GUI: more HAVE_PUI defines
Mostly done by Fernando to enable Core-profile testing
This commit is contained in:
parent
ee3bab3437
commit
3986508911
3 changed files with 25 additions and 10 deletions
|
@ -143,8 +143,12 @@ private:
|
|||
void NasalMenuItem::initFromNode(SGPropertyNode_ptr config)
|
||||
{
|
||||
auto n = config->getChild("name");
|
||||
_name = n->getStringValue();
|
||||
n->addChangeListener(this);
|
||||
if (!n) {
|
||||
SG_LOG(SG_GUI, SG_DEV_WARN, "menu item without <name> element:" << config->getLocation());
|
||||
} else {
|
||||
_name = n->getStringValue();
|
||||
n->addChangeListener(this);
|
||||
}
|
||||
|
||||
if (n->getBoolValue("seperator") || nameIsSeperator(_name)) {
|
||||
_isSeperator = true;
|
||||
|
@ -177,7 +181,8 @@ void NasalMenuItem::initFromNode(SGPropertyNode_ptr config)
|
|||
_shortcut = n->getStringValue();
|
||||
}
|
||||
|
||||
_bindings = readBindingList(n->getChildren("binding"), globals->get_props());
|
||||
auto bindingNodes = n->getChildren("binding");
|
||||
_bindings = readBindingList(bindingNodes, globals->get_props());
|
||||
|
||||
n = config->getChild("menu");
|
||||
if (n) {
|
||||
|
|
|
@ -28,7 +28,10 @@
|
|||
|
||||
#include <Main/globals.hxx>
|
||||
#include <Scripting/NasalSys.hxx>
|
||||
|
||||
#if defined(HAVE_PUI)
|
||||
#include "PUIFileDialog.hxx"
|
||||
#endif
|
||||
|
||||
#if defined(SG_MAC)
|
||||
#include "CocoaFileDialog.hxx"
|
||||
|
@ -147,8 +150,11 @@ static naRef f_createFileDialog(const nasal::CallContext& ctx)
|
|||
FileDialogPtr fd(new CocoaFileDialog(usage));
|
||||
#elif defined(HAVE_QT)
|
||||
FileDialogPtr fd(new QtFileDialog(usage));
|
||||
#else
|
||||
#elif defined(HAVE_PUI)
|
||||
FileDialogPtr fd(new PUIFileDialog(usage));
|
||||
#else
|
||||
// we need a fallback implementation
|
||||
FileDialogPtr fd;
|
||||
#endif
|
||||
|
||||
return ctx.to_nasal(fd);
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "GL/glx.h"
|
||||
#endif
|
||||
|
||||
#include "FGPUIMenuBar.hxx"
|
||||
|
||||
#if defined(SG_MAC)
|
||||
#include "FGCocoaMenuBar.hxx"
|
||||
|
@ -54,6 +53,7 @@
|
|||
|
||||
#if defined(HAVE_PUI)
|
||||
#include "FGPUIDialog.hxx"
|
||||
#include "FGPUIMenuBar.hxx"
|
||||
#endif
|
||||
|
||||
#include "FGFontCache.hxx"
|
||||
|
@ -177,7 +177,9 @@ NewGUI::shutdown()
|
|||
_menubar.reset();
|
||||
_dialog_props.clear();
|
||||
|
||||
#if defined(HAVE_PUI)
|
||||
puCleanUpJunk();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -208,12 +210,14 @@ NewGUI::createMenuBarImplementation()
|
|||
// _menubar.reset(new FGWindowsMenuBar);
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_PUI)
|
||||
if (!_menubar.get() && _usePUI) {
|
||||
_menubar.reset(new FGPUIMenuBar);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!_menubar.get()) {
|
||||
if (_usePUI) {
|
||||
_menubar.reset(new FGPUIMenuBar);
|
||||
} else {
|
||||
_menubar.reset(new FGNasalMenuBar);
|
||||
}
|
||||
_menubar.reset(new FGNasalMenuBar);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue