Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 342007
Collapse All | Expand All

(-)a/scripts/kconfig/Makefile (+1 lines)
Lines 238-243 Link Here
238
	@set -e; echo "  CHECK   qt"; dir=""; pkg=""; \
238
	@set -e; echo "  CHECK   qt"; dir=""; pkg=""; \
239
	pkg-config --exists qt 2> /dev/null && pkg=qt; \
239
	pkg-config --exists qt 2> /dev/null && pkg=qt; \
240
	pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
240
	pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
241
	pkg-config --exists Qt3Support 2> /dev/null && pkg=Qt3Support; \
241
	if [ -n "$$pkg" ]; then \
242
	if [ -n "$$pkg" ]; then \
242
	  cflags="\$$(shell pkg-config $$pkg --cflags)"; \
243
	  cflags="\$$(shell pkg-config $$pkg --cflags)"; \
243
	  libs="\$$(shell pkg-config $$pkg --libs)"; \
244
	  libs="\$$(shell pkg-config $$pkg --libs)"; \
(-)a/scripts/kconfig/qconf.h (-31 / +40 lines)
Lines 3-11 Link Here
3
 * Released under the terms of the GNU GPL v2.0.
3
 * Released under the terms of the GNU GPL v2.0.
4
 */
4
 */
5
5
6
#include <qlistview.h>
6
#include <q3listview.h>
7
#if QT_VERSION >= 300
7
#if QT_VERSION >= 300
8
#include <qsettings.h>
8
#include <qsettings.h>
9
//Added by qt3to4:
10
#include <QContextMenuEvent>
11
#include <QCloseEvent>
12
#include <QFocusEvent>
13
#include <Q3ValueList>
14
#include <QPixmap>
15
#include <QMouseEvent>
16
#include <Q3PopupMenu>
17
#include <QKeyEvent>
9
#else
18
#else
10
class QSettings {
19
class QSettings {
11
public:
20
public:
Lines 34-41 Link Here
34
43
35
class ConfigSettings : public QSettings {
44
class ConfigSettings : public QSettings {
36
public:
45
public:
37
	QValueList<int> readSizes(const QString& key, bool *ok);
46
	Q3ValueList<int> readSizes(const QString& key, bool *ok);
38
	bool writeSizes(const QString& key, const QValueList<int>& value);
47
	bool writeSizes(const QString& key, const Q3ValueList<int>& value);
39
};
48
};
40
49
41
enum colIdx {
50
enum colIdx {
Lines 48-56 Link Here
48
	normalOpt = 0, allOpt, promptOpt
57
	normalOpt = 0, allOpt, promptOpt
49
};
58
};
50
59
51
class ConfigList : public QListView {
60
class ConfigList : public Q3ListView {
52
	Q_OBJECT
61
	Q_OBJECT
53
	typedef class QListView Parent;
62
	typedef class Q3ListView Parent;
54
public:
63
public:
55
	ConfigList(ConfigView* p, const char *name = 0);
64
	ConfigList(ConfigView* p, const char *name = 0);
56
	void reinit(void);
65
	void reinit(void);
Lines 58-64 Link Here
58
	{
67
	{
59
		return (ConfigView*)Parent::parent();
68
		return (ConfigView*)Parent::parent();
60
	}
69
	}
61
	ConfigItem* findConfigItem(struct menu *);
70
	ConfigItem* findConfigItem(KCMenu *);
62
71
63
protected:
72
protected:
64
	void keyPressEvent(QKeyEvent *e);
73
	void keyPressEvent(QKeyEvent *e);
Lines 70-76 Link Here
70
	void contextMenuEvent(QContextMenuEvent *e);
79
	void contextMenuEvent(QContextMenuEvent *e);
71
80
72
public slots:
81
public slots:
73
	void setRootMenu(struct menu *menu);
82
	void setRootMenu(KCMenu *menu);
74
83
75
	void updateList(ConfigItem *item);
84
	void updateList(ConfigItem *item);
76
	void setValue(ConfigItem* item, tristate val);
85
	void setValue(ConfigItem* item, tristate val);
Lines 78-87 Link Here
78
	void updateSelection(void);
87
	void updateSelection(void);
79
	void saveSettings(void);
88
	void saveSettings(void);
80
signals:
89
signals:
81
	void menuChanged(struct menu *menu);
90
	void menuChanged(KCMenu *menu);
82
	void menuSelected(struct menu *menu);
91
	void menuSelected(KCMenu *menu);
83
	void parentSelected(void);
92
	void parentSelected(void);
84
	void gotFocus(struct menu *);
93
	void gotFocus(KCMenu *);
85
94
86
public:
95
public:
87
	void updateListAll(void)
96
	void updateListAll(void)
Lines 121-127 Link Here
121
	bool menuSkip(struct menu *);
130
	bool menuSkip(struct menu *);
122
131
123
	template <class P>
132
	template <class P>
124
	void updateMenuList(P*, struct menu*);
133
	void updateMenuList(P*, KCMenu*);
125
134
126
	bool updateAll;
135
	bool updateAll;
127
136
Lines 132-161 Link Here
132
	bool showName, showRange, showData;
141
	bool showName, showRange, showData;
133
	enum listMode mode;
142
	enum listMode mode;
134
	enum optionMode optMode;
143
	enum optionMode optMode;
135
	struct menu *rootEntry;
144
	KCMenu *rootEntry;
136
	QColorGroup disabledColorGroup;
145
	QColorGroup disabledColorGroup;
137
	QColorGroup inactivedColorGroup;
146
	QColorGroup inactivedColorGroup;
138
	QPopupMenu* headerPopup;
147
	Q3PopupMenu* headerPopup;
139
148
140
private:
149
private:
141
	int colMap[colNr];
150
	int colMap[colNr];
142
	int colRevMap[colNr];
151
	int colRevMap[colNr];
143
};
152
};
144
153
145
class ConfigItem : public QListViewItem {
154
class ConfigItem : public Q3ListViewItem {
146
	typedef class QListViewItem Parent;
155
	typedef class Q3ListViewItem Parent;
147
public:
156
public:
148
	ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v)
157
	ConfigItem(Q3ListView *parent, ConfigItem *after, KCMenu *m, bool v)
149
	: Parent(parent, after), menu(m), visible(v), goParent(false)
158
	: Parent(parent, after), menu(m), visible(v), goParent(false)
150
	{
159
	{
151
		init();
160
		init();
152
	}
161
	}
153
	ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
162
	ConfigItem(ConfigItem *parent, ConfigItem *after, KCMenu *m, bool v)
154
	: Parent(parent, after), menu(m), visible(v), goParent(false)
163
	: Parent(parent, after), menu(m), visible(v), goParent(false)
155
	{
164
	{
156
		init();
165
		init();
157
	}
166
	}
158
	ConfigItem(QListView *parent, ConfigItem *after, bool v)
167
	ConfigItem(Q3ListView *parent, ConfigItem *after, bool v)
159
	: Parent(parent, after), menu(0), visible(v), goParent(true)
168
	: Parent(parent, after), menu(0), visible(v), goParent(true)
160
	{
169
	{
161
		init();
170
		init();
Lines 198-204 Link Here
198
	void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
207
	void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
199
208
200
	ConfigItem* nextItem;
209
	ConfigItem* nextItem;
201
	struct menu *menu;
210
	KCMenu *menu;
202
	bool visible;
211
	bool visible;
203
	bool goParent;
212
	bool goParent;
204
};
213
};
Lines 219-227 Link Here
219
	ConfigItem *item;
228
	ConfigItem *item;
220
};
229
};
221
230
222
class ConfigView : public QVBox {
231
class ConfigView : public Q3VBox {
223
	Q_OBJECT
232
	Q_OBJECT
224
	typedef class QVBox Parent;
233
	typedef class Q3VBox Parent;
225
public:
234
public:
226
	ConfigView(QWidget* parent, const char *name = 0);
235
	ConfigView(QWidget* parent, const char *name = 0);
227
	~ConfigView(void);
236
	~ConfigView(void);
Lines 252-272 Link Here
252
	static QAction *showPromptAction;
261
	static QAction *showPromptAction;
253
};
262
};
254
263
255
class ConfigInfoView : public QTextBrowser {
264
class ConfigInfoView : public Q3TextBrowser {
256
	Q_OBJECT
265
	Q_OBJECT
257
	typedef class QTextBrowser Parent;
266
	typedef class Q3TextBrowser Parent;
258
public:
267
public:
259
	ConfigInfoView(QWidget* parent, const char *name = 0);
268
	ConfigInfoView(QWidget* parent, const char *name = 0);
260
	bool showDebug(void) const { return _showDebug; }
269
	bool showDebug(void) const { return _showDebug; }
261
270
262
public slots:
271
public slots:
263
	void setInfo(struct menu *menu);
272
	void setInfo(KCMenu *menu);
264
	void saveSettings(void);
273
	void saveSettings(void);
265
	void setShowDebug(bool);
274
	void setShowDebug(bool);
266
275
267
signals:
276
signals:
268
	void showDebugChanged(bool);
277
	void showDebugChanged(bool);
269
	void menuSelected(struct menu *);
278
	void menuSelected(KCMenu *);
270
279
271
protected:
280
protected:
272
	void symbolInfo(void);
281
	void symbolInfo(void);
Lines 274-284 Link Here
274
	QString debug_info(struct symbol *sym);
283
	QString debug_info(struct symbol *sym);
275
	static QString print_filter(const QString &str);
284
	static QString print_filter(const QString &str);
276
	static void expr_print_help(void *data, struct symbol *sym, const char *str);
285
	static void expr_print_help(void *data, struct symbol *sym, const char *str);
277
	QPopupMenu* createPopupMenu(const QPoint& pos);
286
	Q3PopupMenu* createPopupMenu(const QPoint& pos);
278
	void contentsContextMenuEvent(QContextMenuEvent *e);
287
	void contentsContextMenuEvent(QContextMenuEvent *e);
279
288
280
	struct symbol *sym;
289
	struct symbol *sym;
281
	struct menu *menu;
290
	KCMenu *menu;
282
	bool _showDebug;
291
	bool _showDebug;
283
};
292
};
284
293
Lines 302-308 Link Here
302
	struct symbol **result;
311
	struct symbol **result;
303
};
312
};
304
313
305
class ConfigMainWindow : public QMainWindow {
314
class ConfigMainWindow : public Q3MainWindow {
306
	Q_OBJECT
315
	Q_OBJECT
307
316
308
	static QAction *saveAction;
317
	static QAction *saveAction;
Lines 310-317 Link Here
310
public:
319
public:
311
	ConfigMainWindow(void);
320
	ConfigMainWindow(void);
312
public slots:
321
public slots:
313
	void changeMenu(struct menu *);
322
	void changeMenu(KCMenu *);
314
	void setMenuLink(struct menu *);
323
	void setMenuLink(KCMenu *);
315
	void listFocusChanged(void);
324
	void listFocusChanged(void);
316
	void goBack(void);
325
	void goBack(void);
317
	void loadConfig(void);
326
	void loadConfig(void);
Lines 334-340 Link Here
334
	ConfigView *configView;
343
	ConfigView *configView;
335
	ConfigList *configList;
344
	ConfigList *configList;
336
	ConfigInfoView *helpText;
345
	ConfigInfoView *helpText;
337
	QToolBar *toolBar;
346
	Q3ToolBar *toolBar;
338
	QAction *backAction;
347
	QAction *backAction;
339
	QSplitter* split1;
348
	QSplitter* split1;
340
	QSplitter* split2;
349
	QSplitter* split2;
(-)a/scripts/kconfig/qconf.cc (-89 / +100 lines)
Lines 4-27 Link Here
4
 */
4
 */
5
5
6
#include <qapplication.h>
6
#include <qapplication.h>
7
#include <qmainwindow.h>
7
#include <q3mainwindow.h>
8
#include <qdesktopwidget.h>
8
#include <qdesktopwidget.h>
9
#include <qtoolbar.h>
9
#include <q3toolbar.h>
10
#include <qlayout.h>
10
#include <qlayout.h>
11
#include <qvbox.h>
11
#include <q3vbox.h>
12
#include <qsplitter.h>
12
#include <qsplitter.h>
13
#include <qlistview.h>
13
#include <q3listview.h>
14
#include <qtextbrowser.h>
14
#include <q3textbrowser.h>
15
#include <qlineedit.h>
15
#include <qlineedit.h>
16
#include <qlabel.h>
16
#include <qlabel.h>
17
#include <qpushbutton.h>
17
#include <qpushbutton.h>
18
#include <qmenubar.h>
18
#include <qmenubar.h>
19
#include <qmessagebox.h>
19
#include <qmessagebox.h>
20
#include <qaction.h>
20
#include <qaction.h>
21
#include <qheader.h>
21
#include <q3header.h>
22
#include <qfiledialog.h>
22
#include <q3filedialog.h>
23
#include <qdragobject.h>
23
#include <q3dragobject.h>
24
#include <qregexp.h>
24
#include <qregexp.h>
25
//Added by qt3to4:
26
#include <QContextMenuEvent>
27
#include <QPixmap>
28
#include <QFocusEvent>
29
#include <QMouseEvent>
30
#include <QCloseEvent>
31
#include <Q3ValueList>
32
#include <QKeyEvent>
33
#include <Q3HBoxLayout>
34
#include <Q3VBoxLayout>
35
#include <Q3PopupMenu>
25
36
26
#include <stdlib.h>
37
#include <stdlib.h>
27
38
Lines 54-62 Link Here
54
/**
65
/**
55
 * Reads a list of integer values from the application settings.
66
 * Reads a list of integer values from the application settings.
56
 */
67
 */
57
QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
68
Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
58
{
69
{
59
	QValueList<int> result;
70
	Q3ValueList<int> result;
60
	QStringList entryList = readListEntry(key, ok);
71
	QStringList entryList = readListEntry(key, ok);
61
	QStringList::Iterator it;
72
	QStringList::Iterator it;
62
73
Lines 69-78 Link Here
69
/**
80
/**
70
 * Writes a list of integer values to the application settings.
81
 * Writes a list of integer values to the application settings.
71
 */
82
 */
72
bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value)
83
bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList<int>& value)
73
{
84
{
74
	QStringList stringList;
85
	QStringList stringList;
75
	QValueList<int>::ConstIterator it;
86
	Q3ValueList<int>::ConstIterator it;
76
87
77
	for (it = value.begin(); it != value.end(); ++it)
88
	for (it = value.begin(); it != value.end(); ++it)
78
		stringList.push_back(QString::number(*it));
89
		stringList.push_back(QString::number(*it));
Lines 395-401 Link Here
395
	}
406
	}
396
}
407
}
397
408
398
ConfigItem* ConfigList::findConfigItem(struct menu *menu)
409
ConfigItem* ConfigList::findConfigItem(KCMenu *menu)
399
{
410
{
400
	ConfigItem* item = (ConfigItem*)menu->data;
411
	ConfigItem* item = (ConfigItem*)menu->data;
401
412
Lines 409-415 Link Here
409
420
410
void ConfigList::updateSelection(void)
421
void ConfigList::updateSelection(void)
411
{
422
{
412
	struct menu *menu;
423
	KCMenu *menu;
413
	enum prop_type type;
424
	enum prop_type type;
414
425
415
	ConfigItem* item = (ConfigItem*)selectedItem();
426
	ConfigItem* item = (ConfigItem*)selectedItem();
Lines 432-438 Link Here
432
	if (!rootEntry) {
443
	if (!rootEntry) {
433
		if (mode != listMode)
444
		if (mode != listMode)
434
			goto update;
445
			goto update;
435
		QListViewItemIterator it(this);
446
		Q3ListViewItemIterator it(this);
436
		ConfigItem* item;
447
		ConfigItem* item;
437
448
438
		for (; it.current(); ++it) {
449
		for (; it.current(); ++it) {
Lines 496-502 Link Here
496
void ConfigList::changeValue(ConfigItem* item)
507
void ConfigList::changeValue(ConfigItem* item)
497
{
508
{
498
	struct symbol* sym;
509
	struct symbol* sym;
499
	struct menu* menu;
510
	KCMenu* menu;
500
	int type, oldexpr, newexpr;
511
	int type, oldexpr, newexpr;
501
512
502
	menu = item->menu;
513
	menu = item->menu;
Lines 537-543 Link Here
537
	}
548
	}
538
}
549
}
539
550
540
void ConfigList::setRootMenu(struct menu *menu)
551
void ConfigList::setRootMenu(KCMenu *menu)
541
{
552
{
542
	enum prop_type type;
553
	enum prop_type type;
543
554
Lines 556-569 Link Here
556
void ConfigList::setParentMenu(void)
567
void ConfigList::setParentMenu(void)
557
{
568
{
558
	ConfigItem* item;
569
	ConfigItem* item;
559
	struct menu *oldroot;
570
	KCMenu *oldroot;
560
571
561
	oldroot = rootEntry;
572
	oldroot = rootEntry;
562
	if (rootEntry == &rootmenu)
573
	if (rootEntry == &rootmenu)
563
		return;
574
		return;
564
	setRootMenu(menu_get_parent_menu(rootEntry->parent));
575
	setRootMenu(menu_get_parent_menu(rootEntry->parent));
565
576
566
	QListViewItemIterator it(this);
577
	Q3ListViewItemIterator it(this);
567
	for (; (item = (ConfigItem*)it.current()); it++) {
578
	for (; (item = (ConfigItem*)it.current()); it++) {
568
		if (item->menu == oldroot) {
579
		if (item->menu == oldroot) {
569
			setCurrentItem(item);
580
			setCurrentItem(item);
Lines 581-589 Link Here
581
 * menu: entry to be updated
592
 * menu: entry to be updated
582
 */
593
 */
583
template <class P>
594
template <class P>
584
void ConfigList::updateMenuList(P* parent, struct menu* menu)
595
void ConfigList::updateMenuList(P* parent, KCMenu* menu)
585
{
596
{
586
	struct menu* child;
597
	KCMenu* child;
587
	ConfigItem* item;
598
	ConfigItem* item;
588
	ConfigItem* last;
599
	ConfigItem* last;
589
	bool visible;
600
	bool visible;
Lines 645-653 Link Here
645
656
646
void ConfigList::keyPressEvent(QKeyEvent* ev)
657
void ConfigList::keyPressEvent(QKeyEvent* ev)
647
{
658
{
648
	QListViewItem* i = currentItem();
659
	Q3ListViewItem* i = currentItem();
649
	ConfigItem* item;
660
	ConfigItem* item;
650
	struct menu *menu;
661
	KCMenu *menu;
651
	enum prop_type type;
662
	enum prop_type type;
652
663
653
	if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
664
	if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
Lines 708-714 Link Here
708
{
719
{
709
	QPoint p(contentsToViewport(e->pos()));
720
	QPoint p(contentsToViewport(e->pos()));
710
	ConfigItem* item = (ConfigItem*)itemAt(p);
721
	ConfigItem* item = (ConfigItem*)itemAt(p);
711
	struct menu *menu;
722
	KCMenu *menu;
712
	enum prop_type ptype;
723
	enum prop_type ptype;
713
	const QPixmap* pm;
724
	const QPixmap* pm;
714
	int idx, x;
725
	int idx, x;
Lines 770-776 Link Here
770
{
781
{
771
	QPoint p(contentsToViewport(e->pos()));
782
	QPoint p(contentsToViewport(e->pos()));
772
	ConfigItem* item = (ConfigItem*)itemAt(p);
783
	ConfigItem* item = (ConfigItem*)itemAt(p);
773
	struct menu *menu;
784
	KCMenu *menu;
774
	enum prop_type ptype;
785
	enum prop_type ptype;
775
786
776
	if (!item)
787
	if (!item)
Lines 795-801 Link Here
795
806
796
void ConfigList::focusInEvent(QFocusEvent *e)
807
void ConfigList::focusInEvent(QFocusEvent *e)
797
{
808
{
798
	struct menu *menu = NULL;
809
	KCMenu *menu = NULL;
799
810
800
	Parent::focusInEvent(e);
811
	Parent::focusInEvent(e);
801
812
Lines 813-820 Link Here
813
		if (!headerPopup) {
824
		if (!headerPopup) {
814
			QAction *action;
825
			QAction *action;
815
826
816
			headerPopup = new QPopupMenu(this);
827
			headerPopup = new Q3PopupMenu(this);
817
			action = new QAction(NULL, _("Show Name"), 0, this);
828
			action = new QAction(_("Show Name"), this);
818
			  action->setToggleAction(TRUE);
829
			  action->setToggleAction(TRUE);
819
			  connect(action, SIGNAL(toggled(bool)),
830
			  connect(action, SIGNAL(toggled(bool)),
820
				  parent(), SLOT(setShowName(bool)));
831
				  parent(), SLOT(setShowName(bool)));
Lines 822-828 Link Here
822
				  action, SLOT(setOn(bool)));
833
				  action, SLOT(setOn(bool)));
823
			  action->setOn(showName);
834
			  action->setOn(showName);
824
			  action->addTo(headerPopup);
835
			  action->addTo(headerPopup);
825
			action = new QAction(NULL, _("Show Range"), 0, this);
836
			action = new QAction(_("Show Range"), this);
826
			  action->setToggleAction(TRUE);
837
			  action->setToggleAction(TRUE);
827
			  connect(action, SIGNAL(toggled(bool)),
838
			  connect(action, SIGNAL(toggled(bool)),
828
				  parent(), SLOT(setShowRange(bool)));
839
				  parent(), SLOT(setShowRange(bool)));
Lines 830-836 Link Here
830
				  action, SLOT(setOn(bool)));
841
				  action, SLOT(setOn(bool)));
831
			  action->setOn(showRange);
842
			  action->setOn(showRange);
832
			  action->addTo(headerPopup);
843
			  action->addTo(headerPopup);
833
			action = new QAction(NULL, _("Show Data"), 0, this);
844
			action = new QAction(_("Show Data"), this);
834
			  action->setToggleAction(TRUE);
845
			  action->setToggleAction(TRUE);
835
			  connect(action, SIGNAL(toggled(bool)),
846
			  connect(action, SIGNAL(toggled(bool)),
836
				  parent(), SLOT(setShowData(bool)));
847
				  parent(), SLOT(setShowData(bool)));
Lines 914-920 Link Here
914
925
915
void ConfigList::setAllOpen(bool open)
926
void ConfigList::setAllOpen(bool open)
916
{
927
{
917
	QListViewItemIterator it(this);
928
	Q3ListViewItemIterator it(this);
918
929
919
	for (; it.current(); it++)
930
	for (; it.current(); it++)
920
		it.current()->setOpen(open);
931
		it.current()->setOpen(open);
Lines 968-974 Link Here
968
	}
979
	}
969
}
980
}
970
981
971
void ConfigInfoView::setInfo(struct menu *m)
982
void ConfigInfoView::setInfo(KCMenu *m)
972
{
983
{
973
	if (menu == m)
984
	if (menu == m)
974
		return;
985
		return;
Lines 1150-1159 Link Here
1150
		*text += str2;
1161
		*text += str2;
1151
}
1162
}
1152
1163
1153
QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos)
1164
Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos)
1154
{
1165
{
1155
	QPopupMenu* popup = Parent::createPopupMenu(pos);
1166
	Q3PopupMenu* popup = Parent::createPopupMenu(pos);
1156
	QAction* action = new QAction(NULL, _("Show Debug Info"), 0, popup);
1167
	QAction* action = new QAction(_("Show Debug Info"), popup);
1157
	  action->setToggleAction(TRUE);
1168
	  action->setToggleAction(TRUE);
1158
	  connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1169
	  connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1159
	  connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
1170
	  connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
Lines 1173-1180 Link Here
1173
{
1184
{
1174
	setCaption("Search Config");
1185
	setCaption("Search Config");
1175
1186
1176
	QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6);
1187
	Q3VBoxLayout* layout1 = new Q3VBoxLayout(this, 11, 6);
1177
	QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6);
1188
	Q3HBoxLayout* layout2 = new Q3HBoxLayout(0, 0, 6);
1178
	layout2->addWidget(new QLabel(_("Find:"), this));
1189
	layout2->addWidget(new QLabel(_("Find:"), this));
1179
	editField = new QLineEdit(this);
1190
	editField = new QLineEdit(this);
1180
	connect(editField, SIGNAL(returnPressed()), SLOT(search()));
1191
	connect(editField, SIGNAL(returnPressed()), SLOT(search()));
Lines 1190-1199 Link Here
1190
	list = new ConfigView(split, name);
1201
	list = new ConfigView(split, name);
1191
	list->list->mode = listMode;
1202
	list->list->mode = listMode;
1192
	info = new ConfigInfoView(split, name);
1203
	info = new ConfigInfoView(split, name);
1193
	connect(list->list, SIGNAL(menuChanged(struct menu *)),
1204
	connect(list->list, SIGNAL(menuChanged(KCMenu *)),
1194
		info, SLOT(setInfo(struct menu *)));
1205
		info, SLOT(setInfo(KCMenu *)));
1195
	connect(list->list, SIGNAL(menuChanged(struct menu *)),
1206
	connect(list->list, SIGNAL(menuChanged(KCMenu *)),
1196
		parent, SLOT(setMenuLink(struct menu *)));
1207
		parent, SLOT(setMenuLink(KCMenu *)));
1197
1208
1198
	layout1->addWidget(split);
1209
	layout1->addWidget(split);
1199
1210
Lines 1210-1216 Link Here
1210
			y = configSettings->readNumEntry("/window y", 0, &ok);
1221
			y = configSettings->readNumEntry("/window y", 0, &ok);
1211
		if (ok)
1222
		if (ok)
1212
			move(x, y);
1223
			move(x, y);
1213
		QValueList<int> sizes = configSettings->readSizes("/split", &ok);
1224
		Q3ValueList<int> sizes = configSettings->readSizes("/split", &ok);
1214
		if (ok)
1225
		if (ok)
1215
			split->setSizes(sizes);
1226
			split->setSizes(sizes);
1216
		configSettings->endGroup();
1227
		configSettings->endGroup();
Lines 1297-1338 Link Here
1297
	configList->setFocus();
1308
	configList->setFocus();
1298
1309
1299
	menu = menuBar();
1310
	menu = menuBar();
1300
	toolBar = new QToolBar("Tools", this);
1311
	toolBar = new Q3ToolBar("Tools", this);
1301
1312
1302
	backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
1313
	backAction = new QAction(QPixmap(xpm_back), _("Back"), this);
1303
	  connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1314
	  connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1304
	  backAction->setEnabled(FALSE);
1315
	  backAction->setEnabled(FALSE);
1305
	QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
1316
	QAction *quitAction = new QAction(_("&Quit"), Qt::CTRL + Qt::Key_Q, this, 0);
1306
	  connect(quitAction, SIGNAL(activated()), SLOT(close()));
1317
	  connect(quitAction, SIGNAL(activated()), SLOT(close()));
1307
	QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
1318
	QAction *loadAction = new QAction(QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this, 0);
1308
	  connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1319
	  connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1309
	saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
1320
	saveAction = new QAction(QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this, 0);
1310
	  connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1321
	  connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1311
	conf_set_changed_callback(conf_changed);
1322
	conf_set_changed_callback(conf_changed);
1312
	// Set saveAction's initial state
1323
	// Set saveAction's initial state
1313
	conf_changed();
1324
	conf_changed();
1314
	QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
1325
	QAction *saveAsAction = new QAction(_("Save &As..."), 0, this, "Save As...");
1315
	  connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1326
	  connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1316
	QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
1327
	QAction *searchAction = new QAction(_("&Find"), Qt::CTRL + Qt::Key_F, this, "Find");
1317
	  connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1328
	  connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1318
	QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1329
	QAction *singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), 0, this, "Single View");
1319
	  connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
1330
	  connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
1320
	QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this);
1331
	QAction *splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), 0, this, "Split View");
1321
	  connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
1332
	  connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
1322
	QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this);
1333
	QAction *fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), 0, this, "Full View");
1323
	  connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
1334
	  connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
1324
1335
1325
	QAction *showNameAction = new QAction(NULL, _("Show Name"), 0, this);
1336
	QAction *showNameAction = new QAction(_("Show Name"), 0, this, 0);
1326
	  showNameAction->setToggleAction(TRUE);
1337
	  showNameAction->setToggleAction(TRUE);
1327
	  connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
1338
	  connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
1328
	  connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool)));
1339
	  connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool)));
1329
	  showNameAction->setOn(configView->showName());
1340
	  showNameAction->setOn(configView->showName());
1330
	QAction *showRangeAction = new QAction(NULL, _("Show Range"), 0, this);
1341
	QAction *showRangeAction = new QAction(_("Show Range"), 0, this, 0);
1331
	  showRangeAction->setToggleAction(TRUE);
1342
	  showRangeAction->setToggleAction(TRUE);
1332
	  connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
1343
	  connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
1333
	  connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool)));
1344
	  connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool)));
1334
	  showRangeAction->setOn(configList->showRange);
1345
	  showRangeAction->setOn(configList->showRange);
1335
	QAction *showDataAction = new QAction(NULL, _("Show Data"), 0, this);
1346
	QAction *showDataAction = new QAction(_("Show Data"), 0, this, 0);
1336
	  showDataAction->setToggleAction(TRUE);
1347
	  showDataAction->setToggleAction(TRUE);
1337
	  connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
1348
	  connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
1338
	  connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
1349
	  connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
Lines 1345-1353 Link Here
1345
	connect(optGroup, SIGNAL(selected(QAction *)), menuView,
1356
	connect(optGroup, SIGNAL(selected(QAction *)), menuView,
1346
		SLOT(setOptionMode(QAction *)));
1357
		SLOT(setOptionMode(QAction *)));
1347
1358
1348
	configView->showNormalAction = new QAction(NULL, _("Show Normal Options"), 0, optGroup);
1359
	configView->showNormalAction = new QAction(_("Show Normal Options"), 0, optGroup, 0);
1349
	configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup);
1360
	configView->showAllAction = new QAction(_("Show All Options"), 0, optGroup, 0);
1350
	configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup);
1361
	configView->showPromptAction = new QAction(_("Show Prompt Options"), 0, optGroup, 0);
1351
	configView->showNormalAction->setToggleAction(TRUE);
1362
	configView->showNormalAction->setToggleAction(TRUE);
1352
	configView->showNormalAction->setOn(configList->optMode == normalOpt);
1363
	configView->showNormalAction->setOn(configList->optMode == normalOpt);
1353
	configView->showAllAction->setToggleAction(TRUE);
1364
	configView->showAllAction->setToggleAction(TRUE);
Lines 1355-1369 Link Here
1355
	configView->showPromptAction->setToggleAction(TRUE);
1366
	configView->showPromptAction->setToggleAction(TRUE);
1356
	configView->showPromptAction->setOn(configList->optMode == promptOpt);
1367
	configView->showPromptAction->setOn(configList->optMode == promptOpt);
1357
1368
1358
	QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this);
1369
	QAction *showDebugAction = new QAction(_("Show Debug Info"), 0, this, 0);
1359
	  showDebugAction->setToggleAction(TRUE);
1370
	  showDebugAction->setToggleAction(TRUE);
1360
	  connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
1371
	  connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
1361
	  connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool)));
1372
	  connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool)));
1362
	  showDebugAction->setOn(helpText->showDebug());
1373
	  showDebugAction->setOn(helpText->showDebug());
1363
1374
1364
	QAction *showIntroAction = new QAction(NULL, _("Introduction"), 0, this);
1375
	QAction *showIntroAction = new QAction(_("Introduction"), 0, this, 0);
1365
	  connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro()));
1376
	  connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro()));
1366
	QAction *showAboutAction = new QAction(NULL, _("About"), 0, this);
1377
	QAction *showAboutAction = new QAction(_("About"), 0, this, 0);
1367
	  connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout()));
1378
	  connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout()));
1368
1379
1369
	// init tool bar
1380
	// init tool bar
Lines 1377-1383 Link Here
1377
	fullViewAction->addTo(toolBar);
1388
	fullViewAction->addTo(toolBar);
1378
1389
1379
	// create config menu
1390
	// create config menu
1380
	QPopupMenu* config = new QPopupMenu(this);
1391
	Q3PopupMenu* config = new Q3PopupMenu(this);
1381
	menu->insertItem(_("&File"), config);
1392
	menu->insertItem(_("&File"), config);
1382
	loadAction->addTo(config);
1393
	loadAction->addTo(config);
1383
	saveAction->addTo(config);
1394
	saveAction->addTo(config);
Lines 1386-1397 Link Here
1386
	quitAction->addTo(config);
1397
	quitAction->addTo(config);
1387
1398
1388
	// create edit menu
1399
	// create edit menu
1389
	QPopupMenu* editMenu = new QPopupMenu(this);
1400
	Q3PopupMenu* editMenu = new Q3PopupMenu(this);
1390
	menu->insertItem(_("&Edit"), editMenu);
1401
	menu->insertItem(_("&Edit"), editMenu);
1391
	searchAction->addTo(editMenu);
1402
	searchAction->addTo(editMenu);
1392
1403
1393
	// create options menu
1404
	// create options menu
1394
	QPopupMenu* optionMenu = new QPopupMenu(this);
1405
	Q3PopupMenu* optionMenu = new Q3PopupMenu(this);
1395
	menu->insertItem(_("&Option"), optionMenu);
1406
	menu->insertItem(_("&Option"), optionMenu);
1396
	showNameAction->addTo(optionMenu);
1407
	showNameAction->addTo(optionMenu);
1397
	showRangeAction->addTo(optionMenu);
1408
	showRangeAction->addTo(optionMenu);
Lines 1402-1432 Link Here
1402
	showDebugAction->addTo(optionMenu);
1413
	showDebugAction->addTo(optionMenu);
1403
1414
1404
	// create help menu
1415
	// create help menu
1405
	QPopupMenu* helpMenu = new QPopupMenu(this);
1416
	Q3PopupMenu* helpMenu = new Q3PopupMenu(this);
1406
	menu->insertSeparator();
1417
	menu->insertSeparator();
1407
	menu->insertItem(_("&Help"), helpMenu);
1418
	menu->insertItem(_("&Help"), helpMenu);
1408
	showIntroAction->addTo(helpMenu);
1419
	showIntroAction->addTo(helpMenu);
1409
	showAboutAction->addTo(helpMenu);
1420
	showAboutAction->addTo(helpMenu);
1410
1421
1411
	connect(configList, SIGNAL(menuChanged(struct menu *)),
1422
	connect(configList, SIGNAL(menuChanged(KCMenu *)),
1412
		helpText, SLOT(setInfo(struct menu *)));
1423
		helpText, SLOT(setInfo(KCMenu *)));
1413
	connect(configList, SIGNAL(menuSelected(struct menu *)),
1424
	connect(configList, SIGNAL(menuSelected(KCMenu *)),
1414
		SLOT(changeMenu(struct menu *)));
1425
		SLOT(changeMenu(KCMenu *)));
1415
	connect(configList, SIGNAL(parentSelected()),
1426
	connect(configList, SIGNAL(parentSelected()),
1416
		SLOT(goBack()));
1427
		SLOT(goBack()));
1417
	connect(menuList, SIGNAL(menuChanged(struct menu *)),
1428
	connect(menuList, SIGNAL(menuChanged(KCMenu *)),
1418
		helpText, SLOT(setInfo(struct menu *)));
1429
		helpText, SLOT(setInfo(KCMenu *)));
1419
	connect(menuList, SIGNAL(menuSelected(struct menu *)),
1430
	connect(menuList, SIGNAL(menuSelected(KCMenu *)),
1420
		SLOT(changeMenu(struct menu *)));
1431
		SLOT(changeMenu(KCMenu *)));
1421
1432
1422
	connect(configList, SIGNAL(gotFocus(struct menu *)),
1433
	connect(configList, SIGNAL(gotFocus(KCMenu *)),
1423
		helpText, SLOT(setInfo(struct menu *)));
1434
		helpText, SLOT(setInfo(KCMenu *)));
1424
	connect(menuList, SIGNAL(gotFocus(struct menu *)),
1435
	connect(menuList, SIGNAL(gotFocus(KCMenu *)),
1425
		helpText, SLOT(setInfo(struct menu *)));
1436
		helpText, SLOT(setInfo(KCMenu *)));
1426
	connect(menuList, SIGNAL(gotFocus(struct menu *)),
1437
	connect(menuList, SIGNAL(gotFocus(KCMenu *)),
1427
		SLOT(listFocusChanged(void)));
1438
		SLOT(listFocusChanged(void)));
1428
	connect(helpText, SIGNAL(menuSelected(struct menu *)),
1439
	connect(helpText, SIGNAL(menuSelected(KCMenu *)),
1429
		SLOT(setMenuLink(struct menu *)));
1440
		SLOT(setMenuLink(KCMenu *)));
1430
1441
1431
	QString listMode = configSettings->readEntry("/listMode", "symbol");
1442
	QString listMode = configSettings->readEntry("/listMode", "symbol");
1432
	if (listMode == "single")
1443
	if (listMode == "single")
Lines 1437-1443 Link Here
1437
		showSplitView();
1448
		showSplitView();
1438
1449
1439
	// UI setup done, restore splitter positions
1450
	// UI setup done, restore splitter positions
1440
	QValueList<int> sizes = configSettings->readSizes("/split1", &ok);
1451
	Q3ValueList<int> sizes = configSettings->readSizes("/split1", &ok);
1441
	if (ok)
1452
	if (ok)
1442
		split1->setSizes(sizes);
1453
		split1->setSizes(sizes);
1443
1454
Lines 1448-1454 Link Here
1448
1459
1449
void ConfigMainWindow::loadConfig(void)
1460
void ConfigMainWindow::loadConfig(void)
1450
{
1461
{
1451
	QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this);
1462
	QString s = Q3FileDialog::getOpenFileName(conf_get_configname(), NULL, this);
1452
	if (s.isNull())
1463
	if (s.isNull())
1453
		return;
1464
		return;
1454
	if (conf_read(QFile::encodeName(s)))
1465
	if (conf_read(QFile::encodeName(s)))
Lines 1464-1470 Link Here
1464
1475
1465
void ConfigMainWindow::saveConfigAs(void)
1476
void ConfigMainWindow::saveConfigAs(void)
1466
{
1477
{
1467
	QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this);
1478
	QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this);
1468
	if (s.isNull())
1479
	if (s.isNull())
1469
		return;
1480
		return;
1470
	if (conf_write(QFile::encodeName(s)))
1481
	if (conf_write(QFile::encodeName(s)))
Lines 1478-1484 Link Here
1478
	searchWindow->show();
1489
	searchWindow->show();
1479
}
1490
}
1480
1491
1481
void ConfigMainWindow::changeMenu(struct menu *menu)
1492
void ConfigMainWindow::changeMenu(KCMenu *menu)
1482
{
1493
{
1483
	configList->setRootMenu(menu);
1494
	configList->setRootMenu(menu);
1484
	if (configList->rootEntry->parent == &rootmenu)
1495
	if (configList->rootEntry->parent == &rootmenu)
Lines 1487-1495 Link Here
1487
		backAction->setEnabled(TRUE);
1498
		backAction->setEnabled(TRUE);
1488
}
1499
}
1489
1500
1490
void ConfigMainWindow::setMenuLink(struct menu *menu)
1501
void ConfigMainWindow::setMenuLink(KCMenu *menu)
1491
{
1502
{
1492
	struct menu *parent;
1503
	KCMenu *parent;
1493
	ConfigList* list = NULL;
1504
	ConfigList* list = NULL;
1494
	ConfigItem* item;
1505
	ConfigItem* item;
1495
1506
Lines 1692-1700 Link Here
1692
		saveAction->setEnabled(conf_get_changed());
1703
		saveAction->setEnabled(conf_get_changed());
1693
}
1704
}
1694
1705
1695
void fixup_rootmenu(struct menu *menu)
1706
void fixup_rootmenu(KCMenu *menu)
1696
{
1707
{
1697
	struct menu *child;
1708
	KCMenu *child;
1698
	static int menu_cnt = 0;
1709
	static int menu_cnt = 0;
1699
1710
1700
	menu->flags |= MENU_ROOT;
1711
	menu->flags |= MENU_ROOT;

Return to bug 342007