Inheritance: DatabaseTable
        public GUISettingsPane()
        {
            InitializeComponent();

            // if we are in designer, break to prevent errors with rendering, it cant access the DB...
            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                return;

            homeScreenTextBox.Setting = MovingPicturesCore.Settings["home_name"];
            watchedPercentTextBox.Setting = MovingPicturesCore.Settings["gui_watch_percentage"];
            remoteControlCheckBox.Setting = MovingPicturesCore.Settings["enable_rc_filter"];
            enableDeleteCheckBox.Setting = MovingPicturesCore.Settings["enable_delete_movie"];
            allowRescanInGuiCheckBox.Setting = MovingPicturesCore.Settings["gui_show_rescan_menuitem"];
            parentalControlsCheckBox.Setting = MovingPicturesCore.Settings["enable_parental_controls"];
            passwordTextBox.Setting = MovingPicturesCore.Settings["parental_controls_password"];
            categoriesCheckBox.Setting = MovingPicturesCore.Settings["enable_categories"];
            defaultFilterCheckBox.Setting = MovingPicturesCore.Settings["use_default_filter"];

            passwordTextBox.Enabled = parentalControlsCheckBox.Checked;
            parentalContolsButton.Enabled = parentalControlsCheckBox.Checked;
            defineCategoriesButton.Enabled = categoriesCheckBox.Checked;
            defaultFilterCombo.Enabled = defaultFilterCheckBox.Checked;

            sortFieldComboBox.Setting = MovingPicturesCore.Settings["default_sort_field"];
            sortFieldComboBox.EnumType = typeof(SortingFields);

            clickGoesToDetails = MovingPicturesCore.Settings["click_to_details"];
            dvdInsertedAction = MovingPicturesCore.Settings["on_disc_loaded"];
            defaultView = MovingPicturesCore.Settings["default_view"];

            // initialize filter combo to manage the default filter
            defaultFilterCombo.TreePanel.TranslationParser = new TranslationParserDelegate(Translation.ParseString);
            defaultFilterCombo.Menu = MovingPicturesCore.Settings.FilterMenu;
            defaultFilterCombo.SelectedNode = MovingPicturesCore.Settings.DefaultFilter;
        }
Exemple #2
0
 void Settings_SettingChanged(Cornerstone.Database.Tables.DBSetting setting, object oldValue)
 {
     if (setting.Key == "dataprovider_management")
     {
         updateGUI();
     }
 }
        public ImporterSettingsPane()
        {
            InitializeComponent();

            // if we are in designer, break to prevent errors with rendering, it cant access the DB...
            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                return;

            autoApproval = MovingPicturesCore.Settings["importer_autoapprove"];

            settingAutoApproveAlternateTitle.Setting = MovingPicturesCore.Settings["importer_autoapprove_alternate_titles"];
            settingAutoApproveAlternateTitle.IgnoreSettingName = true;

            preferFolderCheckBox.Setting = MovingPicturesCore.Settings["importer_prefer_foldername"];
            folderGroupingCheckBox.Setting = MovingPicturesCore.Settings["importer_groupfolder"];
            nfoExtTextBox.Setting = MovingPicturesCore.Settings["importer_nfoext"];

            nfoScannerCheckBox.Setting = MovingPicturesCore.Settings["importer_nfoscan"];
            nfoScannerCheckBox.IgnoreSettingName = true;

            nfoAutoApproveCheckBox.Setting = MovingPicturesCore.Settings["importer_autoimdb"];
            nfoAutoApproveCheckBox.IgnoreSettingName = true;

            coverFromMovieFolderCheckBox.Setting = MovingPicturesCore.Settings["local_cover_from_movie_folder"];
            coverFromMovieFolderCheckBox.IgnoreSettingName = true;
            coverPatternTextBox.Setting = MovingPicturesCore.Settings["local_moviefolder_coverart_pattern"];

            backdropFromMovieFolderCheckBox.Setting = MovingPicturesCore.Settings["local_backdrop_from_movie_folder"];
            backdropFromMovieFolderCheckBox.IgnoreSettingName = true;
            backdropPatternTextBox.Setting = MovingPicturesCore.Settings["local_moviefolder_backdrop_pattern"];

            coverCountTextBox.Setting = MovingPicturesCore.Settings["max_covers_per_movie"];

            autoRescanCheckBox.Setting = MovingPicturesCore.Settings["importer_rescan_enabled"];
            rescanIntervalTextBox.Setting = MovingPicturesCore.Settings["importer_rescan_interval"];

            MovingPicturesCore.Settings.SettingChanged += new Cornerstone.Database.SettingChangedDelegate(Settings_SettingChanged);
        }
        private void Settings_SettingChanged(DBSetting setting, object oldValue)
        {
            try {
                // Reinitializes the follwitAPI object when Username, Password, or URLBase changes.
                if (setting.Key == "socialurlbase" || setting.Key == "socialusername" || setting.Key == "socialpassword") {
                    Init();
                }

                // Recreate the timer if the timer setting changes
                if (setting.Key == "socialtasklisttimer") {
                    if (taskListTimer != null) taskListTimer.Dispose();
                    if (MovingPicturesCore.Settings.FollwitTaskListTimer > 0) {
                        taskListTimer = new Timer(taskListTimerCallback, null, 0, MovingPicturesCore.Settings.FollwitTaskListTimer * 60000);
                    }
                }
            }
            catch (Exception ex) {
                logger.ErrorException("", ex);
            }
        }
        // if the user single clicks on an item, show the value of that item
        private void advancedSettingsTreeView_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
        {
            TreeNode selectedNode = advancedSettingsTreeView.SelectedNode;
            // if the user selected a settings node
            if (selectedNode != null &&
                selectedNode.Tag != null &&
                selectedNode.Tag.GetType() == typeof(DBSetting))
            {

                setValueTextBox.Enabled = true;
                selectedSetting = (DBSetting)selectedNode.Tag;
                setValueTextBox.Text = selectedSetting.StringValue;
                setDescriptionLabel.Text = selectedSetting.Description;
                moreInfoLinkLabel.Visible = (selectedSetting.MoreInfoLink != null);
            }
            else {
                setValueTextBox.Enabled = false;
                setDescriptionLabel.Text = string.Empty;
                setValueTextBox.Text = String.Empty;
                moreInfoLinkLabel.Visible = false;
            }

            updateSettingButton.Enabled = false;
        }