don't require [begin] in included files
This commit is contained in:
parent
5bae25702e
commit
9128a64e62
5 changed files with 19 additions and 16 deletions
|
@ -1,6 +1,8 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 0.9.11
|
||||
*04/10/04:
|
||||
* Don't require [begin] tag for included menu files (Simon)
|
||||
MenuCreator.hh/cc Screen.cc Window.cc
|
||||
* Fix handling of setlocale return (Thanks Victor Yegorov)
|
||||
FbTk/XmbFontImp.cc
|
||||
*04/09/30:
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: MenuCreator.cc,v 1.16 2004/09/16 14:08:46 rathnor Exp $
|
||||
// $Id: MenuCreator.cc,v 1.17 2004/10/04 15:37:58 rathnor Exp $
|
||||
|
||||
#include "MenuCreator.hh"
|
||||
|
||||
|
@ -244,14 +244,14 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) {
|
|||
if (FbTk::Directory::isRegularFile(thisfile) &&
|
||||
(filelist[file_index][0] != '.') &&
|
||||
(thisfile[thisfile.length() - 1] != '~')) {
|
||||
MenuCreator::createFromFile(thisfile, menu);
|
||||
MenuCreator::createFromFile(thisfile, menu, false);
|
||||
Fluxbox::instance()->saveMenuFilename(thisfile.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// inject this file into the current menu
|
||||
MenuCreator::createFromFile(newfile, menu);
|
||||
MenuCreator::createFromFile(newfile, menu, false);
|
||||
Fluxbox::instance()->saveMenuFilename(newfile.c_str());
|
||||
}
|
||||
|
||||
|
@ -379,7 +379,7 @@ bool getStart(FbMenuParser &parser, std::string &label) {
|
|||
return true;
|
||||
}
|
||||
|
||||
FbTk::Menu *MenuCreator::createFromFile(const std::string &filename, int screen_number) {
|
||||
FbTk::Menu *MenuCreator::createFromFile(const std::string &filename, int screen_number, bool require_begin) {
|
||||
std::string real_filename = FbTk::StringUtil::expandFilename(filename);
|
||||
FbMenuParser parser(real_filename);
|
||||
if (!parser.isLoaded())
|
||||
|
@ -388,7 +388,7 @@ FbTk::Menu *MenuCreator::createFromFile(const std::string &filename, int screen_
|
|||
Fluxbox::instance()->saveMenuFilename(real_filename.c_str());
|
||||
|
||||
std::string label;
|
||||
if (!getStart(parser, label))
|
||||
if (require_begin && !getStart(parser, label))
|
||||
return 0;
|
||||
|
||||
FbTk::Menu *menu = createMenu(label, screen_number);
|
||||
|
@ -399,8 +399,8 @@ FbTk::Menu *MenuCreator::createFromFile(const std::string &filename, int screen_
|
|||
}
|
||||
|
||||
|
||||
bool MenuCreator::createFromFile(const std::string &filename,
|
||||
FbTk::Menu &inject_into) {
|
||||
bool MenuCreator::createFromFile(const std::string &filename,
|
||||
FbTk::Menu &inject_into, bool require_begin) {
|
||||
|
||||
std::string real_filename = FbTk::StringUtil::expandFilename(filename);
|
||||
FbMenuParser parser(real_filename);
|
||||
|
@ -408,7 +408,7 @@ bool MenuCreator::createFromFile(const std::string &filename,
|
|||
return false;
|
||||
|
||||
std::string label;
|
||||
if (!getStart(parser, label))
|
||||
if (require_begin && !getStart(parser, label))
|
||||
return false;
|
||||
|
||||
parseMenu(parser, inject_into);
|
||||
|
@ -418,7 +418,7 @@ bool MenuCreator::createFromFile(const std::string &filename,
|
|||
|
||||
bool MenuCreator::createFromFile(const std::string &filename,
|
||||
FbTk::Menu &inject_into,
|
||||
FluxboxWindow &win) {
|
||||
FluxboxWindow &win, bool require_begin) {
|
||||
std::string real_filename = FbTk::StringUtil::expandFilename(filename);
|
||||
FbMenuParser parser(real_filename);
|
||||
if (!parser.isLoaded())
|
||||
|
@ -426,7 +426,7 @@ bool MenuCreator::createFromFile(const std::string &filename,
|
|||
|
||||
std::string label;
|
||||
|
||||
if (!getStart(parser, label))
|
||||
if (require_begin && !getStart(parser, label))
|
||||
return false;
|
||||
|
||||
parseWindowMenu(parser, inject_into, win);
|
||||
|
|
|
@ -36,9 +36,10 @@ public:
|
|||
static FbTk::Menu *createMenu(const std::string &label, int screen_num);
|
||||
static FbTk::Menu *createFromFile(const std::string &filename, int screen_num);
|
||||
static FbTk::Menu *createMenuType(const std::string &label, int screen_num);
|
||||
static bool createFromFile(const std::string &filename, FbTk::Menu &inject_into);
|
||||
static bool createFromFile(const std::string &filename, FbTk::Menu &inject_into,
|
||||
bool require_begin);
|
||||
static bool createFromFile(const std::string &filename, FbTk::Menu &inject_into,
|
||||
FluxboxWindow &win);
|
||||
FluxboxWindow &win, bool require_begin);
|
||||
static bool createWindowMenuItem(const std::string &type, const std::string &label,
|
||||
FbTk::Menu &inject_into, FluxboxWindow &win);
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Screen.cc,v 1.293 2004/09/16 10:10:36 fluxgen Exp $
|
||||
// $Id: Screen.cc,v 1.294 2004/10/04 15:37:58 rathnor Exp $
|
||||
|
||||
|
||||
#include "Screen.hh"
|
||||
|
@ -1670,7 +1670,7 @@ void BScreen::initMenu() {
|
|||
Fluxbox * const fb = Fluxbox::instance();
|
||||
if (fb->getMenuFilename().size() > 0) {
|
||||
m_rootmenu.reset(MenuCreator::createFromFile(fb->getMenuFilename(),
|
||||
screenNumber()));
|
||||
screenNumber(), true));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Window.cc,v 1.300 2004/09/30 18:45:26 akir Exp $
|
||||
// $Id: Window.cc,v 1.301 2004/10/04 15:37:58 rathnor Exp $
|
||||
|
||||
#include "Window.hh"
|
||||
|
||||
|
@ -3583,7 +3583,7 @@ void FluxboxWindow::setupMenu() {
|
|||
menu().disableTitle(); // not titlebar
|
||||
|
||||
if (screen().windowMenuFilename().empty() ||
|
||||
! MenuCreator::createFromFile(screen().windowMenuFilename(), menu(), *this))
|
||||
! MenuCreator::createFromFile(screen().windowMenuFilename(), menu(), *this, true))
|
||||
|
||||
{
|
||||
MenuCreator::createWindowMenuItem("shade", "", menu(), *this);
|
||||
|
|
Loading…
Reference in a new issue