mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the menu icon for the smartdevice control change according to whether or not it is running.
This commit is contained in:
parent
26d010d315
commit
9d28e7a366
BIN
resources/images/dot_green.png
Normal file
BIN
resources/images/dot_green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
resources/images/dot_red.png
Normal file
BIN
resources/images/dot_red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@ -59,7 +59,7 @@ class ShareConnMenu(QMenu): # {{{
|
||||
self.toggle_server_action.triggered.connect(lambda x:
|
||||
self.toggle_server.emit())
|
||||
self.control_smartdevice_action = \
|
||||
self.addAction(QIcon(I('devices/galaxy_s3.png')),
|
||||
self.addAction(QIcon(I('dot_green.png')),
|
||||
_('Control Smart Device Connections'))
|
||||
self.control_smartdevice_action.triggered.connect(lambda x:
|
||||
self.control_smartdevice.emit())
|
||||
@ -217,7 +217,15 @@ class ConnectShareAction(InterfaceAction):
|
||||
def control_smartdevice(self):
|
||||
sd_dialog = SmartdeviceDialog(self.gui)
|
||||
sd_dialog.exec_()
|
||||
self.set_smartdevice_icon()
|
||||
|
||||
def check_smartdevice_menus(self):
|
||||
if not self.gui.device_manager.is_enabled('smartdevice'):
|
||||
self.share_conn_menu.hide_smartdevice_menus()
|
||||
|
||||
def set_smartdevice_icon(self):
|
||||
running = self.gui.device_manager.is_running('smartdevice')
|
||||
if running:
|
||||
self.share_conn_menu.control_smartdevice_action.setIcon(QIcon(I('dot_green.png')))
|
||||
else:
|
||||
self.share_conn_menu.control_smartdevice_action.setIcon(QIcon(I('dot_red.png')))
|
||||
|
@ -344,6 +344,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
self.device_manager.start_plugin('smartdevice')
|
||||
except:
|
||||
pass
|
||||
smartdevice_actions.set_smartdevice_icon()
|
||||
|
||||
self.keyboard_interrupt.connect(self.quit, type=Qt.QueuedConnection)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user