fix: fix slots for Qt 6
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
c363423718
commit
15c5bbcf22
@ -8,7 +8,11 @@ LoggedProcess::LoggedProcess(QObject *parent) : QProcess(parent)
|
|||||||
connect(this, &QProcess::readyReadStandardOutput, this, &LoggedProcess::on_stdOut);
|
connect(this, &QProcess::readyReadStandardOutput, this, &LoggedProcess::on_stdOut);
|
||||||
connect(this, &QProcess::readyReadStandardError, this, &LoggedProcess::on_stdErr);
|
connect(this, &QProcess::readyReadStandardError, this, &LoggedProcess::on_stdErr);
|
||||||
connect(this, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(on_exit(int,QProcess::ExitStatus)));
|
connect(this, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(on_exit(int,QProcess::ExitStatus)));
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(this, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(on_error(QProcess::ProcessError)));
|
||||||
|
#else
|
||||||
connect(this, SIGNAL(error(QProcess::ProcessError)), this, SLOT(on_error(QProcess::ProcessError)));
|
connect(this, SIGNAL(error(QProcess::ProcessError)), this, SLOT(on_error(QProcess::ProcessError)));
|
||||||
|
#endif
|
||||||
connect(this, &QProcess::stateChanged, this, &LoggedProcess::on_stateChange);
|
connect(this, &QProcess::stateChanged, this, &LoggedProcess::on_stateChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,11 @@ void JavaChecker::performCheck()
|
|||||||
qDebug() << "Running java checker: " + m_path + args.join(" ");;
|
qDebug() << "Running java checker: " + m_path + args.join(" ");;
|
||||||
|
|
||||||
connect(process.get(), SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finished(int, QProcess::ExitStatus)));
|
connect(process.get(), SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finished(int, QProcess::ExitStatus)));
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(process.get(), SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(error(QProcess::ProcessError)));
|
||||||
|
#else
|
||||||
connect(process.get(), SIGNAL(error(QProcess::ProcessError)), this, SLOT(error(QProcess::ProcessError)));
|
connect(process.get(), SIGNAL(error(QProcess::ProcessError)), this, SLOT(error(QProcess::ProcessError)));
|
||||||
|
#endif
|
||||||
connect(process.get(), SIGNAL(readyReadStandardOutput()), this, SLOT(stdoutReady()));
|
connect(process.get(), SIGNAL(readyReadStandardOutput()), this, SLOT(stdoutReady()));
|
||||||
connect(process.get(), SIGNAL(readyReadStandardError()), this, SLOT(stderrReady()));
|
connect(process.get(), SIGNAL(readyReadStandardError()), this, SLOT(stderrReady()));
|
||||||
connect(&killTimer, SIGNAL(timeout()), SLOT(timeout()));
|
connect(&killTimer, SIGNAL(timeout()), SLOT(timeout()));
|
||||||
|
@ -20,7 +20,11 @@ void AuthRequest::get(const QNetworkRequest &req, int timeout/* = 60*1000*/) {
|
|||||||
reply_ = APPLICATION->network()->get(request_);
|
reply_ = APPLICATION->network()->get(request_);
|
||||||
status_ = Requesting;
|
status_ = Requesting;
|
||||||
timedReplies_.add(new Katabasis::Reply(reply_, timeout));
|
timedReplies_.add(new Katabasis::Reply(reply_, timeout));
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(reply_, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(onRequestError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
connect(reply_, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onRequestError(QNetworkReply::NetworkError)));
|
connect(reply_, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onRequestError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
connect(reply_, SIGNAL(finished()), this, SLOT(onRequestFinished()));
|
connect(reply_, SIGNAL(finished()), this, SLOT(onRequestFinished()));
|
||||||
connect(reply_, &QNetworkReply::sslErrors, this, &AuthRequest::onSslErrors);
|
connect(reply_, &QNetworkReply::sslErrors, this, &AuthRequest::onSslErrors);
|
||||||
}
|
}
|
||||||
@ -31,7 +35,11 @@ void AuthRequest::post(const QNetworkRequest &req, const QByteArray &data, int t
|
|||||||
status_ = Requesting;
|
status_ = Requesting;
|
||||||
reply_ = APPLICATION->network()->post(request_, data_);
|
reply_ = APPLICATION->network()->post(request_, data_);
|
||||||
timedReplies_.add(new Katabasis::Reply(reply_, timeout));
|
timedReplies_.add(new Katabasis::Reply(reply_, timeout));
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(reply_, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(onRequestError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
connect(reply_, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onRequestError(QNetworkReply::NetworkError)));
|
connect(reply_, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onRequestError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
connect(reply_, SIGNAL(finished()), this, SLOT(onRequestFinished()));
|
connect(reply_, SIGNAL(finished()), this, SLOT(onRequestFinished()));
|
||||||
connect(reply_, &QNetworkReply::sslErrors, this, &AuthRequest::onSslErrors);
|
connect(reply_, &QNetworkReply::sslErrors, this, &AuthRequest::onSslErrors);
|
||||||
connect(reply_, SIGNAL(uploadProgress(qint64,qint64)), this, SLOT(onUploadProgress(qint64,qint64)));
|
connect(reply_, SIGNAL(uploadProgress(qint64,qint64)), this, SLOT(onUploadProgress(qint64,qint64)));
|
||||||
|
@ -34,7 +34,11 @@ void CapeChange::clearCape() {
|
|||||||
|
|
||||||
m_reply = shared_qobject_ptr<QNetworkReply>(rep);
|
m_reply = shared_qobject_ptr<QNetworkReply>(rep);
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(rep, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,11 @@ void SkinDelete::executeTask()
|
|||||||
|
|
||||||
setStatus(tr("Deleting skin"));
|
setStatus(tr("Deleting skin"));
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(rep, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,11 @@ void SkinUpload::executeTask()
|
|||||||
|
|
||||||
setStatus(tr("Uploading skin"));
|
setStatus(tr("Uploading skin"));
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(rep, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,11 @@ void Download::executeTask()
|
|||||||
m_reply.reset(rep);
|
m_reply.reset(rep);
|
||||||
connect(rep, &QNetworkReply::downloadProgress, this, &Download::downloadProgress);
|
connect(rep, &QNetworkReply::downloadProgress, this, &Download::downloadProgress);
|
||||||
connect(rep, &QNetworkReply::finished, this, &Download::downloadFinished);
|
connect(rep, &QNetworkReply::finished, this, &Download::downloadFinished);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(rep, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
connect(rep, &QNetworkReply::sslErrors, this, &Download::sslErrors);
|
connect(rep, &QNetworkReply::sslErrors, this, &Download::sslErrors);
|
||||||
connect(rep, &QNetworkReply::readyRead, this, &Download::downloadReadyRead);
|
connect(rep, &QNetworkReply::readyRead, this, &Download::downloadReadyRead);
|
||||||
}
|
}
|
||||||
|
@ -129,10 +129,13 @@ void PasteUpload::executeTask()
|
|||||||
|
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress);
|
||||||
connect(rep, &QNetworkReply::finished, this, &PasteUpload::downloadFinished);
|
connect(rep, &QNetworkReply::finished, this, &PasteUpload::downloadFinished);
|
||||||
// This function call would be a lot shorter if we were using the latest Qt
|
|
||||||
connect(rep,
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||||
static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
|
connect(rep, &QNetworkReply::errorOccurred, this, &PasteUpload::downloadError);
|
||||||
this, &PasteUpload::downloadError);
|
#else
|
||||||
|
connect(rep, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &PasteUpload::downloadError);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
m_reply = std::shared_ptr<QNetworkReply>(rep);
|
m_reply = std::shared_ptr<QNetworkReply>(rep);
|
||||||
|
|
||||||
|
@ -73,7 +73,11 @@ void ImgurAlbumCreation::executeTask()
|
|||||||
m_reply.reset(rep);
|
m_reply.reset(rep);
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &ImgurAlbumCreation::downloadProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &ImgurAlbumCreation::downloadProgress);
|
||||||
connect(rep, &QNetworkReply::finished, this, &ImgurAlbumCreation::downloadFinished);
|
connect(rep, &QNetworkReply::finished, this, &ImgurAlbumCreation::downloadFinished);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
connect(rep, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void ImgurAlbumCreation::downloadError(QNetworkReply::NetworkError error)
|
void ImgurAlbumCreation::downloadError(QNetworkReply::NetworkError error)
|
||||||
{
|
{
|
||||||
|
@ -88,8 +88,11 @@ void ImgurUpload::executeTask()
|
|||||||
m_reply.reset(rep);
|
m_reply.reset(rep);
|
||||||
connect(rep, &QNetworkReply::uploadProgress, this, &ImgurUpload::downloadProgress);
|
connect(rep, &QNetworkReply::uploadProgress, this, &ImgurUpload::downloadProgress);
|
||||||
connect(rep, &QNetworkReply::finished, this, &ImgurUpload::downloadFinished);
|
connect(rep, &QNetworkReply::finished, this, &ImgurUpload::downloadFinished);
|
||||||
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)),
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
SLOT(downloadError(QNetworkReply::NetworkError)));
|
connect(rep, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#else
|
||||||
|
connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(downloadError(QNetworkReply::NetworkError)));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void ImgurUpload::downloadError(QNetworkReply::NetworkError error)
|
void ImgurUpload::downloadError(QNetworkReply::NetworkError error)
|
||||||
{
|
{
|
||||||
|
@ -97,9 +97,9 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget *parent)
|
|||||||
// set up instance and launch process recognition
|
// set up instance and launch process recognition
|
||||||
{
|
{
|
||||||
auto launchTask = m_instance->getLaunchTask();
|
auto launchTask = m_instance->getLaunchTask();
|
||||||
on_InstanceLaunchTask_changed(launchTask);
|
instanceLaunchTaskChanged(launchTask);
|
||||||
connect(m_instance.get(), &BaseInstance::launchTaskChanged, this, &InstanceWindow::on_InstanceLaunchTask_changed);
|
connect(m_instance.get(), &BaseInstance::launchTaskChanged, this, &InstanceWindow::instanceLaunchTaskChanged);
|
||||||
connect(m_instance.get(), &BaseInstance::runningStatusChanged, this, &InstanceWindow::on_RunningState_changed);
|
connect(m_instance.get(), &BaseInstance::runningStatusChanged, this, &InstanceWindow::runningStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up instance destruction detection
|
// set up instance destruction detection
|
||||||
@ -152,12 +152,12 @@ void InstanceWindow::on_btnLaunchMinecraftOffline_clicked()
|
|||||||
APPLICATION->launch(m_instance, false, nullptr);
|
APPLICATION->launch(m_instance, false, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstanceWindow::on_InstanceLaunchTask_changed(shared_qobject_ptr<LaunchTask> proc)
|
void InstanceWindow::instanceLaunchTaskChanged(shared_qobject_ptr<LaunchTask> proc)
|
||||||
{
|
{
|
||||||
m_proc = proc;
|
m_proc = proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstanceWindow::on_RunningState_changed(bool running)
|
void InstanceWindow::runningStateChanged(bool running)
|
||||||
{
|
{
|
||||||
updateLaunchButtons();
|
updateLaunchButtons();
|
||||||
m_container->refreshContainer();
|
m_container->refreshContainer();
|
||||||
|
@ -55,8 +55,8 @@ slots:
|
|||||||
void on_btnKillMinecraft_clicked();
|
void on_btnKillMinecraft_clicked();
|
||||||
void on_btnLaunchMinecraftOffline_clicked();
|
void on_btnLaunchMinecraftOffline_clicked();
|
||||||
|
|
||||||
void on_InstanceLaunchTask_changed(shared_qobject_ptr<LaunchTask> proc);
|
void instanceLaunchTaskChanged(shared_qobject_ptr<LaunchTask> proc);
|
||||||
void on_RunningState_changed(bool running);
|
void runningStateChanged(bool running);
|
||||||
void on_instanceStatusChanged(BaseInstance::Status, BaseInstance::Status newStatus);
|
void on_instanceStatusChanged(BaseInstance::Status, BaseInstance::Status newStatus);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -235,7 +235,6 @@ public:
|
|||||||
TranslatedAction actionMods;
|
TranslatedAction actionMods;
|
||||||
TranslatedAction actionViewSelectedInstFolder;
|
TranslatedAction actionViewSelectedInstFolder;
|
||||||
TranslatedAction actionViewSelectedMCFolder;
|
TranslatedAction actionViewSelectedMCFolder;
|
||||||
TranslatedAction actionViewSelectedModsFolder;
|
|
||||||
TranslatedAction actionDeleteInstance;
|
TranslatedAction actionDeleteInstance;
|
||||||
TranslatedAction actionConfig_Folder;
|
TranslatedAction actionConfig_Folder;
|
||||||
TranslatedAction actionCAT;
|
TranslatedAction actionCAT;
|
||||||
@ -709,14 +708,6 @@ public:
|
|||||||
actionViewSelectedMCFolder->setShortcut(QKeySequence(tr("Ctrl+M")));
|
actionViewSelectedMCFolder->setShortcut(QKeySequence(tr("Ctrl+M")));
|
||||||
all_actions.append(&actionViewSelectedMCFolder);
|
all_actions.append(&actionViewSelectedMCFolder);
|
||||||
|
|
||||||
/*
|
|
||||||
actionViewSelectedModsFolder = TranslatedAction(MainWindow);
|
|
||||||
actionViewSelectedModsFolder->setObjectName(QStringLiteral("actionViewSelectedModsFolder"));
|
|
||||||
actionViewSelectedModsFolder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Mods Folder"));
|
|
||||||
actionViewSelectedModsFolder.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the selected instance's mods folder in a file browser."));
|
|
||||||
all_actions.append(&actionViewSelectedModsFolder);
|
|
||||||
*/
|
|
||||||
|
|
||||||
actionConfig_Folder = TranslatedAction(MainWindow);
|
actionConfig_Folder = TranslatedAction(MainWindow);
|
||||||
actionConfig_Folder->setObjectName(QStringLiteral("actionConfig_Folder"));
|
actionConfig_Folder->setObjectName(QStringLiteral("actionConfig_Folder"));
|
||||||
actionConfig_Folder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Confi&g Folder"));
|
actionConfig_Folder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Confi&g Folder"));
|
||||||
@ -793,9 +784,6 @@ public:
|
|||||||
instanceToolBar->addSeparator();
|
instanceToolBar->addSeparator();
|
||||||
|
|
||||||
instanceToolBar->addAction(actionViewSelectedMCFolder);
|
instanceToolBar->addAction(actionViewSelectedMCFolder);
|
||||||
/*
|
|
||||||
instanceToolBar->addAction(actionViewSelectedModsFolder);
|
|
||||||
*/
|
|
||||||
instanceToolBar->addAction(actionConfig_Folder);
|
instanceToolBar->addAction(actionConfig_Folder);
|
||||||
instanceToolBar->addAction(actionViewSelectedInstFolder);
|
instanceToolBar->addAction(actionViewSelectedInstFolder);
|
||||||
|
|
||||||
@ -1894,11 +1882,6 @@ void MainWindow::globalSettingsClosed()
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionInstanceSettings_triggered()
|
|
||||||
{
|
|
||||||
APPLICATION->showInstanceWindow(m_selectedInstance, "settings");
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::on_actionEditInstNotes_triggered()
|
void MainWindow::on_actionEditInstNotes_triggered()
|
||||||
{
|
{
|
||||||
APPLICATION->showInstanceWindow(m_selectedInstance, "notes");
|
APPLICATION->showInstanceWindow(m_selectedInstance, "notes");
|
||||||
@ -2021,20 +2004,6 @@ void MainWindow::on_actionViewSelectedMCFolder_triggered()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionViewSelectedModsFolder_triggered()
|
|
||||||
{
|
|
||||||
if (m_selectedInstance)
|
|
||||||
{
|
|
||||||
QString str = m_selectedInstance->modsRoot();
|
|
||||||
if (!FS::ensureFilePathExists(str))
|
|
||||||
{
|
|
||||||
// TODO: report error
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DesktopServices::openDirectory(QDir(str).absolutePath());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *event)
|
void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
// Save the window state and geometry.
|
// Save the window state and geometry.
|
||||||
|
@ -118,8 +118,6 @@ private slots:
|
|||||||
|
|
||||||
void on_actionViewSelectedMCFolder_triggered();
|
void on_actionViewSelectedMCFolder_triggered();
|
||||||
|
|
||||||
void on_actionViewSelectedModsFolder_triggered();
|
|
||||||
|
|
||||||
void refreshInstances();
|
void refreshInstances();
|
||||||
|
|
||||||
void on_actionViewCentralModsFolder_triggered();
|
void on_actionViewCentralModsFolder_triggered();
|
||||||
@ -128,8 +126,6 @@ private slots:
|
|||||||
|
|
||||||
void on_actionSettings_triggered();
|
void on_actionSettings_triggered();
|
||||||
|
|
||||||
void on_actionInstanceSettings_triggered();
|
|
||||||
|
|
||||||
void on_actionManageAccounts_triggered();
|
void on_actionManageAccounts_triggered();
|
||||||
|
|
||||||
void on_actionReportBug_triggered();
|
void on_actionReportBug_triggered();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* PolyMC - Minecraft Launcher
|
* PolyMC - Minecraft Launcher
|
||||||
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
|
* Copyright (c) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,11 +37,11 @@
|
|||||||
#include "ProxyPage.h"
|
#include "ProxyPage.h"
|
||||||
#include "ui_ProxyPage.h"
|
#include "ui_ProxyPage.h"
|
||||||
|
|
||||||
|
#include <QButtonGroup>
|
||||||
#include <QTabBar>
|
#include <QTabBar>
|
||||||
|
|
||||||
#include "settings/SettingsObject.h"
|
#include "settings/SettingsObject.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "Application.h"
|
|
||||||
|
|
||||||
ProxyPage::ProxyPage(QWidget *parent) : QWidget(parent), ui(new Ui::ProxyPage)
|
ProxyPage::ProxyPage(QWidget *parent) : QWidget(parent), ui(new Ui::ProxyPage)
|
||||||
{
|
{
|
||||||
@ -49,7 +50,8 @@ ProxyPage::ProxyPage(QWidget *parent) : QWidget(parent), ui(new Ui::ProxyPage)
|
|||||||
loadSettings();
|
loadSettings();
|
||||||
updateCheckboxStuff();
|
updateCheckboxStuff();
|
||||||
|
|
||||||
connect(ui->proxyGroup, SIGNAL(buttonClicked(int)), SLOT(proxyChanged(int)));
|
connect(ui->proxyGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
|
||||||
|
this, &ProxyPage::proxyGroupChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyPage::~ProxyPage()
|
ProxyPage::~ProxyPage()
|
||||||
@ -65,13 +67,13 @@ bool ProxyPage::apply()
|
|||||||
|
|
||||||
void ProxyPage::updateCheckboxStuff()
|
void ProxyPage::updateCheckboxStuff()
|
||||||
{
|
{
|
||||||
ui->proxyAddrBox->setEnabled(!ui->proxyNoneBtn->isChecked() &&
|
bool enableEditing = ui->proxyHTTPBtn->isChecked()
|
||||||
!ui->proxyDefaultBtn->isChecked());
|
|| ui->proxySOCKS5Btn->isChecked();
|
||||||
ui->proxyAuthBox->setEnabled(!ui->proxyNoneBtn->isChecked() &&
|
ui->proxyAddrBox->setEnabled(enableEditing);
|
||||||
!ui->proxyDefaultBtn->isChecked());
|
ui->proxyAuthBox->setEnabled(enableEditing);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProxyPage::proxyChanged(int)
|
void ProxyPage::proxyGroupChanged(QAbstractButton *button)
|
||||||
{
|
{
|
||||||
updateCheckboxStuff();
|
updateCheckboxStuff();
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <QAbstractButton>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
#include "ui/pages/BasePage.h"
|
#include "ui/pages/BasePage.h"
|
||||||
@ -73,15 +74,14 @@ public:
|
|||||||
bool apply() override;
|
bool apply() override;
|
||||||
void retranslate() override;
|
void retranslate() override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void proxyGroupChanged(QAbstractButton *button);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateCheckboxStuff();
|
void updateCheckboxStuff();
|
||||||
void applySettings();
|
void applySettings();
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
|
|
||||||
private
|
|
||||||
slots:
|
|
||||||
void proxyChanged(int);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ProxyPage *ui;
|
Ui::ProxyPage *ui;
|
||||||
};
|
};
|
||||||
|
@ -623,7 +623,7 @@ ServersPage::ServersPage(InstancePtr inst, QWidget* parent)
|
|||||||
|
|
||||||
auto selectionModel = ui->serversView->selectionModel();
|
auto selectionModel = ui->serversView->selectionModel();
|
||||||
connect(selectionModel, &QItemSelectionModel::currentChanged, this, &ServersPage::currentChanged);
|
connect(selectionModel, &QItemSelectionModel::currentChanged, this, &ServersPage::currentChanged);
|
||||||
connect(m_inst.get(), &MinecraftInstance::runningStatusChanged, this, &ServersPage::on_RunningState_changed);
|
connect(m_inst.get(), &MinecraftInstance::runningStatusChanged, this, &ServersPage::runningStateChanged);
|
||||||
connect(ui->nameLine, &QLineEdit::textEdited, this, &ServersPage::nameEdited);
|
connect(ui->nameLine, &QLineEdit::textEdited, this, &ServersPage::nameEdited);
|
||||||
connect(ui->addressLine, &QLineEdit::textEdited, this, &ServersPage::addressEdited);
|
connect(ui->addressLine, &QLineEdit::textEdited, this, &ServersPage::addressEdited);
|
||||||
connect(ui->resourceComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(resourceIndexChanged(int)));
|
connect(ui->resourceComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(resourceIndexChanged(int)));
|
||||||
@ -663,7 +663,7 @@ QMenu * ServersPage::createPopupMenu()
|
|||||||
return filteredMenu;
|
return filteredMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServersPage::on_RunningState_changed(bool running)
|
void ServersPage::runningStateChanged(bool running)
|
||||||
{
|
{
|
||||||
if(m_locked == running)
|
if(m_locked == running)
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ private slots:
|
|||||||
void on_actionMove_Down_triggered();
|
void on_actionMove_Down_triggered();
|
||||||
void on_actionJoin_triggered();
|
void on_actionJoin_triggered();
|
||||||
|
|
||||||
void on_RunningState_changed(bool running);
|
void runningStateChanged(bool running);
|
||||||
|
|
||||||
void nameEdited(const QString & name);
|
void nameEdited(const QString & name);
|
||||||
void addressEdited(const QString & address);
|
void addressEdited(const QString & address);
|
||||||
|
Loading…
Reference in New Issue
Block a user