- : QTreeView(parent),
- showChannelList(tr("Show Channel List"), this),
- _connectNetAction(tr("Connect"), this),
- _disconnectNetAction(tr("Disconnect"), this),
- _joinChannelAction(tr("Join Channel"), this),
-
- _joinBufferAction(tr("Join"), this),
- _partBufferAction(tr("Part"), this),
- _hideBufferTemporarilyAction(tr("Hide buffers"), this),
- _hideBufferPermanentlyAction(tr("Hide buffers permanently"), this),
- _removeBufferAction(tr("Delete buffer"), this),
- _ignoreListAction(tr("Ignore list"), this),
-
- _hideJoinAction(tr("Join Events"), this),
- _hidePartAction(tr("Part Events"), this),
- _hideKillAction(tr("Kill Events"), this),
- _hideQuitAction(tr("Quit Events"), this),
- _hideModeAction(tr("Mode Events"), this)
-
-{
- _hideJoinAction.setCheckable(true);
- _hidePartAction.setCheckable(true);
- _hideKillAction.setCheckable(true);
- _hideQuitAction.setCheckable(true);
- _hideModeAction.setCheckable(true);
- _hideJoinAction.setEnabled(false);
- _hidePartAction.setEnabled(false);
- _ignoreListAction.setEnabled(false);
- _hideKillAction.setEnabled(false);
- _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 &)));
-
- setSelectionMode(QAbstractItemView::ExtendedSelection);
-}
-
-void BufferView::init() {
- setIndentation(10);
- header()->setContextMenuPolicy(Qt::ActionsContextMenu);
- hideColumn(1);
- hideColumn(2);
- expandAll();
-
- setAnimated(true);
+ : QTreeView(parent)
+{
+ connect(this, SIGNAL(collapsed(const QModelIndex &)), SLOT(storeExpandedState(const QModelIndex &)));
+ connect(this, SIGNAL(expanded(const QModelIndex &)), SLOT(storeExpandedState(const QModelIndex &)));
+
+ setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+ QAbstractItemDelegate *oldDelegate = itemDelegate();
+ BufferViewDelegate *tristateDelegate = new BufferViewDelegate(this);
+ setItemDelegate(tristateDelegate);
+ delete oldDelegate;
+}
+
+
+void BufferView::init()
+{
+ header()->setContextMenuPolicy(Qt::ActionsContextMenu);
+ hideColumn(1);
+ hideColumn(2);
+ setIndentation(10);
+
+ expandAll();
+
+ header()->hide(); // nobody seems to use this anyway
+
+ // breaks with Qt 4.8
+ if (QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10!
+ setAnimated(true);
+
+ // FIXME This is to workaround bug #663
+ setUniformRowHeights(true);