Merge pull request #397 from kiwix/open-folder-toolbar

add open file button in toolbar
This commit is contained in:
Matthieu Gautier 2020-04-07 12:05:43 +02:00 committed by GitHub
commit 2b67d3bc62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,23 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.15, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M97 4493 c-4 -3 -7 -844 -7 -1867 0 -1513 3 -1872 14 -1917 25 -110
98 -197 205 -248 l56 -26 1699 -3 c1110 -1 1719 1 1754 8 113 21 229 98 289
194 22 35 963 2416 963 2437 0 5 -791 9 -1769 9 -1675 0 -1769 -1 -1776 -17
-4 -10 -188 -528 -411 -1151 -222 -623 -413 -1149 -423 -1170 -50 -96 -168
-150 -285 -128 -44 8 -104 59 -122 103 -12 27 -14 341 -14 1818 l0 1785 688 0
687 0 265 -265 265 -265 812 0 813 0 0 -265 0 -265 90 0 90 0 -2 353 -3 352
-865 3 -865 2 -265 265 -265 265 -806 0 c-443 0 -809 -3 -812 -7z m4713 -1597
c0 -15 -819 -2106 -844 -2154 -22 -43 -98 -107 -144 -120 -29 -9 -414 -12
-1521 -12 l-1482 0 25 43 c13 23 200 537 416 1142 216 605 394 1103 397 1108
2 4 713 7 1579 7 1323 0 1574 -2 1574 -14z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -71,6 +71,7 @@
<file>icons/cancel-button.png</file> <file>icons/cancel-button.png</file>
<file>icons/new-tab-icon.svg</file> <file>icons/new-tab-icon.svg</file>
<file>icons/library-icon.svg</file> <file>icons/library-icon.svg</file>
<file>icons/open-file.svg</file>
</qresource> </qresource>
<qresource lang="fr" prefix="/"> <qresource lang="fr" prefix="/">
<file alias="texts/about.html">texts/fr/about.html</file> <file alias="texts/about.html">texts/fr/about.html</file>

View File

@ -292,7 +292,7 @@ void KiwixApp::createAction()
SET_SHORTCUT(BrowseLibraryAction, QKeySequence(Qt::CTRL+Qt::Key_E)); SET_SHORTCUT(BrowseLibraryAction, QKeySequence(Qt::CTRL+Qt::Key_E));
HIDE_ACTION(BrowseLibraryAction); HIDE_ACTION(BrowseLibraryAction);
CREATE_ACTION(OpenFileAction, tr("Open file")); CREATE_ACTION_ICON(OpenFileAction, "open-file", tr("Open file"));
SET_SHORTCUT(OpenFileAction, QKeySequence::Open); SET_SHORTCUT(OpenFileAction, QKeySequence::Open);
connect(mpa_actions[OpenFileAction], &QAction::triggered, connect(mpa_actions[OpenFileAction], &QAction::triggered,
this, [=]() { openZimFile(); }); this, [=]() { openZimFile(); });

View File

@ -36,6 +36,7 @@ TopWidget::TopWidget(QWidget *parent) :
addSeparator(); addSeparator();
addAction(KiwixApp::instance()->getAction(KiwixApp::OpenFileAction));
QMenu* menu = new MainMenu(); QMenu* menu = new MainMenu();
QAction* menuAction = new QAction(this); QAction* menuAction = new QAction(this);