def _onSelectSeries(self, event): """ Select a series, or all """ self._series_list.Freeze() busy = wx.BusyInfo("This can take a while, please wait ...", wx.GetApp()._frame) sel = self._series_selection series_id = sel.GetClientData(sel.GetSelection()) if series_id >= 0: series = db.store.get(series_list.Series, series_id) viewmgr.set_selection(series) busy.Destroy() self._series_list.Thaw()
def _onGuiAddNew(self, event): """ Event handler to add a new Series """ dlg = SeriesDlg.SeriesDlg(self) if dlg.ShowModal() == wx.ID_OK: # we instantiate a new series object series = series_list.Series() series.update_period = 7 dlg.guiToObject(series) viewmgr.add_series(series) # select the new series viewmgr.set_selection(series) # ask if this needs to be scheduled too if series.url.strip() != '': if wx.MessageBox("Do you wish to run an update for this series?", "Question", wx.ICON_QUESTION | wx.YES_NO) == wx.YES: viewmgr.get_selected_series() dlg.Destroy()
def _onGuiAddNew(self, event): """ Event handler to add a new Series """ dlg = SeriesDlg.SeriesDlg(self) if dlg.ShowModal() == wx.ID_OK: # we instantiate a new series object series = series_list.Series() series.update_period = 7 dlg.guiToObject(series) viewmgr.add_series(series) # select the new series viewmgr.set_selection(series) # ask if this needs to be scheduled too if series.url.strip() != '': if wx.MessageBox( "Do you wish to run an update for this series?", "Question", wx.ICON_QUESTION | wx.YES_NO) == wx.YES: viewmgr.get_selected_series() dlg.Destroy()