コード例 #1
0
ファイル: __init__.py プロジェクト: xguse/outspline
    def find_in_tree(self):
        sel = self.get_selections()

        if len(sel) > 0:
            wxgui_api.unselect_all_items(self.filename)

            # Do not loop directly on view.GetSelections(), e.g.
            #   for s in view.GetSelections():
            # because it doesn't work as expected!
            for item in sel:
                id_ = self.get_item_id(item)

                # The logged item may not exist anymore
                if core_api.is_item(self.filename, id_):
                    wxgui_api.add_item_to_selection(self.filename, id_)
コード例 #2
0
ファイル: __init__.py プロジェクト: mikpim01/outspline
    def find_in_tree(self):
        sel = self.get_selections()

        if len(sel) > 0:
            wxgui_api.unselect_all_items(self.filename)

            # Do not loop directly on view.GetSelections(), e.g.
            #   for s in view.GetSelections():
            # because it doesn't work as expected!
            for item in sel:
                id_ = self.get_item_id(item)

                # The logged item may not exist anymore
                if core_api.is_item(self.filename, id_):
                    wxgui_api.add_item_to_selection(self.filename, id_)
コード例 #3
0
ファイル: __init__.py プロジェクト: xguse/outspline
    def find_in_tree(self):
        sel = self.listview.GetFirstSelected()

        if sel > -1:
            for filename in core_api.get_open_databases():
                wxgui_api.unselect_all_items(filename)

            seldb = None
            warning = False

            # [1]: line repeated in the loop because of
            # wxgui_api.select_database_tab
            filename, id_ = self.itemdatamap[self.listview.GetItemData(sel)]

            while True:
                # It's necessary to repeat this line (see [1]) because
                # wxgui_api.select_database_tab must be executed only once
                # for the first selected item
                filename, id_ = self.itemdatamap[self.listview.GetItemData(
                                                                        sel)]

                # Check whether the database is still open and the item
                # still exists because the search results are retrieved in
                # a separate thread and are not updated together with the
                # database
                if core_api.is_database_open(filename) and \
                                        core_api.is_item(filename, id_):
                    wxgui_api.add_item_to_selection(filename, id_)

                    if seldb is None:
                        seldb = filename
                else:
                    warning = True

                sel = self.listview.GetNextSelected(sel)

                if sel < 0:
                    break

            if seldb:
                wxgui_api.select_database_tab(seldb)

                if warning:
                    msgboxes.some_items_not_found().ShowModal()
            elif warning:
                msgboxes.all_items_not_found().ShowModal()
コード例 #4
0
    def find_in_tree(self):
        sel = self.listview.GetFirstSelected()

        if sel > -1:
            for filename in core_api.get_open_databases():
                wxgui_api.unselect_all_items(filename)

            seldb = None
            warning = False

            # [1]: line repeated in the loop because of
            # wxgui_api.select_database_tab
            filename, id_ = self.itemdatamap[self.listview.GetItemData(sel)]

            while True:
                # It's necessary to repeat this line (see [1]) because
                # wxgui_api.select_database_tab must be executed only once
                # for the first selected item
                filename, id_ = self.itemdatamap[self.listview.GetItemData(
                    sel)]

                # Check whether the database is still open and the item
                # still exists because the search results are retrieved in
                # a separate thread and are not updated together with the
                # database
                if core_api.is_database_open(filename) and \
                                        core_api.is_item(filename, id_):
                    wxgui_api.add_item_to_selection(filename, id_)

                    if seldb is None:
                        seldb = filename
                else:
                    warning = True

                sel = self.listview.GetNextSelected(sel)

                if sel < 0:
                    break

            if seldb:
                wxgui_api.select_database_tab(seldb)

                if warning:
                    msgboxes.some_items_not_found().ShowModal()
            elif warning:
                msgboxes.all_items_not_found().ShowModal()