Beispiel #1
0
    def update_blocks(self, blocks):
        """
        This methods update all blocks loaded for each library.

            :param blocks: blocks to update
            :return: None
        """
        languages = []

        while self.get_n_pages() > 0:
            self.remove_page(0)
            self.tabs.pop()

        for x in blocks:
            instance = blocks[x]
            name = instance.language
            name += "/" + instance.extension
            if name in languages:
                continue
            languages.append(name)

        for language in languages:
            treeview = BlocksTreeView(self.main_window, language, blocks)
            self.append_page(treeview, Gtk.Label.new(language))
            self.tabs.append(treeview)
        self.show_all()
Beispiel #2
0
    def update(self):
        languages = []

        while self.get_n_pages() > 0:
            self.remove_page(0)

        System()
        for x in System.plugins:
            instance = System.plugins[x]
            name = instance.language
            name += "/" + instance.framework
            if name in languages:
                continue
            languages.append(name)

        for language in languages:
            treeview = BlocksTreeView(self.main_window, language)
            self.append_page(treeview, Gtk.Label(language))
        self.show_all()
Beispiel #3
0
    def __init__(self):
        s2idirectory.load()
        Gtk.Window.__init__(self, title="Harpia")
        #self.set_default_size(800,600)
        self.set_property("height_request", 500)
        self.maximize()
        self.set_size_request(900, 500)  #Controla o tamanho minimo
        self.main_control = MainControl(self)
        self.connect("check-resize", self.__resize)

        #GUI components
        self.menu = Menu(self)
        self.toolbar = Toolbar(self)
        self.search = SearchBar(self)
        self.blocks_tree_view = BlocksTreeView(self)
        self.block_properties = BlockProperties(self)
        self.work_area = WorkArea(self)
        self.status = Status(self)
        s2idirectory.Log = self.status

        # vbox main
        # -----------------------------------------------------
        # | Menu
        # -----------------------------------------------------
        # | Toolbar
        # -----------------------------------------------------
        # | V Paned bottom
        # -----------------------------------------------------

        # First Vertical Box
        vbox_main = Gtk.VBox()
        self.add(vbox_main)
        vbox_main.pack_start(self.menu, False, True, 0)
        vbox_main.pack_start(self.toolbar, False, False, 0)
        self.vpaned_bottom = Gtk.Paned.new(Gtk.Orientation.VERTICAL)
        vbox_main.add(self.vpaned_bottom)

        # vpaned_bottom
        # -----------------------------------------------------
        # | hpaned_work_area
        # =====================================================
        # | status
        # -----------------------------------------------------

        hpaned_work_area = Gtk.HPaned()
        self.vpaned_bottom.add1(hpaned_work_area)
        self.vpaned_bottom.add2(self.__create_frame(self.status))
        self.vpaned_bottom.set_position(420)
        self.vpaned_bottom.set_size_request(50, 50)

        # hpaned_work_area
        # -----------------------------------------------------
        # | vbox_left      ||   work_area
        # -----------------------------------------------------
        vbox_left = Gtk.VBox(False, 0)
        hpaned_work_area.add1(vbox_left)
        hpaned_work_area.add2(self.work_area)

        # vbox_left
        # -----------------------------------------------------
        # |search
        # -----------------------------------------------------
        # |vpaned_left
        # -----------------------------------------------------

        vbox_left.pack_start(self.search, False, False, 0)
        self.vpaned_left = Gtk.VPaned()
        vbox_left.pack_start(self.vpaned_left, True, True, 0)

        # vpaned_left
        # -----------------------------------------------------
        # |blocks_tree_view
        # =====================================================
        # | block_properties
        # -----------------------------------------------------

        self.vpaned_left.add1(self.__create_frame(self.blocks_tree_view))
        self.vpaned_left.add2(self.__create_frame(self.block_properties))
        self.vpaned_left.set_position(300)
        #self.vpaned_left.set_size_request(50,50)
        #self.vpaned_left.set_property("min-position",150)

        self.connect("delete-event", self.quit)

        # Load Examples
        list_of_examples = glob(os.environ['HARPIA_DATA_DIR'] + "examples/*")
        list_of_examples.sort()

        for example in list_of_examples:
            self.menu.add_example(example)

        self.menu.add_recent_file("/home/flavio/Desktop/harpiaTest.hrp")
        self.menu.add_recent_file("/home/flavio/Desktop/harpiaTest2.hrp")