1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Various fixes regarding "Don't load tabs until selected" option

- fixed typo in Access Keys Navigation plugin
This commit is contained in:
nowrep 2012-03-12 18:22:01 +01:00
parent 36f90f0404
commit 9161945d97
21 changed files with 99 additions and 98 deletions

4
.gitignore vendored
View File

@ -21,5 +21,7 @@ libqupzilla.*
bin/core
qupzilla.sh
git_revision
bin/qupzilla.exe
*.exe
*.dll
*.lib
Thumbs.db

View File

@ -99,7 +99,7 @@ void CommandLineOptions::parseActions()
if (arg.startsWith("-p=") || arg.startsWith("--profile=")) {
arg.remove("-p=");
arg.remove("--profile=");
cout << "starting with profile " << arg.toUtf8().data() << endl;
cout << "QupZilla: Starting with profile " << arg.toUtf8().data() << endl;
ActionPair pair;
pair.action = Qz::CL_StartWithProfile;
pair.text = arg;
@ -144,7 +144,7 @@ void CommandLineOptions::parseActions()
QString url(m_argv[m_argc - 1]);
if (m_argc > 1 && !url.isEmpty() && !url.startsWith("-") && url.contains(".")) {
cout << "starting with url " << url.toUtf8().data() << endl;
cout << "QupZilla: Starting with url " << url.toUtf8().data() << endl;
ActionPair pair;
pair.action = Qz::CL_OpenUrl;
pair.text = url;

View File

@ -895,7 +895,7 @@ bool MainApplication::checkSettingsDir()
return true;
}
std::cout << "Creating new profile directory" << std::endl;
std::cout << "QupZilla: Creating new profile directory" << std::endl;
QDir dir(PROFILEDIR);

View File

@ -93,7 +93,7 @@ void ProfileUpdater::updateProfile(const QString &current, const QString &profil
return;
}
std::cout << "incompatible profile version detected, overwriting profile data..." << std::endl;
std::cout << "QupZilla: Incompatible profile version detected, overwriting profile data..." << std::endl;
copyDataToProfile();
}
@ -110,7 +110,7 @@ void ProfileUpdater::copyDataToProfile()
void ProfileUpdater::update100b4()
{
std::cout << "upgrading profile version from 1.0.0-b4..." << std::endl;
std::cout << "QupZilla: Upgrading profile version from 1.0.0-b4..." << std::endl;
mApp->connectDatabase();
QSqlQuery query;
@ -120,7 +120,7 @@ void ProfileUpdater::update100b4()
void ProfileUpdater::update100rc1()
{
std::cout << "upgrading profile version from 1.0.0-rc1..." << std::endl;
std::cout << "QupZilla: Upgrading profile version from 1.0.0-rc1..." << std::endl;
mApp->connectDatabase();
QSqlQuery query;
@ -134,7 +134,7 @@ void ProfileUpdater::update100rc1()
void ProfileUpdater::update100()
{
std::cout << "upgrading profile version from 1.0.0..." << std::endl;
std::cout << "QupZilla: Upgrading profile version from 1.0.0..." << std::endl;
mApp->connectDatabase();
QSqlQuery query;

View File

@ -6,10 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>829</width>
<height>496</height>
<width>800</width>
<height>500</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>800</width>
<height>500</height>
</size>
</property>
<property name="windowTitle">
<string>Preferences</string>
</property>
@ -292,24 +298,24 @@
</item>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="8" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;b&gt;Profiles&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="10" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Startup profile:</string>
</property>
</widget>
</item>
<item row="9" column="2">
<item row="10" column="2">
<widget class="QComboBox" name="startProfile"/>
</item>
<item row="10" column="1" colspan="3">
<item row="11" column="1" colspan="3">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@ -398,35 +404,35 @@
</property>
</widget>
</item>
<item row="8" column="1">
<item row="9" column="1">
<widget class="QLabel" name="label_45">
<property name="text">
<string>Active profile:</string>
</property>
</widget>
</item>
<item row="8" column="2">
<item row="9" column="2">
<widget class="QLabel" name="activeProfile">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="16" column="1" colspan="2">
<item row="17" column="1" colspan="2">
<widget class="QLabel" name="label_17">
<property name="text">
<string>In order to change language, you must restart browser.</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="3">
<item row="13" column="0" colspan="3">
<widget class="QLabel" name="label_11">
<property name="text">
<string>&lt;b&gt;Language&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="13" column="1">
<item row="14" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QLabel" name="label_16">
@ -449,10 +455,17 @@
</item>
</layout>
</item>
<item row="13" column="2">
<item row="14" column="2">
<widget class="QComboBox" name="languages"/>
</item>
<item row="11" column="1">
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="dontLoadTabsUntilSelected">
<property name="text">
<string>Don't load tabs until selected</string>
</property>
</widget>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -465,13 +478,6 @@
</property>
</spacer>
</item>
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="dontLoadTabsUntilSelected">
<property name="text">
<string>Don't load tabs until selected</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="stackedWidgetPage2">
@ -1697,9 +1703,6 @@
</widget>
<widget class="QWidget" name="stackedWidgetPage6">
<layout class="QGridLayout" name="gridLayout_12">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item row="26" column="1" colspan="4">
<widget class="QCheckBox" name="jscanAccessClipboard">
<property name="text">

View File

@ -16,30 +16,30 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "closedtabsmanager.h"
#include "webview.h"
#include "webtab.h"
#include "mainapplication.h"
#include <QWebHistory>
#include <QWebSettings>
ClosedTabsManager::ClosedTabsManager()
{
}
void ClosedTabsManager::saveView(WebView* view, int position)
void ClosedTabsManager::saveView(WebTab* tab, int position)
{
if (mApp->webSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled) ||
(view->url().isEmpty() && view->history()->items().count() == 0)) {
(tab->url().isEmpty() && tab->history()->items().count() == 0)) {
return;
}
Tab tab;
tab.url = view->url();
tab.title = view->title();
tab.position = position;
QDataStream tabHistoryStream(&tab.history, QIODevice::WriteOnly);
tabHistoryStream << *view->history();
Tab closedTab;
closedTab.url = tab->url();
closedTab.title = tab->title();
closedTab.position = position;
closedTab.history = tab->historyData();
m_closedTabs.prepend(tab);
m_closedTabs.prepend(closedTab);
}
ClosedTabsManager::Tab ClosedTabsManager::getFirstClosedTab()

View File

@ -22,7 +22,7 @@
#include "qz_namespace.h"
class WebView;
class WebTab;
class QT_QUPZILLA_EXPORT ClosedTabsManager
{
@ -42,7 +42,7 @@ public:
explicit ClosedTabsManager();
void saveView(WebView* view, int position);
void saveView(WebTab *tab, int position);
ClosedTabsManager::Tab getFirstClosedTab();
ClosedTabsManager::Tab getTabAt(int index);

View File

@ -59,7 +59,7 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
QWebFrame* frame = view->page()->mainFrame();
QString title = view->title();
QSslCertificate cert = webPage->sslCertificate();
m_baseUrl = view->url();
m_baseUrl = frame->baseUrl();
//GENERAL
ui->heading->setText(QString("<b>%1</b>:").arg(title));

View File

@ -93,8 +93,6 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent)
connect(this, SIGNAL(currentChanged(int)), p_QupZilla, SLOT(refreshHistory()));
connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
connect(m_tabBar, SIGNAL(backTab(int)), this, SLOT(backTab(int)));
connect(m_tabBar, SIGNAL(forwardTab(int)), this, SLOT(forwardTab(int)));
connect(m_tabBar, SIGNAL(reloadTab(int)), this, SLOT(reloadTab(int)));
connect(m_tabBar, SIGNAL(stopTab(int)), this, SLOT(stopTab(int)));
connect(m_tabBar, SIGNAL(closeTab(int)), this, SLOT(closeTab(int)));
@ -358,7 +356,7 @@ void TabWidget::closeTab(int index)
disconnect(webView, SIGNAL(changed()), mApp, SLOT(setStateChanged()));
disconnect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
//Save last tab url and history
m_closedTabsManager->saveView(webView, index);
m_closedTabsManager->saveView(webTab, index);
if (m_isClosingToLastTabIndex && m_lastTabIndex < count() && index == currentIndex()) {
setCurrentIndex(m_lastTabIndex);
@ -463,19 +461,16 @@ void TabWidget::closeAllButCurrent(int index)
int TabWidget::duplicateTab(int index)
{
WebView* view = weTab(index)->view();
const QUrl &url = view->url();
WebTab* webTab = weTab(index);
QByteArray history;
QDataStream tabHistoryStream(&history, QIODevice::WriteOnly);
tabHistoryStream << *view->history();
const QUrl &url = webTab->url();
const QByteArray &history = webTab->historyData();
QNetworkRequest req(url);
req.setRawHeader("Referer", url.toEncoded());
int id = addView(req, tabText(index), Qz::NT_CleanNotSelectedTab);
QDataStream historyStream(history);
historyStream >> *weTab(id)->history();
weTab(id)->setHistoryData(history);
return id;
}
@ -579,29 +574,18 @@ void TabWidget::savePinnedTabs()
QStringList tabs;
QList<QByteArray> tabsHistory;
for (int i = 0; i < count(); ++i) {
if (WebTab* tab = weTab(i)) {
if (!tab->isPinned()) {
WebTab* tab = weTab(i);
if (!tab || !tab->isPinned()) {
continue;
}
tabs.append(tab->url().toEncoded());
if (tab->history()->count() != 0) {
QByteArray tabHistory;
QDataStream tabHistoryStream(&tabHistory, QIODevice::WriteOnly);
tabHistoryStream << *tab->history();
tabsHistory.append(tabHistory);
}
else {
tabsHistory << QByteArray();
}
}
else {
tabs.append(QString::null);
tabsHistory.append(QByteArray());
}
tabsHistory.append(tab->historyData());
}
stream << tabs;
stream << tabsHistory;
QFile file(mApp->getActiveProfilPath() + "pinnedtabs.dat");
file.open(QIODevice::WriteOnly);
file.write(data);

View File

@ -93,8 +93,6 @@ public slots:
void reloadTab(int index);
void reloadAllTabs();
void stopTab(int index);
void backTab(int index);
void forwardTab(int index);
void closeAllButCurrent(int index);
void restoreClosedTab();
void restoreAllClosedTabs();

View File

@ -31,19 +31,10 @@
WebTab::SavedTab::SavedTab(WebTab* webTab)
{
if (webTab->isRestored()) {
WebView* view = webTab->view();
title = view->title();
url = view->url();
icon = view->icon();
QDataStream historyStream(&history, QIODevice::WriteOnly);
historyStream << *view->history();
}
else {
*this = webTab->savedTab();
}
title = webTab->title();
url = webTab->url();
icon = webTab->icon();
history = webTab->historyData();
}
void WebTab::SavedTab::clear()
@ -152,6 +143,26 @@ QWebHistory* WebTab::history() const
return m_view->history();
}
void WebTab::setHistoryData(const QByteArray &data)
{
QDataStream historyStream(data);
historyStream >> *m_view->history();
}
QByteArray WebTab::historyData() const
{
if (isRestored()) {
QByteArray historyArray;
QDataStream historyStream(&historyArray, QIODevice::WriteOnly);
historyStream << *m_view->history();
return historyArray;
}
else {
return m_savedTab.history;
}
}
void WebTab::reload()
{
m_view->reload();

View File

@ -62,7 +62,10 @@ public:
QUrl url() const;
QString title() const;
QIcon icon() const;
QWebHistory* history() const;
QWebHistory *history() const;
void setHistoryData(const QByteArray &data);
QByteArray historyData() const;
void reload();
void stop();

View File

@ -32,7 +32,7 @@ void sigpipe_handler(int s)
// this signal and ignoring it to prevent unneeded crash because of it.
Q_UNUSED(s)
std::cout << "QupZilla::Caught SIGPIPE!" << std::endl;
std::cout << "QupZilla: Caught SIGPIPE!" << std::endl;
}
#endif

View File

@ -35,7 +35,7 @@ PluginSpec AKN_Plugin::pluginSpec()
spec.name = "Access Keys Navigation";
spec.info = "Access keys navigation for QupZilla";
spec.description = "Provides support for navigating in webpages by keyboard shortcuts";
spec.version = "0.2.0";
spec.version = "0.2.1";
spec.author = "David Rosca <nowrep@gmail.com>";
spec.icon = QPixmap(":/accesskeysnavigation/data/icon.png");
spec.hasSettings = true;

View File

@ -100,7 +100,7 @@
<item row="2" column="0">
<widget class="QPushButton" name="licence">
<property name="text">
<string>Licence</string>
<string>License</string>
</property>
</widget>
</item>

View File

@ -40,7 +40,7 @@
</message>
<message>
<location filename="../akn_settings.ui" line="103"/>
<source>Licence</source>
<source>License</source>
<translation>Licence</translation>
</message>
</context>

View File

@ -40,7 +40,7 @@
</message>
<message>
<location filename="../akn_settings.ui" line="103"/>
<source>Licence</source>
<source>License</source>
<translation>Lizenz</translation>
</message>
</context>

View File

@ -40,7 +40,7 @@
</message>
<message>
<location filename="../akn_settings.ui" line="103"/>
<source>Licence</source>
<source>License</source>
<translation>Licentie</translation>
</message>
</context>

View File

@ -40,7 +40,7 @@
</message>
<message>
<location filename="../akn_settings.ui" line="103"/>
<source>Licence</source>
<source>License</source>
<translation>Лиценца</translation>
</message>
</context>

View File

@ -40,7 +40,7 @@
</message>
<message>
<location filename="../akn_settings.ui" line="103"/>
<source>Licence</source>
<source>License</source>
<translation>Лиценца</translation>
</message>
</context>

View File

@ -40,7 +40,7 @@
</message>
<message>
<location filename="../akn_settings.ui" line="103"/>
<source>Licence</source>
<source>License</source>
<translation></translation>
</message>
</context>