1
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:
nowrep 2012-03-13 15:10:18 +01:00
parent a2a21bd01b
commit 17d70adfa5
10 changed files with 27 additions and 41 deletions

View File

@ -128,7 +128,7 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
setOverrideCursor(Qt::WaitCursor);
setWindowIcon(QIcon(":icons/exeicons/qupzilla-window.png"));
bool noAddons = false;
QUrl startUrl("");
QUrl startUrl;
QStringList messages;
QString startProfile;
@ -178,9 +178,6 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
return;
}
connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString)));
connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings()));
#ifdef Q_WS_MAC
setQuitOnLastWindowClosed(false);
#else
@ -222,34 +219,27 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
settings2.setValue("isRunning", true);
settings2.endGroup();
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, m_activeProfil);
translateApp();
QWebHistoryInterface::setDefaultInterface(new WebHistoryInterface(this));
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();
m_mainWindows.append(qupzilla);
AutoSaver* saver = new AutoSaver();
connect(saver, SIGNAL(saveApp()), this, SLOT(saveStateSlot()));
connect(qupzilla, SIGNAL(message(Qz::AppMessageType, bool)), this, SLOT(sendMessages(Qz::AppMessageType, bool)));
connect(qupzilla, SIGNAL(startingCompleted()), this, SLOT(restoreCursor()));
if (settings2.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool()) {
m_updater = new Updater(qupzilla);
}
if (noAddons) {
settings2.setValue("Plugin-Settings/AllowedPlugins", QStringList());
settings2.setValue("Plugin-Settings/EnablePlugins", false);
loadSettings();
networkManager()->loadCertificates();
if (!noAddons) {
plugins()->loadPlugins();
}
networkManager()->loadCertificates();
plugins()->loadPlugins();
loadSettings();
QTimer::singleShot(0, this, SLOT(postLaunch()));
QTimer::singleShot(2000, this, SLOT(restoreCursor()));
#ifdef Q_WS_WIN
QTimer::singleShot(10 * 1000, this, SLOT(setupJumpList()));
#endif
@ -268,6 +258,15 @@ void MainApplication::postLaunch()
if (m_postLaunchActions.contains(OpenNewTab)) {
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()

View File

@ -105,7 +105,6 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
setObjectName("mainwindow");
setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(tr("QupZilla"));
setUpdatesEnabled(false);
m_activeProfil = mApp->getActiveProfilPath();
m_activeLanguage = mApp->getActiveLanguage();
@ -188,10 +187,8 @@ void QupZilla::postLaunch()
}
aboutToHideEditMenu();
setUpdatesEnabled(true);
mApp->plugins()->emitMainWindowCreated(this);
emit startingCompleted();
}

View File

@ -100,7 +100,6 @@ public:
inline QUrl homepageUrl() { return m_homepage; }
signals:
void loadHistory();
void startingCompleted();
void message(Qz::AppMessageType mes, bool state);
void setWebViewMouseTracking(bool state);

View File

@ -139,7 +139,7 @@ void Plugins::loadPlugins()
refreshLoadedPlugins();
std::cout << "QupZilla: " << m_loadedPlugins.count() << " plugins loaded" << std::endl;
std::cout << "QupZilla: " << m_loadedPlugins.count() << " extensions loaded" << std::endl;
}
void Plugins::loadAvailablePlugins()

View File

@ -217,7 +217,7 @@ void PluginsList::itemChanged(QListWidgetItem* item)
if (item->checkState() == Qt::Checked && !plugin.isLoaded()) {
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));

View File

@ -166,7 +166,7 @@
</item>
<item>
<property name="text">
<string>Plugins</string>
<string>Extensions</string>
</property>
<property name="whatsThis">
<string notr="true">9</string>

View File

@ -276,19 +276,9 @@ void TabbedWebView::linkHovered(const QString &link, const QString &title, const
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 i = 0;
while (WebTab* wTab = qobject_cast<WebTab*>(m_tabWidget->widget(i))) {
if (wTab && wTab->view() == this) {
break;
}
i++;
}
return i;
return m_tabWidget->indexOf(m_webTab);
}
QWidget* TabbedWebView::overlayForJsAlert()

View File

@ -227,9 +227,9 @@ void WebPage::handleUnsupportedContent(QNetworkReply* reply)
if (reply->header(QNetworkRequest::ContentTypeHeader).isValid()) {
QString requestUrl = reply->request().url().toString(QUrl::RemoveFragment | QUrl::RemoveQuery);
if (requestUrl.endsWith(".swf")) {
QWebElement docElement = mainFrame()->documentElement();
QWebElement object = docElement.findFirst(QString("object[src=\"%1\"]").arg(requestUrl));
QWebElement embed = docElement.findFirst(QString("embed[src=\"%1\"]").arg(requestUrl));
const QWebElement &docElement = mainFrame()->documentElement();
const QWebElement &object = docElement.findFirst(QString("object[src=\"%1\"]").arg(requestUrl));
const QWebElement &embed = docElement.findFirst(QString("embed[src=\"%1\"]").arg(requestUrl));
if (!object.isNull() || !embed.isNull()) {
qDebug() << "WebPage::UnsupportedContent" << url << "Attempt to download flash object on site!";

View File

@ -65,6 +65,7 @@ Qt::Key keyFromCode(int code)
AKN_Handler::AKN_Handler(const QString &sPath, QObject* parent)
: QObject(parent)
, m_view(0)
, m_accessKeysVisible(false)
, m_settingsPath(sPath)
{
loadSettings();

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.1";
spec.version = "0.2.2";
spec.author = "David Rosca <nowrep@gmail.com>";
spec.icon = QPixmap(":/accesskeysnavigation/data/icon.png");
spec.hasSettings = true;