From ddb961fad5532a33bbd3771fbac840a1d9450d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 6 Jan 2014 00:33:16 +0100 Subject: [PATCH 01/18] Scroll console window for <= lines above the bottom instead of the very bottom. --- gui/ConsoleWindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp index e640d2619..e7ac6008b 100644 --- a/gui/ConsoleWindow.cpp +++ b/gui/ConsoleWindow.cpp @@ -78,8 +78,7 @@ void ConsoleWindow::write(QString data, MessageLevel::Enum mode) int val_bar = bar->value(); if(m_scroll_active) { - if(m_last_scroll_value > val_bar) - m_scroll_active = false; + m_scroll_active = (max_bar - val_bar) <= 1; } else { From fcb8612c10ae1bb1d2d8883a762979e9bca1f31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 6 Jan 2014 02:52:51 +0100 Subject: [PATCH 02/18] Implement console window tray icon, console window hiding, better scrolling --- gui/ConsoleWindow.cpp | 117 ++++++++++++++++++++++++++++++++---------- gui/ConsoleWindow.h | 6 ++- 2 files changed, 96 insertions(+), 27 deletions(-) diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp index e7ac6008b..84a141ced 100644 --- a/gui/ConsoleWindow.cpp +++ b/gui/ConsoleWindow.cpp @@ -19,12 +19,14 @@ #include #include +#include #include #include #include #include "logic/net/PasteUpload.h" +#include "logic/icons/IconList.h" ConsoleWindow::ConsoleWindow(MinecraftProcess *mcproc, QWidget *parent) : QMainWindow(parent), ui(new Ui::ConsoleWindow), proc(mcproc) @@ -35,14 +37,28 @@ ConsoleWindow::ConsoleWindow(MinecraftProcess *mcproc, QWidget *parent) SLOT(write(QString, MessageLevel::Enum))); connect(mcproc, SIGNAL(ended(BaseInstance *, int, QProcess::ExitStatus)), this, SLOT(onEnded(BaseInstance *, int, QProcess::ExitStatus))); - connect(mcproc, SIGNAL(prelaunch_failed(BaseInstance*,int,QProcess::ExitStatus)), this, + connect(mcproc, SIGNAL(prelaunch_failed(BaseInstance *, int, QProcess::ExitStatus)), this, SLOT(onEnded(BaseInstance *, int, QProcess::ExitStatus))); - connect(mcproc, SIGNAL(launch_failed(BaseInstance*)), this, - SLOT(onLaunchFailed(BaseInstance*))); + connect(mcproc, SIGNAL(launch_failed(BaseInstance *)), this, + SLOT(onLaunchFailed(BaseInstance *))); - restoreState(QByteArray::fromBase64(MMC->settings()->get("ConsoleWindowState").toByteArray())); - restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("ConsoleWindowGeometry").toByteArray())); + restoreState( + QByteArray::fromBase64(MMC->settings()->get("ConsoleWindowState").toByteArray())); + restoreGeometry( + QByteArray::fromBase64(MMC->settings()->get("ConsoleWindowGeometry").toByteArray())); + QString iconKey = proc->instance()->iconKey(); + QString name = proc->instance()->name(); + auto icon = MMC->icons()->getIcon(iconKey); + setWindowIcon(icon); + m_trayIcon = new QSystemTrayIcon(icon, this); + QString consoleTitle = tr("Console window for ") + name; + m_trayIcon->setToolTip(consoleTitle); + setWindowTitle(consoleTitle); + + connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), + SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); + m_trayIcon->show(); if (mcproc->instance()->settings().get("ShowConsole").toBool()) { show(); @@ -55,13 +71,26 @@ ConsoleWindow::~ConsoleWindow() delete ui; } +void ConsoleWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) +{ + switch (reason) + { + case QSystemTrayIcon::Trigger: + { + toggleConsole(); + } + default: + return; + } +} + void ConsoleWindow::writeColor(QString text, const char *color) { // append a paragraph QString newtext; newtext += "text->verticalScrollBar(); int max_bar = bar->maximum(); int val_bar = bar->value(); - if(m_scroll_active) + if(isVisible()) { - m_scroll_active = (max_bar - val_bar) <= 1; + if (m_scroll_active) + { + m_scroll_active = (max_bar - val_bar) <= 1; + } + else + { + m_scroll_active = val_bar == max_bar; + } } - else - { - m_scroll_active = val_bar == max_bar; - } - if (data.endsWith('\n')) data = data.left(data.length() - 1); QStringList paragraphs = data.split('\n'); @@ -113,11 +144,14 @@ void ConsoleWindow::write(QString data, MessageLevel::Enum mode) else while (iter.hasNext()) writeColor(iter.next()); - if(m_scroll_active) + if(isVisible()) { - bar->setValue(bar->maximum()); + if (m_scroll_active) + { + bar->setValue(bar->maximum()); + } + m_last_scroll_value = bar->value(); } - m_last_scroll_value = bar->value(); } void ConsoleWindow::clear() @@ -133,22 +167,45 @@ void ConsoleWindow::on_closeButton_clicked() void ConsoleWindow::setMayClose(bool mayclose) { m_mayclose = mayclose; - if (mayclose) - ui->closeButton->setEnabled(true); +} + +void ConsoleWindow::toggleConsole() +{ + QScrollBar *bar = ui->text->verticalScrollBar(); + if (isVisible()) + { + int max_bar = bar->maximum(); + int val_bar = m_last_scroll_value = bar->value(); + m_scroll_active = (max_bar - val_bar) <= 1; + hide(); + } else - ui->closeButton->setEnabled(false); + { + show(); + if (m_scroll_active) + { + bar->setValue(bar->maximum()); + } + else + { + bar->setValue(m_last_scroll_value); + } + } } void ConsoleWindow::closeEvent(QCloseEvent *event) { if (!m_mayclose) - event->ignore(); + { + toggleConsole(); + } else { MMC->settings()->set("ConsoleWindowState", saveState().toBase64()); MMC->settings()->set("ConsoleWindowGeometry", saveGeometry().toBase64()); emit isClosing(); + m_trayIcon->hide(); QMainWindow::closeEvent(event); } } @@ -169,19 +226,26 @@ void ConsoleWindow::on_btnKillMinecraft_clicked() void ConsoleWindow::onEnded(BaseInstance *instance, int code, QProcess::ExitStatus status) { + bool peacefulExit = code == 0 && status != QProcess::CrashExit; ui->btnKillMinecraft->setEnabled(false); setMayClose(true); if (instance->settings().get("AutoCloseConsole").toBool()) { - if (code == 0 && status != QProcess::CrashExit) + if (peacefulExit) { this->close(); return; } } - if(!isVisible()) + /* + if(!peacefulExit) + { + m_trayIcon->showMessage(tr("Oh no!"), tr("Minecraft crashed!"), QSystemTrayIcon::Critical); + } + */ + if (!isVisible()) show(); } @@ -191,7 +255,7 @@ void ConsoleWindow::onLaunchFailed(BaseInstance *instance) setMayClose(true); - if(!isVisible()) + if (!isVisible()) show(); } @@ -199,10 +263,11 @@ void ConsoleWindow::on_btnPaste_clicked() { auto text = ui->text->toPlainText(); ProgressDialog dialog(this); - PasteUpload* paste=new PasteUpload(this, text); + PasteUpload *paste = new PasteUpload(this, text); dialog.exec(paste); - if(!paste->successful()) + if (!paste->successful()) { - CustomMessageBox::selectable(this, "Upload failed", paste->failReason(), QMessageBox::Critical)->exec(); + CustomMessageBox::selectable(this, "Upload failed", paste->failReason(), + QMessageBox::Critical)->exec(); } } diff --git a/gui/ConsoleWindow.h b/gui/ConsoleWindow.h index 731c616cb..9291320e7 100644 --- a/gui/ConsoleWindow.h +++ b/gui/ConsoleWindow.h @@ -16,6 +16,7 @@ #pragma once #include +#include #include "logic/MinecraftProcess.h" namespace Ui @@ -77,7 +78,8 @@ slots: // failures) void on_btnPaste_clicked(); - + void iconActivated(QSystemTrayIcon::ActivationReason); + void toggleConsole(); protected: void closeEvent(QCloseEvent *); @@ -87,4 +89,6 @@ private: bool m_mayclose = true; int m_last_scroll_value = 0; bool m_scroll_active = true; + QSystemTrayIcon *m_trayIcon = nullptr; + int m_saved_offset = 0; }; From 093143cfef8959261fc4f66a65d2ecc4cdc2e23c Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Mon, 6 Jan 2014 10:01:40 +0100 Subject: [PATCH 03/18] Fix instances getting deselected after FTB instances are loaded (or whenever the model is reset) --- gui/MainWindow.cpp | 37 +++++++++++++++++++------------------ gui/MainWindow.h | 2 ++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 968fecb77..905d14cff 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -289,24 +289,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi this, &MainWindow::notificationsChanged); } - const QString currentInstanceId = MMC->settings()->get("SelectedInstance").toString(); - if (!currentInstanceId.isNull()) - { - const QModelIndex index = MMC->instances()->getInstanceIndexById(currentInstanceId); - if (index.isValid()) - { - const QModelIndex mappedIndex = proxymodel->mapFromSource(index); - view->setCurrentIndex(mappedIndex); - } - else - { - view->setCurrentIndex(proxymodel->index(0, 0)); - } - } - else - { - view->setCurrentIndex(proxymodel->index(0, 0)); - } + setSelectedInstanceById(MMC->settings()->get("SelectedInstance").toString()); // removing this looks stupid view->setFocus(); @@ -788,6 +771,20 @@ void MainWindow::updateInstanceToolIcon(QString new_icon) ui->actionChangeInstIcon->setIcon(MMC->icons()->getIcon(m_currentInstIcon)); } +void MainWindow::setSelectedInstanceById(const QString &id) +{ + QModelIndex selectionIndex = proxymodel->index(0, 0); + if (!id.isNull()) + { + const QModelIndex index = MMC->instances()->getInstanceIndexById(id); + if (index.isValid()) + { + selectionIndex = proxymodel->mapFromSource(index); + } + } + view->selectionModel()->setCurrentIndex(selectionIndex, QItemSelectionModel::ClearAndSelect); +} + void MainWindow::on_actionChangeInstGroup_triggered() { if (!m_selectedInstance) @@ -1274,12 +1271,16 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex & void MainWindow::selectionBad() { + // start by reseting everything... m_selectedInstance = nullptr; statusBar()->clearMessage(); ui->instanceToolBar->setEnabled(false); renameButton->setText(tr("Rename Instance")); updateInstanceToolIcon("infinity"); + + // ...and then see if we can enable the previously selected instance + setSelectedInstanceById(MMC->settings()->get("SelectedInstance").toString()); } void MainWindow::on_actionEditInstNotes_triggered() diff --git a/gui/MainWindow.h b/gui/MainWindow.h index af2f1dca7..12d76da4e 100644 --- a/gui/MainWindow.h +++ b/gui/MainWindow.h @@ -179,6 +179,8 @@ protected: void setCatBackground(bool enabled); void updateInstanceToolIcon(QString new_icon); + void setSelectedInstanceById(const QString &id); + private: Ui::MainWindow *ui; KCategoryDrawer *drawer; From 0a312d3b08a40d51acc1952df3ed2f0348f4aa5e Mon Sep 17 00:00:00 2001 From: Forkk Date: Mon, 6 Jan 2014 15:02:58 -0600 Subject: [PATCH 04/18] Implement proxy settings --- MultiMC.cpp | 125 +++++++++++++++++---------- MultiMC.h | 5 ++ gui/dialogs/SettingsDialog.cpp | 37 +++++++- gui/dialogs/SettingsDialog.h | 2 + gui/dialogs/SettingsDialog.ui | 151 ++++++++++++++++++++++++++++++++- 5 files changed, 270 insertions(+), 50 deletions(-) diff --git a/MultiMC.cpp b/MultiMC.cpp index 297d08fdb..7c4116935 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -198,56 +198,12 @@ MultiMC::MultiMC(int &argc, char **argv, bool root_override) // init the http meta cache initHttpMetaCache(); - // set up a basic autodetected proxy (system default) - QNetworkProxyFactory::setUseSystemConfiguration(true); - - QLOG_INFO() << "Detecting system proxy settings..."; - auto proxies = QNetworkProxyFactory::systemProxyForQuery(); - if (proxies.size() == 1 && proxies[0].type() == QNetworkProxy::NoProxy) - { - QLOG_INFO() << "No proxy found."; - } - else - for (auto proxy : proxies) - { - QString proxyDesc; - if (proxy.type() == QNetworkProxy::NoProxy) - { - QLOG_INFO() << "Using no proxy is an option!"; - continue; - } - switch (proxy.type()) - { - case QNetworkProxy::DefaultProxy: - proxyDesc = "Default proxy: "; - break; - case QNetworkProxy::Socks5Proxy: - proxyDesc = "Socks5 proxy: "; - break; - case QNetworkProxy::HttpProxy: - proxyDesc = "HTTP proxy: "; - break; - case QNetworkProxy::HttpCachingProxy: - proxyDesc = "HTTP caching: "; - break; - case QNetworkProxy::FtpCachingProxy: - proxyDesc = "FTP caching: "; - break; - default: - proxyDesc = "DERP proxy: "; - break; - } - proxyDesc += QString("%3@%1:%2 pass %4") - .arg(proxy.hostName()) - .arg(proxy.port()) - .arg(proxy.user()) - .arg(proxy.password()); - QLOG_INFO() << proxyDesc; - } - // create the global network manager m_qnam.reset(new QNetworkAccessManager(this)); + // init proxy settings + updateProxySettings(); + // launch instance, if that's what should be done // WARNING: disabled until further notice /* @@ -424,6 +380,13 @@ void MultiMC::initGlobalSettings() m_settings->registerSetting({"MinecraftWinWidth", "MCWindowWidth"}, 854); m_settings->registerSetting({"MinecraftWinHeight", "MCWindowHeight"}, 480); + // Proxy Settings + m_settings->registerSetting("ProxyType", "Default"); + m_settings->registerSetting({"ProxyAddr", "ProxyHostName"}, "127.0.0.1"); + m_settings->registerSetting("ProxyPort", 8080); + m_settings->registerSetting({"ProxyUser", "ProxyUsername"}, ""); + m_settings->registerSetting({"ProxyPass", "ProxyPassword"}, ""); + // Memory m_settings->registerSetting({"MinMemAlloc", "MinMemoryAlloc"}, 512); m_settings->registerSetting({"MaxMemAlloc", "MaxMemoryAlloc"}, 1024); @@ -467,6 +430,74 @@ void MultiMC::initHttpMetaCache() m_metacache->Load(); } +void MultiMC::updateProxySettings() +{ + QString proxyTypeStr = settings()->get("ProxyType").toString(); + + // Get the proxy settings from the settings object. + QString addr = settings()->get("ProxyAddr").toString(); + int port = settings()->get("ProxyPort").value(); + QString user = settings()->get("ProxyUser").toString(); + QString pass = settings()->get("ProxyPass").toString(); + + // Set the application proxy settings. + if (proxyTypeStr == "SOCKS5") + { + QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, addr, port, user, pass)); + } + else if (proxyTypeStr == "HTTP") + { + QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::HttpProxy, addr, port, user, pass)); + } + else if (proxyTypeStr == "None") + { + // If we have no proxy set, set no proxy and return. + QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::NoProxy)); + } + else + { + // If we have "Default" selected, set Qt to use the system proxy settings. + QNetworkProxyFactory::setUseSystemConfiguration(true); + } + + QLOG_INFO() << "Detecting proxy settings..."; + QNetworkProxy proxy = QNetworkProxy::applicationProxy(); + if (m_qnam.get()) m_qnam->setProxy(proxy); + QString proxyDesc; + if (proxy.type() == QNetworkProxy::NoProxy) + { + QLOG_INFO() << "Using no proxy is an option!"; + return; + } + switch (proxy.type()) + { + case QNetworkProxy::DefaultProxy: + proxyDesc = "Default proxy: "; + break; + case QNetworkProxy::Socks5Proxy: + proxyDesc = "Socks5 proxy: "; + break; + case QNetworkProxy::HttpProxy: + proxyDesc = "HTTP proxy: "; + break; + case QNetworkProxy::HttpCachingProxy: + proxyDesc = "HTTP caching: "; + break; + case QNetworkProxy::FtpCachingProxy: + proxyDesc = "FTP caching: "; + break; + default: + proxyDesc = "DERP proxy: "; + break; + } + proxyDesc += QString("%3@%1:%2 pass %4") + .arg(proxy.hostName()) + .arg(proxy.port()) + .arg(proxy.user()) + .arg(proxy.password()); + QLOG_INFO() << proxyDesc; +} + std::shared_ptr MultiMC::icons() { if (!m_icons) diff --git a/MultiMC.h b/MultiMC.h index d02099f3f..18c7aab7f 100644 --- a/MultiMC.h +++ b/MultiMC.h @@ -123,6 +123,11 @@ public: void installUpdates(const QString updateFilesDir, UpdateFlags flags = None); + /*! + * Updates the application proxy settings from the settings object. + */ + void updateProxySettings(); + /*! * Opens a json file using either a system default editor, or, if note empty, the editor * specified in the settings diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp index 549b11b04..091ffb1c3 100644 --- a/gui/dialogs/SettingsDialog.cpp +++ b/gui/dialogs/SettingsDialog.cpp @@ -83,6 +83,8 @@ void SettingsDialog::updateCheckboxStuff() { ui->windowWidthSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked()); ui->windowHeightSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked()); + ui->proxyAddrBox->setEnabled(!ui->proxyNoneBtn->isChecked() && !ui->proxyDefaultBtn->isChecked()); + ui->proxyAuthBox->setEnabled(!ui->proxyNoneBtn->isChecked() && !ui->proxyDefaultBtn->isChecked()); } void SettingsDialog::on_ftbLauncherBrowseBtn_clicked() @@ -202,6 +204,9 @@ void SettingsDialog::on_buttonBox_accepted() { applySettings(MMC->settings().get()); + // Apply proxy settings + MMC->updateProxySettings(); + MMC->settings()->set("SettingsGeometry", saveGeometry().toBase64()); } @@ -210,6 +215,12 @@ void SettingsDialog::on_buttonBox_rejected() MMC->settings()->set("SettingsGeometry", saveGeometry().toBase64()); } +void SettingsDialog::on_proxyNoneBtn_toggled(bool checked) +{ + Q_UNUSED(checked); + updateCheckboxStuff(); +} + void SettingsDialog::refreshUpdateChannelList() { // Stop listening for selection changes. It's going to change a lot while we update it and we don't need to update the @@ -310,6 +321,19 @@ void SettingsDialog::applySettings(SettingsObject *s) s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value()); s->set("MinecraftWinHeight", ui->windowHeightSpinBox->value()); + // Proxy + QString proxyType = "None"; + if (ui->proxyDefaultBtn->isChecked()) proxyType = "Default"; + else if (ui->proxyNoneBtn->isChecked()) proxyType = "None"; + else if (ui->proxySOCKS5Btn->isChecked()) proxyType = "SOCKS5"; + else if (ui->proxyHTTPBtn->isChecked()) proxyType = "HTTP"; + + s->set("ProxyType", proxyType); + s->set("ProxyAddr", ui->proxyAddrEdit->text()); + s->set("ProxyPort", ui->proxyPortEdit->value()); + s->set("ProxyUser", ui->proxyUserEdit->text()); + s->set("ProxyPass", ui->proxyPassEdit->text()); + // Memory s->set("MinMemAlloc", ui->minMemSpinBox->value()); s->set("MaxMemAlloc", ui->maxMemSpinBox->value()); @@ -384,6 +408,18 @@ void SettingsDialog::loadSettings(SettingsObject *s) ui->sortByNameBtn->setChecked(true); } + // Proxy + QString proxyType = s->get("ProxyType").toString(); + if (proxyType == "Default") ui->proxyDefaultBtn->setChecked(true); + else if (proxyType == "None") ui->proxyNoneBtn->setChecked(true); + else if (proxyType == "SOCKS5") ui->proxySOCKS5Btn->setChecked(true); + else if (proxyType == "HTTP") ui->proxyHTTPBtn->setChecked(true); + + ui->proxyAddrEdit->setText(s->get("ProxyAddr").toString()); + ui->proxyPortEdit->setValue(s->get("ProxyPort").value()); + ui->proxyUserEdit->setText(s->get("ProxyUser").toString()); + ui->proxyPassEdit->setText(s->get("ProxyPass").toString()); + // Java Settings ui->javaPathTextBox->setText(s->get("JavaPath").toString()); ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString()); @@ -447,4 +483,3 @@ void SettingsDialog::checkFinished(JavaCheckResult result) "or set the path to the java executable.")); } } - diff --git a/gui/dialogs/SettingsDialog.h b/gui/dialogs/SettingsDialog.h index df67d4927..6039ecab1 100644 --- a/gui/dialogs/SettingsDialog.h +++ b/gui/dialogs/SettingsDialog.h @@ -75,6 +75,8 @@ slots: void checkFinished(JavaCheckResult result); + void on_proxyNoneBtn_toggled(bool checked); + /*! * Updates the list of update channels in the combo box. */ diff --git a/gui/dialogs/SettingsDialog.ui b/gui/dialogs/SettingsDialog.ui index 7d2708cbb..756e2a1fa 100644 --- a/gui/dialogs/SettingsDialog.ui +++ b/gui/dialogs/SettingsDialog.ui @@ -7,7 +7,7 @@ 0 0 526 - 639 + 683 @@ -33,7 +33,7 @@ QTabWidget::Rounded - 0 + 2 @@ -424,6 +424,153 @@ + + + Network settings. + + + Network + + + + + + Proxy + + + + + + Type + + + + + + Uses your system's default proxy settings. + + + Default + + + + + + + None + + + + + + + SOCKS5 + + + + + + + HTTP + + + + + + + + + + Address and Port + + + + + + 127.0.0.1 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + QAbstractSpinBox::PlusMinus + + + 65535 + + + 8080 + + + + + + + + + + Authentication + + + + + + + + + Username: + + + + + + + Password: + + + + + + + QLineEdit::Password + + + + + + + Note: Proxy username and password are stored in plain text inside MultiMC's configuration file! + + + true + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + Java From 267f18ca814cbe96e9581dfbf79b744543d1e8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 6 Jan 2014 22:05:20 +0100 Subject: [PATCH 05/18] Add hack for Nvidia --- CMakeLists.txt | 2 +- Hacks.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 Hacks.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a9bd32c9..160d09f5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -529,7 +529,7 @@ QT5_ADD_RESOURCES(GRAPHICS_QRC graphics.qrc) ADD_LIBRARY(MultiMC_common STATIC ${MULTIMC_SOURCES} ${MULTIMC_UI} ${GENERATED_QRC} ${GRAPHICS_QRC}) # Add executable -ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 main.cpp ${MULTIMC_RCS}) +ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 main.cpp Hacks.cpp ${MULTIMC_RCS}) # Link TARGET_LINK_LIBRARIES(MultiMC MultiMC_common) diff --git a/Hacks.cpp b/Hacks.cpp new file mode 100644 index 000000000..3c3d8191b --- /dev/null +++ b/Hacks.cpp @@ -0,0 +1,8 @@ +#include "MultiMC.h" + +#ifdef Q_OS_WIN32 +extern "C" +{ +__declspec(dllexport) uint32_t NvOptimusEnablement = 0x00000001; +} +#endif From 28c35ea0db3b38a050f18c8aa868061202f931da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 7 Jan 2014 02:19:26 +0100 Subject: [PATCH 06/18] Fix proxy settings radio buttons not triggering updates of the proxy settings. --- gui/dialogs/SettingsDialog.cpp | 4 ++-- gui/dialogs/SettingsDialog.h | 3 +-- gui/dialogs/SettingsDialog.ui | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp index 091ffb1c3..00b3b1fdc 100644 --- a/gui/dialogs/SettingsDialog.cpp +++ b/gui/dialogs/SettingsDialog.cpp @@ -61,6 +61,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::Se { MMC->updateChecker()->updateChanList(); } + connect(ui->proxyGroup, SIGNAL(buttonClicked(int)), SLOT(proxyChanged(int))); } SettingsDialog::~SettingsDialog() @@ -215,9 +216,8 @@ void SettingsDialog::on_buttonBox_rejected() MMC->settings()->set("SettingsGeometry", saveGeometry().toBase64()); } -void SettingsDialog::on_proxyNoneBtn_toggled(bool checked) +void SettingsDialog::proxyChanged(int) { - Q_UNUSED(checked); updateCheckboxStuff(); } diff --git a/gui/dialogs/SettingsDialog.h b/gui/dialogs/SettingsDialog.h index 6039ecab1..d7bbbeb3c 100644 --- a/gui/dialogs/SettingsDialog.h +++ b/gui/dialogs/SettingsDialog.h @@ -75,8 +75,6 @@ slots: void checkFinished(JavaCheckResult result); - void on_proxyNoneBtn_toggled(bool checked); - /*! * Updates the list of update channels in the combo box. */ @@ -88,6 +86,7 @@ slots: void refreshUpdateChannelDesc(); void updateChannelSelectionChanged(int index); + void proxyChanged(int); private: Ui::SettingsDialog *ui; diff --git a/gui/dialogs/SettingsDialog.ui b/gui/dialogs/SettingsDialog.ui index 756e2a1fa..e7671cce4 100644 --- a/gui/dialogs/SettingsDialog.ui +++ b/gui/dialogs/SettingsDialog.ui @@ -7,7 +7,7 @@ 0 0 526 - 683 + 723 @@ -33,7 +33,7 @@ QTabWidget::Rounded - 2 + 0 @@ -452,6 +452,9 @@ Default + + proxyGroup + @@ -459,6 +462,9 @@ None + + proxyGroup + @@ -466,6 +472,9 @@ SOCKS5 + + proxyGroup + @@ -473,6 +482,9 @@ HTTP + + proxyGroup + @@ -884,5 +896,6 @@ + From 012b007e56c8121e5dc6434765f16647edd23585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 7 Jan 2014 02:43:25 +0100 Subject: [PATCH 07/18] Do not log each and every possible update. Only the latest one. --- logic/updater/UpdateChecker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logic/updater/UpdateChecker.cpp b/logic/updater/UpdateChecker.cpp index 489e77698..8a280dd17 100644 --- a/logic/updater/UpdateChecker.cpp +++ b/logic/updater/UpdateChecker.cpp @@ -142,8 +142,6 @@ void UpdateChecker::updateCheckFinished(bool notifyNoUpdate) if (newestVersion.value("Id").toVariant().toInt() < version.value("Id").toVariant().toInt()) { - QLOG_DEBUG() << "Found newer version with ID" - << version.value("Id").toVariant().toInt(); newestVersion = version; } } @@ -153,6 +151,7 @@ void UpdateChecker::updateCheckFinished(bool notifyNoUpdate) int newBuildNumber = newestVersion.value("Id").toVariant().toInt(); if (newBuildNumber != MMC->version().build) { + QLOG_DEBUG() << "Found newer version with ID" << newBuildNumber; // Update! emit updateAvailable(m_repoUrl, newestVersion.value("Name").toVariant().toString(), newBuildNumber); @@ -262,3 +261,4 @@ void UpdateChecker::chanListDownloadFailed() QLOG_ERROR() << "Failed to download channel list."; emit channelListLoaded(); } + From 5fe0ed7e8fad7654f9fe61669e596fe74bac8740 Mon Sep 17 00:00:00 2001 From: Sky Date: Tue, 7 Jan 2014 03:16:47 +0000 Subject: [PATCH 08/18] Return a properly sorted list of checked javas --- logic/JavaChecker.cpp | 2 ++ logic/JavaChecker.h | 2 ++ logic/JavaCheckerJob.cpp | 7 +++---- logic/lists/JavaVersionList.cpp | 4 ++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/logic/JavaChecker.cpp b/logic/JavaChecker.cpp index 113974ffd..a470bfa22 100644 --- a/logic/JavaChecker.cpp +++ b/logic/JavaChecker.cpp @@ -47,6 +47,7 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status) JavaCheckResult result; { result.path = path; + result.id = id; } if (status == QProcess::CrashExit || exitcode == 1) @@ -104,6 +105,7 @@ void JavaChecker::error(QProcess::ProcessError err) JavaCheckResult result; { result.path = path; + result.id = id; } emit checkFinished(result); diff --git a/logic/JavaChecker.h b/logic/JavaChecker.h index 291bf46cb..4705381c9 100644 --- a/logic/JavaChecker.h +++ b/logic/JavaChecker.h @@ -15,6 +15,7 @@ struct JavaCheckResult QString javaVersion; bool valid = false; bool is_64bit = false; + int id; }; typedef std::shared_ptr QProcessPtr; @@ -27,6 +28,7 @@ public: void performCheck(); QString path; + int id; signals: void checkFinished(JavaCheckResult result); diff --git a/logic/JavaCheckerJob.cpp b/logic/JavaCheckerJob.cpp index 36a8a050d..bb39bf627 100644 --- a/logic/JavaCheckerJob.cpp +++ b/logic/JavaCheckerJob.cpp @@ -26,10 +26,8 @@ void JavaCheckerJob::partFinished(JavaCheckResult result) << javacheckers.size(); emit progress(num_finished, javacheckers.size()); - javaresults.append(result); - int result_size = javacheckers.size(); - - emit progress(num_finished, result_size); + QLOG_INFO() << "after replace" << result.id << javaresults.size(); + javaresults.replace(result.id, result); if (num_finished == javacheckers.size()) { @@ -43,6 +41,7 @@ void JavaCheckerJob::start() m_running = true; for (auto iter : javacheckers) { + javaresults.append(JavaCheckResult()); connect(iter.get(), SIGNAL(checkFinished(JavaCheckResult)), SLOT(partFinished(JavaCheckResult))); iter->performCheck(); } diff --git a/logic/lists/JavaVersionList.cpp b/logic/lists/JavaVersionList.cpp index e8c5acd06..eb1c56500 100644 --- a/logic/lists/JavaVersionList.cpp +++ b/logic/lists/JavaVersionList.cpp @@ -182,13 +182,17 @@ void JavaListLoadTask::executeTask() connect(m_job.get(), SIGNAL(progress(int, int)), this, SLOT(checkerProgress(int, int))); QLOG_DEBUG() << "Probing the following Java paths: "; + int id = 0; for(QString candidate : candidate_paths) { QLOG_DEBUG() << " " << candidate; auto candidate_checker = new JavaChecker(); candidate_checker->path = candidate; + candidate_checker->id = id; m_job->addJavaCheckerAction(JavaCheckerPtr(candidate_checker)); + + id++; } m_job->start(); From 7773e771509935183a99e42ee61314431dd3f478 Mon Sep 17 00:00:00 2001 From: Sky Date: Tue, 7 Jan 2014 03:18:26 +0000 Subject: [PATCH 09/18] Don't include debugging messages :( --- logic/JavaCheckerJob.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/logic/JavaCheckerJob.cpp b/logic/JavaCheckerJob.cpp index bb39bf627..b0aea758e 100644 --- a/logic/JavaCheckerJob.cpp +++ b/logic/JavaCheckerJob.cpp @@ -26,7 +26,6 @@ void JavaCheckerJob::partFinished(JavaCheckResult result) << javacheckers.size(); emit progress(num_finished, javacheckers.size()); - QLOG_INFO() << "after replace" << result.id << javaresults.size(); javaresults.replace(result.id, result); if (num_finished == javacheckers.size()) From 3202b972f8dac05d4464eb46724b1bd703b9b21d Mon Sep 17 00:00:00 2001 From: Forkk Date: Tue, 7 Jan 2014 18:09:05 -0600 Subject: [PATCH 10/18] Rework version numbering system. Again... --- CMakeLists.txt | 30 ++++++++----- MultiMC.cpp | 4 +- MultiMCVersion.h | 63 +++++++++++++++------------ config.h.in | 12 +++-- logic/updater/NotificationChecker.cpp | 11 ++--- logic/updater/NotificationChecker.h | 2 +- 6 files changed, 70 insertions(+), 52 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 160d09f5b..79b79734e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,12 +128,16 @@ SET(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch ######## Set version numbers ######## SET(MultiMC_VERSION_MAJOR 0) SET(MultiMC_VERSION_MINOR 0) +SET(MultiMC_VERSION_HOTFIX 0) # Build number SET(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") -# Build type -SET(MultiMC_VERSION_BUILD_TYPE "custombuild" CACHE STRING "Build type. If this is set, it is appended to the end of the version string with a dash (-. It is not used for anything other than indicating in the version string what type of build this is (eg 'lin64').") +# Version type +SET(MultiMC_VERSION_TYPE "Custom" CACHE STRING "MultiMC's version type. This should be one of 'Custom', 'Release', 'ReleaseCandidate', or 'Development', depending on what type of version this is.") + +# Build platform. +SET(MultiMC_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.") # Version channel SET(MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string.") @@ -147,16 +151,20 @@ SET(MultiMC_UPDATER false CACHE BOOL "Whether or not the update system is enable # Notification URL SET(MultiMC_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.") +SET(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}") +IF (MultiMC_VERSION_HOTFIX GREATER 0) + SET(MultiMC_RELEASE_VERSION_NAME "${MultiMC_RELEASE_VERSION_NAME}.${MultiMC_VERSION_HOTFIX}") +ENDIF() + # Build a version string to display in the configure logs. -SET(MultiMC_VERSION_STRING "5.${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}") -IF (MultiMC_VERSION_BUILD GREATER -1) - SET(MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}.${MultiMC_VERSION_BUILD}") -ENDIF () -IF (NOT MultiMC_VERSION_CHANNEL STREQUAL "") - SET(MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}-${MultiMC_VERSION_CHANNEL}") -ENDIF () -IF (NOT MultiMC_VERSION_BUILD_TYPE STREQUAL "") - SET(MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}-${MultiMC_VERSION_BUILD_TYPE}") +IF (MultiMC_VERSION_TYPE STREQUAL "Custom" OR MultiMC_VERSION_TYPE STREQUAL "Release") + SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") +ELSEIF (MultiMC_VERSION_TYPE STREQUAL "ReleaseCandidate") + SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-rc${MultiMC_VERSION_BUILD}") +ELSEIF (MultiMC_VERSION_TYPE STREQUAL "Development") + SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}") +ELSE () + MESSAGE(ERROR "Invalid build type.") ENDIF () MESSAGE(STATUS "MultiMC 5 version ${MultiMC_VERSION_STRING}") diff --git a/MultiMC.cpp b/MultiMC.cpp index 7c4116935..17fc2e0a7 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -38,8 +38,8 @@ using namespace Util::Commandline; MultiMC::MultiMC(int &argc, char **argv, bool root_override) - : QApplication(argc, argv), m_version{VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, - VERSION_CHANNEL, VERSION_BUILD_TYPE} + : QApplication(argc, argv), m_version{VERSION_MAJOR, VERSION_MINOR, VERSION_HOTFIX, + VERSION_BUILD, MultiMCVersion::VERSION_TYPE, VERSION_CHANNEL, BUILD_PLATFORM} { setOrganizationName("MultiMC"); setApplicationName("MultiMC5"); diff --git a/MultiMCVersion.h b/MultiMCVersion.h index 75e017dfc..e205bec66 100644 --- a/MultiMCVersion.h +++ b/MultiMCVersion.h @@ -18,58 +18,63 @@ #include /*! - * \brief The Version class represents a MultiMC version number. + * \brief The Version class represents a MultiMC version. */ struct MultiMCVersion { + enum Type + { + //! Version type for stable release builds. + Release, + + //! Version type for release candidates. + ReleaseCandidate, + + //! Version type for development builds. + Development, + + //! Version type for custom builds. This is the default when no version type is specified. + Custom + }; + /*! * \brief Converts the Version to a string. * \return The version number in string format (major.minor.revision.build). */ QString toString() const { - QString vstr = QString("5.%1.%2").arg( + QString vstr = QString("%1.%2").arg( QString::number(major), QString::number(minor)); - if (build >= 0) vstr += "." + QString::number(build); - if (!channel.isEmpty()) vstr += "-" + channel; - if (!buildType.isEmpty()) vstr += "-" + buildType; + if (hotfix > 0) vstr += "." + QString::number(hotfix); + + // If the build is a development build or release candidate, add that info to the end. + if (type == Development) vstr += "-dev" + QString::number(build); + else if (type == ReleaseCandidate) vstr += "-rc" + QString::number(build); return vstr; } - /*! - * \brief The major version number. - * This is no longer going to always be 5 for MultiMC 5. Doing so is useless. - * Instead, we'll be starting major off at 1 and incrementing it with every major feature. - */ + //! The major version number. int major; - /*! - * \brief The minor version number. - * This number is incremented for major features and bug fixes. - */ + //! The minor version number. int minor; - /*! - * \brief The build number. - * This number is automatically set by Buildbot it is set to the build number of the buildbot - * build that this build came from. - * If this build didn't come from buildbot and no build number was given to CMake, this will default - * to -1, causing it to not show in this version's string representation. - */ + //! The hotfix number. + int hotfix; + + //! The build number. int build; - /*! - * \brief This build's channel. - */ + //! The build type. + Type type; + + //! The build channel. QString channel; - /*! - * \brief The build type. - * This indicates the type of build that this is. For example, lin64 or custombuild. - */ - QString buildType; + //! A short string identifying the platform that this version is for. For example, lin64 or win32. + QString platform; }; diff --git a/config.h.in b/config.h.in index 8df1fc751..16e9f54ee 100644 --- a/config.h.in +++ b/config.h.in @@ -1,13 +1,17 @@ #pragma once -// Minor and major version, used to communicate changes to users. +// Version information #define VERSION_MAJOR @MultiMC_VERSION_MAJOR@ #define VERSION_MINOR @MultiMC_VERSION_MINOR@ - -// Build number, channel, and type -- number and channel are used by the updater, type is purely visual +#define VERSION_HOTFIX @MultiMC_VERSION_HOTFIX@ #define VERSION_BUILD @MultiMC_VERSION_BUILD@ +#define VERSION_TYPE @MultiMC_VERSION_TYPE@ + +// The version channel. This is used by the updater to determine what channel the current version came from. #define VERSION_CHANNEL "@MultiMC_VERSION_CHANNEL@" -#define VERSION_BUILD_TYPE "@MultiMC_VERSION_BUILD_TYPE@" + +// A short string identifying this build's platform. For example, "lin64" or "win32". +#define BUILD_PLATFORM "@MultiMC_BUILD_PLATFORM@" // URL for the updater's channel #define CHANLIST_URL "@MultiMC_CHANLIST_URL@" diff --git a/logic/updater/NotificationChecker.cpp b/logic/updater/NotificationChecker.cpp index 40367eace..b2d67632e 100644 --- a/logic/updater/NotificationChecker.cpp +++ b/logic/updater/NotificationChecker.cpp @@ -5,8 +5,8 @@ #include #include "MultiMC.h" +#include "MultiMCVersion.h" #include "logic/net/CacheDownload.h" -#include "config.h" NotificationChecker::NotificationChecker(QObject *parent) : QObject(parent), m_notificationsUrl(QUrl(NOTIFICATION_URL)) @@ -66,7 +66,7 @@ void NotificationChecker::downloadSucceeded(int) entry.id = obj.value("id").toDouble(); entry.message = obj.value("message").toString(); entry.channel = obj.value("channel").toString(); - entry.buildtype = obj.value("buildtype").toString(); + entry.platform = obj.value("platform").toString(); entry.from = obj.value("from").toString(); entry.to = obj.value("to").toString(); const QString type = obj.value("type").toString("critical"); @@ -93,13 +93,14 @@ void NotificationChecker::downloadSucceeded(int) bool NotificationChecker::NotificationEntry::applies() const { - bool channelApplies = channel.isEmpty() || channel == VERSION_CHANNEL; - bool buildtypeApplies = buildtype.isEmpty() || buildtype == VERSION_BUILD_TYPE; + MultiMCVersion version = MMC->version(); + bool channelApplies = channel.isEmpty() || channel == version.channel; + bool platformApplies = platform.isEmpty() || platform == version.platform; bool fromApplies = from.isEmpty() || from == FULL_VERSION_STR || !versionLessThan(FULL_VERSION_STR, from); bool toApplies = to.isEmpty() || to == FULL_VERSION_STR || !versionLessThan(to, FULL_VERSION_STR); - return channelApplies && buildtypeApplies && fromApplies && toApplies; + return channelApplies && platformApplies && fromApplies && toApplies; } bool NotificationChecker::NotificationEntry::versionLessThan(const QString &v1, diff --git a/logic/updater/NotificationChecker.h b/logic/updater/NotificationChecker.h index 20541757f..915ee54d2 100644 --- a/logic/updater/NotificationChecker.h +++ b/logic/updater/NotificationChecker.h @@ -26,7 +26,7 @@ public: Information } type; QString channel; - QString buildtype; + QString platform; QString from; QString to; bool applies() const; From fb83299e592ef7627d5914e0fbce70c570981124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 8 Jan 2014 01:27:40 +0100 Subject: [PATCH 11/18] Deploy jars instead of extracting them at runtime, remove non-working nvidia fix --- CMakeLists.txt | 139 ++++++++++++++++--------------- Hacks.cpp | 8 -- depends/javacheck/CMakeLists.txt | 5 +- depends/launcher/CMakeLists.txt | 3 +- generated.qrc.in | 2 + logic/JavaChecker.cpp | 16 +--- logic/JavaChecker.h | 2 - logic/LegacyInstance.cpp | 6 +- 8 files changed, 83 insertions(+), 98 deletions(-) delete mode 100644 Hacks.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 160d09f5b..7ab9983da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,9 +38,7 @@ ELSEIF(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall") ENDIF() -################################ INCLUDE LIBRARIES ################################ - -######## 3rd Party Libs ######## +################################ 3rd Party Libs ################################ # Find the required Qt parts find_package(Qt5Core REQUIRED) @@ -75,41 +73,6 @@ query_qmake(QT_HOST_DATA QT_DATA_DIR) set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) -######## Included Libs ######## - -# Add quazip -add_subdirectory(depends/quazip) -include_directories(depends/quazip) - -# Add the java launcher and checker -add_subdirectory(depends/launcher) -add_subdirectory(depends/javacheck) - -# Add xz decompression -add_subdirectory(depends/xz-embedded) -include_directories(${XZ_INCLUDE_DIR}) - -# Add pack200 decompression -add_subdirectory(depends/pack200) -include_directories(${PACK200_INCLUDE_DIR}) - -######## MultiMC Libs ######## - -# Add the util library. -add_subdirectory(depends/util) -include_directories(${LIBUTIL_INCLUDE_DIR}) - -# Add the settings library. -add_subdirectory(depends/settings) -include_directories(${LIBSETTINGS_INCLUDE_DIR}) - -# Add the group view library. -add_subdirectory(depends/groupview) -include_directories(${LIBGROUPVIEW_INCLUDE_DIR}) - -# Add the updater -add_subdirectory(mmc_updater) - ################################ SET UP BUILD OPTIONS ################################ ######## Check endianness ######## @@ -209,6 +172,72 @@ ADD_DEFINITIONS(-DLIBSETTINGS_STATIC) ADD_DEFINITIONS(-DLIBUTIL_STATIC) ADD_DEFINITIONS(-DLIBGROUPVIEW_STATIC) +######## Packaging/install paths setup ######## + +IF(UNIX AND APPLE) + SET(BINARY_DEST_DIR MultiMC.app/Contents/MacOS) + SET(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS) + SET(QTCONF_DEST_DIR MultiMC.app/Contents/Resources) + SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app") + + SET(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC") + SET(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.") + SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5") + SET(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") + SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") + SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") + SET(MACOSX_BUNDLE_ICON_FILE MultiMC.icns) + SET(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 MultiMC Contributors") +ELSEIF(UNIX) + SET(BINARY_DEST_DIR bin) + SET(PLUGIN_DEST_DIR plugins) + SET(QTCONF_DEST_DIR .) + SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC") +ELSEIF(WIN32) + SET(BINARY_DEST_DIR .) + SET(PLUGIN_DEST_DIR .) + SET(QTCONF_DEST_DIR .) + SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe") +ENDIF() + +# directories to look for dependencies +SET(DIRS "${QT_LIBS_DIR}") + +################################ Included Libs ################################ + +# Add quazip +add_subdirectory(depends/quazip) +include_directories(depends/quazip) + +# Add the java launcher and checker +add_subdirectory(depends/launcher) +add_subdirectory(depends/javacheck) + +# Add xz decompression +add_subdirectory(depends/xz-embedded) +include_directories(${XZ_INCLUDE_DIR}) + +# Add pack200 decompression +add_subdirectory(depends/pack200) +include_directories(${PACK200_INCLUDE_DIR}) + +######## MultiMC Libs ######## + +# Add the util library. +add_subdirectory(depends/util) +include_directories(${LIBUTIL_INCLUDE_DIR}) + +# Add the settings library. +add_subdirectory(depends/settings) +include_directories(${LIBSETTINGS_INCLUDE_DIR}) + +# Add the group view library. +add_subdirectory(depends/groupview) +include_directories(${LIBGROUPVIEW_INCLUDE_DIR}) + +# Add the updater +add_subdirectory(mmc_updater) + ################################ FILES ################################ ######## Sources and headers ######## @@ -516,8 +545,8 @@ IF(MultiMC_CODE_COVERAGE) ENDIF(MultiMC_CODE_COVERAGE) # Tell CMake that MultiMCLauncher.jar is generated. -SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED) -SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED) +#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED) +#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED) # Qt 5 stuff QT5_WRAP_UI(MULTIMC_UI ${MULTIMC_UIS}) @@ -529,7 +558,7 @@ QT5_ADD_RESOURCES(GRAPHICS_QRC graphics.qrc) ADD_LIBRARY(MultiMC_common STATIC ${MULTIMC_SOURCES} ${MULTIMC_UI} ${GENERATED_QRC} ${GRAPHICS_QRC}) # Add executable -ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 main.cpp Hacks.cpp ${MULTIMC_RCS}) +ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 main.cpp ${MULTIMC_RCS}) # Link TARGET_LINK_LIBRARIES(MultiMC MultiMC_common) @@ -540,34 +569,6 @@ ADD_DEPENDENCIES(MultiMC_common MultiMCLauncher JavaCheck) ################################ INSTALLATION AND PACKAGING ################################ -######## Packaging/install paths setup ######## - -IF(UNIX AND APPLE) - SET(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS) - SET(QTCONF_DEST_DIR MultiMC.app/Contents/Resources) - SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app") - - SET(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC") - SET(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.") - SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5") - SET(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") - SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") - SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") - SET(MACOSX_BUNDLE_ICON_FILE MultiMC.icns) - SET(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 MultiMC Contributors") -ELSEIF(UNIX) - SET(PLUGIN_DEST_DIR plugins) - SET(QTCONF_DEST_DIR .) - SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC") -ELSEIF(WIN32) - SET(PLUGIN_DEST_DIR .) - SET(QTCONF_DEST_DIR .) - SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe") -ENDIF() - -# directories to look for dependencies -SET(DIRS "${QT_LIBS_DIR}") - ######## Install ######## #### Executable #### diff --git a/Hacks.cpp b/Hacks.cpp deleted file mode 100644 index 3c3d8191b..000000000 --- a/Hacks.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "MultiMC.h" - -#ifdef Q_OS_WIN32 -extern "C" -{ -__declspec(dllexport) uint32_t NvOptimusEnablement = 0x00000001; -} -#endif diff --git a/depends/javacheck/CMakeLists.txt b/depends/javacheck/CMakeLists.txt index e72c95520..10b9a7168 100644 --- a/depends/javacheck/CMakeLists.txt +++ b/depends/javacheck/CMakeLists.txt @@ -5,10 +5,11 @@ find_package(Java 1.6 REQUIRED COMPONENTS Development) include(UseJava) set(CMAKE_JAVA_JAR_ENTRY_POINT JavaCheck) set(CMAKE_JAVA_COMPILE_FLAGS -target 1.6 -source 1.6 -Xlint:deprecation -Xlint:unchecked) -#set(CMAKE_JAVA_TARGET_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/../../resources") set(SRC JavaCheck.java ) -add_jar(JavaCheck ${SRC}) \ No newline at end of file +add_jar(JavaCheck ${SRC}) + +INSTALL_JAR(JavaCheck "${BINARY_DEST_DIR}/jars") diff --git a/depends/launcher/CMakeLists.txt b/depends/launcher/CMakeLists.txt index e91d5bd64..729ebb672 100644 --- a/depends/launcher/CMakeLists.txt +++ b/depends/launcher/CMakeLists.txt @@ -5,7 +5,6 @@ find_package(Java 1.6 REQUIRED COMPONENTS Development) include(UseJava) set(CMAKE_JAVA_JAR_ENTRY_POINT MultiMCLauncher) set(CMAKE_JAVA_COMPILE_FLAGS -target 1.6 -source 1.6 -Xlint:deprecation -Xlint:unchecked) -#set(CMAKE_JAVA_TARGET_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/../../resources") set(SRC MultiMCLauncher.java @@ -19,3 +18,5 @@ set(SRC ) add_jar(MultiMCLauncher ${SRC}) + +INSTALL_JAR(MultiMCLauncher "${BINARY_DEST_DIR}/jars") diff --git a/generated.qrc.in b/generated.qrc.in index 82f4db99f..794943eb7 100644 --- a/generated.qrc.in +++ b/generated.qrc.in @@ -1,6 +1,8 @@ + diff --git a/logic/JavaChecker.cpp b/logic/JavaChecker.cpp index a470bfa22..6ee7b4cfa 100644 --- a/logic/JavaChecker.cpp +++ b/logic/JavaChecker.cpp @@ -1,26 +1,20 @@ #include "JavaChecker.h" +#include "MultiMC.h" +#include #include #include #include #include -#define CHECKER_FILE "JavaChecker.jar" - JavaChecker::JavaChecker(QObject *parent) : QObject(parent) { } void JavaChecker::performCheck() { - checkerJar.setFileTemplate("checker_XXXXXX.jar"); - checkerJar.open(); - QFile inner(":/java/checker.jar"); - inner.open(QIODevice::ReadOnly); - checkerJar.write(inner.readAll()); - inner.close(); - checkerJar.close(); + QString checkerJar = PathCombine(MMC->bin(), "jars", "JavaCheck.jar"); - QStringList args = {"-jar", checkerJar.fileName()}; + QStringList args = {"-jar", checkerJar}; process.reset(new QProcess()); process->setArguments(args); @@ -42,7 +36,6 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status) killTimer.stop(); QProcessPtr _process; _process.swap(process); - checkerJar.remove(); JavaCheckResult result; { @@ -100,7 +93,6 @@ void JavaChecker::error(QProcess::ProcessError err) if(err == QProcess::FailedToStart) { killTimer.stop(); - checkerJar.remove(); JavaCheckResult result; { diff --git a/logic/JavaChecker.h b/logic/JavaChecker.h index 4705381c9..e19895f7f 100644 --- a/logic/JavaChecker.h +++ b/logic/JavaChecker.h @@ -1,7 +1,6 @@ #pragma once #include #include -#include #include class JavaChecker; @@ -35,7 +34,6 @@ signals: private: QProcessPtr process; QTimer killTimer; - QTemporaryFile checkerJar; public slots: void timeout(); diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp index 0bc0961e5..5ab19fc98 100644 --- a/logic/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -31,8 +31,6 @@ #include "gui/dialogs/LegacyModEditDialog.h" -#define LAUNCHER_FILE "MultiMCLauncher.jar" - LegacyInstance::LegacyInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) : BaseInstance(new LegacyInstancePrivate(), rootDir, settings, parent) @@ -61,7 +59,7 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account) pixmap.save(PathCombine(minecraftRoot(), "icon.png"), "PNG"); // extract the legacy launcher - QFile(":/java/launcher.jar").copy(PathCombine(minecraftRoot(), LAUNCHER_FILE)); + QString launcherJar = PathCombine(MMC->bin(), "jars", "MultiMCLauncher.jar"); // set the process arguments { @@ -104,7 +102,7 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account) "minecraft.exe.heapdump"); #endif - args << "-jar" << LAUNCHER_FILE; + args << "-jar" << launcherJar; args << account->currentProfile()->name; args << account->sessionId(); args << windowTitle; From a14eeab2d6f6437f0cbd7402537ef6634085f7ac Mon Sep 17 00:00:00 2001 From: Forkk Date: Tue, 7 Jan 2014 18:31:31 -0600 Subject: [PATCH 12/18] Add information to the about dialog. --- MultiMCVersion.h | 16 ++++++ gui/dialogs/AboutDialog.cpp | 17 +++++- gui/dialogs/AboutDialog.ui | 109 ++++++++++++++++++++++++++++-------- 3 files changed, 118 insertions(+), 24 deletions(-) diff --git a/MultiMCVersion.h b/MultiMCVersion.h index e205bec66..811b9076f 100644 --- a/MultiMCVersion.h +++ b/MultiMCVersion.h @@ -56,6 +56,22 @@ struct MultiMCVersion return vstr; } + QString typeName() const + { + switch (type) + { + case Release: + return "Stable Release"; + case ReleaseCandidate: + return "Release Candidate"; + case Development: + return "Development"; + case Custom: + default: + return "Custom"; + } + } + //! The major version number. int major; diff --git a/gui/dialogs/AboutDialog.cpp b/gui/dialogs/AboutDialog.cpp index 58d61dd0b..efeea6f2c 100644 --- a/gui/dialogs/AboutDialog.cpp +++ b/gui/dialogs/AboutDialog.cpp @@ -25,7 +25,22 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia ui->setupUi(this); ui->icon->setPixmap(QIcon(":/icons/multimc/scalable/apps/multimc.svg").pixmap(64)); - ui->title->setText("MultiMC " + MMC->version().toString()); + ui->title->setText("MultiMC 5 " + MMC->version().toString()); + + ui->versionLabel->setText(tr("Version") +": " + MMC->version().toString()); + ui->vtypeLabel->setText(tr("Version Type") +": " + MMC->version().typeName()); + ui->platformLabel->setText(tr("Platform") +": " + MMC->version().platform); + + if (MMC->version().build >= 0) + ui->buildNumLabel->setText(tr("Build Number") +": " + QString::number(MMC->version().build)); + else + ui->buildNumLabel->setVisible(false); + + if (!MMC->version().channel.isEmpty()) + ui->channelLabel->setText(tr("Channel") +": " + MMC->version().channel); + else + ui->channelLabel->setVisible(false); + connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); MMC->connect(ui->aboutQt, SIGNAL(clicked()), SLOT(aboutQt())); diff --git a/gui/dialogs/AboutDialog.ui b/gui/dialogs/AboutDialog.ui index df9b1a53d..b0dafb06b 100644 --- a/gui/dialogs/AboutDialog.ui +++ b/gui/dialogs/AboutDialog.ui @@ -86,7 +86,7 @@ - MultiMC + MultiMC 5 Qt::AlignCenter @@ -103,14 +103,64 @@ 0 0 - 685 - 304 + 689 + 331 About + + + + Version: + + + Qt::AlignCenter + + + + + + + Version Type: + + + Qt::AlignCenter + + + + + + + Platform: + + + Qt::AlignCenter + + + + + + + Build Number: + + + Qt::AlignCenter + + + + + + + Channel: + + + Qt::AlignCenter + + + @@ -158,6 +208,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -165,8 +228,8 @@ 0 0 - 685 - 304 + 689 + 331 @@ -182,19 +245,19 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">MultiMC</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Andrew Okin &lt;</span><a href="mailto:forkk@forkk.net"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">forkk@forkk.net</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Petr Mrázek &lt;</span><a href="mailto:peterix@gmail.com"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">peterix@gmail.com</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Sky &lt;</span><a href="https://www.twitter.com/drayshak"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">@drayshak</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; font-weight:600;"><br /></p> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">MultiMC</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Andrew Okin &lt;</span><a href="mailto:forkk@forkk.net"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">forkk@forkk.net</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Petr Mrázek &lt;</span><a href="mailto:peterix@gmail.com"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">peterix@gmail.com</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Sky &lt;</span><a href="https://www.twitter.com/drayshak"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">@drayshak</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt; font-weight:600;">With thanks to</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Orochimarufan &lt;</span><a href="mailto:orochimarufan.x3@gmail.com"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">orochimarufan.x3@gmail.com</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">TakSuyu &lt;</span><a href="mailto:taksuyu@gmail.com"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">taksuyu@gmail.com</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Kilobyte &lt;</span><a href="mailto:stiepen22@gmx.de"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">stiepen22@gmx.de</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Jan (02JanDal) &lt;</span><a href="mailto:02jandal@gmail.com"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">02jandal@gmail.com</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Robotbrain &lt;</span><a href="https://twitter.com/skylordelros"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">@skylordelros</span></a><span style=" font-size:10pt;">&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Rootbear75 &lt;</span><a href="https://twitter.com/rootbear75"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">@rootbear75</span></a><span style=" font-size:10pt;">&gt; (build server)</span></p></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Orochimarufan &lt;</span><a href="mailto:orochimarufan.x3@gmail.com"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">orochimarufan.x3@gmail.com</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">TakSuyu &lt;</span><a href="mailto:taksuyu@gmail.com"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">taksuyu@gmail.com</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Kilobyte &lt;</span><a href="mailto:stiepen22@gmx.de"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">stiepen22@gmx.de</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Jan (02JanDal) &lt;</span><a href="mailto:02jandal@gmail.com"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">02jandal@gmail.com</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Robotbrain &lt;</span><a href="https://twitter.com/skylordelros"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">@skylordelros</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Rootbear75 &lt;</span><a href="https://twitter.com/rootbear75"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">@rootbear75</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">&gt; (build server)</span></p></body></html> Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse @@ -218,8 +281,8 @@ p, li { white-space: pre-wrap; } 0 0 - 684 - 290 + 689 + 331 @@ -246,7 +309,7 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:7.8pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:9pt; font-weight:400; font-style:normal;"> <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">MultiMC</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Copyright 2012-2014 MultiMC Contributors</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></p> @@ -378,8 +441,8 @@ p, li { white-space: pre-wrap; } 0 0 - 684 - 290 + 689 + 331 @@ -392,7 +455,7 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:11pt;">We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans'; font-size:11pt;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:11pt;">Part of the reason for using the Apache license is we don't want people using the &quot;MultiMC&quot; name when redistributing the project. This means people must take the time to go through the source code and remove all references to &quot;MultiMC&quot;, including but not limited to the project icon and the title of windows, (no *MultiMC-fork* in the title).</span></p> From 9bf4d087703d1c8b862a205b38191fb4fcbc0ad9 Mon Sep 17 00:00:00 2001 From: Forkk Date: Tue, 7 Jan 2014 19:00:42 -0600 Subject: [PATCH 13/18] Add changelog. --- changelog.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog.yaml diff --git a/changelog.yaml b/changelog.yaml new file mode 100644 index 000000000..63c4b4b13 --- /dev/null +++ b/changelog.yaml @@ -0,0 +1,2 @@ +0.0: + - Initial release. From d7564a51ce4a85799bd421dac0c913cb20d25a63 Mon Sep 17 00:00:00 2001 From: Forkk Date: Tue, 7 Jan 2014 19:21:42 -0600 Subject: [PATCH 14/18] Bump minor version number and update changelog. --- CMakeLists.txt | 2 +- changelog.yaml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c795ab8f..33183b9d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,7 @@ SET(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch ######## Set version numbers ######## SET(MultiMC_VERSION_MAJOR 0) -SET(MultiMC_VERSION_MINOR 0) +SET(MultiMC_VERSION_MINOR 1) SET(MultiMC_VERSION_HOTFIX 0) # Build number diff --git a/changelog.yaml b/changelog.yaml index 63c4b4b13..38b8f755e 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,2 +1,18 @@ +# +# This is MultiMC's changelog. It is formatted in YAML. +# +# Each key below represents a release version name. Each release key has several string entries under it, each containing information about a single change. Each of these entries may contain Markdown for formatting. +# + 0.0: - Initial release. +0.1: + - Reworked the version numbering system to support our [new Git workflow](http://nvie.com/posts/a-successful-git-branching-model/). + - Added a tray icon for the console window. + - Fixed instances getting deselected after FTB instances are loaded (or whenever the model is reset). + - Implemented proxy settings. + - Added a hack to fix NVidia Optimus using the wrong graphics card. + - Fixed sorting of Java installations in the Java list. + - Jar files are now distributed separately, rather than being extracted from the binary at runtime. + - Added additional information to the about dialog. + From 87b12a63a12529933e10c0e9d9fdcb5415f3132f Mon Sep 17 00:00:00 2001 From: Forkk Date: Tue, 7 Jan 2014 19:30:08 -0600 Subject: [PATCH 15/18] Make CMake output version type info --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33183b9d7..274e4155d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,17 +120,23 @@ IF (MultiMC_VERSION_HOTFIX GREATER 0) ENDIF() # Build a version string to display in the configure logs. -IF (MultiMC_VERSION_TYPE STREQUAL "Custom" OR MultiMC_VERSION_TYPE STREQUAL "Release") +IF (MultiMC_VERSION_TYPE STREQUAL "Custom") + MESSAGE(STATUS "Version Type: Custom") + SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") +ELSEIF (MultiMC_VERSION_TYPE STREQUAL "Release") + MESSAGE(STATUS "Version Type: Stable Release") SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") ELSEIF (MultiMC_VERSION_TYPE STREQUAL "ReleaseCandidate") + MESSAGE(STATUS "Version Type: Release Candidate") SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-rc${MultiMC_VERSION_BUILD}") ELSEIF (MultiMC_VERSION_TYPE STREQUAL "Development") + MESSAGE(STATUS "Version Type: Development") SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}") ELSE () MESSAGE(ERROR "Invalid build type.") ENDIF () -MESSAGE(STATUS "MultiMC 5 version ${MultiMC_VERSION_STRING}") +MESSAGE(STATUS "MultiMC 5 Version: ${MultiMC_VERSION_STRING}") # If the update system is enabled, make sure MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL are set. IF (MultiMC_UPDATER) From 7ace682260bb392714e2a9a8a985e79f3ee9b022 Mon Sep 17 00:00:00 2001 From: Forkk Date: Wed, 8 Jan 2014 17:54:23 -0600 Subject: [PATCH 16/18] Remove lies from the changelog There wasn't really an Optimus fix. LIES! ALL LIES! --- changelog.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/changelog.yaml b/changelog.yaml index 38b8f755e..0e41abdd1 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -11,7 +11,6 @@ - Added a tray icon for the console window. - Fixed instances getting deselected after FTB instances are loaded (or whenever the model is reset). - Implemented proxy settings. - - Added a hack to fix NVidia Optimus using the wrong graphics card. - Fixed sorting of Java installations in the Java list. - Jar files are now distributed separately, rather than being extracted from the binary at runtime. - Added additional information to the about dialog. From b4fcbab5135205d64b34d1774b2efd7c3dd56672 Mon Sep 17 00:00:00 2001 From: Forkk Date: Wed, 8 Jan 2014 17:56:38 -0600 Subject: [PATCH 17/18] Word wrap the update channel description label Previously, channel descriptions that were too long would mess up the dialog. --- gui/dialogs/SettingsDialog.ui | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/dialogs/SettingsDialog.ui b/gui/dialogs/SettingsDialog.ui index e7671cce4..251e79162 100644 --- a/gui/dialogs/SettingsDialog.ui +++ b/gui/dialogs/SettingsDialog.ui @@ -106,6 +106,9 @@ No channel selected. + + true + @@ -895,7 +898,7 @@ - + From b767d4b134148ddb3f956253a2f7f2cad831e782 Mon Sep 17 00:00:00 2001 From: Forkk Date: Wed, 8 Jan 2014 18:02:15 -0600 Subject: [PATCH 18/18] Fix the window title The window title now says "MultiMC 5 - Version [on ]" --- gui/MainWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 905d14cff..69cdf602b 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -99,7 +99,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi { MultiMCPlatform::fixWM_CLASS(this); ui->setupUi(this); - setWindowTitle(QString("MultiMC %1").arg(MMC->version().toString())); + + QString winTitle = QString("MultiMC 5 - Version %1").arg(MMC->version().toString()); + if (!MMC->version().platform.isEmpty()) + winTitle += " on " + MMC->version().platform; + setWindowTitle(winTitle); // OSX magic. // setUnifiedTitleAndToolBarOnMac(true);