Browse Source

expanded i18n coverage. Fixed layout issues

pull/90/merge
chriskiehl 9 years ago
parent
commit
a7b0f618e7
4 changed files with 18 additions and 4 deletions
  1. 1
      gooey/gui/image_repository.py
  2. 4
      gooey/gui/widgets/choosers.py
  3. 5
      gooey/gui/widgets/widget_pack.py
  4. 12
      gooey/gui/windows/header.py

1
gooey/gui/image_repository.py

@ -14,6 +14,7 @@ icon = os.path.join(image_dir, "icon.ico")
images = os.path.join(image_dir, "images.jpg") images = os.path.join(image_dir, "images.jpg")
loader = os.path.join(image_dir, "loader.gif") loader = os.path.join(image_dir, "loader.gif")
settings2 = os.path.join(image_dir, "settings2.png") settings2 = os.path.join(image_dir, "settings2.png")
error = os.path.join(image_dir, "error.png")
def _list_images(): def _list_images():

4
gooey/gui/widgets/choosers.py

@ -1,3 +1,5 @@
from gooey.gui.lang import i18n
__author__ = 'Chris' __author__ = 'Chris'
import wx import wx
@ -13,7 +15,7 @@ class AbstractChooser(object):
# parent # parent
self.panel = None self.panel = None
self.button_text = 'Browse'
self.button_text = i18n._('browse')
# Widgets # Widgets
self.title = None self.title = None

5
gooey/gui/widgets/widget_pack.py

@ -1,4 +1,5 @@
from functools import partial from functools import partial
from gooey.gui.lang import i18n
from gooey.gui.util.filedrop import FileDrop from gooey.gui.util.filedrop import FileDrop
__author__ = 'Chris' __author__ = 'Chris'
@ -36,8 +37,8 @@ class WidgetPack(object):
class BaseChooser(WidgetPack): class BaseChooser(WidgetPack):
def __init__(self, button_text='Browse'):
self.button_text = button_text
def __init__(self, button_text=''):
self.button_text = i18n._('browse')
self.option_string = None self.option_string = None
self.parent = None self.parent = None
self.text_box = None self.text_box = None

12
gooey/gui/windows/header.py

@ -29,6 +29,7 @@ class FrameHeader(wx.Panel):
self._settings_img = None self._settings_img = None
self._running_img = None self._running_img = None
self._check_mark = None self._check_mark = None
self._error_symbol = None
self.layouts = {} self.layouts = {}
@ -52,6 +53,7 @@ class FrameHeader(wx.Panel):
self._settings_img = self._load_image(image_repository.settings2, height=79) self._settings_img = self._load_image(image_repository.settings2, height=79)
self._running_img = self._load_image(image_repository.computer3, 79) self._running_img = self._load_image(image_repository.computer3, 79)
self._check_mark = self._load_image(image_repository.alessandro_rei_checkmark, height=75) self._check_mark = self._load_image(image_repository.alessandro_rei_checkmark, height=75)
self._error_symbol = self._load_image(image_repository.error, height=75)
def _do_layout(self): def _do_layout(self):
@ -62,8 +64,10 @@ class FrameHeader(wx.Panel):
sizer.Add(self._settings_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE) sizer.Add(self._settings_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self._running_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE) sizer.Add(self._running_img, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self._check_mark, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE) sizer.Add(self._check_mark, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
sizer.Add(self._error_symbol, 0, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, PAD_SIZE)
self._running_img.Hide() self._running_img.Hide()
self._check_mark.Hide() self._check_mark.Hide()
self._error_symbol.Hide()
vsizer.Add(sizer, 1, wx.EXPAND) vsizer.Add(sizer, 1, wx.EXPAND)
self.SetSizer(vsizer) self.SetSizer(vsizer)
@ -90,6 +94,7 @@ class FrameHeader(wx.Panel):
self._settings_img.Show() self._settings_img.Show()
self._check_mark.Hide() self._check_mark.Hide()
self._running_img.Hide() self._running_img.Hide()
self._error_symbol.Hide()
self.Layout() self.Layout()
def running(): def running():
@ -98,6 +103,7 @@ class FrameHeader(wx.Panel):
self._check_mark.Hide() self._check_mark.Hide()
self._settings_img.Hide() self._settings_img.Hide()
self._running_img.Show() self._running_img.Show()
self._error_symbol.Hide()
self.Layout() self.Layout()
def success(): def success():
@ -108,7 +114,11 @@ class FrameHeader(wx.Panel):
self.Layout() self.Layout()
def error(): def error():
success()
self._header.SetLabel(i18n._('finished_title'))
self._subheader.SetLabel(i18n._('finished_error'))
self._running_img.Hide()
self._error_symbol.Show()
self.Layout()
self.layouts = locals() self.layouts = locals()

Loading…
Cancel
Save