private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("musicfiles", "extractthumbs", btnExtractthumbs.Selected); xmlwriter.SetValueAsBool("musicfiles", "createartistthumbs", btnCreateartistthumbs.Selected); xmlwriter.SetValueAsBool("musicfiles", "creategenrethumbs", btnCreategenrethumbs.Selected); xmlwriter.SetValueAsBool("musicfiles", "useFolderThumbs", btnUseFolderThumbs.Selected); xmlwriter.SetValueAsBool("musicfiles", "useAllImages", btnUseAllImages.Selected); xmlwriter.SetValueAsBool("musicfiles", "createMissingFolderThumbs", btnCreateMissingFolderThumbs.Selected); xmlwriter.SetValueAsBool("musicfiles", "treatFolderAsAlbum", btnTreatFolderAsAlbum.Selected); xmlwriter.SetValueAsBool("musicfiles", "monitorShares", btnMonitorShares.Selected); xmlwriter.SetValueAsBool("musicfiles", "updateSinceLastImport", btnUpdateSinceLastImport.Selected); xmlwriter.SetValueAsBool("musicfiles", "stripartistprefixes", btnStripartistprefixes.Selected); xmlwriter.SetValue("musicfiles", "artistprefixes", _prefixes); xmlwriter.SetValue("musicfiles", "dateadded", _dateAddedSelectedIndex); SettingsSharesHelper settingsSharesHelper = new SettingsSharesHelper(); settingsSharesHelper.ShareListControl = lcFolders.ListItems; settingsSharesHelper.RememberLastFolder = _rememberLastFolder; settingsSharesHelper.AddOpticalDiskDrives = _addOpticalDiskDrives; settingsSharesHelper.SwitchRemovableDrives = _autoSwitchRemovableDrives; settingsSharesHelper.DefaultShare = _defaultShare; settingsSharesHelper.SaveSettings("music"); } }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("general", "startfullscreen", _cmStartfullscreen.Selected); xmlwriter.SetValueAsBool("general", "usefullscreensplash", _cmUsefullscreensplash.Selected); xmlwriter.SetValueAsBool("general", "keepstartfullscreen", _cmkeepstartfullscreen.Selected); xmlwriter.SetValueAsBool("general", "alwaysontop", _cmAlwaysontop.Selected); try { if (_cmAlwaysontop.Selected) // always on top { using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true)) { if (subkey != null) subkey.SetValue("ForegroundLockTimeout", 0); } } } // ReSharper disable EmptyGeneralCatchClause catch (Exception) { } // ReSharper restore EmptyGeneralCatchClause xmlwriter.SetValueAsBool("general", "hidetaskbar", _cmHidetaskbar.Selected); xmlwriter.SetValueAsBool("general", "autostart", _cmAutostart.Selected); try { if (_cmAutostart.Selected) // autostart on boot { Log.Debug("AUTOSTART"); string fileName = Config.GetFile(Config.Dir.Base, "MediaPortal.exe"); using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true)) { if (subkey != null) { subkey.SetValue("MediaPortal", fileName); } } } else { using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true)) { if (subkey != null) { subkey.DeleteValue("MediaPortal", false); } } } } // ReSharper disable EmptyGeneralCatchClause catch (Exception) { } // ReSharper restore EmptyGeneralCatchClause xmlwriter.SetValueAsBool("general", "minimizeonstartup", _cmMinimizeonstartup.Selected); xmlwriter.SetValueAsBool("general", "minimizeonexit", _cmMinimizeonexit.Selected); xmlwriter.SetValueAsBool("general", "minimizeonfocusloss", _cmMinimizeonfocusloss.Selected); } }
public void Save() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("tetris", "music", m_bMusic); xmlwriter.SetValueAsBool("tetris", "sound", m_bSound); xmlwriter.SetValue("tetris", "highscore", m_nHighscore); } }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("general", "turnoffmonitor", _cmTurnoffmonitor.Selected); xmlwriter.SetValueAsBool("general", "showlastactivemodule", _cmShowlastactivemodule.Selected); xmlwriter.SetValueAsBool("general", "stoponaudioremoval", _cmStopOnAudioRemoval.Selected); xmlwriter.SetValueAsBool("general", "delay startup", _cmDelayStartup.Selected); xmlwriter.SetValueAsBool("general", "delay resume", _cmDelayResume.Selected); } }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValue("pictures", "speed", m_iSpeed.ToString()); xmlwriter.SetValue("pictures", "transition", m_iTransistion.ToString()); xmlwriter.SetValue("pictures", "kenburnsspeed", m_iKenBurnsSpeed.ToString()); xmlwriter.SetValueAsBool("pictures", "kenburns", m_bKenBurns); xmlwriter.SetValueAsBool("pictures", "random", m_bRandom); } }
private void SaveSettings() { using (Profile.Settings xmlWriter = new Profile.MPSettings()) { xmlWriter.SetValueAsBool("home", "scrollfixed", chkboxFixScrollbar.Checked); xmlWriter.SetValueAsBool("home", "usemyplugins", chkBoxUseMyPlugins.Checked); xmlWriter.SetValueAsBool("home", "enableanimation", chkBoxAnimation.Checked); xmlWriter.SetValueAsBool("home", "LongTimeFormat", checkBoxShowSeconds.Checked); xmlWriter.SetValue("home", "dateformat", cboxFormat.Text); } SaveMenuSorting(); }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("musicmisc", "fetchlastfmcovers", !btnFetchlastfmcovers.Selected); xmlwriter.SetValueAsBool("musicmisc", "fetchlastfmtopalbums", !btnFetchlastfmtopalbums.Selected); xmlwriter.SetValueAsBool("musicmisc", "fetchlastfmtracktags", !btnFetchlastfmtracktags.Selected); xmlwriter.SetValueAsBool("musicmisc", "switchArtistOnLastFMSubmit", btnSwitchArtistOnLastFMSubmit.Selected); xmlwriter.SetValue("musicmisc", "vumeter", _vuMeter.ToLowerInvariant()); } }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("movies", "markwatched", btnMarkWatched.Selected); xmlwriter.SetValueAsBool("movies", "keepfolderstogether", btnKeepFoldersTogether.Selected); xmlwriter.SetValueAsBool("comskip", "automaticskip", btnCommercialSkip.Selected); xmlwriter.SetValue("movies", "playedpercentagewatched", _watchedPercentage); xmlwriter.SetValue("FFDShow", "audiodelayInterval", _videoAudioDelay); } }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("audioscrobbler", "showtrayicon", checkBoxUseTrayIcon.Checked); xmlwriter.SetValueAsBool("audioscrobbler", "showballontips", checkBoxShowBallonTips.Checked); xmlwriter.SetValueAsBool("audioscrobbler", "submitradiotracks", checkBoxSubmitToProfile.Checked); xmlwriter.SetValueAsBool("audioscrobbler", "directskip", checkBoxDirectSkip.Checked); xmlwriter.SetValue("audioscrobbler", "listentrycount", numericUpDownListEntries.Value); xmlwriter.SetValue("audioscrobbler", "streamplayertype", 0); // comboBoxStreamPlayerType.SelectedIndex); xmlwriter.SetValueAsBool("audioscrobbler", "oneclickstart", checkBoxOneClickMode.Checked); } }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("general", "startfullscreen", _cmStartfullscreen.Selected); xmlwriter.SetValueAsBool("general", "usefullscreensplash", _cmUsefullscreensplash.Selected); xmlwriter.SetValueAsBool("general", "alwaysontop", _cmAlwaysontop.Selected); try { if (_cmAlwaysontop.Selected) // always on top { using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true)) { if (subkey != null) { subkey.SetValue("ForegroundLockTimeout", 0); } } } } // ReSharper disable EmptyGeneralCatchClause catch (Exception) { } // ReSharper restore EmptyGeneralCatchClause xmlwriter.SetValueAsBool("general", "hidetaskbar", _cmHidetaskbar.Selected); xmlwriter.SetValueAsBool("general", "autostart", _cmAutostart.Selected); try { if (_cmAutostart.Selected) // autostart on boot { Log.Debug("AUTOSTART"); string fileName = Config.GetFile(Config.Dir.Base, "MediaPortal.exe"); using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true)) { if (subkey != null) { subkey.SetValue("MediaPortal", fileName); } } } else { using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true)) { if (subkey != null) { subkey.DeleteValue("MediaPortal", false); } } } } // ReSharper disable EmptyGeneralCatchClause catch (Exception) { } // ReSharper restore EmptyGeneralCatchClause xmlwriter.SetValueAsBool("general", "minimizeonstartup", _cmMinimizeonstartup.Selected); xmlwriter.SetValueAsBool("general", "minimizeonexit", _cmMinimizeonexit.Selected); xmlwriter.SetValueAsBool("general", "minimizeonfocusloss", _cmMinimizeonfocusloss.Selected); } }
public void Save() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("NumberPlace", "showerrormoves", m_bShow); xmlwriter.SetValueAsBool("NumberPlace", "blockerrormoves", m_bBlock); xmlwriter.SetValue("NumberPlace", "level", m_bLevel); xmlwriter.SetValueAsBool("NumberPlace", "showcandidates", _showCandidates); for (int i = 1; i <= m_highScore.Count && i < 4; i++) { xmlwriter.SetValue("NumberPlace", "name" + i, m_highScore[i - 1].Name); xmlwriter.SetValue("NumberPlace", "score" + i, m_highScore[i - 1].Score); } } }
private void OnLoopSlideShows() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("pictures", "autoRepeat", cmLoopSlideShows.Selected); } }
private void SaveSettings() { using (Profile.Settings xmlreader = new Profile.MPSettings()) { xmlreader.SetValueAsBool("musicfiles", "autoshuffle", m_bAutoShuffle); } }
private void OnShuffleSlideShows() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("pictures", "autoShuffle", cmShuffleSlideShows.Selected); } }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("musicmisc", "lookupSimilarTracks", !btnDisableSimilarTrackLookup.Selected); xmlwriter.SetValue("musicmisc", "vumeter", _vuMeter.ToLowerInvariant()); } }
protected override void OnPageDestroy(int newWindowId) { currentSelectedItem = facadeLayout.SelectedListItemIndex; using (Profile.Settings settings = new Profile.MPSettings()) { settings.SetValueAsBool("movies", "repeat", playlistPlayer.RepeatPlaylist); } base.OnPageDestroy(newWindowId); }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("general", "turnoffmonitor", cmTurnoffmonitor.Selected); xmlwriter.SetValueAsBool("general", "turnmonitoronafterresume", cmTurnmonitoronafterresume.Selected); xmlwriter.SetValueAsBool("general", "enables3trick", cmEnables3trick.Selected); xmlwriter.SetValueAsBool("general", "useS3Hack", cmUseS3Hack.Selected); xmlwriter.SetValueAsBool("general", "restartonresume", cmRestartonresume.Selected); xmlwriter.SetValueAsBool("general", "showlastactivemodule", cmShowlastactivemodule.Selected); xmlwriter.SetValueAsBool("screenselector", "usescreenselector", cmUsescreenselector.Selected); xmlwriter.SetValueAsBool("general", "delay startup", cmDelayStartup.Selected); xmlwriter.SetValueAsBool("general", "delay resume", cmDelayResume.Selected); } }
protected override void OnPageDestroy(int newWindowId) { m_iItemSelected = facadeLayout.SelectedListItemIndex; using (Profile.Settings settings = new Profile.MPSettings()) { settings.SetValueAsBool("musicfiles", "repeat", playlistPlayer.RepeatPlaylist); } HideWaitCursor(); base.OnPageDestroy(newWindowId); }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValue("pictures", "speed", m_iSpeed.ToString()); xmlwriter.SetValue("pictures", "transition", m_iTransistion.ToString()); xmlwriter.SetValue("pictures", "kenburnsspeed", m_iKenBurnsSpeed.ToString()); xmlwriter.SetValueAsBool("pictures", "kenburns", m_bKenBurns); xmlwriter.SetValueAsBool("pictures", "random", m_bRandom); xmlwriter.SetValueAsBool("pictures", "autoRepeat", cmLoopSlideShows.Selected); xmlwriter.SetValueAsBool("pictures", "autoShuffle", cmShuffleSlideShows.Selected); xmlwriter.SetValueAsBool("pictures", "useExif", cmExifSlideShows.Selected); xmlwriter.SetValueAsBool("pictures", "usePicasa", cmPicasaSlideShows.Selected); xmlwriter.SetValueAsBool("pictures", "useDayGrouping", cmGroupByDaySlideShows.Selected); xmlwriter.SetValueAsBool("pictures", "enableVideoPlayback", cmEnablePlaySlideShows.Selected); xmlwriter.SetValueAsBool("pictures", "playVideosInSlideshows", cmPlayInSlideShows.Selected); } }
public void PageDestroy() { if (!_keyboard._useSearchLayout && !_keyboard._password) { using (MediaPortal.Profile.MPSettings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("general", "smsstyleinput", _keyboard.SmsStyleText); } } GUIWindowManager.IsSwitchingToNewWindow = true; lock (this) { base.OnPageDestroy(_parentWindowId); GUIGraphicsContext.Overlay = _previousOverlayVisible; Dispose(); GUIWindowManager.UnRoute(); _parentWindow = null; } GUIWindowManager.IsSwitchingToNewWindow = false; GUILayerManager.UnRegisterLayer(this); Log.Debug("Window: {0} deinit", ToString()); }
protected override void OnPageDestroy(int newWindowId) { // set back Sort by sorttitle using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("moviedatabase", "usesorttitle", _useSortTitle); } if (_setThumbs != null && _setThumbs.IsAlive) { _setThumbs.Abort(); _setThumbs = null; } // Set folder history when video window is not actually left (ie.: play movie, video info..) if (IsVideoWindow(newWindowId)) { if (facadeLayout != null) { _history.Set(facadeLayout.SelectedListItemIndex.ToString(), _currentFolder); } } else // For real exit (ie.: to home, reset folder history) { _history.Set("0", _currentFolder); } SaveFolderSettings(_currentFolder); ReleaseResources(); base.OnPageDestroy(newWindowId); }
protected override void OnPageLoad() { base.OnPageLoad(); if (!VideoDatabase.DbHealth) { GUIDialogOK pDlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK); pDlgOK.SetHeading(315); pDlgOK.SetLine(1, string.Empty); pDlgOK.SetLine(2, GUILocalizeStrings.Get(190010, new object[] { GUILocalizeStrings.Get(3) })); pDlgOK.DoModal(GUIWindowManager.ActiveWindow); ; } if (!FolderSettings.DbHealth) { GUIDialogOK pDlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK); pDlgOK.SetHeading(315); pDlgOK.SetLine(1, string.Empty); pDlgOK.SetLine(2, GUILocalizeStrings.Get(190010, new object[] { GUILocalizeStrings.Get(190011) })); pDlgOK.DoModal(GUIWindowManager.ActiveWindow); } base.LoadSettings(); // This can't be in LoadSettings beacuse settings are loaded on MP start and it will disable SortTitle setting always using (Profile.Settings xmlreader = new Profile.MPSettings()) { // Don't sort by sorttitle _useSortTitle = xmlreader.GetValueAsBool("moviedatabase", "usesorttitle", false); xmlreader.SetValueAsBool("moviedatabase", "usesorttitle", false); } if (!KeepVirtualDirectory(PreviousWindowId)) { Reset(); } if (!IsVideoWindow(PreviousWindowId) && IsFolderPinProtected(_cachedDir)) { //when the user left MyVideos completely make sure that we don't use the cache //if folder is pin protected and reload the dir completly including PIN request etc. _cachedItems.Clear(); _cachedDir = null; } if (VideoState.StartWindow != GetID) { GUIWindowManager.ReplaceWindow(VideoState.StartWindow); return; } _resetCount = 0; // Go to default share from main MP menu if (_currentFolder == string.Empty) { _currentFolder = _virtualStartDirectory; } LoadFolderSettings(_currentFolder); //OnPageLoad is sometimes called when stopping playback. //So we use the cached version of the function here. LoadDirectory(_currentFolder, true); }
protected override void OnPageDestroy(int newWindowId) { SaveSettings(); // Save view using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValue("music", "startWindow", MusicState.StartWindow.ToString()); xmlwriter.SetValue("music", "startview", MusicState.View); xmlwriter.SetValueAsBool("lastfm:test", "autoDJ", MusicState.AutoDJEnabled); } base.OnPageDestroy(newWindowId); }
private void SaveSettings() { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { xmlwriter.SetValueAsBool("movies", "fuzzyMatching", btnNearestmatch.Selected); // FanArt xmlwriter.SetValueAsBool("moviedatabase", "usefanart", btnUsefanart.Selected); xmlwriter.SetValue("moviedatabase", "fanartnumber", m_iCount); // Folder movie title xmlwriter.SetValueAsBool("moviedatabase", "usefolderastitle", btnFoldernamefortitle.Selected); xmlwriter.SetValueAsBool("moviedatabase", "preferfilenameforsearch", btnPrefervideofilename.Selected); // Strip movie title prefix xmlwriter.SetValueAsBool("moviedatabase", "striptitleprefixes", btnStripprefix.Selected); xmlwriter.SetValue("moviedatabase", "titleprefixes", _prefixes); // Database xmlwriter.SetValueAsBool("moviedatabase", "scanskipexisting", btnSkipalreadyexisting.Selected); // Actors fetch size xmlwriter.SetValue("moviedatabase", "actorslistsize", _actorsFetchSize); // SortTitle xmlwriter.SetValueAsBool("moviedatabase", "usesorttitle", btnUseSortTitle.Selected); // nfo scraper only xmlwriter.SetValueAsBool("moviedatabase", "useonlynfoscraper", btnUseNfoScraper.Selected); SettingsSharesHelper settingsSharesHelper = new SettingsSharesHelper(); settingsSharesHelper.ShareListControl = lcFolders.ListItems; settingsSharesHelper.RememberLastFolder = _rememberLastFolder; settingsSharesHelper.AddOpticalDiskDrives = _addOpticalDiskDrives; settingsSharesHelper.SwitchRemovableDrives = _autoSwitchRemovableDrives; settingsSharesHelper.DefaultShare = _defaultShare; settingsSharesHelper.SaveSettings("movies"); } }
private static void SaveShare(IList sharesList, string mediaType) { using (Profile.Settings xmlwriter = new Profile.MPSettings()) { for (int index = 0; index < MaximumShares; index++) { string shareName = String.Format("sharename{0}", index); string sharePath = String.Format("sharepath{0}", index); string sharePin = String.Format("pincode{0}", index); string shareType = String.Format("sharetype{0}", index); string shareServer = String.Format("shareserver{0}", index); string shareLogin = String.Format("sharelogin{0}", index); string sharePwd = String.Format("sharepassword{0}", index); string sharePort = String.Format("shareport{0}", index); string shareRemotePath = String.Format("shareremotepath{0}", index); string shareNameData = string.Empty; string sharePathData = string.Empty; string sharePinData = string.Empty; bool shareTypeData = false; string shareServerData = string.Empty; string shareLoginData = string.Empty; string sharePwdData = string.Empty; int sharePortData = 21; string shareRemotePathData = string.Empty; if (sharesList != null && sharesList.Count > index) { Share shareData = sharesList[index] as Share; if (shareData != null) { shareNameData = shareData.Name; sharePathData = shareData.Path; sharePinData = shareData.Pincode; shareTypeData = shareData.IsFtpShare; shareServerData = shareData.FtpServer; shareLoginData = shareData.FtpLoginName; sharePwdData = shareData.FtpPassword; sharePortData = shareData.FtpPort; shareRemotePathData = shareData.FtpFolder; } } xmlwriter.SetValue(mediaType, shareName, shareNameData); xmlwriter.SetValue(mediaType, sharePath, sharePathData); xmlwriter.SetValue(mediaType, sharePin, Util.Utils.EncryptPassword(sharePinData)); xmlwriter.SetValueAsBool(mediaType, shareType, shareTypeData); xmlwriter.SetValue(mediaType, shareServer, shareServerData); xmlwriter.SetValue(mediaType, shareLogin, shareLoginData); xmlwriter.SetValue(mediaType, sharePwd, Util.Utils.EncryptPassword(sharePwdData)); xmlwriter.SetValue(mediaType, sharePort, sharePortData.ToString()); xmlwriter.SetValue(mediaType, shareRemotePath, shareRemotePathData); } } }