From 57bc503662183f0d2b89ddc419548e0938c17e8f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 9 Feb 2010 11:15:10 +0100 Subject: Fix NewTabPage API && comments --- src/rekonqpage/newtabpage.cpp | 4 ++++ src/rekonqpage/newtabpage.h | 18 ++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/rekonqpage/newtabpage.cpp b/src/rekonqpage/newtabpage.cpp index 19f1686f..95b15ed9 100644 --- a/src/rekonqpage/newtabpage.cpp +++ b/src/rekonqpage/newtabpage.cpp @@ -197,6 +197,7 @@ QWebElement NewTabPage::loadingPreview(int index, KUrl url) return prev; } + QWebElement NewTabPage::validPreview(int index, KUrl url, QString title) { QWebElement prev = markup(".thumbnail"); @@ -220,12 +221,15 @@ void NewTabPage::hideControls(QWebElement e) e.findFirst(".remove").setStyleProperty("visibility", "hidden"); e.findFirst(".modify").setStyleProperty("visibility", "hidden"); } + + void NewTabPage::showControls(QWebElement e) { e.findFirst(".remove").setStyleProperty("visibility", "visible"); e.findFirst(".modify").setStyleProperty("visibility", "visible"); } + void NewTabPage::setupPreview(QWebElement e, int index) { e.findFirst(".remove img").setAttribute("src", QString("file:///") + diff --git a/src/rekonqpage/newtabpage.h b/src/rekonqpage/newtabpage.h index 9d41946e..38d82684 100644 --- a/src/rekonqpage/newtabpage.h +++ b/src/rekonqpage/newtabpage.h @@ -44,18 +44,17 @@ class WebPage; class NewTabPage : public QObject { Q_OBJECT + public: NewTabPage(QWebFrame *frame); ~NewTabPage(); /** - * This is the unique NewTabPage public method. It takes an - * about: url and loads the corresponding part of the - * new tab page + * This method takes an about: url and loads + * the corresponding part of the new tab page */ void generate(KUrl url = KUrl("about:home")); -public slots: void snapFinished(int index, KUrl url, QString title); void removePreview(int index); @@ -63,6 +62,10 @@ protected: // these are the function to build the new tab page void browsingMenu(const KUrl ¤tUrl); void favoritesPage(); + void historyPage(); + void bookmarksPage(); + void closedTabsPage(); + QWebElement emptyPreview(int index); QWebElement loadingPreview(int index, KUrl url); QWebElement validPreview(int index, KUrl url, QString title); @@ -73,12 +76,7 @@ protected: // these are the function to build the new tab page void hideControls(QWebElement e); void showControls(QWebElement e); void setupPreview(QWebElement e, int index); - - - void historyPage(); - void bookmarksPage(); - void closedTabsPage(); - + private: void createBookItem(const KBookmark &bookmark, QWebElement parent); -- cgit v1.2.1