コード例 #1
0
ファイル: gui.py プロジェクト: figure002/bioden
    def on_load_data_failed(self, sender, strerror, data=None):
        """Show a error dialog showing that loading the data has failed."""
        self.progress_dialog.destroy()

        builder = Gtk.Builder()
        builder.add_from_file( resource_filename('glade/error_dialog.glade') )
        dialog = builder.get_object('error_dialog')
        dialog.set_transient_for(self.window)

        if ".csv" in self.filter_name:
            message = ("The data could not be loaded. This is probably caused "
                "by an incorrect input file or the CSV file was in a different "
                "format. If the CSV file was in a different format, change "
                "the settings under \"CSV Input File Options\" accordingly "
                "and make sure the format matches the format described in the "
                "documentation.")
        elif ".xls" in self.filter_name:
            message = ("The data could not be loaded. This is probably caused "
                "by an incorrect input file or the XLS file was in a different "
                "format. Make sure the format matches the format described in "
                "the documentation.")

        dialog.format_secondary_text(message)
        textbuffer = builder.get_object('textbuffer_details')
        textbuffer.set_text(strerror)
        dialog.run()
        dialog.destroy()
コード例 #2
0
ファイル: gui.py プロジェクト: figure002/bioden
 def __init__(self, parent=None):
     self.worker = None
     self.builder = Gtk.Builder()
     self.builder.add_from_file( resource_filename('glade/progress_dialog.glade') )
     self.dialog = self.builder.get_object('progress_dialog')
     self.dialog.set_transient_for(parent)
     self.progress_bar = self.builder.get_object('progress_bar')
     self.label_action = self.builder.get_object('label_action')
     self.textview = self.builder.get_object('textview_details')
     self.textbuffer = self.builder.get_object('textbuffer_details')
     self.builder.connect_signals(self)
     self.dialog.show()
コード例 #3
0
ファイル: gui.py プロジェクト: figure002/bioden
    def __init__(self):
        self.builder = Gtk.Builder()
        self.builder.add_from_file( resource_filename('glade/main.glade') )
        self.window = self.builder.get_object('main_window')
        self.combobox_property = self.builder.get_object('combobox_property')
        self.combobox_output_format = self.builder.get_object('combobox_output_format')

        # Connect the window signals to the handlers.
        self.builder.connect_signals(self)

        # Reset the widgets.
        self.reset_widgets()

        # Set additional signal handlers.
        self.handlers = {
            'process-finished': bioden.std.sender.connect('process-finished',
                self.on_process_finished),
            'load-data-failed': bioden.std.sender.connect('load-data-failed',
                self.on_load_data_failed)
        }