private void onTVSelectionChanged(object o, EventArgs args) { string selectedName = getSelectedName(); if (selectedName == "") { return; } List <EncoderConfigurationSQLObject> list = SqliteEncoderConfiguration.Select(false, encoderGI, selectedName); if (list != null && list.Count == 1) { EncoderConfigurationSQLObject econfSO = list[0]; entry_save_name.Text = econfSO.name; entry_save_description.Text = econfSO.description; //mark all as unactive SqliteEncoderConfiguration.MarkAllAsUnactive(false, encoderGI); econfSO.active = true; //mark this as active SqliteEncoderConfiguration.Update(false, encoderGI, selectedName, econfSO); EncoderConfigurationWindowBox.updateGUIFromEncoderConfiguration(econfSO.encoderConfiguration); } }
void on_button_new_clicked(object o, EventArgs args) { string selectedName = getSelectedName(); if (selectedName == "") { return; } List <EncoderConfigurationSQLObject> list = SqliteEncoderConfiguration.Select(false, encoderGI, selectedName); if (list != null && list.Count == 1) { EncoderConfigurationSQLObject econfSO = list[0]; econfSO.uniqueID = -1; //to be entered as null and not repeat the uniqueID //add a suffix econfSO.name += "_" + Catalog.GetString("copy"); //add more suffixes until name is unique econfSO.name = SqliteEncoderConfiguration.IfNameExistsAddSuffix(econfSO.name, Catalog.GetString("copy")); SqliteEncoderConfiguration.MarkAllAsUnactive(false, encoderGI); econfSO.active = true; SqliteEncoderConfiguration.Insert(false, econfSO); store.AppendValues(new string[] { econfSO.name, econfSO.description }); UtilGtk.TreeviewSelectRowWithName(treeview_select, store, colName, econfSO.name, true); } }
static public EncoderConfigurationWindow View( Constants.EncoderGI encoderGI, EncoderConfigurationSQLObject econfSO, string anchorage_str, int extraWeightN) { if (EncoderConfigurationWindowBox == null) { EncoderConfigurationWindowBox = new EncoderConfigurationWindow(); } EncoderConfigurationWindowBox.encoderGI = encoderGI; EncoderConfigurationWindowBox.updateGUIFromEncoderConfiguration(econfSO.encoderConfiguration); EncoderConfigurationWindowBox.main_gui_anchorage_str = anchorage_str; EncoderConfigurationWindowBox.main_gui_extraWeightN = extraWeightN; EncoderConfigurationWindowBox.createTreeView(); EncoderConfigurationWindowBox.fillTreeView( SqliteEncoderConfiguration.Select(false, encoderGI, ""), //all econfSO); //A) side is hidden at start to ensure scr_treeview_select is scrolled and displays correctly the last row EncoderConfigurationWindowBox.notebook_side.Visible = false; EncoderConfigurationWindowBox.encoder_configuration.Show(); //B) side is shown now, after showing the window in order to be displayed correctly (see A) EncoderConfigurationWindowBox.notebook_side.Visible = (EncoderConfigurationWindowBox.sideMode != sideModes.HIDDEN); return(EncoderConfigurationWindowBox); }