2013-06-12 10:05:20 +02:00
try :
import locale
except :
pass
2013-05-11 18:33:16 +02:00
2013-05-02 17:53:54 +02:00
try :
2013-06-13 09:59:40 +02:00
from PyQt4 import QtCore , QtGui
2013-05-02 17:53:54 +02:00
from PyQt4 . QtCore import *
from PyQt4 . QtGui import *
2013-06-12 23:12:32 +02:00
except Exception as err :
2013-06-17 22:42:30 +02:00
print ' PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download it from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \' PyQt Download \' (without quotes). '
2013-05-02 17:53:54 +02:00
print ' Error message: ' , err
sys . exit ( )
2013-05-10 21:47:01 +02:00
2013-06-13 09:59:40 +02:00
try :
_encoding = QtGui . QApplication . UnicodeUTF8
except AttributeError :
2013-06-14 21:58:46 +02:00
print ' QtGui.QApplication.UnicodeUTF8 error: ' , err
def _translate ( context , text ) :
return QtGui . QApplication . translate ( context , text )
2013-06-13 09:59:40 +02:00
2013-05-11 18:33:16 +02:00
withMessagingMenu = False
2013-05-10 21:47:01 +02:00
try :
from gi . repository import MessagingMenu
2013-05-11 18:33:16 +02:00
from gi . repository import Notify
withMessagingMenu = True
2013-05-10 21:47:01 +02:00
except ImportError :
MessagingMenu = None
2013-05-02 17:53:54 +02:00
from addresses import *
import shared
from bitmessageui import *
from newaddressdialog import *
from newsubscriptiondialog import *
from regenerateaddresses import *
from specialaddressbehavior import *
from settings import *
from about import *
from help import *
from iconglossary import *
import sys
from time import strftime , localtime , gmtime
import time
import os
from pyelliptic . openssl import OpenSSL
2013-05-03 21:53:38 +02:00
import pickle
2013-05-14 17:44:51 +02:00
import platform
2013-05-02 17:53:54 +02:00
class MyForm ( QtGui . QMainWindow ) :
2013-05-10 21:47:01 +02:00
2013-05-14 17:06:01 +02:00
str_broadcast_subscribers = ' [Broadcast subscribers] '
2013-05-02 17:53:54 +02:00
def __init__ ( self , parent = None ) :
QtGui . QWidget . __init__ ( self , parent )
self . ui = Ui_MainWindow ( )
self . ui . setupUi ( self )
2013-06-12 23:12:32 +02:00
# Ask the user if we may delete their old version 1 addresses if they
# have any.
2013-05-02 17:53:54 +02:00
configSections = shared . config . sections ( )
for addressInKeysFile in configSections :
2013-06-12 23:12:32 +02:00
if addressInKeysFile != ' bitmessagesettings ' :
status , addressVersionNumber , streamNumber , hash = decodeAddress (
addressInKeysFile )
2013-05-02 17:53:54 +02:00
if addressVersionNumber == 1 :
2013-06-13 09:59:40 +02:00
displayMsg = _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " One of your addresses, % 1, is an old version 1 address. Version 1 addresses are no longer supported. "
+ " May we delete it now? " ) . arg ( addressInKeysFile )
reply = QtGui . QMessageBox . question (
self , ' Message ' , displayMsg , QtGui . QMessageBox . Yes , QtGui . QMessageBox . No )
2013-05-02 17:53:54 +02:00
if reply == QtGui . QMessageBox . Yes :
shared . config . remove_section ( addressInKeysFile )
with open ( shared . appdata + ' keys.dat ' , ' wb ' ) as configfile :
shared . config . write ( configfile )
2013-06-12 23:12:32 +02:00
# Configure Bitmessage to start on startup (or remove the
# configuration) based on the setting in the keys.dat file
2013-05-02 17:53:54 +02:00
if ' win32 ' in sys . platform or ' win64 ' in sys . platform :
2013-06-12 23:12:32 +02:00
# Auto-startup for Windows
2013-05-02 17:53:54 +02:00
RUN_PATH = " HKEY_CURRENT_USER \\ Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Run "
self . settings = QSettings ( RUN_PATH , QSettings . NativeFormat )
2013-06-12 23:12:32 +02:00
self . settings . remove (
" PyBitmessage " ) # In case the user moves the program and the registry entry is no longer valid, this will delete the old registry entry.
2013-05-02 17:53:54 +02:00
if shared . config . getboolean ( ' bitmessagesettings ' , ' startonlogon ' ) :
2013-06-12 23:12:32 +02:00
self . settings . setValue ( " PyBitmessage " , sys . argv [ 0 ] )
2013-05-02 17:53:54 +02:00
elif ' darwin ' in sys . platform :
2013-06-12 23:12:32 +02:00
# startup for mac
2013-05-02 17:53:54 +02:00
pass
elif ' linux ' in sys . platform :
2013-06-12 23:12:32 +02:00
# startup for linux
2013-05-02 17:53:54 +02:00
pass
self . ui . labelSendBroadcastWarning . setVisible ( False )
2013-06-12 23:12:32 +02:00
# FILE MENU and other buttons
QtCore . QObject . connect ( self . ui . actionExit , QtCore . SIGNAL (
" triggered() " ) , self . quit )
QtCore . QObject . connect ( self . ui . actionManageKeys , QtCore . SIGNAL (
" triggered() " ) , self . click_actionManageKeys )
QtCore . QObject . connect ( self . ui . actionDeleteAllTrashedMessages , QtCore . SIGNAL (
" triggered() " ) , self . click_actionDeleteAllTrashedMessages )
QtCore . QObject . connect ( self . ui . actionRegenerateDeterministicAddresses , QtCore . SIGNAL (
" triggered() " ) , self . click_actionRegenerateDeterministicAddresses )
QtCore . QObject . connect ( self . ui . pushButtonNewAddress , QtCore . SIGNAL (
" clicked() " ) , self . click_NewAddressDialog )
QtCore . QObject . connect ( self . ui . comboBoxSendFrom , QtCore . SIGNAL (
" activated(int) " ) , self . redrawLabelFrom )
QtCore . QObject . connect ( self . ui . pushButtonAddAddressBook , QtCore . SIGNAL (
" clicked() " ) , self . click_pushButtonAddAddressBook )
QtCore . QObject . connect ( self . ui . pushButtonAddSubscription , QtCore . SIGNAL (
" clicked() " ) , self . click_pushButtonAddSubscription )
QtCore . QObject . connect ( self . ui . pushButtonAddBlacklist , QtCore . SIGNAL (
" clicked() " ) , self . click_pushButtonAddBlacklist )
QtCore . QObject . connect ( self . ui . pushButtonSend , QtCore . SIGNAL (
" clicked() " ) , self . click_pushButtonSend )
QtCore . QObject . connect ( self . ui . pushButtonLoadFromAddressBook , QtCore . SIGNAL (
" clicked() " ) , self . click_pushButtonLoadFromAddressBook )
QtCore . QObject . connect ( self . ui . radioButtonBlacklist , QtCore . SIGNAL (
" clicked() " ) , self . click_radioButtonBlacklist )
QtCore . QObject . connect ( self . ui . radioButtonWhitelist , QtCore . SIGNAL (
" clicked() " ) , self . click_radioButtonWhitelist )
QtCore . QObject . connect ( self . ui . pushButtonStatusIcon , QtCore . SIGNAL (
" clicked() " ) , self . click_pushButtonStatusIcon )
QtCore . QObject . connect ( self . ui . actionSettings , QtCore . SIGNAL (
" triggered() " ) , self . click_actionSettings )
QtCore . QObject . connect ( self . ui . actionAbout , QtCore . SIGNAL (
" triggered() " ) , self . click_actionAbout )
QtCore . QObject . connect ( self . ui . actionHelp , QtCore . SIGNAL (
" triggered() " ) , self . click_actionHelp )
# Popup menu for the Inbox tab
2013-05-02 17:53:54 +02:00
self . ui . inboxContextMenuToolbar = QtGui . QToolBar ( )
# Actions
2013-06-13 09:59:40 +02:00
self . actionReply = self . ui . inboxContextMenuToolbar . addAction ( _translate (
" MainWindow " , " Reply " ) , self . on_action_InboxReply )
self . actionAddSenderToAddressBook = self . ui . inboxContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Add sender to your Address Book " ) , self . on_action_InboxAddSenderToAddressBook )
self . actionTrashInboxMessage = self . ui . inboxContextMenuToolbar . addAction (
2013-06-13 09:59:40 +02:00
_translate ( " MainWindow " , " Move to Trash " ) , self . on_action_InboxTrash )
self . actionForceHtml = self . ui . inboxContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " View HTML code as formatted text " ) , self . on_action_InboxMessageForceHtml )
2013-06-19 22:49:31 +02:00
self . actionSaveMessageAs = self . ui . inboxContextMenuToolbar . addAction ( _translate (
" MainWindow " , " Save message as... " ) , self . on_action_InboxSaveMessageAs )
2013-06-12 23:12:32 +02:00
self . ui . tableWidgetInbox . setContextMenuPolicy (
QtCore . Qt . CustomContextMenu )
self . connect ( self . ui . tableWidgetInbox , QtCore . SIGNAL (
' customContextMenuRequested(const QPoint&) ' ) , self . on_context_menuInbox )
self . popMenuInbox = QtGui . QMenu ( self )
self . popMenuInbox . addAction ( self . actionForceHtml )
2013-05-02 17:53:54 +02:00
self . popMenuInbox . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenuInbox . addAction ( self . actionReply )
self . popMenuInbox . addAction ( self . actionAddSenderToAddressBook )
2013-05-02 17:53:54 +02:00
self . popMenuInbox . addSeparator ( )
2013-06-17 00:28:18 +02:00
self . popMenuInbox . addAction ( self . actionSaveMessageAs )
2013-05-02 17:53:54 +02:00
self . popMenuInbox . addAction ( self . actionTrashInboxMessage )
2013-06-12 23:12:32 +02:00
# Popup menu for the Your Identities tab
2013-05-02 17:53:54 +02:00
self . ui . addressContextMenuToolbar = QtGui . QToolBar ( )
# Actions
2013-06-13 09:59:40 +02:00
self . actionNew = self . ui . addressContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " New " ) , self . on_action_YourIdentitiesNew )
2013-06-13 09:59:40 +02:00
self . actionEnable = self . ui . addressContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Enable " ) , self . on_action_YourIdentitiesEnable )
2013-06-13 09:59:40 +02:00
self . actionDisable = self . ui . addressContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Disable " ) , self . on_action_YourIdentitiesDisable )
2013-06-13 09:59:40 +02:00
self . actionClipboard = self . ui . addressContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Copy address to clipboard " ) , self . on_action_YourIdentitiesClipboard )
2013-06-13 09:59:40 +02:00
self . actionSpecialAddressBehavior = self . ui . addressContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Special address behavior... " ) , self . on_action_SpecialAddressBehaviorDialog )
self . ui . tableWidgetYourIdentities . setContextMenuPolicy (
QtCore . Qt . CustomContextMenu )
self . connect ( self . ui . tableWidgetYourIdentities , QtCore . SIGNAL (
' customContextMenuRequested(const QPoint&) ' ) , self . on_context_menuYourIdentities )
self . popMenu = QtGui . QMenu ( self )
self . popMenu . addAction ( self . actionNew )
2013-05-02 17:53:54 +02:00
self . popMenu . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenu . addAction ( self . actionClipboard )
2013-05-02 17:53:54 +02:00
self . popMenu . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenu . addAction ( self . actionEnable )
self . popMenu . addAction ( self . actionDisable )
self . popMenu . addAction ( self . actionSpecialAddressBehavior )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Popup menu for the Address Book page
2013-05-02 17:53:54 +02:00
self . ui . addressBookContextMenuToolbar = QtGui . QToolBar ( )
# Actions
2013-06-13 09:59:40 +02:00
self . actionAddressBookSend = self . ui . addressBookContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Send message to this address " ) , self . on_action_AddressBookSend )
2013-06-13 09:59:40 +02:00
self . actionAddressBookClipboard = self . ui . addressBookContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Copy address to clipboard " ) , self . on_action_AddressBookClipboard )
2013-06-19 18:19:07 +02:00
self . actionAddressBookSubscribe = self . ui . addressBookContextMenuToolbar . addAction ( _translate (
" MainWindow " , " Subscribe to this address " ) , self . on_action_AddressBookSubscribe )
2013-06-13 09:59:40 +02:00
self . actionAddressBookNew = self . ui . addressBookContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Add New Address " ) , self . on_action_AddressBookNew )
2013-06-13 09:59:40 +02:00
self . actionAddressBookDelete = self . ui . addressBookContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Delete " ) , self . on_action_AddressBookDelete )
self . ui . tableWidgetAddressBook . setContextMenuPolicy (
QtCore . Qt . CustomContextMenu )
self . connect ( self . ui . tableWidgetAddressBook , QtCore . SIGNAL (
' customContextMenuRequested(const QPoint&) ' ) , self . on_context_menuAddressBook )
self . popMenuAddressBook = QtGui . QMenu ( self )
self . popMenuAddressBook . addAction ( self . actionAddressBookSend )
self . popMenuAddressBook . addAction ( self . actionAddressBookClipboard )
2013-06-14 03:55:38 +02:00
self . popMenuAddressBook . addAction ( self . actionAddressBookSubscribe )
2013-05-02 17:53:54 +02:00
self . popMenuAddressBook . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenuAddressBook . addAction ( self . actionAddressBookNew )
self . popMenuAddressBook . addAction ( self . actionAddressBookDelete )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Popup menu for the Subscriptions page
2013-05-02 17:53:54 +02:00
self . ui . subscriptionsContextMenuToolbar = QtGui . QToolBar ( )
# Actions
2013-06-12 23:12:32 +02:00
self . actionsubscriptionsNew = self . ui . subscriptionsContextMenuToolbar . addAction (
2013-06-13 09:59:40 +02:00
_translate ( " MainWindow " , " New " ) , self . on_action_SubscriptionsNew )
2013-06-12 23:12:32 +02:00
self . actionsubscriptionsDelete = self . ui . subscriptionsContextMenuToolbar . addAction (
2013-06-13 09:59:40 +02:00
_translate ( " MainWindow " , " Delete " ) , self . on_action_SubscriptionsDelete )
2013-06-12 23:12:32 +02:00
self . actionsubscriptionsClipboard = self . ui . subscriptionsContextMenuToolbar . addAction (
2013-06-13 09:59:40 +02:00
_translate ( " MainWindow " , " Copy address to clipboard " ) , self . on_action_SubscriptionsClipboard )
2013-06-12 23:12:32 +02:00
self . actionsubscriptionsEnable = self . ui . subscriptionsContextMenuToolbar . addAction (
2013-06-13 09:59:40 +02:00
_translate ( " MainWindow " , " Enable " ) , self . on_action_SubscriptionsEnable )
2013-06-12 23:12:32 +02:00
self . actionsubscriptionsDisable = self . ui . subscriptionsContextMenuToolbar . addAction (
2013-06-13 09:59:40 +02:00
_translate ( " MainWindow " , " Disable " ) , self . on_action_SubscriptionsDisable )
2013-06-12 23:12:32 +02:00
self . ui . tableWidgetSubscriptions . setContextMenuPolicy (
QtCore . Qt . CustomContextMenu )
self . connect ( self . ui . tableWidgetSubscriptions , QtCore . SIGNAL (
' customContextMenuRequested(const QPoint&) ' ) , self . on_context_menuSubscriptions )
self . popMenuSubscriptions = QtGui . QMenu ( self )
self . popMenuSubscriptions . addAction ( self . actionsubscriptionsNew )
self . popMenuSubscriptions . addAction ( self . actionsubscriptionsDelete )
2013-05-02 17:53:54 +02:00
self . popMenuSubscriptions . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenuSubscriptions . addAction ( self . actionsubscriptionsEnable )
self . popMenuSubscriptions . addAction ( self . actionsubscriptionsDisable )
2013-05-02 17:53:54 +02:00
self . popMenuSubscriptions . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenuSubscriptions . addAction ( self . actionsubscriptionsClipboard )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Popup menu for the Sent page
2013-05-02 17:53:54 +02:00
self . ui . sentContextMenuToolbar = QtGui . QToolBar ( )
# Actions
2013-06-13 09:59:40 +02:00
self . actionTrashSentMessage = self . ui . sentContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Move to Trash " ) , self . on_action_SentTrash )
2013-06-13 09:59:40 +02:00
self . actionSentClipboard = self . ui . sentContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Copy destination address to clipboard " ) , self . on_action_SentClipboard )
2013-06-13 09:59:40 +02:00
self . actionForceSend = self . ui . sentContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Force send " ) , self . on_action_ForceSend )
self . ui . tableWidgetSent . setContextMenuPolicy (
QtCore . Qt . CustomContextMenu )
self . connect ( self . ui . tableWidgetSent , QtCore . SIGNAL (
' customContextMenuRequested(const QPoint&) ' ) , self . on_context_menuSent )
# self.popMenuSent = QtGui.QMenu( self )
# self.popMenuSent.addAction( self.actionSentClipboard )
# self.popMenuSent.addAction( self.actionTrashSentMessage )
# Popup menu for the Blacklist page
2013-05-02 17:53:54 +02:00
self . ui . blacklistContextMenuToolbar = QtGui . QToolBar ( )
# Actions
2013-06-13 09:59:40 +02:00
self . actionBlacklistNew = self . ui . blacklistContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Add new entry " ) , self . on_action_BlacklistNew )
2013-06-13 09:59:40 +02:00
self . actionBlacklistDelete = self . ui . blacklistContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Delete " ) , self . on_action_BlacklistDelete )
2013-06-13 09:59:40 +02:00
self . actionBlacklistClipboard = self . ui . blacklistContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Copy address to clipboard " ) , self . on_action_BlacklistClipboard )
2013-06-13 09:59:40 +02:00
self . actionBlacklistEnable = self . ui . blacklistContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Enable " ) , self . on_action_BlacklistEnable )
2013-06-13 09:59:40 +02:00
self . actionBlacklistDisable = self . ui . blacklistContextMenuToolbar . addAction ( _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Disable " ) , self . on_action_BlacklistDisable )
self . ui . tableWidgetBlacklist . setContextMenuPolicy (
QtCore . Qt . CustomContextMenu )
self . connect ( self . ui . tableWidgetBlacklist , QtCore . SIGNAL (
' customContextMenuRequested(const QPoint&) ' ) , self . on_context_menuBlacklist )
self . popMenuBlacklist = QtGui . QMenu ( self )
# self.popMenuBlacklist.addAction( self.actionBlacklistNew )
self . popMenuBlacklist . addAction ( self . actionBlacklistDelete )
2013-05-02 17:53:54 +02:00
self . popMenuBlacklist . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenuBlacklist . addAction ( self . actionBlacklistClipboard )
2013-05-02 17:53:54 +02:00
self . popMenuBlacklist . addSeparator ( )
2013-06-12 23:12:32 +02:00
self . popMenuBlacklist . addAction ( self . actionBlacklistEnable )
self . popMenuBlacklist . addAction ( self . actionBlacklistDisable )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Initialize the user's list of addresses on the 'Your Identities' tab.
2013-05-02 17:53:54 +02:00
configSections = shared . config . sections ( )
for addressInKeysFile in configSections :
2013-06-12 23:12:32 +02:00
if addressInKeysFile != ' bitmessagesettings ' :
isEnabled = shared . config . getboolean (
addressInKeysFile , ' enabled ' )
newItem = QtGui . QTableWidgetItem ( unicode (
shared . config . get ( addressInKeysFile , ' label ' ) , ' utf-8) ' ) )
2013-05-02 17:53:54 +02:00
if not isEnabled :
2013-06-12 23:12:32 +02:00
newItem . setTextColor ( QtGui . QColor ( 128 , 128 , 128 ) )
2013-05-02 17:53:54 +02:00
self . ui . tableWidgetYourIdentities . insertRow ( 0 )
self . ui . tableWidgetYourIdentities . setItem ( 0 , 0 , newItem )
newItem = QtGui . QTableWidgetItem ( addressInKeysFile )
2013-06-12 23:12:32 +02:00
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
2013-05-02 17:53:54 +02:00
if not isEnabled :
2013-06-12 23:12:32 +02:00
newItem . setTextColor ( QtGui . QColor ( 128 , 128 , 128 ) )
if shared . safeConfigGetBoolean ( addressInKeysFile , ' mailinglist ' ) :
newItem . setTextColor ( QtGui . QColor ( 137 , 04 , 177 ) ) # magenta
2013-05-02 17:53:54 +02:00
self . ui . tableWidgetYourIdentities . setItem ( 0 , 1 , newItem )
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem ( str (
addressStream ( addressInKeysFile ) ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
2013-05-02 17:53:54 +02:00
if not isEnabled :
2013-06-12 23:12:32 +02:00
newItem . setTextColor ( QtGui . QColor ( 128 , 128 , 128 ) )
2013-05-02 17:53:54 +02:00
self . ui . tableWidgetYourIdentities . setItem ( 0 , 2 , newItem )
if isEnabled :
2013-06-12 23:12:32 +02:00
status , addressVersionNumber , streamNumber , hash = decodeAddress (
addressInKeysFile )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Load inbox from messages database file
2013-05-02 17:53:54 +02:00
font = QFont ( )
font . setBold ( True )
2013-05-02 20:18:24 +02:00
shared . sqlLock . acquire ( )
2013-06-12 23:12:32 +02:00
shared . sqlSubmitQueue . put (
''' SELECT msgid, toaddress, fromaddress, subject, received, message, read FROM inbox where folder= ' inbox ' ORDER BY received ''' )
2013-05-02 17:53:54 +02:00
shared . sqlSubmitQueue . put ( ' ' )
queryreturn = shared . sqlReturnQueue . get ( )
2013-05-02 20:18:24 +02:00
shared . sqlLock . release ( )
2013-05-02 17:53:54 +02:00
for row in queryreturn :
msgid , toAddress , fromAddress , subject , received , message , read = row
2013-06-11 00:53:15 +02:00
subject = shared . fixPotentiallyInvalidUTF8Data ( subject )
message = shared . fixPotentiallyInvalidUTF8Data ( message )
2013-05-02 17:53:54 +02:00
try :
2013-05-14 17:06:01 +02:00
if toAddress == self . str_broadcast_subscribers :
toLabel = self . str_broadcast_subscribers
2013-05-02 17:53:54 +02:00
else :
toLabel = shared . config . get ( toAddress , ' label ' )
except :
toLabel = ' '
if toLabel == ' ' :
toLabel = toAddress
fromLabel = ' '
t = ( fromAddress , )
2013-05-02 20:18:24 +02:00
shared . sqlLock . acquire ( )
2013-06-12 23:12:32 +02:00
shared . sqlSubmitQueue . put (
''' select label from addressbook where address=? ''' )
2013-05-02 17:53:54 +02:00
shared . sqlSubmitQueue . put ( t )
queryreturn = shared . sqlReturnQueue . get ( )
2013-05-02 20:18:24 +02:00
shared . sqlLock . release ( )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
if queryreturn != [ ] :
2013-05-02 17:53:54 +02:00
for row in queryreturn :
fromLabel , = row
2013-06-12 23:12:32 +02:00
if fromLabel == ' ' : # If this address wasn't in our address book...
2013-05-02 17:53:54 +02:00
t = ( fromAddress , )
2013-05-02 20:18:24 +02:00
shared . sqlLock . acquire ( )
2013-06-12 23:12:32 +02:00
shared . sqlSubmitQueue . put (
''' select label from subscriptions where address=? ''' )
2013-05-02 17:53:54 +02:00
shared . sqlSubmitQueue . put ( t )
queryreturn = shared . sqlReturnQueue . get ( )
2013-05-02 20:18:24 +02:00
shared . sqlLock . release ( )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
if queryreturn != [ ] :
2013-05-02 17:53:54 +02:00
for row in queryreturn :
fromLabel , = row
self . ui . tableWidgetInbox . insertRow ( 0 )
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem ( unicode ( toLabel , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( toLabel , ' utf-8 ' ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
2013-05-02 17:53:54 +02:00
if not read :
newItem . setFont ( font )
2013-06-12 23:12:32 +02:00
newItem . setData ( Qt . UserRole , str ( toAddress ) )
if shared . safeConfigGetBoolean ( toAddress , ' mailinglist ' ) :
newItem . setTextColor ( QtGui . QColor ( 137 , 04 , 177 ) )
self . ui . tableWidgetInbox . setItem ( 0 , 0 , newItem )
2013-05-02 17:53:54 +02:00
if fromLabel == ' ' :
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem (
unicode ( fromAddress , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( fromAddress , ' utf-8 ' ) )
2013-05-02 17:53:54 +02:00
else :
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem ( unicode ( fromLabel , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( fromLabel , ' utf-8 ' ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
2013-05-02 17:53:54 +02:00
if not read :
newItem . setFont ( font )
2013-06-12 23:12:32 +02:00
newItem . setData ( Qt . UserRole , str ( fromAddress ) )
self . ui . tableWidgetInbox . setItem ( 0 , 1 , newItem )
newItem = QtGui . QTableWidgetItem ( unicode ( subject , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( subject , ' utf-8 ' ) )
newItem . setData ( Qt . UserRole , unicode ( message , ' utf-8) ' ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
2013-05-02 17:53:54 +02:00
if not read :
newItem . setFont ( font )
2013-06-12 23:12:32 +02:00
self . ui . tableWidgetInbox . setItem ( 0 , 2 , newItem )
newItem = myTableWidgetItem ( unicode ( strftime ( shared . config . get (
' bitmessagesettings ' , ' timeformat ' ) , localtime ( int ( received ) ) ) , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( strftime ( shared . config . get (
' bitmessagesettings ' , ' timeformat ' ) , localtime ( int ( received ) ) ) , ' utf-8 ' ) )
newItem . setData ( Qt . UserRole , QByteArray ( msgid ) )
newItem . setData ( 33 , int ( received ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
2013-05-02 17:53:54 +02:00
if not read :
newItem . setFont ( font )
2013-06-12 23:12:32 +02:00
self . ui . tableWidgetInbox . setItem ( 0 , 3 , newItem )
self . ui . tableWidgetInbox . sortItems ( 3 , Qt . DescendingOrder )
2013-05-02 17:53:54 +02:00
self . ui . tableWidgetInbox . keyPressEvent = self . tableWidgetInboxKeyPressEvent
2013-06-11 00:53:15 +02:00
2013-06-12 23:12:32 +02:00
# Load Sent items from database
2013-05-02 20:18:24 +02:00
shared . sqlLock . acquire ( )
2013-06-12 23:12:32 +02:00
shared . sqlSubmitQueue . put (
''' SELECT toaddress, fromaddress, subject, message, status, ackdata, lastactiontime FROM sent where folder = ' sent ' ORDER BY lastactiontime ''' )
2013-05-02 17:53:54 +02:00
shared . sqlSubmitQueue . put ( ' ' )
queryreturn = shared . sqlReturnQueue . get ( )
2013-05-02 20:18:24 +02:00
shared . sqlLock . release ( )
2013-05-02 17:53:54 +02:00
for row in queryreturn :
toAddress , fromAddress , subject , message , status , ackdata , lastactiontime = row
2013-06-11 00:53:15 +02:00
subject = shared . fixPotentiallyInvalidUTF8Data ( subject )
message = shared . fixPotentiallyInvalidUTF8Data ( message )
2013-05-02 17:53:54 +02:00
try :
fromLabel = shared . config . get ( fromAddress , ' label ' )
except :
fromLabel = ' '
if fromLabel == ' ' :
fromLabel = fromAddress
toLabel = ' '
t = ( toAddress , )
2013-05-02 20:18:24 +02:00
shared . sqlLock . acquire ( )
2013-06-12 23:12:32 +02:00
shared . sqlSubmitQueue . put (
''' select label from addressbook where address=? ''' )
2013-05-02 17:53:54 +02:00
shared . sqlSubmitQueue . put ( t )
queryreturn = shared . sqlReturnQueue . get ( )
2013-05-02 20:18:24 +02:00
shared . sqlLock . release ( )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
if queryreturn != [ ] :
2013-05-02 17:53:54 +02:00
for row in queryreturn :
toLabel , = row
self . ui . tableWidgetSent . insertRow ( 0 )
if toLabel == ' ' :
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem ( unicode ( toAddress , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( toAddress , ' utf-8 ' ) )
2013-05-02 17:53:54 +02:00
else :
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem ( unicode ( toLabel , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( toLabel , ' utf-8 ' ) )
newItem . setData ( Qt . UserRole , str ( toAddress ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
self . ui . tableWidgetSent . setItem ( 0 , 0 , newItem )
2013-05-02 17:53:54 +02:00
if fromLabel == ' ' :
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem (
unicode ( fromAddress , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( fromAddress , ' utf-8 ' ) )
2013-05-02 17:53:54 +02:00
else :
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem ( unicode ( fromLabel , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( fromLabel , ' utf-8 ' ) )
newItem . setData ( Qt . UserRole , str ( fromAddress ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
self . ui . tableWidgetSent . setItem ( 0 , 1 , newItem )
newItem = QtGui . QTableWidgetItem ( unicode ( subject , ' utf-8 ' ) )
newItem . setToolTip ( unicode ( subject , ' utf-8 ' ) )
newItem . setData ( Qt . UserRole , unicode ( message , ' utf-8) ' ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
self . ui . tableWidgetSent . setItem ( 0 , 2 , newItem )
2013-05-29 23:18:44 +02:00
if status == ' awaitingpubkey ' :
2013-06-13 09:59:40 +02:00
statusText = _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Waiting on their encryption key. Will request it again soon. " )
2013-05-29 23:18:44 +02:00
elif status == ' doingpowforpubkey ' :
2013-06-13 09:59:40 +02:00
statusText = _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Encryption key request queued. " )
2013-05-29 23:18:44 +02:00
elif status == ' msgqueued ' :
2013-06-13 09:59:40 +02:00
statusText = _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Queued. " )
2013-05-29 23:18:44 +02:00
elif status == ' msgsent ' :
2013-06-13 09:59:40 +02:00
statusText = _translate ( " MainWindow " , " Message sent. Waiting on acknowledgement. Sent at % 1 " ) . arg (
2013-06-18 19:11:30 +02:00
unicode ( strftime ( shared . config . get ( ' bitmessagesettings ' , ' timeformat ' ) , localtime ( lastactiontime ) ) , ' utf-8 ' ) )
2013-05-29 23:18:44 +02:00
elif status == ' doingmsgpow ' :
2013-06-13 09:59:40 +02:00
statusText = _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Need to do work to send message. Work is queued. " )
2013-05-02 17:53:54 +02:00
elif status == ' ackreceived ' :
2013-06-13 09:59:40 +02:00
statusText = _translate ( " MainWindow " , " Acknowledgement of the message received % 1 " ) . arg (
2013-06-18 19:11:30 +02:00
unicode ( strftime ( shared . config . get ( ' bitmessagesettings ' , ' timeformat ' ) , localtime ( lastactiontime ) ) , ' utf-8 ' ) )
2013-05-29 23:18:44 +02:00
elif status == ' broadcastqueued ' :
2013-06-13 09:59:40 +02:00
statusText = _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Broadcast queued. " )
2013-05-02 17:53:54 +02:00
elif status == ' broadcastsent ' :
2013-06-13 09:59:40 +02:00
statusText = _translate ( " MainWindow " , " Broadcast on % 1 " ) . arg ( unicode ( strftime (
2013-06-18 19:11:30 +02:00
shared . config . get ( ' bitmessagesettings ' , ' timeformat ' ) , localtime ( lastactiontime ) ) , ' utf-8 ' ) )
2013-06-10 15:40:51 +02:00
elif status == ' toodifficult ' :
2013-06-13 09:59:40 +02:00
statusText = _translate ( " MainWindow " , " Problem: The work demanded by the recipient is more difficult than you are willing to do. % 1 " ) . arg (
2013-06-18 19:11:30 +02:00
unicode ( strftime ( shared . config . get ( ' bitmessagesettings ' , ' timeformat ' ) , localtime ( lastactiontime ) ) , ' utf-8 ' ) )
2013-06-13 21:15:22 +02:00
elif status == ' badkey ' :
2013-06-17 23:49:06 +02:00
statusText = _translate ( " MainWindow " , " Problem: The recipient \' s encryption key is no good. Could not encrypt message. % 1 " ) . arg (
2013-06-18 19:11:30 +02:00
unicode ( strftime ( shared . config . get ( ' bitmessagesettings ' , ' timeformat ' ) , localtime ( lastactiontime ) ) , ' utf-8 ' ) )
2013-06-11 00:53:15 +02:00
elif status == ' forcepow ' :
2013-06-13 09:59:40 +02:00
statusText = _translate (
2013-06-12 23:12:32 +02:00
" MainWindow " , " Forced difficulty override. Send should start soon. " )
2013-05-02 17:53:54 +02:00
else :
2013-06-13 09:59:40 +02:00
statusText = _translate ( " MainWindow " , " Unknown status: % 1 % 2 " ) . arg ( status ) . arg ( unicode (
2013-06-18 19:11:30 +02:00
strftime ( shared . config . get ( ' bitmessagesettings ' , ' timeformat ' ) , localtime ( lastactiontime ) ) , ' utf-8 ' ) )
2013-06-12 23:12:32 +02:00
newItem = myTableWidgetItem ( statusText )
2013-06-11 00:53:15 +02:00
newItem . setToolTip ( statusText )
2013-06-12 23:12:32 +02:00
newItem . setData ( Qt . UserRole , QByteArray ( ackdata ) )
newItem . setData ( 33 , int ( lastactiontime ) )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
self . ui . tableWidgetSent . setItem ( 0 , 3 , newItem )
self . ui . tableWidgetSent . sortItems ( 3 , Qt . DescendingOrder )
2013-06-11 00:53:15 +02:00
self . ui . tableWidgetSent . keyPressEvent = self . tableWidgetSentKeyPressEvent
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Initialize the address book
2013-05-02 20:18:24 +02:00
shared . sqlLock . acquire ( )
2013-05-02 17:53:54 +02:00
shared . sqlSubmitQueue . put ( ' SELECT * FROM addressbook ' )
shared . sqlSubmitQueue . put ( ' ' )
queryreturn = shared . sqlReturnQueue . get ( )
2013-05-02 20:18:24 +02:00
shared . sqlLock . release ( )
2013-05-02 17:53:54 +02:00
for row in queryreturn :
label , address = row
self . ui . tableWidgetAddressBook . insertRow ( 0 )
2013-06-12 23:12:32 +02:00
newItem = QtGui . QTableWidgetItem ( unicode ( label , ' utf-8 ' ) )
self . ui . tableWidgetAddressBook . setItem ( 0 , 0 , newItem )
newItem = QtGui . QTableWidgetItem ( address )
newItem . setFlags (
QtCore . Qt . ItemIsSelectable | QtCore . Qt . ItemIsEnabled )
self . ui . tableWidgetAddressBook . setItem ( 0 , 1 , newItem )
# Initialize the Subscriptions
2013-05-24 22:12:16 +02:00
self . rerenderSubscriptions ( )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Initialize the Blacklist or Whitelist
2013-05-02 17:53:54 +02:00
if shared . config . get ( ' bitmessagesettings ' , ' blackwhitelist ' ) == ' black ' :
self . loadBlackWhiteList ( )
else :
2013-06-12 23:12:32 +02:00
self . ui . tabWidget . setTabText ( 6 , ' Whitelist ' )
2013-05-02 17:53:54 +02:00
self . ui . radioButtonWhitelist . click ( )
self . loadBlackWhiteList ( )
2013-06-12 23:12:32 +02:00
QtCore . QObject . connect ( self . ui . tableWidgetYourIdentities , QtCore . SIGNAL (
" itemChanged(QTableWidgetItem *) " ) , self . tableWidgetYourIdentitiesItemChanged )
QtCore . QObject . connect ( self . ui . tableWidgetAddressBook , QtCore . SIGNAL (
" itemChanged(QTableWidgetItem *) " ) , self . tableWidgetAddressBookItemChanged )
QtCore . QObject . connect ( self . ui . tableWidgetSubscriptions , QtCore . SIGNAL (
" itemChanged(QTableWidgetItem *) " ) , self . tableWidgetSubscriptionsItemChanged )
QtCore . QObject . connect ( self . ui . tableWidgetInbox , QtCore . SIGNAL (
" itemSelectionChanged () " ) , self . tableWidgetInboxItemClicked )
QtCore . QObject . connect ( self . ui . tableWidgetSent , QtCore . SIGNAL (
" itemSelectionChanged () " ) , self . tableWidgetSentItemClicked )
# Put the colored icon on the status bar
# self.ui.pushButtonStatusIcon.setIcon(QIcon(":/newPrefix/images/yellowicon.png"))
2013-05-02 17:53:54 +02:00
self . statusbar = self . statusBar ( )
2013-06-12 23:12:32 +02:00
self . statusbar . insertPermanentWidget ( 0 , self . ui . pushButtonStatusIcon )
2013-06-13 09:59:40 +02:00
self . ui . labelStartupTime . setText ( _translate ( " MainWindow " , " Since startup on % 1 " ) . arg (
2013-06-18 19:11:30 +02:00
unicode ( strftime ( shared . config . get ( ' bitmessagesettings ' , ' timeformat ' ) , localtime ( int ( time . time ( ) ) ) ) , ' utf-8 ' ) ) )
2013-05-02 17:53:54 +02:00
self . numberOfMessagesProcessed = 0
self . numberOfBroadcastsProcessed = 0
self . numberOfPubkeysProcessed = 0
self . UISignalThread = UISignaler ( )
2013-06-12 23:12:32 +02:00
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" writeNewAddressToTable(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject) " ) , self . writeNewAddressToTable )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" updateStatusBar(PyQt_PyObject) " ) , self . updateStatusBar )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" updateSentItemStatusByHash(PyQt_PyObject,PyQt_PyObject) " ) , self . updateSentItemStatusByHash )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject) " ) , self . updateSentItemStatusByAckdata )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" displayNewInboxMessage(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject) " ) , self . displayNewInboxMessage )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" displayNewSentMessage(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject,PyQt_PyObject) " ) , self . displayNewSentMessage )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" updateNetworkStatusTab() " ) , self . updateNetworkStatusTab )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" incrementNumberOfMessagesProcessed() " ) , self . incrementNumberOfMessagesProcessed )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" incrementNumberOfPubkeysProcessed() " ) , self . incrementNumberOfPubkeysProcessed )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" incrementNumberOfBroadcastsProcessed() " ) , self . incrementNumberOfBroadcastsProcessed )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" setStatusIcon(PyQt_PyObject) " ) , self . setStatusIcon )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" rerenderInboxFromLabels() " ) , self . rerenderInboxFromLabels )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" rerenderSubscriptions() " ) , self . rerenderSubscriptions )
QtCore . QObject . connect ( self . UISignalThread , QtCore . SIGNAL (
" removeInboxRowByMsgid(PyQt_PyObject) " ) , self . removeInboxRowByMsgid )
2013-05-02 17:53:54 +02:00
self . UISignalThread . start ( )
2013-06-12 23:12:32 +02:00
# Below this point, it would be good if all of the necessary global data
# structures were initialized.
2013-05-02 17:53:54 +02:00
2013-05-08 22:42:28 +02:00
self . rerenderComboBoxSendFrom ( )
2013-05-02 17:53:54 +02:00
2013-06-12 23:12:32 +02:00
# Show or hide the application window after clicking an item within the
# tray icon or, on Windows, the try icon itself.
2013-05-08 22:42:28 +02:00
def appIndicatorShowOrHideWindow ( self ) :
if not self . actionShow . isChecked ( ) :
self . hide ( )
else :
if sys . platform [ 0 : 3 ] == ' win ' :
self . setWindowFlags ( Qt . Window )
2013-06-12 23:12:32 +02:00
# else:
# self.showMaximized()
2013-05-25 19:59:00 +02:00
self . show ( )
2013-06-12 23:12:32 +02:00
self . setWindowState (
self . windowState ( ) & ~ QtCore . Qt . WindowMinimized | QtCore . Qt . WindowActive )
2013-05-15 18:36:30 +02:00
self . activateWindow ( )
2013-05-07 23:22:34 +02:00
2013-05-10 00:57:46 +02:00
# pointer to the application
2013-06-12 23:12:32 +02:00
# app = None
2013-05-14 17:06:01 +02:00
# The most recent message
newMessageItem = None
# The most recent broadcast
newBroadcastItem = None
2013-05-07 23:22:34 +02:00
# show the application window
def appIndicatorShow ( self ) :
2013-06-12 23:12:32 +02:00
if self . actionShow is None :
2013-05-07 23:22:34 +02:00
return
2013-05-14 17:44:51 +02:00
if not self . actionShow . isChecked ( ) :
self . actionShow . setChecked ( True )
self . appIndicatorShowOrHideWindow ( )
2013-05-07 23:22:34 +02:00
2013-05-13 13:20:29 +02:00
# unchecks the show item on the application indicator
def appIndicatorHide ( self ) :
2013-06-12 23:12:32 +02:00
if self . actionShow is None :
2013-05-13 13:20:29 +02:00
return
2013-05-14 17:44:51 +02:00
if self . actionShow . isChecked ( ) :
self . actionShow . setChecked ( False )
self . appIndicatorShowOrHideWindow ( )
2013-05-13 13:20:29 +02:00
2013-05-07 23:22:34 +02:00
# application indicator show or hide
2013-05-08 22:42:28 +02:00
""" # application indicator show or hide
2013-05-07 23:22:34 +02:00
def appIndicatorShowBitmessage ( self ) :
2013-05-08 22:42:28 +02:00
#if self.actionShow == None:
# return
print self . actionShow . isChecked ( )
2013-05-07 23:22:34 +02:00
if not self . actionShow . isChecked ( ) :
self . hide ( )
2013-05-08 22:42:28 +02:00
#self.setWindowState(self.windowState() & QtCore.Qt.WindowMinimized)
2013-05-07 23:22:34 +02:00
else :
2013-05-08 22:42:28 +02:00
self . appIndicatorShowOrHideWindow ( ) """
2013-05-07 23:22:34 +02:00
2013-05-10 21:47:01 +02:00
# Show the program window and select inbox tab
2013-05-11 19:30:49 +02:00
def appIndicatorInbox ( self , mm_app , source_id ) :
2013-05-10 21:47:01 +02:00
self . appIndicatorShow ( )
2013-05-13 23:34:08 +02:00
# select inbox