From 1df70c152d9621a6b4ec41af19260e737f7ef58b Mon Sep 17 00:00:00 2001 From: Domrachev Alexandr Date: Thu, 18 Jun 2009 22:39:08 +0400 Subject: MainWindow::slotPrivateBrowsing fix Don't show private browsing confirmation dialog when disabling private browsing. Private browsing activation confirm dialog fix. --- src/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index abc3fcd5..20ee31f8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -288,7 +288,7 @@ void MainWindow::setupActions() a = new KAction(KIcon("view-media-artist"), i18n("Private &Browsing"), this); a->setCheckable(true); actionCollection()->addAction(QLatin1String("private_browsing"), a); - connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotPrivateBrowsing(bool))); + connect(a, SIGNAL(triggered(bool)), this, SLOT(slotPrivateBrowsing(bool))); // ================ history related actions m_historyBackAction = new KAction(KIcon("go-previous"), i18n("Back"), this); @@ -524,7 +524,7 @@ void MainWindow::printRequested(QWebFrame *frame) void MainWindow::slotPrivateBrowsing(bool enable) { QWebSettings *settings = QWebSettings::globalSettings(); - if (enable) + if (enable && !settings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) { QString title = i18n("Are you sure you want to turn on private browsing?"); QString text = "" + title + i18n("

When private browsing is turned on," @@ -535,8 +535,8 @@ void MainWindow::slotPrivateBrowsing(bool enable) " Until you close the window, you can still click the Back and Forward buttons" \ " to return to the web pages you have opened."); - int button = KMessageBox::questionYesNo(this, text, title); - if (button == KMessageBox::Ok) + int button = KMessageBox::questionYesNo(this, text, title); + if (button == KMessageBox::Yes) { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); } -- cgit v1.2.1 From 63de0263e68f31dd9535e6e92932260b0ab6111a Mon Sep 17 00:00:00 2001 From: Domrachev Alexandr Date: Thu, 18 Jun 2009 22:47:32 +0400 Subject: MainWindow::slotFind{Next, Previous} code clean --- src/mainwindow.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 20ee31f8..d0405ea9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -570,15 +570,9 @@ void MainWindow::slotFindNext() if (!currentTab() && m_lastSearch.isEmpty()) return; - QWebPage::FindFlags options; + QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; if (m_findBar->matchCase()) - { - options = QWebPage::FindCaseSensitively | QWebPage::FindWrapsAroundDocument; - } - else - { - options = QWebPage::FindWrapsAroundDocument; - } + options |= QWebPage::FindCaseSensitively; if (!currentTab()->findText(m_lastSearch, options)) { @@ -592,15 +586,9 @@ void MainWindow::slotFindPrevious() if (!currentTab() && m_lastSearch.isEmpty()) return; - QWebPage::FindFlags options; + QWebPage::FindFlags options = QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; if (m_findBar->matchCase()) - { - options = QWebPage::FindCaseSensitively | QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; - } - else - { - options = QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; - } + options |= QWebPage::FindCaseSensitively; if (!currentTab()->findText(m_lastSearch, options)) { -- cgit v1.2.1 From 0ed1a768789d208a93d747e9d0bac581ab69d1cb Mon Sep 17 00:00:00 2001 From: Domrachev Alexandr Date: Thu, 18 Jun 2009 22:57:11 +0400 Subject: File filter fix in MainView::slotFileOpen dialog. --- src/mainwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d0405ea9..94411794 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -476,10 +476,10 @@ void MainWindow::slotUpdateWindowTitle(const QString &title) void MainWindow::slotFileOpen() { QString filePath = KFileDialog::getOpenFileName(KUrl(), - i18n("Web Resources (*.html *.htm *.svg *.png *.gif *.svgz); All files (*.*)"), + i18n("*.html *.htm *.svg *.png *.gif *.svgz|Web Resources (*.html *.htm *.svg *.png *.gif *.svgz)\n"\ + "*.*|All files (*.*)"), this, - i18n("Open Web Resource") - ); + i18n("Open Web Resource")); if (filePath.isEmpty()) return; -- cgit v1.2.1 From 2e7d5ea7f5f4dcb24a446fc112a80d1811a3ec14 Mon Sep 17 00:00:00 2001 From: Domrachev Alexandr Date: Thu, 18 Jun 2009 23:03:47 +0400 Subject: Some text reformatting --- src/mainwindow.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 94411794..aed1ef9c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -476,7 +476,7 @@ void MainWindow::slotUpdateWindowTitle(const QString &title) void MainWindow::slotFileOpen() { QString filePath = KFileDialog::getOpenFileName(KUrl(), - i18n("*.html *.htm *.svg *.png *.gif *.svgz|Web Resources (*.html *.htm *.svg *.png *.gif *.svgz)\n"\ + i18n("*.html *.htm *.svg *.png *.gif *.svgz|Web Resources (*.html *.htm *.svg *.png *.gif *.svgz)\n" \ "*.*|All files (*.*)"), this, i18n("Open Web Resource")); @@ -704,8 +704,8 @@ void MainWindow::slotToggleInspector(bool enable) if (enable) { int result = KMessageBox::questionYesNo(this, - i18n("The web inspector will only work correctly for pages that were loaded after enabling.\n" - "Do you want to reload all pages?"), + i18n("The web inspector will only work correctly for pages that were loaded after enabling.\n" \ + "Do you want to reload all pages?"), i18n("Web Inspector") ); @@ -834,17 +834,16 @@ bool MainWindow::queryClose() int answer = KMessageBox::questionYesNoCancel( this, - i18np( "Are you sure you want to close the window?\n" - "You have 1 tab open", - "Are you sure you want to close the window?\n" - "You have %1 tabs open", - m_view->count()), - i18n("Are you sure you want to close the window?"), - KStandardGuiItem::quit(), - KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")), - KStandardGuiItem::cancel(), - "confirmClosingMultipleTabs" - ); + i18np("Are you sure you want to close the window?\n" \ + "You have 1 tab open", + "Are you sure you want to close the window?\n" \ + "You have %1 tabs open", + m_view->count()), + i18n("Are you sure you want to close the window?"), + KStandardGuiItem::quit(), + KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")), + KStandardGuiItem::cancel(), + "confirmClosingMultipleTabs"); switch (answer) { -- cgit v1.2.1 From 76d86dde4d9e5801ccbdce66f8ccaa86ccbd77d0 Mon Sep 17 00:00:00 2001 From: Domrachev Alexandr Date: Fri, 19 Jun 2009 01:18:23 +0400 Subject: Application::icon() changed to static --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index aed1ef9c..b60e3469 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -766,7 +766,7 @@ void MainWindow::slotAboutToShowBackMenu() QWebHistoryItem item = history->backItems(history->count()).at(i); KAction *action = new KAction(this); action->setData(-1*(historyCount - i - 1)); - QIcon icon = Application::instance()->icon(item.url()); + QIcon icon = Application::icon(item.url()); action->setIcon(icon); action->setText(item.title()); m_historyBackMenu->addAction(action); -- cgit v1.2.1