X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=6d8aa6bb47af1838d4354de3b31bf9a9df24d005;hp=70e2285206e6ce860eac77e2f797258b92804886;hb=8379f6f725cf8ed2fdad1a19bd10743436c2d086;hpb=99ae722f4f4b427698d07d6476b3b860da7fa09c diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 70e22852..6d8aa6bb 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef HAVE_KDE4 # include @@ -196,6 +197,8 @@ void MainWin::init() connect(Client::coreConnection(), SIGNAL(handleSslErrors(const QSslSocket *, bool *, bool *)), SLOT(handleSslErrors(const QSslSocket *, bool *, bool *))); #endif + connect(this, SIGNAL(changePassword(QString)), Client::instance(), SLOT(changePassword(QString))); + // Setup Dock Areas setDockNestingEnabled(true); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); @@ -410,6 +413,10 @@ void MainWin::setupActions() #endif coll->addAction("ConfigureQuassel", configureQuasselAct); + QAction *changePasswordAct = new Action(QIcon::fromTheme("dialog-password"), tr("&Change password..."), coll, + this, SLOT(showChangePasswordDialog())); + coll->addAction("ChangePassword", changePasswordAct); + // Help QAction *aboutQuasselAct = new Action(QIcon(":/icons/quassel.png"), tr("&About Quassel"), coll, this, SLOT(showAboutDlg())); @@ -552,8 +559,10 @@ void MainWin::setupMenus() #else _settingsMenu->addAction(coll->action("ConfigureShortcuts")); #endif + _settingsMenu->addAction(coll->action("ChangePassword")); _settingsMenu->addAction(coll->action("ConfigureQuassel")); + _helpMenu = menuBar()->addMenu(tr("&Help")); _helpMenu->addAction(coll->action("AboutQuassel")); @@ -731,6 +740,15 @@ void MainWin::changeActiveBufferView(int bufferViewId) nextBufferView(); // fallback } +void MainWin::showChangePasswordDialog() +{ + bool ok; + QString newPassword = QInputDialog::getText(this, tr("Set new password"), tr("New password:"), QLineEdit::Password, QString(), &ok); + if (ok && !newPassword.isEmpty()) { + emit changePassword(newPassword); + } +} + void MainWin::changeActiveBufferView(bool backwards) {