Skip to content

Commit

Permalink
Added more strings for UI elements for #570
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Aug 5, 2024
1 parent b75e433 commit d052dd5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
24 changes: 16 additions & 8 deletions bundledApps/WAIL.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,21 +816,25 @@ def view_archive_in_browser(self, button, latest_memento=False):

class WAILGUIFrame_Advanced(wx.Panel):
class ServicesPanel(wx.Panel, threading.Thread):
def make_button(self, label):
return wx.Button(
def make_button(self, label, tooltip=""):
# Ideally this would be abstract and in WAILConfig for reuse, but wxPython needs a reference to the
# parent when creating the button, limiting this function's reuse by other panels
but = wx.Button(
self, wx.ID_ANY, label, style=wx.BU_EXACTFIT
)
but.SetToolTip(tooltip)
return but

def __init__(self, parent):
wx.Panel.__init__(self, parent)

self.fix_wayback = self.make_button(config.button_label_fix)
self.fix_heritrix = self.make_button(config.button_label_fix)
self.fix_memgator = self.make_button(config.button_label_fix)
self.fix_wayback = self.make_button(config.button_label_fix, config.tooltip_fix_wayback)
self.fix_heritrix = self.make_button(config.button_label_fix, config.tooltip_fix_heritrix)
self.fix_memgator = self.make_button(config.button_label_fix, config.tooltip_fix_memgator)

self.kill_wayback = self.make_button(config.button_label_kill)
self.kill_heritrix = self.make_button(config.button_label_kill)
self.kill_memgator = self.make_button(config.button_label_kill)
self.kill_wayback = self.make_button(config.button_label_kill, config.tooltip_kill_wayback)
self.kill_heritrix = self.make_button(config.button_label_kill, config.tooltip_kill_heritrix)
self.kill_memgator = self.make_button(config.button_label_kill, config.tooltip_kill_memgator)

self.status_wayback = wx.StaticText(self, wx.ID_ANY, config.service_enabled_label_NO)
self.status_heritrix = wx.StaticText(self, wx.ID_ANY, config.service_enabled_label_NO)
Expand Down Expand Up @@ -1067,9 +1071,11 @@ def __init__(self, parent):
self.view_wayback_in_browser_button = wx.Button(
self, -1, config.button_label_wayback
)
self.view_wayback_in_browser_button.SetToolTip(config.tooltip_view_wayback)
self.edit_wayback_configuration = wx.Button(
self, -1, config.button_label_edit_wayback_config
)
self.edit_wayback_configuration.SetToolTip(config.tooltip_edit_wayback)
self.view_wayback_in_browser_button.Bind(
wx.EVT_BUTTON, self.open_wayback_in_browser
)
Expand Down Expand Up @@ -1514,11 +1520,13 @@ def __init__(self, parent):
view_archives_folder_button_button = wx.Button(
self, 1, config.button_label_view_archive_files
)
view_archives_folder_button_button.SetToolTip(config.tooltip_view_archives_folder)

view_archives_folder_button_button.Bind(wx.EVT_BUTTON,
self.open_archives_folder)
self.test_update = wx.Button(self, 1,
config.button_label_check_for_updates)
self.test_update.SetToolTip(config.tooltip_check_for_updates)

box = wx.BoxSizer(wx.VERTICAL)
box.Add(view_archives_folder_button_button, 0, wx.EXPAND | wx.ALL, 1)
Expand Down
16 changes: 13 additions & 3 deletions bundledApps/WAILConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,19 @@
tooltip_check_status = (
'Check the local archive to see if captures already exist'
)
tooltip_archive_now = (
'Start a crawl using the current URL'
)
tooltip_archive_now = ('Start a crawl using the current URL')
tooltip_fix_wayback = ('Restart the Wayback replay service')
tooltip_fix_heritrix = ('Restart the Heritrix crawling service')
tooltip_fix_memgator = ('Restart the MemGator aggregation service')
tooltip_kill_wayback = ('Stop the Wayback replay service')
tooltip_kill_heritrix = ('Stop the Heritrix crawling service')
tooltip_kill_memgator = ('Stop the MemGator aggregation service')

tooltip_view_wayback = ('View the archive in your web browser')
tooltip_edit_wayback = ('Edit the OpenWayback configuration file')

tooltip_view_archives_folder = ('View the directory containing the archive files in Finder') # todo: adapt for Win
tooltip_check_for_updates = ('Check if a newer version of WAIL is available (disabled)')

text_statusbar_no_captures = 'There are no local captures for this URL.'
text_statusbar_wayback_not_running = 'Wayback is not running. Click again to fix.'
Expand Down

0 comments on commit d052dd5

Please sign in to comment.