Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask-vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Merlin
bitmask-vpn
Commits
82ee9e4e
Unverified
Commit
82ee9e4e
authored
4 years ago
by
Kali Kaneko
Browse files
Options
Downloads
Patches
Plain Diff
[style] formatting
we should try to use qmlfmt, indeed
parent
7af4d63e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gui/qjsonmodel.cpp
+8
-8
8 additions, 8 deletions
gui/qjsonmodel.cpp
gui/qml/main.qml
+25
-25
25 additions, 25 deletions
gui/qml/main.qml
with
33 additions
and
33 deletions
gui/qjsonmodel.cpp
+
8
−
8
View file @
82ee9e4e
...
...
@@ -211,7 +211,7 @@ bool QJsonModel::loadJson(const QByteArray &json)
if
(
!
jdoc
.
isNull
())
{
beginResetModel
();
delete
mRootItem
;
delete
mRootItem
;
if
(
jdoc
.
isArray
())
{
mRootItem
=
QJsonTreeItem
::
load
(
QJsonValue
(
jdoc
.
array
()));
...
...
@@ -228,7 +228,7 @@ bool QJsonModel::loadJson(const QByteArray &json)
if
(
!
ok
)
{
qDebug
()
<<
Q_FUNC_INFO
<<
"ERROR: cannot load json"
;
qDebug
()
<<
Q_FUNC_INFO
<<
"ERROR: cannot load json"
;
}
mtx
.
unlock
();
...
...
@@ -250,12 +250,12 @@ QVariant QJsonModel::data(const QModelIndex &index, int role) const
case
Roles
::
ValueRole
:
return
item
->
value
();
case
Qt
::
DisplayRole
:
{
if
(
index
.
column
()
==
0
)
return
QString
(
"%1"
).
arg
(
item
->
key
());
else
if
(
index
.
column
()
==
1
)
return
QString
(
"%1"
).
arg
(
item
->
value
());
else
return
QString
(
""
);
if
(
index
.
column
()
==
0
)
return
QString
(
"%1"
).
arg
(
item
->
key
());
else
if
(
index
.
column
()
==
1
)
return
QString
(
"%1"
).
arg
(
item
->
value
());
else
return
QString
(
""
);
}
case
Qt
::
EditRole
:
{
if
(
index
.
column
()
==
1
)
...
...
This diff is collapsed.
Click to expand it.
gui/qml/main.qml
+
25
−
25
View file @
82ee9e4e
...
...
@@ -49,30 +49,30 @@ ApplicationWindow {
}
function
showInitFailure
(
msg
)
{
console
.
debug
(
"
ERRORS:
"
,
ctx
.
errors
)
if
(
msg
==
undefined
)
{
if
(
ctx
.
errors
==
'
bad_auth_502
'
||
ctx
.
errors
==
'
bad_auth_timeout
'
)
{
msg
=
qsTr
(
"
Oops! The authentication service seems down. Please try again later
"
)
initFailure
.
title
=
qsTr
(
"
Service Error
"
)
}
else
if
(
ctx
.
errors
==
'
bad_auth
'
)
{
if
(
allowEmptyPass
)
{
// For now, this is a libraryVPN, so we can be explicit about what credentials are here.
// Another option to consider is to customize the error strings while vendoring.
//: Incorrect library card number
msg
=
qsTr
(
"
Please check your Patron ID
"
)
}
else
{
msg
=
qsTr
(
"
Could not log in with those credentials, please retry
"
)
}
initFailure
.
title
=
qsTr
(
"
Login Error
"
)
}
else
{
//: %1 -> application name
//: %2 -> error string
msg
=
qsTr
(
"
Got an error starting %1: %2
"
).
arg
(
ctx
.
appName
).
arg
(
ctx
.
errors
)
}
}
initFailure
.
text
=
msg
initFailure
.
visible
=
true
console
.
debug
(
"
ERRORS:
"
,
ctx
.
errors
)
if
(
msg
==
undefined
)
{
if
(
ctx
.
errors
==
'
bad_auth_502
'
||
ctx
.
errors
==
'
bad_auth_timeout
'
)
{
msg
=
qsTr
(
"
Oops! The authentication service seems down. Please try again later
"
)
initFailure
.
title
=
qsTr
(
"
Service Error
"
)
}
else
if
(
ctx
.
errors
==
'
bad_auth
'
)
{
if
(
allowEmptyPass
)
{
// For now, this is a libraryVPN, so we can be explicit about what credentials are here.
// Another option to consider is to customize the error strings while vendoring.
//: Incorrect library card number
msg
=
qsTr
(
"
Please check your Patron ID
"
)
}
else
{
msg
=
qsTr
(
"
Could not log in with those credentials, please retry
"
)
}
initFailure
.
title
=
qsTr
(
"
Login Error
"
)
}
else
{
//: %1 -> application name
//: %2 -> error string
msg
=
qsTr
(
"
Got an error starting %1: %2
"
).
arg
(
ctx
.
appName
).
arg
(
ctx
.
errors
)
}
}
initFailure
.
text
=
msg
initFailure
.
visible
=
true
}
function
shouldAllowEmptyPass
()
{
...
...
@@ -124,7 +124,7 @@ ApplicationWindow {
"
wait
"
:
"
qrc:/assets/icon/png/black/vpn_wait_0.png
"
,
"
blocked
"
:
"
qrc:/assets/icon/png/black/vpn_blocked.png
"
,
}
SystemTrayIcon
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment