Remove remaining references to the old myapp.trayIcon

This commit is contained in:
Jonathan Warren 2013-06-02 23:22:28 -04:00
parent de384c1c56
commit 3f5b7a5936
1 changed files with 1 additions and 38 deletions

View File

@ -71,17 +71,6 @@ class MyForm(QtGui.QMainWindow):
#startup for linux #startup for linux
pass pass
"""self.trayIcon = QtGui.QSystemTrayIcon(self)
self.trayIcon.setIcon( QtGui.QIcon(':/newPrefix/images/can-icon-16px.png') )
traySignal = "activated(QSystemTrayIcon::ActivationReason)"
QtCore.QObject.connect(self.trayIcon, QtCore.SIGNAL(traySignal), self.__icon_activated)
menu = QtGui.QMenu()
self.exitAction = menu.addAction("Quit", self.quit)
self.trayIcon.setContextMenu(menu)
#I'm currently under the impression that Mac users have different expectations for the tray icon. They don't necessairly expect it to open the main window when clicked and they still expect a program showing a tray icon to also be in the dock.
if 'darwin' in sys.platform:
self.trayIcon.show()"""
self.ui.labelSendBroadcastWarning.setVisible(False) self.ui.labelSendBroadcastWarning.setVisible(False)
#FILE MENU and other buttons #FILE MENU and other buttons
@ -831,23 +820,6 @@ class MyForm(QtGui.QMainWindow):
self.actionShow.setChecked(not self.actionShow.isChecked()) self.actionShow.setChecked(not self.actionShow.isChecked())
self.appIndicatorShowOrHideWindow() self.appIndicatorShowOrHideWindow()
"""if 'linux' in sys.platform:
self.trayIcon.hide()
self.setWindowFlags(Qt.Window)
self.show()
elif 'win32' in sys.platform or 'win64' in sys.platform:
self.trayIcon.hide()
self.setWindowFlags(Qt.Window)
self.show()
self.setWindowState(self.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
self.activateWindow()
elif 'darwin' in sys.platform:
#self.trayIcon.hide() #this line causes a segmentation fault
#self.setWindowFlags(Qt.Window)
#self.show()
self.setWindowState(self.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
self.activateWindow()"""
def incrementNumberOfMessagesProcessed(self): def incrementNumberOfMessagesProcessed(self):
self.numberOfMessagesProcessed += 1 self.numberOfMessagesProcessed += 1
self.ui.labelMessageCount.setText('Processed ' + str(self.numberOfMessagesProcessed) + ' person-to-person messages.') self.ui.labelMessageCount.setText('Processed ' + str(self.numberOfMessagesProcessed) + ' person-to-person messages.')
@ -922,7 +894,6 @@ class MyForm(QtGui.QMainWindow):
if self.actionStatus != None: if self.actionStatus != None:
self.actionStatus.setText('Not Connected') self.actionStatus.setText('Not Connected')
self.tray.setIcon(QtGui.QIcon(":/newPrefix/images/can-icon-24px-red.png")) self.tray.setIcon(QtGui.QIcon(":/newPrefix/images/can-icon-24px-red.png"))
#self.trayIcon.show()
if color == 'yellow': if color == 'yellow':
if self.statusBar().currentMessage() == 'Warning: You are currently not connected. Bitmessage will do the work necessary to send the message but it won\'t send until you connect.': if self.statusBar().currentMessage() == 'Warning: You are currently not connected. Bitmessage will do the work necessary to send the message but it won\'t send until you connect.':
self.statusBar().showMessage('') self.statusBar().showMessage('')
@ -1650,7 +1621,6 @@ class MyForm(QtGui.QMainWindow):
# unregister the messaging system # unregister the messaging system
if self.mmapp is not None: if self.mmapp is not None:
self.mmapp.unregister() self.mmapp.unregister()
#self.trayIcon.hide()
self.statusBar().showMessage('All done. Closing user interface...') self.statusBar().showMessage('All done. Closing user interface...')
os._exit(0) os._exit(0)
@ -2139,12 +2109,10 @@ class settingsDialog(QtGui.QDialog):
self.ui.checkBoxStartOnLogon.setDisabled(True) self.ui.checkBoxStartOnLogon.setDisabled(True)
self.ui.checkBoxMinimizeToTray.setDisabled(True) self.ui.checkBoxMinimizeToTray.setDisabled(True)
self.ui.checkBoxShowTrayNotifications.setDisabled(True) self.ui.checkBoxShowTrayNotifications.setDisabled(True)
self.ui.checkBoxStartInTray.setDisabled(True)
self.ui.labelSettingsNote.setText('Options have been disabled because they either aren\'t applicable or because they haven\'t yet been implimented for your operating system.') self.ui.labelSettingsNote.setText('Options have been disabled because they either aren\'t applicable or because they haven\'t yet been implimented for your operating system.')
elif 'linux' in sys.platform: elif 'linux' in sys.platform:
self.ui.checkBoxStartOnLogon.setDisabled(True) self.ui.checkBoxStartOnLogon.setDisabled(True)
self.ui.checkBoxMinimizeToTray.setDisabled(True) self.ui.checkBoxMinimizeToTray.setDisabled(True)
self.ui.checkBoxStartInTray.setDisabled(True)
self.ui.labelSettingsNote.setText('Options have been disabled because they either aren\'t applicable or because they haven\'t yet been implimented for your operating system.') self.ui.labelSettingsNote.setText('Options have been disabled because they either aren\'t applicable or because they haven\'t yet been implimented for your operating system.')
#On the Network settings tab: #On the Network settings tab:
self.ui.lineEditTCPPort.setText(str(shared.config.get('bitmessagesettings', 'port'))) self.ui.lineEditTCPPort.setText(str(shared.config.get('bitmessagesettings', 'port')))
@ -2331,12 +2299,7 @@ def run():
app.setStyleSheet("QStatusBar::item { border: 0px solid black }") app.setStyleSheet("QStatusBar::item { border: 0px solid black }")
myapp = MyForm() myapp = MyForm()
if shared.config.getboolean('bitmessagesettings', 'startintray'): if not shared.config.getboolean('bitmessagesettings', 'startintray'):
if not myapp.isUbuntu():
myapp.trayIcon.show()
if 'win32' in sys.platform or 'win64' in sys.platform:
myapp.setWindowFlags(Qt.ToolTip)
else:
myapp.show() myapp.show()
myapp.appIndicatorInit(app) myapp.appIndicatorInit(app)