Merge pull request #569 from GriffinRichards/recent-projects

Add 'Open Recent Project' menu
This commit is contained in:
GriffinR
2023-12-31 17:39:43 -05:00
committed by GitHub
5 changed files with 70 additions and 19 deletions

View File

@@ -51,7 +51,7 @@ public:
reset();
}
virtual void reset() override {
this->recentProject = "";
this->recentProjects.clear();
this->reopenOnLaunch = true;
this->mapSortOrder = MapSortOrder::Group;
this->prettyCursors = true;
@@ -73,7 +73,8 @@ public:
this->projectSettingsTab = 0;
this->warpBehaviorWarningDisabled = false;
}
void setRecentProject(QString project);
void addRecentProject(QString project);
void setRecentProjects(QStringList projects);
void setReopenOnLaunch(bool enabled);
void setMapSortOrder(MapSortOrder order);
void setPrettyCursors(bool enabled);
@@ -101,6 +102,7 @@ public:
void setProjectSettingsTab(int tab);
void setWarpBehaviorWarningDisabled(bool disabled);
QString getRecentProject();
QStringList getRecentProjects();
bool getReopenOnLaunch();
MapSortOrder getMapSortOrder();
bool getPrettyCursors();
@@ -134,7 +136,7 @@ protected:
virtual void onNewConfigFileCreated() override {};
virtual void setUnreadKeys() override {};
private:
QString recentProject;
QStringList recentProjects;
bool reopenOnLaunch;
QString stringFromByteArray(QByteArray);
QByteArray bytesFromString(QString);

View File

@@ -354,6 +354,7 @@ private:
bool setInitialMap();
void setRecentMap(QString map_name);
QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
void refreshRecentProjectsMenu();
void drawMapListIcons(QAbstractItemModel *model);
void updateMapList();