1 /* vim: set sw=4 ts=4 et: */
3 * This file is part of Live Wallpaper (livewp)
5 * Copyright (C) 2010 Vlad Vasiliev
6 * Copyright (C) 2010 Tanya Makova
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version.
14 * This software is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this software; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 /*******************************************************************************/
25 #include "livewp-settings.h"
26 /*******************************************************************************/
29 GtkWidget *window = NULL,
32 window = gtk_dialog_new();
33 gtk_window_set_title(GTK_WINDOW(window), _("About"));
34 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
35 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
36 vbox = gtk_vbox_new (FALSE, 5);
37 label_about = gtk_label_new (_("Live Wallpaper\n Version 0.1 \n Copyright(c) 2010\n Tany Makova\n Vlad Vasiliev"));
38 gtk_box_pack_start (GTK_BOX (vbox), label_about, FALSE, FALSE, 0);
39 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
41 gtk_widget_show (label_about);
42 gtk_widget_show (vbox);
43 gtk_widget_show (window);
44 gtk_dialog_run(GTK_DIALOG(window));
47 /*******************************************************************************/
49 create_theme_selector (void)
53 selector = hildon_touch_selector_new_text ();
55 hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Berlin"));
56 hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Modern"));
59 /*******************************************************************************/
61 create_themes_button (gchar *theme){
66 selector = create_theme_selector();
67 button = hildon_picker_button_new (HILDON_SIZE_AUTO, HILDON_BUTTON_ARRANGEMENT_VERTICAL);
68 hildon_button_set_title (HILDON_BUTTON (button), "Theme");
69 hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
70 HILDON_TOUCH_SELECTOR (selector));
72 if (!strcmp(theme, _("Berlin"))){
73 hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 0);
74 hildon_button_set_value(button, _("Berlin"));
76 if (!strcmp(theme, _("Modern"))){
77 hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 1);
78 hildon_button_set_value(button, _("Modern"));
84 /*******************************************************************************/
86 lw_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv){
88 GtkWidget *window = NULL;
89 GtkWidget *save_button;
90 GtkWidget *theme_button;
92 window = gtk_dialog_new();
93 gtk_window_set_title(GTK_WINDOW(window), _("Live Wallpaper Settings"));
94 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
95 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
96 /* Create Theme button */
97 theme_button = create_themes_button(priv->theme);
98 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
99 theme_button, TRUE, TRUE, 0);
100 gtk_widget_show (theme_button);
101 gtk_widget_show (window);
102 save_button = gtk_dialog_add_button(GTK_DIALOG(window), _("Save"), GTK_RESPONSE_YES);
103 gtk_dialog_add_button(GTK_DIALOG(window), _("About"), GTK_RESPONSE_NO);
104 result = gtk_dialog_run(GTK_DIALOG(window));
107 case GTK_RESPONSE_YES:
108 fprintf(stderr,"Yes\n");
109 if (hildon_button_get_value(HILDON_BUTTON (theme_button))){
112 if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Berlin")))
113 priv->theme = g_strdup("Berlin");
114 if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Modern")))
115 priv->theme = g_strdup("Modern");
118 reload_scene(priv->desktop_plugin);
121 case GTK_RESPONSE_OK:
123 case GTK_RESPONSE_NO:
124 gtk_widget_destroy(window);
130 gtk_widget_destroy(window);