summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-03-04 16:02:25 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-03-04 16:02:25 (GMT)
commit3f06fdbf826d8d1c1e243cff5fcbf27870f4f0f8 (patch)
tree1f86916268e3fe659537e1733d4880542967e2a1 /Swift/QtUI/QtMainWindow.cpp
parent0070f96a4ab8770f45a09f5285f427357b955fe2 (diff)
downloadswift-3f06fdbf826d8d1c1e243cff5fcbf27870f4f0f8.zip
swift-3f06fdbf826d8d1c1e243cff5fcbf27870f4f0f8.tar.bz2
Create an edit contact menu item.
Resolves: #769 Release-notes: It is now possible to edit contacts from the standard menus (without needing to right-click on the item).
Diffstat (limited to 'Swift/QtUI/QtMainWindow.cpp')
-rw-r--r--Swift/QtUI/QtMainWindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index 99cbcf5..ca357e3 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -92,6 +92,10 @@ QtMainWindow::QtMainWindow(QtSettingsProvider* settings, UIEventStream* uiEventS
addUserAction_ = new QAction(tr("&Add Contact"), this);
connect(addUserAction_, SIGNAL(triggered(bool)), this, SLOT(handleAddUserActionTriggered(bool)));
actionsMenu->addAction(addUserAction_);
+ editUserAction_ = new QAction(tr("&Edit Selected Contact"), this);
+ connect(editUserAction_, SIGNAL(triggered(bool)), treeWidget_, SLOT(handleEditUserActionTriggered(bool)));
+ actionsMenu->addAction(editUserAction_);
+ editUserAction_->setEnabled(false);
chatUserAction_ = new QAction(tr("Start &Chat"), this);
connect(chatUserAction_, SIGNAL(triggered(bool)), this, SLOT(handleChatUserActionTriggered(bool)));
actionsMenu->addAction(chatUserAction_);
@@ -100,6 +104,8 @@ QtMainWindow::QtMainWindow(QtSettingsProvider* settings, UIEventStream* uiEventS
connect(signOutAction, SIGNAL(triggered()), SLOT(handleSignOutAction()));
actionsMenu->addAction(signOutAction);
+ connect(treeWidget_, SIGNAL(onSomethingSelectedChanged(bool)), editUserAction_, SLOT(setEnabled(bool)));
+
lastOfflineState_ = false;
uiEventStream_->onUIEvent.connect(boost::bind(&QtMainWindow::handleUIEvent, this, _1));
}