xconfig: set title bar
PATCH 1/1 xconfig: set title bar
From: Randy Dunlap <[email protected]>
menuconfig and gconfig already place a title (or caption) on the top bar of their window (or whatever that is properly called). However, qconf (xconfig) just says "qconf". I tried to find a Qt API to set the title but did not find one, so set the program title (caption) by using the "-title <caption>" command line option instead.
This can be useful when someone has multiple qconf instances running, to help differentiate which one is which.
--- scripts/kconfig/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kconfig/Makefile +1 -1
@@ -5,7 +5,7 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config xconfig: $(obj)/qconf - $< arch/$(ARCH)/Kconfig + $< arch/$(ARCH)/Kconfig -title "Linux v${KERNELVERSION} qconf" gconfig: $(obj)/gconf $< arch/$(ARCH)/Kconfig
Quoted 7 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
menuconfig and gconfig already place a title (or caption) on the top bar of their window (or whatever that is properly called). However, qconf (xconfig) just says "qconf". I tried to find a Qt API to set the title but did not find one, so set the program title (caption) by using the "-title <caption>" command line option instead.
I found this one to work:
scripts/kconfig/qconf.cc +1 -0
@@ -1277,6 +1277,7 @@ ConfigMainWindow::ConfigMainWindow(void) QWidget *d = configApp->desktop(); + setCaption("hello my little world"); width = configSettings->readNumEntry("/window width", d->width() - 64); height = configSettings->readNumEntry("/window height", d->height() - 64); resize(width, height);
We should show the prompt associated with mainmenu here.
Sam
Quoted 23 lines · Sam Ravnborg
Quoted 7 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
menuconfig and gconfig already place a title (or caption) on the top bar of their window (or whatever that is properly called). However, qconf (xconfig) just says "qconf". I tried to find a Qt API to set the title but did not find one, so set the program title (caption) by using the "-title <caption>" command line option instead.
I found this one to work:
scripts/kconfig/qconf.cc +1
-0@@ -1277,6 +1277,7 @@ ConfigMainWindow::ConfigMainWindow(void) QWidget *d = configApp->desktop(); + setCaption("hello my little world"); width = configSettings->readNumEntry("/window width", d->width() - 64); height = configSettings->readNumEntry("/window height", d->height() - 64); resize(width, height);
Quoted 1 line
We should show the prompt associated with mainmenu here.
After a closer looks it revealed that kconfig does not even save the mainmenu prompt?!??!
See following snippet from zconf.y:
stmt_list:
/* empty */
| stmt_list common_stmt
| stmt_list choice_stmt
| stmt_list menu_stmt
| stmt_list T_MAINMENU prompt nl
So it seems no frontend displays the mainmenu prompt.
Sam
Quoted 30 lines · On Sat, 20 Oct 2007 20:12:02 +0200 Sam Ravnborg wrote:
Quoted 23 lines · Sam Ravnborg
Quoted 7 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
menuconfig and gconfig already place a title (or caption) on the top bar of their window (or whatever that is properly called). However, qconf (xconfig) just says "qconf". I tried to find a Qt API to set the title but did not find one, so set the program title (caption) by using the "-title <caption>" command line option instead.
I found this one to work:
scripts/kconfig/qconf.cc +1
-0@@ -1277,6 +1277,7 @@ ConfigMainWindow::ConfigMainWindow(void) QWidget *d = configApp->desktop(); + setCaption("hello my little world"); width = configSettings->readNumEntry("/window width", d->width() - 64); height = configSettings->readNumEntry("/window height", d->height() - 64); resize(width, height);Quoted 1 line
We should show the prompt associated with mainmenu here.
After a closer looks it revealed that kconfig does not even save the mainmenu prompt?!??!
See following snippet from zconf.y:
Quoted 8 lines
stmt_list:
/* empty */
|stmt_listcommon_stmt
|stmt_listchoice_stmt
|stmt_listmenu_stmt
|stmt_listT_MAINMENUprompt nlSo it seems no frontend displays the mainmenu prompt.
Yes, I was going to make that same comment.
I'll have qconf.cc using the same title as gconfig and menuconfig soon...
---
~Randy
[switched email addr due to some odd mail server problem]
Quoted 2 lines · On Sat, 20 Oct 2007 19:14:03 +0200 Sam Ravnborg wrote:
I found this one to work:
+setCaption("hello my little world");
Thanks, your search expressions were better than mine.
Quoted 1 line
We should show the prompt associated with mainmenu here.
You want all 3 of them converted to
symbol_value(mainmenu) + $KERNELVERSION
?
---
From: Randy Dunlap <[email protected]>
Put kernel version info on title bar in xconfig (qconf) instead of defaulting to "qconf".
--- scripts/kconfig/qconf.cc | 4 ++++ 1 file changed, 4 insertions(+)
scripts/kconfig/qconf.cc +4 -0
@@ -1274,8 +1274,12 @@ ConfigMainWindow::ConfigMainWindow(void) QMenuBar* menu; bool ok; int x, y, width, height; + char title[256]; QWidget *d = configApp->desktop(); + sprintf(title, _("Linux Kernel v%s Configuration"), + getenv("KERNELVERSION")); + setCaption(title); width = configSettings->readNumEntry("/window width", d->width() - 64); height = configSettings->readNumEntry("/window height", d->height() - 64);
Quoted 11 lines · Randy Dunlap
Quoted 2 lines · On Sat, 20 Oct 2007 19:14:03 +0200 Sam Ravnborg wrote:
I found this one to work:
+setCaption("hello my little world");Thanks, your search expressions were better than mine.
Quoted 1 line
We should show the prompt associated with mainmenu here.
You want all 3 of them converted to
symbol_value(mainmenu)+ $KERNELVERSION
Well - if mainmenu should serve any purpose then yes.
Quoted 16 lines
?
---
From: Randy Dunlap <[email protected]>Put kernel version info on title bar in xconfig (qconf) instead of defaulting to "qconf".
Signed-off-by Randy Dunlap <[email protected]>--- scripts/kconfig/qconf.cc | 4 ++++ 1 file changed, 4 insertions(+)
scripts/kconfig/qconf.cc ConfigMainWindow::ConfigMainWindow(void) · line 1280
Quoted 7 lines
scripts/kconfig/qconf.cc +2
-0@@ -1274,8 +1274,12 @@ ConfigMainWindow::ConfigMainWindow(void) QMenuBar* menu; bool ok; int x, y, width, height; + char title[256]; QWidget *d = configApp->desktop(); + sprintf(title, _("Linux Kernel v%s Configuration"),
I made this look like this:
scripts/kconfig/qconf.cc ConfigMainWindow::ConfigMainWindow(void) · line 1281
Quoted 1 line
scripts/kconfig/qconf.cc +1
-0+ snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"),
because we may append to the KERNELVERSION using EXTRAVERSION and people could go insane.
Sam