Changeset View
Changeset View
Standalone View
Standalone View
src/MainWindow.cpp
Show First 20 Lines • Show All 597 Lines • ▼ Show 20 Line(s) | 558 | { | |||
---|---|---|---|---|---|
598 | // make sure the window is shown on current desktop and is not minimized | 598 | // make sure the window is shown on current desktop and is not minimized | ||
599 | KWindowSystem::setOnDesktop(winId(), KWindowSystem::currentDesktop()); | 599 | KWindowSystem::setOnDesktop(winId(), KWindowSystem::currentDesktop()); | ||
600 | if (isMinimized()) { | 600 | if (isMinimized()) { | ||
601 | KWindowSystem::unminimizeWindow(winId(), true); | 601 | KWindowSystem::unminimizeWindow(winId(), true); | ||
602 | } | 602 | } | ||
603 | int result; | 603 | int result; | ||
604 | 604 | | |||
605 | if (!processesRunning.isEmpty()) { | 605 | if (!processesRunning.isEmpty()) { | ||
606 | if (openTabs == 1) { | ||||
607 | result = KMessageBox::warningYesNoList(this, | ||||
608 | i18ncp("@info", | ||||
609 | "There is a process running in this window. " | ||||
610 | "Do you still want to quit?", | ||||
611 | "There are %1 processes running in this window. " | ||||
612 | "Do you still want to quit?", | ||||
613 | processesRunning.count()), | ||||
614 | processesRunning, | ||||
615 | i18nc("@title", "Confirm Close"), | ||||
616 | KGuiItem(i18nc("@action:button", | ||||
617 | "Close &Window"), | ||||
618 | QStringLiteral("window-close")), | ||||
619 | KStandardGuiItem::cancel(), | ||||
620 | // don't ask again name is wrong but I can't update. | ||||
621 | // this is not about tabs anymore. it's about empty tabs *or* splits. | ||||
622 | QStringLiteral("CloseAllTabs")); | ||||
623 | if (result == KMessageBox::No) // No is equal to cancel closing | ||||
624 | result = KMessageBox::Cancel; | ||||
625 | } else { | ||||
606 | result = KMessageBox::warningYesNoCancelList(this, | 626 | result = KMessageBox::warningYesNoCancelList(this, | ||
607 | i18ncp("@info", | 627 | i18ncp("@info", | ||
608 | "There is a process running in this window. " | 628 | "There is a process running in this window. " | ||
609 | "Do you still want to quit?", | 629 | "Do you still want to quit?", | ||
610 | "There are %1 processes running in this window. " | 630 | "There are %1 processes running in this window. " | ||
611 | "Do you still want to quit?", | 631 | "Do you still want to quit?", | ||
612 | processesRunning.count()), | 632 | processesRunning.count()), | ||
613 | processesRunning, | 633 | processesRunning, | ||
614 | i18nc("@title", "Confirm Close"), | 634 | i18nc("@title", "Confirm Close"), | ||
615 | KGuiItem(i18nc("@action:button", | 635 | KGuiItem(i18nc("@action:button", | ||
616 | "Close &Window"), | 636 | "Close &Window"), | ||
617 | QStringLiteral("window-close")), | 637 | QStringLiteral("window-close")), | ||
618 | KGuiItem(i18nc("@action:button", | 638 | KGuiItem(i18nc("@action:button", | ||
619 | "Close Current &Tab"), | 639 | "Close Current &Tab"), | ||
620 | QStringLiteral("tab-close")), | 640 | QStringLiteral("tab-close")), | ||
621 | KStandardGuiItem::cancel(), | 641 | KStandardGuiItem::cancel(), | ||
622 | // don't ask again name is wrong but I can't update. | 642 | // don't ask again name is wrong but I can't update. | ||
623 | // this is not about tabs anymore. it's about empty tabs *or* splits. | 643 | // this is not about tabs anymore. it's about empty tabs *or* splits. | ||
624 | QStringLiteral("CloseAllTabs")); | 644 | QStringLiteral("CloseAllTabs")); | ||
645 | } | ||||
625 | } else { | 646 | } else { | ||
626 | result = KMessageBox::warningYesNoCancel(this, | 647 | result = KMessageBox::warningYesNoCancel(this, | ||
627 | i18nc("@info", | 648 | i18nc("@info", | ||
628 | "There are %1 open terminals in this window. " | 649 | "There are %1 open terminals in this window. " | ||
629 | "Do you still want to quit?", | 650 | "Do you still want to quit?", | ||
630 | openTabs), | 651 | openTabs), | ||
631 | i18nc("@title", "Confirm Close"), | 652 | i18nc("@title", "Confirm Close"), | ||
632 | KGuiItem(i18nc("@action:button", "Close &Window"), | 653 | KGuiItem(i18nc("@action:button", "Close &Window"), | ||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |