summaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 2e05b9c..b3ba39a 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.204 2003/07/19 03:59:55 rathnor Exp $ 25// $Id: Screen.cc,v 1.205 2003/07/20 02:45:57 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1940,10 +1940,29 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
1940 return ((menu.numberOfItems() == 0) ? true : false); 1940 return ((menu.numberOfItems() == 0) ? true : false);
1941} 1941}
1942 1942
1943void BScreen::addConfigMenu(const char *label, FbTk::Menu &menu) {
1944 m_configmenu_list.push_back(std::make_pair(label, &menu));
1945 setupConfigmenu(*m_configmenu.get());
1946}
1947
1948void BScreen::removeConfigMenu(FbTk::Menu &menu) {
1949 Configmenus::iterator it = m_configmenu_list.begin();
1950 Configmenus::iterator it_end = m_configmenu_list.end();
1951 for (; it != it_end; ++it) {
1952 if (it->second == &menu) {
1953 m_configmenu_list.erase(it);
1954 break;
1955 }
1956 }
1957 setupConfigmenu(*m_configmenu.get());
1958}
1959
1943void BScreen::setupConfigmenu(FbTk::Menu &menu) { 1960void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1944 I18n *i18n = I18n::instance(); 1961 I18n *i18n = I18n::instance();
1945 using namespace FBNLS; 1962 using namespace FBNLS;
1946 1963
1964 menu.removeAll();
1965
1947 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); 1966 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand();
1948 FbTk::RefCount<FbTk::Command> saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(), 1967 FbTk::RefCount<FbTk::Command> saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(),
1949 &Fluxbox::save_rc)); 1968 &Fluxbox::save_rc));
@@ -1997,6 +2016,11 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1997 } 2016 }
1998#endif // SLIT 2017#endif // SLIT
1999 2018
2019 Configmenus::iterator it = m_configmenu_list.begin();
2020 Configmenus::iterator it_end = m_configmenu_list.end();
2021 for (; it != it_end; ++it)
2022 menu.insert(it->first, it->second);
2023
2000 menu.insert(new 2024 menu.insert(new
2001 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuImageDithering, 2025 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuImageDithering,
2002 "Image Dithering"), 2026 "Image Dithering"),