return vbox;
}
-SettingsDialog::SettingsDialog(GtkWindow *parent, LauncherItems& items) : myList(SL_APPLET_SETTINGS_ICON_SIZE, items) {
+SettingsDialog::SettingsDialog(GtkWindow *parent, LauncherItems& items, GConfBooleanOption& transparent, GConfIntegerOption& icon_size, GConfIntegerOption& canvas_size):
+ myList(SL_APPLET_SETTINGS_ICON_SIZE, items),
+ myTransparent(transparent, "Transparent background:"), myIconSize(icon_size, "Icon Size:"), myCanvasSize(canvas_size, "Canvas Size:") {
myDialog = GTK_DIALOG(gtk_dialog_new_with_buttons("Launcher Settings", parent, (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), "OK", GTK_RESPONSE_OK, "Cancel", GTK_RESPONSE_CANCEL, NULL));
GtkNotebook *notebook = GTK_NOTEBOOK(gtk_notebook_new());
return gtk_dialog_run(myDialog);
}
+void SettingsDialog::updateValues() {
+ myTransparent.updateValue();
+ myIconSize.updateValue();
+ myCanvasSize.updateValue();
+}
+
// vim:ts=2:sw=2:et
#include <gtk/gtkdialog.h>
+#include "gconf-wrapper.h"
#include "sla-list.h"
#include "launcher-item.h"
+#include "dialog-entry.h"
class SettingsDialog {
public:
- SettingsDialog(GtkWindow *parent, LauncherItems& items);
+ SettingsDialog(GtkWindow *parent, LauncherItems& items, GConfBooleanOption& transparent, GConfIntegerOption& icon_size, GConfIntegerOption& canvas_size);
~SettingsDialog();
gint run();
+ void updateValues();
+
private:
SLAList myList;
GtkDialog *myDialog;
+
+ SettingsDialogBooleanEntry myTransparent;
+ SettingsDialogIntegerEntry myIconSize;
+ SettingsDialogIntegerEntry myCanvasSize;
};
#endif
LauncherItems newItems = myItems;
- SettingsDialog dialog(myParent, newItems);
+ // TODO: make it nicer... this code is ugly :(
+ SettingsDialog dialog(myParent, newItems, myTransparent, myIconSize, myCanvasSize);
switch (dialog.run()) {
case GTK_RESPONSE_OK:
myItems = newItems;
+ dialog.updateValues(); // FIXME: hackish :( make it better
+
saveConfig(); // save it immediately!
updateWidget();
break;