|
|
62b5a75 |
--- trunk/src/gnome-screensaver-preferences.c 2007/04/02 17:06:48 1149
|
|
|
62b5a75 |
+++ trunk/src/gnome-screensaver-preferences.c 2007/04/02 17:08:59 1150
|
|
|
62b5a75 |
@@ -59,6 +59,8 @@
|
|
|
62b5a75 |
#define KEY_CYCLE_DELAY KEY_DIR "/cycle_delay"
|
|
|
62b5a75 |
#define KEY_THEMES KEY_DIR "/themes"
|
|
|
62b5a75 |
|
|
|
62b5a75 |
+#define GPM_COMMAND "gnome-power-preferences"
|
|
|
62b5a75 |
+
|
|
|
62b5a75 |
enum {
|
|
|
62b5a75 |
NAME_COLUMN = 0,
|
|
|
62b5a75 |
ID_COLUMN,
|
|
|
62b5a75 |
@@ -429,7 +431,7 @@
|
|
|
62b5a75 |
error = NULL;
|
|
|
62b5a75 |
|
|
|
62b5a75 |
res = gdk_spawn_command_line_on_screen (gdk_screen_get_default (),
|
|
|
62b5a75 |
- "gnome-power-preferences",
|
|
|
62b5a75 |
+ GPM_COMMAND,
|
|
|
62b5a75 |
&error);
|
|
|
62b5a75 |
if (! res) {
|
|
|
62b5a75 |
g_warning ("Unable to start power management preferences: %s", error->message);
|
|
|
62b5a75 |
@@ -1358,6 +1360,18 @@
|
|
|
62b5a75 |
return FALSE;
|
|
|
62b5a75 |
}
|
|
|
62b5a75 |
|
|
|
62b5a75 |
+static gboolean
|
|
|
62b5a75 |
+is_program_in_path (const char *program)
|
|
|
62b5a75 |
+{
|
|
|
62b5a75 |
+ char *tmp = g_find_program_in_path (program);
|
|
|
62b5a75 |
+ if (tmp != NULL) {
|
|
|
62b5a75 |
+ g_free (tmp);
|
|
|
62b5a75 |
+ return TRUE;
|
|
|
62b5a75 |
+ } else {
|
|
|
62b5a75 |
+ return FALSE;
|
|
|
62b5a75 |
+ }
|
|
|
62b5a75 |
+}
|
|
|
62b5a75 |
+
|
|
|
62b5a75 |
static void
|
|
|
62b5a75 |
init_capplet (void)
|
|
|
62b5a75 |
{
|
|
|
62b5a75 |
@@ -1372,6 +1386,7 @@
|
|
|
62b5a75 |
GtkWidget *lock_checkbox;
|
|
|
62b5a75 |
GtkWidget *root_warning_label;
|
|
|
62b5a75 |
GtkWidget *preview_button;
|
|
|
62b5a75 |
+ GtkWidget *gpm_button;
|
|
|
62b5a75 |
GtkWidget *fullscreen_preview_window;
|
|
|
62b5a75 |
GtkWidget *fullscreen_preview_previous;
|
|
|
62b5a75 |
GtkWidget *fullscreen_preview_next;
|
|
|
62b5a75 |
@@ -1414,6 +1429,7 @@
|
|
|
62b5a75 |
lock_checkbox = glade_xml_get_widget (xml, "lock_checkbox");
|
|
|
62b5a75 |
root_warning_label = glade_xml_get_widget (xml, "root_warning_label");
|
|
|
62b5a75 |
preview_button = glade_xml_get_widget (xml, "preview_button");
|
|
|
62b5a75 |
+ gpm_button = glade_xml_get_widget (xml, "gpm_button");
|
|
|
62b5a75 |
fullscreen_preview_window = glade_xml_get_widget (xml, "fullscreen_preview_window");
|
|
|
62b5a75 |
fullscreen_preview_area = glade_xml_get_widget (xml, "fullscreen_preview_area");
|
|
|
62b5a75 |
fullscreen_preview_close = glade_xml_get_widget (xml, "fullscreen_preview_close");
|
|
|
62b5a75 |
@@ -1428,6 +1444,11 @@
|
|
|
62b5a75 |
gtk_widget_set_no_show_all (root_warning_label, TRUE);
|
|
|
62b5a75 |
widget_set_best_colormap (preview);
|
|
|
62b5a75 |
|
|
|
62b5a75 |
+ if (! is_program_in_path (GPM_COMMAND)) {
|
|
|
62b5a75 |
+ gtk_widget_set_no_show_all (gpm_button, TRUE);
|
|
|
62b5a75 |
+ gtk_widget_hide (gpm_button);
|
|
|
62b5a75 |
+ }
|
|
|
62b5a75 |
+
|
|
|
62b5a75 |
activate_delay = config_get_activate_delay (&is_writable);
|
|
|
62b5a75 |
ui_set_delay (activate_delay);
|
|
|
62b5a75 |
if (! is_writable) {
|