2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
3 * Released under the terms of the GNU GPL v2.0.
6 #include <QTextBrowser>
10 #include <qsettings.h>
11 #include <QPushButton>
21 class ConfigMainWindow;
23 class ConfigSettings : public QSettings {
26 QList<int> readSizes(const QString& key, bool *ok);
27 bool writeSizes(const QString& key, const QList<int>& value);
31 promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
34 singleMode, menuMode, symbolMode, fullMode, listMode
37 normalOpt = 0, allOpt, promptOpt
40 class ConfigLineEdit : public QLineEdit {
42 typedef class QLineEdit Parent;
44 ConfigLineEdit(ConfigView* parent);
45 ConfigView* parent(void) const
47 return (ConfigView*)Parent::parent();
49 void show(QTreeWidgetItem *i);
50 void keyPressEvent(QKeyEvent *e);
53 QTreeWidgetItem *item;
56 class ConfigView : public QWidget {
58 typedef class QWidget Parent;
60 ConfigView(QWidget* parent, const char *name = 0);
62 static void updateList(QTreeWidgetItem* item);
63 static void updateListAll(void);
65 bool showName(void) const { return false; } // TODO: Implement me.
66 bool showRange(void) const { return false; } // TODO: Implement me.
67 bool showData(void) const { return false; } // TODO: Implement me.
69 void setShowName(bool);
70 void setShowRange(bool);
71 void setShowData(bool);
72 void setOptionMode(QAction *);
74 void showNameChanged(bool);
75 void showRangeChanged(bool);
76 void showDataChanged(bool);
79 ConfigLineEdit* lineEdit;
81 static ConfigView* viewList;
84 static QAction *showNormalAction;
85 static QAction *showAllAction;
86 static QAction *showPromptAction;
89 class ConfigInfoView : public QTextBrowser {
91 typedef class QTextBrowser Parent;
93 ConfigInfoView(QWidget* parent, const char *name = 0);
94 bool showDebug(void) const { return _showDebug; }
97 void setInfo(struct menu *menu);
98 void saveSettings(void);
99 void setShowDebug(bool);
102 void showDebugChanged(bool);
103 void menuSelected(struct menu *);
106 void symbolInfo(void);
108 QString debug_info(struct symbol *sym);
109 static QString print_filter(const QString &str);
110 static void expr_print_help(void *data, struct symbol *sym, const char *str);
111 QMenu *createStandardContextMenu(const QPoint & pos);
112 void contextMenuEvent(QContextMenuEvent *e);
119 class ConfigSearchWindow : public QDialog {
121 typedef class QDialog Parent;
123 ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0);
126 void saveSettings(void);
130 QLineEdit* editField;
131 QPushButton* searchButton;
134 ConfigInfoView* info;
136 struct symbol **result;
139 class ConfigMainWindow : public QMainWindow {
142 static QAction *saveAction;
143 static void conf_changed(void);
145 ConfigMainWindow(void);
147 void changeMenu(struct menu *);
148 void setMenuLink(struct menu *);
149 void listFocusChanged(void);
151 void loadConfig(void);
152 bool saveConfig(void);
153 void saveConfigAs(void);
154 void searchConfig(void);
155 void showSingleView(void);
156 void showSplitView(void);
157 void showFullView(void);
158 void showIntro(void);
159 void showAbout(void);
160 void saveSettings(void);
163 void closeEvent(QCloseEvent *e);
165 ConfigSearchWindow *searchWindow;
166 ConfigView *menuView;
167 QTreeWidget *menuList;
168 ConfigView *configView;
169 QTreeWidget *configList;
170 ConfigInfoView *helpText;
173 QAction *singleViewAction;
174 QAction *splitViewAction;
175 QAction *fullViewAction;