Show
Ignore:
Timestamp:
02/02/06 16:13:01 (18 years ago)
Author:
jerome
Message:

Now the network dialog is binary safe.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykoticon/trunk/bin/pykoticon

    r106 r107  
    8484    def export_quitApplication(self) :     
    8585        """Makes the application quit.""" 
    86         self.logDebug("Remote host asked to close the application.") 
    8786        self.frame.quitEvent.set() 
    8887        wx.CallAfter(self.frame.OnClose, None) 
     
    9190    def export_askDatas(self, labels, varnames, varvalues) : 
    9291        """Asks some textual datas defined by a list of labels, a list of variables' names and a list of variables values in a mapping.""" 
    93         wx.CallAfter(self.frame.askDatas, labels, varnames, varvalues) 
     92        values = {} 
     93        for (k, v) in varvalues.items() : 
     94            values[k] = v.data 
     95        wx.CallAfter(self.frame.askDatas, [ v.data for v in labels ], \ 
     96                                          varnames, \ 
     97                                          values) 
     98        # ugly, isn't it ? 
     99        while self.frame.dialogAnswer is None : 
     100            time.sleep(0.1) 
     101        retcode = self.frame.dialogAnswer     
     102        for (k, v) in retcode.items() : 
     103            if k != "isValid" : 
     104                retcode[k] = xmlrpclib.Binary(v) 
     105        self.frame.dialogAnswer = None # prepare for next call, just in case 
     106        return retcode 
     107         
     108    def export_showDialog(self, message, yesno) : 
     109        """Opens a notification or confirmation dialog.""" 
     110        wx.CallAfter(self.frame.showDialog, message.data, yesno) 
    94111        # ugly, isn't it ? 
    95112        while self.frame.dialogAnswer is None : 
     
    99116        return retcode 
    100117         
    101     def export_showDialog(self, message, yesno) : 
    102         """Opens a notification or confirmation dialog.""" 
    103         wx.CallAfter(self.frame.showDialog, message, yesno) 
    104         # ugly, isn't it ? 
    105         while self.frame.dialogAnswer is None : 
    106             time.sleep(0.1) 
    107         retcode = self.frame.dialogAnswer     
    108         self.frame.dialogAnswer = None # prepare for next call, just in case 
    109         return retcode 
    110          
    111118    def export_nop(self) :     
    112119        """Does nothing, but allows a clean shutdown from the frame itself.""" 
    113         self.logDebug("No operation !") 
    114120        return True 
    115121