mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-14 20:33:05 +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);
|
||||
}
|
||||
|
||||
@ -371,11 +364,8 @@ void ProjectView::removeDiagram(DiagramView *diagram_view) {
|
||||
// verifie que le schema est bien present dans le projet
|
||||
if (!diagram_ids_.values().contains(diagram_view)) return;
|
||||
|
||||
// demande confirmation a l'utilisateur
|
||||
if (
|
||||
diagram_view -> diagram() -> wasWritten() ||\
|
||||
!diagram_view -> diagram() -> undoStack().isClean()
|
||||
) {
|
||||
|
||||
//Ask confirmation to user.
|
||||
int answer = QET::MessageBox::question(
|
||||
this,
|
||||
tr("Supprimer le sch\351ma ?", "message box title"),
|
||||
@ -386,7 +376,6 @@ void ProjectView::removeDiagram(DiagramView *diagram_view) {
|
||||
if (answer != QMessageBox::Yes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// enleve le DiagramView des onglets
|
||||
int diagram_tab_id = diagram_ids_.key(diagram_view);
|
||||
|
@ -34,7 +34,6 @@ class ProjectView : public QWidget {
|
||||
|
||||
public:
|
||||
enum ProjectSaveOption {
|
||||
ModifiedDiagramsOnly = 1,
|
||||
CurrentDiagram = 2,
|
||||
AllDiagramsButCurrent = 4,
|
||||
AllDiagrams = 6
|
||||
@ -77,7 +76,7 @@ class ProjectView : public QWidget {
|
||||
void printProject();
|
||||
void exportProject();
|
||||
QETResult save();
|
||||
QETResult saveAs(ProjectSaveOptions = ProjectSaveOptions(AllDiagrams | ModifiedDiagramsOnly));
|
||||
QETResult saveAs(ProjectSaveOptions = ProjectSaveOptions(AllDiagrams));
|
||||
QETResult doSave(ProjectSaveOptions);
|
||||
void saveDiagrams(const QList<Diagram *> &);
|
||||
int cleanProject();
|
||||
|
Loading…
x
Reference in New Issue
Block a user