[Goodies-commits] r2902 - in ristretto/trunk: . po src
Stephan Arts
stephan at xfce.org
Fri Jul 13 00:51:09 CEST 2007
Author: stephan
Date: 2007-07-12 22:51:09 +0000 (Thu, 12 Jul 2007)
New Revision: 2902
Added:
ristretto/trunk/po/ChangeLog
ristretto/trunk/po/nl.po
ristretto/trunk/po/ristretto.pot
Modified:
ristretto/trunk/aclocal.m4
ristretto/trunk/configure.in.in
ristretto/trunk/intltool-extract.in
ristretto/trunk/intltool-merge.in
ristretto/trunk/intltool-update.in
ristretto/trunk/po/LINGUAS
ristretto/trunk/po/Makefile.in.in
ristretto/trunk/po/Makevars
ristretto/trunk/src/main.c
ristretto/trunk/src/picture_viewer.c
Log:
Fix i18n
Add 'open' button
Add Dutch translation
Add ChangeLog to po directory
Fix email adress in po/Makevars
Modified: ristretto/trunk/aclocal.m4
===================================================================
--- ristretto/trunk/aclocal.m4 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/aclocal.m4 2007-07-12 22:51:09 UTC (rev 2902)
@@ -224,6 +224,20 @@
glib_save_LIBS="$LIBS"
LIBS="$LIBS $INTLLIBS"
AC_CHECK_FUNCS(dcgettext)
+ MSGFMT_OPTS=
+ AC_MSG_CHECKING([if msgfmt accepts -c])
+ GLIB_RUN_PROG([msgfmt -c -o /dev/null],[
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: test 1.0\n"
+"PO-Revision-Date: 2007-02-15 12:01+0100\n"
+"Last-Translator: test <foo at bar.xx>\n"
+"Language-Team: C <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+ AC_SUBST(MSGFMT_OPTS)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
@@ -419,7 +433,24 @@
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
])dnl
+# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
+#
+# Create a temporary file with TEST-FILE as its contents and pass the
+# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
+# 0 and perform ACTION-IF-FAIL for any other exit status.
+AC_DEFUN([GLIB_RUN_PROG],
+[cat >conftest.foo <<_ACEOF
+$2
+_ACEOF
+if AC_RUN_LOG([$1 conftest.foo]); then
+ m4_ifval([$3], [$3], [:])
+m4_ifvaln([$4], [else $4])dnl
+echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
+sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
+fi])
+
+
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
# serial 35 IT_PROG_INTLTOOL
AC_DEFUN([IT_PROG_INTLTOOL],
@@ -511,7 +542,30 @@
# Substitute ALL_LINGUAS so we can use it in po/Makefile
AC_SUBST(ALL_LINGUAS)
-
+
+# Set DATADIRNAME correctly if it is not set yet
+# (copied from glib-gettext.m4)
+if test -z "$DATADIRNAME"; then
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
+ [DATADIRNAME=share],
+ [case $host in
+ *-*-solaris*)
+ dnl On Solaris, if bind_textdomain_codeset is in libc,
+ dnl GNU format message catalog is always supported,
+ dnl since both are added to the libc all together.
+ dnl Hence, we'd like to go with DATADIRNAME=share
+ dnl in this case.
+ AC_CHECK_FUNC(bind_textdomain_codeset,
+ [DATADIRNAME=share], [DATADIRNAME=lib])
+ ;;
+ *)
+ [DATADIRNAME=lib]
+ ;;
+ esac])
+fi
+AC_SUBST(DATADIRNAME)
+
IT_PO_SUBDIR([po])
dnl The following is very similar to
Modified: ristretto/trunk/configure.in.in
===================================================================
--- ristretto/trunk/configure.in.in 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/configure.in.in 2007-07-12 22:51:09 UTC (rev 2902)
@@ -21,7 +21,7 @@
dnl *******************************************
m4_define([ristretto_debug_default], [ifelse(ristretto_version_tag(), [svn], [full], [minimum])])
-AC_COPYRIGHT([Copyright (c) 2006
+AC_COPYRIGHT([Copyright (c) 2006-2007
The Xfce development team. All rights reserved.
Written for Xfce by Stephan Arts <stephan at xfce.org>.])
Modified: ristretto/trunk/intltool-extract.in
===================================================================
--- ristretto/trunk/intltool-extract.in 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/intltool-extract.in 2007-07-12 22:51:09 UTC (rev 2902)
@@ -32,7 +32,7 @@
## Release information
my $PROGRAM = "intltool-extract";
my $PACKAGE = "intltool";
-my $VERSION = "0.35.0";
+my $VERSION = "0.35.5";
## Loaded modules
use strict;
@@ -114,6 +114,11 @@
sub place_normal {
$FILE = $ARGV[0];
$OUTFILE = "$FILE.h";
+
+ my $dirname = dirname ($OUTFILE);
+ if (! -d "$dirname" && $dirname ne "") {
+ system ("mkdir -p $dirname");
+ }
}
sub place_local {
@@ -156,7 +161,7 @@
--type=TYPE Specify the file type of FILENAME. Currently supports:
"gettext/glade", "gettext/ini", "gettext/keys"
"gettext/rfc822deb", "gettext/schemas",
- "gettext/scheme", "gettext/xml"
+ "gettext/scheme", "gettext/xml", "gettext/quoted"
-l, --local Writes output into current working directory
(conflicts with --update)
--update Writes output into the same directory the source file
@@ -212,6 +217,7 @@
&type_scheme if $gettext_type eq "scheme";
&type_schemas if $gettext_type eq "schemas";
&type_rfc822deb if $gettext_type eq "rfc822deb";
+ &type_quoted if $gettext_type eq "quoted";
}
sub entity_decode_minimal
@@ -242,7 +248,7 @@
{
return '\"' if $_ eq '"';
return '\n' if $_ eq "\n";
- return '\\' if $_ eq '\\';
+ return '\\\\' if $_ eq '\\';
return $_;
}
@@ -255,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} = [];
}
}
@@ -711,6 +720,17 @@
return @list;
}
+sub type_quoted {
+ while ($input =~ /\"(([^\"]|\\\")*[^\\\"])\"/g) {
+ my $message = $1;
+ my $before = $`;
+ $message =~ s/\\\"/\"/g;
+ $before =~ s/[^\n]//g;
+ $messages{$message} = [];
+ $loc{$message} = length ($before) + 2;
+ }
+}
+
sub type_glade {
### For translatable Glade XML files ###
Modified: ristretto/trunk/intltool-merge.in
===================================================================
--- ristretto/trunk/intltool-merge.in 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/intltool-merge.in 2007-07-12 22:51:09 UTC (rev 2902)
@@ -35,7 +35,7 @@
## Release information
my $PROGRAM = "intltool-merge";
my $PACKAGE = "intltool";
-my $VERSION = "0.35.0";
+my $VERSION = "0.35.5";
## Loaded modules
use strict;
@@ -60,6 +60,7 @@
my $DESKTOP_STYLE_ARG = 0;
my $SCHEMAS_STYLE_ARG = 0;
my $RFC822DEB_STYLE_ARG = 0;
+my $QUOTED_STYLE_ARG = 0;
my $QUIET_ARG = 0;
my $PASS_THROUGH_ARG = 0;
my $UTF8_ARG = 0;
@@ -79,6 +80,7 @@
"desktop-style|d" => \$DESKTOP_STYLE_ARG,
"schemas-style|s" => \$SCHEMAS_STYLE_ARG,
"rfc822deb-style|r" => \$RFC822DEB_STYLE_ARG,
+ "quoted-style" => \$QUOTED_STYLE_ARG,
"pass-through|p" => \$PASS_THROUGH_ARG,
"utf8|u" => \$UTF8_ARG,
"multiple-output|m" => \$MULTIPLE_OUTPUT,
@@ -157,6 +159,14 @@
&rfc822deb_merge_translations;
&finalize;
}
+elsif ($QUOTED_STYLE_ARG && @ARGV > 2)
+{
+ &utf8_sanity_check;
+ &preparation;
+ &print_message;
+ "ed_merge_translations;
+ &finalize;
+}
else
{
&print_help;
@@ -193,6 +203,7 @@
-k, --keys-style includes translations in the keys style
-s, --schemas-style includes translations in the schemas style
-r, --rfc822deb-style includes translations in the RFC822 style
+ --quoted-style includes translations in the quoted string style
-x, --xml-style includes translations in the standard xml style
Other options:
@@ -415,7 +426,7 @@
{
$nextfuzzy = 1 if /^#, fuzzy/;
- if (/^msgid "((\\.|[^\\])*)"/ )
+ if (/^msgid "((\\.|[^\\]+)*)"/ )
{
$translations{$lang, $msgid} = $msgstr if $inmsgstr && $msgid && $msgstr;
$msgid = "";
@@ -431,14 +442,14 @@
$nextfuzzy = 0;
}
- if (/^msgstr "((\\.|[^\\])*)"/)
+ if (/^msgstr "((\\.|[^\\]+)*)"/)
{
$msgstr = unescape_po_string($1);
$inmsgstr = 1;
$inmsgid = 0;
}
- if (/^"((\\.|[^\\])*)"/)
+ if (/^"((\\.|[^\\]+)*)"/)
{
$msgid .= unescape_po_string($1) if $inmsgid;
$msgstr .= unescape_po_string($1) if $inmsgstr;
@@ -1006,8 +1017,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';
@@ -1354,3 +1365,39 @@
return @list;
}
+sub quoted_translation
+{
+ my ($lang, $string) = @_;
+
+ $string =~ s/\\\"/\"/g;
+
+ my $translation = $translations{$lang, $string};
+ $translation = $string if !$translation;
+
+ $translation =~ s/\"/\\\"/g;
+ return $translation
+}
+
+sub quoted_merge_translations
+{
+ if (!$MULTIPLE_OUTPUT) {
+ print "Quoted only supports Multiple Output.\n";
+ exit(1);
+ }
+
+ for my $lang (sort keys %po_files_by_lang) {
+ 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";
+ binmode (OUTPUT) if $^O eq 'MSWin32';
+ while (<INPUT>)
+ {
+ s/\"(([^\"]|\\\")*[^\\\"])\"/"\"" . "ed_translation($lang, $1) . "\""/ge;
+ print OUTPUT;
+ }
+ close OUTPUT;
+ close INPUT;
+ }
+}
Modified: ristretto/trunk/intltool-update.in
===================================================================
--- ristretto/trunk/intltool-update.in 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/intltool-update.in 2007-07-12 22:51:09 UTC (rev 2902)
@@ -30,7 +30,7 @@
## Release information
my $PROGRAM = "intltool-update";
-my $VERSION = "0.35.0";
+my $VERSION = "0.35.5";
my $PACKAGE = "intltool";
## Loaded modules
@@ -90,10 +90,9 @@
$| = 1;
## Sometimes the source tree will be rooted somewhere else.
-my $SRCDIR = ".";
+my $SRCDIR = $ENV{"srcdir"} || ".";
my $POTFILES_in;
-$SRCDIR = $ENV{"srcdir"} if $ENV{"srcdir"};
$POTFILES_in = "<$SRCDIR/POTFILES.in";
my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null');
@@ -124,8 +123,10 @@
&Console_Write_IntltoolHelp if $arg_count > 1;
+my $PKGNAME = FindPackageName ();
+
# --version and --help don't require a module name
-my $MODULE = $GETTEXT_PACKAGE || &FindPackageName || "unknown";
+my $MODULE = $GETTEXT_PACKAGE || $PKGNAME || "unknown";
if ($POT_ARG)
{
@@ -316,7 +317,8 @@
@buf_potfiles_ignore,
@buf_allfiles,
@buf_allfiles_sorted,
- @buf_potfiles_sorted
+ @buf_potfiles_sorted,
+ @buf_potfiles_ignore_sorted
);
## Search and find all translatable files
@@ -342,7 +344,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")
{
@@ -351,7 +353,7 @@
}
print "Found $ignore: Ignoring files...\n" if $VERBOSE;
- open FILE, "<$ignore" or die "ERROR: Failed to open $ignore!\n";
+ open FILE, "<$SRCDIR/$ignore" or die "ERROR: Failed to open $SRCDIR/$ignore!\n";
while (<FILE>)
{
@@ -359,7 +361,7 @@
}
close FILE;
- @buf_potfiles = (@buf_potfiles_ignore, @buf_potfiles);
+ @buf_potfiles_ignore_sorted = sort (@buf_potfiles_ignore);
}
foreach my $file (@buf_i18n_plain)
@@ -417,7 +419,7 @@
}
}
- if (/\.GetString ?\(QUOTEDTEXT/)
+ if (/\w\.GetString *\(QUOTEDTEXT/)
{
if (defined isNotValidMissing (unpack("x3 A*", $file))) {
## Remove the first 3 chars and add newline
@@ -426,7 +428,8 @@
last;
}
- if (/_\(QUOTEDTEXT/)
+ ## N_ Q_ and _ are the three macros defined in gi8n.h
+ if (/[NQ]?_ *\(QUOTEDTEXT/)
{
if (defined isNotValidMissing (unpack("x3 A*", $file))) {
## Remove the first 3 chars and add newline
@@ -489,6 +492,11 @@
$in2{$_} = 1;
}
+ foreach (@buf_potfiles_ignore_sorted)
+ {
+ $in2{$_} = 1;
+ }
+
my @result;
foreach (@buf_allfiles_sorted)
@@ -504,7 +512,7 @@
foreach (@buf_potfiles_sorted)
{
chomp (my $dummy = $_);
- if ("$dummy" ne "" and ! -f "../$dummy")
+ if ("$dummy" ne "" and !(-f "$SRCDIR/../$dummy" or -f "../$dummy"))
{
push @buf_potfiles_notexist, $_;
}
@@ -537,7 +545,7 @@
warn "\n" if ($VERBOSE or @result);
warn "\e[1mThe following files do not exist anymore:\e[0m\n\n";
warn @buf_potfiles_notexist, "\n";
- warn "Please remove them from POTFILES.in or POTFILES.skip. A file \e[1m'notexist'\e[0m\n".
+ warn "Please remove them from POTFILES.in. A file \e[1m'notexist'\e[0m\n".
"containing this list of absent files has been written in the current directory.\n";
}
}
@@ -557,11 +565,8 @@
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")
@@ -671,12 +676,8 @@
}
else
{
- if ($SRCDIR eq ".") {
- print OUTFILE "../$_\n";
- } else {
- print OUTFILE "$SRCDIR/../$_\n";
- }
- $gettext_code = &TextFile_DetermineEncoding ("../$_") if ($gettext_support_nonascii and not defined $forced_gettext_code);
+ print OUTFILE "$SRCDIR/../$_\n";
+ $gettext_code = &TextFile_DetermineEncoding ("$SRCDIR/../$_") if ($gettext_support_nonascii and not defined $forced_gettext_code);
}
next if (! $gettext_support_nonascii);
Added: ristretto/trunk/po/ChangeLog
===================================================================
--- ristretto/trunk/po/ChangeLog (rev 0)
+++ ristretto/trunk/po/ChangeLog 2007-07-12 22:51:09 UTC (rev 2902)
@@ -0,0 +1,5 @@
+13-07-2007 Stephan Arts <stephan at xfce.org>
+ * nl.po: Add dutch translation
+ * Makevars: Fix email adress
+ * LINGUAS: Add dutch translation to LINGUAS
+ * ChangeLog: Add ChangeLog file
Modified: ristretto/trunk/po/LINGUAS
===================================================================
--- ristretto/trunk/po/LINGUAS 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/po/LINGUAS 2007-07-12 22:51:09 UTC (rev 2902)
@@ -0,0 +1 @@
+nl
Modified: ristretto/trunk/po/Makefile.in.in
===================================================================
--- ristretto/trunk/po/Makefile.in.in 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/po/Makefile.in.in 2007-07-12 22:51:09 UTC (rev 2902)
@@ -25,7 +25,7 @@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
-top_builddir = ..
+top_builddir = @top_builddir@
VPATH = @srcdir@
prefix = @prefix@
@@ -57,15 +57,19 @@
PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
-POFILES=$(shell if test -n "$(PO_LINGUAS)"; then LINGUAS="$(PO_LINGUAS)"; else LINGUAS="$(ALL_LINGUAS)"; fi; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
POTFILES = \
-#This Gets Replace for some reason
+# This comment gets stripped out
-CATALOGS=$(shell if test -n "$(PO_LINGUAS)"; then LINGUAS="$(PO_LINGUAS)"; else LINGUAS="$(ALL_LINGUAS)"; fi; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
.SUFFIXES:
.SUFFIXES: .po .pox .gmo .mo .msg .cat
@@ -99,11 +103,7 @@
install-data-no: all
install-data-yes: all
$(mkdir_p) $(DESTDIR)$(itlocaledir)
- if test -n "$(PO_LINGUAS)"; then \
- linguas="$(PO_LINGUAS)"; \
- else \
- linguas="$(ALL_LINGUAS)"; \
- fi; \
+ linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
$(mkdir_p) $$dir; \
@@ -137,17 +137,18 @@
installcheck:
uninstall:
- if test -n "$(PO_LINGUAS)"; then \
- linguas="$(PO_LINGUAS)"; \
- else \
- linguas="$(ALL_LINGUAS)"; \
- fi; \
+ linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
done
check: all $(GETTEXT_PACKAGE).pot
+ rm -f missing notexist
+ srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+ if [ -r missing -o -r notexist ]; then \
+ exit 1; \
+ fi
mostlyclean:
rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
@@ -180,11 +181,7 @@
update-po: Makefile
$(MAKE) $(GETTEXT_PACKAGE).pot
tmpdir=`pwd`; \
- if test -n "$(PO_LINGUAS)"; then \
- linguas="$(PO_LINGUAS)"; \
- else \
- linguas="$(ALL_LINGUAS)"; \
- fi; \
+ linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
echo "$$lang:"; \
result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
@@ -212,8 +209,8 @@
$(MAKE) stamp-it; \
fi
-stamp-it: Makefile.in.in ../config.status POTFILES.in
- cd .. \
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
$(SHELL) ./config.status
Modified: ristretto/trunk/po/Makevars
===================================================================
--- ristretto/trunk/po/Makevars 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/po/Makevars 2007-07-12 22:51:09 UTC (rev 2902)
@@ -34,7 +34,7 @@
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
-MSGID_BUGS_ADDRESS = psybsd at gmail.com
+MSGID_BUGS_ADDRESS = stephan at xfce.org
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
Added: ristretto/trunk/po/nl.po
===================================================================
--- ristretto/trunk/po/nl.po (rev 0)
+++ ristretto/trunk/po/nl.po 2007-07-12 22:51:09 UTC (rev 2902)
@@ -0,0 +1,21 @@
+# Dutch translations for ristretto package.
+# Copyright (C) 2007 THE ristretto'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the ristretto package.
+# Stephan Arts <stephan at xfce.org>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ristretto 0.0.1-svn-r02537\n"
+"Report-Msgid-Bugs-To: psybsd at gmail.com\n"
+"POT-Creation-Date: 2007-07-13 00:46+0200\n"
+"PO-Revision-Date: 2007-07-13 00:48+0200\n"
+"Last-Translator: Stephan Arts <stephan at xfce.org>\n"
+"Language-Team: Dutch\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: ../src/main.c:131
+msgid "Open image"
+msgstr "Afbeelding openen"
Added: ristretto/trunk/po/ristretto.pot
===================================================================
--- ristretto/trunk/po/ristretto.pot (rev 0)
+++ ristretto/trunk/po/ristretto.pot 2007-07-12 22:51:09 UTC (rev 2902)
@@ -0,0 +1,21 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: psybsd at gmail.com\n"
+"POT-Creation-Date: 2007-07-13 00:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/main.c:131
+msgid "Open image"
+msgstr ""
Modified: ristretto/trunk/src/main.c
===================================================================
--- ristretto/trunk/src/main.c 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/src/main.c 2007-07-12 22:51:09 UTC (rev 2902)
@@ -1,6 +1,4 @@
/*
- * Copyright (c) 2006 Stephan Arts <stephan at xfce.org>
- *
* 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
* the Free Software Foundation; either version 2 of the License, or
@@ -18,6 +16,7 @@
#include <config.h>
#include <gtk/gtk.h>
+#include <gettext.h>
#include "picture_viewer.h"
@@ -29,6 +28,8 @@
cb_rstto_zoom_in(GtkToolItem *item, RsttoPictureViewer *viewer);
static void
cb_rstto_zoom_out(GtkToolItem *item, RsttoPictureViewer *viewer);
+static void
+cb_rstto_open(GtkToolItem *item, RsttoPictureViewer *viewer);
int main(int argc, char **argv)
{
@@ -55,7 +56,12 @@
GtkToolItem *zoom_100= gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_100);
GtkToolItem *zoom_out= gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_OUT);
GtkToolItem *zoom_in= gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_IN);
+ GtkToolItem *open = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN);
+ GtkToolItem *spacer = gtk_tool_item_new();
+ gtk_tool_item_set_expand(spacer, TRUE);
+ gtk_tool_item_set_homogeneous(spacer, FALSE);
+
rstto_picture_viewer_set_pixbuf(RSTTO_PICTURE_VIEWER(viewer), pixbuf);
gtk_widget_set_size_request(window, 300, 200);
@@ -72,11 +78,14 @@
gtk_toolbar_insert(GTK_TOOLBAR(tool_bar), zoom_100, 0);
gtk_toolbar_insert(GTK_TOOLBAR(tool_bar), zoom_out, 0);
gtk_toolbar_insert(GTK_TOOLBAR(tool_bar), zoom_in, 0);
+ gtk_toolbar_insert(GTK_TOOLBAR(tool_bar), spacer, 0);
+ gtk_toolbar_insert(GTK_TOOLBAR(tool_bar), open, 0);
g_signal_connect(G_OBJECT(zoom_fit), "clicked", G_CALLBACK(cb_rstto_zoom_fit), viewer);
g_signal_connect(G_OBJECT(zoom_100), "clicked", G_CALLBACK(cb_rstto_zoom_100), viewer);
g_signal_connect(G_OBJECT(zoom_in), "clicked", G_CALLBACK(cb_rstto_zoom_in), viewer);
g_signal_connect(G_OBJECT(zoom_out), "clicked", G_CALLBACK(cb_rstto_zoom_out), viewer);
+ g_signal_connect(G_OBJECT(open), "clicked", G_CALLBACK(cb_rstto_open), viewer);
gtk_container_add(GTK_CONTAINER(window), main_vbox);
@@ -112,3 +121,27 @@
gdouble scale = rstto_picture_viewer_get_scale(viewer);
rstto_picture_viewer_set_scale(viewer, scale/1.2);
}
+
+static void
+cb_rstto_open(GtkToolItem *item, RsttoPictureViewer *viewer)
+{
+ GdkPixbuf *pixbuf = NULL;
+ GtkWidget *window = gtk_widget_get_toplevel(GTK_WIDGET(item));
+
+ GtkWidget *dialog = gtk_file_chooser_dialog_new(_("Open image"),
+ GTK_WINDOW(window),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+ NULL);
+
+ gint response = gtk_dialog_run(GTK_DIALOG(dialog));
+ if(response == GTK_RESPONSE_OK)
+ {
+ pixbuf = gdk_pixbuf_new_from_file(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)), NULL);
+
+ rstto_picture_viewer_set_pixbuf(RSTTO_PICTURE_VIEWER(viewer), pixbuf);
+ }
+
+ gtk_widget_destroy(dialog);
+}
Modified: ristretto/trunk/src/picture_viewer.c
===================================================================
--- ristretto/trunk/src/picture_viewer.c 2007-07-09 16:58:29 UTC (rev 2901)
+++ ristretto/trunk/src/picture_viewer.c 2007-07-12 22:51:09 UTC (rev 2902)
@@ -1,6 +1,4 @@
/*
- * Copyright (c) 2006 Stephan Arts <stephan at xfce.org>
- *
* 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
* the Free Software Foundation; either version 2 of the License, or
@@ -116,16 +114,16 @@
object_class->destroy = rstto_picture_viewer_destroy;
- widget_class->set_scroll_adjustments_signal =
- g_signal_new ("set_scroll_adjustments",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (RsttoPictureViewerClass, set_scroll_adjustments),
- NULL, NULL,
- gtk_marshal_VOID__POINTER_POINTER,
- G_TYPE_NONE, 2,
- GTK_TYPE_ADJUSTMENT,
- GTK_TYPE_ADJUSTMENT);
+ widget_class->set_scroll_adjustments_signal =
+ g_signal_new ("set_scroll_adjustments",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (RsttoPictureViewerClass, set_scroll_adjustments),
+ NULL, NULL,
+ gtk_marshal_VOID__POINTER_POINTER,
+ G_TYPE_NONE, 2,
+ GTK_TYPE_ADJUSTMENT,
+ GTK_TYPE_ADJUSTMENT);
}
@@ -205,21 +203,30 @@
GdkPixbuf *pixbuf = RSTTO_PICTURE_VIEWER(widget)->dst_pixbuf;
/* required for transparent pixbufs... add double buffering to fix flickering*/
if(GTK_WIDGET_REALIZED(widget))
- {
- gdk_window_clear(widget->window);
+ {
+ GdkPixmap *buffer = gdk_pixmap_new(NULL, widget->allocation.width, widget->allocation.height, gdk_drawable_get_depth(widget->window));
if(pixbuf)
{
- gdk_draw_pixbuf(GDK_DRAWABLE(widget->window),
+ gdk_draw_pixbuf(GDK_DRAWABLE(buffer),
NULL,
pixbuf,
0,
0,
(widget->allocation.width-gdk_pixbuf_get_width(pixbuf))<0?0:(widget->allocation.width-gdk_pixbuf_get_width(pixbuf))/2,
(widget->allocation.height-gdk_pixbuf_get_height(pixbuf))<0?0:(widget->allocation.height-gdk_pixbuf_get_height(pixbuf))/2,
- gdk_pixbuf_get_width(pixbuf),
- gdk_pixbuf_get_height(pixbuf),
+ gdk_pixbuf_get_width(pixbuf),
+ gdk_pixbuf_get_height(pixbuf),
GDK_RGB_DITHER_NONE,
0,0);
+ gdk_draw_drawable(GDK_DRAWABLE(widget->window),
+ gdk_gc_new(widget->window),
+ buffer,
+ 0,
+ 0,
+ 0,
+ 0,
+ widget->allocation.width,
+ widget->allocation.height);
}
}
}
More information about the Goodies-commits
mailing list