[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Using the Modules' aboutData() in KControl
From: Malte.Starostik () t-online ! de (Malte Starostik)
Date: 2001-05-03 0:38:11
[Download RAW message or body]
Hi,
the attached patch adds a menu item to KControl's help menu to show an about
dialog for the currently active module. The item is disabled when no module
is active or it doesn't have a KAboutData. Currently only kcmnotify seems to
have one, but maybe that'll change if it's used for more than just the bug
report dialog...
Any objections?
-Malte
["kcontrol.diff" (text/plain)]
Index: kcontrolui.rc
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/kcontrolui.rc,v
retrieving revision 1.10
diff -u -r1.10 kcontrolui.rc
--- kcontrolui.rc 2001/03/17 01:18:15 1.10
+++ kcontrolui.rc 2001/05/03 00:34:39
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui>
-<kpartgui name="kcontrol" version="1">
+<kpartgui name="kcontrol" version="2">
<MenuBar>
<Menu name="view"><text>&View</text>
<Menu name="view_mode"><text>&Mode</text>
@@ -11,6 +11,9 @@
<Action name="activate_mediumicons"/>
<Action name="activate_largeicons"/>
</Menu>
+ </Menu>
+ <Menu name="help">
+ <Action name="help_about_module" append="about_merge">
</Menu>
</MenuBar>
</kpartgui>
Index: toplevel.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/toplevel.cpp,v
retrieving revision 1.83
diff -u -r1.83 toplevel.cpp
--- toplevel.cpp 2001/03/27 19:19:50 1.83
+++ toplevel.cpp 2001/05/03 00:34:39
@@ -25,6 +25,7 @@
#include <kdebug.h>
#include <kbugreport.h>
#include <kaboutdata.h>
+#include <kaboutapplication.h>
#include <qhbox.h>
#include <qtabwidget.h>
@@ -214,6 +215,9 @@
actionCollection(), "activate_largeicons");
icon_large->setExclusiveGroup( "iconsize" );
+ about_module = new KAction(i18n("About the current Module"), 0, this, \
SLOT(aboutModule()), actionCollection(), "help_about_module"); + \
about_module->setEnabled(false); +
// I need to add this so that each module can get a bug reported,
// and not just KControl
createGUI("kcontrolui.rc");
@@ -350,6 +354,18 @@
// dock it
_dock->dockModule(mod);
+ if (mod->aboutData())
+ {
+ about_module->setText(i18n("Help menu->about <modulename>", \
"About %1").arg(mod->name())); + \
about_module->setIcon(mod->icon()); + \
about_module->setEnabled(true); + }
+ else
+ {
+ about_module->setText(i18n("About the current Module"));
+ about_module->setIconSet(QIconSet());
+ about_module->setEnabled(false);
+ }
break;
}
}
@@ -395,3 +411,10 @@
dummyAbout = 0;
br->show();
}
+
+void TopLevel::aboutModule()
+{
+ KAboutApplication dlg(_active->aboutData());
+ dlg.show();
+}
+
Index: toplevel.h
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/toplevel.h,v
retrieving revision 1.29
diff -u -r1.29 toplevel.h
--- toplevel.h 2001/03/17 01:18:15 1.29
+++ toplevel.h 2001/05/03 00:34:39
@@ -56,6 +56,7 @@
void activateTreeView();
void reportBug();
+ void aboutModule();
void activateSmallIcons();
void activateMediumIcons();
@@ -75,7 +76,7 @@
KToggleAction *tree_view, *icon_view;
KToggleAction *icon_small, *icon_medium, *icon_large;
- KAction *report_bug;
+ KAction *report_bug, *about_module;
IndexWidget *_indextab;
SearchWidget *_searchtab;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic