granule 1.2.0
Eric Dorland
18 years ago
0 | Release 1.2.0 | |
1 | Nov 30 2005 Vladislav Grinchenko (vlg@users.sourceforge.net) | |
2 | - Fix CardFile Save option greyed out bug (bug #1261317). | |
3 | - Add an option to disable keyboard shortcuts in DeckPlayer. | |
4 | - Add hours/minutes scheduling resolution (rfe #1256643). | |
5 | - Make DeckView sortable by either Front or Back column (rfe #1348833). | |
6 | - Add selection of the answer line for multiline front size of the | |
7 | card in DeckPlayer dialog (used for studying multiple languages | |
8 | in one Deck). | |
9 | - Make CardView input dialog fully tabular. | |
10 | - Add Pango markup shortcut controls to CardView dialog. | |
11 | - Add Japanese translation by Jeff Ames (jeffames@users.sourceforge.net) | |
12 | - Catch illegal pango markup and give the user a chance to fix it. | |
13 | - Get rid of libxml++ dependency (uses basic libxml2 instead). | |
14 | - Port to libassa-3.4.x. | |
15 | - Port to cygwin32. | |
16 | - Port to x86_ia64 - Konstantin Riabitsev (graf25@users.sourceforge.net) | |
17 | ||
0 | 18 | Release 1.1.6 |
1 | 19 | Jul 3 2005 Vladislav Grinchenko (vlg@users.sourceforge.net) |
2 | 20 | - Fix markup of multiple tildas in the Example field. |
1500 | 1500 | |
1501 | 1501 | |
1502 | 1502 | APP_MAJOR_VERSION=1 |
1503 | APP_MINOR_VERSION=1 | |
1504 | APP_MICRO_VERSION=6 | |
1503 | APP_MINOR_VERSION=2 | |
1504 | APP_MICRO_VERSION=0 | |
1505 | 1505 | |
1506 | 1506 | APP_VERSION=$APP_MAJOR_VERSION.$APP_MINOR_VERSION.$APP_MICRO_VERSION |
1507 | 1507 | APP_SUBVERSION=$APP_MAJOR_VERSION.$APP_MINOR_VERSION |
20164 | 20164 | echo "${ECHO_T}yes" >&6 |
20165 | 20165 | |
20166 | 20166 | |
20167 | ALL_LINGUAS="ru ru_RU bg" | |
20167 | ALL_LINGUAS="ru bg de_DE ja_JP" | |
20168 | 20168 | |
20169 | 20169 | |
20170 | 20170 | |
21859 | 21859 | else |
21860 | 21860 | PKG_CONFIG_MIN_VERSION=0.9.0 |
21861 | 21861 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then |
21862 | echo "$as_me:$LINENO: checking for libxml++-2.6 >= 0.26.0" >&5 | |
21863 | echo $ECHO_N "checking for libxml++-2.6 >= 0.26.0... $ECHO_C" >&6 | |
21864 | ||
21865 | if $PKG_CONFIG --exists "libxml++-2.6 >= 0.26.0" ; then | |
21862 | echo "$as_me:$LINENO: checking for libxml-2.0 >= 2.6.16" >&5 | |
21863 | echo $ECHO_N "checking for libxml-2.0 >= 2.6.16... $ECHO_C" >&6 | |
21864 | ||
21865 | if $PKG_CONFIG --exists "libxml-2.0 >= 2.6.16" ; then | |
21866 | 21866 | echo "$as_me:$LINENO: result: yes" >&5 |
21867 | 21867 | echo "${ECHO_T}yes" >&6 |
21868 | 21868 | succeeded=yes |
21869 | 21869 | |
21870 | 21870 | echo "$as_me:$LINENO: checking XMLCPP_CFLAGS" >&5 |
21871 | 21871 | echo $ECHO_N "checking XMLCPP_CFLAGS... $ECHO_C" >&6 |
21872 | XMLCPP_CFLAGS=`$PKG_CONFIG --cflags "libxml++-2.6 >= 0.26.0"` | |
21872 | XMLCPP_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6.16"` | |
21873 | 21873 | echo "$as_me:$LINENO: result: $XMLCPP_CFLAGS" >&5 |
21874 | 21874 | echo "${ECHO_T}$XMLCPP_CFLAGS" >&6 |
21875 | 21875 | |
21876 | 21876 | echo "$as_me:$LINENO: checking XMLCPP_LIBS" >&5 |
21877 | 21877 | echo $ECHO_N "checking XMLCPP_LIBS... $ECHO_C" >&6 |
21878 | XMLCPP_LIBS=`$PKG_CONFIG --libs "libxml++-2.6 >= 0.26.0"` | |
21878 | XMLCPP_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6.16"` | |
21879 | 21879 | echo "$as_me:$LINENO: result: $XMLCPP_LIBS" >&5 |
21880 | 21880 | echo "${ECHO_T}$XMLCPP_LIBS" >&6 |
21881 | 21881 | else |
21883 | 21883 | XMLCPP_LIBS="" |
21884 | 21884 | ## If we have a custom action on failure, don't print errors, but |
21885 | 21885 | ## do set a variable so people can do so. |
21886 | XMLCPP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml++-2.6 >= 0.26.0"` | |
21886 | XMLCPP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml-2.0 >= 2.6.16"` | |
21887 | 21887 | echo $XMLCPP_PKG_ERRORS |
21888 | 21888 | fi |
21889 | 21889 | |
21898 | 21898 | if test $succeeded = yes; then |
21899 | 21899 | : |
21900 | 21900 | else |
21901 | { { echo "$as_me:$LINENO: error: Library requirements (libxml++-2.6 >= 0.26.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 | |
21902 | echo "$as_me: error: Library requirements (libxml++-2.6 >= 0.26.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} | |
21901 | { { echo "$as_me:$LINENO: error: Library requirements (libxml-2.0 >= 2.6.16) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 | |
21902 | echo "$as_me: error: Library requirements (libxml-2.0 >= 2.6.16) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} | |
21903 | 21903 | { (exit 1); exit 1; }; } |
21904 | 21904 | fi |
21905 | 21905 | |
21961 | 21961 | else |
21962 | 21962 | PKG_CONFIG_MIN_VERSION=0.9.0 |
21963 | 21963 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then |
21964 | echo "$as_me:$LINENO: checking for assa >= 3.3.1" >&5 | |
21965 | echo $ECHO_N "checking for assa >= 3.3.1... $ECHO_C" >&6 | |
21966 | ||
21967 | if $PKG_CONFIG --exists "assa >= 3.3.1" ; then | |
21964 | echo "$as_me:$LINENO: checking for assa-3.4 >= 3.4.0" >&5 | |
21965 | echo $ECHO_N "checking for assa-3.4 >= 3.4.0... $ECHO_C" >&6 | |
21966 | ||
21967 | if $PKG_CONFIG --exists "assa-3.4 >= 3.4.0" ; then | |
21968 | 21968 | echo "$as_me:$LINENO: result: yes" >&5 |
21969 | 21969 | echo "${ECHO_T}yes" >&6 |
21970 | 21970 | succeeded=yes |
21971 | 21971 | |
21972 | 21972 | echo "$as_me:$LINENO: checking ASSA_CFLAGS" >&5 |
21973 | 21973 | echo $ECHO_N "checking ASSA_CFLAGS... $ECHO_C" >&6 |
21974 | ASSA_CFLAGS=`$PKG_CONFIG --cflags "assa >= 3.3.1"` | |
21974 | ASSA_CFLAGS=`$PKG_CONFIG --cflags "assa-3.4 >= 3.4.0"` | |
21975 | 21975 | echo "$as_me:$LINENO: result: $ASSA_CFLAGS" >&5 |
21976 | 21976 | echo "${ECHO_T}$ASSA_CFLAGS" >&6 |
21977 | 21977 | |
21978 | 21978 | echo "$as_me:$LINENO: checking ASSA_LIBS" >&5 |
21979 | 21979 | echo $ECHO_N "checking ASSA_LIBS... $ECHO_C" >&6 |
21980 | ASSA_LIBS=`$PKG_CONFIG --libs "assa >= 3.3.1"` | |
21980 | ASSA_LIBS=`$PKG_CONFIG --libs "assa-3.4 >= 3.4.0"` | |
21981 | 21981 | echo "$as_me:$LINENO: result: $ASSA_LIBS" >&5 |
21982 | 21982 | echo "${ECHO_T}$ASSA_LIBS" >&6 |
21983 | 21983 | else |
21985 | 21985 | ASSA_LIBS="" |
21986 | 21986 | ## If we have a custom action on failure, don't print errors, but |
21987 | 21987 | ## do set a variable so people can do so. |
21988 | ASSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "assa >= 3.3.1"` | |
21988 | ASSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "assa-3.4 >= 3.4.0"` | |
21989 | 21989 | echo $ASSA_PKG_ERRORS |
21990 | 21990 | fi |
21991 | 21991 | |
22000 | 22000 | if test $succeeded = yes; then |
22001 | 22001 | : |
22002 | 22002 | else |
22003 | { { echo "$as_me:$LINENO: error: Library requirements (assa >= 3.3.1) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 | |
22004 | echo "$as_me: error: Library requirements (assa >= 3.3.1) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} | |
22003 | { { echo "$as_me:$LINENO: error: Library requirements (assa-3.4 >= 3.4.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 | |
22004 | echo "$as_me: error: Library requirements (assa-3.4 >= 3.4.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} | |
22005 | 22005 | { (exit 1); exit 1; }; } |
22006 | 22006 | fi |
22007 | 22007 |
0 | 0 | dnl ---------------------------------------------------------------------------- |
1 | 1 | dnl configure.in |
2 | 2 | dnl |
3 | dnl $Id: configure.in,v 1.28 2005/07/06 02:52:23 vlg Exp $ | |
3 | dnl $Id: configure.in,v 1.32 2005/11/27 04:59:21 vlg Exp $ | |
4 | 4 | dnl ---------------------------------------------------------------------------- |
5 | 5 | |
6 | 6 | dnl Process this file with autoconf to produce a configure script. |
20 | 20 | dnl ---------------------------------------------------------------------------- |
21 | 21 | |
22 | 22 | APP_MAJOR_VERSION=1 |
23 | APP_MINOR_VERSION=1 | |
24 | APP_MICRO_VERSION=6 | |
23 | APP_MINOR_VERSION=2 | |
24 | APP_MICRO_VERSION=0 | |
25 | 25 | |
26 | 26 | APP_VERSION=$APP_MAJOR_VERSION.$APP_MINOR_VERSION.$APP_MICRO_VERSION |
27 | 27 | APP_SUBVERSION=$APP_MAJOR_VERSION.$APP_MINOR_VERSION |
57 | 57 | |
58 | 58 | dnl ---------------------------------------------------------------------------- |
59 | 59 | dnl Set PACKAGE_LOCALE_DIR in config.h. |
60 | dnl | |
61 | dnl The po files are in format LL_CC.po, where LL is the language code, | |
62 | dnl and CC is the coutry code. Both 'ru' and 'ru_RU' woudl be valid names, but | |
63 | dnl the latter is more narrowly defined. | |
64 | dnl | |
65 | dnl To enable locale, run LANG=ru_RU appname | |
60 | 66 | dnl ---------------------------------------------------------------------------- |
67 | dnl | |
68 | dnl | |
61 | 69 | |
62 | ALL_LINGUAS="ru ru_RU bg" | |
70 | ALL_LINGUAS="ru bg de_DE ja_JP" | |
63 | 71 | |
64 | 72 | AC_PROG_INTLTOOL([0.23]) |
65 | 73 | GETTEXT_PACKAGE=granule |
100 | 108 | dnl Replace with the current version number |
101 | 109 | dnl ---------------------------------------------------------------------------- |
102 | 110 | |
103 | PKG_CHECK_MODULES(XMLCPP, libxml++-2.6 >= 0.26.0) | |
111 | PKG_CHECK_MODULES(XMLCPP, libxml-2.0 >= 2.6.16) | |
104 | 112 | AC_SUBST(XMLCPP_CFLAGS) |
105 | 113 | AC_SUBST(XMLCPP_LIBS) |
106 | 114 | |
109 | 117 | dnl Replace with the current version number |
110 | 118 | dnl ---------------------------------------------------------------------------- |
111 | 119 | |
112 | PKG_CHECK_MODULES(ASSA, assa >= 3.3.1) | |
120 | PKG_CHECK_MODULES(ASSA, assa-3.4 >= 3.4.0) | |
113 | 121 | AC_SUBST(ASSA_CFLAGS) |
114 | 122 | AC_SUBST(ASSA_LIBS) |
115 | 123 |
0 | granule (1.2.0-1) unstable; urgency=low | |
1 | ||
2 | * New upstream release. | |
3 | * debian/control: Use new libassa dev package. | |
4 | ||
5 | -- Eric Dorland <eric@debian.org> Fri, 16 Dec 2005 20:58:59 -0500 | |
6 | ||
0 | 7 | granule (1.1.6-1) unstable; urgency=low |
1 | 8 | |
9 | * Never uploaded. | |
2 | 10 | * Initial release. |
3 | 11 | |
4 | 12 | -- Eric Dorland <eric@debian.org> Thu, 7 Apr 2005 00:44:14 -0400 |
1 | 1 | Section: games |
2 | 2 | Priority: optional |
3 | 3 | Maintainer: Eric Dorland <eric@debian.org> |
4 | Build-Depends: debhelper (>= 4.1), cdbs, libgtkmm-2.4-dev, libxml++2.6-dev, libassa0-dev, libxml-parser-perl | |
5 | Standards-Version: 3.6.2.0 | |
4 | Build-Depends: debhelper (>= 4.1), cdbs, libgtkmm-2.4-dev, libxml++2.6-dev, libassa3.4-0-dev, libxml-parser-perl | |
5 | Standards-Version: 3.6.2.1 | |
6 | 6 | |
7 | 7 | Package: granule |
8 | 8 | Architecture: any |
0 | 0 | [options] |
1 | 1 | gtk_options="--disable-crash-dialog" |
2 | 2 | log_level=0 |
3 | log_stdout=false | |
3 | log_stdout="no" | |
4 | 4 | |
5 | 5 | [History] |
6 | 6 | |
23 | 23 | history_size=5 |
24 | 24 | root_x=521 |
25 | 25 | root_y=164 |
26 | disable_key_shortcuts=false | |
26 | 27 | |
27 | 28 | [Scheduling] |
28 | 1=4/0 | |
29 | 2=0/1 | |
30 | 3=0/2 | |
31 | 4=0/3 | |
32 | 5=0/4 | |
29 | 1=0/4/0/0 | |
30 | 2=1/0/0/0 | |
31 | 3=2/0/0/0 | |
32 | 4=3/0/0/0 | |
33 | 5=4/0/0/0 |
4 | 4 | # |
5 | 5 | # RPM format: name-version-release.rpm |
6 | 6 | # |
7 | # $Id: granule.spec.in,v 1.15 2005/07/06 02:52:23 vlg Exp $ | |
7 | # $Id: granule.spec.in,v 1.16 2005/11/13 02:50:47 vlg Exp $ | |
8 | 8 | #=============================================================================== |
9 | 9 | %define debug_package %{nil} |
10 | 10 | |
11 | 11 | %define name granule |
12 | %define ver 1.1.6 | |
12 | %define ver 1.2.0 | |
13 | 13 | |
14 | 14 | %define rel 1 |
15 | 15 | %define disttag fc2 |
24 | 24 | Version: %ver |
25 | 25 | Release: %{release} |
26 | 26 | Source: %{name}-%{version}.tar.gz |
27 | Copyright: GPL | |
27 | License: GPL | |
28 | 28 | Group: Applications |
29 | 29 | Packager: Vladislav Grinchenko (vlg@users.sourceforge.net) |
30 | 30 | Source: %{name}-%{version}.tar.gz |
97 | 97 | #=============================================================================== |
98 | 98 | |
99 | 99 | %changelog |
100 | * Sun Nov 6 2005 Vladislav Grinchenko <vlg@users.sourceforge.net> | |
101 | - Fixed License tag | |
102 | ||
100 | 103 | * Mon Jul 4 2005 Vladislav Grinchenko <vlg@users.sourceforge.net> |
101 | 104 | - Changed XML dir. |
102 | 105 |
4 | 4 | # |
5 | 5 | # RPM format: name-version-release.rpm |
6 | 6 | # |
7 | # $Id: granule.spec.in,v 1.15 2005/07/06 02:52:23 vlg Exp $ | |
7 | # $Id: granule.spec.in,v 1.16 2005/11/13 02:50:47 vlg Exp $ | |
8 | 8 | #=============================================================================== |
9 | 9 | %define debug_package %{nil} |
10 | 10 | |
24 | 24 | Version: %ver |
25 | 25 | Release: %{release} |
26 | 26 | Source: %{name}-%{version}.tar.gz |
27 | Copyright: GPL | |
27 | License: GPL | |
28 | 28 | Group: Applications |
29 | 29 | Packager: Vladislav Grinchenko (vlg@users.sourceforge.net) |
30 | 30 | Source: %{name}-%{version}.tar.gz |
97 | 97 | #=============================================================================== |
98 | 98 | |
99 | 99 | %changelog |
100 | * Sun Nov 6 2005 Vladislav Grinchenko <vlg@users.sourceforge.net> | |
101 | - Fixed License tag | |
102 | ||
100 | 103 | * Mon Jul 4 2005 Vladislav Grinchenko <vlg@users.sourceforge.net> |
101 | 104 | - Changed XML dir. |
102 | 105 |
0 | # $Id: Makefile.am,v 1.6 2005/04/10 23:48:43 vlg Exp $ | |
0 | # $Id: Makefile.am,v 1.7 2005/11/14 04:12:14 vlg Exp $ | |
1 | 1 | # |
2 | 2 | # src/pixmaps/Makefile.am |
3 | 3 | # |
4 | 4 | |
5 | 5 | pixmapdir = $(grappdatadir)/pixmaps |
6 | ||
6 | 7 | pixmap_DATA = drawer_empty.xpm drawer_many.xpm drawer_one.xpm \ |
7 | 8 | sched_green.xpm sched_grey.xpm sched_red.xpm \ |
8 | 9 | sched_yellow.xpm speaker_24.xpm copy_deck.xpm \ |
9 | 10 | thumbdown.xpm thumbup.xpm \ |
10 | cardview_32x32.png deckplayer_32x32.png deckview_32x32.png | |
11 | cardview_32x32.png deckplayer_32x32.png deckview_32x32.png \ | |
12 | text_big.png text_block.png text_bold.png text_center.png \ | |
13 | text_color_background.png text_color_foreground.png \ | |
14 | text_color_hilight.png text_italic.png text_left.png \ | |
15 | text_monospaced.png text_remove_tags.png text_right.png \ | |
16 | text_small.png text_subscript.png text_superscript.png \ | |
17 | text_underlined.png | |
11 | 18 | |
12 | 19 | EXTRA_DIST = $(pixmap_DATA) |
13 | 20 |
13 | 13 | |
14 | 14 | @SET_MAKE@ |
15 | 15 | |
16 | # $Id: Makefile.am,v 1.6 2005/04/10 23:48:43 vlg Exp $ | |
16 | # $Id: Makefile.am,v 1.7 2005/11/14 04:12:14 vlg Exp $ | |
17 | 17 | # |
18 | 18 | # src/pixmaps/Makefile.am |
19 | 19 | # |
206 | 206 | sched_green.xpm sched_grey.xpm sched_red.xpm \ |
207 | 207 | sched_yellow.xpm speaker_24.xpm copy_deck.xpm \ |
208 | 208 | thumbdown.xpm thumbup.xpm \ |
209 | cardview_32x32.png deckplayer_32x32.png deckview_32x32.png | |
209 | cardview_32x32.png deckplayer_32x32.png deckview_32x32.png \ | |
210 | text_big.png text_block.png text_bold.png text_center.png \ | |
211 | text_color_background.png text_color_foreground.png \ | |
212 | text_color_hilight.png text_italic.png text_left.png \ | |
213 | text_monospaced.png text_remove_tags.png text_right.png \ | |
214 | text_small.png text_subscript.png text_superscript.png \ | |
215 | text_underlined.png | |
210 | 216 | |
211 | 217 | EXTRA_DIST = $(pixmap_DATA) |
212 | 218 | all: all-am |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | 0 | # List of source files containing translatable strings. |
1 | ./src/CSVImportDialog.cpp | |
1 | 2 | ./src/CardBox.cpp |
2 | 3 | ./src/CardDeck.cpp |
3 | 4 | ./src/CardView.cpp |
5 | ./src/Deck.cpp | |
4 | 6 | ./src/DeckPlayer.cpp |
7 | ./src/GeneralPref.cpp | |
5 | 8 | ./src/MainWindow.cpp |
6 | 9 | |
10 | ||
11 |
4 | 4 | # , fuzzy |
5 | 5 | # |
6 | 6 | # |
7 | #: src/CSVImportDialog.cpp:74 | |
7 | 8 | msgid "" |
8 | 9 | msgstr "" |
9 | 10 | "Project-Id-Version: granule\n" |
10 | 11 | "Report-Msgid-Bugs-To: \n" |
11 | "POT-Creation-Date: 2005-07-12 22:08-0400\n" | |
12 | "POT-Creation-Date: 2005-11-27 18:53-0500\n" | |
12 | 13 | "PO-Revision-Date: 2005-04-13 18:23+0300\n" |
13 | 14 | "Last-Translator: Rostislav \"zbrox\" Raykov <zbrox@i-space.org>\n" |
14 | 15 | "Language-Team: Bulgarian <dict@linux.zonebg.com>\n" |
16 | 17 | "Content-Type: text/plain; charset=UTF-8\n" |
17 | 18 | "Content-Transfer-Encoding: 8bit\n" |
18 | 19 | |
20 | #: src/CSVImportDialog.cpp:57 src/CardView.cpp:119 | |
21 | msgid "Cancel" | |
22 | msgstr "?????" | |
23 | ||
24 | #: src/CSVImportDialog.cpp:64 | |
25 | msgid "Import" | |
26 | msgstr "" | |
27 | ||
28 | #: src/CSVImportDialog.cpp:69 | |
29 | msgid "Line Break:" | |
30 | msgstr "" | |
31 | ||
32 | #: src/CSVImportDialog.cpp:70 | |
33 | msgid "UNIX (LF)" | |
34 | msgstr "" | |
35 | ||
36 | #: src/CSVImportDialog.cpp:71 | |
37 | msgid "Windows (CR+LF)" | |
38 | msgstr "" | |
39 | ||
40 | #: src/CSVImportDialog.cpp:76 | |
41 | msgid "Space" | |
42 | msgstr "" | |
43 | ||
44 | #: src/CSVImportDialog.cpp:77 | |
45 | msgid "Tab" | |
46 | msgstr "" | |
47 | ||
48 | #: src/CSVImportDialog.cpp:78 | |
49 | msgid "Semicolon (;)" | |
50 | msgstr "" | |
51 | ||
52 | #: src/CSVImportDialog.cpp:79 | |
53 | msgid "Colon (:)" | |
54 | msgstr "" | |
55 | ||
56 | #: src/CSVImportDialog.cpp:81 | |
57 | msgid "Comma (,)" | |
58 | msgstr "" | |
59 | ||
60 | #: src/CSVImportDialog.cpp:85 | |
61 | msgid "Separators" | |
62 | msgstr "" | |
63 | ||
64 | #: src/CSVImportDialog.cpp:88 | |
65 | msgid "See two separators as one" | |
66 | msgstr "" | |
67 | ||
68 | #: src/CSVImportDialog.cpp:214 | |
69 | msgid "CSV Text Import" | |
70 | msgstr "" | |
71 | ||
19 | 72 | #: src/CardBox.cpp:184 |
20 | 73 | msgid "0 cards" |
21 | 74 | msgstr "0 ?????" |
22 | 75 | |
23 | #: src/CardBox.cpp:311 | |
76 | #: src/CardBox.cpp:325 | |
24 | 77 | msgid "" |
25 | 78 | "Failed to parse file\n" |
26 | 79 | " " |
28 | 81 | "??????? ??? ??????????? ?? ????\n" |
29 | 82 | "..." |
30 | 83 | |
31 | #: src/CardBox.cpp:312 | |
84 | #: src/CardBox.cpp:326 | |
32 | 85 | msgid "" |
33 | 86 | "\n" |
34 | 87 | "Reason: invalid file syntax/DTD" |
36 | 89 | "\n" |
37 | 90 | "???????: ????????? ?????? ?????????/DTD" |
38 | 91 | |
39 | #: src/CardBox.cpp:499 | |
92 | #: src/CardBox.cpp:539 | |
40 | 93 | msgid "File \n" |
41 | 94 | msgstr "???? \n" |
42 | 95 | |
43 | #: src/CardBox.cpp:500 | |
96 | #: src/CardBox.cpp:540 | |
44 | 97 | msgid "" |
45 | 98 | "\n" |
46 | 99 | "already exists.\n" |
50 | 103 | "???? ??????????.\n" |
51 | 104 | "??????? ?? ????? ?? ?? ?????????" |
52 | 105 | |
53 | #: src/CardBox.cpp:507 src/CardBox.cpp:775 src/DeckPlayer.cpp:886 | |
106 | #: src/CardBox.cpp:547 src/CardBox.cpp:815 src/DeckPlayer.cpp:988 | |
54 | 107 | msgid "Yes" |
55 | 108 | msgstr "??" |
56 | 109 | |
57 | #: src/CardBox.cpp:508 src/CardBox.cpp:776 src/DeckPlayer.cpp:887 | |
110 | #: src/CardBox.cpp:548 src/CardBox.cpp:816 src/DeckPlayer.cpp:989 | |
58 | 111 | msgid "No" |
59 | 112 | msgstr "??" |
60 | 113 | |
61 | #: src/CardBox.cpp:543 | |
114 | #: src/CardBox.cpp:583 | |
62 | 115 | msgid "Trying to access index out of range!" |
63 | 116 | msgstr "" |
64 | 117 | |
65 | #: src/CardBox.cpp:554 | |
118 | #: src/CardBox.cpp:594 | |
66 | 119 | msgid "Card Deck you've selected is empty" |
67 | 120 | msgstr "??????? ?????, ????? ??? ??????? ? ??????" |
68 | 121 | |
69 | #: src/CardBox.cpp:573 | |
122 | #: src/CardBox.cpp:613 | |
70 | 123 | msgid "" |
71 | 124 | "First, open or create\n" |
72 | 125 | "a Card Box file." |
74 | 127 | "????? ???????? ??? ????????\n" |
75 | 128 | "???? ?? ????? ?? ?????." |
76 | 129 | |
77 | #: src/CardBox.cpp:612 | |
130 | #: src/CardBox.cpp:652 | |
78 | 131 | msgid "First, open or create a Card File." |
79 | 132 | msgstr "????? ???????? ??? ???????? ???? ?? ?????." |
80 | 133 | |
81 | #: src/CardBox.cpp:656 | |
134 | #: src/CardBox.cpp:696 | |
82 | 135 | msgid "" |
83 | 136 | "You have learnt all\n" |
84 | 137 | "expired cards in this deck." |
86 | 139 | "???????? ?????? ?????\n" |
87 | 140 | "? ??????? ???? ? ???? ?????." |
88 | 141 | |
89 | #: src/CardBox.cpp:689 | |
142 | #: src/CardBox.cpp:729 | |
90 | 143 | msgid "" |
91 | 144 | "First Open or Create\n" |
92 | 145 | "a New Card File!" |
94 | 147 | "????? ???????? ??? ????????\n" |
95 | 148 | "??? ???? ?? ?????!" |
96 | 149 | |
97 | #: src/CardDeck.cpp:25 | |
150 | #: src/CardDeck.cpp:26 | |
98 | 151 | msgid "Card Box 1" |
99 | 152 | msgstr "????? ?? ????? 1" |
100 | 153 | |
101 | #: src/CardDeck.cpp:25 | |
154 | #: src/CardDeck.cpp:26 | |
102 | 155 | msgid "Card Box 2" |
103 | 156 | msgstr "????? ?? ????? 2" |
104 | 157 | |
105 | #: src/CardDeck.cpp:26 | |
158 | #: src/CardDeck.cpp:27 | |
106 | 159 | msgid "Card Box 3" |
107 | 160 | msgstr "????? ?? ????? 3" |
108 | 161 | |
109 | #: src/CardDeck.cpp:26 | |
162 | #: src/CardDeck.cpp:27 | |
110 | 163 | msgid "Card Box 4" |
111 | 164 | msgstr "????? ?? ????? 4" |
112 | 165 | |
113 | #: src/CardDeck.cpp:27 | |
166 | #: src/CardDeck.cpp:28 | |
114 | 167 | msgid "Card Box 5" |
115 | 168 | msgstr "????? ?? ????? 5" |
116 | 169 | |
117 | #: src/CardView.cpp:109 | |
170 | #: src/CardView.cpp:111 | |
118 | 171 | msgid "Clear" |
119 | 172 | msgstr "??????????" |
120 | 173 | |
121 | #: src/CardView.cpp:117 | |
122 | msgid "Cancel" | |
123 | msgstr "?????" | |
124 | ||
125 | #: src/CardView.cpp:126 | |
174 | #: src/CardView.cpp:128 | |
126 | 175 | msgid "Add" |
127 | 176 | msgstr "" |
128 | 177 | |
129 | #: src/CardView.cpp:135 | |
178 | #: src/CardView.cpp:137 | |
130 | 179 | msgid "Ok" |
131 | 180 | msgstr "?????" |
132 | 181 | |
133 | #: src/CardView.cpp:144 | |
182 | #: src/CardView.cpp:146 | |
134 | 183 | msgid "Help" |
135 | 184 | msgstr "" |
136 | 185 | |
137 | #: src/CardView.cpp:153 | |
186 | #: src/CardView.cpp:155 | |
138 | 187 | msgid "Front : " |
139 | 188 | msgstr "???? : " |
140 | 189 | |
141 | #: src/CardView.cpp:159 | |
190 | #: src/CardView.cpp:161 | |
142 | 191 | msgid "Back :" |
143 | 192 | msgstr "???? : " |
144 | 193 | |
145 | #: src/CardView.cpp:165 | |
194 | #: src/CardView.cpp:167 | |
146 | 195 | msgid "Example : " |
147 | 196 | msgstr "?????? : " |
148 | 197 | |
149 | #: src/CardView.cpp:266 | |
198 | #: src/CardView.cpp:269 | |
150 | 199 | msgid "Fill up the back of the card" |
151 | 200 | msgstr "????????? ????? ?? ???????" |
152 | 201 | |
153 | #: src/CardView.cpp:297 | |
202 | #: src/CardView.cpp:301 | |
154 | 203 | msgid "Fill up an example" |
155 | 204 | msgstr "????????? ?????? ?? ???????" |
156 | 205 | |
157 | #: src/CardView.cpp:327 | |
206 | #: src/CardView.cpp:353 | |
158 | 207 | msgid "Fill up the front of the card" |
159 | 208 | msgstr "????????? ?????? ?? ???????" |
160 | 209 | |
161 | #: src/CardView.cpp:544 | |
210 | #: src/CardView.cpp:591 | |
162 | 211 | msgid "FRONT field contains illegal markup tag(s)." |
163 | 212 | msgstr "?????? ?? ??????? ??????? ?????????/?? ???/???." |
164 | 213 | |
165 | #: src/CardView.cpp:551 | |
214 | #: src/CardView.cpp:600 | |
166 | 215 | msgid "BACK field contains illegal markup tag(s)." |
167 | 216 | msgstr "????? ?? ??????? ??????? ?????????/?? ???/???." |
168 | 217 | |
169 | #: src/CardView.cpp:558 | |
218 | #: src/CardView.cpp:609 | |
170 | 219 | msgid "EXAMPLE field contains illegal markup tag(s)." |
171 | 220 | msgstr "?????? ?? ??????? ??????? ?????????/?? ???/???." |
172 | 221 | |
173 | #: src/DeckPlayer.cpp:51 | |
222 | #: src/Deck.cpp:310 | |
223 | msgid "" | |
224 | "Failed to open import file.\n" | |
225 | "Check file permissions." | |
226 | msgstr "" | |
227 | ||
228 | #: src/DeckPlayer.cpp:55 | |
174 | 229 | msgid "Check" |
175 | 230 | msgstr "????????" |
176 | 231 | |
177 | #: src/DeckPlayer.cpp:51 | |
232 | #: src/DeckPlayer.cpp:55 | |
178 | 233 | msgid "Next " |
179 | 234 | msgstr "????????" |
180 | 235 | |
181 | #: src/DeckPlayer.cpp:51 | |
236 | #: src/DeckPlayer.cpp:55 | |
182 | 237 | msgid "Correct " |
183 | 238 | msgstr "?????!" |
184 | 239 | |
185 | #: src/DeckPlayer.cpp:51 | |
240 | #: src/DeckPlayer.cpp:55 | |
186 | 241 | msgid "Incorrect" |
187 | 242 | msgstr "??????!" |
188 | 243 | |
189 | #: src/DeckPlayer.cpp:279 | |
244 | #: src/DeckPlayer.cpp:319 | |
190 | 245 | msgid "Close" |
191 | 246 | msgstr "?????????" |
192 | 247 | |
193 | #: src/DeckPlayer.cpp:281 | |
248 | #: src/DeckPlayer.cpp:321 | |
194 | 249 | msgid "Shuffle" |
195 | 250 | msgstr "???????????" |
196 | 251 | |
197 | #: src/DeckPlayer.cpp:284 | |
252 | #: src/DeckPlayer.cpp:324 | |
198 | 253 | msgid "View/Edit Deck" |
199 | 254 | msgstr "???????/???????? ?? ???????" |
200 | 255 | |
201 | #: src/DeckPlayer.cpp:286 | |
256 | #: src/DeckPlayer.cpp:326 | |
202 | 257 | msgid "Edit Card" |
203 | 258 | msgstr "??????????? ?? ?????" |
204 | 259 | |
205 | #: src/DeckPlayer.cpp:881 | |
260 | #: src/DeckPlayer.cpp:412 | |
261 | #, fuzzy | |
262 | msgid "Front" | |
263 | msgstr "???? : " | |
264 | ||
265 | #: src/DeckPlayer.cpp:444 | |
266 | #, fuzzy | |
267 | msgid "Back" | |
268 | msgstr "???? : " | |
269 | ||
270 | #: src/DeckPlayer.cpp:458 | |
271 | msgid "Ask front" | |
272 | msgstr "" | |
273 | ||
274 | #: src/DeckPlayer.cpp:464 | |
275 | msgid "Ask back" | |
276 | msgstr "" | |
277 | ||
278 | #: src/DeckPlayer.cpp:475 | |
279 | msgid "Test line: " | |
280 | msgstr "" | |
281 | ||
282 | #: src/DeckPlayer.cpp:537 | |
283 | msgid "Say It!" | |
284 | msgstr "" | |
285 | ||
286 | #: src/DeckPlayer.cpp:547 | |
287 | msgid "I know it!" | |
288 | msgstr "" | |
289 | ||
290 | #: src/DeckPlayer.cpp:557 | |
291 | msgid "No clue" | |
292 | msgstr "" | |
293 | ||
294 | #: src/DeckPlayer.cpp:724 | |
295 | msgid "" | |
296 | "The card you are about to see has invalid markup.\n" | |
297 | "To proceed further, first, fix the broken markup.\n" | |
298 | "If unsure about the correct syntax, consult Help." | |
299 | msgstr "" | |
300 | ||
301 | #: src/DeckPlayer.cpp:983 | |
206 | 302 | msgid "" |
207 | 303 | "Would you like to make cards\n" |
208 | 304 | "order changes permanent?" |
210 | 306 | "??????? ?? ????????? ? ???? ?? ???????\n" |
211 | 307 | "?? ????? ???????? ?? ??????????" |
212 | 308 | |
213 | #: src/DeckPlayer.cpp:960 | |
309 | #: src/DeckPlayer.cpp:1062 | |
214 | 310 | msgid "The deck is empty!" |
215 | 311 | msgstr "??????? ? ??????!" |
312 | ||
313 | #: src/GeneralPref.cpp:112 | |
314 | msgid "" | |
315 | "Remove duplicates when inserting new\n" | |
316 | "cards from a Deck to the CardBox" | |
317 | msgstr "" | |
318 | ||
319 | #: src/GeneralPref.cpp:118 | |
320 | msgid "Record all dynamic links in CardFile as relative paths" | |
321 | msgstr "" | |
322 | ||
323 | #: src/GeneralPref.cpp:124 | |
324 | msgid "" | |
325 | "Some keyboard input methods may conflict with keyboard\n" | |
326 | "shortcuts. If checked, disable all shortcuts in DeckPlayer\n" | |
327 | "dialog (requires restart)." | |
328 | msgstr "" | |
216 | 329 | |
217 | 330 | #: src/MainWindow.cpp:95 |
218 | 331 | msgid "CardBox" |
250 | 363 | "???????? ? ???????.\n" |
251 | 364 | "????? ?? ?????????." |
252 | 365 | |
253 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:362 | |
366 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:364 | |
254 | 367 | msgid "" |
255 | 368 | "Please open or create\n" |
256 | 369 | "project first" |
262 | 375 | "Close it to proceed." |
263 | 376 | msgstr "???????? ?? ? ????????.??????????? ??, ?? ?? ??????????." |
264 | 377 | |
265 | #: src/MainWindow.cpp:499 | |
378 | #: src/MainWindow.cpp:504 | |
266 | 379 | msgid "Choose New CardFile name" |
267 | 380 | msgstr "???????? ???? ??? ?? ????? ?? ?????" |
268 | 381 | |
269 | #: src/MainWindow.cpp:539 | |
382 | #: src/MainWindow.cpp:544 | |
270 | 383 | msgid "Save Card File As ..." |
271 | 384 | msgstr "????????? ?? ???? ?? ????? ????..." |
Binary diff not shown
0 | # German translation of Granule. | |
1 | # Copyright (C) 2005 THE Granule'S COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the Granule package. | |
3 | # arzed <ladoo@gmx.at>, 2005. | |
4 | # , fuzzy | |
5 | # | |
6 | # | |
7 | #: src/CSVImportDialog.cpp:74 | |
8 | msgid "" | |
9 | msgstr "" | |
10 | "Project-Id-Version: Granule 1.1.6\n" | |
11 | "Report-Msgid-Bugs-To: \n" | |
12 | "POT-Creation-Date: 2005-11-27 18:53-0500\n" | |
13 | "PO-Revision-Date: 2005-09-23 11:12+0200\n" | |
14 | "Last-Translator: arzed <ladoo@gmx.at>\n" | |
15 | "Language-Team: German\n" | |
16 | "MIME-Version: 1.0\n" | |
17 | "Content-Type: text/plain; charset=UTF-8\n" | |
18 | "Content-Transfer-Encoding: 8bit\n" | |
19 | ||
20 | #: src/CSVImportDialog.cpp:57 src/CardView.cpp:119 | |
21 | msgid "Cancel" | |
22 | msgstr "Abbrechen" | |
23 | ||
24 | #: src/CSVImportDialog.cpp:64 | |
25 | msgid "Import" | |
26 | msgstr "" | |
27 | ||
28 | #: src/CSVImportDialog.cpp:69 | |
29 | msgid "Line Break:" | |
30 | msgstr "" | |
31 | ||
32 | #: src/CSVImportDialog.cpp:70 | |
33 | msgid "UNIX (LF)" | |
34 | msgstr "" | |
35 | ||
36 | #: src/CSVImportDialog.cpp:71 | |
37 | msgid "Windows (CR+LF)" | |
38 | msgstr "" | |
39 | ||
40 | #: src/CSVImportDialog.cpp:76 | |
41 | msgid "Space" | |
42 | msgstr "" | |
43 | ||
44 | #: src/CSVImportDialog.cpp:77 | |
45 | msgid "Tab" | |
46 | msgstr "" | |
47 | ||
48 | #: src/CSVImportDialog.cpp:78 | |
49 | msgid "Semicolon (;)" | |
50 | msgstr "" | |
51 | ||
52 | #: src/CSVImportDialog.cpp:79 | |
53 | msgid "Colon (:)" | |
54 | msgstr "" | |
55 | ||
56 | #: src/CSVImportDialog.cpp:81 | |
57 | msgid "Comma (,)" | |
58 | msgstr "" | |
59 | ||
60 | #: src/CSVImportDialog.cpp:85 | |
61 | msgid "Separators" | |
62 | msgstr "" | |
63 | ||
64 | #: src/CSVImportDialog.cpp:88 | |
65 | msgid "See two separators as one" | |
66 | msgstr "" | |
67 | ||
68 | #: src/CSVImportDialog.cpp:214 | |
69 | msgid "CSV Text Import" | |
70 | msgstr "" | |
71 | ||
72 | #: src/CardBox.cpp:184 | |
73 | msgid "0 cards" | |
74 | msgstr "0 Karten" | |
75 | ||
76 | #: src/CardBox.cpp:325 | |
77 | msgid "" | |
78 | "Failed to parse file\n" | |
79 | " " | |
80 | msgstr "" | |
81 | "Einlesen der Datei fehlgeschlagen\n" | |
82 | " " | |
83 | ||
84 | #: src/CardBox.cpp:326 | |
85 | msgid "" | |
86 | "\n" | |
87 | "Reason: invalid file syntax/DTD" | |
88 | msgstr "" | |
89 | "\n" | |
90 | "Ursache: Datei ist nicht konform (DTD)" | |
91 | ||
92 | #: src/CardBox.cpp:539 | |
93 | msgid "File \n" | |
94 | msgstr "Datei \n" | |
95 | ||
96 | #: src/CardBox.cpp:540 | |
97 | msgid "" | |
98 | "\n" | |
99 | "already exists.\n" | |
100 | "Would you like to delete it first?" | |
101 | msgstr "" | |
102 | "\n" | |
103 | "existiert bereits.\n" | |
104 | "Möchten Sie sie zuerst löschen?" | |
105 | ||
106 | #: src/CardBox.cpp:547 src/CardBox.cpp:815 src/DeckPlayer.cpp:988 | |
107 | msgid "Yes" | |
108 | msgstr "Ja" | |
109 | ||
110 | #: src/CardBox.cpp:548 src/CardBox.cpp:816 src/DeckPlayer.cpp:989 | |
111 | msgid "No" | |
112 | msgstr "Nein" | |
113 | ||
114 | #: src/CardBox.cpp:583 | |
115 | msgid "Trying to access index out of range!" | |
116 | msgstr "" | |
117 | "Versuche auf einen Index außerhalb des Gültigkeitsbereiches zuzugreifen!" | |
118 | ||
119 | #: src/CardBox.cpp:594 | |
120 | msgid "Card Deck you've selected is empty" | |
121 | msgstr "Das ausgewählte Deck ist leer" | |
122 | ||
123 | #: src/CardBox.cpp:613 | |
124 | msgid "" | |
125 | "First, open or create\n" | |
126 | "a Card Box file." | |
127 | msgstr "" | |
128 | "Öffnen oder erstellen Sie erst\n" | |
129 | "eine neue Kartei." | |
130 | ||
131 | #: src/CardBox.cpp:652 | |
132 | msgid "First, open or create a Card File." | |
133 | msgstr "Erstellen oder öffnen sie zuerst eine Kartei." | |
134 | ||
135 | #: src/CardBox.cpp:696 | |
136 | msgid "" | |
137 | "You have learnt all\n" | |
138 | "expired cards in this deck." | |
139 | msgstr "" | |
140 | "Sie haben alle abgelaufenen Karten\n" | |
141 | "in diesem Karteikasten gelernt." | |
142 | ||
143 | #: src/CardBox.cpp:729 | |
144 | msgid "" | |
145 | "First Open or Create\n" | |
146 | "a New Card File!" | |
147 | msgstr "" | |
148 | "Öffnen oder erstellen Sie\n" | |
149 | "erst eine neue Kartei!" | |
150 | ||
151 | #: src/CardDeck.cpp:26 | |
152 | msgid "Card Box 1" | |
153 | msgstr "Kartei 1" | |
154 | ||
155 | #: src/CardDeck.cpp:26 | |
156 | msgid "Card Box 2" | |
157 | msgstr "Kartei 2" | |
158 | ||
159 | #: src/CardDeck.cpp:27 | |
160 | msgid "Card Box 3" | |
161 | msgstr "Kartei 3" | |
162 | ||
163 | #: src/CardDeck.cpp:27 | |
164 | msgid "Card Box 4" | |
165 | msgstr "Kartei 4" | |
166 | ||
167 | #: src/CardDeck.cpp:28 | |
168 | msgid "Card Box 5" | |
169 | msgstr "Kartei 5" | |
170 | ||
171 | #: src/CardView.cpp:111 | |
172 | msgid "Clear" | |
173 | msgstr "Löschen" | |
174 | ||
175 | #: src/CardView.cpp:128 | |
176 | msgid "Add" | |
177 | msgstr "Hinzufügen" | |
178 | ||
179 | #: src/CardView.cpp:137 | |
180 | msgid "Ok" | |
181 | msgstr "Ok" | |
182 | ||
183 | #: src/CardView.cpp:146 | |
184 | msgid "Help" | |
185 | msgstr "Hilfe" | |
186 | ||
187 | #: src/CardView.cpp:155 | |
188 | msgid "Front : " | |
189 | msgstr "Vorderseite : " | |
190 | ||
191 | #: src/CardView.cpp:161 | |
192 | msgid "Back :" | |
193 | msgstr "Rückseite : " | |
194 | ||
195 | #: src/CardView.cpp:167 | |
196 | msgid "Example : " | |
197 | msgstr "Beispiel : " | |
198 | ||
199 | #: src/CardView.cpp:269 | |
200 | msgid "Fill up the back of the card" | |
201 | msgstr "Beschreiben Sie die Kartenrückseite" | |
202 | ||
203 | #: src/CardView.cpp:301 | |
204 | msgid "Fill up an example" | |
205 | msgstr "Geben sie ein Beispiel" | |
206 | ||
207 | #: src/CardView.cpp:353 | |
208 | msgid "Fill up the front of the card" | |
209 | msgstr "Beschreiben Sie die Kartenvorderseite" | |
210 | ||
211 | #: src/CardView.cpp:591 | |
212 | msgid "FRONT field contains illegal markup tag(s)." | |
213 | msgstr "Vorderseite beinhaltet ungültige markup tags." | |
214 | ||
215 | #: src/CardView.cpp:600 | |
216 | msgid "BACK field contains illegal markup tag(s)." | |
217 | msgstr "Rückseite beinhaltet ungültige markup tags." | |
218 | ||
219 | #: src/CardView.cpp:609 | |
220 | msgid "EXAMPLE field contains illegal markup tag(s)." | |
221 | msgstr "Das Beispiel enthält ungültige markup tags." | |
222 | ||
223 | #: src/Deck.cpp:310 | |
224 | msgid "" | |
225 | "Failed to open import file.\n" | |
226 | "Check file permissions." | |
227 | msgstr "" | |
228 | ||
229 | #: src/DeckPlayer.cpp:55 | |
230 | msgid "Check" | |
231 | msgstr "Überprüfen" | |
232 | ||
233 | #: src/DeckPlayer.cpp:55 | |
234 | msgid "Next " | |
235 | msgstr "Nächste " | |
236 | ||
237 | #: src/DeckPlayer.cpp:55 | |
238 | msgid "Correct " | |
239 | msgstr "Richtig " | |
240 | ||
241 | #: src/DeckPlayer.cpp:55 | |
242 | msgid "Incorrect" | |
243 | msgstr "Falsch " | |
244 | ||
245 | #: src/DeckPlayer.cpp:319 | |
246 | msgid "Close" | |
247 | msgstr "schließen" | |
248 | ||
249 | #: src/DeckPlayer.cpp:321 | |
250 | msgid "Shuffle" | |
251 | msgstr "mischen" | |
252 | ||
253 | #: src/DeckPlayer.cpp:324 | |
254 | msgid "View/Edit Deck" | |
255 | msgstr "Deck ansehen/editieren" | |
256 | ||
257 | #: src/DeckPlayer.cpp:326 | |
258 | msgid "Edit Card" | |
259 | msgstr "Karte bearbeiten" | |
260 | ||
261 | #: src/DeckPlayer.cpp:412 | |
262 | #, fuzzy | |
263 | msgid "Front" | |
264 | msgstr "Vorderseite : " | |
265 | ||
266 | #: src/DeckPlayer.cpp:444 | |
267 | #, fuzzy | |
268 | msgid "Back" | |
269 | msgstr "Rückseite : " | |
270 | ||
271 | #: src/DeckPlayer.cpp:458 | |
272 | msgid "Ask front" | |
273 | msgstr "" | |
274 | ||
275 | #: src/DeckPlayer.cpp:464 | |
276 | msgid "Ask back" | |
277 | msgstr "" | |
278 | ||
279 | #: src/DeckPlayer.cpp:475 | |
280 | msgid "Test line: " | |
281 | msgstr "" | |
282 | ||
283 | #: src/DeckPlayer.cpp:537 | |
284 | msgid "Say It!" | |
285 | msgstr "" | |
286 | ||
287 | #: src/DeckPlayer.cpp:547 | |
288 | msgid "I know it!" | |
289 | msgstr "" | |
290 | ||
291 | #: src/DeckPlayer.cpp:557 | |
292 | msgid "No clue" | |
293 | msgstr "" | |
294 | ||
295 | #: src/DeckPlayer.cpp:724 | |
296 | msgid "" | |
297 | "The card you are about to see has invalid markup.\n" | |
298 | "To proceed further, first, fix the broken markup.\n" | |
299 | "If unsure about the correct syntax, consult Help." | |
300 | msgstr "" | |
301 | ||
302 | #: src/DeckPlayer.cpp:983 | |
303 | msgid "" | |
304 | "Would you like to make cards\n" | |
305 | "order changes permanent?" | |
306 | msgstr "" | |
307 | "Wollen sie die Veränderungen der\n" | |
308 | "Karteinreihenfolge speichern?" | |
309 | ||
310 | #: src/DeckPlayer.cpp:1062 | |
311 | msgid "The deck is empty!" | |
312 | msgstr "Das Deck ist leer!" | |
313 | ||
314 | #: src/GeneralPref.cpp:112 | |
315 | msgid "" | |
316 | "Remove duplicates when inserting new\n" | |
317 | "cards from a Deck to the CardBox" | |
318 | msgstr "" | |
319 | ||
320 | #: src/GeneralPref.cpp:118 | |
321 | msgid "Record all dynamic links in CardFile as relative paths" | |
322 | msgstr "" | |
323 | ||
324 | #: src/GeneralPref.cpp:124 | |
325 | msgid "" | |
326 | "Some keyboard input methods may conflict with keyboard\n" | |
327 | "shortcuts. If checked, disable all shortcuts in DeckPlayer\n" | |
328 | "dialog (requires restart)." | |
329 | msgstr "" | |
330 | ||
331 | #: src/MainWindow.cpp:95 | |
332 | msgid "CardBox" | |
333 | msgstr "Kartei" | |
334 | ||
335 | #: src/MainWindow.cpp:212 src/MainWindow.cpp:300 | |
336 | msgid "" | |
337 | "Project has been modified.\n" | |
338 | "Please, save and close it first" | |
339 | msgstr "" | |
340 | "Das Projekt wurde verändert.\n" | |
341 | "Bitte speichern und schließen Sie es erst" | |
342 | ||
343 | #: src/MainWindow.cpp:220 src/MainWindow.cpp:308 | |
344 | msgid "" | |
345 | "Project is opened.\n" | |
346 | "Please, close it first" | |
347 | msgstr "" | |
348 | "Ein Projekt ist offen.\n" | |
349 | "Bitte schließen Sie es zuerst" | |
350 | ||
351 | #: src/MainWindow.cpp:251 | |
352 | msgid "" | |
353 | "Project has been modified\n" | |
354 | "Please, save and close it first" | |
355 | msgstr "" | |
356 | "Das Projekt wurde verändert.\n" | |
357 | "Bitte speichern und schließen Sie es erst" | |
358 | ||
359 | #: src/MainWindow.cpp:260 | |
360 | msgid "" | |
361 | "Project is opened\n" | |
362 | "Please, close it first" | |
363 | msgstr "" | |
364 | "Ein Projekt ist geöffnet\n" | |
365 | "Bitte, schließen Sie es erst" | |
366 | ||
367 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:364 | |
368 | msgid "" | |
369 | "Please open or create\n" | |
370 | "project first" | |
371 | msgstr "" | |
372 | "Bitte öffnen oder erstellen\n" | |
373 | "Sie zuerst ein Projekt." | |
374 | ||
375 | #: src/MainWindow.cpp:342 | |
376 | msgid "" | |
377 | "Project is not modified.\n" | |
378 | "Close it to proceed." | |
379 | msgstr "" | |
380 | "Das Projekt ist unverändert.\n" | |
381 | "Schließen Sie es um fortzufahren." | |
382 | ||
383 | #: src/MainWindow.cpp:504 | |
384 | msgid "Choose New CardFile name" | |
385 | msgstr "" | |
386 | "Wählen Sie einen neuen\n" | |
387 | "Dateinamen für das Deck" | |
388 | ||
389 | #: src/MainWindow.cpp:544 | |
390 | msgid "Save Card File As ..." | |
391 | msgstr "Deck speichern unter ..." |
2 | 2 | # This file is distributed under the same license as the PACKAGE package. |
3 | 3 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
4 | 4 | # |
5 | #: src/CSVImportDialog.cpp:74 | |
5 | 6 | #, fuzzy |
6 | 7 | msgid "" |
7 | 8 | msgstr "" |
8 | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | 10 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2005-07-12 22:08-0400\n" | |
11 | "POT-Creation-Date: 2005-11-27 18:53-0500\n" | |
11 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
12 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
15 | 16 | "Content-Type: text/plain; charset=CHARSET\n" |
16 | 17 | "Content-Transfer-Encoding: 8bit\n" |
17 | 18 | |
19 | #: src/CSVImportDialog.cpp:57 src/CardView.cpp:119 | |
20 | msgid "Cancel" | |
21 | msgstr "" | |
22 | ||
23 | #: src/CSVImportDialog.cpp:64 | |
24 | msgid "Import" | |
25 | msgstr "" | |
26 | ||
27 | #: src/CSVImportDialog.cpp:69 | |
28 | msgid "Line Break:" | |
29 | msgstr "" | |
30 | ||
31 | #: src/CSVImportDialog.cpp:70 | |
32 | msgid "UNIX (LF)" | |
33 | msgstr "" | |
34 | ||
35 | #: src/CSVImportDialog.cpp:71 | |
36 | msgid "Windows (CR+LF)" | |
37 | msgstr "" | |
38 | ||
39 | #: src/CSVImportDialog.cpp:76 | |
40 | msgid "Space" | |
41 | msgstr "" | |
42 | ||
43 | #: src/CSVImportDialog.cpp:77 | |
44 | msgid "Tab" | |
45 | msgstr "" | |
46 | ||
47 | #: src/CSVImportDialog.cpp:78 | |
48 | msgid "Semicolon (;)" | |
49 | msgstr "" | |
50 | ||
51 | #: src/CSVImportDialog.cpp:79 | |
52 | msgid "Colon (:)" | |
53 | msgstr "" | |
54 | ||
55 | #: src/CSVImportDialog.cpp:81 | |
56 | msgid "Comma (,)" | |
57 | msgstr "" | |
58 | ||
59 | #: src/CSVImportDialog.cpp:85 | |
60 | msgid "Separators" | |
61 | msgstr "" | |
62 | ||
63 | #: src/CSVImportDialog.cpp:88 | |
64 | msgid "See two separators as one" | |
65 | msgstr "" | |
66 | ||
67 | #: src/CSVImportDialog.cpp:214 | |
68 | msgid "CSV Text Import" | |
69 | msgstr "" | |
70 | ||
18 | 71 | #: src/CardBox.cpp:184 |
19 | 72 | msgid "0 cards" |
20 | 73 | msgstr "" |
21 | 74 | |
22 | #: src/CardBox.cpp:311 | |
75 | #: src/CardBox.cpp:325 | |
23 | 76 | msgid "" |
24 | 77 | "Failed to parse file\n" |
25 | 78 | " " |
26 | 79 | msgstr "" |
27 | 80 | |
28 | #: src/CardBox.cpp:312 | |
81 | #: src/CardBox.cpp:326 | |
29 | 82 | msgid "" |
30 | 83 | "\n" |
31 | 84 | "Reason: invalid file syntax/DTD" |
32 | 85 | msgstr "" |
33 | 86 | |
34 | #: src/CardBox.cpp:499 | |
87 | #: src/CardBox.cpp:539 | |
35 | 88 | msgid "File \n" |
36 | 89 | msgstr "" |
37 | 90 | |
38 | #: src/CardBox.cpp:500 | |
91 | #: src/CardBox.cpp:540 | |
39 | 92 | msgid "" |
40 | 93 | "\n" |
41 | 94 | "already exists.\n" |
42 | 95 | "Would you like to delete it first?" |
43 | 96 | msgstr "" |
44 | 97 | |
45 | #: src/CardBox.cpp:507 src/CardBox.cpp:775 src/DeckPlayer.cpp:886 | |
98 | #: src/CardBox.cpp:547 src/CardBox.cpp:815 src/DeckPlayer.cpp:988 | |
46 | 99 | msgid "Yes" |
47 | 100 | msgstr "" |
48 | 101 | |
49 | #: src/CardBox.cpp:508 src/CardBox.cpp:776 src/DeckPlayer.cpp:887 | |
102 | #: src/CardBox.cpp:548 src/CardBox.cpp:816 src/DeckPlayer.cpp:989 | |
50 | 103 | msgid "No" |
51 | 104 | msgstr "" |
52 | 105 | |
53 | #: src/CardBox.cpp:543 | |
106 | #: src/CardBox.cpp:583 | |
54 | 107 | msgid "Trying to access index out of range!" |
55 | 108 | msgstr "" |
56 | 109 | |
57 | #: src/CardBox.cpp:554 | |
110 | #: src/CardBox.cpp:594 | |
58 | 111 | msgid "Card Deck you've selected is empty" |
59 | 112 | msgstr "" |
60 | 113 | |
61 | #: src/CardBox.cpp:573 | |
114 | #: src/CardBox.cpp:613 | |
62 | 115 | msgid "" |
63 | 116 | "First, open or create\n" |
64 | 117 | "a Card Box file." |
65 | 118 | msgstr "" |
66 | 119 | |
67 | #: src/CardBox.cpp:612 | |
120 | #: src/CardBox.cpp:652 | |
68 | 121 | msgid "First, open or create a Card File." |
69 | 122 | msgstr "" |
70 | 123 | |
71 | #: src/CardBox.cpp:656 | |
124 | #: src/CardBox.cpp:696 | |
72 | 125 | msgid "" |
73 | 126 | "You have learnt all\n" |
74 | 127 | "expired cards in this deck." |
75 | 128 | msgstr "" |
76 | 129 | |
77 | #: src/CardBox.cpp:689 | |
130 | #: src/CardBox.cpp:729 | |
78 | 131 | msgid "" |
79 | 132 | "First Open or Create\n" |
80 | 133 | "a New Card File!" |
81 | 134 | msgstr "" |
82 | 135 | |
83 | #: src/CardDeck.cpp:25 | |
136 | #: src/CardDeck.cpp:26 | |
84 | 137 | msgid "Card Box 1" |
85 | 138 | msgstr "" |
86 | 139 | |
87 | #: src/CardDeck.cpp:25 | |
140 | #: src/CardDeck.cpp:26 | |
88 | 141 | msgid "Card Box 2" |
89 | 142 | msgstr "" |
90 | 143 | |
91 | #: src/CardDeck.cpp:26 | |
144 | #: src/CardDeck.cpp:27 | |
92 | 145 | msgid "Card Box 3" |
93 | 146 | msgstr "" |
94 | 147 | |
95 | #: src/CardDeck.cpp:26 | |
148 | #: src/CardDeck.cpp:27 | |
96 | 149 | msgid "Card Box 4" |
97 | 150 | msgstr "" |
98 | 151 | |
99 | #: src/CardDeck.cpp:27 | |
152 | #: src/CardDeck.cpp:28 | |
100 | 153 | msgid "Card Box 5" |
101 | 154 | msgstr "" |
102 | 155 | |
103 | #: src/CardView.cpp:109 | |
156 | #: src/CardView.cpp:111 | |
104 | 157 | msgid "Clear" |
105 | 158 | msgstr "" |
106 | 159 | |
107 | #: src/CardView.cpp:117 | |
108 | msgid "Cancel" | |
109 | msgstr "" | |
110 | ||
111 | #: src/CardView.cpp:126 | |
160 | #: src/CardView.cpp:128 | |
112 | 161 | msgid "Add" |
113 | 162 | msgstr "" |
114 | 163 | |
115 | #: src/CardView.cpp:135 | |
164 | #: src/CardView.cpp:137 | |
116 | 165 | msgid "Ok" |
117 | 166 | msgstr "" |
118 | 167 | |
119 | #: src/CardView.cpp:144 | |
168 | #: src/CardView.cpp:146 | |
120 | 169 | msgid "Help" |
121 | 170 | msgstr "" |
122 | 171 | |
123 | #: src/CardView.cpp:153 | |
172 | #: src/CardView.cpp:155 | |
124 | 173 | msgid "Front : " |
125 | 174 | msgstr "" |
126 | 175 | |
127 | #: src/CardView.cpp:159 | |
176 | #: src/CardView.cpp:161 | |
128 | 177 | msgid "Back :" |
129 | 178 | msgstr "" |
130 | 179 | |
131 | #: src/CardView.cpp:165 | |
180 | #: src/CardView.cpp:167 | |
132 | 181 | msgid "Example : " |
133 | 182 | msgstr "" |
134 | 183 | |
135 | #: src/CardView.cpp:266 | |
184 | #: src/CardView.cpp:269 | |
136 | 185 | msgid "Fill up the back of the card" |
137 | 186 | msgstr "" |
138 | 187 | |
139 | #: src/CardView.cpp:297 | |
188 | #: src/CardView.cpp:301 | |
140 | 189 | msgid "Fill up an example" |
141 | 190 | msgstr "" |
142 | 191 | |
143 | #: src/CardView.cpp:327 | |
192 | #: src/CardView.cpp:353 | |
144 | 193 | msgid "Fill up the front of the card" |
145 | 194 | msgstr "" |
146 | 195 | |
147 | #: src/CardView.cpp:544 | |
196 | #: src/CardView.cpp:591 | |
148 | 197 | msgid "FRONT field contains illegal markup tag(s)." |
149 | 198 | msgstr "" |
150 | 199 | |
151 | #: src/CardView.cpp:551 | |
200 | #: src/CardView.cpp:600 | |
152 | 201 | msgid "BACK field contains illegal markup tag(s)." |
153 | 202 | msgstr "" |
154 | 203 | |
155 | #: src/CardView.cpp:558 | |
204 | #: src/CardView.cpp:609 | |
156 | 205 | msgid "EXAMPLE field contains illegal markup tag(s)." |
157 | 206 | msgstr "" |
158 | 207 | |
159 | #: src/DeckPlayer.cpp:51 | |
208 | #: src/Deck.cpp:310 | |
209 | msgid "" | |
210 | "Failed to open import file.\n" | |
211 | "Check file permissions." | |
212 | msgstr "" | |
213 | ||
214 | #: src/DeckPlayer.cpp:55 | |
160 | 215 | msgid "Check" |
161 | 216 | msgstr "" |
162 | 217 | |
163 | #: src/DeckPlayer.cpp:51 | |
218 | #: src/DeckPlayer.cpp:55 | |
164 | 219 | msgid "Next " |
165 | 220 | msgstr "" |
166 | 221 | |
167 | #: src/DeckPlayer.cpp:51 | |
222 | #: src/DeckPlayer.cpp:55 | |
168 | 223 | msgid "Correct " |
169 | 224 | msgstr "" |
170 | 225 | |
171 | #: src/DeckPlayer.cpp:51 | |
226 | #: src/DeckPlayer.cpp:55 | |
172 | 227 | msgid "Incorrect" |
173 | 228 | msgstr "" |
174 | 229 | |
175 | #: src/DeckPlayer.cpp:279 | |
230 | #: src/DeckPlayer.cpp:319 | |
176 | 231 | msgid "Close" |
177 | 232 | msgstr "" |
178 | 233 | |
179 | #: src/DeckPlayer.cpp:281 | |
234 | #: src/DeckPlayer.cpp:321 | |
180 | 235 | msgid "Shuffle" |
181 | 236 | msgstr "" |
182 | 237 | |
183 | #: src/DeckPlayer.cpp:284 | |
238 | #: src/DeckPlayer.cpp:324 | |
184 | 239 | msgid "View/Edit Deck" |
185 | 240 | msgstr "" |
186 | 241 | |
187 | #: src/DeckPlayer.cpp:286 | |
242 | #: src/DeckPlayer.cpp:326 | |
188 | 243 | msgid "Edit Card" |
189 | 244 | msgstr "" |
190 | 245 | |
191 | #: src/DeckPlayer.cpp:881 | |
246 | #: src/DeckPlayer.cpp:412 | |
247 | msgid "Front" | |
248 | msgstr "" | |
249 | ||
250 | #: src/DeckPlayer.cpp:444 | |
251 | msgid "Back" | |
252 | msgstr "" | |
253 | ||
254 | #: src/DeckPlayer.cpp:458 | |
255 | msgid "Ask front" | |
256 | msgstr "" | |
257 | ||
258 | #: src/DeckPlayer.cpp:464 | |
259 | msgid "Ask back" | |
260 | msgstr "" | |
261 | ||
262 | #: src/DeckPlayer.cpp:475 | |
263 | msgid "Test line: " | |
264 | msgstr "" | |
265 | ||
266 | #: src/DeckPlayer.cpp:537 | |
267 | msgid "Say It!" | |
268 | msgstr "" | |
269 | ||
270 | #: src/DeckPlayer.cpp:547 | |
271 | msgid "I know it!" | |
272 | msgstr "" | |
273 | ||
274 | #: src/DeckPlayer.cpp:557 | |
275 | msgid "No clue" | |
276 | msgstr "" | |
277 | ||
278 | #: src/DeckPlayer.cpp:724 | |
279 | msgid "" | |
280 | "The card you are about to see has invalid markup.\n" | |
281 | "To proceed further, first, fix the broken markup.\n" | |
282 | "If unsure about the correct syntax, consult Help." | |
283 | msgstr "" | |
284 | ||
285 | #: src/DeckPlayer.cpp:983 | |
192 | 286 | msgid "" |
193 | 287 | "Would you like to make cards\n" |
194 | 288 | "order changes permanent?" |
195 | 289 | msgstr "" |
196 | 290 | |
197 | #: src/DeckPlayer.cpp:960 | |
291 | #: src/DeckPlayer.cpp:1062 | |
198 | 292 | msgid "The deck is empty!" |
293 | msgstr "" | |
294 | ||
295 | #: src/GeneralPref.cpp:112 | |
296 | msgid "" | |
297 | "Remove duplicates when inserting new\n" | |
298 | "cards from a Deck to the CardBox" | |
299 | msgstr "" | |
300 | ||
301 | #: src/GeneralPref.cpp:118 | |
302 | msgid "Record all dynamic links in CardFile as relative paths" | |
303 | msgstr "" | |
304 | ||
305 | #: src/GeneralPref.cpp:124 | |
306 | msgid "" | |
307 | "Some keyboard input methods may conflict with keyboard\n" | |
308 | "shortcuts. If checked, disable all shortcuts in DeckPlayer\n" | |
309 | "dialog (requires restart)." | |
199 | 310 | msgstr "" |
200 | 311 | |
201 | 312 | #: src/MainWindow.cpp:95 |
226 | 337 | "Please, close it first" |
227 | 338 | msgstr "" |
228 | 339 | |
229 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:362 | |
340 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:364 | |
230 | 341 | msgid "" |
231 | 342 | "Please open or create\n" |
232 | 343 | "project first" |
238 | 349 | "Close it to proceed." |
239 | 350 | msgstr "" |
240 | 351 | |
241 | #: src/MainWindow.cpp:499 | |
352 | #: src/MainWindow.cpp:504 | |
242 | 353 | msgid "Choose New CardFile name" |
243 | 354 | msgstr "" |
244 | 355 | |
245 | #: src/MainWindow.cpp:539 | |
356 | #: src/MainWindow.cpp:544 | |
246 | 357 | msgid "Save Card File As ..." |
247 | 358 | msgstr "" |
Binary diff not shown
0 | # Japanese translation of Granule. | |
1 | # Copyright (C) 2005 THE Granule'S COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the Granule package. | |
3 | # Jeff <jeffames@gmail.com>, 2005. | |
4 | # | |
5 | # | |
6 | #: src/CSVImportDialog.cpp:74 | |
7 | msgid "" | |
8 | msgstr "" | |
9 | "Project-Id-Version: Granule 1.1.6\n" | |
10 | "Report-Msgid-Bugs-To: \n" | |
11 | "POT-Creation-Date: 2005-11-27 18:53-0500\n" | |
12 | "PO-Revision-Date: 2005-09-23 11:12+0200\n" | |
13 | "Last-Translator: Jeff <jeffames@gmail.com>\n" | |
14 | "Language-Team: Japanese\n" | |
15 | "MIME-Version: 1.0\n" | |
16 | "Content-Type: text/plain; charset=UTF-8\n" | |
17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | ||
19 | #: src/CSVImportDialog.cpp:57 src/CardView.cpp:119 | |
20 | msgid "Cancel" | |
21 | msgstr "キャンセル" | |
22 | ||
23 | #: src/CSVImportDialog.cpp:64 | |
24 | msgid "Import" | |
25 | msgstr "" | |
26 | ||
27 | #: src/CSVImportDialog.cpp:69 | |
28 | msgid "Line Break:" | |
29 | msgstr "" | |
30 | ||
31 | #: src/CSVImportDialog.cpp:70 | |
32 | msgid "UNIX (LF)" | |
33 | msgstr "" | |
34 | ||
35 | #: src/CSVImportDialog.cpp:71 | |
36 | msgid "Windows (CR+LF)" | |
37 | msgstr "" | |
38 | ||
39 | #: src/CSVImportDialog.cpp:76 | |
40 | msgid "Space" | |
41 | msgstr "" | |
42 | ||
43 | #: src/CSVImportDialog.cpp:77 | |
44 | msgid "Tab" | |
45 | msgstr "" | |
46 | ||
47 | #: src/CSVImportDialog.cpp:78 | |
48 | msgid "Semicolon (;)" | |
49 | msgstr "" | |
50 | ||
51 | #: src/CSVImportDialog.cpp:79 | |
52 | msgid "Colon (:)" | |
53 | msgstr "" | |
54 | ||
55 | #: src/CSVImportDialog.cpp:81 | |
56 | msgid "Comma (,)" | |
57 | msgstr "" | |
58 | ||
59 | #: src/CSVImportDialog.cpp:85 | |
60 | msgid "Separators" | |
61 | msgstr "" | |
62 | ||
63 | #: src/CSVImportDialog.cpp:88 | |
64 | msgid "See two separators as one" | |
65 | msgstr "" | |
66 | ||
67 | #: src/CSVImportDialog.cpp:214 | |
68 | msgid "CSV Text Import" | |
69 | msgstr "" | |
70 | ||
71 | #: src/CardBox.cpp:184 | |
72 | msgid "0 cards" | |
73 | msgstr "0 カード" | |
74 | ||
75 | #: src/CardBox.cpp:325 | |
76 | msgid "" | |
77 | "Failed to parse file\n" | |
78 | " " | |
79 | msgstr "" | |
80 | "ファイルがの構文解析できません\n" | |
81 | " " | |
82 | ||
83 | #: src/CardBox.cpp:326 | |
84 | msgid "" | |
85 | "\n" | |
86 | "Reason: invalid file syntax/DTD" | |
87 | msgstr "" | |
88 | "\n" | |
89 | "理由: ファイル構文かDTDが間違います" | |
90 | ||
91 | #: src/CardBox.cpp:539 | |
92 | msgid "File \n" | |
93 | msgstr "ファイル \n" | |
94 | ||
95 | #: src/CardBox.cpp:540 | |
96 | msgid "" | |
97 | "\n" | |
98 | "already exists.\n" | |
99 | "Would you like to delete it first?" | |
100 | msgstr "" | |
101 | "\n" | |
102 | "もうあります。\n" | |
103 | "まず消したいですか?" | |
104 | ||
105 | #: src/CardBox.cpp:547 src/CardBox.cpp:815 src/DeckPlayer.cpp:988 | |
106 | msgid "Yes" | |
107 | msgstr "はい" | |
108 | ||
109 | #: src/CardBox.cpp:548 src/CardBox.cpp:816 src/DeckPlayer.cpp:989 | |
110 | msgid "No" | |
111 | msgstr "いいえ" | |
112 | ||
113 | #: src/CardBox.cpp:583 | |
114 | msgid "Trying to access index out of range!" | |
115 | msgstr "範囲外のインデックスをアクセスしようとしています!" | |
116 | ||
117 | #: src/CardBox.cpp:594 | |
118 | msgid "Card Deck you've selected is empty" | |
119 | msgstr "選ばれたカードデックが空虚です" | |
120 | ||
121 | #: src/CardBox.cpp:613 | |
122 | msgid "" | |
123 | "First, open or create\n" | |
124 | "a Card Box file." | |
125 | msgstr "" | |
126 | "まず、カードファイルを開くか作成するか\n" | |
127 | "どちらかして下さい。" | |
128 | ||
129 | #: src/CardBox.cpp:652 | |
130 | msgid "First, open or create a Card File." | |
131 | msgstr "まず、カードファイルを開くか作成するかどちらかして下さい。" | |
132 | ||
133 | #: src/CardBox.cpp:696 | |
134 | msgid "" | |
135 | "You have learnt all\n" | |
136 | "expired cards in this deck." | |
137 | msgstr "" | |
138 | "このデックの満期になったカードを\n" | |
139 | "全部習いました。" | |
140 | ||
141 | #: src/CardBox.cpp:729 | |
142 | msgid "" | |
143 | "First Open or Create\n" | |
144 | "a New Card File!" | |
145 | msgstr "" | |
146 | "まず、新しいカードファイルを開くか作成するか\n" | |
147 | "どちらかして下さい。" | |
148 | ||
149 | #: src/CardDeck.cpp:26 | |
150 | msgid "Card Box 1" | |
151 | msgstr "カードボックス 1" | |
152 | ||
153 | #: src/CardDeck.cpp:26 | |
154 | msgid "Card Box 2" | |
155 | msgstr "カードボックス 2" | |
156 | ||
157 | #: src/CardDeck.cpp:27 | |
158 | msgid "Card Box 3" | |
159 | msgstr "カードボックス 3" | |
160 | ||
161 | #: src/CardDeck.cpp:27 | |
162 | msgid "Card Box 4" | |
163 | msgstr "カードボックス 4" | |
164 | ||
165 | #: src/CardDeck.cpp:28 | |
166 | msgid "Card Box 5" | |
167 | msgstr "カードボックス 5" | |
168 | ||
169 | #: src/CardView.cpp:111 | |
170 | msgid "Clear" | |
171 | msgstr "クリア" | |
172 | ||
173 | #: src/CardView.cpp:128 | |
174 | msgid "Add" | |
175 | msgstr "追加" | |
176 | ||
177 | #: src/CardView.cpp:137 | |
178 | msgid "Ok" | |
179 | msgstr "Ok" | |
180 | ||
181 | #: src/CardView.cpp:146 | |
182 | msgid "Help" | |
183 | msgstr "ヘルプ" | |
184 | ||
185 | #: src/CardView.cpp:155 | |
186 | msgid "Front : " | |
187 | msgstr "表面:" | |
188 | ||
189 | #: src/CardView.cpp:161 | |
190 | msgid "Back :" | |
191 | msgstr "裏面:" | |
192 | ||
193 | #: src/CardView.cpp:167 | |
194 | msgid "Example : " | |
195 | msgstr "例:" | |
196 | ||
197 | #: src/CardView.cpp:269 | |
198 | msgid "Fill up the back of the card" | |
199 | msgstr "カードの裏面を記入して下さい" | |
200 | ||
201 | #: src/CardView.cpp:301 | |
202 | msgid "Fill up an example" | |
203 | msgstr "例を記入して下さい" | |
204 | ||
205 | #: src/CardView.cpp:353 | |
206 | msgid "Fill up the front of the card" | |
207 | msgstr "カードの表面を記入して下さい" | |
208 | ||
209 | #: src/CardView.cpp:591 | |
210 | msgid "FRONT field contains illegal markup tag(s)." | |
211 | msgstr "表面フィールドは違法のマークアップがあります。" | |
212 | ||
213 | #: src/CardView.cpp:600 | |
214 | msgid "BACK field contains illegal markup tag(s)." | |
215 | msgstr "裏面フィールドは違法のマークアップがあります。" | |
216 | ||
217 | #: src/CardView.cpp:609 | |
218 | msgid "EXAMPLE field contains illegal markup tag(s)." | |
219 | msgstr "例フィールドは違法のマークアップがあります。" | |
220 | ||
221 | #: src/Deck.cpp:310 | |
222 | msgid "" | |
223 | "Failed to open import file.\n" | |
224 | "Check file permissions." | |
225 | msgstr "" | |
226 | ||
227 | #: src/DeckPlayer.cpp:55 | |
228 | msgid "Check" | |
229 | msgstr "照合" | |
230 | ||
231 | #: src/DeckPlayer.cpp:55 | |
232 | msgid "Next " | |
233 | msgstr "次 " | |
234 | ||
235 | #: src/DeckPlayer.cpp:55 | |
236 | msgid "Correct " | |
237 | msgstr "正解 " | |
238 | ||
239 | #: src/DeckPlayer.cpp:55 | |
240 | msgid "Incorrect" | |
241 | msgstr "違う " | |
242 | ||
243 | #: src/DeckPlayer.cpp:319 | |
244 | msgid "Close" | |
245 | msgstr "閉じる" | |
246 | ||
247 | #: src/DeckPlayer.cpp:321 | |
248 | msgid "Shuffle" | |
249 | msgstr "シャッフル" | |
250 | ||
251 | #: src/DeckPlayer.cpp:324 | |
252 | msgid "View/Edit Deck" | |
253 | msgstr "デックを見る/編集する" | |
254 | ||
255 | #: src/DeckPlayer.cpp:326 | |
256 | msgid "Edit Card" | |
257 | msgstr "カードを編集する" | |
258 | ||
259 | #: src/DeckPlayer.cpp:412 | |
260 | #, fuzzy | |
261 | msgid "Front" | |
262 | msgstr "表面:" | |
263 | ||
264 | #: src/DeckPlayer.cpp:444 | |
265 | #, fuzzy | |
266 | msgid "Back" | |
267 | msgstr "裏面:" | |
268 | ||
269 | #: src/DeckPlayer.cpp:458 | |
270 | msgid "Ask front" | |
271 | msgstr "" | |
272 | ||
273 | #: src/DeckPlayer.cpp:464 | |
274 | msgid "Ask back" | |
275 | msgstr "" | |
276 | ||
277 | #: src/DeckPlayer.cpp:475 | |
278 | msgid "Test line: " | |
279 | msgstr "" | |
280 | ||
281 | #: src/DeckPlayer.cpp:537 | |
282 | msgid "Say It!" | |
283 | msgstr "" | |
284 | ||
285 | #: src/DeckPlayer.cpp:547 | |
286 | msgid "I know it!" | |
287 | msgstr "" | |
288 | ||
289 | #: src/DeckPlayer.cpp:557 | |
290 | msgid "No clue" | |
291 | msgstr "" | |
292 | ||
293 | #: src/DeckPlayer.cpp:724 | |
294 | msgid "" | |
295 | "The card you are about to see has invalid markup.\n" | |
296 | "To proceed further, first, fix the broken markup.\n" | |
297 | "If unsure about the correct syntax, consult Help." | |
298 | msgstr "" | |
299 | ||
300 | #: src/DeckPlayer.cpp:983 | |
301 | msgid "" | |
302 | "Would you like to make cards\n" | |
303 | "order changes permanent?" | |
304 | msgstr "カードの順位が永久にしたいですか?" | |
305 | ||
306 | #: src/DeckPlayer.cpp:1062 | |
307 | msgid "The deck is empty!" | |
308 | msgstr "デックが空虚です!" | |
309 | ||
310 | #: src/GeneralPref.cpp:112 | |
311 | msgid "" | |
312 | "Remove duplicates when inserting new\n" | |
313 | "cards from a Deck to the CardBox" | |
314 | msgstr "" | |
315 | ||
316 | #: src/GeneralPref.cpp:118 | |
317 | msgid "Record all dynamic links in CardFile as relative paths" | |
318 | msgstr "" | |
319 | ||
320 | #: src/GeneralPref.cpp:124 | |
321 | msgid "" | |
322 | "Some keyboard input methods may conflict with keyboard\n" | |
323 | "shortcuts. If checked, disable all shortcuts in DeckPlayer\n" | |
324 | "dialog (requires restart)." | |
325 | msgstr "" | |
326 | ||
327 | #: src/MainWindow.cpp:95 | |
328 | msgid "CardBox" | |
329 | msgstr "カードボックス" | |
330 | ||
331 | #: src/MainWindow.cpp:212 src/MainWindow.cpp:300 | |
332 | msgid "" | |
333 | "Project has been modified.\n" | |
334 | "Please, save and close it first" | |
335 | msgstr "" | |
336 | "プロジェクトは変わりました。\n" | |
337 | "まず、セーブし、閉じて下さい。" | |
338 | ||
339 | #: src/MainWindow.cpp:220 src/MainWindow.cpp:308 | |
340 | msgid "" | |
341 | "Project is opened.\n" | |
342 | "Please, close it first" | |
343 | msgstr "" | |
344 | "プロジェクトは開いています。\n" | |
345 | "まず、閉じて下さい。" | |
346 | ||
347 | #: src/MainWindow.cpp:251 | |
348 | msgid "" | |
349 | "Project has been modified\n" | |
350 | "Please, save and close it first" | |
351 | msgstr "" | |
352 | "プロジェクトは変わりました\n" | |
353 | "まず、セーブし、閉じて下さい。" | |
354 | ||
355 | #: src/MainWindow.cpp:260 | |
356 | msgid "" | |
357 | "Project is opened\n" | |
358 | "Please, close it first" | |
359 | msgstr "" | |
360 | "プロジェクトは開いています\n" | |
361 | "まず、閉じて下さい。" | |
362 | ||
363 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:364 | |
364 | msgid "" | |
365 | "Please open or create\n" | |
366 | "project first" | |
367 | msgstr "" | |
368 | "まず、プロジェクトを\n" | |
369 | "開くか作成するかどちらかして下さい" | |
370 | ||
371 | #: src/MainWindow.cpp:342 | |
372 | msgid "" | |
373 | "Project is not modified.\n" | |
374 | "Close it to proceed." | |
375 | msgstr "" | |
376 | "プロジェクトは変わっていません。\n" | |
377 | "続くために閉じて下さい。" | |
378 | ||
379 | #: src/MainWindow.cpp:504 | |
380 | msgid "Choose New CardFile name" | |
381 | msgstr "新しいカードファイル名前を選んで下さい" | |
382 | ||
383 | #: src/MainWindow.cpp:544 | |
384 | msgid "Save Card File As ..." | |
385 | msgstr "カードファイルを…でセーブする" |
2 | 2 | # This file is distributed under the same license as the PACKAGE package. |
3 | 3 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
4 | 4 | # |
5 | #: src/CSVImportDialog.cpp:74 | |
5 | 6 | #, fuzzy |
6 | 7 | msgid "" |
7 | 8 | msgstr "" |
8 | 9 | "Project-Id-Version: granule 1.1.5\n" |
9 | 10 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2005-07-12 22:08-0400\n" | |
11 | "POT-Creation-Date: 2005-11-27 18:53-0500\n" | |
11 | 12 | "PO-Revision-Date: 2005-04-12 21:34-0000\n" |
12 | 13 | "Last-Translator: Vladislav Grinchenko <vlg@users.sourceforge.net>\n" |
13 | 14 | "Language-Team: Russian <LL@li.org>\n" |
15 | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
16 | 17 | "Content-Transfer-Encoding: 8bit\n" |
17 | 18 | |
19 | #: src/CSVImportDialog.cpp:57 src/CardView.cpp:119 | |
20 | msgid "Cancel" | |
21 | msgstr "Отменить" | |
22 | ||
23 | #: src/CSVImportDialog.cpp:64 | |
24 | msgid "Import" | |
25 | msgstr "Импорт" | |
26 | ||
27 | #: src/CSVImportDialog.cpp:69 | |
28 | msgid "Line Break:" | |
29 | msgstr "Разделитель" | |
30 | ||
31 | #: src/CSVImportDialog.cpp:70 | |
32 | msgid "UNIX (LF)" | |
33 | msgstr "" | |
34 | ||
35 | #: src/CSVImportDialog.cpp:71 | |
36 | msgid "Windows (CR+LF)" | |
37 | msgstr "" | |
38 | ||
39 | #: src/CSVImportDialog.cpp:76 | |
40 | msgid "Space" | |
41 | msgstr "Пробел" | |
42 | ||
43 | #: src/CSVImportDialog.cpp:77 | |
44 | msgid "Tab" | |
45 | msgstr "Таб" | |
46 | ||
47 | #: src/CSVImportDialog.cpp:78 | |
48 | msgid "Semicolon (;)" | |
49 | msgstr "Точка с запятой (;)" | |
50 | ||
51 | #: src/CSVImportDialog.cpp:79 | |
52 | msgid "Colon (:)" | |
53 | msgstr "Двоеточие (:)" | |
54 | ||
55 | #: src/CSVImportDialog.cpp:81 | |
56 | msgid "Comma (,)" | |
57 | msgstr "Запятая (,)" | |
58 | ||
59 | #: src/CSVImportDialog.cpp:85 | |
60 | msgid "Separators" | |
61 | msgstr "Разделители" | |
62 | ||
63 | #: src/CSVImportDialog.cpp:88 | |
64 | msgid "See two separators as one" | |
65 | msgstr "Слить 2 сепаратора в один" | |
66 | ||
67 | #: src/CSVImportDialog.cpp:214 | |
68 | msgid "CSV Text Import" | |
69 | msgstr "Импортировать текст" | |
70 | ||
18 | 71 | #: src/CardBox.cpp:184 |
19 | 72 | msgid "0 cards" |
20 | 73 | msgstr "0 карточек" |
21 | 74 | |
22 | #: src/CardBox.cpp:311 | |
75 | #: src/CardBox.cpp:325 | |
23 | 76 | msgid "" |
24 | 77 | "Failed to parse file\n" |
25 | 78 | " " |
27 | 80 | "Ошибка при чтении файла\n" |
28 | 81 | " " |
29 | 82 | |
30 | #: src/CardBox.cpp:312 | |
83 | #: src/CardBox.cpp:326 | |
31 | 84 | msgid "" |
32 | 85 | "\n" |
33 | 86 | "Reason: invalid file syntax/DTD" |
35 | 88 | "\n" |
36 | 89 | "Причина: ошибка в семантике файла/ДТД" |
37 | 90 | |
38 | #: src/CardBox.cpp:499 | |
91 | #: src/CardBox.cpp:539 | |
39 | 92 | msgid "File \n" |
40 | 93 | msgstr "Файл \n" |
41 | 94 | |
42 | #: src/CardBox.cpp:500 | |
95 | #: src/CardBox.cpp:540 | |
43 | 96 | msgid "" |
44 | 97 | "\n" |
45 | 98 | "already exists.\n" |
49 | 102 | "уже существует.\n" |
50 | 103 | "Не хотите-ли вначале удалить его?" |
51 | 104 | |
52 | #: src/CardBox.cpp:507 src/CardBox.cpp:775 src/DeckPlayer.cpp:886 | |
105 | #: src/CardBox.cpp:547 src/CardBox.cpp:815 src/DeckPlayer.cpp:988 | |
53 | 106 | msgid "Yes" |
54 | 107 | msgstr "Да" |
55 | 108 | |
56 | #: src/CardBox.cpp:508 src/CardBox.cpp:776 src/DeckPlayer.cpp:887 | |
109 | #: src/CardBox.cpp:548 src/CardBox.cpp:816 src/DeckPlayer.cpp:989 | |
57 | 110 | msgid "No" |
58 | 111 | msgstr "Нет" |
59 | 112 | |
60 | #: src/CardBox.cpp:543 | |
113 | #: src/CardBox.cpp:583 | |
61 | 114 | msgid "Trying to access index out of range!" |
62 | 115 | msgstr "Попытка чтения вне инексного предела" |
63 | 116 | |
64 | #: src/CardBox.cpp:554 | |
117 | #: src/CardBox.cpp:594 | |
65 | 118 | msgid "Card Deck you've selected is empty" |
66 | 119 | msgstr "Выбранная колода карточек пуста" |
67 | 120 | |
68 | #: src/CardBox.cpp:573 | |
121 | #: src/CardBox.cpp:613 | |
69 | 122 | msgid "" |
70 | 123 | "First, open or create\n" |
71 | 124 | "a Card Box file." |
73 | 126 | "Вначале откройте или создайте\n" |
74 | 127 | "Card Box файл (для хранение картотеки)." |
75 | 128 | |
76 | #: src/CardBox.cpp:612 | |
129 | #: src/CardBox.cpp:652 | |
77 | 130 | msgid "First, open or create a Card File." |
78 | 131 | msgstr "Вначале откройте или создайте Card файл." |
79 | 132 | |
80 | #: src/CardBox.cpp:656 | |
133 | #: src/CardBox.cpp:696 | |
81 | 134 | msgid "" |
82 | 135 | "You have learnt all\n" |
83 | 136 | "expired cards in this deck." |
85 | 138 | "Вы выучили все просроченные\n" |
86 | 139 | "карточки в этой колоде." |
87 | 140 | |
88 | #: src/CardBox.cpp:689 | |
141 | #: src/CardBox.cpp:729 | |
89 | 142 | msgid "" |
90 | 143 | "First Open or Create\n" |
91 | 144 | "a New Card File!" |
93 | 146 | "Вначале откройте или создайте\n" |
94 | 147 | "новый Card File (для хранения картотеки)." |
95 | 148 | |
96 | #: src/CardDeck.cpp:25 | |
149 | #: src/CardDeck.cpp:26 | |
97 | 150 | msgid "Card Box 1" |
98 | 151 | msgstr "1-ая Ячейка" |
99 | 152 | |
100 | #: src/CardDeck.cpp:25 | |
153 | #: src/CardDeck.cpp:26 | |
101 | 154 | msgid "Card Box 2" |
102 | 155 | msgstr "2-ая Ячейка" |
103 | 156 | |
104 | #: src/CardDeck.cpp:26 | |
157 | #: src/CardDeck.cpp:27 | |
105 | 158 | msgid "Card Box 3" |
106 | 159 | msgstr "3-я Ячейка" |
107 | 160 | |
108 | #: src/CardDeck.cpp:26 | |
161 | #: src/CardDeck.cpp:27 | |
109 | 162 | msgid "Card Box 4" |
110 | 163 | msgstr "4-я Ячейка" |
111 | 164 | |
112 | #: src/CardDeck.cpp:27 | |
165 | #: src/CardDeck.cpp:28 | |
113 | 166 | msgid "Card Box 5" |
114 | 167 | msgstr "5-я Ячейка" |
115 | 168 | |
116 | #: src/CardView.cpp:109 | |
169 | #: src/CardView.cpp:111 | |
117 | 170 | msgid "Clear" |
118 | 171 | msgstr "Очистить" |
119 | 172 | |
120 | #: src/CardView.cpp:117 | |
121 | msgid "Cancel" | |
122 | msgstr "Отменить" | |
123 | ||
124 | #: src/CardView.cpp:126 | |
173 | #: src/CardView.cpp:128 | |
125 | 174 | msgid "Add" |
126 | msgstr "" | |
127 | ||
128 | #: src/CardView.cpp:135 | |
175 | msgstr "Добавить" | |
176 | ||
177 | #: src/CardView.cpp:137 | |
129 | 178 | msgid "Ok" |
130 | 179 | msgstr "Выполнить" |
131 | 180 | |
132 | #: src/CardView.cpp:144 | |
181 | #: src/CardView.cpp:146 | |
133 | 182 | msgid "Help" |
134 | msgstr "" | |
135 | ||
136 | #: src/CardView.cpp:153 | |
183 | msgstr "Подсказка" | |
184 | ||
185 | #: src/CardView.cpp:155 | |
137 | 186 | msgid "Front : " |
138 | 187 | msgstr "Лицевая:" |
139 | 188 | |
140 | #: src/CardView.cpp:159 | |
189 | #: src/CardView.cpp:161 | |
141 | 190 | msgid "Back :" |
142 | 191 | msgstr "Оборот: " |
143 | 192 | |
144 | #: src/CardView.cpp:165 | |
193 | #: src/CardView.cpp:167 | |
145 | 194 | msgid "Example : " |
146 | 195 | msgstr "Пример : " |
147 | 196 | |
148 | #: src/CardView.cpp:266 | |
197 | #: src/CardView.cpp:269 | |
149 | 198 | msgid "Fill up the back of the card" |
150 | 199 | msgstr "Заполните оборот карточки" |
151 | 200 | |
152 | #: src/CardView.cpp:297 | |
201 | #: src/CardView.cpp:301 | |
153 | 202 | msgid "Fill up an example" |
154 | 203 | msgstr "Заполните пример" |
155 | 204 | |
156 | #: src/CardView.cpp:327 | |
205 | #: src/CardView.cpp:353 | |
157 | 206 | msgid "Fill up the front of the card" |
158 | 207 | msgstr "Заполните лицевую сторону" |
159 | 208 | |
160 | #: src/CardView.cpp:544 | |
209 | #: src/CardView.cpp:591 | |
161 | 210 | msgid "FRONT field contains illegal markup tag(s)." |
162 | 211 | msgstr "Лицевая сторона содержит неудобоваримую маркировку." |
163 | 212 | |
164 | #: src/CardView.cpp:551 | |
213 | #: src/CardView.cpp:600 | |
165 | 214 | msgid "BACK field contains illegal markup tag(s)." |
166 | 215 | msgstr "Оборотная сторона содержит неудобоваримую маркировку." |
167 | 216 | |
168 | #: src/CardView.cpp:558 | |
217 | #: src/CardView.cpp:609 | |
169 | 218 | msgid "EXAMPLE field contains illegal markup tag(s)." |
170 | 219 | msgstr "Пример содержит неудобоваримую маркировку." |
171 | 220 | |
172 | #: src/DeckPlayer.cpp:51 | |
221 | #: src/Deck.cpp:310 | |
222 | msgid "" | |
223 | "Failed to open import file.\n" | |
224 | "Check file permissions." | |
225 | msgstr "" | |
226 | "Ошибка при импорте файла.\n" | |
227 | "Проверьте аттрибуты доступа." | |
228 | ||
229 | #: src/DeckPlayer.cpp:55 | |
173 | 230 | msgid "Check" |
174 | 231 | msgstr "Сравнить" |
175 | 232 | |
176 | #: src/DeckPlayer.cpp:51 | |
233 | #: src/DeckPlayer.cpp:55 | |
177 | 234 | msgid "Next " |
178 | 235 | msgstr "Следующий" |
179 | 236 | |
180 | #: src/DeckPlayer.cpp:51 | |
237 | #: src/DeckPlayer.cpp:55 | |
181 | 238 | msgid "Correct " |
182 | 239 | msgstr "Угадал " |
183 | 240 | |
184 | #: src/DeckPlayer.cpp:51 | |
241 | #: src/DeckPlayer.cpp:55 | |
185 | 242 | msgid "Incorrect" |
186 | 243 | msgstr "Не угадал" |
187 | 244 | |
188 | #: src/DeckPlayer.cpp:279 | |
245 | #: src/DeckPlayer.cpp:319 | |
189 | 246 | msgid "Close" |
190 | 247 | msgstr "Закрыть" |
191 | 248 | |
192 | #: src/DeckPlayer.cpp:281 | |
249 | #: src/DeckPlayer.cpp:321 | |
193 | 250 | msgid "Shuffle" |
194 | 251 | msgstr "Перемешать" |
195 | 252 | |
196 | #: src/DeckPlayer.cpp:284 | |
253 | #: src/DeckPlayer.cpp:324 | |
197 | 254 | msgid "View/Edit Deck" |
198 | 255 | msgstr "Поправка Колоды" |
199 | 256 | |
200 | #: src/DeckPlayer.cpp:286 | |
257 | #: src/DeckPlayer.cpp:326 | |
201 | 258 | msgid "Edit Card" |
202 | 259 | msgstr "Поправка Карточки" |
203 | 260 | |
204 | #: src/DeckPlayer.cpp:881 | |
261 | #: src/DeckPlayer.cpp:412 | |
262 | msgid "Front" | |
263 | msgstr "Перед" | |
264 | ||
265 | #: src/DeckPlayer.cpp:444 | |
266 | msgid "Back" | |
267 | msgstr "Оборот" | |
268 | ||
269 | #: src/DeckPlayer.cpp:458 | |
270 | msgid "Ask front" | |
271 | msgstr "Проверь перед" | |
272 | ||
273 | #: src/DeckPlayer.cpp:464 | |
274 | msgid "Ask back" | |
275 | msgstr "Проверь оборот" | |
276 | ||
277 | #: src/DeckPlayer.cpp:475 | |
278 | msgid "Test line: " | |
279 | msgstr "Строка" | |
280 | ||
281 | #: src/DeckPlayer.cpp:537 | |
282 | msgid "Say It!" | |
283 | msgstr "Произнеси" | |
284 | ||
285 | #: src/DeckPlayer.cpp:547 | |
286 | msgid "I know it!" | |
287 | msgstr "Я знаю" | |
288 | ||
289 | #: src/DeckPlayer.cpp:557 | |
290 | msgid "No clue" | |
291 | msgstr "Я не знаю" | |
292 | ||
293 | #: src/DeckPlayer.cpp:724 | |
294 | msgid "" | |
295 | "The card you are about to see has invalid markup.\n" | |
296 | "To proceed further, first, fix the broken markup.\n" | |
297 | "If unsure about the correct syntax, consult Help." | |
298 | msgstr "" | |
299 | "Карточта которую вы сейчас увидете содержит\n" | |
300 | "неудобоваримую маркировку. Чтобы продолжить,\n" | |
301 | "пожалуйста, исправье. Обратитесь к Подсказке за помощью." | |
302 | ||
303 | #: src/DeckPlayer.cpp:983 | |
205 | 304 | msgid "" |
206 | 305 | "Would you like to make cards\n" |
207 | 306 | "order changes permanent?" |
209 | 308 | "Не желаете-ли сохранить новый\n" |
210 | 309 | "порядок карточек?" |
211 | 310 | |
212 | #: src/DeckPlayer.cpp:960 | |
311 | #: src/DeckPlayer.cpp:1062 | |
213 | 312 | msgid "The deck is empty!" |
214 | 313 | msgstr "Колода пуста!" |
314 | ||
315 | #: src/GeneralPref.cpp:112 | |
316 | msgid "" | |
317 | "Remove duplicates when inserting new\n" | |
318 | "cards from a Deck to the CardBox" | |
319 | msgstr "" | |
320 | "Избавиться от дубликатов при добавлении\n" | |
321 | "новых карточек из Колоды в Ячейку" | |
322 | ||
323 | #: src/GeneralPref.cpp:118 | |
324 | msgid "Record all dynamic links in CardFile as relative paths" | |
325 | msgstr "Записать все динамические ссылки в CardFile как относительные" | |
326 | ||
327 | #: src/GeneralPref.cpp:124 | |
328 | msgid "" | |
329 | "Some keyboard input methods may conflict with keyboard\n" | |
330 | "shortcuts. If checked, disable all shortcuts in DeckPlayer\n" | |
331 | "dialog (requires restart)." | |
332 | msgstr "" | |
333 | "Некоторые методы клавиатурного ввода могут противоречить\n" | |
334 | "клавиатурным упрощениям. Если отмечено, заблокировать\n" | |
335 | "упрощения в DeckPlayer диалоге (перестартовка необходима)" | |
215 | 336 | |
216 | 337 | #: src/MainWindow.cpp:95 |
217 | 338 | msgid "CardBox" |
249 | 370 | "Проэкт открыт.\n" |
250 | 371 | "Пожалуйста, закройте его вначале." |
251 | 372 | |
252 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:362 | |
373 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:364 | |
253 | 374 | msgid "" |
254 | 375 | "Please open or create\n" |
255 | 376 | "project first" |
265 | 386 | "Проэкт не был изменен.\n" |
266 | 387 | "Закройте его чтобы продолжить." |
267 | 388 | |
268 | #: src/MainWindow.cpp:499 | |
389 | #: src/MainWindow.cpp:504 | |
269 | 390 | msgid "Choose New CardFile name" |
270 | 391 | msgstr "Выберите новое имя для картотеки" |
271 | 392 | |
272 | #: src/MainWindow.cpp:539 | |
393 | #: src/MainWindow.cpp:544 | |
273 | 394 | msgid "Save Card File As ..." |
274 | 395 | msgstr "Сохранить картотеку Как ..." |
0 | # SOME DESCRIPTIVE TITLE. | |
1 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the PACKAGE package. | |
3 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | |
4 | # | |
5 | #, fuzzy | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: granule 1.1.5\n" | |
9 | "Report-Msgid-Bugs-To: \n" | |
10 | "POT-Creation-Date: 2005-07-12 22:08-0400\n" | |
11 | "PO-Revision-Date: 2005-04-12 21:34-0000\n" | |
12 | "Last-Translator: Vladislav Grinchenko <vlg@users.sourceforge.net>\n" | |
13 | "Language-Team: Russian <LL@li.org>\n" | |
14 | "MIME-Version: 1.0\n" | |
15 | "Content-Type: text/plain; charset=UTF-8\n" | |
16 | "Content-Transfer-Encoding: 8bit\n" | |
17 | ||
18 | #: src/CardBox.cpp:184 | |
19 | msgid "0 cards" | |
20 | msgstr "0 карточек" | |
21 | ||
22 | #: src/CardBox.cpp:311 | |
23 | msgid "" | |
24 | "Failed to parse file\n" | |
25 | " " | |
26 | msgstr "" | |
27 | "Ошибка при чтении файла\n" | |
28 | " " | |
29 | ||
30 | #: src/CardBox.cpp:312 | |
31 | msgid "" | |
32 | "\n" | |
33 | "Reason: invalid file syntax/DTD" | |
34 | msgstr "" | |
35 | "\n" | |
36 | "Причина: ошибка в семантике файла/ДТД" | |
37 | ||
38 | #: src/CardBox.cpp:499 | |
39 | msgid "File \n" | |
40 | msgstr "Файл \n" | |
41 | ||
42 | #: src/CardBox.cpp:500 | |
43 | msgid "" | |
44 | "\n" | |
45 | "already exists.\n" | |
46 | "Would you like to delete it first?" | |
47 | msgstr "" | |
48 | "\n" | |
49 | "уже существует.\n" | |
50 | "Не хотите-ли вначале удалить его?" | |
51 | ||
52 | #: src/CardBox.cpp:507 src/CardBox.cpp:775 src/DeckPlayer.cpp:886 | |
53 | msgid "Yes" | |
54 | msgstr "Да" | |
55 | ||
56 | #: src/CardBox.cpp:508 src/CardBox.cpp:776 src/DeckPlayer.cpp:887 | |
57 | msgid "No" | |
58 | msgstr "Нет" | |
59 | ||
60 | #: src/CardBox.cpp:543 | |
61 | msgid "Trying to access index out of range!" | |
62 | msgstr "Попытка чтения вне инексного предела" | |
63 | ||
64 | #: src/CardBox.cpp:554 | |
65 | msgid "Card Deck you've selected is empty" | |
66 | msgstr "Выбранная колода карточек пуста" | |
67 | ||
68 | #: src/CardBox.cpp:573 | |
69 | msgid "" | |
70 | "First, open or create\n" | |
71 | "a Card Box file." | |
72 | msgstr "" | |
73 | "Вначале откройте или создайте\n" | |
74 | "Card Box файл (для хранение картотеки)." | |
75 | ||
76 | #: src/CardBox.cpp:612 | |
77 | msgid "First, open or create a Card File." | |
78 | msgstr "Вначале откройте или создайте Card файл." | |
79 | ||
80 | #: src/CardBox.cpp:656 | |
81 | msgid "" | |
82 | "You have learnt all\n" | |
83 | "expired cards in this deck." | |
84 | msgstr "" | |
85 | "Вы выучили все просроченные\n" | |
86 | "карточки в этой колоде." | |
87 | ||
88 | #: src/CardBox.cpp:689 | |
89 | msgid "" | |
90 | "First Open or Create\n" | |
91 | "a New Card File!" | |
92 | msgstr "" | |
93 | "Вначале откройте или создайте\n" | |
94 | "новый Card File (для хранения картотеки)." | |
95 | ||
96 | #: src/CardDeck.cpp:25 | |
97 | msgid "Card Box 1" | |
98 | msgstr "1-ая Ячейка" | |
99 | ||
100 | #: src/CardDeck.cpp:25 | |
101 | msgid "Card Box 2" | |
102 | msgstr "2-ая Ячейка" | |
103 | ||
104 | #: src/CardDeck.cpp:26 | |
105 | msgid "Card Box 3" | |
106 | msgstr "3-я Ячейка" | |
107 | ||
108 | #: src/CardDeck.cpp:26 | |
109 | msgid "Card Box 4" | |
110 | msgstr "4-я Ячейка" | |
111 | ||
112 | #: src/CardDeck.cpp:27 | |
113 | msgid "Card Box 5" | |
114 | msgstr "5-я Ячейка" | |
115 | ||
116 | #: src/CardView.cpp:109 | |
117 | msgid "Clear" | |
118 | msgstr "Очистить" | |
119 | ||
120 | #: src/CardView.cpp:117 | |
121 | msgid "Cancel" | |
122 | msgstr "Отменить" | |
123 | ||
124 | #: src/CardView.cpp:126 | |
125 | msgid "Add" | |
126 | msgstr "" | |
127 | ||
128 | #: src/CardView.cpp:135 | |
129 | msgid "Ok" | |
130 | msgstr "Выполнить" | |
131 | ||
132 | #: src/CardView.cpp:144 | |
133 | msgid "Help" | |
134 | msgstr "" | |
135 | ||
136 | #: src/CardView.cpp:153 | |
137 | msgid "Front : " | |
138 | msgstr "Лицевая:" | |
139 | ||
140 | #: src/CardView.cpp:159 | |
141 | msgid "Back :" | |
142 | msgstr "Оборот: " | |
143 | ||
144 | #: src/CardView.cpp:165 | |
145 | msgid "Example : " | |
146 | msgstr "Пример : " | |
147 | ||
148 | #: src/CardView.cpp:266 | |
149 | msgid "Fill up the back of the card" | |
150 | msgstr "Заполните оборот карточки" | |
151 | ||
152 | #: src/CardView.cpp:297 | |
153 | msgid "Fill up an example" | |
154 | msgstr "Заполните пример" | |
155 | ||
156 | #: src/CardView.cpp:327 | |
157 | msgid "Fill up the front of the card" | |
158 | msgstr "Заполните лицевую сторону" | |
159 | ||
160 | #: src/CardView.cpp:544 | |
161 | msgid "FRONT field contains illegal markup tag(s)." | |
162 | msgstr "Лицевая сторона содержит неудобоваримую маркировку." | |
163 | ||
164 | #: src/CardView.cpp:551 | |
165 | msgid "BACK field contains illegal markup tag(s)." | |
166 | msgstr "Оборотная сторона содержит неудобоваримую маркировку." | |
167 | ||
168 | #: src/CardView.cpp:558 | |
169 | msgid "EXAMPLE field contains illegal markup tag(s)." | |
170 | msgstr "Пример содержит неудобоваримую маркировку." | |
171 | ||
172 | #: src/DeckPlayer.cpp:51 | |
173 | msgid "Check" | |
174 | msgstr "Сравнить" | |
175 | ||
176 | #: src/DeckPlayer.cpp:51 | |
177 | msgid "Next " | |
178 | msgstr "Следующий" | |
179 | ||
180 | #: src/DeckPlayer.cpp:51 | |
181 | msgid "Correct " | |
182 | msgstr "Угадал " | |
183 | ||
184 | #: src/DeckPlayer.cpp:51 | |
185 | msgid "Incorrect" | |
186 | msgstr "Не угадал" | |
187 | ||
188 | #: src/DeckPlayer.cpp:279 | |
189 | msgid "Close" | |
190 | msgstr "Закрыть" | |
191 | ||
192 | #: src/DeckPlayer.cpp:281 | |
193 | msgid "Shuffle" | |
194 | msgstr "Перемешать" | |
195 | ||
196 | #: src/DeckPlayer.cpp:284 | |
197 | msgid "View/Edit Deck" | |
198 | msgstr "Поправка Колоды" | |
199 | ||
200 | #: src/DeckPlayer.cpp:286 | |
201 | msgid "Edit Card" | |
202 | msgstr "Поправка Карточки" | |
203 | ||
204 | #: src/DeckPlayer.cpp:881 | |
205 | msgid "" | |
206 | "Would you like to make cards\n" | |
207 | "order changes permanent?" | |
208 | msgstr "" | |
209 | "Не желаете-ли сохранить новый\n" | |
210 | "порядок карточек?" | |
211 | ||
212 | #: src/DeckPlayer.cpp:960 | |
213 | msgid "The deck is empty!" | |
214 | msgstr "Колода пуста!" | |
215 | ||
216 | #: src/MainWindow.cpp:95 | |
217 | msgid "CardBox" | |
218 | msgstr "Картотека" | |
219 | ||
220 | #: src/MainWindow.cpp:212 src/MainWindow.cpp:300 | |
221 | msgid "" | |
222 | "Project has been modified.\n" | |
223 | "Please, save and close it first" | |
224 | msgstr "" | |
225 | "Проэкт был изменен,\n" | |
226 | "Пожалуйста, вначале сохраните и закройте его." | |
227 | ||
228 | #: src/MainWindow.cpp:220 src/MainWindow.cpp:308 | |
229 | msgid "" | |
230 | "Project is opened.\n" | |
231 | "Please, close it first" | |
232 | msgstr "" | |
233 | "Проэкт открыт.\n" | |
234 | "Пожалуйста, закройте его вначале." | |
235 | ||
236 | #: src/MainWindow.cpp:251 | |
237 | msgid "" | |
238 | "Project has been modified\n" | |
239 | "Please, save and close it first" | |
240 | msgstr "" | |
241 | "Проэкт был изменен,\n" | |
242 | "Пожалуйста, вначале сохраните и закройте его." | |
243 | ||
244 | #: src/MainWindow.cpp:260 | |
245 | msgid "" | |
246 | "Project is opened\n" | |
247 | "Please, close it first" | |
248 | msgstr "" | |
249 | "Проэкт открыт.\n" | |
250 | "Пожалуйста, закройте его вначале." | |
251 | ||
252 | #: src/MainWindow.cpp:327 src/MainWindow.cpp:362 | |
253 | msgid "" | |
254 | "Please open or create\n" | |
255 | "project first" | |
256 | msgstr "" | |
257 | "Вначале, откройте или создайте\n" | |
258 | "новый проэкт." | |
259 | ||
260 | #: src/MainWindow.cpp:342 | |
261 | msgid "" | |
262 | "Project is not modified.\n" | |
263 | "Close it to proceed." | |
264 | msgstr "" | |
265 | "Проэкт не был изменен.\n" | |
266 | "Закройте его чтобы продолжить." | |
267 | ||
268 | #: src/MainWindow.cpp:499 | |
269 | msgid "Choose New CardFile name" | |
270 | msgstr "Выберите новое имя для картотеки" | |
271 | ||
272 | #: src/MainWindow.cpp:539 | |
273 | msgid "Save Card File As ..." | |
274 | msgstr "Сохранить картотеку Как ..." |
0 | 0 | // -*- c++ -*- |
1 | 1 | // generated by glade-- |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: AboutGRAPP.cpp,v 1.3 2004/07/06 04:34:22 vlg Exp $ | |
3 | // $Id: AboutGRAPP.cpp,v 1.4 2005/11/27 04:59:22 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // AboutGRAPP.cpp |
6 | 6 | //------------------------------------------------------------------------------ |
57 | 57 | |
58 | 58 | /** Label is the rest of it |
59 | 59 | */ |
60 | Glib::ustring info_msg ("\nThe Index Cards Program.\n"); | |
61 | info_msg += "Copyright (C) 2004 Vladislav Grinchenko\n"; | |
60 | Glib::ustring info_msg ("\nThe FlashCards Program.\n"); | |
61 | info_msg += "Copyright (C) 2004-2005 Vladislav Grinchenko\n"; | |
62 | 62 | label = manage (new Gtk::Label (info_msg)); |
63 | 63 | |
64 | 64 | contents->pack_start (*label); |
0 | 0 | // -*- c++ -*- |
1 | 1 | //------------------------------------------------------------------------------ |
2 | // $Id: CardBox.cpp,v 1.45 2005/07/06 02:52:26 vlg Exp $ | |
2 | // $Id: CardBox.cpp,v 1.47 2005/11/13 02:50:48 vlg Exp $ | |
3 | 3 | //------------------------------------------------------------------------------ |
4 | 4 | // CardBox.cpp |
5 | 5 | //------------------------------------------------------------------------------ |
225 | 225 | show_all (); |
226 | 226 | } |
227 | 227 | |
228 | CardBox:: | |
229 | ~CardBox () | |
230 | { | |
231 | trace_with_mask("CardBox::~CardBox",GUITRACE); | |
232 | } | |
233 | ||
234 | 228 | void |
235 | 229 | CardBox:: |
236 | 230 | update_count (int idx_) |
273 | 267 | { |
274 | 268 | trace_with_mask("CardBox::load",GUITRACE); |
275 | 269 | |
270 | int ret = 0; | |
271 | string error_msg; | |
272 | xmlParserCtxtPtr context; | |
273 | xmlDocPtr parser; | |
274 | ||
276 | 275 | /** Test to see if file exists |
277 | 276 | */ |
278 | 277 | struct stat file_stat; |
279 | 278 | if (stat (fname_.c_str (), &file_stat) < 0 || |
280 | S_ISREG (file_stat.st_mode) == false) // invalid project file | |
279 | S_ISREG (file_stat.st_mode) == false) // invalid project file | |
281 | 280 | { |
282 | string msg ("Invalid CardBox file:\n"); | |
283 | msg += fname_; | |
284 | Gtk::MessageDialog md_error (msg, false, Gtk::MESSAGE_ERROR); | |
281 | error_msg = "Invalid CardBox file:\n"; | |
282 | error_msg += fname_; | |
283 | Gtk::MessageDialog md_error (error_msg, false, Gtk::MESSAGE_ERROR); | |
284 | md_error.run (); | |
285 | 285 | return -1; |
286 | 286 | } |
287 | 287 | |
288 | 288 | CONFIG->set_proj_name (fname_); |
289 | 289 | |
290 | try { | |
291 | xmlpp::DomParser parser; | |
292 | parser.set_validate (); | |
293 | parser.parse_file (fname_); | |
294 | if (!parser) { | |
295 | DL((GRAPP,"Failed to parse \"%s\"\n", fname_.c_str ())); | |
296 | return -1; | |
297 | } | |
298 | DL((GRAPP,"Parsing the card file ...\n")); | |
299 | const xmlpp::Node* root_node = parser.get_document ()->get_root_node (); | |
300 | Assert_exit (root_node); | |
301 | ||
302 | if (parse_xml_tree (root_node) == 0) { | |
303 | m_fname = fname_; | |
304 | MAINWIN->set_mw_name (); | |
305 | CONFIG->set_filesel_path (fname_); | |
306 | return 0; | |
307 | } | |
308 | } | |
309 | catch (const std::exception& ex_) { | |
310 | string msg (_("Failed to parse file\n ")); | |
311 | msg += fname_ + _("\nReason: invalid file syntax/DTD"); | |
312 | Gtk::MessageDialog e (msg, false, MESSAGE_ERROR); | |
313 | e.run (); | |
314 | } | |
315 | return -1; | |
290 | context = xmlCreateFileParserCtxt (fname_.c_str ()); // new | |
291 | if (!context) { | |
292 | DL ((GRAPP,"Failed to create file context\n")); | |
293 | xmlFreeParserCtxt (context); | |
294 | return -1; | |
295 | } | |
296 | // Initialize context | |
297 | context->linenumbers = 1; | |
298 | context->validate = 1; | |
299 | context->replaceEntities = 1; | |
300 | ||
301 | // Parse the document | |
302 | xmlParseDocument (context); | |
303 | ||
304 | if(!context->wellFormed || context->errNo != 0) { | |
305 | error_msg = "File is not well-formed:\n"; | |
306 | error_msg += fname_; | |
307 | Gtk::MessageDialog md_error (error_msg, false, Gtk::MESSAGE_ERROR); | |
308 | md_error.run (); | |
309 | xmlFreeParserCtxt (context); | |
310 | return -1; | |
311 | } | |
312 | ||
313 | parser = context->myDoc; | |
314 | xmlFreeParserCtxt (context); // not needed anymore? | |
315 | ||
316 | DL((GRAPP,"Parsing the card file ...\n")); | |
317 | ||
318 | if (parse_xml_tree (parser, error_msg) == 0) { | |
319 | m_fname = fname_; | |
320 | MAINWIN->set_mw_name (); | |
321 | CONFIG->set_filesel_path (fname_); | |
322 | } | |
323 | else { | |
324 | string msg (_("Failed to parse file\n ")); | |
325 | msg += fname_ + _("\nReason: invalid file syntax/DTD"); | |
326 | Gtk::MessageDialog e (msg, false, MESSAGE_ERROR); | |
327 | e.run (); | |
328 | DL ((ASSA::ERROR,"Failed to parse file: %s\n", error_msg.c_str ())); | |
329 | ret = -1; | |
330 | } | |
331 | ||
332 | xmlFreeDoc (parser); | |
333 | return ret; | |
316 | 334 | } |
317 | 335 | |
318 | 336 | int |
319 | 337 | CardBox:: |
320 | parse_xml_tree (const xmlpp::Node* node_) | |
338 | parse_xml_tree (const xmlDocPtr parser_, string error_msg_) | |
321 | 339 | { |
322 | 340 | trace_with_mask("CardBox::parse_xml_tree",GUITRACE); |
341 | ||
342 | char total_count [32]; | |
323 | 343 | char xpath [64]; |
324 | char total_count [32]; | |
325 | const xmlpp::TextNode* text_node; | |
326 | const xmlpp::Attribute* attr_node; | |
327 | xmlpp::NodeSet nset; // set of cards | |
328 | xmlpp::NodeSet::iterator nset_iter; | |
329 | long card_id; | |
330 | string abs_path; // absolute deck path | |
331 | string deck_path; // deck path as recorded in CDF file | |
332 | int ccount; // card counter | |
333 | int cloaded; // count of cards loaded | |
334 | Card* cardptr; | |
344 | xmlChar* result; | |
345 | ||
346 | string attr_node; | |
347 | long card_id; | |
348 | string abs_path; // absolute deck path | |
349 | string deck_path; // deck path as recorded in CDF file | |
350 | int ccount; // card counter | |
351 | int cloaded; // count of cards loaded | |
352 | Card* cardptr; | |
335 | 353 | CardRef* card_ref; |
336 | 354 | |
337 | for (int i = 0; i < CARD_BOX_SIZE; i++) { | |
355 | for (int i = 0; i < CARD_BOX_SIZE; i++) | |
356 | { | |
338 | 357 | DL((GRAPP,"Filling Card Deck # %d ...\n", i+1)); |
339 | 358 | m_card_deck [i].set_name (i); |
340 | 359 | cloaded = 0; |
341 | for (ccount = 1; ccount < MAX_CARDS; ccount++) { | |
360 | for (ccount = 1; ccount < MAX_CARDS; ccount++) | |
361 | { | |
342 | 362 | DL((GRAPP,"Parsing Card # %d/%d ...\n", i+1, ccount)); |
363 | ||
343 | 364 | sprintf(xpath, "/cardfile/carddeck[%d]/card[%d]", i+1, ccount); |
344 | nset = node_->find (xpath); | |
345 | if ((nset_iter = nset.begin ()) == nset.end ()) { | |
365 | result = Granule::get_node_by_xpath (parser_, xpath); | |
366 | if (result == NULL) { | |
346 | 367 | break; |
347 | 368 | } |
369 | xmlFree (result); | |
370 | ||
348 | 371 | /** Parse card's ID |
349 | 372 | */ |
350 | 373 | sprintf (xpath, "/cardfile/carddeck[%d]/card[%d]/@id", i+1, ccount); |
351 | nset = node_->find (xpath); | |
352 | if ((nset_iter = nset.begin ()) == nset.end ()) return -1; | |
353 | attr_node = dynamic_cast<const xmlpp::Attribute*> (*nset_iter); | |
354 | if (attr_node == NULL) { | |
374 | result = Granule::get_node_by_xpath (parser_, xpath); | |
375 | if (result == NULL) { | |
376 | error_msg_ = "Failed to retrieve card id for "; | |
377 | error_msg_ += xpath; | |
355 | 378 | return -1; |
356 | 379 | } |
357 | card_id = ::atol ((attr_node->get_value ().substr (1)).c_str ()); | |
380 | attr_node = (const char*) result; | |
381 | card_id = ::atol ((attr_node.substr (1)).c_str ()); | |
382 | xmlFree (result); | |
358 | 383 | |
359 | 384 | /** Parse the expiration time of the card (expdate tag). If |
360 | 385 | tag is not found, then we are dealing with an older file. |
361 | 386 | */ |
362 | 387 | ASSA::TimeVal exp_time; |
363 | sprintf (xpath, "/cardfile/carddeck[%d]/card[%d]/expdate/text()", | |
388 | sprintf (xpath, "/cardfile/carddeck[%d]/card[%d]/expdate", | |
364 | 389 | i+1, ccount); |
365 | nset = node_->find (xpath); | |
366 | if ((nset_iter = nset.begin ()) == nset.end ()) { | |
390 | result = Granule::get_node_by_xpath (parser_, xpath); | |
391 | if (result == NULL) { | |
367 | 392 | exp_time = CONFIG->get_load_time (); // card expires today |
368 | 393 | } |
369 | 394 | else { |
370 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
371 | if (text_node == NULL) { | |
372 | return -1; | |
373 | } | |
374 | exp_time.sec (::atol (text_node->get_content ().c_str ())); | |
395 | exp_time.sec (::atol ((const char*) result)); | |
396 | xmlFree (result); | |
375 | 397 | } |
376 | 398 | |
377 | 399 | /** Parse the source Deck path of the card |
378 | 400 | */ |
379 | sprintf (xpath, "/cardfile/carddeck[%d]/card[%d]/fromdeck/text()", | |
401 | sprintf (xpath, "/cardfile/carddeck[%d]/card[%d]/fromdeck", | |
380 | 402 | i+1, ccount); |
381 | nset = node_->find (xpath); | |
382 | if ((nset_iter = nset.begin ()) == nset.end ()) { | |
403 | result = Granule::get_node_by_xpath (parser_, xpath); | |
404 | if (result == NULL) { | |
383 | 405 | return -1; |
384 | 406 | } |
385 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
386 | if (text_node == NULL) { | |
387 | return -1; | |
388 | } | |
389 | ||
390 | deck_path = Glib::locale_from_utf8 (text_node->get_content ()); | |
407 | deck_path = Glib::locale_from_utf8 ((const char*) result); | |
408 | xmlFree (result); | |
391 | 409 | |
392 | 410 | if (deck_path[0] != G_DIR_SEPARATOR) { |
393 | 411 | abs_path = calculate_absolute_path (CONFIG->get_proj_path (), |
416 | 434 | } |
417 | 435 | } // for (each card) |
418 | 436 | |
437 | DL((GRAPP,"Processed %d cards\n", m_card_deck [i].size ())); | |
419 | 438 | m_card_deck [i].sort_by_expiration_time (); |
420 | 439 | sprintf (total_count, "%d cards", cloaded); |
421 | 440 | update_count (i); |
433 | 452 | { |
434 | 453 | trace_with_mask("CardBox::save",GUITRACE); |
435 | 454 | |
436 | xmlpp::Document deck_xml; | |
437 | xmlpp::Element* deck_node; | |
438 | xmlpp::Element* carddeck; | |
439 | xmlpp::Element* card; | |
440 | xmlpp::Element* path; | |
441 | xmlpp::TextNode* txt_node; | |
455 | static const char dtd_url[] = "http://granule.sourceforge.net/cardfile.dtd"; | |
442 | 456 | |
443 | 457 | std::string abs_fname; |
444 | 458 | const std::string proj_path (CONFIG->get_proj_path ()); |
445 | 459 | std::string deck_fname; |
446 | 460 | VDeck::cardlist_iterator citer; |
447 | CardRef* card_ref; | |
461 | CardRef* card_ref = NULL; | |
462 | int ret = 0; | |
463 | ||
464 | xmlTextWriterPtr writer; | |
448 | 465 | |
449 | 466 | DL((GRAPP,"Saving to \"%s\"\n", m_fname.c_str ())); |
450 | 467 | ::unlink (m_fname.c_str ()); |
451 | deck_xml.set_internal_subset ("cardfile", "", "http://granule.sourceforge.net/cardfile.dtd"); | |
452 | deck_node = deck_xml.create_root_node ("cardfile"); | |
468 | ||
469 | writer = xmlNewTextWriterFilename (m_fname.c_str (), 0); | |
470 | if (writer == NULL) { | |
471 | return -1; | |
472 | } | |
473 | ||
474 | ret = xmlTextWriterStartDocument (writer, NULL, "UTF-8", NULL); | |
475 | if (ret < 0) { | |
476 | xmlFreeTextWriter (writer); | |
477 | return -1; | |
478 | } | |
479 | ||
480 | xmlTextWriterSetIndent(writer, 0); | |
481 | xmlTextWriterStartDTD (writer, BAD_CAST "cardfile", NULL, BAD_CAST dtd_url); | |
482 | xmlTextWriterSetIndent(writer, 1); | |
483 | xmlTextWriterEndDTD (writer); | |
484 | ||
485 | ret = xmlTextWriterStartElement (writer, BAD_CAST "cardfile"); | |
453 | 486 | |
454 | 487 | for (int i = 0; i < CARD_BOX_SIZE; i++) { |
455 | carddeck = deck_node->add_child ("carddeck"); | |
488 | ret = xmlTextWriterStartElement (writer, BAD_CAST "carddeck"); | |
456 | 489 | citer = m_card_deck [i].begin (); |
490 | ||
457 | 491 | while (citer != m_card_deck [i].end ()) { |
492 | ||
458 | 493 | if ((card_ref = dynamic_cast<CardRef*> (*citer)) != NULL) { |
459 | card = carddeck->add_child ("card"); | |
460 | card->set_attribute ("id", (*citer)->get_id_str ()); | |
461 | ||
462 | path = card->add_child ("fromdeck"); | |
494 | ret = xmlTextWriterStartElement (writer, BAD_CAST "card"); | |
495 | ret = xmlTextWriterWriteAttribute (writer, BAD_CAST "id", | |
496 | BAD_CAST (*citer)->get_id_str ().c_str ()); | |
497 | ||
463 | 498 | abs_fname = card_ref->get_deck ().get_name (); |
464 | 499 | if (CONFIG->with_relpaths ()) { |
465 | 500 | deck_fname = calculate_relative_path (proj_path, abs_fname); |
467 | 502 | else { |
468 | 503 | deck_fname = abs_fname; |
469 | 504 | } |
470 | txt_node = path->add_child_text ( | |
471 | Glib::locale_to_utf8 (deck_fname)); | |
472 | ||
473 | path = card->add_child ("expdate"); | |
474 | txt_node = path->add_child_text ( | |
475 | card_ref->get_expiration_str ()); | |
505 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "fromdeck", | |
506 | BAD_CAST Glib::locale_to_utf8 (deck_fname).c_str ()); | |
507 | ||
508 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "expdate", | |
509 | BAD_CAST card_ref->get_expiration_str ().c_str ()); | |
510 | ret = xmlTextWriterEndElement (writer); | |
476 | 511 | } |
477 | 512 | citer++; |
478 | 513 | } |
479 | } | |
480 | deck_xml.write_to_file_formatted (m_fname, "UTF-8"); | |
514 | ret = xmlTextWriterEndElement (writer); // carddeck | |
515 | } | |
516 | ||
517 | xmlTextWriterEndElement (writer); // @end cardfile | |
518 | xmlFreeTextWriter (writer); // cleanup | |
519 | ||
520 | return ret; | |
481 | 521 | } |
482 | 522 | |
483 | 523 | int |
565 | 605 | add_deck_to_box (int idx_, Deck* from_deck_) |
566 | 606 | { |
567 | 607 | trace_with_mask("CardBox::add_deck_to_box",GUITRACE); |
568 | Assert_exit (idx_ < CARD_BOX_SIZE); | |
569 | Assert_exit (from_deck_); | |
608 | Assure_exit (idx_ < CARD_BOX_SIZE); | |
609 | Assure_exit (from_deck_); | |
570 | 610 | |
571 | 611 | if (m_fname.empty ()) { |
572 | 612 | Gtk::MessageDialog em (_("First, open or create\na Card Box file."), |
0 | 0 | // -*- c++ -*- |
1 | 1 | //------------------------------------------------------------------------------ |
2 | // $Id: CardBox.h,v 1.23 2004/12/13 04:29:03 vlg Exp $ | |
2 | // $Id: CardBox.h,v 1.24 2005/11/13 02:50:48 vlg Exp $ | |
3 | 3 | //------------------------------------------------------------------------------ |
4 | 4 | // CardBox.h |
5 | 5 | //------------------------------------------------------------------------------ |
6 | // Copyright (c) 2004 by Vladislav Grinchenko | |
6 | // Copyright (c) 2004,2005 by Vladislav Grinchenko | |
7 | 7 | // |
8 | 8 | // This program is free software; you can redistribute it and/or |
9 | 9 | // modify it under the terms of the GNU General Public License |
86 | 86 | void repaint_deck_players (); |
87 | 87 | |
88 | 88 | private: |
89 | struct CardBoxIF { | |
89 | struct CardBoxIF | |
90 | { | |
90 | 91 | Gtk::Image* m_sched_light; // Light button to indicate % of overdue |
91 | 92 | Gtk::Label* m_sched_count; // How many cards are overdue |
92 | 93 | Gtk::VBox* m_sched_vbox; // Vbox to hold scheduling widgets |
99 | 100 | m_total_count (NULL), m_expired_count (0) |
100 | 101 | { /* no-op */ } |
101 | 102 | |
102 | void reset () { | |
103 | void reset () | |
104 | { | |
103 | 105 | m_sched_count->set_text ("0"); |
104 | 106 | m_total_count->set_text ("0 cards"); |
105 | 107 | m_expired_count = 0; |
107 | 109 | void add_one () { m_expired_count++; } |
108 | 110 | }; |
109 | 111 | |
110 | int parse_xml_tree (const xmlpp::Node* node_); | |
112 | int parse_xml_tree (xmlDocPtr parser_, string error_msg_); | |
111 | 113 | void update_count (int idx_); |
112 | 114 | |
113 | 115 | /** Take an absolute path and absolute file name and calculate resultant |
145 | 147 | DeckPlayer* m_cdplayers [CARD_BOX_SIZE]; |
146 | 148 | }; |
147 | 149 | |
150 | inline CardBox:: | |
151 | ~CardBox () | |
152 | { | |
153 | trace_with_mask("CardBox::~CardBox",GUITRACE); | |
154 | } | |
155 | ||
148 | 156 | #endif /* CARD_BOX_H */ |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // CardDeck.cpp |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: CardDeck.cpp,v 1.16 2005/05/08 18:48:00 vlg Exp $ | |
4 | // $Id: CardDeck.cpp,v 1.18 2005/11/13 02:50:48 vlg Exp $ | |
5 | 5 | // |
6 | 6 | // Copyright (c) 2004 by Vladislav Grinchenko |
7 | 7 | // |
20 | 20 | #include "Granule-main.h" |
21 | 21 | #include "Intern.h" |
22 | 22 | |
23 | static const char* box_names[] = { | |
23 | static const char* box_names [] = | |
24 | { | |
24 | 25 | N_("Card Box 1"), N_("Card Box 2"), |
25 | 26 | N_("Card Box 3"), N_("Card Box 4"), |
26 | 27 | N_("Card Box 5") |
27 | 28 | }; |
29 | ||
28 | 30 | void |
29 | 31 | CardDeck:: |
30 | 32 | set_name (int idx_) |
41 | 43 | return (idx); |
42 | 44 | } |
43 | 45 | } |
44 | Assert_exit (false); | |
46 | Assure_exit (false); | |
45 | 47 | } |
46 | 48 | |
47 | 49 | bool |
49 | 51 | erase (VCard* vcard_) |
50 | 52 | { |
51 | 53 | trace_with_mask("CardDeck::erase(VCard)",GUITRACE|DECK); |
54 | ||
52 | 55 | cardlist_iterator p = m_cards.begin (); |
53 | 56 | while (p != m_cards.end ()) { |
54 | 57 | if ((*p) == vcard_) { |
63 | 66 | play_card (VDeck::cardlist_iterator& iter_) |
64 | 67 | { |
65 | 68 | CardRef* cref = dynamic_cast<CardRef*>(*iter_); |
66 | Assert_exit (cref); | |
69 | Assure_exit (cref); | |
67 | 70 | cref->get_deck ().play_card (iter_); |
68 | 71 | } |
69 | 72 | |
83 | 86 | while (q != m_cards.end ()) { |
84 | 87 | cr_p = dynamic_cast<CardRef*> (*p); |
85 | 88 | cr_q = dynamic_cast<CardRef*> (*q); |
86 | Assert_exit (cr_p && cr_q); | |
89 | Assure_exit (cr_p && cr_q); | |
87 | 90 | if (cr_p->get_card ().get_id () == cr_q->get_card ().get_id ()) { |
88 | 91 | delete (*q); |
89 | 92 | m_cards.erase (q); |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // CardDeck.h |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: CardDeck.h,v 1.14 2004/11/27 20:44:39 vlg Exp $ | |
4 | // $Id: CardDeck.h,v 1.16 2005/11/13 02:50:48 vlg Exp $ | |
5 | 5 | // |
6 | 6 | // Copyright (c) 2004 by Vladislav Grinchenko |
7 | 7 | // |
25 | 25 | class Compare_CardRefs { |
26 | 26 | public: |
27 | 27 | int operator () (VCard* const& vc1_, VCard* const& vc2_) |
28 | { | |
29 | CardRef* cr1 = dynamic_cast<CardRef*> (vc1_); | |
30 | CardRef* cr2 = dynamic_cast<CardRef*> (vc2_); | |
31 | Assert_exit (cr1 && cr2); | |
32 | return (cr1->get_card ().get_id () < cr2->get_card ().get_id ()); | |
33 | } | |
28 | { | |
29 | CardRef* cr1 = dynamic_cast<CardRef*> (vc1_); | |
30 | CardRef* cr2 = dynamic_cast<CardRef*> (vc2_); | |
31 | Assure_exit (cr1 && cr2); | |
32 | return (cr1->get_card ().get_id () < cr2->get_card ().get_id ()); | |
33 | } | |
34 | 34 | }; |
35 | 35 | |
36 | 36 | class Compare_ExpTime_CardRefs { |
37 | 37 | public: |
38 | 38 | int operator () (VCard* const& vc1_, VCard* const& vc2_) |
39 | { | |
40 | /* | |
41 | CardRef* cr1 = dynamic_cast<CardRef*> (vc1_); | |
42 | CardRef* cr2 = dynamic_cast<CardRef*> (vc2_); | |
43 | Assert_exit (cr1 && cr2); | |
44 | return (cr1->get_expiration () < cr2->get_expiration ()); | |
45 | */ | |
46 | return ((*vc1_) < (*vc2_)); | |
47 | } | |
39 | { | |
40 | return ((*vc1_) < (*vc2_)); | |
41 | } | |
48 | 42 | }; |
49 | 43 | |
50 | 44 | /** |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // CardView.cpp |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: CardView.cpp,v 1.21 2005/06/11 04:42:43 vlg Exp $ | |
4 | // $Id: CardView.cpp,v 1.28 2005/11/27 23:54:36 vlg Exp $ | |
5 | 5 | // |
6 | 6 | // Copyright (c) 2004-2005 by Vladislav Grinchenko |
7 | 7 | // |
30 | 30 | #include "DeckView.h" |
31 | 31 | #include "Card.h" |
32 | 32 | #include "CardRef.h" |
33 | #include "EditControls.h" | |
33 | 34 | #include "Intern.h" |
34 | 35 | |
35 | 36 | CardView:: |
42 | 43 | m_front_text (NULL), |
43 | 44 | m_back_text (NULL), |
44 | 45 | m_example_text (NULL), |
46 | m_edit_controls (NULL), | |
45 | 47 | m_syntax_error (false), |
46 | 48 | m_keep_open (false), |
47 | 49 | m_help_dialog (*this) |
245 | 247 | hbox5->pack_start (*label5, Gtk::PACK_SHRINK, 0); |
246 | 248 | alignment8->add (*hbox5); |
247 | 249 | |
248 | m_help_button->set_flags (Gtk::CAN_FOCUS); | |
250 | m_help_button->unset_flags (Gtk::CAN_FOCUS); // Take help off the chain | |
249 | 251 | m_help_button->set_relief (Gtk::RELIEF_NORMAL); |
250 | 252 | m_help_button->add (*alignment8); |
251 | 253 | |
262 | 264 | m_back_text->set_indent (0); |
263 | 265 | m_back_text->set_wrap_mode (Gtk::WRAP_WORD); |
264 | 266 | m_back_text->set_justification (Gtk::JUSTIFY_LEFT); |
267 | m_back_text->set_accepts_tab (false); | |
265 | 268 | m_back_text->get_buffer ()->set_text (_("Fill up the back of the card")); |
266 | 269 | |
267 | 270 | backtext_scrollwin->set_flags (Gtk::CAN_FOCUS); |
293 | 296 | m_example_text->set_indent (0); |
294 | 297 | m_example_text->set_wrap_mode (Gtk::WRAP_WORD); |
295 | 298 | m_example_text->set_justification (Gtk::JUSTIFY_LEFT); |
299 | m_example_text->set_accepts_tab (false); | |
296 | 300 | m_example_text->get_buffer ()->set_text (_("Fill up an example")); |
297 | 301 | |
298 | 302 | example_scrollwin->set_flags (Gtk::CAN_FOCUS); |
310 | 314 | example_label->set_selectable (false); |
311 | 315 | vbox_examplelabel->pack_start (*example_label, Gtk::PACK_SHRINK, 0); |
312 | 316 | |
313 | // Front Text | |
317 | /** Add EditControls | |
318 | */ | |
319 | m_edit_controls = Gtk::manage(new EditControls(m_front_text->get_buffer())); | |
320 | vbox_examplelabel->pack_end (*m_edit_controls, Gtk::PACK_SHRINK, 0); | |
321 | ||
322 | m_front_text->signal_grab_focus ().connect ( | |
323 | bind<Gtk::TextView*> (mem_fun (*m_edit_controls, | |
324 | &EditControls::on_focus_changed), | |
325 | m_front_text)); | |
326 | ||
327 | m_back_text->signal_grab_focus ().connect ( | |
328 | bind<Gtk::TextView*> (mem_fun (*m_edit_controls, | |
329 | &EditControls::on_focus_changed), | |
330 | m_back_text)); | |
331 | ||
332 | m_example_text->signal_grab_focus ().connect ( | |
333 | bind<Gtk::TextView*> (mem_fun (*m_edit_controls, | |
334 | &EditControls::on_focus_changed), | |
335 | m_example_text)); | |
336 | ||
337 | /** Front Text | |
338 | */ | |
314 | 339 | m_front_text->set_flags (Gtk::CAN_FOCUS); |
315 | 340 | m_front_text->set_border_width (3); |
316 | 341 | m_front_text->set_editable (true); |
323 | 348 | m_front_text->set_indent (0); |
324 | 349 | m_front_text->set_wrap_mode (Gtk::WRAP_WORD); |
325 | 350 | m_front_text->set_justification (Gtk::JUSTIFY_LEFT); |
351 | m_front_text->set_accepts_tab (false); | |
326 | 352 | m_front_text->get_buffer ()->set_text (_("Fill up the front of the card")); |
327 | 353 | |
328 | 354 | front_scrollwin->set_flags (Gtk::CAN_FOCUS); |
340 | 366 | front_label->set_selectable (false); |
341 | 367 | alignment6->add (*front_label); |
342 | 368 | vbox_frontlabel->pack_start (*alignment6, Gtk::PACK_SHRINK, 0); |
343 | ||
369 | ||
344 | 370 | /** |
345 | 371 | * Table holds elements together: |
346 | 372 | * |
351 | 377 | elems_table->set_border_width (4); |
352 | 378 | elems_table->set_row_spacings (8); |
353 | 379 | elems_table->set_col_spacings (2); |
380 | elems_table->set_name ("CardViewElemsTable"); | |
354 | 381 | |
355 | 382 | elems_table->attach (*vbox_frontlabel, 0, 1, 0, 1, |
356 | 383 | Gtk::FILL, Gtk::FILL, 0, 0); |
379 | 406 | hbuttonbox->set_homogeneous (); |
380 | 407 | hbuttonbox->set_spacing (8); |
381 | 408 | hbuttonbox->set_layout (Gtk::BUTTONBOX_END); |
409 | hbuttonbox->set_name ("CardView_CtrlButtonBox"); | |
382 | 410 | |
383 | 411 | hbuttonbox->pack_end (*m_cancel_button, false, false, 1); |
384 | 412 | hbuttonbox->pack_end (*m_add_button, false, false, 1); |
416 | 444 | m_example_text->get_buffer ()->set_text (m_card->get_example ()); |
417 | 445 | } |
418 | 446 | |
447 | /** Set Widget names - very helpful with debugging! | |
448 | */ | |
449 | m_front_text->set_name ("FrontText"); | |
450 | m_back_text ->set_name ("BackText"); | |
451 | m_example_text->set_name ("ExampleText"); | |
452 | m_help_button->set_name ("HelpButton"); | |
453 | m_cancel_button->set_name ("CancelButton"); | |
454 | m_add_button->set_name ("AddButton"); | |
455 | m_add_n_close_button->set_name ("AddNCloseButton"); | |
456 | ||
457 | vbox_all->set_name ("CardView_VBoxAll"); | |
458 | ||
419 | 459 | show_all_children (); |
420 | 460 | } |
421 | 461 | |
424 | 464 | //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
425 | 465 | |
426 | 466 | /** |
427 | * Called to just edit an existing card: | |
467 | * Called by the following methods to edit an existing card: | |
428 | 468 | * |
429 | 469 | * - DeckPlayer::on_vcard_edit_clicked () |
430 | 470 | * - DeckView::on_edit_clicked () |
431 | 471 | */ |
432 | 472 | int |
433 | 473 | CardView:: |
434 | run () | |
435 | { | |
436 | trace_with_mask("CardView::run",GUITRACE); | |
474 | run (bool disable_cancel_) | |
475 | { | |
476 | trace_with_mask("CardView::run(bool)",GUITRACE); | |
437 | 477 | |
438 | 478 | m_syntax_error = false; |
439 | 479 | m_add_button->set_sensitive (false); |
480 | if (disable_cancel_) { | |
481 | m_cancel_button->set_sensitive (false); | |
482 | } | |
483 | take_snapshot (); | |
440 | 484 | Gtk::Main::run (*this); |
441 | ||
442 | 485 | return (m_syntax_error ? Gtk::RESPONSE_REJECT : m_response); |
443 | 486 | } |
444 | 487 | |
463 | 506 | trace_with_mask("CardView::run(DeckView&)",GUITRACE); |
464 | 507 | int ret = 0; |
465 | 508 | m_syntax_error = false; |
509 | take_snapshot (); | |
466 | 510 | |
467 | 511 | Gtk::Main::run (*this); |
468 | 512 | |
469 | 513 | if (m_syntax_error) { |
514 | DL ((GRAPP,"Caught a syntax error (RESPONSE_REJECT)\n")); | |
470 | 515 | delete m_card; |
471 | 516 | return (Gtk::RESPONSE_REJECT); |
472 | 517 | } |
473 | 518 | |
474 | if (ret == Gtk::RESPONSE_CANCEL) { | |
519 | if (m_response == Gtk::RESPONSE_CANCEL) { | |
520 | DL ((GRAPP,"Dialog cancelled (RESPONSE_CANCEL)\n")); | |
475 | 521 | delete m_card; |
476 | 522 | return (m_response); |
477 | 523 | } |
539 | 585 | |
540 | 586 | m_response = Gtk::RESPONSE_OK; |
541 | 587 | |
542 | if (!check_markup (m_front_text->get_buffer ()->get_text ())) { | |
543 | Gtk::MessageDialog err1 (_("FRONT field contains illegal markup tag(s)."), | |
544 | false, Gtk::MESSAGE_ERROR); | |
588 | if (!Granule::check_markup (m_front_text->get_buffer ()->get_text ())) { | |
589 | Gtk::MessageDialog err1 ( | |
590 | _("FRONT field contains illegal markup tag(s)."), | |
591 | false, Gtk::MESSAGE_ERROR); | |
545 | 592 | err1.run (); |
546 | 593 | m_syntax_error = true; |
547 | 594 | return; |
548 | 595 | } |
549 | if (!check_markup (m_back_text->get_buffer ()->get_text ())) { | |
550 | Gtk::MessageDialog err2 (_("BACK field contains illegal markup tag(s)."), | |
551 | false, Gtk::MESSAGE_ERROR); | |
596 | ||
597 | if (!Granule::check_markup (m_back_text->get_buffer ()->get_text ())) { | |
598 | Gtk::MessageDialog err2 ( | |
599 | _("BACK field contains illegal markup tag(s)."), | |
600 | false, Gtk::MESSAGE_ERROR); | |
552 | 601 | err2.run (); |
553 | 602 | m_syntax_error = true; |
554 | 603 | return; |
555 | 604 | } |
556 | if (!check_markup (m_example_text->get_buffer ()->get_text ())) { | |
557 | Gtk::MessageDialog err2 (_("EXAMPLE field contains illegal markup tag(s)."), | |
558 | false, Gtk::MESSAGE_ERROR); | |
605 | ||
606 | if (!Granule::check_markup (m_example_text->get_buffer ()->get_text ())) { | |
607 | Gtk::MessageDialog err2 ( | |
608 | _("EXAMPLE field contains illegal markup tag(s)."), | |
609 | false, Gtk::MESSAGE_ERROR); | |
559 | 610 | err2.run (); |
560 | 611 | m_syntax_error = true; |
561 | 612 | return; |
563 | 614 | |
564 | 615 | /** Transfer data from the widget to the card |
565 | 616 | */ |
566 | if (m_card != NULL) { | |
617 | if (m_card != NULL && text_modified ()) { | |
567 | 618 | m_card->set_question (m_front_text ->get_buffer ()->get_text ()); |
568 | 619 | m_card->set_answer (m_back_text ->get_buffer ()->get_text ()); |
569 | 620 | m_card->set_example (m_example_text->get_buffer ()->get_text ()); |
570 | 621 | } |
571 | 622 | m_keep_open = false; |
623 | m_front_text->grab_focus (); | |
572 | 624 | |
573 | 625 | Gtk::Main::quit (); |
626 | } | |
627 | ||
628 | void | |
629 | CardView:: | |
630 | take_snapshot () | |
631 | { | |
632 | trace_with_mask("CardView::take_snapshot",GUITRACE); | |
633 | ||
634 | m_snapshot_front = m_front_text ->get_buffer ()->get_text (); | |
635 | m_snapshot_back = m_back_text ->get_buffer ()->get_text (); | |
636 | m_snapshot_example = m_example_text->get_buffer ()->get_text (); | |
637 | } | |
638 | ||
639 | bool | |
640 | CardView:: | |
641 | text_modified () | |
642 | { | |
643 | return (m_snapshot_front != m_front_text ->get_buffer ()->get_text () || | |
644 | m_snapshot_back != m_back_text ->get_buffer ()->get_text () || | |
645 | m_snapshot_example != m_example_text->get_buffer ()->get_text ()); | |
574 | 646 | } |
575 | 647 | |
576 | 648 | void |
601 | 673 | m_front_text ->get_buffer ()->set_text (""); |
602 | 674 | m_back_text ->get_buffer ()->set_text (""); |
603 | 675 | m_example_text->get_buffer ()->set_text (""); |
604 | } | |
605 | ||
606 | bool | |
607 | CardView:: | |
608 | check_markup (const Glib::ustring& str_) | |
609 | { | |
610 | PangoAttrList* attrs = NULL; | |
611 | gchar* ptext = NULL; | |
612 | gboolean ret = FALSE; | |
613 | ||
614 | ret = pango_parse_markup (str_.c_str (), -1, 0, &attrs, &ptext, NULL, NULL); | |
615 | ||
616 | g_free (attrs); | |
617 | g_free (ptext); | |
618 | ||
619 | return ret; | |
676 | ||
677 | m_snapshot_front = ""; | |
678 | m_snapshot_back = ""; | |
679 | m_snapshot_example = ""; | |
620 | 680 | } |
621 | 681 | |
622 | 682 | void |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // CardView.h |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: CardView.h,v 1.12 2005/06/11 04:42:43 vlg Exp $ | |
4 | // $Id: CardView.h,v 1.15 2005/11/27 04:59:22 vlg Exp $ | |
5 | 5 | // |
6 | 6 | // Copyright (c) 2004-2005 by Vladislav Grinchenko |
7 | 7 | // |
29 | 29 | |
30 | 30 | class VCard; |
31 | 31 | class DeckView; |
32 | class EditControls; | |
32 | 33 | |
33 | 34 | class CardView : public Gtk::Window |
34 | 35 | { |
44 | 45 | void size_allocate_cb (Gtk::Allocation& size_); |
45 | 46 | |
46 | 47 | /** Our own implementation of run(). |
48 | * | |
49 | * @param disable_cancel_ if true, disables cancel button. | |
47 | 50 | */ |
48 | int run (); | |
51 | int run (bool disable_cancel_ = false); | |
49 | 52 | |
50 | 53 | /** This run is called by DeckView to add a new card |
51 | 54 | (or multiple cards without closing the dialog) |
52 | 55 | */ |
53 | 56 | int run (DeckView& deckview_); |
57 | ||
58 | private: | |
59 | class Snapshot | |
60 | { | |
61 | ||
62 | private: | |
63 | }; | |
54 | 64 | |
55 | 65 | private: |
56 | 66 | virtual bool on_key_press_event (GdkEventKey* event_); |
60 | 70 | void on_help_clicked (); |
61 | 71 | void on_cancel_clicked (); |
62 | 72 | |
63 | bool check_markup (const Glib::ustring& str_); | |
64 | 73 | void clear_dialog (); |
74 | ||
75 | void take_snapshot (); | |
76 | bool text_modified (); | |
65 | 77 | |
66 | 78 | private: |
67 | 79 | VCard* m_card; |
80 | 92 | Gtk::TextView* m_back_text; |
81 | 93 | Gtk::TextView* m_example_text; |
82 | 94 | |
95 | // -*- Snapshot to detect true changes -*- | |
96 | Glib::ustring m_snapshot_front; | |
97 | Glib::ustring m_snapshot_back; | |
98 | Glib::ustring m_snapshot_example; | |
99 | ||
100 | EditControls* m_edit_controls; | |
101 | ||
83 | 102 | CardViewHelpDialog m_help_dialog; |
84 | 103 | }; |
85 | 104 |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // Config.cpp |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: Config.cpp,v 1.34 2005/05/08 19:39:44 vlg Exp $ | |
4 | // $Id: Config.cpp,v 1.37 2005/11/22 01:39:53 vlg Exp $ | |
5 | 5 | //------------------------------------------------------------------------------ |
6 | 6 | // Copyright (c) 2004-2005 by Vladislav Grinchenko |
7 | 7 | // |
36 | 36 | #include "Granule.h" |
37 | 37 | |
38 | 38 | using namespace ASSA; |
39 | using ASSA::Utils::split_pair; | |
39 | 40 | |
40 | 41 | ASSA_DECL_SINGLETON(Config); |
41 | 42 | |
46 | 47 | int secs_in_day_, |
47 | 48 | int secs_in_week_) |
48 | 49 | { |
50 | ASSA::TimeVal hhmm (::atoi (m_hours.c_str ()) * 360 + | |
51 | ::atoi (m_mins.c_str ()) * 60); | |
49 | 52 | m_tv = load_time_ + |
50 | 53 | ASSA::TimeVal (::atoi (m_days.c_str ()) * secs_in_day_) + |
51 | ASSA::TimeVal (::atoi (m_weeks.c_str ()) * secs_in_week_); | |
54 | ASSA::TimeVal (::atoi (m_weeks.c_str ()) * secs_in_week_) + | |
55 | hhmm; | |
52 | 56 | } |
53 | 57 | |
54 | 58 | /******************************************************************************/ |
56 | 60 | SchedReview:: |
57 | 61 | dump (int idx_) |
58 | 62 | { |
59 | DL((GRAPP,"Deck %d sched = %s/%s (%ld secs : %s)\n", idx_, | |
60 | m_days.c_str (), m_weeks.c_str (), | |
63 | DL((GRAPP,"Deck %d sched = %s/%s/%s/%s (%ld secs : %s)\n", idx_, | |
64 | m_weeks.c_str (), m_days.c_str (), m_hours.c_str (), m_mins.c_str (), | |
61 | 65 | m_tv.sec (), m_tv.fmtString ("%c").c_str ())); |
62 | ||
63 | 66 | } |
64 | 67 | |
65 | 68 | /******************************************************************************/ |
87 | 90 | */ |
88 | 91 | char* ptr = NULL; |
89 | 92 | ptr = new char [PATH_MAX+1]; |
90 | Assert_exit (getcwd (ptr, PATH_MAX) != NULL); | |
93 | Assure_exit (getcwd (ptr, PATH_MAX) != NULL); | |
91 | 94 | m_path_name = ptr; |
92 | 95 | delete [] ptr; |
93 | 96 | |
258 | 261 | * {front|back}<index>=/path/to/file |
259 | 262 | * |
260 | 263 | * [Scheduling] |
261 | * 1=7/0 | |
262 | * 2=0/1 | |
263 | * 3=0/2 | |
264 | * 4=0/3 | |
265 | * 5=0/4 | |
264 | * 1=7/0/0/0 | |
265 | * 2=0/1/0/0 | |
266 | * 3=0/2/0/0 | |
267 | * 4=0/3/0/0 | |
268 | * 5=0/4/0/0 | |
266 | 269 | * |
267 | 270 | * [Default] |
268 | 271 | * filesel_path=/path/to/ |
295 | 298 | IniFile::const_config_iterator section; |
296 | 299 | |
297 | 300 | if (m_config == NULL) { |
298 | s = GRANULE->getAltConfigName (); | |
301 | s = GRANULE->get_config_file (); | |
299 | 302 | if (s.size () == 0) { |
300 | s = GRANULE->getStdConfigName (); | |
303 | s = GRANULE->get_default_config_file (); | |
301 | 304 | } |
302 | 305 | m_config = new IniFile (s); |
303 | 306 | if (m_config->load () < 0) { |
348 | 351 | DL((APP,"Section [FlipSide] was not found in \"~/.granule\".\n")); |
349 | 352 | } |
350 | 353 | |
351 | /** Load [Scheduling] section: | |
354 | /** Load [Scheduling] section. | |
355 | We have to detect and convert old format: | |
356 | ||
357 | old: days/weeks | |
358 | new: weeks/days/hours/minutes | |
352 | 359 | */ |
353 | 360 | section = m_config->find_section ("Scheduling"); |
361 | ||
354 | 362 | if (section != m_config->sect_end ()) { |
355 | 363 | DL((APP,"Scanning [History] section ...\n")); |
356 | 364 | IniFile::const_tuple_iterator k = (*section).second.begin (); |
365 | std::string lhs; | |
366 | std::string rhs; | |
367 | ||
357 | 368 | while (k != (*section).second.end ()) { |
358 | 369 | idx = ::atoi ((*k).first.c_str ()) - 1; |
359 | ASSA::Utils::split_pair ((*k).second, | |
360 | '/', | |
361 | m_sched [idx].m_days, | |
362 | m_sched [idx].m_weeks); | |
370 | split_pair ((*k).second, '/', | |
371 | m_sched [idx].m_days, m_sched [idx].m_weeks); | |
372 | ||
373 | if (split_pair (m_sched [idx].m_weeks, '/', lhs, rhs) == 0) { | |
374 | m_sched [idx].m_weeks = m_sched [idx].m_days; | |
375 | m_sched [idx].m_days = lhs; | |
376 | m_sched [idx].m_hours = rhs; | |
377 | split_pair (m_sched [idx].m_hours, '/', lhs, rhs); | |
378 | m_sched [idx].m_hours = lhs; | |
379 | m_sched [idx].m_mins = rhs; | |
380 | } | |
363 | 381 | m_sched [idx].set_delay (m_load_time, secs_in_day_, secs_in_week_); |
364 | 382 | m_sched [idx].dump (idx); |
365 | 383 | k++; |
458 | 476 | |
459 | 477 | m_root_x = ::atoi (m_config->get_value ("Default", "root_x").c_str ()); |
460 | 478 | m_root_y = ::atoi (m_config->get_value ("Default", "root_y").c_str ()); |
479 | ||
480 | if (m_config->get_value ("Default", "disable_key_shortcuts") == "true") { | |
481 | m_disable_key_shortcuts = true; | |
482 | } | |
483 | else { | |
484 | m_disable_key_shortcuts = false; | |
485 | } | |
461 | 486 | } |
462 | 487 | |
463 | 488 | /****************************************************************************** |
472 | 497 | std::string s; |
473 | 498 | |
474 | 499 | if (m_config == NULL) { |
475 | s = GRANULE->getAltConfigName (); | |
500 | s = GRANULE->get_config_file (); | |
476 | 501 | if (s.size () == 0) { |
477 | s = GRANULE->getStdConfigName (); | |
502 | s = GRANULE->get_default_config_file (); | |
478 | 503 | } |
479 | 504 | m_config = new IniFile (s); |
480 | 505 | s = ""; |
519 | 544 | ckey << (j + 1); |
520 | 545 | m_config->set_pair ("Scheduling", |
521 | 546 | IniFile::tuple_type (ckey.str (), |
522 | m_sched [j].m_days + '/' + m_sched [j].m_weeks)); | |
547 | m_sched [j].m_weeks + '/' + | |
548 | m_sched [j].m_days + '/' + | |
549 | m_sched [j].m_hours + '/' + | |
550 | m_sched [j].m_mins)); | |
523 | 551 | } |
524 | 552 | |
525 | 553 | /** Flip the side so that next time it would be the back of the Deck. |
592 | 620 | sprintf (buf, "%d", m_root_y); |
593 | 621 | m_config->set_pair ("Default", IniFile::tuple_type ("root_y", buf)); |
594 | 622 | |
623 | m_config->set_pair ("Default", IniFile::tuple_type ("disable_key_shortcuts", | |
624 | (m_disable_key_shortcuts ? "true":"false"))); | |
595 | 625 | /** Flush to disk |
596 | 626 | */ |
597 | 627 | m_config->sync (); |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // Config.h |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: Config.h,v 1.26 2005/01/16 22:14:46 vlg Exp $ | |
5 | //------------------------------------------------------------------------------ | |
6 | // Copyright (c) 2004 by Vladislav Grinchenko | |
4 | // $Id: Config.h,v 1.29 2005/11/22 01:39:53 vlg Exp $ | |
5 | //------------------------------------------------------------------------------ | |
6 | // Copyright (c) 2004,2005 by Vladislav Grinchenko | |
7 | 7 | // |
8 | 8 | // This program is free software; you can redistribute it and/or |
9 | 9 | // modify it under the terms of the GNU General Public License |
36 | 36 | { |
37 | 37 | string m_days; // number of days |
38 | 38 | string m_weeks; // number of weeks |
39 | string m_hours; | |
40 | string m_mins; | |
41 | ||
42 | SchedReview () : m_days ("0"), m_weeks ("0"), m_hours ("0"), m_mins ("0") | |
43 | { /* no-op */ } | |
44 | ||
39 | 45 | ASSA::TimeVal m_tv; // time in seconds |
40 | 46 | |
41 | string days () const { return m_days; } | |
42 | string weeks () const { return m_weeks; } | |
43 | void days (const string& d_) { m_days = d_; } | |
44 | void weeks (const string& w_) { m_weeks = w_; } | |
45 | ||
46 | void set_delay (const ASSA::TimeVal& load_time_, | |
47 | int secs_in_day_, | |
48 | int secs_in_week_); | |
49 | void dump (int idx_); | |
47 | string days () const { return m_days; } | |
48 | string weeks () const { return m_weeks; } | |
49 | string hours () const { return m_hours; } | |
50 | string mins () const { return m_mins; } | |
51 | ||
52 | void days (const string& d_) { m_days = d_; } | |
53 | void weeks (const string& w_) { m_weeks = w_; } | |
54 | void hours (const string& h_) { m_hours = h_; } | |
55 | void mins (const string& m_) { m_mins = m_; } | |
56 | ||
57 | void set_delay (const ASSA::TimeVal& load_time_, | |
58 | int secs_in_day_, | |
59 | int secs_in_week_); | |
60 | void dump (int idx_); | |
50 | 61 | }; |
51 | 62 | |
52 | 63 | class Config : public ASSA::Singleton<Config> |
96 | 107 | */ |
97 | 108 | string get_sched_review_days (int idx_) { return m_sched [idx_].days (); } |
98 | 109 | string get_sched_review_weeks (int idx_) { return m_sched [idx_].weeks (); } |
99 | ||
100 | void set_sched_review_days (int idx_, const string& s_) { | |
101 | m_sched [idx_].days (s_); | |
102 | } | |
103 | void set_sched_review_weeks (int idx_, const string& s_) { | |
104 | m_sched [idx_].weeks (s_); | |
105 | } | |
110 | string get_sched_review_hours (int idx_) { return m_sched [idx_].hours (); } | |
111 | string get_sched_review_mins (int idx_) { return m_sched [idx_].mins (); } | |
112 | ||
113 | void set_sched_review_days (int idx_, const string& s_); | |
114 | void set_sched_review_weeks (int idx_, const string& s_); | |
115 | void set_sched_review_hours (int idx_, const string& s_); | |
116 | void set_sched_review_mins (int idx_, const string& s_); | |
106 | 117 | |
107 | 118 | /// Return timestamp when the program was started. |
108 | 119 | ASSA::TimeVal get_load_time () const { return m_load_time; } |
166 | 177 | /// Dump object's state |
167 | 178 | void dump () const; |
168 | 179 | void dump_document_history () const; |
180 | ||
181 | /** If true, ignore key_press events in DeckPlayer. This allows | |
182 | IM with conflicting key strokes to be still functional. | |
183 | */ | |
184 | bool disable_key_shortcuts () const { return m_disable_key_shortcuts; } | |
185 | void disable_key_shortcuts (bool b_) { m_disable_key_shortcuts = b_; } | |
169 | 186 | |
170 | 187 | private: |
171 | 188 | Config (const Config&); // copy constructor |
214 | 231 | int m_secs_in_week; // Seconds in a week |
215 | 232 | int m_root_x; // X-coordinate of MainWindow on desktop |
216 | 233 | int m_root_y; // Y-coordinate of MainWindow on desktop |
234 | bool m_disable_key_shortcuts; // No keyboard navigation | |
217 | 235 | }; |
218 | 236 | |
219 | 237 | // Global locator |
220 | 238 | |
221 | #define CONFIG Config::getInstance() | |
239 | #define CONFIG Config::get_instance() | |
222 | 240 | |
223 | 241 | //------------------------------------------------------------------------------ |
224 | 242 | // Inlines |
299 | 317 | { |
300 | 318 | return (m_sched [idx_].m_tv); |
301 | 319 | } |
320 | ||
321 | inline void Config::set_sched_review_days (int idx_, const string& s_) | |
322 | { | |
323 | m_sched [idx_].days (s_); | |
324 | } | |
325 | ||
326 | inline void Config::set_sched_review_weeks (int idx_, const string& s_) | |
327 | { | |
328 | m_sched [idx_].weeks (s_); | |
329 | } | |
330 | ||
331 | inline void Config::set_sched_review_hours (int idx_, const string& s_) | |
332 | { | |
333 | m_sched [idx_].hours (s_); | |
334 | } | |
335 | ||
336 | inline void Config::set_sched_review_mins (int idx_, const string& s_) | |
337 | { | |
338 | m_sched [idx_].mins (s_); | |
339 | } | |
302 | 340 | |
303 | 341 | #endif /* CONFIG_H */ |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // Deck.cpp |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: Deck.cpp,v 1.39 2005/06/17 03:09:31 vlg Exp $ | |
4 | // $Id: Deck.cpp,v 1.41 2005/11/13 02:50:48 vlg Exp $ | |
5 | 5 | // |
6 | // Copyright (c) 2004 by Vladislav Grinchenko | |
6 | // Copyright (c) 2004-2005 by Vladislav Grinchenko | |
7 | 7 | // |
8 | 8 | // This program is free software; you can redistribute it and/or |
9 | 9 | // modify it under the terms of the GNU General Public License |
33 | 33 | |
34 | 34 | /** Compare real cards by their IDs |
35 | 35 | */ |
36 | class Compare_Cards { | |
36 | class Compare_Cards | |
37 | { | |
37 | 38 | public: |
38 | 39 | int operator () (VCard* const& vc1_, VCard* const& vc2_) |
39 | { | |
40 | Card* cr1 = dynamic_cast<Card*> (vc1_); | |
41 | Card* cr2 = dynamic_cast<Card*> (vc2_); | |
42 | Assert_exit (cr1 && cr2); | |
43 | return (cr1->get_id () < cr2->get_id ()); | |
44 | } | |
40 | { | |
41 | Card* cr1 = dynamic_cast<Card*> (vc1_); | |
42 | Card* cr2 = dynamic_cast<Card*> (vc2_); | |
43 | Assure_exit (cr1 && cr2); | |
44 | return (cr1->get_id () < cr2->get_id ()); | |
45 | } | |
45 | 46 | }; |
46 | 47 | |
47 | 48 | /** C'tor for the new deck |
65 | 66 | dump_deck_status (); |
66 | 67 | } |
67 | 68 | |
69 | int | |
70 | Deck:: | |
71 | load (const string& fname_, DeckAction action_) | |
72 | { | |
73 | trace_with_mask("Deck::load",GUITRACE|DECK); | |
74 | DL((DECK|APP,"Loading \"%s\" ...\n", fname_.c_str ())); | |
75 | ||
76 | string error_msg; | |
77 | xmlParserCtxtPtr context; | |
78 | xmlDocPtr parser; | |
79 | ||
80 | context = xmlCreateFileParserCtxt (fname_.c_str ()); // new | |
81 | ||
82 | if (!context) { | |
83 | DL((GRAPP,"Failed to parse \"%s\"\n", fname_.c_str ())); | |
84 | DECKMGR->on_deck_loaded (this, LOAD_FAILED); | |
85 | xmlFreeParserCtxt (context); | |
86 | return -1; | |
87 | } | |
88 | // Initialize context | |
89 | context->linenumbers = 1; | |
90 | context->validate = 1; | |
91 | ||
92 | //Tell the validity context about the callbacks: | |
93 | //(These are only called if validation is on - see above) | |
94 | // | |
95 | // context->vctxt.error = &callback_validity_error; | |
96 | // context->vctxt.warning = &callback_validity_warning; | |
97 | ||
98 | context->replaceEntities = 1; | |
99 | ||
100 | // Parse the document | |
101 | xmlParseDocument (context); | |
102 | ||
103 | if(!context->wellFormed) { | |
104 | xmlFreeParserCtxt (context); | |
105 | return -1; | |
106 | } | |
107 | if (context->errNo != 0) { | |
108 | xmlFreeParserCtxt (context); | |
109 | return -1; | |
110 | } | |
111 | parser = context->myDoc; | |
112 | xmlFreeParserCtxt (context); // not needed anymore? | |
113 | ||
114 | if (action_ == INSTALL_DECK) { | |
115 | m_fname = fname_; | |
116 | } | |
117 | ||
118 | DL((GRAPP,"Parsing the deck ...\n")); | |
119 | ||
120 | if (parse_xml_tree (parser, error_msg) < 0) { | |
121 | DECKMGR->on_deck_loaded (this, LOAD_FAILED); | |
122 | Gtk::MessageDialog emsg (error_msg, MESSAGE_ERROR); | |
123 | emsg.run (); | |
124 | xmlFreeDoc (parser); | |
125 | return -1; | |
126 | } | |
127 | ||
128 | if (action_ == INSTALL_DECK) { | |
129 | DECKMGR->on_deck_loaded (this, LOAD_OK); | |
130 | } | |
131 | m_status = CLEAN_DECK; | |
132 | dump_deck_status (); | |
133 | ||
134 | xmlFreeDoc (parser); | |
135 | return 0; | |
136 | } | |
137 | ||
138 | int | |
139 | Deck:: | |
140 | parse_xml_tree (xmlDocPtr parser_, std::string& error_msg_) | |
141 | { | |
142 | trace_with_mask("Deck::parse_xml_tree",GUITRACE|DECK); | |
143 | ||
144 | char xpath [64]; | |
145 | xmlChar* result; | |
146 | Card* card; | |
147 | std::ostringstream os; | |
148 | ||
149 | result = Granule::get_node_by_xpath (parser_, "/deck/author"); | |
150 | if (result) { | |
151 | m_author = (const char*) result; | |
152 | xmlFree (result); | |
153 | } | |
154 | ||
155 | result = Granule::get_node_by_xpath (parser_, "/deck/description"); | |
156 | if (result) { | |
157 | m_desc = (const char*) result; | |
158 | xmlFree (result); | |
159 | } | |
160 | ||
161 | result = Granule::get_node_by_xpath (parser_, "/deck/sound_path"); | |
162 | if (result) { | |
163 | m_snd_path = Glib::locale_from_utf8 ((const char*) result); | |
164 | xmlFree (result); | |
165 | } | |
166 | ||
167 | struct stat st; | |
168 | if (::stat (m_snd_path.c_str (), &st) != 0 || !S_ISDIR (st.st_mode)) { | |
169 | DL((APP,"Running with sound disabled\n")); | |
170 | DL((APP,"Path \"%s\" is wrong or non-existent\n",m_snd_path.c_str ())); | |
171 | m_with_snd = false; | |
172 | } | |
173 | dump (); | |
174 | ||
175 | /** Load the cards | |
176 | */ | |
177 | for (int cards_counter = 1; ; cards_counter++) { | |
178 | sprintf (xpath, "/deck/card[%d]", cards_counter); | |
179 | ||
180 | result = Granule::get_node_by_xpath (parser_, xpath); | |
181 | if (result == NULL) { | |
182 | break; | |
183 | } | |
184 | /** Detected new card | |
185 | */ | |
186 | card = new Card; | |
187 | ||
188 | sprintf (xpath, "/deck/card[%d]/@id", cards_counter); | |
189 | result = Granule::get_node_by_xpath (parser_, xpath); | |
190 | if (result == NULL) { | |
191 | os << "id is missing in card # " << cards_counter | |
192 | << "\nof the deck " << m_fname; | |
193 | error_msg_ = os.str (); | |
194 | return -1; | |
195 | } | |
196 | card->set_id (::atol ((const char*) result+1)); | |
197 | xmlFree (result); | |
198 | ||
199 | sprintf (xpath, "/deck/card[%d]/front", cards_counter); | |
200 | result = Granule::get_node_by_xpath (parser_, xpath); | |
201 | if (result == NULL) { | |
202 | os << "<front> tag is missing in card # " << cards_counter | |
203 | << "\nof the deck " << m_fname; | |
204 | error_msg_ = os.str (); | |
205 | return -1; | |
206 | } | |
207 | card->set_question ((const char*) result); | |
208 | xmlFree (result); | |
209 | ||
210 | sprintf (xpath, "/deck/card[%d]/back", cards_counter); | |
211 | result = Granule::get_node_by_xpath (parser_, xpath); | |
212 | if (result == NULL) { | |
213 | os << "<back> tag is missing in card # " << cards_counter | |
214 | << "\nof the deck " << m_fname; | |
215 | error_msg_ = os.str (); | |
216 | return -1; | |
217 | } | |
218 | card->set_answer ((const char*) result); | |
219 | xmlFree (result); | |
220 | ||
221 | /** back_example node might be empty - thus non-critical. | |
222 | */ | |
223 | sprintf (xpath, "/deck/card[%d]/back_example", cards_counter); | |
224 | result = Granule::get_node_by_xpath (parser_, xpath); | |
225 | if (result) { | |
226 | card->set_example ((const char*) result); | |
227 | xmlFree (result); | |
228 | } | |
229 | card->mark_clean (); | |
230 | m_cards.push_back (card); | |
231 | card->dump (); | |
232 | } | |
233 | ||
234 | if (m_cards.size () == 0) { | |
235 | error_msg_ = "No cards found"; | |
236 | return -1; | |
237 | } | |
238 | ||
239 | DL((GRAPP,"Processed %d cards\n", m_cards.size ())); | |
240 | return 0; | |
241 | } | |
242 | ||
68 | 243 | void |
69 | 244 | Deck:: |
70 | load (const string& fname_, DeckAction action_) | |
71 | { | |
72 | trace_with_mask("Deck::load",GUITRACE|DECK); | |
73 | ||
74 | DL((DECK|APP,"Loading \"%s\" ...\n", fname_.c_str ())); | |
75 | ||
76 | /** Load the Deck in XML format | |
77 | */ | |
78 | try { | |
79 | xmlpp::DomParser parser; | |
80 | parser.set_validate (); | |
81 | parser.parse_file (fname_); | |
82 | if (!parser) { | |
83 | DL((GRAPP,"Failed to parse \"%s\"\n", fname_.c_str ())); | |
84 | DECKMGR->on_deck_loaded (this, LOAD_FAILED); | |
85 | return; | |
86 | } | |
87 | if (action_ == INSTALL_DECK) { | |
88 | m_fname = fname_; | |
89 | } | |
90 | ||
91 | /** Root node is managed by the parser | |
92 | */ | |
93 | DL((GRAPP,"Parsing the deck ...\n")); | |
94 | const xmlpp::Node* root_node = parser.get_document ()->get_root_node (); | |
95 | Assert_exit (root_node); | |
96 | parse_xml_tree (root_node); | |
97 | ||
98 | if (action_ == INSTALL_DECK) { | |
99 | DECKMGR->on_deck_loaded (this, LOAD_OK); | |
100 | } | |
101 | m_status = CLEAN_DECK; | |
102 | dump_deck_status (); | |
103 | } | |
104 | catch (const std::exception& ex_) { | |
105 | DL ((GRAPP,"Caught XML parsing exception!\n")); | |
106 | DECKMGR->on_deck_loaded (this, LOAD_FAILED); | |
107 | return; | |
108 | } | |
109 | } | |
110 | ||
111 | void | |
112 | Deck:: | |
113 | 245 | insert (const string& from_fname_) |
114 | 246 | { |
115 | 247 | trace_with_mask("Deck::insert",GUITRACE|DECK); |
248 | ||
249 | Card* cr_p = NULL; | |
250 | Card* cr_q = NULL; | |
116 | 251 | |
117 | 252 | load (from_fname_, ADD_TO_DECK); |
118 | 253 | m_status = MODIFIED_DECK; |
119 | 254 | |
120 | /** | |
121 | * Wack duplicates | |
122 | */ | |
123 | Card* cr_p; | |
124 | Card* cr_q; | |
125 | ||
255 | /** Wack duplicates | |
256 | */ | |
126 | 257 | std::sort (m_cards.begin (), m_cards.end (), Compare_Cards ()); |
127 | 258 | cardlist_iterator p = m_cards.begin (); |
128 | 259 | cardlist_iterator q = p + 1; |
260 | ||
129 | 261 | while (q != m_cards.end ()) { |
130 | 262 | cr_p = dynamic_cast<Card*> (*p); |
131 | 263 | cr_q = dynamic_cast<Card*> (*q); |
132 | Assert_exit (cr_p && cr_q); | |
264 | Assure_exit (cr_p && cr_q); | |
133 | 265 | if (cr_p->get_id () == cr_q->get_id ()) { |
134 | 266 | delete (*q); |
135 | 267 | m_cards.erase (q); |
242 | 374 | return true; |
243 | 375 | } |
244 | 376 | |
245 | void | |
246 | Deck:: | |
247 | parse_xml_tree (const xmlpp::Node* node_) | |
248 | { | |
249 | trace_with_mask("Deck::traverse_xml_tree",GUITRACE|DECK); | |
250 | ||
251 | char xpath [64]; | |
252 | const xmlpp::TextNode* text_node; | |
253 | const xmlpp::Attribute* attr_node; | |
254 | string id; | |
255 | xmlpp::NodeSet nset; | |
256 | xmlpp::NodeSet::iterator nset_iter; | |
257 | Card* card; | |
258 | ||
259 | nset = node_->find ("/deck/author/text()"); | |
260 | if ((nset_iter = nset.begin ()) != nset.end ()) { | |
261 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
262 | if (text_node) { | |
263 | m_author = text_node->get_content (); | |
264 | } | |
265 | } | |
266 | ||
267 | nset = node_->find ("/deck/description/text()"); | |
268 | if ((nset_iter = nset.begin ()) != nset.end ()) { | |
269 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
270 | if (text_node) { | |
271 | m_desc = text_node->get_content (); | |
272 | } | |
273 | } | |
274 | ||
275 | nset = node_->find ("/deck/sound_path/text()"); | |
276 | Assert_exit ((nset_iter = nset.begin ()) != nset.end ()); | |
277 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
278 | Assert_exit (text_node); | |
279 | m_snd_path = Glib::locale_from_utf8 (text_node->get_content ()); | |
280 | ||
281 | struct stat st; | |
282 | if (::stat (m_snd_path.c_str (), &st) != 0 || !S_ISDIR (st.st_mode)) { | |
283 | DL((APP,"Running with sound disabled\n")); | |
284 | DL((APP,"Path \"%s\" is wrong/non-existed\n",m_snd_path.c_str ())); | |
285 | m_with_snd = false; | |
286 | } | |
287 | dump (); | |
288 | ||
289 | for (int cards_counter = 1; ; cards_counter++) { | |
290 | sprintf (xpath, "/deck/card[%d]", cards_counter); | |
291 | nset = node_->find (xpath); | |
292 | if ((nset_iter = nset.begin ()) == nset.end ()) { | |
293 | break; | |
294 | } | |
295 | card = new Card; | |
296 | ||
297 | sprintf (xpath, "/deck/card[%d]/@id", cards_counter); | |
298 | nset = node_->find (xpath); | |
299 | Assert_exit ((nset_iter = nset.begin ()) != nset.end ()); | |
300 | attr_node = dynamic_cast<const xmlpp::Attribute*> (*nset_iter); | |
301 | Assert_exit (attr_node); | |
302 | id = (attr_node->get_value ()).substr (1); | |
303 | card->set_id (::atol (id.c_str ())); | |
304 | ||
305 | sprintf (xpath, "/deck/card[%d]/front/text()", cards_counter); | |
306 | nset = node_->find (xpath); | |
307 | Assert_exit ((nset_iter = nset.begin ()) != nset.end ()); | |
308 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
309 | Assert_exit (text_node); | |
310 | card->set_question (text_node->get_content ()); | |
311 | ||
312 | sprintf (xpath, "/deck/card[%d]/back/text()", cards_counter); | |
313 | nset = node_->find (xpath); | |
314 | Assert_exit ((nset_iter = nset.begin ()) != nset.end ()); | |
315 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
316 | Assert_exit (text_node); | |
317 | card->set_answer (text_node->get_content ()); | |
318 | ||
319 | /** back_example clause might be empty - thus non-critical. | |
320 | */ | |
321 | sprintf (xpath, "/deck/card[%d]/back_example/text()", cards_counter); | |
322 | nset = node_->find (xpath); | |
323 | nset_iter = nset.begin (); | |
324 | if (nset_iter != nset.end ()) { | |
325 | text_node = dynamic_cast<const xmlpp::TextNode*> (*nset_iter); | |
326 | if (text_node) { | |
327 | card->set_example (text_node->get_content ()); | |
328 | } | |
329 | } | |
330 | ||
331 | card->mark_clean (); | |
332 | m_cards.push_back (card); | |
333 | card->dump (); | |
334 | } | |
335 | DL((ASSA::APP,"Processed %d cards\n", m_cards.size ())); | |
336 | } | |
337 | ||
338 | 377 | bool |
339 | 378 | Deck:: |
340 | 379 | erase (VCard* vcard_) |
342 | 381 | trace_with_mask("Deck::erase",GUITRACE|DECK); |
343 | 382 | |
344 | 383 | cardlist_iterator pos; |
345 | Assert_exit (vcard_); | |
384 | Assure_exit (vcard_); | |
346 | 385 | |
347 | 386 | pos = find (m_cards.begin (), m_cards.end (), vcard_); |
348 | 387 | if (pos != m_cards.end ()) { |
375 | 414 | Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, |
376 | 415 | true); |
377 | 416 | qm.add_button ("Yes", Gtk::RESPONSE_YES); |
378 | qm.add_button ("No", Gtk::RESPONSE_NO); | |
417 | qm.add_button ("No", Gtk::RESPONSE_NO); | |
379 | 418 | if (qm.run () == Gtk::RESPONSE_NO) { |
380 | 419 | return -1; |
381 | 420 | } |
402 | 441 | { |
403 | 442 | trace_with_mask("Deck::save",GUITRACE|DECK); |
404 | 443 | |
405 | xmlpp::Document deck_xml; | |
406 | xmlpp::Element* deck_node; | |
407 | xmlpp::Element* card_node; | |
408 | xmlpp::Element* element; | |
409 | xmlpp::TextNode* txt_node; | |
444 | static const char dtd_url [] = "http://granule.sourceforge.net/granule.dtd"; | |
445 | int ret = 0; | |
446 | xmlTextWriterPtr writer; | |
410 | 447 | |
411 | 448 | ::unlink (m_fname.c_str ()); |
412 | deck_xml.set_internal_subset ("deck", "", "http://granule.sourceforge.net/granule.dtd"); | |
413 | deck_node = deck_xml.create_root_node ("deck"); | |
414 | ||
415 | element = deck_node->add_child ("author"); | |
416 | txt_node = element->add_child_text (m_author); | |
417 | ||
418 | element = deck_node->add_child ("description"); | |
419 | txt_node = element->add_child_text (m_desc); | |
420 | ||
421 | element = deck_node->add_child ("sound_path"); | |
422 | txt_node = element->add_child_text (Glib::locale_to_utf8 (m_snd_path)); | |
449 | ||
450 | writer = xmlNewTextWriterFilename (m_fname.c_str (), 0); | |
451 | if (writer == NULL) { | |
452 | return -1; | |
453 | } | |
454 | ||
455 | ret = xmlTextWriterStartDocument (writer, NULL, "UTF-8", NULL); | |
456 | if (ret < 0) { | |
457 | xmlFreeTextWriter (writer); | |
458 | return -1; | |
459 | } | |
460 | ||
461 | /** We have to disable indent prior to StartDTD call and | |
462 | enable it back again before EndDTD call to generate expected | |
463 | indentation of XML file. Oddly enough, xmlTextWriterWriteDTD() | |
464 | doesn't do the right thing itself. | |
465 | */ | |
466 | xmlTextWriterSetIndent (writer, 0); | |
467 | xmlTextWriterStartDTD (writer, BAD_CAST "deck", NULL, BAD_CAST dtd_url); | |
468 | xmlTextWriterSetIndent (writer, 1); | |
469 | xmlTextWriterEndDTD (writer); | |
470 | ||
471 | xmlTextWriterSetIndentString (writer, (xmlChar*) " "); | |
472 | ||
473 | ret = xmlTextWriterStartElement (writer, BAD_CAST "deck"); | |
474 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "author", | |
475 | BAD_CAST m_author.c_str ()); | |
476 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "description", | |
477 | BAD_CAST m_desc.c_str ()); | |
478 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "sound_path", | |
479 | BAD_CAST Glib::locale_to_utf8 (m_snd_path).c_str ()); | |
423 | 480 | |
424 | 481 | cardlist_const_iterator citer = m_cards.begin (); |
425 | 482 | while (citer != m_cards.end ()) { |
426 | card_node = deck_node->add_child ("card"); | |
427 | card_node->set_attribute ("id", (*citer)->get_id_str ()); | |
428 | ||
429 | element = card_node->add_child ("front"); | |
430 | txt_node = element->add_child_text ((*citer)->get_question ()); | |
431 | ||
432 | element = card_node->add_child ("back"); | |
433 | txt_node = element->add_child_text ((*citer)->get_answer ()); | |
434 | ||
435 | element = card_node->add_child ("back_example"); | |
436 | txt_node = element->add_child_text ((*citer)->get_example ()); | |
437 | ||
483 | ret = xmlTextWriterStartElement (writer, BAD_CAST "card"); | |
484 | ret = xmlTextWriterWriteAttribute (writer, BAD_CAST "id", | |
485 | BAD_CAST (*citer)->get_id_str ().c_str ()); | |
486 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "front", | |
487 | BAD_CAST (*citer)->get_question ().c_str ()); | |
488 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "back", | |
489 | BAD_CAST (*citer)->get_answer ().c_str ()); | |
490 | ret = xmlTextWriterWriteElement (writer, BAD_CAST "back_example", | |
491 | BAD_CAST (*citer)->get_example ().c_str ()); | |
492 | ret = xmlTextWriterEndElement (writer); // @end card | |
438 | 493 | citer++; |
439 | 494 | } |
440 | ||
441 | deck_xml.write_to_file_formatted (m_fname, "UTF-8"); | |
495 | /** Close <deck> and write out the file | |
496 | */ | |
497 | xmlTextWriterEndElement (writer); // @end deck | |
498 | xmlTextWriterEndDocument (writer); | |
499 | xmlTextWriterFlush (writer); | |
500 | xmlFreeTextWriter (writer); // clenup | |
501 | ||
442 | 502 | m_status = CLEAN_DECK; |
443 | 503 | m_needs_renaming = false; |
444 | 504 | |
451 | 511 | } |
452 | 512 | |
453 | 513 | dump_deck_status (); |
514 | return (ret); | |
454 | 515 | } |
455 | 516 | |
456 | 517 | void |
480 | 541 | |
481 | 542 | cardlist_iterator iter = m_cards.begin (); |
482 | 543 | while (iter != m_cards.end ()) { |
544 | DL ((GRAPP,"Trying id=%ld\n", (*iter)->get_id ())); | |
483 | 545 | if ((*iter)->get_id () == id_) { |
546 | DL ((GRAPP,"... that's a match\n")); | |
484 | 547 | return (*iter); |
485 | 548 | } |
486 | 549 | iter++; |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // Deck.h |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: Deck.h,v 1.23 2005/05/16 03:02:02 vlg Exp $ | |
4 | // $Id: Deck.h,v 1.24 2005/11/13 02:50:48 vlg Exp $ | |
5 | 5 | // |
6 | 6 | // Copyright (c) 2004 by Vladislav Grinchenko |
7 | 7 | // |
16 | 16 | #define DECK_H |
17 | 17 | |
18 | 18 | #include "VDeck.h" |
19 | #include <libxml/tree.h> // xmlDocPtr | |
19 | 20 | |
20 | 21 | class Card; |
21 | 22 | |
26 | 27 | Deck (const string& fname_, DeckEditStatus status_); |
27 | 28 | ~Deck (); |
28 | 29 | |
29 | virtual void load (const string& fname_, DeckAction = INSTALL_DECK); | |
30 | virtual int load (const string& fname_, DeckAction = INSTALL_DECK); | |
30 | 31 | void insert (const string& from_file_); |
31 | 32 | bool import_from_csv (const string& file_); |
32 | 33 | virtual int save (); |
70 | 71 | void dump_deck_status () const; |
71 | 72 | |
72 | 73 | private: |
73 | void parse_xml_tree (const xmlpp::Node* node_); | |
74 | /** Parse the Deck file card by card. | |
75 | @return 0 on success; -1 on error with error_ explaining the reason. | |
76 | */ | |
77 | int parse_xml_tree (xmlDocPtr parser_, std::string& error_); | |
78 | ||
74 | 79 | void reset_snd_setup (); |
75 | 80 | |
76 | 81 | private: |
0 | 0 | // -*- c++ -*- |
1 | 1 | // Generated by assa-genesis |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: DeckManager.cpp,v 1.31 2005/05/16 03:02:02 vlg Exp $ | |
3 | // $Id: DeckManager.cpp,v 1.33 2005/11/13 02:50:48 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // DeckManager.cpp |
6 | 6 | //------------------------------------------------------------------------------ |
108 | 108 | */ |
109 | 109 | if (iter == DECKLIST->end ()) { |
110 | 110 | deck = new Deck (INVALID_DECK); |
111 | deck->load (path_); | |
111 | if (deck->load (path_) < 0) { | |
112 | DL ((GRAPP,"Failed to load deck \"%s\"\n", path_.c_str ())); | |
113 | return (NULL); | |
114 | } | |
112 | 115 | } |
113 | 116 | |
114 | 117 | if ((card = deck->find_card_by_id (id_)) != NULL) { |
115 | 118 | return (new CardRef (*card, *deck)); |
119 | } | |
120 | else { | |
121 | DL ((GRAPP,"Cound not find card id=%d in deck %s\n", | |
122 | id_, path_.c_str ())); | |
116 | 123 | } |
117 | 124 | return (NULL); |
118 | 125 | } |
144 | 151 | if (f.run () != Gtk::RESPONSE_OK) { |
145 | 152 | return; |
146 | 153 | } |
154 | f.hide (); | |
155 | ||
147 | 156 | DeckList::iterator iter = DECKLIST->begin (); |
148 | 157 | while (iter != DECKLIST->end ()) { |
149 | 158 | if (f.get_filename () == DECKLIST->get_deck (iter)->get_name ()) { |
156 | 165 | } |
157 | 166 | |
158 | 167 | Deck* deck = new Deck (INVALID_DECK); |
159 | deck->load (f.get_filename ()); | |
160 | CONFIG->set_filesel_path (f.get_filename ()); | |
168 | if (deck->load (f.get_filename ()) == 0) { | |
169 | CONFIG->set_filesel_path (f.get_filename ()); | |
170 | } | |
161 | 171 | } |
162 | 172 | |
163 | 173 | /** Insert cards from a deck to the one currently selected. |
219 | 229 | w.run (); |
220 | 230 | return; |
221 | 231 | } |
222 | ||
232 | DL((GRAPP,"Step #1\n")); | |
223 | 233 | Gtk::FileChooserDialog f ("Select File To Import", |
224 | 234 | Gtk::FILE_CHOOSER_ACTION_OPEN); |
235 | DL((GRAPP,"Step #2\n")); | |
225 | 236 | f.set_transient_for (*MAINWIN); |
237 | DL((GRAPP,"Step #3\n")); | |
226 | 238 | f.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
227 | 239 | f.add_button ("Select", Gtk::RESPONSE_OK); |
240 | DL((GRAPP,"Step #4\n")); | |
228 | 241 | f.set_current_folder (CONFIG->get_filesel_path ()); |
242 | DL((GRAPP,"Step #5\n")); | |
229 | 243 | f.set_local_only (); |
244 | DL((GRAPP,"Step #6\n")); | |
230 | 245 | |
231 | 246 | if (f.run () == Gtk::RESPONSE_OK) { |
232 | 247 | f.hide (); |
397 | 412 | trace_with_mask("DeckManager::on_deck_loaded", GUITRACE); |
398 | 413 | |
399 | 414 | if (status_ == LOAD_FAILED) { |
415 | string msg ("Failed to load deck file\n"); | |
416 | msg += "\"" + deck_->get_name () + "\"!\n"; | |
417 | msg += "Check your file syntax with\n"; | |
418 | msg += "\"xmllint --valid <fname>\""; | |
419 | ||
420 | Gtk::MessageDialog emsg (msg, false, MESSAGE_ERROR); | |
421 | emsg.run (); | |
400 | 422 | delete deck_; |
401 | Gtk::MessageDialog emsg ("Failed to load deck file!\n" | |
402 | "Check your file syntax with\n" | |
403 | "\"xmllint --valid <fname>\"", | |
404 | false, MESSAGE_ERROR); | |
405 | emsg.run (); | |
406 | 423 | } |
407 | 424 | else { |
408 | 425 | DECKLIST->push_back (deck_); |
0 | 0 | // -*- c++ -*- |
1 | 1 | //------------------------------------------------------------------------------ |
2 | // $Id: DeckPlayer.cpp,v 1.80 2005/06/20 02:41:59 vlg Exp $ | |
2 | // $Id: DeckPlayer.cpp,v 1.83 2005/11/22 01:39:53 vlg Exp $ | |
3 | 3 | //------------------------------------------------------------------------------ |
4 | 4 | // DeckPlayer.cpp |
5 | 5 | //------------------------------------------------------------------------------ |
17 | 17 | |
18 | 18 | #include <gtkmm/stock.h> |
19 | 19 | #include <gtkmm/separator.h> |
20 | #include <gtkmm/spinbutton.h> | |
20 | 21 | #include <gtkmm/box.h> |
21 | 22 | #include <gtkmm/handlebox.h> |
22 | 23 | #include <gtkmm/buttonbox.h> |
27 | 28 | #include <gtkmm/main.h> |
28 | 29 | #include <gtkmm/progressbar.h> |
29 | 30 | #include <gtkmm/eventbox.h> |
31 | ||
32 | using sigc::bind; | |
33 | using sigc::mem_fun; | |
30 | 34 | |
31 | 35 | #include "ButtonWithImageLabel.h" |
32 | 36 | |
64 | 68 | m_green ("MediumSeaGreen"), |
65 | 69 | m_white ("white"), |
66 | 70 | m_black ("black"), |
67 | m_state (VC_START) | |
71 | m_state (VC_START), | |
72 | m_test_line (NULL), | |
73 | m_line_num (1) | |
74 | ||
68 | 75 | { |
69 | 76 | trace_with_mask("VerifyControl::VerifyControl", GUITRACE); |
70 | 77 | |
133 | 140 | Gtk::EXPAND|Gtk::SHRINK|Gtk::FILL, Gtk::FILL, 0, 0); |
134 | 141 | |
135 | 142 | m_entry->signal_changed ().connect ( |
136 | sigc::mem_fun (*this, &VerifyControl::on_entry_changed)); | |
143 | mem_fun (*this, &VerifyControl::on_entry_changed)); | |
137 | 144 | |
138 | 145 | m_button->signal_clicked ().connect ( |
139 | sigc::mem_fun (m_parent, &DeckPlayer::on_verify_clicked)); | |
146 | mem_fun (m_parent, &DeckPlayer::on_verify_clicked)); | |
147 | } | |
148 | ||
149 | void | |
150 | VerifyControl:: | |
151 | on_test_line_changed () | |
152 | { | |
153 | trace_with_mask("VerifyControl::on_test_line_changed", GUITRACE); | |
154 | ||
155 | if (m_test_line != NULL) { | |
156 | m_line_num = m_test_line->get_value_as_int (); | |
157 | DL ((GRAPP,"test line = %d\n", m_line_num)); | |
158 | } | |
140 | 159 | } |
141 | 160 | |
142 | 161 | /** |
160 | 179 | pc1 = text1 = pc2 = text2 = NULL; |
161 | 180 | |
162 | 181 | Glib::ustring tmp (answer_); |
182 | ||
183 | /** If we are comparing the back of the card and | |
184 | the m_line_num > 1, then we fetch that line instead. | |
185 | If we are short of lines, that's a failed match. | |
186 | */ | |
187 | if (m_parent.get_selected_size () == BACK && m_line_num > 1) { | |
188 | std::vector<Glib::ustring> vec; | |
189 | std::istringstream input (tmp.c_str ()); | |
190 | Glib::ustring token; | |
191 | while (input >> token) { | |
192 | vec.push_back (token); | |
193 | } | |
194 | if (vec.size () >= m_line_num) { | |
195 | tmp = vec [m_line_num-1]; | |
196 | } | |
197 | else { | |
198 | tmp = ""; // Selected answer line is missing | |
199 | } | |
200 | } | |
201 | ||
163 | 202 | DeckPlayer::shrink_to_single_line (tmp); |
164 | 203 | |
165 | 204 | DL ((GRAPP,"tmp = \"%s\"\n", tmp.c_str ())); |
205 | ||
166 | 206 | text1 = pc1 = Granule::strip_pango_markup (tmp.c_str ()); |
167 | 207 | Granule::remove_common_prefixes (text1); |
168 | 208 | |
175 | 215 | |
176 | 216 | if (!strcmp (text1, text2)) { |
177 | 217 | m_report_box->modify_fg (Gtk::STATE_INSENSITIVE, m_green); |
178 | m_report->modify_fg (Gtk::STATE_INSENSITIVE, m_green); | |
179 | m_report->set_label (clabels [CORRECT]); | |
218 | m_report->modify_fg (Gtk::STATE_INSENSITIVE, m_green); | |
219 | m_report->set_label (clabels [CORRECT]); | |
180 | 220 | } |
181 | 221 | else { |
182 | 222 | m_report_box->modify_fg (Gtk::STATE_INSENSITIVE, m_red); |
183 | m_report->modify_fg (Gtk::STATE_INSENSITIVE, m_red); | |
184 | m_report->set_label (clabels [INCORRECT]); | |
223 | m_report->modify_fg (Gtk::STATE_INSENSITIVE, m_red); | |
224 | m_report->set_label (clabels [INCORRECT]); | |
185 | 225 | |
186 | 226 | m_was_equal= false; |
187 | 227 | |
368 | 408 | frame->add (m_front); |
369 | 409 | |
370 | 410 | m_notebook->pages ().push_back ( |
371 | Gtk::Notebook_Helpers::TabElem (*frame, "Front")); | |
411 | Gtk::Notebook_Helpers::TabElem (*frame, _("Front"))); | |
372 | 412 | |
373 | 413 | /** Back of the card |
374 | 414 | */ |
400 | 440 | m_answer_box->pack_start (m_example, Gtk::PACK_SHRINK, 5); |
401 | 441 | |
402 | 442 | m_notebook->pages ().push_back ( |
403 | Gtk::Notebook_Helpers::TabElem (*m_answer_box, "Back")); | |
443 | Gtk::Notebook_Helpers::TabElem (*m_answer_box, _("Back"))); | |
404 | 444 | m_answer_box->show (); |
405 | 445 | |
406 | 446 | /** Side-panel controls |
414 | 454 | vbuttonbox->set_homogeneous (); |
415 | 455 | vbuttonbox->set_spacing (1); |
416 | 456 | |
417 | radio_fb = manage (new Gtk::RadioButton (group, "Ask front")); | |
457 | radio_fb = manage (new Gtk::RadioButton (group, _("Ask front"))); | |
418 | 458 | radio_fb->signal_clicked ().connect ( |
419 | sigc::bind<SideSelection>( | |
420 | sigc::mem_fun (*this, &DeckPlayer::on_radio_selected), FRONT)); | |
459 | bind<SideSelection>( | |
460 | mem_fun (*this, &DeckPlayer::on_radio_selected), FRONT)); | |
421 | 461 | vbuttonbox->pack_end (*radio_fb, false, false, 1); |
422 | 462 | |
423 | radio_bb = manage (new Gtk::RadioButton (group, "Ask back")); | |
463 | radio_bb = manage (new Gtk::RadioButton (group, _("Ask back"))); | |
424 | 464 | radio_bb->signal_clicked ().connect ( |
425 | sigc::bind<SideSelection>( | |
426 | sigc::mem_fun (*this, &DeckPlayer::on_radio_selected), BACK)); | |
465 | bind<SideSelection>( | |
466 | mem_fun (*this, &DeckPlayer::on_radio_selected), BACK)); | |
427 | 467 | vbuttonbox->pack_end (*radio_bb, false, false, 1); |
428 | 468 | vbox->pack_start (*vbuttonbox, false, false, 0); |
429 | 469 | |
470 | /** Add Line selection spin button | |
471 | */ | |
472 | Gtk::HBox* sb_hbox = manage (new Gtk::HBox); | |
473 | Gtk::Adjustment* sb_adjust = manage (new Gtk::Adjustment (1,1,10)); | |
474 | Gtk::Label* sb_label = manage (new Gtk::Label (_("Test line: "))); | |
475 | m_test_line_button = manage (new Gtk::SpinButton (*sb_adjust)); | |
476 | ||
477 | sb_hbox->pack_start (*sb_label, false, false, 0); | |
478 | sb_hbox->pack_start (*m_test_line_button, false, false, 0); | |
479 | vbox->pack_start (*sb_hbox, false, false, 0); | |
480 | m_test_line_button->signal_value_changed ().connect ( | |
481 | mem_fun (*m_verify_control, &VerifyControl::on_test_line_changed)); | |
482 | m_verify_control->attach (m_test_line_button); | |
483 | ||
484 | /** Fetch out the side history and adjust accordingly | |
485 | */ | |
430 | 486 | if (m_is_real_deck) { |
431 | 487 | m_selected_side = CONFIG->get_flipside_history (m_deck.get_name ()); |
432 | 488 | if (m_selected_side == FRONT) { |
433 | 489 | radio_fb->set_active (); |
490 | m_test_line_button->set_sensitive (false); | |
434 | 491 | } |
435 | 492 | else { |
436 | 493 | radio_bb->set_active (); |
494 | m_test_line_button->set_sensitive (true); | |
437 | 495 | } |
438 | 496 | } |
439 | 497 | |
440 | 498 | /** Side-panel buttons |
441 | 499 | */ |
442 | 500 | m_shuffle_button->signal_clicked ().connect ( |
443 | sigc::mem_fun (*this, &DeckPlayer::on_shuffle_clicked)); | |
501 | mem_fun (*this, &DeckPlayer::on_shuffle_clicked)); | |
444 | 502 | vbox->pack_start (*m_shuffle_button, false, false, 0); |
445 | 503 | |
446 | 504 | m_edit_button->signal_clicked ().connect ( |
447 | sigc::mem_fun (*this, &DeckPlayer::on_edit_clicked)); | |
505 | mem_fun (*this, &DeckPlayer::on_edit_clicked)); | |
448 | 506 | vbox->pack_start (*m_edit_button, false, false, 0); |
449 | 507 | |
450 | 508 | m_vcard_edit_button->signal_clicked ().connect ( |
451 | sigc::mem_fun (*this, &DeckPlayer::on_vcard_edit_clicked)); | |
509 | bind<bool>(mem_fun (*this, &DeckPlayer::on_vcard_edit_clicked), false)); | |
452 | 510 | vbox->pack_start (*m_vcard_edit_button, false, false, 0); |
453 | 511 | |
454 | 512 | m_count_label.set_alignment (0.5, 0.5); |
475 | 533 | spkr_source.set_size (Gtk::ICON_SIZE_BUTTON); |
476 | 534 | spkr_set.add_source (spkr_source); |
477 | 535 | icon_factory->add (DeckPlayer::SAY_IT, spkr_set); |
478 | Gtk::Stock::add (Gtk::StockItem (DeckPlayer::SAY_IT, "Say It!")); | |
536 | Gtk::Stock::add (Gtk::StockItem (DeckPlayer::SAY_IT, _("Say It!"))); | |
479 | 537 | |
480 | 538 | Glib::RefPtr<Gdk::Pixbuf> thumbup_xpm = |
481 | 539 | Gdk::Pixbuf::create_from_file (GRAPPDATADIR "/pixmaps/thumbup.xpm"); |
485 | 543 | thumbup_source.set_size (Gtk::ICON_SIZE_BUTTON); |
486 | 544 | thumbup_set.add_source (thumbup_source); |
487 | 545 | icon_factory->add (DeckPlayer::THUMB_UP, thumbup_set); |
488 | Gtk::Stock::add (Gtk::StockItem (DeckPlayer::THUMB_UP, "I know it!")); | |
546 | Gtk::Stock::add (Gtk::StockItem (DeckPlayer::THUMB_UP, _("I know it!"))); | |
489 | 547 | |
490 | 548 | Glib::RefPtr<Gdk::Pixbuf> thumbdown_xpm = |
491 | 549 | Gdk::Pixbuf::create_from_file (GRAPPDATADIR "/pixmaps/thumbdown.xpm"); |
495 | 553 | thumbdown_source.set_size (Gtk::ICON_SIZE_BUTTON); |
496 | 554 | thumbdown_set.add_source (thumbdown_source); |
497 | 555 | icon_factory->add (DeckPlayer::THUMB_DOWN, thumbdown_set); |
498 | Gtk::Stock::add (Gtk::StockItem (DeckPlayer::THUMB_DOWN, "No clue")); | |
556 | Gtk::Stock::add (Gtk::StockItem (DeckPlayer::THUMB_DOWN, _("No clue"))); | |
499 | 557 | |
500 | 558 | icon_factory->add_default (); |
501 | 559 | |
502 | 560 | m_actgroup = Gtk::ActionGroup::create (); |
503 | 561 | |
504 | 562 | m_actgroup->add (Gtk::Action::create ("Say_It", DeckPlayer::SAY_IT), |
505 | sigc::mem_fun (*this, &DeckPlayer::on_sayit_clicked)); | |
563 | mem_fun (*this, &DeckPlayer::on_sayit_clicked)); | |
506 | 564 | |
507 | 565 | m_actgroup->add (Gtk::Action::create ("First", Gtk::Stock::GOTO_FIRST), |
508 | sigc::mem_fun (*this, &DeckPlayer::go_first_cb)); | |
566 | mem_fun (*this, &DeckPlayer::go_first_cb)); | |
509 | 567 | |
510 | 568 | m_actgroup->add (Gtk::Action::create ("Prev", Gtk::Stock::GO_BACK), |
511 | sigc::mem_fun (*this, &DeckPlayer::go_prev_cb)); | |
569 | mem_fun (*this, &DeckPlayer::go_prev_cb)); | |
512 | 570 | |
513 | 571 | m_actgroup->add (Gtk::Action::create ("Next", Gtk::Stock::GO_FORWARD), |
514 | sigc::mem_fun (*this, &DeckPlayer::go_next_cb)); | |
572 | mem_fun (*this, &DeckPlayer::go_next_cb)); | |
515 | 573 | |
516 | 574 | m_actgroup->add (Gtk::Action::create ("Last", Gtk::Stock::GOTO_LAST), |
517 | sigc::mem_fun (*this, &DeckPlayer::go_last_cb)); | |
575 | mem_fun (*this, &DeckPlayer::go_last_cb)); | |
518 | 576 | |
519 | 577 | m_actgroup->add (Gtk::Action::create ("IKnowIt", DeckPlayer::THUMB_UP), |
520 | sigc::mem_fun (*this, &DeckPlayer::know_answer_cb)); | |
578 | mem_fun (*this, &DeckPlayer::know_answer_cb)); | |
521 | 579 | |
522 | 580 | m_actgroup->add (Gtk::Action::create ("NoClue", DeckPlayer::THUMB_DOWN), |
523 | sigc::mem_fun (*this, &DeckPlayer::no_clue_cb)); | |
581 | mem_fun (*this, &DeckPlayer::no_clue_cb)); | |
524 | 582 | |
525 | 583 | m_uimanager = Gtk::UIManager::create (); |
526 | 584 | m_uimanager->insert_action_group (m_actgroup); |
580 | 638 | hbox->show_all (); |
581 | 639 | |
582 | 640 | m_close_button->signal_clicked ().connect ( |
583 | sigc::mem_fun (*this, &DeckPlayer::on_close_clicked)); | |
641 | mem_fun (*this, &DeckPlayer::on_close_clicked)); | |
584 | 642 | |
585 | 643 | /** |
586 | 644 | * Perhaps you should examine signal_realize() instead. |
587 | 645 | * It is called once. |
588 | 646 | */ |
589 | 647 | m_answer_box->signal_size_allocate ().connect ( |
590 | sigc::mem_fun (*this, &DeckPlayer::answer_box_size_allocate_cb)); | |
648 | mem_fun (*this, &DeckPlayer::answer_box_size_allocate_cb)); | |
591 | 649 | |
592 | 650 | signal_size_allocate ().connect ( |
593 | sigc::mem_fun (*this, &DeckPlayer::size_allocate_cb)); | |
651 | mem_fun (*this, &DeckPlayer::size_allocate_cb)); | |
594 | 652 | |
595 | 653 | add_events (Gdk::BUTTON_PRESS_MASK); |
596 | 654 | |
598 | 656 | keypress event handling. Returning 'true' from on_key_pressed() |
599 | 657 | will stop event processing. |
600 | 658 | */ |
601 | signal_key_press_event ().connect( | |
602 | sigc::mem_fun (*this, &DeckPlayer::on_key_pressed), false); | |
659 | if (!CONFIG->disable_key_shortcuts ()) { | |
660 | signal_key_press_event ().connect( | |
661 | mem_fun (*this, &DeckPlayer::on_key_pressed), false); | |
662 | } | |
603 | 663 | |
604 | 664 | /** Grand finale |
605 | 665 | */ |
640 | 700 | show_card (); |
641 | 701 | } |
642 | 702 | |
703 | /** | |
704 | * Always clear all fields first. Then, try to fill them up. | |
705 | * If we were given an invalid markup text, then set_markup() | |
706 | * would fail with | |
707 | * "Gtk-WARNING **: Failed to set label from markup due to error parsing markup" | |
708 | * | |
709 | * I'd like ultimately to catch the error and show it in a warning dialog | |
710 | * to the user, but for now I don't see a way of doing it with GTK+. | |
711 | */ | |
643 | 712 | void |
644 | 713 | DeckPlayer:: |
645 | 714 | show_card (bool with_adjust_count_) |
646 | 715 | { |
647 | 716 | trace_with_mask("DeckPlayer::show_card",GUITRACE); |
648 | 717 | |
718 | clear_text (); | |
719 | ||
649 | 720 | if (m_deck_iter != m_deck.end () || m_deck.size () > 0) { |
721 | while (!markup_is_valid ((*m_deck_iter))) { | |
722 | Gtk::MessageDialog em ( | |
723 | _("The card you are about to see has invalid markup.\n" | |
724 | "To proceed further, first, fix the broken markup.\n" | |
725 | "If unsure about the correct syntax, consult Help."), | |
726 | Gtk::MESSAGE_ERROR); | |
727 | em.run (); | |
728 | em.hide (); | |
729 | on_vcard_edit_clicked (true); | |
730 | } | |
650 | 731 | m_front.set_markup ((*m_deck_iter)->get_question ()); |
651 | 732 | set_answer_field ((*m_deck_iter)->get_answer ()); |
652 | m_example.set_markup (markup_tildas ((*m_deck_iter)->get_example ())); | |
653 | } | |
654 | else { | |
655 | m_front. set_text (""); | |
656 | m_back. set_text (""); | |
657 | m_example.set_text (""); | |
658 | } | |
733 | m_example.set_markup (markup_tildas((*m_deck_iter)->get_example())); | |
734 | } | |
735 | ||
659 | 736 | if (with_adjust_count_) { |
660 | 737 | adjust_count (); |
661 | 738 | } |
662 | 739 | /** set focus |
663 | 740 | */ |
664 | 741 | m_verify_control->grab_focus (); |
742 | } | |
743 | ||
744 | void | |
745 | DeckPlayer:: | |
746 | set_answer_field (Glib::ustring answer_) | |
747 | { | |
748 | trace_with_mask("DeckPlayer::set_answer_field",GUITRACE); | |
749 | ||
750 | // DL ((GRAPP,"answer: \"%s\"\n", answer_.c_str ())); | |
751 | ||
752 | m_back.set_markup (answer_); | |
753 | ||
754 | /* | |
755 | Multi-line right alignment works, but perhaps it should be | |
756 | optional via Preferences | |
757 | ||
758 | if (answer_.find ("\n") != Glib::ustring::npos) { | |
759 | m_back.set_alignment (Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER); | |
760 | } | |
761 | else { | |
762 | m_back.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); | |
763 | } | |
764 | */ | |
665 | 765 | } |
666 | 766 | |
667 | 767 | void |
852 | 952 | on_radio_selected (SideSelection selected_) |
853 | 953 | { |
854 | 954 | trace_with_mask("DeckPlayer::on_radio_selected",GUITRACE); |
955 | ||
855 | 956 | m_selected_side = selected_; |
856 | 957 | switch_side (); |
857 | DL((GRAPP,"Selected side : %s\n", | |
858 | (m_selected_side == FRONT ? "FRONT" : "BACK"))); | |
958 | DL ((GRAPP,"selected = %s\n", | |
959 | (m_selected_side == BACK ? "BACK" : "FRONT"))); | |
960 | m_test_line_button->set_sensitive ((m_selected_side == BACK)); | |
859 | 961 | } |
860 | 962 | |
861 | 963 | void |
942 | 1044 | |
943 | 1045 | void |
944 | 1046 | DeckPlayer:: |
945 | on_vcard_edit_clicked () | |
1047 | on_vcard_edit_clicked (bool disable_cancel_) | |
946 | 1048 | { |
947 | 1049 | trace_with_mask("DeckPlayer::on_vcard_edit_clicked",GUITRACE); |
948 | 1050 | |
949 | 1051 | if (m_deck_iter != m_deck.end () || m_deck.size () > 0) { |
950 | 1052 | VCard* vc = *m_deck_iter; |
951 | 1053 | CardView cview (vc); |
952 | int ret = cview.run (); | |
1054 | int ret = cview.run (disable_cancel_); | |
953 | 1055 | |
954 | 1056 | if (ret == Gtk::RESPONSE_OK) { |
955 | 1057 | show_card (false); |
1125 | 1227 | |
1126 | 1228 | void |
1127 | 1229 | DeckPlayer:: |
1230 | on_template_clicked () | |
1231 | { | |
1232 | trace_with_mask("DeckPlayer::on_template_clicked",GUITRACE); | |
1233 | ||
1234 | } | |
1235 | ||
1236 | void | |
1237 | DeckPlayer:: | |
1128 | 1238 | set_win_name () |
1129 | 1239 | { |
1130 | 1240 | string title = m_deck.get_name (); |
1194 | 1304 | |
1195 | 1305 | Glib::ustring::size_type idx; |
1196 | 1306 | |
1307 | idx = txt_.find_first_of ("\n"); | |
1308 | if (idx != Glib::ustring::npos) { | |
1309 | txt_.replace (idx, txt_.size (), ""); | |
1310 | } | |
1311 | ||
1197 | 1312 | while ((idx = txt_.find (" ")) != Glib::ustring::npos) { |
1198 | 1313 | txt_.replace (idx, 2, " "); |
1199 | } | |
1200 | ||
1201 | idx = txt_.find_last_of ("\n"); | |
1202 | if (idx != Glib::ustring::npos) { | |
1203 | txt_.replace (idx, txt_.size (), ""); | |
1204 | 1314 | } |
1205 | 1315 | |
1206 | 1316 | idx = txt_.find_first_not_of (" \t"); |
1214 | 1324 | } |
1215 | 1325 | } |
1216 | 1326 | |
1217 | void | |
1218 | DeckPlayer:: | |
1219 | set_answer_field (Glib::ustring answer_) | |
1220 | { | |
1221 | trace_with_mask("DeckPlayer::set_answer_field",GUITRACE); | |
1222 | ||
1223 | DL ((GRAPP,"answer: \"%s\"\n", answer_.c_str ())); | |
1224 | m_back.set_markup (answer_); | |
1225 | /* | |
1226 | Multi-line right alignment works, but perhaps it should be | |
1227 | optional via Preferences | |
1228 | ||
1229 | if (answer_.find ("\n") != Glib::ustring::npos) { | |
1230 | m_back.set_alignment (Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER); | |
1231 | } | |
1232 | else { | |
1233 | m_back.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); | |
1234 | } | |
1235 | */ | |
1236 | } | |
1237 | 1327 | |
1238 | 1328 | Glib::ustring |
1239 | 1329 | DeckPlayer:: |
1266 | 1356 | |
1267 | 1357 | return ret; |
1268 | 1358 | } |
1359 | ||
1360 | bool | |
1361 | DeckPlayer:: | |
1362 | markup_is_valid (VCard* card_) | |
1363 | { | |
1364 | return (Granule::check_markup (card_->get_question ()) && | |
1365 | Granule::check_markup (card_->get_answer ()) && | |
1366 | Granule::check_markup (card_->get_example ())); | |
1367 | } |
0 | 0 | // -*- c++ -*- |
1 | 1 | //------------------------------------------------------------------------------ |
2 | // $Id: DeckPlayer.h,v 1.35 2005/06/20 02:41:59 vlg Exp $ | |
2 | // $Id: DeckPlayer.h,v 1.37 2005/11/20 23:28:11 vlg Exp $ | |
3 | 3 | //------------------------------------------------------------------------------ |
4 | 4 | // DeckPlayer.h |
5 | 5 | //------------------------------------------------------------------------------ |
67 | 67 | void set_state (VCState state_); |
68 | 68 | |
69 | 69 | void on_entry_changed (); |
70 | void on_test_line_changed (); | |
71 | ||
72 | void attach (Gtk::SpinButton* tl_) { m_test_line = tl_; } | |
70 | 73 | |
71 | 74 | private: |
72 | 75 | static const int LABELS_SZ = 4; |
85 | 88 | Gdk::Color m_green; |
86 | 89 | Gdk::Color m_white; |
87 | 90 | Gdk::Color m_black; |
91 | ||
92 | Gtk::SpinButton* m_test_line; // Which line to compare for answer. | |
93 | int m_line_num; // Number of line to test | |
88 | 94 | }; |
89 | 95 | |
90 | 96 | /** |
121 | 127 | void on_edit_clicked (); |
122 | 128 | |
123 | 129 | /** User pressed <Edit Card> button to Edit current card |
124 | */ | |
125 | void on_vcard_edit_clicked (); | |
130 | * | |
131 | * @param disable_cancel_ disables <Cancel> button if set to true. | |
132 | */ | |
133 | void on_vcard_edit_clicked (bool disable_cancel_ = false); | |
126 | 134 | |
127 | 135 | // -*- Button Actions -*- |
128 | 136 | void go_first_cb (); // Go to the first card |
138 | 146 | // -*- Radio Button Actions -*- |
139 | 147 | void on_radio_selected (SideSelection selected_); |
140 | 148 | |
149 | // -*- Question Template button -*- | |
150 | void on_template_clicked (); | |
151 | ||
141 | 152 | // -*- Catch and process keyboard events -*- |
142 | 153 | bool on_key_pressed (GdkEventKey* evt_); |
143 | 154 | |
157 | 168 | */ |
158 | 169 | void repaint (); |
159 | 170 | |
171 | /** Clear the text fields of the old or stale text | |
172 | */ | |
173 | void clear_text (); | |
174 | ||
160 | 175 | /// Enable answer control buttons ("I know", "Not a clue") |
161 | 176 | void enable_answer_controls (); |
162 | 177 | |
166 | 181 | /// Flip the Card |
167 | 182 | void flip_card (); |
168 | 183 | |
169 | /// Remove all newlines and shrink all whitespace | |
184 | SideSelection get_selected_size () const { return m_selected_side; } | |
185 | ||
186 | /** Remove all newlines and shrink all whitespace. | |
187 | */ | |
170 | 188 | static void shrink_to_single_line (Glib::ustring& txt_); |
171 | 189 | |
172 | 190 | /** Extend Stock Icons with application-specific ones. |
174 | 192 | static Gtk::StockID SAY_IT; |
175 | 193 | static Gtk::StockID THUMB_UP; |
176 | 194 | static Gtk::StockID THUMB_DOWN; |
177 | ||
195 | ||
178 | 196 | private: |
179 | 197 | void show_deck (); // Show first card of the loaded deck |
180 | 198 | void switch_side (); // Show the front/back side of the card |
195 | 213 | */ |
196 | 214 | static Glib::ustring markup_tildas (const Glib::ustring& src_); |
197 | 215 | |
216 | /** Check markup validity of the text fields of the card_ | |
217 | */ | |
218 | bool markup_is_valid (VCard* card_); | |
219 | ||
198 | 220 | private: |
199 | 221 | Gtk::Button* m_close_button; |
200 | 222 | Gtk::Button* m_shuffle_button; |
201 | 223 | Gtk::Button* m_edit_button; // View/Edit a Deck |
202 | 224 | Gtk::Button* m_vcard_edit_button; // Edit a Card |
225 | int m_match_front_row; // Which row to select for answer | |
203 | 226 | Gtk::Label m_count_label; |
204 | 227 | SideSelection m_selected_side; |
205 | 228 | Gtk::Notebook* m_notebook; |
207 | 230 | Gtk::Label m_front; |
208 | 231 | Gtk::Label m_back; |
209 | 232 | Gtk::Label m_example; |
233 | Gtk::SpinButton* m_test_line_button; | |
210 | 234 | |
211 | 235 | Gtk::VBox* m_answer_box; /* VBox that holds the back of a card */ |
212 | 236 | int m_answer_box_width; /* last resize width */ |
254 | 278 | m_verify_control->grab_focus (); |
255 | 279 | } |
256 | 280 | |
281 | inline void | |
282 | DeckPlayer:: | |
283 | clear_text () | |
284 | { | |
285 | m_front. set_text (""); | |
286 | m_back. set_text (""); | |
287 | m_example.set_text (""); | |
288 | } | |
289 | ||
257 | 290 | |
258 | 291 | #endif /* DECK_PLAYER_H */ |
0 | 0 | // -*- c++ -*- |
1 | 1 | //------------------------------------------------------------------------------ |
2 | // $Id: DeckView.cpp,v 1.33 2005/06/06 02:29:39 vlg Exp $ | |
2 | // $Id: DeckView.cpp,v 1.35 2005/11/27 04:59:22 vlg Exp $ | |
3 | 3 | //------------------------------------------------------------------------------ |
4 | 4 | // DeckView.cpp |
5 | 5 | //------------------------------------------------------------------------------ |
30 | 30 | #include "DeckView.h" |
31 | 31 | #include "DeckInfo.h" |
32 | 32 | #include "ButtonWithImageLabel.h" |
33 | ||
34 | using sigc::bind; | |
35 | using sigc::mem_fun; | |
33 | 36 | |
34 | 37 | DeckView:: |
35 | 38 | DeckView (VDeck& deck_, int selected_row_) : |
121 | 124 | m_close_button->set_relief (Gtk::RELIEF_NORMAL); |
122 | 125 | |
123 | 126 | m_close_button->signal_clicked ().connect ( |
124 | sigc::mem_fun (*this, &DeckView::on_close_clicked)); | |
127 | mem_fun (*this, &DeckView::on_close_clicked)); | |
125 | 128 | |
126 | 129 | /** List View |
127 | 130 | */ |
141 | 144 | row [m_columns.m_card ] = *iter; |
142 | 145 | iter++; |
143 | 146 | } |
147 | ||
148 | /** Make both Front and Back columns sortable. | |
149 | */ | |
144 | 150 | m_list_store_ref->set_sort_func ( |
145 | 0, sigc::mem_fun (*this, &DeckView::on_sort_compare)); | |
151 | 0, (mem_fun (*this, &DeckView::on_sort_compare_front))); | |
152 | ||
153 | m_list_store_ref->set_sort_func ( | |
154 | 1, (mem_fun (*this, &DeckView::on_sort_compare_back))); | |
146 | 155 | |
147 | 156 | /** Create TreeView |
148 | 157 | */ |
153 | 162 | Gtk::TreeView::Column* column; |
154 | 163 | Gtk::CellRendererText* renderer; |
155 | 164 | |
165 | /** Front: Column | |
166 | */ | |
156 | 167 | column = Gtk::manage (new Gtk::TreeView::Column ("Front")); |
157 | 168 | m_tree_view.append_column (*column); |
158 | 169 | renderer = Gtk::manage (new Gtk::CellRendererText); |
170 | 181 | column->set_sort_column_id (m_columns.m_front_row); |
171 | 182 | column->set_sort_indicator (true); |
172 | 183 | column->signal_clicked ().connect ( |
173 | sigc::mem_fun (*this, &DeckView::on_column_sorted)); | |
174 | ||
184 | mem_fun (*this, &DeckView::on_column_sorted)); | |
185 | ||
186 | /** Back: Column | |
187 | */ | |
175 | 188 | column = Gtk::manage (new Gtk::TreeView::Column ("Back")); |
176 | 189 | m_tree_view.append_column (*column); |
177 | 190 | renderer = Gtk::manage (new Gtk::CellRendererText); |
183 | 196 | column->set_sizing (Gtk::TREE_VIEW_COLUMN_FIXED); |
184 | 197 | column->set_fixed_width (140); |
185 | 198 | |
199 | /** Enable column sorting | |
200 | */ | |
201 | column->set_sort_column_id (m_columns.m_back_row); | |
202 | column->set_sort_indicator (true); | |
203 | column->signal_clicked ().connect ( | |
204 | mem_fun (*this, &DeckView::on_column_sorted)); | |
205 | ||
186 | 206 | m_tree_sel_ref = m_tree_view.get_selection (); |
187 | 207 | m_tree_sel_ref->set_mode (Gtk::SELECTION_SINGLE); |
188 | 208 | m_tree_sel_ref->signal_changed ().connect ( |
189 | sigc::mem_fun (*this, &DeckView::on_card_selected)); | |
209 | mem_fun (*this, &DeckView::on_card_selected)); | |
190 | 210 | |
191 | 211 | m_scrollwin->add (m_tree_view); |
192 | 212 | |
193 | 213 | /** Initialize callbacks |
194 | 214 | */ |
195 | 215 | m_add_button->signal_clicked ().connect ( |
196 | sigc::mem_fun (*this, &DeckView::on_add_clicked)); | |
216 | mem_fun (*this, &DeckView::on_add_clicked)); | |
197 | 217 | m_edit_button->signal_clicked ().connect ( |
198 | sigc::mem_fun (*this, &DeckView::on_edit_clicked)); | |
218 | mem_fun (*this, &DeckView::on_edit_clicked)); | |
199 | 219 | m_save_deck_button->signal_clicked ().connect ( |
200 | sigc::mem_fun (*DECKMGR, &DeckManager::save_deck_cb)); | |
220 | mem_fun (*DECKMGR, &DeckManager::save_deck_cb)); | |
201 | 221 | m_delete_button->signal_clicked ().connect ( |
202 | sigc::mem_fun (*this, &DeckView::on_delete_clicked)); | |
222 | mem_fun (*this, &DeckView::on_delete_clicked)); | |
203 | 223 | m_more_button->signal_clicked ().connect ( |
204 | sigc::mem_fun (*this, &DeckView::on_more_clicked)); | |
224 | mem_fun (*this, &DeckView::on_more_clicked)); | |
205 | 225 | m_card_up_button->signal_clicked ().connect ( |
206 | sigc::mem_fun (*this, &DeckView::on_card_up_clicked)); | |
226 | mem_fun (*this, &DeckView::on_card_up_clicked)); | |
207 | 227 | m_card_down_button->signal_clicked ().connect ( |
208 | sigc::mem_fun (*this, &DeckView::on_card_down_clicked)); | |
228 | mem_fun (*this, &DeckView::on_card_down_clicked)); | |
209 | 229 | m_add_card_to_cardbox->signal_clicked ().connect ( |
210 | sigc::mem_fun (*this, &DeckView::on_add_card_to_cardbox)); | |
230 | mem_fun (*this, &DeckView::on_add_card_to_cardbox)); | |
211 | 231 | |
212 | 232 | /** Pack 'em all |
213 | 233 | */ |
241 | 261 | set_sensitivity (); |
242 | 262 | set_win_name (); |
243 | 263 | set_icon_from_file (GRAPPDATADIR "/pixmaps/deckview_32x32.png"); |
264 | ||
244 | 265 | } |
245 | 266 | |
246 | 267 | DeckView:: |
540 | 561 | */ |
541 | 562 | int |
542 | 563 | DeckView:: |
543 | on_sort_compare (const Gtk::TreeModel::iterator& a_, | |
544 | const Gtk::TreeModel::iterator& b_) | |
545 | { | |
546 | trace_with_mask("DeckView::on_sort_compare",GUITRACE); | |
564 | sort_compare_impl (const Gtk::TreeModel::iterator& a_, | |
565 | const Gtk::TreeModel::iterator& b_, | |
566 | int column_) | |
567 | { | |
568 | trace_with_mask("DeckView::sort_compare_impl",GUITRACE); | |
547 | 569 | |
548 | 570 | gchar* txt_a; |
549 | 571 | gchar* txt_b; |
555 | 577 | const Gtk::TreeModel::Row row_a = *a_; |
556 | 578 | const Gtk::TreeModel::Row row_b = *b_; |
557 | 579 | |
558 | const Glib::ustring a = row_a [m_columns.m_front_row]; | |
559 | const Glib::ustring b = row_b [m_columns.m_front_row]; | |
580 | Glib::ustring a; | |
581 | Glib::ustring b; | |
582 | ||
583 | // DL ((GRAPP, "Sorting %s column\n", (column_ == 0 ? "Front" : "Back"))); | |
584 | ||
585 | if (column_ == 0) { | |
586 | a = row_a [m_columns.m_front_row]; | |
587 | b = row_b [m_columns.m_front_row]; | |
588 | } | |
589 | else { | |
590 | a = row_a [m_columns.m_back_row]; | |
591 | b = row_b [m_columns.m_back_row]; | |
592 | } | |
560 | 593 | |
561 | 594 | pa = txt_a = Granule::strip_pango_markup (a.c_str ()); |
562 | 595 | pb = txt_b = Granule::strip_pango_markup (b.c_str ()); |
606 | 639 | /** |
607 | 640 | * For multiline entries (starting with v 1.1.5), |
608 | 641 | * remove part of the string following first newline character. |
642 | * But first, strip possible Pango markup. Markup can span across | |
643 | * multiple lines and interpreting only first line might result | |
644 | * in invalid syntax. | |
609 | 645 | */ |
610 | 646 | Glib::ustring |
611 | 647 | DeckView:: |
612 | trim_multiline (const Glib::ustring& text_) | |
613 | { | |
648 | trim_multiline (const Glib::ustring& orig_text_) | |
649 | { | |
650 | gchar* pc = Granule::strip_pango_markup (orig_text_.c_str ()); | |
651 | Glib::ustring text_ = pc; | |
652 | g_free (pc); | |
614 | 653 | Glib::ustring::size_type idx = text_.find_first_of ("\n"); |
615 | 654 | Glib::ustring result (text_); |
616 | 655 | if (idx != std::string::npos) { |
0 | 0 | // -*- c++ -*- |
1 | 1 | //------------------------------------------------------------------------------ |
2 | // $Id: DeckView.h,v 1.17 2005/06/06 02:29:39 vlg Exp $ | |
2 | // $Id: DeckView.h,v 1.18 2005/11/21 00:25:17 vlg Exp $ | |
3 | 3 | //------------------------------------------------------------------------------ |
4 | 4 | // DeckView.h |
5 | 5 | //------------------------------------------------------------------------------ |
59 | 59 | */ |
60 | 60 | void on_column_sorted (); |
61 | 61 | |
62 | /** Roll in our own sort function | |
62 | /** Sort Front column | |
63 | 63 | */ |
64 | int on_sort_compare (const Gtk::TreeModel::iterator& a_, | |
65 | const Gtk::TreeModel::iterator& b_); | |
64 | int on_sort_compare_front (const Gtk::TreeModel::iterator& a_, | |
65 | const Gtk::TreeModel::iterator& b_) | |
66 | { | |
67 | return (sort_compare_impl (a_, b_, 0)); | |
68 | } | |
69 | ||
70 | /** Sort Back column | |
71 | */ | |
72 | int on_sort_compare_back (const Gtk::TreeModel::iterator& a_, | |
73 | const Gtk::TreeModel::iterator& b_) | |
74 | { | |
75 | return (sort_compare_impl (a_, b_, 1)); | |
76 | } | |
66 | 77 | |
67 | 78 | // -*- Sidebar action button callbacks -*- |
68 | 79 | void on_add_clicked (); |
76 | 87 | void add_new_card (Card* card_); |
77 | 88 | |
78 | 89 | private: |
90 | /** Column sorting implementation | |
91 | */ | |
92 | int sort_compare_impl (const Gtk::TreeModel::iterator& a_, | |
93 | const Gtk::TreeModel::iterator& b_, | |
94 | int column_); | |
95 | ||
79 | 96 | void set_cards_count (); |
80 | 97 | void set_win_name (); |
81 | 98 |
0 | // -*- c++ -*- | |
1 | //------------------------------------------------------------------------------ | |
2 | // $Id: EditControls.cpp,v 1.4 2005/11/27 04:59:22 vlg Exp $ | |
3 | //------------------------------------------------------------------------------ | |
4 | // EditControls.cpp | |
5 | //------------------------------------------------------------------------------ | |
6 | // Copyright (c) 2005 by Vladislav Grinchenko | |
7 | // | |
8 | // This program is free software; you can redistribute it and/or | |
9 | // modify it under the terms of the GNU General Public License | |
10 | // as published by the Free Software Foundation; either version | |
11 | // 2 of the License, or (at your option) any later version. | |
12 | //------------------------------------------------------------------------------ | |
13 | // | |
14 | // Date : Nov 13 2005 | |
15 | // | |
16 | //------------------------------------------------------------------------------ | |
17 | ||
18 | #include <gtkmm/table.h> | |
19 | ||
20 | #include "Granule-main.h" | |
21 | #include "EditControls.h" | |
22 | ||
23 | using Gtk::Image; | |
24 | ||
25 | EditControls:: | |
26 | EditControls (Glib::RefPtr<Gtk::TextBuffer> tb_ref_) | |
27 | : Gtk::HBox (false, 2), | |
28 | m_textbuf (tb_ref_) | |
29 | { | |
30 | trace_with_mask("EditControls::EditControls", GUITRACE); | |
31 | ||
32 | Glib::RefPtr<Gdk::Pixbuf> pixbuf_ref; | |
33 | ||
34 | vector<Glib::ustring> widget_names; | |
35 | widget_names.push_back ("TextBold"); | |
36 | widget_names.push_back ("TextItalic"); | |
37 | widget_names.push_back ("TextUnderline"); | |
38 | widget_names.push_back ("TextMonospace"); | |
39 | widget_names.push_back ("TextSubscript"); | |
40 | widget_names.push_back ("TextSuperscript"); | |
41 | widget_names.push_back ("TextBig"); | |
42 | widget_names.push_back ("TextSmall"); | |
43 | widget_names.push_back ("TextRemoveTags"); | |
44 | ||
45 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
46 | GRAPPDATADIR "pixmaps/text_bold.png"); | |
47 | m_icon_list.push_back (icon_t ("bold", | |
48 | manage (new Image (pixbuf_ref)))); | |
49 | ||
50 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
51 | GRAPPDATADIR "pixmaps/text_italic.png"); | |
52 | m_icon_list.push_back (icon_t ("italic", | |
53 | manage (new Image (pixbuf_ref)))); | |
54 | ||
55 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
56 | GRAPPDATADIR "pixmaps/text_underlined.png"); | |
57 | m_icon_list.push_back (icon_t ("underline", | |
58 | manage (new Image (pixbuf_ref)))); | |
59 | ||
60 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
61 | GRAPPDATADIR "pixmaps/text_monospaced.png"); | |
62 | m_icon_list.push_back (icon_t ("monospace", | |
63 | manage (new Image (pixbuf_ref)))); | |
64 | ||
65 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
66 | GRAPPDATADIR "pixmaps/text_subscript.png"); | |
67 | m_icon_list.push_back (icon_t ("subscript", | |
68 | manage (new Image (pixbuf_ref)))); | |
69 | ||
70 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
71 | GRAPPDATADIR "pixmaps/text_superscript.png"); | |
72 | m_icon_list.push_back (icon_t ("superscript", | |
73 | manage (new Image (pixbuf_ref)))); | |
74 | ||
75 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
76 | GRAPPDATADIR "pixmaps/text_big.png"); | |
77 | m_icon_list.push_back (icon_t ("big", | |
78 | manage (new Image (pixbuf_ref)))); | |
79 | ||
80 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
81 | GRAPPDATADIR "pixmaps/text_small.png"); | |
82 | m_icon_list.push_back (icon_t ("small", | |
83 | manage (new Image (pixbuf_ref)))); | |
84 | ||
85 | pixbuf_ref = Gdk::Pixbuf::create_from_file ( | |
86 | GRAPPDATADIR "pixmaps/text_remove_tags.png"); | |
87 | m_icon_list.push_back (icon_t ("remove_tags", | |
88 | manage (new Image (pixbuf_ref)))); | |
89 | ||
90 | icon_list_t::iterator iter = m_icon_list.begin (); | |
91 | ||
92 | Gtk::Button* button; | |
93 | Gtk::Table* elems_table = Gtk::manage (new Gtk::Table (2, 5, false)); | |
94 | ||
95 | elems_table->set_border_width (0); | |
96 | elems_table->set_row_spacings (1); | |
97 | elems_table->set_col_spacings (1); | |
98 | elems_table->set_name ("EditControlsTable"); | |
99 | ||
100 | int row = 0; | |
101 | int col = 0; | |
102 | ||
103 | /** unset_flags () takes buttons out of the dialog's focus chain. | |
104 | There is no other way it can be achieved with set_focus_chain() | |
105 | in CardView dialog. I tried it and it doesn't work. | |
106 | */ | |
107 | ||
108 | while (iter != m_icon_list.end ()) { | |
109 | button = manage (new Gtk::Button ()); | |
110 | button->unset_flags (Gtk::CAN_FOCUS); | |
111 | button->add (*((*iter).second)); | |
112 | elems_table->attach (*button, col, col+1, row, row+1, | |
113 | Gtk::FILL, Gtk::FILL, 0, 0); | |
114 | if (++col == 2) { | |
115 | row++; | |
116 | col = 0; | |
117 | } | |
118 | button->signal_clicked ().connect ( | |
119 | bind<string>(mem_fun(*this, &EditControls::on_edit_button_clicked), | |
120 | (*iter).first)); | |
121 | iter++; | |
122 | } | |
123 | // elems_table->unset_focus_chain (); | |
124 | ||
125 | this->pack_start (*elems_table, Gtk::PACK_SHRINK); | |
126 | } | |
127 | ||
128 | void | |
129 | EditControls:: | |
130 | on_edit_button_clicked (const string& action_) | |
131 | { | |
132 | trace_with_mask("EditControls::on_edit_button_clicked",GUITRACE); | |
133 | ||
134 | DL ((GRAPP,"Inserting <%s> tag.\n", action_.c_str ())); | |
135 | ||
136 | Gtk::TextBuffer::iterator iter; | |
137 | Gtk::TextBuffer::iterator start_iter; | |
138 | Gtk::TextBuffer::iterator end_iter; | |
139 | ||
140 | /** Iterators are invalidated between text changes. | |
141 | But marks are not. They are placed in the place where | |
142 | the text used to be it it were deleted. | |
143 | Comparing the marks, however, turned out to be useless - | |
144 | you ought to compares iterators only. | |
145 | */ | |
146 | if (!m_textbuf->get_selection_bounds (start_iter, end_iter)) { | |
147 | DL ((GRAPP,"No selection has been made\n")); | |
148 | return; | |
149 | } | |
150 | ||
151 | if (start_iter == end_iter) { | |
152 | DL ((GRAPP,"Selection size is 0.\n")); | |
153 | return; | |
154 | } | |
155 | ||
156 | /** We got a valid selection - mark it now. We cannot use | |
157 | predefined selection marks "insert" and "selection_bound" | |
158 | because if the user made the selection by dragging pointer | |
159 | in the opposite direction, we would get iterators in reverse | |
160 | and Gtkmm doesn't allow for iterators comparison. | |
161 | */ | |
162 | Glib::RefPtr<Gtk::TextBuffer::Mark> mb; | |
163 | Glib::RefPtr<Gtk::TextBuffer::Mark> me; | |
164 | ||
165 | mb = m_textbuf->create_mark ("start_selection", start_iter); | |
166 | me = m_textbuf->create_mark ("end_selection", end_iter); | |
167 | iter = start_iter; | |
168 | ||
169 | DL ((GRAPP,"selection: from='%c' to='%c'\n", | |
170 | display_unichar_at (iter), | |
171 | display_unichar_at (me->get_iter ()))); | |
172 | ||
173 | if (action_ == "bold") { | |
174 | m_textbuf->insert (iter, "<b>"); | |
175 | m_textbuf->insert (me->get_iter (), "</b>"); | |
176 | } | |
177 | else if (action_ == "italic") { | |
178 | m_textbuf->insert (iter, "<i>"); | |
179 | m_textbuf->insert (me->get_iter (), "</i>"); | |
180 | } | |
181 | else if (action_ == "underline") { | |
182 | m_textbuf->insert (iter, "<u>"); | |
183 | m_textbuf->insert (me->get_iter (), "</u>"); | |
184 | } | |
185 | else if (action_ == "monospace") { | |
186 | m_textbuf->insert (iter, "<tt>"); | |
187 | m_textbuf->insert (me->get_iter (), "</tt>"); | |
188 | } | |
189 | else if (action_ == "subscript") { | |
190 | m_textbuf->insert (iter, "<sub>"); | |
191 | m_textbuf->insert (me->get_iter (), "</sub>"); | |
192 | } | |
193 | else if (action_ == "superscript") { | |
194 | m_textbuf->insert (iter, "<sup>"); | |
195 | m_textbuf->insert (me->get_iter (), "</sup>"); | |
196 | } | |
197 | else if (action_ == "big") { | |
198 | m_textbuf->insert (iter, "<big>"); | |
199 | m_textbuf->insert (me->get_iter (), "</big>"); | |
200 | } | |
201 | else if (action_ == "small") { | |
202 | m_textbuf->insert (iter, "<small>"); | |
203 | m_textbuf->insert (me->get_iter (), "</small>"); | |
204 | } | |
205 | else if (action_ == "remove_tags") { | |
206 | remove_tags (mb, me); | |
207 | } | |
208 | ||
209 | else { | |
210 | DL ((GRAPP,"Unexpected action!\n")); | |
211 | } | |
212 | m_textbuf->place_cursor (m_textbuf->begin ()); | |
213 | ||
214 | m_textbuf->delete_mark (mb); | |
215 | m_textbuf->delete_mark (me); | |
216 | } | |
217 | ||
218 | /** We remove all complete individual tags. The incomplete tags | |
219 | are ignored. The tag context is also ignored - we don't match | |
220 | open/close tags at all. | |
221 | */ | |
222 | void | |
223 | EditControls:: | |
224 | remove_tags (Glib::RefPtr<Gtk::TextBuffer::Mark> begin_mark_, | |
225 | Glib::RefPtr<Gtk::TextBuffer::Mark> end_mark_) | |
226 | { | |
227 | trace_with_mask("EditControls::remove_tags",GUITRACE); | |
228 | ||
229 | gunichar open_brace = '<'; | |
230 | gunichar close_brace = '>'; | |
231 | ||
232 | Gtk::TextBuffer::iterator next_ch = begin_mark_->get_iter (); | |
233 | Gtk::TextBuffer::iterator last_ch = end_mark_->get_iter (); | |
234 | ||
235 | DL ((GRAPP,"scanning from='%c' to='%c'\n", | |
236 | display_unichar_at (next_ch), | |
237 | display_unichar_at (last_ch))); | |
238 | ||
239 | while (next_ch && next_ch != last_ch) { | |
240 | if (next_ch.get_char () == open_brace) { | |
241 | Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark; | |
242 | start_mark = m_textbuf->create_mark ("start", next_ch); | |
243 | next_ch++; | |
244 | ||
245 | DL ((GRAPP,"outer: next_ch='%c', last_ch='%c'\n", | |
246 | display_unichar_at (next_ch), | |
247 | display_unichar_at (last_ch))); | |
248 | ||
249 | while (next_ch && next_ch != last_ch) { | |
250 | if (next_ch.get_char () == close_brace) { | |
251 | DL ((GRAPP,"found tag - erasing from '%c' to '%c' ...\n", | |
252 | display_unichar_at (start_mark->get_iter ()), | |
253 | display_unichar_at (next_ch))); | |
254 | ||
255 | next_ch++; | |
256 | m_textbuf->erase (start_mark->get_iter (), next_ch); | |
257 | ||
258 | next_ch = start_mark->get_iter (); | |
259 | last_ch = end_mark_->get_iter (); | |
260 | ||
261 | DL ((GRAPP,"erase: next_ch='%c', last_ch='%c'\n", | |
262 | display_unichar_at (next_ch), | |
263 | display_unichar_at (last_ch))); | |
264 | break; | |
265 | } | |
266 | next_ch++; | |
267 | ||
268 | DL ((GRAPP,"inner: next_ch='%c', last_ch='%c'\n", | |
269 | display_unichar_at (next_ch), | |
270 | display_unichar_at (last_ch))); | |
271 | } | |
272 | m_textbuf->delete_mark (start_mark); | |
273 | } | |
274 | next_ch++; | |
275 | ||
276 | DL ((GRAPP,"outer: next_ch='%c', last_ch='%c'\n", | |
277 | display_unichar_at (next_ch), | |
278 | display_unichar_at (last_ch))); | |
279 | } | |
280 | } | |
281 | ||
282 | void | |
283 | EditControls:: | |
284 | on_focus_changed (Gtk::TextView* text_view_) | |
285 | { | |
286 | trace_with_mask("EditControls::on_focus_changed",GUITRACE); | |
287 | ||
288 | m_textbuf->place_cursor (m_textbuf->begin ()); // cancel old select | |
289 | m_textbuf = text_view_->get_buffer (); | |
290 | } | |
291 |
0 | // -*- c++ -*- | |
1 | //------------------------------------------------------------------------------ | |
2 | // $Id: EditControls.h,v 1.2 2005/11/15 04:08:42 vlg Exp $ | |
3 | //------------------------------------------------------------------------------ | |
4 | // EditControls.h | |
5 | //------------------------------------------------------------------------------ | |
6 | // Copyright (c) 2005 by Vladislav Grinchenko | |
7 | // | |
8 | // This program is free software; you can redistribute it and/or | |
9 | // modify it under the terms of the GNU General Public License | |
10 | // as published by the Free Software Foundation; either version | |
11 | // 2 of the License, or (at your option) any later version. | |
12 | //------------------------------------------------------------------------------ | |
13 | // | |
14 | // Date : Nov 13 2005 | |
15 | // | |
16 | //------------------------------------------------------------------------------ | |
17 | #ifndef EDIT_CONTROLS_H | |
18 | #define EDIT_CONTROLS_H | |
19 | ||
20 | #include <gtkmm/box.h> | |
21 | #include <gtkmm/textview.h> | |
22 | #include <gtkmm/box.h> | |
23 | #include <gdkmm/pixbuf.h> | |
24 | /* | |
25 | ||
26 | #include <gdkmm/image.h> | |
27 | */ | |
28 | #include <gtkmm/image.h> | |
29 | ||
30 | using sigc::bind; | |
31 | using sigc::mem_fun; | |
32 | ||
33 | #include <vector> | |
34 | #include <string> | |
35 | ||
36 | using std::vector; | |
37 | using std::string; | |
38 | ||
39 | /** EditControls is a collection of markup edit buttons | |
40 | that are embedded in CardView for quick editing | |
41 | the text in the input fields. | |
42 | */ | |
43 | class EditControls : public Gtk::HBox | |
44 | { | |
45 | public: | |
46 | EditControls (Glib::RefPtr<Gtk::TextBuffer> tb_ref_); | |
47 | ||
48 | void on_focus_changed (Gtk::TextView* text_view_); | |
49 | ||
50 | private: | |
51 | void on_edit_button_clicked (const string& action_); | |
52 | ||
53 | void remove_tags (Glib::RefPtr<Gtk::TextBuffer::Mark> begin_mark_, | |
54 | Glib::RefPtr<Gtk::TextBuffer::Mark> end_mark_); | |
55 | ||
56 | static gunichar | |
57 | display_unichar_at (Gtk::TextBuffer::iterator iter_) | |
58 | { | |
59 | gunichar c; | |
60 | return ((c = iter_.get_char ()) ? c : ' '); | |
61 | } | |
62 | ||
63 | private: | |
64 | typedef std::pair<string, Gtk::Image*> icon_t; | |
65 | typedef vector<icon_t> icon_list_t; | |
66 | ||
67 | icon_list_t m_icon_list; | |
68 | Glib::RefPtr<Gtk::TextBuffer> m_textbuf; | |
69 | }; | |
70 | ||
71 | #endif /* EDIT_CONTROLS_H */ |
0 | 0 | // -*- c++ -*- |
1 | 1 | // generated by glade-- |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: GeneralPref.cpp,v 1.7 2005/06/15 03:17:00 vlg Exp $ | |
3 | // $Id: GeneralPref.cpp,v 1.8 2005/11/22 01:39:53 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // GeneralPref.cpp |
6 | 6 | //------------------------------------------------------------------------------ |
23 | 23 | #include "Config.h" |
24 | 24 | #include "PrefWindow.h" |
25 | 25 | #include "GeneralPref.h" |
26 | ||
27 | #include "Intern.h" // i18n macros | |
26 | 28 | |
27 | 29 | using sigc::mem_fun; |
28 | 30 | using sigc::bind; |
101 | 103 | Gtk::Frame* frame1 = Gtk::manage(new Gtk::Frame()); |
102 | 104 | Gtk::Frame* frame2 = Gtk::manage(new Gtk::Frame()); |
103 | 105 | Gtk::Frame* frame3 = Gtk::manage(new Gtk::Frame()); |
106 | Gtk::Frame* frame4 = Gtk::manage(new Gtk::Frame()); | |
104 | 107 | Gtk::Label* empty_label; |
105 | 108 | |
106 | 109 | m_dup_checkbutton = |
107 | Gtk::manage(new Gtk::CheckButton("Remove duplicates when inserting new" | |
108 | "\ncards from a Deck to the Card Box")); | |
110 | Gtk::manage(new Gtk::CheckButton( | |
111 | _("Remove duplicates when inserting new\n" | |
112 | "cards from a Deck to the CardBox"))); | |
109 | 113 | m_dup_checkbutton->set_alignment (0.1, 0); |
110 | 114 | |
111 | 115 | m_relpath_checkbutton = |
112 | Gtk::manage(new Gtk::CheckButton("Record all dynamic links in CardFile" | |
113 | " as relative paths")); | |
116 | Gtk::manage(new Gtk::CheckButton( | |
117 | _("Record all dynamic links in CardFile" | |
118 | " as relative paths"))); | |
114 | 119 | m_relpath_checkbutton->set_alignment (0.1, 0); |
120 | ||
121 | m_keys_shortcuts_checkbutton = | |
122 | Gtk::manage(new Gtk::CheckButton( | |
123 | _("Some keyboard input methods may conflict with keyboard\n" | |
124 | "shortcuts. If checked, disable all shortcuts in DeckPlayer\n" | |
125 | "dialog (requires restart)."))); | |
126 | ||
127 | m_keys_shortcuts_checkbutton->set_alignment (0.1, 0); | |
115 | 128 | |
116 | 129 | m_hist_size = Gtk::manage (new HistSizeBox); |
117 | 130 | |
163 | 176 | m_relpath_checkbutton->set_active (false); |
164 | 177 | m_relpath_checkbutton->set_border_width (4); |
165 | 178 | |
179 | m_keys_shortcuts_checkbutton->set_flags (Gtk::CAN_FOCUS); | |
180 | m_keys_shortcuts_checkbutton->set_relief (Gtk::RELIEF_NORMAL); | |
181 | m_keys_shortcuts_checkbutton->set_mode (true); | |
182 | m_keys_shortcuts_checkbutton->set_active (false); | |
183 | m_keys_shortcuts_checkbutton->set_border_width (4); | |
184 | ||
166 | 185 | /** Duplicate check button |
167 | 186 | */ |
168 | 187 | empty_label = Gtk::manage(new Gtk::Label("")); |
212 | 231 | frame3->set_label_widget (*empty_label); |
213 | 232 | frame3->add (*m_hist_size); |
214 | 233 | |
234 | /** Key shortcuts | |
235 | */ | |
236 | empty_label = Gtk::manage(new Gtk::Label("")); | |
237 | ||
238 | empty_label->set_alignment (0.5,0.5); | |
239 | empty_label->set_padding (0,0); | |
240 | empty_label->set_justify (Gtk::JUSTIFY_LEFT); | |
241 | empty_label->set_line_wrap (false); | |
242 | empty_label->set_use_markup (false); | |
243 | empty_label->set_selectable (false); | |
244 | ||
245 | frame4->set_shadow_type (Gtk::SHADOW_ETCHED_IN); | |
246 | frame4->set_border_width(2); | |
247 | frame4->set_label_align (1, 1); | |
248 | frame4->set_label_widget (*empty_label); | |
249 | frame4->add (*m_keys_shortcuts_checkbutton); | |
250 | ||
215 | 251 | /** Set callbacks |
216 | 252 | */ |
217 | 253 | pack_start (*m_font_table, Gtk::PACK_EXPAND_WIDGET, 4); |
218 | 254 | pack_start (*frame1, Gtk::PACK_SHRINK, 0); |
219 | 255 | pack_start (*frame2, Gtk::PACK_SHRINK, 0); |
220 | 256 | pack_start (*frame3, Gtk::PACK_SHRINK, 0); |
257 | pack_start (*frame4, Gtk::PACK_SHRINK, 0); | |
221 | 258 | |
222 | 259 | m_dup_checkbutton->signal_toggled().connect ( |
223 | 260 | mem_fun (m_pref_window, &PrefWindow::changed_cb)); |
224 | 261 | |
225 | 262 | m_relpath_checkbutton->signal_toggled().connect ( |
263 | mem_fun (m_pref_window, &PrefWindow::changed_cb)); | |
264 | ||
265 | m_keys_shortcuts_checkbutton->signal_toggled().connect ( | |
226 | 266 | mem_fun (m_pref_window, &PrefWindow::changed_cb)); |
227 | 267 | |
228 | 268 | m_hist_size->get_entry ()->signal_changed ().connect ( |
258 | 298 | m_dup_checkbutton ->set_active (CONFIG->get_remove_duplicates ()); |
259 | 299 | m_relpath_checkbutton->set_active (CONFIG->with_relpaths ()); |
260 | 300 | m_hist_size ->set_value (CONFIG->get_history_size ()); |
301 | m_keys_shortcuts_checkbutton->set_active (CONFIG->disable_key_shortcuts ()); | |
302 | ||
261 | 303 | } |
262 | 304 | |
263 | 305 | void |
272 | 314 | |
273 | 315 | CONFIG->set_remove_duplicates (m_dup_checkbutton->get_active ()); |
274 | 316 | CONFIG->with_relpaths (m_relpath_checkbutton->get_active ()); |
317 | ||
275 | 318 | if (m_hist_size->get_value () <= 0) { |
276 | 319 | m_hist_size->set_value (5); // enforce sane default |
277 | 320 | } |
278 | 321 | CONFIG->set_history_size (m_hist_size->get_value ()); |
322 | ||
323 | CONFIG->disable_key_shortcuts (m_keys_shortcuts_checkbutton->get_active ()); | |
279 | 324 | } |
280 | 325 | |
281 | 326 | void |
0 | 0 | // -*- c++ -*- |
1 | 1 | // generated by glade-- |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: GeneralPref.h,v 1.5 2005/06/15 03:17:00 vlg Exp $ | |
3 | // $Id: GeneralPref.h,v 1.6 2005/11/22 01:39:53 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // GeneralPref.h |
6 | 6 | //------------------------------------------------------------------------------ |
84 | 84 | FontEntry m_fentry [FONT_ENTRY_SZ]; // Font entry |
85 | 85 | Gtk::CheckButton* m_dup_checkbutton; |
86 | 86 | Gtk::CheckButton* m_relpath_checkbutton; |
87 | Gtk::CheckButton* m_keys_shortcuts_checkbutton; | |
87 | 88 | HistSizeBox* m_hist_size; |
88 | 89 | Gtk::Table* m_font_table; |
89 | 90 | }; |
0 | 0 | // -*- c++ -*- |
1 | 1 | // Generated by assa-genesis |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: Granule-main.cpp,v 1.6 2005/05/06 02:37:01 vlg Exp $ | |
3 | // $Id: Granule-main.cpp,v 1.8 2005/11/13 02:50:48 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // Granule-main.cpp |
6 | 6 | //------------------------------------------------------------------------------ |
38 | 38 | " --secs-in-week NUM - Number of seconds in a week (used for debugging) \n" |
39 | 39 | " \n" |
40 | 40 | " -D, --log-file NAME - Write debug to NAME file \n" |
41 | " -d, --log-stdout - Write debug to standard output \n" | |
41 | " -d, --log-stdout BOOL - Write debug to standard output \n" | |
42 | 42 | " -z, --log-size NUM - Maximum size debug file can reach (dfl: is 10Mb) \n" |
43 | 43 | " \n" |
44 | 44 | " -c, --log-level NUM - Log verbosity \n" |
45 | " -s, --with-log-server - Redirect log messages to the log server \n" | |
45 | " -s, --with-log-server BOOL - Redirect log messages to the log server \n" | |
46 | 46 | " -S, --log-server NAME - Define assa-logd server address \n" |
47 | 47 | " -m, --mask MASK - Mask (default: ALL = 0x7fffffff) \n" |
48 | 48 | " \n" |
49 | 49 | " -h, --help - Print this messag \n" |
50 | " -v, --version - Print version number \n"; | |
50 | " -v, --version - Print version number \n" | |
51 | " \n"; | |
51 | 52 | //------------------------------------------------------------------------------ |
52 | 53 | |
53 | 54 | #include "Granule-main.h" |
80 | 81 | |
81 | 82 | GRANULE->init (&argc, argv, help_msg); |
82 | 83 | |
83 | GRANULE->initServer (); | |
84 | GRANULE->processServer (); | |
84 | GRANULE->init_service (); | |
85 | GRANULE->process_events (); | |
85 | 86 | |
86 | 87 | return GRANULE->get_exit_value (); |
87 | 88 | } |
0 | 0 | // -*- c++ -*- |
1 | 1 | // Generated by assa-genesis |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: Granule-main.h,v 1.16 2005/05/16 03:02:02 vlg Exp $ | |
3 | // $Id: Granule-main.h,v 1.17 2005/10/13 03:04:13 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // Granule-main.h |
6 | 6 | //------------------------------------------------------------------------------ |
19 | 19 | #ifndef MAIN_H |
20 | 20 | #define MAIN_H |
21 | 21 | |
22 | #include <assa/Assert.h> | |
22 | #include <assa/Assure.h> | |
23 | 23 | |
24 | 24 | using ASSA::APP; |
25 | 25 | using ASSA::TRACE; |
0 | 0 | // -*- c++ -*- |
1 | 1 | // Generated by assa-genesis |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: Granule.cpp,v 1.20 2005/06/18 18:14:26 vlg Exp $ | |
3 | // $Id: Granule.cpp,v 1.23 2005/11/22 02:28:30 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // Granule.cpp |
6 | 6 | //------------------------------------------------------------------------------ |
25 | 25 | #include <unistd.h> // access(2) |
26 | 26 | #include <stdlib.h> // system(3) |
27 | 27 | |
28 | #include <glibmm/ustring.h> | |
28 | 29 | #include <gtkmm/main.h> |
29 | 30 | |
30 | 31 | #include <assa/CommonUtils.h> |
49 | 50 | *******************************************************************************/ |
50 | 51 | Granule:: |
51 | 52 | Granule () : |
52 | m_timeout (0.01), | |
53 | m_kit (NULL), | |
54 | m_main_window (NULL), | |
55 | m_secs_in_day (86400), | |
53 | m_timeout (0.01), | |
54 | m_kit (NULL), | |
55 | m_main_window (NULL), | |
56 | m_secs_in_day (86400), | |
56 | 57 | m_secs_in_week (604800) |
57 | 58 | { |
58 | 59 | add_opt ('g', "gtk-options", &m_gtk_options ); |
67 | 68 | rm_opt ('b', "daemon" ); |
68 | 69 | rm_opt ('l', "pidfile" ); |
69 | 70 | rm_opt ('L', "ommit-pidfile"); |
70 | m_ommit_pidflock_flag = 0; // don't lock up on PID | |
71 | ||
72 | /*--- | |
73 | * By defauil disable all debugging | |
74 | *---*/ | |
75 | ||
76 | /* m_debug_mask = GRAPP | DECK | GUITRACE | ASSA::ERROR; */ | |
77 | m_debug_mask = 0; | |
78 | ||
79 | /* m_with_log_server = true; */ | |
71 | ||
72 | m_ommit_pidfile = "yes"; // don't lock up on PID | |
73 | ||
74 | /* By defauil disable all debugging | |
75 | */ | |
76 | /* m_mask = GRAPP | DECK | GUITRACE | ASSA::ERROR; */ | |
77 | m_mask = 0; | |
78 | ||
80 | 79 | m_log_file = "granule.log"; |
81 | ||
82 | 80 | } |
83 | 81 | |
84 | 82 | /** |
118 | 116 | } |
119 | 117 | |
120 | 118 | if (cfg.load () == 0) { |
121 | if (cfg.find_section ("options") != cfg.sect_end ()) { | |
122 | m_gtk_options = cfg.get_value ("options", "gtk_options"); | |
123 | ||
124 | if ((v = cfg.get_value ("options", "log_file")) != "") { | |
125 | m_log_file = v; | |
126 | } | |
127 | if ((v = cfg.get_value ("options","log_stdout")) != "") { | |
128 | m_log_stdout_flag = (v == "1" || v == "yes") ? true : false; | |
129 | } | |
130 | if ((v = cfg.get_value ("options", "log_size")) != "") { | |
131 | m_log_size = strtol (v.c_str (), NULL, 16); ; | |
132 | } | |
133 | if ((v = cfg.get_value ("options", "mask")) != "") { | |
134 | m_debug_mask = strtol (v.c_str (), NULL, 16); | |
135 | } | |
136 | if ((v = cfg.get_value ("options","log_level")) != "") { | |
137 | m_log_level = strtol (v.c_str(), NULL, 16); | |
138 | } | |
139 | } | |
119 | parse_config_file (cfg); | |
140 | 120 | } |
141 | 121 | |
142 | 122 | done: |
156 | 136 | |
157 | 137 | if (m_log_level >= 0) { |
158 | 138 | switch (m_log_level) { |
159 | case 6: m_debug_mask = ALL; break; // Log message flood! | |
160 | case 5: m_debug_mask = 0x3F; break; // ALL_APPS+ERRORS | |
161 | case 4: m_debug_mask = 0x40026; break; // +FORK | |
162 | case 3: m_debug_mask = 0x26; break; // GRAPP+GUITRACE+ERRORS | |
163 | case 2: m_debug_mask = 0x25; break; // TRACE+GUITRACE+ERRORS | |
164 | case 1: m_debug_mask = 0x22; break; // GRAPP+ERRORS | |
165 | case 0: default: m_debug_mask = 0x0; | |
139 | case 6: m_mask = ALL; break; // Log message flood! | |
140 | case 5: m_mask = 0x3F; break; // ALL_APPS+ERRORS | |
141 | case 4: m_mask = 0x40026; break; // +FORK | |
142 | case 3: m_mask = 0x26; break; // GRAPP+GUITRACE+ERRORS | |
143 | case 2: m_mask = 0x25; break; // TRACE+GUITRACE+ERRORS | |
144 | case 1: m_mask = 0x22; break; // GRAPP+ERRORS | |
145 | case 0: default: m_mask = 0x0; | |
166 | 146 | } |
167 | 147 | } |
168 | 148 | |
169 | LOGGER->enable_groups (m_debug_mask); | |
170 | ||
171 | /** Install my own entity loader | |
149 | LOGGER->enable_groups (m_mask); | |
150 | ||
151 | /** Install my own entity loader. This will let me redefine | |
152 | DTD URLs and support backward compatability. | |
172 | 153 | */ |
173 | 154 | m_default_entity_loader = xmlGetExternalEntityLoader(); |
174 | 155 | xmlSetExternalEntityLoader (my_xml_entity_loader); |
156 | ||
157 | /** Initialize XML parser | |
158 | */ | |
159 | xmlInitParser (); | |
160 | xmlIndentTreeOutput = 1; | |
175 | 161 | } |
176 | 162 | |
177 | 163 | Granule:: |
178 | 164 | ~Granule () |
179 | 165 | { |
180 | 166 | trace_with_mask("Granule::~Granule",GUITRACE); |
167 | ||
168 | /** Cleanup XML parser | |
169 | */ | |
170 | xmlCleanupParser (); | |
181 | 171 | |
182 | 172 | /** First, disconnect from the timer callback. |
183 | 173 | Failing to do so causes core dumps on exit from libsigc-2.0's |
206 | 196 | /* Rewrite the url of the granule dtds to local files so we can |
207 | 197 | * use the local dtds. |
208 | 198 | * |
209 | * Look for /etc/xml for backwards compatibility with old files | |
199 | * Look for /etc/xml for backwards compatibility with old files. | |
210 | 200 | */ |
211 | 201 | xmlParserInputPtr |
212 | 202 | Granule:: |
218 | 208 | |
219 | 209 | xmlParserInputPtr ret; |
220 | 210 | |
221 | if (url_ && id_) { | |
222 | DL ((GRAPP,"xml: url = \"%s\", id = \"%s\"\n", url_, id_)); | |
211 | if (url_) { | |
212 | DL ((GRAPP,"URL = \"%s\"\n", url_)); | |
213 | } | |
214 | ||
215 | if (id_) { | |
216 | DL ((GRAPP,"ID = \"%s\"\n", id_)); | |
223 | 217 | } |
224 | 218 | |
225 | 219 | if (strcmp (url_, "/etc/xml/granule/granule.dtd") == 0 || |
240 | 234 | |
241 | 235 | void |
242 | 236 | Granule:: |
243 | initServer () | |
244 | { | |
245 | trace_with_mask("Granule::initServer",GUITRACE); | |
237 | init_service () | |
238 | { | |
239 | trace_with_mask("Granule::init_service",GUITRACE); | |
246 | 240 | |
247 | 241 | ASSA::Log::disable_timestamp (); |
248 | 242 | int gtk_argc = 0; |
249 | 243 | char** gtk_argv = NULL; |
250 | 244 | |
251 | 245 | DL((ALL,"gtk_options = \"%s\"\n", m_gtk_options.c_str ())); |
252 | DL((ALL,"log_stdout = %s\n", m_log_stdout_flag ? "true" : "false")); | |
246 | DL((ALL,"log_stdout = %s\n", m_log_stdout.c_str ())); | |
253 | 247 | DL((ALL,"log_file = \"%s\"\n", m_log_file.c_str ())); |
254 | 248 | DL((ALL,"log_size = %d\n", m_log_size)); |
255 | 249 | DL((ALL,"log_level = \"%d\"\n", m_log_level)); |
256 | DL((ALL,"mask = 0x%X\n", m_debug_mask)); | |
250 | DL((ALL,"mask = 0x%X\n", m_mask)); | |
257 | 251 | |
258 | 252 | /** |
259 | 253 | * Block SIGCHLD for a moment |
309 | 303 | |
310 | 304 | void |
311 | 305 | Granule:: |
312 | processServer () | |
313 | { | |
314 | trace_with_mask("Granule::processServer",GUITRACE); | |
306 | process_events () | |
307 | { | |
308 | trace_with_mask("Granule::process_events",GUITRACE); | |
315 | 309 | |
316 | 310 | m_kit->run (*m_main_window); |
317 | 311 | REACTOR->stopReactor (); |
320 | 314 | /* gtk_exit (0); */ |
321 | 315 | } |
322 | 316 | |
323 | /** | |
317 | /******************************************************************************* | |
324 | 318 | * Static utilities |
325 | */ | |
319 | ******************************************************************************/ | |
326 | 320 | gchar* |
327 | 321 | Granule:: |
328 | 322 | strip_pango_markup (const char* src_) |
332 | 326 | pango_parse_markup (src_, -1, 0, &attrs, &result, NULL, NULL); |
333 | 327 | g_free (attrs); |
334 | 328 | return result; |
329 | } | |
330 | ||
331 | bool | |
332 | Granule:: | |
333 | check_markup (const Glib::ustring& str_) | |
334 | { | |
335 | PangoAttrList* attrs = NULL; | |
336 | gchar* ptext = NULL; | |
337 | gboolean ret = FALSE; | |
338 | ||
339 | ret = pango_parse_markup (str_.c_str (), -1, 0, &attrs, &ptext, NULL, NULL); | |
340 | g_free (attrs); | |
341 | g_free (ptext); | |
342 | return ret; | |
335 | 343 | } |
336 | 344 | |
337 | 345 | void |
347 | 355 | } |
348 | 356 | } |
349 | 357 | |
358 | xmlChar* | |
359 | Granule:: | |
360 | get_node_by_xpath (xmlDocPtr parser_, const char* xpath_) | |
361 | { | |
362 | xmlXPathContextPtr context = NULL; | |
363 | xmlXPathObjectPtr result = NULL; | |
364 | xmlNodeSet* nodeset = NULL; | |
365 | xmlChar* keyword = NULL; | |
366 | ||
367 | context = xmlXPathNewContext (parser_); | |
368 | if (context == NULL) { | |
369 | DL ((ASSA::ERROR,"Failed to create context.\n")); | |
370 | goto done; | |
371 | } | |
372 | ||
373 | result = xmlXPathEval (BAD_CAST xpath_, context); | |
374 | ||
375 | if (xmlXPathNodeSetIsEmpty (result->nodesetval)) { | |
376 | ||
377 | DL ((ASSA::ERROR,"Empty nodeset for xpath \"%s\"\n", xpath_)); | |
378 | goto done; | |
379 | } | |
380 | nodeset = result->nodesetval; | |
381 | ||
382 | /** We expect only one node | |
383 | */ | |
384 | // for (int i = 0; i < nodeset->nodeNr; i++) { | |
385 | keyword = xmlNodeListGetString (parser_, | |
386 | nodeset->nodeTab[0]->xmlChildrenNode, | |
387 | 1); | |
388 | // } | |
389 | ||
390 | done: | |
391 | if (result) { | |
392 | xmlXPathFreeObject (result); | |
393 | } | |
394 | if (context) { | |
395 | xmlXPathFreeContext (context); | |
396 | } | |
397 | ||
398 | return keyword; | |
399 | } |
0 | 0 | // -*- c++ -*- |
1 | 1 | // Generated by assa-genesis |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: Granule.h,v 1.14 2005/06/18 18:14:26 vlg Exp $ | |
3 | // $Id: Granule.h,v 1.16 2005/11/13 02:50:48 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // Granule.h |
6 | 6 | //------------------------------------------------------------------------------ |
21 | 21 | #ifdef HAVE_CONFIG_H |
22 | 22 | # include "config.h" |
23 | 23 | #endif |
24 | ||
25 | #include <libxml/parser.h> | |
26 | #include <libxml/xmlIO.h> | |
27 | ||
24 | 28 | #include <string> |
25 | 29 | using std::string; |
30 | ||
26 | 31 | #include <gtkmm.h> |
27 | 32 | |
28 | 33 | #include <assa/GenServer.h> |
29 | 34 | #include <assa/Singleton.h> |
30 | 35 | #include <assa/TimeVal.h> |
31 | ||
32 | #include <libxml/xmlIO.h> | |
33 | 36 | |
34 | 37 | #include "DeckManager.h" |
35 | 38 | |
45 | 48 | ~Granule (); |
46 | 49 | |
47 | 50 | virtual void init (int* argc_, char* argv_[], const char* help_); |
48 | virtual void initServer (); | |
49 | virtual void processServer (); | |
51 | ||
52 | virtual void init_service (); | |
53 | virtual void process_events (); | |
50 | 54 | |
51 | 55 | bool timer_cb (); |
52 | 56 | |
58 | 62 | my_xml_entity_loader (const char* url_, |
59 | 63 | const char* id_, |
60 | 64 | xmlParserCtxtPtr ctxt_); |
61 | public: | |
62 | static gchar* strip_pango_markup (const char* src_); | |
63 | static void remove_common_prefixes (gchar*& src_); | |
65 | ||
66 | public: // Common utilities used everywhere | |
67 | static gchar* strip_pango_markup (const char* src_); | |
68 | static void remove_common_prefixes (gchar*& src_); | |
69 | ||
70 | /** Search DOM XML parser tree for the first element that | |
71 | matches the xpath_. | |
72 | */ | |
73 | static xmlChar* get_node_by_xpath (xmlDocPtr parser_, const char* xpath_); | |
74 | ||
75 | /** Validate pango markup | |
76 | @return true on success; false if entry is invalid | |
77 | */ | |
78 | static bool check_markup (const Glib::ustring& str_); | |
64 | 79 | |
65 | 80 | private: |
66 | 81 | void dump_package_envs (); |
82 | 97 | |
83 | 98 | /* Useful definitions */ |
84 | 99 | |
85 | #define GRANULE Granule::getInstance() | |
100 | #define GRANULE Granule::get_instance() | |
86 | 101 | |
87 | #define REACTOR GRANULE->getReactor() | |
102 | #define REACTOR GRANULE->get_reactor() | |
88 | 103 | #define MAINWIN GRANULE->get_main_window() |
89 | 104 | #define DECKMGR MAINWIN->get_deck_manager() |
90 | 105 | #define DECKLIST MAINWIN->get_deck_list() |
0 | 0 | // -*- c++ -*- |
1 | 1 | // Generated by assa-genesis |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: MainWindow.cpp,v 1.42 2005/05/06 02:37:01 vlg Exp $ | |
3 | // $Id: MainWindow.cpp,v 1.44 2005/11/22 02:28:30 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // MainWindow.cpp |
6 | 6 | //------------------------------------------------------------------------------ |
7 | // Copyright (c) 2004 by Vladislav Grinchenko | |
7 | // Copyright (c) 2004,2005 by Vladislav Grinchenko | |
8 | 8 | // |
9 | 9 | // This program is free software; you can redistribute it and/or |
10 | 10 | // modify it under the terms of the GNU General Public License |
184 | 184 | |
185 | 185 | exit_cb (); |
186 | 186 | this->hide (); |
187 | GRANULE->setStopServerFlag (); | |
187 | GRANULE->stop_service (); | |
188 | 188 | |
189 | 189 | return true; |
190 | 190 | } |
353 | 353 | { |
354 | 354 | trace_with_mask("MainWindow::save_as_cb",GUITRACE); |
355 | 355 | |
356 | bool was_dirty = false; | |
357 | ||
356 | 358 | switch (m_state) |
357 | 359 | { |
358 | 360 | case Start: /* ignored */ |
364 | 366 | break; |
365 | 367 | |
366 | 368 | case Dirty: |
369 | was_dirty = true; | |
367 | 370 | go_state (Clean); |
368 | 371 | |
369 | 372 | case Clean: |
370 | save_file_as (); | |
373 | if (save_file_as () < 0 && was_dirty) { | |
374 | go_state (Dirty); | |
375 | } | |
371 | 376 | set_mw_name (); |
372 | 377 | break; |
373 | 378 | |
529 | 534 | set_title (_(title.c_str ())); |
530 | 535 | } |
531 | 536 | |
532 | void | |
537 | int | |
533 | 538 | MainWindow:: |
534 | 539 | save_file_as () |
535 | 540 | { |
549 | 554 | f.set_filter (filter_cdf); |
550 | 555 | |
551 | 556 | if (f.run () != Gtk::RESPONSE_OK) { |
552 | return; | |
553 | } | |
557 | return -1; | |
558 | } | |
559 | ||
554 | 560 | m_cardbox->save_as (f.get_filename ()); |
561 | return 0; | |
555 | 562 | } |
556 | 563 | |
557 | 564 | /** |
0 | 0 | // -*- c++ -*- |
1 | 1 | // Generated by assa-genesis |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: MainWindow.h,v 1.25 2005/05/06 02:37:01 vlg Exp $ | |
3 | // $Id: MainWindow.h,v 1.26 2005/11/22 02:28:30 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // MainWindow.h |
6 | 6 | //------------------------------------------------------------------------------ |
96 | 96 | // -*- Internal actions -*- |
97 | 97 | int open_file (); |
98 | 98 | int save_file (); |
99 | void save_file_as (); | |
99 | int save_file_as (); | |
100 | 100 | void close_file (); |
101 | 101 | void go_state (WMState state_); |
102 | 102 | bool change_preferences (); |
1 | 1 | # ------------------------------------------------------------------------------ |
2 | 2 | # src/Makefile.am |
3 | 3 | # |
4 | # $Id: Makefile.am,v 1.24 2005/06/09 03:04:52 vlg Exp $ | |
4 | # $Id: Makefile.am,v 1.25 2005/11/14 04:11:21 vlg Exp $ | |
5 | 5 | # ------------------------------------------------------------------------------ |
6 | 6 | |
7 | 7 | bin_PROGRAMS = granule |
24 | 24 | Card.h Card.cpp \ |
25 | 25 | CardView.h CardView.cpp \ |
26 | 26 | CardViewHelpDialog.h CardViewHelpDialog.cpp \ |
27 | EditControls.h EditControls.cpp \ | |
27 | 28 | FileOpen.h \ |
28 | 29 | Config.h Config.cpp \ |
29 | 30 | TopMenuBar.h TopMenuBar.cpp \ |
17 | 17 | # ------------------------------------------------------------------------------ |
18 | 18 | # src/Makefile.am |
19 | 19 | # |
20 | # $Id: Makefile.am,v 1.24 2005/06/09 03:04:52 vlg Exp $ | |
20 | # $Id: Makefile.am,v 1.25 2005/11/14 04:11:21 vlg Exp $ | |
21 | 21 | # ------------------------------------------------------------------------------ |
22 | 22 | |
23 | 23 | SOURCES = $(granule_SOURCES) |
61 | 61 | DeckView.$(OBJEXT) DeckInfo.$(OBJEXT) DeckPlayer.$(OBJEXT) \ |
62 | 62 | DeckManager.$(OBJEXT) DeckList.$(OBJEXT) VCard.$(OBJEXT) \ |
63 | 63 | CardRef.$(OBJEXT) Card.$(OBJEXT) CardView.$(OBJEXT) \ |
64 | CardViewHelpDialog.$(OBJEXT) Config.$(OBJEXT) \ | |
65 | TopMenuBar.$(OBJEXT) GeneralPref.$(OBJEXT) \ | |
64 | CardViewHelpDialog.$(OBJEXT) EditControls.$(OBJEXT) \ | |
65 | Config.$(OBJEXT) TopMenuBar.$(OBJEXT) GeneralPref.$(OBJEXT) \ | |
66 | 66 | SchedulingPrefs.$(OBJEXT) SoundPrefs.$(OBJEXT) \ |
67 | 67 | GeometryPrefs.$(OBJEXT) PrefWindow.$(OBJEXT) \ |
68 | 68 | MyPropertyBox.$(OBJEXT) ButtonWithImageLabel.$(OBJEXT) \ |
82 | 82 | @AMDEP_TRUE@ ./$(DEPDIR)/DeckInfo.Po ./$(DEPDIR)/DeckList.Po \ |
83 | 83 | @AMDEP_TRUE@ ./$(DEPDIR)/DeckManager.Po \ |
84 | 84 | @AMDEP_TRUE@ ./$(DEPDIR)/DeckPlayer.Po ./$(DEPDIR)/DeckView.Po \ |
85 | @AMDEP_TRUE@ ./$(DEPDIR)/EditControls.Po \ | |
85 | 86 | @AMDEP_TRUE@ ./$(DEPDIR)/GeneralPref.Po \ |
86 | 87 | @AMDEP_TRUE@ ./$(DEPDIR)/GeometryPrefs.Po \ |
87 | 88 | @AMDEP_TRUE@ ./$(DEPDIR)/Granule-main.Po ./$(DEPDIR)/Granule.Po \ |
279 | 280 | Card.h Card.cpp \ |
280 | 281 | CardView.h CardView.cpp \ |
281 | 282 | CardViewHelpDialog.h CardViewHelpDialog.cpp \ |
283 | EditControls.h EditControls.cpp \ | |
282 | 284 | FileOpen.h \ |
283 | 285 | Config.h Config.cpp \ |
284 | 286 | TopMenuBar.h TopMenuBar.cpp \ |
403 | 405 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeckManager.Po@am__quote@ |
404 | 406 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeckPlayer.Po@am__quote@ |
405 | 407 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeckView.Po@am__quote@ |
408 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EditControls.Po@am__quote@ | |
406 | 409 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GeneralPref.Po@am__quote@ |
407 | 410 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GeometryPrefs.Po@am__quote@ |
408 | 411 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Granule-main.Po@am__quote@ |
0 | 0 | // -*- c++ -*- |
1 | 1 | // generated by glade-- |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: SchedulingPrefs.cpp,v 1.3 2004/07/06 04:34:23 vlg Exp $ | |
3 | // $Id: SchedulingPrefs.cpp,v 1.4 2005/11/21 03:58:10 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // SchedulingPref.h |
6 | 6 | //------------------------------------------------------------------------------ |
22 | 22 | #include "SchedulingPrefs.h" |
23 | 23 | #include "PrefWindow.h" |
24 | 24 | |
25 | #define SET_TITLE_LABEL(tl) \ | |
26 | tl->set_alignment(0,0.5); \ | |
27 | tl->set_padding(0,0); \ | |
28 | tl->set_justify(Gtk::JUSTIFY_LEFT); \ | |
29 | tl->set_line_wrap(false); \ | |
30 | tl->set_use_markup(false); \ | |
31 | tl->set_selectable(false); | |
32 | ||
25 | 33 | SchedulingPrefs:: |
26 | 34 | SchedulingPrefs (PrefWindow& pwin_) : |
27 | 35 | VBox(false, 0), |
30 | 38 | trace_with_mask("SchedulingPref::SchedulingPrefs",GUITRACE); |
31 | 39 | int i; |
32 | 40 | |
33 | Gtk::Label *label_b010 = Gtk::manage(new Gtk::Label(" days ")); | |
34 | Gtk::Label *label_b020 = Gtk::manage(new Gtk::Label(" days ")); | |
35 | Gtk::Label *label_b030 = Gtk::manage(new Gtk::Label(" days ")); | |
36 | Gtk::Label *label_b040 = Gtk::manage(new Gtk::Label(" days ")); | |
37 | Gtk::Label *label_b050 = Gtk::manage(new Gtk::Label(" days ")); | |
38 | Gtk::Label *label_b001 = Gtk::manage(new Gtk::Label(" weeks ")); | |
39 | Gtk::Label *label_b002 = Gtk::manage(new Gtk::Label(" weeks ")); | |
40 | Gtk::Label *label_b003 = Gtk::manage(new Gtk::Label(" weeks ")); | |
41 | Gtk::Label *label_b004 = Gtk::manage(new Gtk::Label(" weeks ")); | |
42 | Gtk::Label *label_b005 = Gtk::manage(new Gtk::Label(" weeks ")); | |
41 | Gtk::Label* label_b01000 = Gtk::manage(new Gtk::Label(" weeks ")); | |
42 | Gtk::Label* label_b02000 = Gtk::manage(new Gtk::Label(" weeks ")); | |
43 | Gtk::Label* label_b03000 = Gtk::manage(new Gtk::Label(" weeks ")); | |
44 | Gtk::Label* label_b04000 = Gtk::manage(new Gtk::Label(" weeks ")); | |
45 | Gtk::Label* label_b05000 = Gtk::manage(new Gtk::Label(" weeks ")); | |
46 | Gtk::Label* label_b00100 = Gtk::manage(new Gtk::Label(" days ")); | |
47 | Gtk::Label* label_b00200 = Gtk::manage(new Gtk::Label(" days ")); | |
48 | Gtk::Label* label_b00300 = Gtk::manage(new Gtk::Label(" days ")); | |
49 | Gtk::Label* label_b00400 = Gtk::manage(new Gtk::Label(" days ")); | |
50 | Gtk::Label* label_b00500 = Gtk::manage(new Gtk::Label(" days ")); | |
51 | Gtk::Label* label_b00010 = Gtk::manage(new Gtk::Label(" hours ")); | |
52 | Gtk::Label* label_b00020 = Gtk::manage(new Gtk::Label(" hours ")); | |
53 | Gtk::Label* label_b00030 = Gtk::manage(new Gtk::Label(" hours ")); | |
54 | Gtk::Label* label_b00040 = Gtk::manage(new Gtk::Label(" hours ")); | |
55 | Gtk::Label* label_b00050 = Gtk::manage(new Gtk::Label(" hours ")); | |
56 | Gtk::Label* label_b00001 = Gtk::manage(new Gtk::Label(" mins ")); | |
57 | Gtk::Label* label_b00002 = Gtk::manage(new Gtk::Label(" mins ")); | |
58 | Gtk::Label* label_b00003 = Gtk::manage(new Gtk::Label(" mins ")); | |
59 | Gtk::Label* label_b00004 = Gtk::manage(new Gtk::Label(" mins ")); | |
60 | Gtk::Label* label_b00005 = Gtk::manage(new Gtk::Label(" mins ")); | |
61 | ||
62 | SET_TITLE_LABEL(label_b01000); | |
63 | SET_TITLE_LABEL(label_b02000); | |
64 | SET_TITLE_LABEL(label_b03000); | |
65 | SET_TITLE_LABEL(label_b04000); | |
66 | SET_TITLE_LABEL(label_b05000); | |
67 | SET_TITLE_LABEL(label_b00100); | |
68 | SET_TITLE_LABEL(label_b00200); | |
69 | SET_TITLE_LABEL(label_b00300); | |
70 | SET_TITLE_LABEL(label_b00400); | |
71 | SET_TITLE_LABEL(label_b00500); | |
72 | SET_TITLE_LABEL(label_b00010); | |
73 | SET_TITLE_LABEL(label_b00020); | |
74 | SET_TITLE_LABEL(label_b00030); | |
75 | SET_TITLE_LABEL(label_b00040); | |
76 | SET_TITLE_LABEL(label_b00050); | |
77 | SET_TITLE_LABEL(label_b00001); | |
78 | SET_TITLE_LABEL(label_b00002); | |
79 | SET_TITLE_LABEL(label_b00003); | |
80 | SET_TITLE_LABEL(label_b00004); | |
81 | SET_TITLE_LABEL(label_b00005); | |
43 | 82 | |
44 | 83 | for (i = 0 ; i < CARD_BOX_SIZE; i++) { |
84 | m_week_entry [i] = Gtk::manage(new Gtk::Entry()); | |
45 | 85 | m_day_entry [i] = Gtk::manage(new Gtk::Entry()); |
46 | m_week_entry [i] = Gtk::manage(new Gtk::Entry()); | |
47 | } | |
48 | ||
49 | Gtk::Label *label_b100 = Gtk::manage(new Gtk::Label("In Box 1 after ")); | |
50 | Gtk::Label *label_b200 = Gtk::manage(new Gtk::Label("In Box 2 after ")); | |
51 | Gtk::Label *label_b300 = Gtk::manage(new Gtk::Label("In Box 3 after ")); | |
52 | Gtk::Label *label_b400 = Gtk::manage(new Gtk::Label("In Box 4 after ")); | |
53 | Gtk::Label *label_b500 = Gtk::manage(new Gtk::Label("In Box 5 after ")); | |
54 | ||
55 | m_sched_table = Gtk::manage(new Gtk::Table(2, 2, false)); | |
86 | m_hour_entry [i] = Gtk::manage(new Gtk::Entry()); | |
87 | m_mins_entry [i] = Gtk::manage(new Gtk::Entry()); | |
88 | } | |
89 | ||
90 | Gtk::Label* label_t100 = Gtk::manage(new Gtk::Label("In Box 1 after ")); | |
91 | Gtk::Label* label_t200 = Gtk::manage(new Gtk::Label("In Box 2 after ")); | |
92 | Gtk::Label* label_t300 = Gtk::manage(new Gtk::Label("In Box 3 after ")); | |
93 | Gtk::Label* label_t400 = Gtk::manage(new Gtk::Label("In Box 4 after ")); | |
94 | Gtk::Label* label_t500 = Gtk::manage(new Gtk::Label("In Box 5 after ")); | |
95 | ||
96 | m_sched_table = Gtk::manage(new Gtk::Table(5, 10, false)); | |
56 | 97 | |
57 | Gtk::Label *frame_label = Gtk::manage(new Gtk::Label("Review Cards")); | |
58 | Gtk::Frame *m_frame = Gtk::manage(new Gtk::Frame()); | |
59 | ||
60 | label_b010->set_alignment(0,0.5); | |
61 | label_b010->set_padding(0,0); | |
62 | label_b010->set_justify(Gtk::JUSTIFY_LEFT); | |
63 | label_b010->set_line_wrap(false); | |
64 | label_b010->set_use_markup(false); | |
65 | label_b010->set_selectable(false); | |
66 | label_b020->set_alignment(0,0.5); | |
67 | label_b020->set_padding(0,0); | |
68 | label_b020->set_justify(Gtk::JUSTIFY_LEFT); | |
69 | label_b020->set_line_wrap(false); | |
70 | label_b020->set_use_markup(false); | |
71 | label_b020->set_selectable(false); | |
72 | label_b030->set_alignment(0,0.5); | |
73 | label_b030->set_padding(0,0); | |
74 | label_b030->set_justify(Gtk::JUSTIFY_LEFT); | |
75 | label_b030->set_line_wrap(false); | |
76 | label_b030->set_use_markup(false); | |
77 | label_b030->set_selectable(false); | |
78 | label_b040->set_alignment(0,0.5); | |
79 | label_b040->set_padding(0,0); | |
80 | label_b040->set_justify(Gtk::JUSTIFY_LEFT); | |
81 | label_b040->set_line_wrap(false); | |
82 | label_b040->set_use_markup(false); | |
83 | label_b040->set_selectable(false); | |
84 | label_b050->set_alignment(0,0.5); | |
85 | label_b050->set_padding(0,0); | |
86 | label_b050->set_justify(Gtk::JUSTIFY_LEFT); | |
87 | label_b050->set_line_wrap(false); | |
88 | label_b050->set_use_markup(false); | |
89 | label_b050->set_selectable(false); | |
90 | label_b001->set_alignment(0,0.5); | |
91 | label_b001->set_padding(0,0); | |
92 | label_b001->set_justify(Gtk::JUSTIFY_LEFT); | |
93 | label_b001->set_line_wrap(false); | |
94 | label_b001->set_use_markup(false); | |
95 | label_b001->set_selectable(false); | |
96 | label_b002->set_alignment(0,0.5); | |
97 | label_b002->set_padding(0,0); | |
98 | label_b002->set_justify(Gtk::JUSTIFY_LEFT); | |
99 | label_b002->set_line_wrap(false); | |
100 | label_b002->set_use_markup(false); | |
101 | label_b002->set_selectable(false); | |
102 | label_b003->set_alignment(0,0.5); | |
103 | label_b003->set_padding(0,0); | |
104 | label_b003->set_justify(Gtk::JUSTIFY_LEFT); | |
105 | label_b003->set_line_wrap(false); | |
106 | label_b003->set_use_markup(false); | |
107 | label_b003->set_selectable(false); | |
108 | label_b004->set_alignment(0,0.5); | |
109 | label_b004->set_padding(0,0); | |
110 | label_b004->set_justify(Gtk::JUSTIFY_LEFT); | |
111 | label_b004->set_line_wrap(false); | |
112 | label_b004->set_use_markup(false); | |
113 | label_b004->set_selectable(false); | |
114 | label_b005->set_alignment(0,0.5); | |
115 | label_b005->set_padding(0,0); | |
116 | label_b005->set_justify(Gtk::JUSTIFY_LEFT); | |
117 | label_b005->set_line_wrap(false); | |
118 | label_b005->set_use_markup(false); | |
119 | label_b005->set_selectable(false); | |
98 | Gtk::Label* frame_label = Gtk::manage(new Gtk::Label("Review Cards")); | |
99 | Gtk::Frame* m_frame = Gtk::manage(new Gtk::Frame()); | |
100 | ||
120 | 101 | |
121 | 102 | for (i = 0; i < CARD_BOX_SIZE; i++) { |
103 | m_week_entry [i]->set_flags(Gtk::CAN_FOCUS); | |
104 | m_week_entry [i]->set_visibility(true); | |
105 | m_week_entry [i]->set_editable(true); | |
106 | m_week_entry [i]->set_max_length(0); | |
107 | m_week_entry [i]->set_has_frame(true); | |
108 | m_week_entry [i]->set_activates_default(false); | |
109 | m_week_entry [i]->set_width_chars(3); | |
110 | ||
122 | 111 | m_day_entry [i]->set_flags(Gtk::CAN_FOCUS); |
123 | 112 | m_day_entry [i]->set_visibility(true); |
124 | 113 | m_day_entry [i]->set_editable(true); |
125 | 114 | m_day_entry [i]->set_max_length(0); |
126 | m_day_entry [i]->set_text("3"); | |
127 | 115 | m_day_entry [i]->set_has_frame(true); |
128 | 116 | m_day_entry [i]->set_activates_default(false); |
129 | 117 | m_day_entry [i]->set_width_chars(3); |
130 | 118 | |
131 | m_week_entry [i]->set_flags(Gtk::CAN_FOCUS); | |
132 | m_week_entry [i]->set_visibility(true); | |
133 | m_week_entry [i]->set_editable(true); | |
134 | m_week_entry [i]->set_max_length(0); | |
135 | m_week_entry [i]->set_text("0"); | |
136 | m_week_entry [i]->set_has_frame(true); | |
137 | m_week_entry [i]->set_activates_default(false); | |
138 | m_week_entry [i]->set_width_chars(3); | |
139 | } | |
140 | ||
141 | label_b100->set_alignment(0,0.5); | |
142 | label_b100->set_padding(0,0); | |
143 | label_b100->set_justify(Gtk::JUSTIFY_LEFT); | |
144 | label_b100->set_line_wrap(false); | |
145 | label_b100->set_use_markup(false); | |
146 | label_b100->set_selectable(false); | |
147 | label_b200->set_alignment(0,0.5); | |
148 | label_b200->set_padding(0,0); | |
149 | label_b200->set_justify(Gtk::JUSTIFY_LEFT); | |
150 | label_b200->set_line_wrap(false); | |
151 | label_b200->set_use_markup(false); | |
152 | label_b200->set_selectable(false); | |
153 | label_b300->set_alignment(0,0.5); | |
154 | label_b300->set_padding(0,0); | |
155 | label_b300->set_justify(Gtk::JUSTIFY_LEFT); | |
156 | label_b300->set_line_wrap(false); | |
157 | label_b300->set_use_markup(false); | |
158 | label_b300->set_selectable(false); | |
159 | label_b400->set_alignment(0,0.5); | |
160 | label_b400->set_padding(0,0); | |
161 | label_b400->set_justify(Gtk::JUSTIFY_LEFT); | |
162 | label_b400->set_line_wrap(false); | |
163 | label_b400->set_use_markup(false); | |
164 | label_b400->set_selectable(false); | |
165 | label_b500->set_alignment(0,0.5); | |
166 | label_b500->set_padding(0,0); | |
167 | label_b500->set_justify(Gtk::JUSTIFY_LEFT); | |
168 | label_b500->set_line_wrap(false); | |
169 | label_b500->set_use_markup(false); | |
170 | label_b500->set_selectable(false); | |
119 | m_hour_entry [i]->set_flags(Gtk::CAN_FOCUS); | |
120 | m_hour_entry [i]->set_visibility(true); | |
121 | m_hour_entry [i]->set_editable(true); | |
122 | m_hour_entry [i]->set_max_length(0); | |
123 | m_hour_entry [i]->set_has_frame(true); | |
124 | m_hour_entry [i]->set_activates_default(false); | |
125 | m_hour_entry [i]->set_width_chars(3); | |
126 | ||
127 | m_mins_entry [i]->set_flags(Gtk::CAN_FOCUS); | |
128 | m_mins_entry [i]->set_visibility(true); | |
129 | m_mins_entry [i]->set_editable(true); | |
130 | m_mins_entry [i]->set_max_length(0); | |
131 | m_mins_entry [i]->set_has_frame(true); | |
132 | m_mins_entry [i]->set_activates_default(false); | |
133 | m_mins_entry [i]->set_width_chars(3); | |
134 | } | |
135 | ||
136 | SET_TITLE_LABEL(label_t100); | |
137 | SET_TITLE_LABEL(label_t200); | |
138 | SET_TITLE_LABEL(label_t300); | |
139 | SET_TITLE_LABEL(label_t400); | |
140 | SET_TITLE_LABEL(label_t500); | |
171 | 141 | |
172 | 142 | m_sched_table->set_size_request(-1,-1); |
173 | 143 | m_sched_table->set_row_spacings(3); |
174 | 144 | m_sched_table->set_col_spacings(2); |
175 | 145 | |
176 | m_sched_table->attach(*label_b010,2,3,0,1, | |
177 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
178 | m_sched_table->attach(*label_b020,2,3,1,2, | |
179 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
180 | m_sched_table->attach(*label_b030,2,3,2,3, | |
181 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
182 | m_sched_table->attach(*label_b040,2,3,3,4, | |
183 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
184 | m_sched_table->attach(*label_b050,2,3,4,5, | |
185 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
186 | m_sched_table->attach(*label_b001,4,5,0,1, | |
187 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
188 | m_sched_table->attach(*label_b002,4,5,1,2, | |
189 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
190 | m_sched_table->attach(*label_b003,4,5,2,3, | |
191 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
192 | m_sched_table->attach(*label_b004,4,5,3,4, | |
193 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
194 | m_sched_table->attach(*label_b005,4,5,4,5, | |
146 | /** Attach labels (left, right, top, bottom) | |
147 | */ | |
148 | m_sched_table->attach(*label_b01000,2,3,0,1, | |
149 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
150 | m_sched_table->attach(*label_b02000,2,3,1,2, | |
151 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
152 | m_sched_table->attach(*label_b03000,2,3,2,3, | |
153 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
154 | m_sched_table->attach(*label_b04000,2,3,3,4, | |
155 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
156 | m_sched_table->attach(*label_b05000,2,3,4,5, | |
157 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
158 | ||
159 | m_sched_table->attach(*label_b00100,4,5,0,1, | |
160 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
161 | m_sched_table->attach(*label_b00200,4,5,1,2, | |
162 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
163 | m_sched_table->attach(*label_b00300,4,5,2,3, | |
164 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
165 | m_sched_table->attach(*label_b00400,4,5,3,4, | |
166 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
167 | m_sched_table->attach(*label_b00500,4,5,4,5, | |
168 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
169 | ||
170 | m_sched_table->attach(*label_b00010,6,7,0,1, | |
171 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
172 | m_sched_table->attach(*label_b00020,6,7,1,2, | |
173 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
174 | m_sched_table->attach(*label_b00030,6,7,2,3, | |
175 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
176 | m_sched_table->attach(*label_b00040,6,7,3,4, | |
177 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
178 | m_sched_table->attach(*label_b00050,6,7,4,5, | |
179 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
180 | ||
181 | m_sched_table->attach(*label_b00001,8,9,0,1, | |
182 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
183 | m_sched_table->attach(*label_b00002,8,9,1,2, | |
184 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
185 | m_sched_table->attach(*label_b00003,8,9,2,3, | |
186 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
187 | m_sched_table->attach(*label_b00004,8,9,3,4, | |
188 | Gtk::FILL,Gtk::AttachOptions(),0,0); | |
189 | m_sched_table->attach(*label_b00005,8,9,4,5, | |
195 | 190 | Gtk::FILL,Gtk::AttachOptions(),0,0); |
196 | 191 | |
197 | 192 | for (i = 0; i < CARD_BOX_SIZE; i++) { |
198 | m_sched_table->attach(*m_day_entry [i], 1,2,i,i+1, | |
199 | Gtk::EXPAND|Gtk::FILL,Gtk::AttachOptions(),0,0); | |
200 | ||
201 | m_sched_table->attach(*m_week_entry [i], 3,4,i,i+1, | |
202 | Gtk::EXPAND|Gtk::FILL,Gtk::AttachOptions(),0,0); | |
203 | } | |
204 | ||
205 | m_sched_table->attach(*label_b100,0,1,0,1, | |
206 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
207 | m_sched_table->attach(*label_b200,0,1,1,2, | |
208 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
209 | m_sched_table->attach(*label_b300,0,1,2,3, | |
210 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
211 | m_sched_table->attach(*label_b400,0,1,3,4, | |
212 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
213 | m_sched_table->attach(*label_b500,0,1,4,5, | |
193 | m_sched_table->attach(*m_week_entry [i], 1,2,i,i+1, | |
194 | Gtk::EXPAND|Gtk::FILL,Gtk::AttachOptions(),0,0); | |
195 | ||
196 | m_sched_table->attach(*m_day_entry [i], 3,4,i,i+1, | |
197 | Gtk::EXPAND|Gtk::FILL,Gtk::AttachOptions(),0,0); | |
198 | ||
199 | m_sched_table->attach(*m_hour_entry [i], 5,6,i,i+1, | |
200 | Gtk::EXPAND|Gtk::FILL,Gtk::AttachOptions(),0,0); | |
201 | ||
202 | m_sched_table->attach(*m_mins_entry [i], 7,8,i,i+1, | |
203 | Gtk::EXPAND|Gtk::FILL,Gtk::AttachOptions(),0,0); | |
204 | } | |
205 | ||
206 | m_sched_table->attach(*label_t100,0,1,0,1, | |
207 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
208 | m_sched_table->attach(*label_t200,0,1,1,2, | |
209 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
210 | m_sched_table->attach(*label_t300,0,1,2,3, | |
211 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
212 | m_sched_table->attach(*label_t400,0,1,3,4, | |
213 | Gtk::FILL,Gtk::AttachOptions(),4,0); | |
214 | m_sched_table->attach(*label_t500,0,1,4,5, | |
214 | 215 | Gtk::FILL,Gtk::AttachOptions(),4,0); |
215 | 216 | |
216 | 217 | frame_label->set_alignment(0.5,0.5); |
227 | 228 | m_frame->set_label_widget(*frame_label); |
228 | 229 | |
229 | 230 | for (i = 0; i < CARD_BOX_SIZE; i++) { |
231 | m_week_entry [i]->signal_changed().connect ( | |
232 | sigc::mem_fun (m_pref_window, &PrefWindow::changed_cb)); | |
233 | ||
230 | 234 | m_day_entry [i]->signal_changed().connect ( |
231 | 235 | sigc::mem_fun (m_pref_window, &PrefWindow::changed_cb)); |
232 | 236 | |
233 | m_week_entry [i]->signal_changed().connect ( | |
234 | sigc::mem_fun (m_pref_window, &PrefWindow::changed_cb)); | |
235 | ||
236 | m_day_entry [i]->show (); | |
237 | m_hour_entry [i]->signal_changed().connect ( | |
238 | sigc::mem_fun (m_pref_window, &PrefWindow::changed_cb)); | |
239 | ||
240 | m_mins_entry [i]->signal_changed().connect ( | |
241 | sigc::mem_fun (m_pref_window, &PrefWindow::changed_cb)); | |
242 | ||
237 | 243 | m_week_entry [i]->show (); |
244 | m_day_entry [i]->show (); | |
245 | m_hour_entry [i]->show (); | |
246 | m_mins_entry [i]->show (); | |
247 | ||
238 | 248 | } |
239 | 249 | |
240 | 250 | set_border_width(18); |
256 | 266 | trace_with_mask("SchedulingPrefs::load_from_config",GUITRACE); |
257 | 267 | |
258 | 268 | for (int i = 0; i < CARD_BOX_SIZE; i++) { |
269 | m_week_entry [i]->set_text (CONFIG->get_sched_review_weeks (i)); | |
259 | 270 | m_day_entry [i]->set_text (CONFIG->get_sched_review_days (i)); |
260 | m_week_entry [i]->set_text (CONFIG->get_sched_review_weeks (i)); | |
271 | m_hour_entry [i]->set_text (CONFIG->get_sched_review_hours (i)); | |
272 | m_mins_entry [i]->set_text (CONFIG->get_sched_review_mins (i)); | |
261 | 273 | } |
262 | 274 | } |
263 | 275 | |
268 | 280 | trace_with_mask("SchedulingPrefs::save_to_config",GUITRACE); |
269 | 281 | |
270 | 282 | for (int i = 0; i < CARD_BOX_SIZE; i++) { |
271 | CONFIG->set_sched_review_days (i, m_day_entry [i] ->get_text ()); | |
272 | 283 | CONFIG->set_sched_review_weeks (i, m_week_entry [i]->get_text ()); |
273 | } | |
274 | } | |
284 | CONFIG->set_sched_review_days (i, m_day_entry [i]->get_text ()); | |
285 | CONFIG->set_sched_review_hours (i, m_hour_entry [i]->get_text ()); | |
286 | CONFIG->set_sched_review_mins (i, m_mins_entry [i]->get_text ()); | |
287 | } | |
288 | } |
0 | 0 | // -*- c++ -*- |
1 | 1 | // generated by glade-- |
2 | 2 | //------------------------------------------------------------------------------ |
3 | // $Id: SchedulingPrefs.h,v 1.2 2004/06/01 03:52:29 vlg Exp $ | |
3 | // $Id: SchedulingPrefs.h,v 1.3 2005/11/21 03:58:10 vlg Exp $ | |
4 | 4 | //------------------------------------------------------------------------------ |
5 | 5 | // SchedulingPref.h |
6 | 6 | //------------------------------------------------------------------------------ |
40 | 40 | Gtk::Table* m_sched_table; |
41 | 41 | |
42 | 42 | Gtk::Entry* m_week_entry [CARD_BOX_SIZE]; |
43 | Gtk::Entry* m_day_entry [CARD_BOX_SIZE]; | |
43 | Gtk::Entry* m_day_entry [CARD_BOX_SIZE]; | |
44 | Gtk::Entry* m_hour_entry [CARD_BOX_SIZE]; | |
45 | Gtk::Entry* m_mins_entry [CARD_BOX_SIZE]; | |
44 | 46 | }; |
45 | 47 | |
46 | 48 | #endif |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // TopMenuBar.cpp |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: TopMenuBar.cpp,v 1.20 2005/05/16 03:02:02 vlg Exp $ | |
4 | // $Id: TopMenuBar.cpp,v 1.21 2005/10/13 03:04:13 vlg Exp $ | |
5 | 5 | //------------------------------------------------------------------------------ |
6 | 6 | // Copyright (c) 2004 by Vladislav Grinchenko |
7 | 7 | // |
15 | 15 | |
16 | 16 | #include <gtkmm/stock.h> |
17 | 17 | |
18 | #include <assa/Assert.h> | |
18 | #include <assa/Assure.h> | |
19 | 19 | |
20 | 20 | #include "Granule.h" |
21 | 21 | #include "TopMenuBar.h" |
237 | 237 | if (m_menu_bar == NULL) { |
238 | 238 | DL((ASSA::ERROR, |
239 | 239 | "TopMenuBar::get_menu_bar() : m_menu_bar uninitialized!\n")); |
240 | Assert_exit (false); | |
240 | Assure_exit (false); | |
241 | 241 | } |
242 | 242 | return m_menu_bar; |
243 | 243 | } |
1 | 1 | //------------------------------------------------------------------------------ |
2 | 2 | // VDeck.h |
3 | 3 | //------------------------------------------------------------------------------ |
4 | // $Id: VDeck.h,v 1.6 2004/11/14 06:00:49 vlg Exp $ | |
4 | // $Id: VDeck.h,v 1.7 2005/11/13 02:50:48 vlg Exp $ | |
5 | 5 | // |
6 | 6 | // Copyright (c) 2004 by Vladislav Grinchenko |
7 | 7 | // |
20 | 20 | #include <vector> |
21 | 21 | |
22 | 22 | #include <glibmm/ustring.h> |
23 | #include <libxml++/libxml++.h> | |
23 | ||
24 | #include <libxml/encoding.h> | |
25 | #include <libxml/xmlwriter.h> | |
26 | #include <libxml/xpath.h> | |
27 | #include <libxml/xpathInternals.h> | |
28 | #include <libxml/parserInternals.h> | |
24 | 29 | |
25 | 30 | #include "Granule-main.h" |
26 | 31 | |
36 | 41 | public: |
37 | 42 | virtual ~VDeck (); |
38 | 43 | |
39 | virtual void load (const string& fname_) { /* no-op */ } | |
44 | virtual int load (const string& fname_) { return -1; } | |
40 | 45 | virtual int save () { return 0; } |
41 | 46 | virtual int save_as (const string& fname_) { return 0; } |
42 | 47 | |
49 | 54 | virtual size_t size () const = 0; |
50 | 55 | virtual bool empty () const = 0; |
51 | 56 | |
52 | virtual void push_back (VCard* card_) = 0; | |
53 | virtual void erase (cardlist_iterator iter_) = 0; | |
54 | virtual bool erase (VCard* card_) = 0; | |
57 | virtual void push_back (VCard* card_) = 0; | |
58 | virtual void erase (cardlist_iterator iter_) = 0; | |
59 | virtual bool erase (VCard* card_) = 0; | |
55 | 60 | |
56 | 61 | virtual void play_card (VDeck::cardlist_iterator& iter_) = 0; |
57 | 62 |