1299 Commits

Author SHA1 Message Date
Matthieu Gautier
6f8b1ab7b4 Add a menu.
All action of the menu are created but none is associated with an action.
Actions needed for the alpha are disabled.
Actions not needed for the alpha are hidden.
2018-07-25 17:02:13 +02:00
Matthieu Gautier
7b7f432f8b Customize the searchBar using the css
- Use a the css to display the icon.
- Update the search.svg icon to be 40px wide.
- No need to have a custom paintEvent method.
2018-07-24 17:28:32 +02:00
Matthieu Gautier
28fff443ed Remove the margin around the centralWidget. 2018-07-24 17:25:11 +02:00
Matthieu Gautier
fea60dca50 Add a custom CSS.
This basic CSS is a first attempt to have our custom style.

We use the "Windows" style as base as it is the closest of our style.
2018-07-24 17:24:51 +02:00
Matthieu Gautier
7408bb0a65 Do not use deprecated kiwix-lib method. 2018-07-23 15:48:48 +02:00
Matthieu Gautier
e35d42bcfd Add a property currentZimId to the TabWidget. 2018-07-23 15:48:47 +02:00
Matthieu Gautier
b3fbeccfbc Add a property zimId in the WebView. 2018-07-23 15:48:08 +02:00
Matthieu Gautier
5e80464128 Method of tabWidget changing a webView work by default on current webView. 2018-07-23 15:48:06 +02:00
Matthieu Gautier
ca309c0701 Implement search suggestion. 2018-07-19 18:43:27 +02:00
Matthieu Gautier
c712a7a760 Rename member variables.
- Move camelCase.
- Use the prefix `m_` and `mp_` for member and pointer member.
2018-07-19 15:56:27 +02:00
Matthieu Gautier
e15e8cf642 Implement Back & Forward in the history. 2018-07-19 15:30:03 +02:00
Matthieu Gautier
5e22b03941 Overload TabWidget' widget and currentWidget to return a WebView. 2018-07-19 15:30:03 +02:00
Matthieu Gautier
24dd0a39d5 Add a close button to the tabs. 2018-07-19 15:30:03 +02:00
Matthieu Gautier
ee2a55bcbf Remove unused reader parameter in TabWidget::openUrl. 2018-07-19 15:30:03 +02:00
Matthieu Gautier
3e46893e2d Rename classes and files.
Mainly remove the `Kiwix` part in the name :
- KiwixSchemeHandler -> UrlSchemeHandler
- KiwixRequestInterceptor -> RequestInterceptor
- KiwixWebView -> WebView
- KTabWidget -> TabWidget
2018-07-19 15:30:03 +02:00
Matthieu Gautier
7b9968daee Move source files in src subdirectory. 2018-07-19 10:48:45 +02:00
Matthieu Gautier
9eb761099f
Merge pull request #17 from kiwix/new_version
Update of kiwix-desktop.
2018-07-18 17:59:46 +02:00
Matthieu Gautier
aaae4e7c4b Add a virtual BlobBuffer destructor.
This is need to be sure that the referenced zim::Blob is actually deleted.
2018-07-18 17:57:59 +02:00
Matthieu Gautier
d1b5624f04 Set the tab's icon to the icon of the zim file.
Properly set the icon of the tab when the favicon of the KiwixWebView
is updated.

By default, the icon of QWebEngineView is updated from the favicon set
in the html. But it sometime it is not set.

So we need to load the icon from the zim file, so we have to react
to urlChanged signal, to load the icon when the url's host (the zim file)
changes.
2018-07-18 17:57:59 +02:00
Matthieu Gautier
cb21a6816e Set the tab's text to the title of the webView.
The `titleChanged` signal is emitted twice:
- At beggining of loading with the Url of the page.
- Once the parsing is done and the `<title></title>` html tag has been
  found.
2018-07-18 17:57:59 +02:00
Matthieu Gautier
81766be447 Allow user to open a link in a new tab.
When a user <Ctrl+LeftClick> or <MiddleClick> on a link, `QWebEngineView`
try to open a new window using the `createWindow` method.

By overloading it, we can create our own tab as we want.
2018-07-18 17:57:59 +02:00
Matthieu Gautier
1287c93368 Overload KiwixApp::instance() to return a KiwixApp*. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
0359cde2d2 Fix typos. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
3c9c0a4d88 Display the system title bar. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
88fce09fc6 Set the font of the application. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
428c3972fd Clean a bit log messages. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
8ca34d0bb8 Do not try to open a zimfile is user didn't give a zimfile. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
6ee087c876 Pass the mainWindow as parent for the fileOpenDialog. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
f07b074ab6 Add a kiwix.desktop file. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
a590d2ce50 Set the application name. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
70b5e9ceb4 Set the icon of the application 2018-07-18 17:57:59 +02:00
Matthieu Gautier
6320a4e088 Remove DISTFILES from project
Files are already included in the project using kiwix.qrc.
So we don't need to handle them here.
2018-07-18 17:57:59 +02:00
Matthieu Gautier
e16a625f4c Use a custom tool bar.
We don't want a titlebar and we want a custom toolbar instead.
2018-07-18 17:57:59 +02:00
Matthieu Gautier
b1dbddf127 Add the icons as resources in the project. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
7e4c042824 Use tabs to display KiwixWebView.
This is the first step to handling several zim file at the same time.

- The Library class is used has a handler mapping zimId to kiwix::Reader.
- The KiwixWebView display url of the form : "zim://<zimId>.zim/path".
- The KiwixSchemeHandler uses the host (containing the zimid) to get
  the reader from the library and serve the content.
2018-07-18 17:57:59 +02:00
Matthieu Gautier
bb9f60acc7 Handle HighDpi screen. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
12a2a3c036 Make the KiwixApp responsible to create the MainWindow. 2018-07-18 17:57:59 +02:00
Matthieu Gautier
4c8996d95b
Merge pull request #16 from kiwix/windows
Make kiwix-desktop work on Windows.
2018-07-17 16:27:29 +02:00
Matthieu Gautier
a41b923ae7 Use the static option to define how we link to kiwix-lib.
We cannot create a static binary because we cannot build QtWebEngine
statically.
So the static config, should only be used to define if we are linking
to the dynamic or static kiwix-lib.
2018-07-17 11:21:22 +02:00
Matthieu Gautier
4849b5e364 Rewrite the request interceptor.
It seems that there are request in the form
"blob://foo.zim/<uuid>".
I don't know where it come from, we cannot handle it and even Qt is parsing
it wrongly (scheme and host are empty, path is the full url request).

By using a string to handle the url, it is simpler to change "http://" to
"zim://".
2018-07-17 11:19:43 +02:00
Matthieu Gautier
fab22ab909 Better convertion of the mimetype from std::string to QByteArray. 2018-07-17 11:16:20 +02:00
Matthieu Gautier
6b1d0898d5 Print a message when we fail to open a zim file. 2018-07-17 11:15:34 +02:00
Matthieu Gautier
9aa37e9b9c
Merge pull request #13 from kiwix/force_c++11
Force usage of c++11 version.
2018-06-14 17:47:38 +02:00
Matthieu Gautier
f6e80dbe59 Force usage of c++11 version. 2018-06-14 17:46:14 +02:00
Matthieu Gautier
1231e2fcdb Use last kiwix-lib API. 2018-06-12 19:23:47 +02:00
Matthieu Gautier
7c8d475d24 Do not crash if the zim file is invalid or corrupted. 2018-06-12 19:23:30 +02:00
Matthieu Gautier
84e5124ae6 Use dialog to select a zim file if no zim as been provide on command line.
It is better than crashing.
2018-06-12 19:22:49 +02:00
Matthieu Gautier
a248348452 Initial commit.
This is a first "more than alpha" version of kiwix-desktop.

It takes a zim as command line argument and open it.
There is no navigation button, and the adresse bar is read only.
It crashes if no zim is given on the command line.
2018-05-21 16:58:38 +02:00
Kelson
bbbae462fd
Initial commit 2017-12-03 13:49:23 +01:00