mirror of https://github.com/KLayout/klayout.git
Open to silence instance copy mode dialog
By using "don't ask again" the instance copy mode dialog won't come up again. The mode can be reverted back to "ask" in the editor options.
This commit is contained in:
parent
717470a389
commit
2402adc45d
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CopyModeDialog</class>
|
<class>CopyModeDialog</class>
|
||||||
<widget class="QDialog" name="CopyModeDialog">
|
<widget class="QDialog" name="CopyModeDialog">
|
||||||
|
|
@ -13,24 +14,42 @@
|
||||||
<string>Copy Options</string>
|
<string>Copy Options</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout">
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Copy Mode</string>
|
<string>Copy Mode</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout">
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="shallow_rb">
|
<widget class="QRadioButton" name="shallow_rb">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -48,12 +67,19 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="dont_ask_cbx">
|
||||||
|
<property name="text">
|
||||||
|
<string>Don't ask again (you can always reset this in the editor options)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
|
|
@ -67,7 +93,7 @@
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>EditorOptionsGeneric</class>
|
<class>EditorOptionsGeneric</class>
|
||||||
<widget class="QWidget" name="EditorOptionsGeneric">
|
<widget class="QWidget" name="EditorOptionsGeneric">
|
||||||
|
|
@ -13,19 +14,37 @@
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout">
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Snapping</string>
|
<string>Snapping</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<property name="margin" >
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>9</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
|
|
@ -36,7 +55,7 @@
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>148</width>
|
<width>148</width>
|
||||||
<height>16</height>
|
<height>16</height>
|
||||||
|
|
@ -52,7 +71,7 @@
|
||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>16</width>
|
<width>16</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
|
|
@ -63,15 +82,13 @@
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<widget class="QLineEdit" name="edit_grid_le">
|
<widget class="QLineEdit" name="edit_grid_le">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy>
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<hsizetype>0</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Enter the grid in micron. Can be anisotropic ("gx,gy")</string>
|
<string>Enter the grid in micron. Can be anisotropic ("gx,gy")</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -124,7 +141,16 @@
|
||||||
<string>Angle Constraints</string>
|
<string>Angle Constraints</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<property name="margin" >
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>9</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
|
|
@ -182,12 +208,12 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="2" row="0" column="2" >
|
<item row="0" column="2" rowspan="2">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>257</width>
|
<width>257</width>
|
||||||
<height>41</height>
|
<height>41</height>
|
||||||
|
|
@ -201,34 +227,89 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Selection Mode</string>
|
<string>Hierarchical Features</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<property name="margin" >
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>9</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="1" >
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="hier_sel_cbx" >
|
<widget class="QLabel" name="label">
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy>
|
|
||||||
<hsizetype>7</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Select top level objects only</string>
|
<string>Copy mode</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Hierarchy </string>
|
<string>Shallow select</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="2">
|
||||||
|
<widget class="QComboBox" name="hier_copy_mode_cbx">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Shallow mode (instance only)</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Deep mode (instance and cell)</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Ask</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" colspan="3">
|
||||||
|
<widget class="QCheckBox" name="hier_sel_cbx">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Select top level objects only</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -241,12 +322,21 @@
|
||||||
<string>Instance Display</string>
|
<string>Instance Display</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="show_shapes_cbx">
|
<widget class="QCheckBox" name="show_shapes_cbx">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -257,9 +347,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="max_shapes_le">
|
<widget class="QLineEdit" name="max_shapes_le">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy>
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<hsizetype>5</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
|
@ -278,7 +366,7 @@
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
|
|
@ -294,7 +382,7 @@
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>121</width>
|
<width>121</width>
|
||||||
<height>51</height>
|
<height>51</height>
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ std::string cfg_edit_inst_column_x ("edit-inst-column_x");
|
||||||
std::string cfg_edit_inst_column_y ("edit-inst-column_y");
|
std::string cfg_edit_inst_column_y ("edit-inst-column_y");
|
||||||
std::string cfg_edit_inst_place_origin ("edit-inst-place-origin");
|
std::string cfg_edit_inst_place_origin ("edit-inst-place-origin");
|
||||||
std::string cfg_edit_top_level_selection ("edit-top-level-selection");
|
std::string cfg_edit_top_level_selection ("edit-top-level-selection");
|
||||||
|
std::string cfg_edit_hier_copy_mode ("edit-hier-copy-mode");
|
||||||
std::string cfg_edit_show_shapes_of_instances ("edit-show-shapes-of-instances");
|
std::string cfg_edit_show_shapes_of_instances ("edit-show-shapes-of-instances");
|
||||||
std::string cfg_edit_max_shapes_of_instances ("edit-max-shapes-of-instances");
|
std::string cfg_edit_max_shapes_of_instances ("edit-max-shapes-of-instances");
|
||||||
std::string cfg_edit_global_grid ("grid-micron");
|
std::string cfg_edit_global_grid ("grid-micron");
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ extern EDT_PUBLIC std::string cfg_edit_inst_column_x;
|
||||||
extern EDT_PUBLIC std::string cfg_edit_inst_column_y;
|
extern EDT_PUBLIC std::string cfg_edit_inst_column_y;
|
||||||
extern EDT_PUBLIC std::string cfg_edit_inst_place_origin;
|
extern EDT_PUBLIC std::string cfg_edit_inst_place_origin;
|
||||||
extern EDT_PUBLIC std::string cfg_edit_top_level_selection;
|
extern EDT_PUBLIC std::string cfg_edit_top_level_selection;
|
||||||
|
extern EDT_PUBLIC std::string cfg_edit_hier_copy_mode;
|
||||||
extern EDT_PUBLIC std::string cfg_edit_combine_mode;
|
extern EDT_PUBLIC std::string cfg_edit_combine_mode;
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ CopyModeDialog::~CopyModeDialog ()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CopyModeDialog::exec_dialog (unsigned int &mode)
|
CopyModeDialog::exec_dialog (unsigned int &mode, bool &dont_ask)
|
||||||
{
|
{
|
||||||
if (mode == 0) {
|
if (mode == 0) {
|
||||||
shallow_rb->setChecked (true);
|
shallow_rb->setChecked (true);
|
||||||
|
|
@ -207,6 +207,7 @@ CopyModeDialog::exec_dialog (unsigned int &mode)
|
||||||
} else {
|
} else {
|
||||||
mode = 1;
|
mode = 1;
|
||||||
}
|
}
|
||||||
|
dont_ask = dont_ask_cbx->isChecked ();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
CopyModeDialog (QWidget *parent);
|
CopyModeDialog (QWidget *parent);
|
||||||
virtual ~CopyModeDialog ();
|
virtual ~CopyModeDialog ();
|
||||||
|
|
||||||
bool exec_dialog (unsigned int &mode);
|
bool exec_dialog (unsigned int &mode, bool &dont_ask);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,8 @@ EditorOptionsGeneric::apply (lay::Plugin *root)
|
||||||
root->config_set (cfg_edit_connect_angle_mode, acc.to_string (lay::angle_constraint_type (mp_ui->conn_angle_cb->currentIndex ())));
|
root->config_set (cfg_edit_connect_angle_mode, acc.to_string (lay::angle_constraint_type (mp_ui->conn_angle_cb->currentIndex ())));
|
||||||
|
|
||||||
root->config_set (cfg_edit_top_level_selection, tl::to_string (mp_ui->hier_sel_cbx->isChecked ()));
|
root->config_set (cfg_edit_top_level_selection, tl::to_string (mp_ui->hier_sel_cbx->isChecked ()));
|
||||||
|
int cpm = mp_ui->hier_copy_mode_cbx->currentIndex ();
|
||||||
|
root->config_set (cfg_edit_hier_copy_mode, tl::to_string ((cpm < 0 || cpm > 1) ? -1 : cpm));
|
||||||
root->config_set (cfg_edit_snap_to_objects, tl::to_string (mp_ui->snap_objects_cbx->isChecked ()));
|
root->config_set (cfg_edit_snap_to_objects, tl::to_string (mp_ui->snap_objects_cbx->isChecked ()));
|
||||||
|
|
||||||
unsigned int max_shapes = 1000;
|
unsigned int max_shapes = 1000;
|
||||||
|
|
@ -321,6 +323,10 @@ EditorOptionsGeneric::setup (lay::Plugin *root)
|
||||||
root->config_get (cfg_edit_top_level_selection, top_level_sel);
|
root->config_get (cfg_edit_top_level_selection, top_level_sel);
|
||||||
mp_ui->hier_sel_cbx->setChecked (top_level_sel);
|
mp_ui->hier_sel_cbx->setChecked (top_level_sel);
|
||||||
|
|
||||||
|
int cpm = -1;
|
||||||
|
root->config_get (cfg_edit_hier_copy_mode, cpm);
|
||||||
|
mp_ui->hier_copy_mode_cbx->setCurrentIndex ((cpm < 0 || cpm > 1) ? 2 : cpm);
|
||||||
|
|
||||||
bool snap_to_objects = false;
|
bool snap_to_objects = false;
|
||||||
root->config_get (cfg_edit_snap_to_objects, snap_to_objects);
|
root->config_get (cfg_edit_snap_to_objects, snap_to_objects);
|
||||||
mp_ui->snap_objects_cbx->setChecked (snap_to_objects);
|
mp_ui->snap_objects_cbx->setChecked (snap_to_objects);
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,7 @@ public:
|
||||||
virtual void get_options (std::vector < std::pair<std::string, std::string> > &options) const
|
virtual void get_options (std::vector < std::pair<std::string, std::string> > &options) const
|
||||||
{
|
{
|
||||||
options.push_back (std::pair<std::string, std::string> (cfg_edit_top_level_selection, "false"));
|
options.push_back (std::pair<std::string, std::string> (cfg_edit_top_level_selection, "false"));
|
||||||
|
options.push_back (std::pair<std::string, std::string> (cfg_edit_hier_copy_mode, "-1"));
|
||||||
options.push_back (std::pair<std::string, std::string> (cfg_edit_grid, ""));
|
options.push_back (std::pair<std::string, std::string> (cfg_edit_grid, ""));
|
||||||
options.push_back (std::pair<std::string, std::string> (cfg_edit_snap_to_objects, "false"));
|
options.push_back (std::pair<std::string, std::string> (cfg_edit_snap_to_objects, "false"));
|
||||||
options.push_back (std::pair<std::string, std::string> (cfg_edit_move_angle_mode, "any"));
|
options.push_back (std::pair<std::string, std::string> (cfg_edit_move_angle_mode, "any"));
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ Service::Service (db::Manager *manager, lay::LayoutView *view, db::ShapeIterator
|
||||||
m_connect_ac (lay::AC_Any), m_move_ac (lay::AC_Any), m_alt_ac (lay::AC_Global),
|
m_connect_ac (lay::AC_Any), m_move_ac (lay::AC_Any), m_alt_ac (lay::AC_Global),
|
||||||
m_snap_to_objects (false),
|
m_snap_to_objects (false),
|
||||||
m_top_level_sel (false), m_show_shapes_of_instances (true), m_max_shapes_of_instances (1000),
|
m_top_level_sel (false), m_show_shapes_of_instances (true), m_max_shapes_of_instances (1000),
|
||||||
|
m_hier_copy_mode (-1),
|
||||||
m_indicate_secondary_selection (false),
|
m_indicate_secondary_selection (false),
|
||||||
m_seq (0),
|
m_seq (0),
|
||||||
dm_selection_to_view (this, &edt::Service::do_selection_to_view)
|
dm_selection_to_view (this, &edt::Service::do_selection_to_view)
|
||||||
|
|
@ -134,6 +135,7 @@ Service::Service (db::Manager *manager, lay::LayoutView *view)
|
||||||
m_connect_ac (lay::AC_Any), m_move_ac (lay::AC_Any), m_alt_ac (lay::AC_Global),
|
m_connect_ac (lay::AC_Any), m_move_ac (lay::AC_Any), m_alt_ac (lay::AC_Global),
|
||||||
m_snap_to_objects (true),
|
m_snap_to_objects (true),
|
||||||
m_top_level_sel (false), m_show_shapes_of_instances (true), m_max_shapes_of_instances (1000),
|
m_top_level_sel (false), m_show_shapes_of_instances (true), m_max_shapes_of_instances (1000),
|
||||||
|
m_hier_copy_mode (-1),
|
||||||
m_indicate_secondary_selection (false),
|
m_indicate_secondary_selection (false),
|
||||||
m_seq (0),
|
m_seq (0),
|
||||||
dm_selection_to_view (this, &edt::Service::do_selection_to_view)
|
dm_selection_to_view (this, &edt::Service::do_selection_to_view)
|
||||||
|
|
@ -255,6 +257,8 @@ Service::configure (const std::string &name, const std::string &value)
|
||||||
return true; // taken
|
return true; // taken
|
||||||
} else if (name == cfg_edit_top_level_selection) {
|
} else if (name == cfg_edit_top_level_selection) {
|
||||||
tl::from_string (value, m_top_level_sel);
|
tl::from_string (value, m_top_level_sel);
|
||||||
|
} else if (name == cfg_edit_hier_copy_mode) {
|
||||||
|
tl::from_string (value, m_hier_copy_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // not taken
|
return false; // not taken
|
||||||
|
|
@ -309,6 +313,9 @@ Service::copy_selected ()
|
||||||
edt::CopyModeDialog mode_dialog (view ());
|
edt::CopyModeDialog mode_dialog (view ());
|
||||||
|
|
||||||
bool need_to_ask_for_copy_mode = false;
|
bool need_to_ask_for_copy_mode = false;
|
||||||
|
unsigned int inst_mode = 0;
|
||||||
|
|
||||||
|
if (m_hier_copy_mode < 0) {
|
||||||
for (objects::const_iterator r = m_selection.begin (); r != m_selection.end () && ! need_to_ask_for_copy_mode; ++r) {
|
for (objects::const_iterator r = m_selection.begin (); r != m_selection.end () && ! need_to_ask_for_copy_mode; ++r) {
|
||||||
if (r->is_cell_inst ()) {
|
if (r->is_cell_inst ()) {
|
||||||
const db::Cell &cell = view ()->cellview (r->cv_index ())->layout ().cell (r->back ().inst_ptr.cell_index ());
|
const db::Cell &cell = view ()->cellview (r->cv_index ())->layout ().cell (r->back ().inst_ptr.cell_index ());
|
||||||
|
|
@ -317,10 +324,19 @@ Service::copy_selected ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
inst_mode = (unsigned int) m_hier_copy_mode;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int inst_mode = 0;
|
bool dont_ask_again = false;
|
||||||
|
|
||||||
if (! need_to_ask_for_copy_mode || mode_dialog.exec_dialog (inst_mode)) {
|
if (! need_to_ask_for_copy_mode || mode_dialog.exec_dialog (inst_mode, dont_ask_again)) {
|
||||||
|
|
||||||
|
// store the given value "forever"
|
||||||
|
if (dont_ask_again) {
|
||||||
|
plugin_root ()->config_set (cfg_edit_hier_copy_mode, tl::to_string (inst_mode));
|
||||||
|
plugin_root ()->config_end ();
|
||||||
|
}
|
||||||
|
|
||||||
// create one ClipboardData object per cv_index because, this one assumes that there is
|
// create one ClipboardData object per cv_index because, this one assumes that there is
|
||||||
// only one source layout object.
|
// only one source layout object.
|
||||||
|
|
|
||||||
|
|
@ -579,6 +579,9 @@ private:
|
||||||
bool m_show_shapes_of_instances;
|
bool m_show_shapes_of_instances;
|
||||||
unsigned int m_max_shapes_of_instances;
|
unsigned int m_max_shapes_of_instances;
|
||||||
|
|
||||||
|
// Hierarchical copy mode (-1: ask, 0: shallow, 1: deep)
|
||||||
|
int m_hier_copy_mode;
|
||||||
|
|
||||||
// Sequence number of selection
|
// Sequence number of selection
|
||||||
bool m_indicate_secondary_selection;
|
bool m_indicate_secondary_selection;
|
||||||
unsigned long m_seq;
|
unsigned long m_seq;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue