Survex 1.1.12 development snapshot uploaded

Olly Betts olly at survex.com
Mon Feb 12 10:11:14 GMT 2007


On Thu, Feb 08, 2007 at 08:33:16PM +0100, Roger Schuster wrote:
> I built it on Debian Etch with --prefix=/home/roger/survex and now I am 
> wondering why Aven has a tool bar but no menu bar. The file chooser 
> dialog has no buttons and icons; only thin lines where the buttons 
> should be.

I think this has the same cause as Dave's problem.  If you're easily
able to, could you and Dave try the attached patch?

You can apply it by changing directory to the survex source tree and
doing:

patch -p0 < survex-1.1.12-fix-charset.patch

Then just run "make" to rebuild.

If that doesn't help, can you tell me what this command reports:

printenv | grep 'LC\|LANG'

Cheers,
    Olly
-------------- next part --------------
Index: src/aven.cc
===================================================================
RCS file: /usr/data/cvs/survex/src/aven.cc,v
retrieving revision 1.51.2.36
retrieving revision 1.51.2.37
diff -p -u -r1.51.2.36 -r1.51.2.37
--- src/aven.cc	7 Feb 2007 03:42:20 -0000	1.51.2.36
+++ src/aven.cc	10 Feb 2007 13:56:35 -0000	1.51.2.37
@@ -74,6 +74,16 @@ Aven::~Aven()
     if (m_pageSetupData) delete m_pageSetupData;
 }
 
+static void init_msg_and_cmdline(int& my_argc, char **my_argv) {
+    msg_init(my_argv);
+    select_charset(CHARSET_UTF8);
+    /* Want --version and a decent --help output, which cmdline does for us.
+     * wxCmdLine is much less good.
+     */
+    cmdline_set_syntax_message("[3d file]", NULL);
+    cmdline_init(my_argc, my_argv, short_opts, long_opts, NULL, help, 0, 1);
+}
+
 #if wxCHECK_VERSION(2,5,1)
 static int getopt_first_response = 0;
 
@@ -95,9 +105,7 @@ bool Aven::Initialize(int& my_argc, wxCh
 #endif
     // Call msg_init() and start processing the command line first so that
     // we can respond to --help and --version even without an X display.
-    msg_init(my_argv);
-    cmdline_set_syntax_message("[3d file]", NULL);
-    cmdline_init(my_argc, my_argv, short_opts, long_opts, NULL, help, 0, 1);
+    init_msg_and_cmdline(my_argc, my_argv);
     getopt_first_response = cmdline_getopt();
     return wxApp::Initialize(my_argc, my_argv);
 }
@@ -106,31 +114,9 @@ bool Aven::Initialize(int& my_argc, wxCh
 bool Aven::OnInit()
 {
     wxLog::SetActiveTarget(new MyLogWindow());
-#if !wxCHECK_VERSION(2,5,1) && defined __WXMAC__
-    // wxMac is supposed to remove this magic command line option (which
-    // Finder passes), but the code in 2.4.2 is bogus.  It just decrements
-    // argc rather than copying argv down.  But we get to the command line
-    // before wx does, so we can just remove it and then wx does nothing.
-    // But luckily it also fails to set argv[argc] to NULL so we can just
-    // recalculate argc, then remove the -psn_* switch ourselves.
-    // The code was broken differently in 2.5.0, and fixed in 2.5.1.
-    if (my_argv[my_argc]) {
-	my_argc = 1;
-	while (my_argv[my_argc]) ++my_argc;
-    }
-    if (my_argc > 1 && strncmp(my_argv[1], "-psn_", 5) == 0) {
-	--my_argc;
-	memmove(my_argv + 1, my_argv + 2, my_argc * sizeof(char *));
-    }
-#endif
 
-    /* Want --version and a decent --help output, which cmdline does for us.
-     * wxCmdLine is much less good.
-     */
 #if !wxCHECK_VERSION(2,5,1)
-    msg_init(argv);
-    cmdline_set_syntax_message("[3d file]", NULL);
-    cmdline_init(argc, argv, short_opts, long_opts, NULL, help, 0, 1);
+    init_msg_and_cmdline(argc, argv);
 #endif
 
     const char *lang = msg_lang2 ? msg_lang2 : msg_lang;
Index: src/message.c
===================================================================
RCS file: /usr/data/cvs/survex/src/message.c,v
retrieving revision 1.99.2.19
retrieving revision 1.99.2.21
diff -p -u -r1.99.2.19 -r1.99.2.21
--- src/message.c	18 Oct 2006 02:36:57 -0000	1.99.2.19
+++ src/message.c	10 Feb 2007 13:46:19 -0000	1.99.2.21
@@ -1,6 +1,6 @@
 /* message.c
  * Fairly general purpose message and error routines
- * Copyright (C) 1993-2003,2004,2005,2006 Olly Betts
+ * Copyright (C) 1993-2003,2004,2005,2006,2007 Olly Betts
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -260,6 +260,9 @@ default_charset(void)
    }
    return CHARSET_USASCII;
 #elif OS_UNIX
+#ifdef AVEN
+   return CHARSET_UTF8;
+#else
    const char *p = getenv("LC_ALL");
    if (p == NULL || p[0] == '\0') {
       p = getenv("LC_CTYPE");
@@ -324,10 +327,6 @@ default_charset(void)
 	 }
       }
    }
-#ifdef AVEN
-   return CHARSET_UTF8;
-   return CHARSET_ISO_8859_1;
-#else
    return CHARSET_USASCII;
 #endif
 #else
@@ -958,7 +957,7 @@ msg_init(char * const *argv)
 	  * tree easily. */
 	 p = use_path(pth, "../lib/en.msg");
 	 if (lstat(p, &buf) == 0) {
-#ifdef S_ISDIR
+#ifdef S_ISREG
 	    /* POSIX way */
 	    if (S_ISREG(buf.st_mode)) {
 	       pth_cfg_files = use_path(pth, "../lib");
Index: src/wx.h
===================================================================
RCS file: /usr/data/cvs/survex/src/wx.h,v
retrieving revision 1.6.2.5
retrieving revision 1.6.2.6
diff -p -u -r1.6.2.5 -r1.6.2.6
--- src/wx.h	9 Dec 2006 05:20:59 -0000	1.6.2.5
+++ src/wx.h	10 Feb 2007 13:56:35 -0000	1.6.2.6
@@ -8,8 +8,14 @@
 # include <wx/wx.h>
 #endif
 
-#if !wxCHECK_VERSION(2,4,0)
-# error We support building with wxWidgets 2.4.0 or newer
+#ifndef __WXMAC__
+# if !wxCHECK_VERSION(2,4,0)
+#  error We support building with wxWidgets 2.4.0 or newer
+# endif
+#else
+# if !wxCHECK_VERSION(2,5,1)
+#  error We support building with wxWidgets 2.5.1 or newer on MacOS X
+# endif
 #endif
 
 // These were renamed in wx 2.7.


More information about the Survex mailing list