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
303f42f8
Commit
303f42f8
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Call change_community in search_user and member
parent
5abd05e7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sakia/gui/certification.py
+5
-2
5 additions, 2 deletions
src/sakia/gui/certification.py
src/sakia/gui/mainwindow.py
+1
-0
1 addition, 0 deletions
src/sakia/gui/mainwindow.py
src/sakia/gui/member.py
+30
-14
30 additions, 14 deletions
src/sakia/gui/member.py
with
36 additions
and
16 deletions
src/sakia/gui/certification.py
+
5
−
2
View file @
303f42f8
...
...
@@ -73,15 +73,17 @@ class CertificationDialog(QObject):
self
.
ui
.
combo_community
.
currentIndexChanged
.
connect
(
self
.
change_current_community
)
@classmethod
def
open_dialog
(
cls
,
app
,
account
,
password_asker
):
def
open_dialog
(
cls
,
app
,
account
,
community
,
password_asker
):
"""
Certify and identity
:param sakia.core.Application app: the application
:param sakia.core.Account account: the account certifying the identity
:param sakia.core.Community community: the community
:param sakia.gui.password_asker.PasswordAsker password_asker: the password asker
:return:
"""
dialog
=
cls
(
app
,
account
,
password_asker
,
QDialog
(),
Ui_CertificationDialog
())
dialog
.
ui
.
combo_community
.
setCurrentText
(
community
.
name
)
return
dialog
.
exec
()
@classmethod
...
...
@@ -137,7 +139,8 @@ class CertificationDialog(QObject):
def
change_current_community
(
self
,
index
):
self
.
community
=
self
.
account
.
communities
[
index
]
self
.
ui
.
search_user
.
change_community
(
self
.
community
)
if
self
.
isVisible
():
self
.
ui
.
member_widget
.
change_community
(
self
.
community
)
if
self
.
widget
.
isVisible
():
self
.
refresh
()
def
selected_pubkey
(
self
):
...
...
This diff is collapsed.
Click to expand it.
src/sakia/gui/mainwindow.py
+
1
−
0
View file @
303f42f8
...
...
@@ -246,6 +246,7 @@ class MainWindow(QObject):
def
open_certification_dialog
(
self
):
CertificationDialog
.
open_dialog
(
self
.
app
,
self
.
account
,
self
.
community_view
.
community
,
self
.
password_asker
)
def
open_add_contact_dialog
(
self
):
...
...
This diff is collapsed.
Click to expand it.
src/sakia/gui/member.py
+
30
−
14
View file @
303f42f8
...
...
@@ -7,7 +7,7 @@ from ..core.graph import WoTGraph
from
.widgets.busy
import
Busy
from
..tools.decorators
import
asyncify
from
..gen_resources.member_uic
import
Ui_MemberView
from
..tools.exceptions
import
MembershipNotFoundError
from
..tools.exceptions
import
MembershipNotFoundError
,
LookupFailureError
,
NoPeerAvailable
class
MemberDialog
(
QObject
):
...
...
@@ -49,6 +49,14 @@ class MemberDialog(QObject):
def
as_widget
(
cls
,
parent_widget
,
app
,
account
,
community
,
identity
):
return
cls
(
app
,
account
,
community
,
identity
,
QWidget
(
parent_widget
),
Ui_MemberView
())
def
change_community
(
self
,
community
):
"""
Change current community
:param sakia.core.Community community: the new community
"""
self
.
community
=
community
self
.
refresh
()
@asyncify
async
def
refresh
(
self
):
if
self
.
identity
:
...
...
@@ -56,22 +64,30 @@ class MemberDialog(QObject):
self
.
ui
.
label_uid
.
setText
(
self
.
identity
.
uid
)
self
.
ui
.
label_properties
.
setText
(
""
)
try
:
join_date
=
await
self
.
identity
.
get_join_date
(
self
.
community
)
except
MembershipNotFoundError
:
join_date
=
None
identity_selfcert
=
await
self
.
identity
.
selfcert
(
self
.
community
)
publish_time
=
await
self
.
community
.
time
(
identity_selfcert
.
timestamp
.
number
)
join_date
=
await
self
.
identity
.
get_join_date
(
self
.
community
)
if
join_date
is
None
:
join_date
=
self
.
tr
(
'
not a member
'
)
else
:
join_date
=
datetime
.
datetime
.
fromtimestamp
(
join_date
).
strftime
(
"
%d/%m/%Y %I:%M
"
)
identity_selfcert
=
await
self
.
identity
.
selfcert
(
self
.
community
)
time
=
await
self
.
community
.
time
(
identity_selfcert
.
timestamp
.
number
)
except
MembershipNotFoundError
:
join_date
=
"
###
"
except
(
LookupFailureError
,
NoPeerAvailable
):
publish_time
=
None
join_date
=
"
###
"
if
publish_time
:
uid_publish_date
=
QLocale
.
toString
(
QLocale
(),
QDateTime
.
fromTime_t
(
time
),
QDateTime
.
fromTime_t
(
publish_
time
),
QLocale
.
dateTimeFormat
(
QLocale
(),
QLocale
.
ShortFormat
)
)
else
:
uid_publish_date
=
"
###
"
text
=
self
.
tr
(
"""
<table cellpadding=
"
5
"
>
...
...
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