Пример #1
0
 def on_exportButton_clicked(self):
     MainWindow.on_exportButton_clicked(self)
     if self.cap_thread == None or self.ana_thread == None:
         pass
     elif self.cap_thread.is_alive() or self.ana_thread.is_alive():
         if self.capturer.pktSrcType == 'dev':
             QtGui.QMessageBox.information(self, "Information", 
                                           self.tr("You must stop capture first."))
             return False
         elif self.capturer.pktSrcType == 'dump':
             self.on_stopButton_clicked()
     
     fdialog = QtGui.QFileDialog()
     fdialog.setWindowTitle('Save pcap file')
     fname = fdialog.getSaveFileName(filter='pcap file(*.pcap)', directory='/')
     fname = unicode(fname)
     if str(fname) == '':
         return False
     if os.path.exists('~tmp'):
         shutil.move('~tmp', fname)
     return True