]> source.dussan.org Git - tigervnc.git/commitdiff
Close the session playback if the user presses the cancel button
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Thu, 10 Mar 2005 18:03:27 +0000 (18:03 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Thu, 10 Mar 2005 18:03:27 +0000 (18:03 +0000)
on ChoosePixelFormatDialog dialog.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@241 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfbplayer/rfbplayer.cxx

index b46b2f317a185de515a22c3580e1ae618f18a6d5..d1adc55d227f1265608b55e05aac1ecf117c9941 100644 (file)
@@ -840,6 +840,12 @@ void RfbPlayer::processMsg() {
       else stopped = false;
       updatePos(seekOffset);
       rewindFlag = false;
+      return;
+    } 
+    // It's a special exception which is used to terminate the playback
+    if (strcmp(e.str(), "[TERMINATE]") == 0) {
+      sessionTerminateThread *terminate = new sessionTerminateThread(this);
+      terminate->start();
     } else {
       MessageBox(getMainHandle(), e.str(), e.type(), MB_OK | MB_ICONERROR);
       return;
@@ -866,6 +872,9 @@ void RfbPlayer::serverInit() {
     ChoosePixelFormatDialog choosePixelFormatDialog(pixelFormat);
     if (choosePixelFormatDialog.showDialog()) {
       pixelFormat = choosePixelFormatDialog.getPF();
+    } else {
+      is->pausePlayback();
+      throw rdr::Exception("[TERMINATE]");
     }
   } else {
     pixelFormat = options.pixelFormat;