Changeset View
Changeset View
Standalone View
Standalone View
src/MainWindow.cpp
Context not available. | |||||
603 | int result; | 603 | int result; | ||
---|---|---|---|---|---|
604 | 604 | | |||
605 | if (!processesRunning.isEmpty()) { | 605 | if (!processesRunning.isEmpty()) { | ||
606 | result = KMessageBox::warningYesNoCancelList(this, | 606 | if (openTabs == 1) { | ||
607 | i18ncp("@info", | 607 | result = KMessageBox::warningYesNoList(this, | ||
608 | "There is a process running in this window. " | 608 | i18ncp("@info", | ||
609 | "Do you still want to quit?", | 609 | "There is a process running in this window. " | ||
610 | "There are %1 processes running in this window. " | 610 | "Do you still want to quit?", | ||
611 | "Do you still want to quit?", | 611 | "There are %1 processes running in this window. " | ||
612 | processesRunning.count()), | 612 | "Do you still want to quit?", | ||
613 | processesRunning, | 613 | processesRunning.count()), | ||
614 | i18nc("@title", "Confirm Close"), | 614 | processesRunning, | ||
615 | KGuiItem(i18nc("@action:button", | 615 | i18nc("@title", "Confirm Close"), | ||
616 | "Close &Window"), | 616 | KGuiItem(i18nc("@action:button", | ||
617 | QStringLiteral("window-close")), | 617 | "Close &Window"), | ||
618 | KGuiItem(i18nc("@action:button", | 618 | QStringLiteral("window-close")), | ||
619 | "Close Current &Tab"), | 619 | KStandardGuiItem::cancel(), | ||
620 | QStringLiteral("tab-close")), | 620 | // don't ask again name is wrong but I can't update. | ||
621 | KStandardGuiItem::cancel(), | 621 | // this is not about tabs anymore. it's about empty tabs *or* splits. | ||
622 | // don't ask again name is wrong but I can't update. | 622 | QStringLiteral("CloseAllTabs")); | ||
623 | // this is not about tabs anymore. it's about empty tabs *or* splits. | 623 | if (result == KMessageBox::No) // No is equal to cancel closing | ||
624 | QStringLiteral("CloseAllTabs")); | 624 | result = KMessageBox::Cancel; | ||
625 | } else { | ||||
626 | result = KMessageBox::warningYesNoCancelList(this, | ||||
627 | i18ncp("@info", | ||||
628 | "There is a process running in this window. " | ||||
629 | "Do you still want to quit?", | ||||
630 | "There are %1 processes running in this window. " | ||||
631 | "Do you still want to quit?", | ||||
632 | processesRunning.count()), | ||||
633 | processesRunning, | ||||
634 | i18nc("@title", "Confirm Close"), | ||||
635 | KGuiItem(i18nc("@action:button", | ||||
636 | "Close &Window"), | ||||
637 | QStringLiteral("window-close")), | ||||
638 | KGuiItem(i18nc("@action:button", | ||||
639 | "Close Current &Tab"), | ||||
640 | QStringLiteral("tab-close")), | ||||
641 | KStandardGuiItem::cancel(), | ||||
642 | // don't ask again name is wrong but I can't update. | ||||
643 | // this is not about tabs anymore. it's about empty tabs *or* splits. | ||||
644 | QStringLiteral("CloseAllTabs")); | ||||
645 | } | ||||
625 | } else { | 646 | } else { | ||
626 | result = KMessageBox::warningYesNoCancel(this, | 647 | result = KMessageBox::warningYesNoCancel(this, | ||
627 | i18nc("@info", | 648 | i18nc("@info", | ||
Context not available. |