From 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Thu, 19 Sep 2019 00:41:48 -0700 Subject: merged from 0.6.7 codebase --- application/pages/instance/ScreenshotsPage.h | 91 +++++++++++++++------------- 1 file changed, 48 insertions(+), 43 deletions(-) (limited to 'application/pages/instance/ScreenshotsPage.h') 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 +#include #include "pages/BasePage.h" #include @@ -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 m_model; - std::shared_ptr m_filterModel; - QString m_folder; - bool m_valid = false; - bool m_uploadActive = false; + Ui::ScreenshotsPage *ui; + std::shared_ptr m_model; + std::shared_ptr m_filterModel; + QString m_folder; + bool m_valid = false; + bool m_uploadActive = false; }; -- cgit v1.2.3