mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Now ask whether to save the project when the diagrams order is changed.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1910 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -233,8 +233,10 @@ bool ProjectView::tryClosingElementEditors() {
|
|||||||
int ProjectView::tryClosingDiagrams() {
|
int ProjectView::tryClosingDiagrams() {
|
||||||
if (!project_) return(QDialogButtonBox::DestructiveRole);
|
if (!project_) return(QDialogButtonBox::DestructiveRole);
|
||||||
|
|
||||||
|
bool project_modified = project_ -> projectOptionsWereModified();
|
||||||
QList<Diagram *> modified_diagrams = getDiagrams(AllDiagrams | ModifiedDiagramsOnly);
|
QList<Diagram *> modified_diagrams = getDiagrams(AllDiagrams | ModifiedDiagramsOnly);
|
||||||
if (!modified_diagrams.count() && !project_ -> filePath().isEmpty()) {
|
bool has_filepath = !project_ -> filePath().isEmpty();
|
||||||
|
if (!project_modified && !modified_diagrams.count() && has_filepath) {
|
||||||
// nothing was modified, and we have a filepath, i.e. everything was already
|
// nothing was modified, and we have a filepath, i.e. everything was already
|
||||||
// saved, i.e we can close the project right now
|
// saved, i.e we can close the project right now
|
||||||
return(QDialogButtonBox::DestructiveRole);
|
return(QDialogButtonBox::DestructiveRole);
|
||||||
|
|||||||
@@ -843,6 +843,7 @@ void QETProject::diagramOrderChanged(int old_index, int new_index) {
|
|||||||
|
|
||||||
diagrams_.move(old_index, new_index);
|
diagrams_.move(old_index, new_index);
|
||||||
updateDiagramsFolioData();
|
updateDiagramsFolioData();
|
||||||
|
setModified(true);
|
||||||
emit(projectDiagramsOrderChanged(this, old_index, new_index));
|
emit(projectDiagramsOrderChanged(this, old_index, new_index));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1146,7 +1147,7 @@ NamesList QETProject::namesListForIntegrationCategory() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@return true if project options (title, project-wide properties, settings
|
@return true if project options (title, project-wide properties, settings
|
||||||
for new diagrams, ...) were modified, false otherwise.
|
for new diagrams, diagrams order...) were modified, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool QETProject::projectOptionsWereModified() {
|
bool QETProject::projectOptionsWereModified() {
|
||||||
// unlike similar methods, this method does not compare the content against
|
// unlike similar methods, this method does not compare the content against
|
||||||
|
|||||||
Reference in New Issue
Block a user