Esempio n. 1
0
    def edit_items(self):
        sel = self.listview.GetFirstSelected()

        exists = False
        warning = False

        while sel > -1:
            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.open_editor(filename, id_)

                exists = True
            else:
                warning = True

            sel = self.listview.GetNextSelected(sel)

        if warning:
            if exists:
                msgboxes.some_items_not_found().ShowModal()
            else:
                msgboxes.all_items_not_found().ShowModal()
Esempio n. 2
0
    def edit_items(self):
        sel = self.listview.GetFirstSelected()

        exists = False
        warning = False

        while sel > -1:
            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.open_editor(filename, id_)

                exists = True
            else:
                warning = True

            sel = self.listview.GetNextSelected(sel)

        if warning:
            if exists:
                msgboxes.some_items_not_found().ShowModal()
            else:
                msgboxes.all_items_not_found().ShowModal()
Esempio n. 3
0
 def _open(self, event):
     wxgui_api.show_main_window()
     wxgui_api.open_editor(self.filename, self.id_)
Esempio n. 4
0
 def _open(self, event):
     wxgui_api.show_main_window()
     wxgui_api.open_editor(self.filename, self.id_)