Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
05ea62a8
Commit
05ea62a8
authored
5 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
[enh]
#798
source automatically checked when opening transfer dialog
parent
5d2df929
No related branches found
No related tags found
1 merge request
!778
Release 0.51.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sakia/gui/sub/transfer/controller.py
+29
-4
29 additions, 4 deletions
src/sakia/gui/sub/transfer/controller.py
with
29 additions
and
4 deletions
src/sakia/gui/sub/transfer/controller.py
+
29
−
4
View file @
05ea62a8
...
@@ -53,7 +53,7 @@ class TransferController(QObject):
...
@@ -53,7 +53,7 @@ class TransferController(QObject):
)
)
self
.
view
.
spinbox_amount
.
valueChanged
.
connect
(
self
.
handle_amount_change
)
self
.
view
.
spinbox_amount
.
valueChanged
.
connect
(
self
.
handle_amount_change
)
self
.
view
.
spinbox_relative
.
valueChanged
.
connect
(
self
.
handle_relative_change
)
self
.
view
.
spinbox_relative
.
valueChanged
.
connect
(
self
.
handle_relative_change
)
self
.
view
.
button_source_check
.
clicked
.
connect
(
self
.
check_source
)
self
.
view
.
button_source_check
.
clicked
.
connect
(
self
.
check_source
_dialog
)
@classmethod
@classmethod
def
create
(
cls
,
parent
,
app
):
def
create
(
cls
,
parent
,
app
):
...
@@ -117,7 +117,11 @@ class TransferController(QObject):
...
@@ -117,7 +117,11 @@ class TransferController(QObject):
controller
.
set_amount_value
(
source
.
amount
,
source
.
base
)
controller
.
set_amount_value
(
source
.
amount
,
source
.
base
)
controller
.
view
.
spinbox_amount
.
setDisabled
(
True
)
controller
.
view
.
spinbox_amount
.
setDisabled
(
True
)
controller
.
view
.
spinbox_relative
.
setDisabled
(
True
)
controller
.
view
.
spinbox_relative
.
setDisabled
(
True
)
controller
.
view
.
button_source_check
.
setEnabled
(
True
)
result
,
_
=
controller
.
check_source
(
source
)
# by default, source is unlocked, if not...
if
not
result
:
# enabled the check button to open the errors dialog
controller
.
view
.
button_source_check
.
setEnabled
(
True
)
else
:
else
:
controller
.
view
.
widget_source
.
hide
()
controller
.
view
.
widget_source
.
hide
()
...
@@ -326,9 +330,19 @@ class TransferController(QObject):
...
@@ -326,9 +330,19 @@ class TransferController(QObject):
self
.
password_input
.
set_connection
(
self
.
model
.
connection
)
self
.
password_input
.
set_connection
(
self
.
model
.
connection
)
self
.
refresh
()
self
.
refresh
()
def
check_source
(
self
):
def
check_source
(
self
,
source
):
"""
Check source conditions lock status
Return a tupple with :
result: bool,
errors: list of tuples
[(condition: str, message: str, info: int|str),...]
:param source:
:return tuple:
"""
# evaluate condition
# evaluate condition
source
=
self
.
model
.
current_source
condition
=
pypeg2
.
parse
(
source
.
conditions
,
Condition
)
condition
=
pypeg2
.
parse
(
source
.
conditions
,
Condition
)
result
,
_errors
=
self
.
model
.
app
.
sources_service
.
evaluate_condition
(
result
,
_errors
=
self
.
model
.
app
.
sources_service
.
evaluate_condition
(
self
.
model
.
app
.
currency
,
self
.
model
.
app
.
currency
,
...
@@ -337,6 +351,17 @@ class TransferController(QObject):
...
@@ -337,6 +351,17 @@ class TransferController(QObject):
[],
[],
source
.
identifier
,
source
.
identifier
,
)
)
return
result
,
_errors
def
check_source_dialog
(
self
):
"""
Open check source result and errors dialog
:return:
"""
source
=
self
.
model
.
current_source
result
,
_errors
=
self
.
check_source
(
source
)
# if success...
# if success...
if
result
:
if
result
:
message
=
QCoreApplication
.
translate
(
message
=
QCoreApplication
.
translate
(
...
...
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