diff options
Diffstat (limited to 'application/pages')
-rw-r--r-- | application/pages/global/ProxyPage.cpp | 4 | ||||
-rw-r--r-- | application/pages/instance/ScreenshotsPage.cpp | 32 |
2 files changed, 36 insertions, 0 deletions
diff --git a/application/pages/global/ProxyPage.cpp b/application/pages/global/ProxyPage.cpp index 5c53fb52..ee56a54e 100644 --- a/application/pages/global/ProxyPage.cpp +++ b/application/pages/global/ProxyPage.cpp @@ -20,6 +20,7 @@ #include "settings/SettingsObject.h" #include "MultiMC.h" +#include "Env.h" ProxyPage::ProxyPage(QWidget *parent) : QWidget(parent), ui(new Ui::ProxyPage) { @@ -75,6 +76,9 @@ void ProxyPage::applySettings() s->set("ProxyPort", ui->proxyPortEdit->value()); s->set("ProxyUser", ui->proxyUserEdit->text()); s->set("ProxyPass", ui->proxyPassEdit->text()); + + ENV.updateProxySettings(proxyType, ui->proxyAddrEdit->text(), ui->proxyPortEdit->value(), + ui->proxyUserEdit->text(), ui->proxyPassEdit->text()); } void ProxyPage::loadSettings() { diff --git a/application/pages/instance/ScreenshotsPage.cpp b/application/pages/instance/ScreenshotsPage.cpp index 3420e86b..e61bf5c1 100644 --- a/application/pages/instance/ScreenshotsPage.cpp +++ b/application/pages/instance/ScreenshotsPage.cpp @@ -286,6 +286,38 @@ void ScreenshotsPage::on_uploadBtn_clicked() QList<ScreenshotPtr> uploaded; auto job = NetJobPtr(new NetJob("Screenshot Upload")); + if(selection.size() < 2) + { + auto item = selection.at(0); + auto info = m_model->fileInfo(item); + auto screenshot = std::make_shared<ScreenShot>(info); + job->addNetAction(ImgurUpload::make(screenshot)); + + m_uploadActive = true; + ProgressDialog dialog(this); + if(dialog.execWithTask(job.get()) != QDialog::Accepted) + { + CustomMessageBox::selectable(this, tr("Failed to upload screenshots!"), + tr("Unknown error"), QMessageBox::Warning)->exec(); + } + else + { + auto link = screenshot->m_url; + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(link); + CustomMessageBox::selectable( + this, + tr("Upload finished"), + tr("The <a href=\"%1\">link to the uploaded screenshot</a> has been placed in your clipboard.") + .arg(link), + QMessageBox::Information + )->exec(); + } + + m_uploadActive = false; + return; + } + for (auto item : selection) { auto info = m_model->fileInfo(item); |