UI-top-level: fix GTK framework initialisation order

This commit is contained in:
Fischlurch 2017-05-03 23:09:01 +02:00
parent 09dec65950
commit a3ed982da4
3 changed files with 26 additions and 11 deletions

View file

@ -66,6 +66,18 @@ namespace ctrl {
{ } { }
/**
* Initialise the GTK framework libraries
*/
ApplicationBase::ApplicationBase()
: Gtk::UIManager()
, gtkMain_(&argc, nullptr)
{
Glib::thread_init();
Gdl::init();
}
/** /**
* Initialise the interface globally on application start. * Initialise the interface globally on application start.
* Setup the main application menu and bind the corresponding actions. * Setup the main application menu and bind the corresponding actions.
@ -73,15 +85,11 @@ namespace ctrl {
* @see lumiera::Config * @see lumiera::Config
*/ */
UiManager::UiManager (UiBus& bus) UiManager::UiManager (UiBus& bus)
: Gtk::UIManager() : ApplicationBase()
, globals_{new GlobalCtx{bus, *this}} , globals_{new GlobalCtx{bus, *this}}
, actions_{new Actions{*globals_}} , actions_{new Actions{*globals_}}
, styleManager_{new StyleManager{}} , styleManager_{new StyleManager{}}
, gtkMain_(&argc, nullptr)
{ {
Glib::thread_init();
Gdl::init();
actions_->populateMainActions (*this); actions_->populateMainActions (*this);
} }

View file

@ -64,6 +64,16 @@ namespace ctrl {
class Actions; class Actions;
/** Framework initialisation base */
class ApplicationBase
: public Gtk::UIManager
, boost::noncopyable
{
protected:
Gtk::Main gtkMain_;
ApplicationBase();
};
/** /**
* Manage global concerns regarding a coherent user interface. * Manage global concerns regarding a coherent user interface.
@ -72,17 +82,13 @@ namespace ctrl {
* menu / command actions and to enter the top-level model parts. * menu / command actions and to enter the top-level model parts.
*/ */
class UiManager class UiManager
: public Gtk::UIManager : public ApplicationBase
, boost::noncopyable
{ {
unique_ptr<GlobalCtx> globals_; unique_ptr<GlobalCtx> globals_;
unique_ptr<Actions> actions_; unique_ptr<Actions> actions_;
unique_ptr<workspace::StyleManager> styleManager_; unique_ptr<workspace::StyleManager> styleManager_;
Gtk::Main gtkMain_;
public: public:
/** /**
* There is one global UiManager instance, * There is one global UiManager instance,

View file

@ -290,7 +290,8 @@ psplay_insert (PSplay self, PSplaynode node, int splayfactor)
} }
else else
{ {
TODO ("policy for multiple entered items (before, after, fail, replace)"); WARN (psplay_dbg, "dropping duplicate entry for psplay");
///////////////////////////TODO policy for multiple entered items (before, after, fail, replace)
return NULL; return NULL;
} }
} }