diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 57 |
1 files changed, 14 insertions, 43 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d1650f36..ebf8d676 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -274,8 +274,8 @@ void MainWindow::postLaunch() // Ctrl + wheel handling connect(this->currentTab()->view(), SIGNAL(zoomChanged(int)), m_zoomBar, SLOT(setValue(int))); - // Save session when last window is closed - connect(this, SIGNAL(lastWindowClosed()), rApp->sessionManager(), SLOT(saveSession())); + // Save session on window closing + connect(this, SIGNAL(windowClosing()), rApp->sessionManager(), SLOT(saveSession())); // setting up toolbars to NOT have context menu enabled setContextMenuPolicy(Qt::DefaultContextMenu); @@ -295,6 +295,7 @@ QSize MainWindow::sizeHint() const return size; } + void MainWindow::changeWindowIcon(int index) { if (ReKonfig::useFavicon()) @@ -305,6 +306,7 @@ void MainWindow::changeWindowIcon(int index) } } + void MainWindow::setupActions() { // this let shortcuts work.. @@ -322,7 +324,7 @@ void MainWindow::setupActions() KStandardAction::open(this, SLOT(fileOpen()), actionCollection()); KStandardAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); KStandardAction::print(this, SLOT(printRequested()), actionCollection()); - KStandardAction::quit(rApp, SLOT(quit()), actionCollection()); + KStandardAction::quit(rApp, SLOT(queryQuit()), actionCollection()); a = KStandardAction::find(m_findBar, SLOT(show()), actionCollection()); KShortcut findShortcut = KStandardShortcut::find(); @@ -1290,6 +1292,7 @@ void MainWindow::clearPrivateData() dialog->deleteLater(); } + void MainWindow::aboutToShowBackMenu() { m_historyBackMenu->clear(); @@ -1403,6 +1406,7 @@ void MainWindow::openActionUrl(QAction *action) history->goToItem(history->itemAt(index)); } + void MainWindow::openActionTab(QAction* action) { int index = action->data().toInt(); @@ -1481,46 +1485,6 @@ void MainWindow::enableNetworkAnalysis(bool b) } -bool MainWindow::queryClose() -{ - // this should fux bug 240432 - if (rApp->sessionSaving()) - return true; - - // smooth private browsing mode - if (QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)) - return true; - - if (rApp->mainWindowList().count() > 1) - { - int answer = KMessageBox::questionYesNoCancel( - this, - i18n("Wanna close the window or the whole app?"), - i18n("Application/Window closing..."), - KGuiItem(i18n("C&lose Current Window"), KIcon("window-close")), - KStandardGuiItem::quit(), - KStandardGuiItem::cancel(), - "confirmClosingMultipleWindows" - ); - - switch (answer) - { - case KMessageBox::Yes: - return true; - - case KMessageBox::No: - rApp->quit(); - return true; - - default: - return false; - } - } - emit lastWindowClosed(); - return true; -} - - void MainWindow::saveNewToolbarConfig() { KXmlGuiWindow::saveNewToolbarConfig(); @@ -1586,3 +1550,10 @@ void MainWindow::setEditable(bool on) { currentTab()->page()->setContentEditable(on); } + + +bool MainWindow::close() +{ + emit windowClosing(); + return KMainWindow::close(); +} |