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
Snippets
Deploy
Releases
Container Registry
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
Show more breadcrumbs
Santiago
sakia
Commits
950489cf
Commit
950489cf
authored
10 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
Membership expiration alert on opening currency tab, not at each block refresh
parent
371493c8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cutecoin/gui/currency_tab.py
+19
-18
19 additions, 18 deletions
src/cutecoin/gui/currency_tab.py
with
19 additions
and
18 deletions
src/cutecoin/gui/currency_tab.py
+
19
−
18
View file @
950489cf
...
...
@@ -92,6 +92,25 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
self
.
watcher_thread
.
start
()
person
=
Person
.
lookup
(
self
.
app
.
current_account
.
pubkey
,
self
.
community
)
join_block
=
person
.
membership
(
self
.
community
).
block_number
join_date
=
self
.
community
.
get_block
(
join_block
).
mediantime
parameters
=
self
.
community
.
get_parameters
()
expiration_date
=
join_date
+
parameters
[
'
sigValidity
'
]
current_time
=
time
.
time
()
sig_validity
=
self
.
community
.
get_parameters
()[
'
sigValidity
'
]
warning_expiration_time
=
int
(
sig_validity
/
3
)
will_expire_soon
=
(
current_time
>
expiration_date
-
warning_expiration_time
)
if
will_expire_soon
:
days
=
QDateTime
().
currentDateTime
().
daysTo
(
QDateTime
.
fromTime_t
(
expiration_date
))
QMessageBox
.
warning
(
self
,
"
Membership expiration
"
,
"
Warning : Membership expiration in {0} days
"
.
format
(
days
),
QMessageBox
.
Ok
)
def
refresh
(
self
):
if
self
.
app
.
current_account
is
None
:
self
.
tabs_account
.
setEnabled
(
False
)
...
...
@@ -171,27 +190,9 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
QModelIndex
(),
[])
person
=
Person
.
lookup
(
self
.
app
.
current_account
.
pubkey
,
self
.
community
)
join_block
=
person
.
membership
(
self
.
community
).
block_number
join_date
=
self
.
community
.
get_block
(
join_block
).
mediantime
parameters
=
self
.
community
.
get_parameters
()
expiration_date
=
join_date
+
parameters
[
'
sigValidity
'
]
current_time
=
time
.
time
()
sig_validity
=
self
.
community
.
get_parameters
()[
'
sigValidity
'
]
warning_expiration_time
=
int
(
sig_validity
/
3
)
will_expire_soon
=
(
current_time
>
expiration_date
-
warning_expiration_time
)
text
=
"
Connected : Block {0}
"
.
format
(
block_number
)
self
.
status_label
.
setText
(
text
)
if
will_expire_soon
:
days
=
QDateTime
().
currentDateTime
().
daysTo
(
QDateTime
.
fromTime_t
(
expiration_date
))
QMessageBox
.
warning
(
self
,
"
Membership expiration
"
,
"
Warning : Membership expiration in {0} days
"
.
format
(
days
),
QMessageBox
.
Ok
)
def
refresh_wallets
(
self
):
if
self
.
app
.
current_account
:
wallets_list_model
=
WalletsListModel
(
self
.
app
.
current_account
,
...
...
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