Merge branch 'feature/fix_intel' into develop

Conflicts:
	CMakeLists.txt
	changelog.yaml
	gui/MainWindow.cpp
This commit is contained in:
Petr Mrázek 2014-06-28 08:49:18 +02:00
commit 30b1f5e5cf
4 changed files with 84 additions and 52 deletions

View File

@ -487,6 +487,7 @@ void MultiMC::initGlobalSettings()
// Java Settings
m_settings->registerSetting("JavaPath", "");
m_settings->registerSetting("LastHostname", "");
m_settings->registerSetting("JavaDetectionHack", "");
m_settings->registerSetting("JvmArgs", "");
// Custom Commands

View File

@ -84,5 +84,7 @@
- A crash handler implementation has been added.
0.3.7
- Fixed forge for 1.7.10-pre4 (and any future prereleases)
0.3.8
- Workaround for performance issues with Intel integrated graphics chips
0.4.0
- In Development...

View File

@ -109,7 +109,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
MultiMCPlatform::fixWM_CLASS(this);
ui->setupUi(this);
QString winTitle = QString("MultiMC 5 - Version %1").arg(BuildConfig.printableVersionString());
QString winTitle =
QString("MultiMC 5 - Version %1").arg(BuildConfig.printableVersionString());
if (!BuildConfig.BUILD_PLATFORM.isEmpty())
winTitle += " on " + BuildConfig.BUILD_PLATFORM;
setWindowTitle(winTitle);
@ -338,7 +339,6 @@ void MainWindow::skinJobFinished()
skin_download_job.reset();
}
void MainWindow::showInstanceContextMenu(const QPoint &pos)
{
QList<QAction *> actions;
@ -360,9 +360,10 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
QAction *actionCopyInstance = new QAction(tr("Copy instance"), this);
actionCopyInstance->setToolTip(ui->actionCopyInstance->toolTip());
connect(actionRename, SIGNAL(triggered(bool)), SLOT(on_actionRenameInstance_triggered()));
connect(actionCopyInstance, SIGNAL(triggered(bool)), SLOT(on_actionCopyInstance_triggered()));
connect(actionRename, SIGNAL(triggered(bool)),
SLOT(on_actionRenameInstance_triggered()));
connect(actionCopyInstance, SIGNAL(triggered(bool)),
SLOT(on_actionCopyInstance_triggered()));
actions.replace(1, actionRename);
actions.prepend(actionSep);
@ -377,7 +378,8 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
QAction *actionCreateInstance = new QAction(tr("Create instance"), this);
actionCreateInstance->setToolTip(ui->actionAddInstance->toolTip());
connect(actionCreateInstance, SIGNAL(triggered(bool)), SLOT(on_actionAddInstance_triggered()));
connect(actionCreateInstance, SIGNAL(triggered(bool)),
SLOT(on_actionAddInstance_triggered()));
actions.prepend(actionSep);
actions.prepend(actionVoid);
@ -398,7 +400,8 @@ void MainWindow::updateToolsMenu()
}
QMenu *launchMenu = new QMenu(this);
QAction *normalLaunch = launchMenu->addAction(tr("Launch"));
connect(normalLaunch, &QAction::triggered, [this](){doLaunch();});
connect(normalLaunch, &QAction::triggered, [this]()
{ doLaunch(); });
launchMenu->addSeparator()->setText(tr("Profilers"));
for (auto profiler : MMC->profilers().values())
{
@ -407,11 +410,13 @@ void MainWindow::updateToolsMenu()
if (!profiler->check(&error))
{
profilerAction->setDisabled(true);
profilerAction->setToolTip(tr("Profiler not setup correctly. Go into settings, \"External Tools\"."));
profilerAction->setToolTip(
tr("Profiler not setup correctly. Go into settings, \"External Tools\"."));
}
else
{
connect(profilerAction, &QAction::triggered, [this, profiler](){doLaunch(true, profiler.get());});
connect(profilerAction, &QAction::triggered, [this, profiler]()
{ doLaunch(true, profiler.get()); });
}
}
launchMenu->addSeparator()->setText(tr("Tools"));
@ -422,14 +427,13 @@ void MainWindow::updateToolsMenu()
if (!tool->check(&error))
{
toolAction->setDisabled(true);
toolAction->setToolTip(tr("Tool not setup correctly. Go into settings, \"External Tools\"."));
toolAction->setToolTip(
tr("Tool not setup correctly. Go into settings, \"External Tools\"."));
}
else
{
connect(toolAction, &QAction::triggered, [this, tool]()
{
tool->createDetachedTool(m_selectedInstance, this)->run();
});
{ tool->createDetachedTool(m_selectedInstance, this)->run(); });
}
}
ui->actionLaunchInstance->setMenu(launchMenu);
@ -1234,7 +1238,8 @@ void MainWindow::doLaunch(bool online, BaseProfilerFactory *profiler)
}
}
void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session, BaseProfilerFactory *profiler)
void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session,
BaseProfilerFactory *profiler)
{
auto updateTask = instance->doUpdate();
if (!updateTask)
@ -1249,7 +1254,8 @@ void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session, Ba
tDialog.exec(updateTask.get());
}
void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, BaseProfilerFactory *profiler)
void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session,
BaseProfilerFactory *profiler)
{
Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL");
Q_ASSERT_X(session.get() != nullptr, "launchInstance", "session is NULL");
@ -1276,7 +1282,8 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, Ba
QString error;
if (!profiler->check(&error))
{
QMessageBox::critical(this, tr("Error"), tr("Couldn't start profiler: %1").arg(error));
QMessageBox::critical(this, tr("Error"),
tr("Couldn't start profiler: %1").arg(error));
proc->abort();
return;
}
@ -1286,9 +1293,11 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, Ba
dialog.setMaximum(0);
dialog.setValue(0);
dialog.setLabelText(tr("Waiting for profiler..."));
connect(&dialog, &QProgressDialog::canceled, profilerInstance, &BaseProfiler::abortProfiling);
connect(&dialog, &QProgressDialog::canceled, profilerInstance,
&BaseProfiler::abortProfiling);
dialog.show();
connect(profilerInstance, &BaseProfiler::readyToLaunch, [&dialog, this, proc](const QString &message)
connect(profilerInstance, &BaseProfiler::readyToLaunch,
[&dialog, this, proc](const QString & message)
{
dialog.accept();
QMessageBox msg;
@ -1301,7 +1310,8 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, Ba
msg.exec();
proc->launch();
});
connect(profilerInstance, &BaseProfiler::abortLaunch, [&dialog, this, proc](const QString &message)
connect(profilerInstance, &BaseProfiler::abortLaunch,
[&dialog, this, proc](const QString & message)
{
dialog.accept();
QMessageBox msg;
@ -1431,7 +1441,9 @@ void MainWindow::checkMigrateLegacyAssets()
void MainWindow::checkSetDefaultJava()
{
const QString javaHack = "IntelHack";
bool askForJava = false;
do
{
QString currentHostName = QHostInfo::localHostName();
QString oldHostName = MMC->settings()->get("LastHostname").toString();
@ -1439,16 +1451,30 @@ void MainWindow::checkSetDefaultJava()
{
MMC->settings()->set("LastHostname", currentHostName);
askForJava = true;
break;
}
}
{
QString currentJavaPath = MMC->settings()->get("JavaPath").toString();
if (currentJavaPath.isEmpty())
{
askForJava = true;
break;
}
#if defined Q_OS_WIN32
QString currentHack = MMC->settings()->get("JavaDetectionHack").toString();
if (currentHack != javaHack)
{
CustomMessageBox::selectable(
this, tr("Java detection forced"),
tr("Because of graphics performance issues caused by Intel drivers on Windows, "
"MultiMC java detection was forced. Please select a Java "
"version.<br/><br/>If you have custom java versions set for your instances, "
"make sure you use the 'javaw.exe' executable."),
QMessageBox::Warning)->exec();
askForJava = true;
break;
}
#endif
} while (0);
if (askForJava)
{
@ -1476,7 +1502,10 @@ void MainWindow::checkSetDefaultJava()
java = ju.GetDefaultJava();
}
if (java)
{
MMC->settings()->set("JavaPath", java->path);
MMC->settings()->set("JavaDetectionHack", javaHack);
}
else
MMC->settings()->set("JavaPath", QString("java"));
}

View File

@ -122,7 +122,7 @@ QList<JavaVersionPtr> JavaUtils::FindJavaFromRegistryKey(DWORD keyType, QString
javaVersion->id = subKeyName;
javaVersion->arch = archType;
javaVersion->path =
QDir(PathCombine(value, "bin")).absoluteFilePath("java.exe");
QDir(PathCombine(value, "bin")).absoluteFilePath("javaw.exe");
javas.append(javaVersion);
}
@ -152,12 +152,12 @@ QList<QString> JavaUtils::FindJavaPaths()
KEY_WOW64_32KEY, "SOFTWARE\\JavaSoft\\Java Development Kit");
java_candidates.append(JRE64s);
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre7/bin/java.exe"));
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre6/bin/java.exe"));
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre7/bin/javaw.exe"));
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre6/bin/javaw.exe"));
java_candidates.append(JDK64s);
java_candidates.append(JRE32s);
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre7/bin/java.exe"));
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre6/bin/java.exe"));
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre7/bin/javaw.exe"));
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre6/bin/javaw.exe"));
java_candidates.append(JDK32s);
java_candidates.append(MakeJavaPtr(this->GetDefaultJava()->path));