Commit 8a41374c authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[PATCH] kconfig: updates

- allow double click to start edit of string symbols
- help text by Rod.VanMeter@nokia.com
- small reorganiztion to prepare for new features
parent b2737a08
This diff is collapsed.
...@@ -5,9 +5,27 @@ ...@@ -5,9 +5,27 @@
#include <qlistview.h> #include <qlistview.h>
class ConfigLineEdit; class ConfigList;
class ConfigItem; class ConfigItem;
class ConfigView; class ConfigLineEdit;
class ConfigMainWindow;
class ConfigView : public QVBox {
Q_OBJECT
typedef class QVBox Parent;
public:
ConfigView(QWidget* parent, ConfigMainWindow* cview);
~ConfigView(void);
static void updateList(ConfigItem* item);
static void updateListAll(void);
public:
ConfigList* list;
ConfigLineEdit* lineEdit;
static ConfigView* viewList;
ConfigView* nextView;
};
enum colIdx { enum colIdx {
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
...@@ -20,12 +38,15 @@ class ConfigList : public QListView { ...@@ -20,12 +38,15 @@ class ConfigList : public QListView {
Q_OBJECT Q_OBJECT
typedef class QListView Parent; typedef class QListView Parent;
public: public:
ConfigList(QWidget* p, ConfigView* cview); ConfigList(ConfigView* p, ConfigMainWindow* cview);
void reinit(void); void reinit(void);
ConfigView* parent(void) const
{
return (ConfigView*)Parent::parent();
}
ConfigLineEdit* lineEdit;
protected: protected:
ConfigView* cview; ConfigMainWindow* cview;
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
void contentsMousePressEvent(QMouseEvent *e); void contentsMousePressEvent(QMouseEvent *e);
...@@ -43,7 +64,6 @@ public slots: ...@@ -43,7 +64,6 @@ public slots:
signals: signals:
void menuSelected(struct menu *menu); void menuSelected(struct menu *menu);
void parentSelected(void); void parentSelected(void);
void symbolChanged(ConfigItem* item);
void gotFocus(void); void gotFocus(void);
public: public:
...@@ -100,13 +120,13 @@ public slots: ...@@ -100,13 +120,13 @@ public slots:
class ConfigItem : public QListViewItem { class ConfigItem : public QListViewItem {
typedef class QListViewItem Parent; typedef class QListViewItem Parent;
public: public:
ConfigItem(QListView *parent, ConfigItem *after, struct menu *m) ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v)
: Parent(parent, after), menu(m) : Parent(parent, after), menu(m), visible(v)
{ {
init(); init();
} }
ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m) ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
: Parent(parent, after), menu(m) : Parent(parent, after), menu(m), visible(v)
{ {
init(); init();
} }
...@@ -116,6 +136,7 @@ class ConfigItem : public QListViewItem { ...@@ -116,6 +136,7 @@ class ConfigItem : public QListViewItem {
void okRename(int col); void okRename(int col);
#endif #endif
void updateMenu(void); void updateMenu(void);
bool updateNeeded(void);
ConfigList* listView() const ConfigList* listView() const
{ {
return (ConfigList*)Parent::listView(); return (ConfigList*)Parent::listView();
...@@ -146,31 +167,33 @@ class ConfigItem : public QListViewItem { ...@@ -146,31 +167,33 @@ class ConfigItem : public QListViewItem {
} }
void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align); void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
ConfigItem* nextItem;
struct menu *menu; struct menu *menu;
bool visible; bool visible;
bool doInit;
}; };
class ConfigLineEdit : public QLineEdit { class ConfigLineEdit : public QLineEdit {
Q_OBJECT Q_OBJECT
typedef class QLineEdit Parent; typedef class QLineEdit Parent;
public: public:
ConfigLineEdit(QWidget * parent) ConfigLineEdit(ConfigView* parent)
: QLineEdit(parent) : Parent(parent)
{ } { }
ConfigView* parent(void) const
{
return (ConfigView*)Parent::parent();
}
void show(ConfigItem *i); void show(ConfigItem *i);
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
signals:
void lineChanged(ConfigItem *item);
public: public:
ConfigItem *item; ConfigItem *item;
}; };
class ConfigView : public QMainWindow { class ConfigMainWindow : public QMainWindow {
Q_OBJECT Q_OBJECT
public: public:
ConfigView(void); ConfigMainWindow(void);
public slots: public slots:
void setHelp(QListViewItem* item); void setHelp(QListViewItem* item);
void changeMenu(struct menu *); void changeMenu(struct menu *);
...@@ -187,6 +210,8 @@ public slots: ...@@ -187,6 +210,8 @@ public slots:
void setShowRange(bool); void setShowRange(bool);
void setShowName(bool); void setShowName(bool);
void setShowData(bool); void setShowData(bool);
void showIntro(void);
void showAbout(void);
protected: protected:
void closeEvent(QCloseEvent *e); void closeEvent(QCloseEvent *e);
......
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