From fa21d9fd0ee1c2a7bb4acfb754c247e921f3e6dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Oliver=20Gro=C3=9F?= Date: Tue, 8 Jan 2008 16:09:32 +0100 Subject: [PATCH] added about box --- powermanager.cpp | 13 +++++++++++++ powermanager.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/powermanager.cpp b/powermanager.cpp index c9a8b8f..56a4537 100644 --- a/powermanager.cpp +++ b/powermanager.cpp @@ -18,6 +18,7 @@ namespace qbat { m_DefaultTrayIcon(QIcon(UI_ICON_QBAT), this) { m_ContextMenu.addAction(tr("&Settings"))->setEnabled(false); + m_ContextMenu.addAction(tr("&About"), this, SLOT(showAbout())); m_ContextMenu.addSeparator(); m_ContextMenu.addAction(tr("&Quit"), qApp, SLOT(quit())); @@ -78,4 +79,16 @@ namespace qbat { m_DefaultTrayIcon.setVisible(m_BatteryIcons.isEmpty()); } + + void CPowerManager::showAbout() { + QMessageBox aboutBox; + + aboutBox.setWindowIcon(QIcon(UI_ICON_QBAT)); + aboutBox.setIconPixmap(QPixmap(UI_ICON_QBAT)); + aboutBox.setWindowTitle(tr("About QBat")); + aboutBox.setText(UI_NAME + "\nv" + QString(UI_VERSION)); + aboutBox.setStandardButtons(QMessageBox::Ok); + + aboutBox.exec(); + } } diff --git a/powermanager.h b/powermanager.h index 85d2bcf..dc36079 100644 --- a/powermanager.h +++ b/powermanager.h @@ -26,6 +26,8 @@ namespace qbat { public: CPowerManager(QObject * parent = 0); ~CPowerManager(); + public slots: + void showAbout(); }; } -- 2.11.4.GIT