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); } }
private void apply(bool updateGUI) { //useful fo update SQL string selectedOldName = getSelectedName(); if (selectedOldName == "") { return; } string newName = entry_save_name.Text; if (newName != selectedOldName) { /* * if name has changed, then check if newname already exists on database * if exists add _copy recursively */ newName = SqliteEncoderConfiguration.IfNameExistsAddSuffix(newName, Catalog.GetString("copy")); } //update entry_save_name if needed if (newName != entry_save_name.Text) { entry_save_name.Text = newName; } //update SQL EncoderConfiguration econfOnGUI = GetAcceptedValues(); EncoderConfigurationSQLObject econfSO = new EncoderConfigurationSQLObject(-1, encoderGI, true, newName, econfOnGUI, entry_save_description.Text.ToString()); SqliteEncoderConfiguration.Update(false, encoderGI, selectedOldName, econfSO); if (updateGUI) { TreeModel model; TreeIter iter = new TreeIter(); treeview_select.Selection.GetSelected(out model, out iter); store.SetValue(iter, colName, newName); store.SetValue(iter, colDescription, entry_save_description.Text); } }