Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 7
0
 def new_search(self, event):
     if core_api.get_databases_count() > 0:
         SearchView.open_()
Exemplo n.º 8
0
 def _handle_close_database(self, kwargs):
     if core_api.get_databases_count() < 1:
         self.close_()
Exemplo n.º 9
0
 def new_search(self, event):
     if core_api.get_databases_count() > 0:
         SearchView.open_()
Exemplo n.º 10
0
 def _handle_close_database(self, kwargs):
     if core_api.get_databases_count() < 1:
         self.close_()