From e1791ac7190b8fc570c7097f48d2ad2b5cd29ee1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 14 Sep 2009 18:33:32 +0200 Subject: Open new tab near previous --- src/mainview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mainview.cpp') diff --git a/src/mainview.cpp b/src/mainview.cpp index 7c91b992..3836ddd0 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -274,7 +274,8 @@ WebView *MainView::newWebView(bool focused) connect(webView->page(), SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested())); connect(webView->page(), SIGNAL(printRequested(QWebFrame *)), this, SIGNAL(printRequested(QWebFrame *))); - addTab(webView, i18n("(Untitled)")); + // opening tab NEAR the previous + insertTab(currentIndex() + 1, webView, i18n("(Untitled)")); if (focused) { -- cgit v1.2.1 From f59b52ea590fcef4f76b8691edec542e133c1b78 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 14 Sep 2009 00:24:08 +0200 Subject: Recently closed tabs: first implementation --- src/mainview.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mainview.cpp') diff --git a/src/mainview.cpp b/src/mainview.cpp index 3836ddd0..a40729a3 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -176,6 +176,8 @@ void MainView::clear() /// TODO What exactly do we need to clear here? m_urlBar->clearHistory(); m_urlBar->clear(); + + m_recentlyClosedTabs.clear(); } @@ -403,11 +405,13 @@ void MainView::slotCloseTab(int index) int risp = KMessageBox::questionYesNo(this, i18n("You have modified this page and when closing it you would lose the modifications.\n" "Do you really want to close this page?\n"), - i18n("Do you really want to close this page?")); + i18n("Closing tab confirmation")); if (risp == KMessageBox::No) return; } hasFocus = tab->hasFocus(); + + m_recentlyClosedTabs.prepend(tab->url()); } QWidget *webView = widget(index); @@ -583,3 +587,9 @@ void MainView::resizeEvent(QResizeEvent *event) { KTabWidget::resizeEvent(event); } + + +KUrl::List MainView::recentlyClosedTabs() +{ + return m_recentlyClosedTabs; +} -- cgit v1.2.1 From a25e22d7b195877666237007665ce20e1358753b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 15 Sep 2009 12:37:14 +0200 Subject: Fixing state. Rekonq is not usable now, but this seems a good tech preview. Anyway, performance is definitely a problem with this method, also loading just the first time. Looking at the other way... :) --- src/mainview.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/mainview.cpp') diff --git a/src/mainview.cpp b/src/mainview.cpp index a40729a3..2a3545b4 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -42,6 +42,7 @@ #include "webview.h" #include "sessionmanager.h" #include "homepage.h" +#include "websnap.h" // KDE Includes #include @@ -299,7 +300,7 @@ void MainView::newTab() urlBar()->setUrl(KUrl("")); urlBar()->setFocus(); - HomePage p; + HomePage p(w); switch(ReKonfig::newTabsBehaviour()) { @@ -593,3 +594,24 @@ KUrl::List MainView::recentlyClosedTabs() { return m_recentlyClosedTabs; } + + +void MainView::polish() +{ + static int i = 0; + WebSnap *ws = qobject_cast(sender()); + delete ws; + + i++; + if(i<9) + { + WebView *w = currentWebView(); + HomePage p(w); + w->setHtml( p.rekonqHomePage() ); + kDebug() << "ciao---------------------------------------------____"; + } + else + { + kDebug() << "EROORORORORORORORORORO"; + } +} -- cgit v1.2.1 From 32d0da0ba3c17281c4a69ee84b42e98246eb3c5d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 15 Sep 2009 12:58:56 +0200 Subject: First adjustments and code about it (it's really simple, anyway..Qt rocks!!!) --- src/mainview.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/mainview.cpp') diff --git a/src/mainview.cpp b/src/mainview.cpp index 2a3545b4..038562e8 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -594,24 +594,3 @@ KUrl::List MainView::recentlyClosedTabs() { return m_recentlyClosedTabs; } - - -void MainView::polish() -{ - static int i = 0; - WebSnap *ws = qobject_cast(sender()); - delete ws; - - i++; - if(i<9) - { - WebView *w = currentWebView(); - HomePage p(w); - w->setHtml( p.rekonqHomePage() ); - kDebug() << "ciao---------------------------------------------____"; - } - else - { - kDebug() << "EROORORORORORORORORORO"; - } -} -- cgit v1.2.1 From 47a26d10894d4c88d219dba8d04c0eae4ea48974 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 15 Sep 2009 17:14:14 +0200 Subject: Here we are, embedding Qt Widgets.. Now it's time to RUN working or I'll be dismissed!! This implementation works quite fine, it's a bit slow but really better than the previous one. It crashes gloriously loading flash contents (Qt bug? WebPlugin one's?) and does not resize well webviews.. --- src/mainview.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mainview.cpp') diff --git a/src/mainview.cpp b/src/mainview.cpp index 038562e8..accc1610 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -42,7 +42,6 @@ #include "webview.h" #include "sessionmanager.h" #include "homepage.h" -#include "websnap.h" // KDE Includes #include -- cgit v1.2.1