Beispiel #1
0
    def update_items(self, kwargs):
        if kwargs['menu'] is self:
            if core_api.get_databases_count() > 0:
                self.search.Enable()
            else:
                self.search.Enable(False)

            mainview = self.get_selected_search()

            if mainview:
                self.refresh.Enable()

                sel = mainview.results.listview.GetFirstSelected()

                if sel > -1:
                    self.find.Enable()
                    self.edit.Enable()
                else:
                    self.find.Enable(False)
                    self.edit.Enable(False)

            else:
                self.refresh.Enable(False)
                self.find.Enable(False)
                self.edit.Enable(False)
Beispiel #2
0
    def update_items(self, kwargs):
        if kwargs['menu'] is self:
            if core_api.get_databases_count() > 0:
                self.search.Enable()
            else:
                self.search.Enable(False)

            mainview = self.get_selected_search()

            if mainview:
                self.refresh.Enable()

                sel = mainview.results.listview.GetFirstSelected()

                if sel > -1:
                    self.find.Enable()
                    self.edit.Enable()
                else:
                    self.find.Enable(False)
                    self.edit.Enable(False)

            else:
                self.refresh.Enable(False)
                self.find.Enable(False)
                self.edit.Enable(False)
Beispiel #3
0
def print_all_db():
    print('Open databases: {}'.format(core_api.get_databases_count()))

    for filename in core_api.get_open_databases():
        print_db(filename)

    print_memory_db()
Beispiel #4
0
def print_all_db():
    print('Open databases: {}'.format(core_api.get_databases_count()))

    for filename in core_api.get_open_databases():
        print_db(filename)

    print_memory_db()
Beispiel #5
0
def _select_database():
    dbn = core_api.get_databases_count()
    dbid = wxgui_api.get_selected_database_tab_index()
    if dbid > -1:
        choices = [dbid] * 3 + range(dbn)
        wxgui_api.select_database_tab_index(random.choice(choices))
        return True
    else:
        return False
Beispiel #6
0
def _select_database():
    dbn = core_api.get_databases_count()
    dbid = wxgui_api.get_selected_database_tab_index()
    if dbid > -1:
        choices = [dbid] * 3 + range(dbn)
        wxgui_api.select_database_tab_index(random.choice(choices))
        return True
    else:
        return False
Beispiel #7
0
 def new_search(self, event):
     if core_api.get_databases_count() > 0:
         SearchView.open_()
Beispiel #8
0
 def _handle_close_database(self, kwargs):
     if core_api.get_databases_count() < 1:
         self.close_()
Beispiel #9
0
 def new_search(self, event):
     if core_api.get_databases_count() > 0:
         SearchView.open_()
Beispiel #10
0
 def _handle_close_database(self, kwargs):
     if core_api.get_databases_count() < 1:
         self.close_()