Commit 43bf612a authored by Roman Zippel's avatar Roman Zippel Committed by Sam Ravnborg

kconfig: Add search option for xconfig

Implement a simple search request for xconfig.  Currently the capabilities are
rather simple (the same as menuconfig).
Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent face4374
This diff is collapsed.
...@@ -36,7 +36,7 @@ class ConfigView : public QVBox { ...@@ -36,7 +36,7 @@ class ConfigView : public QVBox {
Q_OBJECT Q_OBJECT
typedef class QVBox Parent; typedef class QVBox Parent;
public: public:
ConfigView(QWidget* parent, ConfigMainWindow* cview, ConfigSettings* configSettings); ConfigView(QWidget* parent, ConfigSettings* configSettings);
~ConfigView(void); ~ConfigView(void);
static void updateList(ConfigItem* item); static void updateList(ConfigItem* item);
static void updateListAll(void); static void updateListAll(void);
...@@ -53,14 +53,14 @@ enum colIdx { ...@@ -53,14 +53,14 @@ enum colIdx {
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
}; };
enum listMode { enum listMode {
singleMode, menuMode, symbolMode, fullMode singleMode, menuMode, symbolMode, fullMode, listMode
}; };
class ConfigList : public QListView { class ConfigList : public QListView {
Q_OBJECT Q_OBJECT
typedef class QListView Parent; typedef class QListView Parent;
public: public:
ConfigList(ConfigView* p, ConfigMainWindow* cview, ConfigSettings *configSettings); ConfigList(ConfigView* p, ConfigSettings *configSettings);
void reinit(void); void reinit(void);
ConfigView* parent(void) const ConfigView* parent(void) const
{ {
...@@ -68,8 +68,6 @@ class ConfigList : public QListView { ...@@ -68,8 +68,6 @@ class ConfigList : public QListView {
} }
protected: protected:
ConfigMainWindow* cview;
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
void contentsMousePressEvent(QMouseEvent *e); void contentsMousePressEvent(QMouseEvent *e);
void contentsMouseReleaseEvent(QMouseEvent *e); void contentsMouseReleaseEvent(QMouseEvent *e);
...@@ -84,6 +82,7 @@ public slots: ...@@ -84,6 +82,7 @@ public slots:
void changeValue(ConfigItem* item); void changeValue(ConfigItem* item);
void updateSelection(void); void updateSelection(void);
signals: signals:
void menuChanged(struct menu *menu);
void menuSelected(struct menu *menu); void menuSelected(struct menu *menu);
void parentSelected(void); void parentSelected(void);
void gotFocus(void); void gotFocus(void);
...@@ -208,9 +207,7 @@ class ConfigLineEdit : public QLineEdit { ...@@ -208,9 +207,7 @@ class ConfigLineEdit : public QLineEdit {
Q_OBJECT Q_OBJECT
typedef class QLineEdit Parent; typedef class QLineEdit Parent;
public: public:
ConfigLineEdit(ConfigView* parent) ConfigLineEdit(ConfigView* parent);
: Parent(parent)
{ }
ConfigView* parent(void) const ConfigView* parent(void) const
{ {
return (ConfigView*)Parent::parent(); return (ConfigView*)Parent::parent();
...@@ -222,6 +219,47 @@ class ConfigLineEdit : public QLineEdit { ...@@ -222,6 +219,47 @@ class ConfigLineEdit : public QLineEdit {
ConfigItem *item; ConfigItem *item;
}; };
class ConfigInfoView : public QTextBrowser {
Q_OBJECT
typedef class QTextBrowser Parent;
public:
ConfigInfoView(QWidget* parent, const char *name = 0);
bool showDebug(void) const { return _showDebug; }
public slots:
void setInfo(struct menu *menu);
void setSource(const QString& name);
void setShowDebug(bool);
signals:
void showDebugChanged(bool);
protected:
void menuInfo(void);
QString debug_info(struct symbol *sym);
static QString print_filter(const QString &str);
static void expr_print_help(void *data, const char *str);
struct menu *menu;
bool _showDebug;
};
class ConfigSearchWindow : public QDialog {
Q_OBJECT
typedef class QDialog Parent;
public:
ConfigSearchWindow(QWidget* parent);
public slots:
void search(void);
protected:
QLineEdit* editField;
QPushButton* searchButton;
ConfigView* list;
ConfigInfoView* info;
struct symbol **result;
};
class ConfigMainWindow : public QMainWindow { class ConfigMainWindow : public QMainWindow {
Q_OBJECT Q_OBJECT
public: public:
...@@ -234,11 +272,11 @@ public slots: ...@@ -234,11 +272,11 @@ public slots:
void loadConfig(void); void loadConfig(void);
void saveConfig(void); void saveConfig(void);
void saveConfigAs(void); void saveConfigAs(void);
void searchConfig(void);
void showSingleView(void); void showSingleView(void);
void showSplitView(void); void showSplitView(void);
void showFullView(void); void showFullView(void);
void setShowAll(bool); void setShowAll(bool);
void setShowDebug(bool);
void setShowRange(bool); void setShowRange(bool);
void setShowName(bool); void setShowName(bool);
void setShowData(bool); void setShowData(bool);
...@@ -249,15 +287,14 @@ public slots: ...@@ -249,15 +287,14 @@ public slots:
protected: protected:
void closeEvent(QCloseEvent *e); void closeEvent(QCloseEvent *e);
ConfigSearchWindow *searchWindow;
ConfigView *menuView; ConfigView *menuView;
ConfigList *menuList; ConfigList *menuList;
ConfigView *configView; ConfigView *configView;
ConfigList *configList; ConfigList *configList;
QTextView *helpText; ConfigInfoView *helpText;
QToolBar *toolBar; QToolBar *toolBar;
QAction *backAction; QAction *backAction;
QSplitter* split1; QSplitter* split1;
QSplitter* split2; QSplitter* split2;
bool showDebug;
}; };
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