Commit f9893351 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'kconfig-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kconfig updates from Masahiro Yamada:

 - Remove unused or useless code from qconf

 - Allow to edit "int", "hex", "string" options in place, and remove the
   separate edit box from qconf

* tag 'kconfig-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kconfig: qconf: create QApplication after option checks
  kconfig: qconf: remove Y, M, N columns
  kconfig: qconf: remove ConfigView class
  kconfig: qconf: move setShowName/Range() to ConfigList from ConfigView
  kconfig: qconf: remove ConfigLineEdit class
  kconfig: qconf: allow to edit "int", "hex", "string" menus in-place
  kconfig: qconf: show data column all the time
  kconfig: qconf: move ConfigView::updateList(All) to ConfigList class
  kconfig: qconf: remove unused ConfigItem::okRename()
  kconfig: qconf: update the intro message to match to the current code
  kconfig: qconf: reformat the intro message
parents 746b25b1 f9a825a7
This diff is collapsed.
...@@ -11,15 +11,14 @@ ...@@ -11,15 +11,14 @@
#include <QPushButton> #include <QPushButton>
#include <QSettings> #include <QSettings>
#include <QSplitter> #include <QSplitter>
#include <QStyledItemDelegate>
#include <QTextBrowser> #include <QTextBrowser>
#include <QTreeWidget> #include <QTreeWidget>
#include "expr.h" #include "expr.h"
class ConfigView;
class ConfigList; class ConfigList;
class ConfigItem; class ConfigItem;
class ConfigLineEdit;
class ConfigMainWindow; class ConfigMainWindow;
class ConfigSettings : public QSettings { class ConfigSettings : public QSettings {
...@@ -30,7 +29,7 @@ class ConfigSettings : public QSettings { ...@@ -30,7 +29,7 @@ class ConfigSettings : public QSettings {
}; };
enum colIdx { enum colIdx {
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx promptColIdx, nameColIdx, dataColIdx
}; };
enum listMode { enum listMode {
singleMode, menuMode, symbolMode, fullMode, listMode singleMode, menuMode, symbolMode, fullMode, listMode
...@@ -43,13 +42,10 @@ class ConfigList : public QTreeWidget { ...@@ -43,13 +42,10 @@ class ConfigList : public QTreeWidget {
Q_OBJECT Q_OBJECT
typedef class QTreeWidget Parent; typedef class QTreeWidget Parent;
public: public:
ConfigList(ConfigView* p, const char *name = 0); ConfigList(QWidget *parent, const char *name = 0);
~ConfigList();
void reinit(void); void reinit(void);
ConfigItem* findConfigItem(struct menu *); ConfigItem* findConfigItem(struct menu *);
ConfigView* parent(void) const
{
return (ConfigView*)Parent::parent();
}
void setSelected(QTreeWidgetItem *item, bool enable) { void setSelected(QTreeWidgetItem *item, bool enable) {
for (int i = 0; i < selectedItems().size(); i++) for (int i = 0; i < selectedItems().size(); i++)
selectedItems().at(i)->setSelected(false); selectedItems().at(i)->setSelected(false);
...@@ -75,6 +71,7 @@ public slots: ...@@ -75,6 +71,7 @@ public slots:
void updateSelection(void); void updateSelection(void);
void saveSettings(void); void saveSettings(void);
void setOptionMode(QAction *action); void setOptionMode(QAction *action);
void setShowName(bool on);
signals: signals:
void menuChanged(struct menu *menu); void menuChanged(struct menu *menu);
...@@ -82,6 +79,7 @@ public slots: ...@@ -82,6 +79,7 @@ public slots:
void itemSelected(struct menu *menu); void itemSelected(struct menu *menu);
void parentSelected(void); void parentSelected(void);
void gotFocus(struct menu *); void gotFocus(struct menu *);
void showNameChanged(bool on);
public: public:
void updateListAll(void) void updateListAll(void)
...@@ -100,7 +98,7 @@ public slots: ...@@ -100,7 +98,7 @@ public slots:
bool updateAll; bool updateAll;
bool showName, showRange, showData; bool showName;
enum listMode mode; enum listMode mode;
enum optionMode optMode; enum optionMode optMode;
struct menu *rootEntry; struct menu *rootEntry;
...@@ -108,6 +106,10 @@ public slots: ...@@ -108,6 +106,10 @@ public slots:
QPalette inactivedColorGroup; QPalette inactivedColorGroup;
QMenu* headerPopup; QMenu* headerPopup;
static QList<ConfigList *> allLists;
static void updateListForAll();
static void updateListAllForAll();
static QAction *showNormalAction, *showAllAction, *showPromptAction; static QAction *showNormalAction, *showAllAction, *showPromptAction;
}; };
...@@ -131,7 +133,6 @@ class ConfigItem : public QTreeWidgetItem { ...@@ -131,7 +133,6 @@ class ConfigItem : public QTreeWidgetItem {
} }
~ConfigItem(void); ~ConfigItem(void);
void init(void); void init(void);
void okRename(int col);
void updateMenu(void); void updateMenu(void);
void testUpdateMenu(bool v); void testUpdateMenu(bool v);
ConfigList* listView() const ConfigList* listView() const
...@@ -168,48 +169,18 @@ class ConfigItem : public QTreeWidgetItem { ...@@ -168,48 +169,18 @@ class ConfigItem : public QTreeWidgetItem {
static QIcon menuIcon, menubackIcon; static QIcon menuIcon, menubackIcon;
}; };
class ConfigLineEdit : public QLineEdit { class ConfigItemDelegate : public QStyledItemDelegate
Q_OBJECT {
typedef class QLineEdit Parent; private:
public: struct menu *menu;
ConfigLineEdit(ConfigView* parent);
ConfigView* parent(void) const
{
return (ConfigView*)Parent::parent();
}
void show(ConfigItem *i);
void keyPressEvent(QKeyEvent *e);
public:
ConfigItem *item;
};
class ConfigView : public QWidget {
Q_OBJECT
typedef class QWidget Parent;
public:
ConfigView(QWidget* parent, const char *name = 0);
~ConfigView(void);
static void updateList();
static void updateListAll(void);
bool showName(void) const { return list->showName; }
bool showRange(void) const { return list->showRange; }
bool showData(void) const { return list->showData; }
public slots:
void setShowName(bool);
void setShowRange(bool);
void setShowData(bool);
signals:
void showNameChanged(bool);
void showRangeChanged(bool);
void showDataChanged(bool);
public: public:
ConfigList* list; ConfigItemDelegate(QObject *parent = nullptr)
ConfigLineEdit* lineEdit; : QStyledItemDelegate(parent) {}
QWidget *createEditor(QWidget *parent,
static ConfigView* viewList; const QStyleOptionViewItem &option,
ConfigView* nextView; const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const override;
}; };
class ConfigInfoView : public QTextBrowser { class ConfigInfoView : public QTextBrowser {
...@@ -257,7 +228,7 @@ public slots: ...@@ -257,7 +228,7 @@ public slots:
QLineEdit* editField; QLineEdit* editField;
QPushButton* searchButton; QPushButton* searchButton;
QSplitter* split; QSplitter* split;
ConfigView* list; ConfigList *list;
ConfigInfoView* info; ConfigInfoView* info;
struct symbol **result; struct symbol **result;
...@@ -292,9 +263,7 @@ public slots: ...@@ -292,9 +263,7 @@ public slots:
void closeEvent(QCloseEvent *e); void closeEvent(QCloseEvent *e);
ConfigSearchWindow *searchWindow; ConfigSearchWindow *searchWindow;
ConfigView *menuView;
ConfigList *menuList; ConfigList *menuList;
ConfigView *configView;
ConfigList *configList; ConfigList *configList;
ConfigInfoView *helpText; ConfigInfoView *helpText;
QAction *backAction; QAction *backAction;
......
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