예제 #1
0
 def __init__(self):
     wx.Frame.__init__(
         self,
         None,
         -1,
         u"Статистика",
         style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER),
         size=(450, 300),
     )
     self.Centre()
     self.construct_frame()
     self.Layout()
     self.Bind(wx.EVT_CLOSE, self.onClose)
     self.Show(False)
     NotificationCenter().addObserver(self, self.onDBUpdate, "dbUpdated")
     NotificationCenter().addObserver(self, self.onUpdateUI, "updateUI")
예제 #2
0
 def newPomodoro(self, description):
     curtime = str(int(time.time()))
     task = DBTask(DBTask.DBTASK_ADD, {
         "time": curtime,
         "desc": description
     })
     self.queue.put(task, True, self.DBREQUEST_TIMEOUT)
     self.queue.join()
     NotificationCenter().postNotification("dbUpdated", self)
     return task.result
예제 #3
0
 def __init__(self):
     wx.Frame.__init__(
         self,
         None,
         -1,
         'Pomodoro it!',
         style=wx.BORDER_DEFAULT | wx.STAY_ON_TOP,
         size=(220, 120),
     )
     state = PomodoroState()
     self.__state_dict = {
         state.StateNoState: {
             'bs': '...'
         },
         state.StateInPomodoro: {
             'bs': u"Отменить..."
         },
         state.StateInRest: {
             'bs': u"Отдыхайте!"
         },
         state.StateWaitingPomodoro: {
             'bs': u"Начать помидору"
         },
         state.StateWaitingRest: {
             'bs': u"Начать отдых"
         },
         state.StatePomodoroKilled: {
             'bs': u"Начать помидору"
         },
     }
     self.buildFrame()
     self.updateUI()
     self.makeMenu()
     self.Show(False)
     NotificationCenter().addObserver(self, self.onDBUpdate, "dbUpdated")
     NotificationCenter().addObserver(self, self.onUpdateUI, "updateUI")
예제 #4
0
 def __init__(self):
     self.queue = Queue()
     self.dbThread = DataBaseThread(self.queue)
     self.dbThread.start()
     NotificationCenter().addObserver(self, self.willQuit, "beforeQuit")
예제 #5
0
 def connectToDB(self, fname):
     self.conn = sqlite.connect(fname)
     self.dbpath = fname
     NotificationCenter().postNotification("dbConnected", self)
예제 #6
0
파일: pomodoro.py 프로젝트: rrader/Pomodoro
 def didApplicationLoaded(self):
     NotificationCenter().postNotification("dbUpdated", self)
예제 #7
0
파일: pomodoro.py 프로젝트: rrader/Pomodoro
 def updateUI(self):
     if self.now_creation:
         return
     NotificationCenter().postNotification("updateUI", self)
예제 #8
0
파일: pomodoro.py 프로젝트: rrader/Pomodoro
 def quit(self):
     NotificationCenter().postNotification("beforeQuit", self)
     self.toggleState(PomodoroState.StateNoState)
     map(lambda x: x.Destroy(), self.__viewControllers.values())
     print "Views were destroyed"