diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 7d0fc15..44b95b1 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -1140,36 +1140,6 @@ void Fluxbox::save_rc() { | |||
1140 | cerr<<_FB_CONSOLETEXT(Fluxbox, BadRCFile, "rc filename is invalid!", "Bad settings file")<<endl; | 1140 | cerr<<_FB_CONSOLETEXT(Fluxbox, BadRCFile, "rc filename is invalid!", "Bad settings file")<<endl; |
1141 | 1141 | ||
1142 | 1142 | ||
1143 | ScreenList::iterator it = m_screen_list.begin(); | ||
1144 | ScreenList::iterator it_end = m_screen_list.end(); | ||
1145 | for (; it != it_end; ++it) { | ||
1146 | BScreen *screen = *it; | ||
1147 | |||
1148 | std::string workspaces_string("screen"); | ||
1149 | workspaces_string += FbTk::StringUtil::number2String(screen->screenNumber()); | ||
1150 | workspaces_string += ".workspaceNames: "; | ||
1151 | |||
1152 | // these are static, but may not be saved in the users resource file, | ||
1153 | // writing these resources will allow the user to edit them at a later | ||
1154 | // time... but loading the defaults before saving allows us to rewrite the | ||
1155 | // users changes... | ||
1156 | |||
1157 | const BScreen::WorkspaceNames& names = screen->getWorkspaceNames(); | ||
1158 | for (size_t i=0; i < names.size(); i++) { | ||
1159 | workspaces_string += FbTk::FbStringUtil::FbStrToLocale(names[i]); | ||
1160 | workspaces_string += ','; | ||
1161 | } | ||
1162 | |||
1163 | XrmPutLineResource(&new_rc, workspaces_string.c_str()); | ||
1164 | |||
1165 | } | ||
1166 | |||
1167 | XrmDatabase old_rc = XrmGetFileDatabase(dbfile.c_str()); | ||
1168 | |||
1169 | XrmMergeDatabases(new_rc, &old_rc); | ||
1170 | XrmPutFileDatabase(old_rc, dbfile.c_str()); | ||
1171 | XrmDestroyDatabase(old_rc); | ||
1172 | |||
1173 | fbdbg<<__FILE__<<"("<<__LINE__<<"): ------------ SAVING DONE"<<endl; | 1143 | fbdbg<<__FILE__<<"("<<__LINE__<<"): ------------ SAVING DONE"<<endl; |
1174 | 1144 | ||
1175 | } | 1145 | } |
@@ -1227,50 +1197,6 @@ void Fluxbox::load_rc() { | |||
1227 | *m_rc_stylefile = DEFAULTSTYLE; | 1197 | *m_rc_stylefile = DEFAULTSTYLE; |
1228 | } | 1198 | } |
1229 | 1199 | ||
1230 | void Fluxbox::load_rc(BScreen &screen) { | ||
1231 | //get resource filename | ||
1232 | _FB_USES_NLS; | ||
1233 | string dbfile(getRcFilename()); | ||
1234 | |||
1235 | XrmDatabaseHelper database; | ||
1236 | |||
1237 | // XXX make this a regular resource | ||
1238 | database = XrmGetFileDatabase(dbfile.c_str()); | ||
1239 | if (database==0) | ||
1240 | database = XrmGetFileDatabase(DEFAULT_INITFILE); | ||
1241 | |||
1242 | |||
1243 | screen.removeWorkspaceNames(); | ||
1244 | |||
1245 | std::string screen_number = FbTk::StringUtil::number2String(screen.screenNumber()); | ||
1246 | |||
1247 | std::string name_lookup("screen"); | ||
1248 | name_lookup += screen_number; | ||
1249 | name_lookup += ".workspaceNames"; | ||
1250 | std::string class_lookup("screen"); | ||
1251 | class_lookup += screen_number; | ||
1252 | class_lookup += ".WorkspaceNames"; | ||
1253 | |||
1254 | XrmValue value; | ||
1255 | char *value_type; | ||
1256 | if (XrmGetResource(*database, name_lookup.c_str(), class_lookup.c_str(), &value_type, | ||
1257 | &value)) { | ||
1258 | |||
1259 | string values(value.addr); | ||
1260 | BScreen::WorkspaceNames names; | ||
1261 | |||
1262 | StringUtil::removeTrailingWhitespace(values); | ||
1263 | StringUtil::removeFirstWhitespace(values); | ||
1264 | StringUtil::stringtok<BScreen::WorkspaceNames>(names, values, ","); | ||
1265 | BScreen::WorkspaceNames::iterator it; | ||
1266 | for(it = names.begin(); it != names.end(); ++it) { | ||
1267 | if (!(*it).empty() && (*it) != "") | ||
1268 | screen.addWorkspaceName((*it).c_str()); | ||
1269 | } | ||
1270 | |||
1271 | } | ||
1272 | } | ||
1273 | |||
1274 | void Fluxbox::reconfigure() { | 1200 | void Fluxbox::reconfigure() { |
1275 | load_rc(); | 1201 | load_rc(); |
1276 | m_reconfigure_wait = true; | 1202 | m_reconfigure_wait = true; |
@@ -1282,11 +1208,6 @@ void Fluxbox::real_reconfigure() { | |||
1282 | 1208 | ||
1283 | FbTk::Transparent::usePseudoTransparent(*m_rc_pseudotrans); | 1209 | FbTk::Transparent::usePseudoTransparent(*m_rc_pseudotrans); |
1284 | 1210 | ||
1285 | ScreenList::iterator screen_it = m_screen_list.begin(); | ||
1286 | ScreenList::iterator screen_it_end = m_screen_list.end(); | ||
1287 | for (; screen_it != screen_it_end; ++screen_it) | ||
1288 | load_rc(*(*screen_it)); | ||
1289 | |||
1290 | STLUtil::forAll(m_screen_list, mem_fun(&BScreen::reconfigure)); | 1211 | STLUtil::forAll(m_screen_list, mem_fun(&BScreen::reconfigure)); |
1291 | m_key->reconfigure(); | 1212 | m_key->reconfigure(); |
1292 | STLUtil::forAll(m_atomhandler, mem_fun(&AtomHandler::reconfigure)); | 1213 | STLUtil::forAll(m_atomhandler, mem_fun(&AtomHandler::reconfigure)); |