From 76d30285358bedd8b2fc6caf48d2a871f7546685 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 19 Jan 2009 02:26:13 +0100 Subject: Ported tons of code to KConfigXT. To merge kcfg branch we need just to port cookie settings.. --- src/mainwindow.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bdf2120d..629899e4 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -66,7 +66,8 @@ MainWindow::MainWindow() setAcceptDrops(true); // updating rekonq configuration - updateConfiguration(); + slotUpdateConf(); +// QTimer::singleShot(0, this, SLOT( postLaunch() ) ); // creating a new tab m_view->newTab(); @@ -118,7 +119,6 @@ MainWindow::MainWindow() // Find Bar m_findBar = new FindBar( this ); connect( m_findBar, SIGNAL( searchString(const QString &) ), this, SLOT( slotFind(const QString &) ) ); - } @@ -282,28 +282,11 @@ void MainWindow::setupCustomMenu() // TODO FIXME -void MainWindow::updateConfiguration() +void MainWindow::slotUpdateConf() { // ============== General ================== m_homePage = ReKonfig::homePage(); -// int historyExpire = ReKonfig::expireHistory(); -// int days; -// switch (historyExpire) -// { -// case 0: days = 1; break; -// case 1: days = 7; break; -// case 2: days = 14; break; -// case 3: days = 30; break; -// case 4: days = 365; break; -// case 5: days = -1; break; -// default: days = -1; -// } -// m_historyExpire = days; -// -// m_downloadDir = ReKonfig::downloadDir(); - - // =========== Fonts ============== QFont standardFont = ReKonfig::standardFont(); QFont fixedFont = ReKonfig::fixedFont(); @@ -454,7 +437,17 @@ void MainWindow::slotFileSaveAs() 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" ) ) + return; + + // we didn't find an instance of this dialog, so lets create it SettingsDialog *s = new SettingsDialog(this); + + // keep us informed when the user changes settings + connect( s, SIGNAL(settingsChanged(const QString&)), this, SLOT(slotUpdateConf()) ); + s->show(); } -- cgit v1.2.1