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
3fbd5951
Commit
3fbd5951
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Contextmenu enabled for members table
parent
a915499a
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
src/cutecoin/gui/community_tab.py
+12
-4
12 additions, 4 deletions
src/cutecoin/gui/community_tab.py
src/cutecoin/gui/currency_tab.py
+3
-2
3 additions, 2 deletions
src/cutecoin/gui/currency_tab.py
with
15 additions
and
6 deletions
src/cutecoin/gui/community_tab.py
+
12
−
4
View file @
3fbd5951
...
...
@@ -7,7 +7,8 @@ Created on 2 févr. 2014
import
logging
from
PyQt5.QtCore
import
Qt
from
PyQt5.QtGui
import
QIcon
from
PyQt5.QtWidgets
import
QWidget
,
QMessageBox
,
QAction
,
QMenu
,
QDialog
,
QLineEdit
from
PyQt5.QtWidgets
import
QWidget
,
QMessageBox
,
QAction
,
QMenu
,
QDialog
,
\
QAbstractItemView
from
..models.members
import
MembersFilterProxyModel
,
MembersTableModel
from
..gen_resources.community_tab_uic
import
Ui_CommunityTabWidget
from
.add_contact
import
AddContactDialog
...
...
@@ -15,6 +16,7 @@ from .wot_tab import WotTabWidget
from
.transfer
import
TransferMoneyDialog
from
.password_asker
import
PasswordAskerDialog
from
.certification
import
CertificationDialog
from
..core.person
import
Person
from
..tools.exceptions
import
PersonNotFoundError
,
NoPeerAvailable
...
...
@@ -37,6 +39,8 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
proxy_members
=
MembersFilterProxyModel
()
proxy_members
.
setSourceModel
(
members_model
)
self
.
table_community_members
.
setModel
(
proxy_members
)
self
.
table_community_members
.
setSelectionBehavior
(
QAbstractItemView
.
SelectRows
)
self
.
table_community_members
.
customContextMenuRequested
.
connect
(
self
.
member_context_menu
)
if
self
.
account
.
member_of
(
self
.
community
):
self
.
button_membership
.
setText
(
"
Renew membership
"
)
...
...
@@ -52,9 +56,13 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
def
member_context_menu
(
self
,
point
):
index
=
self
.
table_community_members
.
indexAt
(
point
)
model
=
self
.
table_community_members
.
model
()
if
index
.
row
()
<
model
.
rowCount
(
None
):
member
=
model
.
members
[
index
.
row
()]
logging
.
debug
(
member
)
if
index
.
row
()
<
model
.
rowCount
():
source_index
=
model
.
mapToSource
(
index
)
pubkey_col
=
model
.
sourceModel
().
columns
.
index
(
'
Pubkey
'
)
pubkey_index
=
model
.
sourceModel
().
index
(
source_index
.
row
(),
pubkey_col
)
pubkey
=
model
.
sourceModel
().
data
(
pubkey_index
,
Qt
.
DisplayRole
)
member
=
Person
.
lookup
(
pubkey
,
self
.
community
)
menu
=
QMenu
(
model
.
data
(
index
,
Qt
.
DisplayRole
),
self
)
add_contact
=
QAction
(
"
Add as contact
"
,
self
)
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/currency_tab.py
+
3
−
2
View file @
3fbd5951
...
...
@@ -10,7 +10,7 @@ import requests
from
ucoinpy.api
import
bma
from
PyQt5.QtWidgets
import
QWidget
,
QMenu
,
QAction
,
QApplication
,
\
QMessageBox
,
QDialog
QMessageBox
,
QDialog
,
QAbstractItemView
from
PyQt5.QtCore
import
QModelIndex
,
Qt
,
pyqtSlot
,
QObject
,
\
QThread
,
pyqtSignal
,
QDateTime
from
PyQt5.QtGui
import
QIcon
...
...
@@ -119,6 +119,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
proxy
.
setSortRole
(
Qt
.
DisplayRole
)
self
.
table_history
.
setModel
(
proxy
)
self
.
table_history
.
setSelectionBehavior
(
QAbstractItemView
.
SelectRows
)
self
.
table_history
.
setSortingEnabled
(
True
)
self
.
tab_community
=
CommunityTabWidget
(
self
.
app
.
current_account
,
...
...
@@ -202,7 +203,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
index
=
self
.
table_history
.
indexAt
(
point
)
model
=
self
.
table_history
.
model
()
if
index
.
row
()
<
model
.
rowCount
(
QModelIndex
()):
menu
=
QMenu
(
model
.
data
(
index
,
Qt
.
DisplayRole
)
,
self
)
menu
=
QMenu
(
"
Actions
"
,
self
)
source_index
=
model
.
mapToSource
(
index
)
state_col
=
model
.
sourceModel
().
columns
.
index
(
'
State
'
)
state_index
=
model
.
sourceModel
().
index
(
source_index
.
row
(),
...
...
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