예제 #1
0
    def on_save_logs(self, button):

        title = _("Save conversation log")

        dialog = gtk.FileChooserDialog(
            title,
            None,
            gtk.FILE_CHOOSER_ACTION_SAVE,
            (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK),
        )

        dialog.set_default_response(gtk.RESPONSE_OK)
        dialog.show_all()

        response = dialog.run()

        while True:
            if response != gtk.RESPONSE_OK:
                break

            if dialog.get_filename():
                path = dialog.get_filename()
                f = open(path, "w")
                f.write(self.textBuffer.get_text(self.textBuffer.get_start_iter(), self.textBuffer.get_end_iter()))
                f.close()

                break

        dialog.hide()
예제 #2
0
    def on_save_logs(self, button):

        title = (_("Save conversation log"))

        dialog = gtk.FileChooserDialog(title, None, \
                                gtk.FILE_CHOOSER_ACTION_SAVE, \
                                (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, \
                                gtk.STOCK_SAVE, gtk.RESPONSE_OK))

        dialog.set_default_response(gtk.RESPONSE_OK)
        dialog.show_all()

        response = dialog.run()

        while True:
            if response != gtk.RESPONSE_OK:
                break

            if dialog.get_filename():
                path = dialog.get_filename()
                f = open(path, "w")
                f.write(self.textBuffer.get_text(self.textBuffer.get_start_iter(),\
                      self.textBuffer.get_end_iter() ))
                f.close()

                break


        dialog.hide()
예제 #3
0
 def get_avi_file(self):
     temp_file=""
     dialog = gtk.FileChooserDialog("Save AVI file...",None,gtk.FILE_CHOOSER_ACTION_SAVE,
         (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file=dialog.get_filename()
     dialog.destroy()
     return temp_file
예제 #4
0
 def get_avi_file(self):
     temp_file = ""
     dialog = gtk.FileChooserDialog("Save AVI file...", None,
                                    gtk.FILE_CHOOSER_ACTION_SAVE,
                                    (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                     gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file = dialog.get_filename()
     dialog.destroy()
     return temp_file
예제 #5
0
 def get_fct_file(self):
     temp_file=""
     dialog = gtk.FileChooserDialog("Choose keyframe...",None,gtk.FILE_CHOOSER_ACTION_OPEN,
         (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     #----setting filters---------
     filter = gtk.FileFilter()
     filter.set_name("gnofract4d files (*.fct)")
     filter.add_pattern("*.fct")
     dialog.add_filter(filter)
     filter = gtk.FileFilter()
     filter.set_name("All files")
     filter.add_pattern("*")
     dialog.add_filter(filter)
     #----------------------------
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file=dialog.get_filename()
     dialog.destroy()
     return temp_file
예제 #6
0
 def get_cfg_file_save(self):
     temp_file=""
     dialog = gtk.FileChooserDialog("Save animation...",None,gtk.FILE_CHOOSER_ACTION_SAVE,
         (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     dialog.set_current_name("animation.fcta")
     #----setting filters---------
     filter = gtk.FileFilter()
     filter.set_name("gnofract4d animation files (*.fcta)")
     filter.add_pattern("*.fcta")
     dialog.add_filter(filter)
     filter = gtk.FileFilter()
     filter.set_name("All files")
     filter.add_pattern("*")
     dialog.add_filter(filter)
     #----------------------------
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file=dialog.get_filename()
     dialog.destroy()
     return temp_file
예제 #7
0
 def get_cfg_file_open(self):
     temp_file=""
     dialog = gtk.FileChooserDialog("Choose animation...",None,gtk.FILE_CHOOSER_ACTION_OPEN,
         (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     #----setting filters---------
     filter = gtk.FileFilter()
     filter.set_name("gnofract4d animation files (*.fcta)")
     filter.add_pattern("*.fcta")
     dialog.add_filter(filter)
     filter = gtk.FileFilter()
     filter.set_name("All files")
     filter.add_pattern("*")
     dialog.add_filter(filter)
     #----------------------------
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file=dialog.get_filename()
     #elif response == gtk.RESPONSE_CANCEL:
     #    print 'Closed, no files selected'
     dialog.destroy()
     return temp_file
예제 #8
0
 def get_fct_file(self):
     temp_file = ""
     dialog = gtk.FileChooserDialog("Choose keyframe...", None,
                                    gtk.FILE_CHOOSER_ACTION_OPEN,
                                    (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                     gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     #----setting filters---------
     filter = gtk.FileFilter()
     filter.set_name("gnofract4d files (*.fct)")
     filter.add_pattern("*.fct")
     dialog.add_filter(filter)
     filter = gtk.FileFilter()
     filter.set_name("All files")
     filter.add_pattern("*")
     dialog.add_filter(filter)
     #----------------------------
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file = dialog.get_filename()
     dialog.destroy()
     return temp_file
예제 #9
0
 def get_cfg_file_save(self):
     temp_file = ""
     dialog = gtk.FileChooserDialog("Save animation...", None,
                                    gtk.FILE_CHOOSER_ACTION_SAVE,
                                    (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                     gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     dialog.set_current_name("animation.fcta")
     #----setting filters---------
     filter = gtk.FileFilter()
     filter.set_name("gnofract4d animation files (*.fcta)")
     filter.add_pattern("*.fcta")
     dialog.add_filter(filter)
     filter = gtk.FileFilter()
     filter.set_name("All files")
     filter.add_pattern("*")
     dialog.add_filter(filter)
     #----------------------------
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file = dialog.get_filename()
     dialog.destroy()
     return temp_file
예제 #10
0
 def get_cfg_file_open(self):
     temp_file = ""
     dialog = gtk.FileChooserDialog("Choose animation...", None,
                                    gtk.FILE_CHOOSER_ACTION_OPEN,
                                    (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                     gtk.STOCK_OPEN, gtk.RESPONSE_OK))
     dialog.set_default_response(gtk.RESPONSE_OK)
     #----setting filters---------
     filter = gtk.FileFilter()
     filter.set_name("gnofract4d animation files (*.fcta)")
     filter.add_pattern("*.fcta")
     dialog.add_filter(filter)
     filter = gtk.FileFilter()
     filter.set_name("All files")
     filter.add_pattern("*")
     dialog.add_filter(filter)
     #----------------------------
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         temp_file = dialog.get_filename()
     #elif response == gtk.RESPONSE_CANCEL:
     #    print 'Closed, no files selected'
     dialog.destroy()
     return temp_file