diff options
Diffstat (limited to 'src/prefs.c')
-rw-r--r-- | src/prefs.c | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/src/prefs.c b/src/prefs.c index 7e723e7..a2f2411 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -20,48 +20,60 @@ #include <gtk/gtk.h> #include "prefs.h" -gboolean fakeapp_restart_server(FakeApp *app); /* TODO: move to a header */ +gboolean fakeapp_restart_server (FakeApp * app); /* TODO: move to a header */ static GConfClient *gconf = NULL; -void gconf_prefs_init(FakeApp *app) { +void +gconf_prefs_init (FakeApp * app) +{ char *s; gconf = gconf_client_get_default (); g_return_if_fail (gconf != NULL); - + s = gconf_client_get_string (gconf, GCONF_DISPLAY, NULL); - if (s != NULL && *s != '\0') { - app->xnest_dpy_name = s; - } + if (s != NULL && *s != '\0') + { + app->xnest_dpy_name = s; + } s = gconf_client_get_string (gconf, GCONF_SERVER, NULL); - if (s != NULL && *s != '\0') { - app->xnest_bin_path = s; - } + if (s != NULL && *s != '\0') + { + app->xnest_bin_path = s; + } s = gconf_client_get_string (gconf, GCONF_SERVER_OPTIONS, NULL); - if (s != NULL && *s != '\0') { - app->xnest_bin_options = s; - } + if (s != NULL && *s != '\0') + { + app->xnest_bin_options = s; + } s = gconf_client_get_string (gconf, GCONF_START_CMD, NULL); - if (s != NULL && *s != '\0') { - app->start_cmd = s; - } + if (s != NULL && *s != '\0') + { + app->start_cmd = s; + } } -void on_preferences_activate (GtkMenuItem *menuitem, FakeApp *app) { +void +on_preferences_activate (GtkMenuItem * menuitem, FakeApp * app) +{ gtk_entry_set_text (GTK_ENTRY (app->entry_display), app->xnest_dpy_name); gtk_entry_set_text (GTK_ENTRY (app->entry_server), app->xnest_bin_path); - gtk_entry_set_text (GTK_ENTRY (app->entry_options), app->xnest_bin_options ? app->xnest_bin_options : ""); + gtk_entry_set_text (GTK_ENTRY (app->entry_options), + app->xnest_bin_options ? app->xnest_bin_options : ""); - gtk_entry_set_text (GTK_ENTRY (app->entry_start), app->start_cmd ? app->start_cmd : ""); + gtk_entry_set_text (GTK_ENTRY (app->entry_start), + app->start_cmd ? app->start_cmd : ""); gtk_window_present (GTK_WINDOW (app->prefs_window)); } -void on_prefs_apply_clicked (GtkWidget *widget, FakeApp *app) { +void +on_prefs_apply_clicked (GtkWidget * widget, FakeApp * app) +{ const char *s = NULL; s = gtk_entry_get_text (GTK_ENTRY (app->entry_display)); @@ -82,6 +94,8 @@ void on_prefs_apply_clicked (GtkWidget *widget, FakeApp *app) { gtk_widget_hide (app->prefs_window); } -void on_prefs_cancel_clicked (GtkWidget *widget, FakeApp *app) { +void +on_prefs_cancel_clicked (GtkWidget * widget, FakeApp * app) +{ gtk_widget_hide (app->prefs_window); } |