summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-04-29 11:51:38 +0000
committerPierre Ossman <ossman@cendio.se>2011-04-29 11:51:38 +0000
commitb885822a6c6438545f464de9f119ed0c42ce3308 (patch)
tree0e3bfd34a872449aa55135ca19d52b2649247a98
parent31c5a52e46438487b5853495096272f71b7d71c4 (diff)
downloadtigervnc-b885822a6c6438545f464de9f119ed0c42ce3308.tar.gz
tigervnc-b885822a6c6438545f464de9f119ed0c42ce3308.zip
Implement about dialog.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4395 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--vncviewer/Viewport.cxx8
-rw-r--r--vncviewer/vncviewer.cxx18
2 files changed, 24 insertions, 2 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index c8713b8c..4fa3cfa3 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -51,13 +51,14 @@ extern "C" const char *osx_event_string(void);
#endif
extern void exit_vncviewer();
+extern void about_vncviewer();
static rfb::LogWriter vlog("Viewport");
// Menu constants
enum { ID_EXIT, ID_CTRL, ID_ALT, ID_MENUKEY, ID_CTRLALTDEL,
- ID_REFRESH, ID_DISMISS };
+ ID_REFRESH, ID_ABOUT, ID_DISMISS };
Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_)
: Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL), pixelTrans(NULL),
@@ -523,6 +524,8 @@ void Viewport::initContextMenu()
contextMenu->add(_("Refresh screen"), 0, NULL, (void*)ID_REFRESH, FL_MENU_DIVIDER);
+ contextMenu->add(_("About TigerVNC viewer..."), 0, NULL, (void*)ID_ABOUT, FL_MENU_DIVIDER);
+
contextMenu->add(_("Dismiss menu"), 0, NULL, (void*)ID_DISMISS, 0);
}
@@ -569,6 +572,9 @@ void Viewport::popupContextMenu()
case ID_REFRESH:
cc->refreshFramebuffer();
break;
+ case ID_ABOUT:
+ about_vncviewer();
+ break;
case ID_DISMISS:
// Don't need to do anything
break;
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index a6244cba..d9277e5d 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -44,6 +44,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_ask.H>
+#include <FL/x.H>
#include "i18n.h"
#include "parameters.h"
@@ -56,7 +57,7 @@ using namespace network;
using namespace rfb;
using namespace std;
-char aboutText[1024];
+static char aboutText[1024];
static bool exitMainloop = false;
@@ -65,6 +66,17 @@ void exit_vncviewer()
exitMainloop = true;
}
+void about_vncviewer()
+{
+ fl_message_title(_("About TigerVNC Viewer"));
+ fl_message(aboutText);
+}
+
+static void about_callback(Fl_Widget *widget, void *data)
+{
+ about_vncviewer();
+}
+
static void CleanupSignalHandler(int sig)
{
// CleanupSignalHandler allows C++ object cleanup to happen because it calls
@@ -109,6 +121,10 @@ static void init_fltk()
fl_ok = _("OK");
fl_cancel = _("Cancel");
fl_close = _("Close");
+
+#ifdef __APPLE__
+ fl_mac_set_about(about_callback, NULL);
+#endif
}
static void mkvnchomedir()