1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
4 * Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>
11 #include <qtextbrowser.h>
13 #include <QFileDialog>
16 #include <qapplication.h>
17 #include <qdesktopwidget.h>
20 #include <qsplitter.h>
21 #include <qlineedit.h>
23 #include <qpushbutton.h>
25 #include <qmessagebox.h>
38 static QApplication
*configApp
;
39 static ConfigSettings
*configSettings
;
41 QAction
*ConfigMainWindow::saveAction
;
43 static inline QString
qgettext(const char* str
)
45 return QString::fromLocal8Bit(str
);
48 ConfigSettings::ConfigSettings()
49 : QSettings("kernel.org", "qconf")
54 * Reads a list of integer values from the application settings.
56 QList
<int> ConfigSettings::readSizes(const QString
& key
, bool *ok
)
62 QStringList entryList
= value(key
).toStringList();
63 QStringList::Iterator it
;
65 for (it
= entryList
.begin(); it
!= entryList
.end(); ++it
)
66 result
.push_back((*it
).toInt());
77 * Writes a list of integer values to the application settings.
79 bool ConfigSettings::writeSizes(const QString
& key
, const QList
<int>& value
)
81 QStringList stringList
;
82 QList
<int>::ConstIterator it
;
84 for (it
= value
.begin(); it
!= value
.end(); ++it
)
85 stringList
.push_back(QString::number(*it
));
86 setValue(key
, stringList
);
94 * TODO check the value
96 void ConfigItem::okRename(int col
)
101 * update the displayed of a menu entry
103 void ConfigItem::updateMenu(void)
107 struct property
*prop
;
114 setPixmap(promptColIdx
, list
->menuBackPix
);
121 prompt
= qgettext(menu_get_prompt(menu
));
123 if (prop
) switch (prop
->type
) {
125 if (list
->mode
== singleMode
|| list
->mode
== symbolMode
) {
126 /* a menuconfig entry is displayed differently
127 * depending whether it's at the view root or a child.
129 if (sym
&& list
->rootEntry
== menu
)
131 setPixmap(promptColIdx
, list
->menuPix
);
135 setPixmap(promptColIdx
, QIcon());
139 setPixmap(promptColIdx
, QIcon());
147 setText(nameColIdx
, QString::fromLocal8Bit(sym
->name
));
149 type
= sym_get_type(sym
);
155 if (!sym_is_changeable(sym
) && list
->optMode
== normalOpt
) {
156 setPixmap(promptColIdx
, QIcon());
157 setText(noColIdx
, QString());
158 setText(modColIdx
, QString());
159 setText(yesColIdx
, QString());
162 expr
= sym_get_tristate_value(sym
);
165 if (sym_is_choice_value(sym
) && type
== S_BOOLEAN
)
166 setPixmap(promptColIdx
, list
->choiceYesPix
);
168 setPixmap(promptColIdx
, list
->symbolYesPix
);
169 setText(yesColIdx
, "Y");
173 setPixmap(promptColIdx
, list
->symbolModPix
);
174 setText(modColIdx
, "M");
178 if (sym_is_choice_value(sym
) && type
== S_BOOLEAN
)
179 setPixmap(promptColIdx
, list
->choiceNoPix
);
181 setPixmap(promptColIdx
, list
->symbolNoPix
);
182 setText(noColIdx
, "N");
187 setText(noColIdx
, sym_tristate_within_range(sym
, no
) ? "_" : 0);
189 setText(modColIdx
, sym_tristate_within_range(sym
, mod
) ? "_" : 0);
191 setText(yesColIdx
, sym_tristate_within_range(sym
, yes
) ? "_" : 0);
193 setText(dataColIdx
, QChar(ch
));
200 data
= sym_get_string_value(sym
);
202 setText(dataColIdx
, data
);
203 if (type
== S_STRING
)
204 prompt
= QString("%1: %2").arg(prompt
).arg(data
);
206 prompt
= QString("(%2) %1").arg(prompt
).arg(data
);
209 if (!sym_has_value(sym
) && visible
)
212 setText(promptColIdx
, prompt
);
215 void ConfigItem::testUpdateMenu(bool v
)
223 sym_calc_value(menu
->sym
);
224 if (menu
->flags
& MENU_CHANGED
) {
225 /* the menu entry changed, so update all list items */
226 menu
->flags
&= ~MENU_CHANGED
;
227 for (i
= (ConfigItem
*)menu
->data
; i
; i
= i
->nextItem
)
229 } else if (listView()->updateAll
)
235 * construct a menu entry
237 void ConfigItem::init(void)
240 ConfigList
* list
= listView();
241 nextItem
= (ConfigItem
*)menu
->data
;
244 if (list
->mode
!= fullMode
)
246 sym_calc_value(menu
->sym
);
252 * destruct a menu entry
254 ConfigItem::~ConfigItem(void)
257 ConfigItem
** ip
= (ConfigItem
**)&menu
->data
;
258 for (; *ip
; ip
= &(*ip
)->nextItem
) {
267 ConfigLineEdit::ConfigLineEdit(ConfigView
* parent
)
270 connect(this, SIGNAL(editingFinished()), SLOT(hide()));
273 void ConfigLineEdit::show(ConfigItem
* i
)
276 if (sym_get_string_value(item
->menu
->sym
))
277 setText(QString::fromLocal8Bit(sym_get_string_value(item
->menu
->sym
)));
284 void ConfigLineEdit::keyPressEvent(QKeyEvent
* e
)
291 sym_set_string_value(item
->menu
->sym
, text().toLatin1());
292 parent()->updateList(item
);
295 Parent::keyPressEvent(e
);
299 parent()->list
->setFocus();
303 ConfigList::ConfigList(ConfigView
* p
, const char *name
)
306 symbolYesPix(xpm_symbol_yes
), symbolModPix(xpm_symbol_mod
), symbolNoPix(xpm_symbol_no
),
307 choiceYesPix(xpm_choice_yes
), choiceNoPix(xpm_choice_no
),
308 menuPix(xpm_menu
), menuInvPix(xpm_menu_inv
), menuBackPix(xpm_menuback
), voidPix(xpm_void
),
309 showName(false), showRange(false), showData(false), mode(singleMode
), optMode(normalOpt
),
310 rootEntry(0), headerPopup(0)
313 setSortingEnabled(false);
314 setRootIsDecorated(true);
316 setVerticalScrollMode(ScrollPerPixel
);
317 setHorizontalScrollMode(ScrollPerPixel
);
319 if (mode
== symbolMode
)
320 setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value");
322 setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
324 connect(this, SIGNAL(itemSelectionChanged(void)),
325 SLOT(updateSelection(void)));
328 configSettings
->beginGroup(name
);
329 showName
= configSettings
->value("/showName", false).toBool();
330 showRange
= configSettings
->value("/showRange", false).toBool();
331 showData
= configSettings
->value("/showData", false).toBool();
332 optMode
= (enum optionMode
)configSettings
->value("/optionMode", 0).toInt();
333 configSettings
->endGroup();
334 connect(configApp
, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
337 addColumn(promptColIdx
);
342 bool ConfigList::menuSkip(struct menu
*menu
)
344 if (optMode
== normalOpt
&& menu_is_visible(menu
))
346 if (optMode
== promptOpt
&& menu_has_prompt(menu
))
348 if (optMode
== allOpt
)
353 void ConfigList::reinit(void)
355 removeColumn(dataColIdx
);
356 removeColumn(yesColIdx
);
357 removeColumn(modColIdx
);
358 removeColumn(noColIdx
);
359 removeColumn(nameColIdx
);
362 addColumn(nameColIdx
);
365 addColumn(modColIdx
);
366 addColumn(yesColIdx
);
369 addColumn(dataColIdx
);
374 void ConfigList::saveSettings(void)
376 if (!objectName().isEmpty()) {
377 configSettings
->beginGroup(objectName());
378 configSettings
->setValue("/showName", showName
);
379 configSettings
->setValue("/showRange", showRange
);
380 configSettings
->setValue("/showData", showData
);
381 configSettings
->setValue("/optionMode", (int)optMode
);
382 configSettings
->endGroup();
386 ConfigItem
* ConfigList::findConfigItem(struct menu
*menu
)
388 ConfigItem
* item
= (ConfigItem
*)menu
->data
;
390 for (; item
; item
= item
->nextItem
) {
391 if (this == item
->listView())
398 void ConfigList::updateSelection(void)
403 if (mode
== symbolMode
)
404 setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value");
406 setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
408 if (selectedItems().count() == 0)
411 ConfigItem
* item
= (ConfigItem
*)selectedItems().first();
416 emit
menuChanged(menu
);
419 type
= menu
->prompt
? menu
->prompt
->type
: P_UNKNOWN
;
420 if (mode
== menuMode
&& type
== P_MENU
)
421 emit
menuSelected(menu
);
424 void ConfigList::updateList(ConfigItem
* item
)
426 ConfigItem
* last
= 0;
429 if (mode
!= listMode
)
431 QTreeWidgetItemIterator
it(this);
435 item
= (ConfigItem
*)(*it
);
438 item
->testUpdateMenu(menu_is_visible(item
->menu
));
445 if (rootEntry
!= &rootmenu
&& (mode
== singleMode
||
446 (mode
== symbolMode
&& rootEntry
->parent
!= &rootmenu
))) {
447 item
= (ConfigItem
*)topLevelItem(0);
449 item
= new ConfigItem(this, 0, true);
452 if ((mode
== singleMode
|| (mode
== symbolMode
&& !(rootEntry
->flags
& MENU_ROOT
))) &&
453 rootEntry
->sym
&& rootEntry
->prompt
) {
454 item
= last
? last
->nextSibling() : firstChild();
456 item
= new ConfigItem(this, last
, rootEntry
, true);
458 item
->testUpdateMenu(true);
460 updateMenuList(item
, rootEntry
);
462 resizeColumnToContents(0);
466 updateMenuList(this, rootEntry
);
468 resizeColumnToContents(0);
471 void ConfigList::setValue(ConfigItem
* item
, tristate val
)
477 sym
= item
->menu
? item
->menu
->sym
: 0;
481 type
= sym_get_type(sym
);
485 oldval
= sym_get_tristate_value(sym
);
487 if (!sym_set_tristate_value(sym
, val
))
489 if (oldval
== no
&& item
->menu
->list
)
490 item
->setExpanded(true);
491 parent()->updateList(item
);
496 void ConfigList::changeValue(ConfigItem
* item
)
500 int type
, oldexpr
, newexpr
;
507 if (item
->menu
->list
)
508 item
->setExpanded(!item
->isExpanded());
512 type
= sym_get_type(sym
);
516 oldexpr
= sym_get_tristate_value(sym
);
517 newexpr
= sym_toggle_tristate_value(sym
);
518 if (item
->menu
->list
) {
519 if (oldexpr
== newexpr
)
520 item
->setExpanded(!item
->isExpanded());
521 else if (oldexpr
== no
)
522 item
->setExpanded(true);
524 if (oldexpr
!= newexpr
)
525 parent()->updateList(item
);
530 parent()->lineEdit
->show(item
);
535 void ConfigList::setRootMenu(struct menu
*menu
)
539 if (rootEntry
== menu
)
541 type
= menu
&& menu
->prompt
? menu
->prompt
->type
: P_UNKNOWN
;
544 updateMenuList(this, 0);
548 currentItem()->setSelected(hasFocus());
549 scrollToItem(currentItem());
553 void ConfigList::setParentMenu(void)
556 struct menu
*oldroot
;
559 if (rootEntry
== &rootmenu
)
561 setRootMenu(menu_get_parent_menu(rootEntry
->parent
));
563 QTreeWidgetItemIterator
it(this);
565 item
= (ConfigItem
*)(*it
);
566 if (item
->menu
== oldroot
) {
567 setCurrentItem(item
);
577 * update all the children of a menu entry
578 * removes/adds the entries from the parent widget as necessary
580 * parent: either the menu list widget or a menu entry widget
581 * menu: entry to be updated
583 void ConfigList::updateMenuList(ConfigItem
*parent
, struct menu
* menu
)
592 while (parent
->childCount() > 0)
594 delete parent
->takeChild(0);
600 last
= parent
->firstChild();
601 if (last
&& !last
->goParent
)
603 for (child
= menu
->list
; child
; child
= child
->next
) {
604 item
= last
? last
->nextSibling() : parent
->firstChild();
605 type
= child
->prompt
? child
->prompt
->type
: P_UNKNOWN
;
609 if (!(child
->flags
& MENU_ROOT
))
613 if (child
->flags
& MENU_ROOT
)
620 visible
= menu_is_visible(child
);
621 if (!menuSkip(child
)) {
622 if (!child
->sym
&& !child
->list
&& !child
->prompt
)
624 if (!item
|| item
->menu
!= child
)
625 item
= new ConfigItem(parent
, last
, child
, visible
);
627 item
->testUpdateMenu(visible
);
629 if (mode
== fullMode
|| mode
== menuMode
|| type
!= P_MENU
)
630 updateMenuList(item
, child
);
632 updateMenuList(item
, 0);
637 if (item
&& item
->menu
== child
) {
638 last
= parent
->firstChild();
641 else while (last
->nextSibling() != item
)
642 last
= last
->nextSibling();
648 void ConfigList::updateMenuList(ConfigList
*parent
, struct menu
* menu
)
657 while (parent
->topLevelItemCount() > 0)
659 delete parent
->takeTopLevelItem(0);
665 last
= (ConfigItem
*)parent
->topLevelItem(0);
666 if (last
&& !last
->goParent
)
668 for (child
= menu
->list
; child
; child
= child
->next
) {
669 item
= last
? last
->nextSibling() : (ConfigItem
*)parent
->topLevelItem(0);
670 type
= child
->prompt
? child
->prompt
->type
: P_UNKNOWN
;
674 if (!(child
->flags
& MENU_ROOT
))
678 if (child
->flags
& MENU_ROOT
)
685 visible
= menu_is_visible(child
);
686 if (!menuSkip(child
)) {
687 if (!child
->sym
&& !child
->list
&& !child
->prompt
)
689 if (!item
|| item
->menu
!= child
)
690 item
= new ConfigItem(parent
, last
, child
, visible
);
692 item
->testUpdateMenu(visible
);
694 if (mode
== fullMode
|| mode
== menuMode
|| type
!= P_MENU
)
695 updateMenuList(item
, child
);
697 updateMenuList(item
, 0);
702 if (item
&& item
->menu
== child
) {
703 last
= (ConfigItem
*)parent
->topLevelItem(0);
706 else while (last
->nextSibling() != item
)
707 last
= last
->nextSibling();
713 void ConfigList::keyPressEvent(QKeyEvent
* ev
)
715 QTreeWidgetItem
* i
= currentItem();
720 if (ev
->key() == Qt::Key_Escape
&& mode
!= fullMode
&& mode
!= listMode
) {
721 emit
parentSelected();
727 Parent::keyPressEvent(ev
);
730 item
= (ConfigItem
*)i
;
735 if (item
->goParent
) {
736 emit
parentSelected();
742 type
= menu
->prompt
? menu
->prompt
->type
: P_UNKNOWN
;
743 if (type
== P_MENU
&& rootEntry
!= menu
&&
744 mode
!= fullMode
&& mode
!= menuMode
) {
745 if (mode
== menuMode
)
746 emit
menuSelected(menu
);
748 emit
itemSelected(menu
);
764 Parent::keyPressEvent(ev
);
770 void ConfigList::mousePressEvent(QMouseEvent
* e
)
772 //QPoint p(contentsToViewport(e->pos()));
773 //printf("contentsMousePressEvent: %d,%d\n", p.x(), p.y());
774 Parent::mousePressEvent(e
);
777 void ConfigList::mouseReleaseEvent(QMouseEvent
* e
)
780 ConfigItem
* item
= (ConfigItem
*)itemAt(p
);
782 enum prop_type ptype
;
790 x
= header()->offset() + p
.x();
791 idx
= header()->logicalIndexAt(x
);
794 icon
= item
->pixmap(promptColIdx
);
795 if (!icon
.isNull()) {
796 int off
= header()->sectionPosition(0) + visualRect(indexAt(p
)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly.
797 if (x
>= off
&& x
< off
+ icon
.availableSizes().first().width()) {
798 if (item
->goParent
) {
799 emit
parentSelected();
803 ptype
= menu
->prompt
? menu
->prompt
->type
: P_UNKNOWN
;
804 if (ptype
== P_MENU
&& rootEntry
!= menu
&&
805 mode
!= fullMode
&& mode
!= menuMode
)
806 emit
menuSelected(menu
);
827 //printf("contentsMouseReleaseEvent: %d,%d\n", p.x(), p.y());
828 Parent::mouseReleaseEvent(e
);
831 void ConfigList::mouseMoveEvent(QMouseEvent
* e
)
833 //QPoint p(contentsToViewport(e->pos()));
834 //printf("contentsMouseMoveEvent: %d,%d\n", p.x(), p.y());
835 Parent::mouseMoveEvent(e
);
838 void ConfigList::mouseDoubleClickEvent(QMouseEvent
* e
)
841 ConfigItem
* item
= (ConfigItem
*)itemAt(p
);
843 enum prop_type ptype
;
847 if (item
->goParent
) {
848 emit
parentSelected();
854 ptype
= menu
->prompt
? menu
->prompt
->type
: P_UNKNOWN
;
855 if (ptype
== P_MENU
) {
856 if (mode
== singleMode
)
857 emit
itemSelected(menu
);
858 else if (mode
== symbolMode
)
859 emit
menuSelected(menu
);
860 } else if (menu
->sym
)
864 //printf("contentsMouseDoubleClickEvent: %d,%d\n", p.x(), p.y());
865 Parent::mouseDoubleClickEvent(e
);
868 void ConfigList::focusInEvent(QFocusEvent
*e
)
870 struct menu
*menu
= NULL
;
872 Parent::focusInEvent(e
);
874 ConfigItem
* item
= (ConfigItem
*)currentItem();
876 item
->setSelected(true);
882 void ConfigList::contextMenuEvent(QContextMenuEvent
*e
)
884 if (e
->y() <= header()->geometry().bottom()) {
888 headerPopup
= new QMenu(this);
889 action
= new QAction("Show Name", this);
890 action
->setCheckable(true);
891 connect(action
, SIGNAL(toggled(bool)),
892 parent(), SLOT(setShowName(bool)));
893 connect(parent(), SIGNAL(showNameChanged(bool)),
894 action
, SLOT(setOn(bool)));
895 action
->setChecked(showName
);
896 headerPopup
->addAction(action
);
897 action
= new QAction("Show Range", this);
898 action
->setCheckable(true);
899 connect(action
, SIGNAL(toggled(bool)),
900 parent(), SLOT(setShowRange(bool)));
901 connect(parent(), SIGNAL(showRangeChanged(bool)),
902 action
, SLOT(setOn(bool)));
903 action
->setChecked(showRange
);
904 headerPopup
->addAction(action
);
905 action
= new QAction("Show Data", this);
906 action
->setCheckable(true);
907 connect(action
, SIGNAL(toggled(bool)),
908 parent(), SLOT(setShowData(bool)));
909 connect(parent(), SIGNAL(showDataChanged(bool)),
910 action
, SLOT(setOn(bool)));
911 action
->setChecked(showData
);
912 headerPopup
->addAction(action
);
914 headerPopup
->exec(e
->globalPos());
920 ConfigView
*ConfigView::viewList
;
921 QAction
*ConfigView::showNormalAction
;
922 QAction
*ConfigView::showAllAction
;
923 QAction
*ConfigView::showPromptAction
;
925 ConfigView::ConfigView(QWidget
* parent
, const char *name
)
929 QVBoxLayout
*verticalLayout
= new QVBoxLayout(this);
930 verticalLayout
->setContentsMargins(0, 0, 0, 0);
932 list
= new ConfigList(this);
933 verticalLayout
->addWidget(list
);
934 lineEdit
= new ConfigLineEdit(this);
936 verticalLayout
->addWidget(lineEdit
);
938 this->nextView
= viewList
;
942 ConfigView::~ConfigView(void)
946 for (vp
= &viewList
; *vp
; vp
= &(*vp
)->nextView
) {
954 void ConfigView::setOptionMode(QAction
*act
)
956 if (act
== showNormalAction
)
957 list
->optMode
= normalOpt
;
958 else if (act
== showAllAction
)
959 list
->optMode
= allOpt
;
961 list
->optMode
= promptOpt
;
963 list
->updateListAll();
966 void ConfigView::setShowName(bool b
)
968 if (list
->showName
!= b
) {
971 emit
showNameChanged(b
);
975 void ConfigView::setShowRange(bool b
)
977 if (list
->showRange
!= b
) {
980 emit
showRangeChanged(b
);
984 void ConfigView::setShowData(bool b
)
986 if (list
->showData
!= b
) {
989 emit
showDataChanged(b
);
993 void ConfigList::setAllOpen(bool open
)
995 QTreeWidgetItemIterator
it(this);
998 (*it
)->setExpanded(open
);
1004 void ConfigView::updateList(ConfigItem
* item
)
1008 for (v
= viewList
; v
; v
= v
->nextView
)
1009 v
->list
->updateList(item
);
1012 void ConfigView::updateListAll(void)
1016 for (v
= viewList
; v
; v
= v
->nextView
)
1017 v
->list
->updateListAll();
1020 ConfigInfoView::ConfigInfoView(QWidget
* parent
, const char *name
)
1021 : Parent(parent
), sym(0), _menu(0)
1023 setObjectName(name
);
1026 if (!objectName().isEmpty()) {
1027 configSettings
->beginGroup(objectName());
1028 setShowDebug(configSettings
->value("/showDebug", false).toBool());
1029 configSettings
->endGroup();
1030 connect(configApp
, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
1034 void ConfigInfoView::saveSettings(void)
1036 if (!objectName().isEmpty()) {
1037 configSettings
->beginGroup(objectName());
1038 configSettings
->setValue("/showDebug", showDebug());
1039 configSettings
->endGroup();
1043 void ConfigInfoView::setShowDebug(bool b
)
1045 if (_showDebug
!= b
) {
1051 emit
showDebugChanged(b
);
1055 void ConfigInfoView::setInfo(struct menu
*m
)
1067 void ConfigInfoView::symbolInfo(void)
1071 str
+= "<big>Symbol: <b>";
1072 str
+= print_filter(sym
->name
);
1073 str
+= "</b></big><br><br>value: ";
1074 str
+= print_filter(sym_get_string_value(sym
));
1075 str
+= "<br>visibility: ";
1076 str
+= sym
->visible
== yes
? "y" : sym
->visible
== mod
? "m" : "n";
1078 str
+= debug_info(sym
);
1083 void ConfigInfoView::menuInfo(void)
1086 QString head
, debug
, help
;
1090 if (_menu
->prompt
) {
1092 head
+= print_filter(_menu
->prompt
->text
);
1093 head
+= "</b></big>";
1097 head
+= QString().sprintf("<a href=\"s%p\">", sym
);
1098 head
+= print_filter(sym
->name
);
1103 } else if (sym
->name
) {
1106 head
+= QString().sprintf("<a href=\"s%p\">", sym
);
1107 head
+= print_filter(sym
->name
);
1110 head
+= "</b></big>";
1115 debug
= debug_info(sym
);
1117 struct gstr help_gstr
= str_new();
1118 menu_get_ext_help(_menu
, &help_gstr
);
1119 help
= print_filter(str_get(&help_gstr
));
1120 str_free(&help_gstr
);
1121 } else if (_menu
->prompt
) {
1123 head
+= print_filter(_menu
->prompt
->text
);
1124 head
+= "</b></big><br><br>";
1126 if (_menu
->prompt
->visible
.expr
) {
1127 debug
+= " dep: ";
1128 expr_print(_menu
->prompt
->visible
.expr
, expr_print_help
, &debug
, E_NONE
);
1129 debug
+= "<br><br>";
1134 debug
+= QString().sprintf("defined at %s:%d<br><br>", _menu
->file
->name
, _menu
->lineno
);
1136 setText(head
+ debug
+ help
);
1139 QString
ConfigInfoView::debug_info(struct symbol
*sym
)
1144 debug
+= print_filter(sym_type_name(sym
->type
));
1145 if (sym_is_choice(sym
))
1146 debug
+= " (choice)";
1148 if (sym
->rev_dep
.expr
) {
1149 debug
+= "reverse dep: ";
1150 expr_print(sym
->rev_dep
.expr
, expr_print_help
, &debug
, E_NONE
);
1153 for (struct property
*prop
= sym
->prop
; prop
; prop
= prop
->next
) {
1154 switch (prop
->type
) {
1157 debug
+= QString().sprintf("prompt: <a href=\"m%p\">", prop
->menu
);
1158 debug
+= print_filter(prop
->text
);
1159 debug
+= "</a><br>";
1164 debug
+= prop_get_type_name(prop
->type
);
1166 expr_print(prop
->expr
, expr_print_help
, &debug
, E_NONE
);
1170 if (sym_is_choice(sym
)) {
1171 debug
+= "choice: ";
1172 expr_print(prop
->expr
, expr_print_help
, &debug
, E_NONE
);
1177 debug
+= "unknown property: ";
1178 debug
+= prop_get_type_name(prop
->type
);
1181 if (prop
->visible
.expr
) {
1182 debug
+= " dep: ";
1183 expr_print(prop
->visible
.expr
, expr_print_help
, &debug
, E_NONE
);
1192 QString
ConfigInfoView::print_filter(const QString
&str
)
1194 QRegExp
re("[<>&\"\\n]");
1196 for (int i
= 0; (i
= res
.indexOf(re
, i
)) >= 0;) {
1197 switch (res
[i
].toLatin1()) {
1199 res
.replace(i
, 1, "<");
1203 res
.replace(i
, 1, ">");
1207 res
.replace(i
, 1, "&");
1211 res
.replace(i
, 1, """);
1215 res
.replace(i
, 1, "<br>");
1223 void ConfigInfoView::expr_print_help(void *data
, struct symbol
*sym
, const char *str
)
1225 QString
* text
= reinterpret_cast<QString
*>(data
);
1226 QString str2
= print_filter(str
);
1228 if (sym
&& sym
->name
&& !(sym
->flags
& SYMBOL_CONST
)) {
1229 *text
+= QString().sprintf("<a href=\"s%p\">", sym
);
1236 QMenu
* ConfigInfoView::createStandardContextMenu(const QPoint
& pos
)
1238 QMenu
* popup
= Parent::createStandardContextMenu(pos
);
1239 QAction
* action
= new QAction("Show Debug Info", popup
);
1241 action
->setCheckable(true);
1242 connect(action
, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1243 connect(this, SIGNAL(showDebugChanged(bool)), action
, SLOT(setOn(bool)));
1244 action
->setChecked(showDebug());
1245 popup
->addSeparator();
1246 popup
->addAction(action
);
1250 void ConfigInfoView::contextMenuEvent(QContextMenuEvent
*e
)
1252 Parent::contextMenuEvent(e
);
1255 ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow
* parent
, const char *name
)
1256 : Parent(parent
), result(NULL
)
1258 setObjectName(name
);
1259 setWindowTitle("Search Config");
1261 QVBoxLayout
* layout1
= new QVBoxLayout(this);
1262 layout1
->setContentsMargins(11, 11, 11, 11);
1263 layout1
->setSpacing(6);
1264 QHBoxLayout
* layout2
= new QHBoxLayout(0);
1265 layout2
->setContentsMargins(0, 0, 0, 0);
1266 layout2
->setSpacing(6);
1267 layout2
->addWidget(new QLabel("Find:", this));
1268 editField
= new QLineEdit(this);
1269 connect(editField
, SIGNAL(returnPressed()), SLOT(search()));
1270 layout2
->addWidget(editField
);
1271 searchButton
= new QPushButton("Search", this);
1272 searchButton
->setAutoDefault(false);
1273 connect(searchButton
, SIGNAL(clicked()), SLOT(search()));
1274 layout2
->addWidget(searchButton
);
1275 layout1
->addLayout(layout2
);
1277 split
= new QSplitter(this);
1278 split
->setOrientation(Qt::Vertical
);
1279 list
= new ConfigView(split
, name
);
1280 list
->list
->mode
= listMode
;
1281 info
= new ConfigInfoView(split
, name
);
1282 connect(list
->list
, SIGNAL(menuChanged(struct menu
*)),
1283 info
, SLOT(setInfo(struct menu
*)));
1284 connect(list
->list
, SIGNAL(menuChanged(struct menu
*)),
1285 parent
, SLOT(setMenuLink(struct menu
*)));
1287 layout1
->addWidget(split
);
1294 configSettings
->beginGroup(name
);
1295 width
= configSettings
->value("/window width", parent
->width() / 2).toInt();
1296 height
= configSettings
->value("/window height", parent
->height() / 2).toInt();
1297 resize(width
, height
);
1298 x
= configSettings
->value("/window x");
1299 y
= configSettings
->value("/window y");
1300 if ((x
.isValid())&&(y
.isValid()))
1301 move(x
.toInt(), y
.toInt());
1302 QList
<int> sizes
= configSettings
->readSizes("/split", &ok
);
1304 split
->setSizes(sizes
);
1305 configSettings
->endGroup();
1306 connect(configApp
, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
1310 void ConfigSearchWindow::saveSettings(void)
1312 if (!objectName().isEmpty()) {
1313 configSettings
->beginGroup(objectName());
1314 configSettings
->setValue("/window x", pos().x());
1315 configSettings
->setValue("/window y", pos().y());
1316 configSettings
->setValue("/window width", size().width());
1317 configSettings
->setValue("/window height", size().height());
1318 configSettings
->writeSizes("/split", split
->sizes());
1319 configSettings
->endGroup();
1323 void ConfigSearchWindow::search(void)
1326 struct property
*prop
;
1327 ConfigItem
*lastItem
= NULL
;
1330 list
->list
->clear();
1333 result
= sym_re_search(editField
->text().toLatin1());
1336 for (p
= result
; *p
; p
++) {
1337 for_all_prompts((*p
), prop
)
1338 lastItem
= new ConfigItem(list
->list
, lastItem
, prop
->menu
,
1339 menu_is_visible(prop
->menu
));
1344 * Construct the complete config widget
1346 ConfigMainWindow::ConfigMainWindow(void)
1355 QDesktopWidget
*d
= configApp
->desktop();
1356 snprintf(title
, sizeof(title
), "%s%s",
1357 rootmenu
.prompt
->text
,
1360 setWindowTitle(title
);
1362 width
= configSettings
->value("/window width", d
->width() - 64).toInt();
1363 height
= configSettings
->value("/window height", d
->height() - 64).toInt();
1364 resize(width
, height
);
1365 x
= configSettings
->value("/window x");
1366 y
= configSettings
->value("/window y");
1367 if ((x
.isValid())&&(y
.isValid()))
1368 move(x
.toInt(), y
.toInt());
1370 QWidget
*widget
= new QWidget(this);
1371 QVBoxLayout
*layout
= new QVBoxLayout(widget
);
1372 setCentralWidget(widget
);
1374 split1
= new QSplitter(widget
);
1375 split1
->setOrientation(Qt::Horizontal
);
1376 split1
->setChildrenCollapsible(false);
1378 menuView
= new ConfigView(widget
, "menu");
1379 menuList
= menuView
->list
;
1381 split2
= new QSplitter(widget
);
1382 split2
->setChildrenCollapsible(false);
1383 split2
->setOrientation(Qt::Vertical
);
1385 // create config tree
1386 configView
= new ConfigView(widget
, "config");
1387 configList
= configView
->list
;
1389 helpText
= new ConfigInfoView(widget
, "help");
1391 layout
->addWidget(split2
);
1392 split2
->addWidget(split1
);
1393 split1
->addWidget(configView
);
1394 split1
->addWidget(menuView
);
1395 split2
->addWidget(helpText
);
1397 setTabOrder(configList
, helpText
);
1398 configList
->setFocus();
1401 toolBar
= new QToolBar("Tools", this);
1402 addToolBar(toolBar
);
1404 backAction
= new QAction(QPixmap(xpm_back
), "Back", this);
1405 connect(backAction
, SIGNAL(triggered(bool)), SLOT(goBack()));
1406 backAction
->setEnabled(false);
1407 QAction
*quitAction
= new QAction("&Quit", this);
1408 quitAction
->setShortcut(Qt::CTRL
+ Qt::Key_Q
);
1409 connect(quitAction
, SIGNAL(triggered(bool)), SLOT(close()));
1410 QAction
*loadAction
= new QAction(QPixmap(xpm_load
), "&Load", this);
1411 loadAction
->setShortcut(Qt::CTRL
+ Qt::Key_L
);
1412 connect(loadAction
, SIGNAL(triggered(bool)), SLOT(loadConfig()));
1413 saveAction
= new QAction(QPixmap(xpm_save
), "&Save", this);
1414 saveAction
->setShortcut(Qt::CTRL
+ Qt::Key_S
);
1415 connect(saveAction
, SIGNAL(triggered(bool)), SLOT(saveConfig()));
1416 conf_set_changed_callback(conf_changed
);
1417 // Set saveAction's initial state
1419 configname
= xstrdup(conf_get_configname());
1421 QAction
*saveAsAction
= new QAction("Save &As...", this);
1422 connect(saveAsAction
, SIGNAL(triggered(bool)), SLOT(saveConfigAs()));
1423 QAction
*searchAction
= new QAction("&Find", this);
1424 searchAction
->setShortcut(Qt::CTRL
+ Qt::Key_F
);
1425 connect(searchAction
, SIGNAL(triggered(bool)), SLOT(searchConfig()));
1426 singleViewAction
= new QAction(QPixmap(xpm_single_view
), "Single View", this);
1427 singleViewAction
->setCheckable(true);
1428 connect(singleViewAction
, SIGNAL(triggered(bool)), SLOT(showSingleView()));
1429 splitViewAction
= new QAction(QPixmap(xpm_split_view
), "Split View", this);
1430 splitViewAction
->setCheckable(true);
1431 connect(splitViewAction
, SIGNAL(triggered(bool)), SLOT(showSplitView()));
1432 fullViewAction
= new QAction(QPixmap(xpm_tree_view
), "Full View", this);
1433 fullViewAction
->setCheckable(true);
1434 connect(fullViewAction
, SIGNAL(triggered(bool)), SLOT(showFullView()));
1436 QAction
*showNameAction
= new QAction("Show Name", this);
1437 showNameAction
->setCheckable(true);
1438 connect(showNameAction
, SIGNAL(toggled(bool)), configView
, SLOT(setShowName(bool)));
1439 showNameAction
->setChecked(configView
->showName());
1440 QAction
*showRangeAction
= new QAction("Show Range", this);
1441 showRangeAction
->setCheckable(true);
1442 connect(showRangeAction
, SIGNAL(toggled(bool)), configView
, SLOT(setShowRange(bool)));
1443 QAction
*showDataAction
= new QAction("Show Data", this);
1444 showDataAction
->setCheckable(true);
1445 connect(showDataAction
, SIGNAL(toggled(bool)), configView
, SLOT(setShowData(bool)));
1447 QActionGroup
*optGroup
= new QActionGroup(this);
1448 optGroup
->setExclusive(true);
1449 connect(optGroup
, SIGNAL(triggered(QAction
*)), configView
,
1450 SLOT(setOptionMode(QAction
*)));
1451 connect(optGroup
, SIGNAL(triggered(QAction
*)), menuView
,
1452 SLOT(setOptionMode(QAction
*)));
1454 configView
->showNormalAction
= new QAction("Show Normal Options", optGroup
);
1455 configView
->showAllAction
= new QAction("Show All Options", optGroup
);
1456 configView
->showPromptAction
= new QAction("Show Prompt Options", optGroup
);
1457 configView
->showNormalAction
->setCheckable(true);
1458 configView
->showAllAction
->setCheckable(true);
1459 configView
->showPromptAction
->setCheckable(true);
1461 QAction
*showDebugAction
= new QAction("Show Debug Info", this);
1462 showDebugAction
->setCheckable(true);
1463 connect(showDebugAction
, SIGNAL(toggled(bool)), helpText
, SLOT(setShowDebug(bool)));
1464 showDebugAction
->setChecked(helpText
->showDebug());
1466 QAction
*showIntroAction
= new QAction("Introduction", this);
1467 connect(showIntroAction
, SIGNAL(triggered(bool)), SLOT(showIntro()));
1468 QAction
*showAboutAction
= new QAction("About", this);
1469 connect(showAboutAction
, SIGNAL(triggered(bool)), SLOT(showAbout()));
1472 toolBar
->addAction(backAction
);
1473 toolBar
->addSeparator();
1474 toolBar
->addAction(loadAction
);
1475 toolBar
->addAction(saveAction
);
1476 toolBar
->addSeparator();
1477 toolBar
->addAction(singleViewAction
);
1478 toolBar
->addAction(splitViewAction
);
1479 toolBar
->addAction(fullViewAction
);
1481 // create config menu
1482 QMenu
* config
= menu
->addMenu("&File");
1483 config
->addAction(loadAction
);
1484 config
->addAction(saveAction
);
1485 config
->addAction(saveAsAction
);
1486 config
->addSeparator();
1487 config
->addAction(quitAction
);
1490 QMenu
* editMenu
= menu
->addMenu("&Edit");
1491 editMenu
->addAction(searchAction
);
1493 // create options menu
1494 QMenu
* optionMenu
= menu
->addMenu("&Option");
1495 optionMenu
->addAction(showNameAction
);
1496 optionMenu
->addAction(showRangeAction
);
1497 optionMenu
->addAction(showDataAction
);
1498 optionMenu
->addSeparator();
1499 optionMenu
->addActions(optGroup
->actions());
1500 optionMenu
->addSeparator();
1501 optionMenu
->addAction(showDebugAction
);
1504 menu
->addSeparator();
1505 QMenu
* helpMenu
= menu
->addMenu("&Help");
1506 helpMenu
->addAction(showIntroAction
);
1507 helpMenu
->addAction(showAboutAction
);
1509 connect(configList
, SIGNAL(menuChanged(struct menu
*)),
1510 helpText
, SLOT(setInfo(struct menu
*)));
1511 connect(configList
, SIGNAL(menuSelected(struct menu
*)),
1512 SLOT(changeMenu(struct menu
*)));
1513 connect(configList
, SIGNAL(itemSelected(struct menu
*)),
1514 SLOT(changeItens(struct menu
*)));
1515 connect(configList
, SIGNAL(parentSelected()),
1517 connect(menuList
, SIGNAL(menuChanged(struct menu
*)),
1518 helpText
, SLOT(setInfo(struct menu
*)));
1519 connect(menuList
, SIGNAL(menuSelected(struct menu
*)),
1520 SLOT(changeMenu(struct menu
*)));
1522 connect(configList
, SIGNAL(gotFocus(struct menu
*)),
1523 helpText
, SLOT(setInfo(struct menu
*)));
1524 connect(menuList
, SIGNAL(gotFocus(struct menu
*)),
1525 helpText
, SLOT(setInfo(struct menu
*)));
1526 connect(menuList
, SIGNAL(gotFocus(struct menu
*)),
1527 SLOT(listFocusChanged(void)));
1528 connect(helpText
, SIGNAL(menuSelected(struct menu
*)),
1529 SLOT(setMenuLink(struct menu
*)));
1531 QString listMode
= configSettings
->value("/listMode", "symbol").toString();
1532 if (listMode
== "single")
1534 else if (listMode
== "full")
1536 else /*if (listMode == "split")*/
1539 // UI setup done, restore splitter positions
1540 QList
<int> sizes
= configSettings
->readSizes("/split1", &ok
);
1542 split1
->setSizes(sizes
);
1544 sizes
= configSettings
->readSizes("/split2", &ok
);
1546 split2
->setSizes(sizes
);
1549 void ConfigMainWindow::loadConfig(void)
1555 str
= QFileDialog::getOpenFileName(this, "", configname
);
1559 ba
= str
.toLocal8Bit();
1562 if (conf_read(name
))
1563 QMessageBox::information(this, "qconf", "Unable to load configuration!");
1566 configname
= xstrdup(name
);
1568 ConfigView::updateListAll();
1571 bool ConfigMainWindow::saveConfig(void)
1573 if (conf_write(configname
)) {
1574 QMessageBox::information(this, "qconf", "Unable to save configuration!");
1577 conf_write_autoconf(0);
1582 void ConfigMainWindow::saveConfigAs(void)
1588 str
= QFileDialog::getSaveFileName(this, "", configname
);
1592 ba
= str
.toLocal8Bit();
1595 if (conf_write(name
)) {
1596 QMessageBox::information(this, "qconf", "Unable to save configuration!");
1598 conf_write_autoconf(0);
1601 configname
= xstrdup(name
);
1604 void ConfigMainWindow::searchConfig(void)
1607 searchWindow
= new ConfigSearchWindow(this, "search");
1608 searchWindow
->show();
1611 void ConfigMainWindow::changeItens(struct menu
*menu
)
1613 configList
->setRootMenu(menu
);
1615 if (configList
->rootEntry
->parent
== &rootmenu
)
1616 backAction
->setEnabled(false);
1618 backAction
->setEnabled(true);
1621 void ConfigMainWindow::changeMenu(struct menu
*menu
)
1623 menuList
->setRootMenu(menu
);
1625 if (menuList
->rootEntry
->parent
== &rootmenu
)
1626 backAction
->setEnabled(false);
1628 backAction
->setEnabled(true);
1631 void ConfigMainWindow::setMenuLink(struct menu
*menu
)
1633 struct menu
*parent
;
1634 ConfigList
* list
= NULL
;
1637 if (configList
->menuSkip(menu
))
1640 switch (configList
->mode
) {
1643 parent
= menu_get_parent_menu(menu
);
1646 list
->setRootMenu(parent
);
1649 if (menu
->flags
& MENU_ROOT
) {
1650 configList
->setRootMenu(menu
);
1651 configList
->clearSelection();
1655 parent
= menu_get_parent_menu(menu
->parent
);
1658 item
= menuList
->findConfigItem(parent
);
1660 item
->setSelected(true);
1661 menuList
->scrollToItem(item
);
1663 list
->setRootMenu(parent
);
1674 item
= list
->findConfigItem(menu
);
1676 item
->setSelected(true);
1677 list
->scrollToItem(item
);
1683 void ConfigMainWindow::listFocusChanged(void)
1685 if (menuList
->mode
== menuMode
)
1686 configList
->clearSelection();
1689 void ConfigMainWindow::goBack(void)
1691 ConfigItem
* item
, *oldSelection
;
1693 configList
->setParentMenu();
1694 if (configList
->rootEntry
== &rootmenu
)
1695 backAction
->setEnabled(false);
1697 if (menuList
->selectedItems().count() == 0)
1700 item
= (ConfigItem
*)menuList
->selectedItems().first();
1701 oldSelection
= item
;
1703 if (item
->menu
== configList
->rootEntry
) {
1704 oldSelection
->setSelected(false);
1705 item
->setSelected(true);
1708 item
= (ConfigItem
*)item
->parent();
1712 void ConfigMainWindow::showSingleView(void)
1714 singleViewAction
->setEnabled(false);
1715 singleViewAction
->setChecked(true);
1716 splitViewAction
->setEnabled(true);
1717 splitViewAction
->setChecked(false);
1718 fullViewAction
->setEnabled(true);
1719 fullViewAction
->setChecked(false);
1722 menuList
->setRootMenu(0);
1723 configList
->mode
= singleMode
;
1724 if (configList
->rootEntry
== &rootmenu
)
1725 configList
->updateListAll();
1727 configList
->setRootMenu(&rootmenu
);
1728 configList
->setFocus();
1731 void ConfigMainWindow::showSplitView(void)
1733 singleViewAction
->setEnabled(true);
1734 singleViewAction
->setChecked(false);
1735 splitViewAction
->setEnabled(false);
1736 splitViewAction
->setChecked(true);
1737 fullViewAction
->setEnabled(true);
1738 fullViewAction
->setChecked(false);
1740 configList
->mode
= menuMode
;
1741 if (configList
->rootEntry
== &rootmenu
)
1742 configList
->updateListAll();
1744 configList
->setRootMenu(&rootmenu
);
1745 configList
->setAllOpen(true);
1746 configApp
->processEvents();
1747 menuList
->mode
= symbolMode
;
1748 menuList
->setRootMenu(&rootmenu
);
1749 menuList
->setAllOpen(true);
1751 menuList
->setFocus();
1754 void ConfigMainWindow::showFullView(void)
1756 singleViewAction
->setEnabled(true);
1757 singleViewAction
->setChecked(false);
1758 splitViewAction
->setEnabled(true);
1759 splitViewAction
->setChecked(false);
1760 fullViewAction
->setEnabled(false);
1761 fullViewAction
->setChecked(true);
1764 menuList
->setRootMenu(0);
1765 configList
->mode
= fullMode
;
1766 if (configList
->rootEntry
== &rootmenu
)
1767 configList
->updateListAll();
1769 configList
->setRootMenu(&rootmenu
);
1770 configList
->setFocus();
1774 * ask for saving configuration before quitting
1776 void ConfigMainWindow::closeEvent(QCloseEvent
* e
)
1778 if (!conf_get_changed()) {
1782 QMessageBox
mb("qconf", "Save configuration?", QMessageBox::Warning
,
1783 QMessageBox::Yes
| QMessageBox::Default
, QMessageBox::No
, QMessageBox::Cancel
| QMessageBox::Escape
);
1784 mb
.setButtonText(QMessageBox::Yes
, "&Save Changes");
1785 mb
.setButtonText(QMessageBox::No
, "&Discard Changes");
1786 mb
.setButtonText(QMessageBox::Cancel
, "Cancel Exit");
1787 switch (mb
.exec()) {
1788 case QMessageBox::Yes
:
1794 case QMessageBox::No
:
1797 case QMessageBox::Cancel
:
1803 void ConfigMainWindow::showIntro(void)
1805 static const QString str
= "Welcome to the qconf graphical configuration tool.\n\n"
1806 "For each option, a blank box indicates the feature is disabled, a check\n"
1807 "indicates it is enabled, and a dot indicates that it is to be compiled\n"
1808 "as a module. Clicking on the box will cycle through the three states.\n\n"
1809 "If you do not see an option (e.g., a device driver) that you believe\n"
1810 "should be present, try turning on Show All Options under the Options menu.\n"
1811 "Although there is no cross reference yet to help you figure out what other\n"
1812 "options must be enabled to support the option you are interested in, you can\n"
1813 "still view the help of a grayed-out option.\n\n"
1814 "Toggling Show Debug Info under the Options menu will show the dependencies,\n"
1815 "which you can then match by examining other options.\n\n";
1817 QMessageBox::information(this, "qconf", str
);
1820 void ConfigMainWindow::showAbout(void)
1822 static const QString str
= "qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n"
1823 "Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>.\n\n"
1824 "Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n";
1826 QMessageBox::information(this, "qconf", str
);
1829 void ConfigMainWindow::saveSettings(void)
1831 configSettings
->setValue("/window x", pos().x());
1832 configSettings
->setValue("/window y", pos().y());
1833 configSettings
->setValue("/window width", size().width());
1834 configSettings
->setValue("/window height", size().height());
1837 switch(configList
->mode
) {
1853 configSettings
->setValue("/listMode", entry
);
1855 configSettings
->writeSizes("/split1", split1
->sizes());
1856 configSettings
->writeSizes("/split2", split2
->sizes());
1859 void ConfigMainWindow::conf_changed(void)
1862 saveAction
->setEnabled(conf_get_changed());
1865 void fixup_rootmenu(struct menu
*menu
)
1868 static int menu_cnt
= 0;
1870 menu
->flags
|= MENU_ROOT
;
1871 for (child
= menu
->list
; child
; child
= child
->next
) {
1872 if (child
->prompt
&& child
->prompt
->type
== P_MENU
) {
1874 fixup_rootmenu(child
);
1876 } else if (!menu_cnt
)
1877 fixup_rootmenu(child
);
1881 static const char *progname
;
1883 static void usage(void)
1885 printf("%s [-s] <config>\n", progname
);
1889 int main(int ac
, char** av
)
1891 ConfigMainWindow
* v
;
1895 configApp
= new QApplication(ac
, av
);
1896 if (ac
> 1 && av
[1][0] == '-') {
1899 conf_set_message_callback(NULL
);
1912 fixup_rootmenu(&rootmenu
);
1914 //zconfdump(stdout);
1916 configSettings
= new ConfigSettings();
1917 configSettings
->beginGroup("/kconfig/qconf");
1918 v
= new ConfigMainWindow();
1920 //zconfdump(stdout);
1921 configApp
->connect(configApp
, SIGNAL(lastWindowClosed()), SLOT(quit()));
1922 configApp
->connect(configApp
, SIGNAL(aboutToQuit()), v
, SLOT(saveSettings()));
1926 configSettings
->endGroup();
1927 delete configSettings
;