/* demo-Gtk.c --- implements the interactive demo-mode and options dialogs.
- * xscreensaver, Copyright (c) 1993-2008 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2011 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
typedef enum { D_NONE, D_LAUNCH, D_GNOME, D_KDE } dialog_button;
-static void
+static Bool
warning_dialog (GtkWidget *parent, const char *message,
dialog_button button_type, int center)
{
!GET_WINDOW (parent)) /* too early to pop up transient dialogs */
{
fprintf (stderr, "%s: too early for dialog?\n", progname);
- return;
+ return False;
}
head = msg;
#endif /* !HAVE_GTK2 */
free (msg);
+ return True;
}
GList *kids = gtk_container_children (GTK_CONTAINER (list_widget));
int i;
#endif /* !HAVE_GTK2 */
+ static Bool already_warned_about_missing_image_directory = False; /* very long name... */
Bool changed = False;
GtkWidget *w;
CHECKBOX (p2->lock_p, "lock_button");
MINUTES (&p2->lock_timeout, "lock_spinbutton");
- CHECKBOX (p2->dpms_enabled_p, "dpms_button");
+ CHECKBOX (p2->dpms_enabled_p, "dpms_button");
+ CHECKBOX (p2->dpms_quickoff_p, "dpms_quickoff_button");
MINUTES (&p2->dpms_standby, "dpms_standby_spinbutton");
MINUTES (&p2->dpms_suspend, "dpms_suspend_spinbutton");
MINUTES (&p2->dpms_off, "dpms_off_spinbutton");
# undef PATHNAME
# undef TEXT
- /* Warn if the image directory doesn't exist.
+ /* Warn if the image directory doesn't exist, when:
+ - not being warned before
+ - image directory is changed and the directory doesn't exist
*/
if (p2->image_directory &&
*p2->image_directory &&
- !directory_p (p2->image_directory))
+ !directory_p (p2->image_directory) &&
+ ( !already_warned_about_missing_image_directory ||
+ ( p->image_directory &&
+ *p->image_directory &&
+ strcmp(p->image_directory, p2->image_directory)
+ )
+ )
+ )
{
char b[255];
- sprintf (b, "Error:\n\n" "Directory does not exist: \"%s\"\n",
+ sprintf (b, "Warning:\n\n" "Directory does not exist: \"%s\"\n",
p2->image_directory);
- warning_dialog (s->toplevel_widget, b, D_NONE, 100);
+ if (warning_dialog (s->toplevel_widget, b, D_NONE, 100))
+ already_warned_about_missing_image_directory = True;
}
COPY(lock_p, "lock_p");
COPY(lock_timeout, "lock_timeout");
- COPY(dpms_enabled_p, "dpms_enabled_p");
- COPY(dpms_standby, "dpms_standby");
- COPY(dpms_suspend, "dpms_suspend");
- COPY(dpms_off, "dpms_off");
+ COPY(dpms_enabled_p, "dpms_enabled_p");
+ COPY(dpms_quickoff_p, "dpms_quickoff_enabled_p");
+ COPY(dpms_standby, "dpms_standby");
+ COPY(dpms_suspend, "dpms_suspend");
+ COPY(dpms_off, "dpms_off");
#if 0
COPY(verbose_p, "verbose_p");
TOGGLE_ACTIVE ("splash_button", p->splash_p);
#endif
TOGGLE_ACTIVE ("dpms_button", p->dpms_enabled_p);
+ TOGGLE_ACTIVE ("dpms_quickoff_button", p->dpms_quickoff_p);
TOGGLE_ACTIVE ("grab_desk_button", p->grab_desktop_p);
TOGGLE_ACTIVE ("grab_video_button", p->grab_video_p);
TOGGLE_ACTIVE ("grab_image_button", p->random_image_p);
/* DPMS
*/
+dpms_supported=1;
SENSITIZE ("dpms_frame", dpms_supported);
SENSITIZE ("dpms_button", dpms_supported);
+ SENSITIZE ("dpms_quickoff_button", dpms_supported);
+
SENSITIZE ("dpms_standby_label", dpms_supported && p->dpms_enabled_p);
SENSITIZE ("dpms_standby_mlabel", dpms_supported && p->dpms_enabled_p);
SENSITIZE ("dpms_standby_spinbutton", dpms_supported && p->dpms_enabled_p);