OpenSecurity/bin/opensecurity_tray.pyw
changeset 144 dd472ede7a9f
parent 136 ac117cd7bab1
child 145 758031cf192a
     1.1 --- a/OpenSecurity/bin/opensecurity_tray.pyw	Wed Apr 30 12:06:22 2014 +0200
     1.2 +++ b/OpenSecurity/bin/opensecurity_tray.pyw	Mon May 12 18:00:05 2014 +0200
     1.3 @@ -42,6 +42,8 @@
     1.4  from PyQt4 import QtGui
     1.5  
     1.6  # local
     1.7 +import __init__ as opensecurity
     1.8 +
     1.9  if sys.platform == 'win32' or sys.platform == 'cygwin':
    1.10      from cygwin import Cygwin
    1.11  
    1.12 @@ -102,8 +104,6 @@
    1.13              QtGui.QMessageBox.critical(self.parent(), 'OpenSecurity Error', 'This action is not supported on this platform.\nSorry.')
    1.14              return
    1.15  
    1.16 -        # TODO: HARDCODED ADDRESS OF OPENSECURITYD
    1.17 -        
    1.18          # tell the user to wait
    1.19          d = OpenSecurityWait()
    1.20          d.show()
    1.21 @@ -113,12 +113,9 @@
    1.22          
    1.23              # get a proper browsing VM
    1.24              Cygwin.start_X11()
    1.25 +
    1.26 +            # TODO: HARDCODED ADDRESS OF OPENSECURITYD
    1.27              browsing_vm = urllib2.urlopen('http://127.0.0.1:8080/browsing').readline()
    1.28 -            #dlg_launch_image = os.path.join(sys.path[0], 'launch.pyw')
    1.29 -            #process_command = [sys.executable, dlg_launch_image, browsing_vm, '/usr/bin/iceweasel']
    1.30 -            #process_command = [sys.executable, dlg_launch_image, browsing_vm, '/usr/bin/midori']
    1.31 -            #print(process_command)
    1.32 -            #process = subprocess.Popen(process_command, shell = False)
    1.33              
    1.34          except:
    1.35              d.hide()
    1.36 @@ -149,6 +146,12 @@
    1.37          process = subprocess.Popen(process_command, shell = False)
    1.38              
    1.39              
    1.40 +    def clicked_mail(self):
    1.41 +        """clicked mail"""
    1.42 +        mail_url = 'mailto:feedback@opensecurity.at?subject=Feedback%20zu%20OpenSecuitryi%20' + opensecurity.__version__
    1.43 +        print('mail clicked: ' + mail_url)
    1.44 +    
    1.45 +
    1.46      def setup_ui(self):
    1.47          """create the user interface
    1.48          As for the system tray this is 'just' the context menu.
    1.49 @@ -179,14 +182,19 @@
    1.50          menu.addAction(self.acConfigure)
    1.51          menu.addSeparator()
    1.52  
    1.53 +        self.acMail = menu.addAction('Send feedback mail')
    1.54 +        icon = QtGui.QIcon()
    1.55 +        icon.addPixmap(QtGui.QPixmap(QtCore.QString.fromUtf8(':/opensecurity/gfx/opensecurity_mail_64.png')), QtGui.QIcon.Normal, QtGui.QIcon.Off)
    1.56 +        self.acMail.setIcon(icon)
    1.57          self.acAbout = menu.addAction('About')
    1.58          self.acExit = menu.addAction('Exit')
    1.59 -        
    1.60 +       
    1.61          self.acBrowser.triggered.connect(self.clicked_browser)
    1.62          self.acLaunch.triggered.connect(self.clicked_launch_application)
    1.63          self.acConfigure.triggered.connect(self.clicked_configure)
    1.64          self.acAbout.triggered.connect(self.clicked_about)
    1.65          self.acExit.triggered.connect(self.clicked_exit)
    1.66 +        self.acMail.triggered.connect(self.clicked_mail)
    1.67          
    1.68  
    1.69  def main():