#include "demo-Gtk-widgets.h"
#include "demo-Gtk-support.h"
+# ifdef __GNUC__
+# define STFU __extension__ /* ignore gcc -pendantic warnings in next sexp */
+# else
+# define STFU /* */
+# endif
+
GtkWidget*
create_xscreensaver_demo (void)
{
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (demo);
gtk_container_add (GTK_CONTAINER (demo_manual_hbbox), demo);
- GTK_WIDGET_SET_FLAGS (demo, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (demo, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, demo, _("Demo the selected screen saver in full-screen mode (click the mouse to return.)"), NULL);
settings = gtk_button_new_with_label (_("Settings..."));
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (settings);
gtk_container_add (GTK_CONTAINER (demo_manual_hbbox), settings);
- GTK_WIDGET_SET_FLAGS (settings, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (settings, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, settings, _("Customization and explanation of the selected screen saver."), NULL);
list_vbox = gtk_vbox_new (FALSE, 0);
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (next);
gtk_box_pack_start (GTK_BOX (next_prev_hbox), next, FALSE, FALSE, 0);
- GTK_WIDGET_SET_FLAGS (next, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (next, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, next, _("Run the next screen saver in the list in full-screen mode (click the mouse to return.)"), NULL);
prev = gtk_button_new_with_label (_("/\\"));
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (prev);
gtk_box_pack_start (GTK_BOX (next_prev_hbox), prev, FALSE, FALSE, 0);
- GTK_WIDGET_SET_FLAGS (prev, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (prev, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, prev, _("Run the previous screen saver in the list in full-screen mode (click the mouse to return.)"), NULL);
preview_frame = gtk_frame_new (_("Description"));
GtkWidget *dialog_hbuttonbox;
GtkWidget *adv_button;
GtkWidget *std_button;
+ GtkWidget *reset_button;
GtkWidget *ok_cancel_hbuttonbox;
GtkWidget *ok_button;
GtkWidget *cancel_button;
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (manual);
gtk_container_add (GTK_CONTAINER (doc_hbuttonbox), manual);
- GTK_WIDGET_SET_FLAGS (manual, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (manual, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, manual, _("Click here to read the manual for this display mode, if it has one."), NULL);
dialog_action_area = GTK_DIALOG (xscreensaver_settings_dialog)->action_area;
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (adv_button);
gtk_container_add (GTK_CONTAINER (dialog_hbuttonbox), adv_button);
- GTK_WIDGET_SET_FLAGS (adv_button, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (adv_button, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, adv_button, _("Edit the command line directly."), NULL);
std_button = gtk_button_new_with_label (_("Standard <<"));
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (std_button);
gtk_container_add (GTK_CONTAINER (dialog_hbuttonbox), std_button);
- GTK_WIDGET_SET_FLAGS (std_button, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (std_button, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, std_button, _("Back to the graphical configuration options."), NULL);
+ reset_button = gtk_button_new_with_label (_("Reset to Defaults"));
+ gtk_widget_set_name (reset_button, "reset_button");
+ gtk_widget_ref (reset_button);
+ gtk_object_set_data_full (GTK_OBJECT (xscreensaver_settings_dialog), "reset_button", reset_button,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (reset_button);
+ gtk_container_add (GTK_CONTAINER (dialog_hbuttonbox), reset_button);
+ STFU GTK_WIDGET_SET_FLAGS (reset_button, GTK_CAN_DEFAULT);
+ gtk_tooltips_set_tip (tooltips, reset_button, _("Reset this screen saver to the default settings."), NULL);
+
ok_cancel_hbuttonbox = gtk_hbutton_box_new ();
gtk_widget_set_name (ok_cancel_hbuttonbox, "ok_cancel_hbuttonbox");
gtk_widget_ref (ok_cancel_hbuttonbox);
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (ok_button);
gtk_container_add (GTK_CONTAINER (ok_cancel_hbuttonbox), ok_button);
- GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT);
cancel_button = gtk_button_new_with_label (_("Cancel"));
gtk_widget_set_name (cancel_button, "cancel_button");
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (cancel_button);
gtk_container_add (GTK_CONTAINER (ok_cancel_hbuttonbox), cancel_button);
- GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (opt_notebook), "switch_page",
GTK_SIGNAL_FUNC (settings_switch_page_cb),
gtk_signal_connect (GTK_OBJECT (std_button), "clicked",
GTK_SIGNAL_FUNC (settings_std_cb),
NULL);
+ gtk_signal_connect (GTK_OBJECT (reset_button), "clicked",
+ GTK_SIGNAL_FUNC (settings_reset_cb),
+ NULL);
gtk_signal_connect (GTK_OBJECT (ok_button), "clicked",
GTK_SIGNAL_FUNC (settings_ok_cb),
NULL);