本文整理汇总了C++中AppSettings::SetJavaPath方法的典型用法代码示例。如果您正苦于以下问题:C++ AppSettings::SetJavaPath方法的具体用法?C++ AppSettings::SetJavaPath怎么用?C++ AppSettings::SetJavaPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppSettings
的用法示例。
在下文中一共展示了AppSettings::SetJavaPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplySettings
void SettingsDialog::ApplySettings(AppSettings &s /* = settings */)
{
s.SetShowConsole(showConsoleCheck->IsChecked());
s.SetAutoCloseConsole(autoCloseConsoleCheck->IsChecked());
s.SetAutoUpdate(autoUpdateCheck->IsChecked());
wxFileName newInstDir = wxFileName::DirName(instDirTextBox->GetValue());
if (!s.GetInstDir().SameAs(newInstDir))
{
wxFileName oldInstDir = s.GetInstDir();
int response = wxMessageBox(
_T("You've changed your instance directory, would you like to transfer all of your instances?"),
_T("Instance directory changed."),
wxYES | wxNO | wxCANCEL | wxCENTER, this);
RetryTransfer:
if (response != wxCANCEL)
{
s.SetInstDir(newInstDir);
}
if (response == wxYES)
{
wxDir instDir(oldInstDir.GetFullPath());
wxString oldDirName;
if (instDir.GetFirst(&oldDirName))
{
do
{
oldDirName = Path::Combine(oldInstDir, oldDirName);
wxFileName newDirName(oldDirName);
newDirName.MakeRelativeTo(oldInstDir.GetFullPath());
newDirName.Normalize(wxPATH_NORM_ALL, newInstDir.GetFullPath());
if (!wxRenameFile(oldDirName, newDirName.GetFullPath(), false))
{
wxLogError(_("Failed to move instance folder %s."), oldDirName.c_str());
}
} while (instDir.GetNext(&oldDirName));
}
}
}
s.SetMinMemAlloc(minMemorySpin->GetValue());
s.SetMaxMemAlloc(maxMemorySpin->GetValue());
s.SetJavaPath(javaPathTextBox->GetValue());
s.SetJvmArgs(jvmArgsTextBox->GetValue());
GUIMode newGUIMode;
if (guiStyleDropDown->GetValue() == guiModeDefault)
newGUIMode = GUI_Default;
else if (guiStyleDropDown->GetValue() == guiModeSimple)
newGUIMode = GUI_Simple;
if (newGUIMode != s.GetGUIMode())
{
s.SetGUIMode(newGUIMode);
wxMessageBox(_("Changing the GUI style requires a restart in order to take effect. Please restart MultiMC."),
_("Restart Required"));
}
}