mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-30 14:54:13 +02:00
Remember dialog size and position across sessions
QETElementEditor, QETDiagramEditor and QETTemplateEditor already persist their geometry via QSettings; none of the modal QDialog subclasses did, so any dialog resized to see more of its content (Search and Replace, Diagram properties, Export, ...) is back to its default size the next time it's opened. Adds QET::trackDialogGeometry(), one call at the end of each dialog constructor (after any default resize()), following the same restoreGeometry()/saveGeometry() pattern as the three editors above, stored under [dialoggeometry] and keyed by class name by default. An explicit key is used for PropertiesEditorDialog, a single class templated over several unrelated wrapped editors, so they don't all fight over one saved size. Covers the 36 dialogs of the original change (#691) plus seven added since: RenumberElementsDialog, MaterialEntryDialog, AiAssistantDialog, DuplicateOffsetDialog, ImageTransparentColorDialog, PdfPagesDialog and WiringListDialog. Deliberately not touched: BackupDialog and ImageCropDialog, which setFixedSize() themselves, and MaterialSelectionDialog, which already restores its own size. A size saved while the dialog sat partly off-screen is restored on screen: restoreGeometry() moves it back inside the available screen (checked: saved at 1502,972 on a 1600x1000 screen, reopened at 600,317). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,12 +20,14 @@
|
||||
#include <QDate>
|
||||
#include "ui_renamedialog.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
RenameDialog::RenameDialog(QString path, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::RenameDialog),
|
||||
m_path(std::move(path))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
m_name = m_path.split("/").last();
|
||||
if (m_name.endsWith(".elmt")) m_name.remove(".elmt");
|
||||
ui->m_label->setText(tr("L'élément « %1 » existe déjà. Que souhaitez-vous faire ?").arg(m_path));
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ui_namelistdialog.h"
|
||||
#include "namelistwidget.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
#include <QPushButton>
|
||||
#include <QMessageBox>
|
||||
|
||||
@@ -27,6 +28,7 @@ NameListDialog::NameListDialog(QWidget *parent) :
|
||||
ui(new Ui::NameListDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
m_namelist_widget = new NameListWidget(this);
|
||||
ui->m_main_layout->insertWidget(1, m_namelist_widget);
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#ifndef PROPERTIESEDITORDIALOG_H
|
||||
#define PROPERTIESEDITORDIALOG_H
|
||||
|
||||
#include "../qet.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QVBoxLayout>
|
||||
@@ -74,6 +76,14 @@ class PropertiesEditorDialog : public QDialog
|
||||
this);
|
||||
vlayout->addWidget(button_box);
|
||||
|
||||
// Keyed on the wrapped editor's own class, not this
|
||||
// dialog's -- every instantiation of this constructor
|
||||
// template is the same PropertiesEditorDialog class,
|
||||
// so using its class name here would have every kind
|
||||
// of wrapped editor (conductor properties, element
|
||||
// properties, ...) fight over one saved size.
|
||||
QET::trackDialogGeometry(this, editor->metaObject()->className());
|
||||
|
||||
//Setup connection between button box and the editor
|
||||
connect(button_box,
|
||||
&QDialogButtonBox::clicked,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "../../qetinformation.h"
|
||||
#include "ui_replaceadvanceddialog.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
#include <QAbstractButton>
|
||||
|
||||
/**
|
||||
@@ -33,6 +34,7 @@ replaceAdvancedDialog::replaceAdvancedDialog(advancedReplaceStruct advanced, QWi
|
||||
ui(new Ui::replaceAdvancedDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
connect(ui->m_button_box, &QDialogButtonBox::clicked, [this](QAbstractButton *button_) {
|
||||
this->done(ui->m_button_box->buttonRole(button_));
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "../searchandreplaceworker.h"
|
||||
#include "ui_replaceconductordialog.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
#include <QColorDialog>
|
||||
#include <QPainter>
|
||||
|
||||
@@ -37,6 +38,7 @@ ReplaceConductorDialog::ReplaceConductorDialog(
|
||||
ui(new Ui::ReplaceConductorDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
initWidget();
|
||||
setProperties(properties);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "replaceelementdialog.h"
|
||||
#include "ui_replaceelementdialog.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
#include <QAbstractButton>
|
||||
|
||||
ReplaceElementDialog::ReplaceElementDialog(DiagramContext context, QWidget *parent) :
|
||||
@@ -31,6 +32,7 @@ ReplaceElementDialog::ReplaceElementDialog(DiagramContext context, QWidget *pare
|
||||
ui(new Ui::ReplaceElementDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
buildWidget();
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "replacefoliowidget.h"
|
||||
|
||||
#include "../../ui/diagramcontextwidget.h"
|
||||
#include "../../qet.h"
|
||||
#include "../searchandreplaceworker.h"
|
||||
#include "ui_replacefoliowidget.h"
|
||||
|
||||
@@ -132,6 +133,8 @@ ReplaceFolioDialog::ReplaceFolioDialog(QWidget *parent) :
|
||||
{
|
||||
this->done(m_button_box->buttonRole(button_));
|
||||
});
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
ReplaceFolioDialog::~ReplaceFolioDialog()
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "../GraphicsItem/terminalstripitem.h"
|
||||
#include "../../diagram.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
void AddTerminalStripItemDialog::openDialog(Diagram *diagram, QWidget *parent)
|
||||
{
|
||||
AddTerminalStripItemDialog d(diagram->project(), parent);
|
||||
@@ -46,6 +47,7 @@ AddTerminalStripItemDialog::AddTerminalStripItemDialog(QETProject *project, QWid
|
||||
ui{new Ui::AddTerminalStripItemDialog}
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
fillComboBox();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "../terminalstrip.h"
|
||||
#include "../../qetproject.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
/**
|
||||
* @brief TerminalStripCreatorDialog::TerminalStripCreatorDialog
|
||||
* @param project : Project to add a new terminal strip
|
||||
@@ -31,6 +32,7 @@ TerminalStripCreatorDialog::TerminalStripCreatorDialog(QETProject *project, QWid
|
||||
m_project(project)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "renumberelementsdialog.h"
|
||||
#include "../../qet.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -60,6 +61,8 @@ RenumberElementsDialog::RenumberElementsDialog(const QStringList &scheme_titles,
|
||||
|
||||
connect(m_all_rb, &QRadioButton::toggled, this, &RenumberElementsDialog::updateUi);
|
||||
connect(m_one_rb, &QRadioButton::toggled, this, &RenumberElementsDialog::updateUi);
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
QString RenumberElementsDialog::selectedSchemeTitle() const
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "configdialog.h"
|
||||
#include "ui/configpage/configpages.h"
|
||||
#include "qetapp.h"
|
||||
#include "qet.h"
|
||||
|
||||
#include "machine_info.h"
|
||||
|
||||
@@ -89,6 +90,8 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
setWindowFlags(Qt::Sheet);
|
||||
}
|
||||
#endif
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "../../qetinformation.h"
|
||||
#include "ui_elementpropertieseditorwidget.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
#include <QItemDelegate>
|
||||
#include <QComboBox>
|
||||
#include <QSpinBox>
|
||||
@@ -95,6 +96,7 @@ ElementPropertiesEditorWidget::ElementPropertiesEditorWidget(ElementData data, Q
|
||||
m_data(data)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
setUpInterface();
|
||||
upDateInterface();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "ElementsCollection/elementcollectionitem.h"
|
||||
#include "ElementsCollection/elementscollectionmodel.h"
|
||||
#include "ElementsCollection/elementstreeview.h"
|
||||
#include "qet.h"
|
||||
#include "qetapp.h"
|
||||
#include "qetmessagebox.h"
|
||||
#include "qfilenameedit.h"
|
||||
@@ -41,6 +42,7 @@ ElementDialog::ElementDialog(uint mode, QWidget *parent) :
|
||||
{
|
||||
setUpWidget();
|
||||
setUpConnection();
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,6 +41,7 @@ ElementsCategoryEditor::ElementsCategoryEditor(const ElementsLocation &location,
|
||||
m_location(location)
|
||||
{
|
||||
setUpWidget();
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
if (m_location.isElement()) {
|
||||
QET::QetMessageBox::warning(this,
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "dxfexport.h"
|
||||
#include "exportpropertieswidget.h"
|
||||
#include "factory/elementpicturefactory.h"
|
||||
#include "qet.h"
|
||||
#include "qetgraphicsitem/ViewItem/qetgraphicstableitem.h"
|
||||
#include "dxfpaintdevice.h"
|
||||
#include "qetgraphicsitem/conductor.h"
|
||||
@@ -108,6 +109,8 @@ ExportDialog::ExportDialog(
|
||||
|
||||
// ajustement des extensions des fichiers
|
||||
slot_changeFilesExtension(true);
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "../../utils/qetutils.h"
|
||||
#include "ui_addtabledialog.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
#include <QFontDialog>
|
||||
|
||||
/**
|
||||
@@ -35,6 +36,7 @@ AddTableDialog::AddTableDialog(QWidget *content_widget, QWidget *parent) :
|
||||
ui(new Ui::AddTableDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
ui->m_header_font_pb->setText(m_header_font.family());
|
||||
ui->m_table_font_pb->setText(m_table_font.family());
|
||||
m_content_widget = content_widget;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "diagnosticsreportdialog.h"
|
||||
|
||||
#include "../../qet.h"
|
||||
#include "../../qetmessagebox.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
@@ -63,6 +64,8 @@ DiagnosticsReportDialog::DiagnosticsReportDialog(
|
||||
// holds a QString copy but we save the original UTF-8 bytes to avoid
|
||||
// any round-trip surprises.
|
||||
setProperty("qet_report_content", content);
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
void DiagnosticsReportDialog::saveToFile()
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "materialentrydialog.h"
|
||||
#include "../qet.h"
|
||||
|
||||
#include "../qetmessagebox.h"
|
||||
|
||||
@@ -92,6 +93,8 @@ MaterialEntryDialog::MaterialEntryDialog(const QStringList &columns, QWidget *pa
|
||||
if (!m_edits.isEmpty()) {
|
||||
m_edits.first()->setFocus();
|
||||
}
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <QColorDialog>
|
||||
#include <QGraphicsSceneContextMenuEvent>
|
||||
#include <QAction>
|
||||
#include <QDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QSaveFile>
|
||||
#include <QSettings>
|
||||
@@ -272,6 +273,27 @@ bool QET::infoFlagIsTrue(const QString &value)
|
||||
|| v == QLatin1String("on");
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QET::trackDialogGeometry
|
||||
@see the declaration in qet.h for the rationale.
|
||||
*/
|
||||
void QET::trackDialogGeometry(QDialog *dialog, const QString &key)
|
||||
{
|
||||
const QString settings_key = QStringLiteral("dialoggeometry/%1").arg(
|
||||
key.isEmpty() ? QString::fromLatin1(dialog->metaObject()->className()) : key);
|
||||
|
||||
QSettings settings;
|
||||
const QVariant geometry = settings.value(settings_key);
|
||||
if (geometry.isValid()) {
|
||||
dialog->restoreGeometry(geometry.toByteArray());
|
||||
}
|
||||
|
||||
QObject::connect(dialog, &QDialog::finished, dialog, [dialog, settings_key]() {
|
||||
QSettings settings;
|
||||
settings.setValue(settings_key, dialog->saveGeometry());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QET::ElementsAndConductorsSentence
|
||||
Permet de composer rapidement la proposition "x elements et y conducteurs"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <QObject>
|
||||
|
||||
class QActionGroup;
|
||||
class QDialog;
|
||||
/**
|
||||
This file provides useful functions and enums that may be used from
|
||||
anywhere else within the QElectroTech application.
|
||||
@@ -204,6 +205,18 @@ namespace QET {
|
||||
QActionGroup *depthActionGroup(QObject *parent = nullptr);
|
||||
void saveCustomColors();
|
||||
void loadCustomColors();
|
||||
|
||||
/**
|
||||
Restore a dialog's last-used size/position from QSettings, and
|
||||
save it back whenever the dialog closes (accepted, rejected, or
|
||||
via the window's close button). @a key identifies the dialog in
|
||||
QSettings; defaults to the dialog's class name, which is enough
|
||||
to distinguish dialogs one-to-one -- pass an explicit @a key for
|
||||
a dialog class reused for several different kinds of content
|
||||
(e.g. a generic properties-editor wrapper), so each kind gets
|
||||
its own remembered size instead of fighting over one entry.
|
||||
*/
|
||||
void trackDialogGeometry(QDialog *dialog, const QString &key = QString());
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(QET::DepthOption)
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "richtexteditor_p.h"
|
||||
#include "ui_addlinkdialog.h"
|
||||
#include "../shortcutmanager.h"
|
||||
#include "../qet.h"
|
||||
|
||||
//#include <QtDesigner/QDesignerFormEditorInterface>
|
||||
|
||||
@@ -242,6 +243,7 @@ AddLinkDialog::AddLinkDialog(RichTextEditor *editor, QWidget *parent) :
|
||||
m_ui(new Ui::AddLinkDialog)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
@@ -862,6 +864,7 @@ RichTextEditorDialog::RichTextEditorDialog(QWidget *parent) :
|
||||
m_editor->setFocus();
|
||||
|
||||
resize(600, 400);
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
RichTextEditorDialog::~RichTextEditorDialog()
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
#include "dimensionwidget.h"
|
||||
|
||||
#include "../qet.h"
|
||||
|
||||
/**
|
||||
Constructor
|
||||
@param complete True for this dialog to show the radio buttons that allow
|
||||
@@ -31,6 +33,7 @@ TitleBlockDimensionWidget::TitleBlockDimensionWidget(bool complete, QWidget *par
|
||||
{
|
||||
initWidgets();
|
||||
initLayouts();
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,7 @@ AboutQETDialog::AboutQETDialog(QWidget *parent) :
|
||||
ui(new Ui::AboutQETDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
setAbout();
|
||||
setAuthors();
|
||||
setTranslators();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "aiassistantdialog.h"
|
||||
#include "../qet.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
@@ -157,6 +158,8 @@ AiAssistantDialog::AiAssistantDialog(QWidget *parent) :
|
||||
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
|
||||
refresh();
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
void AiAssistantDialog::refresh()
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
#include "../qetgraphicsitem/dynamicelementtextitem.h"
|
||||
#include "ui_alignmenttextdialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
AlignmentTextDialog::AlignmentTextDialog(Qt::Alignment alignment, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AlignmentTextDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
if(alignment == (Qt::AlignTop|Qt::AlignLeft))
|
||||
ui->top_left->setChecked(true);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "../qetproject.h"
|
||||
#include "ui_bomexportdialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
#include <QMessageBox>
|
||||
#include <QSqlError>
|
||||
#include <QSqlQueryModel>
|
||||
@@ -40,6 +41,7 @@ BOMExportDialog::BOMExportDialog(QETProject *project, QWidget *parent) :
|
||||
m_project(project)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
m_query_widget = new ElementQueryWidget(this);
|
||||
ui->m_main_layout->insertWidget(0, m_query_widget);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "../qetgraphicsitem/dynamicelementtextitem.h"
|
||||
#include "../qetgraphicsitem/element.h"
|
||||
#include "../qetinformation.h"
|
||||
#include "../qet.h"
|
||||
#include "ui_compositetexteditdialog.h"
|
||||
|
||||
#include <utility>
|
||||
@@ -15,6 +16,7 @@ CompositeTextEditDialog::CompositeTextEditDialog(DynamicElementTextItem *text, Q
|
||||
m_text(text)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
m_default_text = m_text->compositeText();
|
||||
ui->m_plain_text_edit->setPlainText(m_default_text);
|
||||
ui->m_plain_text_edit->setPlaceholderText(tr("Entrée votre texte composé ici, en vous aidant des variables disponible"));
|
||||
@@ -31,6 +33,7 @@ CompositeTextEditDialog::CompositeTextEditDialog(QString text, bool report, QWid
|
||||
ui(new Ui::CompositeTextEditDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
m_default_text = std::move(text);
|
||||
ui->m_plain_text_edit->setPlainText(m_default_text);
|
||||
ui->m_plain_text_edit->setPlaceholderText(tr("Entrée votre texte composé ici, en vous aidant des variables disponible"));
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "conductorpropertieswidget.h"
|
||||
#include "ui_conductorpropertiesdialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
/**
|
||||
@brief ConductorPropertiesDialog::ConductorPropertiesDialog
|
||||
Constructor
|
||||
@@ -36,6 +37,7 @@ ConductorPropertiesDialog::ConductorPropertiesDialog(
|
||||
ui(new Ui::ConductorPropertiesDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
m_cpw = new ConductorPropertiesWidget(conductor->properties());
|
||||
m_cpw -> setHiddenOneTextPerFolio(true);
|
||||
m_cpw->setHiddenAvailableAutonum(true);
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
#include "contactgroupselectiondialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QTableWidget>
|
||||
@@ -207,6 +209,8 @@ ContactGroupSelectionDialog::ContactGroupSelectionDialog(
|
||||
accept();
|
||||
}
|
||||
});
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
int ContactGroupSelectionDialog::selectedIndex() const
|
||||
|
||||
@@ -89,6 +89,8 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
|
||||
vlayout.addLayout(glayout);
|
||||
vlayout.addWidget(&boutons);
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
// if dialog is accepted
|
||||
if (this -> exec() == QDialog::Accepted && !diagram_is_read_only)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "dialogwaiting.h"
|
||||
#include "ui_dialogwaiting.h"
|
||||
#include "../qet.h"
|
||||
#include <QPushButton>
|
||||
|
||||
|
||||
@@ -31,6 +32,7 @@ DialogWaiting::DialogWaiting(QWidget *parent) :
|
||||
ui(new Ui::DialogWaiting)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
setTitle( "..." );
|
||||
setDetail( "..." );
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "duplicateoffsetdialog.h"
|
||||
#include "../qet.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -76,6 +77,8 @@ DuplicateOffsetDialog::DuplicateOffsetDialog(QWidget *parent) :
|
||||
auto *layout = new QVBoxLayout(this);
|
||||
layout->addLayout(form);
|
||||
layout->addWidget(buttons);
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
QPoint DuplicateOffsetDialog::stepOffset() const
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "formulaassistantdialog.h"
|
||||
#include "ui_formulaassistantdialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
#include <QPushButton>
|
||||
|
||||
FormulaAssistantDialog::FormulaAssistantDialog(QWidget *parent) :
|
||||
@@ -25,6 +26,7 @@ FormulaAssistantDialog::FormulaAssistantDialog(QWidget *parent) :
|
||||
ui(new Ui::FormulaAssistantDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
FormulaAssistantDialog::~FormulaAssistantDialog()
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "imagetransparentcolordialog.h"
|
||||
#include "../qet.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGridLayout>
|
||||
@@ -141,6 +142,8 @@ ImageTransparentColorDialog::ImageTransparentColorDialog(const QPixmap &basePixm
|
||||
|
||||
rebuildSwatches(); // shows existingColors immediately, if any
|
||||
updatePreview(); // and the preview already reflects them too, rather than only appearing after the next pick
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "importelementdialog.h"
|
||||
#include "ui_importelementdialog.h"
|
||||
#include "../qet.h"
|
||||
#include <QButtonGroup>
|
||||
|
||||
ImportElementDialog::ImportElementDialog(QWidget *parent) :
|
||||
@@ -24,6 +25,7 @@ ImportElementDialog::ImportElementDialog(QWidget *parent) :
|
||||
ui(new Ui::ImportElementDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
setUpWidget();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
#include "importelementtextpatterndialog.h"
|
||||
#include "ui_importelementtextpatterndialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
ImportElementTextPatternDialog::ImportElementTextPatternDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ImportElementTextPatternDialog) {
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
ImportElementTextPatternDialog::~ImportElementTextPatternDialog()
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "../diagram.h"
|
||||
#include "../diagramview.h"
|
||||
#include "../qetproject.h"
|
||||
#include "../qet.h"
|
||||
#include "../qetgraphicsitem/element.h"
|
||||
|
||||
#include <QEvent>
|
||||
@@ -59,6 +60,8 @@ JumpToElementDialog::JumpToElementDialog(Diagram *diagram, QWidget *parent) :
|
||||
buildCandidates();
|
||||
updateFilteredList(QString());
|
||||
m_filter_edit->setFocus();
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
JumpToElementDialog::~JumpToElementDialog()
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "marginseditdialog.h"
|
||||
#include "ui_marginseditdialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
#include <QScopedPointer>
|
||||
|
||||
MarginsEditDialog::MarginsEditDialog(QMargins margins, QWidget *parent) :
|
||||
@@ -25,6 +26,7 @@ MarginsEditDialog::MarginsEditDialog(QMargins margins, QWidget *parent) :
|
||||
ui(new Ui::MarginsEditDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
ui->m_top_sb->setValue(margins.top());
|
||||
ui->m_left_sb->setValue(margins.left());
|
||||
ui->m_right_sb->setValue(margins.right());
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "../qetgraphicsitem/conductor.h"
|
||||
#include "../ui_multipastedialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
#include <QHash>
|
||||
#include <QSettings>
|
||||
|
||||
@@ -35,6 +36,7 @@ MultiPasteDialog::MultiPasteDialog(Diagram *diagram, QWidget *parent) :
|
||||
m_diagram(diagram)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
|
||||
connect(ui->m_x_sb, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &MultiPasteDialog::updatePreview);
|
||||
connect(ui->m_y_sb, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &MultiPasteDialog::updatePreview);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "pdfpagesdialog.h"
|
||||
#include "../qet.h"
|
||||
|
||||
// Whole file is a no-op unless QtPdf is available (see pdfpagesdialog.h).
|
||||
#ifdef QET_HAS_QTPDF
|
||||
@@ -125,6 +126,8 @@ PdfPagesDialog::PdfPagesDialog(QPdfDocument &document, QWidget *parent)
|
||||
|
||||
// Render initial preview
|
||||
updatePreview();
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "potentialselectordialog.h"
|
||||
|
||||
#include "../QPropertyUndoCommand/qpropertyundocommand.h"
|
||||
#include "../qet.h"
|
||||
#include "../autoNum/assignvariables.h"
|
||||
#include "../diagram.h"
|
||||
#include "../qetgraphicsitem/conductor.h"
|
||||
@@ -270,6 +271,7 @@ PotentialSelectorDialog::PotentialSelectorDialog(Conductor *conductor,
|
||||
m_parent_undo(parent_undo)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
m_potential_selector = new NewConductorPotentialSelector(conductor);
|
||||
buildWidget();
|
||||
}
|
||||
@@ -292,6 +294,7 @@ PotentialSelectorDialog::PotentialSelectorDialog(Element *report,
|
||||
m_parent_undo(parent_undo)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
m_potential_selector = new LinkReportPotentialSelector(report);
|
||||
buildWidget();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "../diagram.h"
|
||||
#include "../qetgraphicsitem/element.h"
|
||||
#include "../undocommand/changeelementinformationcommand.h"
|
||||
#include "../qet.h"
|
||||
#include <QUndoCommand>
|
||||
#include <QCheckBox>
|
||||
#include <QVBoxLayout>
|
||||
@@ -67,6 +68,8 @@ TerminalNumberingDialog::TerminalNumberingDialog(QWidget *parent, QETProject *pr
|
||||
m_stripCheckboxes.insert(prefix, cb);
|
||||
}
|
||||
}
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "thirdpartybinaryinstalldialog.h"
|
||||
#include "ui_thirdpartybinaryinstalldialog.h"
|
||||
|
||||
#include "../qet.h"
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
#include <QDesktopServices>
|
||||
@@ -32,6 +33,7 @@ ThirdPartyBinaryInstallDialog::ThirdPartyBinaryInstallDialog(const QString &text
|
||||
ui{new Ui::ThirdPartyBinaryInstallDialog}
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QET::trackDialogGeometry(this);
|
||||
ui->m_label->setText(text);
|
||||
|
||||
connect(ui->m_download_pb, &QPushButton::clicked, [downloadLink](){
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "wiringlistdialog.h"
|
||||
#include "../qet.h"
|
||||
|
||||
#include "../dataBase/projectdatabase.h"
|
||||
#include "../qetproject.h"
|
||||
@@ -111,4 +112,6 @@ WiringListDialog::WiringListDialog(QETProject *project, QWidget *parent) :
|
||||
auto *buttons = new QDialogButtonBox(QDialogButtonBox::Close, this);
|
||||
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
layout->addWidget(buttons);
|
||||
|
||||
QET::trackDialogGeometry(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user