mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-12 23:44:25 +02:00
Merge remote-tracking branch 'upstream/master' into fix/904-quit-during-modal
This commit is contained in:
@@ -576,9 +576,11 @@ void QETElementEditor::updateInformations()
|
||||
|| selection_xml_name == "ellipse"
|
||||
|| selection_xml_name == "arc")
|
||||
{
|
||||
clearToolsDock();
|
||||
//We add the editor widget
|
||||
ElementItemEditor *editor = static_cast<ElementItemEditor*>(m_editors[selection_xml_name]);
|
||||
if (m_tools_dock_stack -> widget(1) != editor) {
|
||||
clearToolsDock();
|
||||
}
|
||||
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO Check if it takes longer than setting the parts again to the editor.")
|
||||
@@ -611,11 +613,15 @@ void QETElementEditor::updateInformations()
|
||||
success = editor -> setParts(cep_list);
|
||||
}
|
||||
if (success) {
|
||||
m_tools_dock_stack -> insertWidget(1, editor);
|
||||
if (m_tools_dock_stack -> widget(1) != editor) {
|
||||
m_tools_dock_stack -> insertWidget(1, editor);
|
||||
}
|
||||
m_tools_dock_stack -> setCurrentIndex(1);
|
||||
}
|
||||
else {
|
||||
qDebug() << "Editor refused part.";
|
||||
clearToolsDock();
|
||||
m_tools_dock_stack->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -629,8 +635,10 @@ void QETElementEditor::updateInformations()
|
||||
// multi edit for polygons makes no sense
|
||||
// TODO: maybe allowing multipart edit when number of points is the same?
|
||||
//We add the editor widget
|
||||
clearToolsDock();
|
||||
ElementItemEditor *editor = static_cast<ElementItemEditor*>(m_editors[selection_xml_name]);
|
||||
if (m_tools_dock_stack -> widget(1) != editor) {
|
||||
clearToolsDock();
|
||||
}
|
||||
CustomElementPart* part = editor -> currentPart();
|
||||
bool equal = part == cep_list.first();
|
||||
|
||||
@@ -640,11 +648,15 @@ void QETElementEditor::updateInformations()
|
||||
success = editor -> setPart(cep_list.first());
|
||||
}
|
||||
if (success) {
|
||||
m_tools_dock_stack -> insertWidget(1, editor);
|
||||
if (m_tools_dock_stack -> widget(1) != editor) {
|
||||
m_tools_dock_stack -> insertWidget(1, editor);
|
||||
}
|
||||
m_tools_dock_stack -> setCurrentIndex(1);
|
||||
}
|
||||
else {
|
||||
qDebug() << "Editor refused part.";
|
||||
clearToolsDock();
|
||||
m_tools_dock_stack->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -658,15 +670,21 @@ void QETElementEditor::updateInformations()
|
||||
|
||||
//There's several parts selecteds and all can be edited by style editor.
|
||||
if (style_editable) {
|
||||
clearToolsDock();
|
||||
ElementItemEditor *selection_editor = m_editors["style"];
|
||||
if (m_tools_dock_stack -> widget(1) != selection_editor) {
|
||||
clearToolsDock();
|
||||
}
|
||||
if (selection_editor) {
|
||||
if (selection_editor -> setParts(cep_list)) {
|
||||
m_tools_dock_stack -> insertWidget(1, selection_editor);
|
||||
if (m_tools_dock_stack -> widget(1) != selection_editor) {
|
||||
m_tools_dock_stack -> insertWidget(1, selection_editor);
|
||||
}
|
||||
m_tools_dock_stack -> setCurrentIndex(1);
|
||||
}
|
||||
else {
|
||||
qDebug() << "Editor refused part.";
|
||||
clearToolsDock();
|
||||
m_tools_dock_stack->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user