X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferview.cpp;h=936c06369e37e96357a612bd7dfb32416dbcdbde;hp=d2893a8f88c453f621c32eec5a9c02a87dd8f63e;hb=e561e02a8d2f1f009559d17c7b1c66cb6f4e2a5a;hpb=609835c5efa606b9eb63739d50c750dba47c1668 diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index d2893a8f..936c0636 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -79,6 +79,8 @@ BufferView::BufferView(QWidget *parent) _hideQuitAction.setEnabled(false); _hideModeAction.setEnabled(false); + showChannelList.setIcon(QIcon(":/16x16/actions/oxygen/16x16/actions/format-list-unordered.png")); + connect(this, SIGNAL(collapsed(const QModelIndex &)), this, SLOT(on_collapse(const QModelIndex &))); connect(this, SIGNAL(expanded(const QModelIndex &)), this, SLOT(on_expand(const QModelIndex &))); @@ -322,7 +324,7 @@ void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bott return; for(int i = topLeft.row(); i <= bottomRight.row(); i++) { - QModelIndex networkIdx = topLeft.sibling(topLeft.row(), 0); + QModelIndex networkIdx = topLeft.sibling(i, 0); if(model()->rowCount(networkIdx) == 0) continue; @@ -401,6 +403,8 @@ QMenu *BufferView::createHideEventsSubMenu(QMenu &menu) { void BufferView::contextMenuEvent(QContextMenuEvent *event) { QModelIndex index = indexAt(event->pos()); + if(!index.isValid()) + index = rootIndex(); if(!index.isValid()) return; @@ -427,8 +431,8 @@ void BufferView::contextMenuEvent(QContextMenuEvent *event) { _disconnectNetAction.setIcon(connectionStateIcon); _connectNetAction.setIcon(connectionStateIcon); addItemToMenu(showChannelList, contextMenu, index, ActiveState); - addItemToMenu(_disconnectNetAction, contextMenu, index, ActiveState); - addItemToMenu(_connectNetAction, contextMenu, index, InactiveState); + addItemToMenu(_disconnectNetAction, contextMenu, network->connectionState() != Network::Disconnected); + addItemToMenu(_connectNetAction, contextMenu, network->connectionState() == Network::Disconnected); addSeparatorToMenu(contextMenu, index, ActiveState); addItemToMenu(_joinChannelAction, contextMenu, index, ActiveState); break;