aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fluxbox.cc23
-rw-r--r--src/fluxbox.hh9
2 files changed, 27 insertions, 5 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 34752a3..3fcf743 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.59 2002/05/24 13:25:25 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.60 2002/05/29 06:22:31 fluxgen Exp $
26 26
27//Use GNU extensions 27//Use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -300,6 +300,7 @@ m_rc_colors_per_channel(m_resourcemanager, 4, "session.colorsPerChannel", "Sessi
300m_rc_stylefile(m_resourcemanager, "", "session.styleFile", "Session.StyleFile"), 300m_rc_stylefile(m_resourcemanager, "", "session.styleFile", "Session.StyleFile"),
301m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"), 301m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"),
302m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"), 302m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"),
303m_rc_slitlistfile(m_resourcemanager, "", "session.slitlistFile", "Session.SlitlistFile"),
303m_rc_titlebar_left(m_resourcemanager, TitlebarList(&m_titlebar_left[0], &m_titlebar_left[1]), "session.titlebar.left", "Session.Titlebar.Left"), 304m_rc_titlebar_left(m_resourcemanager, TitlebarList(&m_titlebar_left[0], &m_titlebar_left[1]), "session.titlebar.left", "Session.Titlebar.Left"),
304m_rc_titlebar_right(m_resourcemanager, TitlebarList(&m_titlebar_right[0], &m_titlebar_right[3]), "session.titlebar.right", "Session.Titlebar.Right"), 305m_rc_titlebar_right(m_resourcemanager, TitlebarList(&m_titlebar_right[0], &m_titlebar_right[3]), "session.titlebar.right", "Session.Titlebar.Right"),
305m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"), 306m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"),
@@ -415,7 +416,7 @@ void Fluxbox::setupConfigFiles() {
415 createInit = createKeys = createMenu = false; 416 createInit = createKeys = createMenu = false;
416 417
417 string dirname = getenv("HOME")+string("/.")+string(RC_PATH) + "/"; 418 string dirname = getenv("HOME")+string("/.")+string(RC_PATH) + "/";
418 string initFile, keysFile, menuFile; 419 string initFile, keysFile, menuFile, slitlistFile;
419 initFile = dirname+RC_INIT_FILE; 420 initFile = dirname+RC_INIT_FILE;
420 keysFile = dirname+"keys"; 421 keysFile = dirname+"keys";
421 menuFile = dirname+"menu"; 422 menuFile = dirname+"menu";
@@ -1923,6 +1924,13 @@ char *Fluxbox::getRcFilename() {
1923 return dbfile; 1924 return dbfile;
1924} 1925}
1925 1926
1927//-------- getDefaultDataFilename -------------
1928// Provides default filename of data file
1929//---------------------------------------------
1930void Fluxbox::getDefaultDataFilename(char *name, string &filename) {
1931 filename = string(getenv("HOME")+string("/.")+RC_PATH+string("/")+name);
1932}
1933
1926void Fluxbox::load_rc(void) { 1934void Fluxbox::load_rc(void) {
1927 XrmDatabaseHelper database; 1935 XrmDatabaseHelper database;
1928 1936
@@ -1952,6 +1960,17 @@ void Fluxbox::load_rc(void) {
1952 delete [] tmpvar; 1960 delete [] tmpvar;
1953 } else 1961 } else
1954 m_rc_menufile.setDefaultValue(); 1962 m_rc_menufile.setDefaultValue();
1963
1964 if (m_rc_slitlistfile->size()) {
1965 char *tmpvar =StringUtil::expandFilename(m_rc_slitlistfile->c_str());
1966 *m_rc_slitlistfile = (tmpvar==0 ? "" : tmpvar);
1967 delete [] tmpvar;
1968 }
1969 if (!m_rc_slitlistfile->size()) {
1970 string filename;
1971 getDefaultDataFilename("slitlist", filename);
1972 m_rc_slitlistfile.setFromString(filename.c_str());
1973 }
1955 1974
1956 if (*m_rc_colors_per_channel < 2) 1975 if (*m_rc_colors_per_channel < 2)
1957 *m_rc_colors_per_channel = 2; 1976 *m_rc_colors_per_channel = 2;
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 73daa94..137d818 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.hh,v 1.19 2002/05/17 11:07:36 fluxgen Exp $ 25// $Id: fluxbox.hh,v 1.20 2002/05/29 06:22:31 fluxgen Exp $
26 26
27#ifndef FLUXBOX_HH 27#ifndef FLUXBOX_HH
28#define FLUXBOX_HH 28#define FLUXBOX_HH
@@ -104,7 +104,7 @@ public:
104 inline const char *getStyleFilename(void) const { return m_rc_stylefile->c_str(); } 104 inline const char *getStyleFilename(void) const { return m_rc_stylefile->c_str(); }
105 105
106 inline const char *getMenuFilename(void) const { return m_rc_menufile->c_str(); } 106 inline const char *getMenuFilename(void) const { return m_rc_menufile->c_str(); }
107 107 inline const std::string &getSlitlistFilename(void) const { return *m_rc_slitlistfile; }
108 inline int getColorsPerChannel(void) const { return *m_rc_colors_per_channel; } 108 inline int getColorsPerChannel(void) const { return *m_rc_colors_per_channel; }
109 109
110 inline const timeval &getAutoRaiseDelay(void) const { return resource.auto_raise_delay; } 110 inline const timeval &getAutoRaiseDelay(void) const { return resource.auto_raise_delay; }
@@ -124,6 +124,7 @@ public:
124 void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); } 124 void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); }
125 void saveMenuFilename(const char *); 125 void saveMenuFilename(const char *);
126 void saveTitlebarFilename(const char *); 126 void saveTitlebarFilename(const char *);
127 void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); }
127 void saveMenuSearch(Window, Basemenu *); 128 void saveMenuSearch(Window, Basemenu *);
128 void saveWindowSearch(Window, FluxboxWindow *); 129 void saveWindowSearch(Window, FluxboxWindow *);
129 void saveToolbarSearch(Window, Toolbar *); 130 void saveToolbarSearch(Window, Toolbar *);
@@ -188,7 +189,7 @@ private:
188 Resource<bool> m_rc_tabs, m_rc_iconbar; 189 Resource<bool> m_rc_tabs, m_rc_iconbar;
189 Resource<int> m_rc_colors_per_channel; 190 Resource<int> m_rc_colors_per_channel;
190 Resource<std::string> m_rc_stylefile, 191 Resource<std::string> m_rc_stylefile,
191 m_rc_menufile, m_rc_keyfile; 192 m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile;
192 193
193 Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; 194 Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right;
194 Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; 195 Resource<unsigned int> m_rc_cache_life, m_rc_cache_max;
@@ -229,12 +230,14 @@ private:
229 char *rc_file, **argv; 230 char *rc_file, **argv;
230 int argc; 231 int argc;
231 Keys *key; 232 Keys *key;
233 std::string slitlist_path;
232 //default arguments for titlebar left and right 234 //default arguments for titlebar left and right
233 static Fluxbox::Titlebar m_titlebar_left[], m_titlebar_right[]; 235 static Fluxbox::Titlebar m_titlebar_left[], m_titlebar_right[];
234 236
235protected: 237protected:
236 Fluxbox(int, char **, char * = 0, char * = 0); 238 Fluxbox(int, char **, char * = 0, char * = 0);
237 char *getRcFilename(); 239 char *getRcFilename();
240 void getDefaultDataFilename(char *, std::string &);
238 void load_rc(void); 241 void load_rc(void);
239 242
240 void reload_rc(void); 243 void reload_rc(void);