mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Various changes in starting application.
- constantly renaimed app plugins to Extensions
This commit is contained in:
parent
a2a21bd01b
commit
17d70adfa5
@ -128,7 +128,7 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
|
|||||||
setOverrideCursor(Qt::WaitCursor);
|
setOverrideCursor(Qt::WaitCursor);
|
||||||
setWindowIcon(QIcon(":icons/exeicons/qupzilla-window.png"));
|
setWindowIcon(QIcon(":icons/exeicons/qupzilla-window.png"));
|
||||||
bool noAddons = false;
|
bool noAddons = false;
|
||||||
QUrl startUrl("");
|
QUrl startUrl;
|
||||||
QStringList messages;
|
QStringList messages;
|
||||||
QString startProfile;
|
QString startProfile;
|
||||||
|
|
||||||
@ -178,9 +178,6 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString)));
|
|
||||||
connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings()));
|
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
setQuitOnLastWindowClosed(false);
|
setQuitOnLastWindowClosed(false);
|
||||||
#else
|
#else
|
||||||
@ -222,34 +219,27 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
|
|||||||
settings2.setValue("isRunning", true);
|
settings2.setValue("isRunning", true);
|
||||||
settings2.endGroup();
|
settings2.endGroup();
|
||||||
|
|
||||||
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, m_activeProfil);
|
|
||||||
|
|
||||||
translateApp();
|
translateApp();
|
||||||
QWebHistoryInterface::setDefaultInterface(new WebHistoryInterface(this));
|
|
||||||
|
|
||||||
QupZilla* qupzilla = new QupZilla(Qz::BW_FirstAppWindow, startUrl);
|
QupZilla* qupzilla = new QupZilla(Qz::BW_FirstAppWindow, startUrl);
|
||||||
m_mainWindows.append(qupzilla);
|
|
||||||
connect(qupzilla, SIGNAL(message(Qz::AppMessageType, bool)), this, SLOT(sendMessages(Qz::AppMessageType, bool)));
|
|
||||||
qupzilla->show();
|
qupzilla->show();
|
||||||
|
m_mainWindows.append(qupzilla);
|
||||||
|
|
||||||
AutoSaver* saver = new AutoSaver();
|
connect(qupzilla, SIGNAL(message(Qz::AppMessageType, bool)), this, SLOT(sendMessages(Qz::AppMessageType, bool)));
|
||||||
connect(saver, SIGNAL(saveApp()), this, SLOT(saveStateSlot()));
|
connect(qupzilla, SIGNAL(startingCompleted()), this, SLOT(restoreCursor()));
|
||||||
|
|
||||||
if (settings2.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool()) {
|
if (settings2.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool()) {
|
||||||
m_updater = new Updater(qupzilla);
|
m_updater = new Updater(qupzilla);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noAddons) {
|
loadSettings();
|
||||||
settings2.setValue("Plugin-Settings/AllowedPlugins", QStringList());
|
networkManager()->loadCertificates();
|
||||||
settings2.setValue("Plugin-Settings/EnablePlugins", false);
|
|
||||||
|
if (!noAddons) {
|
||||||
|
plugins()->loadPlugins();
|
||||||
}
|
}
|
||||||
|
|
||||||
networkManager()->loadCertificates();
|
|
||||||
plugins()->loadPlugins();
|
|
||||||
loadSettings();
|
|
||||||
|
|
||||||
QTimer::singleShot(0, this, SLOT(postLaunch()));
|
QTimer::singleShot(0, this, SLOT(postLaunch()));
|
||||||
QTimer::singleShot(2000, this, SLOT(restoreCursor()));
|
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
QTimer::singleShot(10 * 1000, this, SLOT(setupJumpList()));
|
QTimer::singleShot(10 * 1000, this, SLOT(setupJumpList()));
|
||||||
#endif
|
#endif
|
||||||
@ -268,6 +258,15 @@ void MainApplication::postLaunch()
|
|||||||
if (m_postLaunchActions.contains(OpenNewTab)) {
|
if (m_postLaunchActions.contains(OpenNewTab)) {
|
||||||
getWindow()->tabWidget()->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd);
|
getWindow()->tabWidget()->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AutoSaver* saver = new AutoSaver();
|
||||||
|
connect(saver, SIGNAL(saveApp()), this, SLOT(saveStateSlot()));
|
||||||
|
|
||||||
|
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, m_activeProfil);
|
||||||
|
QWebHistoryInterface::setDefaultInterface(new WebHistoryInterface(this));
|
||||||
|
|
||||||
|
connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString)));
|
||||||
|
connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainApplication::loadSettings()
|
void MainApplication::loadSettings()
|
||||||
|
@ -105,7 +105,6 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
|
|||||||
setObjectName("mainwindow");
|
setObjectName("mainwindow");
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setWindowTitle(tr("QupZilla"));
|
setWindowTitle(tr("QupZilla"));
|
||||||
setUpdatesEnabled(false);
|
|
||||||
|
|
||||||
m_activeProfil = mApp->getActiveProfilPath();
|
m_activeProfil = mApp->getActiveProfilPath();
|
||||||
m_activeLanguage = mApp->getActiveLanguage();
|
m_activeLanguage = mApp->getActiveLanguage();
|
||||||
@ -188,10 +187,8 @@ void QupZilla::postLaunch()
|
|||||||
}
|
}
|
||||||
|
|
||||||
aboutToHideEditMenu();
|
aboutToHideEditMenu();
|
||||||
setUpdatesEnabled(true);
|
|
||||||
|
|
||||||
mApp->plugins()->emitMainWindowCreated(this);
|
mApp->plugins()->emitMainWindowCreated(this);
|
||||||
|
|
||||||
emit startingCompleted();
|
emit startingCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,6 @@ public:
|
|||||||
inline QUrl homepageUrl() { return m_homepage; }
|
inline QUrl homepageUrl() { return m_homepage; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void loadHistory();
|
|
||||||
void startingCompleted();
|
void startingCompleted();
|
||||||
void message(Qz::AppMessageType mes, bool state);
|
void message(Qz::AppMessageType mes, bool state);
|
||||||
void setWebViewMouseTracking(bool state);
|
void setWebViewMouseTracking(bool state);
|
||||||
|
@ -139,7 +139,7 @@ void Plugins::loadPlugins()
|
|||||||
|
|
||||||
refreshLoadedPlugins();
|
refreshLoadedPlugins();
|
||||||
|
|
||||||
std::cout << "QupZilla: " << m_loadedPlugins.count() << " plugins loaded" << std::endl;
|
std::cout << "QupZilla: " << m_loadedPlugins.count() << " extensions loaded" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plugins::loadAvailablePlugins()
|
void Plugins::loadAvailablePlugins()
|
||||||
|
@ -217,7 +217,7 @@ void PluginsList::itemChanged(QListWidgetItem* item)
|
|||||||
|
|
||||||
if (item->checkState() == Qt::Checked && !plugin.isLoaded()) {
|
if (item->checkState() == Qt::Checked && !plugin.isLoaded()) {
|
||||||
item->setCheckState(Qt::Unchecked);
|
item->setCheckState(Qt::Unchecked);
|
||||||
QMessageBox::critical(this, tr("Error!"), tr("Cannot load plugin!"));
|
QMessageBox::critical(this, tr("Error!"), tr("Cannot load extensions"));
|
||||||
}
|
}
|
||||||
|
|
||||||
item->setData(Qt::UserRole + 10, qVariantFromValue(plugin));
|
item->setData(Qt::UserRole + 10, qVariantFromValue(plugin));
|
||||||
|
@ -166,7 +166,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Plugins</string>
|
<string>Extensions</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="whatsThis">
|
<property name="whatsThis">
|
||||||
<string notr="true">9</string>
|
<string notr="true">9</string>
|
||||||
|
@ -276,19 +276,9 @@ void TabbedWebView::linkHovered(const QString &link, const QString &title, const
|
|||||||
m_hoveredLink = link;
|
m_hoveredLink = link;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Don't do this magic to get index of tab.
|
|
||||||
// Implement setTabIndex() and call it from TabWidget (when creating and also from
|
|
||||||
// tabMoved slot)
|
|
||||||
int TabbedWebView::tabIndex() const
|
int TabbedWebView::tabIndex() const
|
||||||
{
|
{
|
||||||
int i = 0;
|
return m_tabWidget->indexOf(m_webTab);
|
||||||
while (WebTab* wTab = qobject_cast<WebTab*>(m_tabWidget->widget(i))) {
|
|
||||||
if (wTab && wTab->view() == this) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget* TabbedWebView::overlayForJsAlert()
|
QWidget* TabbedWebView::overlayForJsAlert()
|
||||||
|
@ -227,9 +227,9 @@ void WebPage::handleUnsupportedContent(QNetworkReply* reply)
|
|||||||
if (reply->header(QNetworkRequest::ContentTypeHeader).isValid()) {
|
if (reply->header(QNetworkRequest::ContentTypeHeader).isValid()) {
|
||||||
QString requestUrl = reply->request().url().toString(QUrl::RemoveFragment | QUrl::RemoveQuery);
|
QString requestUrl = reply->request().url().toString(QUrl::RemoveFragment | QUrl::RemoveQuery);
|
||||||
if (requestUrl.endsWith(".swf")) {
|
if (requestUrl.endsWith(".swf")) {
|
||||||
QWebElement docElement = mainFrame()->documentElement();
|
const QWebElement &docElement = mainFrame()->documentElement();
|
||||||
QWebElement object = docElement.findFirst(QString("object[src=\"%1\"]").arg(requestUrl));
|
const QWebElement &object = docElement.findFirst(QString("object[src=\"%1\"]").arg(requestUrl));
|
||||||
QWebElement embed = docElement.findFirst(QString("embed[src=\"%1\"]").arg(requestUrl));
|
const QWebElement &embed = docElement.findFirst(QString("embed[src=\"%1\"]").arg(requestUrl));
|
||||||
|
|
||||||
if (!object.isNull() || !embed.isNull()) {
|
if (!object.isNull() || !embed.isNull()) {
|
||||||
qDebug() << "WebPage::UnsupportedContent" << url << "Attempt to download flash object on site!";
|
qDebug() << "WebPage::UnsupportedContent" << url << "Attempt to download flash object on site!";
|
||||||
|
@ -65,6 +65,7 @@ Qt::Key keyFromCode(int code)
|
|||||||
AKN_Handler::AKN_Handler(const QString &sPath, QObject* parent)
|
AKN_Handler::AKN_Handler(const QString &sPath, QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, m_view(0)
|
, m_view(0)
|
||||||
|
, m_accessKeysVisible(false)
|
||||||
, m_settingsPath(sPath)
|
, m_settingsPath(sPath)
|
||||||
{
|
{
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
@ -35,7 +35,7 @@ PluginSpec AKN_Plugin::pluginSpec()
|
|||||||
spec.name = "Access Keys Navigation";
|
spec.name = "Access Keys Navigation";
|
||||||
spec.info = "Access keys navigation for QupZilla";
|
spec.info = "Access keys navigation for QupZilla";
|
||||||
spec.description = "Provides support for navigating in webpages by keyboard shortcuts";
|
spec.description = "Provides support for navigating in webpages by keyboard shortcuts";
|
||||||
spec.version = "0.2.1";
|
spec.version = "0.2.2";
|
||||||
spec.author = "David Rosca <nowrep@gmail.com>";
|
spec.author = "David Rosca <nowrep@gmail.com>";
|
||||||
spec.icon = QPixmap(":/accesskeysnavigation/data/icon.png");
|
spec.icon = QPixmap(":/accesskeysnavigation/data/icon.png");
|
||||||
spec.hasSettings = true;
|
spec.hasSettings = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user