class ZImportZBWProfileDialog(ZNewProfileDialog): def __init__(self, parent, profilesModel): ZNewProfileDialog.__init__(self, parent, profilesModel) # end __init__() def getPathToJoeyProfile(self): return self.profileJoeyPathCtrl.getPath() # end getPathToJoeyProfile() def _createNonHeaderWidgets(self): self.profileJoeyPathLabel = wx.StaticText(self, wx.ID_ANY, _extstr(u"importprofile.OldProfilePath:")) #$NON-NLS-1$ self.profileJoeyPathCtrl = ZValidatingFileChooserCtrl(ZProfileJoeyPathValidator(), self, ZFCC_DIRECTORY_TYPE, _extstr(u"importprofile.ChoosePathDialogTitle")) #$NON-NLS-1$ self.profileJoeyPathCtrl.SetToolTipString(_extstr(u"importprofile.EnterZBW1XPathTooltip")); #$NON-NLS-1$ ZNewProfileDialog._createNonHeaderWidgets(self) # end _createNonHeaderWidgets() def _layoutAdditionalNonHeaderWidgets(self, sizer): #@UnusedVariable sizer.Add(self.profileJoeyPathLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) sizer.Add(self.profileJoeyPathCtrl, 0, wx.EXPAND | wx.RIGHT, 5) # end _layoutAdditionalNonHeaderWidgets() def setJoeyProfilePath(self, joeyProfilePath): self.profileJoeyPathCtrl.setPath(joeyProfilePath) # end setJoeyProfilePath() def _bindWidgetEvents(self): ZNewProfileDialog._bindWidgetEvents(self) self._bindValidatingWidget(self.profileJoeyPathCtrl) # end _bindWidgetEvents() def _setInitialFocus(self): self.profileJoeyPathCtrl.SetFocus() # end _setInitialFocus() def _getHeaderTitle(self): return _extstr(u"importprofile.ImportProfile") #$NON-NLS-1$ # end _getHeaderTitle() def _getHeaderMessage(self): return _extstr(u"importprofile.ImportDialogHeaderMsg") #$NON-NLS-1$ # end _getHeaderMessage() def _getHeaderImagePath(self): return u"images/profile/import_dialog/header_image.png" #$NON-NLS-1$
class ZNewProfileDialog(ZValidatingHeaderDialog): def __init__(self, parent, profilesModel): self.profilesModel = profilesModel ZValidatingHeaderDialog.__init__( self, parent, wx.ID_ANY, _extstr(u"newprofile.CreateNewProfile")) #$NON-NLS-1$ # Tell the dialog to resize itself to best-fit its children. self.Fit() # end __init__() def getProfileInfo(self): return (self.profileNameText.GetValue(), self.profilePathCtrl.getPath()) # end getProfileInfo() def _createNonHeaderWidgets(self): self.profileInfoStaticBox = wx.StaticBox( self, label=_extstr(u"newprofile.ProfileInfo")) #$NON-NLS-1$ self.profileNameLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"newprofile.Name:")) #$NON-NLS-1$ self.profileNameText = ZValidatingTextCtrl(ZProfileNameValidator( self.profilesModel), self, wx.ID_ANY, size=wx.Size(325, -1)) self.profileNameText.SetToolTipString( _extstr(u"newprofile.ProfileNameTooltip")) #$NON-NLS-1$ self.profilePathLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"newprofile.Path:")) #$NON-NLS-1$ self.profilePathCtrl = ZValidatingFileChooserCtrl( ZProfilePathValidator(), self, ZFCC_DIRECTORY_TYPE, _extstr(u"newprofile.ChooseAProfileLocation")) #$NON-NLS-1$ self.profilePathCtrl.SetToolTipString( _extstr(u"newprofile.ProfilePathTooltip")) #$NON-NLS-1$ # end _createNonHeaderWidgets() def _populateNonHeaderWidgets(self): # populate with something? pass # end _populateNonHeaderWidgets() def _layoutNonHeaderWidgets(self): # Flexible grid sizer where all of the label->text ctrl pairs will live flexGridSizer = wx.FlexGridSizer(3, 2, 5, 5) flexGridSizer.AddGrowableCol(1) # NOTE: Called so that the import profile dialog can add widgets. self._layoutAdditionalNonHeaderWidgets(flexGridSizer) flexGridSizer.Add(self.profileNameLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) flexGridSizer.Add(self.profileNameText, 0, wx.EXPAND | wx.RIGHT, 5) flexGridSizer.Add(self.profilePathLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) flexGridSizer.Add(self.profilePathCtrl, 0, wx.EXPAND | wx.RIGHT, 5) # Static box sizer that has a label of "Profile Info" staticBoxSizer = wx.StaticBoxSizer(self.profileInfoStaticBox, wx.VERTICAL) staticBoxSizer.AddSizer(flexGridSizer, 0, wx.EXPAND | wx.ALL, 5) return staticBoxSizer # end _layoutNonHeaderWidgets() def _layoutAdditionalNonHeaderWidgets(self, sizer): #@UnusedVariable pass # end _layoutAdditionalNonHeaderWidgets() def _bindWidgetEvents(self): self._bindValidatingWidget(self.profileNameText) self._bindValidatingWidget(self.profilePathCtrl) # end _bindWidgetEvents() def _setInitialFocus(self): self.profileNameText.SetFocus() # end _setInitialFocus() def _getHeaderTitle(self): return _extstr(u"newprofile.NewProfile") #$NON-NLS-1$ # end _getHeaderTitle() def _getHeaderMessage(self): return _extstr(u"newprofile.DialogUseMsg") #$NON-NLS-1$ # end _getHeaderMessage() def _getHeaderImagePath(self): return u"images/profile/new_dialog/header_image.png" #$NON-NLS-1$ # end _getHeaderImagePath() def setProfilePath(self, path): self.profilePathCtrl.setPath(path) # end setProfilePath() def setProfileName(self, name): self.profileNameText.SetValue(name)
class ZImportZBWProfileDialog(ZNewProfileDialog): def __init__(self, parent, profilesModel): ZNewProfileDialog.__init__(self, parent, profilesModel) # end __init__() def getPathToJoeyProfile(self): return self.profileJoeyPathCtrl.getPath() # end getPathToJoeyProfile() def _createNonHeaderWidgets(self): self.profileJoeyPathLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"importprofile.OldProfilePath:")) #$NON-NLS-1$ self.profileJoeyPathCtrl = ZValidatingFileChooserCtrl( ZProfileJoeyPathValidator(), self, ZFCC_DIRECTORY_TYPE, _extstr(u"importprofile.ChoosePathDialogTitle")) #$NON-NLS-1$ self.profileJoeyPathCtrl.SetToolTipString( _extstr(u"importprofile.EnterZBW1XPathTooltip")) #$NON-NLS-1$ ZNewProfileDialog._createNonHeaderWidgets(self) # end _createNonHeaderWidgets() def _layoutAdditionalNonHeaderWidgets(self, sizer): #@UnusedVariable sizer.Add(self.profileJoeyPathLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) sizer.Add(self.profileJoeyPathCtrl, 0, wx.EXPAND | wx.RIGHT, 5) # end _layoutAdditionalNonHeaderWidgets() def setJoeyProfilePath(self, joeyProfilePath): self.profileJoeyPathCtrl.setPath(joeyProfilePath) # end setJoeyProfilePath() def _bindWidgetEvents(self): ZNewProfileDialog._bindWidgetEvents(self) self._bindValidatingWidget(self.profileJoeyPathCtrl) # end _bindWidgetEvents() def _setInitialFocus(self): self.profileJoeyPathCtrl.SetFocus() # end _setInitialFocus() def _getHeaderTitle(self): return _extstr(u"importprofile.ImportProfile") #$NON-NLS-1$ # end _getHeaderTitle() def _getHeaderMessage(self): return _extstr(u"importprofile.ImportDialogHeaderMsg") #$NON-NLS-1$ # end _getHeaderMessage() def _getHeaderImagePath(self): return u"images/profile/import_dialog/header_image.png" #$NON-NLS-1$
class ZNewProfileDialog(ZValidatingHeaderDialog): def __init__(self, parent, profilesModel): self.profilesModel = profilesModel ZValidatingHeaderDialog.__init__(self, parent, wx.ID_ANY, _extstr(u"newprofile.CreateNewProfile")) #$NON-NLS-1$ # Tell the dialog to resize itself to best-fit its children. self.Fit() # end __init__() def getProfileInfo(self): return ( self.profileNameText.GetValue(), self.profilePathCtrl.getPath() ) # end getProfileInfo() def _createNonHeaderWidgets(self): self.profileInfoStaticBox = wx.StaticBox(self, label = _extstr(u"newprofile.ProfileInfo")) #$NON-NLS-1$ self.profileNameLabel = wx.StaticText(self, wx.ID_ANY, _extstr(u"newprofile.Name:")) #$NON-NLS-1$ self.profileNameText = ZValidatingTextCtrl(ZProfileNameValidator(self.profilesModel), self, wx.ID_ANY, size = wx.Size(325, -1)) self.profileNameText.SetToolTipString(_extstr(u"newprofile.ProfileNameTooltip")) #$NON-NLS-1$ self.profilePathLabel = wx.StaticText(self, wx.ID_ANY, _extstr(u"newprofile.Path:")) #$NON-NLS-1$ self.profilePathCtrl = ZValidatingFileChooserCtrl(ZProfilePathValidator(), self, ZFCC_DIRECTORY_TYPE, _extstr(u"newprofile.ChooseAProfileLocation")) #$NON-NLS-1$ self.profilePathCtrl.SetToolTipString(_extstr(u"newprofile.ProfilePathTooltip")) #$NON-NLS-1$ # end _createNonHeaderWidgets() def _populateNonHeaderWidgets(self): # populate with something? pass # end _populateNonHeaderWidgets() def _layoutNonHeaderWidgets(self): # Flexible grid sizer where all of the label->text ctrl pairs will live flexGridSizer = wx.FlexGridSizer(3, 2, 5, 5) flexGridSizer.AddGrowableCol(1) # NOTE: Called so that the import profile dialog can add widgets. self._layoutAdditionalNonHeaderWidgets(flexGridSizer) flexGridSizer.Add(self.profileNameLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) flexGridSizer.Add(self.profileNameText, 0, wx.EXPAND | wx.RIGHT, 5) flexGridSizer.Add(self.profilePathLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) flexGridSizer.Add(self.profilePathCtrl, 0, wx.EXPAND | wx.RIGHT, 5) # Static box sizer that has a label of "Profile Info" staticBoxSizer = wx.StaticBoxSizer(self.profileInfoStaticBox, wx.VERTICAL) staticBoxSizer.AddSizer(flexGridSizer, 0, wx.EXPAND | wx.ALL, 5) return staticBoxSizer # end _layoutNonHeaderWidgets() def _layoutAdditionalNonHeaderWidgets(self, sizer): #@UnusedVariable pass # end _layoutAdditionalNonHeaderWidgets() def _bindWidgetEvents(self): self._bindValidatingWidget(self.profileNameText) self._bindValidatingWidget(self.profilePathCtrl) # end _bindWidgetEvents() def _setInitialFocus(self): self.profileNameText.SetFocus() # end _setInitialFocus() def _getHeaderTitle(self): return _extstr(u"newprofile.NewProfile") #$NON-NLS-1$ # end _getHeaderTitle() def _getHeaderMessage(self): return _extstr(u"newprofile.DialogUseMsg") #$NON-NLS-1$ # end _getHeaderMessage() def _getHeaderImagePath(self): return u"images/profile/new_dialog/header_image.png" #$NON-NLS-1$ # end _getHeaderImagePath() def setProfilePath(self, path): self.profilePathCtrl.setPath(path) # end setProfilePath() def setProfileName(self, name): self.profileNameText.SetValue(name)