Mercurial > geeqie
comparison src/preferences.c @ 354:5c82855feba7
Add a button to reset fullscreen info string to default value.
author | zas_ |
---|---|
date | Sun, 13 Apr 2008 12:24:42 +0000 |
parents | 07490120df2d |
children | 673d1eb5af73 |
comparison
equal
deleted
inserted
replaced
353:691fcf15aca1 | 354:5c82855feba7 |
---|---|
778 | 778 |
779 if (c_options->fullscreen.info) g_free(c_options->fullscreen.info); | 779 if (c_options->fullscreen.info) g_free(c_options->fullscreen.info); |
780 c_options->fullscreen.info = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE); | 780 c_options->fullscreen.info = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE); |
781 } | 781 } |
782 | 782 |
783 static void fullscreen_info_default_ok_cb(GenericDialog *gd, gpointer data) | |
784 { | |
785 GtkTextView *text_view = data; | |
786 GtkTextBuffer *buffer; | |
787 | |
788 set_default_fullscreen_info(options); | |
789 if (!configwindow) return; | |
790 | |
791 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view)); | |
792 gtk_text_buffer_set_text(buffer, options->fullscreen.info, -1); | |
793 } | |
794 | |
795 static void fullscreen_info_default_cb(GtkWidget *widget, gpointer data) | |
796 { | |
797 GenericDialog *gd; | |
798 | |
799 gd = generic_dialog_new(_("Reset fullscreen info string"), | |
800 GQ_WMCLASS, "reset_fullscreen_info", widget, TRUE, | |
801 dummy_cancel_cb, data); | |
802 generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset fullscreen info string"), | |
803 _("This will reset the fullscreen info string to the default.\nContinue?")); | |
804 generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, fullscreen_info_default_ok_cb, TRUE); | |
805 gtk_widget_show(gd->dialog); | |
806 } | |
807 | |
808 | |
783 /* general options tab */ | 809 /* general options tab */ |
784 static void config_tab_general(GtkWidget *notebook) | 810 static void config_tab_general(GtkWidget *notebook) |
785 { | 811 { |
786 GtkWidget *label; | 812 GtkWidget *label; |
787 GtkWidget *hbox; | 813 GtkWidget *hbox; |
1300 )); | 1326 )); |
1301 #endif | 1327 #endif |
1302 gtk_container_add(GTK_CONTAINER(scrolled), fullscreen_info_view); | 1328 gtk_container_add(GTK_CONTAINER(scrolled), fullscreen_info_view); |
1303 gtk_widget_show(fullscreen_info_view); | 1329 gtk_widget_show(fullscreen_info_view); |
1304 | 1330 |
1331 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); | |
1332 | |
1333 button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, | |
1334 G_CALLBACK(fullscreen_info_default_cb), fullscreen_info_view); | |
1335 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1336 gtk_widget_show(button); | |
1337 | |
1305 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(fullscreen_info_view)); | 1338 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(fullscreen_info_view)); |
1306 gtk_text_buffer_set_text(buffer, options->fullscreen.info, -1); | 1339 gtk_text_buffer_set_text(buffer, options->fullscreen.info, -1); |
1307 g_signal_connect(G_OBJECT(buffer), "changed", | 1340 g_signal_connect(G_OBJECT(buffer), "changed", |
1308 G_CALLBACK(fullscreen_info_view_changed_cb), fullscreen_info_view); | 1341 G_CALLBACK(fullscreen_info_view_changed_cb), fullscreen_info_view); |
1309 | 1342 |