Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
akiraohgaki
ocs-url
Commits
3a3ee907
Commit
3a3ee907
authored
Jan 26, 2017
by
akiraohgaki
Committed by
GitHub
Jan 26, 2017
Browse files
Merge pull request #33 from xdgurl/development
Development
parents
cc784f74
919716d0
Changes
36
Hide whitespace changes
Inline
Side-by-side
.travis.yml
View file @
3a3ee907
...
...
@@ -8,7 +8,7 @@ before_install:
install
:
-
sudo apt-get -y install build-essential fuse zsync desktop-file-utils
-
sudo apt-get -y install qt57base qt57svg qt57
quickcontrols
qt57quickcontrols
2
-
sudo apt-get -y install qt57base qt57svg qt57
declarative
qt57quickcontrols
# Replace linuxdeployqt download URL to official download URL when the stable version released
-
curl -L -o linuxdeployqt https://dl.dropboxusercontent.com/u/150776/temp/linuxdeployqt-799f704-x86-64.appimage
-
sudo install -m 755 -p linuxdeployqt /usr/local/bin/linuxdeployqt
...
...
README.md
View file @
3a3ee907
...
...
@@ -2,7 +2,7 @@
An install helper program for desktop stuff.
Copyright: 2016, Akira Ohgaki
Copyright: 2016
-2017
, Akira Ohgaki
License: GPL-3+
...
...
pkg/arch/PKGBUILD
View file @
3a3ee907
# Maintainer: Akira Ohgaki <akiraohgaki@gmail.com>
pkgname
=
'xdgurl'
pkgver
=
'2.0.
2
'
pkgver
=
'2.0.
3
'
pkgrel
=
'1'
pkgdesc
=
'An install helper program for desktop stuff.'
arch
=(
'i686'
'x86_64'
)
...
...
pkg/build.sh
View file @
3a3ee907
...
...
@@ -71,7 +71,7 @@ build_appimage() {
#sudo apt update
#sudo apt install build-essential fuse zsync desktop-file-utils
#sudo apt install qt57base qt57svg qt57
quickcontrols
qt57quickcontrols
2
#sudo apt install qt57base qt57svg qt57
declarative
qt57quickcontrols
# Replace linuxdeployqt download URL to official download URL when the stable version released
#curl -L -o linuxdeployqt https://dl.dropboxusercontent.com/u/150776/temp/linuxdeployqt-799f704-x86-64.appimage
#sudo install -m 755 -p linuxdeployqt /usr/local/bin/linuxdeployqt
...
...
pkg/fedora/xdgurl.spec
View file @
3a3ee907
Summary: An install helper program for desktop stuff
Name: xdgurl
Version: 2.0.
2
Version: 2.0.
3
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Internet
...
...
@@ -37,6 +37,11 @@ make INSTALL_ROOT="%{buildroot}" install
rm -rf %{buildroot}
%changelog
* Wed Jan 25 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.3-1
- Change installation destination of type bin
- Update qtlib
- Fix for dialog
* Thu Nov 17 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.2-1
- Update qtlibs
- Small fix
...
...
pkg/ubuntu/debian/changelog
View file @
3a3ee907
xdgurl (2.0.3-0ubuntu1) xenial; urgency=low
* Change installation destination of type bin
* Update qtlib
* Fix for dialog
-- Akira Ohgaki <akiraohgaki@gmail.com> Wed, 25 Jan 2017 19:58:44 +0000
xdgurl (2.0.2-0ubuntu1) xenial; urgency=low
* Update qtlibs
...
...
pkg/ubuntu/debian/copyright
View file @
3a3ee907
...
...
@@ -4,7 +4,7 @@ Upstream-Contact: Akira Ohgaki <akiraohgaki@gmail.com>
Source: https://github.com/xdgurl/xdgurl
Files: *
Copyright: 2016, Akira Ohgaki
Copyright: 2016
-2017
, Akira Ohgaki
License: GPL-3+
On Debian systems, the full text of the GNU General Public License version 3
can be found in the `/usr/share/common-licenses/GPL-3' file.
src/app/app.pri
View file @
3a3ee907
...
...
@@ -6,11 +6,11 @@ QT += \
svg
HEADERS += \
$${PWD}/handlers/xdgurl.h
$${PWD}/handlers/xdgurl
handler
.h
SOURCES += \
$${PWD}/main.cpp \
$${PWD}/handlers/xdgurl.cpp
$${PWD}/handlers/xdgurl
handler
.cpp
RESOURCES += \
$${PWD}/configs/configs.qrc \
...
...
src/app/configs/application.json
View file @
3a3ee907
{
"id"
:
"xdgurl"
,
"name"
:
"xdgurl"
,
"version"
:
"2.0.
2
"
,
"version"
:
"2.0.
3
"
,
"organization"
:
"xdgurl"
,
"domain"
:
"com.xdgurl.xdgurl"
,
"icon"
:
":/desktop/xdgurl.svg"
,
...
...
src/app/configs/destinations.json
View file @
3a3ee907
{
"bin"
:
"$HOME/.bin"
,
"bin"
:
"$HOME/.
local/
bin"
,
"downloads"
:
"$HOME/Downloads"
,
"documents"
:
"$HOME/Documents"
,
"pictures"
:
"$HOME/Pictures"
,
...
...
src/app/handlers/xdgurl.cpp
→
src/app/handlers/xdgurl
handler
.cpp
View file @
3a3ee907
#include
"xdgurl.h"
#include
"xdgurl
handler
.h"
#include
<QUrlQuery>
#include
<QDesktopServices>
#include
"qtlib
s/
file.h"
#include
"qtlib
s/
dir.h"
#include
"qtlib
s/
networkresource.h"
#include
"qtlib
s/
package.h"
#include
"qtlib
_
file.h"
#include
"qtlib
_
dir.h"
#include
"qtlib
_
networkresource.h"
#include
"qtlib
_
package.h"
namespace
handlers
{
XdgUrl
::
XdgUrl
(
const
QString
&
xdgUrl
,
const
qtlibs
::
Config
&
config
,
QObject
*
parent
)
XdgUrlHandler
::
XdgUrlHandler
(
const
QString
&
xdgUrl
,
const
qtlib
::
Config
&
config
,
QObject
*
parent
)
:
QObject
(
parent
),
xdgUrl_
(
xdgUrl
),
config_
(
config
)
{
parse
();
loadDestinations
();
}
QString
XdgUrl
::
xdgUrl
()
const
QString
XdgUrl
Handler
::
xdgUrl
()
const
{
return
xdgUrl_
;
}
QJsonObject
XdgUrl
::
metadata
()
const
QJsonObject
XdgUrl
Handler
::
metadata
()
const
{
return
metadata_
;
}
void
XdgUrl
::
process
()
void
XdgUrl
Handler
::
process
()
{
/**
* xdgs scheme is a reserved name, so the process of xdgs
* is the same process of the xdg scheme currently.
*/
// xdgs scheme is a reserved name, so the process of xdgs
// is the same process of the xdg scheme currently.
if
(
!
isValid
())
{
QJsonObject
result
;
...
...
@@ -43,14 +39,14 @@ void XdgUrl::process()
}
QString
url
=
metadata_
[
"url"
].
toString
();
qtlib
s
::
NetworkResource
*
resource
=
new
qtlib
s
::
NetworkResource
(
url
,
QUrl
(
url
),
true
,
this
);
connect
(
resource
,
&
qtlib
s
::
NetworkResource
::
downloadProgress
,
this
,
&
XdgUrl
::
downloadProgress
);
connect
(
resource
,
&
qtlib
s
::
NetworkResource
::
finished
,
this
,
&
XdgUrl
::
networkResourceFinished
);
qtlib
::
NetworkResource
*
resource
=
new
qtlib
::
NetworkResource
(
url
,
QUrl
(
url
),
true
,
this
);
connect
(
resource
,
&
qtlib
::
NetworkResource
::
downloadProgress
,
this
,
&
XdgUrl
Handler
::
downloadProgress
);
connect
(
resource
,
&
qtlib
::
NetworkResource
::
finished
,
this
,
&
XdgUrl
Handler
::
networkResourceFinished
);
resource
->
get
();
emit
started
();
}
bool
XdgUrl
::
isValid
()
bool
XdgUrl
Handler
::
isValid
()
{
QString
scheme
=
metadata_
[
"scheme"
].
toString
();
QString
command
=
metadata_
[
"command"
].
toString
();
...
...
@@ -68,20 +64,20 @@ bool XdgUrl::isValid()
return
false
;
}
void
XdgUrl
::
openDestination
()
void
XdgUrl
Handler
::
openDestination
()
{
if
(
!
destination_
.
isEmpty
())
{
QDesktopServices
::
openUrl
(
QUrl
(
"file://"
+
destination_
));
}
QString
type
=
metadata_
[
"type"
].
toString
();
QDesktopServices
::
openUrl
(
QUrl
(
"file://"
+
destinations_
[
type
].
toString
()));
}
void
XdgUrl
::
networkResourceFinished
(
qtlib
s
::
NetworkResource
*
resource
)
void
XdgUrl
Handler
::
networkResourceFinished
(
qtlib
::
NetworkResource
*
resource
)
{
if
(
resource
->
reply
()
->
error
()
!=
QNetworkReply
::
NoError
)
{
if
(
!
resource
->
isFinishedWith
NoError
()
)
{
QJsonObject
result
;
result
[
"status"
]
=
QString
(
"error_network"
);
result
[
"message"
]
=
resource
->
reply
()
->
errorString
();
emit
finishedWithError
(
result
);
resource
->
deleteLater
();
return
;
}
...
...
@@ -93,7 +89,7 @@ void XdgUrl::networkResourceFinished(qtlibs::NetworkResource *resource)
}
}
void
XdgUrl
::
parse
()
void
XdgUrl
Handler
::
parse
()
{
QUrl
url
(
xdgUrl_
);
QUrlQuery
query
(
url
);
...
...
@@ -129,7 +125,7 @@ void XdgUrl::parse()
}
}
void
XdgUrl
::
loadDestinations
()
void
XdgUrl
Handler
::
loadDestinations
()
{
QJsonObject
configDestinations
=
config_
.
get
(
"destinations"
);
QJsonObject
configDestinationsAlias
=
config_
.
get
(
"destinations_alias"
);
...
...
@@ -146,72 +142,70 @@ void XdgUrl::loadDestinations()
}
}
QString
XdgUrl
::
convertPathString
(
const
QString
&
path
)
QString
XdgUrl
Handler
::
convertPathString
(
const
QString
&
path
)
{
QString
newPath
=
path
;
if
(
newPath
.
contains
(
"$HOME"
))
{
newPath
.
replace
(
"$HOME"
,
qtlib
s
::
Dir
::
homePath
());
newPath
.
replace
(
"$HOME"
,
qtlib
::
Dir
::
homePath
());
}
else
if
(
newPath
.
contains
(
"$XDG_DATA_HOME"
))
{
newPath
.
replace
(
"$XDG_DATA_HOME"
,
qtlib
s
::
Dir
::
genericDataPath
());
newPath
.
replace
(
"$XDG_DATA_HOME"
,
qtlib
::
Dir
::
genericDataPath
());
}
else
if
(
newPath
.
contains
(
"$KDEHOME"
))
{
newPath
.
replace
(
"$KDEHOME"
,
qtlib
s
::
Dir
::
kdehomePath
());
newPath
.
replace
(
"$KDEHOME"
,
qtlib
::
Dir
::
kdehomePath
());
}
return
newPath
;
}
void
XdgUrl
::
saveDownloadedFile
(
qtlib
s
::
NetworkResource
*
resource
)
void
XdgUrl
Handler
::
saveDownloadedFile
(
qtlib
::
NetworkResource
*
resource
)
{
QJsonObject
result
;
QString
type
=
metadata_
[
"type"
].
toString
();
QString
destination
=
destinations_
[
type
].
toString
();
QString
path
=
destination
+
"/"
+
metadata_
[
"filename"
].
toString
();
qtlibs
::
Dir
(
destination
).
make
();
qtlib
::
Dir
destDir
(
destinations_
[
type
].
toString
());
destDir
.
make
();
qtlib
::
File
destFile
(
destDir
.
path
()
+
"/"
+
metadata_
[
"filename"
].
toString
());
if
(
!
resource
->
saveData
(
path
))
{
if
(
!
resource
->
saveData
(
destFile
.
path
()
))
{
result
[
"status"
]
=
QString
(
"error_save"
);
result
[
"message"
]
=
QString
(
"Failed to save data as "
+
path
);
result
[
"message"
]
=
QString
(
"Failed to save data as "
+
destFile
.
path
()
);
emit
finishedWithError
(
result
);
resource
->
deleteLater
();
return
;
}
destination_
=
destination
;
result
[
"status"
]
=
QString
(
"success_download"
);
result
[
"message"
]
=
QString
(
"The file has been stored into "
+
dest
ination
);
result
[
"message"
]
=
QString
(
"The file has been stored into "
+
dest
Dir
.
path
()
);
emit
finishedWithSuccess
(
result
);
resource
->
deleteLater
();
}
void
XdgUrl
::
installDownloadedFile
(
qtlib
s
::
NetworkResource
*
resource
)
void
XdgUrl
Handler
::
installDownloadedFile
(
qtlib
::
NetworkResource
*
resource
)
{
QJsonObject
result
;
QString
tempPath
=
qtlib
s
::
Dir
::
tempPath
()
+
"/"
+
metadata_
[
"filename"
].
toString
();
qtlib
::
File
tempFile
(
qtlib
::
Dir
::
tempPath
()
+
"/"
+
metadata_
[
"filename"
].
toString
()
)
;
if
(
!
resource
->
saveData
(
temp
P
ath
))
{
if
(
!
resource
->
saveData
(
temp
File
.
p
ath
()
))
{
result
[
"status"
]
=
QString
(
"error_save"
);
result
[
"message"
]
=
QString
(
"Failed to save data as "
+
temp
P
ath
);
result
[
"message"
]
=
QString
(
"Failed to save data as "
+
temp
File
.
p
ath
()
);
emit
finishedWithError
(
result
);
resource
->
deleteLater
();
return
;
}
qtlibs
::
Package
package
(
tempPath
);
qtlibs
::
File
tempFile
(
tempPath
);
qtlib
::
Package
package
(
tempFile
.
path
());
QString
type
=
metadata_
[
"type"
].
toString
();
QString
destination
=
destinations_
[
type
].
toString
();
QString
path
=
destination
+
"/"
+
metadata_
[
"filename"
].
toString
();
qtlibs
::
Dir
(
destination
).
make
();
qtlib
::
Dir
destDir
(
destinations_
[
type
].
toString
());
destDir
.
make
();
qtlib
::
File
destFile
(
destDir
.
path
()
+
"/"
+
metadata_
[
"filename"
].
toString
());
if
(
type
==
"bin"
&&
package
.
installAsProgram
(
path
))
{
result
[
"message"
]
=
QString
(
"The file has been installed into "
+
dest
ination
);
&&
package
.
installAsProgram
(
destFile
.
path
()
))
{
result
[
"message"
]
=
QString
(
"The file has been installed into "
+
dest
Dir
.
path
()
);
}
else
if
((
type
==
"plasma_plasmoids"
||
type
==
"plasma4_plasmoids"
||
type
==
"plasma5_plasmoids"
)
&&
package
.
installAsPlasmapkg
(
"plasmoid"
))
{
...
...
@@ -237,26 +231,23 @@ void XdgUrl::installDownloadedFile(qtlibs::NetworkResource *resource)
&&
package
.
installAsPlasmapkg
(
"windowswitcher"
))
{
result
[
"message"
]
=
QString
(
"The KWin window switcher has been installed"
);
}
else
if
(
package
.
installAsArchive
(
dest
ination
))
{
result
[
"message"
]
=
QString
(
"The archive file has been extracted into "
+
dest
ination
);
else
if
(
package
.
installAsArchive
(
dest
Dir
.
path
()
))
{
result
[
"message"
]
=
QString
(
"The archive file has been extracted into "
+
dest
Dir
.
path
()
);
}
else
if
(
package
.
installAsFile
(
path
))
{
result
[
"message"
]
=
QString
(
"The file has been installed into "
+
dest
ination
);
else
if
(
package
.
installAsFile
(
destFile
.
path
()
))
{
result
[
"message"
]
=
QString
(
"The file has been installed into "
+
dest
Dir
.
path
()
);
}
else
{
tempFile
.
remove
();
result
[
"status"
]
=
QString
(
"error_install"
);
result
[
"message"
]
=
QString
(
"Failed to installation"
);
emit
finishedWithError
(
result
);
tempFile
.
remove
();
return
;
}
tempFile
.
remove
();
destination_
=
destination
;
result
[
"status"
]
=
QString
(
"success_install"
);
emit
finishedWithSuccess
(
result
);
}
}
// namespace handlers
tempFile
.
remove
();
resource
->
deleteLater
();
}
src/app/handlers/xdgurl.h
→
src/app/handlers/xdgurl
handler
.h
View file @
3a3ee907
...
...
@@ -3,26 +3,24 @@
#include
<QObject>
#include
<QJsonObject>
#include
"qtlib
s/
config.h"
#include
"qtlib
_
config.h"
namespace
qtlib
s
{
namespace
qtlib
{
class
NetworkResource
;
}
namespace
handlers
{
class
XdgUrl
:
public
QObject
class
XdgUrlHandler
:
public
QObject
{
Q_OBJECT
public:
explicit
XdgUrl
(
const
QString
&
xdgUrl
,
const
qtlib
s
::
Config
&
config
,
QObject
*
parent
=
0
);
explicit
XdgUrl
Handler
(
const
QString
&
xdgUrl
,
const
qtlib
::
Config
&
config
,
QObject
*
parent
=
0
);
signals:
void
started
();
void
finishedWithSuccess
(
const
QJsonObject
&
result
);
void
finishedWithError
(
const
QJsonObject
&
result
);
void
downloadProgress
(
const
qint64
&
bytesReceived
,
const
qint64
&
bytesTotal
);
void
finishedWithSuccess
(
QJsonObject
result
);
void
finishedWithError
(
QJsonObject
result
);
void
downloadProgress
(
QString
id
,
qint64
bytesReceived
,
qint64
bytesTotal
);
public
slots
:
QString
xdgUrl
()
const
;
...
...
@@ -33,20 +31,17 @@ public slots:
void
openDestination
();
private
slots
:
void
networkResourceFinished
(
qtlib
s
::
NetworkResource
*
resource
);
void
networkResourceFinished
(
qtlib
::
NetworkResource
*
resource
);
private:
void
parse
();
void
loadDestinations
();
QString
convertPathString
(
const
QString
&
path
);
void
saveDownloadedFile
(
qtlib
s
::
NetworkResource
*
resource
);
void
installDownloadedFile
(
qtlib
s
::
NetworkResource
*
resource
);
void
saveDownloadedFile
(
qtlib
::
NetworkResource
*
resource
);
void
installDownloadedFile
(
qtlib
::
NetworkResource
*
resource
);
QString
xdgUrl_
;
qtlib
s
::
Config
config_
;
qtlib
::
Config
config_
;
QJsonObject
metadata_
;
QJsonObject
destinations_
;
QString
destination_
;
};
}
// namespace handlers
src/app/main.cpp
View file @
3a3ee907
#include
<QtGlobal>
//
#include <QtGlobal>
#include
<QString>
#include
<QStringList>
#include
<QUrl>
#include
<QJsonObject>
#include
<QCommandLineParser>
#include
<QCoreApplication>
//
#include <QCoreApplication>
#include
<QGuiApplication>
#include
<QIcon>
#include
<QQmlApplicationEngine>
#include
<QQmlContext>
#include
"qtlib
s/
config.h"
#include
"qtlib
_
config.h"
#include
"handlers/xdgurl.h"
#include
"handlers/xdgurl
handler
.h"
int
main
(
int
argc
,
char
*
argv
[])
{
// Init
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
#endif
//
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
//
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
//
#endif
QGuiApplication
app
(
argc
,
argv
);
qtlib
s
::
Config
config
(
":/configs"
);
qtlib
::
Config
config
(
":/configs"
);
QJsonObject
configApplication
=
config
.
get
(
"application"
);
app
.
setApplicationName
(
configApplication
[
"name"
].
toString
());
...
...
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
// Setup QML
QQmlApplicationEngine
qmlAppEngine
;
QQmlContext
*
qmlContext
=
qmlAppEngine
.
rootContext
();
qmlContext
->
setContextProperty
(
"xdgUrlHandler"
,
new
handlers
::
XdgUrl
(
xdgUrl
,
config
,
&
qmlAppEngine
));
qmlContext
->
setContextProperty
(
"xdgUrlHandler"
,
new
XdgUrlHandler
(
xdgUrl
,
config
,
&
qmlAppEngine
));
qmlAppEngine
.
load
(
QUrl
(
"qrc:/qml/main.qml"
));
return
app
.
exec
();
...
...
src/app/qml/main.qml
View file @
3a3ee907
...
...
@@ -3,10 +3,10 @@ import QtQuick.Window 2.0
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
'
scripts/Utility.js
'
as
Utility
import
"
scripts/Utility.js
"
as
Utility
Window
{
id
:
root
id
:
app
title
:
Qt
.
application
.
name
width
:
400
height
:
200
...
...
@@ -17,11 +17,11 @@ Window {
MessageDialog
{
id
:
confirmDialog
title
:
root
.
title
title
:
app
.
title
icon
:
StandardIcon
.
Question
text
:
''
informativeText
:
''
detailedText
:
''
text
:
""
informativeText
:
""
detailedText
:
""
standardButtons
:
StandardButton
.
Ok
|
StandardButton
.
Cancel
onAccepted
:
xdgUrlHandler
.
process
()
onRejected
:
Qt
.
quit
()
...
...
@@ -29,11 +29,11 @@ Window {
MessageDialog
{
id
:
infoDialog
title
:
root
.
title
title
:
app
.
title
icon
:
StandardIcon
.
Information
text
:
''
informativeText
:
''
detailedText
:
''
text
:
""
informativeText
:
""
detailedText
:
""
standardButtons
:
StandardButton
.
Open
|
StandardButton
.
Close
onAccepted
:
{
xdgUrlHandler
.
openDestination
();
...
...
@@ -44,18 +44,22 @@ Window {
MessageDialog
{
id
:
errorDialog
title
:
root
.
title
title
:
app
.
title
icon
:
StandardIcon
.
Warning
text
:
''
informativeText
:
''
detailedText
:
''
text
:
""
informativeText
:
""
detailedText
:
""
standardButtons
:
StandardButton
.
Close
onRejected
:
Qt
.
quit
()
}
Dialog
{
id
:
progressDialog
title
:
root
.
title
title
:
app
.
title
property
alias
primaryLabel
:
primaryLabel
property
alias
informativeLabel
:
informativeLabel
property
alias
progressBar
:
progressBar
property
alias
progressLabel
:
progressLabel
contentItem
:
Item
{
implicitWidth
:
400
implicitHeight
:
150
...
...
@@ -65,12 +69,12 @@ Window {
spacing
:
8
Label
{
id
:
primaryLabel
text
:
''
text
:
"
"
font.bold
:
true
}
Label
{
id
:
informativeLabel
text
:
''
text
:
"
"
}
ProgressBar
{
id
:
progressBar
...
...
@@ -82,32 +86,28 @@ Window {
}
Label
{
id
:
progressLabel
text
:
''
text
:
"
"
anchors.right
:
parent
.
right
}
Button
{
id
:
cancelButton
text
:
'
Cancel
'
text
:
"
Cancel
"
anchors.right
:
parent
.
right
onClicked
:
Qt
.
quit
()
}
}
}
property
alias
primaryLabel
:
primaryLabel
property
alias
informativeLabel
:
informativeLabel
property
alias
progressBar
:
progressBar
property
alias
progressLabel
:
progressLabel
}
Component.onCompleted
:
{
var
metadata
=
xdgUrlHandler
.
metadata
();
var
primaryMessages
=
{
'
success_download
'
:
'
Download successfull
'
,
'
success_install
'
:
'
Installation successfull
'
,
'
error_validation
'
:
'
Validation error
'
,
'
error_network
'
:
'
Network error
'
,
'
error_save
'
:
'
Saving file failed
'
,
'
error_install
'
:
'
Installation failed
'
"
success_download
"
:
"
Download successfull
"
,
"
success_install
"
:
"
Installation successfull
"
,
"
error_validation
"
:
"
Validation error
"
,
"
error_network
"
:
"
Network error
"
,
"
error_save
"
:
"
Saving file failed
"
,
"
error_install
"
:
"
Installation failed
"
};
xdgUrlHandler
.
started
.
connect
(
function
()
{
...
...
@@ -130,25 +130,25 @@ Window {
errorDialog
.
open
();
});
xdgUrlHandler
.
downloadProgress
.
connect
(
function
(
bytesReceived
,
bytesTotal
)
{
progressDialog
.
primaryLabel
.
text
=
'
Downloading...
'
;
xdgUrlHandler
.
downloadProgress
.
connect
(
function
(
id
,
bytesReceived
,
bytesTotal
)
{
progressDialog
.
primaryLabel
.
text
=
"
Downloading...
"
;
progressDialog
.
informativeLabel
.
text
=
metadata
.
filename
;
progressDialog
.
progressBar
.
value
=
bytesReceived
/
bytesTotal
;
progressDialog
.
progressLabel
.
text
=
Utility
.
convertByteToHumanReadable
(
bytesReceived
)
+
'
/
'
+
Utility
.
convertByteToHumanReadable
(
bytesTotal
)
+
"
/
"
+
Utility
.
convertByteToHumanReadable
(
bytesTotal
)
});
if
(
xdgUrlHandler
.
isValid
())
{
confirmDialog
.
text
=
'
Do you want to
'
+
metadata
.
command
+
'
?
'
;
confirmDialog
.
text
=
"
Do you want to
"
+
metadata
.
command
+
"
?
"
;
confirmDialog
.
informativeText
=
metadata
.
filename
;
confirmDialog
.
detailedText
=
'
URL:
'
+
metadata
.
url
+
'
\n\n
'
+
'
File:
'
+
metadata
.
filename
+
'
\n\n
'
+
'
Type:
'
+
metadata
.
type
;
confirmDialog
.
detailedText
=
"
URL:
"
+
metadata
.
url
+
"
\n\n
"