Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9.2, 0.9.3, and 1.0

stable thgtaskbar: implement terminate command

Partial packport of ff0cede782a4 from default branch

Allows to terminate the thgtaskbar.exe with the new
terminate.exe from the default branch.

Potential use case: 0.10 installer might terminate
thgtaskbar.exe of 0.9.2 by using terminate.exe.

Changeset 372443a40e16

Parent 1f3219626658

by Adrian Buehlmann

Changes to one file · Browse files at 372443a40e16 Showing diff from parent 1f3219626658 Diff from another changeset...

Change 1 of 3 Show Entire File thgtaskbar.py Stacked
 
106
107
108
109
 
 
 
 
110
111
112
 
366
367
368
 
369
370
371
 
439
440
441
 
 
 
 
 
442
443
444
 
106
107
108
 
109
110
111
112
113
114
115
 
369
370
371
372
373
374
375
 
443
444
445
446
447
448
449
450
451
452
453
@@ -106,7 +106,10 @@
    def OnDestroy(self, hwnd, msg, wparam, lparam):   nid = (self.hwnd, 0) - Shell_NotifyIcon(NIM_DELETE, nid) + try: + Shell_NotifyIcon(NIM_DELETE, nid) + except pywintypes.error: + pass # happens when we run without icon   PostQuitMessage(0) # Terminate the app.     def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): @@ -366,6 +369,7 @@
   class PipeServer:   def __init__(self, hwnd): + self.hwnd = hwnd   self.updater = Updater(hwnd)   self.updater.start()   @@ -439,6 +443,11 @@
    try:   requests.put(data) + if data == 'terminate|': + print 'PipeServer received terminate from pipe' + print 'posting EXIT_CMD to gui thread...' + PostMessage(self.hwnd, win32con.WM_COMMAND, EXIT_CMD, 0) + break   except SystemExit:   raise SystemExit # interrupted by thread2.terminate()   except: