! Asks to save the project if it was modified. \return \c true if the project still needs to be saved ("cancel" clicked), \c false otherwise. */
| 1004 | \return \c true if the project still needs to be saved ("cancel" clicked), \c false otherwise. |
| 1005 | */ |
| 1006 | bool MainWin::warnModified() { |
| 1007 | if (m_project->hasChanged()) { |
| 1008 | int option = KMessageBox::warningTwoActionsCancel(this, i18n("The current project \"%1\" has been modified. Do you want to save it?", m_project->name()), |
| 1009 | i18n("Save Project"), KStandardGuiItem::save(), KStandardGuiItem::dontSave()); |
| 1010 | switch (option) { |
| 1011 | case KMessageBox::PrimaryAction: |
| 1012 | return !saveProject(); |
| 1013 | case KMessageBox::SecondaryAction: |
| 1014 | break; |
| 1015 | case KMessageBox::Cancel: |
| 1016 | return true; |
| 1017 | } |
| 1018 | } |
| 1019 | |
| 1020 | return false; |
| 1021 | } |
| 1022 | |
| 1023 | /*! |
| 1024 | * updates the state of actions, menus and toolbars (enabled or disabled) |
nothing calls this directly
no test coverage detected