summaryrefslogtreecommitdiffstats
path: root/pica-client
diff options
context:
space:
mode:
authorAnton <anton@picapica>2016-09-15 20:01:58 +0400
committerAnton <anton@picapica>2016-09-15 20:01:58 +0400
commit674385ad22cc49084721c6d18052e83e5ad63cc7 (patch)
tree5c50f1fb1915f2903ce9f98d8831c8d4e9f7eeff /pica-client
parent57075f0806f1fcdeef1b5dad8ac4cf61ec7da6e7 (diff)
downloadpica-pica-674385ad22cc49084721c6d18052e83e5ad63cc7.tar.gz
pica-pica-674385ad22cc49084721c6d18052e83e5ad63cc7.zip
calling settings dialog from the menu
Diffstat (limited to 'pica-client')
-rw-r--r--pica-client/mainwindow.cpp3
-rw-r--r--pica-client/mainwindow.h1
-rw-r--r--pica-client/picaactioncenter.cpp10
-rw-r--r--pica-client/picaactioncenter.h3
4 files changed, 17 insertions, 0 deletions
diff --git a/pica-client/mainwindow.cpp b/pica-client/mainwindow.cpp
index 2081dbc..8f4702f 100644
--- a/pica-client/mainwindow.cpp
+++ b/pica-client/mainwindow.cpp
@@ -111,6 +111,9 @@ void MainWindow::createMenus()
nodesMenu=menuBar()->addMenu(tr("&Nodes"));
+ settingsMenu = menuBar()->addMenu(tr("&Settings"));
+ settingsMenu->addAction(action_center->SettingsAct());
+
helpMenu=menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(action_center->AboutAct());
diff --git a/pica-client/mainwindow.h b/pica-client/mainwindow.h
index 4f5ee0d..b61f31a 100644
--- a/pica-client/mainwindow.h
+++ b/pica-client/mainwindow.h
@@ -39,6 +39,7 @@ private:
QMenu *helpMenu;
QMenu *nodesMenu;
QMenu *accountMenu;
+ QMenu *settingsMenu;
bool status_change_disable_flag;
void SetStatus(bool connected);
diff --git a/pica-client/picaactioncenter.cpp b/pica-client/picaactioncenter.cpp
index 7fe5400..1aa09ec 100644
--- a/pica-client/picaactioncenter.cpp
+++ b/pica-client/picaactioncenter.cpp
@@ -7,6 +7,7 @@
#include "accounts.h"
#include "dialogs/showpicaiddialog.h"
#include "sound.h"
+#include "dialogs/settingsdialog.h"
#include <QMessageBox>
@@ -27,6 +28,9 @@ PicaActionCenter::PicaActionCenter(QObject *parent) :
muteSoundsAct = new QAction(tr("&Mute Sounds"), this);
muteSoundsAct->setCheckable(true);
connect(muteSoundsAct, SIGNAL(triggered(bool)), this, SLOT(muteSounds(bool)));
+
+ settingsAct = new QAction(tr("&Configure Messenger..."), this);
+ connect(settingsAct, SIGNAL(triggered(bool)), this, SLOT(showsettings()));
}
void PicaActionCenter::about()
@@ -55,6 +59,12 @@ void PicaActionCenter::exit()
QApplication::instance()->quit();
}
+void PicaActionCenter::showsettings()
+{
+ SettingsDialog sd;
+ sd.exec();
+}
+
void PicaActionCenter::showmyid()
{
ShowPicaIdDialog d(Accounts::GetCurrentAccount().name, Accounts::GetCurrentAccount().id, tr("My Current Account"));
diff --git a/pica-client/picaactioncenter.h b/pica-client/picaactioncenter.h
index 6361d01..7fa98c4 100644
--- a/pica-client/picaactioncenter.h
+++ b/pica-client/picaactioncenter.h
@@ -14,12 +14,14 @@ public:
QAction *ExitAct() {return exitAct;};
QAction *ShowMyIDAct() {return showmyidAct;};
QAction *MuteSoundsAct() {return muteSoundsAct;};
+ QAction *SettingsAct() {return settingsAct; };
private:
QAction *aboutAct;
QAction *exitAct;
QAction *showmyidAct;
QAction *muteSoundsAct;
+ QAction *settingsAct;
signals:
@@ -29,6 +31,7 @@ private slots:
void exit();
void showmyid();
void muteSounds(bool yes);
+ void showsettings();
};
#endif // PICAACTIONCENTER_H