WIP: refactoring ongoing.

This commit is contained in:
Matthias Koefferlein
2020-02-07 18:46:35 +01:00
parent 4210198179
commit 24ad1b2d26
7 changed files with 42 additions and 32 deletions
+6 -1
View File
@@ -116,8 +116,13 @@ public:
/**
* @brief Gets the AbstractMenu object
*
* This will deliver the actual menu - the one that is the root dispatcher's menu
*/
AbstractMenu *menu () { return &m_menu; }
AbstractMenu *menu ()
{
return (dispatcher () == this) ? &m_menu : dispatcher ()->menu ();
}
/**
* @brief Creates a configuration action with the given title, parameter name and value
+5 -12
View File
@@ -272,7 +272,7 @@ LayoutView::LayoutView (db::Manager *manager, bool editable, lay::Plugin *plugin
tl::DeferredMethodScheduler::instance ();
setObjectName (QString::fromUtf8 (name));
init (manager, dispatcher (), parent);
init (manager, parent);
}
LayoutView::LayoutView (lay::LayoutView *source, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, QWidget *parent, const char *name, unsigned int options)
@@ -293,7 +293,7 @@ LayoutView::LayoutView (lay::LayoutView *source, db::Manager *manager, bool edit
m_annotation_shapes = source->m_annotation_shapes;
init (manager, dispatcher (), parent);
init (manager, parent);
// set the handle reference and clear all cell related stuff
m_cellviews = source->cellview_list ();
@@ -355,12 +355,12 @@ LayoutView::eventFilter(QObject *obj, QEvent *event)
}
void
LayoutView::init (db::Manager *mgr, lay::Dispatcher *dispatcher, QWidget * /*parent*/)
LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
{
manager (mgr);
if (! dispatcher) {
// build the context menus, nothing else so far.
if (dispatcher () == this) {
// if we're the root dispatcher build the context menus, nothing else so far.
menu ()->build (0, 0);
}
@@ -6473,13 +6473,6 @@ LayoutView::intrinsic_mouse_modes (std::vector<std::string> *descriptions)
return 2;
}
AbstractMenu *
LayoutView::menu ()
{
// NOTE: dispatcher is either this or the real end of the chain
return dispatcher ()->menu ();
}
int
LayoutView::default_mode ()
{
+1 -7
View File
@@ -220,12 +220,6 @@ public:
*/
static LayoutView *current ();
/**
* @brief Gets the abstract menu object for this view
* This is either the global menu object or the local one.
*/
AbstractMenu *menu ();
/**
* @brief Determine if there is something to copy
*
@@ -2892,7 +2886,7 @@ private:
bool m_active_cellview_changed_event_enabled;
tl::DeferredMethod<lay::LayoutView> dm_prop_changed;
void init (db::Manager *mgr, lay::Dispatcher *dispatcher, QWidget *parent);
void init (db::Manager *mgr, QWidget *parent);
void do_prop_changed ();
void do_redraw (int layer);