Issue 984 (#987)

* WIP: first attempt to fix issue-983

* WIP: bugfixes

* Fixed a problem with displaying empty cell dimensions, one warning

* Another fix: don't allow proxy cells to be selected in the instance properties dialog. This creates a confusing behaviour

* Fixed a few flaws in the cell selection scheme on the instance properties dialog.

* Early warning when trying to build a recursive hierarchy.

* Another fix: avoid too much undo in case of errors thrown during 'apply' followed by 'cancel'

* First attempt to fix issue 984

* Fixed issue-983 solution

* Fixed the modification status of PCell parameters for 'apply to all'
This commit is contained in:
Matthias Köfferlein
2022-02-08 19:07:04 +01:00
committed by GitHub
parent 285a5e9fca
commit d764adb101
9 changed files with 197 additions and 17 deletions
+82
View File
@@ -0,0 +1,82 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "layBusy.h"
#include "tlThreads.h"
namespace lay
{
tl::Mutex s_lock;
BusyMode *sp_busy_mode = 0;
// ----------------------------------------------------------------------------------------------------------
BusyMode::BusyMode ()
{
tl::MutexLocker locker (&s_lock);
if (sp_busy_mode == 0) {
sp_busy_mode = this;
}
}
BusyMode::~BusyMode ()
{
tl::MutexLocker locker (&s_lock);
if (sp_busy_mode == this) {
sp_busy_mode = 0;
}
}
// ----------------------------------------------------------------------------------------------------------
BusySection::BusySection ()
{
tl::MutexLocker locker (&s_lock);
mp_busy_mode = sp_busy_mode;
m_previous_mode = false;
if (mp_busy_mode) {
m_previous_mode = mp_busy_mode->is_busy ();
mp_busy_mode->enter_busy_mode (true);
}
}
BusySection::~BusySection ()
{
tl::MutexLocker locker (&s_lock);
if (sp_busy_mode == mp_busy_mode && mp_busy_mode) {
mp_busy_mode->enter_busy_mode (m_previous_mode);
}
mp_busy_mode = 0;
}
bool
BusySection::is_busy ()
{
tl::MutexLocker locker (&s_lock);
return sp_busy_mode && sp_busy_mode->is_busy ();
}
// ----------------------------------------------------------------------------------------------------------
}
+65
View File
@@ -0,0 +1,65 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HDR_layBusy
#define HDR_layBusy
#include "laybasicCommon.h"
namespace lay
{
/**
* @brief An interface providing the "busy" methods
*
* There must be one provider implementing this interface.
*/
class LAYBASIC_PUBLIC BusyMode
{
public:
BusyMode ();
virtual ~BusyMode ();
virtual bool is_busy () const = 0;
virtual void enter_busy_mode (bool bm) = 0;
};
/**
* @brief A RAII implementation of the busy mode setter
*/
class LAYBASIC_PUBLIC BusySection
{
public:
BusySection ();
~BusySection ();
static bool is_busy ();
private:
bool m_previous_mode;
BusyMode *mp_busy_mode;
};
}
#endif
@@ -42,6 +42,7 @@
#include "dbClipboard.h"
#include "dbClipboardData.h"
#include "layBusy.h"
#include "layHierarchyControlPanel.h"
#include "layCellTreeModel.h"
#include "layLayoutView.h"
@@ -146,6 +147,8 @@ HCPCellTreeWidget::startDrag (Qt::DropActions supportedActions)
return;
}
lay::BusySection busy_section; // issue 984
QDrag *drag = new QDrag (this);
drag->setMimeData(data);
QPixmap px (1, 1);
@@ -44,6 +44,7 @@
#include "dbClipboardData.h"
#include "dbLibraryManager.h"
#include "dbLibrary.h"
#include "layBusy.h"
#include "layLibrariesView.h"
#include "layCellTreeModel.h"
#include "layLayoutView.h"
@@ -136,6 +137,8 @@ LibraryTreeWidget::startDrag (Qt::DropActions supportedActions)
return;
}
lay::BusySection busy_section; // issue 984
QDrag *drag = new QDrag (this);
drag->setMimeData(data);
QPixmap px (1, 1);
+2
View File
@@ -102,6 +102,7 @@ SOURCES = \
layBrowserDialog.cc \
layBrowserPanel.cc \
layBrowseShapesForm.cc \
layBusy.cc \
layCanvasPlane.cc \
layCellSelectionForm.cc \
layCellTreeModel.cc \
@@ -208,6 +209,7 @@ HEADERS = \
layBrowser.h \
layBrowserPanel.h \
layBrowseShapesForm.h \
layBusy.h \
layCanvasPlane.h \
layCellSelectionForm.h \
layCellTreeModel.h \