summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-03-30 18:19:51 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-04-02 09:22:58 +0200
commit89304e6e7a994fd0d5a4e5605ed955303668ab53 (patch)
treeff974282bbb4aea199cafea4d485fea7ff5b401b /src
parentLoad a clean session and close dialog (diff)
downloadrekonq-89304e6e7a994fd0d5a4e5605ed955303668ab53.tar.xz
Add a "session" startup option
BUG: 249462
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp18
-rw-r--r--src/rekonq.kcfg3
-rw-r--r--src/sessionmanager.cpp2
-rw-r--r--src/sessionmanager.h4
-rw-r--r--src/settings/generalwidget.cpp11
-rw-r--r--src/settings/generalwidget.h1
-rw-r--r--src/settings/settings_general.ui79
-rw-r--r--src/webwindow/webwindow.cpp6
8 files changed, 53 insertions, 71 deletions
diff --git a/src/application.cpp b/src/application.cpp
index bf326888..3a76a6de 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -192,16 +192,23 @@ int Application::newInstance()
if (isFirstLoad)
{
bool restoreOk = false;
- if (ReKonfig::startupBehaviour() == 2)
+
+ switch(ReKonfig::startupBehaviour())
{
+ case 2:
if (hasToBeRecoveredFromCrash)
restoreOk = false;
else
restoreOk = SessionManager::self()->restoreSessionFromScratch();
- }
- else
- {
+ break;
+
+ case 3:
+ SessionManager::self()->manageSessions();
+ break;
+
+ default:
restoreOk = SessionManager::self()->restoreJustThePinnedTabs();
+ break;
}
isFirstLoad = !restoreOk;
@@ -296,6 +303,9 @@ int Application::newInstance()
loadUrl(KUrl("about:home") , Rekonq::NewTab);
}
break;
+ case 3:
+ SessionManager::self()->manageSessions();
+ break;
default:
ASSERT_NOT_REACHED(unknown startup behavior);
break;
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index 152b83bf..c6931d2b 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -85,9 +85,6 @@
<entry name="startupBehaviour" type="Int">
<default>1</default>
</entry>
- <entry name="useNewTabPage" type="Bool">
- <default>false</default>
- </entry>
<entry name="homePage" type="String">
<default>http://www.kde.org/</default>
</entry>
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index a4345635..36082b57 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -480,7 +480,7 @@ bool SessionManager::restoreYourSession(int index)
}
-void SessionManager::manageSession()
+void SessionManager::manageSessions()
{
kDebug() << "OK ,manage session..";
diff --git a/src/sessionmanager.h b/src/sessionmanager.h
index 604a67e5..99e8fcb9 100644
--- a/src/sessionmanager.h
+++ b/src/sessionmanager.h
@@ -85,13 +85,13 @@ public Q_SLOTS:
bool restoreJustThePinnedTabs();
void saveSession();
+ void manageSessions();
+
private Q_SLOTS:
// This method restores session
// after a crash
void restoreCrashedSession();
- void manageSession();
-
private:
QString m_sessionFilePath;
bool m_safe;
diff --git a/src/settings/generalwidget.cpp b/src/settings/generalwidget.cpp
index d64fd8d3..0f582d66 100644
--- a/src/settings/generalwidget.cpp
+++ b/src/settings/generalwidget.cpp
@@ -49,10 +49,6 @@ GeneralWidget::GeneralWidget(QWidget *parent)
connect(setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage()));
- disableHomeSettings(ReKonfig::useNewTabPage());
-
- connect(kcfg_useNewTabPage, SIGNAL(toggled(bool)), this, SLOT(disableHomeSettings(bool)));
-
checkKGetPresence();
connect(kcfg_homePage, SIGNAL(editingFinished()), this, SLOT(fixHomePageURL()));
@@ -99,13 +95,6 @@ void GeneralWidget::setHomeToCurrentPage()
}
-void GeneralWidget::disableHomeSettings(bool b)
-{
- kcfg_homePage->setEnabled(!b);
- setHomeToCurrentPageButton->setEnabled(!b);
-}
-
-
void GeneralWidget::checkKGetPresence()
{
if (KStandardDirs::findExe("kget").isNull())
diff --git a/src/settings/generalwidget.h b/src/settings/generalwidget.h
index ad865955..b0caa46c 100644
--- a/src/settings/generalwidget.h
+++ b/src/settings/generalwidget.h
@@ -52,7 +52,6 @@ Q_SIGNALS:
private Q_SLOTS:
void hasChanged();
void setHomeToCurrentPage();
- void disableHomeSettings(bool);
void fixHomePageURL();
private:
diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui
index 3764df8b..66424fa6 100644
--- a/src/settings/settings_general.ui
+++ b/src/settings/settings_general.ui
@@ -15,12 +15,12 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QGroupBox" name="groupBox_2">
+ <widget class="QGroupBox" name="groupBox">
<property name="title">
- <string>Startup</string>
+ <string>First settings</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="1" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@@ -45,41 +45,7 @@
</property>
</widget>
</item>
- <item>
- <widget class="KComboBox" name="kcfg_startupBehaviour">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <item>
- <property name="text">
- <string>Open the Home Page</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Open the New Tab Page</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Restore the Last Opened Tabs</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>Home Page</string>
- </property>
- <layout class="QFormLayout" name="formLayout_2">
- <item row="1" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@@ -101,7 +67,7 @@
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="KLineEdit" name="kcfg_homePage">
<property name="enabled">
<bool>true</bool>
@@ -114,7 +80,7 @@
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="setHomeToCurrentPageButton">
@@ -138,11 +104,34 @@
</item>
</layout>
</item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="kcfg_useNewTabPage">
- <property name="text">
- <string>Use the New Tab Page as home page</string>
+ <item row="1" column="1">
+ <widget class="KComboBox" name="kcfg_startupBehaviour">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
+ <item>
+ <property name="text">
+ <string>Open the Home Page</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Open the New Tab Page</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Restore the Last Opened Tabs</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Show session dialog</string>
+ </property>
+ </item>
</widget>
</item>
</layout>
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index a6e5d876..5858ec6c 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -283,7 +283,7 @@ void WebWindow::setupActions()
// User sessions management
a = new KAction(KIcon("view-choose"), i18n("&Manage Sessions"), this);
actionCollection()->addAction(QL1S("session_manage"), a);
- connect(a, SIGNAL(triggered(bool)), SessionManager::self(), SLOT(manageSession()));
+ connect(a, SIGNAL(triggered(bool)), SessionManager::self(), SLOT(manageSessions()));
// ===== Tools Actions =================================
a = new KAction(i18n("View Page S&ource"), this);
@@ -968,9 +968,7 @@ void WebWindow::openBookmarksPage()
void WebWindow::openHomePage(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
{
- KUrl homeUrl = ReKonfig::useNewTabPage()
- ? KUrl(QL1S("about:home"))
- : KUrl(ReKonfig::homePage());
+ KUrl homeUrl = KUrl(ReKonfig::homePage());
if (buttons == Qt::MidButton || modifiers == Qt::ControlModifier)
rApp->loadUrl(homeUrl, Rekonq::NewTab);