def __init__(self, *args, **kwargs): wx.Panel.__init__(self, *args, **kwargs) self.profileChoice = wx.Choice(self, -1, choices=PIE_CONFIG.get_profile_names()) self.profileChoice.SetStringSelection( PIE_CONFIG.get('TheProfile', 'current_profile')) tta = wx.ToolTip( _('A profile allows you to point Pieberry at different Pieberry directories and databases' )) self.profileChoice.SetToolTip(tta) self.profileaddbt = wx.Button(self, -1, _('Add')) self.rootdirctrl = wx.DirPickerCtrl(self, -1, path=PIE_CONFIG.get( 'Profile', 'rootdir'), style=wx.DIRP_USE_TEXTCTRL) self.rootdirctrl.SetPath(PIE_CONFIG.get('Profile', 'rootdir')) self.rootdiratstart = PIE_CONFIG.get('Profile', 'rootdir') self.desktopdirctrl = wx.DirPickerCtrl(self, -1, path=PIE_CONFIG.get( 'Profile', 'desktopdir'), style=wx.DIRP_USE_TEXTCTRL) self.desktopdirctrl.SetPath(PIE_CONFIG.get('Profile', 'desktopdir')) self.bib_cb = wx.CheckBox( self, -1, _('Export bibliography to pre-specified file')) # style=wx.ALIGN_RIGHT) ttb = wx.ToolTip( _("Setting the bibliography here means that Pieberry won't prompt you for a bibliography file every time you export it." )) self.bib_cb.SetToolTip(ttb) self.bib_cb.SetValue(PIE_CONFIG.getboolean('Profile', 'export_bibtex')) self.bibfilectrl = wx.FilePickerCtrl( self, -1, wildcard="BibTeX files (*.bib;*.bibtex)|*.bib;*.bibtex", style=wx.FLP_USE_TEXTCTRL | wx.FLP_SAVE) if PIE_CONFIG.getboolean('Profile', 'export_bibtex') == True: self.bibfilectrl.Enable(True) else: self.bibfilectrl.Enable(False) self.bibfilectrl.SetPath(PIE_CONFIG.get('Profile', 'bibliography_file')) self.bibexpstarred_cb = wx.CheckBox(self, -1, _('Export starred items only')) ttc = wx.ToolTip( _('Export only starred items with adequate bibliographic data (unchecking will export all with adequate bibliographic data in the library but not project folders)' )) self.bibexpstarred_cb.SetToolTip(ttc) self.bibexpstarred_cb.SetValue( PIE_CONFIG.getboolean('Profile', 'export_starred_only')) self._do_layout() self._do_bindings()
def __init__(self, *args, **kwargs): wx.Panel.__init__(self, *args, **kwargs) self.profileChoice = wx.Choice(self, -1, choices=PIE_CONFIG.get_profile_names()) self.profileChoice.SetStringSelection( PIE_CONFIG.get('TheProfile', 'current_profile')) tta = wx.ToolTip(_('A profile allows you to point Pieberry at different Pieberry directories and databases')) self.profileChoice.SetToolTip(tta) self.profileaddbt = wx.Button(self, -1, _('Add')) self.rootdirctrl = wx.DirPickerCtrl( self, -1, path = PIE_CONFIG.get('Profile', 'rootdir'), style = wx.DIRP_USE_TEXTCTRL) self.rootdirctrl.SetPath(PIE_CONFIG.get('Profile', 'rootdir')) self.rootdiratstart = PIE_CONFIG.get('Profile', 'rootdir') self.desktopdirctrl = wx.DirPickerCtrl( self, -1, path = PIE_CONFIG.get('Profile', 'desktopdir'), style = wx.DIRP_USE_TEXTCTRL) self.desktopdirctrl.SetPath(PIE_CONFIG.get('Profile', 'desktopdir')) self.bib_cb = wx.CheckBox(self, -1, _('Export bibliography to pre-specified file')) # style=wx.ALIGN_RIGHT) ttb = wx.ToolTip(_("Setting the bibliography here means that Pieberry won't prompt you for a bibliography file every time you export it.")) self.bib_cb.SetToolTip(ttb) self.bib_cb.SetValue(PIE_CONFIG.getboolean('Profile', 'export_bibtex')) self.bibfilectrl = wx.FilePickerCtrl( self, -1, wildcard = "BibTeX files (*.bib;*.bibtex)|*.bib;*.bibtex", style = wx.FLP_USE_TEXTCTRL|wx.FLP_SAVE) if PIE_CONFIG.getboolean('Profile', 'export_bibtex') == True: self.bibfilectrl.Enable(True) else: self.bibfilectrl.Enable(False) self.bibfilectrl.SetPath(PIE_CONFIG.get('Profile', 'bibliography_file')) self.bibexpstarred_cb = wx.CheckBox(self, -1, _('Export starred items only')) ttc = wx.ToolTip(_('Export only starred items with adequate bibliographic data (unchecking will export all with adequate bibliographic data in the library but not project folders)')) self.bibexpstarred_cb.SetToolTip(ttc) self.bibexpstarred_cb.SetValue( PIE_CONFIG.getboolean('Profile', 'export_starred_only')) self._do_layout() self._do_bindings()
def _refill_profile_choice(self): self.profileChoice.Clear() for i in PIE_CONFIG.get_profile_names(): self.profileChoice.Append(i)
def _refill_profile_choice(self): self.profileChoice.Clear() for i in PIE_CONFIG.get_profile_names(): self.profileChoice.Append(i)