From 5b6847f7f0ed81b7d9a3f178704566492ed6d1ba Mon Sep 17 00:00:00 2001 From: eli mackenzie Date: Tue, 29 Jun 2010 23:52:44 -0400 Subject: [PATCH 1/2] make it possible to cancel an accidental control-m --- src/mainwindow.cpp | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8d86cdf..06241ae 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -274,14 +274,14 @@ MainWindow::MainWindow() : KXmlGuiWindow(0) action->setEnabled(false); connect(action, SIGNAL(triggered()), m_viewContainer, SLOT(showLastFocusedView())); actionCollection()->addAction("last_focused_tab", action); - + action=new KAction(this); action->setText(i18n("Next Active Tab")); action->setShortcut(KShortcut("Ctrl+Alt+Space")); action->setEnabled(false); connect(action, SIGNAL(triggered()), m_viewContainer, SLOT(showNextActiveView())); actionCollection()->addAction("next_active_tab", action); - + if (Preferences::self()->tabPlacement()==Preferences::Left) { action=new KAction(this); @@ -691,14 +691,19 @@ void MainWindow::toggleMenubar(bool dontShowWarning) menuBar()->show(); else { + bool doit=true; if (!dontShowWarning) { QString accel = hideMenuBarAction->shortcut().toString(); - KMessageBox::information(this, - i18n("This will hide the menu bar completely. You can show it again by typing %1.",accel), - "Hide menu bar","HideMenuBarWarning"); + doit = KMessageBox::warningContinueCancel(this, + i18n("This will hide the menu bar completely. You can show it again by typing %1.",accel), + "Hide menu bar", + KStandardGuiItem::cont(), + KStandardGuiItem::cancel(), + "HideMenuBarWarning") == KMessageBox::Continue; } - menuBar()->hide(); + if (doit) + menuBar()->hide(); } Preferences::self()->setShowMenuBar(hideMenuBarAction->isChecked()); -- 1.6.6.1 From 56f33c1db024dbb6aae460e3165637cb5deb2c54 Mon Sep 17 00:00:00 2001 From: eli mackenzie Date: Tue, 29 Jun 2010 23:23:01 -0400 Subject: [PATCH 2/2] make it possible to cancel an accidental close of the main window when the systray is enabled --- src/mainwindow.cpp | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 06241ae..b479ba8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -576,11 +576,15 @@ bool MainWindow::queryClose() if (Preferences::self()->showTrayIcon() && !m_closeApp) { - KMessageBox::information( this, - i18n("

Closing the main window will keep Konversation running in the system tray. " - "Use Quit from the Konversation menu to quit the application.

"), - i18n( "Docking in System Tray" ), "HideOnCloseInfo" ); - hide(); + bool doit = KMessageBox::warningContinueCancel( this, + i18n("

Closing the main window will keep Konversation running in the system tray. " + "Use Quit from the Konversation menu to quit the application.

"), + i18n( "Docking in System Tray" ), + KStandardGuiItem::cont(), + KStandardGuiItem::cancel(), + "HideOnCloseInfo" ) == KMessageBox::Continue; + if (doit) + hide(); return false; } -- 1.6.6.1