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
5ff086b9
Commit
5ff086b9
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Added renew membership + warning when leaving a community
parent
c616f262
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
res/ui/community_tab.ui
+26
-6
26 additions, 6 deletions
res/ui/community_tab.ui
src/cutecoin/gui/community_tab.py
+28
-23
28 additions, 23 deletions
src/cutecoin/gui/community_tab.py
src/cutecoin/gui/process_cfg_community.py
+3
-3
3 additions, 3 deletions
src/cutecoin/gui/process_cfg_community.py
with
57 additions
and
32 deletions
res/ui/community_tab.ui
+
26
−
6
View file @
5ff086b9
...
...
@@ -57,6 +57,19 @@
<property
name=
"topMargin"
>
<number>
5
</number>
</property>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_quality"
>
<property
name=
"text"
>
...
...
@@ -67,7 +80,14 @@
<item>
<widget
class=
"QPushButton"
name=
"button_membership"
>
<property
name=
"text"
>
<string>
Send membership demand
</string>
<string>
Renew membership
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"button_leaving"
>
<property
name=
"text"
>
<string>
Send leaving demand
</string>
</property>
</widget>
</item>
...
...
@@ -92,8 +112,8 @@
<slot>
send_membership_demand()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
289
</x>
<y>
277
</y>
<x>
198
</x>
<y>
335
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
199
</x>
...
...
@@ -102,14 +122,14 @@
</hints>
</connection>
<connection>
<sender>
button_
membership
</sender>
<sender>
button_
leaving
</sender>
<signal>
clicked()
</signal>
<receiver>
CommunityTabWidget
</receiver>
<slot>
send_membership_leaving()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
289
</x>
<y>
277
</y>
<x>
338
</x>
<y>
335
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
199
</x>
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/community_tab.py
+
28
−
23
View file @
5ff086b9
...
...
@@ -13,6 +13,7 @@ from ..gen_resources.community_tab_uic import Ui_CommunityTabWidget
from
.add_contact
import
AddContactDialog
from
.wot_tab
import
WotTabWidget
from
.transfer
import
TransferMoneyDialog
from
.password_asker
import
PasswordAskerDialog
from
.certification
import
CertificationDialog
from
..tools.exceptions
import
PersonNotFoundError
,
NoPeerAvailable
...
...
@@ -33,14 +34,12 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
self
.
account
=
account
self
.
password_asker
=
password_asker
self
.
list_community_members
.
setModel
(
MembersListModel
(
community
))
self
.
button_membership
.
disconnect
()
if
self
.
account
.
member_of
(
self
.
community
):
self
.
button_membership
.
setText
(
"
Send leaving demand
"
)
self
.
button_membership
.
clicked
.
connect
(
self
.
send_membership_leaving
)
self
.
button_membership
.
setText
(
"
Renew membership
"
)
else
:
self
.
button_membership
.
setText
(
"
Send membership demand
"
)
self
.
button_
membership
.
clicked
.
connect
(
self
.
send_membership_demand
)
self
.
button_
leaving
.
hide
(
)
self
.
tabs_information
.
addTab
(
WotTabWidget
(
account
,
community
,
password_asker
),
...
...
@@ -121,23 +120,29 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
QMessageBox
.
Ok
)
def
send_membership_leaving
(
self
):
password
=
self
.
password_asker
.
ask
()
if
password
==
""
:
return
try
:
self
.
account
.
send_membership
(
password
,
self
.
community
,
'
OUT
'
)
QMessageBox
.
information
(
self
,
"
Membership
"
,
"
Success sending leaving demand
"
)
except
ValueError
as
e
:
QMessageBox
.
critical
(
self
,
"
Leaving demand error
"
,
e
.
message
)
except
NoPeerAvailable
as
e
:
QMessageBox
.
critical
(
self
,
"
Network error
"
,
"
Couldn
'
t connect to network : {0}
"
.
format
(
e
),
QMessageBox
.
Ok
)
except
Exception
as
e
:
QMessageBox
.
critical
(
self
,
"
Error
"
,
"
{0}
"
.
format
(
e
),
QMessageBox
.
Ok
)
reply
=
QMessageBox
.
warning
(
self
,
"
Warning
"
,
"""
Are you sure ?
Sending a membership demand cannot be canceled.
The process to join back the community later will have to be done again.
"""
.
format
(
self
.
account
.
pubkey
),
QMessageBox
.
Ok
|
QMessageBox
.
Cancel
)
if
reply
==
QMessageBox
.
Ok
:
password
=
PasswordAskerDialog
(
self
.
app
.
current_account
).
ask
()
if
password
==
""
:
return
try
:
self
.
account
.
send_membership
(
password
,
self
.
community
,
'
OUT
'
)
QMessageBox
.
information
(
self
,
"
Membership
"
,
"
Success sending leaving demand
"
)
except
ValueError
as
e
:
QMessageBox
.
critical
(
self
,
"
Leaving demand error
"
,
e
.
message
)
except
NoPeerAvailable
as
e
:
QMessageBox
.
critical
(
self
,
"
Network error
"
,
"
Couldn
'
t connect to network : {0}
"
.
format
(
e
),
QMessageBox
.
Ok
)
except
Exception
as
e
:
QMessageBox
.
critical
(
self
,
"
Error
"
,
"
{0}
"
.
format
(
e
),
QMessageBox
.
Ok
)
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/process_cfg_community.py
+
3
−
3
View file @
5ff086b9
...
...
@@ -175,9 +175,9 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog):
Person
.
lookup
(
self
.
account
.
pubkey
,
self
.
community
,
cached
=
False
)
except
PersonNotFoundError
as
e
:
reply
=
QMessageBox
.
question
(
self
,
"
Pubkey not found
"
,
"
The public key of your account wasn
'
t found in the community. :
\n
\
{0}
\n
\
Would you like to publish the key ?
"
.
format
(
self
.
account
.
pubkey
))
""
"
The public key of your account wasn
'
t found in the community. :
\n
{0}
\n
Would you like to publish the key ?
"
""
.
format
(
self
.
account
.
pubkey
))
if
reply
==
QMessageBox
.
Yes
:
password
=
self
.
password_asker
.
ask
()
if
password
==
""
:
...
...
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