2022-06-23 21:36:00 -04:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
#include <interleaf.h>
|
|
|
|
#include <object.h>
|
|
|
|
#include <QGroupBox>
|
2022-06-23 21:36:00 -04:00
|
|
|
#include <QMainWindow>
|
2022-06-24 13:46:25 -04:00
|
|
|
#include <QStackedWidget>
|
2022-07-04 02:34:49 -04:00
|
|
|
#include <QTreeView>
|
2022-06-23 21:36:00 -04:00
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
#include "objectmodel.h"
|
2022-07-10 23:51:49 -04:00
|
|
|
#include "panel.h"
|
2022-07-11 04:48:50 -04:00
|
|
|
#include "viewer/bitmappanel.h"
|
|
|
|
#include "viewer/wavpanel.h"
|
2022-06-23 21:36:00 -04:00
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
void OpenFilename(const QString &s);
|
|
|
|
|
2022-06-23 21:36:00 -04:00
|
|
|
signals:
|
|
|
|
|
|
|
|
private:
|
|
|
|
void InitializeMenuBar();
|
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
void SetPanel(Panel *panel, si::Object *chunk);
|
|
|
|
|
|
|
|
void ExtractObject(si::Object *obj);
|
2022-07-18 03:27:00 -04:00
|
|
|
void ReplaceObject(si::Object *obj);
|
|
|
|
|
|
|
|
static bool OpenInterleafFileInternal(QWidget *parent, si::Interleaf *interleaf, const QString &s);
|
|
|
|
|
|
|
|
QString GetOpenFileName();
|
|
|
|
|
|
|
|
static const QString kFileFilter;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
|
|
|
QStackedWidget *config_stack_;
|
|
|
|
|
2022-07-10 23:51:49 -04:00
|
|
|
QTreeView *tree_;
|
2022-07-04 02:34:49 -04:00
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
QGroupBox *action_grp_;
|
|
|
|
|
2022-06-24 13:46:25 -04:00
|
|
|
Panel *panel_blank_;
|
2022-07-11 04:48:50 -04:00
|
|
|
WavPanel *panel_wav_;
|
|
|
|
BitmapPanel *panel_bmp_;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-07-11 04:48:50 -04:00
|
|
|
ObjectModel model_;
|
|
|
|
si::Interleaf interleaf_;
|
|
|
|
|
|
|
|
si::Object *last_set_data_;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-07-18 03:27:00 -04:00
|
|
|
QString current_filename_;
|
|
|
|
|
2022-06-23 21:36:00 -04:00
|
|
|
private slots:
|
2022-07-18 03:27:00 -04:00
|
|
|
void NewFile();
|
2022-06-23 21:36:00 -04:00
|
|
|
void OpenFile();
|
2022-07-18 03:27:00 -04:00
|
|
|
bool SaveFile();
|
|
|
|
bool SaveFileAs();
|
2022-07-11 17:20:05 -04:00
|
|
|
|
2022-06-24 13:46:25 -04:00
|
|
|
void SelectionChanged(const QModelIndex &index);
|
|
|
|
|
2022-07-04 02:34:49 -04:00
|
|
|
void ShowContextMenu(const QPoint &p);
|
|
|
|
|
|
|
|
void ExtractSelectedItems();
|
2022-07-11 04:48:50 -04:00
|
|
|
void ExtractClicked();
|
|
|
|
|
2022-07-18 03:27:00 -04:00
|
|
|
void ReplaceClicked();
|
|
|
|
|
|
|
|
void ViewSIFile();
|
|
|
|
|
2022-06-23 21:36:00 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|