WIP: fixed assertion in klayout_main test.

This commit is contained in:
Matthias Koefferlein 2020-02-11 00:39:19 +01:00
parent ad775413f3
commit c801df7f7b
9 changed files with 19 additions and 28 deletions

8
TODO
View File

@ -32,9 +32,14 @@ DONE 8. We can move menu initialization of LV-specifics to the LayoutView and
12. Default ctor for MainWindow so a pymod script can instantiate one (?)
13. Re-think concept of Action as "smart pointers": ConfigureAction
violates this. ConfigureAction should be ActionHandle variant?
Action as pointer and smart pointers for managing?
Tests:
- DONE: compare menu layout
- test every menu function
- DONE: test every menu function
- adding of new tech
- DONE: adding of rulers/removing
- ruby plugin (debugging, re-running)
@ -42,4 +47,5 @@ Tests:
- DONE: funktionieren die check marks vor den menus? (Mode, selection modes, ruler template)
- DONE: check whether there is a replacement for the "cm_..." methods and tests them (at least one)
- DONE: check if changing the default grid works
- Run unit tests -> klayout_main_tests:main is failing

View File

@ -210,7 +210,7 @@ void
PluginDeclaration::update_current_template ()
{
lay::Dispatcher *mp = lay::Dispatcher::instance ();
if (! mp || ! mp->menu ()) {
if (! mp || ! mp->has_ui ()) {
return;
}
@ -240,7 +240,7 @@ void
PluginDeclaration::update_menu ()
{
lay::Dispatcher *mp = lay::Dispatcher::instance ();
if (! mp || ! mp->menu ()) {
if (! mp || ! mp->has_ui ()) {
return;
}

View File

@ -272,7 +272,7 @@ public:
virtual void initialize (lay::Dispatcher *root)
{
lay::Dispatcher *mp = lay::Dispatcher::instance ();
if (! mp || ! mp->menu ()) {
if (! mp || ! mp->has_ui ()) {
return;
}
@ -311,7 +311,7 @@ public:
void update_menu (combine_mode_type cm)
{
lay::Dispatcher *mp = lay::Dispatcher::instance ();
if (! mp || ! mp->menu ()) {
if (! mp || ! mp->has_ui ()) {
return;
}
@ -374,7 +374,7 @@ public:
void initialized (lay::Dispatcher *root)
{
lay::Dispatcher *mp = lay::Dispatcher::instance ();
if (! mp || ! mp->menu ()) {
if (! mp || ! mp->has_ui ()) {
return;
}

View File

@ -299,7 +299,7 @@ void
TechnologyController::update_current_technology ()
{
lay::Dispatcher *pr = lay::Dispatcher::instance ();
if (! pr || ! pr->menu ()) {
if (! pr || ! pr->has_ui ()) {
return;
}
@ -326,7 +326,7 @@ void
TechnologyController::update_menu ()
{
lay::Dispatcher *pr = lay::Dispatcher::instance ();
if (! pr || ! pr->menu ()) {
if (! pr || ! pr->has_ui ()) {
return;
}

View File

@ -161,10 +161,6 @@ BookmarksView::refresh ()
void
BookmarksView::context_menu (const QPoint &p)
{
if (! mp_view->menu ()) {
return;
}
QListView *bm_list = dynamic_cast<QListView *> (sender ());
if (bm_list) {
QMenu *ctx_menu = mp_view->menu ()->detached_menu ("bookmarks_context_menu");

View File

@ -114,6 +114,11 @@ public:
*/
virtual QWidget *menu_parent_widget () { return 0; }
/**
* @brief Returns true, if the dispatcher supplies a user interface
*/
virtual bool has_ui () { return menu_parent_widget () != 0; }
/**
* @brief Gets the AbstractMenu object
*

View File

@ -323,10 +323,6 @@ HierarchyControlPanel::event (QEvent *e)
void
HierarchyControlPanel::context_menu (const QPoint &p)
{
if (! mp_view->menu ()) {
return;
}
QTreeView *cell_list = dynamic_cast<QTreeView *> (sender ());
if (cell_list) {
set_active_celltree_from_sender ();

View File

@ -1605,10 +1605,6 @@ LayerControlPanel::cm_expand_all ()
void
LayerControlPanel::tab_context_menu (const QPoint &p)
{
if (! mp_view->menu ()) {
return;
}
QMenu *ctx_menu = mp_view->menu ()->detached_menu ("lcp_tabs_context_menu");
if (ctx_menu) {
ctx_menu->exec (mp_tab_bar->mapToGlobal (p));
@ -1618,10 +1614,6 @@ LayerControlPanel::tab_context_menu (const QPoint &p)
void
LayerControlPanel::context_menu (const QPoint &p)
{
if (! mp_view->menu ()) {
return;
}
QMenu *ctx_menu = mp_view->menu ()->detached_menu ("lcp_context_menu");
if (ctx_menu) {
ctx_menu->exec (mp_layer_list->mapToGlobal (p));

View File

@ -318,10 +318,6 @@ LibrariesView::event (QEvent *e)
void
LibrariesView::context_menu (const QPoint &p)
{
if (! mp_view->menu ()) {
return;
}
QTreeView *cell_list = dynamic_cast<QTreeView *> (sender ());
if (cell_list) {
QMenu *ctx_menu = mp_view->menu ()->detached_menu ("lib_context_menu");