summaryrefslogtreecommitdiff
path: root/settings-backend
diff options
context:
space:
mode:
authoronestone <onestone>2006-12-07 01:04:07 +0000
committeronestone <onestone>2006-12-07 01:04:07 +0000
commit1ce443daadf9452def907cd3c0160c5e9049d96e (patch)
tree6cd50f5074de1ca5af663b82c0cc875f51db0c2e /settings-backend
parente02162a4315bc27567a195b3851de10ada6e184f (diff)
downloadaquamarine-1ce443daadf9452def907cd3c0160c5e9049d96e.tar.gz
aquamarine-1ce443daadf9452def907cd3c0160c5e9049d96e.tar.bz2
kconfig-backend: fixed missed click_to_focus option. Begin of kde integrated write support.
Diffstat (limited to 'settings-backend')
-rw-r--r--settings-backend/kconfig_backend.cpp66
1 files changed, 65 insertions, 1 deletions
diff --git a/settings-backend/kconfig_backend.cpp b/settings-backend/kconfig_backend.cpp
index a4154ec..9104776 100644
--- a/settings-backend/kconfig_backend.cpp
+++ b/settings-backend/kconfig_backend.cpp
@@ -55,6 +55,7 @@ typedef struct _ConfigFiles {
KSimpleConfig *beryl;
KConfig *kwin;
KConfig *global;
+ Bool modified;
} ConfigFiles;
typedef enum {
@@ -291,7 +292,8 @@ static void readIntegratedOption(ConfigFiles *cFiles, BerylSetting * setting)
}
if (specialOptions[option].berylName == "click_to_focus")
{
- setting->value.value.as_string = g_strdup("xkill");
+ Bool val = (cFiles->kwin->readEntry("FocusPolicy") == "ClickToFocus")?TRUE:FALSE;
+ beryl_setting_value_set_bool(&setting->value,&val);
}
if (specialOptions[option].berylName == "focus_stealing_prevention_level")
{
@@ -646,6 +648,66 @@ static void copy_color(BerylSettingValue * value, QStringList *list)
list->append(color);
}
+static void writeIntegratedOption(ConfigFiles *cFiles, BerylSetting * setting)
+{
+ int option = 0;
+ for (unsigned int i = 0; i < N_SOPTIONS; i++)
+ {
+ if (setting->name == specialOptions[i].berylName &&
+ QString(setting->parent->name) == specialOptions[i].berylPlugin)
+ {
+ option = i;
+ break;
+ }
+ }
+ setting->is_default=FALSE;
+ switch (specialOptions[option].type)
+ {
+ case OptionInt:
+
+ break;
+ case OptionBool:
+
+ break;
+ case OptionKey:
+
+ break;
+ case OptionSpecial:
+ if (specialOptions[option].berylName == "command_screenshot"
+ || specialOptions[option].berylName == "command_window_screenshot"
+ || specialOptions[option].berylName == "command11"
+ ||specialOptions[option].berylName == "unmaximize_window"
+ || specialOptions[option].berylName == "maximize_window"
+ || specialOptions[option].berylName == "maximize_window_horizontally"
+ || specialOptions[option].berylName == "maximize_window_vertically")
+ break;
+
+ if (specialOptions[option].berylName == "click_to_focus")
+ {
+
+ }
+ if (specialOptions[option].berylName == "focus_stealing_prevention_level")
+ {
+ //int level = cFiles->kwin->readNumEntry("FocusStealingPreventionLevel");
+ //level = MAX(0,MIN(4,level));
+ //setting->value.value.as_string = g_strdup(fspLevel[level]);
+ }
+ if (specialOptions[option].berylName == "number_of_desktops")
+ {
+ //cFiles->kwin->setGroup("Desktops");
+
+ //cFiles->kwin->setGroup("Windows");
+ }
+ if (specialOptions[option].berylName == "resize_mode")
+ {
+
+ }
+ break;
+ default:
+ break;
+ }
+}
+
void write_setting(BerylSettingsContext * c, BerylSetting * setting)
{
ConfigFiles *cFiles = (ConfigFiles *)c->backend_private_ptr;
@@ -659,6 +721,7 @@ void write_setting(BerylSettingsContext * c, BerylSetting * setting)
if (isIntegratedOption(setting))
{
+ writeIntegratedOption(cFiles, setting);
return;
}
@@ -859,6 +922,7 @@ gboolean write_init(BerylSettingsContext * c)
cFiles->global = new KConfig("kdeglobals");
cFiles->kwin->setGroup("Windows");
cFiles->global->setGroup("Global Shortcuts");
+ cFiles->modified = false;
c->backend_private_ptr=(void *)cFiles;
return TRUE;