this, SLOT(nextBuffer()), QKeySequence(Qt::ALT + Qt::Key_Down)));
coll->addAction("PreviousBuffer", new Action(SmallIcon("go-up"), tr("Go to Previous Chat"), coll,
this, SLOT(previousBuffer()), QKeySequence(Qt::ALT + Qt::Key_Up)));
+ coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll,
+ this, SLOT(hideCurrentBuffer()), QKeySequence(Qt::ControlModifier + Qt::Key_W)));
}
void MainWin::setupMenus() {
view->previousBuffer();
}
+void MainWin::hideCurrentBuffer() {
+ BufferView *view = activeBufferView();
+ if(view)
+ view->hideCurrentBuffer();
+}
+
void MainWin::showNotificationsDlg() {
SettingsPageDlg dlg(new NotificationsSettingsPage(this), this);
dlg.exec();
public slots:
void showStatusBarMessage(const QString &message);
+ void hideCurrentBuffer();
void nextBufferView(); //!< Activate the next bufferview
void previousBufferView(); //!< Activate the previous bufferview
void nextBuffer();
changeBuffer((Direction)rowDelta);
}
+void BufferView::hideCurrentBuffer() {
+ QModelIndex index = selectionModel()->currentIndex();
+ if(index.data(NetworkModel::ItemTypeRole) != NetworkModel::BufferItemType)
+ return;
+
+ BufferId bufferId = index.data(NetworkModel::BufferIdRole).value<BufferId>();
+
+ //The check above means we won't be looking at a network, which should always be the first row, so we can just go backwards.
+ changeBuffer(Backward);
+
+ /*if(removedRows.contains(bufferId))
+ continue;
+
+ removedRows << bufferId;*/
+ /*if(permanently)
+ config()->requestRemoveBufferPermanently(bufferId);
+ else*/
+ config()->requestRemoveBuffer(bufferId);
+}
+
QSize BufferView::sizeHint() const {
return QTreeView::sizeHint();
void menuActionTriggered(QAction *);
void nextBuffer();
void previousBuffer();
+ void hideCurrentBuffer();
signals:
void removeBuffer(const QModelIndex &);