r3435 - in trunk/src/target/OM-2007.2/applications/openmoko-terminal2: . data src

mickey at sita.openmoko.org mickey at sita.openmoko.org
Sun Nov 18 15:25:18 CET 2007


Author: mickey
Date: 2007-11-18 15:25:17 +0100 (Sun, 18 Nov 2007)
New Revision: 3435

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-terminal2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-terminal2/data/openmoko-terminal.desktop
   trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in
   trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in
   trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in
   trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/moko-terminal.c
Log:
openmoko-terminal2:
* fix terminal colors, start in '~' (patch by Clarke Wixon)
* fix desktop file syntax error (Categories need to end with ';')


Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/ChangeLog	2007-11-16 21:05:53 UTC (rev 3434)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/ChangeLog	2007-11-18 14:25:17 UTC (rev 3435)
@@ -1,8 +1,14 @@
-2007-11-05	Michael Lauer <mickey at openmoko.org>
+2007-11-18  Michael Lauer <mickey at openmoko.org>
 
+	* src/moko-terminal.c: fix terminal colors, start in '~'
+    Closes #1000 -- patch by cwixon at usa.net (Clarke 'Quicksand' Wixon)
+    * data/openmoko-terminal.desktop: fix Category synxtax (';')
+
+2007-11-05  Michael Lauer <mickey at openmoko.org>
+
 	* data/openmoko-terminal.desktop: terminal is not a PIM application
 
-2007-09-14	Michael Lauer <mickey at openmoko.org>
+2007-09-14  Michael Lauer <mickey at openmoko.org>
 
 	* src/moko-terminal.c: Set default font spec to "LiberationMono 5"
 

Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/data/openmoko-terminal.desktop
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/data/openmoko-terminal.desktop	2007-11-16 21:05:53 UTC (rev 3434)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/data/openmoko-terminal.desktop	2007-11-18 14:25:17 UTC (rev 3435)
@@ -6,7 +6,7 @@
 Icon=openmoko-terminal
 Terminal=false
 Type=Application
-Categories=GTK;Application;Utilities
+Categories=GTK;Application;Utilities;
 MimeType=text/x-vcard;
 SingleInstance=true
 StartupNotify=true

Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in	2007-11-16 21:05:53 UTC (rev 3434)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in	2007-11-18 14:25:17 UTC (rev 3435)
@@ -32,7 +32,7 @@
 ## Release information
 my $PROGRAM      = "intltool-extract";
 my $PACKAGE      = "intltool";
-my $VERSION      = "0.35.4";
+my $VERSION      = "0.36.2";
 
 ## Loaded modules
 use strict; 
@@ -237,9 +237,9 @@
 
     s/&apos;/'/g; # '
     s/&quot;/"/g; # "
-    s/&amp;/&/g;
     s/&lt;/</g;
     s/&gt;/>/g;
+    s/&amp;/&/g;
 
     return $_;
 }
@@ -261,8 +261,11 @@
 
 sub type_ini {
     ### For generic translatable desktop files ###
-    while ($input =~ /^_.*=(.*)$/mg) {
-        $messages{$1} = [];
+    while ($input =~ /^(#(.+)\n)?^_.*=(.*)$/mg) {
+        if (defined($2))  {
+            $comments{$3} = $2;
+        }
+        $messages{$3} = [];
     }
 }
 

Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in	2007-11-16 21:05:53 UTC (rev 3434)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in	2007-11-18 14:25:17 UTC (rev 3435)
@@ -35,7 +35,7 @@
 ## Release information
 my $PROGRAM = "intltool-merge";
 my $PACKAGE = "intltool";
-my $VERSION = "0.35.4";
+my $VERSION = "0.36.2";
 
 ## Loaded modules
 use strict; 
@@ -93,9 +93,24 @@
 
 my %po_files_by_lang = ();
 my %translations = ();
-my $iconv = $ENV{"ICONV"} || $ENV{"INTLTOOL_ICONV"} || "@INTLTOOL_ICONV@";
+my $iconv = $ENV{"ICONV"} || "iconv";
 my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null');
 
+sub isProgramInPath
+{
+    my ($file) = @_;
+    # If either a file exists, or when run it returns 0 exit status
+    return 1 if ((-x $file) or (system("$file -l >$devnull") == 0));
+    return 0;
+}
+
+if (! isProgramInPath ("$iconv"))
+{
+	print STDERR " *** iconv is not found on this system!\n".
+		     " *** Without it, intltool-merge can not convert encodings.\n";
+	exit;
+}
+
 # Use this instead of \w for XML files to handle more possible characters.
 my $w = "[-A-Za-z0-9._:]";
 
@@ -260,9 +275,43 @@
 
 sub gather_po_files
 {
-    for my $po_file (glob "$PO_DIR/*.po") {
-	$po_files_by_lang{po_file2lang($po_file)} = $po_file;
+    if (my $linguas = $ENV{"LINGUAS"})
+    {
+        for my $lang (split / /, $linguas) {
+            my $po_file = $PO_DIR . "/" . $lang . ".po";
+            if (-e $po_file) {
+                $po_files_by_lang{$lang} = $po_file;
+            }
+        }
     }
+    else
+    {
+        if (open LINGUAS_FILE, "$PO_DIR/LINGUAS")
+        {
+            while (<LINGUAS_FILE>)
+            {
+                next if /^#/;
+
+                if (/([-a-zA-Z_ at .]+)\n/)
+                {
+                    my $lang = $1;
+
+                    my $po_file = $PO_DIR . "/" . $lang . ".po";
+                    if (-e $po_file) {
+                        $po_files_by_lang{$lang} = $po_file;
+                    }
+                }
+            }
+
+            close LINGUAS_FILE;
+        }
+        else
+        {
+            for my $po_file (glob "$PO_DIR/*.po") {
+                $po_files_by_lang{po_file2lang($po_file)} = $po_file;
+            }
+        }
+    }
 }
 
 sub get_local_charset
@@ -494,16 +543,15 @@
     return $string;
 }
 
-## NOTE: deal with < - &lt; but not > - &gt;  because it seems its ok to have 
-## > in the entity. For further info please look at #84738.
 sub entity_decode
 {
     local ($_) = @_;
 
     s/&apos;/'/g; # '
     s/&quot;/"/g; # "
+    s/&lt;/</g;
+    s/&gt;/>/g;
     s/&amp;/&/g;
-    s/&lt;/</g;
 
     return $_;
 }
@@ -1017,8 +1065,8 @@
 
     if ($MULTIPLE_OUTPUT) {
         for my $lang (sort keys %po_files_by_lang) {
-	    if ( ! -e $lang ) {
-	        mkdir $lang or die "Cannot create subdirectory $lang: $!\n";
+	    if ( ! -d $lang ) {
+	        mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n";
             }
             open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n";
             binmode (OUTPUT) if $^O eq 'MSWin32';
@@ -1386,8 +1434,8 @@
     }
 
     for my $lang (sort keys %po_files_by_lang) {
-        if ( ! -e $lang ) {
-            mkdir $lang or die "Cannot create subdirectory $lang: $!\n";
+        if ( ! -d $lang ) {
+            mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n";
         }
         open INPUT, "<${FILE}" or die;
         open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n";

Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in	2007-11-16 21:05:53 UTC (rev 3434)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in	2007-11-18 14:25:17 UTC (rev 3435)
@@ -30,7 +30,7 @@
 
 ## Release information
 my $PROGRAM = "intltool-update";
-my $VERSION = "0.35.4";
+my $VERSION = "0.36.2";
 my $PACKAGE = "intltool";
 
 ## Loaded modules
@@ -71,7 +71,8 @@
 "sheet(?:\\.in)+|".	# ?
 "schemas(?:\\.in)+|".	# GConf specific
 "pong(?:\\.in)+|".	# DEPRECATED: PONG is not used [by GNOME] any longer.
-"kbd(?:\\.in)+";	# GOK specific. 
+"kbd(?:\\.in)+|".	# GOK specific. 
+"policy(?:\\.in)+";	# PolicyKit files
 
 my $ini_support =
 "icon(?:\\.in)+|".	# http://www.freedesktop.org/Standards/icon-theme-spec
@@ -328,8 +329,13 @@
 	push @buf_i18n_ini,          "$File::Find::name" if /\.($ini_support)$/;
 	push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/;
 	}, "..";
+    find sub { 
+	push @buf_i18n_plain,        "$File::Find::name" if /\.($buildin_gettext_support)$/;
+	push @buf_i18n_xml,          "$File::Find::name" if /\.($xml_support)$/;
+	push @buf_i18n_ini,          "$File::Find::name" if /\.($ini_support)$/;
+	push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/;
+	}, "$SRCDIR/..";
 
-
     open POTFILES, $POTFILES_in or die "$PROGRAM:  there's no POTFILES.in!\n";
     @buf_potfiles = grep !/^(#|\s*$)/, <POTFILES>;
     close POTFILES;
@@ -344,7 +350,7 @@
     ## comparing with POTFILES.in
     foreach my $ignore ("POTFILES.skip", "POTFILES.ignore")
     {
-	(-s $ignore) or next;
+	(-s "$SRCDIR/$ignore") or next;
 
 	if ("$ignore" eq "POTFILES.ignore")
 	{
@@ -489,11 +495,15 @@
     my %in2;
     foreach (@buf_potfiles_sorted) 
     {
+        s#^$SRCDIR/../##;
+        s#^$SRCDIR/##;
 	$in2{$_} = 1;
     }
 
     foreach (@buf_potfiles_ignore_sorted) 
     {
+        s#^$SRCDIR/../##;
+        s#^$SRCDIR/##;
 	$in2{$_} = 1;
     }
 
@@ -501,9 +511,16 @@
 
     foreach (@buf_allfiles_sorted)
     {
-	if (!exists($in2{$_}))
+        my $dummy = $_;
+        my $srcdir = $SRCDIR;
+
+        $srcdir =~ s#^../##;
+        $dummy =~ s#^$srcdir/../##;
+        $dummy =~ s#^$srcdir/##;
+        $dummy =~ s#_build/##;
+	if (!exists($in2{$dummy}))
 	{
-	    push @result, $_
+	    push @result, $dummy
 	}
     }
 
@@ -563,16 +580,33 @@
     exit 1;
 }
 
+sub isProgramInPath
+{
+    my ($file) = @_;
+    # If either a file exists, or when run it returns 0 exit status
+    return 1 if ((-x $file) or (system("$file --version >$devnull") == 0));
+    return 0;
+}
+
+sub isGNUGettextTool
+{
+    my ($file) = @_;
+    # Check that we are using GNU gettext tools
+    if (isProgramInPath ($file))
+    {
+        my $version = `$file --version`;
+        return 1 if ($version =~ m/.*\(GNU .*\).*/);
+    }
+    return 0;
+}
+
 sub GenerateHeaders
 {
-    my $EXTRACT = "@INTLTOOL_EXTRACT@";
-    chomp $EXTRACT;
+    my $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} || "intltool-extract";
 
-    $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"};
-
     ## Generate the .h header files, so we can allow glade and
     ## xml translation support
-    if (! -x "$EXTRACT")
+    if (! isProgramInPath ("$EXTRACT"))
     {
 	print STDERR "\n *** The intltool-extract script wasn't found!"
 	     ."\n *** Without it, intltool-update can not generate files.\n";
@@ -619,13 +653,13 @@
 #
 sub GeneratePOTemplate
 {
-    my $XGETTEXT = $ENV{"XGETTEXT"} || "@INTLTOOL_XGETTEXT@";
+    my $XGETTEXT = $ENV{"XGETTEXT"} || "xgettext";
     my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || '';
     chomp $XGETTEXT;
 
-    if (! -x $XGETTEXT)
+    if (! isGNUGettextTool ("$XGETTEXT"))
     {
-	print STDERR " *** xgettext is not found on this system!\n".
+	print STDERR " *** GNU xgettext is not found on this system!\n".
 		     " *** Without it, intltool-update can not extract strings.\n";
 	exit;
     }
@@ -721,7 +755,23 @@
     unlink "$MODULE.pot";
     my @xgettext_argument=("$XGETTEXT",
 			   "--add-comments",
-			   "--directory\=\.",
+			   "--directory\=.",
+                           "--default-domain\=$MODULE",
+                           "--flag\=g_strdup_printf:1:c-format",
+                           "--flag\=g_string_printf:2:c-format",
+                           "--flag\=g_string_append_printf:2:c-format",
+                           "--flag\=g_error_new:3:c-format",
+                           "--flag\=g_set_error:4:c-format",
+                           "--flag\=g_markup_printf_escaped:1:c-format",
+                           "--flag\=g_log:3:c-format",
+                           "--flag\=g_print:1:c-format",
+                           "--flag\=g_printerr:1:c-format",
+                           "--flag\=g_printf:1:c-format",
+                           "--flag\=g_fprintf:2:c-format",
+                           "--flag\=g_sprintf:2:c-format",
+                           "--flag\=g_snprintf:3:c-format",
+                           "--flag\=g_scanner_error:2:c-format",
+                           "--flag\=g_scanner_warn:2:c-format",
 			   "--output\=$MODULE\.pot",
 			   "--files-from\=\.\/POTFILES\.in\.temp");
     my $XGETTEXT_KEYWORDS = &FindPOTKeywords;
@@ -788,9 +838,16 @@
 {
     -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n";
 
-    my $MSGMERGE = $ENV{"MSGMERGE"} || "@INTLTOOL_MSGMERGE@";
+    my $MSGMERGE = $ENV{"MSGMERGE"} || "msgmerge";
     my ($lang, $outfile) = @_;
 
+    if (! isGNUGettextTool ("$MSGMERGE"))
+    {
+	print STDERR " *** GNU msgmerge is not found on this system!\n".
+		     " *** Without it, intltool-update can not extract strings.\n";
+	exit;
+    }
+
     print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE;
 
     my $infile = "$SRCDIR/$lang.po";
@@ -831,8 +888,15 @@
 sub Console_Write_TranslationStatus
 {
     my ($lang, $output_file) = @_;
-    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
+    my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt";
 
+    if (! isGNUGettextTool ("$MSGFMT"))
+    {
+	print STDERR " *** GNU msgfmt is not found on this system!\n".
+		     " *** Without it, intltool-update can not extract strings.\n";
+	exit;
+    }
+
     $output_file = "$SRCDIR/$lang.po" if ($output_file eq "");
 
     system ("$MSGFMT", "-o", "$devnull", "--verbose", $output_file);
@@ -840,21 +904,28 @@
 
 sub Console_Write_CoverageReport
 {
-    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
+    my $MSGFMT = $ENV{"MSGFMT"} || "msgfmt";
 
+    if (! isGNUGettextTool ("$MSGFMT"))
+    {
+	print STDERR " *** GNU msgfmt is not found on this system!\n".
+		     " *** Without it, intltool-update can not extract strings.\n";
+	exit;
+    }
+
     &GatherPOFiles;
 
     foreach my $lang (@languages) 
     {
-	print "$lang: ";
+	print STDERR "$lang: ";
 	&POFile_Update ($lang, "");
     }
 
-    print "\n\n * Current translation support in $MODULE \n\n";
+    print STDERR "\n\n * Current translation support in $MODULE \n\n";
 
     foreach my $lang (@languages)
     {
-	print "$lang: ";
+	print STDERR "$lang: ";
 	system ("$MSGFMT", "-o", "$devnull", "--verbose", "$SRCDIR/$lang.po");
     }
 }
@@ -928,13 +999,13 @@
 
 	    $conf_in || die "Cannot find top_builddir in Makevars.";
 	}
-	elsif (-f "../configure.ac") 
+	elsif (-f "$SRCDIR/../configure.ac") 
 	{
-	    $conf_in = "../configure.ac";
+	    $conf_in = "$SRCDIR/../configure.ac";
 	} 
-	elsif (-f "../configure.in") 
+	elsif (-f "$SRCDIR/../configure.in") 
 	{
-	    $conf_in = "../configure.in";
+	    $conf_in = "$SRCDIR/../configure.in";
 	} 
 	else 
 	{

Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/moko-terminal.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/moko-terminal.c	2007-11-16 21:05:53 UTC (rev 3434)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/moko-terminal.c	2007-11-18 14:25:17 UTC (rev 3435)
@@ -113,11 +113,19 @@
     priv->scrollbar = gtk_vscrollbar_new( vte->adjustment );
     gtk_box_pack_start( GTK_BOX(self), priv->scrollbar, FALSE, FALSE, 0 );
 
-    GdkColor fore = { 0, 0x0, 0x0, 0x0 };
-    GdkColor back = { 0, 0xfffff, 0xfffff, 0xfffff };
-    GdkColor colors[16];
-    vte_terminal_set_colors( vte, &fore, &back, &colors, 16 );
+    GdkColor fore = { 0, 0x0000, 0x0000, 0x0000 };
+    GdkColor back = { 0, 0xffff, 0xffff, 0xffff };
+    GdkColor colors[8] = { { 0, 0x0000, 0x0000, 0x0000 },
+                           { 0, 0x8000, 0x0000, 0x0000 },
+                           { 0, 0x0000, 0x8000, 0x0000 },
+                           { 0, 0x8000, 0x8000, 0x0000 },
+                           { 0, 0x0000, 0x0000, 0x8000 },
+                           { 0, 0x8000, 0x0000, 0x8000 },
+                           { 0, 0x0000, 0x8000, 0x8000 },
+                           { 0, 0x8000, 0x8000, 0x8000 } };
 
+    vte_terminal_set_colors( vte, &fore, &back, &colors, 8 );
+
     //vte_terminal_set_size( vte, 30, 30);
     vte_terminal_set_scrollback_lines( vte, 1000 );
     vte_terminal_set_font_from_string_full( vte, "LiberationMono 5", 1 );
@@ -130,7 +138,7 @@
                                NULL,
                                NULL,
                                NULL,
-                               NULL,
+                               "~/",
                                TRUE,
                                TRUE,
                                TRUE);





More information about the commitlog mailing list