mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
clean some code
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3523 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
parent
c890e67ddd
commit
1c7892cc19
@ -113,13 +113,6 @@ QList<Diagram *> ProjectView::getDiagrams(ProjectSaveOptions options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options & ModifiedDiagramsOnly) {
|
|
||||||
foreach (Diagram *diagram, selection) {
|
|
||||||
if (!diagram -> undoStack().isClean() || !diagram -> wasWritten()) continue;
|
|
||||||
selection.removeOne(diagram);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return(selection);
|
return(selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,21 +364,17 @@ void ProjectView::removeDiagram(DiagramView *diagram_view) {
|
|||||||
// verifie que le schema est bien present dans le projet
|
// verifie que le schema est bien present dans le projet
|
||||||
if (!diagram_ids_.values().contains(diagram_view)) return;
|
if (!diagram_ids_.values().contains(diagram_view)) return;
|
||||||
|
|
||||||
// demande confirmation a l'utilisateur
|
|
||||||
if (
|
//Ask confirmation to user.
|
||||||
diagram_view -> diagram() -> wasWritten() ||\
|
int answer = QET::MessageBox::question(
|
||||||
!diagram_view -> diagram() -> undoStack().isClean()
|
this,
|
||||||
) {
|
tr("Supprimer le sch\351ma ?", "message box title"),
|
||||||
int answer = QET::MessageBox::question(
|
tr("\312tes-vous s\373r de vouloir supprimer ce sch\351ma du projet ? Ce changement est irr\351versible.", "message box content"),
|
||||||
this,
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
||||||
tr("Supprimer le sch\351ma ?", "message box title"),
|
QMessageBox::No
|
||||||
tr("\312tes-vous s\373r de vouloir supprimer ce sch\351ma du projet ? Ce changement est irr\351versible.", "message box content"),
|
);
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
if (answer != QMessageBox::Yes) {
|
||||||
QMessageBox::No
|
return;
|
||||||
);
|
|
||||||
if (answer != QMessageBox::Yes) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// enleve le DiagramView des onglets
|
// enleve le DiagramView des onglets
|
||||||
|
@ -34,7 +34,6 @@ class ProjectView : public QWidget {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
enum ProjectSaveOption {
|
enum ProjectSaveOption {
|
||||||
ModifiedDiagramsOnly = 1,
|
|
||||||
CurrentDiagram = 2,
|
CurrentDiagram = 2,
|
||||||
AllDiagramsButCurrent = 4,
|
AllDiagramsButCurrent = 4,
|
||||||
AllDiagrams = 6
|
AllDiagrams = 6
|
||||||
@ -77,7 +76,7 @@ class ProjectView : public QWidget {
|
|||||||
void printProject();
|
void printProject();
|
||||||
void exportProject();
|
void exportProject();
|
||||||
QETResult save();
|
QETResult save();
|
||||||
QETResult saveAs(ProjectSaveOptions = ProjectSaveOptions(AllDiagrams | ModifiedDiagramsOnly));
|
QETResult saveAs(ProjectSaveOptions = ProjectSaveOptions(AllDiagrams));
|
||||||
QETResult doSave(ProjectSaveOptions);
|
QETResult doSave(ProjectSaveOptions);
|
||||||
void saveDiagrams(const QList<Diagram *> &);
|
void saveDiagrams(const QList<Diagram *> &);
|
||||||
int cleanProject();
|
int cleanProject();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user