From d05f7f1070643d5212645a2fe6c147eb2dbd3b8d Mon Sep 17 00:00:00 2001 From: salva Date: Sat, 5 Dec 2009 21:38:02 +0200 Subject: [PATCH] Split the desktop code to new files. --- maemo-tweaks-desktop.c | 33 +++++++++++++++++++++++++++++++++ maemo-tweaks-desktop.h | 13 +++++++++++++ maemo-tweaks.c | 30 +++--------------------------- 3 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 maemo-tweaks-desktop.c create mode 100644 maemo-tweaks-desktop.h diff --git a/maemo-tweaks-desktop.c b/maemo-tweaks-desktop.c new file mode 100644 index 0000000..7de99d9 --- /dev/null +++ b/maemo-tweaks-desktop.c @@ -0,0 +1,33 @@ +/* + * vim:ts=4:sw=4:et:cindent:cino=(0 + */ + +#include +#include + +GtkWidget * maemo_tweaks_desktop_create_snap_to_grid (void) +{ + const gchar *options[] = {"Default", "Small grid", "Large grid", NULL}; + gint i = 0; + GtkWidget *button, *selector; + + selector = hildon_touch_selector_new_text (); + while (options[i] && options[i] != '\0') + { + hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), + options [i++]); + } + + button = hildon_picker_button_new (HILDON_SIZE_AUTO, + HILDON_BUTTON_ARRANGEMENT_VERTICAL); + + hildon_button_set_title (HILDON_BUTTON (button), + "Snap desktop icons to grid"); + + hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button), + HILDON_TOUCH_SELECTOR (selector)); + + gtk_widget_show (button); + return button; +} + diff --git a/maemo-tweaks-desktop.h b/maemo-tweaks-desktop.h new file mode 100644 index 0000000..4a918ba --- /dev/null +++ b/maemo-tweaks-desktop.h @@ -0,0 +1,13 @@ +/* + * vim:ts=4:sw=4:et:cindent:cino=(0 + */ + +#ifndef __MAEMO_TWEAKS_DESKTOP_H__ +#define __MAEMO_TWEAKS_DESKTOP_H__ + +#include + +GtkWidget * maemo_tweaks_desktop_create_snap_to_grid (void); + +#endif /* __MAEMO_TWEAKS_DESKTOP_H__ */ + diff --git a/maemo-tweaks.c b/maemo-tweaks.c index 8ad6505..58b2ea8 100644 --- a/maemo-tweaks.c +++ b/maemo-tweaks.c @@ -4,33 +4,8 @@ #include #include -#include -GtkWidget * create_desktop_snap_to_grid (void) -{ - const gchar *options[] = {"Default", "Small grid", "Large grid", NULL}; - gint i = 0; - GtkWidget *button, *selector; - - selector = hildon_touch_selector_new_text (); - while (options[i] && options[i] != '\0') - { - hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), - options [i++]); - } - - button = hildon_picker_button_new (HILDON_SIZE_AUTO, - HILDON_BUTTON_ARRANGEMENT_VERTICAL); - - hildon_button_set_title (HILDON_BUTTON (button), - "Snap desktop icons to grid"); - - hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button), - HILDON_TOUCH_SELECTOR (selector)); - - gtk_widget_show (button); - return button; -} +#include "maemo-tweaks-desktop.h" GtkWidget *create_dialog (GtkWindow *parent) { @@ -48,7 +23,8 @@ GtkWidget *create_dialog (GtkWindow *parent) NULL); box = GTK_DIALOG (dialog)->vbox; - gtk_box_pack_start (GTK_BOX (box), create_desktop_snap_to_grid (), + gtk_box_pack_start (GTK_BOX (box), + maemo_tweaks_desktop_create_snap_to_grid (), TRUE, TRUE, 0); return dialog; -- 1.7.9.5