debian/0000755000000000000000000000000012111473153007164 5ustar debian/stardict-common.lintian-overrides0000644000000000000000000000113511640545277015664 0ustar # # These directories are reserved for dictionary file. # stardict-common: package-contains-empty-directory usr/share/stardict/dic/ stardict-common: package-contains-empty-directory usr/share/stardict/treedict/ # # The stardict-common corss depends on both stardict | stardict-gtk binary # packages which both provide 'stardict' executable binary, so we put # .desktop and debain menu entry in stardict-common. # stardict-common: desktop-command-not-in-package usr/share/applications/stardict.desktop stardict stardict-common: menu-command-not-in-package usr/share/menu/stardict-common:9 usr/bin/stardict debian/stardict-plugin.preinst0000644000000000000000000000023012111472253013676 0ustar #!/bin/sh set -e case "$1" in upgrade) DOCDIR=/usr/share/doc/stardict-plugin if [ -L $DOCDIR ]; then rm $DOCDIR fi ;; esac #DEBHELPER# debian/rules0000755000000000000000000000152711645623207010261 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 %: dh $@ override_dh_auto_configure: ./autogen.sh # Add here commands to compile the package without gnome support. dh_auto_configure -- \ --disable-schemas-install \ --disable-gnome-support \ --disable-gucharmap \ --disable-advertisement \ --disable-updateinfo sed -e 's/SUBDIRS = m4 src stardict-plugins/SUBDIRS = m4 src/' Makefile > Makefile-noplugins $(MAKE) -f Makefile-noplugins # Make a copy for stardict without gnome support. cp src/stardict stardict make distclean # Add here commands to compile the package with gnome support dh_auto_configure -- \ --disable-schemas-install \ --disable-advertisement \ --disable-gucharmap \ --disable-updateinfo $(MAKE) override_dh_auto_clean: # Clean up rm -f stardict-gtk override_dh_auto_test: # Disable check failed in tests/. debian/copyright0000644000000000000000000000551211377365730011140 0ustar This package (stardict) was debianized by Anthony Fok on Wed, 9 Apr 2003 23:29:25 +0800. It was then maintained by Roy Chan, and now maintained by Andrew Lee . It was downloaded from http://downloads.sourceforge.net/stardict/stardict-3.0.1.tar.bz2 Upstream Authors: Hu Zheng (胡正) Evgeniy Dushistov Alex Murygin Copyright: StarDict 3.0.1, an international dictionary written in GTK+ 2.x Copyright (C) 2003, 2004, 2005, 2006, 2007 Hu Zheng License: * StarDict main program: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. * StarDict documentation (in directory help/) Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. On Debian GNU/Linux systems, the complete text of the GNU Free Documentation License can be found in `/usr/share/common-licenses/GFDL'. * Some Unicode-related algorithms (in files src/lib/ctype-{uca,utf8}.cpp): Copyright (C) 2000, 2004 MySQL AB Licensed under the GNU Library General Public License (LGPL), either version 2, or (at your option) any later version. * libsigc++ (in directory src/sigc++/): Copyright (C) 2002, 2003 The libsigc++ Development Team Licensed under the GNU Lesser General Public License (LGPL), either version 2.1, or (at your option) any later version. * eggtrayicon (in files src/eggtrayicon.*): Copyright (C) 2002 Anders Carlsson Licensed under the GNU Lesser General Public License (LGPL), either version 2 [sic], or (at your option) any later version. On Debian GNU/Linux systems, version 2, version 2.1, and the latest version of the complete text of the GNU Lesser/Library General Public License may be found in `/usr/share/common-licenses/LGPL-2', `/usr/share/common-licenses/LGPL-2.1', and `/usr/share/common-licenses/LGPL' respectively. debian/stardict-gtk.install0000644000000000000000000000002211640545221013150 0ustar stardict usr/bin/ debian/changelog0000644000000000000000000004033112111472341011035 0ustar stardict (3.0.1-9.2) unstable; urgency=low * Non-maintainer upload to fix RC bug. * Apply patch provided by Prach Pongpanich to fix postinst scripts. -- Margarita Manterola Thu, 21 Feb 2013 19:25:45 +0000 stardict (3.0.1-9.1) unstable; urgency=low * Non-maintainer upload, for the GNOME 3 transition. * Disable the gucharmap plugin until stardict is ported to GTK+3.0, as the GTK+ 2.0 version of libgucharmap is no longer supported and mixing GTK+ 2 and 3 in the same process is not allowed (closes: #643738): - drop Build-Depends on libgucharmap2-dev - pass --disable-gucharmap to configure -- Jordi Mallach Thu, 13 Oct 2011 19:51:28 +0200 stardict (3.0.1-9) unstable; urgency=low * Drop ttf-thryomanes from Suggests: package ttf-thryomanes has been removed since lenny. (Closes: #619721) * Sorting Depends. * Warpping Depends. * Sorting Recommends. * Warpping Recommends. * Drop stardict (<< 3.0.1-1) from Replaces and Conflicts: 3.0.1-7 already shipping in squeeze. * Added Conflicts and replaces in stardict-common: avoid overwrite errors when upgrading from previous revision. * Put desktop menu entry in stardict-common package. (Closes: #642495) * Drop dummy package stardic: transition has done in squeeze. * Correct desktop-command-not-in-package entry in lintian-overrides file. -- Andrew Lee (李健秋) Wed, 28 Sep 2011 15:21:19 +0800 stardict (3.0.1-8) unstable; urgency=low * Applied 08_gcc-4.6.patch from BTS. Thanks Ilya Barygin . (Closes: #624939) * Applied 08_fix_ftbfs_binutils_gold.patch from BTS. Thanks Mahyuddin Susanto . (Closes: #609675) * Convert debian/rules to debhelper 8 format. Convert .files to .install. * Removing conflict on obsolete stardic package. * Removing useless whitespaces at EOL and EOF. * Sorting and warpping build-depends. * Bumped Standard-version to 3.9.2. * Correct an entry in lintian-overrides file. * Releasing debian version 3.0.1-8. -- Andrew Lee (李健秋) Thu, 22 Sep 2011 16:21:08 +0800 stardict (3.0.1-7) unstable; urgency=low * Convert to 3.0 (quilt) format - Convert all patches from dpatch to quilt - Drop dpatch from build-depends * Added Vcs-Git and Vcs-Browser tags * Make stardict-plugin-* depends on stardict-plugin (= ${binary:Version}) (Closes:#570716) * Build-depends on libestools2.0-dev (Closes:#590373) * Bumped Standard-Version to 3.9.0 -- Andrew Lee (李健秋) Tue, 27 Jul 2010 14:07:18 -0400 stardict (3.0.1-6) unstable; urgency=low * Added a pseudo binary package named stardic for user of stardic can upgrade to stardict smoothly. * debian/control: - replaced scrollkeeper with rarian-compat as build-depends -- Andrew Lee (李健秋) Fri, 24 Jul 2009 00:38:44 +0200 stardict (3.0.1-5) unstable; urgency=high * Applied 07_disable_netdict.dpatch: (Closes:#534731) CVE-2009-2260 - disable netdict by default - giving warning message * Added --disable-dictdotcn option for CVE-2009-2260 * Update 05_g++-4.4.dpatch (Closes:#526162) * debian/control: - Added proper ${misc:Depends} - Replaced build-depends scrollkeeper with rarian-compat - Bumped Standard-version to 3.8.2 * debian/rules: - Drop deprecated dh_scrollkeeper -- Andrew Lee Sun, 12 Jul 2009 21:17:43 +0800 stardict (3.0.1-4.1) unstable; urgency=low * Non-maintainer upload. * 06_new_gucharmap.dpatch: patch stolen from Ubuntu. Update StarDict to work with the latest gucharmap. Closes: #521071. -- Josselin Mouette Sat, 25 Apr 2009 12:34:41 +0200 stardict (3.0.1-4) unstable; urgency=low * debian/patches/05_g++-4.3.dpatch: - Updated. Fixed build error with gcc-4.3 (Closes: #474861:), Thanks to Bradley Smith for patch. * Fixed lintian error "build-depends-on-obsolete-package": - Changed "x-dev" dependency to "x11proto-core-dev" * Add build-dependency: libsigc++-2.0-dev (>= 2.0.18-2) * Merged NMU patch from Mert Dirik * Bumped Standards-Version to 3.8.0.0 - Supporting the standardized environment variable `DEB_BUILD_OPTIONS' for parallel builds. -- Andrew Lee Wed, 02 Jul 2008 18:50:52 +0800 stardict (3.0.1-3) unstable; urgency=low * Incorporates patch from Anibal Avelar -- Andrew Lee Sat, 22 Mar 2008 00:05:55 +0800 stardict (3.0.1-2) unstable; urgency=low * debian/rules: (Closes:#470020) - Added missing option --disable-gnome-support for stardict-gtk. * debian/control: - build-depends on libsigc++-2.0-dev (Closes:#468071) thanks Ying-Chun Liu (PaulLiu) for this tip. -- Andrew Lee Wed, 19 Mar 2008 17:14:36 +0800 stardict (3.0.1-1) unstable; urgency=low [ Andrew Lee ] * New upstream release. Build with options below: --disable-advertisement-plugin --disable-update-info-plugin * Added 01_festival-tts-plugin.dpatch to enable festival plugin from Deng Xiyue (Closes:#452630) * stardict-common: - Drop versioned dependency on scrollkeeper (Closes:#459478) * Package split to have more flexible on dependency for plugins: - stardict-plugin - stardict-plugin-espeak - stardict-plugin-festival - stardict-plugin-gucharmap - stardict-plugin-spell * Renamed binary package stardict to stardict-gnome * Mentioned GFDL license at least for parts in help/ subdirectory in debian/copyright file. (Thanks to Joerg Jaspert for noticing this). [ Anthony Fok ] * debian/control: - Use the new Homepage field. - Updated dependency on automake1.9 to automake (>= 1.10) * 03_license-updates.dpatch: - Updated help files from GFDL 1.1 to 1.2 as agreed by Hu Zheng at the 2008 Linux Developer Symposium in Beijing. Also fixed incorrect reference to the GNU Library General Public License in GPL'ed source files. * 04_changelog-minor-typo-fixes.dpatch: - Minor typo fixes to upstream ChangeLog file. * debian/copyright: Further revised the revisions by Andrew Lee. -- Andrew Lee Mon, 25 Feb 2008 01:55:42 +0800 stardict (3.0.0-3) unstable; urgency=low * Applied 05_espeak.dpatch (Closes:#447372), thanks upstream author Hu Zheng give me this patch. -- Andrew Lee Thu, 25 Oct 2007 01:35:29 +0800 stardict (3.0.0-2) unstable; urgency=low * Applied 04_floatwin.dpatch (fix hpaned width probelm and po file update) by upstream author Hu Zheng * debian/control: - dh_icons needs debhelper (>= 5.0.51) -- Andrew Lee Thu, 13 Sep 2007 23:49:58 +0800 stardict (3.0.0-1) unstable; urgency=low * New maintainer(Closes:#438206) * New upstream release * Bump Standards-Version to 3.7.2.2 * stardict-common - Included icons - One menu file by Jörg Sommer (Closes:#395324) for both stardict and stardict-gtk - Correct folder name 'treedict' for tree dictionaries(Closes:#392529) * stardict-gtk - Added 01_stardict-gtk.dpatch (Reference to the patch from Zhang Le on upstream's BTS.) - BuildDepends on dpatch, libtool, intltool, autoconf, automake1.9, autotools-dev - Build-Conflicts on autoconf2.13, automake1.4 - Disabled stardict-gucharmap-plugin(depends on gnome) * Added 03_stardict-plugins.dpatch to disable plugins below - stardict-advertisement-plugin (needless) - stardict-update-info-plugin (needless) - stardict-man-plugin (buggy) - stardict-espeak-tts-plugin (stability issue) - stardict-festival-tts-plugin (depends on festival 1.96 and speech-tools 1.2.96) * debian/control: - Added BuildDepends on libenchant-dev (for stardict-spell-plugin) - Removed BuildDepends on python-dev, python-support -- Andrew Lee Mon, 20 Aug 2007 18:13:33 +0800 stardict (2.4.8-1) unstable; urgency=low * Co-maintainer upload, agreed by Roy Chan. * Update package to the last python policy by Pierre Habouzit (Closes: 380962). -- Andrew Lee Tue, 5 Sep 2006 17:12:22 +0800 stardict (2.4.8-0.1) unstable; urgency=low [ Andrew Lee ] * NMU for new upstream release (Closes: #361667) * Build stardict-gtk binary package (Closes: #328649) * Changed packaging method back to original and clean up debian/rules * Added watch file * Added LGPL informations into copyright file * Oops, upstream split stardict-tools as another tarball, I think it's good if Debian can respect that, so I will make another NMU for package the new stardict-tools as well. [ Anthony Wong ] * No longer Suggest: sdcv, agreed by Roy Chan. * Corrected package summary and description. * Corrected few things in README.Debian. -- Andrew Lee Mon, 7 Aug 2006 23:51:21 +0800 stardict (2.4.7-1) unstable; urgency=low * New upstream version. (Closes: Bug#361667) * Changed packaging method: Now the pristine upstream bzip2 tarball is placed as-is within the Debian source package. The autogen.sh is also run at build time. (Closes: Bug#289996) * Upgraded Standards-Version from 3.6.2 to 3.7.2. * Updated package description and copyright information. -- Anthony Fok Thu, 1 Jun 2006 04:46:49 +0800 stardict (2.4.5-2) unstable; urgency=low * Co-maintainer upload. :-) * Acknowledge NMU (2.4.5-1.1) by Justin Pryzby for xlibs-dev removal reported by Adeodato Simó. Many thanks (Closes: Bug#347109) * Fix "FTBFS with G++ 4.1: extra qualification". Thanks to Martin Michlmayr for notification and patch! (Closes: Bug#357328) -- Anthony Fok Sat, 18 Mar 2006 06:30:26 +0800 stardict (2.4.5-1.1) unstable; urgency=low * Non-maintainer upload. * Update build-deps for xlibs-dev removal; closes: #347109. -- Justin Pryzby Sat, 14 Jan 2006 15:24:45 -0500 stardict (2.4.5-1) unstable; urgency=low * [debian/control] - Oops! 2.4.5-0.1 failed to build from source! Mea culpa! Added Build-Depends: libxml-parser-perl - Added myself to the Uploaders field. :-) * While hunting down on libxml-parser-perl dependency, I decided to learn more about intltools and to fix up "make distclean" leftovers: - [autogen.sh]: Run intltoolize too. - [Makefile.am]: Added "DISTCLEANFILES = intltool-extract intltool-merge intltool-update" - Updated omf.make and xmldocs.make from gnome-common (2.8.0-3). This cleans out help/*/stardict-*.omf.out. - Ran ./autogen.sh (with automake1.9 and intltools pre-installed). - The new intltool (0.34) scripts clean up po/.intltool-merge-cache and po/*.gmo. Also, stardict.desktop (etc.) entries finally show up in the PO files again. * [debian/rules]: Changed --localstatedir=/var/lib to /var. -- Anthony Fok Wed, 5 Oct 2005 04:22:16 +0800 stardict (2.4.5-0.1) unstable; urgency=low * NMU (with Roy Chan's permission) * New upstream version. (Closes: Bug#289451, Bug#330501) * zh_TW help files are included in this new upstream release. Removed stardict-help-zh_TW.tar.gz.uuencode from source. * Updated Standards-Version: 3.6.1 -> 3.6.2. No change. * Added icon for menu. Thanks to Li Daobing for the patch. (Closes: Bug#289104) * Removed superfluous build-dependency on libstdc++5-3.3-dev. Thanks to Andreas Jochens for the patch. (Closes: Bug#300358) * Suggests: sdcv, the console version of StarDict packaged by Cai Qian. * Fixed Lintian warnings: - Removed bashism in postinst: "-a" in "[" test. - Updated FSF address in copyright file. -- Anthony Fok Tue, 4 Oct 2005 03:47:21 +0800 stardict (2.4.3-5) unstable; urgency=low * Add build-depends xlibs-dev * Sponsored by Anthony Fok -- Roy Hiu-yeung Chan Sun, 15 Aug 2004 00:00:03 +0800 stardict (2.4.3-4) unstable; urgency=low * Add build-depends python, thanks Andreas Jochens and Bastian Kleineidam (Closes: Bug#263820) * Fix configure.in to generate Makefile in help/zh_TW * Rebuild to depend on gcrypt11/gnutls11 instead of gcrypt1/gnutls7 (Closes: Bug#264735) * Suggest ttf-freefont or ttf-thryomanes for display phonetic symbol * Change the gconf schemas location from /etc/gconf/schemas to /usr/share/gconf/schemas via adding dh_scrollkeeper and dh_gconf in debian/rules * Sponsored by Anthony Wong -- Roy Hiu-yeung Chan Thu, 12 Aug 2004 14:21:36 +0800 stardict (2.4.3-3) unstable; urgency=low * Apply Sebastien Bacher patch to be able to compile with gtk+ 2.4 (Closes: Bug#250063) * Add Traditional Chinese Help Manual * Sponsored by Anthony Fok -- Roy Hiu-yeung Chan Wed, 26 May 2004 18:30:53 +0800 stardict (2.4.3-2) unstable; urgency=low * Fix the dependency of stardict-tools in order to be installable on alpha and i64 (Closes: Bug#249236, Bug#249237) * Fix the DTD Url of the help file (Closes: Bug#207928) * Fix the assume char is signed problem in arm (Closes: Bug#206479) * Add dependency on sgml-data 2.x and scrollkeeper. Thanks Anthony Wong * Sponsored by Anthony Wong -- Roy Hiu-yeung Chan Wed, 19 May 2004 19:39:01 +0800 stardict (2.4.3-1) unstable; urgency=low * New upstream release: 2.4.3 (Closes: Bug#199468) * Split to arch-independent data and conversion tools to stardict-common and stardict-tools. (Closes: Bug#233445) * Sponsored by Anthony Fok -- Roy Hiu-yeung Chan Thu, 11 Mar 2004 20:29:37 +0800 stardict (2.4.2-1) unstable; urgency=low * New upstream release: 2.4.2 -- Chen YiFei Sat, 29 Nov 2003 00:40:21 +0800 stardict (1.9.92+2.0.0-pre2-3.1) unstable; urgency=low * Non-maintainer upload according to the release manager's plan. * Fix compilation from sources, patch from Matt Kraai . (Closes: Bug#198113) -- Roland Mas Sun, 24 Aug 2003 14:55:28 +0200 stardict (1.9.92+2.0.0-pre2-3) unstable; urgency=low * I forgot to credit Opera Wang who worked on StarDict 1.31+, 1.32+ and 1.33+ in the second half of year 2002. Updated debian/copyright. -- Anthony Fok Sat, 19 Apr 2003 13:42:55 +0800 stardict (1.9.92+2.0.0-pre2-2) unstable; urgency=low * Oops, forgot to actually install the menu file. :-) * Removed the zero-byte NEWS and install NEWS.zh_CN instead, for now. -- Anthony Fok Sat, 19 Apr 2003 10:55:25 +0800 stardict (1.9.92+2.0.0-pre2-1) unstable; urgency=low * Initial Release of Hu Zheng's GNOME-based StarDict 2.0.0 series. Special thanks to Yu Guanghui for announcing it to the Debian community. * Fixed some typos. -- Anthony Fok Sat, 19 Apr 2003 05:08:16 +0800 stardic (1.3.1-3) unstable; urgency=low * Acknowledged Yu Guanghui's NMU on gcc-3.0 compile problem. Thanks! Also thanks to LaMont Jones for the bug report. (Closes: Bug#105008) * Updated Build-Dependency. The obsolete xlib6g-dev is now xlibs-dev. Thanks to Daniel Schepler for the bug report. (Closes: Bug#170130) * Updated copyright information to point to a possibly new upstream project home page. -- Anthony Fok Sat, 23 Nov 2002 13:32:50 +0800 stardic (1.3.1-2.1) unstable; urgency=low * NMU * Fixed gcc 3.0 compiling problem. (closes:Bug#105008) -- Yu Guanghui Sun, 22 Jul 2001 15:54:18 +0800 stardic (1.3.1-2) unstable; urgency=low * Contacted upstream author (MA Su An) who informed me where to find the stardic Home Page. Hence, the missing fields in /usr/share/doc/stardic/copyright are now filled. :-) -- Anthony Fok Sun, 9 Jul 2000 13:38:09 -0600 stardic (1.3.1-1) unstable; urgency=low * Initial Release. -- Anthony Fok Wed, 28 Jun 2000 10:47:21 -0600 debian/stardict-plugin.install0000644000000000000000000000103711636561162013677 0ustar debian/tmp/usr/lib/stardict/plugins/stardict_html_parsedata.so debian/tmp/usr/lib/stardict/plugins/stardict_xdxf_parsedata.so debian/tmp/usr/lib/stardict/plugins/stardict_wordnet.so debian/tmp/usr/lib/stardict/plugins/stardict_man.so debian/tmp/usr/lib/stardict/plugins/stardict_qqwry.so debian/tmp/usr/lib/stardict/plugins/stardict_powerword_parsedata.so debian/tmp/usr/lib/stardict/plugins/stardict_wordnet_parsedata.so debian/tmp/usr/lib/stardict/plugins/stardict_wiki_parsedata.so debian/tmp/usr/lib/stardict/plugins/stardict_dictdotcn.so debian/stardict-common.install0000644000000000000000000000047111640545221013663 0ustar debian/stardict_16x16.xpm usr/share/pixmaps debian/stardict_32x32.xpm usr/share/pixmaps debian/stardict-common.lintian-overrides usr/share/lintian/overrides debian/tmp/usr/share/applications/* debian/tmp/usr/share/locale/* debian/tmp/usr/share/omf/* debian/tmp/usr/share/pixmaps/* debian/tmp/usr/share/stardict/* debian/stardict-gnome.preinst0000644000000000000000000000022712111472253013513 0ustar #!/bin/sh set -e case "$1" in upgrade) DOCDIR=/usr/share/doc/stardict-gnome if [ -L $DOCDIR ]; then rm $DOCDIR fi ;; esac #DEBHELPER# debian/source/0000755000000000000000000000000011634575755010510 5ustar debian/source/format0000644000000000000000000000001411366107742011703 0ustar 3.0 (quilt) debian/stardict_32x32.xpm0000644000000000000000000001440111377365730012406 0ustar /* XPM */ static char *stardict_32x32[] = { /* columns rows colors chars-per-pixel */ "32 32 257 2", " c #000000", ". c #090703", "X c #0B0D06", "o c #0F0D0B", "O c #0D1208", "+ c #130E08", "@ c #171006", "# c #14110C", "$ c #131A0C", "% c #161512", "& c #1A1712", "* c #1C1A17", "= c #1B2511", "- c #241A0B", "; c #231C12", ": c #2C200C", "> c #2A241C", ", c #282218", "< c #263318", "1 c #2E3D1D", "2 c #36260E", "3 c #332613", "4 c #3F2E14", "5 c #342A18", "6 c #3E321D", "7 c #2F2B26", "8 c #312C26", "9 c #383229", "0 c #3E3931", "q c #2F4310", "w c #324512", "e c #354A14", "r c #394717", "t c #37461D", "y c #3A5017", "u c #3C5319", "i c #3F591B", "p c #344620", "a c #402D10", "s c #463213", "d c #453419", "f c #4A3515", "g c #493719", "h c #49381D", "j c #533C19", "k c #473A26", "l c #403B32", "z c #434C1D", "x c #435B1D", "c c #43561A", "v c #5D441D", "b c #51511F", "n c #444228", "m c #474036", "M c #464138", "N c #4A4235", "B c #4D443A", "V c #455D2B", "C c #43562B", "Z c #53412E", "A c #51473A", "S c #5D4D3A", "D c #534939", "F c #565924", "G c #5D5E32", "H c #476020", "J c #4D6723", "K c #4F6931", "L c #536F27", "P c #5D6C27", "I c #526D33", "U c #56722A", "Y c #5C7A2D", "T c #587637", "R c #5F7F30", "E c #61471F", "W c #614720", "Q c #694E23", "! c #674B22", "~ c #604E39", "^ c #614D36", "/ c #6D5126", "( c #6F5328", ") c #63533C", "_ c #695431", "` c #73562A", "' c #7C5E2F", "] c #735E2D", "[ c #70573A", "{ c #795F3E", "} c #715738", "| c #64622D", " . c #676232", ".. c #696135", "X. c #697B30", "o. c #756F3D", "O. c #7D6032", "+. c #79693D", "@. c #7E773B", "#. c #707331", "$. c #665743", "%. c #6B5C44", "&. c #735D41", "*. c #6F6047", "=. c #6F6D46", "-. c #697D40", ";. c #6B7444", ":. c #786040", ">. c #7C6648", ",. c #7E6C40", "<. c #7A6F4B", "1. c #797644", "2. c #5F803C", "3. c #628231", "4. c #64853E", "5. c #698A36", "6. c #6B823F", "7. c #7C8A38", "8. c #72963B", "9. c #678940", "0. c #6A8C42", "q. c #6E9144", "w. c #768146", "e. c #758F41", "r. c #7E8C4C", "t. c #719446", "y. c #749847", "u. c #769B48", "i. c #7A9F40", "p. c #799E4A", "a. c #7DA34C", "s. c #7DA343", "d. c #856C2B", "f. c #836331", "g. c #85663C", "h. c #866837", "j. c #8E6C37", "k. c #8F6D38", "l. c #89713C", "z. c #946B2E", "x. c #916F39", "c. c #99743D", "v. c #997639", "b. c #816B4B", "n. c #8B6E45", "m. c #836E44", "M. c #867544", "N. c #897553", "B. c #8A7853", "V. c #927241", "C. c #947549", "Z. c #9B7A49", "A. c #907B57", "S. c #927E58", "D. c #987D52", "F. c #A37E43", "G. c #A47F4C", "H. c #838C4E", "J. c #888F4C", "K. c #848340", "L. c #84944C", "P. c #85994C", "I. c #8A9251", "U. c #948C42", "Y. c #97815A", "T. c #938157", "R. c #9E9645", "E. c #929F53", "W. c #9C9F54", "Q. c #81A74E", "!. c #82AA46", "~. c #83AB4E", "^. c #8AAF4C", "/. c #86AE50", "(. c #8CA852", "). c #8BB34E", "_. c #8FBA4E", "`. c #87B051", "'. c #8BB453", "]. c #8EB954", "[. c #9FA55C", "{. c #9FA955", "}. c #9FAB5D", "|. c #95A954", " X c #90B754", ".X c #92BC55", "XX c #96BE58", "oX c #9DB855", "OX c #AD8547", "+X c #A48249", "@X c #A78351", "#X c #AD8955", "$X c #A98550", "%X c #A49B4B", "&X c #A69359", "*X c #B58C4B", "=X c #B58D54", "-X c #BA904E", ";X c #B59351", ":X c #BB9354", ">X c #B8955A", ",X c #BD9958", "X..w e x 5.).yXsXtX^.1XSXPXIXUXJX1Xw.n YXYXYX", "YXYXYXYX@ g / F.ZXVX#X..w w x 3.!.rXpXR.:XLXIXIXNXE.;.%.k . YXYX", "YXYXYXYX. 3 E x.zXKXhX#X..r w u 3.s.3Xv.fXLXJX7XL.=.%.$.D * YXYX", "YXYXYXYXYX: j ' -XKXxXhX#X+.z w i U 7.z.;XmX}.H.<.b.B.$.B * YXYX", "YXYXYXYXYXo d / F.ZXKXvXfX#X,.z q u P d.U.(.H.B.A.B.S.>.B 8 YX", "YXYXYXYXYX. 6 v x.gXKXvXkX:X#Xm.z q c X.e.I.T.Y.S.A.N.>.S 0 . YX", "YXYXYXYXYX. 8 j ' -XKXBXkXdX:X@XM.F q U J.&XXC.m.[ S B 0 o YXYX", "YXYXYXYXYXYX. 5 v k.jX:XBXAXDXLXLXHXHXFXvX#Xn.+.^ l 9 7 o YXYXYX", "YXYXYXYXYXYXYX> j ' j.' AXHXLXHXLXCXfX@Xn.:.S M 8 # . YXYXYXYX", "YXYXYXYXYXYXYX# d Q Q h.DXHXDXBXfX#XC.&.D l 7 % . YXYXYXYXYXYXYX", "YXYXYXYXYXYXYX. k j v ` fXvXfX=XC.&.A 9 * . YXYXYXYXYXYXYXYXYX", "YXYXYXYXYXYXYX ; d j Q ' g.n.) N 9 * . YXYXYXYXYXYXYXYXYXYXYXYX", "YXYXYXYXYXYXYXYX X 2 4 k l 8 % . YXYXYXYXYXYXYXYXYXYXYXYXYX", "YXYXYXYXYXYXYXYXYXYXYX & & YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX" }; debian/patches/0000755000000000000000000000000011645623416010625 5ustar debian/patches/05_g++-4.4.patch0000644000000000000000000026773011423574416013047 0ustar Author: Andrew Lee Description: patch for fix FTBTS with g++-4.4 from --- a/src/gconf_file.cpp +++ b/src/gconf_file.cpp @@ -21,6 +21,8 @@ # include "config.h" #endif +#include + #include #include "gconf_file.hpp" --- a/src/inifile.cpp +++ b/src/inifile.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include --- a/src/lib/common.cpp +++ b/src/lib/common.cpp @@ -24,6 +24,8 @@ #endif #include "common.hpp" +#include +#include static void parse_description(const char *p, long len, std::string &description) { --- a/src/lib/data.cpp +++ b/src/lib/data.cpp @@ -25,7 +25,8 @@ #include "data.hpp" #include "getuint32.h" - +#include +#include DictBase::DictBase() { --- a/src/lib/http_client.h +++ b/src/lib/http_client.h @@ -5,6 +5,7 @@ #include "sigc++/sigc++.h" #include #include +#include #ifndef _WIN32 # include --- a/src/lib/pluginmanager.cpp +++ b/src/lib/pluginmanager.cpp @@ -1,6 +1,7 @@ #include "pluginmanager.h" #include "file.hpp" #include +#include StarDictPluginBaseObject::StarDictPluginBaseObject(const char *filename, GModule *module_, plugin_configure_func_t configure_func_): plugin_filename(filename), module(module_), configure_func(configure_func_) --- a/src/lib/stardict_client.cpp +++ b/src/lib/stardict_client.cpp @@ -29,6 +29,9 @@ #include "getuint32.h" #include "stardict_client.hpp" +#include +#include +#include #define PROTOCOL_VERSION "0.3" --- a/src/lib/stddict.cpp +++ b/src/lib/stddict.cpp @@ -38,6 +38,7 @@ #include "stddict.hpp" #include #include "getuint32.h" +#include static inline gint stardict_strcmp(const gchar *s1, const gchar *s2) { --- a/src/lib/treedict.cpp +++ b/src/lib/treedict.cpp @@ -28,6 +28,7 @@ #include "getuint32.h" #include "treedict.hpp" +#include GtkTreeStore *TreeDict::model=NULL; --- a/src/pangoview.cpp +++ b/src/pangoview.cpp @@ -21,6 +21,8 @@ # include "config.h" #endif +#include + #include "gtktextviewpango.h" #include "utils.h" #include "skin.h"//for SkinCursor definition --- a/src/prefsdlg.cpp +++ b/src/prefsdlg.cpp @@ -20,6 +20,8 @@ # include "config.h" #endif +#include + #include #include --- /dev/null +++ b/src/prefsdlg.cpp.orig @@ -0,0 +1,1907 @@ +/* + * This file part of StarDict - A international dictionary for GNOME. + * http://stardict.sourceforge.net + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#ifdef _WIN32 +# include +#endif + +#include "stardict.h" +#include "conf.h" +#include "desktop.hpp" +#include "utils.h" +#include "iskeyspressed.hpp" +#include "lib/md5.h" + +#include "prefsdlg.h" + +#ifndef CONFIG_GPE +enum { + LOGO = 0, + DICTIONARY_SCAN_SETTINGS, + DICTIONARY_FONT_SETTINGS, + DICTIONARY_CACHE_SETTINGS, + DICTIONARY_EXPORT_SETTINGS, + DICTIONARY_SOUND_SETTINGS, + DICIONARY_ARTICLE_RENDERING, + NETWORK_NETDICT, + MAINWIN_INPUT_SETTINGS, + MAINWIN_OPTIONS_SETTINGS, + MAINWIN_SEARCH_WEBSITE_SETTINGS, + NOTIFICATION_AREA_ICON_OPITIONS_SETTINGS, + FLOATWIN_OPTIONS_SETTINGS, + FLOATWIN_SIZE_SETTINGS, +}; + +enum +{ + CATEGORY_COLUMN = 0, + PAGE_NUM_COLUMN, + NUM_COLUMNS +}; + + +struct CategoriesTreeItem { + gchar *category; + + CategoriesTreeItem *children; + + gint notebook_page; +}; + +static CategoriesTreeItem dictionary_behavior [] = { + {N_("Scan Selection"), NULL, DICTIONARY_SCAN_SETTINGS}, + {N_("Font"), NULL, DICTIONARY_FONT_SETTINGS}, + {N_("Cache"), NULL, DICTIONARY_CACHE_SETTINGS}, + {N_("Export"), NULL, DICTIONARY_EXPORT_SETTINGS}, + {N_("Sound"), NULL, DICTIONARY_SOUND_SETTINGS}, + {N_("Article rendering"), NULL, DICIONARY_ARTICLE_RENDERING }, + { NULL } +}; + +static CategoriesTreeItem network_behavior [] = { + {N_("Net Dict"), NULL, NETWORK_NETDICT}, + { NULL } +}; + +static CategoriesTreeItem mainwin_behavior [] = +{ + {N_("Input"), NULL, MAINWIN_INPUT_SETTINGS}, + {N_("Options"), NULL, MAINWIN_OPTIONS_SETTINGS}, + {N_("Search website"), NULL, MAINWIN_SEARCH_WEBSITE_SETTINGS}, + + { NULL } +}; + +static CategoriesTreeItem NotificationAreaIcon_behavior [] = +{ + {N_("Options"), NULL, NOTIFICATION_AREA_ICON_OPITIONS_SETTINGS}, + + { NULL } +}; + +static CategoriesTreeItem floatwin_behavior [] = +{ + {N_("Options"), NULL, FLOATWIN_OPTIONS_SETTINGS}, + {N_("Settings"), NULL, FLOATWIN_SIZE_SETTINGS}, + + { NULL } +}; + +static CategoriesTreeItem toplevel [] = +{ + {N_("Dictionary"), dictionary_behavior, LOGO}, + + {N_("Network"), network_behavior, LOGO}, + + {N_("Main window"), mainwin_behavior, LOGO}, + + {N_("Notification area icon"), NotificationAreaIcon_behavior, LOGO}, + + {N_("Floating window"), floatwin_behavior, LOGO}, + + { NULL } +}; + +static gint last_selected_page_num = DICTIONARY_SCAN_SETTINGS; +#endif + +void PrefsDlg::response_handler (GtkDialog *dialog, gint res_id, PrefsDlg *oPrefsDlg) +{ + if (res_id==GTK_RESPONSE_HELP) + show_help("stardict-prefs"); +} + +#ifndef CONFIG_GPE +GtkTreeModel* PrefsDlg::create_categories_tree_model () +{ + GtkTreeStore *model; + GtkTreeIter iter; + CategoriesTreeItem *category = toplevel; + + model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_INT); + + while (category->category) { + CategoriesTreeItem *sub_category = category->children; + gtk_tree_store_append (model, &iter, NULL); + gtk_tree_store_set (model, &iter, CATEGORY_COLUMN, gettext (category->category), PAGE_NUM_COLUMN, category->notebook_page, -1); + + while (sub_category->category) { + GtkTreeIter child_iter; + gtk_tree_store_append (model, &child_iter, &iter); + gtk_tree_store_set (model, &child_iter, + CATEGORY_COLUMN, gettext (sub_category->category), + PAGE_NUM_COLUMN, sub_category->notebook_page, + -1); + sub_category++; + } + category++; + } + return GTK_TREE_MODEL (model); +} + +void PrefsDlg::categories_tree_selection_cb (GtkTreeSelection *selection, PrefsDlg *oPrefsDlg) +{ + GtkTreeIter iter; + GValue value = {0, }; + + if (! gtk_tree_selection_get_selected (selection, NULL, &iter)) + return; + + gtk_tree_model_get_value (oPrefsDlg->categories_tree_model, &iter, + PAGE_NUM_COLUMN, + &value); + + last_selected_page_num = g_value_get_int (&value); + + if (oPrefsDlg->notebook != NULL) + gtk_notebook_set_current_page (GTK_NOTEBOOK (oPrefsDlg->notebook), + last_selected_page_num); + g_value_unset (&value); +} + +gboolean PrefsDlg::selection_init (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, PrefsDlg *oPrefsDlg) +{ + GValue value = {0, }; + gint page_num; + + gtk_tree_model_get_value (oPrefsDlg->categories_tree_model, iter, + PAGE_NUM_COLUMN, + &value); + + page_num = g_value_get_int (&value); + + g_value_unset (&value); + + if (page_num == last_selected_page_num) + { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (oPrefsDlg->categories_tree)); + + gtk_tree_selection_select_iter (selection, iter); + + gtk_notebook_set_current_page (GTK_NOTEBOOK (oPrefsDlg->notebook), page_num); + + return TRUE; + } + return FALSE; +} + +void PrefsDlg::categories_tree_realize (GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + gtk_tree_view_expand_all(GTK_TREE_VIEW(widget)); + + gtk_tree_model_foreach(oPrefsDlg->categories_tree_model, + GtkTreeModelForeachFunc(selection_init), + oPrefsDlg); +} + +void PrefsDlg::create_categories_tree(void) +{ + GtkWidget *sw; + GtkTreeModel *model; + GtkWidget *treeview; + GtkCellRenderer *renderer; + GtkTreeSelection *selection; + GtkTreeViewColumn *column; + gint col_offset; + + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_ETCHED_IN); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + gtk_widget_set_size_request (sw, 140, 240); + + model = create_categories_tree_model (); + + treeview = gtk_tree_view_new_with_model (model); + g_object_unref (G_OBJECT (model)); + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE); + + categories_tree = treeview; + categories_tree_model = model; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); + + gtk_tree_selection_set_mode (selection, + GTK_SELECTION_SINGLE); + + /* add column for category */ + renderer = gtk_cell_renderer_text_new (); + g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL); + + col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), + -1, _("Categories"), + renderer, "text", + CATEGORY_COLUMN, + NULL); + + column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1); + gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), FALSE); + + g_signal_connect (selection, "changed", + G_CALLBACK (categories_tree_selection_cb), + this); + + gtk_container_add (GTK_CONTAINER (sw), treeview); + + g_signal_connect (G_OBJECT (treeview), "realize", + G_CALLBACK (categories_tree_realize), + this); + + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); + + categories_window=sw; +} + +void PrefsDlg::setup_logo_page() +{ + GtkWidget *image = gtk_image_new_from_pixbuf(stardict_logo); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook),image,NULL); +} +#endif + +static GtkWidget *prepare_page(GtkNotebook *notebook, const gchar *caption, + const gchar *stock_id) +{ + GtkWidget *vbox = gtk_vbox_new(FALSE, 12); +#ifdef CONFIG_GPE + gtk_container_set_border_width(GTK_CONTAINER (vbox), 5); + GtkWidget *nb_label = gtk_label_new(caption); + gtk_notebook_append_page(notebook, vbox, nb_label); +#else + gtk_notebook_append_page(notebook, vbox, NULL); +#endif + + GtkWidget *vbox1 = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox), vbox1, FALSE, FALSE, 6); + GtkWidget *hbox = gtk_hbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0); + GtkWidget *image = + gtk_image_new_from_stock(stock_id, + GTK_ICON_SIZE_LARGE_TOOLBAR); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + GtkWidget *label = gtk_label_new(NULL); + glib::CharStr label_caption( + g_markup_printf_escaped("%s", caption)); + gtk_label_set_markup(GTK_LABEL(label), get_impl(label_caption)); + gtk_box_pack_start(GTK_BOX(hbox),label, FALSE, FALSE, 0); + GtkWidget *hseparator = gtk_hseparator_new(); + gtk_box_pack_start(GTK_BOX(vbox1),hseparator,FALSE,FALSE,0); + + return vbox; +} + +void PrefsDlg::on_setup_dictionary_scan_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean b = gtk_toggle_button_get_active(button); + gtk_widget_set_sensitive(oPrefsDlg->scan_modifier_key_vbox,b); + conf->set_bool_at("dictionary/only_scan_while_modifier_key", b); +} + +#ifdef _WIN32 +void PrefsDlg::on_setup_dictionary_scan_clipboard_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean b = gtk_toggle_button_get_active(button); + if (b) { + if (conf->get_bool_at("dictionary/scan_selection")) + gpAppFrame->oClipboard.start(); + } else { + if (conf->get_bool_at("dictionary/scan_selection")) + gpAppFrame->oClipboard.stop(); + } + conf->set_bool_at("dictionary/scan_clipboard", b); +} + +void PrefsDlg::on_setup_dictionary_use_scan_hotkey_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean b = gtk_toggle_button_get_active(button); + if (b) + gpAppFrame->oHotkey.start_scan(); + else + gpAppFrame->oHotkey.stop_scan(); + conf->set_bool_at("dictionary/use_scan_hotkey", b); +} +#endif + +void PrefsDlg::on_setup_dictionary_scan_combobox_changed(GtkComboBox *combobox, PrefsDlg *oPrefsDlg) +{ + gint key = gtk_combo_box_get_active(combobox); + conf->set_int_at("dictionary/scan_modifier_key", key); +} + +void PrefsDlg::on_setup_dictionary_scan_hide_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean hide = gtk_toggle_button_get_active(button); + conf->set_bool_at("dictionary/hide_floatwin_when_modifier_key_released", hide); +} + +void PrefsDlg::setup_dictionary_scan_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Scan Selection"), GTK_STOCK_CONVERT); + GtkWidget *vbox1 = gtk_vbox_new(false, 0); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0); + GtkWidget *check_button = gtk_check_button_new_with_mnemonic(_("_Only scan while the modifier key is being pressed.")); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + bool only_scan_while_modifier_key= + conf->get_bool_at("dictionary/only_scan_while_modifier_key"); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), + only_scan_while_modifier_key); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_dictionary_scan_ckbutton_toggled), this); + + scan_modifier_key_vbox = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox1), scan_modifier_key_vbox, + FALSE, FALSE, 12); + gtk_widget_set_sensitive(scan_modifier_key_vbox, + only_scan_while_modifier_key); + + check_button = gtk_check_button_new_with_mnemonic(_("H_ide floating window when modifier key released.")); + gtk_box_pack_start(GTK_BOX(scan_modifier_key_vbox),check_button,false,false,0); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), + conf->get_bool_at("dictionary/hide_floatwin_when_modifier_key_released")); + g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_scan_hide_ckbutton_toggled), this); + + GtkWidget *hbox = gtk_hbox_new(false, 12); + gtk_box_pack_start(GTK_BOX(scan_modifier_key_vbox), hbox,false,false,0); + GtkWidget *label=gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("Scan modifier _key:")); + gtk_box_pack_start(GTK_BOX(hbox),label,false,false,0); + gtk_misc_set_alignment (GTK_MISC (label), 0, .5); + GtkWidget *combobox = gtk_combo_box_new_text(); + gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(combobox), FALSE); + + for (std::list::const_iterator p=key_combs.begin(); + p!=key_combs.end(); ++p) { + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), p->c_str()); + } + + int scan_modifier_key= + conf->get_int_at("dictionary/scan_modifier_key"); + + gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), scan_modifier_key); + + gtk_label_set_mnemonic_widget(GTK_LABEL(label), combobox); + gtk_box_pack_start(GTK_BOX(hbox), combobox, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (combobox), "changed", G_CALLBACK (on_setup_dictionary_scan_combobox_changed), this); + +#ifdef _WIN32 + check_button = gtk_check_button_new_with_mnemonic(_("_Scan clipboard.")); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), conf->get_bool_at("dictionary/scan_clipboard")); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_dictionary_scan_clipboard_ckbutton_toggled), this); + + check_button = gtk_check_button_new_with_mnemonic(_("_Use scan hotkey: Ctrl+Alt+F1.")); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), conf->get_bool_at("dictionary/use_scan_hotkey")); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_dictionary_use_scan_hotkey_ckbutton_toggled), this); +#endif +} + +void PrefsDlg::change_font_for_all_widgets(const std::string& fontname) +{ + gchar *aa = + g_strdup_printf("style \"custom-font\" { font_name= \"%s\" }\n" + "class \"GtkWidget\" style \"custom-font\"\n", fontname.c_str()); + gtk_rc_parse_string(aa); + g_free(aa); + GdkScreen *screen = gtk_window_get_screen(parent_window); + GtkSettings *settings=gtk_settings_get_for_screen(screen); + gtk_rc_reset_styles(settings); +#ifndef CONFIG_GPE + resize_categories_tree(); +#endif +} + +void PrefsDlg::on_setup_dictionary_font_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean b = gtk_toggle_button_get_active(button); + gtk_widget_set_sensitive(oPrefsDlg->custom_font_hbox, b); + conf->set_bool_at("dictionary/use_custom_font", b); + if (b) { + const std::string &custom_font= + conf->get_string_at("dictionary/custom_font"); + oPrefsDlg->change_font_for_all_widgets(custom_font); + } else + oPrefsDlg->change_font_for_all_widgets(""); +} + +void PrefsDlg::on_setup_dictionary_font_button_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + GtkWidget *dlg = gtk_font_selection_dialog_new(_("Choose dictionary font")); + gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (oPrefsDlg->window)); + const gchar *text = gtk_button_get_label(GTK_BUTTON(widget)); + if (strcmp(text,_("Choose"))) + gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dlg), text); + gtk_font_selection_dialog_set_preview_text(GTK_FONT_SELECTION_DIALOG(dlg),_("Dictionary font")); + gint result = gtk_dialog_run (GTK_DIALOG (dlg)); + if (result==GTK_RESPONSE_OK) { + gchar *font_name = + gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(dlg)); + if (font_name) { + gtk_button_set_label(GTK_BUTTON(widget),font_name); + conf->set_string_at("dictionary/custom_font", std::string(font_name)); + } + if (font_name && font_name[0]) { + oPrefsDlg->change_font_for_all_widgets(font_name); + } + } + gtk_widget_destroy (dlg); +} + +void PrefsDlg::setup_dictionary_font_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Font"), GTK_STOCK_SELECT_FONT); + GtkWidget *vbox1 = gtk_vbox_new(false,6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0); + GtkWidget *check_button = gtk_check_button_new_with_mnemonic(_("_Use custom font.")); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + bool use_custom_font= + conf->get_bool_at("dictionary/use_custom_font"); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), + use_custom_font); + g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_font_ckbutton_toggled), this); + custom_font_hbox = gtk_hbox_new(false, 12); + gtk_box_pack_start(GTK_BOX(vbox1),custom_font_hbox,false,false,0); + gtk_widget_set_sensitive(custom_font_hbox, use_custom_font); + GtkWidget *label=gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("Dictionary _font:")); + gtk_box_pack_start(GTK_BOX(custom_font_hbox),label,false,false,0); + gtk_misc_set_alignment (GTK_MISC (label), 0, .5); + GtkWidget *button; + const std::string &custom_font= + conf->get_string_at("dictionary/custom_font"); + + if (!custom_font.empty()) + button = gtk_button_new_with_label(custom_font.c_str()); + else + button=gtk_button_new_with_label(_("Choose")); + + gtk_label_set_mnemonic_widget(GTK_LABEL(label), button); + gtk_box_pack_start(GTK_BOX(custom_font_hbox),button,false,false,0); + g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (on_setup_dictionary_font_button_clicked), this); +} + +void PrefsDlg::on_setup_dictionary_cache_CreateCacheFile_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean enable = gtk_toggle_button_get_active(button); + conf->set_bool_at("dictionary/create_cache_file",enable); +} + +void PrefsDlg::on_setup_dictionary_cache_EnableCollation_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean enable = gtk_toggle_button_get_active(button); + gtk_widget_set_sensitive(oPrefsDlg->collation_hbox, enable); + conf->set_bool_at("dictionary/enable_collation",enable); +} + +void PrefsDlg::on_setup_dictionary_collation_combobox_changed(GtkComboBox *combobox, PrefsDlg *oPrefsDlg) +{ + gint key = gtk_combo_box_get_active(combobox); + conf->set_int_at("dictionary/collate_function", key); +} + +static void clean_dir(const gchar *dirname) +{ + GDir *dir = g_dir_open(dirname, 0, NULL); + if (dir) { + const gchar *filename; + gchar fullfilename[256]; + while ((filename = g_dir_read_name(dir))!=NULL) { + sprintf(fullfilename, "%s" G_DIR_SEPARATOR_S "%s", dirname, filename); + if (g_file_test(fullfilename, G_FILE_TEST_IS_DIR)) { + clean_dir(fullfilename); + } else if (g_str_has_suffix(filename,".oft") || g_str_has_suffix(filename,".clt")) { + g_unlink(fullfilename); + } + } + g_dir_close(dir); + } +} + +void PrefsDlg::on_setup_dictionary_cache_cleanbutton_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + std::string dirname = gStarDictDataDir+ G_DIR_SEPARATOR_S "dic"; + clean_dir(dirname.c_str()); + dirname = g_get_user_cache_dir(); + dirname += G_DIR_SEPARATOR_S "stardict"; + clean_dir(dirname.c_str()); + g_rmdir(dirname.c_str()); +} + +void PrefsDlg::setup_dictionary_cache_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Cache"), GTK_STOCK_HARDDISK); + GtkWidget *vbox1 = gtk_vbox_new(false, 6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0); + GtkWidget *check_button; + check_button = gtk_check_button_new_with_mnemonic(_("Create c_ache files to speed up loading.")); + bool enable = conf->get_bool_at("dictionary/create_cache_file"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), enable); + g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_cache_CreateCacheFile_ckbutton_toggled), (gpointer)this); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + check_button = gtk_check_button_new_with_mnemonic(_("_Sort word list by collation function.")); + enable = conf->get_bool_at("dictionary/enable_collation"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), enable); + g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_cache_EnableCollation_ckbutton_toggled), (gpointer)this); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + collation_hbox = gtk_hbox_new(false,6); + gtk_box_pack_start(GTK_BOX(vbox1),collation_hbox,false,false,0); + GtkWidget *label=gtk_label_new(NULL); + gtk_misc_set_alignment (GTK_MISC (label), 0, .5); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("\tCollation _function:")); + gtk_box_pack_start(GTK_BOX(collation_hbox),label,false,false,0); + GtkWidget *combobox = gtk_combo_box_new_text(); + gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(combobox), FALSE); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_general_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_unicode_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_bin"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_czech_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_danish_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_esperanto_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_estonian_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_hungarian_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_icelandic_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_latvian_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_lithuanian_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_persian_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_polish_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_roman_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_romanian_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_slovak_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_slovenian_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_spanish_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_spanish2_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_swedish_ci"); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), "utf8_turkish_ci"); + int collate_function = conf->get_int_at("dictionary/collate_function"); + gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), collate_function); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), combobox); + gtk_box_pack_start(GTK_BOX(collation_hbox), combobox, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (combobox), "changed", G_CALLBACK (on_setup_dictionary_collation_combobox_changed), this); + gtk_widget_set_sensitive(collation_hbox, enable); + + label = gtk_label_new(_("After enabled collation, when load the dictionaries for the first time, it will take some time for sorting, please wait for a moment.")); + gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); + gtk_box_pack_start(GTK_BOX(vbox1),label,false,false,0); + + GtkWidget *hbox = gtk_hbox_new(false,6); + gtk_box_pack_start(GTK_BOX(vbox1),hbox,false,false,0); + GtkWidget *button = gtk_button_new_with_mnemonic(_("C_lean all cache files")); + gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON)); + gtk_box_pack_end(GTK_BOX(hbox),button,false,false,0); + g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (on_setup_dictionary_cache_cleanbutton_clicked), this); +} + + + +void PrefsDlg::on_setup_dictionary_export_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean enable = gtk_toggle_button_get_active(button); + conf->set_bool_at("dictionary/only_export_word", enable); +} + +void PrefsDlg::on_setup_dictionary_export_browse_button_clicked(GtkButton *button, PrefsDlg *oPrefsDlg) +{ + GtkWidget *dialog; + dialog = gtk_file_chooser_dialog_new (_("Open file..."), + GTK_WINDOW(oPrefsDlg->window), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER (dialog), gtk_entry_get_text(oPrefsDlg->eExportFile)); + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { + gchar *filename; + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + gtk_entry_set_text(oPrefsDlg->eExportFile, filename); + g_free (filename); + } + gtk_widget_destroy (dialog); +} + +void PrefsDlg::setup_dictionary_export_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Export"), GTK_STOCK_SAVE); + GtkWidget *vbox1 = gtk_vbox_new(false, 6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0); + + GtkWidget *check_button; + check_button = gtk_check_button_new_with_mnemonic(_("_Only export words.")); + bool enable= conf->get_bool_at("dictionary/only_export_word"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), enable); + g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_export_ckbutton_toggled), this); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + + GtkWidget *hbox1 = gtk_hbox_new(FALSE, 6); + GtkWidget *label=gtk_label_new(_("File name:")); + gtk_box_pack_start(GTK_BOX(hbox1), label, FALSE, FALSE, 0); + GtkWidget *e = gtk_entry_new(); + const std::string &exportfile= conf->get_string_at("dictionary/export_file"); + gtk_entry_set_text(GTK_ENTRY(e), exportfile.c_str()); + gtk_box_pack_start(GTK_BOX(hbox1), e, TRUE, TRUE, 0); + eExportFile=GTK_ENTRY(e); + + GtkWidget *button; + button = gtk_button_new_with_mnemonic(_("_Browse...")); + GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_dictionary_export_browse_button_clicked), this); + gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0); +} + +void PrefsDlg::on_markup_search_word(GtkToggleButton *button, PrefsDlg *) +{ + conf->set_bool_at("dictionary/markup_search_word", + gtk_toggle_button_get_active(button)); +} + +void PrefsDlg::setup_dict_article_rendering() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Article rendering"), + GTK_STOCK_CONVERT); + GtkWidget *vbox1 = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox), vbox1, FALSE, FALSE, 0); + + GtkWidget *ck_btn = + gtk_check_button_new_with_mnemonic(_("_Highlight search term")); + gtk_box_pack_start(GTK_BOX(vbox1), ck_btn, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ck_btn), + conf->get_bool_at("dictionary/markup_search_word")); + g_signal_connect(G_OBJECT(ck_btn), "toggled", + G_CALLBACK(on_markup_search_word), this); +} + +void PrefsDlg::on_setup_dictionary_sound_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean enable = gtk_toggle_button_get_active(button); + conf->set_bool_at("dictionary/enable_sound_event",enable); +} + +#ifndef _WIN32 +void PrefsDlg::on_setup_dictionary_use_tts_program_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean enable = gtk_toggle_button_get_active(button); + gtk_widget_set_sensitive(oPrefsDlg->use_tts_program_hbox,enable); + conf->set_bool("/apps/stardict/preferences/dictionary/use_tts_program", enable); + gpAppFrame->oReadWord.use_command_tts = enable; + gpAppFrame->oMidWin.oToolWin.UpdatePronounceMenu(); +} +#endif + +void PrefsDlg::setup_dictionary_sound_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Sound"), GTK_STOCK_YES); + GtkWidget *vbox1 = gtk_vbox_new(false, 6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0); + + GtkWidget *check_button; + check_button = gtk_check_button_new_with_mnemonic(_("_Enable sound event.")); + bool enable= + conf->get_bool_at("dictionary/enable_sound_event"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), enable); + g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_sound_ckbutton_toggled), (gpointer)this); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + GtkWidget *label; +#if defined(CONFIG_GTK) || defined(CONFIG_GPE) + GtkWidget *hbox2 = gtk_hbox_new(FALSE, 6); + label=gtk_label_new(_("Command for playing wav files:")); + gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0); + GtkWidget *e = gtk_entry_new(); + gtk_widget_set_size_request(e, 50, -1); + const std::string &playcmd= + conf->get_string_at("dictionary/play_command"); + gtk_entry_set_text(GTK_ENTRY(e), playcmd.c_str()); + gtk_box_pack_start(GTK_BOX(hbox2), e, TRUE, TRUE, 0); + gtk_widget_set_sensitive(hbox2, enable); + ePlayCommand=GTK_ENTRY(e); + gtk_box_pack_start(GTK_BOX(vbox1), hbox2, FALSE, FALSE, 0); +#endif + + label = gtk_label_new(_("RealPeopleTTS search path:")); + gtk_misc_set_alignment(GTK_MISC(label), 0, .5); + gtk_box_pack_start(GTK_BOX(vbox1),label,false,false,0); + tts_textview = gtk_text_view_new(); + gtk_widget_set_size_request(tts_textview, -1, 70); + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tts_textview), GTK_WRAP_CHAR); + const std::string &ttspath = conf->get_string_at("dictionary/tts_path"); + GtkTextBuffer *text_view_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tts_textview)); + gtk_text_buffer_set_text(text_view_buffer, ttspath.c_str(), -1); + GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), + GTK_SHADOW_ETCHED_IN); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_container_add(GTK_CONTAINER(scrolled_window), tts_textview); + gtk_box_pack_start(GTK_BOX(vbox1),scrolled_window,false,false,0); + +#ifndef _WIN32 + check_button = gtk_check_button_new_with_mnemonic(_("_Use TTS program.")); + enable = conf->get_bool("/apps/stardict/preferences/dictionary/use_tts_program"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), enable); + g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_use_tts_program_ckbutton_toggled), this); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + use_tts_program_hbox = gtk_hbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox1),use_tts_program_hbox,false,false,0); + gtk_widget_set_sensitive(use_tts_program_hbox,enable); + label = gtk_label_new(_("Commandline:")); + gtk_misc_set_alignment(GTK_MISC(label), 0, .5); + gtk_box_pack_start(GTK_BOX(use_tts_program_hbox),label,false,false,0); + GtkWidget *comboboxentry = gtk_combo_box_entry_new_text(); + gtk_widget_set_size_request(comboboxentry, 30, -1); + gtk_combo_box_append_text(GTK_COMBO_BOX(comboboxentry), "echo %s | festival --tts &"); + gtk_combo_box_append_text(GTK_COMBO_BOX(comboboxentry), "espeak %s &"); + eTTSCommandline = GTK_ENTRY(GTK_BIN(comboboxentry)->child); + const std::string &tts_program_cmdline = conf->get_string("/apps/stardict/preferences/dictionary/tts_program_cmdline"); + gtk_entry_set_text(eTTSCommandline, tts_program_cmdline.c_str()); + gtk_box_pack_start(GTK_BOX(use_tts_program_hbox),comboboxentry,true,true,0); +#endif +} + +void PrefsDlg::on_setup_network_netdict_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + conf->set_bool_at("network/enable_netdict", + gtk_toggle_button_get_active(button)); +} + +static void on_account_passwd_entry_activated(GtkEntry *entry, GtkDialog *dialog) +{ + gtk_dialog_response(dialog, GTK_RESPONSE_OK); +} + +void PrefsDlg::on_setup_network_account_button_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + GtkWidget *account_dialog; + account_dialog = + gtk_dialog_new_with_buttons (_("Account"), + GTK_WINDOW (oPrefsDlg->window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, + GTK_RESPONSE_OK, + NULL); + GtkWidget *table = gtk_table_new(2, 2, FALSE); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(account_dialog)->vbox), table); + gtk_container_set_border_width(GTK_CONTAINER(table), 6); + GtkWidget *label = gtk_label_new_with_mnemonic(_("_User Name:")); + gtk_misc_set_alignment(GTK_MISC(label), 0, .5); + GtkWidget *user_entry = gtk_entry_new (); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), user_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), user_entry, 1, 2, 0, 1, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + label = gtk_label_new_with_mnemonic(_("_Password:")); + gtk_misc_set_alignment (GTK_MISC (label), 0, .5); + GtkWidget *passwd_entry = gtk_entry_new (); + gtk_entry_set_visibility(GTK_ENTRY(passwd_entry), FALSE); + g_signal_connect(G_OBJECT(passwd_entry),"activate", G_CALLBACK(on_account_passwd_entry_activated), account_dialog); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), passwd_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), passwd_entry, 1, 2, 1, 2, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + gtk_dialog_set_default_response(GTK_DIALOG(account_dialog), GTK_RESPONSE_OK); + gtk_window_set_resizable(GTK_WINDOW(account_dialog), FALSE); + gtk_widget_show_all(GTK_WIDGET(account_dialog)); + while (gtk_dialog_run(GTK_DIALOG(account_dialog))==GTK_RESPONSE_OK) { + const gchar *user = gtk_entry_get_text(GTK_ENTRY(user_entry)); + if (!user[0]) { + conf->set_string_at("network/user", ""); + conf->set_string_at("network/md5passwd", ""); + gtk_button_set_label(oPrefsDlg->bAccount, "Guest"); + gpAppFrame->oStarDictClient.set_auth("", ""); + break; + } + gchar *error_msg = NULL; + const gchar *passwd = gtk_entry_get_text(GTK_ENTRY(passwd_entry)); + if (!passwd[0]) + error_msg = _("Please input the password."); + if (error_msg) { + GtkWidget *message_dlg = + gtk_message_dialog_new( + GTK_WINDOW(account_dialog), + (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_INFO, GTK_BUTTONS_OK, + error_msg); + gtk_dialog_set_default_response(GTK_DIALOG(message_dlg), GTK_RESPONSE_OK); + gtk_window_set_resizable(GTK_WINDOW(message_dlg), FALSE); + gtk_dialog_run(GTK_DIALOG(message_dlg)); + gtk_widget_destroy(message_dlg); + continue; + } + conf->set_string_at("network/user", user); + struct MD5Context ctx; + unsigned char digest[16]; + MD5Init(&ctx); + MD5Update(&ctx, (const unsigned char*)passwd, strlen(passwd)); + MD5Final(digest, &ctx ); + char hex[33]; + for (int i = 0; i < 16; i++) + sprintf( hex+2*i, "%02x", digest[i] ); + hex[32] = '\0'; + conf->set_string_at("network/md5passwd", hex); + gtk_button_set_label(oPrefsDlg->bAccount, user); + gpAppFrame->oStarDictClient.set_auth(user, hex); + break; + } + gtk_widget_destroy(account_dialog); +} + +void PrefsDlg::on_register_end(const char *msg) +{ + gtk_button_set_label(bAccount, register_user.c_str()); + conf->set_string_at("network/user", register_user); + conf->set_string_at("network/md5passwd", register_hex); + gpAppFrame->oStarDictClient.set_auth(register_user.c_str(), register_hex.c_str()); + + GtkWidget *message_dlg = gtk_message_dialog_new(GTK_WINDOW(window), + (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_INFO, GTK_BUTTONS_OK, msg); + gtk_dialog_set_default_response(GTK_DIALOG(message_dlg), GTK_RESPONSE_OK); + gtk_window_set_resizable(GTK_WINDOW(message_dlg), FALSE); + g_signal_connect_swapped (message_dlg, "response", G_CALLBACK (gtk_widget_destroy), message_dlg); + gtk_widget_show(message_dlg); +} + +static void on_register_email_button_activated(GtkEntry *entry, GtkDialog *dialog) +{ + gtk_dialog_response(dialog, GTK_RESPONSE_OK); +} + +void PrefsDlg::on_setup_network_register_button_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + GtkWidget *register_dialog; + register_dialog = + gtk_dialog_new_with_buttons (_("Register"), + GTK_WINDOW (oPrefsDlg->window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, + GTK_RESPONSE_OK, + NULL); + GtkWidget *table = gtk_table_new(3, 2, FALSE); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(register_dialog)->vbox), table); + gtk_container_set_border_width(GTK_CONTAINER(table), 6); + GtkWidget *label = gtk_label_new_with_mnemonic(_("_User Name:")); + gtk_misc_set_alignment(GTK_MISC(label), 0, .5); + GtkWidget *user_entry = gtk_entry_new (); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), user_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), user_entry, 1, 2, 0, 1, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + label = gtk_label_new_with_mnemonic(_("_Password:")); + gtk_misc_set_alignment (GTK_MISC (label), 0, .5); + GtkWidget *passwd_entry = gtk_entry_new (); + gtk_entry_set_visibility(GTK_ENTRY(passwd_entry), FALSE); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), passwd_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), passwd_entry, 1, 2, 1, 2, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + label = gtk_label_new_with_mnemonic(_("_Email:")); + gtk_misc_set_alignment(GTK_MISC(label), 0, .5); + GtkWidget *email_entry = gtk_entry_new (); + g_signal_connect(G_OBJECT(email_entry),"activate", G_CALLBACK(on_register_email_button_activated), register_dialog); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), email_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), email_entry, 1, 2, 2, 3, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + gtk_dialog_set_default_response(GTK_DIALOG(register_dialog), GTK_RESPONSE_OK); + gtk_window_set_resizable(GTK_WINDOW(register_dialog), FALSE); + gtk_widget_show_all(GTK_WIDGET(register_dialog)); + while (gtk_dialog_run(GTK_DIALOG(register_dialog))==GTK_RESPONSE_OK) { + gchar *error_msg = NULL; + const gchar *user = gtk_entry_get_text(GTK_ENTRY(user_entry)); + const gchar *passwd = gtk_entry_get_text(GTK_ENTRY(passwd_entry)); + const gchar *email = gtk_entry_get_text(GTK_ENTRY(email_entry)); + if (!user[0]) + error_msg = _("Please input the user name."); + else if (!passwd[0]) + error_msg = _("Please input the password."); + else if (!email[0]) + error_msg = _("Please input the email."); + else if (strchr(email, '@')==NULL) + error_msg = _("Please input a valid email."); + if (error_msg) { + GtkWidget *message_dlg = + gtk_message_dialog_new( + GTK_WINDOW(register_dialog), + (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_INFO, GTK_BUTTONS_OK, + error_msg); + gtk_dialog_set_default_response(GTK_DIALOG(message_dlg), GTK_RESPONSE_OK); + gtk_window_set_resizable(GTK_WINDOW(message_dlg), FALSE); + gtk_dialog_run(GTK_DIALOG(message_dlg)); + gtk_widget_destroy(message_dlg); + continue; + } + struct MD5Context ctx; + unsigned char digest[16]; + MD5Init(&ctx); + MD5Update(&ctx, (const unsigned char*)passwd, strlen(passwd)); + MD5Final(digest, &ctx ); + char hex[33]; + for (int i = 0; i < 16; i++) + sprintf( hex+2*i, "%02x", digest[i] ); + hex[32] = '\0'; + const gchar *server = gtk_entry_get_text(oPrefsDlg->eStarDictServer); + int port = atoi(gtk_entry_get_text(oPrefsDlg->eStarDictServerPort)); + gpAppFrame->oStarDictClient.set_server(server, port); + gpAppFrame->oStarDictClient.set_auth("", ""); + oPrefsDlg->register_user = user; + oPrefsDlg->register_hex = hex; + STARDICT::Cmd *c = new STARDICT::Cmd(STARDICT::CMD_REGISTER, user, hex, email); + gpAppFrame->oStarDictClient.send_commands(1, c); + break; + } + gtk_widget_destroy(register_dialog); +} + +void PrefsDlg::setup_network_netdict() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Net Dict"), + GTK_STOCK_NETWORK); + GtkWidget *vbox1 = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox), vbox1, FALSE, FALSE, 0); + + GtkWidget *ck_btn = + gtk_check_button_new_with_mnemonic(_("Enable _network dictionaries.")); + gtk_box_pack_start(GTK_BOX(vbox1), ck_btn, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ck_btn), + conf->get_bool_at("network/enable_netdict")); + g_signal_connect(G_OBJECT(ck_btn), "toggled", + G_CALLBACK(on_setup_network_netdict_ckbutton_toggled), this); + + GtkWidget *table; + table = gtk_table_new(3, 2, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), 6); + gtk_table_set_col_spacings(GTK_TABLE(table), 6); + gtk_box_pack_start(GTK_BOX(vbox1),table,false,false,0); + GtkWidget *label=gtk_label_new(_("StarDict server:")); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + GtkWidget *comboboxentry = gtk_combo_box_entry_new_text(); + gtk_table_attach(GTK_TABLE(table), comboboxentry, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + gtk_combo_box_append_text(GTK_COMBO_BOX(comboboxentry), "dict.stardict.org"); + gtk_combo_box_append_text(GTK_COMBO_BOX(comboboxentry), "dict.stardict.cn"); + eStarDictServer=GTK_ENTRY(GTK_BIN(comboboxentry)->child); + const std::string &server= conf->get_string_at("network/server"); + gtk_entry_set_text(eStarDictServer, server.c_str()); + label=gtk_label_new(_("Port:")); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); + GtkWidget *e = gtk_entry_new(); + int port = conf->get_int_at("network/port"); + gchar *str = g_strdup_printf("%d", port); + gtk_entry_set_text(GTK_ENTRY(e), str); + g_free(str); + gtk_table_attach(GTK_TABLE(table), e, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0); + eStarDictServerPort=GTK_ENTRY(e); + label=gtk_label_new(_("Account:")); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0, 0); + const std::string &user= conf->get_string_at("network/user"); + GtkWidget *button; + if (user.empty()) + button = gtk_button_new_with_label("Guest"); + else + button = gtk_button_new_with_label(user.c_str()); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_network_account_button_clicked), this); + gtk_table_attach(GTK_TABLE(table), button, 1, 2, 2, 3, GTK_FILL, GTK_FILL, 0, 0); + bAccount = GTK_BUTTON(button); + button = gtk_button_new_with_mnemonic(_("_Register an account")); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_network_register_button_clicked), this); + GtkWidget *hbox1 = gtk_hbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(hbox1),button,false,false,0); + gtk_box_pack_start(GTK_BOX(vbox1),hbox1,false,false,0); +} + +void PrefsDlg::on_setup_mainwin_searchWhileTyping_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + conf->set_bool_at("main_window/search_while_typing", + gtk_toggle_button_get_active(button)); +} + +void PrefsDlg::on_setup_mainwin_showfirstWhenNotfound_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + conf->set_bool_at("main_window/showfirst_when_notfound", + gtk_toggle_button_get_active(button)); +} + +void PrefsDlg::on_setup_mainwin_input_timeout_spinbutton_changed(GtkSpinButton *button, PrefsDlg *oPrefsDlg) +{ + gint timeout = gtk_spin_button_get_value_as_int(button); + conf->set_int_at("main_window/word_change_timeout", timeout); + gpAppFrame->word_change_timeout = timeout; +} + +void PrefsDlg::setup_mainwin_input_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Input"), + GTK_STOCK_EDIT); + + GtkWidget *vbox1 = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,FALSE,FALSE, 0); + + GtkWidget *check_button = + gtk_check_button_new_with_mnemonic(_("_Search while typing.")); + gtk_box_pack_start(GTK_BOX(vbox1), check_button, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), + conf->get_bool_at("main_window/search_while_typing")); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_mainwin_searchWhileTyping_ckbutton_toggled), this); + GtkWidget *hbox = gtk_hbox_new(false, 5); + gtk_box_pack_start(GTK_BOX(vbox1),hbox,FALSE,FALSE, 0); + GtkWidget *label=gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("Word change _timeout:")); + gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE, 0); + GtkWidget *spin_button; + spin_button = gtk_spin_button_new_with_range(50,2000,50); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin_button); + gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin_button), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), conf->get_int_at("main_window/word_change_timeout")); + g_signal_connect(G_OBJECT(spin_button), "value-changed", G_CALLBACK(on_setup_mainwin_input_timeout_spinbutton_changed), this); + gtk_box_pack_start(GTK_BOX(hbox),spin_button,FALSE,FALSE, 0); + label=gtk_label_new(_("(default:300)")); + gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE, 0); + check_button = gtk_check_button_new_with_mnemonic(_("Show the _first word when not found.")); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,FALSE,FALSE,0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), conf->get_bool_at("main_window/showfirst_when_notfound")); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_mainwin_showfirstWhenNotfound_ckbutton_toggled), this); +} + +void PrefsDlg::on_setup_mainwin_startup_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + conf->set_bool_at("main_window/hide_on_startup", + gtk_toggle_button_get_active(button)); +} + +#ifdef _WIN32 +void PrefsDlg::on_setup_mainwin_autorun_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean b = gtk_toggle_button_get_active(button); + HKEY hKEY; + LONG lRet; + if (b) { + lRet =RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_ALL_ACCESS,&hKEY); + if(lRet==ERROR_SUCCESS) { + std::string path = gStarDictDataDir+ G_DIR_SEPARATOR_S "stardict.exe"; + RegSetValueEx(hKEY, "StarDict", 0, REG_SZ, (const BYTE*)path.c_str(), path.length()+1); + RegCloseKey(hKEY); + } + } else { + lRet =RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_ALL_ACCESS,&hKEY); + if(lRet==ERROR_SUCCESS) { + RegDeleteValue(hKEY, "StarDict"); + RegCloseKey(hKEY); + } + } +} + +void PrefsDlg::on_setup_mainwin_use_mainwindow_hotkey_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean b = gtk_toggle_button_get_active(button); + if (b) + gpAppFrame->oHotkey.start_mainwindow(); + else + gpAppFrame->oHotkey.stop_mainwindow(); + conf->set_bool_at("dictionary/use_mainwindow_hotkey", b); +} +#endif + +void PrefsDlg::on_setup_mainwin_transparent_scale_changed(GtkRange *range, PrefsDlg *oPrefsDlg) +{ + gint transparent = (gint)gtk_range_get_value(range); + conf->set_int_at("main_window/transparent", transparent); + gtk_window_set_opacity(GTK_WINDOW(gpAppFrame->window), (100-transparent)/100.0); +} + +void PrefsDlg::setup_mainwin_options_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Options"), GTK_STOCK_EXECUTE); + GtkWidget *vbox1 = gtk_vbox_new(FALSE, 6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,FALSE,FALSE, 0); + + GtkWidget *check_button; +#ifdef _WIN32 + check_button = gtk_check_button_new_with_mnemonic(_("_Auto run StarDict after boot.")); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,FALSE,FALSE,0); + gboolean autorun; + + HKEY hKEY; + LONG lRet =RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_QUERY_VALUE,&hKEY); + if(lRet!=ERROR_SUCCESS) { + autorun = false; + } else { + char owner_Get[80]; + DWORD cbData_1=80; + DWORD type_1=REG_SZ; + lRet=RegQueryValueEx(hKEY,"StarDict",NULL,&type_1,(LPBYTE)owner_Get,&cbData_1); + RegCloseKey(hKEY); + if((lRet!=ERROR_SUCCESS)||(cbData_1 > 80)) { + autorun = false; + } else { + std::string path = gStarDictDataDir+ G_DIR_SEPARATOR_S "stardict.exe"; + if (strcmp(path.c_str(), owner_Get)==0) + autorun = true; + else + autorun = false; + } + } + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), autorun); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_mainwin_autorun_ckbutton_toggled), this); +#endif + + check_button = gtk_check_button_new_with_mnemonic(_("Hide main window when _starting StarDict.")); + gtk_box_pack_start(GTK_BOX(vbox1), check_button, FALSE, FALSE, 0); + bool hide= + conf->get_bool_at("main_window/hide_on_startup"); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), hide); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_mainwin_startup_ckbutton_toggled), this); + +#ifdef _WIN32 + check_button = gtk_check_button_new_with_mnemonic(_("_Use open main window hotkey: Ctrl+Alt+Z.")); + gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), conf->get_bool_at("dictionary/use_mainwindow_hotkey")); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_mainwin_use_mainwindow_hotkey_ckbutton_toggled), this); +#endif + + GtkWidget *hbox = gtk_hbox_new(false, 5); + gtk_box_pack_start(GTK_BOX(vbox1),hbox,FALSE,FALSE, 0); + GtkWidget *label=gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Transparency:")); + gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE, 0); + GtkWidget *hscale; + hscale = gtk_hscale_new_with_range(0,80,1); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), hscale); + int transparent=conf->get_int_at("main_window/transparent"); + gtk_range_set_value(GTK_RANGE(hscale), transparent); + g_signal_connect(G_OBJECT(hscale), "value-changed", G_CALLBACK(on_setup_mainwin_transparent_scale_changed), this); + gtk_box_pack_start(GTK_BOX(hbox),hscale,TRUE,TRUE, 0); +} + +void PrefsDlg::write_mainwin_searchwebsite_list() +{ + GtkTreeIter iter; + gboolean have_iter; + gchar *website_name, *website_link, *website_searchlink; + std::list searchwebsite_list; + GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW (searchwebsite_treeview)); + + have_iter = gtk_tree_model_get_iter_first(model, &iter); + while (have_iter) { + gtk_tree_model_get (model, &iter, 0, &website_name, 1, &website_link, 2, &website_searchlink, -1); + std::string website(std::string(website_name)+'\t'+website_link+'\t'+website_searchlink); + g_free(website_name); + g_free(website_link); + g_free(website_searchlink); + searchwebsite_list.push_back(website); + have_iter = gtk_tree_model_iter_next(model, &iter); + } + conf->set_strlist_at("main_window/search_website_list", searchwebsite_list); +} + +void PrefsDlg::on_setup_mainwin_searchwebsite_moveup_button_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (oPrefsDlg->searchwebsite_treeview)); + GtkTreeModel *model; + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(selection, &model, &iter)) { + GtkTreePath* path = gtk_tree_model_get_path(model, &iter); + if (gtk_tree_path_prev(path)) { + GtkTreeIter prev; + gtk_tree_model_get_iter(model, &prev, path); + gtk_list_store_swap(GTK_LIST_STORE(model), &iter, &prev); + gtk_tree_selection_select_path(selection, path); + gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW (oPrefsDlg->searchwebsite_treeview), path, NULL, false, 0, 0); + oPrefsDlg->write_mainwin_searchwebsite_list(); + } + gtk_tree_path_free(path); + } +} + +void PrefsDlg::on_setup_mainwin_searchwebsite_movedown_button_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (oPrefsDlg->searchwebsite_treeview)); + GtkTreeModel *model; + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(selection, &model, &iter)) { + GtkTreePath* path = gtk_tree_model_get_path(model, &iter); + gtk_tree_path_next(path); + GtkTreeIter next; + if (gtk_tree_model_get_iter(model, &next, path)) { + gtk_list_store_swap(GTK_LIST_STORE(model), &iter, &next); + gtk_tree_selection_select_path(selection, path); + gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW (oPrefsDlg->searchwebsite_treeview), path, NULL, false, 0, 0); + oPrefsDlg->write_mainwin_searchwebsite_list(); + } + gtk_tree_path_free(path); + } +} + +void PrefsDlg::on_setup_mainwin_searchwebsite_add_button_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + GtkWidget *searchwebsite_add_dialog; + GtkWidget *searchwebsite_add_dialog_name_entry; + GtkWidget *searchwebsite_add_dialog_link_entry; + GtkWidget *searchwebsite_add_dialog_searchlink_entry; + + searchwebsite_add_dialog = + gtk_dialog_new_with_buttons (_("Add"), + GTK_WINDOW (oPrefsDlg->window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, + GTK_RESPONSE_OK, + NULL); + GtkWidget *table = gtk_table_new(3, 2, FALSE); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(searchwebsite_add_dialog)->vbox), table); +#ifndef CONFIG_GPE + gtk_container_set_border_width(GTK_CONTAINER(table), 6); +#endif + GtkWidget *label = gtk_label_new_with_mnemonic(_("Website Name")); + gtk_misc_set_alignment(GTK_MISC(label), 0, .5); + searchwebsite_add_dialog_name_entry = gtk_entry_new (); +#ifdef CONFIG_GPE + gtk_widget_set_size_request(searchwebsite_add_dialog_name_entry, 100, -1); +#endif + gtk_entry_set_activates_default(GTK_ENTRY(searchwebsite_add_dialog_name_entry), TRUE); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), searchwebsite_add_dialog_name_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), searchwebsite_add_dialog_name_entry, 1, 2, 0, 1, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + + + label = gtk_label_new_with_mnemonic(_("Website link")); + gtk_misc_set_alignment (GTK_MISC (label), 0, .5); + searchwebsite_add_dialog_link_entry = gtk_entry_new (); +#ifdef CONFIG_GPE + gtk_widget_set_size_request(searchwebsite_add_dialog_link_entry, 100, -1); +#endif + gtk_entry_set_activates_default (GTK_ENTRY (searchwebsite_add_dialog_link_entry), TRUE); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), searchwebsite_add_dialog_link_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), searchwebsite_add_dialog_link_entry, 1, 2, 1, 2, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + + label = gtk_label_new_with_mnemonic(_("Website search link")); + gtk_misc_set_alignment (GTK_MISC (label), 0, .5); + searchwebsite_add_dialog_searchlink_entry = gtk_entry_new (); +#ifdef CONFIG_GPE + gtk_widget_set_size_request(searchwebsite_add_dialog_searchlink_entry, 100, -1); +#endif + gtk_entry_set_activates_default (GTK_ENTRY (searchwebsite_add_dialog_searchlink_entry), TRUE); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), searchwebsite_add_dialog_searchlink_entry); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, (GtkAttachOptions)0, 6, 4); + gtk_table_attach(GTK_TABLE(table), searchwebsite_add_dialog_searchlink_entry, 1, 2, 2, 3, GTK_EXPAND, (GtkAttachOptions)0, 0, 4); + + gtk_dialog_set_default_response(GTK_DIALOG(searchwebsite_add_dialog), GTK_RESPONSE_OK); + gtk_window_set_resizable(GTK_WINDOW(searchwebsite_add_dialog), FALSE); + + gtk_widget_show_all(GTK_WIDGET(searchwebsite_add_dialog)); + while (gtk_dialog_run(GTK_DIALOG(searchwebsite_add_dialog))==GTK_RESPONSE_OK) { + gchar *error_msg = NULL; + const gchar *website_name = gtk_entry_get_text(GTK_ENTRY(searchwebsite_add_dialog_name_entry)); + const gchar *website_link = gtk_entry_get_text(GTK_ENTRY(searchwebsite_add_dialog_link_entry)); + const gchar *website_searchlink = gtk_entry_get_text(GTK_ENTRY(searchwebsite_add_dialog_searchlink_entry)); + if (!website_name[0]) + error_msg = _("Please input the website name."); + else if (!website_link[0]) + error_msg = _("Please input the website link."); + else if (!website_searchlink[0]) + error_msg = _("Please input the website search link."); + else if (!strstr(website_searchlink, "%s")) { + error_msg = _("The website search link should contain a \"%%s\" string for querying a word."); + } + + if (error_msg) { + GtkWidget *message_dlg = + gtk_message_dialog_new( + GTK_WINDOW(searchwebsite_add_dialog), + (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_INFO, GTK_BUTTONS_OK, + error_msg); + + gtk_dialog_set_default_response(GTK_DIALOG(message_dlg), GTK_RESPONSE_OK); + gtk_window_set_resizable(GTK_WINDOW(message_dlg), FALSE); + + gtk_dialog_run(GTK_DIALOG(message_dlg)); + gtk_widget_destroy(message_dlg); + continue; + } + GtkListStore *model = + GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(oPrefsDlg->searchwebsite_treeview))); + GtkTreeIter iter; + gtk_list_store_prepend(model, &iter); + gtk_list_store_set(model, &iter, + 0, website_name, + 1, website_link, + 2, website_searchlink, + 3, TRUE, + -1); + oPrefsDlg->write_mainwin_searchwebsite_list(); + break; + } + gtk_widget_destroy(searchwebsite_add_dialog); +} + +void PrefsDlg::on_setup_mainwin_searchwebsite_remove_button_clicked(GtkWidget *widget, PrefsDlg *oPrefsDlg) +{ + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (oPrefsDlg->searchwebsite_treeview)); + GtkTreeModel *model; + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(selection, &model, &iter)) { + if (gtk_list_store_remove(GTK_LIST_STORE(model), &iter)) { + GtkTreePath* path = gtk_tree_model_get_path(model, &iter); + gtk_tree_selection_select_path(selection, path); + gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW (oPrefsDlg->searchwebsite_treeview), path, NULL, false, 0, 0); + gtk_tree_path_free(path); + } + oPrefsDlg->write_mainwin_searchwebsite_list(); + } +} + +void PrefsDlg::on_setup_mainwin_searchwebsite_cell_edited(GtkCellRendererText *cell, const gchar *path_string, const gchar *new_text, PrefsDlg *oPrefsDlg) +{ + GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW (oPrefsDlg->searchwebsite_treeview)); + GtkTreePath *path = gtk_tree_path_new_from_string (path_string); + GtkTreeIter iter; + + glong column; + column = (glong)(g_object_get_data (G_OBJECT (cell), "column")); + gtk_tree_model_get_iter (model, &iter, path); + + switch (column) { + case 0: + case 1: + if (new_text[0]) { + gtk_list_store_set (GTK_LIST_STORE (model), &iter, column, new_text, -1); + oPrefsDlg->write_mainwin_searchwebsite_list(); + } + break; + case 2: + if (new_text[0]) { + if (!strstr(new_text, "%s")) { + GtkWidget *message_dlg; + + message_dlg = gtk_message_dialog_new ( + GTK_WINDOW (oPrefsDlg->window), + (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + _("The website search link should contain a \"%%s\" string for querying a word.")); + + gtk_dialog_set_default_response (GTK_DIALOG (message_dlg), GTK_RESPONSE_OK); + + gtk_window_set_resizable (GTK_WINDOW (message_dlg), FALSE); + + gtk_dialog_run (GTK_DIALOG (message_dlg)); + gtk_widget_destroy (message_dlg); + } + else { + gtk_list_store_set (GTK_LIST_STORE (model), &iter, 2, new_text, -1); + oPrefsDlg->write_mainwin_searchwebsite_list(); + } + } + break; + + } + + gtk_tree_path_free (path); +} + +void PrefsDlg::setup_mainwin_searchwebsite_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Search website"), GTK_STOCK_JUMP_TO); + GtkWidget *vbox2; + vbox2 = gtk_vbox_new(false, 6); + gtk_box_pack_start(GTK_BOX(vbox), vbox2, true, true,0); + + GtkListStore *model; + model = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); + + const std::list &web_list= + conf->get_strlist_at("main_window/search_website_list"); + + GtkTreeIter iter; + for (std::list::const_iterator wit=web_list.begin(); + wit!=web_list.end(); ++wit) { + std::vector l=split(*wit, '\t'); + if (l.size()==3) { + gtk_list_store_append(model, &iter); + gtk_list_store_set(model, &iter, + 0, l[0].c_str(), + 1, l[1].c_str(), + 2, l[2].c_str(), + 3, TRUE, + -1); + } + } + + GtkWidget *sw; + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + gtk_widget_set_size_request (sw, 300, 180); + + searchwebsite_treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(model)); + g_object_unref (G_OBJECT (model)); + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (searchwebsite_treeview), TRUE); + + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (searchwebsite_treeview)); + + gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); + + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + renderer = gtk_cell_renderer_text_new (); + g_signal_connect (renderer, "edited", G_CALLBACK (on_setup_mainwin_searchwebsite_cell_edited), this); + g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER(0)); + column = gtk_tree_view_column_new_with_attributes (_("Website Name"), renderer, "text", 0, "editable", 3, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(searchwebsite_treeview), column); + gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), FALSE); + + renderer = gtk_cell_renderer_text_new (); + g_signal_connect (renderer, "edited", G_CALLBACK (on_setup_mainwin_searchwebsite_cell_edited), this); + g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER(1)); + column = gtk_tree_view_column_new_with_attributes (_("Website link"), renderer, "text", 1, "editable", 3, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(searchwebsite_treeview), column); + gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), FALSE); + + renderer = gtk_cell_renderer_text_new (); + g_signal_connect (renderer, "edited", G_CALLBACK (on_setup_mainwin_searchwebsite_cell_edited), this); + g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER(2)); + column = gtk_tree_view_column_new_with_attributes (_("Website search link"), renderer, "text", 2, "editable", 3, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(searchwebsite_treeview), column); + gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), FALSE); + + gtk_container_add (GTK_CONTAINER (sw), searchwebsite_treeview); + gtk_box_pack_start (GTK_BOX (vbox2), sw, TRUE, TRUE, 0); + + GtkWidget *hbox1; + hbox1 = gtk_hbox_new(false,6); + GtkWidget *button; + button = gtk_button_new(); + GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_GO_UP, GTK_ICON_SIZE_BUTTON); + gtk_container_add(GTK_CONTAINER(button), image); + GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_mainwin_searchwebsite_moveup_button_clicked), this); + gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0); + button = gtk_button_new(); + image = gtk_image_new_from_stock(GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_BUTTON); + gtk_container_add(GTK_CONTAINER(button), image); + GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_mainwin_searchwebsite_movedown_button_clicked), this); + gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0); + button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); + GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_mainwin_searchwebsite_remove_button_clicked), this); + gtk_box_pack_end (GTK_BOX (hbox1), button, FALSE, FALSE, 0); + +/* button = gtk_button_new(); + GtkWidget *align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); + gtk_container_add (GTK_CONTAINER (button), align); + GtkWidget *hbox2 = gtk_hbox_new (FALSE, 2); + gtk_container_add (GTK_CONTAINER (align), hbox2); + label = gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Modify")); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), button); + image = gtk_image_new_from_stock (GTK_STOCK_CONVERT, GTK_ICON_SIZE_BUTTON); + gtk_box_pack_start (GTK_BOX (hbox2), image, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_mainwin_searchwebsite_edit_button_clicked), this); + gtk_box_pack_end (GTK_BOX (hbox1), button, FALSE, FALSE, 0);*/ + + button = gtk_button_new_from_stock(GTK_STOCK_ADD); + GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); + g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(on_setup_mainwin_searchwebsite_add_button_clicked), this); + gtk_box_pack_end (GTK_BOX (hbox1), button, FALSE, FALSE, 0); + + gtk_box_pack_start (GTK_BOX (vbox2), hbox1, false, false, 0); +} + +void PrefsDlg::on_setup_NotificationAreaIcon_QueryInFloatWin_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean queryin = gtk_toggle_button_get_active(button); + conf->set_bool_at("notification_area_icon/query_in_floatwin", + queryin); +} + +void PrefsDlg::setup_NotificationAreaIcon_options_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Options"), GTK_STOCK_DND); + GtkWidget *hbox1; + hbox1 = gtk_hbox_new(false,0); + gtk_box_pack_start(GTK_BOX(vbox),hbox1,false,false,0); + + GtkWidget *check_button; + check_button = gtk_check_button_new_with_mnemonic(_("_Query in the floating window when middle mouse\nbutton is clicked.")); + bool query_in_floatwin= + conf->get_bool_at("notification_area_icon/query_in_floatwin"); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), + query_in_floatwin); + g_signal_connect(G_OBJECT(check_button), "toggled", + G_CALLBACK(on_setup_NotificationAreaIcon_QueryInFloatWin_ckbutton_toggled), this); + gtk_box_pack_start(GTK_BOX(hbox1),check_button,false,false,0); +} + +void PrefsDlg::on_setup_floatwin_pronounce_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + conf->set_bool_at("floating_window/pronounce_when_popup", + gtk_toggle_button_get_active(button)); +} + +void PrefsDlg::on_setup_show_float_if_not_found(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + conf->set_bool_at("floating_window/show_if_not_found", + gtk_toggle_button_get_active(button)); +} + +void PrefsDlg::setup_floatwin_options_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Options"), GTK_STOCK_DND); + GtkWidget *vbox1 = gtk_vbox_new(false, 6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0); + GtkWidget *check_button = gtk_check_button_new_with_mnemonic(_("_Pronounce the word when it pops up.")); + bool pronounce_when_popup= + conf->get_bool_at("floating_window/pronounce_when_popup"); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), + pronounce_when_popup); + g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(on_setup_floatwin_pronounce_ckbutton_toggled), this); + gtk_box_pack_start(GTK_BOX(vbox1), check_button, FALSE, FALSE, 0); + + check_button = gtk_check_button_new_with_mnemonic(_("_Show floating window if word not found.")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), conf->get_bool_at("floating_window/show_if_not_found")); + g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(on_setup_show_float_if_not_found), this); + gtk_box_pack_start(GTK_BOX(vbox1), check_button, FALSE, FALSE, 0); +} + +#ifndef CONFIG_GPE +void PrefsDlg::on_setup_floatwin_size_max_width_spinbutton_changed(GtkSpinButton *button, PrefsDlg *oPrefsDlg) +{ + gint width = gtk_spin_button_get_value_as_int(button); + conf->set_int_at("floating_window/max_window_width", width); +} + +void PrefsDlg::on_setup_floatwin_size_max_height_spinbutton_changed(GtkSpinButton *button, PrefsDlg *oPrefsDlg) +{ + gint height = gtk_spin_button_get_value_as_int(button); + conf->set_int_at("floating_window/max_window_height", height); +} + +void PrefsDlg::on_setup_floatwin_use_custom_bg_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) +{ + gboolean use = gtk_toggle_button_get_active(button); + conf->set_bool_at("floating_window/use_custom_bg", use); + if (use) { + GdkColor color; + color.red = conf->get_int_at("floating_window/bg_red"); + color.green = conf->get_int_at("floating_window/bg_green"); + color.blue = conf->get_int_at("floating_window/bg_blue"); + gpAppFrame->oFloatWin.set_bg(&color); + } else { + gpAppFrame->oFloatWin.set_bg(NULL); + } +} + +void PrefsDlg::on_setup_floatwin_color_set(GtkColorButton *widget, PrefsDlg *oPrefsDlg) +{ + GdkColor color; + gtk_color_button_get_color(widget, &color); + conf->set_int_at("floating_window/bg_red", color.red); + conf->set_int_at("floating_window/bg_green", color.green); + conf->set_int_at("floating_window/bg_blue", color.blue); + if (conf->get_bool_at("floating_window/use_custom_bg")) { + gpAppFrame->oFloatWin.set_bg(&color); + } +} + +void PrefsDlg::on_setup_floatwin_transparent_scale_changed(GtkRange *range, PrefsDlg *oPrefsDlg) +{ + gint transparent = (gint)gtk_range_get_value(range); + conf->set_int_at("floating_window/transparent", transparent); + gtk_window_set_opacity(GTK_WINDOW(gpAppFrame->oFloatWin.FloatWindow), (100-transparent)/100.0); +} + +void PrefsDlg::setup_floatwin_size_page() +{ + GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Settings"), GTK_STOCK_ZOOM_FIT); + GtkWidget *vbox1 = gtk_vbox_new(false, 6); + gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0); + GtkWidget *table; + table = gtk_table_new(3, 2, FALSE); + gtk_table_set_row_spacings(GTK_TABLE(table), 6); + gtk_table_set_col_spacings(GTK_TABLE(table), 6); + gtk_box_pack_start(GTK_BOX(vbox1),table,false,false,0); + + int max_width= + conf->get_int_at("floating_window/max_window_width"); + int max_height= + conf->get_int_at("floating_window/max_window_height"); + + GdkScreen *screen = gtk_window_get_screen(parent_window); + gint screen_width = gdk_screen_get_width(screen); + gint screen_height = gdk_screen_get_height(screen); + + GtkWidget *label=gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("Max window _width:")); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + GtkWidget *spin_button; + spin_button = gtk_spin_button_new_with_range(MIN_MAX_FLOATWIN_WIDTH,screen_width,1); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin_button); + gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin_button), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), max_width); + g_signal_connect(G_OBJECT(spin_button), "value-changed", + G_CALLBACK(on_setup_floatwin_size_max_width_spinbutton_changed), this); + gtk_table_attach(GTK_TABLE(table), spin_button, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + label=gtk_label_new(_("(default:320)")); + gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + + label=gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("Max window hei_ght:")); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); + spin_button = gtk_spin_button_new_with_range(MIN_MAX_FLOATWIN_HEIGHT,screen_height,1); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin_button); + gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin_button), GTK_UPDATE_IF_VALID); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button), max_height); + g_signal_connect (G_OBJECT (spin_button), "value-changed", G_CALLBACK (on_setup_floatwin_size_max_height_spinbutton_changed), (gpointer)this); + gtk_table_attach(GTK_TABLE(table), spin_button, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0); + label=gtk_label_new(_("(default:240)")); + gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, GTK_FILL, 0, 0); + + GtkWidget*hbox1 = gtk_hbox_new(false, 5); + gtk_box_pack_start(GTK_BOX(vbox1),hbox1,false,false,0); + GtkWidget *check_button = gtk_check_button_new_with_mnemonic(_("_Use custom background color:")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), conf->get_bool_at("floating_window/use_custom_bg")); + g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(on_setup_floatwin_use_custom_bg_toggled), this); + gtk_box_pack_start(GTK_BOX(hbox1),check_button,false,false,0); + GdkColor color; + color.red = conf->get_int_at("floating_window/bg_red"); + color.green = conf->get_int_at("floating_window/bg_green"); + color.blue = conf->get_int_at("floating_window/bg_blue"); + GtkWidget *colorbutton = gtk_color_button_new_with_color(&color); + g_signal_connect(G_OBJECT(colorbutton), "color-set", G_CALLBACK(on_setup_floatwin_color_set), this); + gtk_box_pack_start(GTK_BOX(hbox1),colorbutton,false,false,0); + + GtkWidget *hbox = gtk_hbox_new(false, 5); + gtk_box_pack_start(GTK_BOX(vbox1),hbox,FALSE,FALSE, 0); + label=gtk_label_new(NULL); + gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Transparency:")); + gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE, 0); + GtkWidget *hscale; + hscale = gtk_hscale_new_with_range(0,80,1); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), hscale); + int transparent=conf->get_int_at("floating_window/transparent"); + gtk_range_set_value(GTK_RANGE(hscale), transparent); + g_signal_connect(G_OBJECT(hscale), "value-changed", G_CALLBACK(on_setup_floatwin_transparent_scale_changed), this); + gtk_box_pack_start(GTK_BOX(hbox),hscale,TRUE,TRUE, 0); +} +#endif + +GtkWidget* PrefsDlg::create_notebook () +{ + notebook = gtk_notebook_new(); + GtkNotebook *nb = GTK_NOTEBOOK(notebook); +#ifdef CONFIG_GPE + gtk_notebook_set_scrollable(nb, true); +#else + gtk_notebook_set_show_tabs(nb,false); + gtk_notebook_set_show_border(nb,false); + setup_logo_page (); +#endif + setup_dictionary_scan_page (); + setup_dictionary_font_page (); + setup_dictionary_cache_page (); + setup_dictionary_export_page (); + setup_dictionary_sound_page (); + setup_dict_article_rendering(); + setup_network_netdict(); + setup_mainwin_input_page (); + setup_mainwin_options_page (); + setup_mainwin_searchwebsite_page(); + setup_NotificationAreaIcon_options_page(); + setup_floatwin_options_page (); +#ifdef CONFIG_GPE + gtk_notebook_set_current_page (nb, 0); +#else + setup_floatwin_size_page (); + gtk_notebook_set_current_page (nb, LOGO); +#endif + return notebook; +} + + +PrefsDlg::PrefsDlg(GtkWindow *parent, GdkPixbuf *logo, const std::list& key_combs_) : + key_combs(key_combs_) +{ + parent_window=parent; +#ifndef CONFIG_GPE + stardict_logo=logo; +#endif + + window = NULL; +} + +bool PrefsDlg::ShowModal() +{ + window = gtk_dialog_new(); + gtk_window_set_transient_for(GTK_WINDOW(window), parent_window); + + gtk_dialog_add_button(GTK_DIALOG(window), + GTK_STOCK_HELP, + GTK_RESPONSE_HELP); + + gtk_dialog_add_button(GTK_DIALOG(window), + GTK_STOCK_CLOSE, + GTK_RESPONSE_CLOSE); + gtk_dialog_set_default_response(GTK_DIALOG(window), + GTK_RESPONSE_CLOSE); + g_signal_connect(G_OBJECT(window), "response", + G_CALLBACK(response_handler), this); +#ifndef CONFIG_GPE + GtkWidget *hbox; + hbox = gtk_hbox_new (FALSE, 18); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); + GtkWidget *r; + r = gtk_vbox_new (FALSE, 6); + + GtkWidget *label; + label = gtk_label_new_with_mnemonic (_("Cat_egories:")); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + g_object_set (G_OBJECT (label), "xalign", 0.0, NULL); + create_categories_tree(); + + + gtk_box_pack_start(GTK_BOX(r), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(r), categories_window, TRUE, TRUE, 0); +#endif + + GtkWidget *l = create_notebook (); + +#ifdef CONFIG_GPE + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), l, true, true, 0); +#else + gtk_box_pack_start (GTK_BOX (hbox), r, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), l, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), hbox, true, true, 0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), categories_tree); +#endif + + gtk_widget_show_all (GTK_DIALOG (window)->vbox); + gtk_window_set_title (GTK_WINDOW (window), _("Preferences")); + +#ifndef CONFIG_GPE + resize_categories_tree(); +#endif + gint result; + while ((result = gtk_dialog_run(GTK_DIALOG(window)))==GTK_RESPONSE_HELP) + ; + if (result != GTK_RESPONSE_NONE) { + const gchar *ch; + ch = gtk_entry_get_text(eExportFile); + if (ch[0]) + conf->set_string_at("dictionary/export_file", ch); +#ifndef _WIN32 + ch = gtk_entry_get_text(eTTSCommandline); + if (ch[0]) { + conf->set_string("/apps/stardict/preferences/dictionary/tts_program_cmdline", ch); + gpAppFrame->oReadWord.tts_program_cmdline = ch; + } +#endif + const gchar *server; + ch = gtk_entry_get_text(eStarDictServer); + if (ch[0]) + server = ch; + else + server = _("dict.stardict.org"); + conf->set_string_at("network/server", server); + int port; + ch = gtk_entry_get_text(eStarDictServerPort); + if (ch[0]) + port = atoi(ch); + else + port = 2628; + conf->set_int_at("network/port", port); + gpAppFrame->oStarDictClient.set_server(server, port); +#if defined(CONFIG_GTK) || defined(CONFIG_GPE) + ch = gtk_entry_get_text(ePlayCommand); + if (ch[0]) + conf->set_string_at("dictionary/play_command", ch); +#endif + GtkTextBuffer *text_view_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tts_textview)); + GtkTextIter start_iter; + GtkTextIter end_iter; + gtk_text_buffer_get_start_iter(text_view_buffer, &start_iter); + gtk_text_buffer_get_end_iter(text_view_buffer, &end_iter); + gchar *text = gtk_text_buffer_get_text(text_view_buffer, &start_iter, &end_iter, FALSE); + conf->set_string_at("dictionary/tts_path", text); + gpAppFrame->oReadWord.LoadRealTtsPath(text); + g_free(text); + gtk_widget_destroy(GTK_WIDGET(window)); + window = NULL; + return false; + } else { + return true; + } +} + +void PrefsDlg::Close() +{ + if (window) { + gtk_widget_destroy (window); + window = NULL; + } +} + +#ifndef CONFIG_GPE +void PrefsDlg::resize_categories_tree(void) +{ + //this is hack for prevet horizontaly scrolling + //if you know how it make better, just write + GtkRequisition rtv, rsw; + gtk_widget_size_request(categories_tree, &rtv); + gtk_widget_size_request(GTK_SCROLLED_WINDOW(categories_window)->vscrollbar, &rsw); + gtk_widget_set_size_request(categories_window, rtv.width+rsw.width+25, -1); +} +#endif --- a/src/readword.cpp +++ b/src/readword.cpp @@ -3,6 +3,7 @@ #endif #include +#include #include #include --- a/src/sigc++/signal.h +++ b/src/sigc++/signal.h @@ -18,7 +18,7 @@ //Compilers, such as older versions of SUN Forte C++, that do not allow this also often //do not allow a typedef to have the same name as a class in the typedef's definition. //For Sun Forte CC 5.7 (SUN Workshop 10), comment this out to fix the build. - #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1 +// #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1 #endif namespace sigc { --- a/src/utils.cpp +++ b/src/utils.cpp @@ -21,6 +21,8 @@ # include "config.h" #endif +#include + #include #include #include --- /dev/null +++ b/src/utils.cpp.orig @@ -0,0 +1,202 @@ +/* + * This file part of StarDict - A international dictionary for GNOME. + * http://stardict.sourceforge.net + * Copyright (C) 2005-2006 Evgeniy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#ifdef CONFIG_GNOME +# include +# include +#elif defined(_WIN32) +# include +#endif + +#include "utils.h" + + +void ProcessGtkEvent() +{ + while (gtk_events_pending()) + gtk_main_iteration(); +} + +std::string get_user_config_dir() +{ + const gchar *config_path_from_env = g_getenv("STARDICT_CONFIG_PATH"); + if (config_path_from_env) + return config_path_from_env; +#ifdef _WIN32 + std::string res = g_get_user_config_dir(); + res += G_DIR_SEPARATOR_S "StarDict"; + return res; +#else + std::string res; + gchar *tmp = g_build_filename(g_get_home_dir(), ".stardict", NULL); + res=tmp; + g_free(tmp); + return res; +#endif +} + +std::string combnum2str(gint comb_code) +{ + switch (comb_code) { +#ifdef _WIN32 + case 0: + return "Shift"; + case 1: + return "Alt"; + case 2: + return "Ctrl"; + case 3: + return "Ctrl+Alt"; +#else + case 0: + return "Win"; + case 1: + return "Shift"; + case 2: + return "Alt"; + case 3: + return "Ctrl"; + case 4: + return "Ctrl+Alt"; + case 5: + return "Ctrl+e"; + case 6: + return "F1"; + case 7: + return "F2"; + case 8: + return "F3"; + case 9: + return "F4"; +#endif + default: + return ""; + } +} + +std::vector split(const std::string& str, char sep) +{ + std::vector res; + std::string::size_type prev_pos=0, pos = 0; + while ((pos=str.find(sep, prev_pos))!=std::string::npos) { + res.push_back(std::string(str, prev_pos, pos-prev_pos)); + prev_pos=pos+1; + } + res.push_back(std::string(str, prev_pos, str.length()-prev_pos)); + + return res; +} + +GdkPixbuf *load_image_from_file(const std::string& filename) +{ + GError *err=NULL; + GdkPixbuf *res=gdk_pixbuf_new_from_file(filename.c_str(), &err); + if (!res) { + GtkWidget *message_dlg = + gtk_message_dialog_new( + NULL, + (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Can not load image. %s"), err->message); + + gtk_dialog_set_default_response(GTK_DIALOG(message_dlg), GTK_RESPONSE_OK); + + gtk_window_set_resizable(GTK_WINDOW(message_dlg), FALSE); + + gtk_dialog_run(GTK_DIALOG(message_dlg)); + gtk_widget_destroy(message_dlg); + g_error_free(err); + exit(EXIT_FAILURE); + } + + return res; +} + +static gchar * byte_to_hex(unsigned char nr) { + gchar *result = NULL; + + result = g_strdup_printf("%%%x%x", nr / 0x10, nr % 0x10); + return result; +} + +char *common_encode_uri_string(const char *string) +{ + gchar *newURIString; + gchar *hex, *tmp = NULL; + int i, j, len, bytes; + + /* the UTF-8 string is casted to ASCII to treat + the characters bytewise and convert non-ASCII + compatible chars to URI hexcodes */ + newURIString = g_strdup(""); + len = strlen(string); + for(i = 0; i < len; i++) { + if(g_ascii_isalnum(string[i]) || strchr("-_.!~*'()", (int)string[i])) + tmp = g_strdup_printf("%s%c", newURIString, string[i]); + else if(string[i] == ' ') + tmp = g_strdup_printf("%s%%20", newURIString); + else if((unsigned char)string[i] <= 127) { + tmp = g_strdup_printf("%s%s", newURIString, hex = byte_to_hex(string[i]));g_free(hex); + } else { + bytes = 0; + if(((unsigned char)string[i] >= 192) && ((unsigned char)string[i] <= 223)) + bytes = 2; + else if(((unsigned char)string[i] > 223) && ((unsigned char)string[i] <= 239)) + bytes = 3; + else if(((unsigned char)string[i] > 239) && ((unsigned char)string[i] <= 247)) + bytes = 4; + else if(((unsigned char)string[i] > 247) && ((unsigned char)string[i] <= 251)) + bytes = 5; + else if(((unsigned char)string[i] > 247) && ((unsigned char)string[i] <= 251)) + bytes = 6; + + if(0 != bytes) { + if((i + (bytes - 1)) > len) { + g_warning(("Unexpected end of character sequence or corrupt UTF-8 encoding! Some characters were dropped!")); + break; + } + + for(j=0; j < (bytes - 1); j++) { + tmp = g_strdup_printf("%s%s", newURIString, hex = byte_to_hex((unsigned char)string[i++])); + g_free(hex); + g_free(newURIString); + newURIString = tmp; + } + tmp = g_strdup_printf("%s%s", newURIString, hex = byte_to_hex((unsigned char)string[i])); + g_free(hex); + } else { + /* sh..! */ + g_error("Internal error while converting UTF-8 chars to HTTP URI!"); + } + } + g_free(newURIString); + newURIString = tmp; + } + return newURIString; +} --- a/src/x11_iskeyspressed.hpp +++ b/src/x11_iskeyspressed.hpp @@ -1,6 +1,8 @@ #ifndef _X11_ISKEYSPRESSED_HPP_ #define _X11_ISKEYSPRESSED_HPP_ +#include + #include #include #include --- a/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp +++ b/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp @@ -1,6 +1,6 @@ #include "stardict_dictdotcn.h" #include -#include +#include #include #ifdef _WIN32 --- a/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp +++ b/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp @@ -1,4 +1,5 @@ #include "stardict_espeak.h" +#include #include #include --- a/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp +++ b/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp @@ -1,7 +1,8 @@ #include "stardict_gucharmap.h" #include #include -#include +#include +#include static char *build_dictdata(char type, const char *definition) { --- a/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp +++ b/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp @@ -1,4 +1,6 @@ #include "stardict_html_parsedata.h" +#include +#include #include #ifdef _WIN32 --- a/stardict-plugins/stardict-man-plugin/stardict_man.cpp +++ b/stardict-plugins/stardict-man-plugin/stardict_man.cpp @@ -1,6 +1,6 @@ #include "stardict_man.h" #include -#include +#include static const StarDictPluginSystemInfo *plugin_info = NULL; static bool need_prefix; --- a/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp +++ b/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp @@ -1,4 +1,5 @@ #include "stardict_powerword_parsedata.h" +#include #include #ifdef _WIN32 --- a/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp +++ b/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp @@ -1,7 +1,8 @@ #include "stardict_qqwry.h" #include #include -#include +#include +#include #ifdef _WIN32 #include --- a/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp +++ b/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp @@ -1,4 +1,5 @@ #include "stardict_spell.h" +#include #include #include #include --- a/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp +++ b/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp @@ -1,5 +1,6 @@ #include "stardict_wiki2xml.h" #include "WIKI2XML.h" +#include #include std::string wiki2xml(std::string &str) --- a/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp +++ b/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp @@ -1,5 +1,6 @@ #include "stardict_wiki_parsedata.h" #include "stardict_wiki2xml.h" +#include #include #ifdef _WIN32 --- a/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp +++ b/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp @@ -1,4 +1,5 @@ #include "court_widget.h" +#include #include #include --- a/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp +++ b/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp @@ -1,5 +1,6 @@ #include "stardict_wordnet.h" #include "court_widget.h" +#include #include #ifdef _WIN32 --- a/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp +++ b/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp @@ -1,4 +1,5 @@ #include "stardict_wordnet_parsedata.h" +#include #include #ifdef _WIN32 --- a/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp +++ b/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp @@ -1,4 +1,5 @@ #include "stardict_xdxf_parsedata.h" +#include #include #ifdef _WIN32 --- a/tests/t_config_file.cpp +++ b/tests/t_config_file.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "config_file.hpp" --- a/tests/t_xml.cpp +++ b/tests/t_xml.cpp @@ -5,6 +5,7 @@ #include #include #include +#include static void xml_decode(const char *str, std::string& decoded) debian/patches/07_disable_netdict.patch0000644000000000000000000000234711423574417015277 0ustar Author: Andrew Lee Description: Patch from RedHat's bugzilla provided by Tomas Hoger --- a/src/conf.cpp +++ b/src/conf.cpp @@ -51,7 +51,7 @@ #else add_entry("/apps/stardict/preferences/dictionary/use_custom_font", false); #endif - add_entry("/apps/stardict/preferences/network/enable_netdict", true); + add_entry("/apps/stardict/preferences/network/enable_netdict", false); // Default stardictd server. add_entry("/apps/stardict/preferences/network/server", std::string(_("dict.stardict.org"))); add_entry("/apps/stardict/preferences/network/port", 2628); --- a/src/prefsdlg.cpp +++ b/src/prefsdlg.cpp @@ -1038,6 +1038,10 @@ GtkWidget *hbox1 = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(hbox1),button,false,false,0); gtk_box_pack_start(GTK_BOX(vbox1),hbox1,false,false,0); + + label = gtk_label_new(_("Warning: Requests to remote StarDict server are sent over the network in an unencrypted form. Do not enable this if you are translating sensitive documents.")); + gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); + gtk_box_pack_start(GTK_BOX(vbox1),label,false,false,0); } void PrefsDlg::on_setup_mainwin_searchWhileTyping_ckbutton_toggled(GtkToggleButton *button, PrefsDlg *oPrefsDlg) debian/patches/01_festival-tts-plugin.patch0000644000000000000000000000074411423574412016067 0ustar Author: Deng Xiyue Description: Correct path for headers. --- a/configure.in +++ b/configure.in @@ -130,7 +130,7 @@ else AC_MSG_RESULT(yes) FESTIVAL_LIBS="-lFestival -lestools -lestbase -leststring" - FESTIVAL_CFLAGS="-I/usr/include/speech-tools/EST -ffriend-injection -Wno-deprecated" + FESTIVAL_CFLAGS="-I/usr/include/speech_tools -ffriend-injection -Wno-deprecated" FESTIVAL_PLUGIN_DIR="stardict-festival-tts-plugin" fi else debian/patches/09_fix_ftbfs_binutils_gold.patch0000644000000000000000000000177111634355407017054 0ustar Description: Fix FTBFS with binutils-gold by adding several modules in Makefile.am Author: Mahyuddin Susanto Bug-Ubuntu: https://bugs.launchpad.net/bugs/701476 --- stardict-3.0.1.orig/tests/Makefile.am +++ stardict-3.0.1/tests/Makefile.am @@ -45,7 +45,7 @@ t_articleview_SOURCES = t_articleview.cp t_xml_SOURCES = t_xml.cpp LDADD = @STARDICT_LIBS@ $(top_builddir)/src/lib/libstardict.a \ - $(LOCAL_SIGCPP_LIBFILE) + $(LOCAL_SIGCPP_LIBFILE) -lz -lglib-2.0 INCLUDES = @STARDICT_CFLAGS@ $(LOCAL_SIGCPP_INCLUDE) -I$(top_builddir) -I$(top_builddir)/src -I$(top_builddir)/src/lib TESTS = \ --- stardict-3.0.1.orig/src/Makefile.am +++ stardict-3.0.1/src/Makefile.am @@ -26,7 +26,7 @@ INCLUDES = stardict_DEPENDENCIES = $(LOCAL_SIGCPP_LIBFILE) lib/libstardict.a stardict_LDFLAGS = -stardict_LDADD = $(STARDICT_LIBS) $(LOCAL_SIGCPP_LIBFILE) lib/libstardict.a +stardict_LDADD = $(STARDICT_LIBS) $(LOCAL_SIGCPP_LIBFILE) lib/libstardict.a -lgmodule-2.0 -lz if !GNOME_SUPPORT if MAEMO_SUPPORT debian/patches/02_makefile.patch0000644000000000000000000000153311423574413013722 0ustar Author: Andrew Lee Description: We don't need to run make in debian/ and mvsc/ subdirectory. No description. --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = m4 src stardict-plugins tests pixmaps po help data doc debian mvsc +SUBDIRS = m4 src stardict-plugins tests pixmaps po help data doc ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ --- a/configure.in +++ b/configure.in @@ -442,8 +442,6 @@ stardict-withoutgnome.spec data/Makefile doc/Makefile -debian/Makefile -mvsc/Makefile po/Makefile.in m4/Makefile src/Makefile --- a/autogen.sh +++ b/autogen.sh @@ -47,4 +47,3 @@ autoconf || exit; echo "Running automake ...." automake || exit; -./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --disable-deprecations $@ debian/patches/03_license-updates.patch0000644000000000000000000006160011423574414015235 0ustar Author: Anthony Fok Description: Updates help files from GFDL 1.1 to 1.2 as agreed by Hu Zheng at the 2008 Linux Developer Symposium in Beijing. Also fixes incorrect reference to the GNU Library General Public License in GPL'ed source files. --- a/help/C/legal.xml +++ b/help/C/legal.xml @@ -2,7 +2,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published + License (GFDL), Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this - \ No newline at end of file + --- a/help/mk/legal.xml +++ b/help/mk/legal.xml @@ -2,7 +2,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published + License (GFDL), Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this - \ No newline at end of file + --- a/help/nl/legal.xml +++ b/help/nl/legal.xml @@ -2,7 +2,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published + License (GFDL), Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this - \ No newline at end of file + --- a/help/ru/legal.xml +++ b/help/ru/legal.xml @@ -2,7 +2,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published + License (GFDL), Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this - \ No newline at end of file + --- a/help/uk/legal.xml +++ b/help/uk/legal.xml @@ -2,7 +2,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published + License (GFDL), Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this - \ No newline at end of file + --- a/help/zh_CN/legal.xml +++ b/help/zh_CN/legal.xml @@ -2,7 +2,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published + License (GFDL), Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this - \ No newline at end of file + --- a/help/zh_TW/legal.xml +++ b/help/zh_TW/legal.xml @@ -2,7 +2,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published + License (GFDL), Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can find a copy of the GFDL at this - \ No newline at end of file + --- a/src/articleview.cpp +++ b/src/articleview.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/class_factory.cpp +++ b/src/class_factory.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/conf.cpp +++ b/src/conf.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/floatwin.cpp +++ b/src/floatwin.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/gconf_file.cpp +++ b/src/gconf_file.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/gtk_iskeyspressed.cpp +++ b/src/gtk_iskeyspressed.cpp @@ -12,11 +12,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/gtktextviewpango.cpp +++ b/src/gtktextviewpango.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /* --- a/src/inifile.cpp +++ b/src/inifile.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/lib/common.cpp +++ b/src/lib/common.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /* --- a/src/lib/data.cpp +++ b/src/lib/data.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /* implementation of class to work with dictionary data */ --- a/src/lib/dict_client.cpp +++ b/src/lib/dict_client.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /* --- a/src/lib/dictziplib.cpp +++ b/src/lib/dictziplib.cpp @@ -17,11 +17,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ //#define HAVE_MMAP //it will defined in config.h. this can be done by configure.in with a AC_FUNC_MMAP. --- a/src/lib/stardict_client.cpp +++ b/src/lib/stardict_client.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/lib/stddict.cpp +++ b/src/lib/stddict.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /* --- a/src/lib/treedict.cpp +++ b/src/lib/treedict.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /* --- a/src/mainwin.cpp +++ b/src/mainwin.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/pangoview.cpp +++ b/src/pangoview.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/prefsdlg.cpp +++ b/src/prefsdlg.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/progresswin.cpp +++ b/src/progresswin.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/skin.cpp +++ b/src/skin.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/splash.cpp +++ b/src/splash.cpp @@ -10,11 +10,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/stardict.cpp +++ b/src/stardict.cpp @@ -10,7 +10,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . --- a/src/tray.cpp +++ b/src/tray.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/utils.cpp +++ b/src/utils.cpp @@ -11,11 +11,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/win32/acrobat/sources/wordPickInit.cpp +++ b/src/win32/acrobat/sources/wordPickInit.cpp @@ -17,7 +17,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software --- a/src/win32/acrobat/sources/wordPickUI.cpp +++ b/src/win32/acrobat/sources/wordPickUI.cpp @@ -17,7 +17,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software @@ -280,4 +280,4 @@ } } return; -} \ No newline at end of file +} --- a/src/win32/acrobat/sources/wordPickUI.h +++ b/src/win32/acrobat/sources/wordPickUI.h @@ -17,7 +17,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software --- a/src/win32/mouseover.cpp +++ b/src/win32/mouseover.cpp @@ -12,11 +12,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H --- a/src/x11_iskeyspressed.cpp +++ b/src/x11_iskeyspressed.cpp @@ -12,11 +12,10 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /* debian/patches/04_changelog-minor-typo-fixes.patch0000644000000000000000000000624011423574414017326 0ustar Author: Anthony Fok Description: Minor typo fixes to upstream ChangeLog. --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,7 @@ 2007.8.13 StarDict-3.0.0 (RedHat) released. -http://www.StarDict.org on-line dictionries website is out in 2006.9.25. We have developed the stardictd dictionary server for it. +http://www.StarDict.org on-line dictionaries website is out in 2006.9.25. We have developed the stardictd dictionary server for it. StarDict's total download count reached two millions in 2007.3.8. Network dictionaries support. Plugin system. @@ -38,14 +38,14 @@ KingSoft PowerWord support. This added 158 dictionaries. The data is cracked by Dwing(http://free5.ys168.com/?dwing). Synonym support. Sort word list by collate function support. -XDXF project(http://xdxf.sourceforge.net) has port its dictionaries to StarDict format, some dictionries are come from Sdictionary. This added 615 dictionries. +XDXF project (http://xdxf.sourceforge.net) has port its dictionaries to StarDict format, some dictionaries are come from Sdictionary. This added 615 dictionaries. French translation, thanks Christophe Durville . Brazilian Portuguese translation, thanks Ernesto . Add cfdict dictionary, thanks Gilles Vigner . Add English-Thai Lexitron Dictionary and Thai-English Lexitron Dictionary, thanks Suphanut Thanyaboon . Add many Japanese dictionaries. Add some Chinese dictionaries, data comes from KDic. -Add two Germany dictionries: ldaf, xindehan. +Add two Germany dictionaries: ldaf, xindehan. Add duden Germany dictionary, thanks Liu Guizhu for providing data file. Add fundset dictionary, thanks Lin Fanshun for providing data file. Add DrEye4in1 dictionary, thanks Lilian for providing data file. @@ -54,7 +54,7 @@ 2006.4.18 StarDict-2.4.7 (complete) released. -Port to GPE(http://gpe.handhelds.org). +Port to GPE (http://gpe.handhelds.org). Full-text search. Acrobat plug-in in Win32, thanks Dewolf Xue . Evgeniy's patches for special character search and other changes. @@ -94,14 +94,14 @@ 2005.7.20 StarDict-2.4.5 (final) released. -Source code optimize and many changes, thanks Evgeney . +Source code optimize and many changes, thanks Evgeniy . Dutch translation and help document translation, thanks Ruud Slaats . 2004.11.28 StarDict-2.4.4 (fine) released. -sdcv-0.1(StarDict command line version) is out, developed by Evgeney . +sdcv-0.1(StarDict command line version) is out, developed by Evgeniy . Try to create .idx.oft file to speed up the interpretation of the .idx file. This feature is especially useful to sdcv. -Mueller7 optimized, thanks Evgeney. +Mueller7 optimized, thanks Evgeniy. quick_eng-gre, quick_gre-eng dictionary encoding fix, thanks Christophe Combelles for bug reporting. Add Hanzi Master dictionary, thanks Michael Robinson . zh_TW help document translation and a small bug fix, thanks Roy Chan . debian/patches/series0000644000000000000000000000031011645623416012034 0ustar 01_festival-tts-plugin.patch 02_makefile.patch 03_license-updates.patch 04_changelog-minor-typo-fixes.patch 05_g++-4.4.patch 07_disable_netdict.patch 08_gcc-4.6.patch 09_fix_ftbfs_binutils_gold.patch debian/patches/08_gcc-4.6.patch0000644000000000000000000000065211634354500013212 0ustar Description: fix FTBFS with gcc 4.6 by adding a necessary header. Author: Ilya Barygin Bug-Ubuntu: https://bugs.launchpad.net/bugs/832822 --- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/scene.hpp +++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/scene.hpp @@ -10,6 +10,7 @@ #include "spring.hpp" #include +#include using namespace std; class scene_t { debian/stardict-gnome.manpages0000644000000000000000000000002011377365730013627 0ustar data/stardict.1 debian/stardict-common.dirs0000644000000000000000000000006311377365730013167 0ustar usr/share/stardict/dic usr/share/stardict/treedict debian/watch0000644000000000000000000000040111377365730010226 0ustar # Example watch control file for uscan # Rename this file to "watch" and then you can run the "uscan" command # to check for upstream updates and more. # Site Directory Pattern Version Script version=3 http://sf.net/stardict/stardict-([\d.]*)\.tar\.bz2 debian/control0000644000000000000000000001357211645623325010610 0ustar Source: stardict Section: utils Priority: optional Maintainer: Andrew Lee (李健秋) Uploaders: Anthony Fok Build-Depends: debhelper (>= 8), autoconf, automake (>= 1.10), autotools-dev, intltool, libbonobo2-dev, libenchant-dev, libespeak-dev, libestools2.0-dev, libgconf2-dev, libgnomeui-dev, liborbit2-dev, libsigc++-2.0-dev (>= 2.0.18-2), libtool, libx11-dev, libxml-parser-perl, festival-dev, rarian-compat, sharutils, x11proto-core-dev, zlib1g-dev Build-Conflicts: autoconf2.13, automake1.4 Standards-Version: 3.9.2 Homepage: http://stardict.sourceforge.net/ Vcs-Git: git://git.debian.org/git/collab-maint/stardict.git Vcs-Browser: http://git.debian.org/?p=collab-maint/stardict.git;a=summary Package: stardict Architecture: all Depends: ${misc:Depends}, ${shlibs:Depends}, stardict-gnome (>= ${source:Version}) | stardict-gtk (>= ${source:Version}) Description: International dictionary StarDict is a cross-platform and international dictionary written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. Package: stardict-gnome Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, stardict-common (= ${source:Version}) Recommends: stardict-plugin (= ${binary:Version}), stardict-plugin-espeak (= ${binary:Version}), stardict-plugin-festival (= ${binary:Version}) Suggests: ttf-freefont, ttf-arphic-uming Replaces: stardict-gtk Conflicts: stardict-gtk Provides: stardict Description: International dictionary for GNOME 2 StarDict is a cross-platform and international dictionary written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. . This package is compiled with GNOME 2 support and contains only the program of stardict and will be of limited use without the dictionary files. For more information about how to get the dictionary files, please read /usr/share/doc/stardict/README.Debian. Package: stardict-gtk Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, stardict-common (= ${source:Version}) Recommends: stardict-plugin (= ${binary:Version}), stardict-plugin-espeak (= ${binary:Version}), stardict-plugin-festival (= ${binary:Version}) Suggests: ttf-freefont, ttf-arphic-uming Replaces: stardict-gnome Conflicts: stardict-gnome Provides: stardict Description: International dictionary written in GTK+ 2.x StarDict is a cross-platform and international dictionary written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. . This package is compiled without GNOME 2 support and contains only the program of stardict and will be of limited use without the dictionary files. For more information about how to get the dictionary files, please read /usr/share/doc/stardict/README.Debian. Package: stardict-plugin-espeak Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, stardict-common (= ${source:Version}), stardict-gnome (= ${binary:Version}) | stardict-gtk (= ${binary:Version}), stardict-plugin (= ${binary:Version}) Description: International dictionary - eSpeak TTS plugin StarDict is a cross-platform and international written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. . This package contains eSpeak TTS plugin for StarDict which can pronounce words. Package: stardict-plugin-festival Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, stardict-common (= ${source:Version}), stardict-gnome (= ${binary:Version}) | stardict-gtk (= ${binary:Version}), stardict-plugin (= ${binary:Version}) Description: International dictionary - Festival TTS plugin StarDict is a cross-platform and international written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. . This package contains Festival TTS plugin for StarDict which can pronounce words. Package: stardict-plugin-spell Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, stardict-common (= ${source:Version}), stardict-gnome (= ${binary:Version}) | stardict-gtk (= ${binary:Version}), stardict-plugin (= ${binary:Version}) Description: International dictionary - spell plugin StarDict is a cross-platform and international written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. . This package contains spell plugin for StarDict which give you spelling suggestion while you searching the dictionary. Package: stardict-plugin Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, stardict-common (= ${source:Version}), stardict-gnome (= ${binary:Version}) | stardict-gtk (= ${binary:Version}) Description: International dictionary - common plugins StarDict is a cross-platform and international written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. . This package contains some add-on plugins for StarDict. These include: - man virtual dict plugin - qqwry virtual dict plugin - html parse plugin - xdxf parse plugin - wordnet plugin - powerword parse plugin - wiki parse plugin Package: stardict-common Architecture: all Depends: ${misc:Depends}, rarian-compat, sgml-data (>= 2.0.2) Recommends: stardict-gnome (>= ${source:Version}) | stardict-gtk (>= ${source:Version}) Conflicts: stardict-gnome (= 3.0.1-8), stardict-gtk (= 3.0.1-8) Replaces: stardict-gnome (= 3.0.1-8), stardict-gtk (= 3.0.1-8) Description: International dictionary - data files StarDict is a cross-platform and international written in GTK+ 2.x. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy search", etc. . This package contains data files (pixmaps, icons, documentations) needed by the stardict package. debian/stardict-plugin-festival.preinst0000644000000000000000000000024112111472253015513 0ustar #!/bin/sh set -e case "$1" in upgrade) DOCDIR=/usr/share/doc/stardict-plugin-festival if [ -L $DOCDIR ]; then rm $DOCDIR fi ;; esac #DEBHELPER# debian/NEWS0000644000000000000000000000040211636561246007673 0ustar stardict (3.0.1-5) unstable; urgency=high * CVE-2009-2260: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-2260 Disable Net.CN plugin by default since this revision. -- Andrew Lee Sun, 12 Jul 2009 20:12:40 +0800 debian/stardict-common.docs0000644000000000000000000000021111377365730013151 0ustar README TODO debian/README.Debian debian/TODO.Debian doc/StarDictFileFormat doc/FAQ doc/HACKING doc/HowToCreateDictionary doc/Translation debian/compat0000644000000000000000000000000211636561162010373 0ustar 8 debian/README.Debian0000644000000000000000000000232411377365730011244 0ustar StarDict for Debian ------------------- StarDict is an international dictionary that runs in GNOME 2 environment. It has powerful features such as "Glob-style pattern matching", "Scan selection word", "Fuzzy query", etc. Dictionary The official site of StarDict (http://stardict.sourceforge.net/) provides many converted dictionaries, including English<->Chinese, Gemany<->English and French<->English. However, the dictionary files are split out from this package because of license issues. You can download them from http://stardict.sourceforge.net/Dictionaries.php and extract to the directory /usr/share/stardict/dic. Phonetic Symbol If stardict fails to display the phonetic symbol, install the package ttf-freefont or ttf-thryomanes. Convertion Tools StarDict also provide a set of convertion tools which can convert the dictionaries from other software to StarDict format. You can find them in the package stardict-tools. Dictionary Format You can find a brief description of Stardict dictionary format in /usr/share/doc/stardict/StarDictFileFormat.gz Created by Roy Hiu-yeung Chan , Wed, 25 Feb 2004 20:06:02 +0800 Last modified by Anthony Wong , Mon Aug 28 2006 16:56:49 +0800 debian/stardict-plugin-espeak.preinst0000644000000000000000000000023712111472253015153 0ustar #!/bin/sh set -e case "$1" in upgrade) DOCDIR=/usr/share/doc/stardict-plugin-espeak if [ -L $DOCDIR ]; then rm $DOCDIR fi ;; esac #DEBHELPER# debian/stardict-gtk.preinst0000644000000000000000000000022512111472253013171 0ustar #!/bin/sh set -e case "$1" in upgrade) DOCDIR=/usr/share/doc/stardict-gtk if [ -L $DOCDIR ]; then rm $DOCDIR fi ;; esac #DEBHELPER# debian/TODO.Debian0000644000000000000000000000005411377365730011052 0ustar * Check the size of depenency for plugins. debian/stardict_16x16.xpm0000644000000000000000000000726111377365730012420 0ustar /* XPM */ static char *stardict_16x16[] = { /* columns rows colors chars-per-pixel */ "16 16 192 2", " c #000000", ". c #010100", "X c #020100", "o c #020101", "O c #020201", "+ c #020202", "@ c #020401", "# c #040301", "$ c #040403", "% c #050402", "& c #050404", "* c #060504", "= c #060605", "- c #060803", "; c #080602", ": c #080603", "> c #0C0B0A", ", c #110D06", "< c #120C04", "1 c #110E09", "2 c #120D08", "3 c #11170B", "4 c #12180B", "5 c #191F0F", "6 c #141310", "7 c #181511", "8 c #1A1713", "9 c #1C2511", "0 c #231A0C", "q c #271D0C", "w c #2A1D0C", "e c #262014", "r c #232C15", "t c #292011", "y c #292012", "u c #2D2214", "i c #2F281E", "p c #342A1D", "a c #392B16", "s c #39371E", "d c #2D2720", "f c #3A3227", "g c #38322A", "h c #393C21", "j c #33431F", "k c #354721", "l c #3B4023", "z c #443216", "x c #473316", "c c #46351B", "v c #443E22", "b c #42392D", "n c #44392C", "m c #404F19", "M c #425B1D", "N c #48521F", "B c #49551F", "V c #465D2B", "C c #495120", "Z c #534125", "A c #5D4622", "S c #515525", "D c #5B5B2A", "F c #5F5038", "G c #486120", "H c #4D6824", "J c #546525", "K c #526D33", "L c #536F34", "P c #5D6934", "I c #547128", "U c #5C7A2D", "Y c #614922", "T c #624822", "R c #664C23", "E c #615023", "W c #6F552C", "Q c #66533A", "! c #68553C", "~ c #607F3B", "^ c #74662E", "/ c #7E613A", "( c #7C7630", ") c #6D6645", "_ c #7A6446", "` c #7C6A4E", "' c #658533", "] c #66883F", "[ c #68863F", "{ c #688A41", "} c #6B8D42", "| c #6C8F43", " . c #6D8F43", ".. c #729245", "X. c #719445", "o. c #729546", "O. c #739646", "+. c #739746", "@. c #789D49", "#. c #799E4A", "$. c #799F4A", "%. c #7EA44C", "&. c #7FA54D", "*. c #7FA74D", "=. c #816231", "-. c #846432", ";. c #896936", ":. c #857039", ">. c #847651", ",. c #93764A", "<. c #95774C", "1. c #9E7D48", "2. c #907752", "3. c #9D7F50", "4. c #A47E43", "5. c #8F914E", "6. c #8E954E", "7. c #998349", "8. c #9E834D", "9. c #949A4F", "0. c #909156", "q. c #989659", "w. c #80A64D", "e. c #86A24E", "r. c #83AB47", "t. c #84AC4F", "y. c #85AD50", "u. c #85AE50", "i. c #86AF51", "p. c #8AA650", "a. c #8BB54C", "s. c #8AB453", "d. c #8BB553", "f. c #8CB654", "g. c #8EB754", "h. c #90B955", "j. c #93BE51", "k. c #93BD57", "l. c #94BD57", "z. c #95BE56", "x. c #95BE57", "c. c #97BF55", "v. c #96BE57", "b. c #96BF56", "n. c #95BE58", "m. c #96BE58", "M. c #9EB757", "N. c #9FB259", "B. c #A68044", "V. c #A0814D", "C. c #A0824D", "Z. c #A88B4D", "A. c #A18A5A", "S. c #A49A52", "D. c #AD9955", "F. c #B2994F", "G. c #B89A5C", "H. c #A3AB4D", "J. c #AAA25F", "K. c #B5AD5F", "L. c #B0B85F", "P. c #B9A764", "I. c #96C056", "U. c #99C655", "Y. c #9FCD59", "T. c #A1D15D", "R. c #A5D45E", "E. c #A7D75F", "W. c #A8D15D", "Q. c #AADB61", "!. c #C39853", "~. c #C49A5C", "^. c #C89C57", "/. c #D4A55E", "(. c #C7A866", "). c #C8A362", "_. c #CDA462", "`. c #CCA862", "'. c #CDAC66", "]. c #C0B760", "[. c #CCB769", "{. c #D3A662", "}. c #D2AB67", "|. c #D6AB60", " X c #DAAB62", ".X c #D5B069", "XX c #DCB56C", "oX c #D2BC72", "OX c #DDBF72", "+X c #E1BF76", "@X c #E4BF75", "#X c None", /* pixels */ "#X#X#X#X#X#X#X% 5 k 3 #X#X#X#X#X", "#X#X#X 2 u v P { { K 9 #X#X#X", "#Xy Z / 7.9.p.%.@...| ~ k - #X#X", " W |.].M.x.s.y.%.@.X.| { V 4 #X", "; T F.W.T.c.x.d.y.w.@.X.| { L r ", "% x ^ ' Y.R.z.x.f.y.w.%.X...6.s ", "#Xw E m U U.Q.z.x.g.i.w.e.K.(.e ", "#X< T :.B I j.Q.I.x.h.N.[.@XP.h ", "#X% z B.Z.C H a.Q.c.L.OX+XJ.l @ ", "#X#Xw -./.8.C G r.H.`.oXq.) i #X", "#X#X, A !.{.V.S M ( S.0.>.` g ", "#X#X= c B. X~.V.D J 5.A.2._ n = ", "#X#X y =.^._.}.'.D.G.<.Q b 7 #X", "#X#X#X2 A ;..XXX).V.! g 6 = #X#X", "#X#X#X= a R 1.,.Q d > #X#X#X#X", "#X#X#X#X: 0 p 7 = #X#X#X#X#X#X" }; debian/stardict-gnome.install0000644000000000000000000000025311640545221013476 0ustar debian/tmp/usr/bin/stardict debian/tmp/usr/lib/bonobo/servers/GNOME_Stardict.server debian/tmp/usr/share/gnome/* debian/tmp/etc/gconf/schemas/* debian/tmp/usr/share/idl/* debian/stardict-plugin-festival.install0000644000000000000000000000007111636561162015507 0ustar debian/tmp/usr/lib/stardict/plugins/stardict_festival.so debian/stardict-gtk.manpages0000644000000000000000000000002011377365730013307 0ustar data/stardict.1 debian/stardict-plugin-spell.install0000644000000000000000000000006611636561162015015 0ustar debian/tmp/usr/lib/stardict/plugins/stardict_spell.so debian/stardict-common.menu0000644000000000000000000000054411636561162013171 0ustar ?package(stardict-common): \ needs="X11" \ section="Applications/Text" \ title="stardict" \ longtitle="dictionary lookup program" \ command="/usr/bin/stardict" \ icon="/usr/share/pixmaps/stardict_32x32.xpm" \ icon16x16="/usr/share/pixmaps/stardict_16x16.xpm" \ hints="Translation,Dictionary" debian/stardict-plugin-espeak.install0000644000000000000000000000006711636561162015147 0ustar debian/tmp/usr/lib/stardict/plugins/stardict_espeak.so debian/stardict-plugin-spell.preinst0000644000000000000000000000023612111472253015021 0ustar #!/bin/sh set -e case "$1" in upgrade) DOCDIR=/usr/share/doc/stardict-plugin-spell if [ -L $DOCDIR ]; then rm $DOCDIR fi ;; esac #DEBHELPER#