Revision: 4395
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4395&view=rev
Author:   ossman_
Date:     2011-04-29 11:51:38 +0000 (Fri, 29 Apr 2011)

Log Message:
-----------
Implement about dialog.

Modified Paths:
--------------
    trunk/vncviewer/Viewport.cxx
    trunk/vncviewer/vncviewer.cxx

Modified: trunk/vncviewer/Viewport.cxx
===================================================================
--- trunk/vncviewer/Viewport.cxx        2011-04-29 11:20:08 UTC (rev 4394)
+++ trunk/vncviewer/Viewport.cxx        2011-04-29 11:51:38 UTC (rev 4395)
@@ -51,13 +51,14 @@
 #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 @@
 
   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 @@
   case ID_REFRESH:
     cc->refreshFramebuffer();
     break;
+  case ID_ABOUT:
+    about_vncviewer();
+    break;
   case ID_DISMISS:
     // Don't need to do anything
     break;

Modified: trunk/vncviewer/vncviewer.cxx
===================================================================
--- trunk/vncviewer/vncviewer.cxx       2011-04-29 11:20:08 UTC (rev 4394)
+++ trunk/vncviewer/vncviewer.cxx       2011-04-29 11:51:38 UTC (rev 4395)
@@ -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 rfb;
 using namespace std;
 
-char aboutText[1024];
+static char aboutText[1024];
 
 static bool exitMainloop = false;
 
@@ -65,6 +66,17 @@
   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 @@
   fl_ok     = _("OK");
   fl_cancel = _("Cancel");
   fl_close  = _("Close");
+
+#ifdef __APPLE__
+  fl_mac_set_about(about_callback, NULL);
+#endif
 }
 
 static void mkvnchomedir()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to