Frontend:
authorsmxx
Tue, 23 Feb 2010 00:18:57 +0000
changeset 2847 cde320fd3122
parent 2846 1cb8b4c425ed
child 2848 8a1725b4f724
Frontend: * Fixed nick list's context menu not updating when using keyboard only
QTfrontend/chatwidget.cpp
QTfrontend/chatwidget.h
--- a/QTfrontend/chatwidget.cpp	Mon Feb 22 23:03:50 2010 +0000
+++ b/QTfrontend/chatwidget.cpp	Tue Feb 23 00:18:57 2010 +0000
@@ -78,8 +78,8 @@
 	chatNicks->setContextMenuPolicy(Qt::ActionsContextMenu);
 	connect(chatNicks, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
 		this, SLOT(chatNickDoubleClicked(QListWidgetItem *)));
-	connect(chatNicks, SIGNAL(itemClicked(QListWidgetItem *)),
-		this, SLOT(chatNickClicked(QListWidgetItem *)));
+	connect(chatNicks, SIGNAL(currentRowChanged(int)),
+		this, SLOT(chatNickSelected(int)));
 
 	mainLayout.addWidget(chatNicks, 0, 1);
 
@@ -303,7 +303,8 @@
 		ignoreList << curritem->text().toLower();
 		onChatString(HWChatWidget::tr("%1 *** %2 has been added to your ignore list").arg('\x03').arg(curritem->text()));
 	}
-	updateIcon(curritem);
+	updateIcon(curritem); // update icon
+	chatNickSelected(0); // update context menu
 }
 
 void HWChatWidget::onFriend()
@@ -322,7 +323,8 @@
 		friendsList << curritem->text().toLower();
 		onChatString(HWChatWidget::tr("%1 *** %2 has been added to your friends list").arg('\x03').arg(curritem->text()));
 	}
-	updateIcon(curritem);
+	updateIcon(curritem); // update icon
+	chatNickSelected(0); // update context menu
 }
 
 void HWChatWidget::chatNickDoubleClicked(QListWidgetItem * item)
@@ -330,8 +332,9 @@
 	if (item) onFollow();
 }
 
-void HWChatWidget::chatNickClicked(QListWidgetItem * item)
+void HWChatWidget::chatNickSelected(int index)
 {
+	QListWidgetItem* item = chatNicks->currentItem();
 	if (!item)
 		return;
 
--- a/QTfrontend/chatwidget.h	Mon Feb 22 23:03:50 2010 +0000
+++ b/QTfrontend/chatwidget.h	Tue Feb 23 00:18:57 2010 +0000
@@ -92,7 +92,7 @@
   void onIgnore();
   void onFriend();
   void chatNickDoubleClicked(QListWidgetItem * item);
-  void chatNickClicked(QListWidgetItem * item);
+  void chatNickSelected(int index);
 };
 
 #endif // _CHAT_WIDGET_INCLUDED