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
fed3f95f
"git@git.duniter.org:clients/wotwizard-ui.git" did not exist on "302c392b4e5b5d708f3f4f37448f0cf07313793e"
Commit
fed3f95f
authored
11 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Delete node from community
parent
258c7dc6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
res/ui/communityConfigurationDialog.ui
+22
-1
22 additions, 1 deletion
res/ui/communityConfigurationDialog.ui
src/cutecoin/gui/configureCommunityDialog.py
+15
-1
15 additions, 1 deletion
src/cutecoin/gui/configureCommunityDialog.py
with
37 additions
and
2 deletions
res/ui/communityConfigurationDialog.ui
+
22
−
1
View file @
fed3f95f
...
@@ -24,7 +24,11 @@
...
@@ -24,7 +24,11 @@
</property>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<item>
<item>
<widget
class=
"QTreeView"
name=
"communityView"
/>
<widget
class=
"QTreeView"
name=
"communityView"
>
<property
name=
"contextMenuPolicy"
>
<enum>
Qt::CustomContextMenu
</enum>
</property>
</widget>
</item>
</item>
<item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
...
@@ -125,8 +129,25 @@
...
@@ -125,8 +129,25 @@
</hint>
</hint>
</hints>
</hints>
</connection>
</connection>
<connection>
<sender>
communityView
</sender>
<signal>
customContextMenuRequested(QPoint)
</signal>
<receiver>
CommunityConfigurationDialog
</receiver>
<slot>
showContextMenu(QPoint)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
199
</x>
<y>
128
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
199
</x>
<y>
149
</y>
</hint>
</hints>
</connection>
</connections>
</connections>
<slots>
<slots>
<slot>
addNode()
</slot>
<slot>
addNode()
</slot>
<slot>
showContextMenu(QPoint)
</slot>
</slots>
</slots>
</ui>
</ui>
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/configureCommunityDialog.py
+
15
−
1
View file @
fed3f95f
...
@@ -4,7 +4,7 @@ Created on 8 mars 2014
...
@@ -4,7 +4,7 @@ Created on 8 mars 2014
@author: inso
@author: inso
'''
'''
from
cutecoin.gen_resources.communityConfigurationDialog_uic
import
Ui_CommunityConfigurationDialog
from
cutecoin.gen_resources.communityConfigurationDialog_uic
import
Ui_CommunityConfigurationDialog
from
PyQt5.QtWidgets
import
QDialog
,
QErrorMessage
from
PyQt5.QtWidgets
import
QDialog
,
QErrorMessage
,
QMenu
from
cutecoin.models.community.treeModel
import
CommunityTreeModel
from
cutecoin.models.community.treeModel
import
CommunityTreeModel
from
cutecoin.models.node
import
TrustedNode
from
cutecoin.models.node
import
TrustedNode
from
cutecoin.core.exceptions
import
NotMemberOfCommunityError
from
cutecoin.core.exceptions
import
NotMemberOfCommunityError
...
@@ -52,6 +52,20 @@ class ConfigureCommunityDialog(QDialog, Ui_CommunityConfigurationDialog):
...
@@ -52,6 +52,20 @@ class ConfigureCommunityDialog(QDialog, Ui_CommunityConfigurationDialog):
self
.
community
.
addTrustedNode
(
TrustedNode
(
server
,
port
))
self
.
community
.
addTrustedNode
(
TrustedNode
(
server
,
port
))
self
.
communityView
.
setModel
(
CommunityTreeModel
(
self
.
community
))
self
.
communityView
.
setModel
(
CommunityTreeModel
(
self
.
community
))
def
showContextMenu
(
self
,
point
):
menu
=
QMenu
()
action
=
menu
.
addAction
(
"
Delete
"
,
self
.
removeNode
)
if
self
.
community
is
not
None
:
if
len
(
self
.
community
.
trustedNodes
)
==
1
:
action
.
setEnabled
(
False
)
menu
.
exec_
(
self
.
communityView
.
mapToGlobal
(
point
))
def
removeNode
(
self
):
for
index
in
self
.
communityView
.
selectedIndexes
():
self
.
community
.
trustedNodes
.
pop
(
index
.
row
())
self
.
communityView
.
setModel
(
CommunityTreeModel
(
self
.
community
))
def
accept
(
self
):
def
accept
(
self
):
self
.
close
()
self
.
close
()
...
...
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