rockbox/utils/regtools/qeditor/regtab.h
Amaury Pouly 970c2482dd qeditor: rework modified indicator, register tab names depend on content
Because Qt doesn't support QObject multiple inherance, it is a bit tricky
to have a base class which interact with the UI. The register tab name
now display:
- file dump name (for dumps)
- hwstub device path (for hwstub)
And the register editor display the filename
Change-Id: If2579992098c02627c67d560c824f1668e73bc45
Reviewed-on: http://gerrit.rockbox.org/979
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-19 10:58:33 +02:00

92 lines
No EOL
2.3 KiB
C++

#ifndef REGTAB_H
#define REGTAB_H
#include <QComboBox>
#include <QTreeWidget>
#include <QVBoxLayout>
#include <QTabWidget>
#include <QSplitter>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QListWidget>
#include <QGroupBox>
#include <QToolButton>
#include <QMenu>
#include <QCheckBox>
#include "backend.h"
#include "settings.h"
#include "mainwindow.h"
#include "utils.h"
class RegTabPanel
{
public:
RegTabPanel() {}
virtual ~RegTabPanel() {}
virtual void AllowWrite(bool en) = 0;
virtual QWidget *GetWidget() = 0;
};
class EmptyRegTabPanel : public QWidget, public RegTabPanel
{
public:
EmptyRegTabPanel(QWidget *parent = 0);
void AllowWrite(bool en);
QWidget *GetWidget();
};
class RegTab : public QSplitter, public DocumentTab
{
Q_OBJECT
public:
RegTab(Backend *backend, QWidget *parent = 0);
~RegTab();
virtual bool Quit();
virtual QWidget *GetWidget();
protected:
void FillDevSubTree(QTreeWidgetItem *item);
void FillSocSubTree(QTreeWidgetItem *item);
void FillRegTree();
void FillAnalyserList();
void UpdateSocList();
void DisplayRegister(const SocRegRef& ref);
void DisplayDevice(const SocDevRef& ref);
void DisplaySoc(const SocRef& ref);
void SetDataSocName(const QString& socname);
void SetPanel(RegTabPanel *panel);
void UpdateSocFilename();
void UpdateTabName();
QComboBox *m_soc_selector;
BackendSelector *m_backend_selector;
Backend *m_backend;
QTreeWidget *m_reg_tree;
SocRef m_cur_soc;
QVBoxLayout *m_right_panel;
RegTabPanel *m_right_content;
QCheckBox *m_readonly_check;
QLabel *m_data_soc_label;
QPushButton *m_data_sel_reload;
QPushButton *m_dump;
IoBackend *m_io_backend;
QTabWidget *m_type_selector;
QListWidget *m_analysers_list;
private slots:
void SetReadOnlyIndicator();
void OnSocChanged(int index);
void OnSocListChanged();
void OnRegItemClicked(QTreeWidgetItem *clicked, int col);
void OnBackendSelect(IoBackend *backend);
void OnDataChanged();
void OnDataSocActivated(const QString&);
void OnAnalyserClicked(QListWidgetItem *clicked);
void OnReadOnlyClicked(bool);
void OnDumpRegs(bool);
void OnBackendReload(bool);
void OnTypeChanged(int index);
};
#endif /* REGTAB_H */