SIEdit/app/mainwindow.h

90 lines
1.6 KiB
C
Raw Normal View History

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>
2023-09-14 13:14:49 -04:00
#include <QPlainTextEdit>
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"
#include "panel.h"
#include "vector3edit.h"
#include "viewer/mediapanel.h"
2022-06-23 21:36:00 -04:00
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
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_;
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_;
MediaPanel *panel_media_;
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_;
QGroupBox *properties_group_;
2023-09-14 13:14:49 -04:00
QPlainTextEdit *m_extraEdit;
Vector3Edit *m_LocationEdit;
2023-08-23 17:34:23 -04:00
Vector3Edit *m_UpEdit;
QSpinBox *start_time_edit_;
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();
2023-09-14 13:14:49 -04:00
void ExtraChanged();
void LocationChanged(const si::Vector3 &v);
2023-08-23 17:34:23 -04:00
void UpChanged(const si::Vector3 &v);
void StartTimeChanged(int t);
2022-06-23 21:36:00 -04:00
};
#endif // MAINWINDOW_H