Option and layout warning dialogs added

pull/17/head
parent 98b39f5c31
commit 80786463f9
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -173,3 +173,19 @@ msgstr ""
#: source/ubl-strings.h:20
msgid "Font"
msgstr ""
#: source/ubl-strings.h:20
msgid "Are you sure you want to remove current option?"
msgstr ""
#: source/ubl-strings.h:20
msgid "Option deletion"
msgstr ""
#: source/ubl-strings.h:20
msgid "Are you sure you want to remove current layout?"
msgstr ""
#: source/ubl-strings.h:20
msgid "Layout deletion"
msgstr ""

@ -175,3 +175,19 @@ msgstr "Дополнительная раскладка клавиш для кл
#: source/ubl-strings.h:20
msgid "Font"
msgstr "Шрифт"
#: source/ubl-strings.h:20
msgid "Are you sure you want to remove current option?"
msgstr "Вы уверены что хотите удалить данную опцию?"
#: source/ubl-strings.h:20
msgid "Option deletion"
msgstr "Удаление опции"
#: source/ubl-strings.h:20
msgid "Are you sure you want to remove current layout?"
msgstr "Вы уверены что хотите удалить данную раскладку?"
#: source/ubl-strings.h:20
msgid "Layout deletion"
msgstr "Удаление раскладки"

@ -95,6 +95,10 @@ void yon_layouts_remove(GtkTreeView *tree, GtkListStore *cur_list, main_window *
GtkTreeModel *model = GTK_TREE_MODEL(cur_list);
GtkTreeIter iter;
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(tree),&model,&iter)){
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->action_text = LAYOUT_REMOVE_LABEL;
data->title = LAYOUT_REMOVE_TITLE_LABEL;
if (yon_confirmation_dialog_call(widgets->Window,data)!=GTK_RESPONSE_ACCEPT) return;
char *layout, *variant;
gtk_tree_model_get(model,&iter,0,&layout,1,&variant,-1);
if (!yon_char_is_empty(variant)){

@ -165,6 +165,10 @@ void on_option_remove(GtkWidget*, main_window *widgets){
GtkTreeIter iter;
GtkTreeModel *model;
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->OptionsTree)),&model, &iter)){
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->action_text = OPTION_REMOVE_LABEL;
data->title = OPTION_REMOVE_TITLE_LABEL;
if (yon_confirmation_dialog_call(widgets->Window,data)!=GTK_RESPONSE_ACCEPT) return;
char *target;
gtk_tree_model_get(model,&iter,0,&target,-1);
yon_config_remove_element(options_parameter,target,",");

@ -319,6 +319,12 @@ void on_layout_selection_changed(GtkTreeView *self,main_window *widgets){
}
void on_option_selection_changed(GtkTreeView *self,main_window *widgets){
int status = gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(self)),NULL,NULL);
gtk_widget_set_sensitive(widgets->OptionsRemoveButton,status);
}
void yon_main_window_complete(main_window *widgets){
widgets = yon_remalloc(widgets,sizeof(main_window));
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
@ -371,6 +377,7 @@ void yon_main_window_complete(main_window *widgets){
// g_signal_connect(G_OBJECT(widgets->LayoutsList),"row-deleted",G_CALLBACK(on_layout_dnd_deleted),widgets);
g_signal_connect(G_OBJECT(widgets->LayoutTree),"cursor-changed",G_CALLBACK(on_layout_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->OptionsTree),"cursor-changed",G_CALLBACK(on_option_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->DefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_toggled),widgets);

@ -278,4 +278,5 @@ void on_font_accept(GtkWidget *, layouts_window *window);
void on_font_selection_changed(GtkWidget *,layouts_window *window);
void yon_interface_save(main_window *widgets);
void on_layout_default_toggled(GtkWidget *, int status, main_window *widgets);
void on_layout_selection_changed(GtkTreeView*,main_window *widgets);
void on_layout_selection_changed(GtkTreeView*,main_window *widgets);
void on_option_selection_changed(GtkTreeView *self,main_window *widgets);

@ -44,4 +44,9 @@
#define GROUP_LABEL _("Group")
#define KEYMAP_TITLE_LABEL _("Additional key layout for the keyboard")
#define FONT_TITLE_LABEL _("Font")
#define FONT_TITLE_LABEL _("Font")
#define OPTION_REMOVE_LABEL _("Are you sure you want to remove current option?")
#define OPTION_REMOVE_TITLE_LABEL _("Option deletion")
#define LAYOUT_REMOVE_LABEL _("Are you sure you want to remove current layout?")
#define LAYOUT_REMOVE_TITLE_LABEL _("Layout deletion")

@ -543,6 +543,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<child>
<object class="GtkButton" id="OptionsRemoveButton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image3</property>

Loading…
Cancel
Save