# HG changeset patch # User sheepluva # Date 1296459905 -3600 # Node ID b0610081ee95f60999711086eadaddf7fef410e1 # Parent 43706c0392e75a51e1d10bcaac80b1b0025843b1 nicklist actions: * changed order * double-click will trigger the first action * "follow"-action not available in rooms diff -r 43706c0392e7 -r b0610081ee95 QTfrontend/chatwidget.cpp --- a/QTfrontend/chatwidget.cpp Sun Jan 30 19:02:32 2011 -0500 +++ b/QTfrontend/chatwidget.cpp Mon Jan 31 08:45:05 2011 +0100 @@ -162,12 +162,24 @@ acFriend->setIcon(QIcon(":/res/addfriend.png")); connect(acFriend, SIGNAL(triggered(bool)), this, SLOT(onFriend())); + chatNicks->insertAction(0, acFriend); chatNicks->insertAction(0, acInfo); - chatNicks->insertAction(0, acFollow); chatNicks->insertAction(0, acIgnore); - chatNicks->insertAction(0, acFriend); showReady = false; + setShowFollow(true); +} + +void HWChatWidget::setShowFollow(bool enabled) +{ + if (enabled) { + if (!(chatNicks->actions().contains(acFollow))) + chatNicks->insertAction(acFriend, acFollow); + } + else { + if (chatNicks->actions().contains(acFollow)) + chatNicks->removeAction(acFollow); + } } void HWChatWidget::loadList(QStringList & list, const QString & file) @@ -420,7 +432,8 @@ void HWChatWidget::chatNickDoubleClicked(QListWidgetItem * item) { - if (item) onFollow(); + QList actions = chatNicks->actions(); + actions.first()->activate(QAction::Trigger); } void HWChatWidget::chatNickSelected(int index) diff -r 43706c0392e7 -r b0610081ee95 QTfrontend/chatwidget.h --- a/QTfrontend/chatwidget.h Sun Jan 30 19:02:32 2011 -0500 +++ b/QTfrontend/chatwidget.h Mon Jan 31 08:45:05 2011 +0100 @@ -58,6 +58,7 @@ void loadLists(const QString & nick); void saveLists(const QString & nick); void setShowReady(bool s); + void setShowFollow(bool enabled); private: void loadList(QStringList & list, const QString & file); diff -r 43706c0392e7 -r b0610081ee95 QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Sun Jan 30 19:02:32 2011 -0500 +++ b/QTfrontend/pages.cpp Mon Jan 31 08:45:05 2011 +0100 @@ -984,6 +984,7 @@ // chatwidget pChatWidget = new HWChatWidget(this, gameSettings, sdli, true); pChatWidget->setShowReady(true); // show status bulbs by default + pChatWidget->setShowFollow(false); // don't show follow in nicks' context menus pageLayout->addWidget(pChatWidget, 2, 0, 1, 2); pageLayout->setRowStretch(1, 100);