summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/home.html7
-rw-r--r--src/mainwindow.cpp7
-rw-r--r--src/newtabpage.cpp30
-rw-r--r--src/urlbar/lineedit.cpp2
4 files changed, 43 insertions, 3 deletions
diff --git a/src/data/home.html b/src/data/home.html
index 97bec22d..25236743 100644
--- a/src/data/home.html
+++ b/src/data/home.html
@@ -189,6 +189,13 @@ margin-right: 5px;
}
/* -------------------------------------------------------- */
+/* Empty pages : in the end : need to overwrite */
+#content.empty {
+margin-top: 10%;
+text-align: center;
+}
+
+
</style>
</head>
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 3c8874e1..cb90f818 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -71,6 +71,7 @@
#include <KToggleAction>
#include <KStandardDirs>
#include <KActionCategory>
+#include <KProcess>
// Qt Includes
#include <QtCore/QTimer>
@@ -1183,8 +1184,9 @@ void MainWindow::clearPrivateData()
clearWidget.setupUi(&widget);
dialog->setMainWidget(&widget);
+ dialog->exec();
- if (dialog->exec() == KDialog::Ok)
+ if (dialog->result() == QDialog::Accepted)
{
if(clearWidget.clearHistory->isChecked())
{
@@ -1204,7 +1206,8 @@ void MainWindow::clearPrivateData()
if(clearWidget.clearCachedPages->isChecked())
{
- // TODO implement me!
+ KProcess::startDetached(KStandardDirs::findExe("kio_http_cache_cleaner"),
+ QStringList(QLatin1String("--clear-all")));
}
if(clearWidget.clearWebIcons->isChecked())
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index d7671937..b709375a 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -180,6 +180,13 @@ void NewTabPage::favoritesPage()
QStringList names = ReKonfig::previewNames();
QStringList urls = ReKonfig::previewUrls();
+ if(urls.isEmpty())
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("You can add a preview by clicking the \"Add Preview\" button in the top-right corner of this page"));
+ return;
+ }
+
for(int i=0; i < urls.count() ; ++i)
{
KUrl url = urls.at(i);
@@ -396,6 +403,13 @@ void NewTabPage::historyPage()
HistoryTreeModel *model = Application::historyManager()->historyTreeModel();
+ if(model->rowCount() == 0)
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("Your browsing history is empty"));
+ return;
+ }
+
int i = 0;
do
{
@@ -436,6 +450,8 @@ void NewTabPage::bookmarksPage()
KBookmarkGroup bookGroup = Application::bookmarkProvider()->rootGroup();
if (bookGroup.isNull())
{
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("You have no bookmarks"));
return;
}
@@ -483,6 +499,13 @@ void NewTabPage::closedTabsPage()
QList<HistoryItem> links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs();
+ if(links.isEmpty())
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("There are no recently closed tabs"));
+ return;
+ }
+
for(int i=0; i < links.count(); ++i)
{
HistoryItem item = links.at(i);
@@ -527,6 +550,13 @@ void NewTabPage::downloadsPage()
DownloadList list = Application::historyManager()->downloads();
+ if(list.isEmpty())
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("There are no recently downloaded files to show"));
+ return;
+ }
+
foreach(const DownloadItem &item, list)
{
m_root.prependInside(markup("div"));
diff --git a/src/urlbar/lineedit.cpp b/src/urlbar/lineedit.cpp
index 09c158fa..6236512f 100644
--- a/src/urlbar/lineedit.cpp
+++ b/src/urlbar/lineedit.cpp
@@ -129,7 +129,7 @@ void LineEdit::paintEvent(QPaintEvent *event)
painter.setPen(Qt::gray);
painter.drawText( textRect,
Qt::AlignCenter,
- i18n("Search Bookmarks, History, Google.. just start typing here!")
+ i18n("Search Bookmarks, History, Web.. just start typing here!")
);
}
}