diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | icons/hi128-app-rekonq.png | bin | 21599 -> 23005 bytes | |||
-rw-r--r-- | icons/hi16-app-rekonq.png | bin | 954 -> 960 bytes | |||
-rw-r--r-- | icons/hi32-app-rekonq.png | bin | 2621 -> 2863 bytes | |||
-rw-r--r-- | icons/hi64-app-rekonq.png | bin | 7571 -> 8476 bytes | |||
-rw-r--r-- | icons/rekonq.svgz | bin | 32828 -> 34958 bytes | |||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/application.cpp | 26 | ||||
-rw-r--r-- | src/bookmarks.cpp | 2 | ||||
-rw-r--r-- | src/cleardata.ui | 2 | ||||
-rw-r--r-- | src/homepage.cpp | 43 | ||||
-rw-r--r-- | src/homepage.h | 3 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/mainview.cpp | 13 | ||||
-rw-r--r-- | src/mainview.h | 3 | ||||
-rw-r--r-- | src/mainwindow.cpp | 65 | ||||
-rw-r--r-- | src/networkaccessmanager.cpp | 39 | ||||
-rw-r--r-- | src/rekonq.kcfg | 27 | ||||
-rw-r--r-- | src/settings.cpp | 33 | ||||
-rw-r--r-- | src/settings_general.ui | 10 | ||||
-rw-r--r-- | src/settings_proxy.ui | 145 | ||||
-rw-r--r-- | src/tabbar.cpp | 67 | ||||
-rw-r--r-- | src/urlbar.cpp | 6 | ||||
-rw-r--r-- | src/webpage.cpp | 10 | ||||
-rw-r--r-- | src/webview.cpp | 2 |
25 files changed, 225 insertions, 276 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 664156e5..f6761177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ PROJECT( rekonq ) # rekonq info SET(REKONQ_MAJOR_VERSION "0") SET(REKONQ_MINOR_VERSION "2") -SET(REKONQ_PATCH_VERSION "64") +SET(REKONQ_PATCH_VERSION "66") SET(REKONQ_VERSION_STR "${REKONQ_MAJOR_VERSION}.${REKONQ_MINOR_VERSION}.${REKONQ_PATCH_VERSION}" diff --git a/icons/hi128-app-rekonq.png b/icons/hi128-app-rekonq.png Binary files differindex c9eb8f0a..1b0d5b82 100644 --- a/icons/hi128-app-rekonq.png +++ b/icons/hi128-app-rekonq.png diff --git a/icons/hi16-app-rekonq.png b/icons/hi16-app-rekonq.png Binary files differindex f6c54bd0..ab0c1c98 100644 --- a/icons/hi16-app-rekonq.png +++ b/icons/hi16-app-rekonq.png diff --git a/icons/hi32-app-rekonq.png b/icons/hi32-app-rekonq.png Binary files differindex 3beb22f4..b3e9ceea 100644 --- a/icons/hi32-app-rekonq.png +++ b/icons/hi32-app-rekonq.png diff --git a/icons/hi64-app-rekonq.png b/icons/hi64-app-rekonq.png Binary files differindex bdd13d12..502ae87c 100644 --- a/icons/hi64-app-rekonq.png +++ b/icons/hi64-app-rekonq.png diff --git a/icons/rekonq.svgz b/icons/rekonq.svgz Binary files differindex ee927542..95796761 100644 --- a/icons/rekonq.svgz +++ b/icons/rekonq.svgz diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 11fc5c6b..8b7e6f78 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,7 +34,6 @@ KDE4_ADD_UI_FILES( rekonq_SRCS proxy.ui settings_general.ui settings_fonts.ui - settings_proxy.ui settings_webkit.ui cleardata.ui ) diff --git a/src/application.cpp b/src/application.cpp index e3c06a5b..6719d456 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -87,6 +87,16 @@ int Application::newInstance() { KCmdLineArgs::setCwd(QDir::currentPath().toUtf8()); KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); + + // we share one process for several mainwindows, + // so initialize only once + static bool first = true; + + if (first) + { + QTimer::singleShot(0, this, SLOT(postLaunch())); + first = false; + } // is your app session restored? restore session... // this mechanism also falls back to load usual plain rekonq @@ -151,6 +161,10 @@ void Application::postLaunch() Application::historyManager(); Application::sessionManager(); + + // bookmarks loading + connect(Application::bookmarkProvider(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), + Application::instance(), SLOT(loadUrl(const KUrl&, const Rekonq::OpenType&))); } @@ -229,9 +243,16 @@ SessionManager *Application::sessionManager() KIcon Application::icon(const KUrl &url) { + if(url.scheme() == "rekonq" || + (url.isEmpty() // Urlbar is empty for homepage, but we want an icon + && !Application::instance()->mainWindowList().isEmpty() // avoid infinite loop at startup + && Application::instance()->mainWindow()->currentTab()->url().scheme() == "rekonq") + ) + return KIcon("go-home"); + if(url.isEmpty()) return KIcon("text-html"); - + KIcon icon = KIcon(QWebSettings::iconForUrl(url)); if (icon.isNull()) { @@ -393,7 +414,6 @@ MainWindow *Application::newMainWindow() m_mainWindows.prepend(w); w->show(); - QTimer::singleShot(0, this, SLOT(postLaunch())); return w; } @@ -413,7 +433,7 @@ MainWindowList Application::mainWindowList() bool Application::homePage(const KUrl &url) { - if ( url == KUrl("rekonq:lastSites") + if ( url == KUrl("rekonq:closedTabs") || url == KUrl("rekonq:history") || url == KUrl("rekonq:bookmarks") || url == KUrl("rekonq:favorites") diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index c08784e9..815b2f56 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -219,7 +219,7 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString if (toolBarGroup.isNull()) return; - m_bookmarkToolBar->clear(); + m_bookmarkToolBar->clear(); // FIXME CRASH KBookmark bookmark = toolBarGroup.first(); while (!bookmark.isNull()) diff --git a/src/cleardata.ui b/src/cleardata.ui index 56a6f04f..b70d3b5a 100644 --- a/src/cleardata.ui +++ b/src/cleardata.ui @@ -64,7 +64,7 @@ <item> <widget class="QCheckBox" name="homePageThumbs"> <property name="text"> - <string>home page thumbs</string> + <string>Home page thumbs</string> </property> <property name="checked"> <bool>true</bool> diff --git a/src/homepage.cpp b/src/homepage.cpp index 3cc908a9..80d0d3b6 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -75,9 +75,9 @@ QString HomePage::rekonqHomePage(const KUrl &url) QString menu = homePageMenu(url); QString speed; - if(url == KUrl("rekonq:lastSites")) + if(url == KUrl("rekonq:closedTabs")) { - speed = lastVisitedSites(); + speed = fillRecentlyClosedTabs(); } if(url == KUrl("rekonq:history")) { @@ -178,21 +178,21 @@ QString HomePage::homePageMenu(KUrl currentUrl) if(currentUrl == "rekonq:favorites" || currentUrl == "rekonq:home") menu += " current"; menu += "\"><a href=\"rekonq:favorites\">"; - menu += "<img src=\"file:///" + loader->iconPath("rating", KIconLoader::Desktop) + "\" />"; + menu += "<img src=\"file:///" + loader->iconPath("emblem-favorite", KIconLoader::Desktop) + "\" />"; menu += "Favorites</a></div>"; menu += "<div class=\"link"; - if(currentUrl == "rekonq:lastSites") + if(currentUrl == "rekonq:closedTabs") menu += " current"; - menu += "\"><a href=\"rekonq:lastSites\">"; - menu += "<img src=\"file:///" + loader->iconPath("edit-undo", KIconLoader::Desktop) + "\" />"; - menu += "Last Visited</a></div>"; + menu += "\"><a href=\"rekonq:closedTabs\">"; + menu += "<img src=\"file:///" + loader->iconPath("edit-redo", KIconLoader::Desktop) + "\" />"; + menu += "Closed Tabs</a></div>"; menu += "<div class=\"link"; if(currentUrl == "rekonq:bookmarks") menu += " current"; menu += "\"><a href=\"rekonq:bookmarks\">"; - menu += "<img src=\"file:///" + loader->iconPath("bookmarks-organize", KIconLoader::Desktop) + "\" />"; + menu += "<img src=\"file:///" + loader->iconPath("bookmarks", KIconLoader::Desktop) + "\" />"; menu += "Bookmarks</a></div>"; menu += "<div class=\"link"; @@ -223,7 +223,7 @@ QString HomePage::fillHistory() { QModelIndex son = model->index(j, 0, index ); history += son.data(HistoryModel::DateTimeRole).toDateTime().toString("hh:mm"); - history += " "; + history += ' '; history += QString("<a href=\"") + son.data(HistoryModel::UrlStringRole).toString() + QString("\">") + son.data().toString() + QString("</a>"); history += "<br />"; @@ -284,3 +284,28 @@ QString HomePage::createBookItem(const KBookmark &bookmark) books += "<a href=\"" + bookmark.url().prettyUrl() + "\">" + bookmark.text() + "</a><br />"; return books; } + + +QString HomePage::fillRecentlyClosedTabs() +{ + KUrl::List links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs(); + QString closed; + + Q_FOREACH( const KUrl &url, links) + { + QString text = url.prettyUrl(); + if(text.length() > 20) + { + text.truncate(17); + text += "..."; + } + closed += "<div class=\"thumbnail\">"; + closed += "<object type=\"application/image-preview\" data=\""; + closed += url.path() + "\" width=\"200\">"; + closed += "</object>"; + closed += "<br />"; + closed += "<a href=\"" + url.path() + "\">" + text + "</a></div>"; + } + + return closed; +} diff --git a/src/homepage.h b/src/homepage.h index 73bb5859..7d62f50a 100644 --- a/src/homepage.h +++ b/src/homepage.h @@ -55,7 +55,8 @@ private: QString lastVisitedSites(); QString fillHistory(); QString fillBookmarks(); - + QString fillRecentlyClosedTabs(); + QString createBookItem(const KBookmark &bookmark); QString m_homePagePath; diff --git a/src/main.cpp b/src/main.cpp index e7f3cc1d..dffb0c4c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,7 +38,7 @@ static const char description[] = I18N_NOOP("A lightweight Web Browser for KDE based on WebKit"); -static const char version[] = "0.2.64"; +static const char version[] = "0.2.66"; int main(int argc, char **argv) diff --git a/src/mainview.cpp b/src/mainview.cpp index 0abf6996..ba7b720e 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -107,8 +107,8 @@ MainView::~MainView() } -TabBar *MainView::tabBar() const -{ +TabBar *MainView::tabBar() const +{ return m_tabBar; } @@ -179,6 +179,8 @@ void MainView::clear() // What exactly do we need to clear here? m_urlBar->clearHistory(); m_urlBar->clear(); + + m_recentlyClosedTabs.clear(); } @@ -411,6 +413,7 @@ void MainView::slotCloseTab(int index) return; } hasFocus = tab->hasFocus(); + m_recentlyClosedTabs.prepend(tab->url()); } QWidget *webView = widget(index); @@ -569,3 +572,9 @@ QLabel *MainView::animatedLoading(int index, bool addMovie) m_tabBar->setTabButton(index, QTabBar::LeftSide, label); return label; } + + +KUrl::List MainView::recentlyClosedTabs() +{ + return m_recentlyClosedTabs; +} diff --git a/src/mainview.h b/src/mainview.h index 48e0b58b..96710919 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -89,6 +89,7 @@ public: */ WebView *newWebView(bool focused = true, bool nearParent = false); + KUrl::List recentlyClosedTabs(); signals: // tab widget signals @@ -155,6 +156,8 @@ private: QString m_loadingGitPath; int m_currentTabIndex; + + KUrl::List m_recentlyClosedTabs; }; #endif // MAINVIEW_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ac9b83bb..c0008cba 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -45,6 +45,7 @@ #include "findbar.h" #include "sidepanel.h" #include "urlbar.h" +#include "tabbar.h" // Ui Includes #include "ui_cleardata.h" @@ -68,6 +69,7 @@ #include <kdeprintdialog.h> #include <KToggleAction> #include <KStandardDirs> +#include <KActionCategory> // Qt Includes #include <QtCore/QTimer> @@ -95,8 +97,8 @@ MainWindow::MainWindow() , m_findBar(new FindBar(this)) , m_sidePanel(0) , m_historyBackMenu(0) - , m_mainBar( new KToolBar( QString("MainToolBar"), this, Qt::TopToolBarArea, true, true, true) ) - , m_bmBar( new KToolBar( QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, true, true) ) + , m_mainBar( new KToolBar( QString("MainToolBar"), this, Qt::TopToolBarArea, true, false, false) ) + , m_bmBar( new KToolBar( QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, false) ) , m_ac( new KActionCollection(this) ) { // enable window size "auto-save" @@ -168,7 +170,12 @@ void MainWindow::setupToolbars() m_mainBar->addSeparator(); m_mainBar->addAction( actionByName("stop_reload") ); m_mainBar->addAction( actionByName(KStandardAction::name(KStandardAction::Home)) ); - m_mainBar->addAction( actionByName("url_bar") ); + + // location bar + KAction *urlBarAction = new KAction(this); + urlBarAction->setDefaultWidget(m_view->urlBar()); + m_mainBar->addAction( urlBarAction ); + m_mainBar->addAction( actionByName("bookmarksActionMenu") ); m_mainBar->addAction( actionByName("rekonq_tools") ); @@ -204,10 +211,6 @@ void MainWindow::postLaunch() // Find Bar signal connect(m_findBar, SIGNAL(searchString(const QString &)), this, SLOT(slotFind(const QString &))); - // bookmarks loading - connect(Application::bookmarkProvider(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), - Application::instance(), SLOT(loadUrl(const KUrl&, const Rekonq::OpenType&))); - // setting up toolbars to NOT have context menu enabled setContextMenuPolicy(Qt::DefaultContextMenu); @@ -236,12 +239,7 @@ void MainWindow::setupActions() actionCollection()->addAssociatedWidget(this); KAction *a; - - // location bar - a = new KAction(i18n("Location Bar"), this); - a->setDefaultWidget(m_view->urlBar()); - actionCollection()->addAction(QLatin1String("url_bar"), a); - + // new window action a = new KAction(KIcon("window-new"), i18n("&New Window"), this); a->setShortcut(KShortcut(Qt::CTRL | Qt::Key_N)); @@ -264,7 +262,6 @@ void MainWindow::setupActions() KStandardAction::home(this, SLOT(slotHome()), actionCollection()); KStandardAction::preferences(this, SLOT(slotPreferences()), actionCollection()); - // WEB Actions (NO KStandardActions..) a = KStandardAction::redisplay(m_view, SLOT(slotWebReload()), actionCollection()); a->setText(i18n("Reload")); @@ -280,13 +277,13 @@ void MainWindow::setupActions() connect(m_view, SIGNAL(browserTabLoading(bool)), this, SLOT(slotBrowserLoading(bool))); slotBrowserLoading(false); //first init for blank start page - a = new KAction(this); + a = new KAction(i18n("Open Location"), this); a->setShortcut(Qt::CTRL + Qt::Key_L); actionCollection()->addAction(QLatin1String("open_location"), a); connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotOpenLocation())); - // ============== Zoom Actions + // ============================= Zoom Actions =================================== a = new KAction(KIcon("zoom-in"), i18n("&Enlarge Font"), this); a->setShortcut(KShortcut(Qt::CTRL | Qt::Key_Plus)); actionCollection()->addAction(QLatin1String("bigger_font"), a); @@ -302,13 +299,12 @@ void MainWindow::setupActions() actionCollection()->addAction(QLatin1String("smaller_font"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotViewTextSmaller())); - // ----------- + // =============================== Tools Actions ================================= a = new KAction(i18n("Page S&ource"), this); a->setIcon(KIcon("application-xhtml+xml")); actionCollection()->addAction(QLatin1String("page_source"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotViewPageSource())); - // ================ Tools (WebKit) Actions a = new KAction(KIcon("tools-report-bug"), i18n("Web &Inspector"), this); a->setCheckable(true); actionCollection()->addAction(QLatin1String("web_inspector"), a); @@ -319,7 +315,11 @@ void MainWindow::setupActions() actionCollection()->addAction(QLatin1String("private_browsing"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotPrivateBrowsing(bool))); - // ================ history related actions + a = new KAction(KIcon("edit-clear"), i18n("Clear Private Data..."), this); + actionCollection()->addAction(QLatin1String("clear_private_data"), a); + connect(a, SIGNAL(triggered(bool)), this, SLOT(clearPrivateData())); + + // ========================= History related actions ============================== a = KStandardAction::back(this, SLOT(slotOpenPrevious()) , actionCollection()); m_historyBackMenu = new KMenu(this); @@ -329,7 +329,7 @@ void MainWindow::setupActions() KStandardAction::forward(this, SLOT(slotOpenNext()) , actionCollection()); - // =================== Tab Actions + // ============================== Tab Actions ==================================== a = new KAction(KIcon("tab-new"), i18n("New &Tab"), this); a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_T)); actionCollection()->addAction(QLatin1String("new_tab"), a); @@ -350,11 +350,24 @@ void MainWindow::setupActions() actionCollection()->addAction(QLatin1String("show_prev_tab"), a); connect(a, SIGNAL(triggered(bool)), m_view, SLOT(previousTab())); - // clear private data action - a = new KAction(KIcon("edit-clear"), i18n("Clear Private Data..."), this); - actionCollection()->addAction(QLatin1String("clear_private_data"), a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(clearPrivateData())); + a = new KAction(KIcon("tab-duplicate"), i18n("Clone Tab"), this); + actionCollection()->addAction(QLatin1String("clone_tab"), a); + connect(a, SIGNAL(triggered(bool)), m_view->tabBar(), SLOT(cloneTab()) ); + a = new KAction(KIcon("tab-close-other"), i18n("Close &Other Tabs"), this); + actionCollection()->addAction( QLatin1String("close_other_tabs"), a); + connect(a, SIGNAL(triggered(bool)), m_view->tabBar(), SLOT(closeOtherTabs()) ); + + a = new KAction(KIcon("view-refresh"), i18n("Reload Tab"), this); + actionCollection()->addAction( QLatin1String("reload_tab"), a); + connect(a, SIGNAL(triggered(bool)), m_view->tabBar(), SLOT(reloadTab()) ); + + a = new KAction(KIcon("view-refresh"), i18n("Reload All Tabs"), this); + actionCollection()->addAction( QLatin1String("reload_all_tabs"), a); + connect(a, SIGNAL(triggered(bool)), m_view, SLOT(slotReloadAllTabs()) ); + + // ------------------------------------------------------------------------------------------------------------ + // Bookmarks ToolBar Action QAction *qa = m_bmBar->toggleViewAction(); qa->setText( i18n("Bookmarks Toolbar") ); @@ -363,7 +376,7 @@ void MainWindow::setupActions() // Bookmark Menu KActionMenu *bmMenu = Application::bookmarkProvider()->bookmarkActionMenu(this); - bmMenu->setIcon(KIcon("rating")); + bmMenu->setIcon(KIcon("bookmarks")); bmMenu->setDelayed(false); actionCollection()->addAction(QLatin1String("bookmarksActionMenu"), bmMenu); @@ -1024,7 +1037,7 @@ void MainWindow::clearPrivateData() kDebug() << path; QDir cacheDir(path); QStringList fileList = cacheDir.entryList(); - foreach(QString str, fileList) + foreach(const QString &str, fileList) { kDebug() << str; QFile file(path + str); diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index fd975062..1cdc6700 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -42,6 +42,7 @@ // KDE Includes #include <KMessageBox> #include <KStandardDirs> +#include <KProtocolManager> // Qt Includes #include <QtCore/QPointer> @@ -69,7 +70,7 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) // load AccessManager Settings loadSettings(); - + // resetting disk cache resetDiskCache(); } @@ -77,23 +78,31 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) void NetworkAccessManager::loadSettings() { - if (ReKonfig::isProxyEnabled()) + // Grab proxy settings from KDE settings + if (KProtocolManager::useProxy()) { - QNetworkProxy proxy; - if (ReKonfig::proxyType() == 0) - { - proxy.setType(QNetworkProxy::Socks5Proxy); - } - else + QString proxyAddress = KProtocolManager::proxyFor("http"); + + if(!proxyAddress.isEmpty()) { - proxy.setType(QNetworkProxy::HttpProxy); + KUrl proxyUrl(proxyAddress); + QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy; + + // See what kind of proxy we have here + if(proxyUrl.protocol() == "socks") + { + proxyType = QNetworkProxy::Socks5Proxy; + } + else + { + proxyType = QNetworkProxy::HttpProxy; + } + + QNetworkProxy proxy(proxyType, proxyUrl.host(), (quint16)proxyUrl.port(), + proxyUrl.user(), proxyUrl.pass()); + + setProxy(proxy); } - proxy.setHostName(ReKonfig::proxyHostName()); - proxy.setPort(ReKonfig::proxyPort()); - proxy.setUser(ReKonfig::proxyUserName()); - proxy.setPassword(ReKonfig::proxyPassword()); - - setProxy(proxy); } } diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 0bffa53d..c55fce9c 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> -<kcfg> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > <!-- Includes --> <include>QtWebKit</include> @@ -44,6 +47,9 @@ <entry name="openTabsNearCurrent" type="Bool"> <default>false</default> </entry> + <entry name="alwaysShowTabPreviews" type="Bool"> + <default>true</default> + </entry> </group> <!-- Fonts Settings --> @@ -72,25 +78,6 @@ </entry> </group> -<!-- Proxy Settings --> - <group name="Proxy"> - <entry name="isProxyEnabled" type="Bool"> - <default>false</default> - </entry> - <entry name="proxyType" type="Int"> - <default>0</default> - </entry> - <entry name="proxyHostName" type="String"> - </entry> - <entry name="proxyPort" type="Int"> - <default>8080</default> - </entry> - <entry name="proxyUserName" type="String"> - </entry> - <entry name="proxyPassword" type="Password"> - </entry> - </group> - <!-- WebKit Settings --> <group name="Webkit"> <entry name="autoLoadImages" type="Bool"> diff --git a/src/settings.cpp b/src/settings.cpp index ec5094c2..4a6c50b8 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -42,7 +42,6 @@ //Ui Includes #include "ui_settings_general.h" #include "ui_settings_fonts.h" -#include "ui_settings_proxy.h" #include "ui_settings_webkit.h" // KDE Includes @@ -63,10 +62,11 @@ class Private private: Ui::general generalUi; Ui::fonts fontsUi; - Ui::proxy proxyUi; Ui::webkit webkitUi; + KCModuleProxy *proxyModule; KCModuleProxy *ebrowsingModule; KCModuleProxy *cookiesModule; + KShortcutsEditor *shortcutsEditor; Private(SettingsDialog *parent); @@ -84,7 +84,7 @@ Private::Private(SettingsDialog *parent) widget->layout()->setMargin(0); pageItem = parent->addPage(widget , i18n("General")); pageItem->setIcon(KIcon("rekonq")); - + widget = new QWidget; fontsUi.setupUi(widget); widget->layout()->setMargin(0); @@ -96,12 +96,11 @@ Private::Private(SettingsDialog *parent) pageItem = parent->addPage(cookiesModule, i18n(cookiesInfo.moduleName().toLocal8Bit())); pageItem->setIcon(KIcon(cookiesInfo.icon())); - widget = new QWidget; - proxyUi.setupUi(widget); - widget->layout()->setMargin(0); - pageItem = parent->addPage(widget , i18n("Proxy")); - pageItem->setIcon(KIcon("preferences-system-network")); - + KCModuleInfo proxyInfo("proxy.desktop"); + proxyModule = new KCModuleProxy(proxyInfo,parent); + pageItem = parent->addPage(proxyModule, i18n(proxyInfo.moduleName().toLocal8Bit())); + pageItem->setIcon(KIcon(proxyInfo.icon())); + widget = new QWidget; webkitUi.setupUi(widget); widget->layout()->setMargin(0); @@ -110,8 +109,8 @@ Private::Private(SettingsDialog *parent) KIcon webkitIcon = KIcon(QIcon(webkitIconPath)); pageItem->setIcon(webkitIcon); - widget = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(),parent); - pageItem = parent->addPage(widget , i18n("Shortcuts")); + shortcutsEditor = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(),parent); + pageItem = parent->addPage(shortcutsEditor , i18n("Shortcuts")); pageItem->setIcon(KIcon("configure-shortcuts")); KCModuleInfo ebrowsingInfo("ebrowsing.desktop"); @@ -143,7 +142,9 @@ SettingsDialog::SettingsDialog(QWidget *parent) connect(d->ebrowsingModule, SIGNAL(changed(bool)), this, SLOT(updateButtons())); connect(d->cookiesModule, SIGNAL(changed(bool)), this, SLOT(updateButtons())); - + connect(d->proxyModule, SIGNAL(changed(bool)), this, SLOT(updateButtons())); + connect(d->shortcutsEditor, SIGNAL(keyChange()), this, SLOT(updateButtons())); + connect(this, SIGNAL(applyClicked()), this, SLOT(saveSettings())); connect(this, SIGNAL(okClicked()), this, SLOT(saveSettings())); @@ -185,11 +186,6 @@ void SettingsDialog::readConfig() // ======= Fonts d->fontsUi.kcfg_fixedFont->setOnlyFixed(true); - - // ======= Proxy - bool proxyEnabled = ReKonfig::isProxyEnabled(); - d->proxyUi.groupBox->setEnabled(proxyEnabled); - connect(d->proxyUi.kcfg_isProxyEnabled, SIGNAL(clicked(bool)), d->proxyUi.groupBox, SLOT(setEnabled(bool))); } @@ -201,6 +197,8 @@ void SettingsDialog::saveSettings() ReKonfig::self()->writeConfig(); d->ebrowsingModule->save(); d->cookiesModule->save(); + d->proxyModule->save(); + d->shortcutsEditor->save(); } @@ -209,6 +207,7 @@ bool SettingsDialog::hasChanged() return KConfigDialog::hasChanged() || d->ebrowsingModule->changed() || d->cookiesModule->changed() + || d->proxyModule->changed() ; } diff --git a/src/settings_general.ui b/src/settings_general.ui index d12d254f..5ea19b09 100644 --- a/src/settings_general.ui +++ b/src/settings_general.ui @@ -139,6 +139,16 @@ </property> </widget> </item> + <item> + <widget class="QCheckBox" name="kcfg_alwaysShowTabPreviews"> + <property name="text"> + <string>Show preview when hovering tab</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> </layout> </widget> </item> diff --git a/src/settings_proxy.ui b/src/settings_proxy.ui deleted file mode 100644 index 938529b0..00000000 --- a/src/settings_proxy.ui +++ /dev/null @@ -1,145 +0,0 @@ -<ui version="4.0" > - <class>proxy</class> - <widget class="QWidget" name="proxy" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>440</width> - <height>223</height> - </rect> - </property> - <property name="windowTitle" > - <string>Proxy</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QCheckBox" name="kcfg_isProxyEnabled" > - <property name="text" > - <string>Enable proxy</string> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox" > - <property name="title" > - <string>Proxy Settings</string> - </property> - <layout class="QGridLayout" name="gridLayout_6" > - <item row="1" column="0" > - <widget class="QLabel" name="label_9" > - <property name="text" > - <string>Type:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="1" column="1" colspan="2" > - <widget class="KComboBox" name="kcfg_proxyType" > - <item> - <property name="text" > - <string>SOCKS 5</string> - </property> - </item> - <item> - <property name="text" > - <string>HTTP</string> - </property> - </item> - </widget> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="label_10" > - <property name="text" > - <string>Host:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="2" column="1" colspan="2" > - <widget class="KLineEdit" name="kcfg_proxyHostName" /> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="label_11" > - <property name="text" > - <string>Port:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QSpinBox" name="kcfg_proxyPort" > - <property name="maximum" > - <number>10000</number> - </property> - <property name="value" > - <number>1080</number> - </property> - </widget> - </item> - <item row="3" column="2" > - <spacer name="horizontalSpacer_2" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0" > - <size> - <width>293</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_12" > - <property name="text" > - <string>Username:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="4" column="1" colspan="2" > - <widget class="KLineEdit" name="kcfg_proxyUserName" /> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="label_13" > - <property name="text" > - <string>Password:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="5" column="1" colspan="2" > - <widget class="KLineEdit" name="kcfg_proxyPassword" /> - </item> - <item row="6" column="0" > - <spacer name="verticalSpacer_2" > - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0" > - <size> - <width>20</width> - <height>8</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 815a153d..94f2c274 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -32,6 +32,7 @@ #include "tabbar.moc" // Local Includes +#include "rekonq.h" #include "application.h" #include "mainwindow.h" #include "urlbar.h" @@ -164,18 +165,18 @@ void TabBar::contextMenuRequested(const QPoint &position) { m_actualIndex = index; - menu.addAction(KIcon("tab-duplicate"), i18n("Clone Tab"), this, SLOT(cloneTab())); + menu.addAction( mainWindow->actionByName("clone_tab") ); menu.addSeparator(); - menu.addAction(KIcon("tab-close"), i18n("&Close Tab"), this, SLOT(closeTab())); - menu.addAction(KIcon("tab-close-other"), i18n("Close &Other Tabs"), this, SLOT(closeOtherTabs())); + menu.addAction( mainWindow->actionByName("close_tab") ); + menu.addAction( mainWindow->actionByName("close_other_tabs") ); menu.addSeparator(); - menu.addAction(KIcon("view-refresh"), i18n("Reload Tab"), this, SLOT(reloadTab())); + menu.addAction( mainWindow->actionByName("reload_tab") ); } else { menu.addSeparator(); } - menu.addAction(i18n("Reload All Tabs"), this, SIGNAL(reloadAllTabs())); + menu.addAction( mainWindow->actionByName("reload_all_tabs") ); menu.exec(QCursor::pos()); } @@ -265,47 +266,53 @@ void TabBar::showTabPreview(int tab) void TabBar::mouseMoveEvent(QMouseEvent *event) { - //Find the tab under the mouse - int i = 0; - int tab = -1; - while (i<count() && tab==-1) + if (ReKonfig::alwaysShowTabPreviews()) { - if (tabRect(i).contains(event->pos())) + //Find the tab under the mouse + int i = 0; + int tab = -1; + while (i<count() && tab==-1) { - tab = i; + if (tabRect(i).contains(event->pos())) + { + tab = i; + } + i++; } - i++; - } - //if found and not the current tab then show tab preview - if (tab != -1 && tab != currentIndex() && m_currentTabPreview != tab) - { - showTabPreview(tab); - m_currentTabPreview = tab; - } + //if found and not the current tab then show tab preview + if (tab != -1 && tab != currentIndex() && m_currentTabPreview != tab) + { + showTabPreview(tab); + m_currentTabPreview = tab; + } - //if current tab or not found then hide previous tab preview - if (tab==currentIndex() || tab==-1) - { - if ( m_previewPopup) + //if current tab or not found then hide previous tab preview + if (tab==currentIndex() || tab==-1) { - m_previewPopup->hide(); + if ( m_previewPopup) + { + m_previewPopup->hide(); + } + m_currentTabPreview = -1; } - m_currentTabPreview = -1; } - + KTabBar::mouseMoveEvent(event); } void TabBar::leaveEvent(QEvent *event) { - //if leave tabwidget then hide previous tab preview - if ( m_previewPopup) + if (ReKonfig::alwaysShowTabPreviews()) { - m_previewPopup->hide(); + //if leave tabwidget then hide previous tab preview + if ( m_previewPopup) + { + m_previewPopup->hide(); + } + m_currentTabPreview = -1; } - m_currentTabPreview = -1; KTabBar::leaveEvent(event); } diff --git a/src/urlbar.cpp b/src/urlbar.cpp index 5776961b..5ad8314e 100644 --- a/src/urlbar.cpp +++ b/src/urlbar.cpp @@ -135,10 +135,12 @@ void UrlBar::setUrl(const QUrl& url) { if(url.scheme() == "rekonq") { + m_currentUrl = ""; setFocus(); - return; } - m_currentUrl = url; + else + m_currentUrl = url; + slotUpdateUrl(); } diff --git a/src/webpage.cpp b/src/webpage.cpp index 59c777d6..2b622847 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -93,6 +93,16 @@ WebPage::~WebPage() bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) { + // advise users on resubmitting data + if(type == QWebPage::NavigationTypeFormResubmitted) + { + int risp = KMessageBox::warningContinueCancel(view(), + i18n("Are you sure you want to send your data again?"), + i18n("Resend form data") ); + if(risp == KMessageBox::Cancel) + return false; + } + if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton) { Application::instance()->loadUrl(request.url(), Rekonq::SettingOpenTab); diff --git a/src/webview.cpp b/src/webview.cpp index a2662399..9e06c9da 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -432,4 +432,4 @@ void WebView::keyPressEvent(QKeyEvent *event) return; } QWebView::keyPressEvent(event); -}
\ No newline at end of file +} |