예제 #1
0
    def __init__(self, callback):
        self.gladefile = os.path.join(__location__, "gui", "addtag.glade")
        self.builder = Gtk.Builder()
        self.builder.add_from_file(self.gladefile)

        # Automatically connect signals to functions defined above
        # not needed in commandline
        self.builder.connect_signals(self)

        self.mission_element_combo = self.builder.get_object(
            "missionElementCombo")
        self.tag_type_combo = self.builder.get_object("tagTypeCombo")
        self.tag_name_entry = self.builder.get_object("tagNameEntry")

        #Populate dropdowns
        self.elements = list(get_registered_elements().keys())
        self.elements.sort()
        populate_combo_box(self.mission_element_combo, self.elements)
        self.set_tag_types([])

        #Get the main window
        self.window = self.builder.get_object("addTagWindow")
        self.window.set_type_hint(Gdk.WindowTypeHint.DIALOG)
        self.window.show()

        #Link callback
        self.callback = callback

        self.log.debug("Window created")
예제 #2
0
    def __init__(self, parent):
        self.gladefile = os.path.join(__location__, "gui/testwindow.glade")
        self.builder = Gtk.Builder()
        self.builder.add_from_file(self.gladefile)
        self.parent = parent
        self.t = None
        self.last_frame_time = None
        self.fps_hysteresis = TimedHysteresis(1.0) #1 second hysteresis

        # Automatically connect signals to functions defined above
        self.builder.connect_signals(self)

        self.mission_element_combo = self.builder.get_object("missionElementCombo")
        self.tag_type_combo = self.builder.get_object("tagTypeCombo")
        self.tag_name_entry = self.builder.get_object("tagNameEntry")

        self.progress_bar = self.builder.get_object("progressBar")
        self.percent_text = self.builder.get_object("percentText")
        self.test_info_text = self.builder.get_object("testInfoText")

        self.spin_button = self.builder.get_object("spinButton")
        self.spin_button.set_numeric(True)
        adjustment = Gtk.Adjustment(value=1, lower=1, upper=50, step_incr=1, page_incr=0, page_size=0)
        self.spin_button.set_adjustment(adjustment)
        self.spin_button.set_value(1)

        self.skip_value = 1

        #Add information about the test about to be run
        self.populate_info()

        #Populate mission element dropdown
        self.elements = get_registered_elements().keys()
        self.elements = sorted(self.elements)
        populate_combo_box(self.mission_element_combo, self.elements)

        #Get the main window
        self.window = self.builder.get_object("testWindow")
        self.window.set_type_hint(Gdk.WindowTypeHint.DIALOG)
        self.window.show()

        #Disable the trees to prevent modifications
        self.parent.video_tree.set_sensitive(False)

        self.testing = False

        self.log.debug("Window created")
예제 #3
0
    def __init__(self, callback, location):
        self.gladefile = os.path.join(__location__, location)
        self.builder = Gtk.Builder()
        self.builder.add_from_file(self.gladefile)

        # Automatically connect signals to functions defined above
        self.builder.connect_signals(self)

        #Populate dropdowns
        self.elements = get_registered_elements().keys()
        self.elements = sorted(self.elements)
        populate_combo_box(self.mission_element_combo, self.elements)
        self.set_tag_types([])

        #Get the main window
        self.window = self.builder.get_object("addTagWindow")
        self.window.set_type_hint(Gdk.WindowTypeHint.DIALOG)
        self.window.show()

        #Link callback
        self.callback = callback

        self.log.debug("Window created")
예제 #4
0
 def set_tag_types(self, types):
     types.sort()
     self.tag_types = types
     populate_combo_box(self.tag_type_combo, types)