aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-10 12:55:53 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 09:57:21 (GMT)
commit22713a05e1f0b25cdf3a34f6cf7eb1f3c4250ffe (patch)
treee81be07e2c7fa248684d5e2ca5ac4c6d92a26ae7
parentb9170680f5970237c93dfdd294c8232ce0b562be (diff)
downloadfluxbox_pavel-22713a05e1f0b25cdf3a34f6cf7eb1f3c4250ffe.zip
fluxbox_pavel-22713a05e1f0b25cdf3a34f6cf7eb1f3c4250ffe.tar.bz2
Attach a modifiedSig handler to the session.appsFile resource
-rw-r--r--src/AtomHandler.hh2
-rw-r--r--src/Remember.cc17
-rw-r--r--src/Remember.hh4
-rw-r--r--src/fluxbox.cc1
-rw-r--r--src/fluxbox.hh2
5 files changed, 9 insertions, 17 deletions
diff --git a/src/AtomHandler.hh b/src/AtomHandler.hh
index 6e517d0..7dd6f54 100644
--- a/src/AtomHandler.hh
+++ b/src/AtomHandler.hh
@@ -58,8 +58,6 @@ public:
58 58
59 virtual bool propertyNotify(WinClient &winclient, Atom the_property) = 0; 59 virtual bool propertyNotify(WinClient &winclient, Atom the_property) = 0;
60 60
61 virtual void reconfigure() {}
62
63 /// should this object be updated or not? 61 /// should this object be updated or not?
64 bool update() const { return m_update; } 62 bool update() const { return m_update; }
65 63
diff --git a/src/Remember.cc b/src/Remember.cc
index c010d07..544fed8 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -635,7 +635,9 @@ Remember::Remember():
635 enableUpdate(); 635 enableUpdate();
636 636
637 m_reloader->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<Remember>(*this, &Remember::reload))); 637 m_reloader->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<Remember>(*this, &Remember::reload)));
638 reconfigure(); 638 m_reloader->setMainFile(*Fluxbox::instance()->getAppsResource());
639 join(Fluxbox::instance()->getAppsResource().modifiedSig(),
640 FbTk::MemFun(*m_reloader, &FbTk::AutoReloadHelper::setMainFile));
639} 641}
640 642
641Remember::~Remember() { 643Remember::~Remember() {
@@ -702,19 +704,12 @@ Application * Remember::add(WinClient &winclient) {
702 return app; 704 return app;
703} 705}
704 706
705
706
707
708void Remember::reconfigure() {
709 m_reloader->setMainFile(Fluxbox::instance()->getAppsFilename());
710}
711
712void Remember::checkReload() { 707void Remember::checkReload() {
713 m_reloader->checkReload(); 708 m_reloader->checkReload();
714} 709}
715 710
716void Remember::reload() { 711void Remember::reload() {
717 string apps_string = FbTk::StringUtil::expandFilename(Fluxbox::instance()->getAppsFilename()); 712 const string &apps_string = FbTk::StringUtil::expandFilename(*Fluxbox::instance()->getAppsResource());
718 713
719 714
720 fbdbg<<"("<<__FUNCTION__<<"): Loading apps file ["<<apps_string<<"]"<<endl; 715 fbdbg<<"("<<__FUNCTION__<<"): Loading apps file ["<<apps_string<<"]"<<endl;
@@ -860,7 +855,7 @@ void Remember::reload() {
860 855
861void Remember::save() { 856void Remember::save() {
862 857
863 string apps_string = FbTk::StringUtil::expandFilename(Fluxbox::instance()->getAppsFilename()); 858 const string &apps_string = FbTk::StringUtil::expandFilename(*Fluxbox::instance()->getAppsResource());
864 859
865 fbdbg<<"("<<__FUNCTION__<<"): Saving apps file ["<<apps_string<<"]"<<endl; 860 fbdbg<<"("<<__FUNCTION__<<"): Saving apps file ["<<apps_string<<"]"<<endl;
866 861
@@ -1036,7 +1031,7 @@ void Remember::save() {
1036 } 1031 }
1037 apps_file.close(); 1032 apps_file.close();
1038 // update timestamp to avoid unnecessary reload 1033 // update timestamp to avoid unnecessary reload
1039 m_reloader->addFile(Fluxbox::instance()->getAppsFilename()); 1034 m_reloader->addFile(*Fluxbox::instance()->getAppsResource());
1040} 1035}
1041 1036
1042bool Remember::isRemembered(WinClient &winclient, Attribute attrib) { 1037bool Remember::isRemembered(WinClient &winclient, Attribute attrib) {
diff --git a/src/Remember.hh b/src/Remember.hh
index a1abf5a..c2489dd 100644
--- a/src/Remember.hh
+++ b/src/Remember.hh
@@ -26,6 +26,7 @@
26#ifndef REMEMBER_HH 26#ifndef REMEMBER_HH
27#define REMEMBER_HH 27#define REMEMBER_HH
28 28
29#include "FbTk/Signal.hh"
29#include "AtomHandler.hh" 30#include "AtomHandler.hh"
30#include "ClientPattern.hh" 31#include "ClientPattern.hh"
31 32
@@ -50,7 +51,7 @@ class AutoReloadHelper;
50 * of modular plugin. Doing this should help give an idea of what 51 * of modular plugin. Doing this should help give an idea of what
51 * sort of interface abilities we'll need... 52 * sort of interface abilities we'll need...
52 */ 53 */
53class Remember : public AtomHandler { 54class Remember : public AtomHandler, private FbTk::SignalTracker {
54public: 55public:
55 /** 56 /**
56 * holds which attributes to remember 57 * holds which attributes to remember
@@ -107,7 +108,6 @@ public:
107 Application* add(WinClient &winclient); 108 Application* add(WinClient &winclient);
108 FluxboxWindow* findGroup(Application *, BScreen &screen); 109 FluxboxWindow* findGroup(Application *, BScreen &screen);
109 110
110 void reconfigure();
111 void checkReload(); 111 void checkReload();
112 void reload(); 112 void reload();
113 void save(); 113 void save();
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index f4d7c84..1cf97a4 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -1194,7 +1194,6 @@ void Fluxbox::reconfigure() {
1194void Fluxbox::real_reconfigure() { 1194void Fluxbox::real_reconfigure() {
1195 STLUtil::forAll(m_screen_list, mem_fun(&BScreen::reconfigure)); 1195 STLUtil::forAll(m_screen_list, mem_fun(&BScreen::reconfigure));
1196 m_key->reconfigure(); 1196 m_key->reconfigure();
1197 STLUtil::forAll(m_atomhandler, mem_fun(&AtomHandler::reconfigure));
1198} 1197}
1199 1198
1200BScreen *Fluxbox::findScreen(int id) { 1199BScreen *Fluxbox::findScreen(int id) {
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index c241fb7..f8a27bc 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -121,8 +121,8 @@ public:
121 const std::string &getStyleOverlayFilename() const { return *m_rc_styleoverlayfile; } 121 const std::string &getStyleOverlayFilename() const { return *m_rc_styleoverlayfile; }
122 122
123 const std::string &getMenuFilename() const { return *m_rc_menufile; } 123 const std::string &getMenuFilename() const { return *m_rc_menufile; }
124 const std::string &getAppsFilename() const { return *m_rc_appsfile; }
125 const std::string &getKeysFilename() const { return *m_rc_keyfile; } 124 const std::string &getKeysFilename() const { return *m_rc_keyfile; }
125 FbTk::StringResource &getAppsResource() { return m_rc_appsfile; }
126 int colorsPerChannel() const { return *m_rc_colors_per_channel; } 126 int colorsPerChannel() const { return *m_rc_colors_per_channel; }
127 int getTabsPadding() const { return *m_rc_tabs_padding; } 127 int getTabsPadding() const { return *m_rc_tabs_padding; }
128 128