diff options
author | Karsten Wiese <annabellesgarden@yahoo.de> | 2006-12-13 03:34:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:48 -0500 |
commit | 3b354c557c7a6fcac099b3a20b308853fe596183 (patch) | |
tree | 4489c66167db27bed76aae32b5e815666f0050b5 /scripts/kconfig/qconf.cc | |
parent | bfc10001b11e51b59ac901d17c5f05361bd2351d (diff) |
[PATCH] kconfig: add "void conf_set_changed_callback(void (*fn)(void))", use it in qconf.cc
Added function sets "void (*conf_changed_callback)(void)". Call it, if
.config's changed state changes. Use above in qconf.cc to set gui's
save-widget's sensitvity.
Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r-- | scripts/kconfig/qconf.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 8d60d99bd9f1..0b2fcc417f59 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -38,6 +38,8 @@ | |||
38 | static QApplication *configApp; | 38 | static QApplication *configApp; |
39 | static ConfigSettings *configSettings; | 39 | static ConfigSettings *configSettings; |
40 | 40 | ||
41 | QAction *ConfigMainWindow::saveAction; | ||
42 | |||
41 | static inline QString qgettext(const char* str) | 43 | static inline QString qgettext(const char* str) |
42 | { | 44 | { |
43 | return QString::fromLocal8Bit(gettext(str)); | 45 | return QString::fromLocal8Bit(gettext(str)); |
@@ -1306,8 +1308,11 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1306 | connect(quitAction, SIGNAL(activated()), SLOT(close())); | 1308 | connect(quitAction, SIGNAL(activated()), SLOT(close())); |
1307 | QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this); | 1309 | QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this); |
1308 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); | 1310 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); |
1309 | QAction *saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); | 1311 | saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); |
1310 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); | 1312 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); |
1313 | conf_set_changed_callback(conf_changed); | ||
1314 | // Set saveAction's initial state | ||
1315 | conf_changed(); | ||
1311 | QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this); | 1316 | QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this); |
1312 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); | 1317 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); |
1313 | QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this); | 1318 | QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this); |
@@ -1658,6 +1663,12 @@ void ConfigMainWindow::saveSettings(void) | |||
1658 | configSettings->writeSizes("/split2", split2->sizes()); | 1663 | configSettings->writeSizes("/split2", split2->sizes()); |
1659 | } | 1664 | } |
1660 | 1665 | ||
1666 | void ConfigMainWindow::conf_changed(void) | ||
1667 | { | ||
1668 | if (saveAction) | ||
1669 | saveAction->setEnabled(conf_get_changed()); | ||
1670 | } | ||
1671 | |||
1661 | void fixup_rootmenu(struct menu *menu) | 1672 | void fixup_rootmenu(struct menu *menu) |
1662 | { | 1673 | { |
1663 | struct menu *child; | 1674 | struct menu *child; |