summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2014-04-03 12:41:31 +0900
committerMichele Calgaro <[email protected]>2014-04-03 12:41:31 +0900
commitd473c3a225c869d48cb71a318a401c8ff1b41d45 (patch)
tree21dbf4139f8d9c5030e39d68507f894a722e3c59 /src
parent4f76b9f747650087ea74d14cdcd6afadd4e1dfda (diff)
downloadksensors-d473c3a225c869d48cb71a318a401c8ff1b41d45.tar.gz
ksensors-d473c3a225c869d48cb71a318a401c8ff1b41d45.zip
Added access to handbook from the systray popup menu. This resolves bug 1845.
Diffstat (limited to 'src')
-rw-r--r--src/lmsensorsdock.cpp33
-rw-r--r--src/lmsensorsdock.h3
2 files changed, 28 insertions, 8 deletions
diff --git a/src/lmsensorsdock.cpp b/src/lmsensorsdock.cpp
index b5321ab..bda6c53 100644
--- a/src/lmsensorsdock.cpp
+++ b/src/lmsensorsdock.cpp
@@ -44,22 +44,35 @@ LMSensorsDock::LMSensorsDock(bool fNoDock, TQObject *parent, const char *name):
LMSensorsDock::~LMSensorsDock()
{
- saveConfig();
- if(sensorsWidget) delete sensorsWidget;
- if(sensorsCfg) delete sensorsCfg;
- if(sensorsAlarm) delete sensorsAlarm;
- delete menu;
- if(sensors) delete sensors;
+ saveConfig();
+ if(sensorsWidget)
+ delete sensorsWidget;
+ if(sensorsCfg)
+ delete sensorsCfg;
+ if(sensorsAlarm)
+ delete sensorsAlarm;
+
+ if (helpmenu)
+ {
+ menu->removeItem(helpmenu_id);
+ delete helpmenu;
+ }
+ delete menu;
+ if(sensors) delete sensors;
}
void LMSensorsDock::createMenu()
{
+ helpmenu=new TDEPopupMenu;
+ helpmenu->insertItem(SmallIcon("help"), i18n("&KSensors Handbook"), this, SLOT(showHandbook()));
+ helpmenu->insertItem(kapp->miniIcon(), i18n("&About KSensors"), this, SLOT(showAbout()));
+
menu= new TDEPopupMenu;
menu->insertTitle(kapp->miniIcon(),"KSensors");
menu->insertItem(SmallIcon("configure"),i18n("&Configure"), this, SLOT(createConfigWidget() ) ,0,101 );
menu->insertSeparator();
- menu->insertItem(kapp->miniIcon() ,i18n("&About KSensors"), this, SLOT(showAbout() ) ,0,103 );
+ helpmenu_id=menu->insertItem(SmallIcon("help"), i18n("&Help"), helpmenu);
menu->insertSeparator();
if(!noDock) menu->insertItem(sensorsWidget ? i18n("&Minimize"):i18n("&Restore"), this, SLOT(minimizeRestoreWidget() ) ,0,100 );
menu->insertItem(SmallIcon("exit"),i18n("&Exit"), this, SLOT(close()),0,102);
@@ -199,7 +212,6 @@ void LMSensorsDock::updateItemDock(const char *name)
// }
}
-
void LMSensorsDock::showAbout()
{
TDEAboutApplication *dialog;
@@ -209,3 +221,8 @@ TDEAboutApplication *dialog;
delete dialog;
}
+void LMSensorsDock::showHandbook()
+{
+ kapp->invokeHelp();
+}
+
diff --git a/src/lmsensorsdock.h b/src/lmsensorsdock.h
index a350ef7..01ffc59 100644
--- a/src/lmsensorsdock.h
+++ b/src/lmsensorsdock.h
@@ -62,6 +62,7 @@ protected slots:
void createConfigWidget();
void updateMenu();
void showAbout();
+ void showHandbook();
void close();
private:
@@ -76,6 +77,8 @@ private:
TQGuardedPtr<LMSensorsAlarms> sensorsAlarm;
TDEPopupMenu *menu;
+ TDEPopupMenu *helpmenu;
+ int helpmenu_id;
void createMenu();
void createWidgets();