diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | src/application.cpp | 2 | ||||
-rw-r--r-- | src/cookiejar.cpp | 3 | ||||
-rw-r--r-- | src/cookiejar.h | 11 | ||||
-rw-r--r-- | src/history.cpp | 4 | ||||
-rw-r--r-- | src/mainview.cpp | 16 | ||||
-rw-r--r-- | src/mainview.h | 14 | ||||
-rw-r--r-- | src/mainwindow.cpp | 16 | ||||
-rw-r--r-- | src/mainwindow.h | 2 | ||||
-rw-r--r-- | src/networkaccessmanager.cpp | 2 | ||||
-rw-r--r-- | src/rekonq.kcfg | 18 | ||||
-rw-r--r-- | src/settings.cpp | 25 | ||||
-rw-r--r-- | src/settings_fonts.ui | 16 | ||||
-rw-r--r-- | src/settings_general.ui | 107 | ||||
-rw-r--r-- | src/settings_privacy.ui | 58 | ||||
-rw-r--r-- | src/webview.cpp | 6 |
16 files changed, 152 insertions, 150 deletions
@@ -10,7 +10,7 @@ DONE Added Google Suggestions - load just ONE site at start - loading right sites as "external browser" - provide translations - +DONE notfound.html shown if rekonq doesn't load connection To 0.0.4 - improve DOCUMENTATION diff --git a/src/application.cpp b/src/application.cpp index de62bbef..6c621015 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -140,7 +140,7 @@ MainWindow *Application::mainWindow() WebView *Application::newTab() { - return m_mainWindow->tabWidget()->newTab(); + return m_mainWindow->mainView()->newTab(); } diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp index 958adb42..d4ecb3f2 100644 --- a/src/cookiejar.cpp +++ b/src/cookiejar.cpp @@ -43,7 +43,7 @@ static const unsigned int JAR_VERSION = 23; -QT_BEGIN_NAMESPACE + QDataStream &operator<<(QDataStream &stream, const QList<QNetworkCookie> &list) { stream << JAR_VERSION; @@ -82,7 +82,6 @@ QDataStream &operator>>(QDataStream &stream, QList<QNetworkCookie> &list) } return stream; } -QT_END_NAMESPACE CookieJar::CookieJar(QObject *parent) diff --git a/src/cookiejar.h b/src/cookiejar.h index b61cebcc..1796d252 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -32,13 +32,12 @@ #include <QStringList> #include <QTableView> -QT_BEGIN_NAMESPACE +// Forward Declarations class QSortFilterProxyModel; class QKeyEvent; -QT_END_NAMESPACE - class AutoSaver; + class CookieJar : public QNetworkCookieJar { friend class CookieModel; @@ -55,13 +54,15 @@ signals: void cookiesChanged(); public: - enum AcceptPolicy { + enum AcceptPolicy + { AcceptAlways, AcceptNever, AcceptOnlyFromSitesNavigatedTo }; - enum KeepPolicy { + enum KeepPolicy + { KeepUntilExpire, KeepUntilExit, KeepUntilTimeLimit diff --git a/src/history.cpp b/src/history.cpp index 87910308..5023bfd3 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -309,10 +309,6 @@ void HistoryManager::load() void HistoryManager::save() { -// KConfig config("rekonqrc"); -// KConfigGroup group = config.group("history"); -// group.writeEntry( QString("historyLimit"), m_historyLimit ); - bool saveAll = m_lastSavedUrl.isEmpty(); int first = m_history.count() - 1; if (!saveAll) diff --git a/src/mainview.cpp b/src/mainview.cpp index a39c40b1..a1eed467 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -89,11 +89,17 @@ MainView::~MainView() } -void MainView::viewTabBar() +void MainView::showTabBar() { bool always = ReKonfig::alwaysShowTabBar(); if(always == true) + { + if( m_tabBar->isHidden() ) + { + m_tabBar->show(); + } return; + } if( m_tabBar->count() == 1 ) { @@ -391,7 +397,7 @@ WebView *MainView::newTab(bool makeCurrent) currentChanged(currentIndex()); emit tabsChanged(); - viewTabBar(); + showTabBar(); return webView; } @@ -447,7 +453,7 @@ void MainView::closeOtherTabs(int index) for (int i = index - 1; i >= 0; --i) closeTab(i); - viewTabBar(); + showTabBar(); } @@ -461,7 +467,7 @@ void MainView::cloneTab(int index) WebView *tab = newTab(false); tab->setUrl( webView(index)->url() ); - viewTabBar(); + showTabBar(); } @@ -505,7 +511,7 @@ void MainView::closeTab(int index) if (count() == 0) emit lastTabClosed(); - viewTabBar(); + showTabBar(); } diff --git a/src/mainview.h b/src/mainview.h index 6ad623fe..78fe2a2c 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -87,6 +87,13 @@ public: QLineEdit *lineEdit(int index) const; int webViewIndex(WebView *webView) const; + /** + * show and hide TabBar if user doesn't choose + * "Always Show TabBar" option + * + */ + void showTabBar(); + protected: void mouseDoubleClickEvent(QMouseEvent *event); void contextMenuEvent(QContextMenuEvent *event); @@ -129,13 +136,6 @@ private slots: private: - /** - * show and hide TabBar if user doesn't choose - * "Always Show TabBar" option - * - */ - void viewTabBar(); - KAction *m_recentlyClosedTabsAction; KMenu *m_recentlyClosedTabsMenu; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index df596bdd..e286cc36 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -309,7 +309,7 @@ void MainWindow::slotUpdateConf() { // ============== General ================== m_homePage = ReKonfig::homePage(); - + mainView()->showTabBar(); // =========== Fonts ============== QWebSettings *defaultSettings = QWebSettings::globalSettings(); @@ -320,33 +320,29 @@ void MainWindow::slotUpdateConf() defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family()); defaultSettings->setFontSize(QWebSettings::DefaultFontSize, fnSize); - QFont fixedFont = ReKonfig::fixedFont(); defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family()); defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fnSize); - // =========== Privacy ============== - bool arePluginsEnabled = ReKonfig::enablePlugins(); bool isJavascriptEnabled = ReKonfig::enableJavascript(); defaultSettings->setAttribute(QWebSettings::PluginsEnabled, arePluginsEnabled); defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, isJavascriptEnabled); - // load Settings on main classes + // ====== load Settings on main classes Application::networkAccessManager()->loadSettings(); Application::cookieJar()->loadSettings(); Application::historyManager()->loadSettings(); - // ============ Proxy ================ } void MainWindow::slotUpdateBrowser() { slotUpdateConf(); - tabWidget()->reloadAllTabs(); + mainView()->reloadAllTabs(); } @@ -435,7 +431,7 @@ void MainWindow::slotPreferences() { // an instance the dialog could be already created and could be cached, // in which case you want to display the cached dialog - if ( SettingsDialog::showDialog( "settings" ) ) + if ( SettingsDialog::showDialog( "rekonfig" ) ) return; // we didn't find an instance of this dialog, so lets create it @@ -546,7 +542,7 @@ void MainWindow::slotPrivateBrowsing() MainWindow* win = Application::instance()->mainWindow(); win->m_lastSearch = QString::null; - win->tabWidget()->clear(); + win->mainView()->clear(); } } @@ -688,7 +684,7 @@ void MainWindow::slotToggleInspector(bool enable) // } -MainView *MainWindow::tabWidget() const +MainView *MainWindow::mainView() const { return m_view; } diff --git a/src/mainwindow.h b/src/mainwindow.h index ee07707d..15eda7ec 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -56,7 +56,7 @@ public: ~MainWindow(); static KUrl guessUrlFromString(const QString &url); - MainView *tabWidget() const; + MainView *mainView() const; WebView *currentTab() const; virtual QSize sizeHint() const; diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 96e099b8..882ae4e1 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -36,6 +36,7 @@ // KDE Includes #include <KMessageBox> +#include <KDebug> // Qt Includes #include <QDialog> @@ -64,6 +65,7 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) void NetworkAccessManager::loadSettings() { + kWarning() << "loading NetworkAccessManager settings.."; QNetworkProxy proxy; if ( ReKonfig::isProxyEnabled() ) { diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 373f3fd1..f2a2cedd 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -17,12 +17,15 @@ <entry name="downloadDir" type="Path"> <default>$HOME</default> </entry> - <entry name="expireHistory" type="Int"> - <default>1</default> - </entry> <entry name="alwaysShowTabBar" type="Bool"> <default>true</default> </entry> + <entry name="enablePlugins" type="Bool"> + <default>true</default> + </entry> + <entry name="enableJavascript" type="Bool"> + <default>true</default> + </entry> </group> <!-- Fonts Settings --> @@ -40,12 +43,9 @@ <!-- Privacy Settings --> <group name="Privacy"> - <entry name="enablePlugins" type="Bool"> - <default>true</default> - </entry> - <entry name="enableJavascript" type="Bool"> - <default>true</default> - </entry> + <entry name="expireHistory" type="Int"> + <default>1</default> + </entry> <entry name="acceptCookies" type="Int"> <default>2</default> </entry> diff --git a/src/settings.cpp b/src/settings.cpp index 68a051ea..860e7050 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -100,8 +100,8 @@ Private::Private(SettingsDialog *parent) // ----------------------------------------------------------------------------------------------------- SettingsDialog::SettingsDialog(QWidget *parent) - : KConfigDialog(parent, "settings", ReKonfig::self() ) - , d(new Private(this) ) + : KConfigDialog(parent, "rekonfig", ReKonfig::self()) + , d(new Private(this)) { setFaceType(KPageDialog::List); showButtonSeparator(true); @@ -123,6 +123,7 @@ SettingsDialog::~SettingsDialog() delete d; } + // we need this function to UPDATE the config widget data.. void SettingsDialog::readConfig() { @@ -132,15 +133,12 @@ void SettingsDialog::readConfig() connect(d->generalUi.downloadDirUrlRequester, SIGNAL(textChanged(QString)),this, SLOT(saveSettings())); // ======= Fonts - QFont stdFont = ReKonfig::standardFont(); - d->fontsUi.standardFont->setCurrentFont(stdFont); - - QFont fxFont = ReKonfig::fixedFont(); - d->fontsUi.fixedFont->setOnlyFixed(true); - d->fontsUi.fixedFont->setCurrentFont(fxFont); - - int fnSize = ReKonfig::fontSize(); - d->fontsUi.fontSize->setValue( fnSize ); +// QFont stdFont = ReKonfig::standardFont(); +// d->fontsUi.standardFont->setCurrentFont(stdFont); +// +// QFont fxFont = ReKonfig::fixedFont(); + d->fontsUi.kcfg_fixedFont->setOnlyFixed(true); +// d->fontsUi.fixedFont->setCurrentFont(fxFont); // ======= Proxy bool proxyEnabled = ReKonfig::isProxyEnabled(); @@ -156,9 +154,8 @@ void SettingsDialog::saveSettings() ReKonfig::setDownloadDir( d->generalUi.downloadDirUrlRequester->url().prettyUrl() ); // Fonts - ReKonfig::setStandardFont( d->fontsUi.standardFont->currentFont() ); - ReKonfig::setFixedFont( d->fontsUi.fixedFont->currentFont() ); - ReKonfig::setFontSize( d->fontsUi.fontSize->value() ); +// ReKonfig::setStandardFont( d->fontsUi.standardFont->currentFont() ); +// ReKonfig::setFixedFont( d->fontsUi.fixedFont->currentFont() ); // Save ReKonfig::self()->writeConfig(); diff --git a/src/settings_fonts.ui b/src/settings_fonts.ui index d3090ef7..de258cad 100644 --- a/src/settings_fonts.ui +++ b/src/settings_fonts.ui @@ -6,20 +6,20 @@ <rect> <x>0</x> <y>0</y> - <width>363</width> - <height>241</height> + <width>414</width> + <height>298</height> </rect> </property> <property name="windowTitle"> <string>Appearance</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="QGroupBox" name="groupBox"> <property name="title"> <string>Fonts</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> + <layout class="QVBoxLayout" name="verticalLayout"> <item> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="0"> @@ -37,16 +37,14 @@ </widget> </item> <item row="1" column="1"> - <widget class="KFontComboBox" name="fixedFont"/> + <widget class="KFontComboBox" name="kcfg_fixedFont"/> </item> <item row="0" column="1"> - <widget class="KFontComboBox" name="standardFont"/> + <widget class="KFontComboBox" name="kcfg_standardFont"/> </item> </layout> </item> </layout> - <zorder></zorder> - <zorder></zorder> </widget> </item> <item> @@ -65,7 +63,7 @@ </widget> </item> <item> - <widget class="QSpinBox" name="fontSize"/> + <widget class="QSpinBox" name="kcfg_fontSize"/> </item> </layout> </item> diff --git a/src/settings_general.ui b/src/settings_general.ui index 9b963f89..3f07eaa5 100644 --- a/src/settings_general.ui +++ b/src/settings_general.ui @@ -6,18 +6,18 @@ <rect> <x>0</x> <y>0</y> - <width>392</width> - <height>269</height> + <width>515</width> + <height>415</height> </rect> </property> <property name="windowTitle"> <string>General</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="QGroupBox" name="groupBox"> <property name="title"> - <string>HomePage</string> + <string>Places</string> </property> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="0"> @@ -64,76 +64,61 @@ </item> </layout> </item> + <item row="2" column="1"> + <widget class="KUrlRequester" name="downloadDirUrlRequester"/> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_7"> + <property name="text"> + <string>Save downloads to:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> </layout> </widget> </item> <item> - <widget class="QGroupBox" name="groupBox_2"> + <widget class="QGroupBox" name="groupBox_3"> <property name="title"> - <string>misc</string> + <string>Appearance</string> </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="label_4"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QCheckBox" name="kcfg_alwaysShowTabBar"> <property name="text"> - <string>Remove history items:</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <string>Always show TabBar</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QComboBox" name="kcfg_expireHistory"> - <item> - <property name="text"> - <string>After one day</string> - </property> - </item> - <item> - <property name="text"> - <string>After one week</string> - </property> - </item> - <item> - <property name="text"> - <string>After two weeks</string> - </property> - </item> - <item> - <property name="text"> - <string>After one month</string> - </property> - </item> - <item> - <property name="text"> - <string>After one year</string> - </property> - </item> - <item> - <property name="text"> - <string>Manually</string> - </property> - </item> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_7"> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Web Content</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="kcfg_enablePlugins"> <property name="text"> - <string>Save downloads to:</string> + <string>Enable Plugins</string> </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <property name="checked"> + <bool>true</bool> </property> </widget> </item> - <item row="1" column="1"> - <widget class="KUrlRequester" name="downloadDirUrlRequester"/> - </item> - <item row="2" column="1"> - <widget class="QCheckBox" name="kcfg_alwaysShowTabBar"> + <item> + <widget class="QCheckBox" name="kcfg_enableJavascript"> <property name="text"> - <string>Always show TabBar</string> + <string>Enable Javascript</string> + </property> + <property name="checked"> + <bool>true</bool> </property> </widget> </item> @@ -141,14 +126,14 @@ </widget> </item> <item> - <spacer name="spacer"> + <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>384</width> - <height>36</height> + <width>20</width> + <height>40</height> </size> </property> </spacer> diff --git a/src/settings_privacy.ui b/src/settings_privacy.ui index 7f3ff1a8..b04f0611 100644 --- a/src/settings_privacy.ui +++ b/src/settings_privacy.ui @@ -15,29 +15,53 @@ </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QGroupBox" name="groupBox"> + <widget class="QGroupBox" name="groupBox_2"> <property name="title"> - <string>Web Content</string> + <string>History</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QCheckBox" name="kcfg_enablePlugins"> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label_4"> <property name="text"> - <string>Enable Plugins</string> + <string>Remove history items:</string> </property> - <property name="checked"> - <bool>true</bool> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> </item> - <item> - <widget class="QCheckBox" name="kcfg_enableJavascript"> - <property name="text"> - <string>Enable Javascript</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> + <item row="0" column="1"> + <widget class="QComboBox" name="kcfg_expireHistory"> + <item> + <property name="text"> + <string>After one day</string> + </property> + </item> + <item> + <property name="text"> + <string>After one week</string> + </property> + </item> + <item> + <property name="text"> + <string>After two weeks</string> + </property> + </item> + <item> + <property name="text"> + <string>After one month</string> + </property> + </item> + <item> + <property name="text"> + <string>After one year</string> + </property> + </item> + <item> + <property name="text"> + <string>Manually</string> + </property> + </item> </widget> </item> </layout> @@ -132,7 +156,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>136</height> </size> </property> </spacer> diff --git a/src/webview.cpp b/src/webview.cpp index da286ee8..947b08cd 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -122,7 +122,7 @@ QWebPage *WebPage::createWindow(QWebPage::WebWindowType type) if (m_openInNewTab) { m_openInNewTab = false; - return mainWindow()->tabWidget()->newTab()->page(); + return mainWindow()->mainView()->newTab()->page(); } MainWindow *mainWindow = Application::instance()->mainWindow(); @@ -137,9 +137,7 @@ QObject *WebPage::createPlugin(const QString &classId, const QUrl &url, const QS kWarning() << "url = " << url; kWarning() << "Param Names = " << paramNames; kWarning() << "Param Values = " << paramValues; -// Q_UNUSED(url); -// Q_UNUSED(paramNames); -// Q_UNUSED(paramValues); + QUiLoader loader; return loader.createWidget(classId, view()); } |