MCPcopy Create free account
hub / github.com/KDE/labplot / warnModified

Method warnModified

src/frontend/MainWin.cpp:1006–1021  ·  view source on GitHub ↗

! 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. */

Source from the content-addressed store, hash-verified

1004 \return \c true if the project still needs to be saved ("cancel" clicked), \c false otherwise.
1005 */
1006bool 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)

Callers

nothing calls this directly

Calls 2

hasChangedMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected