Changeset 59 for pykoticon/trunk/bin
- Timestamp:
- 01/15/05 12:09:44 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykoticon/trunk/bin/pykoticon
r58 r59 182 182 self.menu.Append(self.TBMENU_RESTORE, "Show Print Quota") 183 183 self.menu.Append(self.TBMENU_CLOSE, "Quit") 184 185 def OnIconify(self, evt): 184 185 self.TBTIMER = wx.NewId() 186 self.chrono = wx.wxTimer(self, self.TBTIMER) 187 EVT_TIMER(self, self.TBTIMER, self.OnChronoTimer) 188 189 self.User = None 190 self.networkInterface = CGINetworkInterface(DUMPYKOTA_URL) 191 self.inTimer = 0 192 self.chrono.Start(1000 * 60 * 3) # every 3 minutes 193 194 def getCurrentUserName(self) : 195 """Returns the name of the current user.""" 196 return win32api.GetUserName() 197 198 def OnChronoTimer(self, event) : 199 """Retrieves user's data quota information.""" 200 if not self.inTimer : # avoids re-entrance 201 self.inTimer = 1 202 self.User = self.networkInterface.getUser(self.getCurrentUserName()) 203 self.inTimer = 0 204 205 def OnIconify(self, event) : 186 206 self.Hide() 187 207 188 def OnTaskBarActivate(self, event) :189 if self.IsIconized() :208 def OnTaskBarActivate(self, event) : 209 if self.IsIconized() : 190 210 self.Iconize(False) 191 if not self.IsShown() :211 if not self.IsShown() : 192 212 self.Show(True) 193 213 self.Raise() 194 214 195 def OnCloseWindow(self, event): 215 def OnCloseWindow(self, event) : 216 if hasattr(self, "chrono") : 217 self.chrono.Stop() 218 del self.chrono 196 219 if hasattr(self, "menu") : 197 220 menu.Destroy() 198 221 del self.menu 199 if hasattr(self, "tbicon") :222 if hasattr(self, "tbicon") : 200 223 self.tbicon.Destroy() 201 224 del self.tbicon 202 225 self.Destroy() 203 226 204 def OnTaskBarMenu(self, evt) :227 def OnTaskBarMenu(self, evt) : 205 228 self.tbicon.PopupMenu(self.menu) 206 229 207 def OnTaskBarClose(self, evt) :230 def OnTaskBarClose(self, evt) : 208 231 self.Close() 209 232 wxPython.wx.wxGetApp().ProcessIdle()