diff --git a/linux/appdata/org.kde.falkon.appdata.xml b/linux/appdata/org.kde.falkon.appdata.xml index 9d178821..bf5643da 100644 --- a/linux/appdata/org.kde.falkon.appdata.xml +++ b/linux/appdata/org.kde.falkon.appdata.xml @@ -1,96 +1,95 @@ org.kde.falkon.desktop CC0-1.0 GPL-3.0+ Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon Falkon xxFalkonxx Falkon Web Browser Restolador web Navegador web Navegador web Webový prohlížeč Webbrowser Web Browser Navegador web Verkkoselain Navigateur Web Penelusur Web Browser web Webbrowser Przeglądarka sieciowa Navegador Web Navegador Web Webový prehliadač Webbläsare Переглядач інтернету xxWeb Browserxx 网页浏览器

Falkon is a new and very fast Qt web browser. It aims to be a lightweight web browser available through all major platforms. This project has been originally started only for educational purposes. But from its start, Falkon has grown into a feature-rich browser.

El Falkon és un navegador Qt nou i molt ràpid. Pretén ser un navegador web lleuger, disponible a través de totes les principals plataformes. Aquest projecte només es va iniciar originalment amb finalitats educatives. Però des del seu inici, el Falkon s'ha convertit en un navegador ric en característiques.

El Falkon és un navegador Qt nou i molt ràpid. Pretén ser un navegador web lleuger, disponible a través de totes les principals plataformes. Aquest projecte només es va iniciar originalment amb finalitats educatives. Però des del seu inici, el Falkon s'ha convertit en un navegador ric en característiques.

Falkon is a new and very fast Qt web browser. It aims to be a lightweight web browser available through all major platforms. This project has been originally started only for educational purposes. But from its start, Falkon has grown into a feature-rich browser.

Falkon es un nuevo y muy rápido navegador web. Pretende ser un navegador web ligero disponible para todas las plataformas más populares. Este proyecto se inició originalmente con fines educativos. Aunque, desde el principio, Falkon se ha ido convirtiendo en un navegador rico en funcionalidades.

Falkon on uusi ja hyvin nopea Qt-verkkoselain. Se pyrkii olemaan kaikilla merkittävillä alustoilla käytettävissä oleva kevyt selain. Hanke käynnistettiin alkuaan opetustarkoituksin, mutta alusta saakka Falkonista on kasvanut monitoimintainen selain.

Falkon est un nouveau navigateur web Qt ultra-rapide. Il a pour objectif de devenir un navigateur web léger disponible sur toutes les plate-formes majeures. Ce projet avait à l'origine des fins purement éducatives. Mais après ces débuts, Falkon est devenu un navigateur riche en fonctionnalités.

Falkon adalah penelusur web Qt yang baru dan sangat cepat. Ini bertujuan untuk menjadi penelusur web ringan yang tersedia melalui semua platform utama. Proyek ini awalnya hanya dimulai untuk tujuan pendidikan. Tapi sejak awal, Falkon telah tumbuh menjadi penelusur kaya fitur.

Falkon è un nuovo e velocissimo browser web Qt. Mira ad essere un browser web leggero e disponibile per tutte le maggiori piattaforme. Il progetto è iniziato inizialmente a scopo educativo, ma da allora Falkon è diventato un browser ricco di funzionalità.

Flacon is een nieuwe en zeer snelle Qt-webbrowser. Zijn doel is om een lichtgewicht webbrowser te zijn beschikbaar via alle belangrijke platformen. Dit project is oorspronkelijk gestart alleen gestart voor onderwijsdoeleinden. Maar vanaf zijn start is Falcon gegroeid in een functierijke browser.

Falkon jest nową i bardzo szybką przeglądarką sieciową Qt. Jej celem jest być dostępną na wszystkich głównych platformach. Projekt zaczął się ze względów edukacyjnych, lecz od jego początków Falkon stał się bogatą w możliwości przeglądarką.

O Falkon é um navegador novo e muito rápido em QtWebKit. Pretende ser um navegador Web leve e disponível em todas as plataformas importantes. Este projecto foi iniciado originalmente para fins educativos. Porém, desde o início, o Falkon cresceu para um navegador rico em funcionalidades.

Falkon är en ny och mycket snabb Qt webbläsare. Den har som mål att vara en lättviktig webbläsare tillgänglig på alla större plattformar. Projektet startades ursprungligen bara i utbildningssyfte, men från starten har Falkon växt till en funktionsrik webbläsare.

Falkon — нова і дуже швидка програма для перегляду інтернету на основі навігатора Qt. Метою проекту є створення невибагливого до ресурсів переглядача інтернету для усіх основних програмних платформ. Реалізацію проекту було розпочато з навчальною метою. Втім, з того часу Falkon стала повноцінним переглядачем.

xxFalkon is a new and very fast Qt web browser. It aims to be a lightweight web browser available through all major platforms. This project has been originally started only for educational purposes. But from its start, Falkon has grown into a feature-rich browser.xx

Falkon has all standard functions you expect from a web browser. It includes bookmarks, history (both also in sidebar) and tabs. Above that, you can manage RSS feeds with an included RSS reader, block ads with a built-in AdBlock plugin, block Flash content with Click2Flash and edit the local CA Certificates database with an SSL manager.

El Falkon té totes les funcions estàndard que s'esperen d'un navegador web. Inclou adreces d'interès, historial (ambdós també a la barra lateral) i pestanyes. A més, podeu gestionar els canals RSS amb un lector RSS inclòs, bloquejar els anuncis amb un complement AdBlock integrat, bloquejar el contingut Flash amb Click2Flash i editar la base de dades de certificats de l'AC local amb un gestor SSL.

El Falkon té totes les funcions estàndard que s'esperen d'un navegador web. Inclou adreces d'interés, historial (ambdós també a la barra lateral) i pestanyes. A més, podeu gestionar els canals RSS amb un lector RSS inclòs, bloquejar els anuncis amb un complement AdBlock integrat, bloquejar el contingut Flash amb Click2Flash i editar la base de dades de certificats de l'AC local amb un gestor SSL.

Falkon has all standard functions you expect from a web browser. It includes bookmarks, history (both also in sidebar) and tabs. Above that, you can manage RSS feeds with an included RSS reader, block ads with a built-in AdBlock plugin, block Flash content with Click2Flash and edit the local CA Certificates database with an SSL manager.

Falkon posee todas las funciones estándares que cabría esperar de un navegador web. Incluye marcadores, historial (ambos disponibles también en una barra lateral) y pestañas. Además, puede gestionar fuentes RSS con el lector RSS que incluye, bloquear publicidad mediante un complemento integrado, bloquear contenido Flash con Click2Flash y editar la base de datos local de certificados con un gestor SSL.

Falkonissa on kaikki selaimelta odottamasi toiminnallisuus: kirjanmerkit, historia (kumpikin myös sivupalkissa) ja välilehdet. Lisäksi voit hallita RSS-syötteitäsi sisään rakennetulla RSS-lukuohjelmalla, estää mainokset sisään rakennetulla AdBlock-liitännäisellä, estää Flash-sisällön Click2Flashillä sekä muokata paikallista CA-varmennetietokantaa SSL-hallintatyökalulla.

Falkon dispose de toutes les fonctionnalités standard que l'on peut attendre d'un navigateur. Il comporte des signets, un historique (tous deux également disponibles dans la barre latérale) et des onglets. En plus de cela, vous pouvez gérer des flux RSS grâce au lecteur RSS intégré, bloquer les publicités avec le module externe AdBlock intégré, bloquer les contenus Flash avec Click2Flash et modifier la base de données de certificats CA locaux en utilisant un gestionnaire SSL.

Falkon memiliki semua fungsi standar yang kamu harapkan dari penelusur web. Ini termasuk markah, riwayat (keduanya juga di bilah sisi) dan tab. Di atas itu, kamu bisa mengelola feed RSS dengan pembaca RSS yang disertakan, mencekal iklan dengan plugin AdBlock bawaan, mencekal konten Flash dengan Click2Flash dan mengedit database CA Certificates lokal dengan pengelola SSL.

Falkon ha tutte le funzioni standard che ti aspetteresti da un browser web. Include i segnalibri e la cronologia, entrambi anche nella barra laterale, e le schede. Puoi inoltre gestire i feed RSS con un lettore RSS incluso, bloccare sia le inserzioni con un'estensione AdBlock integrata, sia i contenuti Flash con Click2Flash, ed infine modificare la banca dati dei certificati CA con un gestore SSL.

Falcon heeft alle standaard functies die u verwacht van een webbrowser. Het bevat bladwijzers, geschiedenis (ook in de zijbalk) en tabbladen. Bovendien kunt u RSS-feeds beheren met een ingevoegde RSS-reader, ads blokkeren met een ingebouwde AdBlock plug-in, Flash-inhoud blokkeren met Click2Flash en de lokale database met CA Certificaten met een SSL-beheerder.

Falkon ma wszystkie standardowe funkcje, których oczekuje się od przglądarek. Zawiera zakładki, historię (zarówno obie na pasku bocznym) i karty. Poza tym, może obsługiwać kanały RSS przy użyciu załączonego czytnika, blokować reklamy przy użyciu wbudowanej wtyczki AdBlock, blokować treści Flash przy użyciu Click2Flash i dedytować lokalne certyfikaty UC przy użyciu zarządzania SSL.

O Falkon tem todas as funções-padrão que iria esperar de um navegador Web. Inclui os favoritos, o histórico (ambos na barra lateral) e páginas separadas. Para além disso, pode gerir fontes RSS com um leitor de RSS incluído, o bloqueio de anúncios com um 'plugin' do AdBlock incorporado, o bloqueio de conteúdos em Flash com o Click2Flash e a edição da base de dados de Certificados da AC locais com um gestor de SSL.

Falkon har alla standardfunktioner man kan förvänta sig av en webbläsare. Det omfattar bokmärken, historik (båda också i sidorad) och flikar. Förutom det, kan man hantera RSS-kanaler med en inbyggd RSS-läsare, blockera reklam med ett inbyggt insticksprogram för reklamblockering, blockera Flash-innehåll med Click2Flash och redigera den lokala certifikatdatabasen för certifikatutfärdare med en SSL-hanterare.

У Falkon ви знайдете усі можливості типової програми для перегляду інтернету. Передбачено можливість користування закладками, журналом перегляду (ці дві можливості реалізовано і на бічній панелі) та вкладками. Крім того ви можете отримувати подачі новин RSS за допомогою вбудованого засобу читання RSS, блокувати рекламні повідомлення за допомогою вбудованого додатка блокування реклами, блокувати включення Flash за допомогою додатка Click2Flash та редагувати локальну базу сертифікатів CA за допомогою засобу керування даними SSL.

xxFalkon has all standard functions you expect from a web browser. It includes bookmarks, history (both also in sidebar) and tabs. Above that, you can manage RSS feeds with an included RSS reader, block ads with a built-in AdBlock plugin, block Flash content with Click2Flash and edit the local CA Certificates database with an SSL manager.xx

- https://kde.org/ https://cdn.kde.org/screenshots/falkon/falkon.png - https://userbase.kde.org/Falkon + https://falkon.org https://bugs.kde.org/enter_bug.cgi?format=guided&product=falkon KDE falkon
diff --git a/src/lib/app/qzcommon.cpp b/src/lib/app/qzcommon.cpp index 708e792b..5fd11848 100644 --- a/src/lib/app/qzcommon.cpp +++ b/src/lib/app/qzcommon.cpp @@ -1,32 +1,32 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2014-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #include "qzcommon.h" #include "../config.h" namespace Qz { const int sessionVersion = 0x0004; FALKON_EXPORT const char *APPNAME = "Falkon"; FALKON_EXPORT const char *VERSION = FALKON_VERSION; FALKON_EXPORT const char *AUTHOR = "David Rosca"; FALKON_EXPORT const char *COPYRIGHT = "2010-2018"; -FALKON_EXPORT const char *WWWADDRESS = "https://kde.org"; +FALKON_EXPORT const char *WWWADDRESS = "https://falkon.org"; FALKON_EXPORT const char *BUGSADDRESS = "https://bugs.kde.org/describecomponents.cgi?product=Falkon"; FALKON_EXPORT const char *WIKIADDRESS = "https://userbase.kde.org/Falkon"; } diff --git a/src/lib/data/data/browsedata.sql b/src/lib/data/data/browsedata.sql index 0c2dcac7..570756a5 100644 --- a/src/lib/data/data/browsedata.sql +++ b/src/lib/data/data/browsedata.sql @@ -1,62 +1,58 @@ -- Falkon browsedata.db -- Tables CREATE TABLE autofill ( id INTEGER PRIMARY KEY, server TEXT NOT NULL, data TEXT, password TEXT, username TEXT, last_used INTEGER DEFAULT 0 NOT NULL ); CREATE INDEX autofill_serverindex ON autofill (server); CREATE TABLE autofill_encrypted ( id INTEGER PRIMARY KEY, server TEXT NOT NULL, data_encrypted TEXT, password_encrypted TEXT, username_encrypted TEXT, last_used INTEGER DEFAULT 0 NOT NULL ); CREATE INDEX autofill_encrypted_serverindex ON autofill_encrypted (server); CREATE TABLE autofill_exceptions ( id INTEGER PRIMARY KEY, server TEXT NOT NULL ); CREATE INDEX autofill_exception_serverindex ON autofill_exceptions (server); CREATE TABLE history ( id INTEGER PRIMARY KEY, url TEXT NOT NULL, title TEXT, date INTEGER DEFAULT 0 NOT NULL, count INTEGER DEFAULT 0 NOT NULL ); CREATE INDEX history_titleindex ON history (title); CREATE UNIQUE INDEX history_urluniqueindex ON history (url); CREATE TABLE search_engines ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, url TEXT, icon BLOB, shortcut TEXT, suggestionsUrl TEXT, suggestionsParameters TEXT, postData TEXT ); CREATE TABLE icons ( id INTEGER PRIMARY KEY, url TEXT NOT NULL, icon BLOB ); CREATE UNIQUE INDEX icons_urluniqueindex ON icons (url); -- Data -INSERT INTO icons VALUES(1,'https://bugs.kde.org/describecomponents.cgi?product=Falkon',X'89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000000970485973000011b0000011b001c827f5540000032249444154388d2593cd6b9b7500809fdfc7fbe64dd2a4499334edac650511c52fd44db65605d90ef6a0e2c9c340d941dc45c193e0c1af8b1e3abc39443ca8083a0f9ebc883010714377e8c4c3d6cd315dd3a54d96f44df27ee4fdf8fd3cf43f789e071ee1ac6e1c9d2d553f2d164a6b9ee3a295839080b5181592c9185794d1a642d12da37501632188c7173bdd5b6f6b49beb1b4b4bc7678a58d3513ca9e66f9508ba5f959da8d3200bd61c44e6fcc766f9fed9d2e59ee10f7e571a1c4598d90cf2eaf2c509d55d42a8b34eb55e62a1ea406e577114260d21a87165b949288c75af7b0b935e07a3ac57658932088938038c9c971498d224a25433fe5e4b126278f3519ec4f19dde9f3fa4bf3acaf36c94b75a4a34080140226518c950532aba9c503826e9f519ce3382eaee37077cfe7d5e71b143d8f2f7e1a21ab354a953a5608a4100274810cc5d88f39b5bec03ba716497abb68add15af3dafa3cf3b502dffdbcc7a8dc20330a63144208b49092686a49334161a6c0e6f580e505e8460a6b012178f8be0a16b8f0f7847cce258e33f6830421402215d134434e7c5ebc3fe7e9476b9c3d7f938994804008c1b9f3ff2085e08d1716d8e9eeb3d31f610021d58182c5d2f0525e7ea689eb486e7663fc7182c502f0edc50197affaac3d52e7f17acc3409c8f20cac405a633026e3f2f684f7bfdca2ef273cf750952c955863b1d6a254890fbefe0f3fc878f7f4037861489ea5580cda5a8bc9526225f9f5b6e4a9cd01af9c58e4d28d1ea73fda6298b9b4aa55560f679cf9e41af55950263f60b3160d96691ca295e2895ac48923f7a2b5e2b337dbfc76254408c191074b2cb524376e47bcf7cd5d7c6bc8a739d65ab435967032a1e83a5cf977ca8f177afc794d63929c8fdf6a20106c7cb587eb39ac1f77704949c29024336041632d45a740188cd9f5467cfe4b9956a34da532c75f577749734b87159271cca5eff7180c43a22824886224166df2f477c7ca552534ddce2d9228228ec69467aa7cf84311a514c66e11c72141e033f47b8cfd31ad5a9bc1f0ce1fc259dd385a2d78e74aa5da939e53406b8d140781721590cb1857cca04d05cf2da1b577b0f3a4b7d9e977cffc0f08aa793d8c80ab9b0000000049454e44ae426082'); -INSERT INTO icons VALUES(2,'https://userbase.kde.org/Falkon',X'89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af40000000970485973000011b0000011b001c827f554000004e1494441545885c5975d4c536718c77fe7f414dbd2ae103a680b8b609ca5734e2f16c696652ebac4398dd39878b12deec3b81931234b960c47b26cbb70bdc58c4cbd1b9a2c59624032b670a1cbb8308099f12b919a3040696bb108dd29878f969e5d9c72a0d21e0a17ee9f34e9fbf6e9f9ff9f8ff3bccf2b70fc4f3baae57354b501f0f2741046105a11664e4b19f266c0f694c801bc1aa70531e3f9dac9d3aaf6593d6ca86a83c41ac3ee2a365366970028b549f40ec9396d6253c94581a2f0a489575a35735ac5e7b1d1f6d146aa4ad7e1b098b81b51d8f3e3804696b1d9b7ad8ce6dd9584e349ae8d24b81352b83a282fda64b07a01681efb3d361ceb44001c16d33281cdbb2ba9abb603b07f6b29e17892836783c406e7b22221ae4580214481c61d1e9d1c409e4d73b263444bd31369585180abd8ac7d29b0d0bede5dc5d1d7cbb3f62ef43da2adf7516ebd460fabaf71d075a296f663b5f83cb6bc22e49979ddbe61bb1b6989971d3727f8a6f3415e8ebc35e02a36d372a85a0fa5afc242a03bc4a4329fd37e63b9859643d5789d667defeec3699ada4788c973b9de00c02002b1a9247fdf9fd2d77eb7959f3fdcc84fef6da0c466cab275584c7cb5ab7259de9bdaef138c2879c90d05905669b912e1eec3e92c8f4e768c702f3a9365fa7cb985bd5b4af4752aad12e80ed179ebb121b9b10051201851b8d01fd3c93f691ba4edead832534914b2f20e303a315b50e11a4660010be1ec1dfc37a769389ecc8a94240a34edaa342c5c4301ae62333e8f8d7ddbcaf8a0cec5e581b861384727660974879067d3fa9edf6d2570603d2e47d1ea041cae7f96ae13b55cf96233173fdb84df6de5da4862454f7ebf3d49a03b94b5b7774b099fbe51b10a016995fa1a0775d576bc4e339228904aabdc0929860f59c0b99e28fdc3097d2d89020ddbddd4d738f23ab02c02a39373a4d676bc1293e768fc7598707cf1c0f13ab57e922f15d9024481733d510e9ebd4773e7033a6e4e00f0626581e38228d03b24d3fad7c32c27eaaaed7cbfefb90204a035a0ce1be39cea7ac0d1f3835cbf3fc5bb2f95ae584c4b71ae27ca6fb727b3f6dedcf44cce54e46ec5996a8fc9735cba35c1777bab78674b89de032694149707e200fa59bf3078f83c361a777868bf318ed769261c4fd27e639cbea104c1e8f4b237c9781e1005aa4a8a9044811ff6af675299a7f3d66382d1690e9c19d06c9678e472141138b09efd5b4b01168794fc1311265e3ef26d4ef2b4cae157cb697abb8a759280c36262fb262716b3c8989c647c2aa5d909022e7b116fbd50c299f737b0b3d60940addb46995da26f2881924a8390bb87081cbb9ab3e45dc5667abedc8cdf6dd5f7c2f1240e8b0979669efee10491f81c1e67115ea719bfc7863c338fc362d227a5545ae5c8f94cfbced3c40c53108ccee0775b9167d35ce87b44cb9508be0a2b1fbf56ae87794158a03bc4c5ebe3bc5263a76957257eb7953139a51ddf0607525e01b1a92447cf0f726da4823b21456bc569956044614c4eb2b3d6a97b7ae9e6634e7569434730a2d03794a0718787de2159fb9f010c23109b4a72ea8f51ad884441f764424969e1ce08d047f2ccefc1e834c77ff9c7907801850da54f8430189da67f38412aad128e2797cd07ab41de225c09be0a2bbe0a2b637232e7a5a45048409835dc8e8211451bb760c5a9c70061114168050a3bee9662a126d64eae2008ad12c2cc69b0f07f5dcfff03548d0a78490b34bb0000000049454e44ae426082'); -INSERT INTO icons VALUES(3,'https://www.kde.org/',X'89504e470d0a1a0a0000000d4948445200000020000000200802000000fc18eda30000000970485973000011b0000011b001c827f55400000425494441544889d5566d4c5b55187e6f6f7b4b2fb4b49442a174dd3a6185769b451b90190671d992295ffa4b499718a7c62dfe988959f643b3ecc3b94d137ff9956cecc78c1f51b721033f30e09c81c8d86869a5943946296d27a5bba5ac1fdcb6d71f97dcdeb6b78c4c67e2fbeb3de7bceff39cf739ef39f722d5877f808769bc878afe5f10f0d71e7ab4a5ba442c2cce17ca0bb0637d8e7ec73cb364d2c8f6d4a9c7dcc13177d0e6598cc5930f42d0b2b90ce521d9f345b8e064bb5e211636552900804c24f77d61199e0ed0ab0f281145ad3808c08976bd422c64967ac67d0cfa3f215861d8bb6d7d8356cecc4ff842c7bf9f64477213a03c645fe30695342f1701adf163eba4fbb76b99c960843cf0b5957d00dc047c1e72bac3f05aa3f6db57ea5f305570a80e405120c30527dbf5cca92429ead025fb1c11cd44cb4ede545ab043a700001c430feddab4aba6940770b8d7c18e4100de69d3974a52257e7af5f6af3717b2d1382ab07b43976d3e6658ab96ea94e2289960c7eca95ff7e4c694f4bffdb9f0e1955b5ca5e63883f7fa6f86a271dabf314bb47e349451bb4923637cdf62f4e0453bd3576b2258b8b77cfe7717005c9f255efeec8677319611c08693e40964b8801b7e9536ddb6511e2113072fd832ba82b65e7b4a431c434f77183094b31bb20878085496e4779ad45b5485dd56af2f6befb45db6f97e9af88b19ea94e2034f3dc21999d6455de6da9a32098ea1f470d0e9e7cca1ed689fc3a82e2c2e58b9c39d26f5d0adc095ac464aabe0718d8c4107809940781582bb61f248af83b9d208821c6bad511460ab1150e9adc02d2acb069cfe6eab9719ca70ec449b1e494f4b2378feecc8fbfd5383cef9608404008d1cbf1f05bcfba3d31b4c7570dd86a2971a343909ecded0b961d7eb5f593bbb46288a6aae52dc9760299678ebbb3fd8a5ef6fd46e5149b809189b0944c6dcc196cdcaf2c2b4f78e4c24a7fdf7069cf3ccaed532913c1ffbfc9a1b00883079d1e279e39bf1c93b4b4c4ace0fce1c1135aaa5a73a0c7bcf5f8fc69300d0faf1908788c693a9cd8a04e8a90e83a608efec1af9d9313f3a4b249299179abb82066dd1d3865200d85a5178c65c4bbfdbae40848d5e21159d311b0de512711effedddbaf0723c1b1d0090ecdf967c0cbdf06a7d194b9c1899e8b1f906a7fcae4098a260bd1c6fae52ec362885fcd4fe3c44a4ed93e1289979ed3924da5e59cca02fc7935f8eba6bcac4cf3e5afe9c51c5c4501475cd4558dc41739d5ac84701a05c2adaa92be91ef765a07110f4daefe894e2179fd00c4f078ef74dde0e8401c0a4919d35d73231e673a396b920005cb27a8f3c536d544bbbadde1e5b263ab744b46d55492c738bcc104560e8cd26118602807f29d6fcc1d51404024d95c5bf4cf9b98e20f76bca460780040513be10ed8fba08f61245c180931b7d35826c1bf704696764e6eedab3724af46fd9ffffe7f76fcf3c9927062f2b900000000049454e44ae426082'); -INSERT INTO icons VALUES(4,'https://phabricator.kde.org/source/falkon',X'89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af40000000970485973000011b0000011b001c827f5540000055e494441545885cd576d4c5357187eeeed2d94aa93a6c8470b91955a9d8a6b958a7c2962408bdb14d1e136755f76cb264b167f6c4c1be31265b865cb369909632673fe189d0cd12120536022b8e2940a942950d7b92273484aac948fd27bf743687adb4bd7982deef977dfe7bce779cfb9ef79cf7b0804089bcd166a68ebce3676f466f4deec53fef9d760ecb0633414006608054391e1628b5c26352ae3e5f5892a45b548241a0a645ee29f0698ad030a7d796d41e345e356a77322249049f97c6a243d555996b7795d515cf49cee870a8061186171e9f7072a6b9af3699ae60722ec0d92249d1b3529c5f9da5c1d41108e8003b05a07147b0a4b2bfee8bbb3e86184bd11238d3015eed16e8ae6d80d9f00ba7a2c4b0bf697d4d9ef3bc4ff86f81466cd140e16ed7f3d6be1bcd8ab9e76d2f3c36a1d504c271e269e8d1d796bf1d567ef60c9a2381f816d5bb27050a7855ab50004c7bedaef3bc405fb4beaacd60185a7dd3d946118e18bbb3e689d6edb3f7aff0d2c7b723e0060746c1cba83a5b8dade030078614b265e793e1bc4a4f2c747f438537789732762a411a6635fbcb77c2a2778ee154ae30f19ae743dc3e90520335d0d4964180080a2785899ac4498783632d254c87d7a955b1c00da3bcd30ddb070ce73cf3e1c6eb70f0b6b7ef8ee2c30f90bccd60145654d73fe74e20030363ecefa1604076183261599e96a963800903cd69ff541654d73be79f2579000a02faf2df077d4420441880a0f3c27a3a3c2fcf2344df3f5e5b5050040d86cb6d03ced81db9e45262a428c1d796b4192045c3483b85809e6c9a2030e806118d49c33a0ffce204892c0b87302274e3582a669f7183e9f1ad197ea2494a1ad3bdbbbc26dd0a4626dc6f28005bd411004b23357b06cb7fbefa2e9e776f7b7d339116268ebcea68c1dbd196c6720333dc1af00cd30b8d4da89f6ae9b0811046155b2128fcf8df2eb93b33e8d150000183b7a3378b1f357ecb30dd9259e84ddee40927a914f7201c0c4840bfb8a8ee21bfd5974ddb0e09ac98caaba1688421fc37c790ca738c330a8a8ba805fbb7ff722c0f024b2a5854ee784d0d3defb5b1ffafaef2259bd1824c9cee893679a505175c14b00b8dc761d99e909983553e8c531283d5e8513a71a7c021b1f7706935357aa37ce5fb882c6e6361f7b4b6b27e72a5d2e172eb75df7b1ffd4624459c5794e9f61c768a8df032b080ef2470784d131a75f9e9c211470360edb9fcd424a62bc8f7d859afb82a4783c2c572df0b1af59b914ab53559c3e3384822132325c6cf126b66e5a83979ed37026614e762a12973dc15e0549e0add7721119e15bacf81485bdbbb7236bb5da878b0c175b28b94c6a345bfa9679124909dc270000288ac2c1bd5a341b3ad1d1654648483056a528219b2be11cff2040123bb73d85ba86cb2cbb5c263552ca7879fdd9fad6573d8993d54d885f28f33b615ad212a4252d99768c37ea1a5a7d6cca78793d95a85254f3f9d48867356cba740d255f9f06c5e781a11948a2c2a0599338edae70e146cf2ddcbcd50f922440bb689cae6d61f17c3e3592a8525453229168a8f0d3e3653f36fcf2f214e972d1d057d6b31c7824197079ee315bf1b6ee30c6fc9c80f454659948241a2201206ff3ba229224fd9e97befebb01890340ff9d41bfe224493af336af2b0226afe3b8e839dd1b3529c5fe26f5bcc9800715aef6bc0195d5173136c6ee158282fc37d11b3529c553edbabb10e56b737531d208d3744ec38e119678c9b1d3f8f0f0b7f8fccb72e80a8fb282f0972a31d20853be3657e71eeb495aad038a37dffda485ab2925082041b90039ebd370cd6486fe243b47948be5d8b533078dcd46d49e3360d076cf477cd64ce1e09143bb933ddbf347de96ffff1e265378a44f334f3cb2c7a937feabe7f9dff9cb492bb665f3b60000000049454e44ae426082'); diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index f95d04ff..1ce9143a 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -1,729 +1,729 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #include "locationbar.h" #include "browserwindow.h" #include "tabbedwebview.h" #include "mainapplication.h" #include "webpage.h" #include "tabwidget.h" #include "bookmarksicon.h" #include "bookmarks.h" #include "bookmarkitem.h" #include "bookmarkstoolbar.h" #include "siteicon.h" #include "goicon.h" #include "downicon.h" #include "qztools.h" #include "iconprovider.h" #include "qzsettings.h" #include "colors.h" #include "autofillicon.h" #include "completer/locationcompleter.h" #include #include #include #include #include #include LocationBar::LocationBar(QWidget *parent) : LineEdit(parent) , m_window(nullptr) , m_webView(0) , m_holdingAlt(false) , m_oldTextLength(0) , m_currentTextLength(0) , m_loadProgress(0) , m_progressVisible(false) { setObjectName("locationbar"); setDragEnabled(true); // Disable KDE QLineEdit transitions, it breaks with setText() && home() setProperty("_kde_no_animations", QVariant(true)); m_bookmarkIcon = new BookmarksIcon(this); m_goIcon = new GoIcon(this); m_siteIcon = new SiteIcon(this); m_autofillIcon = new AutoFillIcon(this); DownIcon* down = new DownIcon(this); addWidget(m_siteIcon, LineEdit::LeftSide); addWidget(m_autofillIcon, LineEdit::RightSide); addWidget(m_bookmarkIcon, LineEdit::RightSide); addWidget(m_goIcon, LineEdit::RightSide); addWidget(down, LineEdit::RightSide); m_completer = new LocationCompleter(this); m_completer->setLocationBar(this); connect(m_completer, SIGNAL(showCompletion(QString,bool)), this, SLOT(showCompletion(QString,bool))); connect(m_completer, SIGNAL(showDomainCompletion(QString)), this, SLOT(showDomainCompletion(QString))); connect(m_completer, SIGNAL(clearCompletion()), this, SLOT(clearCompletion())); connect(m_completer, &LocationCompleter::loadRequested, this, &LocationBar::loadRequest); connect(m_completer, &LocationCompleter::popupClosed, this, &LocationBar::updateSiteIcon); m_domainCompleterModel = new QStringListModel(this); QCompleter* domainCompleter = new QCompleter(this); domainCompleter->setCompletionMode(QCompleter::InlineCompletion); domainCompleter->setModel(m_domainCompleterModel); setCompleter(domainCompleter); m_progressTimer = new QTimer(this); m_progressTimer->setInterval(700); m_progressTimer->setSingleShot(true); connect(m_progressTimer, &QTimer::timeout, this, &LocationBar::hideProgress); editAction(PasteAndGo)->setText(tr("Paste And &Go")); editAction(PasteAndGo)->setIcon(QIcon::fromTheme(QSL("edit-paste"))); connect(editAction(PasteAndGo), SIGNAL(triggered()), this, SLOT(pasteAndGo())); connect(this, SIGNAL(textEdited(QString)), this, SLOT(textEdited(QString))); connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(requestLoadUrl())); connect(down, SIGNAL(clicked(QPoint)), m_completer, SLOT(showMostVisited())); connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText())); connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText())); connect(mApp, SIGNAL(settingsReloaded()), SLOT(loadSettings())); loadSettings(); updateSiteIcon(); // Hide icons by default m_goIcon->setVisible(qzSettings->alwaysShowGoIcon); m_autofillIcon->hide(); QTimer::singleShot(0, this, SLOT(updatePlaceHolderText())); } BrowserWindow *LocationBar::browserWindow() const { return m_window; } void LocationBar::setBrowserWindow(BrowserWindow *window) { m_window = window; m_completer->setMainWindow(m_window); m_siteIcon->setBrowserWindow(m_window); } TabbedWebView* LocationBar::webView() const { return m_webView; } void LocationBar::setWebView(TabbedWebView* view) { m_webView = view; m_bookmarkIcon->setWebView(m_webView); m_siteIcon->setWebView(m_webView); m_autofillIcon->setWebView(m_webView); connect(m_webView, SIGNAL(loadStarted()), SLOT(loadStarted())); connect(m_webView, SIGNAL(loadProgress(int)), SLOT(loadProgress(int))); connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(loadFinished())); connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SLOT(showUrl(QUrl))); connect(m_webView, SIGNAL(privacyChanged(bool)), this, SLOT(setPrivacyState(bool))); } void LocationBar::setText(const QString &text) { m_oldTextLength = text.length(); m_currentTextLength = m_oldTextLength; LineEdit::setText(text); refreshTextFormat(); } void LocationBar::updatePlaceHolderText() { if (qzSettings->searchFromAddressBar) { setPlaceholderText(tr("Enter address or search with %1").arg(searchEngine().name)); } else setPlaceholderText(tr("Enter address")); } void LocationBar::showCompletion(const QString &completion, bool completeDomain) { LineEdit::setText(completion); // Move cursor to the end end(false); if (completeDomain) { completer()->complete(); } updateSiteIcon(); } void LocationBar::clearCompletion() { m_webView->setFocus(); showUrl(m_webView->url()); } void LocationBar::showDomainCompletion(const QString &completion) { m_domainCompleterModel->setStringList(QStringList() << completion); // We need to manually force the completion because model is updated asynchronously // But only force completion when the user actually added new text - if (m_oldTextLength < m_currentTextLength) + if (!completion.isEmpty() && m_oldTextLength < m_currentTextLength) completer()->complete(); } QString LocationBar::convertUrlToText(const QUrl &url) { // It was most probably entered by user, so don't urlencode it // Also don't urlencode JavaScript code if (url.scheme().isEmpty() || url.scheme() == QL1S("javascript")) { return QUrl::fromPercentEncoding(url.toEncoded()); } QString stringUrl = QzTools::urlEncodeQueryString(url); if (stringUrl == QL1S("falkon:speeddial") || stringUrl == QL1S("about:blank")) { stringUrl.clear(); } return stringUrl; } SearchEnginesManager::Engine LocationBar::searchEngine() { if (!qzSettings->searchFromAddressBar) { return SearchEngine(); } else if (qzSettings->searchWithDefaultEngine) { return mApp->searchEnginesManager()->defaultEngine(); } else { return mApp->searchEnginesManager()->activeEngine(); } } LocationBar::LoadAction LocationBar::loadAction(const QString &text) { LoadAction action; const QString &t = text.trimmed(); if (t.isEmpty()) { return action; } // Check for Search Engine shortcut const int firstSpacePos = t.indexOf(QLatin1Char(' ')); if (qzSettings->searchFromAddressBar && firstSpacePos != -1) { const QString shortcut = t.left(firstSpacePos); const QString searchedString = t.mid(firstSpacePos).trimmed(); SearchEngine en = mApp->searchEnginesManager()->engineForShortcut(shortcut); if (en.isValid()) { action.type = LoadAction::Search; action.searchEngine = en; action.loadRequest = mApp->searchEnginesManager()->searchResult(en, searchedString); return action; } } // Check for Bookmark keyword const QList items = mApp->bookmarks()->searchKeyword(t); if (!items.isEmpty()) { BookmarkItem* item = items.at(0); action.type = LoadAction::Bookmark; action.bookmark = item; action.loadRequest.setUrl(item->url()); return action; } if (!qzSettings->searchFromAddressBar) { const QUrl &guessedUrl = QUrl::fromUserInput(t); if (guessedUrl.isValid()) { action.type = LoadAction::Url; action.loadRequest = guessedUrl; } return action; } // Check for one word search if (t != QL1S("localhost") && !QzTools::containsSpace(t) && !t.contains(QL1C('.')) && !t.contains(QL1C(':')) && !t.contains(QL1C('/')) ) { action.type = LoadAction::Search; action.searchEngine = searchEngine(); action.loadRequest = mApp->searchEnginesManager()->searchResult(searchEngine(), t); return action; } // Otherwise load as url const QUrl guessedUrl = QUrl::fromUserInput(t); if (guessedUrl.isValid()) { // Always allow javascript: to be loaded const bool forceLoad = guessedUrl.scheme() == QL1S("javascript"); // Only allow spaces in query if (forceLoad || !QzTools::containsSpace(t) || !QzTools::containsSpace(guessedUrl.toString(QUrl::RemoveQuery))) { // Only allow supported schemes if (forceLoad || WebPage::supportedSchemes().contains(guessedUrl.scheme())) { action.type = LoadAction::Url; action.loadRequest = guessedUrl; return action; } } } // Search when creating url failed action.type = LoadAction::Search; action.searchEngine = searchEngine(); action.loadRequest = mApp->searchEnginesManager()->searchResult(searchEngine(), t); return action; } void LocationBar::refreshTextFormat() { if (!m_webView) { return; } TextFormat textFormat; const QString hostName = m_webView->url().isEmpty() ? QUrl(text()).host() : m_webView->url().host(); if (!hostName.isEmpty()) { const int hostPos = text().indexOf(hostName); if (hostPos > 0) { QTextCharFormat format; format.setForeground(Colors::mid(palette().color(QPalette::Base), palette().color(QPalette::Text), 1, 1)); QTextLayout::FormatRange schemePart; schemePart.start = 0; schemePart.length = hostPos; schemePart.format = format; QTextLayout::FormatRange hostPart; hostPart.start = hostPos; hostPart.length = hostName.size(); QTextLayout::FormatRange remainingPart; remainingPart.start = hostPos + hostName.size(); remainingPart.length = text().size() - remainingPart.start; remainingPart.format = format; textFormat.append(schemePart); textFormat.append(hostPart); textFormat.append(remainingPart); } } setTextFormat(textFormat); } void LocationBar::requestLoadUrl() { loadRequest(loadAction(text()).loadRequest); } void LocationBar::textEdited(const QString &text) { m_oldTextLength = m_currentTextLength; m_currentTextLength = text.length(); if (!text.isEmpty()) { m_completer->complete(text); m_siteIcon->setIcon(QIcon::fromTheme(QSL("edit-find"), QIcon(QSL(":icons/menu/search-icon.svg")))); } else { m_completer->closePopup(); } setGoIconVisible(true); } void LocationBar::setGoIconVisible(bool state) { if (state) { m_bookmarkIcon->hide(); m_goIcon->show(); } else { m_bookmarkIcon->show(); if (!qzSettings->alwaysShowGoIcon) { m_goIcon->hide(); } } updateTextMargins(); } void LocationBar::showUrl(const QUrl &url) { if (hasFocus() || url.isEmpty()) { return; } const QString stringUrl = convertUrlToText(url); if (text() == stringUrl) { home(false); refreshTextFormat(); return; } // Set converted url as text setText(stringUrl); // Move cursor to the start home(false); m_bookmarkIcon->checkBookmark(url); } void LocationBar::loadRequest(const LoadRequest &request) { if (!m_webView->webTab()->isRestored()) { return; } const QString urlString = convertUrlToText(request.url()); m_completer->closePopup(); m_webView->setFocus(); if (urlString != text()) { setText(urlString); } m_webView->userLoadAction(request); } void LocationBar::updateSiteIcon() { if (m_completer->isVisible()) { m_siteIcon->setIcon(QIcon::fromTheme(QSL("edit-find"), QIcon(QSL(":icons/menu/search-icon.svg")))); } else { QIcon icon = IconProvider::emptyWebIcon(); if (property("secured").toBool()) { icon = QIcon::fromTheme(QSL("document-encrypted"), icon); } m_siteIcon->setIcon(QIcon(icon.pixmap(16))); } } void LocationBar::setPrivacyState(bool state) { m_siteIcon->setProperty("secured", QVariant(state)); m_siteIcon->style()->unpolish(m_siteIcon); m_siteIcon->style()->polish(m_siteIcon); setProperty("secured", QVariant(state)); style()->unpolish(this); style()->polish(this); updateSiteIcon(); } void LocationBar::pasteAndGo() { clear(); paste(); requestLoadUrl(); } void LocationBar::contextMenuEvent(QContextMenuEvent* event) { QMenu* menu = createContextMenu(); menu->setAttribute(Qt::WA_DeleteOnClose); // Prevent choosing first option with double rightclick QPoint pos = event->globalPos(); pos.setY(pos.y() + 1); menu->popup(pos); } void LocationBar::showEvent(QShowEvent* event) { LineEdit::showEvent(event); refreshTextFormat(); } void LocationBar::focusInEvent(QFocusEvent* event) { if (m_webView) { const QString stringUrl = convertUrlToText(m_webView->url()); // Text has been edited, let's show go button if (stringUrl != text()) { setGoIconVisible(true); } } clearTextFormat(); LineEdit::focusInEvent(event); if (m_window && Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) { m_window->bookmarksToolbar()->show(); } } void LocationBar::focusOutEvent(QFocusEvent* event) { // Context menu or completer popup were opened // Let's block focusOutEvent to trick QLineEdit and paint cursor properly if (event->reason() == Qt::PopupFocusReason) { return; } LineEdit::focusOutEvent(event); setGoIconVisible(false); if (text().trimmed().isEmpty()) { clear(); } refreshTextFormat(); if (m_window && Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) { m_window->bookmarksToolbar()->hide(); } } void LocationBar::dropEvent(QDropEvent* event) { if (event->mimeData()->hasUrls()) { const QUrl dropUrl = event->mimeData()->urls().at(0); if (WebView::isUrlValid(dropUrl)) { setText(dropUrl.toString()); loadRequest(dropUrl); QFocusEvent event(QFocusEvent::FocusOut); LineEdit::focusOutEvent(&event); return; } } else if (event->mimeData()->hasText()) { const QString dropText = event->mimeData()->text().trimmed(); const QUrl dropUrl = QUrl(dropText); if (WebView::isUrlValid(dropUrl)) { setText(dropUrl.toString()); loadRequest(dropUrl); QFocusEvent event(QFocusEvent::FocusOut); LineEdit::focusOutEvent(&event); return; } else { setText(dropText); setFocus(); return; } } LineEdit::dropEvent(event); } void LocationBar::keyPressEvent(QKeyEvent* event) { switch (event->key()) { case Qt::Key_V: if (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) { pasteAndGo(); event->accept(); return; } break; case Qt::Key_Down: m_completer->complete(text()); break; case Qt::Key_Left: m_completer->closePopup(); break; case Qt::Key_Escape: m_webView->setFocus(); showUrl(m_webView->url()); event->accept(); break; case Qt::Key_Alt: m_holdingAlt = true; break; case Qt::Key_Return: case Qt::Key_Enter: switch (event->modifiers()) { case Qt::ControlModifier: if (!text().endsWith(QL1S(".com"))) setText(text().append(QL1S(".com"))); requestLoadUrl(); m_holdingAlt = false; break; case Qt::AltModifier: m_completer->closePopup(); if (m_window) { m_window->tabWidget()->addView(loadAction(text()).loadRequest); } m_holdingAlt = false; break; default: requestLoadUrl(); m_holdingAlt = false; } break; case Qt::Key_0: case Qt::Key_1: case Qt::Key_2: case Qt::Key_3: case Qt::Key_4: case Qt::Key_5: case Qt::Key_6: case Qt::Key_7: case Qt::Key_8: case Qt::Key_9: if (event->modifiers() & Qt::AltModifier || event->modifiers() & Qt::ControlModifier) { event->ignore(); m_holdingAlt = false; return; } break; default: m_holdingAlt = false; } LineEdit::keyPressEvent(event); } void LocationBar::loadStarted() { m_progressVisible = true; m_progressTimer->stop(); m_autofillIcon->hide(); } void LocationBar::loadProgress(int progress) { if (qzSettings->showLoadingProgress) { m_loadProgress = progress; update(); } } void LocationBar::loadFinished() { if (qzSettings->showLoadingProgress) { m_progressTimer->start(); } WebPage* page = qobject_cast(m_webView->page()); if (page && !page->autoFillUsernames().isEmpty()) { m_autofillIcon->setUsernames(page->autoFillUsernames()); m_autofillIcon->show(); } } void LocationBar::loadSettings() { Settings settings; settings.beginGroup("AddressBar"); m_progressStyle = static_cast(settings.value("ProgressStyle", 0).toInt()); bool customColor = settings.value("UseCustomProgressColor", false).toBool(); m_progressColor = customColor ? settings.value("CustomProgressColor", palette().color(QPalette::Highlight)).value() : QColor(); settings.endGroup(); } void LocationBar::hideProgress() { if (qzSettings->showLoadingProgress) { m_progressVisible = false; update(); } } void LocationBar::paintEvent(QPaintEvent* event) { LineEdit::paintEvent(event); // Show loading progress if (qzSettings->showLoadingProgress && m_progressVisible) { QStyleOptionFrame option; initStyleOption(&option); int lm, tm, rm, bm; getTextMargins(&lm, &tm, &rm, &bm); QRect contentsRect = style()->subElementRect(QStyle::SE_LineEditContents, &option, this); contentsRect.adjust(lm, tm, -rm, -bm); QColor bg = m_progressColor; if (!bg.isValid() || bg.alpha() == 0) { bg = Colors::mid(palette().color(QPalette::Base), palette().color(QPalette::Text), m_progressStyle > 0 ? 4 : 8, 1); } QPainter p(this); p.setBrush(QBrush(bg)); // We are painting over text, make sure the text stays visible p.setOpacity(0.5); QPen outlinePen(bg.darker(110), 0.8); p.setPen(outlinePen); switch (m_progressStyle) { case ProgressFilled: { QRect bar = contentsRect.adjusted(0, 1, 0, -1); bar.setWidth(bar.width() * m_loadProgress / 100); const int roundness = bar.height() / 4.0; p.drawRoundedRect(bar, roundness, roundness); break; } case ProgressBottom: { outlinePen.setWidthF(0.3); outlinePen.setColor(outlinePen.color().darker(130)); p.setPen(outlinePen); QRect bar(contentsRect.x(), contentsRect.bottom() - 3, contentsRect.width() * m_loadProgress / 100.0, 3); p.drawRoundedRect(bar, 1, 1); break; } case ProgressTop: { outlinePen.setWidthF(0.3); outlinePen.setColor(outlinePen.color().darker(130)); p.setPen(outlinePen); QRect bar(contentsRect.x(), contentsRect.top() + 1, contentsRect.width() * m_loadProgress / 100.0, 3); p.drawRoundedRect(bar, 1, 1); break; } default: break; } } } diff --git a/windows/installer.nsi b/windows/installer.nsi index 27c0b1c8..3a13f802 100644 --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -1,493 +1,493 @@ ; Falkon Windows Installer NSIS Script ; Copyright (C) 2010-2017 David Rosca ; 2012-2017 S. Razi Alavizadeh ; ; For compiling this script you need following plugins: ; FindProcDLL_plug-in, KillProcDLL_plug-in and 'AllAssociation.nsh' needs ; Registry_plug-in, Application_Association_Registration_plug-in ; Unicode version of them can be downloaded from: ; http://sourceforge.net/projects/findkillprocuni/files/bin/ ; http://nsis.sourceforge.net/Application_Association_Registration_plug-in ; http://nsis.sourceforge.net/Registry_plug-in !ifndef CUSTOM !define VERSION 3.0.0 !define ARCH x86 !define MSVC_VER 140 !define OPENSSL_BIN_DIR . !define MSVC_REDIST_DIR . !define FALKON_SRC_DIR ..\..\ !define FALKON_BIN_DIR . !define ICU_BIN_DIR . !define QT_DIR . !define QT_BIN_DIR . !define QT_PLUGINS_DIR . !define QTWEBENGINE_DICTIONARIES_DIR qtwebengine_dictionaries !undef PORTABLE !endif ; WinVer.nsh was added in the same release that RequestExecutionLevel so check ; if ___WINVER__NSH___ is defined to determine if RequestExecutionLevel is ; available. !include /NONFATAL WinVer.nsh !include x64.nsh Var installAsPortable RequestExecutionLevel admin !addplugindir "wininstall\" !include "StdUtils.nsh" !include "FileFunc.nsh" !include "wininstall\AllAssociation.nsh" SetCompressor /SOLID /FINAL lzma !define PRODUCT_NAME "Falkon" !define /date PRODUCT_VERSION "${VERSION}" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\falkon.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" !define PRODUCT_CAPABILITIES_KEY "Software\${PRODUCT_NAME}\Capabilities" !include "MUI.nsh" !define MUI_ABORTWARNING !define MUI_ICON "wininstall\install.ico" !define MUI_UNICON "wininstall\uninstall.ico" !define MUI_WELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp" !define MUI_UNWELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE ${FALKON_BIN_DIR}\COPYRIGHT.txt ;;; Page custom InstallationModePage InstallationModeLeave ;;; !define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipComponentsIfPortableInstalltion" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY ;;; Page custom installationInfoPage installationInfoLeave ;;; !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_RUN_FUNCTION "RunFalkonAsUser" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH !insertmacro MUI_LANGUAGE "English" Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "${PRODUCT_NAME} Installer ${PRODUCT_VERSION}.exe" InstallDir "$PROGRAMFILES\${PRODUCT_NAME}\" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show ShowUnInstDetails show !include "wininstall\strings.nsh" Section "${TITLE_SecMain}" SecMain SectionIn RO FindProcDLL::FindProc "falkon.exe" IntCmp $R0 1 0 notRunning MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "${MSG_RunningInstance}" /SD IDOK IDCANCEL AbortInstallation KillProcDLL::KillProc "falkon.exe" Sleep 100 Goto notRunning AbortInstallation: Abort "${MSG_InstallationCanceled}" notRunning: SetOverwrite on SetOutPath "$INSTDIR" File "${FALKON_BIN_DIR}\COPYRIGHT.txt" File "${FALKON_BIN_DIR}\falkon.exe" File "${FALKON_BIN_DIR}\falkonprivate.dll" File "${FALKON_BIN_DIR}\qt.conf" File "${OPENSSL_BIN_DIR}\libeay32.dll" File "${OPENSSL_BIN_DIR}\ssleay32.dll" File /nonfatal "${OPENSSL_BIN_DIR}\msvcr*.dll" File "${MSVC_REDIST_DIR}\*" File "${ICU_BIN_DIR}\icudt54.dll" File "${ICU_BIN_DIR}\icuin54.dll" File "${ICU_BIN_DIR}\icuuc54.dll" File "${QT_BIN_DIR}\libEGL.dll" File "${QT_BIN_DIR}\libGLESv2.dll" File "${QT_BIN_DIR}\opengl32sw.dll" File "${QT_BIN_DIR}\D3Dcompiler_47.dll" File "${QT_BIN_DIR}\Qt5Core.dll" File "${QT_BIN_DIR}\Qt5Gui.dll" File "${QT_BIN_DIR}\Qt5Network.dll" File "${QT_BIN_DIR}\Qt5Positioning.dll" File "${QT_BIN_DIR}\Qt5PrintSupport.dll" File "${QT_BIN_DIR}\Qt5Qml.dll" File "${QT_BIN_DIR}\Qt5Quick.dll" File "${QT_BIN_DIR}\Qt5QuickWidgets.dll" File "${QT_BIN_DIR}\Qt5Sql.dll" File "${QT_BIN_DIR}\Qt5Svg.dll" File "${QT_BIN_DIR}\Qt5WinExtras.dll" File "${QT_BIN_DIR}\Qt5WebEngine.dll" File "${QT_BIN_DIR}\Qt5WebEngineCore.dll" File "${QT_BIN_DIR}\Qt5WebEngineWidgets.dll" File "${QT_BIN_DIR}\Qt5WebChannel.dll" File "${QT_BIN_DIR}\Qt5Widgets.dll" File "${QT_BIN_DIR}\QtWebEngineProcess.exe" SetOutPath "$INSTDIR\iconengines" File "${QT_PLUGINS_DIR}\iconengines\qsvgicon.dll" SetOutPath "$INSTDIR\imageformats" File "${QT_PLUGINS_DIR}\imageformats\*.dll" SetOutPath "$INSTDIR\platforms" File "${QT_PLUGINS_DIR}\platforms\qwindows.dll" SetOutPath "$INSTDIR\printsupport" File "${QT_PLUGINS_DIR}\printsupport\windowsprintersupport.dll" SetOutPath "$INSTDIR\qml\QtQuick.2" File "${QT_DIR}\qml\QtQuick.2\*" SetOutPath "$INSTDIR\qml\QtWebEngine" File "${QT_DIR}\qml\QtWebEngine\*" SetOutPath "$INSTDIR\resources" File "${QT_DIR}\resources\*" SetOutPath "$INSTDIR\sqldrivers" File "${QT_PLUGINS_DIR}\sqldrivers\qsqlite.dll" SetOutPath "$INSTDIR\styles" File "${QT_PLUGINS_DIR}\styles\*.dll" call RegisterCapabilities StrCmp $installAsPortable "YES" 0 skipPortableMode FileOpen $0 $INSTDIR\falkon.conf w FileWrite $0 "[Config]$\r$\n" FileWrite $0 "Portable=true$\r$\n" StrCmp $0 "" 0 closeHandle MessageBox MB_OK|MB_ICONEXCLAMATION "${MSG_PortableWriteError}" goto skipPortableMode closeHandle: FileClose $0 skipPortableMode: SectionEnd SectionGroup "${TITLE_SecThemes}" SecThemes Section Default SecDefault SectionIn RO SetOutPath "$INSTDIR\themes\windows" File "${FALKON_SRC_DIR}\themes\windows\*" SetOutPath "$INSTDIR\themes\windows\images" File "${FALKON_SRC_DIR}\themes\windows\images\*" SectionEnd Section Chrome SecChrome SetOutPath "$INSTDIR\themes\chrome" File "${FALKON_SRC_DIR}\themes\chrome\*" SetOutPath "$INSTDIR\themes\chrome\images" File "${FALKON_SRC_DIR}\themes\chrome\images\*" SectionEnd Section Mac SecMac SetOutPath "$INSTDIR\themes\mac" File "${FALKON_SRC_DIR}\themes\mac\*" SetOutPath "$INSTDIR\themes\mac\images" File "${FALKON_SRC_DIR}\themes\mac\images\*" SectionEnd SectionGroupEnd Section "${TITLE_SecTranslations}" SecTranslations SetOutPath "$INSTDIR\locale" File /r "${FALKON_BIN_DIR}\locale\*" SetOutPath "$INSTDIR\translations\qtwebengine_locales" File "${QT_DIR}\translations\qtwebengine_locales\*" SetOutPath "$INSTDIR\qtwebengine_dictionaries\doc" ; In some packages underline '_' is used and in some other packages dash '-' is used so we use wildcard File "${QTWEBENGINE_DICTIONARIES_DIR}\doc\README*en*US.txt" SetOutPath "$INSTDIR\qtwebengine_dictionaries" ; in some packages *.bdic files use dash '-' instead of underline '_' followed by a version number. e.g. en-US-3-0.bdic File "${QTWEBENGINE_DICTIONARIES_DIR}\en*US*.bdic" SectionEnd Section "${TITLE_SecPlugins}" SecPlugins SetOutPath "$INSTDIR\plugins" File "${FALKON_BIN_DIR}\plugins\*.dll" SectionEnd SectionGroup "${TITLE_SecSetASDefault}" SecSetASDefault Section "${TITLE_SecExtensions}" SecExtensions StrCmp $installAsPortable "NO" 0 skipSetExtentions SetOutPath "$INSTDIR" ${RegisterAssociation} ".htm" "$INSTDIR\falkon.exe" "FalkonHTML" "Falkon HTML Document" "$INSTDIR\falkon.exe,1" "file" ${RegisterAssociation} ".html" "$INSTDIR\falkon.exe" "FalkonHTML" "Falkon HTML Document" "$INSTDIR\falkon.exe,1" "file" ${UpdateSystemIcons} skipSetExtentions: SectionEnd Section "${TITLE_SecProtocols}" SecProtocols StrCmp $installAsPortable "NO" 0 skipSecProtocols ${RegisterAssociation} "http" "$INSTDIR\falkon.exe" "FalkonURL" "Falkon URL" "$INSTDIR\falkon.exe,0" "protocol" ${RegisterAssociation} "https" "$INSTDIR\falkon.exe" "FalkonURL" "Falkon URL" "$INSTDIR\falkon.exe,0" "protocol" ${RegisterAssociation} "ftp" "$INSTDIR\falkon.exe" "FalkonURL" "Falkon URL" "$INSTDIR\falkon.exe,0" "protocol" ${UpdateSystemIcons} skipSecProtocols: SectionEnd SectionGroupEnd Section -StartMenu StrCmp $installAsPortable "NO" 0 skipStartMenu SetOutPath "$INSTDIR" SetShellVarContext all CreateDirectory "$SMPROGRAMS\Falkon" CreateShortCut "$SMPROGRAMS\Falkon\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\Falkon\Falkon.lnk" "$INSTDIR\falkon.exe" CreateShortCut "$SMPROGRAMS\Falkon\License.lnk" "$INSTDIR\COPYRIGHT.txt" skipStartMenu: SectionEnd Section "${TITLE_SecDesktop}" SecDesktop StrCmp $installAsPortable "NO" 0 skipDesktopIcon SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\Falkon.lnk" "$INSTDIR\falkon.exe" "" skipDesktopIcon: SectionEnd !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecMain} "${DESC_SecMain}" !insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} "${DESC_SecTranslations}" !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "${DESC_SecPlugins}" !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "${DESC_SecDesktop}" !insertmacro MUI_DESCRIPTION_TEXT ${SecExtensions} "${DESC_SecExtensions}" !insertmacro MUI_DESCRIPTION_TEXT ${SecThemes} "${DESC_SecThemes}" !insertmacro MUI_DESCRIPTION_TEXT ${SecSetASDefault} "${DESC_SecSetASDefault}" !insertmacro MUI_DESCRIPTION_TEXT ${SecProtocols} "${DESC_SecProtocols}" !insertmacro MUI_FUNCTION_DESCRIPTION_END Section -Uninstaller StrCmp $installAsPortable "NO" 0 skipUninstaller WriteUninstaller "$INSTDIR\uninstall.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\falkon.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\falkon.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "Falkon Team" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "HelpLink" "https://userbase.kde.org/Falkon" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallSource" "$EXEDIR" - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "https://kde.org" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "https://falkon.org" ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "EstimatedSize" "$0" skipUninstaller: SectionEnd Section Uninstall FindProcDLL::FindProc "falkon.exe" IntCmp $R0 1 0 notRunning MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "${MSG_RunningInstance}" /SD IDOK IDCANCEL AbortInstallation KillProcDLL::KillProc "falkon.exe" Sleep 100 Goto notRunning AbortInstallation: Abort "${MSG_InstallationCanceled}" notRunning: SetShellVarContext all Delete "$DESKTOP\Falkon.lnk" Delete "$INSTDIR\falkon.exe" Delete "$INSTDIR\falkonprivate.dll" Delete "$INSTDIR\uninstall.exe" Delete "$INSTDIR\COPYRIGHT.txt" Delete "$INSTDIR\qt.conf" Delete "$INSTDIR\libeay32.dll" Delete "$INSTDIR\ssleay32.dll" Delete "$INSTDIR\libEGL.dll" Delete "$INSTDIR\libGLESv2.dll" Delete "$INSTDIR\opengl32sw.dll" Delete "$INSTDIR\D3Dcompiler_47.dll" Delete "$INSTDIR\QtWebEngineProcess.exe" ; Wildcard delete to compact script of uninstall section Delete "$INSTDIR\icu*.dll" Delete "$INSTDIR\Qt5*.dll" Delete "$INSTDIR\msvc*.dll" Delete "$INSTDIR\vc*.dll" Delete "$INSTDIR\concrt*.dll" ; Recursively delete folders in root of $INSTDIR RMDir /r "$INSTDIR\iconengines" RMDir /r "$INSTDIR\imageformats" RMDir /r "$INSTDIR\platforms" RMDir /r "$INSTDIR\printsupport" RMDir /r "$INSTDIR\qml" RMDir /r "$INSTDIR\resources" RMDir /r "$INSTDIR\translations" RMDir /r "$INSTDIR\sqldrivers" RMDir /r "$INSTDIR\styles" RMDir /r "$INSTDIR\qtwebengine_dictionaries" RMDir /r "$INSTDIR\themes" RMDir /r "$INSTDIR\locale" RMDir /r "$INSTDIR\plugins" ; Remove $INSTDIR if it is empty RMDir "$INSTDIR" ; Remove start menu programs folder RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" DeleteRegKey HKLM "Software\${PRODUCT_NAME}" DeleteRegValue HKLM "SOFTWARE\RegisteredApplications" "${PRODUCT_NAME}" ${UnRegisterAssociation} ".htm" "FalkonHTML" "$INSTDIR\falkon.exe" "file" ${UnRegisterAssociation} ".html" "FalkonHTML" "$INSTDIR\falkon.exe" "file" ${UnRegisterAssociation} "http" "FalkonURL" "$INSTDIR\falkon.exe" "protocol" ${UnRegisterAssociation} "https" "FalkonURL" "$INSTDIR\falkon.exe" "protocol" ${UnRegisterAssociation} "ftp" "FalkonURL" "$INSTDIR\falkon.exe" "protocol" ${UpdateSystemIcons} SectionEnd BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer" Function .onInit ;Prevent running installer of 64-bit Falkon on 32-bit Windows ${If} ${RunningX64} ${If} ${ARCH} == "x64" StrCpy $InstDir "$PROGRAMFILES64\${PRODUCT_NAME}\" ${Else} StrCpy $InstDir "$PROGRAMFILES32\${PRODUCT_NAME}\" ${Endif} ${Else} ${If} ${ARCH} == "x64" MessageBox MB_OK|MB_ICONEXCLAMATION "This installation requiers Windows x64!" Quit ${Else} StrCpy $InstDir "$PROGRAMFILES\${PRODUCT_NAME}\" ${Endif} ${EndIf} ;Extract InstallOptions files ;$PLUGINSDIR will automatically be removed when the installer closes InitPluginsDir File /oname=$PLUGINSDIR\portable-mode.ini "portable-mode.ini" File /oname=$PLUGINSDIR\portable-info.ini "portable-info.ini" ;Prevent Multiple Instances System::Call 'kernel32::CreateMutexA(i 0, i 0, t "FalkonInstaller-4ECB4694-2C39-4f93-9122-A986344C4E7B") i .r1 ?e' Pop $R0 StrCmp $R0 0 skip ;Return when running silent instalation IfSilent doAbort 0 MessageBox MB_OK|MB_ICONEXCLAMATION "Falkon installer is already running!" /SD IDOK doAbort: Abort skip: FunctionEnd Function RegisterCapabilities StrCmp $installAsPortable "NO" 0 skipRegisterCapabilities !ifdef ___WINVER__NSH___ ${If} ${AtLeastWinVista} ; even if we don't associate Falkon as default for ".htm" and ".html" ; we need to write these ProgIds for future use! ;(e.g.: user uses "Default Programs" on Win7 or Vista to set Falkon as default.) ${CreateProgId} "FalkonHTML" "$INSTDIR\falkon.exe" "Falkon HTML Document" "$INSTDIR\falkon.exe,1" ${CreateProgId} "FalkonURL" "$INSTDIR\falkon.exe" "Falkon URL" "$INSTDIR\falkon.exe,0" ; note: these lines just introduce capabilities of Falkon to OS and don't change defaults! WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}" "ApplicationDescription" "${PRODUCT_DESC}" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}" "ApplicationIcon" "$INSTDIR\falkon.exe,0" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}" "ApplicationName" "${PRODUCT_NAME}" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\FileAssociations" ".htm" "FalkonHTML" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\FileAssociations" ".html" "FalkonHTML" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\URLAssociations" "http" "FalkonURL" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\URLAssociations" "https" "FalkonURL" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\URLAssociations" "ftp" "FalkonURL" WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\Startmenu" "StartMenuInternet" "$INSTDIR\falkon.exe" WriteRegStr HKLM "SOFTWARE\RegisteredApplications" "${PRODUCT_NAME}" "${PRODUCT_CAPABILITIES_KEY}" ${EndIf} !endif skipRegisterCapabilities: FunctionEnd Function RunFalkonAsUser ${StdUtils.ExecShellAsUser} $0 "$INSTDIR\falkon.exe" "open" "" FunctionEnd Function un.onInit ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallLocation" IfErrors +2 0 StrCpy $INSTDIR "$R0" IfFileExists "$INSTDIR\falkon.exe" found MessageBox MB_OK|MB_ICONSTOP "${MSG_InvalidInstallPath}" Abort found: FunctionEnd Function InstallationModePage !insertmacro MUI_HEADER_TEXT "${TITLE_InstallationMode}" "${DESC_InstallationMode}" WriteINIStr "$PLUGINSDIR\portable-mode.ini" "Field 1" "Text" "${TITLE_StandardInstallation}" WriteINIStr "$PLUGINSDIR\portable-mode.ini" "Field 2" "Text" "${TITLE_PortableInstallation}" InstallOptions::dialog $PLUGINSDIR\portable-mode.ini FunctionEnd Function InstallationModeLeave ReadINIStr $0 "$PLUGINSDIR\portable-mode.ini" "Field 2" "State" StrCmp $0 1 0 notchecked StrCpy $installAsPortable "YES" StrCpy $InstDir "$DESKTOP\${PRODUCT_NAME} Portable\" goto skip notchecked: StrCpy $installAsPortable "NO" skip: FunctionEnd Function installationInfoPage !insertmacro MUI_HEADER_TEXT "${TITLE_InstallInfo}" "${DESC_InstallInfo}" StrCmp $installAsPortable "NO" 0 infoPortable WriteINIStr "$PLUGINSDIR\portable-info.ini" "Field 1" "Text" "${DESC_StandardInstallation}" Goto showInfo infoPortable: WriteINIStr "$PLUGINSDIR\portable-info.ini" "Field 1" "Text" "${DESC_PortableInstallation}" showInfo: InstallOptions::dialog $PLUGINSDIR\portable-info.ini FunctionEnd Function installationInfoLeave FunctionEnd Function SkipComponentsIfPortableInstalltion StrCmp $installAsPortable "YES" 0 +2 Abort FunctionEnd