@ -39,13 +39,12 @@
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
|
||||
#include "ui/pages/BasePage.h"
|
||||
#include <Application.h>
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
#include "settings/Setting.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
namespace Ui {
|
||||
class ServersPage;
|
||||
}
|
||||
|
||||
@ -53,46 +52,33 @@ struct Server;
|
||||
class ServersModel;
|
||||
class MinecraftInstance;
|
||||
|
||||
class ServersPage : public QMainWindow, public BasePage
|
||||
{
|
||||
class ServersPage : public QMainWindow, public BasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ServersPage(InstancePtr inst, QWidget *parent = 0);
|
||||
public:
|
||||
explicit ServersPage(InstancePtr inst, QWidget* parent = 0);
|
||||
virtual ~ServersPage();
|
||||
|
||||
void openedImpl() override;
|
||||
void closedImpl() override;
|
||||
|
||||
virtual QString displayName() const override
|
||||
{
|
||||
return tr("Servers");
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return APPLICATION->getThemedIcon("server");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
return "servers";
|
||||
}
|
||||
virtual QString helpPage() const override
|
||||
{
|
||||
return "Servers-management";
|
||||
}
|
||||
virtual QString displayName() const override { return tr("Servers"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("server"); }
|
||||
virtual QString id() const override { return "servers"; }
|
||||
virtual QString helpPage() const override { return "Servers-management"; }
|
||||
void retranslate() override;
|
||||
|
||||
protected:
|
||||
QMenu * createPopupMenu() override;
|
||||
protected:
|
||||
QMenu* createPopupMenu() override;
|
||||
|
||||
private:
|
||||
private:
|
||||
void updateState();
|
||||
void scheduleSave();
|
||||
bool saveIsScheduled() const;
|
||||
|
||||
private slots:
|
||||
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||
void rowsRemoved(const QModelIndex &parent, int first, int last);
|
||||
private slots:
|
||||
void currentChanged(const QModelIndex& current, const QModelIndex& previous);
|
||||
void rowsRemoved(const QModelIndex& parent, int first, int last);
|
||||
|
||||
void on_actionAdd_triggered();
|
||||
void on_actionRemove_triggered();
|
||||
@ -102,19 +88,18 @@ private slots:
|
||||
|
||||
void runningStateChanged(bool running);
|
||||
|
||||
void nameEdited(const QString & name);
|
||||
void addressEdited(const QString & address);
|
||||
void resourceIndexChanged(int index);\
|
||||
void nameEdited(const QString& name);
|
||||
void addressEdited(const QString& address);
|
||||
void resourceIndexChanged(int index);
|
||||
|
||||
void ShowContextMenu(const QPoint &pos);
|
||||
void ShowContextMenu(const QPoint& pos);
|
||||
|
||||
private: // data
|
||||
private: // data
|
||||
int currentServer = -1;
|
||||
bool m_locked = true;
|
||||
Ui::ServersPage *ui = nullptr;
|
||||
ServersModel * m_model = nullptr;
|
||||
Ui::ServersPage* ui = nullptr;
|
||||
ServersModel* m_model = nullptr;
|
||||
InstancePtr m_inst = nullptr;
|
||||
|
||||
std::shared_ptr<Setting> m_wide_bar_setting = nullptr;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user