mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +01:00
Update the dialogconductorautonum with the diagramselection widget
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2133 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1,15 +1,37 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2013 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/>.
|
||||||
|
*/
|
||||||
#include "dialogconductorautonum.h"
|
#include "dialogconductorautonum.h"
|
||||||
#include "ui_dialogconductorautonum.h"
|
#include "ui_dialogconductorautonum.h"
|
||||||
|
|
||||||
#include "conductorautonumerotation.h"
|
#include "conductorautonumerotation.h"
|
||||||
#include "qetmessagebox.h"
|
#include "qetmessagebox.h"
|
||||||
|
|
||||||
|
|
||||||
DialogConductorAutoNum::DialogConductorAutoNum(Diagram *dg, QWidget *parent) :
|
DialogConductorAutoNum::DialogConductorAutoNum(Diagram *dg, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::DialogConductorAutoNum)
|
ui(new Ui::DialogConductorAutoNum)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui -> setupUi(this);
|
||||||
dg_ = dg;
|
dg_ = dg;
|
||||||
|
|
||||||
|
// create widget of diagram selection
|
||||||
|
dgselect_ = new diagramselection( dg_ ->project(), this );
|
||||||
|
ui -> verticalLayout_Selection -> addWidget( dgselect_ );
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogConductorAutoNum::~DialogConductorAutoNum()
|
DialogConductorAutoNum::~DialogConductorAutoNum()
|
||||||
@@ -17,28 +39,38 @@ DialogConductorAutoNum::~DialogConductorAutoNum()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DialogConductorAutoNum::on_pushButton_delete_clicked
|
* @brief DialogConductorAutoNum::on_pushButton_delete_clicked
|
||||||
*/
|
*/
|
||||||
void DialogConductorAutoNum::on_pushButton_delete_clicked() {
|
void DialogConductorAutoNum::on_pushButton_delete_clicked() {
|
||||||
// TODO check if project or diagram
|
// get list of diagrams selected
|
||||||
// ...
|
QList<Diagram *>listDiag = dgselect_ ->list_of_DiagramSelected();
|
||||||
|
if(listDiag.count()<=0) return;
|
||||||
|
|
||||||
|
QString diagramsTitle;
|
||||||
|
for(int i=0; i<listDiag.count(); i++){
|
||||||
|
diagramsTitle += listDiag.at(i)->title();
|
||||||
|
if(i+1<listDiag.count()) diagramsTitle += ", ";
|
||||||
|
}
|
||||||
// Ask if user is sure to delete the conductor numerotation
|
// Ask if user is sure to delete the conductor numerotation
|
||||||
QMessageBox::StandardButton answer = QET::MessageBox::critical(
|
QMessageBox::StandardButton answer = QET::MessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Suppression des annotations conducteurs", "Attention"),
|
tr("Suppression des annotations conducteurs", "Attention"),
|
||||||
QString(
|
QString(
|
||||||
tr("Voulez vraiment supprimer les annotations conducteurs de\n%1 ?")
|
tr("Voulez vraiment supprimer les annotations conducteurs de :\n\n%1 ?")
|
||||||
).arg(dg_ -> title()),
|
).arg(diagramsTitle),
|
||||||
QMessageBox::Yes | QMessageBox::No,
|
QMessageBox::Yes | QMessageBox::No,
|
||||||
QMessageBox::No
|
QMessageBox::No
|
||||||
);
|
);
|
||||||
|
|
||||||
// if yes remove all
|
// if yes remove all
|
||||||
if( answer == QMessageBox::Yes) {
|
if( answer == QMessageBox::Yes) {
|
||||||
ConductorAutoNumerotation can(dg_);
|
for(int i=0; i<listDiag.count(); i++){
|
||||||
|
ConductorAutoNumerotation can(listDiag.at(i));
|
||||||
can.removeNum_ofDiagram();
|
can.removeNum_ofDiagram();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2013 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 DIALOGCONDUCTORAUTONUM_H
|
#ifndef DIALOGCONDUCTORAUTONUM_H
|
||||||
#define DIALOGCONDUCTORAUTONUM_H
|
#define DIALOGCONDUCTORAUTONUM_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
|
#include "ui/diagramselection.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class DialogConductorAutoNum;
|
class DialogConductorAutoNum;
|
||||||
@@ -19,12 +37,13 @@ class DialogConductorAutoNum : public QDialog
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_pushButton_delete_clicked();
|
void on_pushButton_delete_clicked();
|
||||||
|
|
||||||
void on_pushButton_close_clicked();
|
void on_pushButton_close_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DialogConductorAutoNum *ui;
|
Ui::DialogConductorAutoNum *ui;
|
||||||
Diagram *dg_;
|
Diagram *dg_;
|
||||||
|
diagramselection *dgselect_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGCONDUCTORAUTONUM_H
|
#endif // DIALOGCONDUCTORAUTONUM_H
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>482</width>
|
<width>482</width>
|
||||||
<height>245</height>
|
<height>382</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -27,25 +27,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_Selection"/>
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="radioButton_Diagram">
|
|
||||||
<property name="text">
|
|
||||||
<string>Numéroter le schéma actif</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="radioButton_Project">
|
|
||||||
<property name="text">
|
|
||||||
<string>Numéroter le projet actif entier</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -70,6 +52,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="pushButton_info">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../qelectrotech.qrc">
|
||||||
|
<normaloff>:/ico/16x16/configure.png</normaloff>:/ico/16x16/configure.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -121,6 +111,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fermer</string>
|
<string>Fermer</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="default">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user