diff options
author | Thomas Groman <tgroman@nuegia.net> | 2019-09-19 00:41:48 -0700 |
---|---|---|
committer | Thomas Groman <tgroman@nuegia.net> | 2019-09-19 00:41:48 -0700 |
commit | 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 (patch) | |
tree | 7be7a2f602e6a5af7bc2db86bef9cf2a659c3d3d /application/pages/instance/ScreenshotsPage.h | |
parent | 5fb2c6334e7d5237db11695b4c0ec0f2d1e47c88 (diff) | |
download | MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.gz MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.lz MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.xz MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.zip |
merged from 0.6.7 codebase
Diffstat (limited to 'application/pages/instance/ScreenshotsPage.h')
-rw-r--r-- | application/pages/instance/ScreenshotsPage.h | 91 |
1 files changed, 48 insertions, 43 deletions
diff --git a/application/pages/instance/ScreenshotsPage.h b/application/pages/instance/ScreenshotsPage.h index e31fb8b4..9adf79af 100644 --- a/application/pages/instance/ScreenshotsPage.h +++ b/application/pages/instance/ScreenshotsPage.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2019 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ #pragma once -#include <QWidget> +#include <QMainWindow> #include "pages/BasePage.h" #include <MultiMC.h> @@ -31,54 +31,59 @@ struct ScreenShot; class ScreenshotList; class ImgurAlbumCreation; -class ScreenshotsPage : public QWidget, public BasePage +class ScreenshotsPage : public QMainWindow, public BasePage { - Q_OBJECT + Q_OBJECT public: - explicit ScreenshotsPage(QString path, QWidget *parent = 0); - virtual ~ScreenshotsPage(); + explicit ScreenshotsPage(QString path, QWidget *parent = 0); + virtual ~ScreenshotsPage(); - virtual void openedImpl() override; + virtual void openedImpl() override; - enum - { - NothingDone = 0x42 - }; + enum + { + NothingDone = 0x42 + }; + + virtual bool eventFilter(QObject *, QEvent *) override; + virtual QString displayName() const override + { + return tr("Screenshots"); + } + virtual QIcon icon() const override + { + return MMC->getThemedIcon("screenshots"); + } + virtual QString id() const override + { + return "screenshots"; + } + virtual QString helpPage() const override + { + return "Screenshots-management"; + } + virtual bool apply() override + { + return !m_uploadActive; + } + +protected: + QMenu * createPopupMenu() override; - virtual bool eventFilter(QObject *, QEvent *) override; - virtual QString displayName() const override - { - return tr("Screenshots"); - } - virtual QIcon icon() const override - { - return MMC->getThemedIcon("screenshots"); - } - virtual QString id() const override - { - return "screenshots"; - } - virtual QString helpPage() const override - { - return "Screenshots-management"; - } - virtual bool apply() override - { - return !m_uploadActive; - } private slots: - void on_uploadBtn_clicked(); - void on_deleteBtn_clicked(); - void on_renameBtn_clicked(); - void on_viewFolderBtn_clicked(); - void onItemActivated(QModelIndex); + void on_actionUpload_triggered(); + void on_actionDelete_triggered(); + void on_actionRename_triggered(); + void on_actionView_Folder_triggered(); + void onItemActivated(QModelIndex); + void ShowContextMenu(const QPoint &pos); private: - Ui::ScreenshotsPage *ui; - std::shared_ptr<QFileSystemModel> m_model; - std::shared_ptr<QIdentityProxyModel> m_filterModel; - QString m_folder; - bool m_valid = false; - bool m_uploadActive = false; + Ui::ScreenshotsPage *ui; + std::shared_ptr<QFileSystemModel> m_model; + std::shared_ptr<QIdentityProxyModel> m_filterModel; + QString m_folder; + bool m_valid = false; + bool m_uploadActive = false; }; |