소스 검색

Allow removal of GUI prompt on fatal errors

Add a new parameter 'alertOnFatalError' which guards
the displaying of the GUI alert on fatal errors, and
thus when false just gives the textual error.

Now I can do:

  while true
  do
    vncviewer alertOnFatalError=false vm:0
    sleep 1
  done

and it'll reappear when my VM appears without me getting error
dialogs.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
--
tags/v1.8.90
Dr. David Alan Gilbert 6 년 전
부모
커밋
f4d1d89f58
5개의 변경된 파일21개의 추가작업 그리고 6개의 파일을 삭제
  1. 2
    1
      vncviewer/CConn.cxx
  2. 6
    1
      vncviewer/parameters.cxx
  3. 1
    0
      vncviewer/parameters.h
  4. 8
    4
      vncviewer/vncviewer.cxx
  5. 4
    0
      vncviewer/vncviewer.man

+ 2
- 1
vncviewer/CConn.cxx 파일 보기

vlog.info(_("connected to host %s port %d"), serverHost, serverPort); vlog.info(_("connected to host %s port %d"), serverHost, serverPort);
} catch (rdr::Exception& e) { } catch (rdr::Exception& e) {
vlog.error("%s", e.str()); vlog.error("%s", e.str());
fl_alert("%s", e.str());
if (alertOnFatalError)
fl_alert("%s", e.str());
exit_vncviewer(); exit_vncviewer();
return; return;
} }

+ 6
- 1
vncviewer/parameters.cxx 파일 보기

"Show the dot cursor when the server sends an " "Show the dot cursor when the server sends an "
"invisible cursor", false); "invisible cursor", false);


BoolParameter alertOnFatalError("AlertOnFatalError",
"Give a dialog on connection problems rather "
"than exiting immediately", true);

StringParameter passwordFile("PasswordFile", StringParameter passwordFile("PasswordFile",
"Password file for VNC authentication", ""); "Password file for VNC authentication", "");
AliasParameter passwd("passwd", "Alias for PasswordFile", &passwordFile); AliasParameter passwd("passwd", "Alias for PasswordFile", &passwordFile);
&sendPrimary, &sendPrimary,
#endif #endif
&menuKey, &menuKey,
&fullscreenSystemKeys
&fullscreenSystemKeys,
&alertOnFatalError
}; };


// Encoding Table // Encoding Table

+ 1
- 0
vncviewer/parameters.h 파일 보기

extern rfb::StringParameter menuKey; extern rfb::StringParameter menuKey;


extern rfb::BoolParameter fullscreenSystemKeys; extern rfb::BoolParameter fullscreenSystemKeys;
extern rfb::BoolParameter alertOnFatalError;


#ifndef WIN32 #ifndef WIN32
extern rfb::StringParameter via; extern rfb::StringParameter via;

+ 8
- 4
vncviewer/vncviewer.cxx 파일 보기

defaultServerName = loadViewerParameters(NULL); defaultServerName = loadViewerParameters(NULL);
} catch (rfb::Exception& e) { } catch (rfb::Exception& e) {
defaultServerName = ""; defaultServerName = "";
fl_alert("%s", e.str());
vlog.error("%s", e.str());
if (alertOnFatalError)
fl_alert("%s", e.str());
} }
int i = 1; int i = 1;
// TRANSLATORS: "Parameters" are command line arguments, or settings // TRANSLATORS: "Parameters" are command line arguments, or settings
// from a file or the Windows registry. // from a file or the Windows registry.
vlog.error(_("Parameters -listen and -via are incompatible")); vlog.error(_("Parameters -listen and -via are incompatible"));
fl_alert(_("Parameters -listen and -via are incompatible"));
if (alertOnFatalError)
fl_alert(_("Parameters -listen and -via are incompatible"));
exit_vncviewer(); exit_vncviewer();
return 1; return 1;
} }
} }
} catch (rdr::Exception& e) { } catch (rdr::Exception& e) {
vlog.error("%s", e.str()); vlog.error("%s", e.str());
fl_alert("%s", e.str());
if (alertOnFatalError)
fl_alert("%s", e.str());
exit_vncviewer(); exit_vncviewer();
return 1; return 1;
} }


delete cc; delete cc;


if (exitError != NULL)
if (exitError != NULL && alertOnFatalError)
fl_alert("%s", exitError); fl_alert("%s", exitError);


return 0; return 0;

+ 4
- 0
vncviewer/vncviewer.man 파일 보기

\fIR\fR, and \fIG\fR taken the values of the local port number, the remote \fIR\fR, and \fIG\fR taken the values of the local port number, the remote
host, the port number on the remote host, and the gateway machine host, the port number on the remote host, and the gateway machine
respectively. respectively.
.
.TP
.B \-AlertOnFatalError
Display a dialog with any fatal error before exiting. Default is on.


.SH FILES .SH FILES
.TP .TP

Loading…
취소
저장