From: <sag...@us...> - 2014-12-13 23:30:42
|
Revision: 4649 http://sourceforge.net/p/modplug/code/4649 Author: saga-games Date: 2014-12-13 23:30:29 +0000 (Sat, 13 Dec 2014) Log Message: ----------- [Mod] Move some options from the installer to a first-use dialog that is shown when detecting a fresh OpenMPT installation. [Mod] OpenMPT: Version is now 1.24.00.22 Modified Paths: -------------- trunk/OpenMPT/common/mptPathString.h trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/installer/install.iss trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/mptrack/SelectPluginDialog.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/view_com.cpp Added Paths: ----------- trunk/OpenMPT/mptrack/WelcomeDialog.cpp trunk/OpenMPT/mptrack/WelcomeDialog.h Removed Paths: ------------- trunk/OpenMPT/installer/vst_scan.iss Modified: trunk/OpenMPT/common/mptPathString.h =================================================================== --- trunk/OpenMPT/common/mptPathString.h 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/common/mptPathString.h 2014-12-13 23:30:29 UTC (rev 4649) @@ -100,6 +100,12 @@ // Verify if this path represents a valid directory on the file system. bool IsDirectory() const { return ::PathIsDirectoryW(path.c_str()) != FALSE; } + bool IsFile() const + { + DWORD dwAttrib = ::GetFileAttributesW(path.c_str()); + return (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)); + } + bool FileOrDirectoryExists() const { return ::PathFileExistsW(path.c_str()) != FALSE; } // Return the same path string with a different (or appended) extension (including "."), e.g. "foo.bar",".txt" -> "foo.txt" or "C:\OpenMPT\foo",".txt" -> "C:\OpenMPT\foo.txt" PathString ReplaceExt(const mpt::PathString &newExt) const; Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/common/versionNumber.h 2014-12-13 23:30:29 UTC (rev 4649) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 00 -#define VER_MINORMINOR 21 +#define VER_MINORMINOR 22 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/installer/install.iss 2014-12-13 23:30:29 UTC (rev 4649) @@ -49,9 +49,7 @@ #ifdef DOWNLOAD_MO3 Name: downloadmo3; Description: Download unmo3 (library needed for reading MO3 files, recommended); GroupDescription: Options: #endif -Name: update_c; Description: Automatically check for updates; GroupDescription: Options: Name: portable; Description: Portable mode (use program folder for storing settings, no registry changes); GroupDescription: Options:; Flags: unchecked -Name: vst_scan; Description: Scan for previously installed VST plugins; GroupDescription: Options:; Flags: unchecked ; file associations - put this below all other [tasks]! #include "filetypes.iss" @@ -146,7 +144,6 @@ #endif #include "utilities.iss" -#include "vst_scan.iss" #include "plugins.iss" [Code] @@ -191,15 +188,7 @@ end; procedure CurStepChanged(CurStep: TSetupStep); -var - INIFile: String; - keyboardFilepath: String; - baseLanguage: Integer; - begin - // Get the right INI path. - INIFile := GetINIPath(); - case CurStep of ssPostInstall: begin @@ -212,55 +201,6 @@ // Copy old config files from app's directory, if possible and necessary. CopyConfigsToAppDataDir(); - - // Find a suitable keyboard layout (might not be very precise sometimes, as it's based on the UI language) - // Check http://msdn.microsoft.com/en-us/library/ms776294%28VS.85%29.aspx for the correct language codes. - keyboardFilepath := ''; - baseLanguage := (GetUILanguage and $3FF); - case baseLanguage of - $07: // German - begin - keyboardFilepath := 'DE_jojo'; - end; - $0a: // Spanish - begin - // Spanish latin-american keymap, so we ignore Spain. - if(GetUILanguage <> $0c0a) then - begin - keyboardFilepath := 'es-LA_mpt_(jmkz)'; - end; - end; - $0c: // French - begin - keyboardFilepath := 'FR_mpt_(legovitch)'; - end; - $14: // Norwegian - begin - keyboardFilepath := 'NO_mpt_classic_(rakib)'; - end; - end; - - // Found an alternative keybinding. - if(keyboardFilepath <> '') then - begin - FileCopy(ExpandConstant('{app}\extraKeymaps\') + keyboardFilepath + '.mkb', ExtractFilePath(INIFile) + 'Keybindings.mkb', true); - end; - - // Update check - if(not IsTaskSelected('update_c')) then - begin - SetIniString('Update', 'UpdateCheckPeriod', '0', INIFile); - end else - begin - SetIniString('Update', 'UpdateCheckPeriod', '7', INIFile); - //SetIniString('Update', 'LastUpdateCheck', GetDateTimeString('yyyy-mm-dd hh:nn', #0, #0), INIFile); - end; - - // Scan for pre-installed VST plugins - if(IsTaskSelected('vst_scan')) then - begin - OnVSTScan(INIFile); - end; end; end; end; Deleted: trunk/OpenMPT/installer/vst_scan.iss =================================================================== --- trunk/OpenMPT/installer/vst_scan.iss 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/installer/vst_scan.iss 2014-12-13 23:30:29 UTC (rev 4649) @@ -1,108 +0,0 @@ -[CustomMessages] -english.ProgressTitle=Searching -english.ProgressCaption=Searching for VST plugins -english.ProgressText=Searching for plugin files... - -; http://www.vincenzo.net/isxkb/index.php?title=Search_for_a_file - -[Code] -var - ProgressPage: TOutputProgressWizardPage; - ProgressValue: Integer; - ArrayLen: LongInt; - bExitSetup: Boolean; - VSTPluginNumber: Integer; - OldVSTPluginNumber: Integer; - -procedure ProcessDirectory (RootDir: String; Progress: Boolean; INIFile: String); -var - NewRoot: String; - FilePath: String; - FindRec: TFindRec; -begin - if bExitSetup then - Exit; - NewRoot := AddBackSlash (RootDir); - if FindFirst (NewRoot + '*', FindRec) then - begin - try - repeat - if (FindRec.Name <> '.') AND (FindRec.Name <> '..') then - begin - FilePath := NewRoot + FindRec.Name; - if FindRec.Attributes AND FILE_ATTRIBUTE_DIRECTORY > 0 then - ProcessDirectory (FilePath, Progress, INIFile) - else if CompareFilename(FindRec.Name, '.dll') then - begin - // Start action --> - // . - // Add your custom code here. - // FilePath contains the file name - // including its full path name. - // Try not to call a function for every file - // as this could take a very long time. - // . - SetIniString('VST Plugins', 'Plugin' + IntToStr(VSTPluginNumber), FilePath, INIFile); - VSTPluginNumber := VSTPluginNumber + 1; - // <-- End action. - - ArrayLen := ArrayLen + 1; - if (Progress) then - begin - if (ArrayLen mod 1000) = (ArrayLen / 1000) then - begin - ProgressValue := ProgressValue + 1; - if ProgressValue = 100 then - ProgressValue := 0; - ProgressPage.SetProgress (ProgressValue, 100); - end; - end; - end; - end; - if (bExitSetup) then - Exit; - until NOT FindNext (FindRec); - finally - FindClose(FindRec); - end; - end; -end; - -procedure OnVSTScan(INIFile: String); -var - Dir: String; -begin - VSTPluginNumber := GetIniInt('VST Plugins', 'NumPlugins', 0, 0, 0, INIFile); - OldVSTPluginNumber := VSTPluginNumber; - - // The folder to scan. - Dir := ExpandConstant('{pf}\Steinberg\VstPlugins'); - RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\VST', 'VSTPluginsPath', Dir); // won't touch Dir if registry path does not exist - // The progress page. - ProgressPage := CreateOutputProgressPage (CustomMessage ('ProgressTitle'), - CustomMessage ('ProgressCaption')); - ProgressPage.SetText (CustomMessage ('ProgressText'), Dir); - ProgressPage.SetProgress(0, 0); - ProgressPage.Show; - // Make the Cancel button visible during the operation. - ;WizardForm.CancelButton.Visible := TRUE; - // Scan the folder. - ProcessDirectory (Dir, TRUE, INIFile); - // Hide the progress page. - try - finally - ProgressPage.Hide; - end; - - // Update INI key - - if(VSTPluginNumber <> OldVSTPluginNumber) then - begin - SetIniInt('VST Plugins', 'NumPlugins', VSTPluginNumber, INIFile); - // Also write the detected VST dir to the INI file if there was no previous entry in it. - if(GetIniString('Paths', 'Plugins_Directory', '', INIFile) = '') then - SetIniString('Paths', 'Plugins_Directory', Dir, INIFile); - end; -end; - - Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-13 23:30:29 UTC (rev 4649) @@ -31,6 +31,7 @@ #include "FileDialog.h" #include "PNG.h" #include "../common/ComponentManager.h" +#include "WelcomeDialog.h" // rewbs.memLeak #define _CRTDBG_MAP_ALLOC @@ -119,7 +120,7 @@ { CMainFrame::GetMainFrame()->UpdateMRUList(); } - if(PathFileExistsW(filename.AsNative().c_str()) == FALSE) + if(!filename.IsFile()) { Reporting::Error(L"Unable to open \"" + filename.ToWide() + L"\": file does not exist."); } @@ -767,7 +768,7 @@ sNewPath += sFileName; } - if(PathFileExistsW(sNewPath.AsNative().c_str()) == 0 && PathFileExistsW(sOldPath.AsNative().c_str()) != 0) + if(!sNewPath.IsFile() && sOldPath.IsFile()) { return (MoveFileW(sOldPath.AsNative().c_str(), sNewPath.AsNative().c_str()) != 0); } @@ -1014,18 +1015,24 @@ m_dwTimeStarted = timeGetTime(); m_bInitialized = TRUE; - if(CUpdateCheck::GetUpdateCheckPeriod() != 0) + const bool firstRun = TrackerSettings::Instance().gcsPreviousVersion == 0; + if(CUpdateCheck::GetUpdateCheckPeriod() != 0 && !firstRun) { CUpdateCheck::DoUpdateCheck(true); } // Open settings if the previous execution was with an earlier version. - if(TrackerSettings::Instance().ShowSettingsOnNewVersion && TrackerSettings::Instance().gcsPreviousVersion < MptVersion::num) + if(TrackerSettings::Instance().ShowSettingsOnNewVersion && !firstRun && TrackerSettings::Instance().gcsPreviousVersion < MptVersion::num) { StopSplashScreen(); m_pMainWnd->PostMessage(WM_COMMAND, ID_VIEW_OPTIONS); } + if(firstRun) + { + new WelcomeDlg(m_pMainWnd); + } + EndWaitCursor(); #ifdef _DEBUG Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/Mptrack.h 2014-12-13 23:30:29 UTC (rev 4649) @@ -271,6 +271,7 @@ return *m_pTrackerSettings; } bool IsPortableMode() { return m_bPortableMode; } + void SetPortableMode(bool portable) { m_bPortableMode = portable; } SettingsContainer & GetPluginCache() { ASSERT(m_pPluginCache); Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-12-13 23:30:29 UTC (rev 4649) @@ -475,8 +475,8 @@ } -bool CSelectPluginDlg::VerifyPlug(VSTPluginLib *plug) -//--------------------------------------------------- +bool CSelectPluginDlg::VerifyPlug(VSTPluginLib *plug, CWnd *parent) +//----------------------------------------------------------------- { // TODO: Keep these lists up-to-date. static const struct @@ -514,7 +514,7 @@ { CString s; s.Format("WARNING: This plugin has been identified as %s,\nwhich is known to have the following problem with OpenMPT:\n\n%s\n\nWould you still like to add this plugin to the library?", problemPlugs[p].name, problemPlugs[p].problem); - if(Reporting::Confirm(s, false, false, this) == cnfNo) + if(Reporting::Confirm(s, false, false, parent) == cnfNo) { return false; } @@ -563,7 +563,7 @@ if(lib != nullptr) { update = true; - if(!VerifyPlug(lib)) + if(!VerifyPlug(lib, this)) { pManager->RemovePlugin(lib); } else @@ -618,20 +618,28 @@ if(!dlg.Show(this)) return; TrackerDirectories::Instance().SetWorkingDirectory(dlg.GetDirectory(), DIR_PLUGINS); + VSTPluginLib *plugLib = ScanPlugins(dlg.GetDirectory(), this); + UpdatePluginsList(plugLib ? plugLib->pluginId2 : 0); +} + +VSTPluginLib *CSelectPluginDlg::ScanPlugins(const mpt::PathString &path, CWnd *parent) +//------------------------------------------------------------------------------------ +{ CVstPluginManager *pManager = theApp.GetPluginManager(); VSTPluginLib *plugLib = nullptr; bool update = false; CDialog pluginScanDlg; - pluginScanDlg.Create(IDD_SCANPLUGINS, this); - pluginScanDlg.CenterWindow(this); + pluginScanDlg.Create(IDD_SCANPLUGINS, parent); + pluginScanDlg.CenterWindow(parent); + pluginScanDlg.ModifyStyle(0, WS_SYSMENU, WS_SYSMENU); pluginScanDlg.ShowWindow(SW_SHOW); - FolderScanner scan(dlg.GetDirectory(), true); + FolderScanner scan(path, true); mpt::PathString fileName; int files = 0; - while(scan.NextFile(fileName)) + while(scan.NextFile(fileName) && pluginScanDlg.IsWindowVisible()) { if(!mpt::PathString::CompareNoCase(fileName.GetFileExt(), MPT_PATHSTRING(".dll"))) { @@ -649,7 +657,7 @@ if(lib) { update = true; - if(!VerifyPlug(lib)) + if(!VerifyPlug(lib, parent)) { pManager->RemovePlugin(lib); } else @@ -664,11 +672,12 @@ if(update) { // Force selection to last added plug. - Reporting::Information(mpt::String::Print("Found %1 plugins.", files).c_str(), this); - UpdatePluginsList(plugLib ? plugLib->pluginId2 : 0); + Reporting::Information(mpt::String::Print("Found %1 plugins.", files).c_str(), parent); + return plugLib; } else { Reporting::Error("Could not find any valid VST plugins."); + return nullptr; } } Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.h =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.h 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.h 2014-12-13 23:30:29 UTC (rev 4649) @@ -38,12 +38,14 @@ CSelectPluginDlg(CModDoc *pModDoc, int nPlugSlot, CWnd *parent); ~CSelectPluginDlg(); + static VSTPluginLib *ScanPlugins(const mpt::PathString &path, CWnd *parent); + protected: VSTPluginLib *GetSelectedPlugin() { return reinterpret_cast<VSTPluginLib *>(m_treePlugins.GetItemData(m_treePlugins.GetSelectedItem())); } void DoClose(); void UpdatePluginsList(VstInt32 forceSelect = 0); - bool VerifyPlug(VSTPluginLib *plug); + static bool VerifyPlug(VSTPluginLib *plug, CWnd *parent); virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnInitDialog(); virtual void OnOK(); Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-13 23:30:29 UTC (rev 4649) @@ -55,7 +55,7 @@ static MptVersion::VersionNum GetStoredVersion(const std::string &iniVersion) //--------------------------------------------------------------------------- { - MptVersion::VersionNum result = MptVersion::num; + MptVersion::VersionNum result = 0; if(!iniVersion.empty()) { result = MptVersion::ToNum(iniVersion); @@ -375,7 +375,7 @@ // Fixups: // ------- - const MptVersion::VersionNum storedVersion = gcsPreviousVersion; + const MptVersion::VersionNum storedVersion = gcsPreviousVersion ? gcsPreviousVersion : MptVersion::num; // Version if(gcsInstallGUID.Get().empty()) Added: trunk/OpenMPT/mptrack/WelcomeDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/WelcomeDialog.cpp (rev 0) +++ trunk/OpenMPT/mptrack/WelcomeDialog.cpp 2014-12-13 23:30:29 UTC (rev 4649) @@ -0,0 +1,176 @@ +/* + * WelcomeDialog.cpp + * ----------------- + * Purpose: "First run" OpenMPT welcome dialog + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#include "stdafx.h" +#include "WelcomeDialog.h" +#include "resource.h" +#include "Mainfrm.h" +#include "../common/StringFixer.h" +#include "InputHandler.h" +#include "CommandSet.h" +#include "SelectPluginDialog.h" +#include "UpdateCheck.h" + + +OPENMPT_NAMESPACE_BEGIN + +BEGIN_MESSAGE_MAP(WelcomeDlg, CDialog) + ON_COMMAND(IDC_BUTTON1, OnOptions) + ON_COMMAND(IDC_BUTTON2, OnScanPlugins) +END_MESSAGE_MAP() + + +WelcomeDlg::WelcomeDlg(CWnd *parent) +//---------------------------------- +{ + Create(IDD_WECLOME, parent); + CenterWindow(parent); +} + + +static mpt::PathString GetFullKeyPath(const char *keyFile) +//-------------------------------------------------------- +{ + return theApp.GetAppDirPath() + MPT_PATHSTRING("extraKeymaps\\") + mpt::PathString::FromUTF8(keyFile) + MPT_PATHSTRING(".mkb"); +} + + +BOOL WelcomeDlg::OnInitDialog() +//----------------------------- +{ + CDialog::OnInitDialog(); + + HKEY hkEnum = NULL; + WCHAR str[MAX_PATH]; + DWORD datasize = sizeof(str); + DWORD datatype = REG_SZ; + if(RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\VST", &hkEnum) == ERROR_SUCCESS + && RegQueryValueExW(hkEnum, L"VSTPluginsPath", 0, &datatype, (LPBYTE)str, &datasize) == ERROR_SUCCESS) + { + mpt::String::SetNullTerminator(str); + vstPath = mpt::PathString::FromNative(str); + } else if(SHGetSpecialFolderPathW(0, str, CSIDL_PROGRAM_FILES, FALSE)) + { + mpt::String::SetNullTerminator(str); + vstPath = mpt::PathString::FromNative(str) + MPT_PATHSTRING("\\Steinberg\\VstPlugins\\"); + if(!vstPath.IsDirectory()) + { + vstPath = mpt::PathString(); + } + } + if(!vstPath.empty()) + { + SetDlgItemTextW(m_hWnd, IDC_EDIT1, vstPath.AsNative().c_str()); + if(TrackerDirectories::Instance().GetDefaultDirectory(DIR_PLUGINS).empty()) + { + TrackerDirectories::Instance().SetDefaultDirectory(vstPath, DIR_PLUGINS); + } + } else + { + SetDlgItemText(IDC_EDIT1, _T("No plugin path found!")); + GetDlgItem(IDC_BUTTON2)->EnableWindow(FALSE); + } + + const char *keyFile = nullptr; + const TCHAR *keyFileName = nullptr; + const uint16_t language = LOWORD(GetKeyboardLayout(0)), primaryLang = language & 0x3FF; + CComboBox *combo = (CComboBox *)GetDlgItem(IDC_COMBO1); + combo->AddString(_T("OpenMPT / Chromatic (Default)")); + combo->SetCurSel(0); + switch(primaryLang) + { + case LANG_GERMAN: + keyFile = "DE_jojo"; + keyFileName = _T("German"); + break; + case LANG_SPANISH: + // Spanish latin-american keymap, so we ignore Spain. + if(language != SUBLANG_SPANISH_MODERN && language != SUBLANG_SPANISH) + { + keyFile = "es-LA_mpt_(jmkz)"; + keyFileName = _T("Spanish"); + } + break; + case LANG_FRENCH: + keyFile = "FR_mpt_(legovitch)"; + keyFileName = _T("French"); + break; + case LANG_NORWEGIAN: + keyFile = "NO_mpt_classic_(rakib)"; + keyFileName = _T("Norwegian"); + break; + } + if(keyFile != nullptr) + { + if(GetFullKeyPath(keyFile).IsFile()) + { + int i = combo->AddString(_T("OpenMPT / Chromatic (") + CString(keyFileName) + _T(")")); + combo->SetItemDataPtr(i, (void *)keyFile); + combo->SetCurSel(i); + } + } + combo->SetItemDataPtr(combo->AddString(_T("Impulse Tracker")), "US_mpt-ft2_classic"); + combo->SetItemDataPtr(combo->AddString(_T("FastTracker 2")), "US_mpt-it2_classic"); + + CheckDlgButton(IDC_CHECK1, BST_CHECKED); + CheckDlgButton(IDC_CHECK2, (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_SMALLFONT) ? BST_UNCHECKED : BST_CHECKED); + CheckDlgButton(IDC_CHECK3, theApp.IsPortableMode() ? BST_CHECKED : BST_UNCHECKED); + GetDlgItem(IDC_CHECK3)->EnableWindow(theApp.IsPortableMode() ? FALSE : TRUE); + + ShowWindow(SW_SHOW); + + return TRUE; +} + + +void WelcomeDlg::OnOptions() +//-------------------------- +{ + OnOK(); + CMainFrame::GetMainFrame()->PostMessage(WM_COMMAND, ID_VIEW_OPTIONS); +} + + +void WelcomeDlg::OnScanPlugins() +//------------------------------ +{ + CSelectPluginDlg::ScanPlugins(vstPath, this); +} + + +void WelcomeDlg::OnOK() +//--------------------- +{ + CDialog::OnOK(); + + bool runUpdates = IsDlgButtonChecked(IDC_CHECK1) != BST_UNCHECKED; + CUpdateCheck::SetUpdateSettings(0, runUpdates ? 7 : 0, CUpdateCheck::GetUpdateURL(), CUpdateCheck::GetSendGUID(), CUpdateCheck::GetShowUpdateHint()); + if(IsDlgButtonChecked(IDC_CHECK2) != BST_UNCHECKED) + TrackerSettings::Instance().m_dwPatternSetup &= ~PATTERN_SMALLFONT; + else + TrackerSettings::Instance().m_dwPatternSetup |= PATTERN_SMALLFONT; + theApp.SetPortableMode(IsDlgButtonChecked(IDC_CHECK3) != BST_UNCHECKED); + + CComboBox *combo = (CComboBox *)GetDlgItem(IDC_COMBO1); + const char *keyFile = static_cast<char *>(combo->GetItemDataPtr(combo->GetCurSel())); + if(keyFile != nullptr) + { + CCommandSet cmdSet; + cmdSet.LoadFile(GetFullKeyPath(keyFile)); + CMainFrame::GetInputHandler()->SetNewCommandSet(&cmdSet); + } + if(runUpdates) + { + CUpdateCheck::DoUpdateCheck(true); + } + CMainFrame::GetMainFrame()->PostMessage(WM_MOD_INVALIDATEPATTERNS, HINT_MPTOPTIONS); +} + +OPENMPT_NAMESPACE_END Property changes on: trunk/OpenMPT/mptrack/WelcomeDialog.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/mptrack/WelcomeDialog.h =================================================================== --- trunk/OpenMPT/mptrack/WelcomeDialog.h (rev 0) +++ trunk/OpenMPT/mptrack/WelcomeDialog.h 2014-12-13 23:30:29 UTC (rev 4649) @@ -0,0 +1,38 @@ +/* + * WelcomeDialog.cpp + * ----------------- + * Purpose: "First run" OpenMPT welcome dialog + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +#include "../common/mptPathString.h" + +OPENMPT_NAMESPACE_BEGIN + +//=============================== +class WelcomeDlg : public CDialog +//=============================== +{ +protected: + mpt::PathString vstPath; + +public: + WelcomeDlg(CWnd *parent); + +protected: + virtual BOOL OnInitDialog(); + virtual void OnOK(); + virtual void PostNcDestroy() { CDialog::PostNcDestroy(); delete this; } + + afx_msg void OnOptions(); + afx_msg void OnScanPlugins(); + + DECLARE_MESSAGE_MAP() +}; + +OPENMPT_NAMESPACE_END Property changes on: trunk/OpenMPT/mptrack/WelcomeDialog.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/mptrack.rc 2014-12-13 23:30:29 UTC (rev 4649) @@ -337,7 +337,28 @@ PUSHBUTTON "&Cancel",IDCANCEL,120,24,50,14 END +IDD_WECLOME DIALOGEX 0, 0, 256, 154 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Welcome to OpenMPT!" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&OK",IDOK,198,135,50,14 + LTEXT "Please review the following settings before using this software:",IDC_STATIC,6,6,246,8 + CONTROL "&Automatically check for new versions of OpenMPT",IDC_CHECK1, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,24,246,10 + CONTROL "Store settings in installation directory (&portable mode)",IDC_CHECK3, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,42,246,10 + CONTROL "&Use a big font in the pattern editor",IDC_CHECK2, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,60,246,10 + LTEXT "&Default keyboard scheme:",IDC_STATIC,6,81,108,8 + COMBOBOX IDC_COMBO1,114,79,132,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Scan for existing VST plugins in the following location:",IDC_STATIC,6,100,172,8 + PUSHBUTTON "&Scan",IDC_BUTTON2,198,97,50,14 + EDITTEXT IDC_EDIT1,6,113,240,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + PUSHBUTTON "&More Settings",IDC_BUTTON1,6,135,60,14 +END + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -489,6 +510,14 @@ TOPMARGIN, 7 BOTTOMMARGIN, 58 END + + IDD_WECLOME, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 249 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END END #endif // APSTUDIO_INVOKED Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2014-12-13 23:30:29 UTC (rev 4649) @@ -920,6 +920,10 @@ > </File> <File + RelativePath=".\WelcomeDialog.cpp" + > + </File> + <File RelativePath="..\soundlib\WindowedFIR.cpp" > </File> @@ -1634,6 +1638,10 @@ > </File> <File + RelativePath=".\WelcomeDialog.h" + > + </File> + <File RelativePath="..\soundlib\Wav.h" > </File> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2014-12-13 23:30:29 UTC (rev 4649) @@ -931,6 +931,7 @@ <ClCompile Include="VSTEditor.cpp" /> <ClCompile Include="Vstplug.cpp" /> <ClCompile Include="VstPresets.cpp" /> + <ClCompile Include="WelcomeDialog.cpp" /> </ItemGroup> <ItemGroup> <ResourceCompile Include="mptrack.rc" /> @@ -1107,6 +1108,7 @@ <ClInclude Include="VSTEditor.h" /> <ClInclude Include="Vstplug.h" /> <ClInclude Include="VstPresets.h" /> + <ClInclude Include="WelcomeDialog.h" /> </ItemGroup> <ItemGroup> <None Include="..\soundlib\Tunings\built-inTunings.tc" /> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2014-12-13 23:30:29 UTC (rev 4649) @@ -538,6 +538,9 @@ <ClCompile Include="ExternalSamples.cpp"> <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> + <ClCompile Include="WelcomeDialog.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\soundlib\Loaders.h"> @@ -1053,6 +1056,9 @@ <ClInclude Include="..\common\FileReader.h"> <Filter>Header Files\common</Filter> </ClInclude> + <ClInclude Include="WelcomeDialog.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="res\bitmap1.bmp"> Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/resource.h 2014-12-13 23:30:29 UTC (rev 4649) @@ -136,6 +136,7 @@ #define IDD_SCANPLUGINS 536 #define IDD_RESAMPLE 537 #define IDD_MISSINGSAMPLES 538 +#define IDD_WECLOME 539 #define IDC_BUTTON1 1001 #define IDC_BUTTON2 1002 #define IDC_BUTTON3 1003 @@ -1252,7 +1253,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 539 +#define _APS_NEXT_RESOURCE_VALUE 540 #define _APS_NEXT_COMMAND_VALUE 44645 #define _APS_NEXT_CONTROL_VALUE 2483 #define _APS_NEXT_SYMED_VALUE 901 Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2014-12-13 21:47:31 UTC (rev 4648) +++ trunk/OpenMPT/mptrack/view_com.cpp 2014-12-13 23:30:29 UTC (rev 4649) @@ -198,7 +198,6 @@ m_ToolBar.ChangeBitmap(IDC_LIST_INSTRUMENTS, sndFile.GetNumInstruments() ? IMAGE_INSTRUMENTS : IMAGE_INSTRMUTE); TCHAR s[512], stmp[256]; - LV_COLUMN lvc; LV_ITEM lvi, lvi2; m_ItemList.SetRedraw(FALSE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |