示例#1
0
        public void Save()
        {
            SaveEncryptedPassword();

            using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValueAsBool("radiotime", "mp3", Mp3);
                xmlwriter.SetValueAsBool("radiotime", "wma", Wma);
                xmlwriter.SetValueAsBool("radiotime", "real", Real);
                xmlwriter.SetValueAsBool("radiotime", "UseVideo", UseVideo);
                xmlwriter.SetValueAsBool("radiotime", "JumpNowPlaying", JumpNowPlaying);
                xmlwriter.SetValue("radiotime", "user", User);
                xmlwriter.SetValueAsBool("radiotime", "showpresets", ShowPresets);
                xmlwriter.SetValue("radiotime", "pluginname", PluginName);
                xmlwriter.SetValue("radiotime", "FolderId", FolderId);
                xmlwriter.SetValueAsBool("radiotime", "StartWithFastPreset", StartWithFastPreset);

                var s = "";
                foreach (var history in SearchHistory)
                {
                    s += history + "|";
                }
                xmlwriter.SetValue("radiotime", "searchHistory", s);

                s = "";
                foreach (var history in ArtistSearchHistory)
                {
                    s += history + "|";
                }
                xmlwriter.SetValue("radiotime", "artistSearchHistory", s);
            }
        }
示例#2
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlWriter.SetValue("mplayer", "subtitleFontName", subtitleFont.SelectedItem.ToString());
     xmlWriter.SetValueAsBool("mplayer", "enableSubtitles", subtitles.Checked);
     xmlWriter.SetValue("mplayer", "subtitleDelayStep", subtitleDelayStep.Value);
     xmlWriter.SetValue("mplayer", "subtitleSize", subtitleSize.Value);
     xmlWriter.SetValue("mplayer", "subtitlePosition", subtitlePosition.Value);
       }
 }
示例#3
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         xmlWriter.SetValue("mplayer", "subtitleFontName", subtitleFont.SelectedItem.ToString());
         xmlWriter.SetValueAsBool("mplayer", "enableSubtitles", subtitles.Checked);
         xmlWriter.SetValue("mplayer", "subtitleDelayStep", subtitleDelayStep.Value);
         xmlWriter.SetValue("mplayer", "subtitleSize", subtitleSize.Value);
         xmlWriter.SetValue("mplayer", "subtitlePosition", subtitlePosition.Value);
     }
 }
示例#4
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         xmlWriter.SetValue("mplayer", "soundOutputDriver", soundOutputDriver.SelectedIndex);
         xmlWriter.SetValue("mplayer", "soundOutputDevice", soundOutputDevice.SelectedIndex);
         xmlWriter.SetValue("mplayer", "audioChannels", audioChannels.SelectedIndex);
         xmlWriter.SetValue("mplayer", "audioDelayStep", audioDelayStep.Value);
         xmlWriter.SetValueAsBool("mplayer", "passthroughAC3DTS", passthroughAC3_DTS.Checked);
         xmlWriter.SetValueAsBool("mplayer", "audioNormalize", audioNormalize.Checked);
     }
 }
示例#5
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlWriter.SetValue("mplayer", "videoOutputDriver", videoOutputDriver.SelectedIndex);
     xmlWriter.SetValue("mplayer", "postProcessing", postProcessing.SelectedIndex);
     xmlWriter.SetValue("mplayer", "aspectRatio", aspectRatio.SelectedIndex);
     xmlWriter.SetValue("mplayer", "deinterlace", deinterlace.SelectedIndex);
     xmlWriter.SetValue("mplayer", "noise", noiseDenoise.SelectedIndex);
     xmlWriter.SetValueAsBool("mplayer", "framedrop", framedrop.Checked);
     xmlWriter.SetValueAsBool("mplayer", "directRendering", directRendering.Checked);
     xmlWriter.SetValueAsBool("mplayer", "doubleBuffering", doubleBuffering.Checked);
       }
 }
示例#6
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         xmlWriter.SetValue("mplayer", "videoOutputDriver", videoOutputDriver.SelectedIndex);
         xmlWriter.SetValue("mplayer", "postProcessing", postProcessing.SelectedIndex);
         xmlWriter.SetValue("mplayer", "aspectRatio", aspectRatio.SelectedIndex);
         xmlWriter.SetValue("mplayer", "deinterlace", deinterlace.SelectedIndex);
         xmlWriter.SetValue("mplayer", "noise", noiseDenoise.SelectedIndex);
         xmlWriter.SetValueAsBool("mplayer", "framedrop", framedrop.Checked);
         xmlWriter.SetValueAsBool("mplayer", "directRendering", directRendering.Checked);
         xmlWriter.SetValueAsBool("mplayer", "doubleBuffering", doubleBuffering.Checked);
     }
 }
示例#7
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MQTTPlugin.xml")))
            {
                xmlWriter.SetValueAsBool(MQTTPlugin.PLUGIN_NAME, "WindowChange", WindowChange_checkBox.Checked);
                xmlWriter.SetValue(MQTTPlugin.PLUGIN_NAME, "SetLevelForMediaDuration", Convert.ToInt32(mediaDuration_textBox.Text));

                xmlWriter.SetValue(MQTTPlugin.BROKER, "Host", host_textBox.Text);
                xmlWriter.SetValue(MQTTPlugin.BROKER, "Port", port_textBox.Text);
                xmlWriter.SetValue(MQTTPlugin.BROKER, "User", user_textBox.Text);
                xmlWriter.SetValue(MQTTPlugin.BROKER, "Password", DPAPI.EncryptString(password_textBox.Text));

                xmlWriter.SetValueAsBool(MQTTPlugin.PLUGIN_NAME, "DebugMode", debug_checkBox.Checked);
            }
        }
示例#8
0
        public void SaveSettings()
        {
            logger.Info("Saving Settings");
            logger.Debug("Settings File: " + GetFileFullPath());

            try {
                using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(GetFileFullPath(), false)) {
                    // loop through each property in the class
                    foreach (PropertyInfo currProperty in GetType().GetProperties())
                    {
                        foreach (object currAttr in currProperty.GetCustomAttributes(true))
                        {
                            if (currAttr.GetType() == typeof(SettingAttribute))
                            {
                                // we have found a property with the SettingAttribute applied
                                if (currProperty.PropertyType == typeof(string))
                                {
                                    object value = currProperty.GetGetMethod().Invoke(this, new object[] { });
                                    xmlwriter.SetValue(Namespace, currProperty.Name, value);
                                }

                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception) {
            }
        }
 public void WriteConfig()
 {
     try
     {
         using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
         {
             writer.SetValue("MarantzControl", "Action", Action);
             writer.SetValue("MarantzControl", "Address", Address);
             writer.SetValue("MarantzControl", "Port", Port);
             writer.SetValue("MarantzControl", "TelnetCommand", TelnetCommand);
         }
     }
     catch (Exception ex)
     {
         Log.Error("MarantzControl: Configuration read failed, using defaults! {0}", ex.ToString());
         throw;
     }
 }
 public static void SaveSettings()
 {
     try
     {
         logger.Debug("Save settings to: " + ConfigFilename);
         #region Save settings
         using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, ConfigFilename)))
         {
             xmlwriter.SetValue("Fetcher", "ApproveIfOne", ApproveIfOne);
             xmlwriter.SetValue("Fetcher", "ApproveForNearest", ApproveForNearest);
             xmlwriter.SetValue("Fetcher", "NearestFactor", NearestFactor);
         }
         #endregion
         logger.Debug("Save settings to: " + ConfigFilename + " complete.");
     }
     catch (Exception ex)
     {
         logger.Error("SaveSettings: " + ex);
     }
 }
示例#11
0
 /// <summary>
 /// Stores the configuration for this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlWriter.SetValue("mplayer", "generalArguments", optionalArguments.Text);
     xmlWriter.SetValue("mplayer", "osd", osdSelect.SelectedIndex);
     xmlWriter.SetValueAsBool("mplayer", "rebuildIndex", rebuildIndex.Checked);
     xmlWriter.SetValueAsBool("mplayer", "priorityBoost", priorityBoost.Checked);
     if (cacheSize.Text.Equals(String.Empty))
     {
       xmlWriter.SetValue("mplayer", "cacheSize", 0);
     }
     else
     {
       xmlWriter.SetValue("mplayer", "cacheSize", cacheSize.Text);
     }
     xmlWriter.SetValue("mplayer", "mplayerPath", mplayerPath.Text);
     xmlWriter.SetValueAsBool("externalOSDLibrary", "blankScreen", externalOSDLibraryBlank.Checked);
       }
 }
示例#12
0
 /// <summary>
 /// Stores the configuration for this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         xmlWriter.SetValue("mplayer", "generalArguments", optionalArguments.Text);
         xmlWriter.SetValue("mplayer", "osd", osdSelect.SelectedIndex);
         xmlWriter.SetValueAsBool("mplayer", "rebuildIndex", rebuildIndex.Checked);
         xmlWriter.SetValueAsBool("mplayer", "priorityBoost", priorityBoost.Checked);
         if (cacheSize.Text.Equals(String.Empty))
         {
             xmlWriter.SetValue("mplayer", "cacheSize", 0);
         }
         else
         {
             xmlWriter.SetValue("mplayer", "cacheSize", cacheSize.Text);
         }
         xmlWriter.SetValue("mplayer", "mplayerPath", mplayerPath.Text);
         xmlWriter.SetValueAsBool("externalOSDLibrary", "blankScreen", externalOSDLibraryBlank.Checked);
     }
 }
示例#13
0
 private void SaveEncryptedPassword()
 {
     if (!string.IsNullOrEmpty(Password))
     {
         using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
         {
             xmlwriter.SetValue("radiotime", "encryptedPassword",
                                PasswordUtility.EncryptData(Password, DataProtectionScope.LocalMachine));
             xmlwriter.RemoveEntry("radiotime", "password");
         }
     }
 }
示例#14
0
 // Save settings to file
 private void btSave_Click(object sender, EventArgs e)
 {
     using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "HeadWeb.xml")))
       {
     xmlwriter.SetValue("Settings", "Username", inputUsername.Text);
     xmlwriter.SetValue("Settings", "Password", inputPassword.Text);
     xmlwriter.SetValue("Settings", "PINCode", inputPincode.Text);
     xmlwriter.SetValue("Settings", "VideoQuality", videoQuality.Text);
     xmlwriter.SetValue("Settings", "AutoLogin", checkboxLogin.Checked ? 1 : 0);
     xmlwriter.SetValue("Settings", "PinApprovePurchase", checkboxPin.Checked ? 1 : 0);
     xmlwriter.SetValue("Settings", "DisableAdultMovies", checkboxAdult.Checked ? 1 : 0);
     xmlwriter.SetValue("Settings", "UseOrginalName", checkboxOrginalName.Checked ? 1 : 0);
     this.Close();
       }
 }
示例#15
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "egPath", egPath_textBox.Text);
                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "egPart2", egPart2_comboBox.Text);
                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "egPart3", egPart3_comboBox.Text);
                xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "egPayload", egPayload_checkBox.Checked);
                xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "WindowChange", WindowChange_checkBox.Checked);

                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "setLevelForMediaDuration", Convert.ToInt32(mediaDuration_textBox.Text));

                xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "tcpipIsEnabled", tcpip_radioButton.Checked);
                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "tcpipHost", host_textBox.Text);
                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "tcpipPort", port_textBox.Text);
                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "tcpipPassword", DPAPI.EncryptString(password_textBox.Text));
                xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "PWDEncrypted", true);

                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "ReceivePort", rcvport_textBox.Text);
                xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "ReceivePassword", DPAPI.EncryptString(rcvpassword_textBox.Text));

                xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "DebugMode", debug_checkBox.Checked);
            }
        }
示例#16
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlWriter.SetValue("mplayer", "dvdArguments", dvdArguments.Text);
     xmlWriter.SetValue("mplayer", "vcdArguments", vcdArguments.Text);
     xmlWriter.SetValue("mplayer", "svcdArguments", svcdArguments.Text);
     xmlWriter.SetValue("mplayer", "cueArguments", cueArguments.Text);
     xmlWriter.SetValue("mplayer", "ftpArguments", ftpArguments.Text);
     xmlWriter.SetValue("mplayer", "httpArguments", httpArguments.Text);
     xmlWriter.SetValue("mplayer", "mmsArguments", mmsArguments.Text);
     xmlWriter.SetValue("mplayer", "mpstArguments", mpstArguments.Text);
     xmlWriter.SetValue("mplayer", "rtspArguments", rtspArguments.Text);
     xmlWriter.SetValue("mplayer", "sdpArguments", sdpArguments.Text);
     xmlWriter.SetValue("mplayer", "udpArguments", udpArguments.Text);
     xmlWriter.SetValue("mplayer", "unsvArguments", unsvArguments.Text);
       }
 }
示例#17
0
        /// <summary>
        /// Stores the configuration with the shares
        /// </summary>
        public void SaveConfiguration()
        {
            shareList.SelectedIndex = -1;
            XmlTextWriter writer = new XmlTextWriter(Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml"),
                                                     System.Text.Encoding.UTF8)
            {
                Formatting = Formatting.Indented, Indentation = 1, IndentChar = (char)9
            };

            writer.WriteStartDocument(true);
            writer.WriteStartElement("mplayergui"); //<mplayer>
            writer.WriteAttributeString("version", "1");
            for (int i = 0; i < shareList.Items.Count; i++)
            {
                MPlayerShare temp = shareList.Items[i] as MPlayerShare;
                writer.WriteStartElement("Share"); //<Share>
                if (temp != null)
                {
                    writer.WriteAttributeString("name", temp.Name);
                    writer.WriteAttributeString("path", temp.Path);
                }
                writer.WriteEndElement(); //</Share>
            }
            writer.WriteEndElement();     //</mplayer>
            writer.WriteEndDocument();
            writer.Close();
            using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlWriter.SetValue("mplayer", "displayNameOfGUI",
                                   String.IsNullOrEmpty(pluginName.Text) ? "My MPlayer" : pluginName.Text);
                xmlWriter.SetValueAsBool("mplayer", "useMyMusicShares", myMusicShare.Checked);
                xmlWriter.SetValueAsBool("mplayer", "useMyVideoShares", myVideoShare.Checked);
                xmlWriter.SetValueAsBool("mplayer", "treatPlaylistAsFolders", playlistFolder.Checked);
                xmlWriter.SetValueAsBool("mplayer", "useDVDNAV", dvdNavCheckbox.Checked);
            }
        }
示例#18
0
 public void writeMPConfiguration(string sectionName, string entryName, string entryValue)
 {
     try
       {
     using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
       xmlwriter.SetValue(sectionName, entryName, entryValue);
     }
       }
       catch (Exception e)
       {
     //showError("Error writing MediaPortal.xml : " + e.Message, formStreamedMpEditor.errorCode.readError);
       }
       MediaPortal.Profile.Settings.SaveCache();
 }
示例#19
0
        /// <summary>
        /// Save the current configuration and close the window.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
                {
                    xmlwriter.SetValueAsBool("MyMovies", "chkRemoteWakeup", chkEnableRemoteWakeup.Checked);
                    xmlwriter.SetValue("MyMovies", "IPAddress",             GetIPAddress());
                    xmlwriter.SetValue("MyMovies", "MACAddress",            GetMacAddress());
                    xmlwriter.SetValue("MyMovies", "txtProgramDataPath",    txtProgramDataPath.Text);
                    xmlwriter.SetValue("MyMovies", "txtServerName",         txtServerName.Text);
                    xmlwriter.SetValue("MyMovies", "txtDBInstance",         txtDBInstance.Text);
                    xmlwriter.SetValue("MyMovies", "txtUserName",           txtUserName.Text);
                    xmlwriter.SetValue("MyMovies", "txtPassword",           txtPassword.Text);
                    xmlwriter.SetValue("MyMovies", "txtPINCode",            txtPINCode.Text);
                    xmlwriter.SetValue("MyMovies", "wakeupRetries",         numRetries.Value);
                    xmlwriter.SetValue("MyMovies", "wakeupRetryTimeout",    numRetryTimeout.Value);
                    xmlwriter.SetValue("MyMovies", "maximumViewableRating", numMaxRating.Value);
                    SaveDriveReplacement(xmlwriter);
                    SaveUsers(xmlwriter);
                }
            }
            catch (Exception ex)
            {
                Log.Error("Coniguration::btnOK_Click - Error saving the configuration");
                Log.Error(ex);
            }
            DialogResult = DialogResult.OK;

            this.Close();
        }
示例#20
0
 public override void WriteConfig()
 {
     try
     {
         using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
         {
             writer.SetValue("CecRemote", "HDMIPort", base.HdmiPort);
             writer.SetValue("CecRemote", "Type", base.DeviceType.ToString());
             writer.SetValue("CecRemote", "OsdName", base.OsdName);
             writer.SetValueAsBool("CecRemote", "FastScrolling", base.FastScrolling);
             writer.SetValue("CecRemote", "FastScrollingRepeatDelay", base.FastScrollingRepeatDelay);
             writer.SetValue("CecRemote", "FastScrollingRepeatRate", base.FastScrollingRepeatRate);
             writer.SetValueAsBool("CecRemote", "RequireDelayBetweenKeys", base.RequireDelayBetweenKeys);
             writer.SetValue("CecRemote", "DelayBetweenKeys", base.DelayBetweenKeys);
             writer.SetValueAsBool("CecRemote", "DisableScreensaver", base.DisableScreensaver);
             writer.SetValueAsBool("CecRemote", "ExtensiveLogging", base.ExtensiveLogging);
             writer.SetValueAsBool("CecRemote", "WakeDevicesOnStart", base.WakeDevicesOnStart);
             writer.SetValueAsBool("CecRemote", "ActivateSourceOnStart", base.ActivateSourceOnStart);
             writer.SetValue("CecRemote", "OnStartWakeDevices", DevicesToString(base.OnStartWakeDevices));
             writer.SetValueAsBool("CecRemote", "StandbyDevicesOnExit", base.StandbyDevicesOnExit);
             writer.SetValueAsBool("CecRemote", "InactivateSourceOnExit", base.InactivateSourceOnExit);
             writer.SetValue("CecRemote", "OnExitStandbyDevices", DevicesToString(base.OnExitStandbyDevices));
             writer.SetValueAsBool("CecRemote", "WakeDevicesOnResume", base.WakeDevicesOnResume);
             writer.SetValueAsBool("CecRemote", "ActivateSourceOnResume", base.ActivateSourceOnResume);
             writer.SetValueAsBool("CecRemote", "RequireUserInputOnResume", base.RequireUserInputOnResume);
             writer.SetValue("CecRemote", "OnResumeWakeDevices", DevicesToString(base.OnResumeWakeDevices));
             writer.SetValueAsBool("CecRemote", "StandbyDevicesOnSleep", base.StandbyDevicesOnSleep);
             writer.SetValueAsBool("CecRemote", "InactivateSourceOnSleep", base.InactivateSourceOnSleep);
             writer.SetValue("CecRemote", "OnSleepStandbyDevices", DevicesToString(base.OnSleepStandbyDevices));
             writer.SetValue("CecRemote", "ConnectedTo", base.ConnectedTo.ToString());
             writer.SetValueAsBool("CecRemote", "SendTvPowerOff", base.SendTvPowerOff);
             writer.SetValueAsBool("CecRemote", "SendTvPowerOffOnlyIfActiveSource", base.SendTvPowerOffOnlyIfActiveSource);
             writer.SetValueAsBool("CecRemote", "RequireActiveSourceWhenSleep", base.RequireActiveSourceWhenSleep);
             writer.SetValueAsBool("CecRemote", "ControlVolume", base.ControlVolume);
             writer.SetValueAsBool("CecRemote", "ForcePhysicalAddress", base.ForcePhysicalAddress);
             writer.SetValue("CecRemote", "PhysicalAddress", base.PhysicalAddress);
         }
     }
     catch (Exception ex)
     {
         Log.Error("CecRemote: Configuration write failed, settings not saved correctly! {0}", ex.ToString());
         throw;
     }
 }
示例#21
0
文件: settings.cs 项目: ncoH/Avalon
        public static void Save(string section)
        {
            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "Avalon.xml")))
            {
                switch (section)
                {
                    #region MovingPictures
                    case settings.cXMLSectionMovingPictures:
                        xmlwriter.SetValue(section, cXMLSettingMovingPicturesView, MovingPicturesConfig.IsDefaultStyle ? 1 : 0);
                        xmlwriter.SetValue(section, cXMLSettingMovingPicturesThumbMod, (int)MovingPicturesConfig.ThumbViewMod);
                        break;
                    #endregion

                    #region TV
                    case settings.cXMLSectionTV:
                        xmlwriter.SetValue(section, cXMLSettingTVMiniGuideSize, (int)TVConfig.TVMiniGuideRowSize);
                        xmlwriter.SetValue(section, cXMLSettingTVGuideSize, (int)TVConfig.TVGuideRowSize);
                        xmlwriter.SetValue(section, cXMLSettingTVHomeLayout, (int)TVConfig.TVHomeLayoutType);
                        break;
                    #endregion

                    #region TVSeries
                    case settings.cXMLSectionTVSeries:
                        xmlwriter.SetValue(section, cXMLSettingTVSeriesView, TVSeriesConfig.IsDefaultStyle ? 1 : 0);
                        xmlwriter.SetValue(section, cXMLSettingTVSeriesWidebannerMod, (int)TVSeriesConfig.widebannerMod);
                        break;
                    #endregion

                    #region Update
                    case settings.cXMLSectionUpdate:
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckOnStart, AvalonGUIConfig.checkOnStart ? 1 : 0);
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckForUpdateAt, AvalonGUIConfig.checkForUpdateAt ? 1 : 0);
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckInterval, AvalonGUIConfig.checkInterval);
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckTime, AvalonGUIConfig.checkTime.ToShortTimeString());
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdateNextUpdateCheck, AvalonGUIConfig.nextUpdateCheck);
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdateRunPatchUtilityUnattended, AvalonGUIConfig.patchUtilityRunUnattended ? 1 : 0);
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdatePatchUtilityRestartMP, AvalonGUIConfig.patchUtilityRestartMP ? 1 : 0);
                        xmlwriter.SetValue(section, settings.cXMLSettingUpdatePatchAppliedLastRun, AvalonGUIConfig.patchAppliedLastRun ? 1 : 0);
                        break;
                    #endregion

                    #region MyFilms
                    case settings.cXMLSectionMyFilms:
                        xmlwriter.SetValue(section, cXMLSettingMyFilmsView, MyFilmsConfig.IsDefaultStyle ? 1 : 0);
                        xmlwriter.SetValue(section, cXMLSettingMyFilmsThumbMod, (int)MyFilmsConfig.ThumbViewMod);
                        break;
                    #endregion

                    #region Misc
                    case settings.cXMLSectionMisc:
                        xmlwriter.SetValue(section, cXMLSettingMiscHidePoster, MiscConfigGUI.HidePoster ? 1 : 0);
                        xmlwriter.SetValue(section, cXMLSettingMiscShowRSS, MiscConfigGUI.showRSS ? 1 : 0);
                        xmlwriter.SetValue(section, cXMLSettingMiscShowHiddenMenu, MiscConfigGUI.showHiddenMenu ? 1 : 0);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscUnfocusedAlphaListItems, MiscConfigGUI.UnfocusedAlphaListItems);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscUnfocusedAlphaThumbs, MiscConfigGUI.UnfocusedAlphaThumbs);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscUseLargeFonts, MiscConfigGUI.UseLargeFonts ? 1 : 0);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscShow5DayWeather, MiscConfigGUI.showFiveDayWeather ? 1 : 0);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscTrailerSite, MiscConfigGUI.siteUtil);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscTextColor, MiscConfigGUI.TextColor);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscTextColor2, MiscConfigGUI.TextColor2);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscTextColor3, MiscConfigGUI.TextColor3);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscRemoteColor, MiscConfigGUI.RemoteColor);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscWatchedColor, MiscConfigGUI.WatchedColor);
                        xmlwriter.SetValue(section, settings.cXMLSettingMiscUseWeatherInfoservice, MiscConfigGUI.UseWeatherInfoservice ? 1 : 0);
                        break;
                    #endregion

                    #region Video
                    case settings.cXMLSectionVideo:
                        xmlwriter.SetValue(section, cXMLSettingVideoView, VideoConfig.IsDefaultStyle ? 1 : 0);
                        xmlwriter.SetValue(section, cXMLSettingVideoThumbMod, (int)VideoConfig.ThumbViewMod);
                        break;
                    #endregion
                }
            }
        }
示例#22
0
        public bool Save()
        {
            MediaPortal.Profile.Settings xml = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"));
            xml.SetValue("MyTorrents", "uTorrent.Server.IP", _settings["uTorrent.Server.IP"]);
            xml.SetValue("MyTorrents", "uTorrent.Server.Port", _settings["uTorrent.Server.Port"]);
            xml.SetValue("MyTorrents", "uTorrent.User", _settings["uTorrent.Username"]);
            xml.SetValue("MyTorrents", "uTorrent.Password", _settings["uTorrent.Password"]);
            xml.SetValue("MyTorrents", "Torrent.Notifications", _settings["Torrent.Notifications"]);
            xml.SetValue("MyTorrents", "Torrent.PluginName", _settings["Torrent.PluginName"]);
            xml.SetValue("MyTorrents", "uTorrent.Backend", _settings["uTorrent.Backend"]);
            xml.SetValue("MyTorrents", "Torrent.Timer.Inside", _settings["Torrent.Timer.Inside"]);
            xml.SetValue("MyTorrents", "Torrent.Timer.Outside", _settings["Torrent.Timer.Outside"]);
            xml.SetValue("MyTorrents", "TorrentView", _settings["TorrentView"]);
            xml.SetValue("MyTorrents", "SortOrder", _settings["SortOrder"]);

            return(true);
        }
示例#23
0
        public static void Save(string section)
        {
            smcLog.WriteLog(string.Format("StreamedMP: Settings.Save({0})", section), LogLevel.Info);
              using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "StreamedMPConfig.xml")))
              {
            switch (section)
            {
              #region Update
              case settings.cXMLSectionUpdate:
            xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckOnStart, StreamedMPConfig.checkOnStart ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckForUpdateAt, StreamedMPConfig.checkForUpdateAt ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckInterval, StreamedMPConfig.checkInterval);
            xmlwriter.SetValue(section, settings.cXMLSettingUpdateCheckTime, StreamedMPConfig.checkTime.ToShortTimeString());
            xmlwriter.SetValue(section, settings.cXMLSettingUpdateNextUpdateCheck, StreamedMPConfig.nextUpdateCheck);
            xmlwriter.SetValue(section, settings.cXMLSettingUpdateRunPatchUtilityUnattended, StreamedMPConfig.patchUtilityRunUnattended ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingUpdatePatchUtilityRestartMP, StreamedMPConfig.patchUtilityRestartMP ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingUpdatePatchAppliedLastRun, StreamedMPConfig.patchAppliedLastRun ? 1 : 0);
            break;
              #endregion

              #region Music
              case settings.cXMLSectionMusic:
            xmlwriter.SetValue(section, settings.cXMLSettingMusicCdCoverOnly, MusicOptionsGUI.cdCoverOnly ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMusicShowEqGraphic, MusicOptionsGUI.showEqGraphic ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingNowPlayingStyle, (int)MusicOptionsGUI.nowPlayingStyle);
            break;
              #endregion

              #region TVSeries
              case cXMLSectionTVSeries:
            xmlwriter.SetValue(section, settings.cXMLSettingTVSeriesDefaultStyle, TVSeriesConfig.IsDefaultStyle ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingTVSeriesWideBannerMod, (int)TVSeriesConfig.WideBannerMod);
            break;
              #endregion

              #region MovingPictures
              case cXMLSectionMovingPictures:
            xmlwriter.SetValue(section, settings.cXMLSettingMovingPicturesDefaultStyle, MovingPicturesConfig.IsDefaultStyle ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMovingPicturesThumbMod, (int)MovingPicturesConfig.ThumbnailMod);
            xmlwriter.SetValue(section, settings.cXMLSettingMovingPicturesTagline, MovingPicturesConfig.ShowMovPicsTaglineInDetails ? 1 : 0);
            break;
              #endregion

              #region TV
              case settings.cXMLSectionTV:
            xmlwriter.SetValue(section, settings.cXMLSettingTVGuideSize, (int)TVConfig.TVGuideRowSize);
            xmlwriter.SetValue(section, settings.cXMLSettingTVMiniGuideSize, (int)TVConfig.TVMiniGuideRowSize);
            xmlwriter.SetValue(section, settings.cXMLSettingTVEnableRandomTVSeriesFanart, TVConfig.EnableRandomTVSeriesFanart ? 1 : 0);
            break;
              #endregion

              #region Video
              case settings.cXMLSectionVideo:
            xmlwriter.SetValue(section, settings.cXMLSettingVideoFullVideoOSD, VideoOptionsGUI.FullVideoOSD ? 1 : 0);
            break;
              #endregion

              #region Misc
              case settings.cXMLSectionMisc:
            xmlwriter.SetValue(section, settings.cXMLSettingMiscShowHiddenMenuImage, MiscConfigGUI.ShowHiddenMenuImage ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscShowRoundedCovers, MiscConfigGUI.ShowRoundedImages ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscShowIconsInArtwork, MiscConfigGUI.ShowIconsInArtwork ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscShowTraktStyleIconsInArtwork, MiscConfigGUI.ShowTraktStyleIconsInArtwork ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscEnablePlayMostRecents, MiscConfigGUI.EnablePlayMostRecents ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscFilterWatchedInRecentlyAdded, MiscConfigGUI.FilterWatchedInRecentlyAdded ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscMostRecentFanartTimerInt, MiscConfigGUI.MostRecentFanartTimerInt);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscUnfocusedAlphaListItems, MiscConfigGUI.UnfocusedAlphaListItems);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscUnfocusedAlphaThumbs, MiscConfigGUI.UnfocusedAlphaThumbs);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscUseLargeFonts, MiscConfigGUI.UseLargeFonts ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscTextColor, MiscConfigGUI.TextColor);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscTextColor2, MiscConfigGUI.TextColor2);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscTextColor3, MiscConfigGUI.TextColor3);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscRemoteColor, MiscConfigGUI.RemoteColor);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscWatchedColor, MiscConfigGUI.WatchedColor);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscShowListScrollingPopup, MiscConfigGUI.ShowListScrollingPopup ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMiscTextualLogos, MiscConfigGUI.TextualLogos ? 1 : 0);
            xmlwriter.SetValue(section, settings.cXMLSettingMyVideoWatchedProgress, MiscConfigGUI.MyVideoWatchedProgress ? 1 : 0);
            break;
              #endregion

            }
            MediaPortal.Profile.Settings.SaveCache();
              }
        }
示例#24
0
        public void Save()
        {
            SaveEncryptedPassword();

            using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValueAsBool("radiotime", "mp3", Mp3);
                xmlwriter.SetValueAsBool("radiotime", "wma", Wma);
                xmlwriter.SetValueAsBool("radiotime", "real", Real);
                xmlwriter.SetValueAsBool("radiotime", "UseVideo", UseVideo);
                xmlwriter.SetValueAsBool("radiotime", "JumpNowPlaying", JumpNowPlaying);
                xmlwriter.SetValue("radiotime", "user", User);
                xmlwriter.SetValueAsBool("radiotime", "showpresets", ShowPresets);
                xmlwriter.SetValue("radiotime", "pluginname", PluginName);
                xmlwriter.SetValue("radiotime", "FolderId", FolderId);
                xmlwriter.SetValueAsBool("radiotime", "StartWithFastPreset", StartWithFastPreset);

                var s = "";
                foreach (var history in SearchHistory)
                {
                    s += history + "|";
                }
                xmlwriter.SetValue("radiotime", "searchHistory", s);

                s = "";
                foreach (var history in ArtistSearchHistory)
                {
                    s += history + "|";
                }
                xmlwriter.SetValue("radiotime", "artistSearchHistory", s);
            }
        }
示例#25
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         xmlWriter.SetValue("mplayer", "dvdArguments", dvdArguments.Text);
         xmlWriter.SetValue("mplayer", "vcdArguments", vcdArguments.Text);
         xmlWriter.SetValue("mplayer", "svcdArguments", svcdArguments.Text);
         xmlWriter.SetValue("mplayer", "cueArguments", cueArguments.Text);
         xmlWriter.SetValue("mplayer", "ftpArguments", ftpArguments.Text);
         xmlWriter.SetValue("mplayer", "httpArguments", httpArguments.Text);
         xmlWriter.SetValue("mplayer", "mmsArguments", mmsArguments.Text);
         xmlWriter.SetValue("mplayer", "mpstArguments", mpstArguments.Text);
         xmlWriter.SetValue("mplayer", "rtspArguments", rtspArguments.Text);
         xmlWriter.SetValue("mplayer", "sdpArguments", sdpArguments.Text);
         xmlWriter.SetValue("mplayer", "udpArguments", udpArguments.Text);
         xmlWriter.SetValue("mplayer", "unsvArguments", unsvArguments.Text);
     }
 }
        public void Save()
        {
            using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue("youtubevideos", "PluginName", PluginName);
                xmlwriter.SetValue("youtubevideos", "user", User);
                xmlwriter.SetValue("youtubevideos", "password", Password);
                xmlwriter.SetValue("youtubevideos", "StartUpOpt", StartUpOpt);
                xmlwriter.SetValue("youtubevideos", "VideoQuality", VideoQuality);
                xmlwriter.SetValue("youtubevideos", "DownloadFolder", DownloadFolder);
                xmlwriter.SetValue("youtubevideos", "FanartFolder", FanartDir);
                xmlwriter.SetValue("youtubevideos", "CacheDir", CacheDir);
                xmlwriter.SetValue("youtubevideos", "LastFmUser", LastFmUser);
                xmlwriter.SetValue("youtubevideos", "LastFmPass", LastFmPass);
                xmlwriter.SetValue("youtubevideos", "LayoutItem", LayoutItem);
                xmlwriter.SetValue("youtubevideos", "LayoutArtist", LayoutArtist);
                xmlwriter.SetValue("youtubevideos", "LayoutVideo", LayoutVideo);
                xmlwriter.SetValueAsBool("youtubevideos", "LastFmNowPlay", LastFmNowPlay);
                xmlwriter.SetValueAsBool("youtubevideos", "LastFmSubmit", LastFmSubmit);
                xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter);
                xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying);
                xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter);
                xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart);

                xmlwriter.SetValue("youtubevideos", "PortNumber", PortNumber);
                xmlwriter.SetValueAsBool("youtubevideos", "UseAsServer", this.UseAsServer);

                xmlwriter.SetValueAsBool("youtubevideos", "UseDefaultOSD", this.UseDefaultOSD);
                string his = "";
                foreach (string s in SearchHistory)
                {
                    his += s + "|";
                }
                xmlwriter.SetValue("youtubevideos", "searchhistory", his);
            }
            CreateFolders();
            this.LocalFile.Save();
            MainMenu.Save("youtubefmMenu.xml");
            MediaPortal.Profile.Settings.SaveCache();
        }
        public void Save()
        {
            using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
              {
            xmlwriter.SetValue("youtubevideos", "PluginName", PluginName);
            xmlwriter.SetValue("youtubevideos", "user", User);
            xmlwriter.SetValue("youtubevideos", "password", Password);
            xmlwriter.SetValue("youtubevideos", "StartUpOpt", StartUpOpt);
            xmlwriter.SetValue("youtubevideos", "VideoQuality", VideoQuality);
            xmlwriter.SetValue("youtubevideos", "DownloadFolder", DownloadFolder);
            xmlwriter.SetValue("youtubevideos", "FanartFolder", FanartDir);
            xmlwriter.SetValue("youtubevideos", "CacheDir", CacheDir);
            xmlwriter.SetValue("youtubevideos", "LastFmUser", LastFmUser);
            xmlwriter.SetValue("youtubevideos", "LastFmPass", LastFmPass);
            xmlwriter.SetValue("youtubevideos", "LayoutItem", LayoutItem);
            xmlwriter.SetValue("youtubevideos", "LayoutArtist", LayoutArtist);
            xmlwriter.SetValue("youtubevideos", "LayoutVideo", LayoutVideo);
            xmlwriter.SetValueAsBool("youtubevideos", "LastFmNowPlay", LastFmNowPlay);
            xmlwriter.SetValueAsBool("youtubevideos", "LastFmSubmit", LastFmSubmit);
            xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter);
            xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying);
            xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter);
            xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart);

            xmlwriter.SetValue("youtubevideos", "PortNumber", PortNumber);
            xmlwriter.SetValueAsBool("youtubevideos", "UseAsServer", this.UseAsServer);

            xmlwriter.SetValueAsBool("youtubevideos", "UseDefaultOSD", this.UseDefaultOSD);
            string his = "";
            foreach (string s in SearchHistory)
            {
              his += s + "|";
            }
            xmlwriter.SetValue("youtubevideos", "searchhistory", his);
              }
              CreateFolders();
              this.LocalFile.Save();
              MainMenu.Save("youtubefmMenu.xml");
              MediaPortal.Profile.Settings.SaveCache();
        }
 protected override void OnPageDestroy(int newWindowId)
 {
     m_iItemSelected = facadeView.SelectedListItemIndex;
       using (MediaPortal.Profile.Settings settings = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     settings.SetValueAsBool("youtubeplaylist", "repeat", playlistPlayer.RepeatPlaylist);
     settings.SetValueAsBool("youtubeplaylist", "ScrobblerOn", ScrobblerOn);
     settings.SetValue("youtubeplaylist", "ScrobblerMode", (int) currentScrobbleMode);
       }
       base.OnPageDestroy(newWindowId);
 }
示例#29
0
 public void Save()
 {
     using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         xmlwriter.SetValue("youtubevideos", "PluginName", this.PluginName);
         xmlwriter.SetValue("youtubevideos", "Region", this.Region);
         xmlwriter.SetValue("youtubevideos", "InitialDisplay", this.InitialDisplay);
         xmlwriter.SetValue("youtubevideos", "user", User);
         xmlwriter.SetValue("youtubevideos", "password", Password);
         xmlwriter.SetValue("youtubevideos", "InitialCat", this.InitialCat);
         xmlwriter.SetValue("youtubevideos", "InitialSearch", this.InitialSearch);
         xmlwriter.SetValue("youtubevideos", "VideoQuality", this.VideoQuality);
         xmlwriter.SetValue("youtubevideos", "InstantAction", (int)this.InstantAction);
         xmlwriter.SetValue("youtubevideos", "InstantCharInt", this.InstantChar);
         xmlwriter.SetValue("youtubevideos", "DownloadFolder", this.DownloadFolder);
         xmlwriter.SetValue("youtubevideos", "FanartFolder", this.FanartDir);
         xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter);
         xmlwriter.SetValueAsBool("youtubevideos", "time", this.Time);
         xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying);
         xmlwriter.SetValueAsBool("youtubevideos", "UseYouTubePlayer", this.UseYouTubePlayer);
         xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter);
         xmlwriter.SetValueAsBool("youtubevideos", "UseSMSStyleKeyBoard", this.UseSMSStyleKeyBoard);
         xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart);
         string his = "";
         foreach (string s in SearchHistory)
         {
             his += s + "|";
         }
         xmlwriter.SetValue("youtubevideos", "searchhistory", his);
     }
     this.LocalFile.Save();
 }
示例#30
0
 /// <summary>
 /// Stores the configuration with the shares
 /// </summary>
 public void SaveConfiguration()
 {
     shareList.SelectedIndex = -1;
       XmlTextWriter writer = new XmlTextWriter(Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml"),
                                        System.Text.Encoding.UTF8)
                        {Formatting = Formatting.Indented, Indentation = 1, IndentChar = (char)9};
       writer.WriteStartDocument(true);
       writer.WriteStartElement("mplayergui"); //<mplayer>
       writer.WriteAttributeString("version", "1");
       for (int i = 0; i < shareList.Items.Count; i++)
       {
     MPlayerShare temp = shareList.Items[i] as MPlayerShare;
     writer.WriteStartElement("Share"); //<Share>
     if (temp != null)
     {
       writer.WriteAttributeString("name", temp.Name);
       writer.WriteAttributeString("path", temp.Path);
     }
     writer.WriteEndElement(); //</Share>
       }
       writer.WriteEndElement(); //</mplayer>
       writer.WriteEndDocument();
       writer.Close();
       using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlWriter.SetValue("mplayer", "displayNameOfGUI",
                    String.IsNullOrEmpty(pluginName.Text) ? "My MPlayer" : pluginName.Text);
     xmlWriter.SetValueAsBool("mplayer", "useMyMusicShares", myMusicShare.Checked);
     xmlWriter.SetValueAsBool("mplayer", "useMyVideoShares", myVideoShare.Checked);
     xmlWriter.SetValueAsBool("mplayer", "treatPlaylistAsFolders", playlistFolder.Checked);
     xmlWriter.SetValueAsBool("mplayer", "useDVDNAV", dvdNavCheckbox.Checked);
       }
 }
示例#31
0
        public void Save()
        {
            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue("Anime3", "JMMServer_Address", JMMServer_Address.Trim());
                xmlwriter.SetValue("Anime3", "JMMServer_Port", JMMServer_Port.Trim());
                xmlwriter.SetValue("Anime3", "ImportFolderMappingsList", ImportFolderMappingsList.Trim());
                xmlwriter.SetValue("Anime3", "CurrentJMMUserID", CurrentJMMUserID);

                BaseConfig.MyAnimeLog.Write("ImportFolderMappingsList.Save: " + ImportFolderMappingsList);

                xmlwriter.SetValue("Anime3", "ThumbsFolder", thumbsFolder); // use the raw value
                xmlwriter.SetValue("Anime3", "PluginName", PluginName.Trim());

                xmlwriter.SetValue("Anime3", "BakaBTUsername", BakaBTUsername.Trim());
                xmlwriter.SetValue("Anime3", "BakaBTPassword", BakaBTPassword.Trim());

                xmlwriter.SetValue("Anime3", "AnimeBytesUsername", AnimeBytesUsername.Trim());
                xmlwriter.SetValue("Anime3", "AnimeBytesPassword", AnimeBytesPassword.Trim());

                xmlwriter.SetValue("Anime3", "UTorrentAddress", UTorrentAddress.Trim());
                xmlwriter.SetValue("Anime3", "UTorrentPassword", UTorrentPassword.Trim());
                xmlwriter.SetValue("Anime3", "UTorrentPort", UTorrentPort.Trim());
                xmlwriter.SetValue("Anime3", "UTorrentUsername", UTorrentUsername.Trim());

                // save the list of torrent sources
                string torList = "";
                foreach (string src in TorrentSources)
                {
                    if (torList.Length > 0)
                        torList += ";";

                    torList += src;
                }
                xmlwriter.SetValue("Anime3", "TorrentSources", torList);

                xmlwriter.SetValue("Anime3", "TorrentPreferOwnGroups", TorrentPreferOwnGroups ? "1" : "0");

                xmlwriter.SetValue("Anime3", "WatchedPercentage", WatchedPercentage.ToString());

                xmlwriter.SetValue("Anime3", "ShowMissing", ShowMissing ? "1" : "0");
                xmlwriter.SetValue("Anime3", "ShowMissingMyGroupsOnly", ShowMissingMyGroupsOnly ? "1" : "0");
                xmlwriter.SetValue("Anime3", "DisplayRatingDialogOnCompletion", DisplayRatingDialogOnCompletion ? "1" : "0");
                xmlwriter.SetValue("Anime3", "SingleSeriesGroups", SingleSeriesGroups ? "1" : "0");

                xmlwriter.SetValue("Anime3", "HideWatchedFiles", HideWatchedFiles ? "1" : "0");

                xmlwriter.SetValue("Anime3", "DefaultAudioLanguage", DefaultAudioLanguage);
                xmlwriter.SetValue("Anime3", "DefaultSubtitleLanguage", DefaultSubtitleLanguage);

                xmlwriter.SetValue("Anime3", "FindTimeout", FindTimeout_s);
                xmlwriter.SetValue("Anime3", "FindMode", (int)FindMode);
                xmlwriter.SetValue("Anime3", "FindStartWord", FindStartWord ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FindFilter", FindFilter ? "1" : "0");

                xmlwriter.SetValue("Anime3", "InfoDelay", InfoDelay.ToString());

                xmlwriter.SetValue("Anime3", "LastGroupViewMode", ((int)LastGroupViewMode).ToString());
                xmlwriter.SetValue("Anime3", "LastFanartViewMode", ((int)LastFanartViewMode).ToString());
                xmlwriter.SetValue("Anime3", "LastPosterViewMode", ((int)LastPosterViewMode).ToString());

                xmlwriter.SetValue("Anime3", "AniDBAutoEpisodesSubbed", AniDBAutoEpisodesSubbed ? "1" : "0");
                xmlwriter.SetValue("Anime3", "ShowOnlyAvailableEpisodes", ShowOnlyAvailableEpisodes ? "1" : "0");
                xmlwriter.SetValue("Anime3", "HidePlot", HidePlot ? "1" : "0");

                xmlwriter.SetValue("Anime3", "MenuDeleteFiles", MenuDeleteFiles ? "1" : "0");

                xmlwriter.SetValue("Anime3", "PosterSizePct", PosterSizePct.ToString());
                xmlwriter.SetValue("Anime3", "BannerSizePct", BannerSizePct.ToString());

                xmlwriter.SetValue("Anime3", "EpisodeDisplayFormat", EpisodeDisplayFormat);
                xmlwriter.SetValue("Anime3", "FileSelectionDisplayFormat", fileSelectionDisplayFormat);

                xmlwriter.SetValue("Anime3", "FfdshowNotificationsShow", FfdshowNotificationsShow ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsAutoClose", FfdshowNotificationsAutoClose ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsLock", FfdshowNotificationsLock ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsAutoCloseTime", ((int)FfdshowNotificationsAutoCloseTime).ToString());
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsLockTime", ((int)FfdshowNotificationsLockTime).ToString());

            }
        }
 public void Save()
 {
     using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlwriter.SetValue("youtubevideos", "PluginName", this.PluginName);
     xmlwriter.SetValue("youtubevideos", "Region", this.Region);
     xmlwriter.SetValue("youtubevideos", "InitialDisplay", this.InitialDisplay);
     xmlwriter.SetValue("youtubevideos", "user", User);
     xmlwriter.SetValue("youtubevideos", "password", Password);
     xmlwriter.SetValue("youtubevideos", "InitialCat", this.InitialCat);
     xmlwriter.SetValue("youtubevideos", "InitialSearch", this.InitialSearch);
     xmlwriter.SetValue("youtubevideos", "VideoQuality", this.VideoQuality);
     xmlwriter.SetValue("youtubevideos", "InstantAction", (int)this.InstantAction);
     xmlwriter.SetValue("youtubevideos", "InstantCharInt", this.InstantChar);
     xmlwriter.SetValue("youtubevideos", "DownloadFolder", this.DownloadFolder);
     xmlwriter.SetValue("youtubevideos", "FanartFolder", this.FanartDir);
     xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter);
     xmlwriter.SetValueAsBool("youtubevideos", "time", this.Time);
     xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying);
     xmlwriter.SetValueAsBool("youtubevideos", "UseYouTubePlayer", this.UseYouTubePlayer);
     xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter);
     xmlwriter.SetValueAsBool("youtubevideos", "UseSMSStyleKeyBoard", this.UseSMSStyleKeyBoard);
     xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart);
     string his = "";
     foreach (string s in SearchHistory)
     {
       his += s + "|";
     }
     xmlwriter.SetValue("youtubevideos", "searchhistory", his);
       }
       this.LocalFile.Save();
 }
示例#33
0
 private void SaveEncryptedPassword()
 {
     if (!string.IsNullOrEmpty(Password))
     {
         using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
         {
             xmlwriter.SetValue("radiotime", "encryptedPassword",
                 PasswordUtility.EncryptData(Password, DataProtectionScope.LocalMachine));
             xmlwriter.RemoveEntry("radiotime", "password");
         }
     }
 }
示例#34
0
    public void SaveSettings()
    {
        Log.Debug("[TVWishListMP]:Savesettings");
        try
        {
            using (var reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "TvWishListMP.xml")))
            {
                //reader.SetValue(SectionName, "TvwishlistFolder", TvwishlistFolder);
                reader.SetValue(SectionName, "TvWishItemSeparator", TvWishItemSeparator.ToString());
                reader.SetValue(SectionName, "Sort", GUI_List_window._sort.ToString());
                reader.SetValue(SectionName, "SortReverse", GUI_List_window._sortreverse.ToString());
                
                reader.SetValue(SectionName, "FilterEmailed", GUI_List_window._Email.ToString());
                reader.SetValue(SectionName, "FilterDeleted", GUI_List_window._Deleted.ToString());
                reader.SetValue(SectionName, "FilterConflicts", GUI_List_window._Conflicts.ToString());
                reader.SetValue(SectionName, "FilterScheduled", GUI_List_window._Scheduled.ToString());
                reader.SetValue(SectionName, "FilterRecorded", GUI_List_window._Recorded.ToString());
                reader.SetValue(SectionName, "FilterViewed", GUI_List_window._View.ToString());

                string defaultformats = "";
                for (int i = 0; i < (int)TvWishEntries.end; i++)
                {
                    defaultformats += myTvWishes.DefaultValues[i] + TvWishItemSeparator.ToString();
                    //Log.Debug("i=" + i.ToString() + "array_Eventformats[i]=" + array_Eventformats[i], (int)LogSetting.DEBUG);
                }
                defaultformats = defaultformats.Substring(0, defaultformats.Length - 1);
                Log.Debug("Save: defaultformats=" + defaultformats);
                reader.SetValue(SectionName, "DefaultFormats", defaultformats);     
            }
        }
        catch (Exception exc)
        {
            Log.Debug("Error SaveSettings: Exception " + exc.Message);
        }
    }
示例#35
0
 public override void WriteConfig()
 {
   try
   {
     using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
         writer.SetValue("CecRemote", "HDMIPort", base.HdmiPort);
         writer.SetValue("CecRemote", "Type", base.DeviceType.ToString() );
         writer.SetValue("CecRemote", "OsdName", base.OsdName);
         writer.SetValueAsBool("CecRemote", "FastScrolling", base.FastScrolling);
         writer.SetValue("CecRemote", "FastScrollingRepeatDelay", base.FastScrollingRepeatDelay);
         writer.SetValue("CecRemote", "FastScrollingRepeatRate", base.FastScrollingRepeatRate);
         writer.SetValueAsBool("CecRemote", "RequireDelayBetweenKeys", base.RequireDelayBetweenKeys);
         writer.SetValue("CecRemote", "DelayBetweenKeys", base.DelayBetweenKeys);
         writer.SetValueAsBool("CecRemote", "DisableScreensaver", base.DisableScreensaver);
         writer.SetValueAsBool("CecRemote", "ExtensiveLogging", base.ExtensiveLogging);
         writer.SetValueAsBool("CecRemote", "WakeDevicesOnStart", base.WakeDevicesOnStart);
         writer.SetValueAsBool("CecRemote", "ActivateSourceOnStart", base.ActivateSourceOnStart);
         writer.SetValue("CecRemote", "OnStartWakeDevices", DevicesToString(base.OnStartWakeDevices));
         writer.SetValueAsBool("CecRemote", "StandbyDevicesOnExit", base.StandbyDevicesOnExit);
         writer.SetValueAsBool("CecRemote", "InactivateSourceOnExit", base.InactivateSourceOnExit);
         writer.SetValue("CecRemote", "OnExitStandbyDevices", DevicesToString(base.OnExitStandbyDevices) );
         writer.SetValueAsBool("CecRemote", "WakeDevicesOnResume", base.WakeDevicesOnResume);
         writer.SetValueAsBool("CecRemote", "ActivateSourceOnResume", base.ActivateSourceOnResume);
         writer.SetValueAsBool("CecRemote", "RequireUserInputOnResume", base.RequireUserInputOnResume);
         writer.SetValue("CecRemote", "OnResumeWakeDevices", DevicesToString(base.OnResumeWakeDevices) );
         writer.SetValueAsBool("CecRemote", "StandbyDevicesOnSleep", base.StandbyDevicesOnSleep);
         writer.SetValueAsBool("CecRemote", "InactivateSourceOnSleep", base.InactivateSourceOnSleep);
         writer.SetValue("CecRemote", "OnSleepStandbyDevices", DevicesToString(base.OnSleepStandbyDevices) );
         writer.SetValue("CecRemote", "ConnectedTo", base.ConnectedTo.ToString());
         writer.SetValueAsBool("CecRemote", "SendTvPowerOff", base.SendTvPowerOff);
         writer.SetValueAsBool("CecRemote", "SendTvPowerOffOnlyIfActiveSource", base.SendTvPowerOffOnlyIfActiveSource);
         writer.SetValueAsBool("CecRemote", "RequireActiveSourceWhenSleep", base.RequireActiveSourceWhenSleep);
         writer.SetValueAsBool("CecRemote", "ControlVolume", base.ControlVolume);
         writer.SetValueAsBool("CecRemote", "ForcePhysicalAddress", base.ForcePhysicalAddress);
         writer.SetValue("CecRemote", "PhysicalAddress", base.PhysicalAddress);
       }
   }
   catch (Exception ex)
   {
       Log.Error("CecRemote: Configuration write failed, settings not saved correctly! {0}", ex.ToString());
       throw;
   }
 }
示例#36
0
        /// <summary>
        /// Save the settings to the MP config
        /// </summary>
        public static void Save()
        {
            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml"))) {
                // Encrypt the password
                string encryptedPassword = encryptString(password);

                xmlwriter.SetValue(Helper.PLUGIN_NAME, "username", username);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "server", server);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "password", encryptedPassword);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "resource", resource);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "autoConnectStartup", autoConnectStartup);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMessagePlugin", notifyOnMessagePlugin);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMessageGlobally", notifyOnMessageGlobally);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnStatusPlugin", notifyOnStatusPlugin);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnStatusGlobally", notifyOnStatusGlobally);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMoodPlugin", notifyOnMoodPlugin);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMoodGlobally", notifyOnMoodGlobally);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnActivityPlugin", notifyOnActivityPlugin);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnActivityGlobally", notifyOnActivityGlobally);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnTunePlugin", notifyOnTunePlugin);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnTuneGlobally", notifyOnTuneGlobally);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnErrorPlugin", notifyOnErrorPlugin);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnErrorGlobally", notifyOnErrorGlobally);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "selectStatusOnStartup", selectStatusOnStartup);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "notifyTimeOut", notifyTimeOut);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "autoIdleTimeOut", autoIdleTimeOut);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "autoIdleStatusType", (int)autoIdleStatusType);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "autoIdleStatusMessage", autoIdleStatusMessage);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultStatusType", (int)defaultStatusType);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultStatusMessage", defaultStatusMessage);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultMoodType", (int)defaultMoodType);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultMoodMessage", defaultMoodMessage);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultActivityType", (int)defaultActivityType);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultActivityMessage", defaultActivityMessage);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "notifyWindowType", (int)notifyWindowType);
                xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultKeyboardType", (int)defaultKeyboardType);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishTuneInfo", publishTuneInfo);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityMusic", publishActivityMusic);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityRadio", publishActivityRadio);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityMovie", publishActivityMovie);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityTV", publishActivityTV);
                xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityRecording", publishActivityRecording);
            }
        }
示例#37
0
        public void SaveSettings()
        {
            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(ConfigFileName()))
            {
                xmlwriter.SetValue(settingsSectionName, SampleInterval.Name, SampleInterval.Value);
                xmlwriter.SetValue(settingsSectionName, FolderRecursionDepth.Name, FolderRecursionDepth.Value);
                xmlwriter.SetValue(settingsSectionName, MaxNumFailures.Name, MaxNumFailures.Value);
                xmlwriter.SetValue(settingsSectionName, IgnoreHiddenFiles.Name, IgnoreHiddenFiles.Checked.ToString());
                xmlwriter.SetValue(settingsSectionName, IgnoreSystemFiles.Name, IgnoreSystemFiles.Checked.ToString());

                string s = "";
                foreach (string l in SharesToIgnore.Lines)
                    s = s + l + "|";
                s.TrimEnd('|');
                xmlwriter.SetValue(settingsSectionName, SharesToIgnore.Name, s);

                xmlwriter.SetValue(settingsSectionName, VideoMinFileSizeMB.Name, VideoMinFileSizeMB.Value);
                xmlwriter.SetValue(settingsSectionName, VideoMaxFileSizeMB.Name, VideoMaxFileSizeMB.Value);

                xmlwriter.SetValue(settingsSectionName, PictureMinFileSizeKB.Name, PictureMinFileSizeKB.Value);
                xmlwriter.SetValue(settingsSectionName, PictureMaxFileSizeKB.Name, PictureMaxFileSizeKB.Value);

                xmlwriter.SetValue(settingsSectionName, AudioMinFileSizeMB.Name, AudioMinFileSizeMB.Value);
                xmlwriter.SetValue(settingsSectionName, AudioMaxFileSizeMB.Name, AudioMaxFileSizeMB.Value);

            }
        }
        public void SaveSettings()
        {
            using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                string section = ConfigSection;

                xmlWriter.SetValue(section, PropNames.Extensions, Extensions);
                xmlWriter.SetValue(section, PropNames.SeekIncrement, SeekIncrement);
                xmlWriter.SetValueAsBool(section, PropNames.UseForCDDA, UseForCDDA);
                xmlWriter.SetValueAsBool(section, PropNames.UseForWebStream, UseForWebStream);
            }
        }
示例#39
0
        public void Save()
        {
            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue("Anime3", "JMMServer_Address", JMMServer_Address.Trim());
                xmlwriter.SetValue("Anime3", "JMMServer_Port", JMMServer_Port.Trim());
                xmlwriter.SetValue("Anime3", "ImportFolderMappingsList", ImportFolderMappingsList.Trim());
                xmlwriter.SetValue("Anime3", "CurrentJMMUserID", CurrentJMMUserID);

                BaseConfig.MyAnimeLog.Write("ImportFolderMappingsList.Save: " + ImportFolderMappingsList);

                xmlwriter.SetValue("Anime3", "ThumbsFolder", thumbsFolder);                 // use the raw value
                xmlwriter.SetValue("Anime3", "PluginName", PluginName.Trim());

                xmlwriter.SetValue("Anime3", "BakaBTUsername", BakaBTUsername.Trim());
                xmlwriter.SetValue("Anime3", "BakaBTPassword", BakaBTPassword.Trim());

                xmlwriter.SetValue("Anime3", "AnimeBytesUsername", AnimeBytesUsername.Trim());
                xmlwriter.SetValue("Anime3", "AnimeBytesPassword", AnimeBytesPassword.Trim());

                xmlwriter.SetValue("Anime3", "UTorrentAddress", UTorrentAddress.Trim());
                xmlwriter.SetValue("Anime3", "UTorrentPassword", UTorrentPassword.Trim());
                xmlwriter.SetValue("Anime3", "UTorrentPort", UTorrentPort.Trim());
                xmlwriter.SetValue("Anime3", "UTorrentUsername", UTorrentUsername.Trim());

                // save the list of torrent sources
                string torList = "";
                foreach (string src in TorrentSources)
                {
                    if (torList.Length > 0)
                    {
                        torList += ";";
                    }

                    torList += src;
                }
                xmlwriter.SetValue("Anime3", "TorrentSources", torList);

                xmlwriter.SetValue("Anime3", "TorrentPreferOwnGroups", TorrentPreferOwnGroups ? "1" : "0");

                xmlwriter.SetValue("Anime3", "WatchedPercentage", WatchedPercentage.ToString());

                xmlwriter.SetValue("Anime3", "ShowMissing", ShowMissing ? "1" : "0");
                xmlwriter.SetValue("Anime3", "ShowMissingMyGroupsOnly", ShowMissingMyGroupsOnly ? "1" : "0");
                xmlwriter.SetValue("Anime3", "DisplayRatingDialogOnCompletion", DisplayRatingDialogOnCompletion ? "1" : "0");
                xmlwriter.SetValue("Anime3", "SingleSeriesGroups", SingleSeriesGroups ? "1" : "0");

                xmlwriter.SetValue("Anime3", "HideWatchedFiles", HideWatchedFiles ? "1" : "0");

                xmlwriter.SetValue("Anime3", "DefaultAudioLanguage", DefaultAudioLanguage);
                xmlwriter.SetValue("Anime3", "DefaultSubtitleLanguage", DefaultSubtitleLanguage);

                xmlwriter.SetValue("Anime3", "FindTimeout", FindTimeout_s);
                xmlwriter.SetValue("Anime3", "FindMode", (int)FindMode);
                xmlwriter.SetValue("Anime3", "FindStartWord", FindStartWord ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FindFilter", FindFilter ? "1" : "0");

                xmlwriter.SetValue("Anime3", "InfoDelay", InfoDelay.ToString());

                xmlwriter.SetValue("Anime3", "LastGroupViewMode", ((int)LastGroupViewMode).ToString());
                xmlwriter.SetValue("Anime3", "LastFanartViewMode", ((int)LastFanartViewMode).ToString());
                xmlwriter.SetValue("Anime3", "LastPosterViewMode", ((int)LastPosterViewMode).ToString());

                xmlwriter.SetValue("Anime3", "AniDBAutoEpisodesSubbed", AniDBAutoEpisodesSubbed ? "1" : "0");
                xmlwriter.SetValue("Anime3", "ShowOnlyAvailableEpisodes", ShowOnlyAvailableEpisodes ? "1" : "0");
                xmlwriter.SetValue("Anime3", "HidePlot", HidePlot ? "1" : "0");

                xmlwriter.SetValue("Anime3", "MenuDeleteFiles", MenuDeleteFiles ? "1" : "0");

                xmlwriter.SetValue("Anime3", "PosterSizePct", PosterSizePct.ToString());
                xmlwriter.SetValue("Anime3", "BannerSizePct", BannerSizePct.ToString());

                xmlwriter.SetValue("Anime3", "EpisodeDisplayFormat", EpisodeDisplayFormat);
                xmlwriter.SetValue("Anime3", "FileSelectionDisplayFormat", fileSelectionDisplayFormat);

                xmlwriter.SetValue("Anime3", "FfdshowNotificationsShow", FfdshowNotificationsShow ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsAutoClose", FfdshowNotificationsAutoClose ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsLock", FfdshowNotificationsLock ? "1" : "0");
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsAutoCloseTime", ((int)FfdshowNotificationsAutoCloseTime).ToString());
                xmlwriter.SetValue("Anime3", "FfdshowNotificationsLockTime", ((int)FfdshowNotificationsLockTime).ToString());
            }
        }
示例#40
0
        /// <summary>
        /// Save current settings
        /// </summary>
        /// <param name="new_windowId"></param>
        protected override void OnPageDestroy(int new_windowId)
        {
            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue("MyMovies", "layout", (int)_currentLayout);
                xmlwriter.SetValue("MyMovies", "view", (int)_currentView);
                xmlwriter.SetValue("MyMovies", "sorting", (int)_currentSorting);
                xmlwriter.SetValueAsBool("MyMovies", "sortDirection", _sortAscending);
                xmlwriter.SetValue("MyMovies", "currentUser", CurrentUser);
            }
            btnSortBy.SortChanged -= new SortEventHandler(SortChanged);

            base.OnPageDestroy(new_windowId);
        }
示例#41
0
        public void SaveSettings()
        {
            try
            {
                using (var reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "TvWishListMP.xml")))
                {
                    reader.SetValue(SectionName, "checkBoxDebug", checkBoxDebug.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxAction", checkBoxAction.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxActive", checkBoxActive.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxAfterDays", checkBoxAfterDays.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxAfterTime", checkBoxAfterTime.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxBeforeDay", checkBoxBeforeDay.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxBeforeTime", checkBoxBeforeTime.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxChannel", checkBoxChannel.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxEpisodeName", checkBoxEpisodeName.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxEpisodeNumber", checkBoxEpisodeNumber.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxEpisodePart", checkBoxEpisodePart.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxExclude", checkBoxExclude.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxGroup", checkBoxGroup.Checked.ToString());
                    //reader.SetValue(SectionName, "checkBoxHits", checkBoxHits.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxKeepEpisodes", checkBoxKeepEpisodes.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxKeepUntil", checkBoxKeepUntil.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxMatchType", checkBoxMatchType.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxName", checkBoxName.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxPostrecord", checkBoxPostrecord.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxPrerecord", checkBoxPrerecord.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxPriority", checkBoxPriority.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxRecommendedCard", checkBoxRecommendedCard.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxRecordtype", checkBoxRecordtype.Checked.ToString());                    
                    reader.SetValue(SectionName, "checkBoxSkip", checkBoxSkip.Checked.ToString());                    
                    reader.SetValue(SectionName, "checkBoxSeriesNumber", checkBoxSeriesNumber.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxUseFolderNames", checkBoxUseFolderNames.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxWithinNextHours", checkBoxWithinNextHours.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxEpisodeCriteria", checkBoxEpisodeCriteria.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxPreferredGroup", checkBoxPreferredGroup.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxIncludeRecordings", checkBoxIncludeRecordings.Checked.ToString());
                    //modify for listview table changes

                    reader.SetValue(SectionName, "checkBoxDisableInfoWindow", checkBoxDisableInfoWindow.Checked.ToString());
                    reader.SetValue(SectionName, "checkBoxDisableQuickMenu", checkBoxDisableQuickMenu.Checked.ToString());
                    
                    reader.SetValue(SectionName, "radioButtonEasy", radioButtonEasy.Checked.ToString());
                    reader.SetValue(SectionName, "radioButtonExpert", radioButtonExpert.Checked.ToString());
                  
                    //reader.SetValue(SectionName, "TvwishlistFolder", filenametextBox.Text);

                    reader.SetValue(SectionName, "DateTimeFormat", textBoxDateTimeFormat.Text);
                    reader.SetValue(SectionName, "MainItemFormat", textBoxMainItemFormat.Text);
                    reader.SetValue(SectionName, "EmailMainFormat", textBoxEmailMainFormat.Text);
                    reader.SetValue(SectionName, "EmailResultsFormat", textBoxEmailResultsFormat.Text);
                    reader.SetValue(SectionName, "ResultsItemFormat", textBoxResultsItemFormat.Text);
                    reader.SetValue(SectionName, "ViewMainFormat", textBoxViewMainFormat.Text);
                    reader.SetValue(SectionName, "ViewResultsFormat", textBoxViewResultsFormat.Text);
                    try
                    {
                        int test = Convert.ToInt32(textBoxTimeOut.Text);
                    }
                    catch
                    {
                        textBoxTimeOut.Text = TimeOutDefault;
                    }
                    reader.SetValue(SectionName, "TimeOut", textBoxTimeOut.Text);

                    

                    string defaultformats = SaveDefaultFormatsToString();
                    
                    reader.SetValue(SectionName, "DefaultFormats", defaultformats);     //saving checked complete default user string              
                }
            }
            catch (Exception exc)
            {
                Log.Debug("[TVWishListMP] TvWishListSetup: Error SaveSettings: Exception " + exc.Message);
            }
        }
示例#42
0
 /// <summary>
 /// Stores the configuration of this section
 /// </summary>
 public void SaveConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlWriter.SetValue("mplayer", "soundOutputDriver", soundOutputDriver.SelectedIndex);
     xmlWriter.SetValue("mplayer", "soundOutputDevice", soundOutputDevice.SelectedIndex);
     xmlWriter.SetValue("mplayer", "audioChannels", audioChannels.SelectedIndex);
     xmlWriter.SetValue("mplayer", "audioDelayStep", audioDelayStep.Value);
     xmlWriter.SetValueAsBool("mplayer", "passthroughAC3DTS", passthroughAC3_DTS.Checked);
     xmlWriter.SetValueAsBool("mplayer", "audioNormalize", audioNormalize.Checked);
       }
 }