Merge branch 'develop' of github.com:MultiMC/MultiMC5 into develop
This commit is contained in:
		
							
								
								
									
										16
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								.travis.yml
									
									
									
									
									
								
							| @@ -1,16 +0,0 @@ | ||||
| language: cpp | ||||
| compiler: | ||||
|   - gcc | ||||
|  | ||||
| before_script: | ||||
|   - sudo apt-add-repository -y ppa:czchen/travis-ci | ||||
|   - sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa | ||||
|   - sudo add-apt-repository -y ppa:canonical-qt5-edgers/qt5-proper | ||||
|   - sudo apt-get update -yqq | ||||
|   - sudo apt-get install -yqq cmake | ||||
|   - sudo apt-get install -yqq ubuntu-sdk | ||||
|  | ||||
| script: "cmake . && make -j4" | ||||
|  | ||||
| notifications: | ||||
|   irc: "irc.esper.net#MultiMC" | ||||
| @@ -6,8 +6,8 @@ | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>600</width> | ||||
|     <height>400</height> | ||||
|     <width>610</width> | ||||
|     <height>391</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
| @@ -23,6 +23,9 @@ | ||||
|    <property name="rightMargin"> | ||||
|     <number>0</number> | ||||
|    </property> | ||||
|    <property name="bottomMargin"> | ||||
|     <number>6</number> | ||||
|    </property> | ||||
|    <item> | ||||
|     <widget class="QPlainTextEdit" name="text"> | ||||
|      <property name="font"> | ||||
| @@ -49,6 +52,12 @@ | ||||
|    </item> | ||||
|    <item> | ||||
|     <layout class="QHBoxLayout" name="horizontalLayout"> | ||||
|      <property name="leftMargin"> | ||||
|       <number>6</number> | ||||
|      </property> | ||||
|      <property name="rightMargin"> | ||||
|       <number>6</number> | ||||
|      </property> | ||||
|      <item> | ||||
|       <spacer name="horizontalSpacer"> | ||||
|        <property name="orientation"> | ||||
| @@ -65,14 +74,14 @@ | ||||
|      <item> | ||||
|       <widget class="QPushButton" name="btnKillMinecraft"> | ||||
|        <property name="text"> | ||||
|         <string>Kill Minecraft</string> | ||||
|         <string>&Kill Minecraft</string> | ||||
|        </property> | ||||
|       </widget> | ||||
|      </item> | ||||
|      <item> | ||||
|       <widget class="QPushButton" name="closeButton"> | ||||
|        <property name="text"> | ||||
|         <string>Close</string> | ||||
|         <string>&Close</string> | ||||
|        </property> | ||||
|       </widget> | ||||
|      </item> | ||||
| @@ -80,6 +89,11 @@ | ||||
|    </item> | ||||
|   </layout> | ||||
|  </widget> | ||||
|  <tabstops> | ||||
|   <tabstop>text</tabstop> | ||||
|   <tabstop>closeButton</tabstop> | ||||
|   <tabstop>btnKillMinecraft</tabstop> | ||||
|  </tabstops> | ||||
|  <resources/> | ||||
|  <connections/> | ||||
| </ui> | ||||
|   | ||||
| @@ -535,9 +535,9 @@ void MainWindow::instanceActivated(QModelIndex index) | ||||
| 	BaseInstance *inst = | ||||
| 		(BaseInstance *)index.data(InstanceList::InstancePointerRole).value<void *>(); | ||||
|  | ||||
| 	NagUtils::checkJVMArgs(MMC->settings()->get("JvmArgs").toString(), this); | ||||
| 	NagUtils::checkJVMArgs(inst->settings().get("JvmArgs").toString(), this); | ||||
|  | ||||
| 	bool autoLogin = MMC->settings()->get("AutoLogin").toBool(); | ||||
| 	bool autoLogin = inst->settings().get("AutoLogin").toBool(); | ||||
| 	if (autoLogin) | ||||
| 		doAutoLogin(); | ||||
| 	else | ||||
| @@ -548,7 +548,7 @@ void MainWindow::on_actionLaunchInstance_triggered() | ||||
| { | ||||
| 	if (m_selectedInstance) | ||||
| 	{ | ||||
| 		NagUtils::checkJVMArgs(MMC->settings()->get("JvmArgs").toString(), this); | ||||
| 		NagUtils::checkJVMArgs(m_selectedInstance->settings().get("JvmArgs").toString(), this); | ||||
| 		doLogin(); | ||||
| 	} | ||||
| } | ||||
| @@ -826,7 +826,7 @@ void MainWindow::on_actionInstanceSettings_triggered() | ||||
| 		return; | ||||
|  | ||||
| 	InstanceSettings settings(&m_selectedInstance->settings(), this); | ||||
| 	settings.setWindowTitle(QString("Instance settings")); | ||||
| 	settings.setWindowTitle(tr("Instance settings")); | ||||
| 	settings.exec(); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -20,6 +20,7 @@ | ||||
| #include "InstanceSettings.h" | ||||
| #include "ui_InstanceSettings.h" | ||||
| #include "gui/Platform.h" | ||||
| #include "logic/NagUtils.h" | ||||
|  | ||||
| InstanceSettings::InstanceSettings(SettingsObject *obj, QWidget *parent) | ||||
| 	: m_obj(obj), QDialog(parent), ui(new Ui::InstanceSettings) | ||||
| @@ -89,11 +90,11 @@ void InstanceSettings::applySettings() | ||||
| 	} | ||||
|  | ||||
| 	// Auto Login | ||||
| 	bool login = ui->accountSettingsGroupBox->isChecked(); | ||||
| 	bool login = ui->accountSettingsBox->isChecked(); | ||||
| 	m_obj->set("OverrideLogin", login); | ||||
| 	if (login) | ||||
| 	{ | ||||
| 		m_obj->set("AutoLogin", ui->autoLoginChecBox->isChecked()); | ||||
| 		m_obj->set("AutoLogin", ui->autoLoginCheckBox->isChecked()); | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| @@ -123,6 +124,8 @@ void InstanceSettings::applySettings() | ||||
| 	{ | ||||
| 		m_obj->set("JavaPath", ui->javaPathTextBox->text()); | ||||
| 		m_obj->set("JvmArgs", ui->jvmArgsTextBox->text()); | ||||
|  | ||||
| 		NagUtils::checkJVMArgs(m_obj->get("JvmArgs").toString(), this->parentWidget()); | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| @@ -159,8 +162,8 @@ void InstanceSettings::loadSettings() | ||||
| 	ui->windowHeightSpinBox->setValue(m_obj->get("MinecraftWinHeight").toInt()); | ||||
|  | ||||
| 	// Auto Login | ||||
| 	ui->accountSettingsGroupBox->setChecked(m_obj->get("OverrideLogin").toBool()); | ||||
| 	ui->autoLoginChecBox->setChecked(m_obj->get("AutoLogin").toBool()); | ||||
| 	ui->accountSettingsBox->setChecked(m_obj->get("OverrideLogin").toBool()); | ||||
| 	ui->autoLoginCheckBox->setChecked(m_obj->get("AutoLogin").toBool()); | ||||
|  | ||||
| 	// Memory | ||||
| 	ui->memoryGroupBox->setChecked(m_obj->get("OverrideMemory").toBool()); | ||||
|   | ||||
| @@ -132,7 +132,7 @@ | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QGroupBox" name="accountSettingsGroupBox"> | ||||
|         <widget class="QGroupBox" name="accountSettingsBox"> | ||||
|          <property name="enabled"> | ||||
|           <bool>true</bool> | ||||
|          </property> | ||||
| @@ -147,16 +147,10 @@ | ||||
|          </property> | ||||
|          <layout class="QVBoxLayout" name="verticalLayout_6"> | ||||
|           <item> | ||||
|            <widget class="QCheckBox" name="autoLoginChecBox"> | ||||
|             <property name="enabled"> | ||||
|              <bool>false</bool> | ||||
|             </property> | ||||
|            <widget class="QCheckBox" name="autoLoginCheckBox"> | ||||
|             <property name="text"> | ||||
|              <string>Login automatically when an instance icon is double clicked?</string> | ||||
|             </property> | ||||
|             <property name="checked"> | ||||
|              <bool>false</bool> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|          </layout> | ||||
| @@ -403,8 +397,7 @@ | ||||
|   <tabstop>consoleSettingsBox</tabstop> | ||||
|   <tabstop>showConsoleCheck</tabstop> | ||||
|   <tabstop>autoCloseConsoleCheck</tabstop> | ||||
|   <tabstop>accountSettingsGroupBox</tabstop> | ||||
|   <tabstop>autoLoginChecBox</tabstop> | ||||
|   <tabstop>accountSettingsBox</tabstop> | ||||
|   <tabstop>memoryGroupBox</tabstop> | ||||
|   <tabstop>minMemSpinBox</tabstop> | ||||
|   <tabstop>maxMemSpinBox</tabstop> | ||||
|   | ||||
| @@ -262,10 +262,19 @@ | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QCheckBox" name="autoLoginCheckBox"> | ||||
|          <property name="text"> | ||||
|           <string>Login automatically when an instance icon is double clicked?</string> | ||||
|         <widget class="QGroupBox" name="accountSettingsBox"> | ||||
|          <property name="title"> | ||||
|           <string>Account Settings</string> | ||||
|          </property> | ||||
|          <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|           <item> | ||||
|            <widget class="QCheckBox" name="autoLoginCheckBox"> | ||||
|             <property name="text"> | ||||
|              <string>Login automatically when an instance icon is double clicked?</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|          </layout> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
| @@ -515,7 +524,6 @@ | ||||
|   <tabstop>windowHeightSpinBox</tabstop> | ||||
|   <tabstop>showConsoleCheck</tabstop> | ||||
|   <tabstop>autoCloseConsoleCheck</tabstop> | ||||
|   <tabstop>autoLoginCheckBox</tabstop> | ||||
|   <tabstop>minMemSpinBox</tabstop> | ||||
|   <tabstop>maxMemSpinBox</tabstop> | ||||
|   <tabstop>permGenSpinBox</tabstop> | ||||
|   | ||||
| @@ -40,7 +40,7 @@ void LegacyUpdate::lwjglStart() | ||||
| 	LegacyInstance *inst = (LegacyInstance *)m_inst; | ||||
|  | ||||
| 	lwjglVersion = inst->lwjglVersion(); | ||||
| 	lwjglTargetPath = PathCombine("lwjgl", lwjglVersion); | ||||
| 	lwjglTargetPath = PathCombine(MMC->settings()->get("LWJGLDir").toString(), lwjglVersion); | ||||
| 	lwjglNativesPath = PathCombine(lwjglTargetPath, "natives"); | ||||
|  | ||||
| 	// if the 'done' file exists, we don't have to download this again | ||||
| @@ -361,7 +361,10 @@ void LegacyUpdate::ModTheJar() | ||||
| 		setStatus("Installing mods - backing up minecraft.jar..."); | ||||
| 		if (!baseJar.exists() && !QFile::copy(runnableJar.filePath(), baseJar.filePath())) | ||||
| 		{ | ||||
| 			emitFailed("Failed to back up minecraft.jar"); | ||||
| 			emitFailed("It seems both the active and base jar are gone. A fresh base jar will be used on next run."); | ||||
| 			inst->setShouldRebuild(true); | ||||
| 			inst->setShouldUpdate(true); | ||||
| 			inst->setShouldUseCustomBaseJar(false); | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -56,34 +56,34 @@ void Mod::repath(const QFileInfo &file) | ||||
| 			return; | ||||
|  | ||||
| 		QuaZipFile file(&zip); | ||||
| 		for (bool more = zip.goToFirstFile(); more; more = zip.goToNextFile()) | ||||
|  | ||||
| 		if (zip.setCurrentFile("mcmod.info")) | ||||
| 		{ | ||||
| 			QString name = zip.getCurrentFileName(); | ||||
| 			if (name == "mcmod.info") | ||||
| 			if(!file.open(QIODevice::ReadOnly)) | ||||
| 			{ | ||||
| 				if (!file.open(QIODevice::ReadOnly)) | ||||
| 				{ | ||||
| 					zip.close(); | ||||
| 					return; | ||||
| 				} | ||||
| 				ReadMCModInfo(file.readAll()); | ||||
| 				file.close(); | ||||
| 				zip.close(); | ||||
| 				return; | ||||
| 			} | ||||
| 			else if (name == "forgeversion.properties") | ||||
| 			{ | ||||
| 				if (!file.open(QIODevice::ReadOnly)) | ||||
| 				{ | ||||
| 					zip.close(); | ||||
| 					return; | ||||
| 				} | ||||
| 				ReadForgeInfo(file.readAll()); | ||||
| 				file.close(); | ||||
| 				zip.close(); | ||||
| 				return; | ||||
| 			} | ||||
|  | ||||
| 			ReadMCModInfo(file.readAll()); | ||||
| 			file.close(); | ||||
| 			zip.close(); | ||||
| 			return; | ||||
| 		} | ||||
| 		else if (zip.setCurrentFile("forgeversion.properties")) | ||||
| 		{ | ||||
| 			if (!file.open(QIODevice::ReadOnly)) | ||||
| 			{ | ||||
| 				zip.close(); | ||||
| 				return; | ||||
| 			} | ||||
|  | ||||
| 			ReadForgeInfo(file.readAll()); | ||||
| 			file.close(); | ||||
| 			zip.close(); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		zip.close(); | ||||
| 	} | ||||
| 	else if (m_type == MOD_FOLDER) | ||||
|   | ||||
| @@ -204,7 +204,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) | ||||
| 	// if the root of the json wasn't an object, fail | ||||
| 	if (!jsonDoc.isObject()) | ||||
| 	{ | ||||
| 		qWarning("Invalid group file. Root entry should be an object."); | ||||
| 		QLOG_WARN() << "Invalid group file. Root entry should be an object."; | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| @@ -217,7 +217,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) | ||||
| 	// Get the groups. if it's not an object, fail | ||||
| 	if (!rootObj.value("groups").isObject()) | ||||
| 	{ | ||||
| 		qWarning("Invalid group list JSON: 'groups' should be an object."); | ||||
| 		QLOG_WARN() << "Invalid group list JSON: 'groups' should be an object."; | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| @@ -230,21 +230,21 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap) | ||||
| 		// If not an object, complain and skip to the next one. | ||||
| 		if (!iter.value().isObject()) | ||||
| 		{ | ||||
| 			qWarning(QString("Group '%1' in the group list should " | ||||
| 							 "be an object.") | ||||
| 						 .arg(groupName) | ||||
| 						 .toUtf8()); | ||||
| 			QLOG_WARN() << QString("Group '%1' in the group list should " | ||||
| 								   "be an object.") | ||||
| 							   .arg(groupName) | ||||
| 							   .toUtf8(); | ||||
| 			continue; | ||||
| 		} | ||||
|  | ||||
| 		QJsonObject groupObj = iter.value().toObject(); | ||||
| 		if (!groupObj.value("instances").isArray()) | ||||
| 		{ | ||||
| 			qWarning(QString("Group '%1' in the group list is invalid. " | ||||
| 							 "It should contain an array " | ||||
| 							 "called 'instances'.") | ||||
| 						 .arg(groupName) | ||||
| 						 .toUtf8()); | ||||
| 			QLOG_WARN() << QString("Group '%1' in the group list is invalid. " | ||||
| 								   "It should contain an array " | ||||
| 								   "called 'instances'.") | ||||
| 							   .arg(groupName) | ||||
| 							   .toUtf8(); | ||||
| 			continue; | ||||
| 		} | ||||
|  | ||||
|   | ||||
| @@ -83,7 +83,10 @@ void LWJGLVersionList::loadList() | ||||
|  | ||||
| 	setLoading(true); | ||||
| 	auto worker = MMC->qnam(); | ||||
| 	reply = worker->get(QNetworkRequest(QUrl(RSS_URL))); | ||||
| 	QNetworkRequest req(QUrl(RSS_URL)); | ||||
| 	req.setRawHeader("Accept", "text/xml"); | ||||
| 	req.setRawHeader("User-Agent", "MultiMC/5.0 (Uncached)"); | ||||
| 	reply = worker->get(req); | ||||
| 	connect(reply, SIGNAL(finished()), SLOT(netRequestComplete())); | ||||
| } | ||||
|  | ||||
| @@ -127,7 +130,7 @@ void LWJGLVersionList::netRequestComplete() | ||||
| 			QDomElement linkElement = getDomElementByTagName(items.at(i).toElement(), "link"); | ||||
| 			if (linkElement.isNull()) | ||||
| 			{ | ||||
| 				qWarning() << "Link element" << i << "in RSS feed doesn't exist! Skipping."; | ||||
| 				QLOG_INFO() << "Link element" << i << "in RSS feed doesn't exist! Skipping."; | ||||
| 				continue; | ||||
| 			} | ||||
|  | ||||
| @@ -143,7 +146,7 @@ void LWJGLVersionList::netRequestComplete() | ||||
| 				QUrl url(link); | ||||
| 				if (!url.isValid()) | ||||
| 				{ | ||||
| 					qWarning() << "LWJGL version URL isn't valid:" << link << "Skipping."; | ||||
| 					QLOG_INFO() << "LWJGL version URL isn't valid:" << link << "Skipping."; | ||||
| 					continue; | ||||
| 				} | ||||
|  | ||||
| @@ -180,7 +183,7 @@ const PtrLWJGLVersion LWJGLVersionList::getVersion(const QString &versionName) | ||||
|  | ||||
| void LWJGLVersionList::failed(QString msg) | ||||
| { | ||||
| 	qWarning() << msg; | ||||
| 	QLOG_INFO() << msg; | ||||
| 	emit loadListFailed(msg); | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user