added two targets -- package and pclean -- to simplify the development process :)
[simple-launcher] / dialog-entry.cc
index eadc878..2db6581 100644 (file)
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+#include <gtk/gtkcheckbutton.h>
+
 #include "dialog-entry.h"
 
+SettingsDialogBooleanEntry::SettingsDialogBooleanEntry(GConfBooleanOption& option, const std::string& name): SettingsDialogEntry(option, name) {
+       myWidget = gtk_check_button_new();
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(myWidget), option.value());
+}
+
+void SettingsDialogBooleanEntry::updateValue() {
+       ((GConfBooleanOption&)myOption).setValue(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(myWidget)));
+}
+
+SettingsDialogIntegerEntry::SettingsDialogIntegerEntry(GConfIntegerOption& option, const std::string& name, int minValue, int maxValue): SettingsDialogEntry(option, name) {
+       mySpinBox = HILDON_NUMBER_EDITOR(hildon_number_editor_new(minValue, maxValue));
+       hildon_number_editor_set_value(mySpinBox, option.value());
+}
 
+void SettingsDialogIntegerEntry::updateValue() {
+       ((GConfIntegerOption&)myOption).setValue(hildon_number_editor_get_value(mySpinBox));
+}