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/global/AccountListPage.h | 83 ++++++++++++++++-------------- 1 file changed, 44 insertions(+), 39 deletions(-) (limited to 'application/pages/global/AccountListPage.h') diff --git a/application/pages/global/AccountListPage.h b/application/pages/global/AccountListPage.h index fa5561fe..4c8bc00b 100644 --- a/application/pages/global/AccountListPage.h +++ b/application/pages/global/AccountListPage.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 #include "pages/BasePage.h" @@ -30,59 +30,64 @@ class AccountListPage; class AuthenticateTask; -class AccountListPage : public QWidget, public BasePage +class AccountListPage : public QMainWindow, public BasePage { - Q_OBJECT + Q_OBJECT public: - explicit AccountListPage(QWidget *parent = 0); - ~AccountListPage(); - - QString displayName() const override - { - return tr("Accounts"); - } - QIcon icon() const override - { - auto icon = MMC->getThemedIcon("accounts"); - if(icon.isNull()) - { - icon = MMC->getThemedIcon("noaccount"); - } - return icon; - } - QString id() const override - { - return "accounts"; - } - QString helpPage() const override - { - return "Getting-Started#adding-an-account"; - } + explicit AccountListPage(QWidget *parent = 0); + ~AccountListPage(); + + QString displayName() const override + { + return tr("Accounts"); + } + QIcon icon() const override + { + auto icon = MMC->getThemedIcon("accounts"); + if(icon.isNull()) + { + icon = MMC->getThemedIcon("noaccount"); + } + return icon; + } + QString id() const override + { + return "accounts"; + } + QString helpPage() const override + { + return "Getting-Started#adding-an-account"; + } + +private: + void changeEvent(QEvent * event) override; + QMenu * createPopupMenu() override; public slots: - void on_addAccountBtn_clicked(); + void on_actionAdd_triggered(); - void on_rmAccountBtn_clicked(); + void on_actionRemove_triggered(); - void on_setDefaultBtn_clicked(); + void on_actionSetDefault_triggered(); - void on_noDefaultBtn_clicked(); + void on_actionNoDefault_triggered(); - void on_uploadSkinBtn_clicked(); + void on_actionUploadSkin_triggered(); - void listChanged(); + void listChanged(); - //! Updates the states of the dialog's buttons. - void updateButtonStates(); + //! Updates the states of the dialog's buttons. + void updateButtonStates(); protected: - std::shared_ptr m_accounts; + std::shared_ptr m_accounts; protected slots: - void addAccount(const QString& errMsg=""); + void ShowContextMenu(const QPoint &pos); + void addAccount(const QString& errMsg=""); private: - Ui::AccountListPage *ui; + Ui::AccountListPage *ui; }; -- cgit v1.2.3