summaryrefslogtreecommitdiff
path: root/src/citra_qt/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/main.h')
-rw-r--r--src/citra_qt/main.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 61114a04d..6f1292295 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -24,6 +24,8 @@ class GMainWindow : public QMainWindow
{
Q_OBJECT
+ static const int max_recent_files_item = 10; ///< Max number of recently loaded items to keep track
+
// TODO: Make use of this!
enum {
UI_IDLE,
@@ -58,6 +60,26 @@ private:
void BootGame(const std::string& filename);
void ShutdownGame();
+ /**
+ * Stores the filename in the recently loaded files list.
+ * The new filename is stored at the beginning of the recently loaded files list.
+ * After inserting the new entry, duplicates are removed meaning that if
+ * this was inserted from \a OnMenuRecentFile(), the entry will be put on top
+ * and remove from its previous position.
+ *
+ * Finally, this function calls \a UpdateRecentFiles() to update the UI.
+ *
+ * @param filename the filename to store
+ */
+ void StoreRecentFile(const QString& filename);
+
+ /**
+ * Updates the recent files menu.
+ * Menu entries are rebuilt from the configuration file.
+ * If there is no entry in the menu, the menu is greyed out.
+ */
+ void UpdateRecentFiles();
+
void closeEvent(QCloseEvent* event) override;
private slots:
@@ -66,6 +88,7 @@ private slots:
void OnStopGame();
void OnMenuLoadFile();
void OnMenuLoadSymbolMap();
+ void OnMenuRecentFile();
void OnOpenHotkeysDialog();
void OnConfigure();
void OnDisplayTitleBars(bool);
@@ -86,6 +109,8 @@ private:
CallstackWidget* callstackWidget;
GPUCommandStreamWidget* graphicsWidget;
GPUCommandListWidget* graphicsCommandsWidget;
+
+ QAction* actions_recent_files[max_recent_files_item];
};
#endif // _CITRA_QT_MAIN_HXX_