added forgotten copyright notice
[simple-launcher] / dialog-entry.cc
1 // This file is a part of Simple Launcher
2 //
3 // Copyright (C) 2006, 2007, Mikhail Sobolev
4 //
5 // Simple Launcher is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License version 2 as published by
7 // the Free Software Foundation.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12 // more details.
13 //
14 // You should have received a copy of the GNU General Public License along with
15 // this program; if not, write to the Free Software Foundation, Inc., 51
16 // Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 #include <gtk/gtkcheckbutton.h>
19
20 #include "dialog-entry.h"
21
22 SettingsDialogBooleanEntry::SettingsDialogBooleanEntry(GConfBooleanOption& option, const std::string& name): SettingsDialogEntry(option, name) {
23         myWidget = gtk_check_button_new();
24
25         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(myWidget), option.value());
26 }
27
28 void SettingsDialogBooleanEntry::updateValue() {
29         ((GConfBooleanOption&)myOption).setValue(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(myWidget)));
30 }
31
32 SettingsDialogIntegerEntry::SettingsDialogIntegerEntry(GConfIntegerOption& option, const std::string& name, int minValue, int maxValue): SettingsDialogEntry(option, name) {
33         mySpinBox = HILDON_NUMBER_EDITOR(hildon_number_editor_new(minValue, maxValue));
34         hildon_number_editor_set_value(mySpinBox, option.value());
35 }
36
37 void SettingsDialogIntegerEntry::updateValue() {
38         ((GConfIntegerOption&)myOption).setValue(hildon_number_editor_get_value(mySpinBox));
39 }