Example #1
0
        public static ColorSelectorWindow Open(Rect rect, PreferencesWindow owner, Item item)
        {
            var window = CreateInstance <ColorSelectorWindow>();

            window.Init(rect, owner, item);
            return(window);
        }
Example #2
0
        public static bool WindowKey(Window sender, KeyEventArgs e)
        {
            if (e.KeyModifiers == ControlKey)
            {
                if (e.Key == Key.W)
                {
                    sender.Close();
                }
                else if (e.Key == Key.OemComma)
                {
                    PreferencesWindow.Create(sender);
                }
                else if (e.Key == Key.M)
                {
                    sender.WindowState = WindowState.Minimized;
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            return(true);
        }
        private void ToolsPreferences_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var preferencesWindow = new PreferencesWindow(_csManager);

            preferencesWindow.ShowDialog();
            e.Handled = true;
        }
Example #4
0
        public MainWindow()
        {
            InitializeComponent();

            DemoDbSettings settings        = ServiceLocator.GetRequiredService <DemoDbSettings>();
            var            dbConnectionStr = new DbConnectionString(settings.ConnectionString, settings.DbName);

            var tested = 0;

            if (tested == 0)
            {
                var histo = new SSMSPlusHistory.UI.HistoryControl();
                Panel.Children.Add(histo);
            }
            else if (tested == 1)
            {
                var search = new SSMSPlusSearch.UI.SchemaSearchControl();
                search.Initialize(dbConnectionStr);
                Panel.Children.Add(search);
            }
            else if (tested == 2)
            {
                var docs = new SSMSPlusDocument.UI.ExportDocumentsControl();
                docs.Initialize(dbConnectionStr);
                Panel.Children.Add(docs);
            }
            else if (tested == 3)
            {
                var ui = new PreferencesWindow();
                ui.ShowAndActivate();
            }
        }
        // OVERRIDERS: ----------------------------------------------------------------------------

        protected override GUIContent[] GetVariables(int allowTypesMask)
        {
            DatabaseVariables database = DatabaseVariables.Load();

            if (database == null || database.GetGlobalVariables() == null)
            {
                PreferencesWindow.OpenWindowTab("Variables");
                return(new GUIContent[0]);
            }

            GlobalVariables   globalVariables = database.GetGlobalVariables();
            List <GUIContent> variables       = new List <GUIContent>();

            for (int i = 0; i < globalVariables.references.Length; ++i)
            {
                Variable.DataType type = (Variable.DataType)globalVariables.references[i].variable.type;
                if ((allowTypesMask & 1 << (int)type) == 0)
                {
                    continue;
                }

                variables.Add(new GUIContent(
                                  " " + globalVariables.references[i].variable.name,
                                  VariableEditorUtils.GetIcon(type)
                                  ));
            }

            return(variables.ToArray());
        }
    public static void InitPreferenceWindow()
    {
        currentPreferenceWindow = (PreferencesWindow)EditorWindow.GetWindow<PreferencesWindow>();
        currentPreferenceWindow.title = "Preferences";

        CreateView();
    }
Example #7
0
        private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PreferencesWindow pref = new PreferencesWindow();

            DisableEditing();
            pref.Show(this);
        }
Example #8
0
 public static void Main(string[] args)
 {
     Application.Init ();
       PreferencesWindow win = new PreferencesWindow();
       win.Show ();
       Application.Run ();
 }
Example #9
0
        private void ShowPreferencesAction()
        {
            var preferencesWindow = new PreferencesWindow();

            preferencesWindow.ShowDialog();

            MainWindow.CurrentWindow.RegistHotKey();
        }
Example #10
0
        public static void Main(string[] args)
        {
            Application.Init();
            PreferencesWindow win = new PreferencesWindow();

            win.Show();
            Application.Run();
        }
Example #11
0
        private void Init(Rect rect, PreferencesWindow owner, Item item)
        {
            var size = (Vector2)kCount * kCellSize;

            ShowAsDropDown(rect, size);
            _owner = owner;
            _item  = item;
        }
Example #12
0
 private void PreferencesMenuItem_Click(object sender, EventArgs e)
 {
     PreferencesWindow = new PreferencesWindow
     {
         StartPosition = FormStartPosition.CenterScreen
     };
     PreferencesWindow.Show();
 }
Example #13
0
        public static void ShowPreferencesWindow()
        {
            var preferencesWindow = new PreferencesWindow();

            preferencesWindow.Show();
            // FIXME: Make this a dialog...
            // preferencesWindow.Exec();
        }
Example #14
0
 static WindowManager()
 {
     NotepadWindows = new List <NotepadWindow>();
     WindowPreviews = new WindowManagerView();
     PropertiesView = new FilePropertiesWindow();
     ClipboardWin   = new ClipboardWindow();
     Preferences    = new PreferencesWindow();
     Help           = new HelpWindow();
 }
Example #15
0
        private void ExecuteFromMenu(object sender, EventArgs e)
        {
            if (_window == null)
            {
                _window = new PreferencesWindow();
            }

            _window.ShowAndActivate();
        }
        private void PadView_OpeningPreferences()
        {
            if (preferencesWindow == null)
            {
                preferencesWindow            = new PreferencesWindow(log);
                preferencesWindow.Destroyed += HandleConsoleWindowDestroyed;
            }

            preferencesWindow.ShowAll();
        }
        protected void OnPreferencesClicked(object sender, EventArgs e)
        {
            if (preferencesWindow == null)
            {
                preferencesWindow            = new PreferencesWindow(log);
                preferencesWindow.Destroyed += HandleConsoleWindowDestroyed;
            }

            preferencesWindow.ShowAll();
        }
 private static void CreateView()
 {
     if (currentPreferenceWindow != null)
     {
         currentPreferenceWindow.currentPreferenceView = new NodePreferenceView();
     }
     else
     {
         currentPreferenceWindow = (PreferencesWindow)EditorWindow.GetWindow<PreferencesWindow>();
     }
 }
Example #19
0
        protected void PaintFooter()
        {
            GUILayout.BeginVertical(CoreGUIStyles.GetSearchBox());

            if (GUILayout.Button(TITLE_MANAGE))
            {
                PreferencesWindow.OpenWindowTab("Photon Network");
                this.editorWindow.Close();
            }

            GUILayout.EndVertical();
        }
        protected override void PaintFooter()
        {
            GUILayout.BeginVertical(CoreGUIStyles.GetSearchBox());

            if (GUILayout.Button(TITLE_MANAGE_VARIABLES))
            {
                PreferencesWindow.OpenWindowTab("Variables");
                this.editorWindow.Close();
            }

            GUILayout.EndVertical();
        }
Example #21
0
        public override void OnInspectorGUI()
        {
            EditorGUILayout.HelpBox(
                "This Item can only be edited in the Inventory section of the Preferences window",
                MessageType.Info
                );

            if (GUILayout.Button("Open Preferences"))
            {
                PreferencesWindow.OpenWindow();
            }
        }
Example #22
0
        private void ShowPreferencesWindowMessageReceived(ShowPreferencesWindowMessage message)
        {
            this.DelayBetweenCalls_HardwareDynamic = message.UpdatePreferencesMessage.DelayBetweenCalls_HardwareDynamic;
            this.DelayBetweenCalls_WindowsProcess  = message.UpdatePreferencesMessage.DelayBetweenCalls_WindowsProcess;
            this.DelayBetweenCalls_WindowsService  = message.UpdatePreferencesMessage.DelayBetweenCalls_WindowsService;
            this.DynamicHardwareLogs_Include       = message.UpdatePreferencesMessage.DynamicHardwareLogs_Include;
            this.DynamicHardwareLogs_Path          = message.UpdatePreferencesMessage.DynamicHardwareLogs_Path;

            this.preferencesWindow             = new PreferencesWindow();
            this.preferencesWindow.DataContext = this;
            this.preferencesWindow.ShowDialog();
            this.preferencesWindow.Focus();
        }
Example #23
0
 void on_preferences_delete_event(object o, DeleteEventArgs args)
 {
     //do not hide/exit if copyiing
     if (thread != null && thread.IsAlive)
     {
         args.RetVal = true;
     }
     else
     {
         PreferencesWindowBox.preferences_win.Hide();
         PreferencesWindowBox = null;
     }
 }
Example #24
0
        // PAINT METHODS: -------------------------------------------------------------------------

        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Rect labelRect = new Rect(
                position.x,
                position.y,
                EditorGUIUtility.labelWidth,
                position.height
                );

            Rect fieldRectQst = new Rect(
                labelRect.x + labelRect.width,
                position.y,
                position.width - labelRect.width - QUEST_BTN_W + 1f,
                position.height
                );

            Rect fieldRectBtn = new Rect(
                fieldRectQst.x + fieldRectQst.width,
                position.y,
                QUEST_BTN_W,
                position.height
                );

            IQuest quest       = null;
            string displayName = "(none)";

            if (property.objectReferenceValue != null)
            {
                quest       = (IQuest)property.objectReferenceValue;
                displayName = quest.internalName;
            }

            EditorGUI.LabelField(labelRect, label);

            this.InitilizeStyles();

            GUIStyle style = this.isDragDrop ? this.styleQuestActive : this.styleQuestNormal;

            if (GUI.Button(fieldRectQst, displayName, style))
            {
                SceneView.focusedWindow.ShowNotification(NOTIF_DRAG);
            }

            if (GUI.Button(fieldRectBtn, "Quests", EditorStyles.miniButtonRight))
            {
                PreferencesWindow.OpenWindowTab("Quests");
            }

            this.DropQuest(fieldRectQst, property);
        }
 /// <summary>
 /// Executes when the preferences setting is clicked
 /// </summary>
 /// <param name="sender"> Event sender </param>
 /// <param name="e">Event args</param>
 private void Preferences_MouseDown(object sender, MouseButtonEventArgs e)
 {
     // In case preference window is not running
     if (!PreferencesWindow.IsRunning)
     {
         var window = new PreferencesWindow();
         window.Show();
         System.Windows.Threading.Dispatcher.Run();
     }
     // In case preference window is already running
     else
     {
         PreferencesWindow.CurrentRunningWindow.Focus();
     }
 }
Example #26
0
        public override void OnInspectorGUI()
        {
            if (target == null || serializedObject == null)
            {
                return;
            }
            EditorGUILayout.HelpBox(
                "This Item can only be edited in the Inventory section of the Preferences window",
                MessageType.Info
                );

            if (GUILayout.Button("Open Preferences"))
            {
                PreferencesWindow.OpenWindow();
            }
        }
Example #27
0
        private void ShowPreferences()
        {
            var          prefsWindow = new PreferencesWindow(m_Preferences);
            DialogResult dr          = prefsWindow.ShowDialog();

            switch (dr)
            {
            case DialogResult.OK:
            {
                var fileSaver = new SettingsFileSaver();
                m_Preferences.CloneValues(prefsWindow.ActivePreferences);
                m_Preferences.SaveSettings(PREFS_FILENAME, fileSaver);
                break;
            }
            }
        }
Example #28
0
        private void OpenPreferencesView()
        {
            PreferencesWindow    view  = new PreferencesWindow();
            PreferencesViewModel model = new PreferencesViewModel(((App)Application.Current).Preferences);

            model.CloseRequired += delegate
            {
                view.Close();
            };
            model.Committed += delegate
            {
                Preferences = model;
            };

            view.DataContext = model;
            view.ShowDialog();
        }
Example #29
0
        private void DoShowPreferences()
        {
            var vm = new PreferencesWindowViewModel(_gameConfiguration);
            var pw = new PreferencesWindow {
                DataContext = vm
            };

            vm.ShouldClose += (sender, save) =>
            {
                if (save)
                {
                    _configuration.Save(ConfigurationSaveMode.Full);
                    Initialize();
                }
                pw.Close();
            };
            pw.ShowDialog();
        }
Example #30
0
        public void ShowPreferences()
        {
            Vanish();
            Reset();

            if (PreferencesWindow == null)
            {
                PreferencesWindow         = new PreferencesWindow();
                PreferencesWindow.Hidden += delegate {
                    // Release the window.
                    PreferencesWindow.Dispose();
                    PreferencesWindow.Destroy();
                    PreferencesWindow = null;
                    // Reload universe.
                    Do.UniverseManager.Reload();
                };
            }
            if (Gtk.Grab.Current != null)
            {
                Gtk.Grab.Remove(Gtk.Grab.Current);
            }
            PreferencesWindow.Show();
        }
Example #31
0
 private void OpenPreferences()
 {
     _preferencesWindow = PreferencesWindow.Open(this);
 }
Example #32
0
 void on_preferences_delete_event(object o, DeleteEventArgs args)
 {
     //do not hide/exit if copyiing
     if (thread != null && thread.IsAlive)
         args.RetVal = true;
     else {
         PreferencesWindowBox.preferences_win.Hide();
         PreferencesWindowBox = null;
     }
 }
Example #33
0
    public static PreferencesWindow Show(Preferences preferences, Constants.Menuitem_modes menu_mode)
    {
        if (PreferencesWindowBox == null) {
            PreferencesWindowBox = new PreferencesWindow ();
        }

        if(menu_mode !=	Constants.Menuitem_modes.JUMPSSIMPLE && menu_mode != Constants.Menuitem_modes.JUMPSREACTIVE)
            PreferencesWindowBox.notebook.GetNthPage(1).Hide();
        if(menu_mode !=	Constants.Menuitem_modes.RUNSSIMPLE && menu_mode != Constants.Menuitem_modes.RUNSINTERVALLIC)
            PreferencesWindowBox.notebook.GetNthPage(2).Hide();
        if(menu_mode !=	Constants.Menuitem_modes.POWERGRAVITATORY && menu_mode != Constants.Menuitem_modes.POWERINERTIAL) {
            PreferencesWindowBox.notebook.GetNthPage(3).Hide();
            PreferencesWindowBox.notebook.GetNthPage(4).Hide();
        }

        PreferencesWindowBox.preferences = preferences;

        PreferencesWindowBox.createComboLanguage();

        //multimedia tab
        if(preferences.volumeOn)
            PreferencesWindowBox.checkbutton_volume.Active = true;
        else
            PreferencesWindowBox.checkbutton_volume.Active = false;

        PreferencesWindowBox.createComboCamera(UtilVideo.GetVideoDevices(), preferences.videoDeviceNum);

        string [] decs = {"1", "2", "3"};
        PreferencesWindowBox.combo_decimals.Active = UtilGtk.ComboMakeActive(
                decs, preferences.digitsNumber.ToString());

        if(preferences.showPower)
            PreferencesWindowBox.checkbutton_power.Active = true;
        else
            PreferencesWindowBox.checkbutton_power.Active = false;

        if(preferences.showStiffness)
            PreferencesWindowBox.checkbutton_stiffness.Active = true;
        else
            PreferencesWindowBox.checkbutton_stiffness.Active = false;

        if(preferences.showInitialSpeed)
            PreferencesWindowBox.checkbutton_initial_speed.Active = true;
        else
            PreferencesWindowBox.checkbutton_initial_speed.Active = false;

        if(preferences.showAngle)
            PreferencesWindowBox.checkbutton_angle.Active = true;
        else
            PreferencesWindowBox.checkbutton_angle.Active = false;

        if(preferences.showQIndex || preferences.showDjIndex) {
            PreferencesWindowBox.checkbutton_show_tv_tc_index.Active = true;
            if(preferences.showQIndex) {
                PreferencesWindowBox.radiobutton_show_q_index.Active = true;
                PreferencesWindowBox.radiobutton_show_dj_index.Active = false;
            } else {
                PreferencesWindowBox.radiobutton_show_q_index.Active = false;
                PreferencesWindowBox.radiobutton_show_dj_index.Active = true;
            }
        }
        else {
            PreferencesWindowBox.checkbutton_show_tv_tc_index.Active = false;
            PreferencesWindowBox.hbox_indexes.Hide();
        }

        if(preferences.askDeletion)
            PreferencesWindowBox.checkbutton_ask_deletion.Active = true;
        else
            PreferencesWindowBox.checkbutton_ask_deletion.Active = false;

        if(preferences.weightStatsPercent)
            PreferencesWindowBox.radio_weight_percent.Active = true;
        else
            PreferencesWindowBox.radio_weight_kg.Active = true;

        if(preferences.heightPreferred)
            PreferencesWindowBox.radio_elevation_height.Active = true;
        else
            PreferencesWindowBox.radio_elevation_tf.Active = true;

        if(preferences.metersSecondsPreferred)
            PreferencesWindowBox.radio_speed_ms.Active = true;
        else
            PreferencesWindowBox.radio_speed_km.Active = true;

        if(preferences.runSpeedStartArrival)
            PreferencesWindowBox.radio_runs_speed_start_arrival.Active = true;
        else
            PreferencesWindowBox.radio_runs_speed_start_leaving.Active = true;

        //start of double contacts stuff ----
        PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active =
            (preferences.runDoubleContactsMode != Constants.DoubleContact.NONE);
        PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active =
            (preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE);

        PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value =
            preferences.runDoubleContactsMS;
        PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value =
            preferences.runIDoubleContactsMS;

        if(preferences.runDoubleContactsMode != Constants.DoubleContact.NONE) {
            if(preferences.runDoubleContactsMode == Constants.DoubleContact.FIRST)
                PreferencesWindowBox.radio_runs_prevent_double_contact_first.Active = true;
            else if(preferences.runDoubleContactsMode == Constants.DoubleContact.AVERAGE)
                PreferencesWindowBox.radio_runs_prevent_double_contact_average.Active = true;
            else // Constants.DoubleContact.LAST  DEFAULT
                PreferencesWindowBox.radio_runs_prevent_double_contact_last.Active = true;
        }
        if(preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE) {
            if(preferences.runIDoubleContactsMode == Constants.DoubleContact.FIRST)
                PreferencesWindowBox.radio_runs_i_prevent_double_contact_first.Active = true;
            else if(preferences.runIDoubleContactsMode == Constants.DoubleContact.LAST)
                PreferencesWindowBox.radio_runs_i_prevent_double_contact_last.Active = true;
            else //Constants.DoubleContact.AVERAGE  DEFAULT
                PreferencesWindowBox.radio_runs_i_prevent_double_contact_average.Active = true;
        }
        //---- end of double contacts stuff

        if(preferences.CSVExportDecimalSeparator == "COMMA")
            PreferencesWindowBox.radio_export_latin.Active = true;
        else
            PreferencesWindowBox.radio_export_non_latin.Active = true;

        //encoder capture -->
        PreferencesWindowBox.spin_encoder_capture_time.Value = preferences.encoderCaptureTime;
        PreferencesWindowBox.spin_encoder_capture_inactivity_end_time.Value = preferences.encoderCaptureInactivityEndTime;

        PreferencesWindowBox.createComboEncoderCaptureMainVariable(
                Constants.GetEncoderVariablesCapture(preferences.encoderCaptureMainVariable));

        PreferencesWindowBox.spin_encoder_capture_min_height_gravitatory.Value = preferences.encoderCaptureMinHeightGravitatory;
        PreferencesWindowBox.spin_encoder_capture_min_height_inertial.Value = preferences.encoderCaptureMinHeightInertial;
        PreferencesWindowBox.checkbutton_encoder_capture_fully_extended.Active = preferences.encoderCaptureCheckFullyExtended;
        PreferencesWindowBox.spin_encoder_capture_fully_extended.Value = preferences.encoderCaptureCheckFullyExtendedValue;
        PreferencesWindowBox.hbox_encoder_capture_fully_extended.Visible = preferences.encoderCaptureCheckFullyExtended;

        if(preferences.encoderAutoSaveCurve == Constants.EncoderAutoSaveCurve.BEST)
            PreferencesWindowBox.radio_encoder_auto_save_curve_best.Active = true;
        else if(preferences.encoderAutoSaveCurve == Constants.EncoderAutoSaveCurve.FROM4TOPENULTIMATE)
            PreferencesWindowBox.radio_encoder_auto_save_curve_4top.Active = true;
        else if(preferences.encoderAutoSaveCurve == Constants.EncoderAutoSaveCurve.ALL)
            PreferencesWindowBox.radio_encoder_auto_save_curve_all.Active = true;
        else
            PreferencesWindowBox.radio_encoder_auto_save_curve_none.Active = true;

        PreferencesWindowBox.check_show_start_and_duration.Active = preferences.encoderShowStartAndDuration;

        //encoder other -->
        PreferencesWindowBox.checkbutton_encoder_propulsive.Active = preferences.encoderPropulsive;

        PreferencesWindowBox.spin_encoder_smooth_con.Value = preferences.encoderSmoothCon;

        if(preferences.encoder1RMMethod == Constants.Encoder1RMMethod.NONWEIGHTED)
            PreferencesWindowBox.radio_encoder_1RM_nonweighted.Active = true;
        else if(preferences.encoder1RMMethod == Constants.Encoder1RMMethod.WEIGHTED)
            PreferencesWindowBox.radio_encoder_1RM_weighted.Active = true;
        else if(preferences.encoder1RMMethod == Constants.Encoder1RMMethod.WEIGHTED2)
            PreferencesWindowBox.radio_encoder_1RM_weighted2.Active = true;
        else //(preferences.encoder1RMMethod == Constants.Encoder1RMMethod.WEIGHTED3)
            PreferencesWindowBox.radio_encoder_1RM_weighted3.Active = true;

        //done here and not in glade to be shown with the decimal point of user language
        PreferencesWindowBox.label_encoder_con.Text = (0.7).ToString();

        //language -->
        if(preferences.language == "")
            PreferencesWindowBox.radio_language_detected.Active = true;
        else
            PreferencesWindowBox.radio_language_force.Active = true;

        if(preferences.RGraphsTranslate)
            PreferencesWindowBox.radio_graphs_translate.Active = true;
        else
            PreferencesWindowBox.radio_graphs_no_translate.Active = true;

        //allow signal to be called
        PreferencesWindowBox.hbox_language_signalOn = true;

        if(preferences.useHeightsOnJumpIndexes)
            PreferencesWindowBox.radio_use_heights_on_jump_indexes.Active = true;
        else
            PreferencesWindowBox.radio_do_not_use_heights_on_jump_indexes.Active = true;

        PreferencesWindowBox.preferences_win.Show ();
        return PreferencesWindowBox;
    }
Example #34
0
    //change stuff in Sqlite and in preferences object that will be retrieved by GetPreferences
    void on_button_accept_clicked(object o, EventArgs args)
    {
        Sqlite.Open();

        if( preferences.digitsNumber != Convert.ToInt32(UtilGtk.ComboGetActive(combo_decimals)) ) {
            SqlitePreferences.Update("digitsNumber", UtilGtk.ComboGetActive(combo_decimals), true);
            preferences.digitsNumber = Convert.ToInt32(UtilGtk.ComboGetActive(combo_decimals));
        }

        if( preferences.showPower != PreferencesWindowBox.checkbutton_power.Active ) {
            SqlitePreferences.Update("showPower", PreferencesWindowBox.checkbutton_power.Active.ToString(), true);
            preferences.showPower = PreferencesWindowBox.checkbutton_power.Active;
        }

        if( preferences.showStiffness != PreferencesWindowBox.checkbutton_stiffness.Active ) {
            SqlitePreferences.Update("showStiffness", PreferencesWindowBox.checkbutton_stiffness.Active.ToString(), true);
            preferences.showStiffness = PreferencesWindowBox.checkbutton_stiffness.Active;
        }

        if( preferences.showInitialSpeed != PreferencesWindowBox.checkbutton_initial_speed.Active ) {
            SqlitePreferences.Update("showInitialSpeed", PreferencesWindowBox.checkbutton_initial_speed.Active.ToString(), true);
            preferences.showInitialSpeed = PreferencesWindowBox.checkbutton_initial_speed.Active;
        }

        if( preferences.showAngle != PreferencesWindowBox.checkbutton_angle.Active ) {
            SqlitePreferences.Update("showAngle", PreferencesWindowBox.checkbutton_angle.Active.ToString(), true);
            preferences.showAngle = PreferencesWindowBox.checkbutton_angle.Active;
        }

        if(PreferencesWindowBox.checkbutton_show_tv_tc_index.Active) {
            SqlitePreferences.Update("showQIndex", PreferencesWindowBox.radiobutton_show_q_index.Active.ToString(), true);
            SqlitePreferences.Update("showDjIndex", PreferencesWindowBox.radiobutton_show_dj_index.Active.ToString(), true);
            preferences.showQIndex = PreferencesWindowBox.radiobutton_show_q_index.Active;
            preferences.showDjIndex = PreferencesWindowBox.radiobutton_show_dj_index.Active;
        } else {
            SqlitePreferences.Update("showQIndex", "False", true);
            SqlitePreferences.Update("showDjIndex", "False", true);
            preferences.showQIndex = false;
            preferences.showDjIndex = false;
        }

        if( preferences.askDeletion != PreferencesWindowBox.checkbutton_ask_deletion.Active ) {
            SqlitePreferences.Update("askDeletion", PreferencesWindowBox.checkbutton_ask_deletion.Active.ToString(), true);
            preferences.askDeletion = PreferencesWindowBox.checkbutton_ask_deletion.Active;
        }

        if( preferences.weightStatsPercent != PreferencesWindowBox.radio_weight_percent.Active ) {
            SqlitePreferences.Update("weightStatsPercent", PreferencesWindowBox.radio_weight_percent.Active.ToString(), true);
            preferences.weightStatsPercent = PreferencesWindowBox.radio_weight_percent.Active;
        }

        if( preferences.heightPreferred != PreferencesWindowBox.radio_elevation_height.Active ) {
            SqlitePreferences.Update("heightPreferred", PreferencesWindowBox.radio_elevation_height.Active.ToString(), true);
            preferences.heightPreferred = PreferencesWindowBox.radio_elevation_height.Active;
        }

        if( preferences.metersSecondsPreferred != PreferencesWindowBox.radio_speed_ms.Active ) {
            SqlitePreferences.Update("metersSecondsPreferred", PreferencesWindowBox.radio_speed_ms.Active.ToString(), true);
            preferences.metersSecondsPreferred = PreferencesWindowBox.radio_speed_ms.Active;
        }

        if( preferences.runSpeedStartArrival != PreferencesWindowBox.radio_runs_speed_start_arrival.Active ) {
            SqlitePreferences.Update("runSpeedStartArrival", PreferencesWindowBox.radio_runs_speed_start_arrival.Active.ToString(), true);
            preferences.runSpeedStartArrival = PreferencesWindowBox.radio_runs_speed_start_arrival.Active;
        }

        //start of double contacts stuff ----

        //1 simple runs ----

        //1.1 was FIRST or AVERAGE or LAST and now will be NONE
        if( (preferences.runDoubleContactsMode != Constants.DoubleContact.NONE) &&
                ! PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active)
        {
                SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.NONE.ToString(), true);
                preferences.runDoubleContactsMode = Constants.DoubleContact.NONE;
        }
        else if(PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active)
        {
            //1.2 mode has changed between FIRST, AVERAGE or LAST
            if( PreferencesWindowBox.radio_runs_prevent_double_contact_first.Active &&
                    (preferences.runDoubleContactsMode != Constants.DoubleContact.FIRST) ) {
                SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.FIRST.ToString(), true);
                preferences.runDoubleContactsMode = Constants.DoubleContact.FIRST;
            }
            else if( PreferencesWindowBox.radio_runs_prevent_double_contact_average.Active &&
                    (preferences.runDoubleContactsMode != Constants.DoubleContact.AVERAGE) ) {
                SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.AVERAGE.ToString(), true);
                preferences.runDoubleContactsMode = Constants.DoubleContact.AVERAGE;
            }
            else if( PreferencesWindowBox.radio_runs_prevent_double_contact_last.Active &&
                    (preferences.runDoubleContactsMode != Constants.DoubleContact.LAST) ) {
                SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.LAST.ToString(), true);
                preferences.runDoubleContactsMode = Constants.DoubleContact.LAST;
            }

            if(preferences.runDoubleContactsMS != (int) PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value) {
                SqlitePreferences.Update("runDoubleContactsMS",
                        PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value.ToString(), true); //saved as string
                preferences.runDoubleContactsMS = (int) spinbutton_runs_prevent_double_contact.Value;
            }
        }

        //2 intervallic runs ----

        //2.1 was FIRST or AVERAGE or LAST and now will be NONE
        if( (preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE) &&
                ! PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active)
        {
                SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.NONE.ToString(), true);
                preferences.runIDoubleContactsMode = Constants.DoubleContact.NONE;
        }
        else if(PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active)
        {
            //2.2 mode has changed between FIRST, AVERAGE or LAST
            if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_first.Active &&
                    (preferences.runIDoubleContactsMode != Constants.DoubleContact.FIRST) ) {
                SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.FIRST.ToString(), true);
                preferences.runIDoubleContactsMode = Constants.DoubleContact.FIRST;
            }
            else if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_average.Active &&
                    (preferences.runIDoubleContactsMode != Constants.DoubleContact.AVERAGE) ) {
                SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.AVERAGE.ToString(), true);
                preferences.runIDoubleContactsMode = Constants.DoubleContact.AVERAGE;
            }
            else if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_last.Active &&
                    (preferences.runIDoubleContactsMode != Constants.DoubleContact.LAST) ) {
                SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.LAST.ToString(), true);
                preferences.runIDoubleContactsMode = Constants.DoubleContact.LAST;
            }

            if(preferences.runIDoubleContactsMS != (int) PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value) {
                SqlitePreferences.Update("runIDoubleContactsMS",
                        PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value.ToString(), true); //saved as string
                preferences.runIDoubleContactsMS = (int) spinbutton_runs_i_prevent_double_contact.Value;
            }
        }

        //---- end of double contacts stuff

        //encoder capture ----

        preferences.encoderCaptureTime = preferencesChange(
                "encoderCaptureTime",
                preferences.encoderCaptureTime,
                (int) PreferencesWindowBox.spin_encoder_capture_time.Value);

        preferences.encoderCaptureInactivityEndTime = preferencesChange(
                "encoderCaptureInactivityEndTime",
                preferences.encoderCaptureInactivityEndTime,
                (int) PreferencesWindowBox.spin_encoder_capture_inactivity_end_time.Value);

        Constants.EncoderVariablesCapture mainVariable = Constants.SetEncoderVariablesCapture(
                UtilGtk.ComboGetActive(PreferencesWindowBox.combo_main_variable));
        if( preferences.encoderCaptureMainVariable != mainVariable ) {
            SqlitePreferences.Update("encoderCaptureMainVariable", mainVariable.ToString(), true);
            preferences.encoderCaptureMainVariable = mainVariable;
        }

        preferences.encoderCaptureMinHeightGravitatory = preferencesChange(
                "encoderCaptureMinHeightGravitatory",
                preferences.encoderCaptureMinHeightGravitatory,
                (int) PreferencesWindowBox.spin_encoder_capture_min_height_gravitatory.Value);

        preferences.encoderCaptureMinHeightInertial = preferencesChange(
                "encoderCaptureMinHeightInertial",
                preferences.encoderCaptureMinHeightInertial,
                (int) PreferencesWindowBox.spin_encoder_capture_min_height_inertial.Value);

        preferences.encoderCaptureCheckFullyExtended = preferencesChange(
                "encoderCaptureCheckFullyExtended",
                preferences.encoderCaptureCheckFullyExtended,
                PreferencesWindowBox.checkbutton_encoder_capture_fully_extended.Active);

        preferences.encoderCaptureCheckFullyExtendedValue = preferencesChange(
                "encoderCaptureCheckFullyExtendedValue",
                preferences.encoderCaptureCheckFullyExtendedValue,
                (int) PreferencesWindowBox.spin_encoder_capture_fully_extended.Value);

        if(PreferencesWindowBox.radio_encoder_auto_save_curve_best.Active) {
            SqlitePreferences.Update("encoderAutoSaveCurve", Constants.EncoderAutoSaveCurve.BEST.ToString(), true);
            preferences.encoderAutoSaveCurve = Constants.EncoderAutoSaveCurve.BEST;
        }
        else if(PreferencesWindowBox.radio_encoder_auto_save_curve_4top.Active) {
            SqlitePreferences.Update("encoderAutoSaveCurve", Constants.EncoderAutoSaveCurve.FROM4TOPENULTIMATE.ToString(), true);
            preferences.encoderAutoSaveCurve = Constants.EncoderAutoSaveCurve.FROM4TOPENULTIMATE;
        }
        else if(PreferencesWindowBox.radio_encoder_auto_save_curve_all.Active) {
            SqlitePreferences.Update("encoderAutoSaveCurve", Constants.EncoderAutoSaveCurve.ALL.ToString(), true);
            preferences.encoderAutoSaveCurve = Constants.EncoderAutoSaveCurve.ALL;
        }
        else {
            SqlitePreferences.Update("encoderAutoSaveCurve", Constants.EncoderAutoSaveCurve.NONE.ToString(), true);
            preferences.encoderAutoSaveCurve = Constants.EncoderAutoSaveCurve.NONE;
        }

        preferences.encoderShowStartAndDuration = preferencesChange(
                "encoderShowStartAndDuration",
                preferences.encoderShowStartAndDuration,
                PreferencesWindowBox.check_show_start_and_duration.Active);

        //---- end of encoder capture

        //encoder other ----

        preferences.encoderPropulsive = preferencesChange(
                "encoderPropulsive",
                preferences.encoderPropulsive,
                PreferencesWindowBox.checkbutton_encoder_propulsive.Active);

        preferences.encoderSmoothCon = preferencesChange(
                "encoderSmoothCon",
                preferences.encoderSmoothCon,
                (double) PreferencesWindowBox.spin_encoder_smooth_con.Value);

        Constants.Encoder1RMMethod encoder1RMMethod;
        if(PreferencesWindowBox.radio_encoder_1RM_nonweighted.Active)
            encoder1RMMethod = Constants.Encoder1RMMethod.NONWEIGHTED;
        else if(PreferencesWindowBox.radio_encoder_1RM_weighted.Active)
            encoder1RMMethod = Constants.Encoder1RMMethod.WEIGHTED;
        else if(PreferencesWindowBox.radio_encoder_1RM_weighted2.Active)
            encoder1RMMethod = Constants.Encoder1RMMethod.WEIGHTED2;
        else // (PreferencesWindowBox.radio_encoder_1RM_weighted3.Active)
            encoder1RMMethod = Constants.Encoder1RMMethod.WEIGHTED3;

        SqlitePreferences.Update("encoder1RMMethod", encoder1RMMethod.ToString(), true);
        preferences.encoder1RMMethod = encoder1RMMethod;

        //---- end of encoder other

        //multimedia ----
        if( preferences.volumeOn != PreferencesWindowBox.checkbutton_volume.Active ) {
            SqlitePreferences.Update("volumeOn", PreferencesWindowBox.checkbutton_volume.Active.ToString(), true);
            preferences.volumeOn = PreferencesWindowBox.checkbutton_volume.Active;
        }

        if( preferences.videoDeviceNum != UtilGtk.ComboGetActivePos(combo_camera) ) {
            SqlitePreferences.Update("videoDevice", UtilGtk.ComboGetActivePos(combo_camera).ToString(), true);
            preferences.videoDeviceNum = UtilGtk.ComboGetActivePos(combo_camera);
        }

        if(PreferencesWindowBox.radio_export_latin.Active) {
            SqlitePreferences.Update("CSVExportDecimalSeparator","COMMA", true);
            preferences.CSVExportDecimalSeparator = "COMMA";
        }
        else {
            SqlitePreferences.Update("CSVExportDecimalSeparator","POINT", true);
            preferences.CSVExportDecimalSeparator = "POINT";
        }

        string selectedLanguage = getSelectedLanguage();

        //if there was a language on SQL but now "detected" is selected, put "" in language on SQL
        if(preferences.language != "" && radio_language_detected.Active) {
            SqlitePreferences.Update("language", "", true);
            preferences.language = "";
        }
        //if force a language, and SQL language is != than selected language, change language on SQL
        else if(radio_language_force.Active && preferences.language != selectedLanguage) {
            SqlitePreferences.Update("language", selectedLanguage, true);
            preferences.language = selectedLanguage;
        }

        if( preferences.RGraphsTranslate != PreferencesWindowBox.radio_graphs_translate.Active ) {
            SqlitePreferences.Update("RGraphsTranslate",
                    PreferencesWindowBox.radio_graphs_translate.Active.ToString(), true);
            preferences.RGraphsTranslate = PreferencesWindowBox.radio_graphs_translate.Active;
        }

        if( preferences.useHeightsOnJumpIndexes != PreferencesWindowBox.radio_use_heights_on_jump_indexes.Active ) {
            SqlitePreferences.Update("useHeightsOnJumpIndexes",
                    PreferencesWindowBox.radio_use_heights_on_jump_indexes.Active.ToString(), true);
            preferences.useHeightsOnJumpIndexes = PreferencesWindowBox.radio_use_heights_on_jump_indexes.Active;
        }

        Sqlite.Close();

        PreferencesWindowBox.preferences_win.Hide();
        PreferencesWindowBox = null;
    }
Example #35
0
    private void on_preferences_activate(object o, EventArgs args)
    {
        preferencesWin = PreferencesWindow.Show(preferences, getMenuItemMode());

        preferencesWin.FakeButtonImported.Clicked += new EventHandler(on_preferences_import_configuration);
        preferencesWin.FakeButtonDebugModeStart.Clicked += new EventHandler(on_preferences_debug_mode_start);
        preferencesWin.Button_accept.Clicked += new EventHandler(on_preferences_accepted);
    }
Example #36
0
    public static PreferencesWindow Show(int digitsNumber, bool showHeight, bool showPower,  
        bool showInitialSpeed, bool showAngle, bool showQIndex, bool showDjIndex,
        bool askDeletion, bool weightStatsPercent, bool heightPreferred, bool metersSecondsPreferred,
        string language, bool allowFinishRjAfterTime, bool volumeOn, bool videoOn)
    {
        if (PreferencesWindowBox == null) {
            PreferencesWindowBox = new PreferencesWindow ();
        }

        //PreferencesWindowBox.languageIni = language;
        //if(Util.IsWindows())
        //	PreferencesWindowBox.createComboLanguage(language);
        //else
            PreferencesWindowBox.hideLanguageStuff();

        string [] decs = {"1", "2", "3"};
        PreferencesWindowBox.combo_decimals.Active = UtilGtk.ComboMakeActive(decs, digitsNumber.ToString());

        if(allowFinishRjAfterTime)
            PreferencesWindowBox.checkbutton_allow_finish_rj_after_time.Active = true;
        else
            PreferencesWindowBox.checkbutton_allow_finish_rj_after_time.Active = false;

        if(showHeight)
            PreferencesWindowBox.checkbutton_height.Active = true;
        else
            PreferencesWindowBox.checkbutton_height.Active = false;

        if(showPower) {
            PreferencesWindowBox.checkbutton_power.Active = true;
            PreferencesWindowBox.textview_power.Show();
        } else {
            PreferencesWindowBox.checkbutton_power.Active = false;
            PreferencesWindowBox.textview_power.Hide();
        }

        if(showInitialSpeed)
            PreferencesWindowBox.checkbutton_initial_speed.Active = true;
        else
            PreferencesWindowBox.checkbutton_initial_speed.Active = false;

        if(showAngle)
            PreferencesWindowBox.checkbutton_angle.Active = true;
        else
            PreferencesWindowBox.checkbutton_angle.Active = false;

        if(showQIndex || showDjIndex) {
            PreferencesWindowBox.checkbutton_show_tv_tc_index.Active = true;
            if(showQIndex) {
                PreferencesWindowBox.radiobutton_show_q_index.Active = true;
                PreferencesWindowBox.radiobutton_show_dj_index.Active = false;
            } else {
                PreferencesWindowBox.radiobutton_show_q_index.Active = false;
                PreferencesWindowBox.radiobutton_show_dj_index.Active = true;
            }
        }
        else {
            PreferencesWindowBox.checkbutton_show_tv_tc_index.Active = false;
            PreferencesWindowBox.hbox_indexes.Hide();
        }

        if(askDeletion)
            PreferencesWindowBox.checkbutton_ask_deletion.Active = true;
        else
            PreferencesWindowBox.checkbutton_ask_deletion.Active = false;

        if(weightStatsPercent)
            PreferencesWindowBox.radio_weight_percent.Active = true;
        else
            PreferencesWindowBox.radio_weight_kg.Active = true;

        if(heightPreferred)
            PreferencesWindowBox.radio_elevation_height.Active = true;
        else
            PreferencesWindowBox.radio_elevation_tf.Active = true;

        if(metersSecondsPreferred)
            PreferencesWindowBox.radio_speed_ms.Active = true;
        else
            PreferencesWindowBox.radio_speed_km.Active = true;

        UtilGtk.ColorsCheck(PreferencesWindowBox.checkbutton_volume);
        PreferencesWindowBox.checkbutton_volume.Active = volumeOn;
        PreferencesWindowBox.on_checkbutton_volume_clicked(new object(), new EventArgs());

        UtilGtk.ColorsCheck(PreferencesWindowBox.checkbutton_video);
        PreferencesWindowBox.checkbutton_video.Active = videoOn;
        PreferencesWindowBox.on_checkbutton_video_clicked(new object(), new EventArgs());

        PreferencesWindowBox.preferences.Show ();
        return PreferencesWindowBox;
    }
Example #37
0
    void on_button_accept_clicked(object o, EventArgs args)
    {
        /* the falses are for the dbcon that is not opened */
        SqlitePreferences.Update("digitsNumber", UtilGtk.ComboGetActive(combo_decimals), false);
        SqlitePreferences.Update("showHeight", PreferencesWindowBox.checkbutton_height.Active.ToString(), false);
        SqlitePreferences.Update("showPower", PreferencesWindowBox.checkbutton_power.Active.ToString(), false);
        SqlitePreferences.Update("showInitialSpeed", PreferencesWindowBox.checkbutton_initial_speed.Active.ToString(), false);
        SqlitePreferences.Update("showAngle", PreferencesWindowBox.checkbutton_angle.Active.ToString(), false);
        SqlitePreferences.Update("allowFinishRjAfterTime", PreferencesWindowBox.checkbutton_allow_finish_rj_after_time.Active.ToString(), false);

        if(PreferencesWindowBox.checkbutton_show_tv_tc_index.Active) {
            SqlitePreferences.Update("showQIndex", PreferencesWindowBox.radiobutton_show_q_index.Active.ToString(), false);
            SqlitePreferences.Update("showDjIndex", PreferencesWindowBox.radiobutton_show_dj_index.Active.ToString(), false);
        } else {
            SqlitePreferences.Update("showQIndex", "False", false);
            SqlitePreferences.Update("showDjIndex", "False", false);
        }

        SqlitePreferences.Update("askDeletion", PreferencesWindowBox.checkbutton_ask_deletion.Active.ToString(), false);
        SqlitePreferences.Update("weightStatsPercent", PreferencesWindowBox.radio_weight_percent.Active.ToString(), false);
        SqlitePreferences.Update("heightPreferred", PreferencesWindowBox.radio_elevation_height.Active.ToString(), false);
        SqlitePreferences.Update("metersSecondsPreferred", PreferencesWindowBox.radio_speed_ms.Active.ToString(), false);

        /*
        if(Util.IsWindows()) {
            //if language has changed
            if(UtilGtk.ComboGetActive(PreferencesWindowBox.combo_language) != languageIni) {
                string myLanguage = SqlitePreferences.Select("language");
                if ( myLanguage != null && myLanguage != "" && myLanguage != "0") {
                    //if language exists in sqlite preferences update it
                    SqlitePreferences.Update("language", Util.GetLanguageCodeFromName(UtilGtk.ComboGetActive(PreferencesWindowBox.combo_language)));
                } else {
                    //else: create it
                    SqlitePreferences.Insert("language", Util.GetLanguageCodeFromName(UtilGtk.ComboGetActive(PreferencesWindowBox.combo_language)));
                }

                new DialogMessage(Catalog.GetString("Restart Chronojump to operate completely on your language."), true);
            }
        }
        */

        PreferencesWindowBox.preferences.Hide();
        PreferencesWindowBox = null;
    }
Example #38
0
 public static void OpenSettings()
 {
     PreferencesWindow.Init();
 }
Example #39
0
 void on_button_cancel_clicked(object o, EventArgs args)
 {
     PreferencesWindowBox.preferences.Hide();
     PreferencesWindowBox = null;
 }
 void HandleConsoleWindowDestroyed(object sender, EventArgs e)
 {
     preferencesWindow.Destroyed -= HandleConsoleWindowDestroyed;
     preferencesWindow            = null;
 }
Example #41
0
 void on_preferences_delete_event(object o, DeleteEventArgs args)
 {
     PreferencesWindowBox.preferences.Hide();
     PreferencesWindowBox = null;
 }
        private void MainWindowController_Load(object sender, EventArgs e)
        {
            troubleBox.BackColor = Color.FromArgb(239, 226, 121);
            contentPanel.Location = defaultContentPosition;

            loadStatusIcons();

            Toggl.OnApp += OnApp;
            Toggl.OnError += OnError;
            Toggl.OnLogin += OnLogin;
            Toggl.OnTimeEntryList += OnTimeEntryList;
            Toggl.OnTimeEntryEditor += OnTimeEntryEditor;
            Toggl.OnOnlineState += OnOnlineState;
            Toggl.OnReminder += OnReminder;
            Toggl.OnURL += OnURL;
            Toggl.OnRunningTimerState += OnRunningTimerState;
            Toggl.OnStoppedTimerState += OnStoppedTimerState;
            Toggl.OnSettings += OnSettings;
            Toggl.OnIdleNotification += OnIdleNotification;

            loginViewController = new LoginViewController();
            timeEntryListViewController = new TimeEntryListViewController();
            timeEntryEditViewController = new WPF.TimeEntryEditViewController();

            aboutWindowController = new AboutWindowController();
            preferencesWindowController = new PreferencesWindow();
            feedbackWindowController = new FeedbackWindowController();
            idleNotificationWindowController = new IdleNotificationWindowController();

            initEditForm();
            timeEntryListViewController.SetEditPopup(timeEntryEditViewController);
            editForm.Owner = aboutWindowController.Owner = feedbackWindowController.Owner = this;

            var windowInteropHelper = new WindowInteropHelper(this.preferencesWindowController);
            windowInteropHelper.Owner = this.Handle;
            ElementHost.EnableModelessKeyboardInterop(this.preferencesWindowController);

            if (!Toggl.StartUI(TogglDesktop.Program.Version()))
            {
            try
            {
                DisableTop();
                MessageBox.Show("Missing callback. See the log file for details");
            } finally {
                EnableTop();
            }
            TogglDesktop.Program.Shutdown(1);
            }

            Utils.LoadWindowLocation(this, editForm);

            setCorrectMinimumSize();

            aboutWindowController.initAndCheck();

            runScriptTimer = new Timer();
            runScriptTimer.Interval = 1000;
            runScriptTimer.Tick += runScriptTimer_Tick;
            runScriptTimer.Start();
        }