UI-top-level: fix GTK framework initialisation order
This commit is contained in:
parent
09dec65950
commit
a3ed982da4
3 changed files with 26 additions and 11 deletions
|
|
@ -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.
|
||||
* Setup the main application menu and bind the corresponding actions.
|
||||
|
|
@ -73,15 +85,11 @@ namespace ctrl {
|
|||
* @see lumiera::Config
|
||||
*/
|
||||
UiManager::UiManager (UiBus& bus)
|
||||
: Gtk::UIManager()
|
||||
: ApplicationBase()
|
||||
, globals_{new GlobalCtx{bus, *this}}
|
||||
, actions_{new Actions{*globals_}}
|
||||
, styleManager_{new StyleManager{}}
|
||||
, gtkMain_(&argc, nullptr)
|
||||
{
|
||||
Glib::thread_init();
|
||||
Gdl::init();
|
||||
|
||||
actions_->populateMainActions (*this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,16 @@ namespace ctrl {
|
|||
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.
|
||||
|
|
@ -72,17 +82,13 @@ namespace ctrl {
|
|||
* menu / command actions and to enter the top-level model parts.
|
||||
*/
|
||||
class UiManager
|
||||
: public Gtk::UIManager
|
||||
, boost::noncopyable
|
||||
: public ApplicationBase
|
||||
{
|
||||
|
||||
unique_ptr<GlobalCtx> globals_;
|
||||
unique_ptr<Actions> actions_;
|
||||
|
||||
unique_ptr<workspace::StyleManager> styleManager_;
|
||||
|
||||
Gtk::Main gtkMain_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* There is one global UiManager instance,
|
||||
|
|
|
|||
|
|
@ -290,7 +290,8 @@ psplay_insert (PSplay self, PSplaynode node, int splayfactor)
|
|||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue