mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-06 11:14:14 +02:00
d76f3528ae
Schemas now get saved with a UUID and do not have to be looked up according to the form. They can be renamed and it gets reflected in existing elements. The GUI for editing them is now much easier, e.g. forms can be reshuffled. A formula can be applied. Many options now also for conductors and sheets.
69 lines
2.1 KiB
C++
69 lines
2.1 KiB
C++
/*
|
|
Copyright 2006-2026 The QElectroTech Team
|
|
This file is part of QElectroTech.
|
|
|
|
QElectroTech 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.
|
|
|
|
QElectroTech 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 QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef RENUMBERPREVIEWDIALOG_H
|
|
#define RENUMBERPREVIEWDIALOG_H
|
|
|
|
#include "../renumberelementscommand.h"
|
|
|
|
#include <QCoreApplication>
|
|
#include <QVector>
|
|
|
|
class Element;
|
|
class QWidget;
|
|
|
|
/**
|
|
@brief The RenumberPreviewDialog class
|
|
Shows what a numbering operation is about to do to the labels of
|
|
elements -- each changed element with its label now and the one it
|
|
would get -- and the elements with a frozen label it leaves as they are,
|
|
and asks to go on or not. Nothing is changed by the dialog itself.
|
|
*/
|
|
class RenumberPreviewDialog
|
|
{
|
|
Q_DECLARE_TR_FUNCTIONS(RenumberPreviewDialog)
|
|
|
|
public:
|
|
/// An element an operation leaves as it is, and why
|
|
struct LeftAlone
|
|
{
|
|
Element *element = nullptr;
|
|
QString note;
|
|
};
|
|
enum class Answer { Cancel, Go, GoAndReplace };
|
|
|
|
static Answer ask(
|
|
QWidget *parent,
|
|
const QString &title,
|
|
const QString &intro,
|
|
const QVector<RenumberElementsCommand::ElementChange> &changes,
|
|
const QVector<LeftAlone> &left_alone,
|
|
const QString &replace_text = QString());
|
|
|
|
static bool confirm(
|
|
QWidget *parent,
|
|
const QString &title,
|
|
const QString &intro,
|
|
const QVector<RenumberElementsCommand::ElementChange> &changes,
|
|
const QVector<Element *> &frozen);
|
|
|
|
static int changedLabelCount(
|
|
const QVector<RenumberElementsCommand::ElementChange> &changes);
|
|
};
|
|
|
|
#endif // RENUMBERPREVIEWDIALOG_H
|