Commit 37861ffa authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kconfig updates from Michal Marek:

 - 'make xconfig' gui fixes

 - 'make nconfig' fix for options with long prompts

 - fix 'make nconfig' warning when pkg-config forces -D_GNU_SOURCE

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  xconfig: fix missing suboption and help panels on first run
  xconfig: fix 'Show Debug' functionality
  kconfig/nconf: Fix hang when editing symbol with a long prompt
  Scripts: kconfig: nconf: fix _GNU_SOURCE redefined warning
parents 41e0e24b 83c3a1ba
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
* Derived from menuconfig. * Derived from menuconfig.
* *
*/ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE #define _GNU_SOURCE
#endif
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -364,12 +364,14 @@ int dialog_inputbox(WINDOW *main_window, ...@@ -364,12 +364,14 @@ int dialog_inputbox(WINDOW *main_window,
WINDOW *prompt_win; WINDOW *prompt_win;
WINDOW *form_win; WINDOW *form_win;
PANEL *panel; PANEL *panel;
int i, x, y; int i, x, y, lines, columns, win_lines, win_cols;
int res = -1; int res = -1;
int cursor_position = strlen(init); int cursor_position = strlen(init);
int cursor_form_win; int cursor_form_win;
char *result = *resultp; char *result = *resultp;
getmaxyx(stdscr, lines, columns);
if (strlen(init)+1 > *result_len) { if (strlen(init)+1 > *result_len) {
*result_len = strlen(init)+1; *result_len = strlen(init)+1;
*resultp = result = realloc(result, *result_len); *resultp = result = realloc(result, *result_len);
...@@ -386,14 +388,19 @@ int dialog_inputbox(WINDOW *main_window, ...@@ -386,14 +388,19 @@ int dialog_inputbox(WINDOW *main_window,
if (title) if (title)
prompt_width = max(prompt_width, strlen(title)); prompt_width = max(prompt_width, strlen(title));
win_lines = min(prompt_lines+6, lines-2);
win_cols = min(prompt_width+7, columns-2);
prompt_lines = max(win_lines-6, 0);
prompt_width = max(win_cols-7, 0);
/* place dialog in middle of screen */ /* place dialog in middle of screen */
y = (getmaxy(stdscr)-(prompt_lines+4))/2; y = (lines-win_lines)/2;
x = (getmaxx(stdscr)-(prompt_width+4))/2; x = (columns-win_cols)/2;
strncpy(result, init, *result_len); strncpy(result, init, *result_len);
/* create the windows */ /* create the windows */
win = newwin(prompt_lines+6, prompt_width+7, y, x); win = newwin(win_lines, win_cols, y, x);
prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2); prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2);
form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2); form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2);
keypad(form_win, TRUE); keypad(form_win, TRUE);
......
...@@ -65,12 +65,20 @@ ConfigSettings::ConfigSettings() ...@@ -65,12 +65,20 @@ ConfigSettings::ConfigSettings()
QList<int> ConfigSettings::readSizes(const QString& key, bool *ok) QList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
{ {
QList<int> result; QList<int> result;
if (contains(key))
{
QStringList entryList = value(key).toStringList(); QStringList entryList = value(key).toStringList();
QStringList::Iterator it; QStringList::Iterator it;
for (it = entryList.begin(); it != entryList.end(); ++it) for (it = entryList.begin(); it != entryList.end(); ++it)
result.push_back((*it).toInt()); result.push_back((*it).toInt());
*ok = true;
}
else
*ok = false;
return result; return result;
} }
...@@ -1014,7 +1022,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) ...@@ -1014,7 +1022,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
if (!objectName().isEmpty()) { if (!objectName().isEmpty()) {
configSettings->beginGroup(objectName()); configSettings->beginGroup(objectName());
_showDebug = configSettings->value("/showDebug", false).toBool(); setShowDebug(configSettings->value("/showDebug", false).toBool());
configSettings->endGroup(); configSettings->endGroup();
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
} }
...@@ -1474,6 +1482,7 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1474,6 +1482,7 @@ ConfigMainWindow::ConfigMainWindow(void)
optionMenu->addSeparator(); optionMenu->addSeparator();
optionMenu->addActions(optGroup->actions()); optionMenu->addActions(optGroup->actions());
optionMenu->addSeparator(); optionMenu->addSeparator();
optionMenu->addAction(showDebugAction);
// create help menu // create help menu
menu->addSeparator(); menu->addSeparator();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment