91 lines
2.5 KiB
C++
91 lines
2.5 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include "gschighlighter.h"
|
|
#include "gsceditor.h"
|
|
|
|
#include <QMainWindow>
|
|
#include <QTreeWidgetItem>
|
|
#include <QTextEdit>
|
|
|
|
#define MAX_RECENT_FILES 10
|
|
#define MAX_RECENT_FOLDERS 10
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
QT_END_NAMESPACE
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
GSCEditor *createEditor(QString aTabName, QString aPath);
|
|
void saveFile(const QByteArray &aData, const QString aFilePath);
|
|
|
|
QAbstractItemModel *modelFromFile(const QString &fileName);
|
|
|
|
private slots:
|
|
void on_actionOpen_Folder_triggered();
|
|
void on_actionConsole_triggered();
|
|
void on_actionDeveloperMode_triggered();
|
|
void on_actionFive_State_Modding_Website_triggered();
|
|
void on_action5SM_Discord_triggered();
|
|
void on_actionAbout_Sanguine_triggered();
|
|
void on_actionRedLine_Solutions_Website_triggered();
|
|
void on_actionOpenGSC_File_gsc_triggered();
|
|
void on_actionOpenText_File_txt_triggered();
|
|
void on_actionNewGSC_File_gsc_triggered();
|
|
void on_actionNewText_File_txt_triggered();
|
|
void on_treeWidget_itemSelectionChanged();
|
|
void on_tabWidget_customContextMenuRequested(const QPoint &pos);
|
|
void on_actionRemove_Comments_triggered();
|
|
void on_actionBeautify_Code_triggered();
|
|
void on_actionClear_Saved_Data_triggered();
|
|
|
|
void on_treeWidget_customContextMenuRequested(const QPoint &pos);
|
|
|
|
private:
|
|
void openFile(const QString& aFilePath);
|
|
void pinFile(const QString& aFilePath);
|
|
void updatePinnedFiles();
|
|
void openPinnedFiles();
|
|
void addRecentFile(const QString& aFilePath);
|
|
void updateRecentFiles();
|
|
|
|
void openFolder(const QString& aFolderPath);
|
|
void openSubFolder(const QString& aFolderPath, QTreeWidget *aTreeWidget, QTreeWidgetItem *aItem, QTreeWidgetItem *aRoot);
|
|
void pinFolder(const QString& aFolderPath);
|
|
void updatePinnedFolders();
|
|
void openPinnedFolders();
|
|
void addRecentFolder(const QString& aFolderPath);
|
|
void updateRecentFolders();
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
QString mFolderPath;
|
|
QString mOpenGscPath;
|
|
QString mOpenTxtPath;
|
|
QString mNewGscPath;
|
|
QString mNewTxtPath;
|
|
|
|
QStringList mRecentFiles;
|
|
QStringList mPinnedFiles;
|
|
|
|
QStringList mRecentFolders;
|
|
QStringList mPinnedFolders;
|
|
|
|
QIcon mPinIcon;
|
|
|
|
QTreeWidgetItem* mFolderRootItem;
|
|
QTreeWidgetItem* mFileRootItem;
|
|
GSCHighlighter* mHighlighter;
|
|
QCompleter* mCompleter;
|
|
};
|
|
#endif // MAINWINDOW_H
|