Ejemplo n.º 1
0
    def __init__(self, parent, id = -1):

        pre = wx.PrePanel()

        res = xmlres.loadGuiResource('StatisticsPanel.xrc')
        res.LoadOnPanel(pre, parent, "ID_STATISTICSPANEL")
        self.PostCreate(pre)
        
        self._new_count = xrc.XRCCTRL(self, "ID_COUNT_NEW")
        self._upd_count = xrc.XRCCTRL(self, "ID_COUNT_UPDATED")
        self._new_text = xrc.XRCCTRL(self, "ID_NEW_TEXT")
        self._updated_text = xrc.XRCCTRL(self, "ID_UPDATED_TEXT")
        self._total_count = xrc.XRCCTRL(self, "ID_COUNT_TOTAL")
        self._clear_new = xrc.XRCCTRL(self, "ID_CLEAR_NEW")
        self._clear_updated = xrc.XRCCTRL(self, "ID_CLEAR_UPDATED")
        
        self._count_new = 0
        self._count_updated = 0 
        self._first_count = True
                        
        self._timer = wx.Timer(self)
        self._timer.Start(2000)
        self.Bind(wx.EVT_TIMER, self._onUpdateStats)        
        self._syncStats()
      
        self.Bind(wx.EVT_BUTTON, self._onClearNew, self._clear_new)
        self.Bind(wx.EVT_BUTTON, self._onClearUpdated, self._clear_updated)
Ejemplo n.º 2
0
    def __init__(self, parent, id = -1):

        pre = wx.PrePanel()

        res = xmlres.loadGuiResource('ViewSelectPanel.xrc')
        res.LoadOnPanel(pre, parent, "ID_VIEWSELECTPANEL")
        self.PostCreate(pre)
        
        self._view_select = xrc.XRCCTRL(self, "ID_VIEW_SELECT")
        
        self._find_text = xrc.XRCCTRL(self, "ID_REFRESH_FIND")
        self._clear_filter = xrc.XRCCTRL(self, "ID_CLEAR_FIND")
        self._filter_text = xrc.XRCCTRL(self, "ID_TEXT_FILTER")
                
        # temp var for delayed selection of view
        self._the_view = -1

        self._our_problem = False
        
        self._initViewSelect()
              
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._onViewSelected, self._view_select)
        self.Bind(wx.EVT_TEXT, self._onFilterText, self._filter_text)
        self.Bind(wx.EVT_BUTTON, self._onRefreshFilter, self._find_text)
        self.Bind(wx.EVT_BUTTON, self._onClearFilter, self._clear_filter)
        self.Bind(wx.EVT_TEXT_ENTER, self._onRefreshFilter, self._filter_text)
        self.Bind(wx.EVT_UPDATE_UI, self._onUpdateUI)
        Publisher.subscribe(self._onViewChanged, signals.SET_VIEW)
Ejemplo n.º 3
0
 def __init__(self, parent, id = wx.ID_ANY):
     
     pre = wx.PreDialog()
     res = xmlres.loadGuiResource("SearchEngineDlg.xrc")
     res.LoadOnDialog(pre, parent, "SearchEngineDlg")
     self.PostCreate(pre)
     
     self._list = xrc.XRCCTRL(self, "ID_SEARCH_ENGINES")
     
     sel = self._list
     sel.InsertColumn(0, "Name", width = 80)
     sel.InsertColumn(1, "", width = 20)
     sel.InsertColumn(2, "URL", width = 380)
     
     self._add = xrc.XRCCTRL(self, "ID_ADD")
     self._edit = xrc.XRCCTRL(self, "ID_EDIT")
     self._delete = xrc.XRCCTRL(self, "ID_DELETE")
     self._default = xrc.XRCCTRL(self, "ID_DEFAULT")
     
     self.Bind(wx.EVT_BUTTON, self._onOK,  xrc.XRCCTRL(self, "wxID_OK"))
     self.Bind(wx.EVT_BUTTON, self._onAdd, self._add)
     self.Bind(wx.EVT_BUTTON, self._onEdit, self._edit)
     self.Bind(wx.EVT_BUTTON, self._onDelete, self._delete)
     self.Bind(wx.EVT_BUTTON, self._onDefault, self._default)
     
     self._populateSearchEngines()
Ejemplo n.º 4
0
    def __init__(self, parent, id=wx.ID_ANY):

        pre = wx.PreDialog()
        res = xmlres.loadGuiResource("SeriesDlg.xrc")
        res.LoadOnDialog(pre, parent, "SeriesDlg")
        self.PostCreate(pre)

        self._editing = False

        self.Bind(wx.EVT_BUTTON, self._onOK, xrc.XRCCTRL(self, "wxID_OK"))
        self._series_id = xrc.XRCCTRL(self, "ID_SERIES_ID")
        self._series_link = xrc.XRCCTRL(self, "ID_SERIES_LINK")
        self._postponed = xrc.XRCCTRL(self, "ID_CANCELLED")
        self._update_period = xrc.XRCCTRL(self, "ID_UPDATE_PERIOD")
        self._period_select = xrc.XRCCTRL(self, "ID_PERIOD_SELECT")
        self._last_updated = xrc.XRCCTRL(self, "ID_UPDATE_DATE")
        self._seriesFolder = xrc.XRCCTRL(self, "ID_SERIES_PATH")
        self._seriesBrowse = xrc.XRCCTRL(self, "ID_SERIES_BROWSE")
        self._warning = xrc.XRCCTRL(self, "ID_WARNING")

        self._warning.Show(appcfg.options[appcfg.CFG_SERIES_PATH] == '')

        i = -1
        while i >= series_list.min_period:
            self._period_select.Append(series_list.period_trans[i], i)
            i -= 1
        self._period_select.Append(series_list.period_custom[1],
                                   series_list.period_custom[0])

        self.Bind(wx.EVT_UPDATE_UI, self._onUpdateUI)
        self.Bind(wx.EVT_CHOICE, self._onPeriodSelect, self._period_select)
        self.Bind(wx.EVT_BUTTON, self._onSeriesBrowse, self._seriesBrowse)
Ejemplo n.º 5
0
    def __init__(self, parent, id=wx.ID_ANY):

        pre = wx.PreDialog()
        res = xmlres.loadGuiResource("SearchEngineDlg.xrc")
        res.LoadOnDialog(pre, parent, "SearchEngineDlg")
        self.PostCreate(pre)

        self._list = xrc.XRCCTRL(self, "ID_SEARCH_ENGINES")

        sel = self._list
        sel.InsertColumn(0, "Name", width=80)
        sel.InsertColumn(1, "", width=20)
        sel.InsertColumn(2, "URL", width=380)

        self._add = xrc.XRCCTRL(self, "ID_ADD")
        self._edit = xrc.XRCCTRL(self, "ID_EDIT")
        self._delete = xrc.XRCCTRL(self, "ID_DELETE")
        self._default = xrc.XRCCTRL(self, "ID_DEFAULT")

        self.Bind(wx.EVT_BUTTON, self._onOK, xrc.XRCCTRL(self, "wxID_OK"))
        self.Bind(wx.EVT_BUTTON, self._onAdd, self._add)
        self.Bind(wx.EVT_BUTTON, self._onEdit, self._edit)
        self.Bind(wx.EVT_BUTTON, self._onDelete, self._delete)
        self.Bind(wx.EVT_BUTTON, self._onDefault, self._default)

        self._populateSearchEngines()
Ejemplo n.º 6
0
    def __init__(self, parent, id=-1):

        pre = wx.PrePanel()

        res = xmlres.loadGuiResource('ViewSelectPanel.xrc')
        res.LoadOnPanel(pre, parent, "ID_VIEWSELECTPANEL")
        self.PostCreate(pre)

        self._view_select = xrc.XRCCTRL(self, "ID_VIEW_SELECT")

        self._find_text = xrc.XRCCTRL(self, "ID_REFRESH_FIND")
        self._clear_filter = xrc.XRCCTRL(self, "ID_CLEAR_FIND")
        self._filter_text = xrc.XRCCTRL(self, "ID_TEXT_FILTER")

        # temp var for delayed selection of view
        self._the_view = -1

        self._our_problem = False

        self._initViewSelect()

        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._onViewSelected,
                  self._view_select)
        self.Bind(wx.EVT_TEXT, self._onFilterText, self._filter_text)
        self.Bind(wx.EVT_BUTTON, self._onRefreshFilter, self._find_text)
        self.Bind(wx.EVT_BUTTON, self._onClearFilter, self._clear_filter)
        self.Bind(wx.EVT_TEXT_ENTER, self._onRefreshFilter, self._filter_text)
        self.Bind(wx.EVT_UPDATE_UI, self._onUpdateUI)
        Publisher.subscribe(self._onViewChanged, signals.SET_VIEW)
Ejemplo n.º 7
0
 def __init__(self, parent, id = wx.ID_ANY):
     
     pre = wx.PreDialog()
     res = xmlres.loadGuiResource("SeriesDlg.xrc")
     res.LoadOnDialog(pre, parent, "SeriesDlg")
     self.PostCreate(pre)
     
     self._editing = False
     
     self.Bind(wx.EVT_BUTTON, self._onOK,  xrc.XRCCTRL(self, "wxID_OK"))
     self._series_id = xrc.XRCCTRL(self, "ID_SERIES_ID")
     self._series_link = xrc.XRCCTRL(self, "ID_SERIES_LINK")
     self._postponed = xrc.XRCCTRL(self, "ID_CANCELLED")
     self._update_period = xrc.XRCCTRL(self, "ID_UPDATE_PERIOD")
     self._period_select = xrc.XRCCTRL(self, "ID_PERIOD_SELECT")
     self._last_updated = xrc.XRCCTRL(self, "ID_UPDATE_DATE")
     self._seriesFolder = xrc.XRCCTRL(self, "ID_SERIES_PATH")
     self._seriesBrowse = xrc.XRCCTRL(self, "ID_SERIES_BROWSE")
     self._warning = xrc.XRCCTRL(self, "ID_WARNING")
     
     self._warning.Show(appcfg.options[appcfg.CFG_SERIES_PATH] == '')
     
     i = -1
     while i >= series_list.min_period:
         self._period_select.Append(series_list.period_trans[i], i)
         i -= 1
     self._period_select.Append(series_list.period_custom[1], 
                                series_list.period_custom[0])
     
     self.Bind(wx.EVT_UPDATE_UI, self._onUpdateUI)
     self.Bind(wx.EVT_CHOICE, self._onPeriodSelect, self._period_select)
     self.Bind(wx.EVT_BUTTON, self._onSeriesBrowse, self._seriesBrowse)
Ejemplo n.º 8
0
    def __init__(self, parent, id = wx.ID_ANY):
        
        pre = wx.PreDialog()
        res = xmlres.loadGuiResource("EpisodeEditDlg.xrc")
        res.LoadOnDialog(pre, parent, "EpisodeEditDlg")
        self.PostCreate(pre)

        self._season = xrc.XRCCTRL(self, "ID_SEASON")
        self._title = xrc.XRCCTRL(self, "ID_TITLE")
        self._aired = xrc.XRCCTRL(self, "ID_AIRED")
        self._status = xrc.XRCCTRL(self, "ID_STATUS")
        self._updated = xrc.XRCCTRL(self, "ID_UPDATED")
        self._lock_update = xrc.XRCCTRL(self, "ID_LOCK_UPDATE")
        self._new = xrc.XRCCTRL(self, "ID_NEW")
        
        self._dt_valid = False
        
        statuses = [ ( series_list.EP_NEW,         "New"),
                     ( series_list.EP_TO_DOWNLOAD, "To Download"),
                     ( series_list.EP_DOWNLOADING, "Downloading"),
                     ( series_list.EP_DOWNLOADED,  "Downloaded"),
                     ( series_list.EP_READY,       "Ready"),
                     ( series_list.EP_SEEN,        "Seen") ]

        self._st_lookup = dict()
        for st in statuses:
            idx = self._status.Append( st[1], st[0] )
            self._st_lookup[st[0]] = idx
        
        self.Bind(wx.EVT_BUTTON, self._onOK,  xrc.XRCCTRL(self, "wxID_OK"))
        self.Bind(wx.EVT_TEXT, self._onEdited, self._title)
        self.Bind(wx.EVT_TEXT, self._onEdited, self._season)
        self.Bind(wx.EVT_DATE_CHANGED, self._onEdited, self._aired)
Ejemplo n.º 9
0
    def __init__(self, parent, id=-1):

        pre = wx.PrePanel()

        res = xmlres.loadGuiResource('StatisticsPanel.xrc')
        res.LoadOnPanel(pre, parent, "ID_STATISTICSPANEL")
        self.PostCreate(pre)

        self._new_count = xrc.XRCCTRL(self, "ID_COUNT_NEW")
        self._upd_count = xrc.XRCCTRL(self, "ID_COUNT_UPDATED")
        self._new_text = xrc.XRCCTRL(self, "ID_NEW_TEXT")
        self._updated_text = xrc.XRCCTRL(self, "ID_UPDATED_TEXT")
        self._total_count = xrc.XRCCTRL(self, "ID_COUNT_TOTAL")
        self._clear_new = xrc.XRCCTRL(self, "ID_CLEAR_NEW")
        self._clear_updated = xrc.XRCCTRL(self, "ID_CLEAR_UPDATED")

        self._count_new = 0
        self._count_updated = 0
        self._first_count = True

        self._timer = wx.Timer(self)
        self._timer.Start(2000)
        self.Bind(wx.EVT_TIMER, self._onUpdateStats)
        self._syncStats()

        self.Bind(wx.EVT_BUTTON, self._onClearNew, self._clear_new)
        self.Bind(wx.EVT_BUTTON, self._onClearUpdated, self._clear_updated)
Ejemplo n.º 10
0
    def __init__(self, parent, id=wx.ID_ANY):

        pre = wx.PreDialog()
        res = xmlres.loadGuiResource("EpisodeEditDlg.xrc")
        res.LoadOnDialog(pre, parent, "EpisodeEditDlg")
        self.PostCreate(pre)

        self._season = xrc.XRCCTRL(self, "ID_SEASON")
        self._title = xrc.XRCCTRL(self, "ID_TITLE")
        self._aired = xrc.XRCCTRL(self, "ID_AIRED")
        self._status = xrc.XRCCTRL(self, "ID_STATUS")
        self._updated = xrc.XRCCTRL(self, "ID_UPDATED")
        self._lock_update = xrc.XRCCTRL(self, "ID_LOCK_UPDATE")
        self._new = xrc.XRCCTRL(self, "ID_NEW")

        self._dt_valid = False

        statuses = [(series_list.EP_NEW, "New"),
                    (series_list.EP_TO_DOWNLOAD, "To Download"),
                    (series_list.EP_DOWNLOADING, "Downloading"),
                    (series_list.EP_DOWNLOADED, "Downloaded"),
                    (series_list.EP_READY, "Ready"),
                    (series_list.EP_SEEN, "Seen")]

        self._st_lookup = dict()
        for st in statuses:
            idx = self._status.Append(st[1], st[0])
            self._st_lookup[st[0]] = idx

        self.Bind(wx.EVT_BUTTON, self._onOK, xrc.XRCCTRL(self, "wxID_OK"))
        self.Bind(wx.EVT_TEXT, self._onEdited, self._title)
        self.Bind(wx.EVT_TEXT, self._onEdited, self._season)
        self.Bind(wx.EVT_DATE_CHANGED, self._onEdited, self._aired)
Ejemplo n.º 11
0
 def __init__(self, parent, id = wx.ID_ANY):
     
     pre = wx.PreDialog()
     res = xmlres.loadGuiResource("SearchEngineItemDlg.xrc")
     res.LoadOnDialog(pre, parent, "SearchEngineItemDlg")
     self.PostCreate(pre)
     
     self.Bind(wx.EVT_BUTTON, self._onOK,  xrc.XRCCTRL(self, "wxID_OK"))
                 
     self._name = xrc.XRCCTRL(self, "ID_NAME")
     self._url = xrc.XRCCTRL(self, "ID_URL")
Ejemplo n.º 12
0
    def __init__(self, parent, id = -1):

        pre = wx.PrePanel()

        res = xmlres.loadGuiResource('ProgressLogPanel.xrc')
        res.LoadOnPanel(pre, parent, "ID_PROGRESSLOGPANEL")
        self.PostCreate(pre)

        self._log_window = xrc.XRCCTRL(self, "ID_LOG_WINDOW")

        Publisher().subscribe(self._onSignalLogMessage, signals.APP_LOG)
Ejemplo n.º 13
0
    def __init__(self, parent, id = wx.ID_ANY):

        pre = wx.PreDialog()
        res = xmlres.loadGuiResource("OptionsDlg.xrc")
        res.LoadOnDialog(pre, parent, "OptionsDialog")
        self.PostCreate(pre)

        self._layout = xrc.XRCCTRL(self, "ID_LAYOUT")
        self._layout.Append("Mobile (bare text)", appcfg.LAYOUT_MOBILE)
        self._layout.Append("Screen (small fonts and icons)", appcfg.LAYOUT_SCREEN)
        self._layout.Append("TV (big fonts and icons)", appcfg.LAYOUT_TV)

        layout = appcfg.options[appcfg.CFG_LAYOUT_SCREEN]
        for idx in xrange(0, self._layout.GetCount()):
            if self._layout.GetClientData(idx) == layout:
                self._layout.SetSelection(idx)
                break

        self._playerPath = xrc.XRCCTRL(self, "ID_PLAYER_PATH")
        self._playerArgs = xrc.XRCCTRL(self, "ID_PLAYER_ARGS")
        self._playerBtn = xrc.XRCCTRL(self, "ID_PLAYER_BROWSE")

        self._seriesPath = xrc.XRCCTRL(self, "ID_SERIES_ROOT")
        self._seriesBtn = xrc.XRCCTRL(self, "ID_SERIES_BROWSE")
        
        self._webURL = xrc.XRCCTRL(self, "ID_WEB_URL")
        self._webPort = xrc.XRCCTRL(self, "ID_WEB_PORT")
        
        self._autoUpdate = xrc.XRCCTRL(self, "ID_AUTO_UPDATE")
        self._gracePeriod = xrc.XRCCTRL(self, "ID_GRACE_PERIOD")
        
        self._autoTimed = xrc.XRCCTRL(self, "ID_TIMED_UPDATE")
        self._timedUpdate = xrc.XRCCTRL(self, "ID_TIME_PERIOD")
        
        self._fuzzyMatch = xrc.XRCCTRL(self, "ID_FUZZY_MATCH")
        
        self._playerPath.SetValue(appcfg.options[appcfg.CFG_PLAYER_PATH])
        self._playerArgs.SetValue(appcfg.options[appcfg.CFG_PLAYER_ARGS])
        self._seriesPath.SetValue(appcfg.options[appcfg.CFG_SERIES_PATH])
        self._webPort.SetValue(str(appcfg.options[appcfg.CFG_WEB_PORT]))
        self._webURL.SetValue(appcfg.options[appcfg.CFG_WEB_URL])
        self._autoUpdate.SetValue(appcfg.options[appcfg.CFG_AUTO_UPDATE])
        self._gracePeriod.SetValue(str(appcfg.options[appcfg.CFG_GRACE_PERIOD]))
        self._timedUpdate.SetValue(appcfg.options[appcfg.CFG_TIMED_UPDATE])
        self._autoTimed.SetValue(appcfg.options[appcfg.CFG_AUTO_UPDATE_TIMED])
        self._fuzzyMatch.SetValue(appcfg.options[appcfg.CFG_FUZZY_MATCH])
        
        self.Bind(wx.EVT_BUTTON, self.__OnOK,  xrc.XRCCTRL(self, "wxID_OK"))
        self.Bind(wx.EVT_BUTTON, self._browseSeries, self._seriesBtn)
        self.Bind(wx.EVT_BUTTON, self._browsePlayer, self._playerBtn)
Ejemplo n.º 14
0
    def __init__(self, parent, id = -1):

        pre = wx.PrePanel()

        # two count values displaying number of
        # episodes that are reported new / updated
        
        res = xmlres.loadGuiResource('MainPanel.xrc')
        res.LoadOnPanel(pre, parent, "ID_MAIN_PANEL")
        self.PostCreate(pre)

        self._update_all = xrc.XRCCTRL(self, "ID_UPDATE_ALL")
        self._update_one = xrc.XRCCTRL(self, "ID_UPDATE_ONE")

        self._show_unseen = xrc.XRCCTRL(self, "ID_SHOW_UNSEEN")

        self._queue = xrc.XRCCTRL(self, "ID_QUEUE")

        self._episodeFilter = xrc.XRCCTRL(self, "ID_EPISODE_FILTER")
        
        deltalist = [ "View episodes from last week",
                      "View episodes from last two weeks",
                      "View episodes from last month",
                      "View episodes from last two months" ]
        
        for delta in deltalist:        
            pos = self._episodeFilter.Append(delta)
            self._episodeFilter.SetClientData(pos, series_list.idx_to_weekdelta(pos))
        
        idx = appcfg.options[appcfg.CFG_EPISODE_DELTA]
        self._episodeFilter.SetSelection(idx)
        viewmgr._series_sel._weeks_delta = self._episodeFilter.GetClientData(idx)

        # put the mixin control in place and initialize the
        # columns and styles
        self._list_panel = xrc.XRCCTRL(self, "ID_EPISODE_VIEW")
        self._series_selection = xrc.XRCCTRL(self, "ID_SERIES_LIST")
        self._series_list = EpisodeListCtrl(self._list_panel)

        # create main view (for now)
        sizer = wx.BoxSizer()
        sizer.Add(self._series_list, 1, wx.EXPAND)
        self._list_panel.SetSizer(sizer)        
                
        self.tmr = wx.Timer(self)
        self.tmr.Start(300)
        
        self.Bind(wx.EVT_TIMER, self._onTimer, self.tmr)
        self.Bind(wx.EVT_BUTTON, self._onUpdateAll, self._update_all)
        self.Bind(wx.EVT_BUTTON, self._onUpdateOne, self._update_one)
        self.Bind(wx.EVT_CHOICE, self._onSelectSeries, self._series_selection)
        self.Bind(wx.EVT_CHOICE, self._onEpisodeFilter, self._episodeFilter)
        self.Bind(wx.EVT_CHECKBOX, self._onShowOnlyUnseen, self._show_unseen)
        self.Bind(wx.EVT_UPDATE_UI, self._onGuiUpdated)
        
        Publisher().subscribe(self._onSignalRestoreSeries, signals.DATA_SERIES_RESTORED)
        Publisher().subscribe(self._onAppInitialized, signals.APP_INITIALIZED)
        Publisher().subscribe(self._onDeleteSeries, signals.SERIES_DELETED)
        Publisher().subscribe(self._onAddSeries, signals.SERIES_ADDED)
        Publisher().subscribe(self._onSerieSelected, signals.SERIES_SELECT)
        Publisher().subscribe(self._onSerieUpdated, signals.SERIES_UPDATED)
        Publisher().subscribe(self._onViewChanged, signals.SET_VIEW)
        Publisher().subscribe(self._onEditEpisode, signals.EPISODE_EDIT)