kopia lustrzana https://github.com/ctjacobs/pyqso
Added 'record count' feature.
rodzic
f816554816
commit
7055f4f67d
|
@ -11,6 +11,7 @@
|
||||||
- More unit tests.
|
- More unit tests.
|
||||||
- More tooltips.
|
- More tooltips.
|
||||||
- The option to enter the frequency in Hz, kHz, MHz, or GHz in the Add/Edit Record dialog. Frequencies are still displayed in MHz in the logbook.
|
- The option to enter the frequency in Hz, kHz, MHz, or GHz in the Add/Edit Record dialog. Frequencies are still displayed in MHz in the logbook.
|
||||||
|
- Record/QSO count feature.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Using username and port information (in addition to hostname) when creating an identifier for a DX cluster bookmark.
|
- Using username and port information (in addition to hostname) when creating an identifier for a DX cluster bookmark.
|
||||||
|
|
|
@ -740,7 +740,7 @@ class Logbook:
|
||||||
printer = Printer(self.application)
|
printer = Printer(self.application)
|
||||||
printer.print_records(records)
|
printer.print_records(records)
|
||||||
else:
|
else:
|
||||||
error(self.application.window, "Could not retrieve the records from the SQL database. No records have been printed.")
|
error(parent=self.application.window, message="Could not retrieve the records from the SQL database. No records have been printed.")
|
||||||
return
|
return
|
||||||
|
|
||||||
def add_record_callback(self, widget):
|
def add_record_callback(self, widget):
|
||||||
|
@ -929,6 +929,19 @@ class Logbook:
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def record_count_callback(self, widget=None):
|
||||||
|
""" Show the record count for the selected log. """
|
||||||
|
page_index = self.notebook.get_current_page() # Get the index of the selected tab in the logbook.
|
||||||
|
if(page_index == 0): # If we are on the Summary page...
|
||||||
|
logging.debug("No log currently selected!")
|
||||||
|
return
|
||||||
|
log_index = self.get_log_index()
|
||||||
|
log = self.logs[log_index]
|
||||||
|
record_count = log.record_count
|
||||||
|
if(record_count is not None):
|
||||||
|
info(parent=self.application.window, message="Log '%s' contains %d records." % (log.name, record_count))
|
||||||
|
return
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def log_count(self):
|
def log_count(self):
|
||||||
""" Return the total number of logs in the logbook.
|
""" Return the total number of logs in the logbook.
|
||||||
|
|
|
@ -108,6 +108,10 @@ class Menu:
|
||||||
self.items["REMOVE_DUPLICATES"] = self.builder.get_object("mitem_remove_duplicates")
|
self.items["REMOVE_DUPLICATES"] = self.builder.get_object("mitem_remove_duplicates")
|
||||||
self.items["REMOVE_DUPLICATES"].connect("activate", self.application.logbook.remove_duplicates_callback)
|
self.items["REMOVE_DUPLICATES"].connect("activate", self.application.logbook.remove_duplicates_callback)
|
||||||
|
|
||||||
|
# Record count
|
||||||
|
self.items["RECORD_COUNT"] = self.builder.get_object("mitem_record_count")
|
||||||
|
self.items["RECORD_COUNT"].connect("activate", self.application.logbook.record_count_callback)
|
||||||
|
|
||||||
# View toolbox
|
# View toolbox
|
||||||
self.items["TOOLBOX"] = self.builder.get_object("mitem_toolbox")
|
self.items["TOOLBOX"] = self.builder.get_object("mitem_toolbox")
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
|
@ -160,7 +164,7 @@ class Menu:
|
||||||
:arg bool sensitive: If True, enable all the record-related menu items. If False, disable them all.
|
:arg bool sensitive: If True, enable all the record-related menu items. If False, disable them all.
|
||||||
"""
|
"""
|
||||||
logging.debug("Setting record-related menu item sensitivity to: %s..." % sensitive)
|
logging.debug("Setting record-related menu item sensitivity to: %s..." % sensitive)
|
||||||
for item_name in ["ADD_RECORD", "EDIT_RECORD", "DELETE_RECORD", "REMOVE_DUPLICATES"]:
|
for item_name in ["ADD_RECORD", "EDIT_RECORD", "DELETE_RECORD", "REMOVE_DUPLICATES", "RECORD_COUNT"]:
|
||||||
self.items[item_name].set_sensitive(sensitive)
|
self.items[item_name].set_sensitive(sensitive)
|
||||||
logging.debug("Set record-related menu item sensitivity to: %s." % sensitive)
|
logging.debug("Set record-related menu item sensitivity to: %s." % sensitive)
|
||||||
return
|
return
|
||||||
|
|
|
@ -347,6 +347,19 @@
|
||||||
<property name="use_stock">False</property>
|
<property name="use_stock">False</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorMenuItem" id="separatormenuitem7">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="mitem_record_count">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Record Count</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
Ładowanie…
Reference in New Issue