diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-06-12 13:17:47 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-16 23:51:49 (GMT) |
commit | 946bc2edb60836bb0d939d850543d1c9ab683dc9 (patch) | |
tree | 1011ab3f5e572998bd60408aef7618f9cc809e48 /util | |
parent | 62aac4851aed94bc198c09aff4d764967542b8e4 (diff) | |
download | fluxbox_pavel-946bc2edb60836bb0d939d850543d1c9ab683dc9.zip fluxbox_pavel-946bc2edb60836bb0d939d850543d1c9ab683dc9.tar.bz2 |
Factor out "session." from resource names
this reduces typing and it makes more sense in lua, since there the resources are implemented as
hierarchical tables and the topmost table has to be handled a bit specially.
Diffstat (limited to 'util')
-rw-r--r-- | util/fluxbox-update_configs.cc | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/util/fluxbox-update_configs.cc b/util/fluxbox-update_configs.cc index 93acb04..069b112 100644 --- a/util/fluxbox-update_configs.cc +++ b/util/fluxbox-update_configs.cc | |||
@@ -90,11 +90,11 @@ void update_add_mouse_evens_to_keys(FbTk::ResourceManager& rm, | |||
90 | // different screens? the ability is going away until we make per-screen | 90 | // different screens? the ability is going away until we make per-screen |
91 | // keys files, anyway, so let's just use the first screen's setting | 91 | // keys files, anyway, so let's just use the first screen's setting |
92 | FbTk::BoolResource rc_wheeling(rm, true, | 92 | FbTk::BoolResource rc_wheeling(rm, true, |
93 | "session.screen0.desktopwheeling", | 93 | "screen0.desktopwheeling", |
94 | "Session.Screen0.DesktopWheeling"); | 94 | "Screen0.DesktopWheeling"); |
95 | FbTk::BoolResource rc_reverse(rm, false, | 95 | FbTk::BoolResource rc_reverse(rm, false, |
96 | "session.screen0.reversewheeling", | 96 | "screen0.reversewheeling", |
97 | "Session.Screen0.ReverseWheeling"); | 97 | "Screen0.ReverseWheeling"); |
98 | if (*rc_wheeling) { | 98 | if (*rc_wheeling) { |
99 | if (*rc_reverse) { // if you ask me, this should have been default | 99 | if (*rc_reverse) { // if you ask me, this should have been default |
100 | new_keyfile += "OnDesktop Mouse4 :PrevWorkspace\n"; | 100 | new_keyfile += "OnDesktop Mouse4 :PrevWorkspace\n"; |
@@ -115,7 +115,7 @@ void update_move_groups_entries_to_apps_file(FbTk::ResourceManager& rm, | |||
115 | const FbTk::FbString& keyfilename, const FbTk::FbString& appsfilename) { | 115 | const FbTk::FbString& keyfilename, const FbTk::FbString& appsfilename) { |
116 | 116 | ||
117 | FbTk::StringResource rc_groupfile(rm, "~/.fluxbox/groups", | 117 | FbTk::StringResource rc_groupfile(rm, "~/.fluxbox/groups", |
118 | "session.groupFile", "Session.GroupFile"); | 118 | "groupFile", "GroupFile"); |
119 | string groupfilename = FbTk::StringUtil::expandFilename(*rc_groupfile); | 119 | string groupfilename = FbTk::StringUtil::expandFilename(*rc_groupfile); |
120 | string whole_groupfile = read_file(groupfilename); | 120 | string whole_groupfile = read_file(groupfilename); |
121 | string whole_appsfile = read_file(appsfilename); | 121 | string whole_appsfile = read_file(appsfilename); |
@@ -159,14 +159,14 @@ void update_move_toolbar_wheeling_to_keys_file(FbTk::ResourceManager& rm, | |||
159 | 159 | ||
160 | // scrolling on toolbar needs to match user's toolbar wheeling settings | 160 | // scrolling on toolbar needs to match user's toolbar wheeling settings |
161 | FbTk::StringResource rc_wheeling(rm, "Off", | 161 | FbTk::StringResource rc_wheeling(rm, "Off", |
162 | "session.screen0.iconbar.wheelMode", | 162 | "screen0.iconbar.wheelMode", |
163 | "Session.Screen0.Iconbar.WheelMode"); | 163 | "Screen0.Iconbar.WheelMode"); |
164 | FbTk::BoolResource rc_screen(rm, true, | 164 | FbTk::BoolResource rc_screen(rm, true, |
165 | "session.screen0.desktopwheeling", | 165 | "screen0.desktopwheeling", |
166 | "Session.Screen0.DesktopWheeling"); | 166 | "Screen0.DesktopWheeling"); |
167 | FbTk::BoolResource rc_reverse(rm, false, | 167 | FbTk::BoolResource rc_reverse(rm, false, |
168 | "session.screen0.reversewheeling", | 168 | "screen0.reversewheeling", |
169 | "Session.Screen0.ReverseWheeling"); | 169 | "Screen0.ReverseWheeling"); |
170 | if (strcasecmp((*rc_wheeling).c_str(), "On") == 0 || | 170 | if (strcasecmp((*rc_wheeling).c_str(), "On") == 0 || |
171 | (strcasecmp((*rc_wheeling).c_str(), "Screen") == 0 && *rc_screen)) { | 171 | (strcasecmp((*rc_wheeling).c_str(), "Screen") == 0 && *rc_screen)) { |
172 | keep_changes = true; | 172 | keep_changes = true; |
@@ -196,11 +196,11 @@ void update_move_modkey_to_keys_file(FbTk::ResourceManager& rm, | |||
196 | 196 | ||
197 | // need to match user's resize model | 197 | // need to match user's resize model |
198 | FbTk::StringResource rc_mode(rm, "Bottom", | 198 | FbTk::StringResource rc_mode(rm, "Bottom", |
199 | "session.screen0.resizeMode", | 199 | "screen0.resizeMode", |
200 | "Session.Screen0.ResizeMode"); | 200 | "Screen0.ResizeMode"); |
201 | FbTk::StringResource rc_modkey(rm, "Mod1", | 201 | FbTk::StringResource rc_modkey(rm, "Mod1", |
202 | "session.modKey", | 202 | "modKey", |
203 | "Session.ModKey"); | 203 | "ModKey"); |
204 | 204 | ||
205 | new_keyfile += "OnWindow " + *rc_modkey + | 205 | new_keyfile += "OnWindow " + *rc_modkey + |
206 | " Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}\n"; | 206 | " Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}\n"; |
@@ -229,8 +229,8 @@ void update_window_patterns_for_iconbar(FbTk::ResourceManager& rm, | |||
229 | // it won't get freed, but that's ok | 229 | // it won't get freed, but that's ok |
230 | FbTk::StringResource *rc_mode = | 230 | FbTk::StringResource *rc_mode = |
231 | new FbTk::StringResource(rm, "Workspace", | 231 | new FbTk::StringResource(rm, "Workspace", |
232 | "session.screen0.iconbar.mode", | 232 | "screen0.iconbar.mode", |
233 | "Session.Screen0.Iconbar.Mode"); | 233 | "Screen0.Iconbar.Mode"); |
234 | 234 | ||
235 | std::string mode = FbTk::StringUtil::toLower(**rc_mode); | 235 | std::string mode = FbTk::StringUtil::toLower(**rc_mode); |
236 | if (mode == "none") | 236 | if (mode == "none") |
@@ -260,8 +260,8 @@ void update_move_titlebar_actions_to_keys_file(FbTk::ResourceManager& rm, | |||
260 | new_keyfile += "OnTitlebar Double Mouse1 :Shade\n"; | 260 | new_keyfile += "OnTitlebar Double Mouse1 :Shade\n"; |
261 | new_keyfile += "OnTitlebar Mouse3 :WindowMenu\n"; | 261 | new_keyfile += "OnTitlebar Mouse3 :WindowMenu\n"; |
262 | 262 | ||
263 | FbTk::BoolResource rc_reverse(rm, false,"session.screen0.reversewheeling", "Session.Screen0.ReverseWheeling"); | 263 | FbTk::BoolResource rc_reverse(rm, false,"screen0.reversewheeling", "Screen0.ReverseWheeling"); |
264 | FbTk::StringResource scroll_action(rm, "", "session.screen0.windowScrollAction", "Session.Screen0.WindowScrollAction"); | 264 | FbTk::StringResource scroll_action(rm, "", "screen0.windowScrollAction", "Screen0.WindowScrollAction"); |
265 | if (strcasecmp((*scroll_action).c_str(), "shade") == 0) { | 265 | if (strcasecmp((*scroll_action).c_str(), "shade") == 0) { |
266 | if (*rc_reverse) { | 266 | if (*rc_reverse) { |
267 | new_keyfile += "OnTitlebar Mouse5 :ShadeOn\n"; | 267 | new_keyfile += "OnTitlebar Mouse5 :ShadeOn\n"; |
@@ -307,8 +307,8 @@ void update_disable_icons_in_tabs_for_backwards_compatibility(FbTk::ResourceMana | |||
307 | 307 | ||
308 | FbTk::BoolResource *show = | 308 | FbTk::BoolResource *show = |
309 | new FbTk::BoolResource(rm, false, | 309 | new FbTk::BoolResource(rm, false, |
310 | "session.screen0.tabs.usePixmap", | 310 | "screen0.tabs.usePixmap", |
311 | "Session.Screen0.Tabs.UsePixmap"); | 311 | "Screen0.Tabs.UsePixmap"); |
312 | if (!*show) // only change if the setting didn't already exist | 312 | if (!*show) // only change if the setting didn't already exist |
313 | *show = false; | 313 | *show = false; |
314 | } | 314 | } |
@@ -321,13 +321,13 @@ void update_change_format_of_split_placement_menu(FbTk::ResourceManager& rm, | |||
321 | 321 | ||
322 | FbTk::StringResource *placement = | 322 | FbTk::StringResource *placement = |
323 | new FbTk::StringResource(rm, "BottomRight", | 323 | new FbTk::StringResource(rm, "BottomRight", |
324 | "session.screen0.slit.placement", | 324 | "screen0.slit.placement", |
325 | "Session.Screen0.Slit.Placement"); | 325 | "Screen0.Slit.Placement"); |
326 | 326 | ||
327 | FbTk::StringResource *direction = | 327 | FbTk::StringResource *direction = |
328 | new FbTk::StringResource(rm, "Vertical", | 328 | new FbTk::StringResource(rm, "Vertical", |
329 | "session.screen0.slit.direction", | 329 | "screen0.slit.direction", |
330 | "Session.Screen0.Slit.Direction"); | 330 | "Screen0.Slit.Direction"); |
331 | 331 | ||
332 | if (strcasecmp((**direction).c_str(), "vertical") == 0) { | 332 | if (strcasecmp((**direction).c_str(), "vertical") == 0) { |
333 | if (strcasecmp((**placement).c_str(), "BottomRight") == 0) | 333 | if (strcasecmp((**placement).c_str(), "BottomRight") == 0) |
@@ -556,9 +556,9 @@ int run_updates(int old_version, FbTk::ResourceManager &rm) { | |||
556 | int new_version = old_version; | 556 | int new_version = old_version; |
557 | 557 | ||
558 | FbTk::StringResource rc_keyfile(rm, "~/.fluxbox/keys", | 558 | FbTk::StringResource rc_keyfile(rm, "~/.fluxbox/keys", |
559 | "session.keyFile", "Session.KeyFile"); | 559 | "keyFile", "KeyFile"); |
560 | FbTk::StringResource rc_appsfile(rm, "~/.fluxbox/apps", | 560 | FbTk::StringResource rc_appsfile(rm, "~/.fluxbox/apps", |
561 | "session.appsFile", "Session.AppsFile"); | 561 | "appsFile", "AppsFile"); |
562 | 562 | ||
563 | string appsfilename = FbTk::StringUtil::expandFilename(*rc_appsfile); | 563 | string appsfilename = FbTk::StringUtil::expandFilename(*rc_appsfile); |
564 | string keyfilename = FbTk::StringUtil::expandFilename(*rc_keyfile); | 564 | string keyfilename = FbTk::StringUtil::expandFilename(*rc_keyfile); |
@@ -617,7 +617,7 @@ int main(int argc, char **argv) { | |||
617 | if (rc_filename.empty()) | 617 | if (rc_filename.empty()) |
618 | rc_filename = getenv("HOME") + string("/.fluxbox/init"); | 618 | rc_filename = getenv("HOME") + string("/.fluxbox/init"); |
619 | 619 | ||
620 | FbTk::ResourceManager resource_manager(rc_filename.c_str(),false); | 620 | FbTk::ResourceManager resource_manager("session", "Session", rc_filename.c_str(),false); |
621 | if (!resource_manager.load(rc_filename.c_str())) { | 621 | if (!resource_manager.load(rc_filename.c_str())) { |
622 | // couldn't load rc file | 622 | // couldn't load rc file |
623 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<rc_filename<<endl; | 623 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<rc_filename<<endl; |
@@ -634,7 +634,7 @@ int main(int argc, char **argv) { | |||
634 | // I feel like putting this in a separate function for no apparent reason | 634 | // I feel like putting this in a separate function for no apparent reason |
635 | 635 | ||
636 | FbTk::IntResource config_version(resource_manager, 0, | 636 | FbTk::IntResource config_version(resource_manager, 0, |
637 | "session.configVersion", "Session.ConfigVersion"); | 637 | "configVersion", "ConfigVersion"); |
638 | 638 | ||
639 | if (check) { | 639 | if (check) { |
640 | cout << rc_filename << ": " << *config_version << endl | 640 | cout << rc_filename << ": " << *config_version << endl |