当前位置: 首页>>代码示例>>C++>>正文


C++ AppSettings::GetGUIMode方法代码示例

本文整理汇总了C++中AppSettings::GetGUIMode方法的典型用法代码示例。如果您正苦于以下问题:C++ AppSettings::GetGUIMode方法的具体用法?C++ AppSettings::GetGUIMode怎么用?C++ AppSettings::GetGUIMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppSettings的用法示例。


在下文中一共展示了AppSettings::GetGUIMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadSettings

void SettingsDialog::LoadSettings(AppSettings &s /* = settings */)
{
	showConsoleCheck->SetValue(s.GetShowConsole());
	autoCloseConsoleCheck->SetValue(s.GetAutoCloseConsole());

	autoUpdateCheck->SetValue(s.GetAutoUpdate());

	instDirTextBox->SetValue(s.GetInstDir().GetFullPath());

	minMemorySpin->SetValue(s.GetMinMemAlloc());
	maxMemorySpin->SetValue(s.GetMaxMemAlloc());

	javaPathTextBox->SetValue(s.GetJavaPath());
	jvmArgsTextBox->SetValue(s.GetJvmArgs());
	
	switch (s.GetGUIMode())
	{
	case GUI_Simple:
		guiStyleDropDown->SetValue(guiModeSimple);
		break;
		
	case GUI_Default:
		guiStyleDropDown->SetValue(guiModeDefault);
		break;
	}
}
开发者ID:bartbes,项目名称:MultiMC4,代码行数:26,代码来源:settingsdialog.cpp

示例2: 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"));
	}
}
开发者ID:bartbes,项目名称:MultiMC4,代码行数:64,代码来源:settingsdialog.cpp


注:本文中的AppSettings::GetGUIMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。