Commit 8ba891bb authored by hjk's avatar hjk

debugger: progress on action generalization

mostly renamings
parent f54440b4
This diff is collapsed.
......@@ -42,17 +42,17 @@ class QSettings;
QT_END_NAMESPACE
namespace Debugger {
namespace Internal {
namespace Core {
namespace Utils {
enum ApplyMode { ImmediateApply, DeferedApply };
class DebuggerAction : public QAction
class SavedAction : public QAction
{
Q_OBJECT
public:
DebuggerAction(QObject *parent = 0);
SavedAction(QObject *parent = 0);
virtual QVariant value() const;
Q_SLOT virtual void setValue(const QVariant &value, bool doemit = true);
......@@ -103,20 +103,27 @@ private:
ApplyMode m_applyMode;
};
class DebuggerSettingsGroup
class SavedActionSet
{
public:
DebuggerSettingsGroup() {}
~DebuggerSettingsGroup() {}
SavedActionSet() {}
~SavedActionSet() {}
void insert(DebuggerAction *action, QWidget *widget);
void insert(SavedAction *action, QWidget *widget);
void apply(QSettings *settings);
void finish();
void clear() { m_list.clear(); }
private:
QList<DebuggerAction *> m_list;
QList<SavedAction *> m_list;
};
} // namespace Utils
} // namespace Core
namespace Debugger {
namespace Internal {
class DebuggerSettings : public QObject
{
......@@ -126,8 +133,8 @@ public:
DebuggerSettings(QObject *parent = 0);
~DebuggerSettings();
void insertItem(int code, DebuggerAction *item);
DebuggerAction *item(int code);
void insertItem(int code, Core::Utils::SavedAction *item);
Core::Utils::SavedAction *item(int code);
QString dump();
......@@ -136,7 +143,7 @@ public slots:
void writeSettings(QSettings *settings);
private:
QHash<int, DebuggerAction *> m_items;
QHash<int, Core::Utils::SavedAction *> m_items;
};
......@@ -199,7 +206,7 @@ enum DebuggerActionCode
// singleton access
DebuggerSettings *theDebuggerSettings();
DebuggerAction *theDebuggerAction(int code);
Core::Utils::SavedAction *theDebuggerAction(int code);
// convienience
bool theDebuggerBoolSetting(int code);
......
......@@ -259,7 +259,7 @@ private:
Ui::GdbOptionPage m_ui;
DebuggerPlugin *m_plugin;
DebuggerSettingsGroup m_group;
Core::Utils::SavedActionSet m_group;
};
QWidget *GdbOptionPage::createPage(QWidget *parent)
......@@ -273,6 +273,7 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
m_ui.terminalChooser->setExpectedKind(Core::Utils::PathChooser::Command);
m_ui.terminalChooser->setPromptDialogTitle(tr("Choose Location of Terminal Application"));
m_group.clear();
m_group.insert(theDebuggerAction(GdbLocation),
m_ui.gdbLocationChooser);
m_group.insert(theDebuggerAction(GdbScriptFile),
......@@ -291,6 +292,8 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
m_group.insert(theDebuggerAction(SelectedPluginBreakpointsPattern),
m_ui.lineEditSelectedPluginBreakpointsPattern);
m_group.insert(theDebuggerAction(ListSourceFiles),
m_ui.checkBoxListSourceFiles);
m_group.insert(theDebuggerAction(SkipKnownFrames),
m_ui.checkBoxSkipKnownFrames);
m_group.insert(theDebuggerAction(UseToolTips),
......@@ -346,7 +349,7 @@ private:
Ui::DumperOptionPage m_ui;
DebuggerPlugin *m_plugin;
DebuggerSettingsGroup m_group;
Core::Utils::SavedActionSet m_group;
};
QWidget *DumperOptionPage::createPage(QWidget *parent)
......@@ -362,6 +365,7 @@ QWidget *DumperOptionPage::createPage(QWidget *parent)
connect(m_ui.radioButtonUsePrebuiltDumpers, SIGNAL(toggled(bool)),
m_ui.dumperLocationChooser, SLOT(setEnabled(bool)));
m_group.clear();
m_group.insert(theDebuggerAction(UseQtDumpers),
m_ui.radioButtonUseQtDumpers);
m_group.insert(theDebuggerAction(UsePrebuiltDumpers),
......
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