private void SaveSettings()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValue("gui", "ScrollSpeedRight", m_iSpeedHorizontal.ToString());
     xmlwriter.SetValue("gui", "ScrollSpeedDown", m_iSpeedVertical.ToString());
     xmlwriter.SetValue("screen", "GuiRenderFps", GUIGraphicsContext.MaxFPS);
     xmlwriter.SetValue("gui", "listLoopDelay", m_iListLoopDelay.ToString());
   }
 }
    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);
   }
 }
Beispiel #4
0
 private void SaveSettings()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValue("mpsettings", "pin", Util.Utils.EncryptPin(_pin));
   }
 }
 private void SaveSettings()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValueAsBool("musicmisc", "lookupSimilarTracks", !btnDisableSimilarTrackLookup.Selected);
     xmlwriter.SetValue("musicmisc", "vumeter", _vuMeter.ToLowerInvariant());
   }
 }
Beispiel #6
0
        protected override void OnPageDestroy(int newWindowId)
        {
            SaveSettings();

            // Save view
            using (Profile.Settings xmlwriter = new Profile.MPSettings())
            {
                // Save only MyVideos window views
                if (GUIVideoFiles.IsVideoWindow(VideoState.StartWindow))
                {
                    xmlwriter.SetValue("movies", "startWindow", VideoState.StartWindow.ToString());
                    xmlwriter.SetValue("movies", "startview", VideoState.View);
                }
            }

            m_bPlaylistsLayout = false;

            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);
            }
        }
 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();
 }
Beispiel #9
0
        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("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("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 SetTemperatureSelect()
        {
            using (Profile.Settings xmlwriter = new Profile.MPSettings())
            {
                string ts = "F"; // Farenheit
                if (btnTemperatureSelect.SelectedItemLabel.CompareTo("Celsius") == 0)
                {
                    ts = "C"; // Celsius
                }

                xmlwriter.SetValue("weather", "temperature", ts);
            }
        }
        private void SetDefaultLocation()
        {
            string defaultLocationCode = "";

            for (int i = 0; i < availableLocations.Count; i++)
            {
                if (btnDefaultLocation.SelectedItemLabel == ((LocationInfo)availableLocations[i]).City)
                {
                    defaultLocationCode = ((LocationInfo)availableLocations[i]).CityCode;
                    break;
                }
            }

            // If no default location could be set then choose the first city in the list.
            if (defaultLocationCode == "" & availableLocations.Count > 0)
            {
                defaultLocationCode = ((LocationInfo)availableLocations[0]).CityCode;
            }

            using (Profile.Settings xmlwriter = new Profile.MPSettings())
            {
                xmlwriter.SetValue("weather", "location", defaultLocationCode);
            }
        }
    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);
      }
      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);
      }
    }
 private void SaveMenuSorting()
 {
   using (Profile.Settings xmlWriter = new Profile.MPSettings())
   {
     foreach (TreeNode node in tvMenu.Nodes)
     {
       xmlWriter.SetValue("pluginSorting", node.Text, node.Index);
       if (node.Nodes != null)
       {
         foreach (TreeNode subNode in node.Nodes)
         {
           xmlWriter.SetValue("pluginSorting", subNode.Text, subNode.Index);
         }
       }
     }
   }
 }
 private void SetRefreshInterval()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValue("weather", "refresh", btnRefreshInterval.SelectedItemValue);
   }
 }
    private void SetWindSpeedSelect()
    {
      int newWindUnit = 0;
      if (btnWindSpeedSelect.SelectedItemLabel == GUILocalizeStrings.Get(561))
      {
        newWindUnit = 0; // km/h
      }
      else if (btnWindSpeedSelect.SelectedItemLabel == GUILocalizeStrings.Get(562))
      {
        newWindUnit = 1; // mph
      }
      else if (btnWindSpeedSelect.SelectedItemLabel == GUILocalizeStrings.Get(564))
      {
        newWindUnit = 2; // m/s
      }
      else if (btnWindSpeedSelect.SelectedItemLabel == GUILocalizeStrings.Get(563))
      {
        newWindUnit = 3; // kn
      }
      else if (btnWindSpeedSelect.SelectedItemLabel == GUILocalizeStrings.Get(565))
      {
        newWindUnit = 4; // bft
      }

      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValue("weather", "speed", newWindUnit);
      }
    }
 private void SaveCurrentViz(VisualizationInfo vizPluginInfo)
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValue("musicvisualization", "name", vizPluginInfo.Name);
     xmlwriter.SetValue("musicvisualization", "vizType", ((int)vizPluginInfo.VisualizationType).ToString());
     xmlwriter.SetValue("musicvisualization", "path", vizPluginInfo.FilePath);
     xmlwriter.SetValue("musicvisualization", "clsid", vizPluginInfo.CLSID);
     xmlwriter.SetValue("musicvisualization", "preset", vizPluginInfo.PresetIndex.ToString());
   }
 }
    private void SetDefaultLocation()
    {
      string defaultLocationCode = "";
      for (int i = 0; i < availableLocations.Count; i++)
      {
        if (btnDefaultLocation.SelectedItemLabel == ((LocationInfo)availableLocations[i]).City)
        {
          defaultLocationCode = ((LocationInfo)availableLocations[i]).CityCode;
          break;
        }
      }

      // If no default location could be set then choose the first city in the list.
      if (defaultLocationCode == "" & availableLocations.Count > 0)
      {
        defaultLocationCode = ((LocationInfo)availableLocations[0]).CityCode;
      }

      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValue("weather", "location", defaultLocationCode);
      }
    }
    public static void SetInitialDefaultShares(bool addOptical, bool addMusic, bool addPictures, bool addVideos)
    {
      ArrayList sharesVideos = new ArrayList();
      ArrayList sharesMusic = new ArrayList();
      ArrayList sharesPhotos = new ArrayList();

      // add optical drive letters
      if (addOptical)
      {
        string[] drives = Environment.GetLogicalDrives();
        foreach (string drive in drives)
        {
          int driveType = Utils.getDriveType(drive);
          if (driveType == (int)DriveType.CDRom)
          {
            string driveName = String.Format("({0}:) CD/DVD", drive.Substring(0, 1).ToUpperInvariant());
            Share share = new Share(driveName, drive, string.Empty);
            sharesMusic.Add(share);
            sharesPhotos.Add(share);
            sharesVideos.Add(share);
          }
        }
      }

      // add user profile dirs
      string MusicProfilePath = Win32API.GetFolderPath(Win32API.CSIDL_MYMUSIC);
      if (addMusic)
      {
        Share MusicShare = new Share(GetShareNameDefault(MusicProfilePath), MusicProfilePath, string.Empty);
        sharesMusic.Add(MusicShare);
      }

      string PicturesProfilePath = Win32API.GetFolderPath(Win32API.CSIDL_MYPICTURES);
      if (addPictures)
      {
        Share PicShare = new Share(GetShareNameDefault(PicturesProfilePath), PicturesProfilePath, string.Empty);
        sharesPhotos.Add(PicShare);
      }

      string VideoProfilePath = Win32API.GetFolderPath(Win32API.CSIDL_MYVIDEO);
      if (addVideos)
      {
        Share VidShare = new Share(GetShareNameDefault(VideoProfilePath), VideoProfilePath, string.Empty);
        sharesVideos.Add(VidShare);
      }

      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        if (addMusic)
        {
          xmlwriter.SetValue("music", "default", MusicProfilePath);
          SaveShare(sharesMusic, "music");
        }
        if (addPictures)
        {
          xmlwriter.SetValue("pictures", "default", PicturesProfilePath);
          SaveShare(sharesPhotos, "pictures");
        }
        if (addVideos)
        {
          xmlwriter.SetValue("movies", "default", VideoProfilePath);
          SaveShare(sharesVideos, "movies");
        }
      }
    }
    private void OnStartUpDelay()
    {
      string seconds = _iStartUpDelay.ToString(CultureInfo.InvariantCulture);
      GetNumberFromKeyboard(ref seconds);
      _iStartUpDelay = Convert.ToInt32(seconds);

      string property = _iStartUpDelay + " " + GUILocalizeStrings.Get(2999); // sec
      GUIPropertyManager.SetProperty("#delayStartup", property);

      if (_iStartUpDelay == 0)
      {
        _cmDelayStartup.IsEnabled = false;
        _cmDelayResume.IsEnabled = false;
      }
      else
      {
        _cmDelayStartup.IsEnabled = true;
        _cmDelayResume.IsEnabled = true;
      }

      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValue("general", "delay", _iStartUpDelay);
        SettingsChanged(true);
      }
    }
Beispiel #23
0
    private void LoadFolderSettings(string folderName)
    {
      if (folderName == string.Empty)
      {
        folderName = "root";
      }
      object o;
      FolderSettings.GetFolderSetting(folderName, "VideoFiles", typeof(MapSettings), out o);
      if (o != null)
      {
        _mapSettings = o as MapSettings;

        if (_mapSettings == null)
        {
          _mapSettings = new MapSettings();
        }

        CurrentSortAsc = _mapSettings.SortAscending;
        CurrentSortMethod = (VideoSort.SortMethod)_mapSettings.SortBy;
        currentLayout = (Layout)_mapSettings.ViewAs;
      }
      else
      {
        Share share = _virtualDirectory.GetShare(folderName);

        if (share != null)
        {
          if (_mapSettings == null)
          {
            _mapSettings = new MapSettings();
          }
          CurrentSortAsc = _mapSettings.SortAscending;
          CurrentSortMethod = (VideoSort.SortMethod)_mapSettings.SortBy;
          currentLayout = (Layout)share.DefaultLayout;
          CurrentLayout = (Layout)share.DefaultLayout;
        }
      }

      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        if (xmlreader.GetValueAsBool("movies", "rememberlastfolder", false))
        {
          xmlreader.SetValue("movies", "lastfolder", folderName);
        }
      }

      SwitchLayout();
      UpdateButtonStates();
    }
 protected override void SaveSettings()
 {
   base.SaveSettings();
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValue(SerializeName, "sortmethod", (int)currentSortMethod);
     xmlwriter.SetValue(SerializeName, "sortmethodroot", (int)currentSortMethodRoot);
   }
 }
    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.SetValue("weather", "location", _locationCode);
     xmlwriter.SetValue("weather", "temperature", _temperatureFarenheit);
     xmlwriter.SetValue("weather", "speed", (int)_currentWindUnit);
   }
 }
    private void SetTemperatureSelect()
    {
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        string ts = "F"; // Farenheit
        if (btnTemperatureSelect.SelectedItemLabel.CompareTo("Celsius") == 0)
        {
          ts = "C"; // Celsius
        }

        xmlwriter.SetValue("weather", "temperature", ts);
      }
    }
    private void OnShowScreens()
    {
      // Refresh screen
      GetScreens();

      var dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
      if (dlg == null)
      {
        return;
      }
      dlg.Reset();
      dlg.SetHeading(496); // Options

      foreach (Tuple<string, string, string> screen in _screenCollection)
      {
        dlg.Add(screen.Item1);
      }

      if (_screennumber < _screenCollection.Count)
      {
        dlg.SelectedLabel = _screennumber;
      }

      // Show dialog menu
      dlg.DoModal(GetID);

      if (dlg.SelectedLabel == -1)
      {
        return;
      }

      // Check if screen are present and if not force to use primary screen
      if (dlg.SelectedLabel == -1)
      {
        dlg.SelectedLabel = 0;
      }

      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValue("screenselector", "screennumber", dlg.SelectedLabel);
        xmlwriter.SetValue("screenselector", "screendeviceid", _screenCollection[dlg.SelectedLabel].Item2);
        xmlwriter.SetValue("screenselector", "screendisplayname", _screenCollection[dlg.SelectedLabel].Item3);
        SettingsChanged(true);
      }

      GUIPropertyManager.SetProperty("#defScreen", _screenCollection[dlg.SelectedLabel].Item1);
    }
 private void SaveCurrentViz(VisualizationInfo vizPluginInfo)
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValue("musicvisualization", "name", vizPluginInfo.Name);
     xmlwriter.SetValue("musicvisualization", "vizType", ((int)vizPluginInfo.VisualizationType).ToString());
     xmlwriter.SetValue("musicvisualization", "path", vizPluginInfo.FilePath);
     xmlwriter.SetValue("musicvisualization", "preset", vizPluginInfo.PresetIndex.ToString());
     // save only new PluginIndex if BASSVISKind WMP
     if (vizPluginInfo.VisualizationType == VisualizationInfo.PluginType.WMP)
       xmlwriter.SetValue("musicvisualization", "plgIndex", vizPluginInfo.PlgIndex.ToString());
   }
 }
    protected override void OnPageDestroy(int newWindowId)
    {
      SaveSettings();

      // Save view
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        // Save only MyVideos window views
        if (GUIVideoFiles.IsVideoWindow(VideoState.StartWindow))
        {
          xmlwriter.SetValue("movies", "startWindow", VideoState.StartWindow.ToString());
          xmlwriter.SetValue("movies", "startview", VideoState.View);
        }
      }

      m_bPlaylistsLayout = false;

      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 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);
   }
 }
Beispiel #33
0
 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 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);
        }
      }
    }
    private void SaveLocations()
    {
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        // Clear the current set of locations
        for (int i = 0; i < VirtualDirectory.MaxSharesCount; i++)
        {
          string cityTag = String.Format("city{0}", i);
          string strCodeTag = String.Format("code{0}", i);
          string strSatUrlTag = String.Format("sat{0}", i);
          string strTempUrlTag = String.Format("temp{0}", i);
          string strUVUrlTag = String.Format("uv{0}", i);
          string strWindsUrlTag = String.Format("winds{0}", i);
          string strHumidUrlTag = String.Format("humid{0}", i);
          string strPrecipUrlTag = String.Format("precip{0}", i);
          xmlwriter.SetValue("weather", cityTag, "");
          xmlwriter.SetValue("weather", strCodeTag, "");
          xmlwriter.SetValue("weather", strSatUrlTag, "");
          xmlwriter.SetValue("weather", strTempUrlTag, "");
          xmlwriter.SetValue("weather", strUVUrlTag, "");
          xmlwriter.SetValue("weather", strWindsUrlTag, "");
          xmlwriter.SetValue("weather", strHumidUrlTag, "");
          xmlwriter.SetValue("weather", strPrecipUrlTag, "");
        }

        // Write our collection of locations
        for (int i = 0; i < availableLocations.Count; i++)
        {
          string cityTag = String.Format("city{0}", i);
          string strCodeTag = String.Format("code{0}", i);
          string strSatUrlTag = String.Format("sat{0}", i);
          string strTempUrlTag = String.Format("temp{0}", i);
          string strUVUrlTag = String.Format("uv{0}", i);
          string strWindsUrlTag = String.Format("winds{0}", i);
          string strHumidUrlTag = String.Format("humid{0}", i);
          string strPrecipUrlTag = String.Format("precip{0}", i);
          xmlwriter.SetValue("weather", cityTag, ((LocationInfo)availableLocations[i]).City);
          xmlwriter.SetValue("weather", strCodeTag, ((LocationInfo)availableLocations[i]).CityCode);
          xmlwriter.SetValue("weather", strSatUrlTag, ((LocationInfo)availableLocations[i]).UrlSattelite);
          xmlwriter.SetValue("weather", strTempUrlTag, ((LocationInfo)availableLocations[i]).UrlTemperature);
          xmlwriter.SetValue("weather", strUVUrlTag, ((LocationInfo)availableLocations[i]).UrlUvIndex);
          xmlwriter.SetValue("weather", strWindsUrlTag, ((LocationInfo)availableLocations[i]).UrlWinds);
          xmlwriter.SetValue("weather", strHumidUrlTag, ((LocationInfo)availableLocations[i]).UrlHumidity);
          xmlwriter.SetValue("weather", strPrecipUrlTag, ((LocationInfo)availableLocations[i]).UrlPrecip);
        }
      }
    }
    private void OnShowScreens()
    {
      var dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
      if (dlg == null)
      {
        return;
      }
      dlg.Reset();
      dlg.SetHeading(496); // Options

      foreach (string screen in _screenCollection)
      {
        dlg.Add(screen);
      }

      if (_screennumber < _screenCollection.Count)
      {
        dlg.SelectedLabel = _screennumber;
      }

      // Show dialog menu
      dlg.DoModal(GetID);

      if (dlg.SelectedLabel == -1)
      {
        return;
      }

      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValue("screenselector", "screennumber", dlg.SelectedLabel);
        SettingsChanged(true);
      }
    }
        private void SaveLocations()
        {
            using (Profile.Settings xmlwriter = new Profile.MPSettings())
            {
                // Clear the current set of locations
                for (int i = 0; i < VirtualDirectory.MaxSharesCount; i++)
                {
                    string cityTag         = String.Format("city{0}", i);
                    string strCodeTag      = String.Format("code{0}", i);
                    string strSatUrlTag    = String.Format("sat{0}", i);
                    string strTempUrlTag   = String.Format("temp{0}", i);
                    string strUVUrlTag     = String.Format("uv{0}", i);
                    string strWindsUrlTag  = String.Format("winds{0}", i);
                    string strHumidUrlTag  = String.Format("humid{0}", i);
                    string strPrecipUrlTag = String.Format("precip{0}", i);
                    xmlwriter.SetValue("weather", cityTag, "");
                    xmlwriter.SetValue("weather", strCodeTag, "");
                    xmlwriter.SetValue("weather", strSatUrlTag, "");
                    xmlwriter.SetValue("weather", strTempUrlTag, "");
                    xmlwriter.SetValue("weather", strUVUrlTag, "");
                    xmlwriter.SetValue("weather", strWindsUrlTag, "");
                    xmlwriter.SetValue("weather", strHumidUrlTag, "");
                    xmlwriter.SetValue("weather", strPrecipUrlTag, "");
                }

                // Write our collection of locations
                for (int i = 0; i < availableLocations.Count; i++)
                {
                    string cityTag         = String.Format("city{0}", i);
                    string strCodeTag      = String.Format("code{0}", i);
                    string strSatUrlTag    = String.Format("sat{0}", i);
                    string strTempUrlTag   = String.Format("temp{0}", i);
                    string strUVUrlTag     = String.Format("uv{0}", i);
                    string strWindsUrlTag  = String.Format("winds{0}", i);
                    string strHumidUrlTag  = String.Format("humid{0}", i);
                    string strPrecipUrlTag = String.Format("precip{0}", i);
                    xmlwriter.SetValue("weather", cityTag, ((LocationInfo)availableLocations[i]).City);
                    xmlwriter.SetValue("weather", strCodeTag, ((LocationInfo)availableLocations[i]).CityCode);
                    xmlwriter.SetValue("weather", strSatUrlTag, ((LocationInfo)availableLocations[i]).UrlSattelite);
                    xmlwriter.SetValue("weather", strTempUrlTag, ((LocationInfo)availableLocations[i]).UrlTemperature);
                    xmlwriter.SetValue("weather", strUVUrlTag, ((LocationInfo)availableLocations[i]).UrlUvIndex);
                    xmlwriter.SetValue("weather", strWindsUrlTag, ((LocationInfo)availableLocations[i]).UrlWinds);
                    xmlwriter.SetValue("weather", strHumidUrlTag, ((LocationInfo)availableLocations[i]).UrlHumidity);
                    xmlwriter.SetValue("weather", strPrecipUrlTag, ((LocationInfo)availableLocations[i]).UrlPrecip);
                }
            }
        }