Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
26ba728f
Commit
26ba728f
authored
Aug 30, 2016
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up some QAction related code
parent
7e121478
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
19 deletions
+13
-19
accounts.py
blink/accounts.py
+1
-2
chatwindow.py
blink/chatwindow.py
+2
-3
contacts.py
blink/contacts.py
+1
-1
mainwindow.py
blink/mainwindow.py
+6
-8
vncviewer.py
blink/screensharing/vncviewer.py
+2
-3
buttons.py
blink/widgets/buttons.py
+1
-2
No files found.
blink/accounts.py
View file @
26ba728f
...
...
@@ -709,9 +709,8 @@ class ServerToolsWindow(base_class, ui_class):
menu
.
clear
()
for
row
in
xrange
(
self
.
model
.
rowCount
()):
account_info
=
self
.
model
.
data
(
self
.
model
.
index
(
row
,
0
),
Qt
.
UserRole
)
action
=
QAction
(
account_info
.
name
,
self
)
action
=
menu
.
addAction
(
account_info
.
name
)
action
.
setData
(
account_info
.
account
)
menu
.
addAction
(
action
)
def
open_settings_page
(
self
,
account
):
view
=
self
.
tab_widget
.
currentWidget
()
...
...
blink/chatwindow.py
View file @
26ba728f
...
...
@@ -903,7 +903,6 @@ class VideoWidget(VideoSurface, ui_class):
self
.
mute_button
.
clicked
.
connect
(
self
.
_SH_MuteButtonClicked
)
self
.
hold_button
.
clicked
.
connect
(
self
.
_SH_HoldButtonClicked
)
self
.
close_button
.
clicked
.
connect
(
self
.
_SH_CloseButtonClicked
)
self
.
screenshots_folder_action
.
triggered
.
connect
(
self
.
_SH_ScreenshotsFolderActionTriggered
)
self
.
screenshot_button
.
customContextMenuRequested
.
connect
(
self
.
_SH_ScreenshotButtonContextMenuRequested
)
self
.
camera_preview
.
adjusted
.
connect
(
self
.
_SH_CameraPreviewAdjusted
)
self
.
detach_animation
.
finished
.
connect
(
self
.
_SH_DetachAnimationFinished
)
...
...
@@ -999,7 +998,7 @@ class VideoWidget(VideoSurface, ui_class):
self
.
close_button
.
setIcon
(
close_icon
)
self
.
screenshot_button_menu
=
QMenu
(
self
)
self
.
screenshot
s_folder_action
=
self
.
screenshot_button_menu
.
addAction
(
'Open screenshots folder'
)
self
.
screenshot
_button_menu
.
addAction
(
'Open screenshots folder'
,
self
.
_SH_ScreenshotsFolderActionTriggered
)
@
property
def
interactive
(
self
):
...
...
@@ -1370,7 +1369,7 @@ class VideoWidget(VideoSurface, ui_class):
if
not
self
.
isFullScreen
():
self
.
screenshot_button_menu
.
exec_
(
self
.
screenshot_button
.
mapToGlobal
(
pos
))
def
_SH_ScreenshotsFolderActionTriggered
(
self
,
pos
):
def
_SH_ScreenshotsFolderActionTriggered
(
self
):
settings
=
BlinkSettings
()
QDesktopServices
.
openUrl
(
QUrl
.
fromLocalFile
(
settings
.
screenshots_directory
.
normalized
))
...
...
blink/contacts.py
View file @
26ba728f
...
...
@@ -4510,7 +4510,7 @@ class ContactURITableView(QTableView):
super
(
ContactURITableView
,
self
)
.
__init__
(
parent
)
self
.
setItemDelegate
(
ContactURIDelegate
(
self
))
self
.
context_menu
=
QMenu
(
self
)
self
.
context_menu
.
addAction
(
QAction
(
"Delete"
,
self
,
triggered
=
self
.
_AH_DeleteSelection
)
)
self
.
context_menu
.
addAction
(
"Delete"
,
self
.
_AH_DeleteSelection
)
self
.
horizontalHeader
()
.
setSectionResizeMode
(
self
.
horizontalHeader
()
.
ResizeToContents
)
def
selectionChanged
(
self
,
selected
,
deselected
):
...
...
blink/mainwindow.py
View file @
26ba728f
...
...
@@ -97,8 +97,8 @@ class MainWindow(base_class, ui_class):
self
.
system_tray_icon
=
QSystemTrayIcon
(
QIcon
(
Resources
.
get
(
'icons/blink.png'
)),
self
)
self
.
system_tray_icon
.
activated
.
connect
(
self
.
_SH_SystemTrayIconActivated
)
menu
=
QMenu
(
self
)
menu
.
addAction
(
QAction
(
"Show"
,
self
,
triggered
=
self
.
_AH_SystemTrayShowWindow
)
)
menu
.
addAction
(
Q
Action
(
QIcon
(
Resources
.
get
(
'icons/application-exit.png'
)),
"Quit"
,
self
,
triggered
=
self
.
_AH_QuitActionTriggered
)
)
menu
.
addAction
(
"Show"
,
self
.
_AH_SystemTrayShowWindow
)
menu
.
addAction
(
Q
Icon
(
Resources
.
get
(
'icons/application-exit.png'
)),
"Quit"
,
self
.
_AH_QuitActionTriggered
)
self
.
system_tray_icon
.
setContextMenu
(
menu
)
self
.
system_tray_icon
.
show
()
else
:
...
...
@@ -220,10 +220,8 @@ class MainWindow(base_class, ui_class):
self
.
alert_devices_group
=
QActionGroup
(
self
)
self
.
video_devices_group
=
QActionGroup
(
self
)
self
.
request_screen_action
=
QAction
(
'Request screen'
,
self
,
triggered
=
self
.
_AH_RequestScreenActionTriggered
)
self
.
share_my_screen_action
=
QAction
(
'Share my screen'
,
self
,
triggered
=
self
.
_AH_ShareMyScreenActionTriggered
)
self
.
screen_sharing_button
.
addAction
(
self
.
request_screen_action
)
self
.
screen_sharing_button
.
addAction
(
self
.
share_my_screen_action
)
self
.
screen_sharing_button
.
addAction
(
QAction
(
'Request screen'
,
self
.
screen_sharing_button
,
triggered
=
self
.
_AH_RequestScreenActionTriggered
))
self
.
screen_sharing_button
.
addAction
(
QAction
(
'Share my screen'
,
self
.
screen_sharing_button
,
triggered
=
self
.
_AH_ShareMyScreenActionTriggered
))
# adjust search box height depending on theme as the value set in designer isn't suited for all themes
search_box
=
self
.
search_box
...
...
@@ -449,12 +447,12 @@ class MainWindow(base_class, ui_class):
contact
,
contact_uri
=
URIUtils
.
find_contact
(
action
.
entry
.
uri
)
session_manager
.
create_session
(
contact
,
contact_uri
,
[
StreamDescription
(
'audio'
)],
account
=
account
)
# TODO: memorize media type and use it? -Saul (not sure about history in/out -Dan)
def
_AH_SystemTrayShowWindow
(
self
,
checked
):
def
_AH_SystemTrayShowWindow
(
self
):
self
.
show
()
self
.
raise_
()
self
.
activateWindow
()
def
_AH_QuitActionTriggered
(
self
,
checked
):
def
_AH_QuitActionTriggered
(
self
):
if
self
.
system_tray_icon
is
not
None
:
self
.
system_tray_icon
.
hide
()
QApplication
.
instance
()
.
quit
()
...
...
blink/screensharing/vncviewer.py
View file @
26ba728f
...
...
@@ -550,7 +550,6 @@ class ScreensharingWindow(base_class, ui_class):
self
.
fullscreen_action
.
triggered
.
connect
(
self
.
_SH_FullscreenActionTriggered
)
self
.
minimize_action
.
triggered
.
connect
(
self
.
_SH_MinimizeActionTriggered
)
self
.
close_action
.
triggered
.
connect
(
self
.
_SH_CloseActionTriggered
)
self
.
screenshots_folder_action
.
triggered
.
connect
(
self
.
_SH_ScreenshotsFolderActionTriggered
)
self
.
screenshot_button
.
customContextMenuRequested
.
connect
(
self
.
_SH_ScreenshotButtonContextMenuRequested
)
self
.
color_depth_button
.
currentIndexChanged
[
int
]
.
connect
(
self
.
_SH_ColorDepthButtonCurrentIndexChanged
)
self
.
fullscreen_toolbox
.
color_depth_button
.
currentIndexChanged
[
int
]
.
connect
(
self
.
_SH_ColorDepthButtonCurrentIndexChanged
)
...
...
@@ -594,7 +593,7 @@ class ScreensharingWindow(base_class, ui_class):
self
.
color_depth_button
.
addItem
(
'LowColor (8 bits)'
,
LowColor
)
self
.
screenshot_button_menu
=
QMenu
(
self
)
self
.
screenshot
s_folder_action
=
self
.
screenshot_button_menu
.
addAction
(
'Open screenshots folder'
)
self
.
screenshot
_button_menu
.
addAction
(
'Open screenshots folder'
,
self
.
_SH_ScreenshotsFolderActionTriggered
)
def
closeEvent
(
self
,
event
):
super
(
ScreensharingWindow
,
self
)
.
closeEvent
(
event
)
...
...
@@ -656,7 +655,7 @@ class ScreensharingWindow(base_class, ui_class):
else
:
self
.
screenshot_button_menu
.
exec_
(
self
.
screenshot_button
.
mapToGlobal
(
pos
))
def
_SH_ScreenshotsFolderActionTriggered
(
self
,
pos
):
def
_SH_ScreenshotsFolderActionTriggered
(
self
):
settings
=
BlinkSettings
()
QDesktopServices
.
openUrl
(
QUrl
.
fromLocalFile
(
settings
.
screenshots_directory
.
normalized
))
...
...
blink/widgets/buttons.py
View file @
26ba728f
...
...
@@ -701,10 +701,9 @@ class AccountState(StateButton):
state
=
getattr
(
self
,
state_name
)
except
AttributeError
:
continue
action
=
QAction
(
QIcon
(
state
.
icon
),
note
,
menu
)
action
=
menu
.
addAction
(
QIcon
(
state
.
icon
),
note
)
action
.
state
=
state
action
.
note
=
note
menu
.
addAction
(
action
)
history
=
property
(
_get_history
,
_set_history
)
del
_get_history
,
_set_history
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment