diff options
author | Arno <arno@disconnect.de> | 2017-03-06 08:23:51 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2017-03-06 08:23:51 +0100 |
commit | f8029800e3564a194d6c13729620f1d2f450e5e0 (patch) | |
tree | 47c8bf0f75c942c26679833beecda9d4e24ce8f8 /playerwidget.cpp | |
parent | e7616324065c0a96acba082c914e935158380cd2 (diff) | |
download | BeetPlayer-f8029800e3564a194d6c13729620f1d2f450e5e0.tar.gz BeetPlayer-f8029800e3564a194d6c13729620f1d2f450e5e0.tar.bz2 BeetPlayer-f8029800e3564a194d6c13729620f1d2f450e5e0.zip |
Implement help and about dialogs
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r-- | playerwidget.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp index 2ad2246..d32d383 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -18,6 +18,8 @@ #include <QDir> #include <QMimeDatabase> #include <QSettings> +#include <QMenu> +#include <QMessageBox> #include <QApplication> #include <algorithm> @@ -240,6 +242,15 @@ void PlayerWidget::createActions(){ muteA->setCheckable(true); connect(muteA, SIGNAL(triggered(bool)), this, SLOT(mute(bool))); QAction *configA = Globals::instance()->action(Globals::ConfigAction); + QAction *helpA = new QAction(Helper::iconFromQChar(QChar(0x00BF), 50), tr("Help"), this); + QMenu *helpM = new QMenu; + QAction *aboutThisA = new QAction(tr("About..."), this); + connect(aboutThisA, SIGNAL(triggered()), this, SLOT(aboutDlg())); + helpM->addAction(aboutThisA); + QAction *aboutQtA = new QAction(tr("About Qt..."), this); + connect(aboutQtA, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + helpM->addAction(aboutQtA); + helpA->setMenu(helpM); mView->addAction(addToPlayListA); mView->addAction(addToPlayListAndClearA); mView->addAction(Helper::createSeparator(this)); @@ -271,6 +282,8 @@ void PlayerWidget::createActions(){ mToolBar->addAction(muteA); mToolBar->addSeparator(); mToolBar->addAction(configA); + mToolBar->addSeparator(); + mToolBar->addAction(helpA); QWidget* spacer2 = new QWidget(); spacer2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); mToolBar->addWidget(spacer2); @@ -933,3 +946,11 @@ void PlayerWidget::writeSettings(){ s.setValue("volume", mVolumeSlider->value()); s.setValue("folderdir", mCurDir); } + +void PlayerWidget::aboutDlg(){ + QString title = QString(tr("About %1")).arg(qApp->applicationName()); + QString msg; + msg.append(tr("<p>A basic music player without all the fancy stuff implemented in eg. Amarok</p>")); + msg.append(tr("<p>Depends on PostgreSQL, Qt and TagLib")); + QMessageBox::about(this, title, msg); +} |