diff options
Diffstat (limited to 'mate-dictionary')
187 files changed, 35897 insertions, 0 deletions
diff --git a/mate-dictionary/AUTHORS b/mate-dictionary/AUTHORS new file mode 100644 index 00000000..e71c6239 --- /dev/null +++ b/mate-dictionary/AUTHORS @@ -0,0 +1,11 @@ +Author: +Maintainer: + Emmanuele Bassi <[email protected]> + +Original gdict code by: + Mike Hughes <[email protected]> + Spiros Papadimitriou <[email protected]> + Bradford Hovinen <[email protected]> + Vincent Noel <[email protected]> + +Note: none of the original code is left in the current Dictionary. diff --git a/mate-dictionary/Makefile.am b/mate-dictionary/Makefile.am new file mode 100644 index 00000000..de4d7657 --- /dev/null +++ b/mate-dictionary/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = libgdict src data docs help + +EXTRA_DIST = TODO README AUTHORS diff --git a/mate-dictionary/README b/mate-dictionary/README new file mode 100644 index 00000000..3a9044de --- /dev/null +++ b/mate-dictionary/README @@ -0,0 +1,25 @@ +MATE Dictionary - Look up words in dictionary sources. + ++++ + +Source tree: + +data/ + contains Glade files for the UI; the .server file and menu description + file for the applet; MateConf schemas; the .desktop for the application. + +docs/ + reference/ + gtk-doc magic needed for the Gdict reference guide. + +help/ + the help for the application and the applet. + +libgdict/ + contains the Gdict library, which is the engine upon which both the + application and the applet are built; + +src/ + contains the application and the applet sources. + +2005-12-19 20:24 (+0100) ebassi <ebassi (AT) gmail (DOT) com> diff --git a/mate-dictionary/TODO b/mate-dictionary/TODO new file mode 100644 index 00000000..8a35890b --- /dev/null +++ b/mate-dictionary/TODO @@ -0,0 +1,39 @@ +[Gdict] + +* Great UI rework: port the old UI to the new infrastructure + [ ] Gdict::Entry + [+] Gdict::Defbox + [x] common pattern recognition for definition sections + [ ] colors for sections (with theme support) + [+] Gdict::Speller + [ ] visually separate matchs from different dictionaries + +* UI additions + [x] Gdict::DatabaseChooser + [x] Gdict::StrategyChooser + [x] add a "find bottom pane" to Gdict::Defbox; + +* Add preferences support + [x] Implement the .desktop file prototype for selecting the preferred + source for dictionary data; + [x] Remove MateConf stuff from the preferences: only applications should + depend on MateConf; + +[MATE Dictionary] + +* UI updates + [x] Create a new HIG-compliant preferences dialog using Glade, and + share it with the applet; + [+] Source dialog + [x] Add view/edit modes + [x] Use the DatabaseChooser and StrategyChooser widgets for + the "Database" and "Startegy" fields. + [x] Source remove + [x] Remember window size/state across sessions + +[MATE Dictionary Applet] + +* UI updates + [x] Use GtkAlignedWindow as the container for the Gdict::Defbox; + +$ Last updated: 2007-02-13 01:00 (+0000) ebassi $ diff --git a/mate-dictionary/data/MATE_DictionaryApplet.server.in.in b/mate-dictionary/data/MATE_DictionaryApplet.server.in.in new file mode 100644 index 00000000..3c69076e --- /dev/null +++ b/mate-dictionary/data/MATE_DictionaryApplet.server.in.in @@ -0,0 +1,55 @@ +<oaf_info> + + <oaf_server iid="OAFIID:MATE_DictionaryApplet_Factory" + type="exe" + location="@LIBEXECDIR@/mate-dictionary-applet"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:MateComponent/GenericFactory:1.0"/> + <item value="IDL:MateComponent/Unknown:1.0"/> + </oaf_attribute> + <oaf_attribute name="name" type="string" value="GDict Applet Factory"/> + <oaf_attribute name="description" type="string" value="GDict Applet Factory"/> + + </oaf_server> + + <oaf_server iid="OAFIID:MATE_DictionaryApplet" + type="factory" + location="OAFIID:MATE_DictionaryApplet_Factory"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:MATE/Vertigo/MatePanelAppletShell:1.0"/> + <item value="IDL:MateComponent/Control:1.0"/> + <item value="IDL:MateComponent/Unknown:1.0"/> + </oaf_attribute> + <oaf_attribute name="name" type="string" _value="Dictionary Look up"/> + <oaf_attribute name="description" type="string" _value="Look up words in a dictionary"/> + <oaf_attribute name="panel:category" type="string" value="Accessories"/> + <oaf_attribute name="panel:icon" type="string" value="accessories-dictionary.png"/> + <oaf_attribute name="bugzilla:bugzilla" type="string" value="MATE"/> + <oaf_attribute name="bugzilla:product" type="string" value="mate-utils"/> + <oaf_attribute name="bugzilla:component" type="string" value="gdict-applet"/> + <oaf_attribute name="bugzilla:version" type="string" value="@VERSION@"/> + <oaf_attribute name="bugzilla:other_binaries" type="string" value="mate-dictionary-applet"/> + + </oaf_server> + + <oaf_server iid="OAFIID:MATE_GDictApplet" + type="factory" + location="OAFIID:MATE_DictionaryApplet_Factory"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:MATE/Vertigo/MatePanelAppletShell:1.0"/> + <item value="IDL:MateComponent/Control:1.0"/> + <item value="IDL:MateComponent/Unknown:1.0"/> + </oaf_attribute> + <oaf_attribute name="name" type="string" _value="Dictionary Look up"/> + <oaf_attribute name="description" type="string" _value="Look up words in a dictionary"/> + <oaf_attribute name="bugzilla:bugzilla" type="string" value="MATE"/> + <oaf_attribute name="bugzilla:product" type="string" value="mate-utils"/> + <oaf_attribute name="bugzilla:component" type="string" value="gdict-applet"/> + <oaf_attribute name="bugzilla:version" type="string" value="@VERSION@"/> + <oaf_attribute name="bugzilla:other_binaries" type="string" value="mate-dictionary-applet"/> + </oaf_server> + +</oaf_info> diff --git a/mate-dictionary/data/MATE_DictionaryApplet.xml b/mate-dictionary/data/MATE_DictionaryApplet.xml new file mode 100644 index 00000000..3e975cc1 --- /dev/null +++ b/mate-dictionary/data/MATE_DictionaryApplet.xml @@ -0,0 +1,15 @@ +<Root> + <popups> + <popup name="button3"> + <menuitem name="LookUpItem" verb="LookUp" _label="_Look Up Selected Text" pixtype="stock" pixname="gtk-find"/> + <separator/> + <menuitem name="ClearItem" verb="Clear" _label="Cl_ear" pixtype="stock" pixname="gtk-clear"/> + <menuitem name="PrintItem" verb="Print" _label="_Print" pixtype="stock" pixname="gtk-print"/> + <menuitem name="SaveItem" verb="Save" _label="_Save" pixtype="stock" pixname="gtk-save-as"/> + <separator/> + <menuitem name="PreferencesItem" verb="Preferences" _label="_Preferences" pixtype="stock" pixname="gtk-properties"/> + <menuitem name="HelpItem" verb="Help" _label="_Help" pixtype="stock" pixname="gtk-help"/> + <menuitem name="AboutItem" verb="About" _label="_About" pixtype="stock" pixname="gtk-about"/> + </popup> + </popups> +</Root> diff --git a/mate-dictionary/data/Makefile.am b/mate-dictionary/data/Makefile.am new file mode 100644 index 00000000..2e38a96c --- /dev/null +++ b/mate-dictionary/data/Makefile.am @@ -0,0 +1,84 @@ +NULL = + +man_MANS = mate-dictionary.1 + +gdictappdir = $(datadir)/applications +gdictapp_in_files = mate-dictionary.desktop.in +gdictapp_DATA = $(gdictapp_in_files:.desktop.in=.desktop) + +$(gdictapp_in_files): $(gdictapp_in_files:.desktop.in=.desktop.in.in) + @sed -e "s|\@VERSION\@|@VERSION@|" $< > $@ + +@INTLTOOL_DESKTOP_RULE@ + +# dictionary sources definitions +dictsourcedir = $(datadir)/mate-dict/sources +dictsource_in_files = \ + default.desktop.in \ + spanish.desktop.in \ + thai.desktop.in \ + $(NULL) +dictsource_DATA = $(dictsource_in_files:.desktop.in=.desktop) +@INTLTOOL_DESKTOP_RULE@ + +builderdir = $(datadir)/mate-dictionary +builder_DATA = mate-dictionary-preferences.ui \ + mate-dictionary-source.ui + +uidir = $(datadir)/mate-dictionary +ui_DATA = mate-dictionary-ui.xml + +if BUILD_GDICT_APPLET + +# applet menu definition +appletuidir = $(datadir)/mate-2.0/ui +appletui_DATA = MATE_DictionaryApplet.xml + +serverdir = $(libdir)/matecomponent/servers +server_in_files = MATE_DictionaryApplet.server.in +server_DATA = $(server_in_files:.server.in=.server) + +$(server_in_files): $(server_in_files:.server.in=.server.in.in) + @sed \ + -e "s|\@VERSION\@|@VERSION@|" \ + -e "s|\@LIBEXECDIR\@|$(libexecdir)|" \ + $< > $@ + + +@INTLTOOL_SERVER_RULE@ + +endif # BUILD_GDICT_APPLET + +schemadir = $(MATECONF_SCHEMA_FILE_DIR) +schemas_in_file = mate-dictionary.schemas.in +schema_DATA = $(schemas_in_file:.schemas.in=.schemas) +@INTLTOOL_SCHEMAS_RULE@ + +EXTRA_DIST = \ + MATE_DictionaryApplet.server.in.in \ + mate-dictionary.desktop.in.in \ + $(dictsource_in_files) \ + $(man_MANS) \ + $(schemas_in_file) \ + $(builder_DATA) \ + $(ui_DATA) \ + $(appletui_DATA) \ + $(NULL) + +CLEANFILES = \ + $(dictsource_DATA) \ + $(server_in_files) \ + $(server_DATA) \ + $(gdictapp_in_files) \ + $(gdictapp_DATA) \ + $(schema_DATA) \ + $(NULL) + +if MATECONF_SCHEMAS_INSTALL +install-data-local: + if test -z "$(DESTDIR)" ; then \ + MATECONF_CONFIG_SOURCE=$(MATECONF_SCHEMA_CONFIG_SOURCE) $(MATECONFTOOL) --makefile-install-rule $(schema_DATA) ; \ + fi +else +install-data-local: +endif diff --git a/mate-dictionary/data/default.desktop.in b/mate-dictionary/data/default.desktop.in new file mode 100644 index 00000000..395433e8 --- /dev/null +++ b/mate-dictionary/data/default.desktop.in @@ -0,0 +1,6 @@ +[Dictionary Source] +Name=Default +_Description=Default Dictionary Server +Transport=dictd +Hostname=dict.org +Port=2628 diff --git a/mate-dictionary/data/mate-dictionary-preferences.ui b/mate-dictionary/data/mate-dictionary-preferences.ui new file mode 100644 index 00000000..1f04df8f --- /dev/null +++ b/mate-dictionary/data/mate-dictionary-preferences.ui @@ -0,0 +1,230 @@ +<?xml version="1.0"?> +<!--*- mode: xml -*--> +<interface> + <object class="GtkVBox" id="preferences_root"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">18</property> + <child> + <object class="GtkNotebook" id="preferences_notebook"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + <child> + <object class="GtkVBox" id="vbox2"> + <property name="border_width">12</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Select a dictionary source for looking up words:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">sources_treeview</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="height_request">100</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + <child> + <object class="GtkTreeView" id="sources_treeview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">True</property> + <property name="rules_hint">False</property> + <property name="reorderable">False</property> + <property name="enable_search">True</property> + <property name="fixed_height_mode">False</property> + <property name="hover_selection">False</property> + <property name="hover_expand">False</property> + </object> + </child> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + <child> + <object class="GtkHButtonBox" id="hbuttonbox6"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <property name="spacing">6</property> + <child> + <object class="GtkButton" id="add_button"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-add</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + </object> + </child> + <child> + <object class="GtkButton" id="remove_button"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-remove</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + </object> + </child> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </object> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes">Source</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + </child> + <child> + <object class="GtkVBox" id="vbox3"> + <property name="border_width">12</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + <child> + <object class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Print font:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">print_font_button</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <object class="GtkFontButton" id="print_font_button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_style">True</property> + <property name="show_size">True</property> + <property name="use_font">True</property> + <property name="use_size">False</property> + <property name="focus_on_click">True</property> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </object> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="label" translatable="yes">Print</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + </child> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </object> +</interface> + diff --git a/mate-dictionary/data/mate-dictionary-source.ui b/mate-dictionary/data/mate-dictionary-source.ui new file mode 100644 index 00000000..4ba2b6b5 --- /dev/null +++ b/mate-dictionary/data/mate-dictionary-source.ui @@ -0,0 +1,332 @@ +<?xml version="1.0"?> +<!--*- mode: xml -*--> +<interface> + <object class="GtkListStore" id="model1"> + <columns> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0">Dictionary Server</col> + </row> + </data> + </object> + <object class="GtkVBox" id="source_root"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkNotebook" id="notebook1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + <child> + <object class="GtkTable" id="table2"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="description_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Description:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">description_entry</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkLabel" id="transport_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Transport:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">transport_combo</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkLabel" id="hostname_label"> + <property name="label" translatable="yes">H_ostname:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">hostname_entry</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkLabel" id="port_label"> + <property name="label" translatable="yes">_Port:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">port_entry</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkEntry" id="description_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes">Source Name</property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkEntry" id="hostname_entry"> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text">dict.org</property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkEntry" id="port_entry"> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text">2628</property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkComboBox" id="transport_combo"> + <property name="visible">True</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + <property name="model">model1</property> + <child> + <object class="GtkCellRendererText" id="renderer1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + </object> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label18"> + <property name="visible">True</property> + <property name="label" translatable="yes">Source</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + </child> + <child> + <object class="GtkVBox" id="db-vbox"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="label" translatable="yes">Dictionaries</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + </child> + <child> + <object class="GtkVBox" id="strat-vbox"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes">Strategies</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </object> + </child> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </object> +</interface> + diff --git a/mate-dictionary/data/mate-dictionary-ui.xml b/mate-dictionary/data/mate-dictionary-ui.xml new file mode 100644 index 00000000..81e756d6 --- /dev/null +++ b/mate-dictionary/data/mate-dictionary-ui.xml @@ -0,0 +1,48 @@ +<ui> + <menubar name="MainMenu"> + <menu name="FileMenu" action="File"> + <menuitem name="NewMenu" action="FileNew"/> + <menuitem name="SaveAsMenu" action="FileSaveAs"/> + <separator/> + <menuitem name="FilePreviewMenu" action="FilePreview"/> + <menuitem name="FilePrintMenu" action="FilePrint"/> + <separator/> + <menuitem name="FileCloseWindowMenu" action="FileCloseWindow"/> + </menu> + <menu name="EditMenu" action="Edit"> + <menuitem name="EditCopyMenu" action="EditCopy"/> + <separator/> + <menuitem name="EditSelectAllMenu" action="EditSelectAll"/> + <separator/> + <menuitem name="EditFindMenu" action="EditFind"/> + <menuitem name="EditFindNextMenu" action="EditFindNext"/> + <menuitem name="EditFindPreviousMenu" action="EditFindPrevious"/> + <separator/> + <menuitem name="EditPreferencesMenu" action="EditPreferences"/> + </menu> + <menu name="ViewMenu" action="View"> + <menuitem name="ViewSidebarMenu" action="ViewSidebar"/> + <menuitem name="ViewStatusbarMenu" action="ViewStatusbar"/> + <separator/> + <menuitem name="ViewSpellerMenu" action="ViewSpeller"/> + <menuitem name="ViewSourceMenu" action="ViewSource"/> + <menuitem name="ViewDBMenu" action="ViewDB"/> + <menuitem name="ViewStratMenu" action="ViewStrat"/> + </menu> + <menu name="GoMenu" action="Go"> + <menuitem name="GoPreviousDefMenu" action="GoPreviousDef"/> + <menuitem name="GoNextDefMenu" action="GoNextDef"/> + <separator/> + <menuitem name="GoFirstDefMenu" action="GoFirstDef"/> + <menuitem name="GoLastDefMenu" action="GoLastDef"/> + </menu> + <menu name="HelpMenu" action="Help"> + <menuitem name="HelpContentsMenu" action="HelpContents"/> + <menuitem name="HelpAboutMenu" action="HelpAbout"/> + </menu> + </menubar> + + <accelerator name="LookupAccel" action="Lookup"/> + <accelerator name="EscapeAccel" action="Escape"/> + <accelerator name="SlashAccel" action="Slash"/> +</ui> diff --git a/mate-dictionary/data/mate-dictionary.1 b/mate-dictionary/data/mate-dictionary.1 new file mode 100644 index 00000000..ceabc30a --- /dev/null +++ b/mate-dictionary/data/mate-dictionary.1 @@ -0,0 +1,61 @@ +.\" mate-dictionary.1 - a online dictionary client +.\" Copyright 2005 Emmanuele Bassi +.\" Copyright 2001 Jochen Voss +.TH mate-dictionary 1 "Jan 2 2005" "mate-utils 2.13.4" +.SH NAME +mate-dictionary \- Look up words on dictionaries +.SH SYNOPSIS +.nf +.BI mate-dictionary +.br +.BI mate-dictionary " [options]" +.fi +.sp +or select +.B Dictionary +from the +.B Accessories +submenu of the Applications menu. +.SH DESCRIPTION +.B MATE Dictionary +provides dictionary definitions of words, using a dictionary source. + +For full documentation see the +.B MATE Dictionary +online help. + +.SH OPTIONS +.TP +.BI \-\-look\-up " word" +Looks up the specified word using the pre-defined dictionary source. +.TP +.BI \-s " source\fR or " \-\-source " source" +Uses the specified source for looking up words. This does not affect the +global settings. +.TP +.BR \-l " or " \-\-list\-sources +Lists all the sources available. +.TP +.BR \-n " or " \-\-no\-window +Using this switch with the \-\-look\-up will print the definitions found +on the console without launching the GUI. +.TP +.B \-\-help +Display help information. +.SH CONFIGURATION +All the configuration is handled using MateConf. +.SH AUTHOR +.B MATE Dictionary +was originally written by Spiros Papadimitriou (<[email protected]>), Mike +Hughes (<[email protected]>) and Bradford Hovinen (<[email protected]>). + +Emmanuele Bassi (<[email protected]>) rewrote it from scratch. + +This manual page was originally written by Jochen Voss + +.SH SEE ALSO +.BR dict (1), +.BR dictd (8), +.BR http://www.dict.org/ , +.B RFC 2229 diff --git a/mate-dictionary/data/mate-dictionary.desktop.in.in b/mate-dictionary/data/mate-dictionary.desktop.in.in new file mode 100644 index 00000000..c3718204 --- /dev/null +++ b/mate-dictionary/data/mate-dictionary.desktop.in.in @@ -0,0 +1,15 @@ +[Desktop Entry] +_Name=Dictionary +_Comment=Check word definitions and spellings in an online dictionary +Exec=mate-dictionary +Terminal=false +Type=Application +Icon=accessories-dictionary +StartupNotify=true +Categories=MATE;GTK;Office;Dictionary; +OnlyShowIn=MATE; +X-MATE-DocPath=mate-dictionary/mate-dictionary.xml +X-MATE-Bugzilla-Bugzilla=MATE +X-MATE-Bugzilla-Product=mate-utils +X-MATE-Bugzilla-Component=gdict +X-MATE-Bugzilla-Version=@VERSION@ diff --git a/mate-dictionary/data/mate-dictionary.schemas.in b/mate-dictionary/data/mate-dictionary.schemas.in new file mode 100644 index 00000000..0d204ecd --- /dev/null +++ b/mate-dictionary/data/mate-dictionary.schemas.in @@ -0,0 +1,201 @@ +<mateconfschemafile> + <schemalist> + <schema> + <key>/schemas/apps/mate-dictionary/server</key> + <applyto>/apps/mate-dictionary/server</applyto> + <owner>mate-dictionary</owner> + <type>string</type> + <default>dict.org</default> + <locale name="C"> + <short>Dictionary server (Deprecated)</short> + <long>The dictionary server to connect to. The default server is + dict.org. See http://www.dict.org for details on other servers. + This key is deprecated and no longer in use.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/port</key> + <applyto>/apps/mate-dictionary/port</applyto> + <owner>mate-dictionary</owner> + <type>int</type> + <default>2628</default> + <locale name="C"> + <short>Port used to connect to server (Deprecated)</short> + <long>The port number to connect to. The default port is 2628. + This key is deprecated and no longer in use.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/smart</key> + <applyto>/apps/mate-dictionary/smart</applyto> + <owner>mate-dictionary</owner> + <type>bool</type> + <default>TRUE</default> + <locale name="C"> + <short>Use smart lookup (Deprecated)</short> + <long>Specify whether to use smart lookup. This key is dependant + on whether the dictionary server supports this option. The default + is TRUE. This key is deprecated and no longer in use.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/database</key> + <applyto>/apps/mate-dictionary/database</applyto> + <owner>mate-dictionary</owner> + <type>string</type> + <default>!</default> + <locale name="C"> + <short>The default database to use</short> + <long>The name of the default individual database or meta-database to + use on a dictionary source. An exclamation mark ("!") means that all + the databases present in a dictionary source should be searched</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/strategy</key> + <applyto>/apps/mate-dictionary/strategy</applyto> + <owner>mate-dictionary</owner> + <type>string</type> + <default>exact</default> + <locale name="C"> + <short>The default search strategy to use</short> + <long>The name of the default search strategy to use on a dictionary + source, if available. The default strategy is 'exact', that is match + exact words.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/print-font</key> + <applyto>/apps/mate-dictionary/print-font</applyto> + <owner>mate-dictionary</owner> + <type>string</type> + <default>Serif 12</default> + <locale name="C"> + <short>The font to be used when printing</short> + <long>The font to be used when printing a definition.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/source-name</key> + <applyto>/apps/mate-dictionary/source-name</applyto> + <owner>mate-dictionary</owner> + <type>string</type> + <default>Default</default> + <locale name="C"> + <short>The name of the dictionary source used</short> + <long>The name of the dictionary source used to retrieve the + definitions of words.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/default-window-width</key> + <applyto>/apps/mate-dictionary/default-window-width</applyto> + <owner>mate-dictionary</owner> + <type>int</type> + <default>-1</default> + <locale name="C"> + <short>The default width of the application window</short> + <long>This key defines the window width and it's used to remember + the size of the dictionary window across sessions. Setting it + to -1 will make the dictionary window use a width based on the + font size.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/default-window-height</key> + <applyto>/apps/mate-dictionary/default-window-height</applyto> + <owner>mate-dictionary</owner> + <type>int</type> + <default>-1</default> + <locale name="C"> + <short>The default height of the application window</short> + <long>This key defines the window height and it's used to remember + the size of the dictionary window across sessions. Setting it + to -1 will make the dictionary window use a height based on the + font size.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/window-is-maximized</key> + <applyto>/apps/mate-dictionary/window-is-maximized</applyto> + <owner>mate-dictionary</owner> + <type>bool</type> + <default>FALSE</default> + <locale name="C"> + <short>Whether the application window should be maximized</short> + <long>This key defines whether the window should be maximized and it's + used to remember the state of the dictionary window across sessions. + Setting it to TRUE will make the window always appear as + maximized.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/sidebar-visible</key> + <applyto>/apps/mate-dictionary/sidebar-visible</applyto> + <owner>mate-dictionary</owner> + <type>bool</type> + <default>FALSE</default> + <locale name="C"> + <short>Whether the sidebar should be visible</short> + <long>This key defines whether the sidebar should be visible + and it's used to remember the state of the sidebar across + sessions. Setting it to TRUE will make the sidebar always + be displayed.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/statusbar-visible</key> + <applyto>/apps/mate-dictionary/statusbar-visible</applyto> + <owner>mate-dictionary</owner> + <type>bool</type> + <default>FALSE</default> + <locale name="C"> + <short>Whether the statusbar should be visible</short> + <long>This key defines whether the statusbar should be visible + and it's used to remember the state of the statusbar across + sessions. Setting it to TRUE will make the statusbar always + be displayed.</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/sidebar-page</key> + <applyto>/apps/mate-dictionary/sidebar-page</applyto> + <owner>mate-dictionary</owner> + <type>string</type> + <default>speller</default> + <locale name="C"> + <short>The page of the sidebar to show</short> + <long>This key defines which page of the sidebar should be + displayed and it's used to remember the setting across + sessions.. It can be "speller" or "databases".</long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/mate-dictionary/sidebar-width</key> + <applyto>/apps/mate-dictionary/sidebar-width</applyto> + <owner>mate-dictionary</owner> + <type>int</type> + <default>-1</default> + <locale name="C"> + <short>The width of the sidebar</short> + <long>This key defines the width of the sidebar and it's + used to remember the setting across sessions.</long> + </locale> + </schema> + + </schemalist> + +</mateconfschemafile> diff --git a/mate-dictionary/data/spanish.desktop.in b/mate-dictionary/data/spanish.desktop.in new file mode 100644 index 00000000..3ec0f18a --- /dev/null +++ b/mate-dictionary/data/spanish.desktop.in @@ -0,0 +1,6 @@ +[Dictionary Source] +Name=spanish +_Description=Spanish Dictionaries +Transport=dictd +Hostname=es.dict.org +Port=2628 diff --git a/mate-dictionary/data/thai.desktop.in b/mate-dictionary/data/thai.desktop.in new file mode 100644 index 00000000..1922f280 --- /dev/null +++ b/mate-dictionary/data/thai.desktop.in @@ -0,0 +1,6 @@ +[Dictionary Source] +Name=Thai +_Description=Longdo Thai-English Dictionaries +Transport=dictd +Hostname=dict.longdo.com +Port=2628 diff --git a/mate-dictionary/docs/Makefile.am b/mate-dictionary/docs/Makefile.am new file mode 100644 index 00000000..fcc10bfd --- /dev/null +++ b/mate-dictionary/docs/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = reference + +EXTRA_DIST = source-configuration.txt diff --git a/mate-dictionary/docs/reference/Makefile.am b/mate-dictionary/docs/reference/Makefile.am new file mode 100644 index 00000000..20467a8e --- /dev/null +++ b/mate-dictionary/docs/reference/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = gdict diff --git a/mate-dictionary/docs/reference/gdict/ChangeLog b/mate-dictionary/docs/reference/gdict/ChangeLog new file mode 100644 index 00000000..6648e039 --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/ChangeLog @@ -0,0 +1,71 @@ +2007-08-13 Emmanuele Bassi <[email protected]> + + * gdict-sections.txt: Remove undefined symbols and add the + last undocumented one. + +2007-08-13 Emmanuele Bassi <[email protected]> + + * gdict-sections.txt: Add undocumented symbols. + + * gdict-docs.sgml: Use parts instead of sections and add + the utilities and version checking pages. + +2007-08-13 Emmanuele Bassi <[email protected]> + + * tmpl/*: Remove templates. + + * gdict-docs.sgml: + * gdict-sections.txt: Update and clean up. + +2007-08-13 Emmanuele Bassi <[email protected]> + + * gdict.types: Add types + + * Makefile.am: + * gdict-sections.txt: + * gdict-docs.sgml: Remove GdictEntry. + +2006-01-27 Emmanuele Bassi <[email protected]> + + * gdict-sections.txt: add new GdictDefbox functions: + gdict_defbox_get_font_name and gdict_defbox_set_font_name. + +2006-01-16 Emmanuele Bassi <[email protected]> + + D gdict-decl.txt + + * gdict-decl.txt: remove this auto-generated file + +2006-01-16 Emmanuele Bassi <[email protected]> + + D gdict-decl-list.txt + D gdict-undocumented.txt + A gdict-context.sgml + + * gdict-decl-list.txt, gdict-undocumented.txt: remove these + auto-generated files. + + * .cvsignore: add gdict-decl-list.txt to the list of ignored + files + + * tmpl/gdict-context.sgml: add documentation of the GdictContext + GInterface and the boxed types defined in gdict-context.h + + * tmpl/gdict-source.sgml: add a description of the GdictSource object + +2005-12-30 Emmanuele Bassi <[email protected]> + + * gdict-docs.sgml: flesh out the text. + + * gdict-sections.txt: add new functions and data structures. + +2005-12-19 Emmanuele Bassi <[email protected]> + + A .cvsignore + A tmpl/.cvsignore + + * .cvsignore, tmpl/.cvsignore: added .cvsignore files. + +2005-11-12 Emmanuele Bassi <[email protected]> + + * Makefile.am: build against ../../../libgdict diff --git a/mate-dictionary/docs/reference/gdict/Makefile.am b/mate-dictionary/docs/reference/gdict/Makefile.am new file mode 100644 index 00000000..8dab089e --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/Makefile.am @@ -0,0 +1,75 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = 1.6 + +# The name of the module, e.g. 'glib'. +DOC_MODULE=mate-dict + +# The top-level SGML file. Change it if you want. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting functions and macros. +DOC_SOURCE_DIR=../../../libgdict + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS= + +# Extra options to pass to gtkdoc-scangobj +SCANGOBJ_OPTIONS=--type-init-func="g_type_init()" + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS= + +# Used for dependencies. +HFILE_GLOB=$(top_srcdir)/mate-dictionary/libgdict/*.h +CFILE_GLOB=$(top_srcdir)/mate-dictionary/libgdict/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES = \ + gdict-enum-types.h \ + gdict-marshal.h \ + gdict-context-private.h \ + gdict-debug.h \ + gdict-private.h \ + stamp-gdict-enum-types.h \ + stamp-gdict-marshal.h + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = version.xml + +# Other files to distribute. +extra_files = + +# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib +# contains GtkObjects/GObjects and you want to document signals and properties. +GTKDOC_CFLAGS = \ + $(CFLAGS) \ + $(CPPFLAGS) \ + $(LIBGDICT_CFLAGS) \ + -I$(srcdir)/../../../libgdict \ + -I$(top_builddir)/mate-dictionary/libgdict + +GTKDOC_LIBS = \ + $(LDFLAGS) \ + $(LIBGDICT_LIBS) \ + ../../../libgdict/libmatedict.la + +include $(top_srcdir)/gtk-doc.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += version.xml.in + +#dist-hook-local: +# mkdir $(distdir)/TEXT; \ +# for f in $(srcdir)/TEXT/* ; do \ +# test -f $$f && cp -p $$f $(distdir)/TEXT; \ +# done diff --git a/mate-dictionary/docs/reference/gdict/gdict-docs.sgml b/mate-dictionary/docs/reference/gdict/gdict-docs.sgml new file mode 100644 index 00000000..19c4555a --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/gdict-docs.sgml @@ -0,0 +1,159 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ + +<!ENTITY version SYSTEM "version.xml"> +]> + +<book xmlns:xi="http://www.w3.org/2003/XInclude" id="libgdict"> + <bookinfo> + <title>MATE Dictionary Library Reference Manual</title> + <authorgroup> + <author> + <firstname>Emmanuele</firstname> + <surname>Bassi</surname> + <affiliation> + <address> + <email>[email protected]</email> + </address> + </affiliation> + </author> + </authorgroup> + + <copyright> + <year>2005</year> + <holder>Emmanuele Bassi</holder> + </copyright> + + <abstract> + + <para> + This manual documents the &version; release of the Dictionary + Library for MATE 2.x + </para> + + </abstract> + + </bookinfo> + + <part id="introduction"> + <title>Introduction</title> + + <partintro> + <para> + The MATE Dictionary Library is a simple yet powerful collection of + classes that can be used to access various dictionary sources. + </para> + + <para> + It was created for the MATE Dictionary application, but it has been + made available for each developer whom wishes to access and display + definitions stored inside language dictionaries. + </para> + + </partintro> + + </part> + + <part id="gdict"> + <title>The MATE Dictionary Library</title> + + <chapter id="context"> + <title>Dictionary Context</title> + + <para>A dictionary context is a representation of a transport method, + that is a way to access a dictionary source.</para> + + <para>A dictionary source is any digital representation of a language + dictionary which provides a way to programmatically query its contents + for the available definitions of a word, phrase or any kind of + text.</para> + + <para>A dictionary source might use files encoded using the DICT or the + StarDict formats, and offer an interface for queries compliant to the + Dictionary Protocol as defined by the RFC 2229.</para> + + <xi:include href="xml/gdict-context.xml"/> + + </chapter> + + <chapter id="context-types"> + <title>Context Implementations</title> + + <para>The only context implementation currently available is a client + for the Dictionary Protocol.</para> + + <xi:include href="xml/gdict-client-context.xml"/> + + </chapter> + + <chapter id="sources"> + <title>Dictionary Source</title> + + <para>A dictionary source is repesented using a specially crafted file, + and can be accessed using the GdictSource class.</para> + + <para>Dictionary sources can be created at runtime or stored inside a + file and loaded directly using its path. Usually, sources files are + stored inside a predefined path and loaded using the GdictSourceLoader + class.</para> + + <xi:include href="xml/gdict-source.xml"/> + <xi:include href="xml/gdict-source-loader.xml"/> + + </chapter> + + <chapter id="gdict-utils"> + <title>Gdict Utilities</title> + + <xi:include href="xml/gdict-utils.xml"/> + <xi:include href="xml/gdict-version.xml"/> + + </chapter> + + </part> + + <part id="gdictui"> + <title>The MATE Dictionary Library Widgets</title> + + <partintro> + + <para> + Apart from the low-level classes, the MATE Dictionary library + offers a set of widgets for accessing the dictionary sources and showing + the results of queries. + </para> + + </partintro> + + <chapter> + <title>Base widgets</title> + + <xi:include href="xml/gdict-defbox.xml"/> + <xi:include href="xml/gdict-speller.xml"/> + </chapter> + + <chapter> + <title>Advanced widgets</title> + + <xi:include href="xml/gdict-database-chooser.xml"/> + <xi:include href="xml/gdict-strategy-chooser.xml"/> + <xi:include href="xml/gdict-source-chooser.xml"/> + </chapter> + + </part> + + <index> + <title>Index</title> + </index> + <index role="deprecated"> + <title>Index of deprecated symbols</title> + </index> + <index role="0.10"> + <title>Index of new symbols in 0.10</title> + </index> + <index role="0.12"> + <title>Index of new symbols in 0.12</title> + </index> + +</book> diff --git a/mate-dictionary/docs/reference/gdict/gdict-overrides.txt b/mate-dictionary/docs/reference/gdict/gdict-overrides.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/gdict-overrides.txt diff --git a/mate-dictionary/docs/reference/gdict/gdict-sections.txt b/mate-dictionary/docs/reference/gdict/gdict-sections.txt new file mode 100644 index 00000000..51adbf41 --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/gdict-sections.txt @@ -0,0 +1,336 @@ +<SECTION> +<FILE>gdict-client-context</FILE> +<TITLE>GdictClientContext</TITLE> +GdictClientContext +GdictClientContextClass +GdictClientContextError +gdict_client_context_new +gdict_client_context_set_hostname +gdict_client_context_get_hostname +gdict_client_context_set_port +gdict_client_context_get_port +gdict_client_context_set_client +gdict_client_context_get_client +<SUBSECTION Standard> +GdictContext +GDICT_CLIENT_CONTEXT +GDICT_IS_CLIENT_CONTEXT +GDICT_TYPE_CLIENT_CONTEXT +gdict_client_context_get_type +GDICT_CLIENT_CONTEXT_CLASS +GDICT_CLIENT_CONTEXT_GET_CLASS +GDICT_CLIENT_CONTEXT_ERROR +gdict_client_context_error_quark +<SUBSECTION Private> +GdictClientContextPrivate +</SECTION> + +<SECTION> +<FILE>gdict-context</FILE> +<TITLE>GdictContext</TITLE> +GdictContextIface +GdictContextError +gdict_context_set_local_only +gdict_context_get_local_only +gdict_context_lookup_databases +gdict_context_lookup_strategies +gdict_context_match_word +gdict_context_define_word +<SUBSECTION> +GdictDatabase +gdict_database_ref +gdict_database_unref +gdict_database_get_name +gdict_database_get_full_name +<SUBSECTION> +GdictStrategy +gdict_strategy_ref +gdict_strategy_unref +gdict_strategy_get_name +gdict_strategy_get_description +<SUBSECTION> +GdictMatch +gdict_match_ref +gdict_match_unref +gdict_match_get_word +gdict_match_get_database +<SUBSECTION> +GdictDefinition +gdict_definition_ref +gdict_definition_unref +gdict_definition_get_total +gdict_definition_get_word +gdict_definition_get_database +gdict_definition_get_text +<SUBSECTION Standard> +GDICT_TYPE_DATABASE +GDICT_TYPE_STRATEGY +GDICT_TYPE_MATCH +GDICT_TYPE_DEFINITION +GDICT_CONTEXT +GDICT_IS_CONTEXT +GDICT_TYPE_CONTEXT +gdict_context_get_type +gdict_database_get_type +gdict_definition_get_type +gdict_match_get_type +gdict_strategy_get_type +GDICT_CONTEXT_GET_IFACE +GDICT_CONTEXT_ERROR +gdict_context_error_quark +</SECTION> + +<SECTION> +<FILE>gdict-database-chooser</FILE> +<TITLE>GdictDatabaseChooser</TITLE> +GdictDatabaseChooser +GdictDatabaseChooserClass +gdict_database_chooser_new +gdict_database_chooser_new_with_context +gdict_database_chooser_get_context +gdict_database_chooser_set_context +gdict_database_chooser_get_databases +gdict_database_chooser_count_databases +gdict_database_chooser_has_database +gdict_database_chooser_refresh +gdict_database_chooser_clear +gdict_database_chooser_add_button +gdict_database_chooser_get_current_database +gdict_database_chooser_select_database +gdict_database_chooser_set_current_database +gdict_database_chooser_unselect_database +<SUBSECTION Standard> +GDICT_DATABASE_CHOOSER +GDICT_IS_DATABASE_CHOOSER +GDICT_TYPE_DATABASE_CHOOSER +gdict_database_chooser_get_type +GDICT_DATABASE_CHOOSER_CLASS +GDICT_IS_DATABASE_CHOOSER_CLASS +GDICT_DATABASE_CHOOSER_GET_CLASS +<SUBSECTION Private> +GdictDatabaseChooserPrivate +</SECTION> + +<SECTION> +<FILE>gdict-defbox</FILE> +<TITLE>GdictDefbox</TITLE> +GdictDefbox +GdictDefboxClass +gdict_defbox_new +gdict_defbox_new_with_context +gdict_defbox_set_context +gdict_defbox_get_context +gdict_defbox_set_database +gdict_defbox_get_database +gdict_defbox_get_text +gdict_defbox_select_all +gdict_defbox_copy_to_clipboard +gdict_defbox_clear +gdict_defbox_lookup +gdict_defbox_get_word +gdict_defbox_count_definitions +gdict_defbox_jump_to_definition +gdict_defbox_set_show_find +gdict_defbox_get_show_find +gdict_defbox_find_next +gdict_defbox_find_previous +gdict_defbox_set_font_name +gdict_defbox_get_font_name +gdict_defbox_get_selected_word +<SUBSECTION Standard> +GDICT_DEFBOX +GDICT_IS_DEFBOX +GDICT_TYPE_DEFBOX +gdict_defbox_get_type +GDICT_DEFBOX_CLASS +GDICT_IS_DEFBOX_CLASS +GDICT_DEFBOX_GET_CLASS +<SUBSECTION Private> +GdictDefboxPrivate +</SECTION> + +<SECTION> +<FILE>gdict-source-loader</FILE> +<TITLE>GdictSourceLoader</TITLE> +GdictSourceLoader +GdictSourceLoaderClass +gdict_source_loader_new +gdict_source_loader_update +gdict_source_loader_add_search_path +gdict_source_loader_get_paths +gdict_source_loader_get_names +gdict_source_loader_get_sources +gdict_source_loader_get_source +gdict_source_loader_remove_source +gdict_source_loader_has_source +<SUBSECTION Standard> +GDICT_SOURCE_LOADER +GDICT_IS_SOURCE_LOADER +GDICT_TYPE_SOURCE_LOADER +gdict_source_loader_get_type +GDICT_SOURCE_LOADER_CLASS +GDICT_IS_SOURCE_LOADER_CLASS +GDICT_SOURCE_LOADER_GET_CLASS +<SUBSECTION Private> +GdictSourceLoaderPrivate +</SECTION> + +<SECTION> +<FILE>gdict-source</FILE> +<TITLE>GdictSource</TITLE> +GdictSourceError +GdictSource +GdictSourceClass +gdict_source_new +gdict_source_load_from_file +gdict_source_load_from_data +gdict_source_to_data +gdict_source_set_name +gdict_source_get_name +gdict_source_set_description +gdict_source_get_description +gdict_source_set_database +gdict_source_get_database +gdict_source_set_strategy +gdict_source_get_strategy +GdictSourceTransport +gdict_source_set_transport +gdict_source_set_transportv +gdict_source_get_transport +gdict_source_get_context +gdict_source_peek_context +<SUBSECTION Standard> +GDICT_SOURCE +GDICT_IS_SOURCE +GDICT_TYPE_SOURCE +gdict_source_get_type +GDICT_SOURCE_CLASS +GDICT_IS_SOURCE_CLASS +GDICT_SOURCE_GET_CLASS +GDICT_SOURCE_ERROR +gdict_source_error_quark +<SUBSECTION Private> +GdictSourcePrivate +</SECTION> + +<SECTION> +<FILE>gdict-speller</FILE> +<TITLE>GdictSpeller</TITLE> +GdictSpeller +GdictSpellerClass +gdict_speller_new +gdict_speller_new_with_context +gdict_speller_set_context +gdict_speller_get_context +gdict_speller_set_database +gdict_speller_get_database +gdict_speller_set_strategy +gdict_speller_get_strategy +gdict_speller_clear +gdict_speller_match +gdict_speller_count_matches +gdict_speller_get_matches +<SUBSECTION Standard> +GDICT_SPELLER +GDICT_IS_SPELLER +GDICT_TYPE_SPELLER +gdict_speller_get_type +GDICT_SPELLER_CLASS +GDICT_IS_SPELLER_CLASS +GDICT_SPELLER_GET_CLASS +<SUBSECTION Private> +GdictSpellerPrivate +</SECTION> + +<SECTION> +<FILE>gdict-strategy-chooser</FILE> +<TITLE>GdictStrategyChooser</TITLE> +GdictStrategyChooser +GdictStrategyChooserClass +gdict_strategy_chooser_new +gdict_strategy_chooser_new_with_context +gdict_strategy_chooser_get_context +gdict_strategy_chooser_set_context +gdict_strategy_chooser_get_strategies +gdict_strategy_chooser_has_strategy +gdict_strategy_chooser_add_button +gdict_strategy_chooser_clear +gdict_strategy_chooser_count_strategies +gdict_strategy_chooser_get_current_strategy +gdict_strategy_chooser_refresh +gdict_strategy_chooser_select_strategy +gdict_strategy_chooser_set_current_strategy +gdict_strategy_chooser_unselect_strategy +<SUBSECTION Standard> +GDICT_STRATEGY_CHOOSER +GDICT_IS_STRATEGY_CHOOSER +GDICT_TYPE_STRATEGY_CHOOSER +gdict_strategy_chooser_get_type +GDICT_STRATEGY_CHOOSER_CLASS +GDICT_IS_STRATEGY_CHOOSER_CLASS +GDICT_STRATEGY_CHOOSER_GET_CLASS +<SUBSECTION Private> +GdictStrategyChooserPrivate +</SECTION> + +<SECTION> +<FILE>gdict-source-chooser</FILE> +<TITLE>GdictSourceChooser</TITLE> +GdictSourceChooser +GdictSourceChooserClass +gdict_source_chooser_new +gdict_source_chooser_new_with_loader +gdict_source_chooser_get_loader +gdict_source_chooser_set_loader +gdict_source_chooser_get_sources +gdict_source_chooser_count_sources +gdict_source_chooser_has_source +gdict_source_chooser_refresh +gdict_source_chooser_select_source +gdict_source_chooser_unselect_source +gdict_source_chooser_get_current_source +gdict_source_chooser_set_current_source +gdict_source_chooser_add_button +<SUBSECTION Standard> +GDICT_SOURCE_CHOOSER +GDICT_SOURCE_CHOOSER_CLASS +GDICT_SOURCE_CHOOSER_GET_CLASS +GDICT_TYPE_SOURCE_CHOOSER +GDICT_IS_SOURCE_CHOOSER +GDICT_IS_SOURCE_CHOOSER_CLASS +gdict_source_chooser_get_type +<SUBSECTION Private> +GdictSourceChooserPrivate +</SECTION> + +<SECTION> +<FILE>gdict-utils</FILE> +<TITLE>Gdict Utilities</TITLE> +GDICT_DEFAULT_DATABASE +GDICT_DEFAULT_STRATEGY +GDICT_DEFAULT_FONT_NAME +GdictContextProp +GdictStatusCode +gdict_debug_init +gdict_get_option_group +<SUBSECTION Standard> +GDICT_IS_VALID_STATUS_CODE +</SECTION> + +<SECTION> +<FILE>gdict-version</FILE> +<TITLE>Gdict Version Checking</TITLE> +GDICT_MAJOR_VERSION +GDICT_MINOR_VERSION +GDICT_MICRO_VERSION +GDICT_VERSION +GDICT_VERSION_S +GDICT_VERSION_HEX +GDICT_CHECK_VERSION +<SUBSECTION> +gdict_major +gdict_minor +gdict_micro +gdict_check_version +</SECTION> + diff --git a/mate-dictionary/docs/reference/gdict/gdict.types b/mate-dictionary/docs/reference/gdict/gdict.types new file mode 100644 index 00000000..aa5a3f92 --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/gdict.types @@ -0,0 +1,9 @@ +gdict_client_context_get_type +gdict_context_get_type +gdict_database_chooser_get_type +gdict_defbox_get_type +gdict_source_get_type +gdict_source_chooser_get_type +gdict_source_loader_get_type +gdict_speller_get_type +gdict_strategy_chooser_get_type diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-client-context.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-client-context.sgml new file mode 100644 index 00000000..bc5ac1dd --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-client-context.sgml @@ -0,0 +1,146 @@ +<!-- ##### SECTION Title ##### --> +GdictClientContext + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictClientContext ##### --> +<para> + +</para> + + +<!-- ##### SIGNAL GdictClientContext::connected ##### --> +<para> + +</para> + +@gdictclientcontext: the object which received the signal. + +<!-- ##### SIGNAL GdictClientContext::disconnected ##### --> +<para> + +</para> + +@gdictclientcontext: the object which received the signal. + +<!-- ##### ARG GdictClientContext:client-name ##### --> +<para> + +</para> + +<!-- ##### ARG GdictClientContext:hostname ##### --> +<para> + +</para> + +<!-- ##### ARG GdictClientContext:port ##### --> +<para> + +</para> + +<!-- ##### ARG GdictClientContext:status ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictClientContextClass ##### --> +<para> + +</para> + +@connected: +@disconnected: + +<!-- ##### ENUM GdictClientContextError ##### --> +<para> + +</para> + +@GDICT_CLIENT_CONTEXT_ERROR_SOCKET: +@GDICT_CLIENT_CONTEXT_ERROR_LOOKUP: +@GDICT_CLIENT_CONTEXT_ERROR_NO_CONNECTION: +@GDICT_CLIENT_CONTEXT_ERROR_SERVER_DOWN: + +<!-- ##### FUNCTION gdict_client_context_new ##### --> +<para> + +</para> + +@hostname: +@port: +@Returns: + + +<!-- ##### FUNCTION gdict_client_context_set_hostname ##### --> +<para> + +</para> + +@context: +@hostname: + + +<!-- ##### FUNCTION gdict_client_context_get_hostname ##### --> +<para> + +</para> + +@context: +@Returns: + + +<!-- ##### FUNCTION gdict_client_context_set_port ##### --> +<para> + +</para> + +@context: +@port: + + +<!-- ##### FUNCTION gdict_client_context_get_port ##### --> +<para> + +</para> + +@context: +@Returns: + + +<!-- ##### FUNCTION gdict_client_context_set_client ##### --> +<para> + +</para> + +@context: +@client: + + +<!-- ##### FUNCTION gdict_client_context_get_client ##### --> +<para> + +</para> + +@context: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-context.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-context.sgml new file mode 100644 index 00000000..67fe6dee --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-context.sgml @@ -0,0 +1,300 @@ +<!-- ##### SECTION Title ##### --> +GdictContext + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictContextIface ##### --> +<para> + +</para> + +@get_databases: +@get_strategies: +@match_word: +@define_word: +@lookup_start: +@lookup_end: +@database_found: +@strategy_found: +@match_found: +@definition_found: +@error: + +<!-- ##### ENUM GdictContextError ##### --> +<para> + +</para> + +@GDICT_CONTEXT_ERROR_PARSE: +@GDICT_CONTEXT_ERROR_NOT_IMPLEMENTED: +@GDICT_CONTEXT_ERROR_INVALID_DATABASE: +@GDICT_CONTEXT_ERROR_INVALID_STRATEGY: +@GDICT_CONTEXT_ERROR_INVALID_COMMAND: +@GDICT_CONTEXT_ERROR_NO_MATCH: +@GDICT_CONTEXT_ERROR_NO_DATABASES: +@GDICT_CONTEXT_ERROR_NO_STRATEGIES: + +<!-- ##### FUNCTION gdict_context_set_local_only ##### --> +<para> + +</para> + +@context: +@local_only: + + +<!-- ##### FUNCTION gdict_context_get_local_only ##### --> +<para> + +</para> + +@context: +@Returns: + + +<!-- ##### FUNCTION gdict_context_lookup_databases ##### --> +<para> + +</para> + +@context: +@error: +@Returns: + + +<!-- ##### FUNCTION gdict_context_lookup_strategies ##### --> +<para> + +</para> + +@context: +@error: +@Returns: + + +<!-- ##### FUNCTION gdict_context_match_word ##### --> +<para> + +</para> + +@context: +@database: +@strategy: +@word: +@error: +@Returns: + + +<!-- ##### FUNCTION gdict_context_define_word ##### --> +<para> + +</para> + +@context: +@database: +@word: +@error: +@Returns: + + +<!-- ##### STRUCT GdictDatabase ##### --> +<para> + +</para> + + +<!-- ##### FUNCTION gdict_database_ref ##### --> +<para> + +</para> + +@db: +@Returns: + + +<!-- ##### FUNCTION gdict_database_unref ##### --> +<para> + +</para> + +@db: + + +<!-- ##### FUNCTION gdict_database_get_name ##### --> +<para> + +</para> + +@db: +@Returns: + + +<!-- ##### FUNCTION gdict_database_get_full_name ##### --> +<para> + +</para> + +@db: +@Returns: + + +<!-- ##### STRUCT GdictStrategy ##### --> +<para> + +</para> + + +<!-- ##### FUNCTION gdict_strategy_ref ##### --> +<para> + +</para> + +@strat: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_unref ##### --> +<para> + +</para> + +@strat: + + +<!-- ##### FUNCTION gdict_strategy_get_name ##### --> +<para> + +</para> + +@strat: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_get_description ##### --> +<para> + +</para> + +@strat: +@Returns: + + +<!-- ##### STRUCT GdictMatch ##### --> +<para> + +</para> + + +<!-- ##### FUNCTION gdict_match_ref ##### --> +<para> + +</para> + +@match: +@Returns: + + +<!-- ##### FUNCTION gdict_match_unref ##### --> +<para> + +</para> + +@match: + + +<!-- ##### FUNCTION gdict_match_get_word ##### --> +<para> + +</para> + +@match: +@Returns: + + +<!-- ##### FUNCTION gdict_match_get_database ##### --> +<para> + +</para> + +@match: +@Returns: + + +<!-- ##### STRUCT GdictDefinition ##### --> +<para> + +</para> + + +<!-- ##### FUNCTION gdict_definition_ref ##### --> +<para> + +</para> + +@def: +@Returns: + + +<!-- ##### FUNCTION gdict_definition_unref ##### --> +<para> + +</para> + +@def: + + +<!-- ##### FUNCTION gdict_definition_get_total ##### --> +<para> + +</para> + +@def: +@Returns: + + +<!-- ##### FUNCTION gdict_definition_get_word ##### --> +<para> + +</para> + +@def: +@Returns: + + +<!-- ##### FUNCTION gdict_definition_get_database ##### --> +<para> + +</para> + +@def: +@Returns: + + +<!-- ##### FUNCTION gdict_definition_get_text ##### --> +<para> + +</para> + +@def: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-database-chooser.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-database-chooser.sgml new file mode 100644 index 00000000..ad828acc --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-database-chooser.sgml @@ -0,0 +1,194 @@ +<!-- ##### SECTION Title ##### --> +GdictDatabaseChooser + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictDatabaseChooser ##### --> +<para> + +</para> + + +<!-- ##### SIGNAL GdictDatabaseChooser::database-activated ##### --> +<para> + +</para> + +@gdictdatabasechooser: the object which received the signal. +@arg1: +@arg2: + +<!-- ##### SIGNAL GdictDatabaseChooser::selection-changed ##### --> +<para> + +</para> + +@gdictdatabasechooser: the object which received the signal. + +<!-- ##### ARG GdictDatabaseChooser:context ##### --> +<para> + +</para> + +<!-- ##### ARG GdictDatabaseChooser:count ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictDatabaseChooserClass ##### --> +<para> + +</para> + +@database_activated: +@selection_changed: + +<!-- ##### FUNCTION gdict_database_chooser_new ##### --> +<para> + +</para> + +@void: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_new_with_context ##### --> +<para> + +</para> + +@context: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_get_context ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_set_context ##### --> +<para> + +</para> + +@chooser: +@context: + + +<!-- ##### FUNCTION gdict_database_chooser_get_databases ##### --> +<para> + +</para> + +@chooser: +@length: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_count_databases ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_has_database ##### --> +<para> + +</para> + +@chooser: +@database: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_refresh ##### --> +<para> + +</para> + +@chooser: + + +<!-- ##### FUNCTION gdict_database_chooser_clear ##### --> +<para> + +</para> + +@chooser: + + +<!-- ##### FUNCTION gdict_database_chooser_add_button ##### --> +<para> + +</para> + +@chooser: +@button_text: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_get_current_database ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_select_database ##### --> +<para> + +</para> + +@chooser: +@db_name: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_set_current_database ##### --> +<para> + +</para> + +@chooser: +@db_name: +@Returns: + + +<!-- ##### FUNCTION gdict_database_chooser_unselect_database ##### --> +<para> + +</para> + +@chooser: +@db_name: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-defbox.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-defbox.sgml new file mode 100644 index 00000000..5ca025f2 --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-defbox.sgml @@ -0,0 +1,288 @@ +<!-- ##### SECTION Title ##### --> +GdictDefbox + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictDefbox ##### --> +<para> + +</para> + + +<!-- ##### SIGNAL GdictDefbox::find-next ##### --> +<para> + +</para> + +@gdictdefbox: the object which received the signal. + +<!-- ##### SIGNAL GdictDefbox::find-previous ##### --> +<para> + +</para> + +@gdictdefbox: the object which received the signal. + +<!-- ##### SIGNAL GdictDefbox::hide-find ##### --> +<para> + +</para> + +@gdictdefbox: the object which received the signal. + +<!-- ##### SIGNAL GdictDefbox::link-clicked ##### --> +<para> + +</para> + +@gdictdefbox: the object which received the signal. +@arg1: + +<!-- ##### SIGNAL GdictDefbox::show-find ##### --> +<para> + +</para> + +@gdictdefbox: the object which received the signal. + +<!-- ##### ARG GdictDefbox:context ##### --> +<para> + +</para> + +<!-- ##### ARG GdictDefbox:database ##### --> +<para> + +</para> + +<!-- ##### ARG GdictDefbox:font-name ##### --> +<para> + +</para> + +<!-- ##### ARG GdictDefbox:word ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictDefboxClass ##### --> +<para> + +</para> + +@parent_class: +@show_find: +@hide_find: +@find_previous: +@find_next: +@link_clicked: +@_gdict_defbox_1: +@_gdict_defbox_2: +@_gdict_defbox_3: +@_gdict_defbox_4: + +<!-- ##### FUNCTION gdict_defbox_new ##### --> +<para> + +</para> + +@void: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_new_with_context ##### --> +<para> + +</para> + +@context: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_set_context ##### --> +<para> + +</para> + +@defbox: +@context: + + +<!-- ##### FUNCTION gdict_defbox_get_context ##### --> +<para> + +</para> + +@defbox: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_set_database ##### --> +<para> + +</para> + +@defbox: +@database: + + +<!-- ##### FUNCTION gdict_defbox_get_database ##### --> +<para> + +</para> + +@defbox: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_get_text ##### --> +<para> + +</para> + +@defbox: +@length: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_select_all ##### --> +<para> + +</para> + +@defbox: + + +<!-- ##### FUNCTION gdict_defbox_copy_to_clipboard ##### --> +<para> + +</para> + +@defbox: +@clipboard: + + +<!-- ##### FUNCTION gdict_defbox_clear ##### --> +<para> + +</para> + +@defbox: + + +<!-- ##### FUNCTION gdict_defbox_lookup ##### --> +<para> + +</para> + +@defbox: +@word: + + +<!-- ##### FUNCTION gdict_defbox_get_word ##### --> +<para> + +</para> + +@defbox: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_count_definitions ##### --> +<para> + +</para> + +@defbox: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_jump_to_definition ##### --> +<para> + +</para> + +@defbox: +@number: + + +<!-- ##### FUNCTION gdict_defbox_set_show_find ##### --> +<para> + +</para> + +@defbox: +@show_find: + + +<!-- ##### FUNCTION gdict_defbox_get_show_find ##### --> +<para> + +</para> + +@defbox: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_find_next ##### --> +<para> + +</para> + +@defbox: + + +<!-- ##### FUNCTION gdict_defbox_find_previous ##### --> +<para> + +</para> + +@defbox: + + +<!-- ##### FUNCTION gdict_defbox_set_font_name ##### --> +<para> + +</para> + +@defbox: +@font_name: + + +<!-- ##### FUNCTION gdict_defbox_get_font_name ##### --> +<para> + +</para> + +@defbox: +@Returns: + + +<!-- ##### FUNCTION gdict_defbox_get_selected_word ##### --> +<para> + +</para> + +@defbox: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-source-chooser.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-source-chooser.sgml new file mode 100644 index 00000000..baafc187 --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-source-chooser.sgml @@ -0,0 +1,186 @@ +<!-- ##### SECTION Title ##### --> +GdictSourceChooser + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictSourceChooser ##### --> +<para> + +</para> + + +<!-- ##### SIGNAL GdictSourceChooser::selection-changed ##### --> +<para> + +</para> + +@gdictsourcechooser: the object which received the signal. + +<!-- ##### SIGNAL GdictSourceChooser::source-activated ##### --> +<para> + +</para> + +@gdictsourcechooser: the object which received the signal. +@arg1: +@arg2: + +<!-- ##### ARG GdictSourceChooser:count ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSourceChooser:loader ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictSourceChooserClass ##### --> +<para> + +</para> + +@source_activated: +@selection_changed: + +<!-- ##### FUNCTION gdict_source_chooser_new ##### --> +<para> + +</para> + +@void: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_new_with_loader ##### --> +<para> + +</para> + +@loader: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_get_loader ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_set_loader ##### --> +<para> + +</para> + +@chooser: +@loader: + + +<!-- ##### FUNCTION gdict_source_chooser_get_sources ##### --> +<para> + +</para> + +@chooser: +@length: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_count_sources ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_has_source ##### --> +<para> + +</para> + +@chooser: +@source_name: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_refresh ##### --> +<para> + +</para> + +@chooser: + + +<!-- ##### FUNCTION gdict_source_chooser_select_source ##### --> +<para> + +</para> + +@chooser: +@source_name: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_unselect_source ##### --> +<para> + +</para> + +@chooser: +@source_name: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_get_current_source ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_set_current_source ##### --> +<para> + +</para> + +@chooser: +@source_name: +@Returns: + + +<!-- ##### FUNCTION gdict_source_chooser_add_button ##### --> +<para> + +</para> + +@chooser: +@button_text: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-source-loader.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-source-loader.sgml new file mode 100644 index 00000000..f9f2349b --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-source-loader.sgml @@ -0,0 +1,144 @@ +<!-- ##### SECTION Title ##### --> +GdictSourceLoader + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictSourceLoader ##### --> +<para> + +</para> + + +<!-- ##### SIGNAL GdictSourceLoader::source-loaded ##### --> +<para> + +</para> + +@gdictsourceloader: the object which received the signal. +@arg1: + +<!-- ##### ARG GdictSourceLoader:paths ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSourceLoader:sources ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictSourceLoaderClass ##### --> +<para> + +</para> + +@parent_class: +@source_loaded: +@_gdict_source_1: +@_gdict_source_2: +@_gdict_source_3: +@_gdict_source_4: + +<!-- ##### FUNCTION gdict_source_loader_new ##### --> +<para> + +</para> + +@void: +@Returns: + + +<!-- ##### FUNCTION gdict_source_loader_update ##### --> +<para> + +</para> + +@loader: + + +<!-- ##### FUNCTION gdict_source_loader_add_search_path ##### --> +<para> + +</para> + +@loader: +@path: + + +<!-- ##### FUNCTION gdict_source_loader_get_paths ##### --> +<para> + +</para> + +@loader: +@Returns: + + +<!-- ##### FUNCTION gdict_source_loader_get_names ##### --> +<para> + +</para> + +@loader: +@length: +@Returns: + + +<!-- ##### FUNCTION gdict_source_loader_get_sources ##### --> +<para> + +</para> + +@loader: +@Returns: + + +<!-- ##### FUNCTION gdict_source_loader_get_source ##### --> +<para> + +</para> + +@loader: +@name: +@Returns: + + +<!-- ##### FUNCTION gdict_source_loader_remove_source ##### --> +<para> + +</para> + +@loader: +@name: +@Returns: + + +<!-- ##### FUNCTION gdict_source_loader_has_source ##### --> +<para> + +</para> + +@loader: +@source_name: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-source.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-source.sgml new file mode 100644 index 00000000..f0117047 --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-source.sgml @@ -0,0 +1,253 @@ +<!-- ##### SECTION Title ##### --> +GdictSource + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### ENUM GdictSourceError ##### --> +<para> + +</para> + +@GDICT_SOURCE_ERROR_PARSE: +@GDICT_SOURCE_ERROR_INVALID_NAME: +@GDICT_SOURCE_ERROR_INVALID_TRANSPORT: +@GDICT_SOURCE_ERROR_INVALID_BAD_PARAMETER: + +<!-- ##### STRUCT GdictSource ##### --> +<para> + +</para> + + +<!-- ##### ARG GdictSource:context ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSource:database ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSource:description ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSource:filename ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSource:name ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSource:strategy ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSource:transport ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictSourceClass ##### --> +<para> + +</para> + + +<!-- ##### FUNCTION gdict_source_new ##### --> +<para> + +</para> + +@void: +@Returns: + + +<!-- ##### FUNCTION gdict_source_load_from_file ##### --> +<para> + +</para> + +@source: +@filename: +@error: +@Returns: + + +<!-- ##### FUNCTION gdict_source_load_from_data ##### --> +<para> + +</para> + +@source: +@data: +@length: +@error: +@Returns: + + +<!-- ##### FUNCTION gdict_source_to_data ##### --> +<para> + +</para> + +@source: +@length: +@error: +@Returns: + + +<!-- ##### FUNCTION gdict_source_set_name ##### --> +<para> + +</para> + +@source: +@name: + + +<!-- ##### FUNCTION gdict_source_get_name ##### --> +<para> + +</para> + +@source: +@Returns: + + +<!-- ##### FUNCTION gdict_source_set_description ##### --> +<para> + +</para> + +@source: +@description: + + +<!-- ##### FUNCTION gdict_source_get_description ##### --> +<para> + +</para> + +@source: +@Returns: + + +<!-- ##### FUNCTION gdict_source_set_database ##### --> +<para> + +</para> + +@source: +@database: + + +<!-- ##### FUNCTION gdict_source_get_database ##### --> +<para> + +</para> + +@source: +@Returns: + + +<!-- ##### FUNCTION gdict_source_set_strategy ##### --> +<para> + +</para> + +@source: +@strategy: + + +<!-- ##### FUNCTION gdict_source_get_strategy ##### --> +<para> + +</para> + +@source: +@Returns: + + +<!-- ##### ENUM GdictSourceTransport ##### --> +<para> + +</para> + +@GDICT_SOURCE_TRANSPORT_DICTD: +@GDICT_SOURCE_TRANSPORT_INVALID: + +<!-- ##### FUNCTION gdict_source_set_transport ##### --> +<para> + +</para> + +@source: +@transport: +@first_transport_property: +@Varargs: + + +<!-- ##### FUNCTION gdict_source_set_transportv ##### --> +<para> + +</para> + +@source: +@transport: +@first_transport_property: +@var_args: + + +<!-- ##### FUNCTION gdict_source_get_transport ##### --> +<para> + +</para> + +@source: +@Returns: + + +<!-- ##### FUNCTION gdict_source_get_context ##### --> +<para> + +</para> + +@source: +@Returns: + + +<!-- ##### FUNCTION gdict_source_peek_context ##### --> +<para> + +</para> + +@source: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-speller.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-speller.sgml new file mode 100644 index 00000000..98c06fbe --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-speller.sgml @@ -0,0 +1,174 @@ +<!-- ##### SECTION Title ##### --> +GdictSpeller + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictSpeller ##### --> +<para> + +</para> + + +<!-- ##### SIGNAL GdictSpeller::word-activated ##### --> +<para> + +</para> + +@gdictspeller: the object which received the signal. +@arg1: +@arg2: + +<!-- ##### ARG GdictSpeller:context ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSpeller:database ##### --> +<para> + +</para> + +<!-- ##### ARG GdictSpeller:strategy ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictSpellerClass ##### --> +<para> + +</para> + +@parent_class: +@word_activated: +@_gdict_speller_1: +@_gdict_speller_2: +@_gdict_speller_3: +@_gdict_speller_4: + +<!-- ##### FUNCTION gdict_speller_new ##### --> +<para> + +</para> + +@void: +@Returns: + + +<!-- ##### FUNCTION gdict_speller_new_with_context ##### --> +<para> + +</para> + +@context: +@Returns: + + +<!-- ##### FUNCTION gdict_speller_set_context ##### --> +<para> + +</para> + +@speller: +@context: + + +<!-- ##### FUNCTION gdict_speller_get_context ##### --> +<para> + +</para> + +@speller: +@Returns: + + +<!-- ##### FUNCTION gdict_speller_set_database ##### --> +<para> + +</para> + +@speller: +@database: + + +<!-- ##### FUNCTION gdict_speller_get_database ##### --> +<para> + +</para> + +@speller: +@Returns: + + +<!-- ##### FUNCTION gdict_speller_set_strategy ##### --> +<para> + +</para> + +@speller: +@strategy: + + +<!-- ##### FUNCTION gdict_speller_get_strategy ##### --> +<para> + +</para> + +@speller: +@Returns: + + +<!-- ##### FUNCTION gdict_speller_clear ##### --> +<para> + +</para> + +@speller: + + +<!-- ##### FUNCTION gdict_speller_match ##### --> +<para> + +</para> + +@speller: +@word: + + +<!-- ##### FUNCTION gdict_speller_count_matches ##### --> +<para> + +</para> + +@speller: +@Returns: + + +<!-- ##### FUNCTION gdict_speller_get_matches ##### --> +<para> + +</para> + +@speller: +@length: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-strategy-chooser.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-strategy-chooser.sgml new file mode 100644 index 00000000..f909feed --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-strategy-chooser.sgml @@ -0,0 +1,188 @@ +<!-- ##### SECTION Title ##### --> +GdictStrategyChooser + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### STRUCT GdictStrategyChooser ##### --> +<para> + +</para> + + +<!-- ##### SIGNAL GdictStrategyChooser::strategy-activated ##### --> +<para> + +</para> + +@gdictstrategychooser: the object which received the signal. +@arg1: +@arg2: + +<!-- ##### ARG GdictStrategyChooser:context ##### --> +<para> + +</para> + +<!-- ##### STRUCT GdictStrategyChooserClass ##### --> +<para> + +</para> + +@parent_class: +@strategy_activated: +@_gdict_padding1: +@_gdict_padding2: +@_gdict_padding3: +@_gdict_padding4: +@_gdict_padding5: +@_gdict_padding6: + +<!-- ##### FUNCTION gdict_strategy_chooser_new ##### --> +<para> + +</para> + +@void: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_new_with_context ##### --> +<para> + +</para> + +@context: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_get_context ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_set_context ##### --> +<para> + +</para> + +@chooser: +@context: + + +<!-- ##### FUNCTION gdict_strategy_chooser_get_strategies ##### --> +<para> + +</para> + +@chooser: +@length: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_has_strategy ##### --> +<para> + +</para> + +@chooser: +@strategy: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_add_button ##### --> +<para> + +</para> + +@chooser: +@button_text: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_clear ##### --> +<para> + +</para> + +@chooser: + + +<!-- ##### FUNCTION gdict_strategy_chooser_count_strategies ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_get_current_strategy ##### --> +<para> + +</para> + +@chooser: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_refresh ##### --> +<para> + +</para> + +@chooser: + + +<!-- ##### FUNCTION gdict_strategy_chooser_select_strategy ##### --> +<para> + +</para> + +@chooser: +@strat_name: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_set_current_strategy ##### --> +<para> + +</para> + +@chooser: +@strat_name: +@Returns: + + +<!-- ##### FUNCTION gdict_strategy_chooser_unselect_strategy ##### --> +<para> + +</para> + +@chooser: +@strat_name: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-unused.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-unused.sgml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-unused.sgml diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-utils.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-utils.sgml new file mode 100644 index 00000000..60582b6e --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-utils.sgml @@ -0,0 +1,107 @@ +<!-- ##### SECTION Title ##### --> +Gdict Utilities + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### MACRO GDICT_DEFAULT_DATABASE ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_DEFAULT_STRATEGY ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_DEFAULT_FONT_NAME ##### --> +<para> + +</para> + + + +<!-- ##### ENUM GdictContextProp ##### --> +<para> + +</para> + +@GDICT_CONTEXT_PROP_FIRST: +@GDICT_CONTEXT_PROP_LOCAL_ONLY: +@GDICT_CONTEXT_PROP_LAST: + +<!-- ##### ENUM GdictStatusCode ##### --> +<para> + +</para> + +@GDICT_STATUS_INVALID: +@GDICT_STATUS_N_DATABASES_PRESENT: +@GDICT_STATUS_N_STRATEGIES_PRESENT: +@GDICT_STATUS_DATABASE_INFO: +@GDICT_STATUS_HELP_TEXT: +@GDICT_STATUS_SERVER_INFO: +@GDICT_STATUS_CHALLENGE: +@GDICT_STATUS_N_DEFINITIONS_RETRIEVED: +@GDICT_STATUS_WORD_DB_NAME: +@GDICT_STATUS_N_MATCHES_FOUND: +@GDICT_STATUS_CONNECT: +@GDICT_STATUS_QUIT: +@GDICT_STATUS_AUTH_OK: +@GDICT_STATUS_OK: +@GDICT_STATUS_SEND_RESPONSE: +@GDICT_STATUS_SERVER_DOWN: +@GDICT_STATUS_SHUTDOWN: +@GDICT_STATUS_BAD_COMMAND: +@GDICT_STATUS_BAD_PARAMETERS: +@GDICT_STATUS_COMMAND_NOT_IMPLEMENTED: +@GDICT_STATUS_PARAMETER_NOT_IMPLEMENTED: +@GDICT_STATUS_NO_ACCESS: +@GDICT_STATUS_USE_SHOW_INFO: +@GDICT_STATUS_UNKNOWN_MECHANISM: +@GDICT_STATUS_BAD_DATABASE: +@GDICT_STATUS_BAD_STRATEGY: +@GDICT_STATUS_NO_MATCH: +@GDICT_STATUS_NO_DATABASES_PRESENT: +@GDICT_STATUS_NO_STRATEGIES_PRESENT: + +<!-- ##### FUNCTION gdict_debug_init ##### --> +<para> + +</para> + +@argc: +@argv: + + +<!-- ##### FUNCTION gdict_get_option_group ##### --> +<para> + +</para> + +@void: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/tmpl/gdict-version.sgml b/mate-dictionary/docs/reference/gdict/tmpl/gdict-version.sgml new file mode 100644 index 00000000..8d3cb5ce --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/tmpl/gdict-version.sgml @@ -0,0 +1,105 @@ +<!-- ##### SECTION Title ##### --> +Gdict Version Checking + +<!-- ##### SECTION Short_Description ##### --> + + +<!-- ##### SECTION Long_Description ##### --> +<para> + +</para> + + +<!-- ##### SECTION See_Also ##### --> +<para> + +</para> + + +<!-- ##### SECTION Stability_Level ##### --> + + +<!-- ##### SECTION Image ##### --> + + +<!-- ##### MACRO GDICT_MAJOR_VERSION ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_MINOR_VERSION ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_MICRO_VERSION ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_VERSION ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_VERSION_S ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_VERSION_HEX ##### --> +<para> + +</para> + + + +<!-- ##### MACRO GDICT_CHECK_VERSION ##### --> +<para> + +</para> + +@major: +@minor: +@micro: + + +<!-- ##### VARIABLE gdict_major ##### --> +<para> + +</para> + + +<!-- ##### VARIABLE gdict_minor ##### --> +<para> + +</para> + + +<!-- ##### VARIABLE gdict_micro ##### --> +<para> + +</para> + + +<!-- ##### FUNCTION gdict_check_version ##### --> +<para> + +</para> + +@required_major: +@required_minor: +@required_micro: +@Returns: + + diff --git a/mate-dictionary/docs/reference/gdict/version.xml.in b/mate-dictionary/docs/reference/gdict/version.xml.in new file mode 100644 index 00000000..181a09ca --- /dev/null +++ b/mate-dictionary/docs/reference/gdict/version.xml.in @@ -0,0 +1 @@ +@GDICT_VERSION@ diff --git a/mate-dictionary/docs/source-configuration.txt b/mate-dictionary/docs/source-configuration.txt new file mode 100644 index 00000000..3b815cae --- /dev/null +++ b/mate-dictionary/docs/source-configuration.txt @@ -0,0 +1,65 @@ +Thoughts on Source Configuration +================================ + +Since there has been a request for multiple back-end support inside MATE +Dictionary, and since Gdict makes the addition of such back-ends a possibility, +we need a way to configure these back-ends. + +My plan is to use .desktop files in a standard location, such as +/usr/share/mate-dictionary and $HOME/.mate2/mate-dictionary. By dropping a +correctly-formatted .desktop file inside these locations, you can enable a new +dictionary source inside MATE Dictionary. + +* Syntax +======== + +** General keys +=============== + +A .desktop file is parsable using the GKeyFile class of GLib. Please remember +that a .desktop file is case sensitive. A standard .desktop file for +Dictionary must have the "Dictionary" group; only this group should be parsed, +and other groups should be ignored. + +The mandatory name of the dictionary source is specified by the "Name" key; +it may be localized. + +An optional description of the dictionary source is specified by the +"Description" key; also this may be localized. + +The type of back-end to use is specified by the mandatory "Transport" key; at +this moment, only the "dictd" value is permitted. + +An optional default database to be used with the dictionary source is specified +by the "Database" key; if no default database is specified, assume the default +database for the transport. + +An option default match strategy to be used with the dictionary source is +specified by the "Strategy" key; if no default strategy is specified, assume +the default strategy for the transport. + +** Transport-specific keys +========================== + +These are the keys defined for the "dictd" transport: + +"Hostname" [mandatory] + holds the hostname of the dictionary server to connect to; + +"Port" [optional] + holds the port of the dictionary server to connect to; if omitted, + the default port should be used. + +** Example +========== + +Dictionary source for dict.org: + + [Dictionary] + _Name: Default + _Description: Default dictionary server + Transport: dictd + Hostname: dict.org + Port: 2628 + +$ Last updated: 2005-12-07 19:00 (+0100) ebassi $ diff --git a/mate-dictionary/help/C/figures/mate-dictionary-add-source.png b/mate-dictionary/help/C/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..f6401e8b --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/C/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/C/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..efeb4833 --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/C/figures/mate-dictionary-applet.png b/mate-dictionary/help/C/figures/mate-dictionary-applet.png Binary files differnew file mode 100644 index 00000000..07d702a4 --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-applet.png diff --git a/mate-dictionary/help/C/figures/mate-dictionary-application.png b/mate-dictionary/help/C/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..40f7cca6 --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/C/figures/mate-dictionary-find.png b/mate-dictionary/help/C/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..fb78545f --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/C/figures/mate-dictionary-lookup.png b/mate-dictionary/help/C/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..e6a51ee7 --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/C/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/C/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..9b184388 --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/C/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/C/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..4d423c12 --- /dev/null +++ b/mate-dictionary/help/C/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/C/legal.xml b/mate-dictionary/help/C/legal.xml new file mode 100644 index 00000000..acb0b403 --- /dev/null +++ b/mate-dictionary/help/C/legal.xml @@ -0,0 +1,76 @@ + <legalnotice id="legalnotice"> + <para> + 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 + 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 <ulink type="help" + url="ghelp:fdl">link</ulink> or in the file COPYING-DOCS + distributed with this manual. + </para> + <para> This manual is part of a collection of MATE manuals + distributed under the GFDL. If you want to distribute this + manual separately from the collection, you can do so by + adding a copy of the license to the manual, as described in + section 6 of the license. + </para> + + <para> + Many of the names used by companies to distinguish their + products and services are claimed as trademarks. Where those + names appear in any MATE documentation, and the members of + the MATE Documentation Project are made aware of those + trademarks, then the names are in capital letters or initial + capital letters. + </para> + + <para> + DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED + UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE + WITH THE FURTHER UNDERSTANDING THAT: + + <orderedlist> + <listitem> + <para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR + IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES + THAT THE DOCUMENT OR MODIFIED VERSION OF THE + DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR + A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE + RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE + OF THE DOCUMENT OR MODIFIED VERSION OF THE + DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR + MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY + CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY + SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED + VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER + EXCEPT UNDER THIS DISCLAIMER; AND + </para> + </listitem> + <listitem> + <para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL + THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), + CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, + INITIAL WRITER, ANY CONTRIBUTOR, OR ANY + DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION + OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH + PARTIES, BE LIABLE TO ANY PERSON FOR ANY + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER + INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS + OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR + MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR + LOSSES ARISING OUT OF OR RELATING TO USE OF THE + DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, + EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF + THE POSSIBILITY OF SUCH DAMAGES. + </para> + </listitem> + </orderedlist> + </para> + </legalnotice> + diff --git a/mate-dictionary/help/C/mate-dictionary.xml b/mate-dictionary/help/C/mate-dictionary.xml new file mode 100644 index 00000000..c61d5b37 --- /dev/null +++ b/mate-dictionary/help/C/mate-dictionary.xml @@ -0,0 +1,451 @@ +<?xml version="1.0"?> +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ +<!ENTITY app "Dictionary"> +<!ENTITY applet "Dictionary Applet"> +<!ENTITY appversion "2.14.0"> +<!ENTITY date "January 2005"> +<!ENTITY legal SYSTEM "legal.xml"> +<!ENTITY manrevision "1.0.0"> +]> +<!-- This file describes the Dictionary applet and application. --> +<!-- + (Do not remove this comment block.) + Maintained by the MATE Documentation Project + http://developer.mate.org/projects/gdp + Template version: 2.0 beta + Template last modified 11 April, 2002 + +--> +<!-- =============Document Header ============================= --> +<article id="index" lang="en"> +<!-- please do not change the id; for translations, change language to --> +<!-- appropriate code --> + <articleinfo> + <title>&app; Manual</title> + + <abstract role="description"> + <para> + Dictionary enables you to look up definitions and correct spellings + of words. + </para> + </abstract> + + <copyright> + <year>2005</year> + <holder>Emmanuele Bassi</holder> + </copyright> + +<!-- translators: uncomment this: + + <copyright> + <year>2006</year> + <holder>ME-THE-TRANSLATOR (Latin translation)</holder> + </copyright> + + --> + + <publisher> + <publishername> MATE Documentation Project </publishername> + </publisher> + + &legal; + + <authorgroup> + <author role="maintainer"> + <firstname>Emmanuele</firstname> + <surname>Bassi</surname> + <affiliation> + <address><email>[email protected]</email></address> + </affiliation> + </author> + +<!-- This is appropriate place for other contributors: translators, + maintainers, etc. Commented out by default. + <othercredit role="translator"> + <firstname>Latin</firstname> + <surname>Translator 1</surname> + <affiliation> + <orgname>Latin Translation Team</orgname> + <address> <email>[email protected]</email> </address> + </affiliation> + <contrib>Latin translation</contrib> + </othercredit> +--> + + </authorgroup> + + <revhistory> + <revision> + <revnumber>&app; Manual V&manrevision;</revnumber> + <date>&date;</date> + <revdescription> + <para role="author">Emmanuele Bassi</para> + <para role="publisher">MATE Documentation Project</para> + </revdescription> + </revision> + </revhistory> + + <releaseinfo>This manual describes version &appversion; of &app;.</releaseinfo> + <legalnotice> + <title>Feedback</title> + <para>To report a bug or make a suggestion regarding the &app; + application or this manual, follow the directions in the + <ulink url="ghelp:mate-feedback" type="help">MATE Feedback + Page</ulink>.</para> + +<!-- Translators may also add here feedback address for translations --> + </legalnotice> + </articleinfo> + + <indexterm> + <primary>Dictionary</primary> + </indexterm> + +<!-- ============= Document Body ============================= --> +<!-- ============= Introduction ============================== --> + <sect1 id="mate-dictionary-introduction"> + <title>Introduction</title> + + <para>The <application>&app;</application> application enables you to + search words and terms on a dictionary source.</para> + + </sect1> + +<!-- ============= Getting Started =========================== --> + <sect1 id="mate-dictionary-getting-started"> + <title>Getting Started</title> + +<!-- ============= To Start Dictionary ======================= --> + <sect2 id="mate-dictionary-start-application"> + <title>To Start &app;</title> + + <para>You can start <application>&app;</application> in the following + ways:</para> + + <variablelist> + <varlistentry> + <term><guimenu>Applications</guimenu> menu</term> + <listitem> + <para>Choose <menuchoice><guisubmenu>Accessories</guisubmenu> + <guimenuitem>Dictionary</guimenuitem></menuchoice>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>Command line</term> + <listitem> + <para>Execute the following command: <command>mate-dictionary</command></para> + </listitem> + </varlistentry> + </variablelist> + + <para>Once started, the <application>&app;</application> window is + displayed:</para> + + <figure id="mate-dictionary-fig"> + <title>&app; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-application.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows &app; main window.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + </sect2> + + </sect1> + +<!-- ============= Usage ===================================== --> + <sect1 id="mate-dictionary-usage"> + <title>Usage</title> + + <sect2 id="mate-dictionary-lookup"> + <title>Looking up a word</title> + + <para>To look up a word, type it into the <guilabel>entry field</guilabel> + and press <keycap>Enter</keycap>.</para> + + <para>If some definition for the word is found, it will appear inside + the main window area:</para> + + <figure id="mate-dictionary-lookup-fig"> + <title>&app; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-lookup.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows a definition inside the &app; main window.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + <para>Otherwise, an error dialog will appear, with a message explaining the + nature of the error.</para> + + </sect2> + + <sect2 id="mate-dictionary-save"> + <title>Save look up results</title> + + <para>To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialog, then click <guibutton>Save</guibutton>.</para> + + </sect2> + + <sect2 id="mate-dictionary-print"> + <title>Print look up results</title> + + <para>To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>.</para> + + <para>Inside the <guilabel>Print</guilabel> dialog you can select the + printer to use, the paper format, the number of copies.</para> + + <para>To see a preview of what will be printed, click + <guibutton>Preview</guibutton>.</para> + + <para>To print, click <guibutton>Print</guibutton>.</para> + + </sect2> + + <sect2 id="mate-dictionary-find"> + <title>Find Text</title> + + <figure id="mate-dictionary-find-fig"> + <title>&app; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-find.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows the &app; Find pane inside the main window.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + + <para>To find text inside the results of a look up, perform the following + steps:</para> + + <orderedlist> + <listitem><para>Choose <menuchoice> <guimenu>Edit</guimenu> <guimenuitem>Find</guimenuitem> </menuchoice> + to display the <guilabel>Find</guilabel> pane.</para></listitem> + <listitem><para>Type the text you want to find inside the <guilabel>Search</guilabel> + entry.</para></listitem> + <listitem><para>To find the next occurrence of the text, click <guibutton>Next</guibutton>. + To find the previous occurrence of the text, click + <guibutton>Previous</guibutton>.</para></listitem> + </orderedlist> + + </sect2> + + </sect1> + +<!-- ============= Preferences =============================== --> + <sect1 id="mate-dictionary-preferences"> + <title>Preferences</title> + + <para>To change the <application>&app;</application> application + preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>.</para> + +<!-- ============= Source Tab ================================ --> + <sect2 id="mate-dictionary-source-tab"> + <title>Dictionary Sources</title> + + <figure id="mate-dictionary-sources-fig"> + <title>&app; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-preferences-source.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows the Source tab of the Preferences dialog.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + <para>To change the dictionary source used to look up words, select + the desired source from the list.</para> + </sect2> + +<!-- ============= Add Source ================================ --> + <sect2 id="mate-dictionary-add-source"> + <title>Adding a new source</title> + + <figure id="mate-dictionary-add-source-fig"> + <title>&app; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-add-source.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows the Add Source dialog.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + <para>To add a new dictionary source, perform the following steps:</para> + + <orderedlist> + <listitem><para>Click on the <guibutton>Add</guibutton> button</para></listitem> + <listitem><para>Edit the name of the new source inside the <guilabel>Description</guilabel> entry</para></listitem> + <listitem><para>Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box</para></listitem> + <listitem><para>Edit the attributes of the new source</para></listitem> + <listitem><para>Click <guibutton>Add</guibutton></para></listitem> + </orderedlist> + + <para>Different source transport types uses different attributes. This + is the list of available attributes per transport type:</para> + + <informaltable frame="all"> + <tgroup cols="2" colsep="1" rowsep="1"> + <thead> + <row valign="top"> + <entry><para>Transport</para></entry> + <entry><para>Attributes</para></entry> + </row> + </thead> + <tbody> + <row valign="top"> + <entry><para>Dictionary Server</para></entry> + <entry> + <para>Hostname: the hostname of the dictionary server</para> + <para>Port: the port of the dictionary server</para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + + </sect2> + +<!-- ============= Remove Source ============================= --> + <sect2 id="mate-dictionary-remove-source"> + <title>Removing a source</title> + + <para>To remove a dictionary source, perform the following steps:</para> + + <orderedlist> + <listitem><para>Select the source you wish to remove</para></listitem> + <listitem><para>Click the <guibutton>Remove</guibutton> button</para></listitem> + </orderedlist> + + <warning><para>If you remove a dictionary source it will be permanently + deleted from the list of available sources. Also, as some sources might + be defined system-wide you may actually not be able to remove + them unless you have the right ownership privileges.</para></warning> + + </sect2> + +<!-- ============= Print Tab ================================= --> + <sect2 id="mate-dictionary-print-tab"> + <title>Print Options</title> + + <figure id="mate-dictionary-print-fig"> + <title>&app; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-preferences-print.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows the Print tab inside the Preferences dialog.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + <para>If you want to change the font name and size used when printing, + perform the following steps:</para> + + <orderedlist> + <listitem><para>Click on the <guilabel>Print Font</guilabel> button</para></listitem> + <listitem><para>Select the font and size you wish to use</para></listitem> + <listitem><para>Click <guibutton>Ok</guibutton></para></listitem> + </orderedlist> + + </sect2> + + </sect1> + +<!-- ============= Dictionary Applet ======================== --> + <sect1 id="mate-dictionary-applet"> + <title>The &applet;</title> + + <para>The <application>&app;</application> application comes with a + panel applet, the <application>&applet;</application>. You can add + the <application>&applet;</application> applet to a panel and look + up words in dictionaries.</para> + + <figure id="mate-dictionary-applet-fig"> + <title>&applet; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-applet.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows &applet;.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + +<!-- ============= Dictionary Applet Start ================== --> + <sect2 id="mate-dictionary-applet-start"> + <title>To Start &applet;</title> + + <para>To add <application>&applet;</application> to a panel, right-click + on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. + Select &applet; in the <application>Add to the panel</application> + dialog, then click <guibutton>OK</guibutton>.</para> + + </sect2> + +<!-- ============= Dictionary Applet Start ================== --> + <sect2 id="mate-dictionary-applet-usage"> + <title>Using the &applet;</title> + + <para>To look up a word, type it into the <guilabel>entry field</guilabel>, + and press <keycap>Enter</keycap> or right-click on the dictionary icon + and then choose <guimenuitem>Look up</guimenuitem>. + </para> + + <para>If some definition for the word was found, a window will appear, + with the text of the definitions:</para> + + <figure id="mate-dictionary-applet-window-fig"> + <title>&applet; Window</title> + <screenshot> + <mediaobject> + <imageobject> + <imagedata fileref="figures/mate-dictionary-applet-window.png" format="PNG"/> + </imageobject> + <textobject><phrase>Shows &applet; main window.</phrase></textobject> + </mediaobject> + </screenshot> + </figure> + + <para>Click <guibutton>Save</guibutton> to save the definitions to a + text file. Click <guibutton>Print</guibutton> to print the definitions. + Click <guibutton>Clear</guibutton> to clear the definitions.</para> + + <para>You can make the window disappear by left-clicking on the dictionary + icon or by pressing <keycap>Esc</keycap>.</para> + + </sect2> + + <sect2 id="mate-dictionary-applet-preferences"> + <title>Preferences</title> + + <para>To configure the <application>&applet;</application>, right-click on + the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>.</para> + + <para>The <guilabel>Preferences</guilabel> dialog is the same used by + the <application>&app;</application> application, so refer to + <xref linkend="mate-dictionary-preferences"/></para> + + </sect2> + + </sect1> + +</article> diff --git a/mate-dictionary/help/ChangeLog b/mate-dictionary/help/ChangeLog new file mode 100644 index 00000000..d749b57e --- /dev/null +++ b/mate-dictionary/help/ChangeLog @@ -0,0 +1,211 @@ +2009-04-10 Simos Xenitellis <[email protected]> + + * el/el.po: Updated Greek translation (Fotis Tsamis). + +2009-03-27 Simos Xenitellis <[email protected]> + + * el/figures/mate-dictionary-applet.png: Deleted duplicated + screenshot + +2009-03-19 Jorge Gonzalez <[email protected]> + + * es/figures/mate-dictionary-applet.png: Deleted duplicated + screenshot + +2009-02-17 Inaki Larranaga Murgoitio <[email protected]> + + * eu/figures/: Added image in Basque language. Images are: + mate-dictionary-add-source.png + mate-dictionary-application.png + mate-dictionary-find.png + mate-dictionary-preferences-print.png + mate-dictionary-preferences-source.png + mate-dictionary-applet-window.png + mate-dictionary-applet.png + mate-dictionary-lookup.png + +2009-02-16 Inaki Larranaga Murgoitio <[email protected]> + + * eu/eu.po: Added Basque translation. + * Makefile.am: Added 'eu' to DOC_LINGUAS. + +2008-09-20 Mario Blättermann <[email protected]> + + * de/de.po: Added German translation. + * de/figures/*.png: + * Makefile.am: Added de to DOC_LINGUAS + +2008-06-25 Ilkka Tuohela <<[email protected]>> + + * fi/fi.po: Added Finnish documentation by Jukka Heikkilä. + * fi/figures/*.png: + * Makefile.am: Added fi to DOC_LINGUAS + +2008-03-09 Jorge Gonzalez <[email protected]> + + * es/es.po: Updated Spanish translation + * es/figures/*.png: Updated screenshots + +2008-03-03 Luca Ferretti <[email protected]> + + * it.po: Updated Italian translation by Andrea Zagli. + +2008-01-09 Kjartan Maraas <[email protected]> + + * uk/uk.po: Remove a redundant tag that caused problems + with make check. Reported by Gilles Dartiguelongue. + Closes bug #467920. + +2007-10-14 Yannig Marchegay <[email protected]> + + * Makefile.am: Added 'oc' to ALL_LINGUAS. + +2007-06-02 Jordi Mas <[email protected]> + + * ca/ca.po: Added Catalan translation. + * Makefile.am: Added ca to DOC_LINGUAS + +2007-04-22 Jorge gonzalez <[email protected]> + + * /es/es.po: Updated spanish translation + +2007-03-13 Maxim Dziumanenko <[email protected]> + + * uk.po: Update Ukrainian translation + +2007-03-12 David Lodge <[email protected]> + + * en_GB/en_GB.po: Added (British) English translation. + * Makefile.am: Added en_GB to DOC_LINGUAS + +2007-03-03 Luca Ferretti <[email protected]> + + * it/figures/*png: Added translated figures for Italian manual + +2007-03-03 Luca Ferretti <[email protected]> + + * Makefile.am: + * it/it.po: Added Italian translation by Andrea Zagli. + +2007-01-21 Nickolay V. Shmyrev <[email protected]> + + * ru/ru.po: Updated Russian translation. + +2006-12-27 Daniel Nylander <[email protected]> + + * sv/sv.po: Updated Swedish translation. + * sv/figures/*png: Added screenshots. + +2006-09-04 Nikos Charonitakis <[email protected]> + + * el/el.po: Updated Greek translation. + +2006-08-22 Francisco Javier F. Serrador <[email protected]> + + * es/es.po: Updated Spanish translation. + * es/figures: Added screenshots. + +2006-08-17 Christophe Bliard <[email protected]> + + * fr/fr.po: Added French translation. + * Makefile.am: added fr to DOC_LINGUAS + +2006-08-02 Francisco Javier F. Serrador <[email protected]> + + * es/es.po: Updated Spanish translation. + +2006-07-27 Francisco Javier F. Serrador <[email protected]> + + * es/es.po: Updated Spanish translation. + +2006-07-23 Daniel Nylander <[email protected]> + + * sv/sv.po: Updated Swedish translation. + +2006-07-07 Nikos Charonitakis <[email protected]> + + * el.po: Updated Greek translation. + +2006-07-05 Nikos Charonitakis <[email protected]> + + * el/el.po: Added Greek translation. + * Makefile.am: added el to DOC_LINGUAS + * el/figures/*.png: added localized pictures (Greek) + +2006-06-29 Daniel Nylander <[email protected]> + + * sv/sv.po: Added Swedish translation. + +2006-06-16 Francisco Javier F. Serrador <[email protected]> + + * es.po: Updated Spanish translation. + +2006-06-12 Nickolay V. Shmyrev <[email protected]> + + * Makefile.am: added ru to DOC_LINGUAS + * ru/ru.po: Added Russian translation. + +2006-03-29 German Poo-Caaman~o <[email protected]> + + * es/es.po: Fixed #336480 + +2006-03-17 Maxim Dziumanenko <[email protected]> + + * Makefile.am: added uk to DOC_LINGUAS + * uk/uk.po: + * uk/figures/*.png: added Ukrainian translation. + +2006-03-04 Emmanuele Bassi <[email protected]> + + * C/mate-dictionary.xml: added the note about using Esc to close the + applet's window. + +2006-01-16 Emmanuele Bassi <[email protected]> + + * C/mate-dictionary.xml: finished the first revision of the user's + manual. + +2005-12-31 Emmanuele Bassi <[email protected]> + + A C/figures/mate-dictionary-add-source.png + A C/figures/mate-dictionary-applet-window.png + A C/figures/mate-dictionary-preferences-print.png + A C/figures/mate-dictionary-preferences-source.png + + * C/figures/*: add new figures for the manual. + + * C/mate-dictionary.xml: fix find buttons name. + +2005-12-31 Emmanuele Bassi <[email protected]> + + A C/figures/mate-dictionary-find.png + A C/figures/mate-dictionary-lookup.png + D C/figures/mate-dictionary-preferences-1.png + D C/figures/mate-dictionary-preferences-2.png + + * C/mate-dictionary.xml: first rough version of the manual layout. + +2005-12-21 Dennis Cranston <[email protected]> + + * C/mate-dictionary.xml: Fix bug #318992, update the scrollkeeper + description. + +2005-12-07 Emmanuele Bassi <[email protected]> + + * C/mate-dictionary.xml: add a stub user's manual, so that + mate-doc-utils won't complain about an empty file + + * C/figures/mate-dictionary-application.png: add image + +2005-12-07 Emmanuele Bassi <[email protected]> + + * C/mate-dictionary.xml: fix stupid typo in the filename. + +2005-12-07 Emmanuele Bassi <[email protected]> + + * mate-dictionary.omf.in: ad OMF template + + * Makefile.am: add mate-doc-utils Makefile template + + * C/figures, C/mate-dictionary.xml, C/legal.xml: add documentation + stub files and directories. diff --git a/mate-dictionary/help/Makefile.am b/mate-dictionary/help/Makefile.am new file mode 100644 index 00000000..2747bb68 --- /dev/null +++ b/mate-dictionary/help/Makefile.am @@ -0,0 +1,8 @@ +include $(top_srcdir)/mate-doc-utils.make +dist-hook: doc-dist-hook + +DOC_MODULE = mate-dictionary +DOC_ENTITIES = legal.xml +DOC_INCLUDES = + +DOC_LINGUAS = ca cs da de el en_GB es eu fi fr it oc ru sv uk zh_CN diff --git a/mate-dictionary/help/ca/ca.po b/mate-dictionary/help/ca/ca.po new file mode 100644 index 00000000..f9c04254 --- /dev/null +++ b/mate-dictionary/help/ca/ca.po @@ -0,0 +1,445 @@ +msgid "" +msgstr "" +"Project-Id-Version: dictionary\n" +"POT-Creation-Date: 2006-12-31 14:14+0100\n" +"PO-Revision-Date: 2007-04-16 10:14+0100\n" +"Last-Translator: Gil Forcada <[email protected]>\n" +"Language-Team: catalan <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" +msgstr "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" +msgstr "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" +msgstr "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Manual del Diccionari" + +#: C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "El Diccionari us permet consultar definicions i l'ortografia correcta de paraules." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Projecte de documentació del MATE" + +#: C/mate-dictionary.xml:2(para) +msgid "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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +msgstr "Teniu permís per a copiar, distribuir i/o modificar aquest document, sota els termes de la Llicència de documentació lliure GNU (GFDL), versió 1.1 o qualsevol versió publicada posteriorment per la Free Software Foundation, sense seccions invariants, sense texts de portada i sense texts de contraportada. Podeu trobar una còpia de la GFDL en aquest <ulink type=\"help\" url=\"ghelp:fdl\">enllaç</ulink> o en el fitxer COPYING-DOCS distribuït amb aquest manual." + +#: C/mate-dictionary.xml:12(para) +msgid "This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the license to the manual, as described in section 6 of the license." +msgstr "Aquest manual forma part d'una col·lecció de manuals del MATE distribuïts sota la GFDL. Si voleu distribuir aquest manual independentment de la col·lecció, podeu fer-ho afegint una còpia de la llicència al manual, tal com es descriu a la secció 6 de la llicència." + +#: C/mate-dictionary.xml:19(para) +msgid "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters." +msgstr "Molts dels noms que les empreses utilitzen per a distingir els seus productes i serveis es consideren marques comercials. Quan aquests noms apareguin en qualsevol documentació del MATE, si els membres del Projecte de documentació del MATE han estat avisats pel que fa a les marques, els noms apareixeran en majúscules o amb les inicials en majúscules." + +#: C/mate-dictionary.xml:35(para) +msgid "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "EL DOCUMENT S'OFEREIX «TAL COM ÉS», SENSE CAP TIPUS DE GARANTIA, NI EXPLÍCITA NI IMPLÍCITA; AIXÒ INCLOU, SENSE LIMITAR-S'HI, LES GARANTIES QUE EL DOCUMENT O LA VERSIÓ MODIFICADA DEL DOCUMENT NO TINGUI DEFECTES, SIGUI COMERCIALITZABLE, SIGUI ADEQUAT PER A UN ÚS CONCRET O NO INFRINGEIXI CAP LLEI. TOT EL RISC PEL QUE FA A LA QUALITAT, EXACTITUD I RENDIMENT DEL DOCUMENT O LA VERSIÓ MODIFICADA DEL DOCUMENT ÉS VOSTRE. EN CAS QUE EL DOCUMENT RESULTÉS DEFECTUÓS EN QUALSEVOL ASPECTE, VÓS (NO PAS L'ESCRIPTOR INICIAL, L'AUTOR O CAP ALTRE COL·LABORADOR) ASSUMIU TOT EL COST DE MANTENIMENT, REPARACIÓ O CORRECCIÓ. AQUESTA RENÚNCIA DE GARANTIA CONSTITUEIX UNA PART ESSENCIAL D'AQUESTA LLICÈNCIA. NO S'AUTORITZA L'ÚS DE CAP DOCUMENT O VERSIÓ MODIFICADA DEL DOCUMENT EXCEPTE SOTA AQUESTA RENÚNCIA DE GARANTIA; I " + + +#: C/mate-dictionary.xml:55(para) +msgid "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES." +msgstr "EN CAP CAS I SOTA CAP INTERPRETACIÓ LEGAL, JA SIGUI PER AGREUJAMENT (INCLOENT-HI LA NEGLIGÈNCIA), CONTRACTE O ALTRE CAS, L'AUTOR, L'ESCRIPTOR ORIGINAL, QUALSEVOL DELS COL·LABORADORS O DISTRIBUÏDORS DEL DOCUMENT O UNA VERSIÓ MODIFICADA DEL DOCUMENT NI CAP PROVEÏDOR D'AQUESTES PARTS NO SERAN RESPONSABLES DAVANT DE NINGÚ PER CAP DANY DIRECTE, INDIRECTE, ESPECIAL, ACCIDENTAL O CONSECUTIU DE QUALSEVOL TIPUS; AIXÒ INCLOU, SENSE LIMITAR-S'HI, ELS DANYS PER PÈRDUA DE CLIENTS, INTERRUPCIONS DE LA FEINA, FALLADA O MALFUNCIONAMENT DE L'ORDINADOR, O QUALSEVOL ALTRA PÈRDUA O DANY RELACIONAT AMB L'ÚS DEL DOCUMENT I LES VERSIONS MODIFICADES DEL DOCUMENT, FINS I TOT SI S'HA INFORMAT AQUESTA PART DE LA POSSIBILITAT D'AQUESTS DANYS." + +#: C/mate-dictionary.xml:28(para) +msgid "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: <placeholder-1/>" +msgstr "EL DOCUMENT I LES VERSIONS MODIFICADES DEL DOCUMENT S'OFEREIXEN SOTA ELS TERMES DE LA LLICÈNCIA DE DOCUMENTACIÓ LLIURE DE GNU, TENINT EN COMPTE QUE: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Manual del Diccionari (Versió 1.0.0)" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Gener del 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Aquest manual descriu la versió 2.14.0 del Diccionari." + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Comentaris" + +#: C/mate-dictionary.xml:91(para) +msgid "To report a bug or make a suggestion regarding the Dictionary application or this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "Per a informar d'un error o fer un suggeriment sobre l'aplicació Diccionari o aquest manual, seguiu les indicacions de la <ulink url=\"ghelp:mate-feedback\" type=\"help\">Pàgina de suggeriments del MATE</ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Diccionari" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Introducció" + +#: C/mate-dictionary.xml:109(para) +msgid "The <application>Dictionary</application> application enables you to search words and terms on a dictionary source." +msgstr "L'aplicació <application>Diccionari</application> us permet cercar paraules i termes en un diccionari." + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Primers passos" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Per a iniciar el Diccionari" + +#: C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "Podeu iniciar el <application>Diccionari</application> de les maneres següents:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menú <guimenu>Aplicacions</guimenu>" + +#: C/mate-dictionary.xml:129(para) +msgid "Choose <menuchoice><guisubmenu>Accessories</guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "Escolliu <menuchoice><guisubmenu>Accessoris</guisubmenu><guimenuitem>Diccionari</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Línia d'ordres" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Executeu l'ordre següent: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "Un cop iniciat es mostra la finestra del <application>Diccionari</application>:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Finestra del diccionari" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Mostra la finestra principal del diccionari." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Utilització" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Consulta d'una paraula" + +#: C/mate-dictionary.xml:168(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel> and press <keycap>Enter</keycap>." +msgstr "Per a consultar una paraula, escriviu-la en el <guilabel>camp d'entrada</guilabel> i premeu <keycap>Retorn</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "If some definition for the word is found, it will appear inside the main window area:" +msgstr "Si es troba alguna definició de la paraula, es mostrarà dins de l'àrea de finestra principal:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Mostra una definició dins de la finestra principal del Diccionari." + +#: C/mate-dictionary.xml:186(para) +msgid "Otherwise, an error dialog will appear, with a message explaining the nature of the error." +msgstr "En cas contrari, es mostrarà un diàleg d'error amb un missatge explicant-ne el motiu." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Desar els resultats d'una consulta" + +#: C/mate-dictionary.xml:194(para) +msgid "To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialog, then click <guibutton>Save</guibutton>." +msgstr "Per a desar els resultats d'una consulta, escolliu <menuchoice><guimenu>Fitxer</guimenu><guimenuitem>Desa una còpia</guimenuitem></menuchoice>. Introduïu un nom per al fitxer en el diàleg <guilabel>Desa una còpia</guilabel> i després feu clic a <guibutton>Desa</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Imprimir dels resultats de la consulta" + +#: C/mate-dictionary.xml:201(para) +msgid "To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "Per a imprimir els resultats d'una consulta, escolliu <menuchoice><guimenu>Fitxer</guimenu><guimenuitem>Imprimeix</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "Inside the <guilabel>Print</guilabel> dialog you can select the printer to use, the paper format, the number of copies." +msgstr "A dintre del diàleg <guilabel>imprimeix</guilabel> podeu seleccionar l'impressora a utilitzar, el format del paper i el nombre de còpies." + +#: C/mate-dictionary.xml:206(para) +msgid "To see a preview of what will be printed, click <guibutton>Preview</guibutton>." +msgstr "Per a veure una previsualització del que s'imprimirà, feu clic a <guibutton>previsualitza</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Per a imprimir feu clic a <guibutton>Imprimeix</guibutton>." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Cerca text" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Mostra la subfinestra de cerca del Diccionari dins de la finestra principal." + +#: C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "Per a cercar text entre els resultats d'una consulta, seguiu els passos següents:" + +#: C/mate-dictionary.xml:233(para) +msgid "Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "Escolliu <menuchoice><guimenu>Edita</guimenu><guimenuitem>Cerca</guimenuitem></menuchoice> perquè es mostri la subfinestra de <guilabel>Cerca</guilabel>." + +#: C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "Escriviu el text que voleu cercar dins de l'entrada <guilabel>Cerca</guilabel>." + +#: C/mate-dictionary.xml:237(para) +msgid "To find the next occurrence of the text, click <guibutton>Next</guibutton>. To find the previous occurrence of the text, click <guibutton>Previous</guibutton>." +msgstr "Per a cercar la següent coincidència del text, feu clic a <guibutton>Següent</guibutton>. Per a cercar l'ocurrència anterior del text feu clic a <guibutton>Anterior</guibutton>." + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Preferències" + +#: C/mate-dictionary.xml:250(para) +msgid "To change the <application>Dictionary</application> application preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>." +msgstr "Per a canviar les preferències de l'aplicació <application>Diccionari</application>, escolliu <menuchoice><guimenu>Edita</guimenu><guimenuitem>Preferències</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Fonts del Diccionari" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Mostra la pestanya de fonts del diàleg de preferències." + +#: C/mate-dictionary.xml:269(para) +msgid "To change the dictionary source used to look up words, select the desired source from the list." +msgstr "Per a canviar la font del diccionari on es fan les consultes de paraules, seleccioneu la font desitjada de la llista." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Afegir una font nova" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Mostra el diàleg d'afegir una font nova." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Per a afegir una font de diccionari nova, seguiu els passos següents:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Feu clic al botó <guibutton>Afegeix</guibutton>" + +#: C/mate-dictionary.xml:293(para) +msgid "Edit the name of the new source inside the <guilabel>Description</guilabel> entry" +msgstr "Edita el nom de la font nova a l'entrada <guilabel>Descripció</guilabel>" + +#: C/mate-dictionary.xml:294(para) +msgid "Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box" +msgstr "Canvieu el tipus de transport de la font nova amb el quadre combinat <guilabel>Transport</guilabel>" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Editeu els atributs de la font nova" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Feu clic a <guibutton>Afegeix</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "Different source transport types uses different attributes. This is the list of available attributes per transport type:" +msgstr "Cada tipus de transport de font fa servir diferents atributs. Aquesta és una llista dels atributs disponibles per a cada tipus de transport:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transport" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Atributs" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Servidor del diccionari" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Nom del servidor: el nom del servidor del diccionari" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Port: el port del servidor del diccionari" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Suprimir una font" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Per a suprimir una font de diccionari, seguiu els passos següents:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Seleccioneu la font que voleu suprimir" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Feu clic al botó <guibutton>Suprimeix</guibutton>" + +#: C/mate-dictionary.xml:335(para) +msgid "If you remove a dictionary source it will be permanently deleted from the list of available sources. Also, as some sources might be defined system-wide you may actually not be able to remove them unless you have the right ownership privileges." +msgstr "Si suprimiu una font de diccionari se suprimirà permanentment de la llista de fonts disponibles. A més a més, com que algunes fonts poden estar definides per a tot el sistema, no podreu suprimir aquestes fonts si no és que teniu permisos de propietari." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Opcions d'impressió" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Mostra la pestanya d'impressió en el diàleg de preferències." + +#: C/mate-dictionary.xml:358(para) +msgid "If you want to change the font name and size used when printing, perform the following steps:" +msgstr "Si voleu canviar el nom del tipus de lletra i la mida que s'utilitzarà per a imprimir, seguiu els passos següents:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Feu clic al botó <guilabel>Tipus de lletra d'impressió</guilabel>" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Seleccioneu el tipus de lletra i la mida que voleu utilitzar" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Feu clic a <guibutton>D'acord</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "La miniaplicació del Diccionari" + +#: C/mate-dictionary.xml:375(para) +msgid "The <application>Dictionary</application> application comes with a panel applet, the <application>Dictionary Applet</application>. You can add the <application>Dictionary Applet</application> applet to a panel and look up words in dictionaries." +msgstr "L'aplicació <application>Diccionari</application> incorpora una miniaplicació per al quadre, la <application>miniaplicació del Diccionari</application>. Podeu afegir la miniaplicació <application>miniaplicació del Diccionari</application> a un quadre i consultar paraules als diccionaris." + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Finestra de la miniaplicació del Diccionari" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Mostra la miniaplicació del Diccionari." + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Per a iniciar la miniaplicació del Diccionari" + +#: C/mate-dictionary.xml:397(para) +msgid "To add <application>Dictionary Applet</application> to a panel, right-click on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select Dictionary Applet in the <application>Add to the panel</application> dialog, then click <guibutton>OK</guibutton>." +msgstr "Per a afegir al quadre la <application>miniaplicació del Diccionari</application>, feu clic amb el botó secundari en el quadre i escolliu <guimenuitem>Afegeix al quadre</guimenuitem>. Seleccioneu la miniaplicació del Diccionari en el diàleg d'<application>Afegeix al quadre</application>, llavors feu clic a <guibutton>D'acord</guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Utilització de la miniaplicació del Diccionari" + +#: C/mate-dictionary.xml:408(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel>, and press <keycap>Enter</keycap> or right-click on the dictionary icon and then choose <guimenuitem>Look up</guimenuitem>." +msgstr "Per a consultar una paraula, escriviu-la en el <guilabel>camp d'entrada</guilabel>, i premeu <keycap>Retorn</keycap> o feu clic en la icona del diccionari i després escolliu <guimenuitem>Consulta el text seleccionat</guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "If some definition for the word was found, a window will appear, with the text of the definitions:" +msgstr "Si es troba alguna definició de la paraula, apareixerà una finestra amb el text de les definicions:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Mostra la finestra principal de la miniaplicació del Diccionari" + +#: C/mate-dictionary.xml:428(para) +msgid "Click <guibutton>Save</guibutton> to save the definitions to a text file. Click <guibutton>Print</guibutton> to print the definitions. Click <guibutton>Clear</guibutton> to clear the definitions." +msgstr "Feu clic a <guibutton>Desa</guibutton> per a desar les definicions a un fitxer de text. Feu clic a <guibutton>Imprimeix</guibutton> per a imprimir les definicions. Feu clic a <guibutton>Neteja</guibutton> per a netejar les definicions." + +#: C/mate-dictionary.xml:432(para) +msgid "You can make the window disappear by left-clicking on the dictionary icon or by pressing <keycap>Esc</keycap>." +msgstr "Podeu fer que la finestra desaparegui fent clic en la icona del diccionari, o bé, prement <keycap>Esc</keycap>." + +#: C/mate-dictionary.xml:440(para) +msgid "To configure the <application>Dictionary Applet</application>, right-click on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "Per a configurar la <application>miniaplicació del Diccionari</application>, feu clic amb el botó secundari en la icona del diccionari i després escolliu <guimenuitem>Preferències</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "The <guilabel>Preferences</guilabel> dialog is the same used by the <application>Dictionary</application> application, so refer to <xref linkend=\"mate-dictionary-preferences\"/>" +msgstr "El diàleg de <guilabel>Preferències</guilabel> és el mateix que l'aplicació <application>Diccionari</application>, vegeu <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Gil Forcada <[email protected]> 2007" + diff --git a/mate-dictionary/help/cs/cs.po b/mate-dictionary/help/cs/cs.po new file mode 100644 index 00000000..d8960df4 --- /dev/null +++ b/mate-dictionary/help/cs/cs.po @@ -0,0 +1,465 @@ +# Czech translation of mate-utils help. +# Copyright (C) 2009 the author(s) of mate-utils. +# This file is distributed under the same license as the mate-utils help. +# +# Marek Černocký <[email protected]>, 2009. +# Petr Kovar <[email protected]>, 2009. +msgid "" +msgstr "" +"Project-Id-Version: mate-utils mate-2-28\n" +"POT-Creation-Date: 2009-06-29 09:58+0000\n" +"PO-Revision-Date: 2009-07-12 23:23+0200\n" +"Last-Translator: Petr Kovar <[email protected]>\n" +"Language-Team: Czech <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Poedit-Language: Czech\n" +"X-Poedit-Country: CZECH REPUBLIC\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Generator: Lokalize 0.3\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "@@image: 'figures/mate-dictionary-application.png'; md5=335fa0a0fcc45db37b6dcfc79b992897" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "@@image: 'figures/mate-dictionary-lookup.png'; md5=5c386330936c55b9052f98ca6b413252" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "@@image: 'figures/mate-dictionary-find.png'; md5=a5fea0592d25b395cd4cc252e219a1e7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" +msgstr "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=23f819db7cbdf82552043594c8643745" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" +msgstr "@@image: 'figures/mate-dictionary-add-source.png'; md5=6afca3c7cece1b4ebad129b95927d95b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=8ac68f214b425f343c5f715c7fe7cabf" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" +msgstr "@@image: 'figures/mate-dictionary-applet.png'; md5=35a186e4d809cb17e3958588cef24e59" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "@@image: 'figures/mate-dictionary-applet-window.png'; md5=6c130e2cd5b375c2db663de428076d0f" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Příručka ke Slovníku" + +#: C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Slovník vám umožňuje vyhledávat definice a správnou výslovnost slov." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) +#: C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) +#: C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Dokumentační projekt MATE" + +#: C/mate-dictionary.xml:2(para) +msgid "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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +msgstr "Je povoleno kopírovat, šířit a/nebo upravovat tento dokument za podmínek GNU Free Documentation License, verze 1.1 nebo jakékoli další verze vydané nadací Free Software Foundation; bez neměnných oddílů, bez textů předních desek a bez textů zadních desek. Kopie této licence je zahrnuta v oddílu jménem <ulink type=\"help\" url=\"ghelp:fdl\">GNU Free Documentation License</ulink> nebo v souboru COPYING-DOCS dodávaném s touto příručkou." + +#: C/mate-dictionary.xml:12(para) +msgid "This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the license to the manual, as described in section 6 of the license." +msgstr "Tato příručka je součástí kolekce příruček MATE, distribuovaných pod licencí GNU FDL. Pokud chcete tento dokument šířit odděleně od kolekce, musíte přiložit kopii licence dle popisu v sekci 6 dané licence." + +#: C/mate-dictionary.xml:19(para) +msgid "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters." +msgstr "Mnoho užívaných jmen určených k zviditelnění produktů nebo služeb jsou ochranné známky. Na místech, kde jsou tato jména v dokumentaci užita a členové Dokumentačního projektu MATE jsou si vědomi skutečnosti, že se jedná o ochrannou známku, je takové jméno psáno velkými písmeny celé nebo s velkým písmenem na začátku." + +#: C/mate-dictionary.xml:35(para) +msgid "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "DOKUMENT JE POSKYTOVÁN V PODOBĚ „JAK JE“ BEZ ZÁRUKY V JAKÉKOLIV PODOBĚ, NEPOSKYTUJÍ SE ANI ODVOZENÉ ZÁRUKY, ZÁRUKY, ŽE DOKUMENT, NEBO JEHO UPRAVENÁ VERZE, JE BEZCHYBNÝ NEBO ZÁRUKY PRODEJNOSTI, VHODNOSTI PRO URČITÝ ÚČEL NEBO NEPORUŠENOSTI. RIZIKO NEKVALITY, NEPŘESNOSTI A ŠPATNÉHO PROVEDENÍ DOKUMENTU, NEBO JEHO UPRAVENÉ VERZE, LEŽÍ NA VÁS. POKUD KVŮLI TOMUTO DOKUMENTU, NEBO JEHO UPRAVENÉ VERZI, NASTANE PROBLÉM, VY (NIKOLIV PŮVODNÍ AUTOR NEBO JAKÝKOLIV PŘISPĚVATEL) PŘEBÍRÁTE JAKÉKOLIV NÁKLADY ZA NUTNÉ ÚPRAVY, OPRAVY ČI SLUŽBY. TOTO PROHLÁŠENÍ O ZÁRUCE PŘEDSTAVUJE ZÁKLADNÍ SOUČÁST TÉTO LICENCE. BEZ TOHOTO PROHLÁŠENÍ NENÍ, PODLE TÉTO DOHODY, POVOLENO UŽÍVÁNÍ ANI ÚPRAVY TOHOTO DOKUMENTU; DÁLE" + +#: C/mate-dictionary.xml:55(para) +msgid "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES." +msgstr "ZA ŽÁDNÝCH OKOLNOSTÍ A ŽÁDNÝCH PRÁVNÍCH PŘEDPOKLADŮ, AŤ SE JEDNÁ O PŘEČIN (VČETNĚ NEDBALOSTNÍCH), SMLOUVU NEBO JINÉ, NENÍ AUTOR, PŮVODNÍ PISATEL, KTERÝKOLIV PŘISPĚVATEL NEBO KTERÝKOLIV DISTRIBUTOR TOHOTO DOKUMENTU NEBO UPRAVENÉ VERZE DOKUMENTU NEBO KTERÝKOLIV DODAVATEL NĚKTERÉ Z TĚCHTO STRAN ODPOVĚDNÝ NĚJAKÉ OSOBĚ ZA PŘÍMÉ, NEPŘÍMÉ, SPECIÁLNÍ, NAHODILÉ NEBO NÁSLEDNÉ ŠKODY JAKÉHOKOLIV CHARAKTERU, VČETNĚ, ALE NEJEN, ZA POŠKOZENÍ ZE ZTRÁTY DOBRÉHO JMÉNA, PŘERUŠENÍ PRÁCE, PORUCHY NEBO NESPRÁVNÉ FUNKCE POČÍTAČE NEBO JINÉHO A VŠECH DALŠÍCH ŠKOD NEBO ZTRÁT VYVSTÁVAJÍCÍCH Z NEBO VZTAHUJÍCÍCH SE K POUŽÍVÁNÍ TOHOTO DOKUMENTU NEBO UPRAVENÝCH VERZÍ DOKUMENTU, I KDYŽ BY TAKOVÁTO STRANA BYLA INFORMOVANÁ O MOŽNOSTI TAKOVÉHOTO POŠKOZENÍ." + +#: C/mate-dictionary.xml:28(para) +msgid "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: <placeholder-1/>" +msgstr "DOKUMENT A JEHO UPRAVENÉ VERZE JSOU ŠÍŘENY V SOULADU SE ZNĚNÍM LICENCE GNU FREE DOCUMENTATION LICENSE S NÁSLEDUJÍCÍM USTANOVENÍM: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Příručka V1.0.0 ke Slovníku" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Leden 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Tato příručka popisuje aplikaci Slovník ve verzi 2.14.0" + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Ohlasy" + +#: C/mate-dictionary.xml:91(para) +msgid "To report a bug or make a suggestion regarding the Dictionary application or this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "Pokud chcete oznámit chybu nebo navrhnout vylepšení vztahující se k aplikaci Slovník nebo této příručce, postupujte dle instrukcí na stránce <ulink url=\"ghelp:mate-feedback\" type=\"help\">Stránka s ohlasy na MATE</ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Slovník" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Úvod" + +#: C/mate-dictionary.xml:109(para) +msgid "The <application>Dictionary</application> application enables you to search words and terms on a dictionary source." +msgstr "Aplikace <application>Slovník</application> vám umožňuje vyhledávat slova a výrazy ve slovníkových zdrojích." + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Začínáme" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Spuštění Slovníku" + +#: C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "Aplikaci <application>Slovník</application> můžete spustit následujícími způsoby:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Nabídka <guimenu>Aplikace</guimenu>" + +#: C/mate-dictionary.xml:129(para) +msgid "Choose <menuchoice><guisubmenu>Accessories</guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "Zvolte <menuchoice><guisubmenu>Příslušenství</guisubmenu><guimenuitem>Slovník</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Příkazový řádek" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Spusťte následující příkaz: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "Jakmile se spustí, zobrazí se okno <application>Slovník</application>:" + +#: C/mate-dictionary.xml:146(title) +#: C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) +#: C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) +#: C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Okno" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Ukazuje hlavní okno aplikace Slovník." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Použití" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Vyhledávání slov" + +#: C/mate-dictionary.xml:168(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel> and press <keycap>Enter</keycap>." +msgstr "Slovo vyhledáte tak, že jej zadáte do vstupního pole <guilabel>Hledat</guilabel> a stisknete <keycap>Enter</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "If some definition for the word is found, it will appear inside the main window area:" +msgstr "Pokud se nalezne nějaká definice zadaného slova, objeví se uvnitř oblasti hlavního okna" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Ukazuje definici slova uvnitř hlavního okna Slovníku." + +#: C/mate-dictionary.xml:186(para) +msgid "Otherwise, an error dialog will appear, with a message explaining the nature of the error." +msgstr "V opačném případě se objeví chybový dialog se zprávou vysvětlující příčiny chyby." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Ukládání výsledků hledání" + +#: C/mate-dictionary.xml:194(para) +msgid "To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialog, then click <guibutton>Save</guibutton>." +msgstr "Pokud chcete výsledky vyhledávání uložit, zvolte <menuchoice><guimenu>Soubor</guimenu><guimenuitem>Uložit kopii</guimenuitem></menuchoice>. V dialogové okně <guilabel>Uložit kopii</guilabel> zadejte název pro soubor a klikněte na <guibutton>Uložit</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Tisk výsledků hledání" + +#: C/mate-dictionary.xml:201(para) +msgid "To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "Pokud chcete výsledky vyhledávání vytisknout, zvolte <menuchoice><guimenu>Soubor</guimenu><guimenuitem>Tisk</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "Inside the <guilabel>Print</guilabel> dialog you can select the printer to use, the paper format, the number of copies." +msgstr "V dialogovém okně <guilabel>Tisk</guilabel> můžete zvolit, kterou tiskárnu chcete použít, formát papíru a počet kopií." + +#: C/mate-dictionary.xml:206(para) +msgid "To see a preview of what will be printed, click <guibutton>Preview</guibutton>." +msgstr "Na náhled, jak bude tisk vypadat, se podíváte kliknutím na <guibutton>Náhled tisku</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Kliknutím na tlačítko <guibutton>Tisk</guibutton> se tisk provede." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Hledání textu" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Ukazuje panel hledání ve slovníku uvnitř hlavního okna." + +#: C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "Pokud chcete najít text ve výsledcích vyhledávání, postupujte následovně:" + +#: C/mate-dictionary.xml:233(para) +msgid "Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "Zvolte <menuchoice><guimenu>Úpravy</guimenu><guimenuitem>Hledat</guimenuitem></menuchoice>, aby se zobrazil panel <guilabel>Hledání</guilabel>." + +#: C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "Text, který chcete najít, zadejte do pole <guilabel>Hledat</guilabel>." + +#: C/mate-dictionary.xml:237(para) +msgid "To find the next occurrence of the text, click <guibutton>Next</guibutton>. To find the previous occurrence of the text, click <guibutton>Previous</guibutton>." +msgstr "Pokud chcete najít další výskyt zadaného textu, klikněte na <guibutton>Následující</guibutton>. Pokud chcete najít předcházející výskyt zadaného textu, klikněte na <guibutton>Předchozí</guibutton>." + +#: C/mate-dictionary.xml:248(title) +#: C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Předvolby" + +#: C/mate-dictionary.xml:250(para) +msgid "To change the <application>Dictionary</application> application preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>." +msgstr "Pokud chcete změnit nastavení aplikace <application>Slovník</application>, použijte <menuchoice><guimenu>Úpravy</guimenu><guimenuitem>Předvolby</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Zdroje slovníků" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Ukazuje kartu Zdroj v dialogovém okně Předvolby slovníku." + +#: C/mate-dictionary.xml:269(para) +msgid "To change the dictionary source used to look up words, select the desired source from the list." +msgstr "Pokud chcete změnit zdroj slovníku používaného k vyhledávání slov, zvolte požadovaný zdroj v seznamu." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Přidání nového zdroje" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Ukazuje dialogové okno Přidat zdroj slovníku" + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Pokud chcete přidat nový zdroj slovníku, postupujte následovně:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Klikněte na tlačítko <guibutton>Přidat</guibutton>" + +#: C/mate-dictionary.xml:293(para) +msgid "Edit the name of the new source inside the <guilabel>Description</guilabel> entry" +msgstr "V poli <guilabel>Popis</guilabel> upravte název nového zdroje" + +#: C/mate-dictionary.xml:294(para) +msgid "Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box" +msgstr "Ve výběrovém seznamu <guilabel>Transport</guilabel> zvolte typ transportu nového zdroje" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Upravte atributy nového zdroje" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Klikněte na <guibutton>Přidat</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "Different source transport types uses different attributes. This is the list of available attributes per transport type:" +msgstr "Různé typy transportů ze zdrojů používají odlišné atributy. Zde je seznam dostupných atributů podle typu transportu:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transport" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Parametry" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Server se slovníkem" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Název počítače: název počítače hostujícího server se slovníkem" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Port: port serveru se slovníkem" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Odebrání zdroje" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Zdroj slovníku odstraníte ze seznamu pomocí následujícího postupu:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Vyberte zdroj, který si přejete ze seznamu odstranit" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Klikněte na tlačítko <guibutton>Odstranit</guibutton>" + +#: C/mate-dictionary.xml:335(para) +msgid "If you remove a dictionary source it will be permanently deleted from the list of available sources. Also, as some sources might be defined system-wide you may actually not be able to remove them unless you have the right ownership privileges." +msgstr "Pokud zdroj slovníku odstraníte, bude trvale vymazán ze seznamu dostupných zdrojů. Navíc, jelikož jsou některé zdroje definované pro celý systém, nebudete je moci odstranit, pokud nebudete mít oprávnění skutečného vlastníka." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Volby tisku" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Ukazuje kartu Vytisknout v dialogovém okně Předvolby slovníku." + +#: C/mate-dictionary.xml:358(para) +msgid "If you want to change the font name and size used when printing, perform the following steps:" +msgstr "Jestliže chcete změnit písmo a jeho velikost použité pro tisk, proveďte následující:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Klikněte na tlačítko <guilabel>Písmo pro tisk</guilabel>" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Vyberte si dle svého přání písmo a jeho velikost" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Klikněte na <guibutton>Ok</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Applet Hledat ve slovníku" + +#: C/mate-dictionary.xml:375(para) +msgid "The <application>Dictionary</application> application comes with a panel applet, the <application>Dictionary Applet</application>. You can add the <application>Dictionary Applet</application> applet to a panel and look up words in dictionaries." +msgstr "Aplikace <application>Slovník</application> se dodává spolu s appletem na panel <application>Hledání ve slovníku</application>. Můžete si applet <application>Hledání ve slovníku</application> přidat na panel a vyhledávat slova ve slovnících." + +#: C/mate-dictionary.xml:381(title) +#: C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Okno appletu Hledat ve slovníku" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Ukazuje applet Hledat ve slovníku." + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Spuštění appletu Slovník" + +#: C/mate-dictionary.xml:397(para) +msgid "To add <application>Dictionary Applet</application> to a panel, right-click on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select Dictionary Applet in the <application>Add to the panel</application> dialog, then click <guibutton>OK</guibutton>." +msgstr "Applet <application>Hledat ve slovníku</application> přidáte na panel tím, že na něj kliknete pravým tlačítkem a zvolíte <guimenuitem>Přidat na panel</guimenuitem>. V dialogovém okně <application>Přidat na panel</application> vyberete Hledat ve slovníku a kliknete na <guibutton>OK</guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Používání appletu Hledat ve slovníku" + +#: C/mate-dictionary.xml:408(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel>, and press <keycap>Enter</keycap> or right-click on the dictionary icon and then choose <guimenuitem>Look up</guimenuitem>." +msgstr "Když chcete vyhledat slovo, napíšete jej do <guilabel>vstupního pole</guilabel> a stisknete <keycap>Enter</keycap> nebo kliknete na ikonu slovníku a zvolíte <guimenuitem>Hledat vybraný text</guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "If some definition for the word was found, a window will appear, with the text of the definitions:" +msgstr "Pokud se podaří pro slovo najít nějakou definici, objeví se okno s textem definice:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Ukazuje hlavní okno appletu Slovník." + +#: C/mate-dictionary.xml:428(para) +msgid "Click <guibutton>Save</guibutton> to save the definitions to a text file. Click <guibutton>Print</guibutton> to print the definitions. Click <guibutton>Clear</guibutton> to clear the definitions." +msgstr "Klikněte na <guibutton>Uložit</guibutton> pro uložení definice do textového souboru. Na <guibutton>Tisk</guibutton> klikněte pro vytisknutí definici. A na <guibutton>Vymazat</guibutton> klikněte pro vymazání definice z okna." + +#: C/mate-dictionary.xml:432(para) +msgid "You can make the window disappear by left-clicking on the dictionary icon or by pressing <keycap>Esc</keycap>." +msgstr "Okno můžete skrýt kliknutím na ikonu slovníku nebo stiskem <keycap>Esc</keycap>." + +#: C/mate-dictionary.xml:440(para) +msgid "To configure the <application>Dictionary Applet</application>, right-click on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "Pokud chcete změnit nastavení <application>appletu Hledat ve slovníku</application>, klikněte pravým tlačítkem na ikoně slovníku a vyberte <guimenuitem>Předvolby</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "The <guilabel>Preferences</guilabel> dialog is the same used by the <application>Dictionary</application> application, so refer to <xref linkend=\"mate-dictionary-preferences\"/>" +msgstr "Objeví se dialogové okno <guilabel>Předvolby slovníku</guilabel>, které je stejné jako u aplikace <application>Slovník</application> a platí pro něj to stejné, co uvádí <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Marek Černocký <[email protected]>, 2009" + + diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-add-source.png b/mate-dictionary/help/cs/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..78542136 --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/cs/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..e1c06542 --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-applet.png b/mate-dictionary/help/cs/figures/mate-dictionary-applet.png Binary files differnew file mode 100644 index 00000000..9752916f --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-applet.png diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-application.png b/mate-dictionary/help/cs/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..cc110e2f --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-find.png b/mate-dictionary/help/cs/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..01eb865b --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-lookup.png b/mate-dictionary/help/cs/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..5ee640c4 --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/cs/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..43ba481a --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/cs/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/cs/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..4a059659 --- /dev/null +++ b/mate-dictionary/help/cs/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/da/da.po b/mate-dictionary/help/da/da.po new file mode 100644 index 00000000..55fdf882 --- /dev/null +++ b/mate-dictionary/help/da/da.po @@ -0,0 +1,713 @@ +# Danish translation for mate-utils. +# Copyright (C) 2010 mate-utils & Joe Hansen. +# This file is distributed under the same license as the mate-utils package. +# Joe Hansen ([email protected]), 2009, 2010. +# +# ordbog ved direkte opstart, men i panelprogram står der ordbogsopslag +# +msgid "" +msgstr "" +"Project-Id-Version: mate-utils master\n" +"POT-Creation-Date: 2010-02-04 00:36+0100\n" +"PO-Revision-Date: 2009-11-07 23:07+0200\n" +"Last-Translator: Joe Hansen <[email protected]>\n" +"Language-Team: Dansk-gruppen <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../C/legal.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Tilladelse er givet til at kopiere, distribuere og/eller ændre dette " +"dokument under betingelserne i GNU Free Documentation License (GFDL), " +"version 1.1 eller enhver senere version udgivet af Free Software Foundation; " +"uden invariante afsnit, forsidetekster, samt bagsidetekster. Du kan se en " +"kopi af GFDL her <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> eller i " +"filen COPYING-DOCS som distribueres sammen med denne manual." + +#: ../C/legal.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"Denne manual er en del af den samling af MATE-manualer som udgives under " +"GFDL. Hvis du ønsker at distribuere denne manuel adskilt fra samlingen, kan " +"du gøre dette ved at tilføje en kopi af licensen til manualen, som beskrevet " +"i afsnit 6 af licensen." + +#: ../C/legal.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"En stor del af de navne som anvendes af firmaer til at identificere deres " +"produkter og tjenester hævdes som værende varemærker. Hvor disse navne " +"fremgår i en hvilken som helst MATE-dokumentation, og medlemmerne af MATE-" +"dokumentationsprojeket er gjort opmærksom på disse varemærker, så er disse " +"navne vist med store bogstaver eller stort begyndelsesbogstav." + +#: ../C/legal.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"DETTE DOKUMENT GØRES TILGÆNGELIGT SÅDAN SOM DET ER, UDEN NOGEN FORM FOR " +"GARANTI, HVERKEN UDTALT ELLER ANTYDET, DERIBLANDT, UDEN BEGRÆNSNINGER, " +"GARANTIER OM AT DOKUMENTET ELLER ÆNDREDE VERSIONER AF DOKUMENTET ER FRIT FOR " +"DEFEKTER, PASSENDE TIL ET BESTEMT FORMÅL ELLER IKKE-KRÆNKENDE. DU HÆFTER " +"SELV FOR HELE RISIKOEN VEDRØRENDE KVALITET, KORREKTHED OG YDELSE FOR " +"DOKUMENTET ELLER ÆNDREDE VERSIONER AF DOKUMENTET. SKULLE ET DOKUMENT, ELLER " +"EN ÆNDRET VERSION AF ET DOKUMENT VISE SIG AT VÆRE DEFEKT PÅ EN HVILKEN SOM " +"HELST MÅDE, HÆFTER DU FOR BETALING FOR EVENTUEL NØDVENDIG SERVICE, " +"REPARATION ELLER KORREKTION (OG IKKE HVERKEN DEN OPRINDELIGE FORFATTER, " +"SKRIBENT ELLER NOGEN ANDEN BIDRAGYDER). DENNE ERKLÆRING OM GARANTIFORBEHOLD " +"ER EN ESSENTIEL DEL AF DENNE LICENS. INGEN BRUG AF NOGET DOKUMENT ELLER " +"ÆNDRET VERSION AF DOKUMENTET ER AUTORISERET HERUNDER BORTSET FRA DENNE " +"ANSVARSFRASKRIVELSE OG" + +#: ../C/legal.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"UNDER INGEN OMSTÆNDIGHEDER OG UNDER INGEN JURIDISK TEORI, UANSET OM DET ER " +"EN BEVIDST SKADENDE HANDLING (INKLUSIVE UFORSVARLIGHED) ELLER PÅ HVILKEN SOM " +"HELST ANDEN MÅDE, KAN FORFATTEREN, SKRIBENT, BIDRAGYDERE, DISTRIBUTØRER " +"ELLER LEVERANDØR AF DETTE DOKUMENT ELLER MODIFICEREDE VERSIONER GØRES " +"ANSVARLIG OVERFOR NOGEN PERSON FOR NOGEN DIREKTE, INDIREKTE, SPECIEL, " +"TILFÆLDIG ELLER FØLGENDE SKADE PÅFØRT NOGEN INKLUSIVE, UDEN BEGRÆNSNING, " +"SKADE SOM FØLGE AF TAB AF RYGTE, ARBEJDSSTOP, COMPUTERFEJL ELLER -SVIGT, " +"ELLER ENHVER ANDEN FORM FOR SKADE ELLER TAB SOM ER OPSTÅET I FORBINDELSE MED " +"BRUG AF DETTE DOKUMENT ELLER MODIFICEREDE VERSIONER HERAF, SELV HVIS EN " +"SÅDAN PART HAR VÆRET INFORMERET OM MULIGHEDEN FOR SÅDANNE SKADER." + +#: ../C/legal.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"DOKUMENTET OG ÆNDREDE VERSIONER AF DOKUMENTET STILLES TIL RÅDIGHED UNDER GNU " +"FREE DOCOMENTATION LICENSE MED FØLGENDE BETINGELSER: <placeholder-1/>" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: ../C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Ordbogsmanual" + +#: ../C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Ordbog gør, at du kan slå orddefinitioner og korrekt stavning op." + +#: ../C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: ../C/mate-dictionary.xml:35(holder) ../C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: ../C/mate-dictionary.xml:48(publishername) +#: ../C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "MATE-dokumentationsprojekt" + +#: ../C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: ../C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: ../C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: ../C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Manual for ordbogsopslag version 1.0.0" + +#: ../C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Denne manual beskriver version 2.14.0 af ordbog." + +#: ../C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Tilbagemeldinger" + +#: ../C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Hvis du ønsker at indrapportere en fejl eller komme med et forslag " +"vedrørende ordbog eller denne manual så følg vejledningen på siden <ulink " +"url=\"ghelp:user-guide?feedback-bugs\" type=\"help\">tilbagemeldinger " +"omkring MATE</ulink>." + +#: ../C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Ordbog" + +#: ../C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Indledning" + +#: ../C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"Programmet <application>Ordbog</application> gør det muligt for dig at søge " +"blandt ord og termer fra en ordbogskilde." + +#: ../C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Kom i gang" + +#: ../C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "For at starte ordbog" + +#: ../C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "Du kan starte <application>Ordbog</application> på følgende måder:" + +#: ../C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menuen <guimenu>Programmer</guimenu>" + +# Den her har jeg slet ikke !!!! +#: ../C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Vælg <menuchoice><guisubmenu>Tilbehør</guisubmenu><guimenuitem>Ordbog</" +"guimenuitem></menuchoice>." + +#: ../C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Kommandolinje" + +#: ../C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Udfør den følgende kommando: <command>mate-dictionary</command>" + +# her hedder programmet ordbog !!!! i paneldelen står der ordbogsopslag. +#: ../C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "Når startet vises vinduet <application>Ordbog</application>:" + +#: ../C/mate-dictionary.xml:146(title) ../C/mate-dictionary.xml:175(title) +#: ../C/mate-dictionary.xml:217(title) ../C/mate-dictionary.xml:258(title) +#: ../C/mate-dictionary.xml:278(title) ../C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Ordbogsvindue" + +#: ../C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Vis hovedvinduet for Ordbog." + +#: ../C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Brug" + +#: ../C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Slå et ord op" + +#: ../C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"For at slå et ord op tastes det i <guilabel>indtastningsfeltet</guilabel> " +"efterfulgt af <keycap>Retur</keycap>." + +#: ../C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" +"Hvis en definition på et ord findes, vil denne vises inden i hovedvinduets " +"område:" + +#: ../C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Viser en definition inden i ordbogens hovedvindue." + +#: ../C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "" +"Ellers vil en fejlbesked komme frem, med en besked der forklarer årsagen til " +"fejlen." + +#: ../C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Gem opslagsresultater" + +#: ../C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"For at gemme resultatet af et opslag vælges <menuchoice><guimenu>Fil</" +"guimenu><guimenuitem>Gem en kopi</guimenuitem></menuchoice>. Indtast et navn " +"på filen i vinduet <guilabel>Gem en kopi</guilabel>, og klik på " +"<guibutton>Gem</guibutton>." + +#: ../C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Udskriv opslagsresultater" + +#: ../C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"For at udskrive et opslagsresultat vælges <menuchoice><guimenu>Fil</" +"guimenu><guimenuitem>Udskriv</guimenuitem></menuchoice>." + +#: ../C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"I vinduet <guilabel>Udskriv</guilabel> kan du vælge den ønskede printer, " +"papirformatet og antallet af kopier." + +#: ../C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"For at se en forhåndsvisning af det udskrevne klikkes på " +"<guibutton>Forhåndsvisning</guibutton>." + +#: ../C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "For at udskrive klikkes på <guibutton>Udskriv</guibutton>." + +#: ../C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Find tekst" + +#: ../C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Viser ordbogens søgepanel inden i hovedvinduet." + +#: ../C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "For at finde tekst i resultaterne af et opslag gøres følgende:" + +#: ../C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Vælg <menuchoice><guimenu>Redigér</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> for at vise panelet <guilabel>Find</guilabel>." + +#: ../C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" +"Indtast teksten du ønsker at finde inden i indtastningsfeltet " +"<guilabel>Find</guilabel>." + +#: ../C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"For at finde den næste forekomst af teksten klikkes på <guibutton>Næste</" +"guibutton>. For at finde den forrige forekomst af teksten klikkes på " +"<guibutton>Forrige</guibutton>." + +#: ../C/mate-dictionary.xml:248(title) ../C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Indstillinger" + +#: ../C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"For at ændre programindstillingerne for <application>Ordbog</application> " +"vælges <menuchoice><guimenu>Redigér</guimenu><guimenuitem>Indstillinger</" +"guimenuitem></menuchoice>." + +#: ../C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Ordbogskilder" + +#: ../C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Viser kildefanebladet i indstillingsvinduet." + +#: ../C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "Vælg den kilde fra listen som ønskes brugt til at slå ord op med." + +#: ../C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Tilføjelse af en ny kilde" + +#: ../C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Viser vinduet Tilføj kilde." + +#: ../C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "For at tilføje en ny ordbogskilde gøres følgende:" + +#: ../C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Klip på knappen <guibutton>Tilføj</guibutton>" + +#: ../C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" +"Rediger navnet på den nye kilde inden i indtastningsfeltet " +"<guilabel>Beskrivelse</guilabel>" + +#: ../C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Ændre transportypen på den nye kilde med brug af valgboksen " +"<guilabel>Transport</guilabel>" + +#: ../C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Rediger attributterne på den nye kilde" + +#: ../C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Klik <guibutton>Tilføj</guibutton>" + +#: ../C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Forskellige kildetransporttyper anvender forskellige attributter. Dette er " +"listen over tilgængelige attributter per transporttype:" + +#: ../C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transport" + +#: ../C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Attributter" + +#: ../C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Ordbogsserver" + +#: ../C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Værtsnavn: Værtsnavnet på ordbogsserveren" + +#: ../C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Port: Porten for ordbogsserveren" + +#: ../C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Fjern en kilde" + +#: ../C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "For at fjerne en ordbogskilde, gøres følgende:" + +#: ../C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Vælg kilden du ønsker at fjerne" + +#: ../C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Klik på knappen <guibutton>Fjern</guibutton>" + +#: ../C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Hvis du fjerner en ordbogskilde, vil den permanent blive slettet fra listen " +"over tilgængelige kilder. Bemærk også at nogle kilder måske er generelt " +"defineret, og at du måske ikke kan fjerne dem uden at have de korrekte " +"ejerskabsprivilegier." + +# udskriftsindstillinger +#: ../C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Udskrivningsindstillinger" + +#: ../C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Viser udskrivningsfanebladet inden i indstillingsvinduet." + +#: ../C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Hvis du ønsker at ændre den brugte skrifttype og størrelse under udskrivning " +"så udfør de følgende trin:" + +#: ../C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Klik på knappen <guilabel>Udskriv skrifttype</guilabel>" + +#: ../C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Vælg skrifttypen og størrelse du ønsker at bruge" + +#: ../C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Klik <guibutton>O.k.</guibutton>" + +#: ../C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Ordbogspanelprogrammet" + +#: ../C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"Programmet <application>Ordbog</application> kommer med et panelprogram, " +"<application>Ordbogsopslag</application>. Du kan tilføje panelprogrammet " +"<application>Ordbogsopslag</application> til et panel og slå ord op i " +"ordbøger." + +#: ../C/mate-dictionary.xml:381(title) ../C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Vindue for ordbogsopslag" + +#: ../C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Viser panelprogrammet ordbogsopslag." + +#: ../C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "For at starte panelprogrammet ordbogsopslag" + +#: ../C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"For at tilføje <application>Ordbogsopslag</application> til et panel " +"højreklikkes på panelet, og der vælges <guimenuitem>Tilføj til panel</" +"guimenuitem>. Vælg ordbogsopslag i vinduet <application>Tilføj til panelet</" +"application> og klik på <guibutton>O.k.</guibutton>." + +#: ../C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Brug af panelprogrammet ordbogsopslag" + +#: ../C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"For at slå et ord op, tastes det i <guilabel>indtastningsfeltet</guilabel>, " +"og der trykkes på <keycap>Retur</keycap> eller højreklik på ordbogsikonet og " +"så vælge <guimenuitem>Slå op</guimenuitem>." + +#: ../C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Hvis en definition for ordet blev fundet, vil et vindue vise sig med teksten " +"på definitionerne:" + +#: ../C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Viser hovedvindue for panelprogrammet ordbogsopslag." + +#: ../C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Klik <guibutton>Gem</guibutton> for at gemme definitionerne til en tekstfil. " +"Klik <guibutton>Udskriv</guibutton> for at udskrive definitionerne. Klik " +"<guibutton>Ryd</guibutton> for at rydde definitionerne." + +#: ../C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Du får vinduet til at forsvinde ved at venstreklikke på ordbogsikonet eller " +"ved at trykke på <keycap>Esc</keycap>." + +#: ../C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"For at konfigurere <application>Ordbogsopslag</application>, højreklik på " +"ordbogsikonet, og vælg <uguimenuiten>Indstillinger</guimenuitem>." + +#: ../C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"Vinduet <guilabel>Indstillinger</guilabel> er det samme som brugt af " +"<application>Ordbog</application>, så se i <xref linkend=\"mate-dictionary-" +"preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2 +#: ../C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "" +"Joe Hansen, 2009-2010.\n" +"\n" +"Dansk-gruppen <[email protected]>\n" +"Mere info: http://www.dansk-gruppen.dk" + +#~ msgid "January 2005" +#~ msgstr "Januar 2005" diff --git a/mate-dictionary/help/de/de.po b/mate-dictionary/help/de/de.po new file mode 100644 index 00000000..8ab5744c --- /dev/null +++ b/mate-dictionary/help/de/de.po @@ -0,0 +1,711 @@ +# Mario Blättermann <[email protected]>, 2008. +msgid "" +msgstr "" +"Project-Id-Version: dictionary\n" +"POT-Creation-Date: 2008-09-20 04:11+0000\n" +"PO-Revision-Date: 2008-09-20 14:15+0200\n" +"Last-Translator: Mario Blättermann <[email protected]>\n" +"Language-Team: German <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: German\n" +"X-Poedit-Country: GERMANY\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "translated" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "translated" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "translated" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "translated" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "translated" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "translated" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "translated" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "translated" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Wörterbuch-Handbuch" + +#: C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "" +"Das Wörterbuch ermöglicht Ihnen das Nachschlagen von Definitionen und der " +"korrekten Schreibweise von Wörtern." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "MATE-Dokumentationsprojekt" + +#: C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in " +"the file COPYING-DOCS distributed with this manual." +msgstr "" +"Das vorliegende Dokument kann gemäß den Bedingungen der GNU Free " +"Documentation License (GFDL), Version 1.1 oder jeder späteren, von der Free " +"Software Foundation veröffentlichten Version ohne unveränderbare Abschnitte " +"sowie ohne Texte auf dem vorderen und hinteren Buchdeckel kopiert, verteilt " +"und/oder modifiziert werden. Eine Kopie der GFDL finden Sie unter diesem " +"<ulink type=\"help\" url=\"ghelp:fdl\">Link</ulink> oder in der mit diesem " +"Handbuch gelieferten Datei COPYING-DOCS." + +#: C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"Dieses Handbuch ist Teil einer Sammlung von MATE-Handbüchern, die unter der " +"GFDL veröffentlicht werden. Wenn Sie dieses Handbuch getrennt von der " +"Sammlung weiterverbreiten möchten, können Sie das tun, indem Sie eine Kopie " +"der Lizenz zum Handbuch hinzufügen, wie es in Abschnitt 6 der Lizenz " +"beschrieben ist." + +#: C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"Viele der Namen, die von Unternehmen verwendet werden, um ihre Produkte und " +"Dienstleistungen von anderen zu unterscheiden, sind eingetragene " +"Warenzeichen. An den Stellen, an denen diese Namen in einer MATE-" +"Dokumentation erscheinen, werden die Namen in Großbuchstaben oder mit einem " +"großen Anfangsbuchstaben geschrieben, wenn das MATE-Dokumentationsprojekt " +"auf diese Warenzeichen hingewiesen wird." + +#: C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK " +"AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED " +"VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION " +"PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY " +"CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR " +"CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS " +"LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS " +"AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"DIESES DOKUMENT WIRD »WIE VORLIEGEND« GELIEFERT, OHNE GARANTIEN IRGENDEINER " +"ART, SOWOHL AUSDRÜCKLICH GENANNTE ALS AUCH ANGEDEUTETE. DIES BEZIEHT SICH " +"AUCH OHNE EINSCHRÄNKUNG AUF GARANTIEN, DASS DIESES DOKUMENT ODER VERÄNDERTE " +"FASSUNGEN DIESES DOKUMENTS FREI VON HANDELSDEFEKTEN, FÜR EINEN BESTIMMTEN " +"ZWECK GEEIGNET IST ODER DASS ES KEINE RECHTE DRITTER VERLETZT. DAS VOLLE " +"RISIKO WAS QUALITÄT, GENAUIGKEIT UND LEISTUNG DES DOKUMENTS ODER VERÄNDERTE " +"FASSUNGEN DES DOKUMENTS LIEGT BEI IHNEN. SOLLTE EIN DOKUMENT ODER EINE " +"VERÄNDERTE FASSUNG DAVON FEHLER IRGENDEINER ART BEINHALTEN, TRAGEN SIE (NICHT " +"DER URSPRUNGSAUTOR, DER AUTOR ODER EIN MITWIRKENDER) DIE KOSTEN FÜR " +"NOTWENDIGE DIENSTLEISTUNGEN, REPARATUREN ODER FEHLERKORREKTUREN. DIESER " +"HAFTUNGSAUSSCHLUSS IST EIN ESSENZIELLER TEIL DIESER LIZENZ. DIE VERWENDUNG " +"EINES DOKUMENTS ODER EINER VERÄNDERTEN VERSION DES DOKUMENTS IST NICHT " +"GESTATTET AUßER UNTER BEACHTUNG DIESES HAFTUNGSAUSSCHLUSSES UND" + +#: C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR " +"ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY " +"CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK " +"STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR " +"LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"UNTER KEINEN UMSTÄNDEN UND AUF BASIS KEINER RECHTSGRUNDLAGE, EGAL OB DURCH " +"UNERLAUBTEN HANDLUNGEN (EINSCHLIEßLICH FAHRLÄSSIGKEIT), VERTRAG ODER " +"ANDERWEITIG KANN DER AUTOR, URSPRUNGSAUTOR, EIN MITWIRKENDER ODER EIN " +"VERTRIEBSPARTNER DIESES DOKUMENTS ODER EINER VERÄNDERTEN FASSUNG DES " +"DOKUMENTS ODER EIN ZULIEFERER EINER DIESER PARTEIEN, HAFTBAR GEMACHT WERDEN " +"FÜR DIREKTE, INDIREKTE, SPEZIELLE, VERSEHENTLICHE ODER FOLGESCHÄDEN JEGLICHER " +"ART, EINSCHLIEßLICH UND OHNE EINSCHRÄNKUNGEN SCHÄDEN DURCH VERLUST VON " +"KULANZ, ARBEITSAUSFALL, COMPUTERVERSAGEN ODER COMPUTERFEHLFUNKTIONEN ODER " +"ALLE ANDEREN SCHÄDEN ODER VERLUSTE, DIE SICH AUS ODER IN VERBINDUNG MIT DER " +"VERWENDUNG DES DOKUMENTS UND VERÄNDERTER FASSUNGEN DES DOKUMENTS ERGEBEN, " +"AUCH WENN DIE OBEN GENANNTEN PARTEIEN ÜBER DIE MÖGLICHKEIT SOLCHER SCHÄDEN " +"INFORMIERT WAREN." + +#: C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"DAS DOKUMENT UND VERÄNDERTE FASSUNGEN DES DOKUMENTS WERDEN UNTER DEN " +"BEDINGUNGEN DER GNU FREE DOCUMENTATION LICENSE ZUR VERFÜGUNG GESTELLT MIT DEM " +"WEITERGEHENDEN VERSTÄNDNIS, DASS: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Wörterbuch-Handbuch V1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Januar 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Dieses Handbuch beschreibt Version 2.14.0 des Wörterbuchs." + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Rückmeldungen" + +#: C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" " +"type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Um Fehler zu melden oder einen Vorschlag zur Anwendung " +"<application>Wörterbuch</application> oder zu diesem Handbuch zu machen, " +"folgen Sie den Anweisungen auf der <ulink url=\"ghelp:mate-feedback\" type=" +"\"help\">MATE-Seite für Rückmeldungen</ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Wörterbuch" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Einführung" + +#: C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"Die Anwendung <application>Wörterbuch</application> ermöglicht Ihnen, in " +"einer Wörterbuch-Quelle nach Wörtern und Begriffen zu suchen." + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Erste Schritte" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "So starten Sie das Wörterbuch" + +#: C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "" +"Sie können das <application>Wörterbuch</application> auf folgende Arten " +"starten:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menü <guimenu>Anwendungen</guimenu>" + +#: C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Wählen Sie <menuchoice><guisubmenu>Werkzeuge</" +"guisubmenu><guimenuitem>Wörterbuch</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Befehlszeile" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "" +"Führen Sie den folgenden Befehl aus: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" +"Nach dem Start wird das <application>Wörterbuch</application>-Fenster " +"angezeigt:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Wörterbuch-Fenster" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Zeigt das Wörterbuch-Hauptfenster an." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Benutzung" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Suchen nach einem Wort" + +#: C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"Um ein Wort nachzuschlagen, geben Sie es in das <guilabel>Eingabefeld</" +"guilabel> ein und drücken dann die <keycap>Eingabetaste</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" +"Falls einige Definitionen für das Wort gefunden wurden, werden diese " +"innerhalb des Hauptfensters angezeigt:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Zeigt eine Definition im Wörterbuch-Hauptfenster." + +#: C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "" +"Anderenfalls erscheint eine Fehlermeldung mit der Angabe der Art des Fehlers." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Ergebnisse des Nachschlagens speichern" + +#: C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for " +"the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"Um die Ergebnisse des Nachschlagens zu speichern, wählen Sie " +"<menuchoice><guimenu>Datei</guimenu><guimenuitem>Eine Kopie speichern …</" +"guimenuitem></menuchoice>. Geben Sie den Namen der Datei in den Dialog " +"<guilabel>Eine Kopie speichern</guilabel> ein, dann klicken Sie auf " +"<guibutton>Speichern</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Ergebnisse des Nachschlagens drucken" + +#: C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"Um die Ergebnisse des Nachschlagens zu drucken, wählen Sie " +"<menuchoice><guimenu>Datei</guimenu><guimenuitem>Drucken …</guimenuitem></" +"menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"Im Dialog <guilabel>Drucken</guilabel> können Sie den zu verwendenden " +"Drucker, das Papierformat und die Anzahl der Kopien auswählen." + +#: C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"Um eine Vorschau des zu druckenden Texts anzuzeigen, klicken Sie auf die " +"Schaltfläche <guibutton>Druckvorschau</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Zum Drucken klicken Sie auf <guibutton>Drucken</guibutton>." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Text suchen" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Zeigt die Wörterbuch-Suchleiste im Hauptfenster." + +#: C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "" +"Um einen Text innerhalb der Ergebnisse des Nachschlagens zu suchen, gehen Sie " +"wie folgt vor:" + +#: C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Wählen Sie <menuchoice><guimenu>Bearbeiten</guimenu><guimenuitem>Suchen</" +"guimenuitem></menuchoice>, um die <guilabel>Suchen</guilabel>-Leiste " +"anzuzeigen." + +#: C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" +"Geben Sie den zu suchenden Text in das Eingabfeld <guilabel>Suchen</guilabel> " +"ein." + +#: C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"Um das nächste Vorkommen des Texts zu finden, klicken Sie auf " +"<guibutton>Weiter</guibutton>. Um das vorhergehende Vorkommen des Texts zu " +"finden, klicken Sie auf <guibutton>Zurück</guibutton>." + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Einstellungen" + +#: C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"Um die Einstellungen der Anwendung <application>Wörterbuch</application> zu " +"ändern, wählen Sie <menuchoice><guimenu>Bearbeiten</" +"guimenu><guimenuitem>Einstellungen</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Wörterbuchquellen" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Zeigt den Reiter »Quelle« des Einstellungsdialogs." + +#: C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" +"Um die Wörterbuchquelle zu ändern, die zum Nachschlagen von Wörtern verwendet " +"wird, wählen Sie die gewünschte Quelle aus der Liste." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Hinzufügen einer neuen Datenquelle" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Zeigt den Dialog zum Hinzufügen neuer Quellen." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Um eine neue Wörterbuchquelle hinzuzufügen, gehen Sie wie folgt vor:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Klicken Sie auf die Schaltfläche <guibutton>Hinzufügen</guibutton>." + +#: C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" +"Ändern Sie den Namen der Quelle im Eingabefeld <guilabel>Beschreibung</" +"guilabel>" + +#: C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Ändern Sie die Art des Transports der neuen Quelle in der Aufklappliste " +"<guilabel>Transport</guilabel>" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Ändern Sie die Einstellungen der neuen Quelle" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Klicken Sie auf <guibutton>Hinzufügen</guibutton>." + +#: C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Die verschiedenen Transporttypen verwenden unterschiedliche Attribute. Hier " +"sehen Sie eine Liste der für den jeweiligen Transporttyp verfügbaren " +"Attribute:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transport" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Attribute" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Wörterbuch-Server" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Der Rechnername des zu verwendenen Wörterbuch-Servers" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Der zu verwendene Port des Wörterbuch-Servers" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Entfernen einer Quelle" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "" +"Um eine Wörterbuchquelle zu entfernen, führen Sie die folgenden Schritte aus:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Wählen Sie die zu entfernende Quelle aus" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Klicken Sie auf die Schaltfläche <guibutton>Entfernen</guibutton>." + +#: C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-wide " +"you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Falls Sie eine Wörterbuchquelle löschen, wird diese dauerhaft aus der Liste " +"der verfügbaren Quellen entfernt. Außerdem können Sie einige systemweit " +"definierte Wörterbuchquellen nicht löschen, es sei denn, Sie verfügen über " +"die notwendigen Rechte, um dies zu tun." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Druckoptionen" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Zeigt den Reiter »Drucken« innerhalb des Einstellungsdialogs." + +#: C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Falls Sie die beim Drucken verwendete Schriftart und -größe ändern wollen, " +"gehen Sie wie folgt vor:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Klicken Sie auf die Schaltfläche <guibutton>Schriftart</guibutton>." + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Wählen Sie die Schriftart und -größe, die Sie verwenden wollen" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Klicken Sie auf <guibutton>OK</guibutton>." + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Das Wörterbuch-Applet" + +#: C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"Die Anwendung <application>Wörterbuch</application> liefert ein Panel-Applet " +"mit, das <application>Wörterbuch-Applet</application>. Sie können das " +"<application>Wörterbuch-Applet</application> zu einem Panel hinzufügen und " +"damit in Wörterbüchern nachschlagen." + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Fenster des Wörterbuch-Applets" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Zeigt das Wörterbuch-Applet." + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "So starten Sie das Wörterbuch-Applet" + +#: C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"Um das <application>Wörterbuch-Applet</application> zu einem Panel " +"hinzuzufügen, klicken Sie mit der rechten Maustaste darauf und wählen dann " +"<guimenuitem>Zum Panel hinzufügen …</guimenuitem>. Wählen Sie " +"<application>Wörterbuchsuche</application> im <application>Zum Panel " +"hinzufügen</application>-Dialog aus, und klicken Sie dann auf <guibutton>OK</" +"guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Verwendung des Wörterbuch-Applets" + +#: C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"Um ein Wort nachzuschlagen, geben Sie es in das <guilabel>Eingabefeld</" +"guilabel> ein, und drücken dann die <keycap>Eingabetaste</keycap>. Alternativ " +"können Sie mit der rechten Maustaste auf das Wörterbuch-Symbol klicken und " +"dann <guimenuitem>Nachschlagen</guimenuitem> wählen." + +#: C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Falls einige Definitionen für das Wort gefunden werden konnten, erscheint ein " +"Fenster, in dem der Text der Definitionen angezeigt wird:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Zeigt das Hauptfenster des Wörterbuch-Applets." + +#: C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Klicken Sie auf <guibutton>Speichern</guibutton>, um die Definitionen in " +"einer Textdatei zu speichern. Klicken Sie auf <guibutton>Drucken</guibutton>, " +"um die Definitionen zu drucken. Klicken Sie auf <guibutton>Leeren</" +"guibutton>, um die Definitionen zu löschen. " + +#: C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Sie können das Fenster schließen, indem Sie das Wörterbuch-Symbol anklicken " +"oder die <keycap>Esc</keycap>-Taste drücken." + +#: C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click on " +"the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"Um das <application>Wörterbuch-Applet</application> zu konfigurieren, klicken " +"Sie mit der rechten Maustaste aus fas Wörterbuch-Symbol und wählen dann " +"<guimenuitem>Einstellungen</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"Der Dialog <guilabel>Einstellungen</guilabel> ist der gleiche, wie er vom " +"<application>Wörterbuch</application> verwendet wird, siehe <xref linkend=" +"\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Mario Blättermann <[email protected]>, 2008" diff --git a/mate-dictionary/help/de/figures/mate-dictionary-add-source.png b/mate-dictionary/help/de/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..2780bdff --- /dev/null +++ b/mate-dictionary/help/de/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/de/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/de/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..e569616a --- /dev/null +++ b/mate-dictionary/help/de/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/de/figures/mate-dictionary-application.png b/mate-dictionary/help/de/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..724fd59c --- /dev/null +++ b/mate-dictionary/help/de/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/de/figures/mate-dictionary-find.png b/mate-dictionary/help/de/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..bd2db21e --- /dev/null +++ b/mate-dictionary/help/de/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/de/figures/mate-dictionary-lookup.png b/mate-dictionary/help/de/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..de3ff522 --- /dev/null +++ b/mate-dictionary/help/de/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/de/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/de/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..4df82b5e --- /dev/null +++ b/mate-dictionary/help/de/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/de/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/de/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..dff4d082 --- /dev/null +++ b/mate-dictionary/help/de/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/el/el.po b/mate-dictionary/help/el/el.po new file mode 100644 index 00000000..b629f9a1 --- /dev/null +++ b/mate-dictionary/help/el/el.po @@ -0,0 +1,715 @@ +# +# Fotis Tsamis <[email protected]>, 2009. +msgid "" +msgstr "" +"Project-Id-Version: el-mate-dictionary-help 1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-03-27 12:43+0000\n" +"PO-Revision-Date: 2009-04-05 15:00+0300\n" +"Last-Translator: Fotis Tsamis <[email protected]>\n" +"Language-Team: Greek <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Εγχειρίδιο Λεξικού" + +#: C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "" +"Το λεξικό σας δίνει την δυνατότητα να αναζητήσετε ορισμούς και την σωστή " +"ορθογραφία λέξεων." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Έργο τεκμηρίωσης MATE" + +#: C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Παρέχεται άδεια για την αντιγραφή, διανομή και/ή τροποποίηση αυτού του " +"εγγράφου υπό τους όρους της GNU Free Documentation License (GFDL), Έκδοση " +"1.1 ή μεταγενέστερης που δημοσιεύεται από το Free Software Foundation χωρίς " +"αμετάβλητα τμήματα, χωρίς κείμενα πρωτοσέλιδου, και χωρίς κείμενα " +"οπισθόφυλλου. Μπορεί να βρείτε ένα αντίγραφο της GFDL στη <ulink type=" +"\"βοήθεια\" url=\"ghelp:fdl\">link</ulink> ή στο αρχείο COPYING-DOCS που " +"διανέμεται με αυτό το εγχειρίδιο." + +#: C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"Αυτός ο οδηγός είναι μέρος μιας συλλογής οδηγών του MATE που διανέμονται " +"υπό το GFDL. Αν επιθυμείτε να διανείμετε αυτόν τον οδηγό ξεχωριστά από τη " +"συλλογή, μπορείτε να το πραγματοποιήσετε προσθέτοντας ένα αντίγραφο της " +"άδειας στον οδηγό, όπως περιγράφεται στο 6ο τμήμα της άδειας." + +#: C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"Πολλά από τα ονόματα που χρησιμοποιούνται από επιχειρήσεις για να διακρίνουν " +"τα προϊόντα τους και τις υπηρεσίες ζητούνται σαν εμπορικά σήματα. Όπου " +"εμφανίζονται αυτά τα ονόματα σε κάποια τεκμηρίωση του MATE, και τα μέλη του " +"MATE Documentation Project γνωρίουν για αυτά τα εμπορικά σήματα, τότε τα " +"ονόματα είναι με κεφαλαία γράμματα ή με αρχικά κεφαλαία γράμματα." + +#: C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"ΤΟ ΠΑΡΟΝ ΕΓΓΡΑΦΟ ΠΑΡΕΧΕΤΑΙ \"ΩΣ ΕΧΕΙ\", ΧΩΡΙΣ ΟΠΟΙΑΔΗΠΟΤΕ ΕΓΓΥΗΣΗ, " +"ΕΚΠΕΦΡΑΣΜΕΝΗ Ή ΥΠΑΙΝΙΣΣΟΜΕΝΗ, ΣΥΜΠΕΡΙΛΑΜΒΑΝΟΜΕΝΩΝ, ΧΩΡΙΣ ΠΕΡΙΟΡΙΣΜΟΥΣ, " +"ΕΓΓΥΗΣΕΩΝ ΟΤΙ ΤΟ ΕΓΓΡΑΦΟ Ή Η ΤΡΟΠΟΠΟΙΗΜΕΝΗ ΕΚΔΟΣΗ ΤΟΥ ΕΙΝΑΙ ΑΠΑΛΑΓΜΕΝΟ " +"ΑΤΕΛΕΙΩΝ, ΕΜΠΟΡΕΥΣΙΜΟ, ΚΑΤΑΛΛΗΛΟ ΓΙΑ ΣΥΓΚΕΚΡΙΜΕΝΗ ΧΡΗΣΗ Ή ΑΠΑΡΑΒΙΑΣΤΟ. Ο " +"ΧΡΗΣΤΗΣ ΑΝΑΛΑΜΒΑΝΕΙ ΚΑΘΕ ΚΙΝΔΥΝΟ ΠΟΥ ΜΠΟΡΕΙ ΝΑ ΠΡΟΚΥΨΕΙ ΩΣ ΠΡΟΣ ΤΗΝ " +"ΠΟΙΟΤΗΤΑ, ΑΚΡΙΒΕΙΑ ΚΑΙ ΛΕΙΤΟΥΡΓΙΑ ΤΟΥ ΕΓΓΡΑΦΟΥ Ή ΤΩΝ ΤΡΟΠΟΠΟΙΗΜΕΝΩΝ ΕΚΔΟΣΕΩΝ " +"ΤΟΥ. ΑΝ ΟΠΟΙΟΔΗΠΟΤΕ ΕΓΓΡΑΦΟ Ή ΤΡΟΠΟΠΟΙΗΜΕΝΗ ΕΚΔΟΣΗ ΤΟΥ ΑΠΟΔΕΙΧΘΟΥΝ " +"ΕΛΛΑΤΩΜΑΤΙΚΑ ΜΕ ΟΠΟΙΟΝΔΗΠΟΤΕ ΤΡΟΠΟ, Ο ΤΕΛΙΚΟΣ ΧΡΗΣΤΗΣ (ΚΑΙ ΟΧΙ Ο ΑΡΧΙΚΟΣ " +"ΣΥΓΓΡΑΦΕΑΣ, ΣΥΝΤΑΚΤΗΣ Ή ΟΠΟΙΟΣΔΗΠΟΤΕ ΤΟ ΔΙΕΝΗΜΕ) ΑΝΑΛΑΜΒΑΝΕΙ ΤΟ ΚΟΣΤΟΣ " +"ΟΠΟΙΑΣΔΗΠΟΤΕ ΕΠΙΣΚΕΥΗΣ Ή ΔΙΟΡΘΩΣΗΣ. ΑΥΤΗ Η ΠΑΡΑΙΤΗΣΗ ΑΠΟ ΕΓΓΥΗΤΙΚΕΣ ΕΥΘΥΝΕΣ " +"ΣΥΝΙΣΤΑ ΟΥΣΙΑΣΤΙΚΟ ΜΕΡΟΣ ΤΗΣ ΑΔΕΙΑΣ. ΟΥΔΕΜΙΑ ΧΡΗΣΗ ΟΙΟΥΔΗΠΟΤΕ ΕΓΓΡΑΦΟΥ Ή " +"ΤΡΟΠΟΠΟΙΗΜΕΝΟΥ ΕΓΓΡΑΦΟΥ ΕΞΟΥΣΙΟΔΟΤΕΙΤΑΙ ΕΦΕΞΗΣ, ΠΑΡΑ ΥΠΟ ΤΟΝ ΟΡΟ ΤΗΣ ΩΣ ΑΝΩ " +"ΠΑΡΑΙΤΗΣΗΣ ΚΑΙ" + +#: C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"ΣΕ ΚΑΜΙΑ ΠΕΡΙΠΤΩΣΗ ΚΑΙ ΥΠΟ ΚΑΜΙΑ ΝΟΜΙΚΗ ΣΥΝΘΗΚΗ, ΕΙΤΕ ΜΕΣΩ ΣΥΜΒΟΛΑΙΩΝ Ή " +"ΑΛΛΙΩΣ, ΔΕΝ ΕΥΘΥΝΟΝΤΑΙ Ο ΣΥΓΓΡΑΦΕΑΣ, Ο ΔΙΑΝΟΜΕΑΣ, Η ΑΛΛΟΣ ΣΥΝΥΠΕΥΘΥΝΟΣ ΓΙΑ " +"ΤΗΝ ΣΥΓΓΡΑΦΗ ΤΗΣ ΤΕΚΜΗΡΙΩΣΗΣ, ΓΙΑ ΕΜΜΕΣΕΣ Η ΑΜΕΣΕΣ, ΤΥΧΑΙΕΣ Ή ΜΗ ΖΗΜΙΕΣ " +"ΠΑΝΤΩΣ ΦΥΣΕΩΣ ΠΟΥ ΠΡΟΕΡΧΟΝΤΑΙ ΑΠΟ ΤΗΝ ΧΡΗΣΗ ΤΗΣ ΤΕΚΜΗΡΙΩΣΗΣ ΚΑΙ/Ή ΠΑΡΑΛΛΑΓΩΝ " +"ΑΥΤΗΣ ΑΚΟΜΑ ΚΑΙ ΕΑΝ ΕΧΕΙ ΥΠΑΡΞΕΙ ΠΡΟΕΙΔΟΠΟΙΗΣΗ ΓΙΑ ΤΗΝ ΠΙΘΑΝΟΤΗΤΑ ΥΠΑΡΞΗΣ " +"ΤΕΤΟΙΩΝ ΖΗΜΙΩΝ." + +#: C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"ΤΟ ΕΓΓΡΑΦΟ ΚΑΙ ΟΙ ΤΡΟΠΟΠΟΙΗΜΕΝΕΣ ΕΚΔΟΣΕΙΣ ΤΟΥ ΕΓΓΡΑΦΟΥ ΠΑΡΕΧΟΝΤΑΙ ΥΠΟ ΤΟΥΣ " +"ΟΡΟΥΣ ΤΗΣ ΑΔΕΙΑΣ GNU FREE DOCUMENTATION LICENSE, ΜΕ ΤΗΝ ΕΠΙΠΛΕΟΝ ΚΑΤΑΝΟΗΣΗ " +"ΟΤΙ: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Εγχειρίδιο Λεξικού V1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "January 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Αυτό το εγχειρίδιο περιγράφει την έκδοση 2.14.0 του Λεξικού" + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Ανάδραση" + +#: C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Για να αναφέρετε ένα σφάλμα ή να κάνετε μια πρόταση σχετικά με την εφαρμογή " +"Λεξικού ή αυτή την τεκμηρίωση, ακολουθήστε τις οδηγίες στη <ulink url=" +"\"ghelp:mate-feedback\" type=\"help\">Σελίδα ανάδρασης MATE</ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Λεξικό" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Εισαγωγή" + +#: C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"Η εφαρμογή <application>Λεξικού</application> σας δείνει την δυνατότητα να " +"αναζητήσετε λέξεις και ορισμούς σε μια πηγή λεξικού" + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Ξεκινώντας" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Για να εκκινήσετε το Λεξικό" + +#: C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "" +"Μπορείτε να ξεκινήσετε το <application>Λεξικό</application> με τους " +"ακόλουθους τρόπους:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Μενού <guimenu>Εφαρμογές</guimenu>" + +#: C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Επιλέξτε <menuchoice><guisubmenu>Βοηθήματα</guisubmenu><guimenuitem>Λεξικό</" +"guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Γραμμή εντολών" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Εκτέλεση της παρακάτω εντολής: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" +"Όταν ξεκινήσει, εμφανίζεται το παράθυρο <application>Λεξικού</application>:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Παράθυρο λεξικού" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Εμφανίζει το κύριο παράθυρο του Λεξικού." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Χρήση" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Αναζήτηση μίας λέξης" + +#: C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"Για να αναζητήσετε μια λέξη, πληκτρολογήστε την μέσα στο <guilabel>πεδίο " +"εισαγωγής</guilabel> και πατήστε <keycap>Enter</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" +"Αν βρεθεί κάποιος ορισμός για την λέξη, θα εμφανιστεί μέσα στην κεντρική " +"περιοχή του παραθύρου:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Εμφανίζει ένα ορισμό μέσα στο κεντρικό παράθυρο του λεξικού." + +#: C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "" +"Διαφορετικά, ένας διάλογος σφάλματος θα εμφανιστεί και ένα μήνυμα θα εξηγεί " +"την φύση του σφάλματος." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Αποθήκευση αποτελεσμάτων αναζήτησης" + +#: C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"Για να αποθηκεύσετε τα αποτελέσματα μιας αναζήτησης, επιλέξτε " +"<menuchoice><guimenu>Αρχείο</guimenu><guimenuitem> Αποθήκευση ενός " +"αντιγράφου</guimenuitem></menuchoice>. Εισάγετε ένα όνομα αρχείου στον " +"διάλογο του <guilabel>Αποθήκευση ενός αντιγράφου</guilabel>, έπειτα κάντε " +"κλικ στο κουμπί <guibutton>Αποθήκευση</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Εκτύπωση αποτελεσμάτων αναζήτησης" + +#: C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"Για να εκτυπώσετε τα αποτέλεσματα μιας αναζήτησης, επιλέξτε " +"<menuchoice><guimenu>Αρχείο</guimenu><guimenuitem>Εκτύπωση</guimenuitem></" +"menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"Μέσα από τον διάλογο <guilabel>Εκτύπωση</guilabel>μπορείτε να επιλέξετε τον " +"εκτυπωτή, την μορφή χαρτιού και των αριθμό των αντιγράφων που θέλετε." + +#: C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"Για να δείτε μια προεπισκόπηση εκτύπωσης, κάντε κλικ στο " +"<guibutton>Προεπισκόπηση</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Για να εκτυπώσετε, κάντε κλικ στο <guibutton>Εκτύπωση</guibutton>." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Εύρεση κειμένου" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Εμφανίζει το πλαίσιο αναζήτησης του Λεξικού μέσα στο κύριο παράθυρο." + +#: C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "" +"Για να εντοπίσετε κείμενο μέσα στα αποτελέσματα της αναζήτησης, ακολουθήστε " +"τα παρακάτω βήματα:" + +#: C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Επιλέξτε <menuchoice><guimenu>Επεξεργασία</guimenu><guimenuitem>Εύρεση</" +"guimenuitem></menuchoice> για να εμφανίσετε το πλαίσιο <guilabel>Εύρεση</" +"guilabel>." + +#: C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" +"Πληκτρολογήστε το κείμενο που θέλετε να βρείτε μέσα στην " +"<guilabel>Αναζήτηση</guilabel>." + +#: C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"Για να βρείτε την επόμενη εμφάνιση του κειμένου, κάντε κλικ στο " +"<guibutton>Επόμενο</guibutton>. Για να βρείτε μια προηγούμενη εμφάνιση του " +"κειμένου, κάντε κλικ στο <guibutton>Επόμενο</guibutton>." + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Προτιμήσεις" + +#: C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"Για να αλλάξετε της προτιμήσεις της εφαρμογής <application>Λεξικό</" +"application>, επιλέξτε <menuchoice><guimenu>Επεξεργασία</" +"guimenu><guimenuitem>Προτιμήσεις</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Πηγές λεξικών" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Εμφανίζει την καρτέλα Πηγή από τον διάλογο Προτιμήσεις." + +#: C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" +"Για να αλλάξετε την πηγή λεξικού στην οποία γίνονται οι αναζητήσεις, " +"επιλέξτε την επιθυμητή πηγή από τη λίστα." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Προσθήκη μίας νέας πηγής" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Εμφανίζει τον διάλογο Προσθήκη πηγής." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Για να προσθέστε μια νέα πηγή λεξικού, ακολουθήστε τα επόμενα βήματα:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Κάντε κλικ στο κουμπί <guibutton>Προσθήκη</guibutton>" + +#: C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" +"Επεξεργασία του ονόματος της νέας πηγής μέσα στην καταχώρηση της " +"<guilabel>Περιγραφής</guilabel>" + +#: C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Αλλαγή του τύπου μεταφοράς της νέας πηγής με την χρήση του πλαισίου επιλογών " +"<guilabel>Μεταφορά</guilabel>" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Επεξεργασία των γνωρισμάτων της νέας πηγής" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Κάντε κλικ στο <guibutton>Προσθήκη</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Διαφορετικοί τύποι μεταφοράς πηγής χρησιμοποιούν διαφορετικά γνωρίσματα. " +"Αυτή είναι η λίστα των διαθέσιμων γνωρισμάτων ανά τύπο μεταφοράς:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Μεταφορά" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Γνωρίσματα" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Εξυπηρετητής λεξικού" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Όνομα συστήματος: το όνομα συστήματος του εξυπηρετητή λεξικού" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Θύρα: η θύρα του εξυπηρετητή λεξικού" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Απομάκρυνση μιας πηγής" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Για να απομακρύνετε μια πηγή λεξικού, ακολουθήστε τα παρακάτω βήματα:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Επιλογή πηγής που θέλετε να απομακρυνθεί" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Κάντε κλικ στο κουμπί <guibutton>Απομάκρυνση</guibutton>" + +#: C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Αν απομακρύνετε μια πηγή λεξικού τότε αυτή θα διαγραφεί μόνιμα από τη λίστα " +"των διαθέσιμων πηγών. Επίσης, μερικές πηγές που καθορίζονται από το σύστημα " +"είναι πιθανό να μην μπορείτε να τις απομακρύνετε εκτός και αν έχετε τα " +"απαραίτητα δικαιώματα." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Επιλογές εκτύπωσης" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Εμφανίζει την καρτέλα Εκτύπωση μέσα στον διάλογο Προτιμήσεις." + +#: C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Αν θελήσετε να αλλάξετε το όνομα και το μέγεθος της γραμματοσειράς, " +"ακολουθήστε τα επόμενα βήματα:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "" +"Κάντε κλικ πάνω στο κουμπί <guilabel>Γραμματοσειρά εκτύπωσης</guilabel>" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Επιλέξτε το μέγεθος της γραμματοσειράς που θα χρησιμοποιηθεί" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Κάντε κλικ στο <guibutton>Εντάξει</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Η μικροεφαρμογή Λεξικού" + +#: C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"Το <application>Λεξικό</application> διαθέτει και μια μικροεφαρμογή στον " +"πίνακα εφαρμογών, την <application>Μικροεφαρμογή Λεξικό</application>. " +"Μπορείτε να προσθέσετε την <application>Μικροεφαρμογή Λεξικό</application> " +"στον πίνακα εφαρμογών και να αναζητείτε λέξεις σε διάφορα λεξικά." + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Παράθυρο μικροεφαρμογής Λεξικό" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Εμφανίζει την μικροεφαρμογή Λεξικoύ." + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Για να ξεκινήσετε την μικροεφαρμογή Λεξικό" + +#: C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"Για να προσθέσετε στον πίνακα εφαρμογών την <application>Μικροεφαρμογή " +"Λεξικό</application>, κάντε δεξί κλικ πάνω στον πίνακα εφαρμογών και " +"επιλέξτε <guimenuitem>Προσθήκη στον πίνακα εφαρμογών</guimenuitem>. Επιλέξτε " +"την μικροεφαρμογή Λεξικό στον διάλογο του <application>Προσθήκη στον πίνακα " +"εφαρμογών</application>, έπειτα κάντε κλικ στο <guibutton>Εντάξει</" +"guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Χρησιμοποιώντας την μικροεφαρμογή Λεξικού" + +#: C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"Για να αναζητήσετε μια λέξη, πληκτρολογήστε την στο <guilabel>πεδίο " +"εισαγωγής</guilabel>, και πατήστε <keycap>Enter</keycap> ή κάντε δεξί κλικ " +"στο εικονίδιο λεξικού και μετά επιλέξτε <guimenuitem>Αναζήτηση</guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Αν βρεθούν ορισμοί της λέξεως, ένα παράθυρο θα εμφανιστεί με το κείμενο των " +"ορισμών:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Εμφανίζει το κεντρικό παράθυρο της μικροεφαρμογής Λεξικό." + +#: C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Κάντε κλικ στο <guibutton>Αποθήκευση</guibutton> για να αποθηκεύσετε τα " +"αποτελέσματα σε ένα αρχείο κειμένου. Κάντε κλικ στο <guibutton>Εκτύπωση</" +"guibutton> για να εκτυπώσετε τα αποτελέσματα. Κάντε κλικ στο " +"<guibutton>Καθαρισμός</guibutton> για να καθαρίσετε τα αποτελέσματα." + +#: C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Μπορείτε να εξαφανίσετε το παράθυρο με αριστερό κλικ στο εικονίδιο του " +"λεξικού ή πατώντας το <keycap>Esc</keycap>." + +#: C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"Για να ρυθμίσετε την <application>Μικροεφαρμογή λεξικού</application>, κάντε " +"δεξί κλικ στο εικονίδιο λεξικού, μετά επιλέξτε <guimenuitem>Προτιμήσεις</" +"guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"Ο διάλογος <guilabel>Προτιμήσεις</guilabel> είναι ο ίδιος που χρησιμοποιεί η " +"εφαρμογή <application>Λεξικό</application>, ανατρέξτε στο <xref linkend=" +"\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Nikos Charonitakis <[email protected]>, 2006." diff --git a/mate-dictionary/help/el/figures/mate-dictionary-application.png b/mate-dictionary/help/el/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..8414811f --- /dev/null +++ b/mate-dictionary/help/el/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/el/figures/mate-dictionary-find.png b/mate-dictionary/help/el/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..e6776a69 --- /dev/null +++ b/mate-dictionary/help/el/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/el/figures/mate-dictionary-lookup.png b/mate-dictionary/help/el/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..e5d2ee7d --- /dev/null +++ b/mate-dictionary/help/el/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/el/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/el/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..1913a2b0 --- /dev/null +++ b/mate-dictionary/help/el/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/en_GB/en_GB.po b/mate-dictionary/help/en_GB/en_GB.po new file mode 100644 index 00000000..b35264ae --- /dev/null +++ b/mate-dictionary/help/en_GB/en_GB.po @@ -0,0 +1,455 @@ +msgid "" +msgstr "" +"Project-Id-Version: bug-buddy-docs\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-12 07:18+0100\n" +"PO-Revision-Date: 2007-03-12 22:36-0000\n" +"Last-Translator: David Lodge <[email protected]>\n" +"Language-Team: en_GB <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" +msgstr "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" +msgstr "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" +msgstr "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Dictionary Manual" + +#: C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Dictionary enables you to look up definitions and correct spellings of words." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) +#: C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) +#: C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "MATE Documentation Project" + +#: C/mate-dictionary.xml:2(para) +msgid "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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +msgstr "Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation Licence (GFDL), Version 1.1 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in the file COPYING-DOCS distributed with this manual." + +#: C/mate-dictionary.xml:12(para) +msgid "This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the license to the manual, as described in section 6 of the license." +msgstr "This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the licence to the manual, as described in section 6 of the licence." + +#: C/mate-dictionary.xml:19(para) +msgid "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters." +msgstr "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters." + +#: C/mate-dictionary.xml:35(para) +msgid "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENCE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORISED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" + +#: C/mate-dictionary.xml:55(para) +msgid "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES." +msgstr "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES." + +#: C/mate-dictionary.xml:28(para) +msgid "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: <placeholder-1/>" +msgstr "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENCE WITH THE FURTHER UNDERSTANDING THAT: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Dictionary Manual V1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "January 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "This manual describes version 2.14.0 of Dictionary." + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Feedback" + +#: C/mate-dictionary.xml:91(para) +msgid "To report a bug or make a suggestion regarding the Dictionary application or this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "To report a bug or make a suggestion regarding the Dictionary application or this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE Feedback Page</ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Dictionary" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Introduction" + +#: C/mate-dictionary.xml:109(para) +msgid "The <application>Dictionary</application> application enables you to search words and terms on a dictionary source." +msgstr "The <application>Dictionary</application> application enables you to search words and terms on a dictionary source." + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Getting Started" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "To Start Dictionary" + +#: C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "You can start <application>Dictionary</application> in the following ways:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "<guimenu>Applications</guimenu> menu" + +#: C/mate-dictionary.xml:129(para) +msgid "Choose <menuchoice><guisubmenu>Accessories</guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "Choose <menuchoice><guisubmenu>Accessories</guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Command line" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Execute the following command: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "Once started, the <application>Dictionary</application> window is displayed:" + +#: C/mate-dictionary.xml:146(title) +#: C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) +#: C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) +#: C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Dictionary Window" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Shows Dictionary main window." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Usage" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Looking up a word" + +#: C/mate-dictionary.xml:168(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel> and press <keycap>Enter</keycap>." +msgstr "To look up a word, type it into the <guilabel>entry field</guilabel> and press <keycap>Enter</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "If some definition for the word is found, it will appear inside the main window area:" +msgstr "If some definition for the word is found, it will appear inside the main window area:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Shows a definition inside the Dictionary main window." + +#: C/mate-dictionary.xml:186(para) +msgid "Otherwise, an error dialog will appear, with a message explaining the nature of the error." +msgstr "Otherwise, an error dialogue will appear, with a message explaining the nature of the error." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Save look up results" + +#: C/mate-dictionary.xml:194(para) +msgid "To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialog, then click <guibutton>Save</guibutton>." +msgstr "To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialogue, then click <guibutton>Save</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Print look up results" + +#: C/mate-dictionary.xml:201(para) +msgid "To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "Inside the <guilabel>Print</guilabel> dialog you can select the printer to use, the paper format, the number of copies." +msgstr "Inside the <guilabel>Print</guilabel> dialog you can select the printer to use, the paper format, the number of copies." + +#: C/mate-dictionary.xml:206(para) +msgid "To see a preview of what will be printed, click <guibutton>Preview</guibutton>." +msgstr "To see a preview of what will be printed, click <guibutton>Preview</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "To print, click <guibutton>Print</guibutton>." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Find Text" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Shows the Dictionary Find pane inside the main window." + +#: C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "To find text inside the results of a look up, perform the following steps:" + +#: C/mate-dictionary.xml:233(para) +msgid "Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></menuchoice> to display the <guilabel>Find</guilabel> pane." + +#: C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "Type the text you want to find inside the <guilabel>Search</guilabel> entry." + +#: C/mate-dictionary.xml:237(para) +msgid "To find the next occurrence of the text, click <guibutton>Next</guibutton>. To find the previous occurrence of the text, click <guibutton>Previous</guibutton>." +msgstr "To find the next occurrence of the text, click <guibutton>Next</guibutton>. To find the previous occurrence of the text, click <guibutton>Previous</guibutton>." + +#: C/mate-dictionary.xml:248(title) +#: C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Preferences" + +#: C/mate-dictionary.xml:250(para) +msgid "To change the <application>Dictionary</application> application preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>." +msgstr "To change the <application>Dictionary</application> application preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Dictionary Sources" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Shows the Source tab of the Preferences dialogue." + +#: C/mate-dictionary.xml:269(para) +msgid "To change the dictionary source used to look up words, select the desired source from the list." +msgstr "To change the dictionary source used to look up words, select the desired source from the list." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Adding a new source" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Shows the Add Source dialogue." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "To add a new dictionary source, perform the following steps:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Click on the <guibutton>Add</guibutton> button" + +#: C/mate-dictionary.xml:293(para) +msgid "Edit the name of the new source inside the <guilabel>Description</guilabel> entry" +msgstr "Edit the name of the new source inside the <guilabel>Description</guilabel> entry" + +#: C/mate-dictionary.xml:294(para) +msgid "Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box" +msgstr "Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Edit the attributes of the new source" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Click <guibutton>Add</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "Different source transport types uses different attributes. This is the list of available attributes per transport type:" +msgstr "Different source transport types uses different attributes. This is the list of available attributes per transport type:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transport" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Attributes" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Dictionary Server" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Hostname: the hostname of the dictionary server" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Port: the port of the dictionary server" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Removing a source" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "To remove a dictionary source, perform the following steps:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Select the source you wish to remove" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Click the <guibutton>Remove</guibutton> button" + +#: C/mate-dictionary.xml:335(para) +msgid "If you remove a dictionary source it will be permanently deleted from the list of available sources. Also, as some sources might be defined system-wide you may actually not be able to remove them unless you have the right ownership privileges." +msgstr "If you remove a dictionary source it will be permanently deleted from the list of available sources. Also, as some sources might be defined system-wide you may actually not be able to remove them unless you have the right ownership privileges." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Print Options" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Shows the Print tab inside the Preferences dialogue." + +#: C/mate-dictionary.xml:358(para) +msgid "If you want to change the font name and size used when printing, perform the following steps:" +msgstr "If you want to change the font name and size used when printing, perform the following steps:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Click on the <guilabel>Print Font</guilabel> button" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Select the font and size you wish to use" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Click <guibutton>Ok</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "The Dictionary Applet" + +#: C/mate-dictionary.xml:375(para) +msgid "The <application>Dictionary</application> application comes with a panel applet, the <application>Dictionary Applet</application>. You can add the <application>Dictionary Applet</application> applet to a panel and look up words in dictionaries." +msgstr "The <application>Dictionary</application> application comes with a panel applet, the <application>Dictionary Applet</application>. You can add the <application>Dictionary Applet</application> applet to a panel and look up words in dictionaries." + +#: C/mate-dictionary.xml:381(title) +#: C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Dictionary Applet Window" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Shows Dictionary Applet." + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "To Start Dictionary Applet" + +#: C/mate-dictionary.xml:397(para) +msgid "To add <application>Dictionary Applet</application> to a panel, right-click on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select Dictionary Applet in the <application>Add to the panel</application> dialog, then click <guibutton>OK</guibutton>." +msgstr "To add <application>Dictionary Applet</application> to a panel, right-click on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select Dictionary Applet in the <application>Add to the panel</application> dialogue, then click <guibutton>OK</guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Using the Dictionary Applet" + +#: C/mate-dictionary.xml:408(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel>, and press <keycap>Enter</keycap> or right-click on the dictionary icon and then choose <guimenuitem>Look up</guimenuitem>." +msgstr "To look up a word, type it into the <guilabel>entry field</guilabel>, and press <keycap>Enter</keycap> or right-click on the dictionary icon and then choose <guimenuitem>Look up</guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "If some definition for the word was found, a window will appear, with the text of the definitions:" +msgstr "If some definition for the word was found, a window will appear, with the text of the definitions:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Shows Dictionary Applet main window." + +#: C/mate-dictionary.xml:428(para) +msgid "Click <guibutton>Save</guibutton> to save the definitions to a text file. Click <guibutton>Print</guibutton> to print the definitions. Click <guibutton>Clear</guibutton> to clear the definitions." +msgstr "Click <guibutton>Save</guibutton> to save the definitions to a text file. Click <guibutton>Print</guibutton> to print the definitions. Click <guibutton>Clear</guibutton> to clear the definitions." + +#: C/mate-dictionary.xml:432(para) +msgid "You can make the window disappear by left-clicking on the dictionary icon or by pressing <keycap>Esc</keycap>." +msgstr "You can make the window disappear by left-clicking on the dictionary icon or by pressing <keycap>Esc</keycap>." + +#: C/mate-dictionary.xml:440(para) +msgid "To configure the <application>Dictionary Applet</application>, right-click on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "To configure the <application>Dictionary Applet</application>, right-click on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "The <guilabel>Preferences</guilabel> dialog is the same used by the <application>Dictionary</application> application, so refer to <xref linkend=\"mate-dictionary-preferences\"/>" +msgstr "The <guilabel>Preferences</guilabel> dialog is the same used by the <application>Dictionary</application> application, so refer to <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "David Lodge <[email protected]>, 2007" + diff --git a/mate-dictionary/help/es/es.po b/mate-dictionary/help/es/es.po new file mode 100644 index 00000000..b9327804 --- /dev/null +++ b/mate-dictionary/help/es/es.po @@ -0,0 +1,724 @@ +# translation of dictionary.HEAD.po to Español +# translation of es.po to +# +# Jorge Gonzalez <[email protected]>, 2005. +# Francisco Javier F. Serrador <[email protected]>, 2005, 2006. +# FRancisco Javier F. Serrador <[email protected]>, 2006. +# Jorge González <[email protected]>, 2007, 2008. +msgid "" +msgstr "" +"Project-Id-Version: dictionary.HEAD\n" +"POT-Creation-Date: 2007-04-22 12:52+0100\n" +"PO-Revision-Date: 2008-03-09 14:24+0100\n" +"Last-Translator: Jorge González <[email protected]>\n" +"Language-Team: Español <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Manual del diccionario" + +#: C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "" +"EL diccionario le permite buscar definiciones y escrituras correctas de " +"palabras." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Proyecto de documentación de MATE" + +#: C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Se otorga permiso para copiar, distribuir y/o modificar este documento bajo " +"los términos de la Licencia de Documentación Libre de GNU, Versión 1.1 o " +"cualquier otra versión posterior publicada por la Free Software Foundation; " +"sin Secciones Invariantes ni Textos de Cubierta Delantera ni Textos de " +"Cubierta Trasera. Puede encontrar una copia de la licencia GFDL en este " +"<ulink type=\"help\" url=\"ghelp:fdl\">enlace</ulink> o en el archivo " +"COPYING-DOCS distribuido con este manual." + +#: C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"Este manual es parte de una colección de manuales de MATE distribuido bajo " +"la GFDL. Si quiere distribuir este manual por separado de la colección, " +"puede hacerlo añadiendo una copia de la licencia al manual, tal como se " +"describe en la sección 6 de la licencia." + +#: C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"Muchos de los nombres usados por compañías para distinguir sus productos y " +"servicios son mencionados como marcas comerciales. Donde esos nombres " +"aparezcan en cualquier documentación de MATE, y los miembros del Proyecto " +"de Documentación de MATE están al corriente de esas marcas comerciales, " +"entonces los nombres se pondrán en mayúsculas o con la inicial en mayúsculas." + +#: C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"EL DOCUMENTO SE PROPORCIONA \"TAL CUAL\", SIN GARANTÍA DE NINGÚN TIPO, NI " +"EXPLÍCITA NI IMPLÍCITA INCLUYENDO, SIN LIMITACIÓN, GARANTÍA DE QUE EL " +"DOCUMENTO O VERSIÓN MODIFICADA DE ÉSTE CAREZCA DE DEFECTOS COMERCIALES, SEA " +"ADECUADO A UN FIN CONCRETO O INCUMPLA ALGUNA NORMATIVA. TODO EL RIESGO " +"RELATIVO A LA CALIDAD, PRECISIÓN Y UTILIDAD DEL DOCUMENTO O SU VERSIÓN " +"MODIFICADA RECAE EN USTED. SI CUALQUIER DOCUMENTO O VERSIÓN MODIFICADA DE " +"AQUÉL RESULTARA DEFECTUOSO EN CUALQUIER ASPECTO, USTED (Y NO EL REDACTOR " +"INICIAL, AUTOR O CONTRIBUYENTE) ASUMIRÁ LOS COSTES DE TODA REPARACIÓN, " +"MANTENIMIENTO O CORRECCIÓN NECESARIOS. ESTA RENUNCIA DE GARANTÍA ES UNA " +"PARTE ESENCIAL DE ESTA LICENCIA. NO SE AUTORIZA EL USO DE NINGÚN DOCUMENTO " +"NI VERSIÓN MODIFICADA DE ÉSTE POR EL PRESENTE, SALVO DENTRO DEL CUMPLIMIENTO " +"DE LA RENUNCIA;Y" + +#: C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"BAJO NINGUNA CIRCUNSTANCIA NI BAJO NINGUNA TEORÍA LEGAL, SEA POR ERROR " +"(INCLUYENDO NEGLIGENCIA), CONTRATO O DE ALGÚN OTRO MODO, EL AUTOR, EL " +"ESCRITOR INICIAL, CUALQUIER CONTRIBUIDOR, O CUALQUIER DISTRIBUIDOR DEL " +"DOCUMENTO O VERSIÓN MODIFICADA DEL DOCUMENTO, O CUALQUIER PROVEEDOR DE " +"CUALQUIERA DE ESAS PARTES, SERÁ RESPONSABLE ANTE NINGUNA PERSONA POR NINGÚN " +"DAÑO DIRECTO, INDIRECTO, ESPECIAL, INCIDENTAL O DERIVADO DE NINGÚN TIPO, " +"INCLUYENDO, SIN LIMITACIÓN DAÑOS POR PÉRDIDA DE MERCANCÍAS, PARO TÉCNICO, " +"FALLO INFORMÁTICO O MAL FUNCIONAMIENTO O CUALQUIER OTRO POSIBLE DAÑO O " +"PÉRDIDAS DERIVADAS O RELACIONADAS CON EL USO DEL DOCUMENTO O SUS VERSIONES " +"MODIFICADAS, AUNQUE DICHA PARTE HAYA SIDO INFORMADA DE LA POSIBILIDAD DE QUE " +"SE PRODUJESEN DICHOS DAÑOS." + +#: C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"ESTE DOCUMENTO Y LAS VERSIONES MODIFICADAS DEL MISMO SE PROPORCIONAN SEGÚN " +"LAS CONDICIONES ESTABLECIDAS EN LA LICENCIA DE DOCUMENTACIÓN LIBRE DE GNU " +"(GFDL) Y TENIENDO EN CUENTA QUE: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Manual del diccionario V1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Enero de 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Este manual describe la versión 2.14.0 del Diccionario." + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Comentarios" + +#: C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Para informar sobre un fallo o hacer sugerencias sobre la aplicación " +"Diccionario o sobre este manual, siga las indicaciones en la <ulink url=" +"\"ghelp:mate-feedback\" type=\"help\">Página de comentarios de MATE</" +"ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Diccionario" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Introducción" + +#: C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"La aplicación <application>Diccionario</application> le permite buscar " +"palabras y términos en una fuente de diccionarios." + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Iniciando" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Para iniciar el diccionario" + +#: C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "" +"Puede iniciar el <application>Diccionario</application> de las siguientes " +"formas:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menú <guimenu>Aplicaciones</guimenu>" + +#: C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Elija <menuchoice><guisubmenu>Accesorios</" +"guisubmenu><guimenuitem>Diccionario</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Línea de órdenes" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Ejecute el siguiente comando: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" +"Una vez iniciado el <application>Diccionario</application>, se mostrará la " +"siguiente ventana:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Ventana del diccionario" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Muestra la ventana principal del Diccionario." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Uso" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Buscar una palabra" + +#: C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"Para buscar una palabra, tecléela en el <guilabel>campo de entrada</" +"guilabel> y pulse <keycap>Retorno</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" +"Si se encuentra alguna definición para la palabra, aparecerá dentro del área " +"principal de la ventana:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Muestra una definición dentro de la ventana principal del Diccionario." + +#: C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "" +"En otro caso, aparecerá un diálogo de error, con un mensaje explicando la " +"naturaleza del error." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Guardar resultados de la búsqueda" + +#: C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"Para guardar el resultado de una búsqueda. elija " +"<menuchoice><guimenu>Archivo</guimenu><guimenuitem>Guardar una copia</" +"guimenuitem></menuchoice>. Introduzca un nombre para el archivo en el " +"diálogo<guilabel>Guardar una copia</guilabel>, después pulse en el botón " +"<guibutton>Guardar</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Imprimir resultado de una búsqueda" + +#: C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"Para imprimir el resultado de una búsqueda, elija " +"<menuchoice><guimenu>Archivo</guimenu><guimenuitem>Imprimir</guimenuitem></" +"menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"Dentro del diálogo <guilabel>Imprimir</guilabel> puede seleccionar la " +"impresora a usar, el formato del panel y el número de copias." + +#: C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"Para ver una vista preliminar de lo que se va a imprimir, pulse en el botón " +"<guibutton>Vista previa</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Para imprimir, pulse en <guibutton>Imprimir</guibutton>." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Buscar texto" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Muestra el panel de búsqueda del diccionario dentro de la ventana principal." + +#: C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "" +"Para buscar texto dentro de los resultados de una búsqueda, realice los " +"siguientes pasos:" + +#: C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Elija <menuchoice><guimenu>Editar</guimenu><guimenuitem>Buscar</" +"guimenuitem></menuchoice> para mostrar el panel <guilabel>Buscar</guilabel>." + +#: C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" +"Teclee el texto que quiere encontrar, en la entrada <guilabel>Buscar</" +"guilabel>." + +#: C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"Para buscar la aparición siguiente del texto, pulse el botón " +"<guibutton>Siguiente</guibutton>. Para encontrar la aparición anterior del " +"texto, pulse en el botón <guibutton>Anterior</guibutton>." + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Preferencias" + +#: C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"Para cambiar las preferencias de la aplicación <application>Diccionario</" +"application>, elija <menuchoice><guimenu>Editar...</" +"guimenu><guimenuitem>Preferencias</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Fuentes de diccionario" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Muestra la solapa de fuentes del diálogo de preferencias." + +#: C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" +"Para cambiar la fuente de diccionarios usada para buscar palabras, " +"seleccione la fuente deseada de la lista." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Añadir una fuente nueva" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Muestra el diálogo «Añadir fuente»." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Para añadir una fuente de diccionario nueva, efectúe los siguientes pasos:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Pulse en el botón <guibutton>Añadir</guibutton>" + +#: C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" +"Edite el nombre de la fuente nueva dentro de la entrada " +"<guilabel>Descripción</guilabel>" + +#: C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Cambie el tipo de transporte de la fuente nueva usando la caja de " +"combinación <guilabel>Transporte</guilabel>" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Edite los atributos de la fuente nueva" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Pulse en <guibutton>Añadir</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Los distintos tipos de transporte usan atributos diferentes. Esta es la " +"lista de atributos disponibles para cada tipo de transporte:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transporte" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Atributos" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Servidor de diccionario" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Nombre del host: El nombre del host del servidor de diccionarios" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Puerto: El puerto del servidor de diccionarios" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Quitar una fuente" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Para quitar una fuente, efectúe los siguientes pasos:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Seleccione la fuente que quiere quitar" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Pulse en el botón <guibutton>Quitar</guibutton>." + +#: C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Si quita una fuente de diccionario se borrará permanentemente de la lista de " +"fuentes disponibles. Además, como algunas fuentes quizá estén definidas para " +"todo el sistema, no podrá quitarlas a no ser que tenga los derechos de " +"propiedad adecuados." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Opciones de impresión" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Muestra la solapa Impresión dentro del diálogo de Preferencias." + +#: C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Si quiere cambiar el nombre de la tipografía y el tamaño usado al imprimir, " +"realice los siguientes pasos:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Pulse en el botón <guilabel>Tipografía de impresión</guilabel>" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Seleccione el tamaño y la tipografía que desea usar" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Pulse en <guibutton>Aceptar</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "La miniaplicación del Diccionario" + +#: C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"La aplicación <application>Diccionario</application> viene con una " +"miniaplicación para el panel, la <application>Miniaplicación del " +"diccionario</application>. Puede añadir la miniaplicación " +"<application>Miniaplicación del diccionario</application> a un panel y " +"buscar palabras en los diccionarios." + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Ventana de la miniaplicación del diccionario" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Muestra la miniaplicación del diccionario." + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Para iniciar la miniaplicación del diccionario" + +#: C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"Para añadir una <application>Miniaplicación del diccionario</application> a " +"un panel, pulse con el botón derecho en el panel, después elija " +"<guimenuitem>Añadir al panel</guimenuitem>. Seleccione " +"<application>Diccionario</application> en el diálogo <application>Añadir al " +"panel</application>, después pulse <guibutton>Aceptar</guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Uso de la miniaplicación del diccionario" + +#: C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"Para buscar una palabra, tecléela en el <guilabel>campo de entrada</" +"guilabel>, y pulse la tecla <keycap>Retorno</keycap> o pulse con el botón " +"derecho en el icono del diccionario y después elija <guimenuitem>Buscar</" +"guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Si se encuentra alguna definición de la palabra, aparecerá una ventana, con " +"el texto de las definiciones:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Muestra la ventana principal de la miniaplicación del diccionario." + +#: C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Pulse <guibutton>Guardar</guibutton> para guardar las definiciones a un " +"archivo de texto. Pulse <guibutton>Imprimir</guibutton> para imprimir las " +"definiciones. Pulse <guibutton>Limpiar</guibutton> para limpiar las " +"definiciones." + +#: C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Puede hacer desaparecer la ventana pulsando con el botón izquierdo en el " +"icono del diccionario o pulsando la tecla <keycap>Esc</keycap>." + +#: C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"Para configurar la <application>Miniaplicación del diccionario</" +"application>, pulse con el botón derecho del ratón en el icono del " +"diccionario, después elija <guimenuitem>Preferencias</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"El diálogo <guilabel>Preferencias</guilabel> es el mismo usado por la " +"aplicación <application>Diccionario</application>, así que vea la <xref " +"linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "" +"Jorge González <[email protected]>, 2005, 2007-2008.\n" +"Francisco Javier F. Serrador <[email protected]> 2006." + diff --git a/mate-dictionary/help/es/figures/mate-dictionary-add-source.png b/mate-dictionary/help/es/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..c27d6ed0 --- /dev/null +++ b/mate-dictionary/help/es/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/es/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/es/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..bdc883a4 --- /dev/null +++ b/mate-dictionary/help/es/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/es/figures/mate-dictionary-application.png b/mate-dictionary/help/es/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..758ad6d6 --- /dev/null +++ b/mate-dictionary/help/es/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/es/figures/mate-dictionary-find.png b/mate-dictionary/help/es/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..e75b29ff --- /dev/null +++ b/mate-dictionary/help/es/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/es/figures/mate-dictionary-lookup.png b/mate-dictionary/help/es/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..0bfc197a --- /dev/null +++ b/mate-dictionary/help/es/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/es/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/es/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..e62d737a --- /dev/null +++ b/mate-dictionary/help/es/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/es/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/es/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..7a5ab588 --- /dev/null +++ b/mate-dictionary/help/es/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/eu/eu.po b/mate-dictionary/help/eu/eu.po new file mode 100644 index 00000000..fb8589ea --- /dev/null +++ b/mate-dictionary/help/eu/eu.po @@ -0,0 +1,448 @@ +# translation of dictionary_help.HEAD.po to Basque +# Iñaki Larrañaga Murgoitio <[email protected]>, 2008. +msgid "" +msgstr "" +"Project-Id-Version: dictionary_help.HEAD\n" +"POT-Creation-Date: 2007-09-04 03:34+0100\n" +"PO-Revision-Date: 2008-12-14 19:25+0100\n" +"Last-Translator: Iñaki Larrañaga Murgoitio <[email protected]>\n" +"Language-Team: Basque <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" +msgstr "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" +msgstr "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" +msgstr "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Hiztegiaren eskuliburua" + +#: C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Definizioak bilatzeko eta hitzen ortografia zuzentzeko aukera ematen dizu hiztegiak." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "MATEren dokumentazio-proiektua" + +#: C/mate-dictionary.xml:2(para) +msgid "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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +msgstr "Baimena ematen da dokumentu hau kopiatu, banatu eta/edo aldatzeko Free Software Foundation-ek argitaratutako GNU Dokumentazio Librearen Lizentziaren 1.1. bertsioan edo berriago batean ezarritako baldintzak betetzen badira; Atal Aldaezinik, Aurreko azaleko testurik eta Atzeko azaleko testurik gabe. GFDL lizentziaren kopia <ulink type=\"help\" url=\"ghelp:fdl\">esteka honetan</ulink> edo eskuliburu honekin batera ematen den COPYING-DOCS fitxategian aurkituko duzu." + +#: C/mate-dictionary.xml:12(para) +msgid "This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the license to the manual, as described in section 6 of the license." +msgstr "Eskuliburu hau GFDL lizentziarekin banatzen diren MATE eskuliburuen bildumakoa da. Eskuliburu hau bildumatik bereizita banatu nahi baduzu, bana dezakezu, baina eskuliburuari lizentziaren kopia bat gehitu beharko diozu, lizentzian bertan 6. atalean azaltzen den bezala." + +#: C/mate-dictionary.xml:19(para) +msgid "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters." +msgstr "Enpresek euren produktu eta zerbitzuak bereizteko erabiltzen dituzten izen asko marka erregistratu moduan hartu behar dira. Izen horiek MATEren edozein agiritan agertzen direnean, eta MATEren Dokumentazio Proiektuko kideak marka komertzialak direla konturatu badira, orduan izen horiek maiuskulaz idatzita egongo dira, osorik edo hasierako letra maiuskulaz jarrita." + +#: C/mate-dictionary.xml:35(para) +msgid "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "DOKUMENTUA \"DAGOEN-DAGOENEAN\" EMATEN DA, INOLAKO BERMERIK GABE, EZ ESPRESUKI ADIERAZITAKORIK ETA EZ INPLIZITURIK ERE; BESTEAK BESTE (MUGARIK GABE), EZ DA BERMATZEN DOKUMENTUA EDO BERTSIO ALDATUA AKATSIK GABEA DENIK, MERKATURATZEKO EDO XEDE JAKIN BATERAKO EGOKIA DENIK EDO ARAURIK HAUSTEN EZ DUENIK. DOKUMENTUAREN EDO DOKUMENTUAREN BERTSIO ALDATUAREN KALITATEARI, ZEHAZTASUNARI ETA PERFORMANTZIARI BURUZKO ERANTZUKIZUN OSOA ZUREA DA. DOKUMENTUREN BATEK EDO BERTSIO ALDATUREN BATEK EDOZEIN MOTATAKO AKATSIK IZANEZ GERO, ZUK (EZ HASIERAKO IDAZLEAK, EZ EGILEAK ETA EZ INONGO KOLABORATZAILEK) ZEURE GAIN HARTU BEHARKO DUZU BERRIKUSTEKO, KONPONTZEKO EDO ZUZENTZEKO BEHARREZKO ZERBITZU GUZTIEN KOSTUA. BERME-UKATZE HAU LIZENTZIA HONEN FUNTSEZKO ZATIA DA. EZ DA BAIMENIK EMATEN EZEIN DOKUMENTU EDO BERTSIO ALDATU ERABILTZEKO, BALDIN ETA EZ BADA BERME-UKATZE HAU ONARTZEN." + +#: C/mate-dictionary.xml:55(para) +msgid "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES." +msgstr "EZINGO DA INONGO ZIRKUNSTANTZIA EDO LEGE-TEORIARIK OINARRI HARTU --EZ ERANTZUKIZUN ZIBILARI BURUZKORIK (ZABARKERIA BARNE HARTUTA) EZ KONTRATUARI BURUZKORIK, EZ BESTERIK-- DOKUMENTU HONEN EDO BERTSIO ALDATU BATEN EGILEA, HASIERAKO IDAZLEA, EDOZEIN KOLABORATZAILE EDO BANATZAILE, EDO ALDERDI HORIEN EDOZEIN HORNITZAILE BESTE PERTSONA BATEN AURREAN ERANTZULE EGITEKO, PERTSONA HORREK EDOZEIN MOTATAKO KALTE ZUZENEKO, ZEHARKAKO, BEREZI, INTZIDENTAL EDO ONDORIOZKOAK JASAN DITUELAKO, BESTEAK BESTE (MUGARIK GABE), BEZEROAK GALTZEAREN, LANA ETEN BEHARRAREN, ORDENAGAILUAK EZ IBILTZEAREN EDO GAIZKI IBILTZEAREN ONDORIOZKO KALTEAK, EDO DOKUMENTUA NAHIZ HAREN BERTSIO ALDATUAK ERABILTZETIK ONDORIOZTATZEN DIREN EDO ERABILERA HORREKIN ZERIKUSIA DUEN EDOZEIN KALTE EDO GALERA, ALDERDIARI KALTE HORIEK GERTA ZITEZKEELA ADITZERA EMAN BAZAIO ERE." + +#: C/mate-dictionary.xml:28(para) +msgid "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: <placeholder-1/>" +msgstr "DOKUMENTUA ETA DOKUMENTUAREN BERTSIO ALDATUAK GNU DOKUMENTAZIO LIBREAREN LIZENTZIAREN BALDINTZEN ARABERA EMATEN DIRA, ETA ONDOREN ZEHAZTEN DIRENAK ONARTZERA BEHARTZEN DUTE: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Hiztegiaren eskuliburua 1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "2005eko urtarrila" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Eskuliburu honetan Hiztegiaren 2.14.0 bertsioa azaltzen da." + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Ohar-bidaltzea" + +#: C/mate-dictionary.xml:91(para) +msgid "To report a bug or make a suggestion regarding the Dictionary application or this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "Hiztegiari buruzko akatsen berri emateko edo oharrak bidaltzeko, <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATEra oharrak bidaltzeko orria</ulink>n aurkituko dituzu argibideak." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Hiztegia" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Sarrera" + +#: C/mate-dictionary.xml:109(para) +msgid "The <application>Dictionary</application> application enables you to search words and terms on a dictionary source." +msgstr "Hiztegian hitzak eta terminoak bilatzeko aukera ematen du <application>Hiztegia</application> aplikazioak." + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Erabiltzen hastea" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Hiztegia abiaraztea" + +#: C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "Aukera hauek dituzu <application>Hiztegia</application> abiarazteko:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "<guimenu>Aplikazioak</guimenu> menua" + +#: C/mate-dictionary.xml:129(para) +msgid "Choose <menuchoice><guisubmenu>Accessories</guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "Aukeratu <menuchoice><guisubmenu>Gehigarriak</guisubmenu><guimenuitem>Hiztegia</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Komando-lerroa" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Exekutatu komando hau: <command>mate-hiztegia</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "Abiarazi ondoren, <application>Hiztegia</application>ren leihoa bistaratzen da:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Hiztegiaren leihoa" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Hiztegiaren leiho nagusia erakusten du." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Erabilera" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Hitza bilatzea" + +#: C/mate-dictionary.xml:168(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel> and press <keycap>Enter</keycap>." +msgstr "Hitz bat bilatzeko, idatzi hitza <guilabel>sarreraren eremua</guilabel>n, eta sakatu <keycap>Sartu</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "If some definition for the word is found, it will appear inside the main window area:" +msgstr "Hitzaren definizioren bat aurkitzen badu, leiho-area nagusian azalduko da:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Hiztegiaren leiho nagusiaren barruan erakusten du definizioa." + +#: C/mate-dictionary.xml:186(para) +msgid "Otherwise, an error dialog will appear, with a message explaining the nature of the error." +msgstr "Bestela, errorearen elkarrizketa-koadroa eta errorearen izaera azaltzen duen mezu bat azalduko dira." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Bilaketaren emaitzak gordetzea" + +#: C/mate-dictionary.xml:194(para) +msgid "To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialog, then click <guibutton>Save</guibutton>." +msgstr "Bilaketa baten emaitzak gordetzeko, aukeratu <menuchoice><guimenu>Fitxategia</guimenu><guimenuitem>Gorde kopia</guimenuitem></menuchoice>. Idatzi fitxategiaren izena <guilabel>Gorde kopia</guilabel> elkarrizketa-koadroan, eta sakatu <guibutton>Gorde</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Bilaketaren emaitzak inprimatzea" + +#: C/mate-dictionary.xml:201(para) +msgid "To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "Bilaketa baten emaitzak inprimatzeko, aukeratu <menuchoice><guimenu>Fitxategia</guimenu><guimenuitem>Inprimatu</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "Inside the <guilabel>Print</guilabel> dialog you can select the printer to use, the paper format, the number of copies." +msgstr "Inprimagailua, paper-formatua eta kopia kopurua aukeratu ditzakezu <guilabel>Inprimatu</guilabel> elkarrizketa-koadroan." + +#: C/mate-dictionary.xml:206(para) +msgid "To see a preview of what will be printed, click <guibutton>Preview</guibutton>." +msgstr "Inprimatuko duzuna aurrez ikusteko, egin klik <guibutton>Aurrebista</guibutton>n." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Inprimatzeko, egin klik <guibutton>Inrpimatu</guibutton> botoian." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Testua bilatzea" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Hiztegiaren bilaketa-panela erakusten du leiho nagusiaren barruan." + +#: C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "Bilaketa baten emaitzetan testu bat bilatzeko, jarraitu urrats hauei:" + +#: C/mate-dictionary.xml:233(para) +msgid "Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "<guilabel>Bilatu</guilabel> panela bistaratzeko, aukeratu <menuchoice><guimenu>Editatu</guimenu><guimenuitem>Bilatu</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "Idatzi bilatu nahi duzun testua <guilabel>Bilaketa</guilabel> sarreran." + +#: C/mate-dictionary.xml:237(para) +msgid "To find the next occurrence of the text, click <guibutton>Next</guibutton>. To find the previous occurrence of the text, click <guibutton>Previous</guibutton>." +msgstr "Testuaren hurrengo agerraldia bilatzeko, egin klik <guibutton>Hurrengoa</guibutton> botoian. Testuaren aurreko agerraldia bilatzeko, egin klik <guibutton>Aurrekoa</guibutton> botoian." + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Hobespenak" + +#: C/mate-dictionary.xml:250(para) +msgid "To change the <application>Dictionary</application> application preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>." +msgstr "<application>Hiztegia</application> aplikazioaren hobespenak aldatzeko, aukeratu <menuchoice><guimenu>Editatu</guimenu><guimenuitem>Hobespenak</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Hiztegiaren iturburuak" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Hobespenen elkarrizketa-koadroko Iturburua fitxa erakusten du." + +#: C/mate-dictionary.xml:269(para) +msgid "To change the dictionary source used to look up words, select the desired source from the list." +msgstr "Hitzak bilatzeko erabilitako hiztegiaren iturburua aldatzeko, zerrendan aukeratu nahi duzun iturria." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Iturburu berri bat gehitzea" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "'Gehitu iturburua' elkarrizketa-koadroa erakusten du." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Hiztegi-iturburu bat gehitzeko, jarraitu urrats hauei:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Egin klik <guibutton>Gehitu</guibutton> botoian." + +#: C/mate-dictionary.xml:293(para) +msgid "Edit the name of the new source inside the <guilabel>Description</guilabel> entry" +msgstr "Editatu iturburu berriaren izena <guilabel>Azalpena</guilabel> sarreran." + +#: C/mate-dictionary.xml:294(para) +msgid "Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box" +msgstr "Aldatu iturburu berriaren garraio mota, <guilabel>Garraioa</guilabel> konbinazio-koadroa erabiliz." + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Editatu iturburu berriaren atributuak" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Sakatu <guibutton>Gehitu</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "Different source transport types uses different attributes. This is the list of available attributes per transport type:" +msgstr "Iturburuen garraio mota desberdinek, atributu desberdinak erabiltzen dituzte. Hau da garraio mota bakoitzean erabilgarri dauden atributuen zerrenda:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Garraioa" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Atributuak" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Hiztegi-zerbitzaria" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Ostalari-izena: hiztegi-zerbitzariaren ostalari-izena" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Ataka: hiztegi-zerbitzariaren ataka" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Iturburu bat kentzea" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Hiztegi-iturburu bat kentzeko, jarraitu urrats hauei:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Hautatu kendu nahi duzun iturburua:" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Egin klik <guibutton>Kendu</guibutton> botoian." + +#: C/mate-dictionary.xml:335(para) +msgid "If you remove a dictionary source it will be permanently deleted from the list of available sources. Also, as some sources might be defined system-wide you may actually not be able to remove them unless you have the right ownership privileges." +msgstr "Hiztegi-iturburu bat kentzen baduzu, betiko ezabatzen da iturburu erabilgarrien zerrendatik. Litekeena da zenbait iturburu sistema osorako finkatuta egotea; beraz,, ezingo dituzu kendu jabetza-pribilegio egokiak izan ezean." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Inprimatzeko aukerak" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Hobespenen elkarrizketa-koadroko inprimatzeko fitxa erakusten du ." + +#: C/mate-dictionary.xml:358(para) +msgid "If you want to change the font name and size used when printing, perform the following steps:" +msgstr "Inprimatzean erabiltzen diren letra-tipoa eta letra-tamaina aldatu nahi badituzu, jarraitu urrats hauei:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Egin klik <guilabel>Inprimatzeko letra-tipoa</guilabel> botoian" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Aukeratu erabili nahi dituzun letra-tipoa eta letra-tamaina" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Egin klik <guibutton>Ados</guibutton> botoian." + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Hiztegia miniaplikazioa" + +#: C/mate-dictionary.xml:375(para) +msgid "The <application>Dictionary</application> application comes with a panel applet, the <application>Dictionary Applet</application>. You can add the <application>Dictionary Applet</application> applet to a panel and look up words in dictionaries." +msgstr "<application>Hiztegia</application> aplikaziorekin batera paneleko miniaplikazioa dator: <application>Hiztegia miniaplikazioa</application>. <application>Hiztegia miniaplikazioa</application> panel bati gehitu eta hitzak bila ditzakezu hiztegietan." + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Hiztegia miniaplikazioaren leihoa" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Hiztegia miniaplikazioa erakusten du" + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Hiztegia miniaplikazioa abiaraztea" + +#: C/mate-dictionary.xml:397(para) +msgid "To add <application>Dictionary Applet</application> to a panel, right-click on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select Dictionary Applet in the <application>Add to the panel</application> dialog, then click <guibutton>OK</guibutton>." +msgstr "<application>>Hiztegia miniaplikazioa</application> panel bati gehitzeko, egin klik eskuineko botoiaz panelean eta aukeratu <guimenuitem>Gehitu panelari</guimenuitem>. Hautatu Hiztegia miniaplikazioa <application>Gehitu panelari</application> elkarrizketa-koadroan, eta egin klik <guibutton>Ados</guibutton> botoian." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Hiztegia miniaplikazioa erabiltzea" + +#: C/mate-dictionary.xml:408(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel>, and press <keycap>Enter</keycap> or right-click on the dictionary icon and then choose <guimenuitem>Look up</guimenuitem>." +msgstr "Hitz bat bilatzeko, idatzi hitza <guilabel>sarreraren eremua</guilabel>n eta sakatu <keycap>Sartu</keycap>, edo egin klik eskuineko botoiaz hiztegiaren ikonoan eta aukeratu <guimenuitem>Bilatu</guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "If some definition for the word was found, a window will appear, with the text of the definitions:" +msgstr "Hitzaren definizioren bat aurkitzen badu, leiho bat azalduko da definizioaren testuarekin:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Hiztegia miniaplikazioaren leiho nagusia erakusten du." + +#: C/mate-dictionary.xml:428(para) +msgid "Click <guibutton>Save</guibutton> to save the definitions to a text file. Click <guibutton>Print</guibutton> to print the definitions. Click <guibutton>Clear</guibutton> to clear the definitions." +msgstr "Definizioak testu fitxategi batean gordetzeko, egin klik <guibutton>Gorde</guibutton> botoian. Definizioak inprimatzeko, egin klik <guibutton>Inprimatu</guibutton>n. Definizioak garbitzeko, egin klik <guibutton>Garbitu</guibutton>n." + +#: C/mate-dictionary.xml:432(para) +msgid "You can make the window disappear by left-clicking on the dictionary icon or by pressing <keycap>Esc</keycap>." +msgstr "Leihoa desagerraraz dezakezu hiztegiaren ikonoan ezkerreko botoiaz klik eginez edo <keycap>Ihes</keycap> sakatuz." + +#: C/mate-dictionary.xml:440(para) +msgid "To configure the <application>Dictionary Applet</application>, right-click on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "<application>Hiztegia miniaplikazioa</application> konfiguratzeko, egin klik eskuineko botoiaz hiztegiaren ikonoan eta aukeratu <guimenuitem>Hobespenak</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "The <guilabel>Preferences</guilabel> dialog is the same used by the <application>Dictionary</application> application, so refer to <xref linkend=\"mate-dictionary-preferences\"/>" +msgstr "<guilabel>Hobespenak</guilabel> elkarrizketa-koadroa <application>Hiztegia</application> aplikazioak erabiltzen duena bezalakoa da, beraz kontsultatu <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Hizkuntza Politikarako Sailburuordetza <[email protected]>, 2008." + diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-add-source.png b/mate-dictionary/help/eu/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..ae7b8f24 --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/eu/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..11ba6f32 --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-applet.png b/mate-dictionary/help/eu/figures/mate-dictionary-applet.png Binary files differnew file mode 100644 index 00000000..2762fb6a --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-applet.png diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-application.png b/mate-dictionary/help/eu/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..9bf2c15b --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-find.png b/mate-dictionary/help/eu/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..daa32fcf --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-lookup.png b/mate-dictionary/help/eu/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..e62ee1a1 --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/eu/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..d429da18 --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/eu/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/eu/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..fb19c256 --- /dev/null +++ b/mate-dictionary/help/eu/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/fi/fi.po b/mate-dictionary/help/fi/fi.po new file mode 100644 index 00000000..9dbd8688 --- /dev/null +++ b/mate-dictionary/help/fi/fi.po @@ -0,0 +1,491 @@ +# mate-dictionary's Finnish translation. +# Copyright (C) 2008 Free Software Foundation, Inc. +# Jukka Heikkilä <[email protected]>, 2008. +# Tommi Vainikainen <[email protected]> (Legal Notices), 2006. +# + +msgid "" +msgstr "" +"Project-Id-Version: mate-utils-mate-dictionary doc\n" +"POT-Creation-Date: 2008-05-16 06:41+0000\n" +"PO-Revision-Date: 2008-06-10 12:49+0300\n" +"Last-Translator: Jukka Heikkilä <[email protected]>\n" +"Language-Team: Finnish <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "@@image: 'figures/mate-dictionary-application.png'; md5=e840761a38bf60ed9b7532681697fbce" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "@image: 'figures/mate-dictionary-lookup.png'; md5=9119ae2e2acc72e2cd4bc4b909c840a0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "@@image: 'figures/mate-dictionary-find.png'; md5=38c983c987413f5b0a7c0e9543f29ef5" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" +msgstr "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=213f1d528bae7044480e00f6a444c0ed" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" +msgstr "@@image: 'figures/mate-dictionary-add-source.png'; md5=7cc4dd65384ff3a14a92872b7e0dcbb9" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=e64b7264281169d4ac3be8321ccb6489" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" +msgstr "@@image: 'figures/mate-dictionary-applet.png'; md5=f295de193f0828b3f656f7916824fb49" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "@@image: 'figures/mate-dictionary-applet-window.png'; md5=5ca039868bd111287c098f1e8b5b97d7" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Sanakirjan käyttöohje" + +#: C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Sanakirja mahdollistaa oikeiden määritelmien ja kirjoitusasun tarkistamisen." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Mate dokumentointiprojekti" + +#: C/mate-dictionary.xml:2(para) +msgid "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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Tätä asiakirjaa saa kopioida, jakaa edelleen ja/tai muokata Free Software " +"Foundationin julkaiseman GNU Free Documentation Licensen (GFDL) version 1.1 " +"tai valinnaisesti myöhemmän version mukaisesti, ilman vaatimuksia " +"muuttamattomista osioista ja etu- tai takakansiteksteistä. Kopion GFDL:stä " +"voi nähdä napsauttamalla <ulink type=\"help\" url=\"ghelp:fdl\">tätä " +"linkkiä</ulink>, tai lukemalla ohjeen mukana toimitetun COPYING-DOCS-nimisen " +"tiedoston." + +#: C/mate-dictionary.xml:12(para) +msgid "This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the license to the manual, as described in section 6 of the license." +msgstr "" +"Tämä käyttöohje on osa Maten käyttöohjekokoelmaa, jota levitetään GFDL-" +"lisenssin alaisena. Jos haluat levittää tätä käyttöohjetta erillään " +"kokoelmasta, voit tehdä sen liittämällä lisenssin kopion ohjeen mukaan, " +"kuten lisenssin luku 6 sanelee." + +#: C/mate-dictionary.xml:19(para) +msgid "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters." +msgstr "" +"Monet nimistä, joita yhtiöt käyttävät tuotteistansa ja palveluistansa, ovat " +"tuotemerkkejä. Maten dokumentointiprojektissa nämä nimet pyritään " +"kirjoittamaan suuraakkosin tai isolla alkukirjaimella, sikäli kun projektin " +"jäsenet tietävät kyseisistä tuotemerkeistä." + +#: C/mate-dictionary.xml:35(para) +msgid "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"ASIAKIRJA TARJOTAAN SELLAISENAAN, ILMAN MINKÄÄNLAISTA KIRJATTUA TAI " +"KONKLUDENTTISTA RAJATONTA TAKUUTA ASIAKIRJAN TAI SEN MUOKATUN VERSION " +"VIRHEETTÖMYYDESTÄ, SOPIVUUDESTA KAUPALLISEEN KÄYTTÖÖN TAI TIETTYYN " +"KÄYTTÖTARKOITUKSEEN TAI LOUKKAAMATTOMUUDESTA. TÄYSI VASTUU ASIAKIRJAN TAI " +"SEN MUOKATUN VERSION LAADUSTA, TARKKUUDESTA JA TOIMIVUUDESTA ON KÄYTTÄJÄLLÄ. " +"JOS ASIAKIRJA TAI SEN MUOKATTU VERSIO OSOITTAUTUU JOLLAKIN TAVALLA " +"VIRHEELLISEKSI, KÄYTTÄJÄ (EI ALKUPERÄINEN KIRJOITTAJA TAI MUU TEKIJÄ) VASTAA " +"PALVELUJEN, KORJAUSTEN TAI OIKAISUJEN KUSTANNUKSISTA. TÄMÄ " +"VASTUUVAPAUSLAUSEKE ON EROTTAMATON OSA LISENSSIÄ. ASIAKIRJAN TAI SEN " +"MUOKATTUJEN VERSIOIDEN KÄYTTÖ ON SALLITTUA VAIN TÄMÄN VASTUUVAPAUSLAUSEKKEEN " +"NOJALLA; SEKÄ" + +#: C/mate-dictionary.xml:55(para) +msgid "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"MISSÄÄN OLOSUHTEISSA TAI MINKÄÄN OIKEUSLAITOKSEN ALAISUUDESSA, NIIN " +"OIKEUSLOUKKAUKSISSA (MUKAAN LUKIEN HUOLIMATTOMUUS), SOPIMUS TAI MUUTOIN, " +"ASIAKIRJAN TAI SEN MUOKATUN VERSION TEKIJÄ, ALKUPERÄINEN KIRJOITTAJA, KUKAAN " +"AVUSTAJISTA, KUKAAN LEVITTÄJÄ TAIKKA KUKAAN TARJOAJA EI OLE VASTUUSSA " +"KENELLEKÄÄN SUORASTA, EPÄSUORASTA, ERITYISESTÄ, TAPATURMAISESTA TAI " +"VÄLILLISESTÄ VAHINGOSTA SISÄLTÄEN RAJOITUKSETTA VAHINGOT LIIKEARVON " +"MENETYKSESTÄ, TYÖN KESKEYTYMISESTÄ, TIETOKONEVIRHEESTÄ TAI -HÄIRIÖSTÄ TAIKKA " +"MISTÄÄN MUUSTA VAHINGOSTA TAI MENETYKSESTÄ, JOKA ILMENEE TAI LIITTYY " +"ASIAKIRJAN TAI SEN MUOKATUN VERSION KÄYTTÖÖN EDES SILLOIN KUN OSAPUOLTA ON " +"OLLUT TIETOINEN TÄLLAISEN VAHINGON MAHDOLLISUUDESTA." + +#: C/mate-dictionary.xml:28(para) +msgid "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: <placeholder-1/>" +msgstr "" +"ASIAKIRJA SEKÄ MUOKATUT VERSIOT ASIAKIRJASTA TARJOTAAN GNU FREE " +"DOCUMENTATION LICENSEN EHDOIN SEKÄ YMMÄRTÄEN ETTÄ: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Sanakirjan käyttöohje V1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Tammikuu 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Tämä käyttöohje kattaa Sanakirjan version 2.14.0." + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Palaute" + +#: C/mate-dictionary.xml:91(para) +msgid "To report a bug or make a suggestion regarding the Dictionary application or this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Ilmoittaaksesi viasta tai tehdäksesi ehdotuksen koskien Sanakirja -sovelmaa tai tätä käyttöohjetta, seuraa ohjeita <ulink url=\"ghelp:mate-feedback\" type=\"help\">Mate palautesivulla</ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Sanakirja" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Johdanto" + +#: C/mate-dictionary.xml:109(para) +msgid "The <application>Dictionary</application> application enables you to search words and terms on a dictionary source." +msgstr "<application>Sanakirja</application> -sovellus mahdollistaa sanojen ja termien haun sanakirjalähteistä" + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Aloitustoimet" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Sanakirjan käynnistäminen" + +#: C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "Voit käynnistää <application>Sanakirja</application> -sovelluksen seuraavilla tavoilla:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "<guimenu>Sovellukset</guimenu> -valikosta" + +#: C/mate-dictionary.xml:129(para) +msgid "Choose <menuchoice><guisubmenu>Accessories</guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "Valitse <menuchoice><guisubmenu>Apuohjelmat</guisubmenu><guimenuitem>Sanakirja</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Komentoriviltä" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Suorita komento: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "Ensimmäisen käynnistyskerran jälkeen <application>Sanakirja</application> -ikkuna näyttää seuraavalta:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Sanakirja -sovelluksen ikkuna" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Sanakirjan pääikkuna." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Käyttö" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Sanan etsiminen" + +#: C/mate-dictionary.xml:168(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel> and press <keycap>Enter</keycap>." +msgstr "Etsiäksesi sanaa, kirjoita <guilabel>tekstikenttään</guilabel> ja paina <keycap>Enter</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "If some definition for the word is found, it will appear inside the main window area:" +msgstr "Mikäli joitain määritelmiä sanalle löytyy, ilmestyy se pääikkunan ruutuun:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Määritelmä näkyy Sanakirjan pääikkunassa." + +#: C/mate-dictionary.xml:186(para) +msgid "Otherwise, an error dialog will appear, with a message explaining the nature of the error." +msgstr "Muussa tapauksessa näytetään virhesanoma, joka kertoo virheen luonteen." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Haun tuloksen tallentaminen" + +#: C/mate-dictionary.xml:194(para) +msgid "To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialog, then click <guibutton>Save</guibutton>." +msgstr "Tallentaaksesi hakutuloksen, valitse <menuchoice><guimenu>Tiedosto</guimenu><guimenuitem>Tallenna kopio</guimenuitem></menuchoice>. Anna tiedostonimi <guilabel>Tallenna kopio</guilabel> valintaikkunaan ja napsauta <guibutton>Tallenna</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Haun tuloksen tulostaminen" + +#: C/mate-dictionary.xml:201(para) +msgid "To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "Tulostaaksesi haun tuloksen, valitse <menuchoice><guimenu>Tiedosto</guimenu><guimenuitem>Tulosta</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "Inside the <guilabel>Print</guilabel> dialog you can select the printer to use, the paper format, the number of copies." +msgstr "<guilabel>Tulosta</guilabel> -valintaikkunasta voit valita haluamasi tulostimen, paperityypin ja tulostusmäärän." + +#: C/mate-dictionary.xml:206(para) +msgid "To see a preview of what will be printed, click <guibutton>Preview</guibutton>." +msgstr "Mikäli haluat tarkistaa, miltä tulostus näyttää, napsauta <guibutton>Esikatselu</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Tulostaaksesi haun, napsauta <guibutton>Tulosta</guibutton>." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Etsi teksti" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Sanakirjan hakuruutu pääikkunassa." + +#: C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "Etsiäksesi tekstin hakutuloksesta, toimi seuraavasti:" + +#: C/mate-dictionary.xml:233(para) +msgid "Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "Valitse <menuchoice><guimenu>Muokkaa</guimenu><guimenuitem>Etsi</guimenuitem></menuchoice> avataksesi <guilabel>Etsi</guilabel> -ruudun." + +#: C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "Kirjoita <guilabel>Etsi</guilabel> -hekukenttään teksti, jonka haluat etsiä." + +#: C/mate-dictionary.xml:237(para) +msgid "To find the next occurrence of the text, click <guibutton>Next</guibutton>. To find the previous occurrence of the text, click <guibutton>Previous</guibutton>." +msgstr "Etsiäksesi seuraavan esiintymän tekstistä, napsauta <guibutton>Seuraava</guibutton>-painiketta. Etsiäksesi edellisen esiintymän tekstistä, napsauta <guibutton>Edellinen</guibutton>." + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Asetukset" + +#: C/mate-dictionary.xml:250(para) +msgid "To change the <application>Dictionary</application> application preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>." +msgstr "Muuttaaksesi <application>Sanakirja</application>-sovelluksen asetuksia, napsauta <menuchoice><guimenu>Muokkaa</guimenu><guimenuitem>Asetukset</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Sanakirjan lähteet" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Lähde-välilehti Asetukset-ikkunassa" + +#: C/mate-dictionary.xml:269(para) +msgid "To change the dictionary source used to look up words, select the desired source from the list." +msgstr "Sanakirjan lähteen saat muutettua valitsemalla listalta haluamasi lähteen." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Uuden lähteen asettaminen" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Lisää lähde -valintaikkuna." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Lisätäksesi uuden sanakirjan lähteen, toimi seuraavasti:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Napsauta <guibutton>Lisää</guibutton>-painiketta" + +#: C/mate-dictionary.xml:293(para) +msgid "Edit the name of the new source inside the <guilabel>Description</guilabel> entry" +msgstr "Muokkaa uuden lähteen nimi <guilabel>Kuvaus</guilabel>-kenttään" + +#: C/mate-dictionary.xml:294(para) +msgid "Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box" +msgstr "Valitse uudelle lähteelle siirtoyhteyden tyyppi <guilabel>Siirtoyhteys</guilabel> -valintalaatikosta" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Muokkaa uuden lähteen määritykset" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Napsauta <guibutton>Lisää</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "Different source transport types uses different attributes. This is the list of available attributes per transport type:" +msgstr "Erilaiset siirtoyhteystyypit käyttää erilaisia määrityksiä. Seuraava lista esittää eri siirtoyhteystyyppien mahdolliset määritykset:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Siirtoyhteys" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Määritykset" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Sanakirjapalvelin" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Palvelin: Sanakirjapalvelimen osoite" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Portti: Sanakirjapalvelimen portti" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Lähteen poisto" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Poistaaksesi sanakirjan lähteen, toimi seuraavasti:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Valitse lähde, jonka haluat poistaa" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Napsauta <guibutton>Poista</guibutton> -painiketta" + +#: C/mate-dictionary.xml:335(para) +msgid "If you remove a dictionary source it will be permanently deleted from the list of available sources. Also, as some sources might be defined system-wide you may actually not be able to remove them unless you have the right ownership privileges." +msgstr "Jos poistat sanakirjan lähteen, se poistetaan lopullisesti käytettävissä olevien lähteiden listasta. Myös jotkin lähteet voivat olla määritetty kattamaan koko järjestelmän, jolloin et voi poistaa niitä, mikäli sinulla ei ole oikeita käyttöoikeuksia." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Tulostuksen asetukset" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Tulostus -välilehti Asetukset -valintaikkunassa." + +#: C/mate-dictionary.xml:358(para) +msgid "If you want to change the font name and size used when printing, perform the following steps:" +msgstr "Jos tahdot muuttaa tulostuksessa käytettävän kirjasimen nimeä tai kokoa, toimi seuraavasti:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Napsauta <guilabel>Tulostuksen kirjaisin</guilabel> -painiketta" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Valitse haluamasi kirjaisin ja sen koko" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Napsauta <guibutton>OK</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Sanakirja -sovelma" + +#: C/mate-dictionary.xml:375(para) +msgid "The <application>Dictionary</application> application comes with a panel applet, the <application>Dictionary Applet</application>. You can add the <application>Dictionary Applet</application> applet to a panel and look up words in dictionaries." +msgstr "<application>Sanakirja</application> -sovelluksen mukana tulee paneelissa toimiva <application>Sanakirja -sovelma</application>. Voit lisätä <application>Sanakirja</application> -sovelman paneeliin ja hakea sanoja sanakirjoista." + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Sanakirja -sovelman ikkuna" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Sanakirja -sovelma" + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Sanakirja -sovelman käynnistäminen" + +#: C/mate-dictionary.xml:397(para) +msgid "To add <application>Dictionary Applet</application> to a panel, right-click on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select Dictionary Applet in the <application>Add to the panel</application> dialog, then click <guibutton>OK</guibutton>." +msgstr "Lisätäksesi <application>Sanakirja</application> -sovelman paneeliin, napsauta hiiren oikealla painikkeella paneelissa ja valitse ponnahdusvalikosta <guimenuitem>Lisää paneeliin</guimenuitem>. Valitse Sanakirja -sovelma <application>Lisää paneeliin</application> -valintaikkunasta ja napsauta <guibutton>OK</guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Sanakirja -sovelman käyttö" + +#: C/mate-dictionary.xml:408(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel>, and press <keycap>Enter</keycap> or right-click on the dictionary icon and then choose <guimenuitem>Look up</guimenuitem>." +msgstr "Hakeaksesi sanoja, kirjoita sana <guilabel>hakukenttään</guilabel> ja paina <keycap>Enter</keycap> tai napsauta hiiren oikealla painikkeella sanakirja ikonia ja valitse <guimenuitem>Etsi valittu teksti</guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "If some definition for the word was found, a window will appear, with the text of the definitions:" +msgstr "Mikäli jotain sanan selityksiä löytyy, avautuu ikkuna, jossa on sanalle selitys:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Sanakirja -sovelman pääikkuna." + +#: C/mate-dictionary.xml:428(para) +msgid "Click <guibutton>Save</guibutton> to save the definitions to a text file. Click <guibutton>Print</guibutton> to print the definitions. Click <guibutton>Clear</guibutton> to clear the definitions." +msgstr "Napsauta <guibutton>Tallenna</guibutton> -painiketta tallentaaksesi selityksen tekstitiedostoon. Napsauta <guibutton>Tulosta</guibutton> -painiketta tulostaaksesi selityksen. Napsauta <guibutton>Tyhjennä</guibutton> -painiketta tyhjentääksesi selityksen ruudulta." + +#: C/mate-dictionary.xml:432(para) +msgid "You can make the window disappear by left-clicking on the dictionary icon or by pressing <keycap>Esc</keycap>." +msgstr "Voit piilottaa ikkunan napsauttamalla hiiren vasemmalla painikkeella sanakirja -ikonia tai painamalla <keycap>Esc</keycap> -painiketta." + +#: C/mate-dictionary.xml:440(para) +msgid "To configure the <application>Dictionary Applet</application>, right-click on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "Muokataksesi <application>Sanakirja</application> -sovelman asetuksia, napsauta hiiren oikealla painikkeella sanakirja -ikonia ja valitse alasvetovalikosta <guimenuitem>Asetukset</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "The <guilabel>Preferences</guilabel> dialog is the same used by the <application>Dictionary</application> application, so refer to <xref linkend=\"mate-dictionary-preferences\"/>" +msgstr "<guilabel>Asetukset</guilabel> -valintaikkuna on samanlainen, kuin <application>Sanakirja</application> -sovelluksen, joten löydät lisätietoja kohdasta <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "" +"Jukka Heikkilä <[email protected]>, 2008\n" +"Tommi Vainikainen <[email protected]> (Legal Notices), 2006" diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-add-source.png b/mate-dictionary/help/fi/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..ac36d84c --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/fi/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..8573064b --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-applet.png b/mate-dictionary/help/fi/figures/mate-dictionary-applet.png Binary files differnew file mode 100644 index 00000000..3bd0ec91 --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-applet.png diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-application.png b/mate-dictionary/help/fi/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..b6c6d66a --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-find.png b/mate-dictionary/help/fi/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..2c901ce1 --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-lookup.png b/mate-dictionary/help/fi/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..1a4bf4eb --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/fi/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..3c398c15 --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/fi/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/fi/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..ff11c8e8 --- /dev/null +++ b/mate-dictionary/help/fi/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-add-source.png b/mate-dictionary/help/fr/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..cdc74604 --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/fr/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..5de80355 --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-applet.png b/mate-dictionary/help/fr/figures/mate-dictionary-applet.png Binary files differnew file mode 100644 index 00000000..3f25c155 --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-applet.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-application.png b/mate-dictionary/help/fr/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..c36a1ee6 --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-find.png b/mate-dictionary/help/fr/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..cee3cecf --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-lookup.png b/mate-dictionary/help/fr/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..822d178d --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/fr/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..2499130c --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/fr/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/fr/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..bc457dc8 --- /dev/null +++ b/mate-dictionary/help/fr/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/fr/fr.po b/mate-dictionary/help/fr/fr.po new file mode 100644 index 00000000..4e2a73f5 --- /dev/null +++ b/mate-dictionary/help/fr/fr.po @@ -0,0 +1,734 @@ +# French translation of mate-utils-dictionary documentation. +# Copyright (C) 2006 Free Software Foundation, Inc. +# This file is distributed under the same license as the mate-utils +# documentation package. +# +# Jonathan Ernst <[email protected]>, 2006. +# Claude Paroz <[email protected]>, 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: mate-utils-dictionary documentation\n" +"POT-Creation-Date: 2006-08-16 19:10+0200\n" +"PO-Revision-Date: 2006-07-28 23:24+0200\n" +"Last-Translator: Claude Paroz <[email protected]>\n" +"Language-Team: MATE French Team <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: French\n" +"X-Generator: KBabel 1.11.2\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: ../C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Manuel du dictionnaire" + +#: ../C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "" +"Le Dictionnaire permet de consulter des définitions et de corriger " +"l'orthographe." + +#: ../C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: ../C/mate-dictionary.xml:35(holder) ../C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: ../C/mate-dictionary.xml:48(publishername) +#: ../C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Le projet de documentation MATE" + +#: ../C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Permission vous est donnée de copier, distribuer et/ou modifier ce document " +"selon les termes de la Licence GNU Free Documentation License, Version 1.1 " +"ou ultérieure publiée par la Free Software Foundation sans section " +"inaltérable, sans texte de première page de couverture ni texte de dernière " +"page de couverture. Vous trouverez un exemplaire de cette licence en suivant " +"ce <ulink type=\"help\" url=\"ghelp:fdl\">lien</ulink> ou dans le fichier " +"COPYING-DOCS fourni avec le présent manuel." + +#: ../C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"Ce manuel fait partie de la collection de manuels MATE distribués selon les " +"termes de la licence de documentation libre GNU. Si vous souhaitez " +"distribuer ce manuel indépendamment de la collection, vous devez joindre un " +"exemplaire de la licence au document, comme indiqué dans la section 6 de " +"celle-ci." + +#: ../C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"La plupart des noms utilisés par les entreprises pour distinguer leurs " +"produits et services sont des marques déposées. Lorsque ces noms " +"apparaissent dans la documentation MATE et que les membres du projet de " +"Documentation MATE sont informés de l'existence de ces marques déposées, " +"soit ces noms entiers, soit leur première lettre est en majuscule." + +#: ../C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"LE PRÉSENT DOCUMENT EST FOURNI « TEL QUEL », SANS AUCUNE GARANTIE, EXPRESSE " +"OU IMPLICITE, Y COMPRIS, ET SANS LIMITATION, LES GARANTIES DE BONNE QUALITÉ " +"MARCHANDE OU D'APTITUDE À UN EMPLOI PARTICULIER OU AUTORISÉ DU DOCUMENT OU " +"DE SA VERSION MODIFIÉE. L'UTILISATEUR ASSUME TOUT RISQUE RELATIF À LA " +"QUALITÉ, À LA PERTINENCE ET À LA PERFORMANCE DU DOCUMENT OU DE SA VERSION DE " +"MISE À JOUR. SI LE DOCUMENT OU SA VERSION MODIFIÉE S'AVÉRAIT DÉFECTUEUSE, " +"L'UTILISATEUR (ET NON LE RÉDACTEUR INITIAL, L'AUTEUR, NI TOUT AUTRE " +"PARTICIPANT) ENDOSSERA LES COÛTS DE TOUTE INTERVENTION, RÉPARATION OU " +"CORRECTION NÉCESSAIRE. CETTE DÉNÉGATION DE RESPONSABILITÉ CONSTITUE UNE " +"PARTIE ESSENTIELLE DE CETTE LICENCE. AUCUNE UTILISATION DE CE DOCUMENT OU DE " +"SA VERSION MODIFIÉE N'EST AUTORISÉE AUX TERMES DU PRÉSENT ACCORD, EXCEPTÉ " +"SOUS CETTE DÉNÉGATION DE RESPONSABILITÉ ; " + +#: ../C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"EN AUCUNE CIRCONSTANCE ET SOUS AUCUNE INTERPRÉTATION DE LA LOI, QU'IL " +"S'AGISSE DE RESPONSABILITÉ CIVILE (Y COMPRIS LA NÉGLIGENCE), CONTRACTUELLE " +"OU AUTRE, L'AUTEUR, LE RÉDACTEUR INITIAL, TOUT PARTICIPANT ET TOUT " +"DISTRIBUTEUR DE CE DOCUMENTOU DE SA VERSION DE MISE À JOUR AINSI QUE TOUT " +"FOURNISSEUR DE QUELQUE PARTIE QUE CE SOIT NE POURRONT ÊTRE TENUS " +"RESPONSABLES À L'ÉGARD DE QUICONQUE POUR TOUT DOMMAGE DIRECT, INDIRECT, " +"PARTICULIER OU ACCIDENTEL DE TOUT TYPE Y COMPRIS, SANS LIMITATION, LES " +"DOMMAGES LIÉS À LA PERTE DE CLIENTÈLE, AUX ARRÊTS DE TRAVAIL, AUX " +"DÉFAILLANCES ET AUX DYSFONCTIONNEMENTS INFORMATIQUES OU TOUT AUTRE DOMMAGE " +"OU PERTE LIÉE À L'UTILISATION DU PRÉSENT DOCUMENT ET DE SES VERSIONS DE MISE " +"À JOUR, ET CE MÊME SI CES PARTIES ONT ÉTÉ INFORMÉES DE LA POSSIBILITÉ DE " +"TELS DOMMAGES." + +#: ../C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"LE PRÉSENT DOCUMENT ET SES VERSIONS MODIFIÉES SONT FOURNIS SELON LES TERMES " +"DE LA LICENCE DE DOCUMENTATION LIBRE GNU SACHANT QUE : <placeholder-1/>" + +#: ../C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: ../C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: ../C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: ../C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Manuel du dictionnaire V1.0.0" + +#: ../C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Janvier 2005" + +#: ../C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Ce manuel décrit la version 2.14.0 du dictionnaire" + +#: ../C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Votre avis" + +#: ../C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Pour rapporter une anomalie ou émettre une suggestion concernant le " +"Dictionnaire ou ce manuel, procédez comme indiqué sur la <ulink url=\"ghelp:" +"mate-feedback\" type=\"help\">page de réactions sur MATE</ulink>." + +#: ../C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Dictionnaire" + +#: ../C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Introduction" + +#: ../C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"Le <application>Dictionnaire</application> permet de rechercher des " +"définitions de mots et de termes à partir d'un dictionnaire source." + +#: ../C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Premiers pas" + +#: ../C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Démarrage du Dictionnaire" + +#: ../C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "" +"Le <application>Dictionnaire</application> peut être lancé de plusieurs " +"manières :" + +#: ../C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menu <guimenu>Applications</guimenu>" + +#: ../C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Choisissez <menuchoice><guisubmenu>Accessoires</" +"guisubmenu><guimenuitem>Dictionnaire</guimenuitem></menuchoice>." + +#: ../C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Ligne de commande" + +#: ../C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Exécutez la commande suivante : <command>mate-dictionary</command>" + +#: ../C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" +"La fenêtre suivante est affichée au lancement du <application>Dictionnaire</" +"application> :" + +#: ../C/mate-dictionary.xml:146(title) ../C/mate-dictionary.xml:175(title) +#: ../C/mate-dictionary.xml:217(title) ../C/mate-dictionary.xml:258(title) +#: ../C/mate-dictionary.xml:278(title) ../C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Fenêtre du Dictionnaire" + +#: ../C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Montre la fenêtre principale du Dictionnaire" + +#: ../C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Utilisation" + +#: ../C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Recherche d'un mot" + +#: ../C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"Pour rechercher un mot, saisissez-le dans la <guilabel>zone de recherche</" +"guilabel> et appuyez sur <keycap>Entrée</keycap>." + +#: ../C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" +"Si une définition du mot est trouvée, elle apparaît dans la zone principale " +"de la fenêtre :" + +#: ../C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Montre une définition dans la fenêtre principale du Dictionnaire" + +#: ../C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "Dans le cas contraire, un message d'erreur explicatif apparaîtra." + +#: ../C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Enregistrement des résultats d'une recherche" + +#: ../C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"Pour enregistrer les résultats d'une recherche, choisissez " +"<menuchoice><guimenu>Fichier</guimenu><guimenuitem>Enregistrer une copie</" +"guimenuitem></menuchoice>. Saisissez un nom de fichier dans la boîte de " +"dialogue <guilabel>Enregistrer une copie</guilabel>, puis cliquez sur " +"<guibutton>Enregistrer</guibutton>." + +#: ../C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Impression des résultats d'une recherche" + +#: ../C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"Pour imprimer les résultats d'une recherche, choisissez " +"<menuchoice><guimenu>Fichier</guimenu><guimenuitem>Imprimer</guimenuitem></" +"menuchoice>." + +#: ../C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"Dans la boîte de dialogue <guilabel>Imprimer</guilabel>, il est possible de " +"choisir l'imprimante, le format du papier et le nombre de copies." + +#: ../C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"Pour prévisualiser l'impression, cliquez sur <guibutton>Aperçu avant " +"impression</guibutton>." + +#: ../C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Pour imprimer, cliquez sur <guibutton>Imprimer</guibutton>." + +#: ../C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Recherche de texte" + +#: ../C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "" +"Affiche le volet de recherche du Dictionnaire dans la fenêtre principale" + +#: ../C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "" +"Pour rechercher du texte à l'intérieur des résultats d'une requête, " +"effectuez les opérations suivantes :" + +#: ../C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Choisissez <menuchoice><guimenu>Édition</guimenu><guimenuitem>Rechercher</" +"guimenuitem></menuchoice> afin d'afficher le volet <guilabel>Rechercher</" +"guilabel> au bas de la fenêtre principale." + +#: ../C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" +"Saisissez le texte souhaité dans le champ <guilabel>Rechercher</guilabel>." + +#: ../C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"Pour rechercher la prochaine occurrence du texte, cliquez sur le bouton " +"<guibutton>Suivant</guibutton>. Pour rechercher l'occurrence précédente, " +"cliquez sur <guibutton>Précédent</guibutton>." + +#: ../C/mate-dictionary.xml:248(title) ../C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Préférences" + +#: ../C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"Pour modifier les préférences de l'application <application>Dictionnaire</" +"application>, choisissez <menuchoice><guimenu>Édition</" +"guimenu><guimenuitem>Préférences</guimenuitem></menuchoice>." + +#: ../C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Sources de dictionnaires" + +#: ../C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Montre l'onglet Source de la fenêtre des préférences." + +#: ../C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" +"Pour modifier la source du dictionnaire utilisé pour rechercher des mots, " +"sélectionnez la source souhaitée dans la liste." + +#: ../C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Ajout d'une nouvelle source de dictionnaire" + +#: ../C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Montre la boîte de dialogue Ajouter une source de dictionnaire" + +#: ../C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "" +"Pour ajouter une nouvelle source de dictionnaire, effectuez les opérations " +"suivantes :" + +#: ../C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Cliquez sur le bouton <guibutton>Ajouter</guibutton>." + +#: ../C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" +"Saisissez le nom de la nouvelle source dans le champ <guilabel>Description</" +"guilabel>." + +#: ../C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Modifiez le type de transport de la nouvelle source dans la liste déroulante " +"<guilabel>Transport</guilabel>." + +#: ../C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Modifiez les attributs de la nouvelle source." + +#: ../C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Cliquez sur <guibutton>Ajouter</guibutton>." + +#: ../C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Différents types de transport de source utilisent des attributs différents. " +"Voici la liste des attributs disponibles pour chaque type de transport :" + +#: ../C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transport" + +#: ../C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Attributs" + +#: ../C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Serveur de dictionnaire" + +#: ../C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Nom d'hôte : le nom d'hôte du serveur de dictionnaire" + +#: ../C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Port : le port du serveur de dictionnaire" + +#: ../C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Suppression d'une source" + +#: ../C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "" +"Pour supprimer une source de dictionnaire, effectuez les opérations " +"suivantes :" + +#: ../C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Sélectionnez la source à supprimer." + +#: ../C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Cliquez sur le bouton <guibutton>Enlever</guibutton>." + +#: ../C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Si vous enlevez une source de dictionnaire, elle sera définitivement " +"supprimée de la liste des ressources disponibles. D'autre part, comme " +"certaines sources sont définies au niveau du système, il est possible que " +"vous ne puissiez pas l'enlever si vous ne disposez pas des privilèges " +"nécessaires." + +#: ../C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Options d'impression" + +#: ../C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Montre l'onglet Imprimer de la fenêtre des préférences" + +#: ../C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Si vous désirez modifier le nom de la police et la taille utilisée pour " +"l'impression, effectuez les opérations suivantes :" + +#: ../C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Cliquez sur le bouton <guilabel>Police d'impression</guilabel>." + +#: ../C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Sélectionnez la police et la taille de caractères de votre choix." + +#: ../C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Cliquez sur <guibutton>Valider</guibutton>." + +#: ../C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "L'applet Dictionnaire" + +#: ../C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"L'application <application>Dictionnaire</application> est fournie avec une " +"applet de tableau de bord, l'<application>applet Dictionnaire</application>. " +"Vous pouvez ajouter l'applet <application>Dictionnaire</application> à un " +"tableau de bord et rechercher des mots dans des dictionnaires." + +#: ../C/mate-dictionary.xml:381(title) ../C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Fenêtre de l'applet Dictionnaire" + +#: ../C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Montre l'applet Dictionnaire" + +#: ../C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Démarrage de l'applet Dictionnaire" + +#: ../C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"Pour ajouter l'applet <application>Dictionnaire</application> à un tableau " +"de bord, cliquez avec le bouton droit de la souris sur un tableau de bord, " +"puis choisissez <guimenuitem>Ajouter au tableau de bord</guimenuitem>. " +"Sélectionnez l'applet Dictionnaire dans la boîte de dialogue " +"<application>Ajouter au tableau de bord</application>, puis cliquez sur " +"<guibutton>Ajouter</guibutton>." + +#: ../C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Utilisation de l'applet Dictionnaire" + +#: ../C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"Pour rechercher un mot, saisissez-le dans la <guilabel>zone de texte</" +"guilabel>, puis appuyez sur <keycap>Entrée</keycap> ou cliquez avec le " +"bouton droit sur l'icône du dictionnaire et choisissez " +"<guimenuitem>Rechercher le texte sélectionné</guimenuitem>." + +#: ../C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Si une définition du mot est trouvée, une fenêtre contenant le texte de la " +"définition apparaît :" + +#: ../C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Montre la fenêtre principale de l'applet Dictionnaire." + +#: ../C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Cliquez sur <guibutton>Enregistrer</guibutton> pour enregistrer les " +"définitions dans un fichier texte. Cliquez sur <guibutton>Imprimer</" +"guibutton> pour imprimer les définitions. Cliquez sur <guibutton>Effacer</" +"guibutton> pour effacer les définitions." + +#: ../C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Vous pouvez faire disparaître la fenêtre en cliquant avec le bouton gauche " +"sur l'icône du Dictionnaire ou en appuyant sur <keycap>Échap</keycap>." + +#: ../C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"Pour configurer l'applet <application>Dictionnaire</application>, cliquez " +"avec le bouton droit sur l'icône du dictionnaire et choisissez " +"<guimenuitem>Préférences</guimenuitem>." + +#: ../C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"La boîte de dialogue <guilabel>Préférences</guilabel> est la même que celle " +"de l'application <application>Dictionnaire</application>, veuillez donc vous " +"référer à <xref linkend=\"mate-dictionary-preferences\"/>." + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: ../C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "" +"Jonathan Ernst <[email protected]>, 2006.\n" +"Claude Paroz <[email protected]>, 2006." diff --git a/mate-dictionary/help/it/figures/mate-dictionary-add-source.png b/mate-dictionary/help/it/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..918b7a95 --- /dev/null +++ b/mate-dictionary/help/it/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/it/figures/mate-dictionary-application.png b/mate-dictionary/help/it/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..8c854355 --- /dev/null +++ b/mate-dictionary/help/it/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/it/figures/mate-dictionary-find.png b/mate-dictionary/help/it/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..664a654a --- /dev/null +++ b/mate-dictionary/help/it/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/it/figures/mate-dictionary-lookup.png b/mate-dictionary/help/it/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..1d3bb304 --- /dev/null +++ b/mate-dictionary/help/it/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/it/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/it/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..52fa9eb2 --- /dev/null +++ b/mate-dictionary/help/it/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/it/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/it/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..ce26ea24 --- /dev/null +++ b/mate-dictionary/help/it/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/it/it.po b/mate-dictionary/help/it/it.po new file mode 100644 index 00000000..d3b68b14 --- /dev/null +++ b/mate-dictionary/help/it/it.po @@ -0,0 +1,732 @@ +# Italian translation of dictionary documentation. +# Andrea Zagli <[email protected]>, 2006-2008. +# +# +msgid "" +msgstr "" +"Project-Id-Version: mate-utils-dictionary-help-it 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-03-03 15:21+0100\n" +"PO-Revision-Date: 2008-03-03 15:24+0100\n" +"Last-Translator: Andrea Zagli <[email protected]>\n" +"Language-Team: Italian <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Manuale di Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "" +"Dizionario permette di ricercare definizioni di parole e la loro corretta " +"ortografia." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:35(holder) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:48(publishername) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Progetto di documentazione di MATE" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Questo documento può essere copiato, distribuito e/o modificato solo in " +"conformità con i termini della GNU Free Documentation License (GFDL) " +"Versione 1.1 o delle versioni successive pubblicate dalla Free Software " +"Foundation senza sezioni invariabili, frontespizi e testi di copertina. Una " +"copia della GFDL è disponibile su questo <ulink type=\"help\" url=\"ghelp:fdl" +"\">collegamento</ulink> o nel file COPYING-DOCS distribuito con questo " +"manuale." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"Questo manuale fa parte di una raccolta di manuali MATE distribuita in " +"conformità con la GFDL. Per poter distribuire questo manuale separatamente, " +"è necessario inserirvi una copia della licenza, come descritto nella sezione " +"6 della licenza." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"Molti dei nomi usati dalle aziende per distinguere i propri prodotti e " +"servizi sono rivendicati come marchi. Quando questi nomi compaiono nella " +"documentazione di MATE, e i partecipanti al Progetto di documentazione di " +"MATE sono consapevoli del loro utilizzo, essi vengono scritti in lettere " +"maiuscole o con l'iniziale maiuscola." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"IL DOCUMENTO VIENE FORNITO SENZA GARANZIE DI ALCUN TIPO, ESPLICITE O " +"IMPLICITE, INCLUSE, MA SENZA LIMITAZIONE, LE GARANZIE ATTESTANTI CHE IL " +"DOCUMENTO O LE SUE VERSIONI MODIFICATE SIANO PRIVI DI DIFETTI, " +"COMMERCIALIZZABILI, IDONEI A UN DETERMINATO SCOPO O CHE NON VIOLINO DIRITTI " +"DI TERZI. SI DECLINA QUALUNQUE RESPONSABILITÀ RIGUARDO AI RISCHI INERENTI LA " +"QUALITÀ, L'ACCURATEZZA E LE PRESTAZIONI DEL DOCUMENTO O DI UNA SUA VERSIONE " +"MODIFICATA. QUALORA UN DOCUMENTO O UNA SUA VERSIONE MODIFICATA DOVESSERO " +"PRESENTARE QUALUNQUE TIPO DI DIFETTO, IL COSTO DI EVENTUALI INTERVENTI DI " +"ASSISTENZA, RIPARAZIONE O CORREZIONE SARÀ A CARICO DELL'UTENTE (NON DEL " +"REDATTORE INIZIALE, DELL'AUTORE O DI ALTRI COLLABORATORI). QUESTA " +"LIMITAZIONE DELLA GARANZIA COSTITUISCE PARTE ESSENZIALE DELLA LICENZA. L'USO " +"DEL DOCUMENTO O DELLE SUE VERSIONI MODIFICATE È CONSENTITO SOLO ENTRO I " +"TERMINI DI QUESTA LIMITAZIONE DELLA GARANZIA; E" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"IN NESSUNA CIRCOSTANZA E PER NESSUNA RAGIONE LEGALE, INCLUSI I PRINCIPI DI " +"COLPA (INCLUSA LA NEGLIGENZA), ACCORDO CONTRATTUALE O ALTRO, SARÀ POSSIBILE " +"CONSIDERARE L'AUTORE, IL REDATTORE INIZIALE, GLI ALTRI COLLABORATORI, " +"QUALUNQUE DISTRIBUTORE DEL DOCUMENTO O DI UNA SUA VERSIONE MODIFICATA O " +"QUALUNQUE FORNITORE DELLE PERSONE CITATE, RESPONSABILE NEI CONFRONTI DI " +"QUALUNQUE PERSONA PER DANNI DIRETTI, INDIRETTI, SPECIALI, INCIDENTALI O " +"CONSEGUENTI DI QUALUNQUE NATURA, INCLUSI, MA SENZA LIMITAZIONE, I DANNI PER " +"PERDITA DI AVVIAMENTO, INTERRUZIONE DEL LAVORO, GUASTO O MALFUNZIONAMENTO " +"DEL COMPUTER O QUALUNQUE ALTRO DANNO O PERDITA DERIVANTE O CORRELATA ALL'USO " +"DEL DOCUMENTO O DI UNA SUA VERSIONE MODIFICATA, ANCHE QUALORA LE PERSONE " +"CITATE FOSSERO STATE INFORMATE DELLA POSSIBILITÀ DI TALI DANNI." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"QUESTO DOCUMENTO E LE SUE VERSIONI MODIFICATE VENGONO FORNITI IN BASE AI " +"TERMINI DELLA GNU FREE DOCUMENTATION LICENSE, CON L'INTESA CHE:<placeholder-" +"1/>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Manuale di Dizionario V1.0.0" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Gennaio 2005" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Questo manuale descrive la versione 2.14.0 di Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Commenti" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Per segnalare un errore o inviare un suggerimento riguardo l'applicazione " +"Dizionario o questo manuale, seguire le indicazioni nella <ulink url=\"ghelp:" +"mate-feedback\" type=\"help\">pagina di commenti su MATE</ulink>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Introduzione" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"L'applicazione <application>Dizionario</application> permette la ricerca di " +"parole e termini in una sorgente dizionario." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Per iniziare" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Avviare Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "" +"Si può avviare <application>Dizionario</application> nei seguenti modi:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menù <guimenu>Applicazioni</guimenu>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Scegliere <menuchoice><guisubmenu>Accessori</" +"guisubmenu><guimenuitem>Dizionario</guimenuitem></menuchoice>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Riga di comando" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Eseguire il seguente comando: <command>mate-dictionary</command>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" +"Una volta avviato, viene visualizzata la finestra di " +"<application>Dizionario</application>:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:146(title) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:175(title) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:217(title) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:258(title) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:278(title) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Finestra di Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Mostra la finestra principale di Dizionario." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Utilizzo" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Ricercare una parola" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"Per ricercare una parola, digitarla nel <guilabel>campo di inserimento</" +"guilabel> e premere <keycap>Invio</keycap>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" +"Se vengono trovate delle definizioni per la parola, appariranno nell'area " +"principale della finestra:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "" +"Mostra una definizione all'interno della finestra principale di Dizionario." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "" +"Altrimenti, apparirà un dialogo di errore, con un messaggio che spiega la " +"natura dell'errore." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Salvare i risultati di una ricerca" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"Per salvare i risultati di una ricerca, scegliere <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Salva una copia</guimenuitem></menuchoice>. Inserire un " +"nome per il file nel dialogo <guilabel>Salva una copia</guilabel>, poi fare " +"clic su <guibutton>Salva</guibutton>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Stampare i risultati di una ricerca" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"Per stampare i risultati di una ricerca, scegliere " +"<menuchoice><guimenu>File</guimenu><guimenuitem>Stampa</guimenuitem></" +"menuchoice>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"All'interno del dialogo <guilabel>Stampa</guilabel> si può selezionare la " +"stampante da utilizzare, il formato della carta, il numero di copie." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"Per vedere un'anteprima di quello che verrà stampato, fare clic su " +"<guibutton>Anteprima</guibutton>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Per stampare, fare clic su <guibutton>Stampa</guibutton>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Trovare del testo" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "" +"Mostra il riquadro Trova di Dizionario all'interno della finestra principale." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "" +"Per trovare del testo all'interno dei risultati di una ricerca, procedere " +"come segue:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Scegliere <menuchoice><guimenu>Modifica</guimenu><guimenuitem>Trova</" +"guimenuitem></menuchoice> per visualizzare il riquadro <guilabel>Trova</" +"guilabel>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" +"Digitare il testo che si vuole trovare all'interno del campo di inserimento " +"<guilabel>Trova</guilabel>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"Per trovare l'occorrenza successiva del testo, fare clic su " +"<guibutton>Successivo</guibutton>. Per trovare l'occorrenza precedente del " +"testo, fare clic su <guibutton>Precedente</guibutton>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:248(title) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Preferenze" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"Per cambiare le preferenze dell'applicazione <application>Dizionario</" +"application>, scegliere <menuchoice><guimenu>Modifica</" +"guimenu><guimenuitem>Preferenze</guimenuitem></menuchoice>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Sorgenti di dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Mostra la scheda Sorgente del dialogo Preferenze." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" +"Per cambiare la sorgente dizionario utilizzata per ricercare le parole, " +"selezionare la sorgente desiderata dalla lista." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Aggiungere una nuova sorgente" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Mostra il dialogo Aggiungi sorgente." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Per aggiungere una nuova sorgente dizionario, procedere come segue:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Fare clic sul pulsante <guibutton>Aggiungi</guibutton>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" +"Modificare il nome della nuova sorgente all'interno del campo di inserimento " +"<guilabel>Descrizione</guilabel>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Cambiare il tipo di trasporto della nuova sorgente utilizzando la casella " +"combinata <guilabel>Trasporto</guilabel>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Modificare gli attributi della nuova sorgente" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Fare clic su <guibutton>Aggiungi</guibutton>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Differenti tipi di trasporto sorgente utilizzano differenti attributi. " +"Questo è l'elenco degli attributi disponibili per tipo di trasporto:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Trasporto" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Attributi" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Server di dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Nome host: nome host del server di dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Porta: la porta del server di dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Rimuovere una sorgente" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Per rimuovere una sorgente dizionario, procedere come segue:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Selezionare la sorgente dizionario che si vuole rimuovere" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Fare clic sul pulsante <guibutton>Rimuovi</guibutton>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Se si rimuove una sorgente dizionario questa sarà eliminata permanentemente " +"dall'elenco delle sorgenti disponibili. Inoltre, poiché qualche sorgente " +"potrebbe essere definita a livello di sistema, si potrebbe non essere in " +"grado di eliminarla fino a quando non si possiedono i giusti privilegi di " +"possesso." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Opzioni di stampa" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Mostra la scheda Stampa all'interno del dialogo Preferenze." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Se si vuole cambiare il tipo di carattere e la dimensione utilizzati quando " +"si stampa, procedere come segue:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Fare clic sul pulsante <guilabel>Carattere per stampa</guilabel>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "" +"Selezionare il tipo di carattere e la grandezza che si vuole utilizzare" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Fare clic su <guibutton>OK</guibutton>" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "L'applet Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"L'applicazione <application>Dizionario</application> fornisce una applet per " +"il pannello, l'<application>Applet Dizionario</application>. Si può " +"aggiungere l'applet <application>Applet Dizionario</application> ad un " +"pannello e ricercare parole nei dizionari." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:381(title) +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Finestra di Applet Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Mostra Applet Dizionario." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Avviare l'applet Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"Per aggiungere <application>Applet Dizionario</application> ad un pannello, " +"fare clic con il tasto destro del mouse sul pannello, quindi scegliere " +"<guimenuitem>Aggiungi al pannello</guimenuitem>. Selezionare Applet " +"Dizionario nel dialogo <application>Aggiungi al pannello</application>, " +"quindi fare clic su <guibutton>OK</guibutton>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Utilizzare l'applet Dizionario" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"Per ricercare una parola, digitarla all'interno del <guilabel>campo di " +"inserimento</guilabel>, quindi premere <keycap>Invio</keycap> o fare clic " +"con il tasto destro del mouse sull'icona dizionario e poi scegliere " +"<guimenuitem>Ricerca</guimenuitem>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Se è stata trovata qualche definizione per la parola, verrà mostrata una " +"finestra con il testo delle definizioni:" + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Mostra la finestra principale di Applet Dizionario." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Fare clic su <guibutton>Salva</guibutton> per salvare le definizioni in un " +"file di testo. Fare clic su <guibutton>Stampa</guibutton> per stampare le " +"definizioni. Fare clic su <guibutton>Pulisci</guibutton> per pulire le " +"definizioni." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Si può far scomparire la finestra facendo clic con il tasto sinistro del " +"mouse sull'icona del dizionario o premendo <keycap>Esc</keycap>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"Per configurare l'<application>Applet Dizionario</application>, fare clic " +"con il tasto destro del mouse sull'icona dizionario, poi scegliere " +"<guimenuitem>Preferenze</guimenuitem>." + +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"Il dialogo <guilabel>Preferenze</guilabel> è lo stesso utilizzato " +"dall'applicazione <application>Dizionario</application>, per questo " +"consultare <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: /home/andreaz/traduzioni/mate-utils/mate-dictionary/help/C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Andrea Zagli <[email protected]>, 2006-2008" + diff --git a/mate-dictionary/help/mate-dictionary.omf.in b/mate-dictionary/help/mate-dictionary.omf.in new file mode 100644 index 00000000..dd8e7510 --- /dev/null +++ b/mate-dictionary/help/mate-dictionary.omf.in @@ -0,0 +1,9 @@ +<?xml version="1.0" standalone="no"?> +<omf> + <resource> + <subject category="GNOME|Applications|Accessories"/> + <type>user's manual</type> + <relation seriesid="1ecf16b8-675f-11da-8538-e2da790b69ab"/> + <rights type="GNU FDL" license.version="1.1" holder="Emmanuele Bassi"/> + </resource> +</omf> diff --git a/mate-dictionary/help/oc/oc.po b/mate-dictionary/help/oc/oc.po new file mode 100644 index 00000000..3f6ab152 --- /dev/null +++ b/mate-dictionary/help/oc/oc.po @@ -0,0 +1,596 @@ +# Translation of oc.po to Occitan +# Occitan translation of mate-utils-dictionary documentation. +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. +# This file is distributed under the same license as the mate-utils +# documentation package. +# +# Yannig MARCHEGAY ([email protected]> - 2006-2007 +# +# Yannig Marchegay (Kokoyaya) <[email protected]>, 2007. +msgid "" +msgstr "" +"Project-Id-Version: oc\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-02 17:30+0000\n" +"PO-Revision-Date: 2008-02-26 23:53+0100\n" +"Last-Translator: Yannig Marchegay (Kokoyaya) <[email protected]>\n" +"Language-Team: Occitan <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);X-Generator: KBabel 1.11.4" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Manuel del diccionari" + +#: C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "" + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Projècte de documentacion de MATE" + +#: C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" + +#: C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" + +#: C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" + +#: C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" + +#: C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" + +#: C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Genièr de 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "" + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "" + +#: C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Diccionari" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Introduccion" + +#: C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Per començar" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "" + +#: C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menut <guimenu>Applications</guimenu>" + +#: C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Linha de comanda" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "" + +#: C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Fenèstra del diccionari" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "" + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Utilizacion" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "" + +#: C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" + +#: C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "" + +#: C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "" + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "" + +#: C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "" + +#: C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" + +#: C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" + +#: C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "" + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "" + +#: C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "" + +#: C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" + +#: C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" + +#: C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Preferéncias" + +#: C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Servidor de diccionari" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "" + +#: C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "" + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "" + +#: C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" + +#: C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Clicatz sus <guibutton>Apondre</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Atributs" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Servidor de diccionari" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "" + +#: C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "" + +#: C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Clicatz sus <guibutton>Validar</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "" + +#: C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "" + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "" + +#: C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "" + +#: C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" + +#: C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "" + +#: C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" + +#: C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" + +#: C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" + +#: C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Yannig Marchegay (Kokoyaya) <[email protected]>" + diff --git a/mate-dictionary/help/ru/ru.po b/mate-dictionary/help/ru/ru.po new file mode 100644 index 00000000..71bfb92b --- /dev/null +++ b/mate-dictionary/help/ru/ru.po @@ -0,0 +1,699 @@ +# mate-dictionary help file translation + +msgid "" +msgstr "" +"Project-Id-Version: mate-dictionary HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.mate.org\n" +"POT-Creation-Date: 2007-01-21 01:52+0300\n" +"PO-Revision-Date: 2007-01-20 01:55+0300\n" +"Last-Translator: Nickolay V. Shmyrev <[email protected]>\n" +"Language-Team: Russian <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: ../C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: ../C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Справка по словарю" + +#: ../C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Словарь позволяет искать определения слов, их правописание и значение." + +#: ../C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: ../C/mate-dictionary.xml:35(holder) ../C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: ../C/mate-dictionary.xml:48(publishername) +#: ../C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Проект документирования MATE" + +#: ../C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: ../C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: ../C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: ../C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Руководство по приложению Словарь версии 1.0.0" + +#: ../C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Это руководство описывает версию 2.14.0 приложения Словарь." + +#: ../C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Обратная связь" + +#: ../C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Для того, чтобы сообщить об ошибке или сделать предложение по апплету " +"Словарь или этому руководству, следуйте инструкциями на странице <ulink url=" +"\"ghelp:mate-feedback\" type=\"help\">Обратная связь с MATE</ulink>." + +#: ../C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Словарь" + +#: ../C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Введение" + +#: ../C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"Приложение <application>Словарь</application> позволяет искать определения " +"слов и понятий в словарях." + +#: ../C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Начало работы" + +#: ../C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Для того, чтобы запустить словарь" + +#: ../C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "" +"Можно запустить приложение <application>Словарь</application> следующими " +"способами:" + +#: ../C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Из меню <guimenu>Приложения</guimenu>" + +#: ../C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Выберите <menuchoice><guisubmenu>Стандартные</" +"guisubmenu><guimenuitem>Словарь</guimenuitem></menuchoice>." + +#: ../C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Из командной строки" + +#: ../C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Выполните следующую команду: <command>mate-dictionary</command>" + +#: ../C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" +"После запуска будет отображено окно приложения <application>Словарь</" +"application>:" + +#: ../C/mate-dictionary.xml:146(title) ../C/mate-dictionary.xml:175(title) +#: ../C/mate-dictionary.xml:217(title) ../C/mate-dictionary.xml:258(title) +#: ../C/mate-dictionary.xml:278(title) ../C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Окно словаря" + +#: ../C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Показывает главное окно словаря" + +#: ../C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Использование" + +#: ../C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Поиск слова" + +#: ../C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"Для поиска слова введите его в поле <guilabel>ввода</guilabel> и нажмите " +"<keycap>Enter</keycap>." + +#: ../C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "" +"Если какая-то словарная статья будет найдена, она появится в главном окне" + +#: ../C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Показывает определение внутри окна Словаря." + +#: ../C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "" +"В противном случае появится диалог, сообщающий об ошибке с сообщением, более " +"подробно её описывающим." + +#: ../C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Сохранить результаты поиска" + +#: ../C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"Для сохранения результатов поиска, выберите меню <menuchoice><guimenu>Файл</" +"guimenu><guimenuitem>Сохранить копию</guimenuitem></menuchoice>. Введите имя " +"файла в появившемся диалоге <guilabel>Сохранить копию</guilabel> и нажмите " +"на кнопку <guibutton>Сохранить</guibutton>." + +#: ../C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Напечатать результаты поиска" + +#: ../C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"Для печати результатов поиска, выберите меню <menuchoice><guimenu>Файл</" +"guimenu><guimenuitem>Печать</guimenuitem></menuchoice>." + +#: ../C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"В диалоге <guilabel>Печать</guilabel> можно выбрать используемый принтер и " +"формат бумаги, число печатаемых копий." + +#: ../C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"Для предварительного просмотра того, что будет напечатано, нажмите " +"<guibutton>Предварительный просмотр</guibutton>." + +#: ../C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Для печати, нажмите <guibutton>Печать</guibutton>." + +#: ../C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Найти текст" + +#: ../C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Показывает панель поиска текста в главном окне" + +#: ../C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "Для поиска текста в словарной статье, сделайте следующее:" + +#: ../C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Выберите <menuchoice><guimenu>Правка</guimenu><guimenuitem>Найти</" +"guimenuitem></menuchoice> для отображения панели <guilabel>Поиск</guilabel>." + +#: ../C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "" +"Наберите текст, который нужно найти внутри поле ввода <guilabel>Найти</" +"guilabel>." + +#: ../C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"Для поиска следующего вхождения слова, нажмите кнопку <guibutton>Найти " +"следующее</guibutton>. Для нахождения предыдущего вхождения нажмите " +"<guibutton>Найти предыдущее</guibutton>." + +#: ../C/mate-dictionary.xml:248(title) ../C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Параметры" + +#: ../C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"Для правки параметров приложения <application>Словарь</application> выберите " +"<menuchoice><guimenu>Правка</guimenu><guimenuitem>Параметры</guimenuitem></" +"menuchoice>." + +#: ../C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Источники поиска словарных статей" + +#: ../C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "" +"Показывает закладку источников поиска словарных статей в диалоге параметров." + +#: ../C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" +"Для изменения источников поиска словарных статей, выберите требуемых " +"источник из списка." + +#: ../C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Добавление нового источника словарных статей" + +#: ../C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Показывает диалог добавления нового источника словарных статей" + +#: ../C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Для того, чтобы добавить новый источник, сделайте следующее:" + +#: ../C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Нажмите на кнопку <guibutton>Добавить</guibutton>" + +#: ../C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "" +"Задайте имя нового источинка в поле ввода <guilabel>Описание</guilabel>" + +#: ../C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Измените тип транспора для нового источника в выпадающем списке " +"<guilabel>Транспорт</guilabel>" + +#: ../C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Правка параметров нового источника словарных статей" + +#: ../C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Нажмите на кнопку <guibutton>Добавить</guibutton>" + +#: ../C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Различные источники словарных статей могут задаваться различными " +"параметрами. Список доступных параметров для каждого типа транспорта:" + +#: ../C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Транспорт" + +#: ../C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Параметры" + +#: ../C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Сервер словарных статей" + +#: ../C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Имя узла: имя узла, в котором находится сервер словарей" + +#: ../C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Порт: порт, по которому слушает сервер словарей" + +#: ../C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Удаление источника статей" + +#: ../C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Для удаления источника статей, сделайте следующее:" + +#: ../C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Выберите источник, который нужно удалить" + +#: ../C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Нажмите на кнопку <guibutton>Удалить</guibutton>." + +#: ../C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Если вы удаляете источник поиска словарных статей, он будет удалён навсегда " +"из списка используемых источников. Также, некоторые источники статей могут " +"быть определены системным администратором и вы не сможете удалить их, не " +"получив достаточных для этого прав доступа." + +#: ../C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Параметры печати" + +#: ../C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Показывает вкладку параметров печати в диалоге параметров." + +#: ../C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Если нужно изменить размер или тип шрифта для печати, сделайте следующее:" + +#: ../C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Нажмите на кнопку <guilabel>Шрифт печати</guilabel>" + +#: ../C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Выберите требуемый шрифт и его размер" + +#: ../C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Нажмите на кнопку <guibutton>OK</guibutton>" + +#: ../C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Апплет Словарь" + +#: ../C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"Приложение <application>Словарь</application> также содержит апплет панели " +"рабочего стола, называемый апплет <application>Словарь</application>. Можно " +"добавить апплет <application>Словарь</application> на панель и использовать " +"его для быстрого поиска слова в словарях." + +#: ../C/mate-dictionary.xml:381(title) ../C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Окно апплета Словарь" + +#: ../C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Показывает апплет Словарь." + +#: ../C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Для запуска апплета Словарь" + +#: ../C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"Для того, чтобы добавить апплет <application>Словарь</application> на " +"панель, щёлкните правой кнопкой мыши по панели, затем выберите " +"<guimenuitem>Добавить</guimenuitem>. Выберите апплет в диалоге " +"<application>Добавить на панель</application>, затем нажмите на кнопку " +"<guibutton>ОК</guibutton>." + +#: ../C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Использование апплета Словарь" + +#: ../C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"Для поиска слова, наберите его в <guilabel>поле ввода</guilabel> и нажмите " +"клавишу <keycap>Enter</keycap> или щёлкните правой кнопкой мыши по значку " +"словаря. Затем выберите <guimenuitem>Искать</guimenuitem>" + +#: ../C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Если описание слова было найдено, появится окно с текстом словарной статьи:" + +#: ../C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Показывает главное окно апплета Словарь" + +#: ../C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Нажмите на кнопку <guibutton>Сохранить</guibutton>для сохранения определения " +"в текстовый файл. Нажмите <guibutton>Print</guibutton> для печати " +"определения. Нажмите <guibutton>Очистить</guibutton> для очистки содержания " +"словарной статьи." + +#: ../C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Можно убрать окно словаря, щёлкнув по значку левой кнопкой мыши или нажмите " +"<keycap>Esc</keycap>." + +#: ../C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"Для настройки апплета <application>Словарь</application>, кликните правой " +"кнопой мыши по значку словаря, затем выберите <guimenuitem>Параметры</" +"guimenuitem>." + +#: ../C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"Диалог <guilabel>Параметры</guilabel> также используется приложением " +"<application>Словарь</application>. Подробная информация о нём может быть " +"найдена в <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: ../C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Николай В. Шмырёв" + +#~ msgid "" +#~ "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 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 <ulink type=\"help\" url=\"ghelp:fdl" +#~ "\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +#~ msgstr "" +#~ "Следующим разрешается копировать и/или модифицировать этот документ при " +#~ "условии соблюдения GNU Free Documentation License (GFDL), версии 1.1 или " +#~ "любой более поздней опубликованной ассоциацией свободного программного " +#~ "обеспечения версией без неизменяемых частей, без текстов на обложках. Вы " +#~ "можете найти копию лицензии по этой <ulink type=\"help\" url=\"ghelp:fdl" +#~ "\">ссылке</ulink> или в файле COPYING-DOCS, распространяемом с этим " +#~ "документом." + +#~ msgid "" +#~ "This manual is part of a collection of MATE manuals distributed under " +#~ "the GFDL. If you want to distribute this manual separately from the " +#~ "collection, you can do so by adding a copy of the license to the manual, " +#~ "as described in section 6 of the license." +#~ msgstr "" +#~ "Этот документ является частью документации MATE распространяемой под " +#~ "лицензией GFDL. Если вы хотите распространять этот документ отдельно от " +#~ "общей документации, вы должны приложить копию лицензии к документу, как " +#~ "написано в части 6 лицензии." + +#~ msgid "" +#~ "Many of the names used by companies to distinguish their products and " +#~ "services are claimed as trademarks. Where those names appear in any MATE " +#~ "documentation, and the members of the MATE Documentation Project are " +#~ "made aware of those trademarks, then the names are in capital letters or " +#~ "initial capital letters." +#~ msgstr "" +#~ "Некоторые имена и марки используются компаниями для различения их " +#~ "продуктов и услуг и являются торговыми марками. Эти марки присутствуют в " +#~ "документации и члены проекта документирования MATE знают об этом. Имена " +#~ "выделяются заглавными буквами или начальной заглавной буквой." + +#~ msgid "" +#~ "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +#~ "EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES " +#~ "THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +#~ "MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +#~ "RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +#~ "MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +#~ "MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +#~ "WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +#~ "SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES " +#~ "AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED " +#~ "VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS " +#~ "DISCLAIMER; AND" +#~ msgstr "" +#~ "ДОКУМЕНТ РАСПРОСТРАНЯЕТСЯ \"КАК ЕСТЬ\", БЕЗ ВСЯКИХ ГАРАНТИЙ, ПРИДУМАННЫХ " +#~ "ИЛИ УНАСЛЕДОВАННЫХ, БЕЗ ОГРАНИЧЕНИЙ, ГАРАНТИЙ ТОГО ЧТО ДОКУМЕНТ ИЛИ " +#~ "МОДИФИЦИРОВАННАЯ ВЕРСИЯ ДОКУМЕНТА СВОБОДНА ОТ ДЕФЕКТОВ, ТОЛЬКО ДЛЯ " +#~ "СПЕЦИАЛЬНОГО ИСПОЛЬЗОВАНИЯ НЕ ЗАКЛЮЧАЮЩЕГО В СЕБЕ РИСКИ КАЧЕСТВА, " +#~ "АККУРАТНОСТИ ИЛИ СООТВЕТСТВИЯ ДОКУМЕНТА ИЛИ ИЗМЕНЁННЫХ ВЕРСИЙ ДОКУМЕНТА " +#~ "ВАШИМ ТРЕБОВАНИЯМ. ЕСЛИ ДОКУМЕНТ ИЛИ МОДИФИЦИРОВАННАЯ ВЕРСИЯ ДОКУМЕНТА " +#~ "ИМЕЕТ НЕДОСТАТКИ, ВЫ (А НЕ АВТОР ДОКУМЕНТА ИЛИ ЕГО ПОМОЩНИК) ДОЛЖНЫ САМИ " +#~ "ПРИЛОЖИТЬ УСИЛИЯ К ЕГО ДОРАБОТКИ, КОРРЕКЦИИ ИЛИ ВОССТАНОВЛЕНИЮ. ЭТО " +#~ "ПРЕДУПРЕЖДЕНИЕ СОСТАВЛЯЕТ СУЩЕСТВЕННУЮ ЧАСТЬ ЛИЦЕНЗИИ. ДОКУМЕНТ НЕ ДОЛЖЕН " +#~ "ИСПОЛЬЗОВАТЬСЯ БЕЗ ДАННОГО ПРЕДУПРЕЖДЕНИЯ И" + +#~ msgid "" +#~ "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT " +#~ "(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL " +#~ "WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED " +#~ "VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE " +#~ "LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR " +#~ "CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, " +#~ "DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR " +#~ "MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR " +#~ "RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, " +#~ "EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH " +#~ "DAMAGES." +#~ msgstr "" +#~ "НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ И НИ ПРИ КАКОМ ЗАКОННОМ СПОСОБЕ, НИ ПО " +#~ "КАКОМУ СОГЛАШЕНИЮ ИЛИ ДРУГОЙ ПРИЧИНЕ, АВТОР, СОЗДАТЕЛЬ ИЛИ ПОМОЩНИКИ НЕ " +#~ "НЕСУТ ОТВЕТСТВЕННОСТЬ ЗА ПРЯМОЕ, КОСВЕННОЕ, СПЕЦИАЛЬНОЕ, СЛУЧАЙНОЕ ИЛИ " +#~ "ПРЕДНАМЕРЕННОЕ ПОВРЕЖДЕНИЕ ЛЮБОГО СВОЙСТВА, ВКЛЮЧАЯ БЕЗ ОГРАНИЧЕНИЯ " +#~ "ПОТЕРЮ ЖЕЛАНИЯ, РАБОТОСПОСОБНОСТИ, КОМПЬЮТЕРНЫЕ СБОИ ИЛИ НЕПРАВИЛЬНОЕ " +#~ "ВЗАИМОДЕЙСТВИЕ, ВМЕСТЕ ИЛИ ПО-ОТДЕЛЬНОСТИ. НИКАКИЕ ПОВРЕЖДЕНИЯ И ПОТЕРИ " +#~ "НЕ МОГУТ БЫТЬ ВОЗЛОЖЕНЫ НА АВТОРА ДОКУМЕНТА ИЛИ МОДИФИЦИРОВАННОЙ ВЕРСИИ " +#~ "ДОКУМЕНТА, ДАЖЕ ЕСЛИ СТОРОНА БЫЛА ПРОИНФОРМИРОВАНА О ВОЗМОЖНОСТИ ТАКИХ " +#~ "ПОВРЕЖДЕНИЙ." + +#~ msgid "" +#~ "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE " +#~ "TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER " +#~ "UNDERSTANDING THAT: <placeholder-1/>" +#~ msgstr "" +#~ "ДОКУМЕНТ И ИЗМЕНЁННЫЕ ВЕРСИИ ДОКУМЕНТА ПРЕДСТАВЛЯЮТСЯ ПОЛЬЗОВАТЕЛЮ ПОД " +#~ "ЛИЦЕНЗИЕЙ GNU FREE DOCUMENTATION LICENSE С УВЕДОМЛЕНИЕМ О ТОМ, ЧТО " +#~ "<placeholder-1/>" + +#~ msgid "January 2005" +#~ msgstr "Январь 2005" diff --git a/mate-dictionary/help/sv/figures/mate-dictionary-add-source.png b/mate-dictionary/help/sv/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..9fc23b43 --- /dev/null +++ b/mate-dictionary/help/sv/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/sv/figures/mate-dictionary-application.png b/mate-dictionary/help/sv/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..cc3f0814 --- /dev/null +++ b/mate-dictionary/help/sv/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/sv/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/sv/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..ecbb972e --- /dev/null +++ b/mate-dictionary/help/sv/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/sv/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/sv/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..e134a827 --- /dev/null +++ b/mate-dictionary/help/sv/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/sv/sv.po b/mate-dictionary/help/sv/sv.po new file mode 100644 index 00000000..70dd66b4 --- /dev/null +++ b/mate-dictionary/help/sv/sv.po @@ -0,0 +1,454 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: dictionary\n" +"PO-Revision-Date: 2006-12-27 23:23+0100\n" +"POT-Creation-Date: 2006-05-31 18:59+0200\n" +"Last-Translator: Daniel Nylander <[email protected]>\n" +"Language-Team: Swedish <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:150(None) +msgid "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "@@image: 'figures/mate-dictionary-application.png'; md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:179(None) +msgid "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "@@image: 'figures/mate-dictionary-lookup.png'; md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:221(None) +msgid "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "@@image: 'figures/mate-dictionary-find.png'; md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:262(None) +msgid "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" +msgstr "@@image: 'figures/mate-dictionary-preferences-source.png'; md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:282(None) +msgid "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" +msgstr "@@image: 'figures/mate-dictionary-add-source.png'; md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:351(None) +msgid "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "@@image: 'figures/mate-dictionary-preferences-print.png'; md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:385(None) +msgid "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" +msgstr "@@image: 'figures/mate-dictionary-applet.png'; md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:421(None) +msgid "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "@@image: 'figures/mate-dictionary-applet-window.png'; md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Handbok för Ordbok" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:27(para) +msgid "Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Ordbok ger dig möjligheten att slå upp definitioner och korrekta stavningar av ord." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:35(holder) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:48(publishername) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Dokumentationsprojekt för MATE" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:2(para) +msgid "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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or in the file COPYING-DOCS distributed with this manual." +msgstr "Tillstånd att kopiera, distribuera och/eller modifiera detta dokument ges under villkoren i GNU Free Documentation License (GFDL), version 1.1 eller senare, utgivet av Free Software Foundation utan standardavsnitt och omslagstexter. En kopia av GFDL finns att hämta på denna <ulink type=\"help\" url=\"ghelp:fdl\">länk</ulink> eller i filen COPYING-DOCS som medföljer denna handbok." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:12(para) +msgid "This manual is part of a collection of MATE manuals distributed under the GFDL. If you want to distribute this manual separately from the collection, you can do so by adding a copy of the license to the manual, as described in section 6 of the license." +msgstr "Denna handbok utgör en av flera MATE-handböcker som distribueras under villkoren i GFDL. Om du vill distribuera denna handbok separat från övriga handböcker kan du göra detta genom att lägga till en kopia av licensavtalet i handboken enligt instruktionerna i avsnitt 6 i licensavtalet." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:19(para) +msgid "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any MATE documentation, and the members of the MATE Documentation Project are made aware of those trademarks, then the names are in capital letters or initial capital letters." +msgstr "Flera namn på produkter och tjänster är registrerade varumärken. I de fall dessa namn förekommer i MATE-dokumentation - och medlemmarna i MATE-dokumentationsprojektet är medvetna om dessa varumärken - är de skrivna med versaler eller med inledande versal." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:35(para) +msgid "DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "DOKUMENTET TILLHANDAHÅLLS I \"BEFINTLIGT SKICK\" UTAN NÅGRA SOM HELST GARANTIER, VARE SIG UTTRYCKLIGA ELLER UNDERFÖRSTÅDDA, INKLUSIVE, MEN INTE BEGRÄNSAT TILL, GARANTIER ATT DOKUMENTET ELLER EN MODIFIERAD VERSION AV DOKUMENTET INTE INNEHÅLLER NÅGRA FELAKTIGHETER, ÄR LÄMPLIGT FÖR ETT VISST ÄNDAMÅL ELLER INTE STRIDER MOT LAG. HELA RISKEN VAD GÄLLER KVALITET, EXAKTHET OCH UTFÖRANDE AV DOKUMENTET OCH MODIFIERADE VERSIONER AV DOKUMENTET LIGGER HELT OCH HÅLLET PÅ ANVÄNDAREN. OM ETT DOKUMENT ELLER EN MODIFIERAD VERSION AV ETT DOKUMENT SKULLE VISA SIG INNEHÅLLA FELAKTIGHETER I NÅGOT HÄNSEENDE ÄR DET DU (INTE DEN URSPRUNGLIGA SKRIBENTEN, FÖRFATTAREN ELLER NÅGON ANNAN MEDARBETARE) SOM FÅR STÅ FÖR ALLA EVENTUELLA KOSTNADER FÖR SERVICE, REPARATIONER ELLER KORRIGERINGAR. DENNA GARANTIFRISKRIVNING UTGÖR EN VÄSENTLIG DEL AV DETTA LICENSAVTAL. DETTA INNEBÄR ATT ALL ANVÄNDNING AV ETT DOKUMENT ELLER EN MODIFIERAD VERSION AV ETT DOKUMENT BEVILJAS ENDAST UNDER DENNA ANSVARSFRISKRIVNING;" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:55(para) +msgid "UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES." +msgstr "UNDER INGA OMSTÄNDIGHETER ELLER INOM RAMEN FÖR NÅGON LAGSTIFTNING, OAVSETT OM DET GÄLLER KRÄNKNING (INKLUSIVE VÅRDSLÖSHET), KONTRAKT ELLER DYLIKT, SKA FÖRFATTAREN, DEN URSPRUNGLIGA SKRIBENTEN ELLER ANNAN MEDARBETARE ELLER ÅTERFÖRSÄLJARE AV DOKUMENTET ELLER AV EN MODIFIERAD VERSION AV DOKUMENTET ELLER NÅGON LEVERANTÖR TILL NÅGON AV NÄMNDA PARTER STÄLLAS ANSVARIG GENTEMOT NÅGON FÖR NÅGRA DIREKTA, INDIREKTA, SÄRSKILDA ELLER OFÖRUTSEDDA SKADOR ELLER FÖLJDSKADOR AV NÅGOT SLAG, INKLUSIVE, MEN INTE BEGRÄNSAT TILL, SKADOR BETRÄFFANDE FÖRLORAD GOODWILL, HINDER I ARBETET, DATORHAVERI ELLER NÅGRA ANDRA TÄNKBARA SKADOR ELLER FÖRLUSTER SOM KAN UPPKOMMA PÅ GRUND AV ELLER RELATERAT TILL ANVÄNDNINGEN AV DOKUMENTET ELLER MODIFIERADE VERSIONER AV DOKUMENTET, ÄVEN OM PART SKA HA BLIVIT INFORMERAD OM MÖJLIGHETEN TILL SÅDANA SKADOR." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:28(para) +msgid "DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: <placeholder-1/>" +msgstr "DOKUMENTET OCH MODIFIERADE VERSIONER AV DOKUMENTET TILLHANDAHÅLLS UNDER VILLKOREN I GNU FREE DOCUMENTATION LICENSE ENDAST UNDER FÖLJANDE FÖRUTSÄTTNINGAR: <placeholder-1/>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Handbok för Ordbok v1.0.0" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Januari 2005" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "Denna handbok beskriver version 2.14.0 av Ordbok." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Återkoppling" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:91(para) +msgid "To report a bug or make a suggestion regarding the Dictionary application or this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "För att rapportera ett fel eller komma med ett förslag angående programmet Ordbok eller denna handbok, följ instruktionerna på <ulink url=\"ghelp:mate-feedback\" type=\"help\">MATE:s återkopplingssida</ulink>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Ordbok" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Introduktion" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:109(para) +msgid "The <application>Dictionary</application> application enables you to search words and terms on a dictionary source." +msgstr "Programmet <application>Ordbok</application> låter dig söka efter ord och termer i en ordbokskälla." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Komma igång" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "För att starta Ordbok" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:122(para) +msgid "You can start <application>Dictionary</application> in the following ways:" +msgstr "Du kan starta <application>Ordbok</application> på följande sätt:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "Menyn <guimenu>Program</guimenu>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:129(para) +msgid "Choose <menuchoice><guisubmenu>Accessories</guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "Välj <menuchoice><guisubmenu>Tillbehör</guisubmenu><guimenuitem>Ordbok</guimenuitem></menuchoice>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Kommandorad" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Kör följande kommando: <command>mate-dictionary</command>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:142(para) +msgid "Once started, the <application>Dictionary</application> window is displayed:" +msgstr "När <application>Ordbok</application> har startats kommer följande fönster att visas:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:146(title) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:175(title) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:217(title) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:258(title) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:278(title) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Ordboksfönstret" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Visar huvudfönstret i Ordbok." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Användning" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Slå upp ett ord" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:168(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel> and press <keycap>Enter</keycap>." +msgstr "För att slå upp ett ord, skriv in det i <guilabel>inmatningsfältet</guilabel> och tryck på <keycap>Enter</keycap>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:171(para) +msgid "If some definition for the word is found, it will appear inside the main window area:" +msgstr "Om någon definition för ordet hittas kommer det att visas i huvudfönstret:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Visar en definition inne i Ordboks huvudfönster." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:186(para) +msgid "Otherwise, an error dialog will appear, with a message explaining the nature of the error." +msgstr "Om inte kommer en feldialogruta att visas med ett meddelande som förklarar problemet." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Spara uppslagsresultat" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:194(para) +msgid "To save the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name for the file in the <guilabel>Save a Copy</guilabel> dialog, then click <guibutton>Save</guibutton>." +msgstr "För att spara resultatet för ett uppslag, välj <menuchoice><guimenu>Arkiv</guimenu><guimenuitem>Spara en kopia</guimenuitem></menuchoice>. Ange ett filnamn i dialogrutan <guilabel>Spara en kopia</guilabel>, klicka sedan på <guibutton>Spara</guibutton>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Skriv ut uppslagsresultat" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:201(para) +msgid "To print the results of a look up, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "För att skriva ut resultatet för en uppslaning, välj <menuchoice><guimenu>Arkiv</guimenu><guimenuitem>Skriv ut</guimenuitem></menuchoice>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:203(para) +msgid "Inside the <guilabel>Print</guilabel> dialog you can select the printer to use, the paper format, the number of copies." +msgstr "I dialogrutan <guilabel>Skriv ut</guilabel> kan du välja vilken skrivare som ska användas, pappersformatet, antalet kopior." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:206(para) +msgid "To see a preview of what will be printed, click <guibutton>Preview</guibutton>." +msgstr "För att få en förhandsvisning av vad som kommer att skrivas ut, klicka på <guibutton>Förhandsgranska</guibutton>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "För att skriva ut, klicka på <guibutton>Skriv ut</guibutton>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Sök text" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Visar Ordboks Sök-panel inne i huvudfönstret." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:229(para) +msgid "To find text inside the results of a look up, perform the following steps:" +msgstr "Genomför följande steg för att söka text inne i resultatet för en uppslagning:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:233(para) +msgid "Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "Välj <menuchoice><guimenu>Redigera</guimenu><guimenuitem>Sök</guimenuitem></menuchoice> för att visa <guilabel>Sök</guilabel>-panelen." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:235(para) +msgid "Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "Skriv in texten som du vill söka efter i inmatningsfältet <guilabel>Sök</guilabel>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:237(para) +msgid "To find the next occurrence of the text, click <guibutton>Next</guibutton>. To find the previous occurrence of the text, click <guibutton>Previous</guibutton>." +msgstr "För att söka nästa förekomst av texten, klicka på <guibutton>Nästa</guibutton>. För att söka föregående förekomst av texten, klicka på <guibutton>Föregående</guibutton>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:248(title) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Inställningar" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:250(para) +msgid "To change the <application>Dictionary</application> application preferences, choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>." +msgstr "För att ändra inställningarna för programmet <application>Ordbok</application>, välj <menuchoice><guimenu>Redigera</guimenu><guimenuitem>Inställningar</guimenuitem></menuchoice>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Ordbokskällor" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Visar fliken Källa i inställningsdialogrutan." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:269(para) +msgid "To change the dictionary source used to look up words, select the desired source from the list." +msgstr "För att ändra ordbokskällan som används för att slå upp ord, markera den önskade källan från listan." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Lägg till en ny källa" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Visar Lägg till källa-dialogrutan." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Genomför följande steg för att lägga till en ny ordbokskälla:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Klicka på knappen <guibutton>Lägg till</guibutton>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:293(para) +msgid "Edit the name of the new source inside the <guilabel>Description</guilabel> entry" +msgstr "Redigera namnet för den nya källan i inmatningsfältet <guilabel>Beskrivning</guilabel>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:294(para) +msgid "Change the transport type of the new source using the <guilabel>Transport</guilabel> combo box" +msgstr "Ändra transporttypen för den nya källan med kombinationsrutan <guilabel>Transport</guilabel>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Redigera attributen för den nya källan" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Klicka på <guibutton>Lägg till</guibutton>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:299(para) +msgid "Different source transport types uses different attributes. This is the list of available attributes per transport type:" +msgstr "Olika källtransporttyper använder olika attribut. Här är listan över tillgängliga attribut per transporttyp:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Transport" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Attribut" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Ordboksserver" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Värdnamn: värdnamnet på ordboksservern" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Port: porten på ordboksservern" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Ta bort en källa" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Genomför följande steg för att ta bort en ordbokskälla:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Välj den källa som du önskar ta bort" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Klicka på knappen <guibutton>Ta bort</guibutton>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:335(para) +msgid "If you remove a dictionary source it will be permanently deleted from the list of available sources. Also, as some sources might be defined system-wide you may actually not be able to remove them unless you have the right ownership privileges." +msgstr "Om du tar bort en ordbokskälla kommer den permanent tas bort från listan över tillgängliga källor. Dock kan vissa källor definieras som systembreda och du kanske inte kan ta bort dem såvida du inte har den rätta behörigheten." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Utskriftsalternativ" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Visar fliken Skriv ut inne i inställningsdialogrutan." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:358(para) +msgid "If you want to change the font name and size used when printing, perform the following steps:" +msgstr "Genomför följande steg om du vill ändra typsnittsnamnet och storleken som används vid utskrifter:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Klicka på knappen <guilabel>Typsnitt för utskrift</guilabel>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Välj typsnittet och storleken du önskar använda" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Klicka på <guibutton>Ok</guibutton>" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Panelprogrammet Ordbok" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:375(para) +msgid "The <application>Dictionary</application> application comes with a panel applet, the <application>Dictionary Applet</application>. You can add the <application>Dictionary Applet</application> applet to a panel and look up words in dictionaries." +msgstr "Programmet <application>Ordbok</application> inkluderar även ett panelprogram, <application>Panelprogrammet Ordbok</application>. Du kan lägga till <application>Panelprogrammet Ordbok</application> till en panel och slå upp ord i ordböcker." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:381(title) +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Panelprogrammet Ordboks fönster" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Visar panelprogrammet Ordbok." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Starta panelprogrammet Ordbok" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:397(para) +msgid "To add <application>Dictionary Applet</application> to a panel, right-click on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select Dictionary Applet in the <application>Add to the panel</application> dialog, then click <guibutton>OK</guibutton>." +msgstr "För att lägga till <application>Panelprogrammet Ordbok</application> till en panel, högerklicka på panelen och välj sedan <guimenuitem>Lägg till i panel</guimenuitem>. Välj Ordboksuppslagning i dialogrutan <application>Lägg till i panel</application>, klicka sedan på <guibutton>OK</guibutton>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Användning av panelprogrammet Ordbok" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:408(para) +msgid "To look up a word, type it into the <guilabel>entry field</guilabel>, and press <keycap>Enter</keycap> or right-click on the dictionary icon and then choose <guimenuitem>Look up</guimenuitem>." +msgstr "För att slå upp ett ord, skriv in det i <guilabel>inmatningsfältet</guilabel> och tryck på <keycap>Enter</keycap>, eller högerklicka på ordboksikonen och välj sedan <guimenuitem>Slå upp</guimenuitem>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:413(para) +msgid "If some definition for the word was found, a window will appear, with the text of the definitions:" +msgstr "Om någon definition för ordet hittas, kommer ett fönster med texten för definitionerna att visas:" + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Visar panelprogrammet Ordboks huvudfönster." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:428(para) +msgid "Click <guibutton>Save</guibutton> to save the definitions to a text file. Click <guibutton>Print</guibutton> to print the definitions. Click <guibutton>Clear</guibutton> to clear the definitions." +msgstr "Klicka på <guibutton>Spara</guibutton> för att spara definitionerna till en textfil. Klicka på <guibutton>Skriv ut</guibutton> för att skriva ut definitionerna. Klicka på <guibutton>Töm</guibutton> för att tömma definitionerna." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:432(para) +msgid "You can make the window disappear by left-clicking on the dictionary icon or by pressing <keycap>Esc</keycap>." +msgstr "Du kan låta fönstret försvinna genom att vänsterklicka på ordboksikonen eller genom att trycka på <keycap>Esc</keycap>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:440(para) +msgid "To configure the <application>Dictionary Applet</application>, right-click on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "För att konfigurera <application>Panelprogrammet Ordbok</application>, högerklicka på ordboksikonen och välj sedan <guimenuitem>Inställningar</guimenuitem>." + +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:443(para) +msgid "The <guilabel>Preferences</guilabel> dialog is the same used by the <application>Dictionary</application> application, so refer to <xref linkend=\"mate-dictionary-preferences\"/>" +msgstr "Dialogrutan <guilabel>Inställningar</guilabel> är samma som används av programmet <application>Ordbok</application>, så referera till <xref linkend=\"mate-dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: /tmp/doc-l10n/cvs/mate-utils-dictionary.HEAD/C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Daniel Nylander <[email protected]>, 2006" + diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-add-source.png b/mate-dictionary/help/uk/figures/mate-dictionary-add-source.png Binary files differnew file mode 100644 index 00000000..ab65addc --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-add-source.png diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-applet-window.png b/mate-dictionary/help/uk/figures/mate-dictionary-applet-window.png Binary files differnew file mode 100644 index 00000000..34a5e8ea --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-applet-window.png diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-applet.png b/mate-dictionary/help/uk/figures/mate-dictionary-applet.png Binary files differnew file mode 100644 index 00000000..5bbcc0fc --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-applet.png diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-application.png b/mate-dictionary/help/uk/figures/mate-dictionary-application.png Binary files differnew file mode 100644 index 00000000..45e6e94f --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-application.png diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-find.png b/mate-dictionary/help/uk/figures/mate-dictionary-find.png Binary files differnew file mode 100644 index 00000000..052b99d7 --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-find.png diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-lookup.png b/mate-dictionary/help/uk/figures/mate-dictionary-lookup.png Binary files differnew file mode 100644 index 00000000..01d0c008 --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-lookup.png diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-preferences-print.png b/mate-dictionary/help/uk/figures/mate-dictionary-preferences-print.png Binary files differnew file mode 100644 index 00000000..0d444c99 --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-preferences-print.png diff --git a/mate-dictionary/help/uk/figures/mate-dictionary-preferences-source.png b/mate-dictionary/help/uk/figures/mate-dictionary-preferences-source.png Binary files differnew file mode 100644 index 00000000..3342d656 --- /dev/null +++ b/mate-dictionary/help/uk/figures/mate-dictionary-preferences-source.png diff --git a/mate-dictionary/help/uk/uk.po b/mate-dictionary/help/uk/uk.po new file mode 100644 index 00000000..7f284a7f --- /dev/null +++ b/mate-dictionary/help/uk/uk.po @@ -0,0 +1,696 @@ +# Ukrainian translation of mate-utils dictionary manual +# Copyright (C) 2001 Free Software Foundation, Inc. +# Maxim Dziumanenko <[email protected]>, 2006-2007. +# +msgid "" +msgstr "" +"Project-Id-Version: mate-utils dictionary manual\n" +"POT-Creation-Date: 2010-01-10 16:23+0000\n" +"PO-Revision-Date: 2010-01-10 02:31+0300\n" +"Last-Translator: Maxim Dziumanenko <[email protected]>\n" +"Language-Team: Ukrainian <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "Довідка з програми \"Словник\"" + +#: C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "Словник дозволяє шукати визначення слів та перевіряти їх правопис." + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "Проект документування MATE" + +#: C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Дозволяється копіювати, розповсюджувати та/або змінювати цей документ на " +"умовах ліцензії GNU Free Documentation License (GFDL), версії 1.1 або будь-" +"якої старшої версії, що опублікована Free Software Foundation без " +"інваріантних розділів, тексту титульної сторінки, та тексту фінальної " +"сторінки. Копію GFDL можна знайти <ulink type=\"help\" url=\"ghelp:fdl\">за " +"адресою</ulink> або у файлі COPYING-DOCS, що постачається з цією довідкою." + +#: C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"Ця довідка є частиною збірки документації з MATE, що постачається на умовах " +"ліцензії GFDL. Якщо ви бажаєте розповсюджувати цю довідку окремо від збірки, " +"можете це зробити додавши до довідки копію ліцензії, як описано у пункті 6 " +"ліцензії." + +#: C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"Більшість назв, що використовуються компаніями для розповсюдження їх " +"продуктів та послуг є торговими марками. Якщо такі назви зустрічаються у " +"документації з MATE та учасникам проекту документування MATE відомо, що " +"вони є торговими марками, тоді ці назви пишуться великими літерами або " +"починаються з великої літери." + +#: C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"ДОКУМЕНТ НАДАЄТЬСЯ \"ЯК Є\", БЕЗ БУДЬ-ЯКИХ ГАРАНТІЇ, ЯВНИХ ЧИ НЕЯВНИХ, " +"ВКЛЮЧАЮЧИ, АЛЕ НЕ ОБМЕЖУЮЧИСЬ, ГАРАНТІЙ ЩО ЦЕЙ ДОКУМЕНТ ЧИ ЗМІНЕНА ВЕРСІЯ " +"ДОКУМЕНТА ВІЛЬНІ ВІД ДЕФЕКТІВ, ПРИДАТНІ ДО ПРОДАЖУ, ВІДПОВІДАЮТЬ ПЕВНІЙ МЕТІ " +"АБО НЕ ПОРУШУЮТЬ ЧИЇСЬ ПРАВА. ВЕСЬ РИЗИК ЗА ЯКІСТЬ, ТОЧНІСТЬ, ТА ЧИННІСТЬ " +"ЦЬОГО ДОКУМЕНТУ АБО ЙОГО ЗМІНЕНИХ ВЕРСІЙ ЛЕЖИТЬ НА ВАС. ЯКЩО БУДЬ-ЯКИЙ " +"ДОКУМЕНТ ЧИ ЗМІНЕНА ВЕРСІЯ БУДУТЬ ВИЗНАНІ ДЕФЕКТНИМИ У БУДЬ-ЯКОМУ " +"ВІДНОШЕННІ, ВИ (НЕ ПОЧАТКОВИЙ УКЛАДАЧ, АВТОР АБО БУДЬ-ЯКИЙ СПІВАВТОР) БЕРЕТЕ " +"НА СЕБЕ ВИТРАТИ ЗА БУДЬ-ЯКЕ НЕОБХІДНЕ ОБСЛУГОВУВАННЯ, РЕМОНТ ЧИ ВИПРАВЛЕННЯ. " +"ЦЯ ВІДМОВА ВІД ГАРАНТІЙ СКЛАДАЄ ВАЖЛИВУ ЧАСТИНУ ЦІЄЇ ЛІЦЕНЗІЇ. НЕ " +"ДОПУСКАЄТЬСЯ ВИКОРИСТАННЯ ЦЬОГО ДОКУМЕНТУ АБО ЙОГО ЗМІНЕНОЇ ВЕРСІЇ БЕЗ " +"ПРИЙНЯТТЯ ЦІЄЇ ВІДМОВИ; ТА" + +#: C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"НІ ЗА ЯКИХ ОБСТАВИН ТА ЗА БУДЬ-ЯКОГО ЗАКОНОДАВСТВА, ЧИ ТО ГРОМАДЯНСЬКОЇ " +"ВІДПОВІДАЛЬНОСТІ (ВКЛЮЧАЮЧИ ХАЛАТНІСТЬ), ДОГОВОРУ, ЧИ ЧОГОСЬ ІНШОГО, АВТОР, " +"ПОЧАТКОВИЙ УКЛАДАЧ, БУДЬ-ЯКИЙ СПІВАВТОР, АБО ДИСТРИБ'ЮТОР ДОКУМЕНТУ ЧИ " +"ЗМІНЕНОЇ ВЕРСІЇ ДОКУМЕНТУ, АБО БУДЬ-ЯКИЙ ПОСТАЧАЛЬНИК БУДЬ-ЯКОЇ З ЦИХ " +"СТОРІН, НЕ НЕСЕ ВІДПОВІДАЛЬНІСТЬ ПЕРЕД БУДЬ-ЯКОЮ ОСОБОЮ ЗА БУДЬ-ЯКІ ПРЯМІ, " +"НЕПРЯМІ, ОСОБЛИВІ, ВИПАДКОВІ, АБО ІСТОТНІ ЗБИТКИ БУДЬ-ЯКОГО ХАРАКТЕРУ " +"ВКЛЮЧАЮЧИ, АЛЕ НЕ ОБМЕЖУЮЧИСЬ, ЗБИТКАМИ ВІД ВТРАТИ ПРЕСТИЖУ, ЗУПИНКИ РОБОТИ, " +"ЗБОЇВ АБО НЕСПРАВНОСТЕЙ КОМП'ЮТЕРА, АБО БУДЬ-ЯКІ ІНШІ ЗБИТКИ АБО ВТРАТИ ЩО " +"ВИНИКЛИ БЕЗВІДНОСНО АБО ВНАСЛІДОК ВИКОРИСТАННЯ ЦЬОГО ДОКУМЕНТУ ТА ЗМІНЕНИХ " +"ВЕРСІЙ ЦЬОГО ДОКУМЕНТУ, НАВІТЬ ЯКЩО ЦІ СТОРОНИ, МОЖЛИВО, БУЛИ ПРОІНФОРМОВАНІ " +"ПРО МОЖЛИВІСТЬ ТАКИХ ЗБИТКІВ." + +#: C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"ДОКУМЕНТ ТА ЗМІНЕНІ ВЕРСІЇ ЦЬОГО ДОКУМЕНТУ ПОСТАЧАЮТЬСЯ НА УМОВАХ ВІЛЬНОЇ " +"ЛІЦЕНЗІЇ ДЛЯ ДОКУМЕНТАЦІЇ GNU З ПОДАЛЬШИМ РОЗУМІННЯМ ЩО: <placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "Довідка з програми \"Словник\" версії 1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "Січень 2005" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "У довідці описується програма Словник версії 2.14.0" + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "Зворотний зв'язок" + +#: C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"Щоб сповістити про помилку або внести пропозицію відносно програми \"Словник" +"\" або цієї довідки, дотримуйтесь інструкцій на сторінці <ulink url=\"ghelp:" +"mate-feedback\" type=\"help\">Зворотний зв'язок з MATE</ulink>." + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "Словник" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "Введення" + +#: C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "" +"Аплет <application>Словник</application> дозволяє шукати слова та терміни у " +"електронних словниках." + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "Початок роботи" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "Запуск програми \"Словник\"" + +#: C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "" +"<application>Словник</application> можна запустити наступними способами:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "З меню <guimenu>Програми</guimenu>" + +#: C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"Виберіть <menuchoice><guisubmenu>Стандартні</" +"guisubmenu><guimenuitem>Словник</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "Командний рядок" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "Виконайте наступну команду: <command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "" +"Після запуску програми <application>Словник</application>, відображуються " +"наступне вікно:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "Вікно програми Словник" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "Показано вікно програми Словник." + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "Використання" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "Пошук слова" + +#: C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"Щоб переглянути слово, введіть його у <guilabel>полі вводу</guilabel> та " +"натисніть <keycap>Enter</keycap>." + +#: C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "Якщо визначення слова знайдено, воно з'являється у головному вікні:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "Показано визначення у головному вікні." + +#: C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "У іншому випадку з'являється повідомлення про помилку." + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "Збереження результату пошуку" + +#: C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"Щоб зберегти результат пошуку, виберіть <menuchoice><guimenu>Файл</" +"guimenu><guimenuitem>Зберегти копію</guimenuitem></menuchoice>. Введіть " +"назву файлу у діалоговому вікні <guilabel>Зберегти копію</guilabel>, потім " +"натисніть <guibutton>Зберегти</guibutton>." + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "Друк результату пошуку" + +#: C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"Щоб надрукувати результат пошуку, виберіть <menuchoice><guimenu>Файл</" +"guimenu><guimenuitem>Друк</guimenuitem></menuchoice>." + +#: C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"У діалоговому вікні <guilabel>Друк</guilabel> можна вибрати принтер, формат " +"паперу, кількість копій." + +#: C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "" +"Щоб переглянути виглядатиме надрукована сторінка, натисніть " +"<guibutton>Попередній перегляд</guibutton>." + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "Щоб надрукувати, натисніть на <guibutton>Друк</guibutton>." + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "Пошук тексту" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "Показано пошук у словнику в середині головного вікна." + +#: C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "Щоб знайти текст у знайденій статті, виконайте кроки:" + +#: C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"Виберіть <menuchoice><guimenu>Правка</guimenu> <guimenuitem>Знайти</" +"guimenuitem></menuchoice>. Відобразиться діалогове вікно <guilabel>Знайти</" +"guilabel>." + +#: C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "Введіть текст, що треба знайти, у полі <guilabel>Знайти</guilabel>." + +#: C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"Щоб знайти наступну відповідність тексту, натисніть <guibutton>Наступне</" +"guibutton>. Щоб знайти попередню відповідність тексту, натисніть " +"<guibutton>Попереднє</guibutton>." + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "Параметри" + +#: C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"Щоб налаштувати <application>Словник</application>, виберіть " +"<menuchoice><guimenu>Правка</guimenu><guimenuitem>Параметри</guimenuitem></" +"menuchoice>." + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "Джерела словників" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "Показано вкладку Джерело у діалоговому вікні Параметри." + +#: C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "" +"Щоб змінити словник, що використовується для пошуку слів, виберіть джерело " +"зі списку." + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "Нове джерело даних" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "Показано діалогове вікно додавання джерела." + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "Щоб додати новий словник, виконайте наступні кроки:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "Натисніть на кнопку <guibutton>Додати</guibutton>" + +#: C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "Змініть назву нового джерела у полі <guilabel>Опис</guilabel>" + +#: C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "" +"Вкажіть тип транспорту нового джерела у розкривному списку " +"<guilabel>Транспорт</guilabel>" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "Зміна атрибутів нового джерела даних" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "Натисніть <guibutton>Додати</guibutton>" + +#: C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "" +"Різні типи транспорту використовують різні атрибути. Список доступних " +"атрибутів в залежності від типу транспорту:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "Транспорт" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "Атрибути" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "Словниковий сервер" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "Назва комп'ютера: назва вузла словникового сервера" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "Порт: порт на словниковому сервері" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "Видалення джерела" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "Щоб видалити словник, виконайте наступні кроки:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "Виберіть джерело, яке хочете видалити" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "Натисніть на кнопку <guibutton>Видалити</guibutton>." + +#: C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"Якщо ви видаляєте словник, він буде остаточно видалений зі списку доступних " +"словників. Файли словників можуть бути визначені системно, тому ви не " +"зможете їх видалити, якщо у вас немає відповідних прав доступу." + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "Параметри друку" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "Показано вкладку Друк вікна Параметри." + +#: C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "" +"Якщо ви бажаєте змінити назву та розмір шрифту, що використовується для " +"друку, виконайте наступні дії:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "Натисніть на кнопку <guilabel>Шрифт друку</guilabel>" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "Виберіть шрифт та розмір шрифту" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "Натисніть <guibutton>Гаразд</guibutton>." + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "Аплет Словник" + +#: C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"Програма <application>Словник</application> має аплет для панелі " +"<application>Пошук у словнику</application>. Можна додати його до панелі та " +"шукати слова у ньому." + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "Аплет \"Словник\"" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "Показано аплет Словник" + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "Запуск аплету Словник" + +#: C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"Щоб додати аплет <application>Словник</application> до панелі, натисніть " +"правою кнопкою на панелі, потім виберіть <guimenuitem>Додати до панелі</" +"guimenuitem>. У діалоговому вікні <application>Додати до панелі</" +"application> виберіть <application>Пошук у словнику</application> та " +"натисніть <guibutton>Гаразд</guibutton>." + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "Використання аплету Словник" + +#: C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"Щоб знайти слово, введіть його у <guilabel>полі вводу</guilabel> та " +"натисніть <keycap>Enter</keycap> або клацніть правою кнопкою миші на значку " +"словника та виберіть <guimenuitem>Знайти</guimenuitem>." + +#: C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "" +"Якщо визначення слова буде знайдено, відкриється вікно з текстом визначення:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "Показано вікно програми Словник." + +#: C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"Щоб зберегти визначення у текстовому файлі натисніть <guibutton>Зберегти</" +"guibutton>. Для друку визначення натисніть <guibutton>Друк</guibutton>. Щоб " +"очистити поле вводу натисніть <guibutton>Очистити</guibutton>." + +#: C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"Вікно можна сховати, якщо клацнути лівою кнопкою миші на значку словника або " +"натиснути <keycap>Esc</keycap>." + +#: C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"Щоб налаштувати аплет <application>Словник</application>, клацніть на ньому " +"правою кнопкою миші, потім виберіть <guimenuitem>Параметри</guimenuitem>." + +#: C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"Діалогове вікно <guilabel>Параметри</guilabel> таке саме як і у програми " +"<application>Слокник</application>, тому дивіться <xref linkend=\"mate-" +"dictionary-preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2 +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "Максим Дзюманенко <[email protected]>" diff --git a/mate-dictionary/help/zh_CN/zh_CN.po b/mate-dictionary/help/zh_CN/zh_CN.po new file mode 100644 index 00000000..4ee1f193 --- /dev/null +++ b/mate-dictionary/help/zh_CN/zh_CN.po @@ -0,0 +1,653 @@ +msgid "" +msgstr "" +"Project-Id-Version: dictionary.mate-2-26\n" +"POT-Creation-Date: 2009-04-19 01:37+0000\n" +"PO-Revision-Date: 2009-04-20 01:57+0600\n" +"Last-Translator: TeliuTe <[email protected]>\n" +"Language-Team: Chinese (simplified) <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Chinese\n" +"X-Poedit-Country: GHANA\n" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:150(None) +msgid "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" +msgstr "" +"@@image: 'figures/mate-dictionary-application.png'; " +"md5=fb48a9e5863bfb2b3811df2e28489eb7" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:179(None) +msgid "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" +msgstr "" +"@@image: 'figures/mate-dictionary-lookup.png'; " +"md5=c41c96af4de54f457a2081aad009a8d0" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:221(None) +msgid "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" +msgstr "" +"@@image: 'figures/mate-dictionary-find.png'; " +"md5=d8bf0677084e2d9998a7942faaab5379" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:262(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-source.png'; " +"md5=5470b15e64e66924477f150c4f47e96d" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:282(None) +msgid "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" +msgstr "" +"@@image: 'figures/mate-dictionary-add-source.png'; " +"md5=d059507fee77bb176fce53373951756b" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:351(None) +msgid "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" +msgstr "" +"@@image: 'figures/mate-dictionary-preferences-print.png'; " +"md5=12a65f07cb333db4c7ba743d1d12a00f" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:385(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" +msgstr "" +"@@image: 'figures/mate-dictionary-applet.png'; " +"md5=538c7fa191540f99dd964963a1079677" + +#. When image changes, this message will be marked fuzzy or untranslated for you. +#. It doesn't matter what you translate it to: it's not used at all. +#: C/mate-dictionary.xml:421(None) +msgid "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" +msgstr "" +"@@image: 'figures/mate-dictionary-applet-window.png'; " +"md5=e26ac4847d2e7b53c6bba7d8e1a519c4" + +#: C/mate-dictionary.xml:24(title) +msgid "Dictionary Manual" +msgstr "字典手册" + +#: C/mate-dictionary.xml:27(para) +msgid "" +"Dictionary enables you to look up definitions and correct spellings of words." +msgstr "字典允许您查询一个单词的意思和正确的拼写。" + +#: C/mate-dictionary.xml:34(year) +msgid "2005" +msgstr "2005" + +#: C/mate-dictionary.xml:35(holder) C/mate-dictionary.xml:82(para) +msgid "Emmanuele Bassi" +msgstr "Emmanuele Bassi" + +#: C/mate-dictionary.xml:48(publishername) C/mate-dictionary.xml:83(para) +msgid "MATE Documentation Project" +msgstr "MATE 文档项目" + +#: C/mate-dictionary.xml:2(para) +msgid "" +"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 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 <ulink type=\"help\" url=\"ghelp:fdl\">link</ulink> or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"对于本文档的复制、分发和/或修改必须遵循自由软件基金会 (Free Software " +"Foundation) 发布的 GNU 自由文档许可证 (GFDL) 版本 1.1 或更高版本,该许可证没" +"有固定的部分、没有封面和背页文本。您可以在此<ulink type=\"help\" url=\"ghelp:" +"fdl\">链接</ulink>上或在随本手册一起分发的 COPYING-DOCS 文件中找到 GFDL 的副" +"本。" + +#: C/mate-dictionary.xml:12(para) +msgid "" +"This manual is part of a collection of MATE manuals distributed under the " +"GFDL. If you want to distribute this manual separately from the collection, " +"you can do so by adding a copy of the license to the manual, as described in " +"section 6 of the license." +msgstr "" +"本手册是在 GFDL 许可之下分发的 MATE 手册集合的一部分。如果想要单独分发此手" +"册,可以在手册中添加该许可证的一份副本然后分发,如该许可证的第 6 部分所述。" + +#: C/mate-dictionary.xml:19(para) +msgid "" +"Many of the names used by companies to distinguish their products and " +"services are claimed as trademarks. Where those names appear in any MATE " +"documentation, and the members of the MATE Documentation Project are made " +"aware of those trademarks, then the names are in capital letters or initial " +"capital letters." +msgstr "" +"各个公司使用的许多用于区别它们产品和服务的名称都声明为商标。在所有的 MATE 文" +"档以及 MATE 文档项目的成员中,这些名称都是以全大写字母或首字母大写显示,从而" +"表明它们是商标。" + +#: C/mate-dictionary.xml:35(para) +msgid "" +"DOCUMENT IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, " +"EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT " +"THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS " +"MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE " +"RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR " +"MODIFIED VERSION OF THE DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR " +"MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL " +"WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY " +"SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN " +"ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED VERSION " +"OF THE DOCUMENT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND" +msgstr "" +"文档按“原样”提供,不提供任何明示或暗示的保证,包括但不限于:文档或文档的修改" +"版本没有适销性方面的缺陷、适合特定目的的适用性,以及没有侵权行为。您将自行承" +"担本文档以及文档修改版本的质量、准确性以及性能方面的风险。如果任何文档或文档" +"修改版本存在缺陷,您(而不是最初的编写者、作者或撰写人)将承担所有必需的服务、" +"维修或更正的费用。此免责声明是本许可证的重要组成部分。如果不接受此免责声明," +"那么您就没有权利使用任何文档或文档的修改版本;并且" + +#: C/mate-dictionary.xml:55(para) +msgid "" +"UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING " +"NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, INITIAL WRITER, ANY " +"CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION OF THE " +"DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON " +"FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF " +"ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, " +"WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES " +"OR LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED " +"VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE " +"POSSIBILITY OF SUCH DAMAGES." +msgstr "" +"无论在任何情况以及在任何法律理论下,本文档或文档修改版本的作者、最初的编写" +"者、任何撰写人或任何分发者,或者任意这些方的任何提供者都不对任何人由于使用本" +"文档或文档修改版本引起或带来的任何直接的、间接的、特殊的、偶然的或继发的损失" +"承担任何民事(包括疏忽)、合同或其它方面的责任,这些损失包括但不限于信誉损失、" +"工作停止、计算机失败或故障,或任何以及所有其它损失或由此引发的或与之相关的损" +"失,即使这些方已被告知存在出现此类损失的可能性时也是如此。" + +#: C/mate-dictionary.xml:28(para) +msgid "" +"DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS " +"OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT: " +"<placeholder-1/>" +msgstr "" +"本文档以及文档的修改版本都是在遵循 GNU 自由文档许可证的条款下提供,这表示具有" +"以下含义:<placeholder-1/>" + +#: C/mate-dictionary.xml:55(firstname) +msgid "Emmanuele" +msgstr "Emmanuele" + +#: C/mate-dictionary.xml:56(surname) +msgid "Bassi" +msgstr "Bassi" + +#: C/mate-dictionary.xml:58(email) +msgid "[email protected]" +msgstr "[email protected]" + +#: C/mate-dictionary.xml:79(revnumber) +msgid "Dictionary Manual V1.0.0" +msgstr "字典手册 V1.0.0" + +#: C/mate-dictionary.xml:80(date) +msgid "January 2005" +msgstr "2005年1月" + +#: C/mate-dictionary.xml:88(releaseinfo) +msgid "This manual describes version 2.14.0 of Dictionary." +msgstr "本手册讲述的是字典 2.14.0 版。" + +#: C/mate-dictionary.xml:90(title) +msgid "Feedback" +msgstr "反馈" + +#: C/mate-dictionary.xml:91(para) +msgid "" +"To report a bug or make a suggestion regarding the Dictionary application or " +"this manual, follow the directions in the <ulink url=\"ghelp:mate-feedback" +"\" type=\"help\">MATE Feedback Page</ulink>." +msgstr "" +"要报告关于字典程序或使用手册中的缺陷,或者提出建议,请参照 <ulink url=" +"\"ghelp:mate-feedback\" type=\"help\">MATE 反馈页</ulink> 上的指导。" + +#: C/mate-dictionary.xml:101(primary) +msgid "Dictionary" +msgstr "字典" + +#: C/mate-dictionary.xml:107(title) +msgid "Introduction" +msgstr "介绍" + +#: C/mate-dictionary.xml:109(para) +msgid "" +"The <application>Dictionary</application> application enables you to search " +"words and terms on a dictionary source." +msgstr "<application>字典</application> 程序允许您在字典源上查询一个词或词组" + +#: C/mate-dictionary.xml:116(title) +msgid "Getting Started" +msgstr "快速入门" + +#: C/mate-dictionary.xml:120(title) +msgid "To Start Dictionary" +msgstr "启动字典" + +#: C/mate-dictionary.xml:122(para) +msgid "" +"You can start <application>Dictionary</application> in the following ways:" +msgstr "您可以用下面的方法启动 <application>字典</application>:" + +#: C/mate-dictionary.xml:127(term) +msgid "<guimenu>Applications</guimenu> menu" +msgstr "<guimenu>应用程序</guimenu> 菜单" + +#: C/mate-dictionary.xml:129(para) +msgid "" +"Choose <menuchoice><guisubmenu>Accessories</" +"guisubmenu><guimenuitem>Dictionary</guimenuitem></menuchoice>." +msgstr "" +"点菜单 <menuchoice><guisubmenu>附件</guisubmenu><guimenuitem>字典</" +"guimenuitem></menuchoice>。" + +#: C/mate-dictionary.xml:135(term) +msgid "Command line" +msgstr "命令行" + +#: C/mate-dictionary.xml:137(para) +msgid "Execute the following command: <command>mate-dictionary</command>" +msgstr "运行下面的命令:<command>mate-dictionary</command>" + +#: C/mate-dictionary.xml:142(para) +msgid "" +"Once started, the <application>Dictionary</application> window is displayed:" +msgstr "启动以后,出来一个 <application>字典</application> 窗口:" + +#: C/mate-dictionary.xml:146(title) C/mate-dictionary.xml:175(title) +#: C/mate-dictionary.xml:217(title) C/mate-dictionary.xml:258(title) +#: C/mate-dictionary.xml:278(title) C/mate-dictionary.xml:347(title) +msgid "Dictionary Window" +msgstr "字典窗口" + +#: C/mate-dictionary.xml:152(phrase) +msgid "Shows Dictionary main window." +msgstr "显示字典主窗口。" + +#: C/mate-dictionary.xml:163(title) +msgid "Usage" +msgstr "用法" + +#: C/mate-dictionary.xml:166(title) +msgid "Looking up a word" +msgstr "查询一个词" + +#: C/mate-dictionary.xml:168(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel> and " +"press <keycap>Enter</keycap>." +msgstr "" +"要查询一个词,在 <guilabel>输入框</guilabel> 里输入,然后按一下 <keycap>回车" +"键</keycap>。" + +#: C/mate-dictionary.xml:171(para) +msgid "" +"If some definition for the word is found, it will appear inside the main " +"window area:" +msgstr "如果查出了这个词,它的含义将出现在主窗口里:" + +#: C/mate-dictionary.xml:181(phrase) +msgid "Shows a definition inside the Dictionary main window." +msgstr "在字典主窗口里显示词的含义。" + +#: C/mate-dictionary.xml:186(para) +msgid "" +"Otherwise, an error dialog will appear, with a message explaining the nature " +"of the error." +msgstr "否则,会出来一个错误对话框,和一条错误提示。" + +#: C/mate-dictionary.xml:192(title) +msgid "Save look up results" +msgstr "保存查询结果" + +#: C/mate-dictionary.xml:194(para) +msgid "" +"To save the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Save a Copy</guimenuitem></menuchoice>. Enter a name " +"for the file in the <guilabel>Save a Copy</guilabel> dialog, then click " +"<guibutton>Save</guibutton>." +msgstr "" +"要保存查询结果,点菜单 <menuchoice><guimenu>文件</guimenu><guimenuitem>保存副" +"本</guimenuitem></menuchoice>,在出来的 <guilabel>保存副本</guilabel> 对话框" +"里输入文件名,然后点 <guibutton>保存</guibutton> 按钮。" + +#: C/mate-dictionary.xml:199(title) +msgid "Print look up results" +msgstr "打印查询结果" + +#: C/mate-dictionary.xml:201(para) +msgid "" +"To print the results of a look up, choose <menuchoice><guimenu>File</" +"guimenu><guimenuitem>Print</guimenuitem></menuchoice>." +msgstr "" +"要打印查询结果,点菜单 <menuchoice><guimenu>文件</guimenu><guimenuitem>打印</" +"guimenuitem></menuchoice>。" + +#: C/mate-dictionary.xml:203(para) +msgid "" +"Inside the <guilabel>Print</guilabel> dialog you can select the printer to " +"use, the paper format, the number of copies." +msgstr "" +"在 <guilabel>打印</guilabel> 对话框里,您可以选择打印机、纸型、打印份数。" + +#: C/mate-dictionary.xml:206(para) +msgid "" +"To see a preview of what will be printed, click <guibutton>Preview</" +"guibutton>." +msgstr "要看一下打印预览,点 <guibutton>预览</guibutton>。" + +#: C/mate-dictionary.xml:209(para) +msgid "To print, click <guibutton>Print</guibutton>." +msgstr "要打印,点 <guibutton>打印</guibutton> 按钮。" + +#: C/mate-dictionary.xml:214(title) +msgid "Find Text" +msgstr "查找文本" + +#: C/mate-dictionary.xml:223(phrase) +msgid "Shows the Dictionary Find pane inside the main window." +msgstr "在字典主窗口里显示查找面板。" + +#: C/mate-dictionary.xml:229(para) +msgid "" +"To find text inside the results of a look up, perform the following steps:" +msgstr "要在查询结果里查找文本,请按下面的步骤操作:" + +#: C/mate-dictionary.xml:233(para) +msgid "" +"Choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Find</guimenuitem></" +"menuchoice> to display the <guilabel>Find</guilabel> pane." +msgstr "" +"点菜单 <menuchoice><guimenu>E编辑</guimenu><guimenuitem>查找</guimenuitem></" +"menuchoice>,出来一个 <guilabel>查找</guilabel> 面板。" + +#: C/mate-dictionary.xml:235(para) +msgid "" +"Type the text you want to find inside the <guilabel>Search</guilabel> entry." +msgstr "在 <guilabel>搜索框</guilabel> 里,输入您想查找的文本。" + +#: C/mate-dictionary.xml:237(para) +msgid "" +"To find the next occurrence of the text, click <guibutton>Next</guibutton>. " +"To find the previous occurrence of the text, click <guibutton>Previous</" +"guibutton>." +msgstr "" +"要查找下一个匹配的文本,点 <guibutton>下一个</guibutton>。要查找上一个匹配的" +"文本,点 <guibutton>上一个</guibutton>。" + +#: C/mate-dictionary.xml:248(title) C/mate-dictionary.xml:438(title) +msgid "Preferences" +msgstr "首选项" + +#: C/mate-dictionary.xml:250(para) +msgid "" +"To change the <application>Dictionary</application> application preferences, " +"choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</" +"guimenuitem></menuchoice>." +msgstr "" +"要更改 <application>字典</application> 程序的首选项,点菜单 " +"<menuchoice><guimenu>编辑</guimenu><guimenuitem>首选项</guimenuitem></" +"menuchoice>。" + +#: C/mate-dictionary.xml:255(title) +msgid "Dictionary Sources" +msgstr "字典源" + +#: C/mate-dictionary.xml:264(phrase) +msgid "Shows the Source tab of the Preferences dialog." +msgstr "在首选项对话框里显示源标签。" + +#: C/mate-dictionary.xml:269(para) +msgid "" +"To change the dictionary source used to look up words, select the desired " +"source from the list." +msgstr "要更改查询单词的字典源,从列表中选择另外一个。" + +#: C/mate-dictionary.xml:275(title) +msgid "Adding a new source" +msgstr "添加一个新的源" + +#: C/mate-dictionary.xml:284(phrase) +msgid "Shows the Add Source dialog." +msgstr "显示添加源对话框。" + +#: C/mate-dictionary.xml:289(para) +msgid "To add a new dictionary source, perform the following steps:" +msgstr "要添加一个新的字典源,请按下面的步骤操作:" + +#: C/mate-dictionary.xml:292(para) +msgid "Click on the <guibutton>Add</guibutton> button" +msgstr "点 <guibutton>添加</guibutton> 按钮" + +#: C/mate-dictionary.xml:293(para) +msgid "" +"Edit the name of the new source inside the <guilabel>Description</guilabel> " +"entry" +msgstr "在 <guilabel>描述</guilabel> 框里,输入新源的名称" + +#: C/mate-dictionary.xml:294(para) +msgid "" +"Change the transport type of the new source using the <guilabel>Transport</" +"guilabel> combo box" +msgstr "在 <guilabel>传送</guilabel> 组合框里,更改传输类型" + +#: C/mate-dictionary.xml:295(para) +msgid "Edit the attributes of the new source" +msgstr "编辑新源的属性" + +#: C/mate-dictionary.xml:296(para) +msgid "Click <guibutton>Add</guibutton>" +msgstr "点 <guibutton>添加</guibutton> 按钮" + +#: C/mate-dictionary.xml:299(para) +msgid "" +"Different source transport types uses different attributes. This is the list " +"of available attributes per transport type:" +msgstr "不同的源传输类型使用不同的属性。下面是每个传输类型可用的属性列表:" + +#: C/mate-dictionary.xml:306(para) +msgid "Transport" +msgstr "传输" + +#: C/mate-dictionary.xml:307(para) +msgid "Attributes" +msgstr "属性" + +#: C/mate-dictionary.xml:312(para) +msgid "Dictionary Server" +msgstr "字典服务器" + +#: C/mate-dictionary.xml:314(para) +msgid "Hostname: the hostname of the dictionary server" +msgstr "主机名:字典服务器的主机名" + +#: C/mate-dictionary.xml:315(para) +msgid "Port: the port of the dictionary server" +msgstr "端口:字典服务器的端口" + +#: C/mate-dictionary.xml:326(title) +msgid "Removing a source" +msgstr "删除一个源" + +#: C/mate-dictionary.xml:328(para) +msgid "To remove a dictionary source, perform the following steps:" +msgstr "要删除一个字典源,请按下面的步骤操作:" + +#: C/mate-dictionary.xml:331(para) +msgid "Select the source you wish to remove" +msgstr "选中您想删除的源" + +#: C/mate-dictionary.xml:332(para) +msgid "Click the <guibutton>Remove</guibutton> button" +msgstr "点 <guibutton>删除</guibutton> 按钮" + +#: C/mate-dictionary.xml:335(para) +msgid "" +"If you remove a dictionary source it will be permanently deleted from the " +"list of available sources. Also, as some sources might be defined system-" +"wide you may actually not be able to remove them unless you have the right " +"ownership privileges." +msgstr "" +"如果您删除了一个字典源,它将彻底从可用源列表里删除。但是,有些源被定义成系统" +"级的,您实际上不能删除它们,除非您取得了特别的权限。" + +#: C/mate-dictionary.xml:344(title) +msgid "Print Options" +msgstr "打印选项" + +#: C/mate-dictionary.xml:353(phrase) +msgid "Shows the Print tab inside the Preferences dialog." +msgstr "在首选项对话框里显示打印标签。" + +#: C/mate-dictionary.xml:358(para) +msgid "" +"If you want to change the font name and size used when printing, perform the " +"following steps:" +msgstr "如果您想更改打印时的字体和字号,请按下面的步骤操作:" + +#: C/mate-dictionary.xml:362(para) +msgid "Click on the <guilabel>Print Font</guilabel> button" +msgstr "点 <guilabel>打印字体</guilabel> 按钮" + +#: C/mate-dictionary.xml:363(para) +msgid "Select the font and size you wish to use" +msgstr "选择一个您想要的字体" + +#: C/mate-dictionary.xml:364(para) +msgid "Click <guibutton>Ok</guibutton>" +msgstr "点 <guibutton>确定</guibutton>" + +#: C/mate-dictionary.xml:373(title) +msgid "The Dictionary Applet" +msgstr "字典小程序" + +#: C/mate-dictionary.xml:375(para) +msgid "" +"The <application>Dictionary</application> application comes with a panel " +"applet, the <application>Dictionary Applet</application>. You can add the " +"<application>Dictionary Applet</application> applet to a panel and look up " +"words in dictionaries." +msgstr "" +"<application>字典</application> 程序也附带一个面板小程序 <application>字典小" +"程序</application>。您可以添加 <application>字典小程序</application> 到一个面" +"板上,然后在字典里查询单词。" + +#: C/mate-dictionary.xml:381(title) C/mate-dictionary.xml:417(title) +msgid "Dictionary Applet Window" +msgstr "字典小程序窗口" + +#: C/mate-dictionary.xml:387(phrase) +msgid "Shows Dictionary Applet." +msgstr "显示字典小程序。" + +#: C/mate-dictionary.xml:395(title) +msgid "To Start Dictionary Applet" +msgstr "启动字典小程序" + +#: C/mate-dictionary.xml:397(para) +msgid "" +"To add <application>Dictionary Applet</application> to a panel, right-click " +"on the panel, then choose <guimenuitem>Add to Panel</guimenuitem>. Select " +"Dictionary Applet in the <application>Add to the panel</application> dialog, " +"then click <guibutton>OK</guibutton>." +msgstr "" +"要添加 <application>字典小程序</application> 到一个面板上,在面板上点右键,然" +"后选 <guimenuitem>添加到面板</guimenuitem> 命令,在出来的 <application>添加到" +"面板</application> 对话框里,选择字典小程序,然后点 <guibutton>添加</" +"guibutton>。" + +#: C/mate-dictionary.xml:406(title) +msgid "Using the Dictionary Applet" +msgstr "使用字典小程序" + +#: C/mate-dictionary.xml:408(para) +msgid "" +"To look up a word, type it into the <guilabel>entry field</guilabel>, and " +"press <keycap>Enter</keycap> or right-click on the dictionary icon and then " +"choose <guimenuitem>Look up</guimenuitem>." +msgstr "" +"要查询一个单词,在 <guilabel>输入框</guilabel> 里输入,然后按一下 <keycap>回" +"车键</keycap> 或者用右键点击字典图标,选 <guimenuitem>查询</guimenuitem>。" + +#: C/mate-dictionary.xml:413(para) +msgid "" +"If some definition for the word was found, a window will appear, with the " +"text of the definitions:" +msgstr "如果查到了这个词,就会显示一个窗口,里面是这个词的解释:" + +#: C/mate-dictionary.xml:423(phrase) +msgid "Shows Dictionary Applet main window." +msgstr "显示字典小程序主窗口。" + +#: C/mate-dictionary.xml:428(para) +msgid "" +"Click <guibutton>Save</guibutton> to save the definitions to a text file. " +"Click <guibutton>Print</guibutton> to print the definitions. Click " +"<guibutton>Clear</guibutton> to clear the definitions." +msgstr "" +"点 <guibutton>保存</guibutton> 可以保存解释的内容。点 <guibutton>打印</" +"guibutton> 可以打印解释。点 <guibutton>清除</guibutton> 可以清除解释内容。" + +#: C/mate-dictionary.xml:432(para) +msgid "" +"You can make the window disappear by left-clicking on the dictionary icon or " +"by pressing <keycap>Esc</keycap>." +msgstr "" +"您可以在字典图标上点左键取消这个窗口,也可以按 <keycap>Esc 键</keycap>。" + +#: C/mate-dictionary.xml:440(para) +msgid "" +"To configure the <application>Dictionary Applet</application>, right-click " +"on the dictionary icon, then choose <guimenuitem>Preferences</guimenuitem>." +msgstr "" +"要配置 <application>字典小程序</application>,在字典图标上点右键,然后选 " +"<guimenuitem>首选项</guimenuitem>。" + +#: C/mate-dictionary.xml:443(para) +msgid "" +"The <guilabel>Preferences</guilabel> dialog is the same used by the " +"<application>Dictionary</application> application, so refer to <xref linkend=" +"\"mate-dictionary-preferences\"/>" +msgstr "" +"出来的 <guilabel>首选项</guilabel> 对话框,跟 <application>字典</" +"application> 程序的用法一样,请参阅:<xref linkend=\"mate-dictionary-" +"preferences\"/>" + +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2. +#: C/mate-dictionary.xml:0(None) +msgid "translator-credits" +msgstr "TeliuTe <[email protected]>, 2009." diff --git a/mate-dictionary/libgdict/Makefile.am b/mate-dictionary/libgdict/Makefile.am new file mode 100644 index 00000000..006b42f4 --- /dev/null +++ b/mate-dictionary/libgdict/Makefile.am @@ -0,0 +1,134 @@ +NULL = + +INCLUDES = -DG_LOG_DOMAIN=\"Gdict\" \ + -DDATADIR=\""$(datadir)"\" \ + -DLIBDIR=\""$(libdir)"\" \ + -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DPREFIX=\""$(prefix)"\" \ + -DMATELOCALEDIR=\""$(mateutilslocaledir)"\" \ + -DGDICTSOURCESDIR=\""$(datadir)/mate-dict/sources"\" \ + -DGDICT_ENABLE_INTERNALS=1 \ + -DG_DISABLE_DEPRECATED \ + -DGDK_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DPANGO_DISABLE_DEPRECATED \ + -DG_DISABLE_SINGLE_INCLUDES \ + -DGTK_DISABLE_SINGLE_INCLUDES \ + $(NULL) + +sources_h = \ + $(srcdir)/gdict-context.h \ + $(srcdir)/gdict-client-context.h \ + $(srcdir)/gdict-database-chooser.h \ + $(srcdir)/gdict-defbox.h \ + $(srcdir)/gdict-source-chooser.h \ + $(srcdir)/gdict-source-loader.h \ + $(srcdir)/gdict-source.h \ + $(srcdir)/gdict-speller.h \ + $(srcdir)/gdict-strategy-chooser.h \ + $(srcdir)/gdict-utils.h \ + $(NULL) + +sources_h_priv = \ + $(srcdir)/gdict-context-private.h \ + $(srcdir)/gdict-debug.h \ + $(srcdir)/gdict-private.h \ + $(NULL) + +sources_c = \ + $(srcdir)/gdict-context.c \ + $(srcdir)/gdict-client-context.c \ + $(srcdir)/gdict-database-chooser.c \ + $(srcdir)/gdict-defbox.c \ + gdict-enum-types.c \ + gdict-marshal.c \ + $(srcdir)/gdict-source-chooser.c \ + $(srcdir)/gdict-source-loader.c \ + $(srcdir)/gdict-source.c \ + $(srcdir)/gdict-speller.c \ + $(srcdir)/gdict-strategy-chooser.c \ + $(srcdir)/gdict-utils.c \ + $(NULL) + +lib_LTLIBRARIES = libmatedict.la + +# MATE Dictionary shared library +libmatedict_la_SOURCES = $(sources_h) $(sources_h_priv) $(sources_c) +libmatedict_la_CPPFLAGS = $(LIBGDICT_CFLAGS) $(GDICT_DEBUG_CFLAGS) $(MAINTAINER_CFLAGS) +libmatedict_la_LIBADD = $(LIBGDICT_LIBS) +libmatedict_la_LDFLAGS = \ + -version-info $(LIBGDICT_LT_VERSION) \ + -export-dynamic \ + -no-undefined + +libgdict_includedir = $(includedir)/mate-dict/gdict +libgdict_include_HEADERS = \ + $(sources_h) \ + gdict-enum-types.h \ + gdict-version.h \ + $(srcdir)/gdict.h \ + $(NULL) + +gdict_built_files = \ + gdict-enum-types.h \ + gdict-enum-types.c \ + gdict-marshal.h \ + gdict-marshal.c + +stamp_files = stamp-gdict-enum-types.h stamp-gdict-marshal.h + +CLEANFILES = $(stamp_files) $(gdict_built_files) +DISTCLEANFILES = gdict-version.h +MAINTAINERCLEANFILES = $(stamp_files) $(gdict_built_files) gdict-version.h + +EXTRA_DIST = \ + gdict-version.h.in \ + gdict-enum-types.h.in \ + gdict-enum-types.c.in \ + gdict-marshal.list \ + mate-dict.pc.in \ + $(NULL) + +BUILT_SOURCES = $(gdict_built_files) + +gdict-marshal.h: stamp-gdict-marshal.h + @true +stamp-gdict-marshal.h: gdict-marshal.list $(GLIB_GENMARSHAL) Makefile + $(AM_V_GEN)$(GLIB_GENMARSHAL) $< --header --prefix=gdict_marshal > xgen-gmh \ + && ( cmp -s xgen-gmh gdict-marshal.h || cp xgen-gmh gdict-marshal.h ) \ + && rm -f xgen-gmh \ + && echo timestamp > $(@F) + +gdict-marshal.c: gdict-marshal.list $(GLIB_GENMARSHAL) Makefile + $(AM_V_GEN)( echo "#include \"gdict-marshal.h\""; echo; \ + $(GLIB_GENMARSHAL) $< --body --prefix=gdict_marshal ) > xgen-gmc \ + && cp xgen-gmc gdict-marshal.c \ + && rm -f xgen-gmc + +gdict-enum-types.h: stamp-gdict-enum-types.h + @true +stamp-gdict-enum-types.h: $(sources_h) gdict-enum-types.h.in Makefile + $(AM_V_GEN)( cd $(srcdir) && \ + $(GLIB_MKENUMS) \ + --template $(srcdir)/gdict-enum-types.h.in \ + $(sources_h) ) > xgen-ceth \ + && ( cmp -s xgen-ceth gdict-enum-types.h || cp xgen-ceth gdict-enum-types.h ) \ + && rm -f xgen-ceth \ + && echo timestamp > $(@F) + +gdict-enum-types.c: gdict-enum-types.h gdict-enum-types.c.in Makefile + $(AM_V_GEN)( cd $(srcdir) && \ + $(GLIB_MKENUMS) \ + --template $(srcdir)/gdict-enum-types.c.in \ + $(sources_h) ) > xgen-cetc \ + && cp xgen-cetc gdict-enum-types.c \ + && rm -f xgen-cetc + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = mate-dict.pc + +distclean-local: + if test $(srcdir) != .; then \ + rm -f $(MAINTAINERCLEANFILES); \ + fi + diff --git a/mate-dictionary/libgdict/gdict-client-context.c b/mate-dictionary/libgdict/gdict-client-context.c new file mode 100644 index 00000000..5e370f0a --- /dev/null +++ b/mate-dictionary/libgdict/gdict-client-context.c @@ -0,0 +1,2162 @@ +/* gdict-client-context.c - + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-client-context + * @short_description: DICT client transport + * + * #GdictClientContext is an implementation of the #GdictContext interface. + * It implements the Dictionary Protocol as defined by the RFC 2229 in order + * to connect to a dictionary server. + * + * You should rarely instantiate this object directely: use an appropriate + * #GdictSource instead. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <netdb.h> +#include <fcntl.h> +#include <errno.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <glib.h> +#include <glib/gi18n-lib.h> + +#include "gdict-context-private.h" +#include "gdict-context.h" +#include "gdict-client-context.h" +#include "gdict-enum-types.h" +#include "gdict-marshal.h" +#include "gdict-debug.h" +#include "gdict-utils.h" +#include "gdict-private.h" + +typedef enum { + CMD_CLIENT, + CMD_SHOW_DB, + CMD_SHOW_STRAT, + CMD_SHOW_INFO, /* not implemented */ + CMD_SHOW_SERVER, /* not implemented */ + CMD_MATCH, + CMD_DEFINE, + CMD_STATUS, /* not implemented */ + CMD_OPTION_MIME, /* not implemented */ + CMD_AUTH, /* not implemented */ + CMD_HELP, /* not implemented */ + CMD_QUIT, + + CMD_INVALID +} GdictCommandType; +#define IS_VALID_CMD(cmd) (((cmd) >= CMD_CLIENT) || ((cmd) < CMD_INVALID)) + +/* command strings: keep synced with the enum above! */ +static const gchar *dict_command_strings[] = { + "CLIENT", + "SHOW DB", + "SHOW STRAT", + "SHOW INFO", + "SHOW SERVER", + "MATCH", + "DEFINE", + "STATUS", + "OPTION MIME", + "AUTH", + "HELP", + "QUIT", + + NULL +}; + +/* command stata */ +enum +{ + S_START, + + S_STATUS, + S_DATA, + + S_FINISH +}; + +typedef struct +{ + GdictCommandType cmd_type; + + gchar *cmd_string; + guint state; + + /* optional parameters passed to the command */ + gchar *database; + gchar *strategy; + gchar *word; + + /* buffer used to hold the reply from the server */ + GString *buffer; + + gpointer data; + GDestroyNotify data_destroy; +} GdictCommand; + +/* The default string to be passed to the CLIENT command */ +#define GDICT_DEFAULT_CLIENT "MATE Dictionary (" VERSION ")" + +/* Default server:port couple */ +#define GDICT_DEFAULT_HOSTNAME "dict.org" +#define GDICT_DEFAULT_PORT 2628 + +/* make the hostname lookup expire every five minutes */ +#define HOSTNAME_LOOKUP_EXPIRE 300 + +/* wait 30 seconds between connection and receiving data on the line */ +#define CONNECTION_TIMEOUT 30 + +enum +{ + PROP_0, + + PROP_HOSTNAME, + PROP_PORT, + PROP_STATUS, + PROP_CLIENT_NAME +}; + +enum +{ + CONNECTED, + DISCONNECTED, + + LAST_SIGNAL +}; + +static guint gdict_client_context_signals[LAST_SIGNAL] = { 0 }; + +#define GDICT_CLIENT_CONTEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_CLIENT_CONTEXT, GdictClientContextPrivate)) +struct _GdictClientContextPrivate +{ +#ifdef ENABLE_IPV6 + struct sockaddr_storage sockaddr; + struct addrinfo *host6info; +#else + struct sockaddr_in sockaddr; +#endif + struct hostent *hostinfo; + + time_t last_lookup; + + gchar *hostname; + gint port; + + GIOChannel *channel; + guint source_id; + guint timeout_id; + + GdictCommand *command; + GQueue *commands_queue; + + gchar *client_name; + + GdictStatusCode status_code; + + guint local_only : 1; + guint is_connecting : 1; +}; + +static void gdict_client_context_iface_init (GdictContextIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GdictClientContext, + gdict_client_context, + G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GDICT_TYPE_CONTEXT, + gdict_client_context_iface_init)); + +/* GObject methods */ +static void gdict_client_context_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gdict_client_context_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void gdict_client_context_finalize (GObject *object); + +/* GdictContext methods */ +static gboolean gdict_client_context_get_databases (GdictContext *context, + GError **error); +static gboolean gdict_client_context_get_strategies (GdictContext *context, + GError **error); +static gboolean gdict_client_context_define_word (GdictContext *context, + const gchar *database, + const gchar *word, + GError **error); +static gboolean gdict_client_context_match_word (GdictContext *context, + const gchar *database, + const gchar *strategy, + const gchar *word, + GError **error); + +static void gdict_client_context_clear_hostinfo (GdictClientContext *context); +static gboolean gdict_client_context_lookup_server (GdictClientContext *context, + GError **error); +static gboolean gdict_client_context_io_watch_cb (GIOChannel *source, + GIOCondition condition, + GdictClientContext *context); +static gboolean gdict_client_context_parse_line (GdictClientContext *context, + const gchar *buffer); +static void gdict_client_context_disconnect (GdictClientContext *context); +static void gdict_client_context_force_disconnect (GdictClientContext *context); +static void gdict_client_context_real_connected (GdictClientContext *context); +static void gdict_client_context_real_disconnected (GdictClientContext *context); + +static GdictCommand *gdict_command_new (GdictCommandType cmd_type); +static void gdict_command_free (GdictCommand *cmd); + + + +GQuark +gdict_client_context_error_quark (void) +{ + return g_quark_from_static_string ("gdict-client-context-error-quark"); +} + +static void +gdict_client_context_iface_init (GdictContextIface *iface) +{ + iface->get_databases = gdict_client_context_get_databases; + iface->get_strategies = gdict_client_context_get_strategies; + iface->match_word = gdict_client_context_match_word; + iface->define_word = gdict_client_context_define_word; +} + +static void +gdict_client_context_class_init (GdictClientContextClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = gdict_client_context_set_property; + gobject_class->get_property = gdict_client_context_get_property; + gobject_class->finalize = gdict_client_context_finalize; + + g_object_class_override_property (gobject_class, + GDICT_CONTEXT_PROP_LOCAL_ONLY, + "local-only"); + + /** + * GdictClientContext:client-name + * + * The name of the client using this context; it will be advertised when + * connecting to the dictionary server. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_CLIENT_NAME, + g_param_spec_string ("client-name", + _("Client Name"), + _("The name of the client of the context object"), + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictClientContext:hostname + * + * The hostname of the dictionary server to connect to. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_HOSTNAME, + g_param_spec_string ("hostname", + _("Hostname"), + _("The hostname of the dictionary server to connect to"), + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictClientContext:port + * + * The port of the dictionary server to connect to. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_PORT, + g_param_spec_uint ("port", + _("Port"), + _("The port of the dictionary server to connect to"), + 0, + 65535, + GDICT_DEFAULT_PORT, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictClientContext:status + * + * The status code as returned by the dictionary server. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_STATUS, + g_param_spec_enum ("status", + _("Status"), + _("The status code as returned by the dictionary server"), + GDICT_TYPE_STATUS_CODE, + GDICT_STATUS_INVALID, + G_PARAM_READABLE)); + + /** + * GdictClientContext::connected + * @client: the object which received the signal + * + * Emitted when a #GdictClientContext has successfully established a + * connection with a dictionary server. + * + * Since: 1.0 + */ + gdict_client_context_signals[CONNECTED] = + g_signal_new ("connected", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictClientContextClass, connected), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + /** + * GdictClientContext::disconnected + * @client: the object which received the signal + * + * Emitted when a #GdictClientContext has disconnected from a dictionary + * server. + * + * Since: 1.0 + */ + gdict_client_context_signals[DISCONNECTED] = + g_signal_new ("disconnected", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictClientContextClass, disconnected), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + klass->connected = gdict_client_context_real_connected; + klass->disconnected = gdict_client_context_real_disconnected; + + g_type_class_add_private (gobject_class, sizeof (GdictClientContextPrivate)); +} + +static void +gdict_client_context_init (GdictClientContext *context) +{ + GdictClientContextPrivate *priv; + + priv = GDICT_CLIENT_CONTEXT_GET_PRIVATE (context); + context->priv = priv; + + priv->hostname = NULL; + priv->port = 0; + + priv->hostinfo = NULL; +#ifdef ENABLE_IPV6 + priv->host6info = NULL; +#endif + + priv->last_lookup = (time_t) -1; + + priv->is_connecting = FALSE; + priv->local_only = FALSE; + + priv->status_code = GDICT_STATUS_INVALID; + + priv->client_name = NULL; + + priv->command = NULL; + priv->commands_queue = g_queue_new (); +} + +static void +gdict_client_context_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictClientContextPrivate *priv = GDICT_CLIENT_CONTEXT_GET_PRIVATE (object); + + switch (prop_id) + { + case PROP_HOSTNAME: + if (priv->hostname) + g_free (priv->hostname); + priv->hostname = g_strdup (g_value_get_string (value)); + gdict_client_context_clear_hostinfo (GDICT_CLIENT_CONTEXT (object)); + break; + case PROP_PORT: + priv->port = g_value_get_uint (value); + break; + case PROP_CLIENT_NAME: + if (priv->client_name) + g_free (priv->client_name); + priv->client_name = g_strdup (g_value_get_string (value)); + break; + case GDICT_CONTEXT_PROP_LOCAL_ONLY: + priv->local_only = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_client_context_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictClientContextPrivate *priv = GDICT_CLIENT_CONTEXT_GET_PRIVATE (object); + + switch (prop_id) + { + case PROP_STATUS: + g_value_set_enum (value, priv->status_code); + break; + case PROP_HOSTNAME: + g_value_set_string (value, priv->hostname); + break; + case PROP_PORT: + g_value_set_uint (value, priv->port); + break; + case PROP_CLIENT_NAME: + g_value_set_string (value, priv->client_name); + break; + case GDICT_CONTEXT_PROP_LOCAL_ONLY: + g_value_set_boolean (value, priv->local_only); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_client_context_finalize (GObject *object) +{ + GdictClientContext *context = GDICT_CLIENT_CONTEXT (object); + GdictClientContextPrivate *priv = context->priv; + + /* force disconnection */ + gdict_client_context_force_disconnect (context); + + if (priv->command) + gdict_command_free (priv->command); + + if (priv->commands_queue) + { + g_queue_foreach (priv->commands_queue, + (GFunc) gdict_command_free, + NULL); + g_queue_free (priv->commands_queue); + + priv->commands_queue = NULL; + } + + if (priv->client_name) + g_free (priv->client_name); + + if (priv->hostname) + g_free (priv->hostname); + +#ifdef ENABLE_IPV6 + if (priv->host6info) + freeaddrinfo (priv->host6info); +#endif + + /* chain up parent's finalize method */ + G_OBJECT_CLASS (gdict_client_context_parent_class)->finalize (object); +} + +/** + * gdict_client_context_new: + * @hostname: the hostname of a dictionary server, or %NULL for the + * default server + * @port: port to be used when connecting to the dictionary server, + * or -1 for the default port + * + * Creates a new #GdictClientContext object for @hostname. Use this + * object to connect and query the dictionary server using the Dictionary + * Protocol as defined by RFC 2229. + * + * Return value: the newly created #GdictClientContext object. You should + * free it using g_object_unref(). + */ +GdictContext * +gdict_client_context_new (const gchar *hostname, + gint port) +{ + return g_object_new (GDICT_TYPE_CLIENT_CONTEXT, + "hostname", (hostname != NULL ? hostname : GDICT_DEFAULT_HOSTNAME), + "port", (port != -1 ? port : GDICT_DEFAULT_PORT), + "client-name", GDICT_DEFAULT_CLIENT, + NULL); +} + +/** + * gdict_client_context_set_hostname: + * @context: a #GdictClientContext + * @hostname: the hostname of a Dictionary server, or %NULL + * + * Sets @hostname as the hostname of the dictionary server to be used. + * If @hostname is %NULL, the default dictionary server will be used. + */ +void +gdict_client_context_set_hostname (GdictClientContext *context, + const gchar *hostname) +{ + g_return_if_fail (GDICT_IS_CLIENT_CONTEXT (context)); + + g_object_set (G_OBJECT (context), + "hostname", (hostname != NULL ? hostname : GDICT_DEFAULT_HOSTNAME), + NULL); +} + +/** + * gdict_client_context_get_hostname: + * @context: a #GdictClientContext + * + * Gets the hostname of the dictionary server used by @context. + * + * Return value: the hostname of a dictionary server. The returned string is + * owned by the #GdictClientContext object and should never be modified or + * freed. + */ +const gchar * +gdict_client_context_get_hostname (GdictClientContext *context) +{ + gchar *hostname; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), NULL); + + g_object_get (G_OBJECT (context), "hostname", &hostname, NULL); + + return hostname; +} + +/** + * gdict_client_context_set_port: + * @context: a #GdictClientContext + * @port: port of the dictionary server to be used, or -1 + * + * Sets the port of the dictionary server to be used when connecting. + * + * If @port is -1, the default port will be used. + */ +void +gdict_client_context_set_port (GdictClientContext *context, + gint port) +{ + g_return_if_fail (GDICT_IS_CLIENT_CONTEXT (context)); + + g_object_set (G_OBJECT (context), + "port", (port != -1 ? port : GDICT_DEFAULT_PORT), + NULL); +} + +/** + * gdict_client_context_get_port: + * @context: a #GdictClientContext + * + * Gets the port of the dictionary server used by @context. + * + * Return value: the number of the port. + */ +guint +gdict_client_context_get_port (GdictClientContext *context) +{ + guint port; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), -1); + + g_object_get (G_OBJECT (context), "port", &port, NULL); + + return port; +} + +/** + * gdict_client_context_set_client: + * @context: a #GdictClientContext + * @client: the client name to use, or %NULL + * + * Sets @client as the client name to be used when advertising ourselves when + * a connection the the dictionary server has been established. + * If @client is %NULL, the default client name will be used. + */ +void +gdict_client_context_set_client (GdictClientContext *context, + const gchar *client) +{ + g_return_if_fail (GDICT_IS_CLIENT_CONTEXT (context)); + + g_object_set (G_OBJECT (context), + "client-name", (client != NULL ? client : GDICT_DEFAULT_CLIENT), + NULL); +} + +/** + * gdict_client_context_get_client: + * @context: a #GdictClientContext + * + * Gets the client name used by @context. See gdict_client_context_set_client(). + * + * Return value: the client name. The returned string is owned by the + * #GdictClientContext object and should never be modified or freed. + */ +const gchar * +gdict_client_context_get_client (GdictClientContext *context) +{ + gchar *client_name; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), NULL); + + g_object_get (G_OBJECT (context), "client-name", &client_name, NULL); + + return client_name; +} + +/* creates a new command to be sent to the dictionary server */ +static GdictCommand * +gdict_command_new (GdictCommandType cmd_type) +{ + GdictCommand *retval; + + g_assert (IS_VALID_CMD (cmd_type)); + + retval = g_slice_new0 (GdictCommand); + + retval->cmd_type = cmd_type; + retval->state = S_START; + + return retval; +} + +static void +gdict_command_free (GdictCommand *cmd) +{ + if (!cmd) + return; + + g_free (cmd->cmd_string); + + switch (cmd->cmd_type) + { + case CMD_CLIENT: + case CMD_QUIT: + break; + case CMD_SHOW_DB: + case CMD_SHOW_STRAT: + break; + case CMD_MATCH: + g_free (cmd->database); + g_free (cmd->strategy); + g_free (cmd->word); + break; + case CMD_DEFINE: + g_free (cmd->database); + g_free (cmd->word); + break; + default: + break; + } + + if (cmd->buffer) + g_string_free (cmd->buffer, TRUE); + + if (cmd->data_destroy) + cmd->data_destroy (cmd->data); + + g_slice_free (GdictCommand, cmd); +} + +/* push @command into the head of the commands queue; the command queue is + * a FIFO-like pipe: commands go into the head and are retrieved from the + * tail. + */ +static gboolean +gdict_client_context_push_command (GdictClientContext *context, + GdictCommand *command) +{ + GdictClientContextPrivate *priv; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + g_assert (command != NULL); + + priv = context->priv; + + /* avoid pushing a command twice */ + if (g_queue_find (priv->commands_queue, command)) + { + g_warning ("gdict_client_context_push_command() called on a command already in queue\n"); + return FALSE; + } + + GDICT_NOTE (DICT, "Pushing command ('%s') into the queue...", + dict_command_strings[command->cmd_type]); + + g_queue_push_head (priv->commands_queue, command); + + return TRUE; +} + +static GdictCommand * +gdict_client_context_pop_command (GdictClientContext *context) +{ + GdictClientContextPrivate *priv; + GdictCommand *retval; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + + priv = context->priv; + + retval = (GdictCommand *) g_queue_pop_tail (priv->commands_queue); + if (!retval) + return NULL; + + GDICT_NOTE (DICT, "Getting command ('%s') from the queue...", + dict_command_strings[retval->cmd_type]); + + return retval; +} + +/* send @command on the wire */ +static gboolean +gdict_client_context_send_command (GdictClientContext *context, + GdictCommand *command, + GError **error) +{ + GdictClientContextPrivate *priv; + GError *write_error; + gsize written_bytes; + GIOStatus res; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + g_assert (command != NULL && command->cmd_string != NULL); + + priv = context->priv; + + if (!priv->channel) + { + GDICT_NOTE (DICT, "No connection established"); + + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_NO_CONNECTION, + _("No connection to the dictionary server at '%s:%d'"), + priv->hostname, + priv->port); + + return FALSE; + } + + write_error = NULL; + res = g_io_channel_write_chars (priv->channel, + command->cmd_string, + -1, + &written_bytes, + &write_error); + if (res != G_IO_STATUS_NORMAL) + { + g_propagate_error (error, write_error); + + return FALSE; + } + + /* force flushing of the write buffer */ + g_io_channel_flush (priv->channel, NULL); + + GDICT_NOTE (DICT, "Wrote %"G_GSIZE_FORMAT" bytes to the channel", written_bytes); + + return TRUE; +} + +/* gdict_client_context_run_command: runs @command inside @context; this + * function builds the command string and then passes it to the dictionary + * server. + */ +static gboolean +gdict_client_context_run_command (GdictClientContext *context, + GdictCommand *command, + GError **error) +{ + GdictClientContextPrivate *priv; + gchar *payload; + GError *send_error; + gboolean res; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + g_assert (command != NULL); + g_assert (IS_VALID_CMD (command->cmd_type)); + + GDICT_NOTE (DICT, "GdictCommand command =\n" + "{\n" + " .cmd_type = '%02d' ('%s');\n" + " .database = '%s';\n" + " .strategy = '%s';\n" + " .word = '%s';\n" + "}\n", + command->cmd_type, dict_command_strings[command->cmd_type], + command->database ? command->database : "<none>", + command->strategy ? command->strategy : "<none>", + command->word ? command->word : "<none>"); + + priv = context->priv; + + g_assert (priv->command == NULL); + + priv->command = command; + + /* build the command string to be sent to the server */ + switch (command->cmd_type) + { + case CMD_CLIENT: + payload = g_shell_quote (priv->client_name); + command->cmd_string = g_strdup_printf ("%s %s\r\n", + dict_command_strings[CMD_CLIENT], + payload); + g_free (payload); + break; + case CMD_QUIT: + command->cmd_string = g_strdup_printf ("%s\r\n", + dict_command_strings[CMD_QUIT]); + break; + case CMD_SHOW_DB: + command->cmd_string = g_strdup_printf ("%s\r\n", + dict_command_strings[CMD_SHOW_DB]); + break; + case CMD_SHOW_STRAT: + command->cmd_string = g_strdup_printf ("%s\r\n", + dict_command_strings[CMD_SHOW_STRAT]); + break; + case CMD_MATCH: + g_assert (command->word); + payload = g_shell_quote (command->word); + command->cmd_string = g_strdup_printf ("%s %s %s %s\r\n", + dict_command_strings[CMD_MATCH], + (command->database != NULL ? command->database : "!"), + (command->strategy != NULL ? command->strategy : "*"), + payload); + g_free (payload); + break; + case CMD_DEFINE: + g_assert (command->word); + payload = g_shell_quote (command->word); + command->cmd_string = g_strdup_printf ("%s %s %s\r\n", + dict_command_strings[CMD_DEFINE], + (command->database != NULL ? command->database : "!"), + payload); + g_free (payload); + break; + default: + g_assert_not_reached (); + break; + } + + g_assert (command->cmd_string); + + GDICT_NOTE (DICT, "Sending command ('%s') to the server", + dict_command_strings[command->cmd_type]); + + send_error = NULL; + res = gdict_client_context_send_command (context, command, &send_error); + if (!res) + { + g_propagate_error (error, send_error); + + return FALSE; + } + + return TRUE; +} + +/* we use this signal to advertise ourselves to the dictionary server */ +static void +gdict_client_context_real_connected (GdictClientContext *context) +{ + GdictCommand *cmd; + + cmd = gdict_command_new (CMD_CLIENT); + cmd->state = S_FINISH; + + /* the CLIENT command should be the first one in our queue, so we place + * it above all other commands the user might have issued between the + * first and the emission of the "connected" signal, by calling it + * directely. + */ + gdict_client_context_run_command (context, cmd, NULL); +} + +static void +clear_command_queue (GdictClientContext *context) +{ + GdictClientContextPrivate *priv = context->priv; + + if (priv->commands_queue) + { + g_queue_foreach (priv->commands_queue, + (GFunc) gdict_command_free, + NULL); + + g_queue_free (priv->commands_queue); + } + + /* renew */ + priv->commands_queue = g_queue_new (); +} + +/* force a disconnection from the server */ +static void +gdict_client_context_force_disconnect (GdictClientContext *context) +{ + GdictClientContextPrivate *priv = context->priv; + + if (priv->timeout_id) + { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + + if (priv->source_id) + { + g_source_remove (priv->source_id); + priv->source_id = 0; + } + + if (priv->channel) + { + g_io_channel_shutdown (priv->channel, TRUE, NULL); + g_io_channel_unref (priv->channel); + + priv->channel = NULL; + } + + if (priv->command) + { + gdict_command_free (priv->command); + priv->command = NULL; + } + + clear_command_queue (context); +} + +static void +gdict_client_context_real_disconnected (GdictClientContext *context) +{ + gdict_client_context_force_disconnect (context); +} + +/* clear the lookup data */ +static void +gdict_client_context_clear_hostinfo (GdictClientContext *context) +{ + GdictClientContextPrivate *priv; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + + priv = context->priv; + +#ifdef ENABLE_IPV6 + if (!priv->host6info) + return; +#endif + + if (!priv->hostinfo) + return; + +#ifdef ENABLE_IPV6 + freeaddrinfo (priv->host6info); +#endif + priv->hostinfo = NULL; +} + +/* gdict_client_context_lookup_server: perform an hostname lookup in order to + * connect to the dictionary server + */ +static gboolean +gdict_client_context_lookup_server (GdictClientContext *context, + GError **error) +{ + GdictClientContextPrivate *priv; + gboolean is_expired = FALSE; + time_t now; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + + priv = context->priv; + + /* we need the hostname, at this point */ + g_assert (priv->hostname != NULL); + + time (&now); + if (now >= (priv->last_lookup + HOSTNAME_LOOKUP_EXPIRE)) + is_expired = TRUE; + + /* we already have resolved the hostname */ +#ifdef ENABLE_IPV6 + if (priv->host6info && !is_expired) + return TRUE; +#endif + + if (priv->hostinfo && !is_expired) + return TRUE; + + /* clear any previously acquired lookup data */ + gdict_client_context_clear_hostinfo (context); + + GDICT_NOTE (DICT, "Looking up hostname '%s'", priv->hostname); + +#ifdef ENABLE_IPV6 + if (_gdict_has_ipv6 ()) + { + struct addrinfo hints, *res; + + GDICT_NOTE (DICT, "Hostname '%s' look-up (using IPv6)", priv->hostname); + + memset (&hints, 0, sizeof (hints)); + hints.ai_socktype = SOCK_STREAM; + + if (getaddrinfo (priv->hostname, NULL, &hints, &(priv->host6info)) == 0) + { + for (res = priv->host6info; res; res = res->ai_next) + if (res->ai_family == AF_INET6 || res->ai_family == AF_INET) + break; + + if (!res) + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_LOOKUP, + _("Lookup failed for hostname '%s': no suitable resources found"), + priv->hostname); + + return FALSE; + } + else + { + if (res->ai_family == AF_INET6) + memcpy (&((struct sockaddr_in6 *) &priv->sockaddr)->sin6_addr, + &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr, + sizeof (struct in6_addr)); + + if (res->ai_family == AF_INET) + memcpy (&((struct sockaddr_in *) &priv->sockaddr)->sin_addr, + &((struct sockaddr_in *) res->ai_addr)->sin_addr, + sizeof (struct in_addr)); + + priv->sockaddr.ss_family = res->ai_family; + + GDICT_NOTE (DICT, "Hostname '%s' found (using IPv6)", + priv->hostname); + + priv->last_lookup = time (NULL); + + return TRUE; + } + } + else + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_LOOKUP, + _("Lookup failed for host '%s': %s"), + priv->hostname, + gai_strerror (errno)); + + return FALSE; + } + } + else + { +#endif /* ENABLE_IPV6 */ + /* if we don't support IPv6, fallback to usual IPv4 lookup */ + + GDICT_NOTE (DICT, "Hostname '%s' look-up (using IPv4)", priv->hostname); + + ((struct sockaddr_in *) &priv->sockaddr)->sin_family = AF_INET; + + priv->hostinfo = gethostbyname (priv->hostname); + if (priv->hostinfo) + { + memcpy (&((struct sockaddr_in *) &(priv->sockaddr))->sin_addr, + priv->hostinfo->h_addr, + priv->hostinfo->h_length); + + GDICT_NOTE (DICT, "Hostname '%s' found (using IPv4)", + priv->hostname); + + priv->last_lookup = time (NULL); + + return TRUE; + } + else + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_LOOKUP, + _("Lookup failed for host '%s': host not found"), + priv->hostname); + + return FALSE; + } +#ifdef ENABLE_IPV6 + } +#endif + + g_assert_not_reached (); + + return FALSE; +} + +/* gdict_client_context_parse_line: parses a line from the dictionary server + * this is the core of the RFC2229 protocol implementation, here's where + * the magic happens. + */ +static gboolean +gdict_client_context_parse_line (GdictClientContext *context, + const gchar *buffer) +{ + GdictClientContextPrivate *priv; + GError *server_error = NULL; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + g_assert (buffer != NULL); + + priv = context->priv; + + GDICT_NOTE (DICT, "parse buffer: '%s'", buffer); + + /* connection is a special case: we don't have a command, so we just + * make sure that the server replied with the correct code. WARNING: + * the server might be shutting down or not available, so we must + * take into account those responses too! + */ + if (!priv->command) + { + if (priv->status_code == GDICT_STATUS_CONNECT) + { + /* the server accepts our connection */ + g_signal_emit (context, gdict_client_context_signals[CONNECTED], 0); + + return TRUE; + } + else if ((priv->status_code == GDICT_STATUS_SERVER_DOWN) || + (priv->status_code == GDICT_STATUS_SHUTDOWN)) + { + /* the server is shutting down or is not available */ + g_set_error (&server_error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SERVER_DOWN, + _("Unable to connect to the dictionary server " + "at '%s:%d'. The server replied with " + "code %d (server down)"), + priv->hostname, + priv->port, + priv->status_code); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + + return TRUE; + } + else + { + GError *parse_error = NULL; + + g_set_error (&parse_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_PARSE, + _("Unable to parse the dictionary server reply\n: '%s'"), + buffer); + + g_signal_emit_by_name (context, "error", parse_error); + + g_error_free (parse_error); + + return FALSE; + } + } + + /* disconnection is another special case: the server replies with code + * 221, and closes the connection; we emit the "disconnected" signal + * and close the connection on our side. + */ + if (priv->status_code == GDICT_STATUS_QUIT) + { + g_signal_emit (context, gdict_client_context_signals[DISCONNECTED], 0); + + return TRUE; + } + + /* here we catch all the errors codes that the server might give us */ + server_error = NULL; + switch (priv->status_code) + { + case GDICT_STATUS_NO_MATCH: + g_set_error (&server_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_NO_MATCH, + _("No definitions found for '%s'"), + priv->command->word); + + GDICT_NOTE (DICT, "No match: %s", server_error->message); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + server_error = NULL; + + priv->command->state = S_FINISH; + break; + case GDICT_STATUS_BAD_DATABASE: + g_set_error (&server_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_INVALID_DATABASE, + _("Invalid database '%s'"), + priv->command->database); + + GDICT_NOTE (DICT, "Bad DB: %s", server_error->message); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + server_error = NULL; + + priv->command->state = S_FINISH; + break; + case GDICT_STATUS_BAD_STRATEGY: + g_set_error (&server_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_INVALID_STRATEGY, + _("Invalid strategy '%s'"), + priv->command->strategy); + + GDICT_NOTE (DICT, "Bad strategy: %s", server_error->message); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + server_error = NULL; + + priv->command->state = S_FINISH; + break; + case GDICT_STATUS_BAD_COMMAND: + g_set_error (&server_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_INVALID_COMMAND, + _("Bad command '%s'"), + dict_command_strings[priv->command->cmd_type]); + + GDICT_NOTE (DICT, "Bad command: %s", server_error->message); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + server_error = NULL; + + priv->command->state = S_FINISH; + break; + case GDICT_STATUS_BAD_PARAMETERS: + g_set_error (&server_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_INVALID_COMMAND, + _("Bad parameters for command '%s'"), + dict_command_strings[priv->command->cmd_type]); + + GDICT_NOTE (DICT, "Bad params: %s", server_error->message); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + server_error = NULL; + + priv->command->state = S_FINISH; + break; + case GDICT_STATUS_NO_DATABASES_PRESENT: + g_set_error (&server_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_NO_DATABASES, + _("No databases found on dictionary server at '%s'"), + priv->hostname); + + GDICT_NOTE (DICT, "No DB: %s", server_error->message); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + server_error = NULL; + + priv->command->state = S_FINISH; + break; + case GDICT_STATUS_NO_STRATEGIES_PRESENT: + g_set_error (&server_error, GDICT_CONTEXT_ERROR, + GDICT_CONTEXT_ERROR_NO_STRATEGIES, + _("No strategies found on dictionary server at '%s'"), + priv->hostname); + + GDICT_NOTE (DICT, "No strategies: %s", server_error->message); + + g_signal_emit_by_name (context, "error", server_error); + + g_error_free (server_error); + server_error = NULL; + + priv->command->state = S_FINISH; + break; + default: + GDICT_NOTE (DICT, "non-error code: %d", priv->status_code); + break; + } + + /* server replied with 'ok' or the command has reached its FINISH state, + * so now we are clear for destroying the current command and check if + * there are other commands on the queue, and run them. + */ + if ((priv->status_code == GDICT_STATUS_OK) || + (priv->command->state == S_FINISH)) + { + GdictCommand *new_command; + GError *run_error; + GdictCommandType last_cmd; + + last_cmd = priv->command->cmd_type; + + gdict_command_free (priv->command); + priv->command = NULL; + + /* notify the end of a command - ignore CLIENT and QUIT commands, as + * we issue them ourselves + */ + if ((last_cmd != CMD_CLIENT) && (last_cmd != CMD_QUIT)) + g_signal_emit_by_name (context, "lookup-end"); + + /* pop the next command from the queue */ + new_command = gdict_client_context_pop_command (context); + if (!new_command) + { + /* if the queue is empty, quit */ + gdict_client_context_disconnect (context); + new_command = gdict_client_context_pop_command (context); + } + + run_error = NULL; + gdict_client_context_run_command (context, new_command, &run_error); + if (run_error) + { + g_signal_emit_by_name (context, "error", run_error); + + g_error_free (run_error); + } + + return TRUE; + } + + GDICT_NOTE (DICT, "check command %d ('%s')[state:%d]", + priv->command->cmd_type, + dict_command_strings[priv->command->cmd_type], + priv->command->state); + + /* check command type */ + switch (priv->command->cmd_type) + { + case CMD_CLIENT: + case CMD_QUIT: + break; + case CMD_SHOW_DB: + if (priv->status_code == GDICT_STATUS_N_DATABASES_PRESENT) + { + gchar *p; + + priv->command->state = S_DATA; + + p = g_utf8_strchr (buffer, -1, ' '); + if (p) + p = g_utf8_next_char (p); + + GDICT_NOTE (DICT, "server replied: %d databases found", atoi (p)); + + g_signal_emit_by_name (context, "lookup-start"); + } + else if (0 == strcmp (buffer, ".")) + priv->command->state = S_FINISH; + else + { + GdictDatabase *db; + gchar *name, *full, *p; + + g_assert (priv->command->state == S_DATA); + + /* first token: database name; + * second token: database description; + */ + name = (gchar *) buffer; + if (!name) + break; + + p = g_utf8_strchr (name, -1, ' '); + if (p) + *p = '\0'; + + full = g_utf8_next_char (p); + + if (full[0] == '\"') + full = g_utf8_next_char (full); + + p = g_utf8_strchr (full, -1, '\"'); + if (p) + *p = '\0'; + + db = _gdict_database_new (name); + db->full_name = g_strdup (full); + + g_signal_emit_by_name (context, "database-found", db); + + gdict_database_unref (db); + } + break; + case CMD_SHOW_STRAT: + if (priv->status_code == GDICT_STATUS_N_STRATEGIES_PRESENT) + { + gchar *p; + + priv->command->state = S_DATA; + + p = g_utf8_strchr (buffer, -1, ' '); + if (p) + p = g_utf8_next_char (p); + + GDICT_NOTE (DICT, "server replied: %d strategies found", atoi (p)); + + g_signal_emit_by_name (context, "lookup-start"); + } + else if (0 == strcmp (buffer, ".")) + priv->command->state = S_FINISH; + else + { + GdictStrategy *strat; + gchar *name, *desc, *p; + + g_assert (priv->command->state == S_DATA); + + name = (gchar *) buffer; + if (!name) + break; + + p = g_utf8_strchr (name, -1, ' '); + if (p) + *p = '\0'; + + desc = g_utf8_next_char (p); + + if (desc[0] == '\"') + desc = g_utf8_next_char (desc); + + p = g_utf8_strchr (desc, -1, '\"'); + if (p) + *p = '\0'; + + strat = _gdict_strategy_new (name); + strat->description = g_strdup (desc); + + g_signal_emit_by_name (context, "strategy-found", strat); + + gdict_strategy_unref (strat); + } + break; + case CMD_DEFINE: + if (priv->status_code == GDICT_STATUS_N_DEFINITIONS_RETRIEVED) + { + GdictDefinition *def; + gchar *p; + + priv->command->state = S_STATUS; + + p = g_utf8_strchr (buffer, -1, ' '); + if (p) + p = g_utf8_next_char (p); + + GDICT_NOTE (DICT, "server replied: %d definitions found", atoi (p)); + + def = _gdict_definition_new (atoi (p)); + + priv->command->data = def; + priv->command->data_destroy = (GDestroyNotify) gdict_definition_unref; + + g_signal_emit_by_name (context, "lookup-start"); + } + else if (priv->status_code == GDICT_STATUS_WORD_DB_NAME) + { + GdictDefinition *def; + gchar *word, *db_name, *db_full, *p; + + word = (gchar *) buffer; + + /* skip the status code */ + word = g_utf8_strchr (word, -1, ' '); + word = g_utf8_next_char (word); + + if (word[0] == '\"') + word = g_utf8_next_char (word); + + p = g_utf8_strchr (word, -1, '\"'); + if (p) + *p = '\0'; + + p = g_utf8_next_char (p); + + /* the database name is not protected by "" */ + db_name = g_utf8_next_char (p); + if (!db_name) + break; + + p = g_utf8_strchr (db_name, -1, ' '); + if (p) + *p = '\0'; + + p = g_utf8_next_char (p); + + db_full = g_utf8_next_char (p); + if (!db_full) + break; + + if (db_full[0] == '\"') + db_full = g_utf8_next_char (db_full); + + p = g_utf8_strchr (db_full, -1, '\"'); + if (p) + *p = '\0'; + + def = (GdictDefinition *) priv->command->data; + + GDICT_NOTE (DICT, "{ word = '%s', db_name = '%s', db_full = '%s' }", + word, + db_name, + db_full); + + def->word = g_strdup (word); + def->database_name = g_strdup (db_name); + def->database_full = g_strdup (db_full); + def->definition = NULL; + + priv->command->state = S_DATA; + } + else if (strcmp (buffer, ".") == 0) + { + GdictDefinition *def; + gint num; + + g_assert (priv->command->state == S_DATA); + + def = (GdictDefinition *) priv->command->data; + if (!def) + break; + + def->definition = g_string_free (priv->command->buffer, FALSE); + + /* store the numer of definitions */ + num = def->total; + + g_signal_emit_by_name (context, "definition-found", def); + + gdict_definition_unref (def); + + priv->command->buffer = NULL; + priv->command->data = _gdict_definition_new (num); + + priv->command->state = S_STATUS; + } + else + { + g_assert (priv->command->state == S_DATA); + + if (!priv->command->buffer) + priv->command->buffer = g_string_new (NULL); + + GDICT_NOTE (DICT, "appending to buffer:\n %s", buffer); + + /* TODO - collapse '..' to '.' */ + g_string_append_printf (priv->command->buffer, "%s\n", buffer); + } + break; + case CMD_MATCH: + if (priv->status_code == GDICT_STATUS_N_MATCHES_FOUND) + { + gchar *p; + + priv->command->state = S_DATA; + + p = g_utf8_strchr (buffer, -1, ' '); + if (p) + p = g_utf8_next_char (p); + + GDICT_NOTE (DICT, "server replied: %d matches found", atoi (p)); + + g_signal_emit_by_name (context, "lookup-start"); + } + else if (0 == strcmp (buffer, ".")) + priv->command->state = S_FINISH; + else + { + GdictMatch *match; + gchar *word, *db_name, *p; + + g_assert (priv->command->state == S_DATA); + + db_name = (gchar *) buffer; + if (!db_name) + break; + + p = g_utf8_strchr (db_name, -1, ' '); + if (p) + *p = '\0'; + + word = g_utf8_next_char (p); + + if (word[0] == '\"') + word = g_utf8_next_char (word); + + p = g_utf8_strchr (word, -1, '\"'); + if (p) + *p = '\0'; + + match = _gdict_match_new (word); + match->database = g_strdup (db_name); + + g_signal_emit_by_name (context, "match-found", match); + + gdict_match_unref (match); + } + break; + default: + g_assert_not_reached (); + break; + } + + return TRUE; +} + +/* retrieve the status code from the server response line */ +static gint +get_status_code (const gchar *line, + gint old_status) +{ + gchar *status; + gint possible_status, retval; + + if (strlen (line) < 3) + return 0; + + if (!g_unichar_isdigit (line[0]) || + !g_unichar_isdigit (line[1]) || + !g_unichar_isdigit (line[2])) + return 0; + + if (!g_unichar_isspace (line[3])) + return 0; + + status = g_strndup (line, 3); + possible_status = atoi (status); + g_free (status); + + /* status whitelisting: sometimes, a database *cough* moby-thes *cough* + * might return a number as first word; we do a small check here for + * invalid status codes based on the previously set status; we don't check + * the whole line, as we need only to be sure that the status code is + * consistent with what we expect. + */ + switch (old_status) + { + case GDICT_STATUS_WORD_DB_NAME: + case GDICT_STATUS_N_MATCHES_FOUND: + if (possible_status == GDICT_STATUS_OK) + retval = possible_status; + else + retval = 0; + break; + case GDICT_STATUS_N_DEFINITIONS_RETRIEVED: + if (possible_status == GDICT_STATUS_WORD_DB_NAME) + retval = possible_status; + else + retval = 0; + break; + default: + retval = possible_status; + break; + } + + return retval; +} + +static gboolean +gdict_client_context_io_watch_cb (GIOChannel *channel, + GIOCondition condition, + GdictClientContext *context) +{ + GdictClientContextPrivate *priv; + + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + priv = context->priv; + + /* since this is an asynchronous channel, we might end up here + * even though the channel has been shut down. + */ + if (!priv->channel) + { + g_warning ("No channel available\n"); + + return FALSE; + } + + if (priv->is_connecting) + { + priv->is_connecting = FALSE; + + if (priv->timeout_id) + { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + } + + if (condition & G_IO_ERR) + { + GError *err = NULL; + + g_set_error (&err, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + _("Connection failed to the dictionary server at %s:%d"), + priv->hostname, + priv->port); + + g_signal_emit_by_name (context, "error", err); + + g_error_free (err); + + return FALSE; + } + + while (1) + { + GIOStatus res; + guint status_code; + GError *read_err; + gsize len, term; + gchar *line; + gboolean parse_res; + + /* we might sever the connection while still inside the read loop, + * so we must check the state of the channel before actually doing + * the line reading, otherwise we'll end up with death, destruction + * and chaos on all earth. oh, and an assertion failed inside + * g_io_channel_read_line(). + */ + if (!priv->channel) + break; + + read_err = NULL; + res = g_io_channel_read_line (priv->channel, &line, &len, &term, &read_err); + if (res == G_IO_STATUS_ERROR) + { + if (read_err) + { + GError *err = NULL; + + g_set_error (&err, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + _("Error while reading reply from server:\n%s"), + read_err->message); + + g_signal_emit_by_name (context, "error", err); + + g_error_free (err); + g_error_free (read_err); + } + + gdict_client_context_force_disconnect (context); + + return FALSE; + } + + if (len == 0) + break; + + /* truncate the line terminator before parsing */ + line[term] = '\0'; + + status_code = get_status_code (line, priv->status_code); + if ((status_code == 0) || (GDICT_IS_VALID_STATUS_CODE (status_code))) + { + priv->status_code = status_code; + + GDICT_NOTE (DICT, "new status = '%d'", priv->status_code); + } + else + priv->status_code = GDICT_STATUS_INVALID; + + /* notify changes only for valid status codes */ + if (priv->status_code != GDICT_STATUS_INVALID) + g_object_notify (G_OBJECT (context), "status"); + + parse_res = gdict_client_context_parse_line (context, line); + if (!parse_res) + { + g_free (line); + + g_warning ("Parsing failed"); + + gdict_client_context_force_disconnect (context); + + return FALSE; + } + + g_free (line); + } + + return TRUE; +} + +static gboolean +check_for_connection (gpointer data) +{ + GdictClientContext *context = data; + +#if 0 + g_debug (G_STRLOC ": checking for connection (is connecting:%s)", + context->priv->is_connecting ? "true" : "false"); +#endif + + if (context == NULL) + return FALSE; + + if (context->priv->is_connecting) + { + GError *err = NULL; + + GDICT_NOTE (DICT, "Forcing a disconnection due to timeout"); + + g_set_error (&err, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + _("Connection timeout for the dictionary server at '%s:%d'"), + context->priv->hostname, + context->priv->port); + + g_signal_emit_by_name (context, "error", err); + + g_error_free (err); + + gdict_client_context_force_disconnect (context); + } + + /* this is a one-off operation */ + return FALSE; +} + +static gboolean +gdict_client_context_connect (GdictClientContext *context, + GError **error) +{ + GdictClientContextPrivate *priv; + GError *lookup_error, *flags_error; + gboolean res; + gint sock_fd, sock_res; + gsize addrlen; + GIOFlags flags; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), FALSE); + + priv = context->priv; + + if (!priv->hostname) + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_LOOKUP, + _("No hostname defined for the dictionary server")); + + return FALSE; + } + + /* forgive the absence of a port */ + if (!priv->port) + priv->port = GDICT_DEFAULT_PORT; + + priv->is_connecting = TRUE; + + lookup_error = NULL; + res = gdict_client_context_lookup_server (context, &lookup_error); + if (!res) + { + g_propagate_error (error, lookup_error); + + return FALSE; + } + +#ifdef ENABLE_IPV6 + if (priv->sockaddr.ss_family == AF_INET6) + ((struct sockaddr_in6 *) &priv->sockaddr)->sin6_port = g_htons (priv->port); + else +#endif + ((struct sockaddr_in *) &priv->sockaddr)->sin_port = g_htons (priv->port); + + +#ifdef ENABLE_IPV6 + if (priv->sockaddr.ss_family == AF_INET6) + { + sock_fd = socket (AF_INET6, SOCK_STREAM, 0); + if (sock_fd < 0) + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + _("Unable to create socket")); + + return FALSE; + } + + addrlen = sizeof (struct sockaddr_in6); + } + else + { +#endif /* ENABLE_IPV6 */ + sock_fd = socket (AF_INET, SOCK_STREAM, 0); + if (sock_fd < 0) + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + _("Unable to create socket")); + + return FALSE; + } + + addrlen = sizeof (struct sockaddr_in); +#ifdef ENABLE_IPV6 + } +#endif + + priv->channel = g_io_channel_unix_new (sock_fd); + + /* RFC2229 mandates the usage of UTF-8, so we force this encoding */ + g_io_channel_set_encoding (priv->channel, "UTF-8", NULL); + + g_io_channel_set_line_term (priv->channel, "\r\n", 2); + + /* make sure that the channel is non-blocking */ + flags = g_io_channel_get_flags (priv->channel); + flags |= G_IO_FLAG_NONBLOCK; + flags_error = NULL; + g_io_channel_set_flags (priv->channel, flags, &flags_error); + if (flags_error) + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + _("Unable to set the channel as non-blocking: %s"), + flags_error->message); + + g_error_free (flags_error); + g_io_channel_unref (priv->channel); + + return FALSE; + } + + /* let the magic begin */ + sock_res = connect (sock_fd, (struct sockaddr *) &priv->sockaddr, addrlen); + if ((sock_res != 0) && (errno != EINPROGRESS)) + { + g_set_error (error, GDICT_CLIENT_CONTEXT_ERROR, + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + _("Unable to connect to the dictionary server at '%s:%d'"), + priv->hostname, + priv->port); + + return FALSE; + } + + priv->timeout_id = g_timeout_add (CONNECTION_TIMEOUT * 1000, + check_for_connection, + context); + + /* XXX - remember that g_io_add_watch() increases the reference count + * of the GIOChannel we are using. + */ + priv->source_id = g_io_add_watch (priv->channel, + (G_IO_IN | G_IO_ERR), + (GIOFunc) gdict_client_context_io_watch_cb, + context); + + return TRUE; +} + +static void +gdict_client_context_disconnect (GdictClientContext *context) +{ + GdictCommand *cmd; + + g_return_if_fail (GDICT_IS_CLIENT_CONTEXT (context)); + + /* instead of just breaking the connection to the server, we push + * a QUIT command on the queue, and wait for every other scheduled + * command to perform; this allows the creation of a batch of + * commands. + */ + cmd = gdict_command_new (CMD_QUIT); + cmd->state = S_FINISH; + + gdict_client_context_push_command (context, cmd); +} + +static gboolean +gdict_client_context_is_connected (GdictClientContext *context) +{ + g_assert (GDICT_IS_CLIENT_CONTEXT (context)); + + /* we are in the middle of a connection attempt */ + if (context->priv->is_connecting) + return TRUE; + + return (context->priv->channel != NULL && context->priv->source_id != 0); +} + +static gboolean +gdict_client_context_get_databases (GdictContext *context, + GError **error) +{ + GdictClientContext *client_ctx; + GdictCommand *cmd; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), FALSE); + + client_ctx = GDICT_CLIENT_CONTEXT (context); + + if (!gdict_client_context_is_connected (client_ctx)) + { + GError *connect_error = NULL; + + gdict_client_context_connect (client_ctx, &connect_error); + if (connect_error) + { + g_propagate_error (error, connect_error); + + return FALSE; + } + } + + cmd = gdict_command_new (CMD_SHOW_DB); + + return gdict_client_context_push_command (client_ctx, cmd); +} + +static gboolean +gdict_client_context_get_strategies (GdictContext *context, + GError **error) +{ + GdictClientContext *client_ctx; + GdictCommand *cmd; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), FALSE); + + client_ctx = GDICT_CLIENT_CONTEXT (context); + + if (!gdict_client_context_is_connected (client_ctx)) + { + GError *connect_error = NULL; + + gdict_client_context_connect (client_ctx, &connect_error); + if (connect_error) + { + g_propagate_error (error, connect_error); + + return FALSE; + } + } + + cmd = gdict_command_new (CMD_SHOW_STRAT); + + return gdict_client_context_push_command (client_ctx, cmd); +} + +static gboolean +gdict_client_context_define_word (GdictContext *context, + const gchar *database, + const gchar *word, + GError **error) +{ + GdictClientContext *client_ctx; + GdictCommand *cmd; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), FALSE); + + client_ctx = GDICT_CLIENT_CONTEXT (context); + + if (!gdict_client_context_is_connected (client_ctx)) + { + GError *connect_error = NULL; + + gdict_client_context_connect (client_ctx, &connect_error); + if (connect_error) + { + g_propagate_error (error, connect_error); + + return FALSE; + } + } + + cmd = gdict_command_new (CMD_DEFINE); + cmd->database = g_strdup ((database != NULL ? database : GDICT_DEFAULT_DATABASE)); + cmd->word = g_utf8_normalize (word, -1, G_NORMALIZE_NFC); + + return gdict_client_context_push_command (client_ctx, cmd); +} + +static gboolean +gdict_client_context_match_word (GdictContext *context, + const gchar *database, + const gchar *strategy, + const gchar *word, + GError **error) +{ + GdictClientContext *client_ctx; + GdictCommand *cmd; + + g_return_val_if_fail (GDICT_IS_CLIENT_CONTEXT (context), FALSE); + + client_ctx = GDICT_CLIENT_CONTEXT (context); + + if (!gdict_client_context_is_connected (client_ctx)) + { + GError *connect_error = NULL; + + gdict_client_context_connect (client_ctx, &connect_error); + if (connect_error) + { + g_propagate_error (error, connect_error); + + return FALSE; + } + } + + cmd = gdict_command_new (CMD_MATCH); + cmd->database = g_strdup ((database != NULL ? database : GDICT_DEFAULT_DATABASE)); + cmd->strategy = g_strdup ((strategy != NULL ? strategy : GDICT_DEFAULT_STRATEGY)); + cmd->word = g_utf8_normalize (word, -1, G_NORMALIZE_NFC); + + return gdict_client_context_push_command (client_ctx, cmd); +} diff --git a/mate-dictionary/libgdict/gdict-client-context.h b/mate-dictionary/libgdict/gdict-client-context.h new file mode 100644 index 00000000..5dbe6ed2 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-client-context.h @@ -0,0 +1,98 @@ +/* gdict-server-context.h - Implementation of a dictionary protocol client context + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_CLIENT_CONTEXT_H__ +#define __GDICT_CLIENT_CONTEXT_H__ + +#include <glib-object.h> + +#define GDICT_TYPE_CLIENT_CONTEXT (gdict_client_context_get_type ()) +#define GDICT_CLIENT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_CLIENT_CONTEXT, GdictClientContext)) +#define GDICT_IS_CLIENT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_CLIENT_CONTEXT)) +#define GDICT_CLIENT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_CLIENT_CONTEXT, GdictClientContextClass)) +#define GDICT_CLIENT_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_CLIENT_CONTEXT, GdictClientContextClass)) + +typedef struct _GdictClientContext GdictClientContext; +typedef struct _GdictClientContextClass GdictClientContextClass; +typedef struct _GdictClientContextPrivate GdictClientContextPrivate; + +#define GDICT_CLIENT_CONTEXT_ERROR (gdict_client_context_error_quark ()) + +/** + * GdictClientContextError: + * @GDICT_CLIENT_CONTEXT_ERROR_SOCKET: + * @GDICT_CLIENT_CONTEXT_ERROR_LOOKUP: + * @GDICT_CLIENT_CONTEXT_ERROR_NO_CONNECTION: + * @GDICT_CLIENT_CONTEXT_ERROR_SERVER_DOWN: + * + * #GdictClientContext error enumeration + */ +typedef enum { + GDICT_CLIENT_CONTEXT_ERROR_SOCKET, + GDICT_CLIENT_CONTEXT_ERROR_LOOKUP, + GDICT_CLIENT_CONTEXT_ERROR_NO_CONNECTION, + GDICT_CLIENT_CONTEXT_ERROR_SERVER_DOWN +} GdictClientContextError; + +GQuark gdict_client_context_error_quark (void); + +struct _GdictClientContext +{ + /*< private >*/ + GObject parent_instance; + + GdictClientContextPrivate *priv; +}; + +struct _GdictClientContextClass +{ + /*< private >*/ + GObjectClass parent_class; + + /*< public >*/ + /* signals monitoring the lifetime of the connection with + * the dictionary server + */ + void (*connected) (GdictClientContext *context); + void (*disconnected) (GdictClientContext *context); + + /*< private >*/ + /* padding for future expansion */ + void (*_gdict_client_1) (void); + void (*_gdict_client_2) (void); + void (*_gdict_client_3) (void); + void (*_gdict_client_4) (void); +}; + +GType gdict_client_context_get_type (void) G_GNUC_CONST; + +GdictContext * gdict_client_context_new (const gchar *hostname, + gint port); + +void gdict_client_context_set_hostname (GdictClientContext *context, + const gchar *hostname); +const gchar *gdict_client_context_get_hostname (GdictClientContext *context); +void gdict_client_context_set_port (GdictClientContext *context, + gint port); +guint gdict_client_context_get_port (GdictClientContext *context); +void gdict_client_context_set_client (GdictClientContext *context, + const gchar *client); +const gchar *gdict_client_context_get_client (GdictClientContext *context); + +#endif /* __GDICT_CLIENT_CONTEXT_H__ */ diff --git a/mate-dictionary/libgdict/gdict-context-private.h b/mate-dictionary/libgdict/gdict-context-private.h new file mode 100644 index 00000000..24ea463a --- /dev/null +++ b/mate-dictionary/libgdict/gdict-context-private.h @@ -0,0 +1,107 @@ +/* gdict-private.h - Private definitions for Gdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_PRIVATE_H__ +#define __GDICT_PRIVATE_H__ + +#ifndef GDICT_ENABLE_INTERNALS +#error "You are trying to access Gdict's internals outside Gdict. The API of these internal functions is not fixed." +#endif + +#include <glib-object.h> + +#include "gdict-context.h" + +G_BEGIN_DECLS + +/* boilerplate code, similar to G_DEFINE_TYPE in spirit, used to define + * our boxed types and their ref/unref functions; you still have to + * implement your own ref/unref functions! + */ +#define GDICT_DEFINE_BOXED_TYPE(TypeName,type_name) \ +\ +static gpointer type_name##_intern_ref (gpointer self) \ +{ \ + return type_name##_ref ((TypeName *) self); \ +} \ +static void type_name##_intern_unref (gpointer self) \ +{ \ + type_name##_unref ((TypeName *) self); \ +} \ +\ +GType \ +type_name##_get_type (void) \ +{ \ + static GType gdict_define_boxed_type = 0; \ + if (G_UNLIKELY (gdict_define_boxed_type == 0)) \ + gdict_define_boxed_type = g_boxed_type_register_static (#TypeName, (GBoxedCopyFunc) type_name##_intern_ref, (GBoxedFreeFunc) type_name##_intern_unref); \ + return gdict_define_boxed_type; \ +} + +/* Never, _ever_ access the members of these structures, unless you + * know what you are doing. + */ + +struct _GdictDatabase +{ + gchar *name; + gchar *full_name; + + guint ref_count; +}; + +struct _GdictStrategy +{ + gchar *name; + gchar *description; + + guint ref_count; +}; + +struct _GdictMatch +{ + gchar *database; + gchar *word; + + guint ref_count; +}; + +struct _GdictDefinition +{ + gint total; + + gchar *word; + gchar *database_name; + gchar *database_full; + gchar *definition; + + guint ref_count; +}; + +/* constructors for these objects are private, as the world outside do + * not know what they hold, and accessor functions are getters only + */ +GdictDatabase * _gdict_database_new (const gchar *name); +GdictStrategy * _gdict_strategy_new (const gchar *name); +GdictMatch * _gdict_match_new (const gchar *word); +GdictDefinition * _gdict_definition_new (gint total); + +G_END_DECLS + +#endif /* __GDICT_PRIVATE_H__ */ diff --git a/mate-dictionary/libgdict/gdict-context.c b/mate-dictionary/libgdict/gdict-context.c new file mode 100644 index 00000000..4566bc1a --- /dev/null +++ b/mate-dictionary/libgdict/gdict-context.c @@ -0,0 +1,892 @@ +/* gdict-context.c - Abstract class for dictionary contexts + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-context + * @short_description: Interface for dictionary transports + * + * #GdictContext is an interface used to uniformly access dictionary + * transport objects. Each implementation of #GdictContext must provide + * functions for accessing the list of databases available on a dictionary + * source and the available matching strategies; a function for retrieving + * all words matching a given string, inside one (or more) of those databases + * and using one of those strategies; a function for querying one (or more) + * of those databases for a definition of a word. + * + * Implementations of the #GdictContext interface should query their + * dictionary sources asynchronously; methods of the #GdictContext interface + * should return immediately, and each time a new database, strategy, match + * or definition has been found, a signal should be fired by those + * implementations. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <glib/gi18n-lib.h> + +#include "gdict-context.h" +#include "gdict-enum-types.h" +#include "gdict-utils.h" +#include "gdict-marshal.h" +#include "gdict-context-private.h" +#include "gdict-private.h" + + +static void gdict_context_class_init (gpointer g_iface); + + +GType +gdict_context_get_type (void) +{ + static GType context_type = 0; + + if (G_UNLIKELY (context_type == 0)) + { + static GTypeInfo context_info = + { + sizeof (GdictContextIface), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gdict_context_class_init, + }; + + context_type = g_type_register_static (G_TYPE_INTERFACE, + "GdictContext", + &context_info, 0); + g_type_interface_add_prerequisite (context_type, G_TYPE_OBJECT); + } + + return context_type; +} + + +static void +gdict_context_class_init (gpointer g_iface) +{ + GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); + + /** + * GdictContext::lookup-start + * @context: the object which received the signal + * + * This signal is emitted when a look up operation has been issued using + * a #GdictContext. Since every operation using a context is + * asynchronous, you can use this signal to know if the request has been + * issued or not. + * + * Since: 1.0 + */ + g_signal_new ("lookup-start", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictContextIface, lookup_start), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + /** + * GdictContext::lookup-end + * @context: the object which received the signal + * + * This signal is emitted when a look up operation that has been issued + * using a #GdictContext has been completed. Since every operation using a + * context is asynchronous, you can use this signal to know if the request + * has been completed or not. + * + * Since: 1.0 + */ + g_signal_new ("lookup-end", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictContextIface, lookup_end), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + /** + * GdictContext::error + * @context: the object which received the signal + * @error: a #GError + * + * This signal is emitted when an error happened during an asynchronous + * request. + * + * Since: 1.0 + */ + g_signal_new ("error", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictContextIface, error), + NULL, NULL, + gdict_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + /** + * GdictContext::database-found + * @context: the object which received the signal + * @database: a #GdictDatabase + * + * This signal is emitted when a database request has found a database. + * + * Since: 1.0 + */ + g_signal_new ("database-found", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictContextIface, database_found), + NULL, NULL, + gdict_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GDICT_TYPE_DATABASE); + /** + * GdictContext::strategy-found + * @context: the object which received the signal + * @strategy: a #GdictStrategy + * + * This signal is emitted when a strategy request has found a strategy. + * + * Since: 1.0 + */ + g_signal_new ("strategy-found", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictContextIface, strategy_found), + NULL, NULL, + gdict_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GDICT_TYPE_STRATEGY); + /** + * GdictContext::match-found + * @context: the object which received the signal + * @match: a #GdictMatch + * + * This signal is emitted when a match request has found a match. + * + * Since: 1.0 + */ + g_signal_new ("match-found", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictContextIface, match_found), + NULL, NULL, + gdict_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GDICT_TYPE_MATCH); + /** + * GdictContext::definition-found + * @context: the object which received the signal + * @definition: a #GdictDefinition + * + * This signal is emitted when a definition request has found a definition. + * + * Since: 1.0 + */ + g_signal_new ("definition-found", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictContextIface, definition_found), + NULL, NULL, + gdict_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + GDICT_TYPE_DEFINITION); + + /** + * GdictContext:local-only + * + * Whether the context uses only local dictionaries or not. + * + * Since: 1.0 + */ + g_object_interface_install_property (g_iface, + g_param_spec_boolean ("local-only", + _("Local Only"), + _("Whether the context uses only local dictionaries or not"), + FALSE, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); +} + +GQuark +gdict_context_error_quark (void) +{ + return g_quark_from_static_string ("gdict-context-error-quark"); +} + +/** + * gdict_context_set_local_only: + * @context: a #GdictContext + * @local_only: %TRUE if only local resources will be used + * + * Sets whether only local resources will be used when querying for databases, + * strategies, matches or definitions. + * + * Since: 1.0 + */ +void +gdict_context_set_local_only (GdictContext *context, + gboolean local_only) +{ + g_return_if_fail (GDICT_IS_CONTEXT (context)); + + g_object_set (context, "local-only", &local_only, NULL); +} + +/** + * gdict_context_get_local_only: + * @context: a #GdictContext + * + * Gets whether only local resources will be used when querying. + * + * Return value: %TRUE if only local resources will be used. + * + * Since: 1.0 + */ +gboolean +gdict_context_get_local_only (GdictContext *context) +{ + gboolean local_only; + + g_return_val_if_fail (GDICT_IS_CONTEXT (context), FALSE); + + g_object_get (context, "local-only", &local_only, NULL); + + return local_only; +} + +/** + * gdict_context_lookup_databases: + * @context: a #GdictContext + * @error: return location for a #GError, or %NULL + * + * Query @context for the list of databases available. Each time a + * database is found, the "database-found" signal is fired. + * + * Return value: %TRUE if the query was successfully started. + * + * Since: 1.0 + */ +gboolean +gdict_context_lookup_databases (GdictContext *context, + GError **error) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), FALSE); + + if (!GDICT_CONTEXT_GET_IFACE (context)->get_databases) + { + g_warning ("Object `%s' does not implement the get_databases " + "virtual function.", + g_type_name (G_OBJECT_TYPE (context))); + + return FALSE; + } + + return GDICT_CONTEXT_GET_IFACE (context)->get_databases (context, error); +} + +/** + * gdict_context_lookup_strategies: + * @context: a #GdictContext + * @error: return location for a #GError, or %NULL + * + * Query @context for the list of matching strategies available. Each + * time a new strategy is found, the "strategy-found" signal is fired. + * + * Return value: %TRUE if the query was successfully started. + * + * Since: 1.0 + */ +gboolean +gdict_context_lookup_strategies (GdictContext *context, + GError **error) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), FALSE); + + if (!GDICT_CONTEXT_GET_IFACE (context)->get_strategies) + { + g_warning ("Object `%s' does not implement the get_strategies " + "virtual function.", + g_type_name (G_OBJECT_TYPE (context))); + + return FALSE; + } + + return GDICT_CONTEXT_GET_IFACE (context)->get_strategies (context, error); +} + +/** + * gdict_context_match_word: + * @context: a #GdictContext + * @database: a database name to search into, or %NULL for the + * default database + * @strategy: a strategy name to use for matching, or %NULL for + * the default strategy + * @word: the word to match + * @error: return location for a #GError, or %NULL + * + * Query @context for a list of word matching @word inside @database, + * using @strategy as a matching strategy. Each time a matching word + * is found, the "match-found" signal is fired. + * + * Return value: %TRUE if the query was successfully started. + * + * Since: 1.0 + */ +gboolean +gdict_context_match_word (GdictContext *context, + const gchar *database, + const gchar *strategy, + const gchar *word, + GError **error) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), FALSE); + g_return_val_if_fail (word != NULL, FALSE); + + if (!GDICT_CONTEXT_GET_IFACE (context)->match_word) + { + g_warning ("Object `%s' does not implement the match_word " + "virtual function.", + g_type_name (G_OBJECT_TYPE (context))); + + return FALSE; + } + + return GDICT_CONTEXT_GET_IFACE (context)->match_word (context, + database, + strategy, + word, + error); +} + +/** + * gdict_context_define_word: + * @context: a #GdictContext + * @database: a database name to search into, or %NULL for the + * default database + * @word: the word to search + * @error: return location for a #GError, or %NULL + * + * Query @context for a list of definitions of @word inside @database. Each + * time a new definition is found, the "definition-found" signal is fired. + * + * Return value: %TRUE if the query was successfully sent. + * + * Since: 1.0 + */ +gboolean +gdict_context_define_word (GdictContext *context, + const gchar *database, + const gchar *word, + GError **error) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), FALSE); + g_return_val_if_fail (word != NULL, FALSE); + + if (!GDICT_CONTEXT_GET_IFACE (context)->define_word) + { + g_warning ("Object `%s' does not implement the define_word " + "virtual function.", + g_type_name (G_OBJECT_TYPE (context))); + + return FALSE; + } + + return GDICT_CONTEXT_GET_IFACE (context)->define_word (context, + database, + word, + error); +} + + + +/***************** + * GdictDatabase * + *****************/ + +GDICT_DEFINE_BOXED_TYPE (GdictDatabase, gdict_database); + +GdictDatabase * +_gdict_database_new (const gchar *name) +{ + GdictDatabase *retval; + + g_return_val_if_fail (name != NULL, NULL); + + retval = g_slice_new (GdictDatabase); + retval->name = g_strdup (name); + retval->full_name = NULL; + retval->ref_count = 1; + + return retval; +} + +/** + * gdict_database_ref: + * @db: a #GdictDatabase + * + * Increases the reference count of @db by one. + * + * Return value: @db with its reference count increased + * + * Since: 1.0 + */ +GdictDatabase * +gdict_database_ref (GdictDatabase *db) +{ + g_return_val_if_fail (db != NULL, NULL); + + g_assert (db->ref_count != 0); + + db->ref_count += 1; + + return db; +} + +/** + * gdict_database_unref: + * @db: a #GdictDatabase + * + * Decreases the reference count of @db by one. If the reference count reaches + * zero, @db is destroyed. + * + * Since: 1.0 + */ +void +gdict_database_unref (GdictDatabase *db) +{ + g_return_if_fail (db != NULL); + + g_assert (db->ref_count != 0); + + db->ref_count -= 1; + if (db->ref_count == 0) + { + g_free (db->name); + g_free (db->full_name); + + g_slice_free (GdictDatabase, db); + } +} + +/** + * gdict_database_get_name: + * @db: a #GdictDatabase + * + * Gets the short name of the database, to be used with functions like + * gdict_context_match_word() or gdict_context_define_word(). + * + * Return value: the short name of the database. The string is owned by + * the #GdictDatabase object, and should never be modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_database_get_name (GdictDatabase *db) +{ + g_return_val_if_fail (db != NULL, NULL); + + return db->name; +} + +/** + * gdict_database_get_full_name: + * @db: a #GdictDatabase + * + * Gets the full name of the database, suitable for display. + * + * Return value: the full name of the database. The string is owned by + * the #GdictDatabase object, and should never be modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_database_get_full_name (GdictDatabase *db) +{ + g_return_val_if_fail (db != NULL, NULL); + + return db->full_name; +} + + + +/***************** + * GdictStrategy * + *****************/ + +GDICT_DEFINE_BOXED_TYPE (GdictStrategy, gdict_strategy); + +GdictStrategy * +_gdict_strategy_new (const gchar *name) +{ + GdictStrategy *strat; + + g_return_val_if_fail (name != NULL, NULL); + + strat = g_slice_new (GdictStrategy); + strat->name = g_strdup (name); + strat->description = NULL; + strat->ref_count = 1; + + return strat; +} + +/** + * gdict_strategy_ref: + * @strat: a #GdictStrategy + * + * Increases the reference count of @strat by one. + * + * Return value: the #GdictStrategy object with its reference count + * increased + * + * Since: 1.0 + */ +GdictStrategy * +gdict_strategy_ref (GdictStrategy *strat) +{ + g_return_val_if_fail (strat != NULL, NULL); + + g_assert (strat->ref_count != 0); + + strat->ref_count += 1; + + return strat; +} + +/** + * gdict_strategy_unref: + * @strat: a #GdictStrategy + * + * Decreases the reference count of @strat by one. If the reference count + * reaches zero, the #GdictStrategy object is freed. + * + * Since: 1.0 + */ +void +gdict_strategy_unref (GdictStrategy *strat) +{ + g_return_if_fail (strat != NULL); + + g_assert (strat->ref_count != 0); + + strat->ref_count -= 1; + if (strat->ref_count == 0) + { + g_free (strat->name); + g_free (strat->description); + + g_slice_free (GdictStrategy, strat); + } +} + +/** + * gdict_strategy_get_name: + * @strat: a #GdictStrategy + * + * FIXME + * + * Return value: FIXME + * + * Since: 1.0 + */ +const gchar * +gdict_strategy_get_name (GdictStrategy *strat) +{ + g_return_val_if_fail (strat != NULL, NULL); + + return strat->name; +} + +/** + * gdict_strategy_get_description: + * @strat: a #GdictStrategy + * + * FIXME + * + * Return value: FIXME + * + * Since: 1.0 + */ +const gchar * +gdict_strategy_get_description (GdictStrategy *strat) +{ + g_return_val_if_fail (strat != NULL, NULL); + + return strat->description; +} + + + +/************** + * GdictMatch * + **************/ + +GDICT_DEFINE_BOXED_TYPE (GdictMatch, gdict_match); + +GdictMatch * +_gdict_match_new (const gchar *word) +{ + GdictMatch *match; + + g_return_val_if_fail (word != NULL, NULL); + + match = g_slice_new (GdictMatch); + match->word = g_strdup (word); + match->database = NULL; + match->ref_count = 1; + + return match; +} + +/** + * gdict_match_ref: + * @match: a #GdictMatch + * + * FIXME + * + * Return value: FIXME + * + * Since: 1.0 + */ +GdictMatch * +gdict_match_ref (GdictMatch *match) +{ + g_return_val_if_fail (match != NULL, NULL); + + g_assert (match->ref_count != 0); + + match->ref_count += 1; + + return match; +} + +/** + * gdict_match_unref: + * @match: a #GdictMatch + * + * FIXME + * + * Since: 1.0 + */ +void +gdict_match_unref (GdictMatch *match) +{ + g_return_if_fail (match != NULL); + + g_assert (match->ref_count != 0); + + match->ref_count -= 1; + + if (match->ref_count == 0) + { + g_free (match->word); + g_free (match->database); + + g_slice_free (GdictMatch, match); + } +} + +/** + * gdict_match_get_word: + * @match: a #GdictMatch + * + * FIXME + * + * Return value: FIXME + * + * Since: 1.0 + */ +const gchar * +gdict_match_get_word (GdictMatch *match) +{ + g_return_val_if_fail (match != NULL, NULL); + + return match->word; +} + +/** + * gdict_match_get_database: + * @match: a #GdictMatch + * + * FIXME + * + * Return value: FIXME + * + * Since: 1.0 + */ +const gchar * +gdict_match_get_database (GdictMatch *match) +{ + g_return_val_if_fail (match != NULL, NULL); + + return match->database; +} + + + +/******************* + * GdictDefinition * + *******************/ + +GDICT_DEFINE_BOXED_TYPE (GdictDefinition, gdict_definition); + +/* GdictDefinition constructor */ +GdictDefinition * +_gdict_definition_new (gint total) +{ + GdictDefinition *def; + + def = g_slice_new (GdictDefinition); + + def->total = total; + def->word = NULL; + def->database_name = NULL; + def->database_full = NULL; + def->ref_count = 1; + + return def; +} + +/** + * gdict_definition_ref: + * @def: a #GdictDefinition + * + * Increases the reference count of @def by one. + * + * Return value: the #GdictDefinition object with its reference count + * increased. + * + * Since: 1.0 + */ +GdictDefinition * +gdict_definition_ref (GdictDefinition *def) +{ + g_return_val_if_fail (def != NULL, NULL); + + g_assert (def->ref_count != 0); + + def->ref_count += 1; + + return def; +} + +/** + * gdict_definition_unref: + * @def: a #GdictDefinition + * + * Decreases the reference count of @def by one. If the reference count + * reaches zero, the #GdictDefinition object is freed. + * + * Since: 1.0 + */ +void +gdict_definition_unref (GdictDefinition *def) +{ + g_return_if_fail (def != NULL); + + g_assert (def->ref_count != 0); + + def->ref_count -= 1; + if (def->ref_count == 0) + { + g_free (def->word); + g_free (def->database_name); + g_free (def->database_full); + + g_slice_free (GdictDefinition, def); + } +} + +/** + * gdict_definition_get_total: + * @def: a #GdictDefinition + * + * Retrieves the total number of definitions that were found on a + * dictionary. + * + * Return value: the number of definitions. + * + * Since: 1.0 + */ +gint +gdict_definition_get_total (GdictDefinition *def) +{ + g_return_val_if_fail (def != NULL, -1); + + return def->total; +} + +/** + * gdict_definition_get_word: + * @def: a #GdictDefinition + * + * Retrieves the word used by the dictionary database to store + * the definition. + * + * Return value: a word. The returned string is owned by the + * #GdictDefinition object and should not be modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_definition_get_word (GdictDefinition *def) +{ + g_return_val_if_fail (def != NULL, NULL); + + return def->word; +} + +/** + * gdict_definition_get_database: + * @def: a #GdictDefinition + * + * Retrieves the full name of the dictionary database where the + * definition is stored. + * + * Return value: the full name of a database. The returned string + * is owned by the #GdictDefinition object and should not be + * modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_definition_get_database (GdictDefinition *def) +{ + g_return_val_if_fail (def != NULL, NULL); + + return def->database_full; +} + +/** + * gdict_definition_get_text: + * @def: a #GdictDefinition + * + * Retrieves the text of the definition. + * + * Return value: the text of the definition. The returned string + * is owned by the #GdictDefinition object, and should not be + * modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_definition_get_text (GdictDefinition *def) +{ + g_return_val_if_fail (def != NULL, NULL); + + return def->definition; +} diff --git a/mate-dictionary/libgdict/gdict-context.h b/mate-dictionary/libgdict/gdict-context.h new file mode 100644 index 00000000..974a820b --- /dev/null +++ b/mate-dictionary/libgdict/gdict-context.h @@ -0,0 +1,204 @@ +/* gdict-context.h - Abstract class for dictionary contexts + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_CONTEXT_H__ +#define __GDICT_CONTEXT_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +#define GDICT_TYPE_DATABASE (gdict_database_get_type ()) +#define GDICT_TYPE_STRATEGY (gdict_strategy_get_type ()) +#define GDICT_TYPE_MATCH (gdict_match_get_type ()) +#define GDICT_TYPE_DEFINITION (gdict_definition_get_type ()) + +#define GDICT_TYPE_CONTEXT (gdict_context_get_type ()) +#define GDICT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_CONTEXT, GdictContext)) +#define GDICT_IS_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_CONTEXT)) +#define GDICT_CONTEXT_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GDICT_TYPE_CONTEXT, GdictContextIface)) + +/* These are the boxed containers for action results. */ +typedef struct _GdictDatabase GdictDatabase; +typedef struct _GdictStrategy GdictStrategy; +typedef struct _GdictMatch GdictMatch; +typedef struct _GdictDefinition GdictDefinition; + +typedef struct _GdictContext GdictContext; /* dummy typedef */ +typedef struct _GdictContextIface GdictContextIface; + +#define GDICT_CONTEXT_ERROR (gdict_context_error_quark ()) + +/** + * GdictContextError: + * @GDICT_CONTEXT_ERROR_PARSE: + * @GDICT_CONTEXT_ERROR_NOT_IMPLEMENTED: + * @GDICT_CONTEXT_ERROR_INVALID_DATABASE: + * @GDICT_CONTEXT_ERROR_INVALID_STRATEGY: + * @GDICT_CONTEXT_ERROR_INVALID_COMMAND: + * @GDICT_CONTEXT_ERROR_NO_MATCH: + * @GDICT_CONTEXT_ERROR_NO_DATABASES: + * @GDICT_CONTEXT_ERROR_NO_STRATEGIES: + * + * #GdictContext error enumeration. + */ +typedef enum { + GDICT_CONTEXT_ERROR_PARSE, + GDICT_CONTEXT_ERROR_NOT_IMPLEMENTED, + GDICT_CONTEXT_ERROR_INVALID_DATABASE, + GDICT_CONTEXT_ERROR_INVALID_STRATEGY, + GDICT_CONTEXT_ERROR_INVALID_COMMAND, + GDICT_CONTEXT_ERROR_NO_MATCH, + GDICT_CONTEXT_ERROR_NO_DATABASES, + GDICT_CONTEXT_ERROR_NO_STRATEGIES +} GdictContextError; + +GQuark gdict_context_error_quark (void); + +/** + * GdictDatabase: + * + * A #GdictDatabase represents a database inside a dictionary source. + * + * The #GdictDatabase structure is private and should only be accessed + * using the available functions. + */ +GType gdict_database_get_type (void) G_GNUC_CONST; +GdictDatabase * gdict_database_ref (GdictDatabase *db); +void gdict_database_unref (GdictDatabase *db); +const gchar *gdict_database_get_name (GdictDatabase *db); +const gchar *gdict_database_get_full_name (GdictDatabase *db); + +/** + * GdictStrategy: + * + * A #GdictStrategy represents a matching strategy implemented by + * a dictionary source. + * + * The #GdictStrategy structure is private and should only be accessed + * using the available functions. + */ +GType gdict_strategy_get_type (void) G_GNUC_CONST; +GdictStrategy * gdict_strategy_ref (GdictStrategy *strat); +void gdict_strategy_unref (GdictStrategy *strat); +const gchar *gdict_strategy_get_name (GdictStrategy *strat); +const gchar *gdict_strategy_get_description (GdictStrategy *strat); + +/** + * GdictMatch: + * + * A #GdictMatch represents a single match for the searched word. + * + * The #GdictMatch structure is private and should only be accessed + * using the available functions. + */ +GType gdict_match_get_type (void) G_GNUC_CONST; +GdictMatch * gdict_match_ref (GdictMatch *match); +void gdict_match_unref (GdictMatch *match); +const gchar *gdict_match_get_word (GdictMatch *match); +const gchar *gdict_match_get_database (GdictMatch *match); + +/** + * GdictDefinition: + * + * A #GdictDefinition represents a single definition for the searched + * word. + * + * The #GdictDefinition structure is private and should only be + * accessed using the available functions. + */ +GType gdict_definition_get_type (void) G_GNUC_CONST; +GdictDefinition * gdict_definition_ref (GdictDefinition *def); +void gdict_definition_unref (GdictDefinition *def); +gint gdict_definition_get_total (GdictDefinition *def); +const gchar *gdict_definition_get_word (GdictDefinition *def); +const gchar *gdict_definition_get_database (GdictDefinition *def); +const gchar *gdict_definition_get_text (GdictDefinition *def); + +/** + * GdictContextIface: + * + * Interface defintion + */ +struct _GdictContextIface +{ + /*< private >*/ + GTypeInterface base_iface; + + /*< public >*/ + /* methods, not signals */ + gboolean (*get_databases) (GdictContext *context, + GError **error); + gboolean (*get_strategies) (GdictContext *context, + GError **error); + gboolean (*match_word) (GdictContext *context, + const gchar *database, + const gchar *strategy, + const gchar *word, + GError **error); + gboolean (*define_word) (GdictContext *context, + const gchar *database, + const gchar *word, + GError **error); + + /* signals */ + void (*lookup_start) (GdictContext *context); + void (*lookup_end) (GdictContext *context); + + void (*database_found) (GdictContext *context, + GdictDatabase *database); + void (*strategy_found) (GdictContext *context, + GdictStrategy *strategy); + void (*match_found) (GdictContext *context, + GdictMatch *match); + void (*definition_found) (GdictContext *context, + GdictDefinition *definition); + + /* fired each time there's an error; the GError is owned + * by the context, and should never be modified or freed + */ + void (*error) (GdictContext *context, + const GError *error); +}; + +GType gdict_context_get_type (void) G_GNUC_CONST; + +/* Configuration */ +void gdict_context_set_local_only (GdictContext *context, + gboolean local_only); +gboolean gdict_context_get_local_only (GdictContext *context); + +/* Actions */ +gboolean gdict_context_lookup_databases (GdictContext *context, + GError **error); +gboolean gdict_context_lookup_strategies (GdictContext *context, + GError **error); +gboolean gdict_context_match_word (GdictContext *context, + const gchar *database, + const gchar *strategy, + const gchar *word, + GError **error); +gboolean gdict_context_define_word (GdictContext *context, + const gchar *database, + const gchar *word, + GError **error); + +G_END_DECLS + +#endif /* __GDICT_CONTEXT_H__ */ diff --git a/mate-dictionary/libgdict/gdict-database-chooser.c b/mate-dictionary/libgdict/gdict-database-chooser.c new file mode 100644 index 00000000..475b150b --- /dev/null +++ b/mate-dictionary/libgdict/gdict-database-chooser.c @@ -0,0 +1,1142 @@ +/* gdict-database-chooser.c - display widget for database names + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-database-chooser + * @short_description: Display the list of available databases + * + * Each #GdictContext has a list of databases, that is dictionaries that + * can be queried. #GdictDatabaseChooser is a widget that queries a given + * #GdictContext and displays the list of available databases. + * + * #GdictDatabaseChooser is available since Gdict 0.10 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> + +#include <gdk/gdkkeysyms.h> +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +#include "gdict-database-chooser.h" +#include "gdict-utils.h" +#include "gdict-debug.h" +#include "gdict-private.h" +#include "gdict-enum-types.h" +#include "gdict-marshal.h" + +#define GDICT_DATABASE_CHOOSER_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_DATABASE_CHOOSER, GdictDatabaseChooserPrivate)) + +struct _GdictDatabaseChooserPrivate +{ + GtkListStore *store; + + GtkWidget *treeview; + GtkWidget *clear_button; + GtkWidget *refresh_button; + GtkWidget *buttons_box; + + GdictContext *context; + gint results; + + guint start_id; + guint match_id; + guint end_id; + guint error_id; + + GdkCursor *busy_cursor; + + gchar *current_db; + + guint is_searching : 1; +}; + +enum +{ + DATABASE_NAME, + DATABASE_ERROR +} DBType; + +enum +{ + DB_COLUMN_TYPE, + DB_COLUMN_NAME, + DB_COLUMN_DESCRIPTION, + DB_COLUMN_CURRENT, + + DB_N_COLUMNS +}; + +enum +{ + PROP_0, + + PROP_CONTEXT, + PROP_COUNT +}; + +enum +{ + DATABASE_ACTIVATED, + SELECTION_CHANGED, + + LAST_SIGNAL +}; + +static guint db_chooser_signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE (GdictDatabaseChooser, + gdict_database_chooser, + GTK_TYPE_VBOX); + + +static void +set_gdict_context (GdictDatabaseChooser *chooser, + GdictContext *context) +{ + GdictDatabaseChooserPrivate *priv; + + g_assert (GDICT_IS_DATABASE_CHOOSER (chooser)); + priv = chooser->priv; + + if (priv->context) + { + if (priv->start_id) + { + GDICT_NOTE (CHOOSER, "Removing old context handlers"); + + g_signal_handler_disconnect (priv->context, priv->start_id); + g_signal_handler_disconnect (priv->context, priv->match_id); + g_signal_handler_disconnect (priv->context, priv->end_id); + + priv->start_id = 0; + priv->end_id = 0; + priv->match_id = 0; + } + + if (priv->error_id) + { + g_signal_handler_disconnect (priv->context, priv->error_id); + + priv->error_id = 0; + } + + GDICT_NOTE (CHOOSER, "Removing old context"); + + g_object_unref (G_OBJECT (priv->context)); + + priv->context = NULL; + priv->results = -1; + } + + if (!context) + return; + + if (!GDICT_IS_CONTEXT (context)) + { + g_warning ("Object of type '%s' instead of a GdictContext\n", + g_type_name (G_OBJECT_TYPE (context))); + return; + } + + GDICT_NOTE (CHOOSER, "Setting new context"); + + priv->context = g_object_ref (context); + priv->results = 0; +} + +static void +gdict_database_chooser_finalize (GObject *gobject) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (gobject); + GdictDatabaseChooserPrivate *priv = chooser->priv; + + g_free (priv->current_db); + + G_OBJECT_CLASS (gdict_database_chooser_parent_class)->finalize (gobject); +} + +static void +gdict_database_chooser_dispose (GObject *gobject) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (gobject); + GdictDatabaseChooserPrivate *priv = chooser->priv; + + set_gdict_context (chooser, NULL); + + if (priv->busy_cursor) + { + gdk_cursor_unref (priv->busy_cursor); + priv->busy_cursor = NULL; + } + + if (priv->store) + { + g_object_unref (priv->store); + priv->store = NULL; + } + + G_OBJECT_CLASS (gdict_database_chooser_parent_class)->dispose (gobject); +} + +static void +gdict_database_chooser_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (gobject); + + switch (prop_id) + { + case PROP_CONTEXT: + set_gdict_context (chooser, g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +gdict_database_chooser_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (gobject); + + switch (prop_id) + { + case PROP_CONTEXT: + g_value_set_object (value, chooser->priv->context); + break; + case PROP_COUNT: + g_value_set_int (value, chooser->priv->results); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +row_activated_cb (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + gpointer user_data) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (user_data); + GdictDatabaseChooserPrivate *priv = chooser->priv; + GtkTreeIter iter; + gchar *db_name, *db_desc; + gboolean valid; + + valid = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->store), + &iter, + path); + if (!valid) + { + g_warning ("Invalid iterator found"); + return; + } + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + DB_COLUMN_NAME, &db_name, + DB_COLUMN_DESCRIPTION, &db_desc, + -1); + if (db_name && db_desc) + { + g_free (priv->current_db); + priv->current_db = g_strdup (db_name); + + g_signal_emit (chooser, db_chooser_signals[DATABASE_ACTIVATED], 0, + db_name, db_desc); + } + else + { + gchar *row = gtk_tree_path_to_string (path); + + g_warning ("Row %s activated, but no database attached", row); + g_free (row); + } + + g_free (db_name); + g_free (db_desc); +} + +static void +refresh_button_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (user_data); + + gdict_database_chooser_refresh (chooser); +} + +static void +clear_button_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (user_data); + + gdict_database_chooser_clear (chooser); +} + +static void +selection_changed_cb (GtkTreeSelection *selection, + gpointer user_data) +{ + g_signal_emit (user_data, db_chooser_signals[SELECTION_CHANGED], 0); +} + +static GObject * +gdict_database_chooser_constructor (GType type, + guint n_params, + GObjectConstructParam *params) +{ + GObjectClass *parent_class; + GObject *object; + GdictDatabaseChooser *chooser; + GdictDatabaseChooserPrivate *priv; + GtkWidget *sw; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkWidget *hbox; + + parent_class = G_OBJECT_CLASS (gdict_database_chooser_parent_class); + object = parent_class->constructor (type, n_params, params); + + chooser = GDICT_DATABASE_CHOOSER (object); + priv = chooser->priv; + + gtk_widget_push_composite_child (); + + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_composite_name (sw, "gdict-database-chooser-scrolled-window"); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (chooser), sw, TRUE, TRUE, 0); + gtk_widget_show (sw); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("databases", + renderer, + "text", DB_COLUMN_DESCRIPTION, + "weight", DB_COLUMN_CURRENT, + NULL); + priv->treeview = gtk_tree_view_new (); + gtk_widget_set_composite_name (priv->treeview, "gdict-database-chooser-treeview"); + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->treeview), FALSE); + gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview), column); + g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)), + "changed", G_CALLBACK (selection_changed_cb), + chooser); + g_signal_connect (priv->treeview, "row-activated", + G_CALLBACK (row_activated_cb), chooser); + gtk_container_add (GTK_CONTAINER (sw), priv->treeview); + gtk_widget_show (priv->treeview); + + hbox = gtk_hbox_new (FALSE, 0); + priv->buttons_box = hbox; + + priv->refresh_button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (priv->refresh_button), + gtk_image_new_from_stock (GTK_STOCK_REFRESH, + GTK_ICON_SIZE_SMALL_TOOLBAR)); + g_signal_connect (priv->refresh_button, "clicked", + G_CALLBACK (refresh_button_clicked_cb), + chooser); + gtk_box_pack_start (GTK_BOX (hbox), priv->refresh_button, FALSE, FALSE, 0); + gtk_widget_show (priv->refresh_button); + gtk_widget_set_tooltip_text (priv->refresh_button, + _("Reload the list of available databases")); + + priv->clear_button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (priv->clear_button), + gtk_image_new_from_stock (GTK_STOCK_CLEAR, + GTK_ICON_SIZE_SMALL_TOOLBAR)); + g_signal_connect (priv->clear_button, "clicked", + G_CALLBACK (clear_button_clicked_cb), + chooser); + gtk_box_pack_start (GTK_BOX (hbox), priv->clear_button, FALSE, FALSE, 0); + gtk_widget_show (priv->clear_button); + gtk_widget_set_tooltip_text (priv->clear_button, + _("Clear the list of available databases")); + + gtk_box_pack_end (GTK_BOX (chooser), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + gtk_widget_pop_composite_child (); + + return object; +} + +static void +gdict_database_chooser_class_init (GdictDatabaseChooserClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gdict_database_chooser_finalize; + gobject_class->dispose = gdict_database_chooser_dispose; + gobject_class->set_property = gdict_database_chooser_set_property; + gobject_class->get_property = gdict_database_chooser_get_property; + gobject_class->constructor = gdict_database_chooser_constructor; + + /** + * GdictDatabaseChooser:context: + * + * The #GdictContext used to retrieve the list of available databases. + * + * Since: 0.10 + */ + g_object_class_install_property (gobject_class, + PROP_CONTEXT, + g_param_spec_object ("context", + "Context", + "The GdictContext object used to get the list of databases", + GDICT_TYPE_CONTEXT, + (G_PARAM_READWRITE | G_PARAM_CONSTRUCT))); + /** + * GdictDatabaseChooser:count: + * + * The number of displayed databases or, if no #GdictContext is set, -1. + * + * Since: 0.12 + */ + g_object_class_install_property (gobject_class, + PROP_COUNT, + g_param_spec_int ("count", + "Count", + "The number of available databases", + -1, G_MAXINT, -1, + G_PARAM_READABLE)); + + /** + * GdictDatabaseChooser::database-activated: + * @chooser: the database chooser that received the signal + * @name: the name of the activated database + * @description: the description of the activated database + * + * The ::database-activated signal is emitted each time the user + * activated a row in the database chooser widget, either by double + * clicking on it or by a keyboard event. + * + * Since: 0.10 + */ + db_chooser_signals[DATABASE_ACTIVATED] = + g_signal_new ("database-activated", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictDatabaseChooserClass, database_activated), + NULL, NULL, + gdict_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_STRING); + /** + * GdictDatabaseChooser::selection-changed: + * @chooser: the database chooser that received the signal + * + * The ::selection-changed signal is emitted each time the selection + * inside the database chooser has been changed. + * + * Since: 0.12 + */ + db_chooser_signals[SELECTION_CHANGED] = + g_signal_new ("selection-changed", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictDatabaseChooserClass, selection_changed), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + g_type_class_add_private (gobject_class, sizeof (GdictDatabaseChooserPrivate)); +} + +static void +gdict_database_chooser_init (GdictDatabaseChooser *chooser) +{ + GdictDatabaseChooserPrivate *priv; + + chooser->priv = priv = GDICT_DATABASE_CHOOSER_GET_PRIVATE (chooser); + + priv->results = -1; + priv->context = NULL; + + priv->store = gtk_list_store_new (DB_N_COLUMNS, + G_TYPE_INT, /* db_type */ + G_TYPE_STRING, /* db_name */ + G_TYPE_STRING, /* db_desc */ + G_TYPE_INT /* db_current */); + + priv->start_id = 0; + priv->end_id = 0; + priv->match_id = 0; + priv->error_id = 0; +} + +/** + * gdict_database_chooser_new: + * + * Creates a new #GdictDatabaseChooser widget. A Database chooser widget + * can be used to display the list of available databases on a dictionary + * source using the #GdictContext representing it. After creation, the + * #GdictContext can be set using gdict_database_chooser_set_context(). + * + * Return value: the newly created #GdictDatabaseChooser widget. + * + * Since: 0.10 + */ +GtkWidget * +gdict_database_chooser_new (void) +{ + return g_object_new (GDICT_TYPE_DATABASE_CHOOSER, NULL); +} + +/** + * gdict_database_chooser_new_with_context: + * @context: a #GdictContext + * + * Creates a new #GdictDatabaseChooser, using @context as the representation + * of the dictionary source to query for the list of available databases. + * + * Return value: the newly created #GdictDatabaseChooser widget. + * + * Since: 0.10 + */ +GtkWidget * +gdict_database_chooser_new_with_context (GdictContext *context) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), NULL); + + return g_object_new (GDICT_TYPE_DATABASE_CHOOSER, + "context", context, + NULL); +} + +/** + * gdict_database_chooser_get_context: + * @chooser: a #GdictDatabaseChooser + * + * Retrieves the #GdictContext used by @chooser. + * + * Return value: a #GdictContext or %NULL + * + * Since: 0.10 + */ +GdictContext * +gdict_database_chooser_get_context (GdictDatabaseChooser *chooser) +{ + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), NULL); + + return chooser->priv->context; +} + +/** + * gdict_database_chooser_set_context: + * @chooser: a #GdictDatabaseChooser + * @context: a #GdictContext + * + * Sets the #GdictContext to be used to query a dictionary source + * for the list of available databases. + * + * Since: 0.10 + */ +void +gdict_database_chooser_set_context (GdictDatabaseChooser *chooser, + GdictContext *context) +{ + g_return_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser)); + g_return_if_fail (context == NULL || GDICT_IS_CONTEXT (context)); + + set_gdict_context (chooser, context); + + g_object_notify (G_OBJECT (chooser), "context"); +} + +/** + * gdict_database_chooser_get_databases: + * @chooser: a #GdictDatabaseChooser + * @length: return location for the length of the returned vector + * + * Gets the list of available database names. + * + * Return value: a newly allocated, %NULL terminated string vector + * containing database names. Use g_strfreev() to deallocate it. + * + * Since: 0.10 + */ +gchar ** +gdict_database_chooser_get_databases (GdictDatabaseChooser *chooser, + gsize *length) +{ + GdictDatabaseChooserPrivate *priv; + GtkTreeIter iter; + gchar **retval; + gsize i; + + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), NULL); + + priv = chooser->priv; + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store), &iter)) + return NULL; + + i = 0; + retval = g_new (gchar*, priv->results); + + do + { + gchar *db_name; + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + DB_COLUMN_NAME, &db_name, + -1); + + retval[i++] = db_name; + } + while (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter)); + + retval[i] = NULL; + + if (length) + *length = i; + + return retval; +} + +/** + * gdict_database_chooser_has_database: + * @chooser: a #GdictDatabaseChooser + * @database: the name of a database + * + * Checks whether the @chooser displays @database + * + * Return value: %TRUE if the search database name is present + * + * Since: 0.10 + */ +gboolean +gdict_database_chooser_has_database (GdictDatabaseChooser *chooser, + const gchar *database) +{ + GdictDatabaseChooserPrivate *priv; + GtkTreeIter iter; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (database != NULL, FALSE); + + priv = chooser->priv; + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store), &iter)) + return FALSE; + + retval = FALSE; + + do + { + gchar *db_name; + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + DB_COLUMN_NAME, &db_name, + -1); + + if (strcmp (db_name, database) == 0) + { + g_free (db_name); + retval = TRUE; + break; + } + + g_free (db_name); + } + while (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter)); + + return retval; +} + +/** + * gdict_database_chooser_count_databases: + * @chooser: a #GdictDatabaseChooser + * + * Returns the number of databases found. + * + * Return value: the number of databases or -1 if no context is set + * + * Since: 0.10 + */ +gint +gdict_database_chooser_count_databases (GdictDatabaseChooser *chooser) +{ + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), -1); + + return chooser->priv->results; +} + +static void +lookup_start_cb (GdictContext *context, + gpointer user_data) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (user_data); + GdictDatabaseChooserPrivate *priv = chooser->priv; + + if (!priv->busy_cursor) + priv->busy_cursor = gdk_cursor_new (GDK_WATCH); + + if (gtk_widget_get_window (GTK_WIDGET (chooser))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (chooser)), priv->busy_cursor); + + priv->is_searching = TRUE; +} + +static void +lookup_end_cb (GdictContext *context, + gpointer user_data) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (user_data); + GdictDatabaseChooserPrivate *priv = chooser->priv; + + if (gtk_widget_get_window (GTK_WIDGET (chooser))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (chooser)), NULL); + + priv->is_searching = FALSE; +} + +static void +database_found_cb (GdictContext *context, + GdictDatabase *database, + gpointer user_data) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (user_data); + GdictDatabaseChooserPrivate *priv = chooser->priv; + GtkTreeIter iter; + const gchar *name, *full_name; + gint weight = PANGO_WEIGHT_NORMAL; + + name = gdict_database_get_name (database); + full_name = gdict_database_get_full_name (database); + + if (priv->current_db && !strcmp (priv->current_db, name)) + weight = PANGO_WEIGHT_BOLD; + + GDICT_NOTE (CHOOSER, "DATABASE: `%s' (`%s')", + name, + full_name); + + gtk_list_store_append (priv->store, &iter); + gtk_list_store_set (priv->store, &iter, + DB_COLUMN_TYPE, DATABASE_NAME, + DB_COLUMN_NAME, name, + DB_COLUMN_DESCRIPTION, full_name, + DB_COLUMN_CURRENT, weight, + -1); + + priv->results += 1; +} + +static void +error_cb (GdictContext *context, + const GError *error, + gpointer user_data) +{ + GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (user_data); + + if (gtk_widget_get_window (GTK_WIDGET (chooser))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (chooser)), NULL); + + chooser->priv->is_searching = FALSE; + chooser->priv->results = 0; +} + +/** + * gdict_database_chooser_refresh: + * @chooser: a #GdictDatabaseChooser + * + * Reloads the list of available databases. + * + * Since: 0.10 + */ +void +gdict_database_chooser_refresh (GdictDatabaseChooser *chooser) +{ + GdictDatabaseChooserPrivate *priv; + GError *db_error; + + g_return_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser)); + + priv = chooser->priv; + + if (!priv->context) + { + g_warning ("Attempting to retrieve the available databases, but " + "no GdictContext has been set. Use gdict_database_chooser_set_context() " + "before invoking gdict_database_chooser_refresh()."); + return; + } + + if (priv->is_searching) + return; + + gdict_database_chooser_clear (chooser); + + if (!priv->start_id) + { + priv->start_id = g_signal_connect (priv->context, "lookup-start", + G_CALLBACK (lookup_start_cb), + chooser); + priv->match_id = g_signal_connect (priv->context, "database-found", + G_CALLBACK (database_found_cb), + chooser); + priv->end_id = g_signal_connect (priv->context, "lookup-end", + G_CALLBACK (lookup_end_cb), + chooser); + } + + if (!priv->error_id) + priv->error_id = g_signal_connect (priv->context, "error", + G_CALLBACK (error_cb), + chooser); + + db_error = NULL; + gdict_context_lookup_databases (priv->context, &db_error); + if (db_error) + { + GtkTreeIter iter; + + gtk_list_store_append (priv->store, &iter); + gtk_list_store_set (priv->store, &iter, + DB_COLUMN_TYPE, DATABASE_ERROR, + DB_COLUMN_NAME, _("Error while matching"), + DB_COLUMN_DESCRIPTION, NULL, + -1); + + g_warning ("Error while looking for databases: %s", + db_error->message); + + g_error_free (db_error); + } +} + +/** + * gdict_database_chooser_clear: + * @chooser: a #GdictDatabaseChooser + * + * Clears @chooser. + * + * Since: 0.10 + */ +void +gdict_database_chooser_clear (GdictDatabaseChooser *chooser) +{ + GdictDatabaseChooserPrivate *priv; + + g_return_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser)); + + priv = chooser->priv; + + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), NULL); + + gtk_list_store_clear (priv->store); + priv->results = 0; + + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); +} + +typedef struct +{ + gchar *db_name; + GdictDatabaseChooser *chooser; + + guint found : 1; + guint do_select : 1; + guint do_activate : 1; +} SelectData; + +static gboolean +scan_for_db_name (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data) +{ + SelectData *select_data = user_data; + gchar *db_name = NULL; + + if (!select_data) + return TRUE; + + gtk_tree_model_get (model, iter, DB_COLUMN_NAME, &db_name, -1); + if (!db_name) + return FALSE; + + if (strcmp (db_name, select_data->db_name) == 0) + { + GtkTreeView *tree_view; + GtkTreeSelection *selection; + + select_data->found = TRUE; + + tree_view = GTK_TREE_VIEW (select_data->chooser->priv->treeview); + if (select_data->do_activate) + { + GtkTreeViewColumn *column; + + gtk_list_store_set (GTK_LIST_STORE (model), iter, + DB_COLUMN_CURRENT, PANGO_WEIGHT_BOLD, + -1); + + column = gtk_tree_view_get_column (tree_view, 0); + gtk_tree_view_row_activated (tree_view, path, column); + } + + selection = gtk_tree_view_get_selection (tree_view); + if (select_data->do_select) + gtk_tree_selection_select_path (selection, path); + else + gtk_tree_selection_unselect_path (selection, path); + } + else + { + gtk_list_store_set (GTK_LIST_STORE (model), iter, + DB_COLUMN_CURRENT, PANGO_WEIGHT_NORMAL, + -1); + } + + g_free (db_name); + + return FALSE; +} + +/** + * gdict_database_chooser_select_database: + * @chooser: a #GdictDatabaseChooser + * @db_name: name of the database to select + * + * Selects the database with @db_name inside the @chooser widget. + * + * Return value: %TRUE if the database was found and selected + * + * Since: 0.10 + */ +gboolean +gdict_database_chooser_select_database (GdictDatabaseChooser *chooser, + const gchar *db_name) +{ + GdictDatabaseChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (db_name != NULL, FALSE); + + priv = chooser->priv; + + data.db_name = g_strdup (db_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = TRUE; + data.do_activate = FALSE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_db_name, + &data); + + retval = data.found; + + g_free (data.db_name); + + return retval; +} + +/** + * gdict_database_chooser_unselect_database: + * @chooser: a #GdictDatabaseChooser + * @db_name: name of the database to unselect + * + * Unselects the database @db_name inside the @chooser widget + * + * Return value: %TRUE if the database was found and unselected + * + * Since: 0.10 + */ +gboolean +gdict_database_chooser_unselect_database (GdictDatabaseChooser *chooser, + const gchar *db_name) +{ + GdictDatabaseChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (db_name != NULL, FALSE); + + priv = chooser->priv; + + data.db_name = g_strdup (db_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = FALSE; + data.do_activate = FALSE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_db_name, + &data); + + retval = data.found; + + g_free (data.db_name); + + return retval; +} + +/** + * gdict_database_chooser_set_current_database: + * @chooser: a #GdictDatabaseChooser + * @db_name: the name of the database + * + * Sets @db_name as the current database. This function will select + * and activate the corresponding row, if the database is found. + * + * Return value: %TRUE if the database was found and set + * + * Since: 0.10 + */ +gboolean +gdict_database_chooser_set_current_database (GdictDatabaseChooser *chooser, + const gchar *db_name) +{ + GdictDatabaseChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (db_name != NULL, FALSE); + + priv = chooser->priv; + + data.db_name = g_strdup (db_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = TRUE; + data.do_activate = TRUE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_db_name, + &data); + + retval = data.found; + + if (data.found) + { + g_free (priv->current_db); + priv->current_db = data.db_name; + } + else + g_free (data.db_name); + + return retval; +} + +/** + * gdict_database_chooser_get_current_database: + * @chooser: a #GdictDatabaseChooser + * + * Retrieves the name of the currently selected database inside @chooser + * + * Return value: the name of the selected database. Use g_free() on the + * returned string when done using it + * + * Since: 0.10 + */ +gchar * +gdict_database_chooser_get_current_database (GdictDatabaseChooser *chooser) +{ + GdictDatabaseChooserPrivate *priv; + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + gchar *retval = NULL; + + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), NULL); + + priv = chooser->priv; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return NULL; + + gtk_tree_model_get (model, &iter, DB_COLUMN_NAME, &retval, -1); + + g_free (priv->current_db); + priv->current_db = g_strdup (retval); + + return retval; +} + +/** + * gdict_database_chooser_add_button: + * @chooser: a #GdictDatabase + * @button_text: text of the button + * + * Adds a #GtkButton with @button_text to the button area on + * the bottom of @chooser. The @button_text can also be a + * stock ID. + * + * Return value: the newly packed button. + * + * Since: 0.10 + */ +GtkWidget * +gdict_database_chooser_add_button (GdictDatabaseChooser *chooser, + const gchar *button_text) +{ + GdictDatabaseChooserPrivate *priv; + GtkWidget *button; + + g_return_val_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser), NULL); + g_return_val_if_fail (button_text != NULL, NULL); + + priv = chooser->priv; + + button = gtk_button_new_from_stock (button_text); + + gtk_widget_set_can_default (button, TRUE); + + gtk_widget_show (button); + + gtk_box_pack_end (GTK_BOX (priv->buttons_box), button, FALSE, TRUE, 0); + + return button; +} diff --git a/mate-dictionary/libgdict/gdict-database-chooser.h b/mate-dictionary/libgdict/gdict-database-chooser.h new file mode 100644 index 00000000..c95a23ab --- /dev/null +++ b/mate-dictionary/libgdict/gdict-database-chooser.h @@ -0,0 +1,99 @@ +/* gdict-database-chooser.h - display widget for database names + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_DATABASE_CHOOSER_H__ +#define __GDICT_DATABASE_CHOOSER_H__ + +#include <gtk/gtk.h> +#include "gdict-context.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_DATABASE_CHOOSER (gdict_database_chooser_get_type ()) +#define GDICT_DATABASE_CHOOSER(obj) \ +(G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_DATABASE_CHOOSER, GdictDatabaseChooser)) +#define GDICT_IS_DATABASE_CHOOSER(obj) \ +(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_DATABASE_CHOOSER)) +#define GDICT_DATABASE_CHOOSER_CLASS(klass) \ +(G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_DATABASE_CHOOSER, GdictDatabaseChooserClass)) +#define GDICT_IS_DATABASE_CHOOSER_CLASS(klass) \ +(G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_DATABASE_CHOOSER)) +#define GDICT_DATABASE_CHOOSER_GET_CLASS(obj) \ +(G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_DATABASE_CHOOSER, GdictDatabaseChooserClass)) + +typedef struct _GdictDatabaseChooser GdictDatabaseChooser; +typedef struct _GdictDatabaseChooserPrivate GdictDatabaseChooserPrivate; +typedef struct _GdictDatabaseChooserClass GdictDatabaseChooserClass; + +struct _GdictDatabaseChooser +{ + /*< private >*/ + GtkVBox parent_instance; + + GdictDatabaseChooserPrivate *priv; +}; + +struct _GdictDatabaseChooserClass +{ + /*< private >*/ + GtkVBoxClass parent_class; + + /*< public >*/ + void (*database_activated) (GdictDatabaseChooser *chooser, + const gchar *name, + const gchar *description); + void (*selection_changed) (GdictDatabaseChooser *chooser); + + /*< private >*/ + /* padding for future expansion */ + void (*_gdict_padding2) (void); + void (*_gdict_padding3) (void); + void (*_gdict_padding4) (void); + void (*_gdict_padding5) (void); + void (*_gdict_padding6) (void); +}; + +GType gdict_database_chooser_get_type (void) G_GNUC_CONST; + +GtkWidget * gdict_database_chooser_new (void); +GtkWidget * gdict_database_chooser_new_with_context (GdictContext *context); + +GdictContext *gdict_database_chooser_get_context (GdictDatabaseChooser *chooser); +void gdict_database_chooser_set_context (GdictDatabaseChooser *chooser, + GdictContext *context); +gboolean gdict_database_chooser_select_database (GdictDatabaseChooser *chooser, + const gchar *db_name); +gboolean gdict_database_chooser_unselect_database (GdictDatabaseChooser *chooser, + const gchar *db_name); +gboolean gdict_database_chooser_set_current_database (GdictDatabaseChooser *chooser, + const gchar *db_name); +gchar * gdict_database_chooser_get_current_database (GdictDatabaseChooser *chooser) G_GNUC_MALLOC; +gchar ** gdict_database_chooser_get_databases (GdictDatabaseChooser *chooser, + gsize *length) G_GNUC_MALLOC; +gint gdict_database_chooser_count_databases (GdictDatabaseChooser *chooser); +gboolean gdict_database_chooser_has_database (GdictDatabaseChooser *chooser, + const gchar *database); +void gdict_database_chooser_refresh (GdictDatabaseChooser *chooser); +void gdict_database_chooser_clear (GdictDatabaseChooser *chooser); +GtkWidget * gdict_database_chooser_add_button (GdictDatabaseChooser *chooser, + const gchar *button_text); + +G_END_DECLS + +#endif /* __GDICT_DATABASE_CHOOSER_H__ */ diff --git a/mate-dictionary/libgdict/gdict-debug.h b/mate-dictionary/libgdict/gdict-debug.h new file mode 100644 index 00000000..af234b1f --- /dev/null +++ b/mate-dictionary/libgdict/gdict-debug.h @@ -0,0 +1,55 @@ +/* gdict-debug.h - Debug facilities for Gdict + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_DEBUG_H__ +#define __GDICT_DEBUG_H__ + +#include <glib.h> + +G_BEGIN_DECLS + +typedef enum { + GDICT_DEBUG_MISC = 1 << 0, + GDICT_DEBUG_CONTEXT = 1 << 1, + GDICT_DEBUG_DICT = 1 << 2, + GDICT_DEBUG_SOURCE = 1 << 3, + GDICT_DEBUG_LOADER = 1 << 4, + GDICT_DEBUG_CHOOSER = 1 << 5, + GDICT_DEBUG_DEFBOX = 1 << 6, + GDICT_DEBUG_SPELLER = 1 << 7 +} GdictDebugFlags; + +#ifdef GDICT_ENABLE_DEBUG + +#define GDICT_NOTE(type,x,a...) G_STMT_START { \ + if (gdict_debug_flags & GDICT_DEBUG_##type) { \ + g_message ("[" #type "]: " G_STRLOC ": " x, ##a); \ + } } G_STMT_END + +#else + +#define GDICT_NOTE(type,x,a...) + +#endif /* !GDICT_ENABLE_DEBUG */ + +extern guint gdict_debug_flags; + +G_END_DECLS + +#endif /* __GDICT_DEBUG_H__ */ diff --git a/mate-dictionary/libgdict/gdict-defbox.c b/mate-dictionary/libgdict/gdict-defbox.c new file mode 100644 index 00000000..0b739475 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-defbox.c @@ -0,0 +1,2927 @@ +/* gdict-defbox.c - display widget for dictionary definitions + * + * Copyright (C) 2005-2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-defbox + * @short_description: Display the list of definitions for a word + * + * The #GdictDefbox widget is a composite widget showing the list of + * definitions for a word. It queries the passed #GdictContext and displays + * the list of #GdictDefinition<!-- -->s obtained. + * + * It provides syntax highlighting, clickable links and an embedded find + * bar. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> + +#include <gdk/gdkkeysyms.h> +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +#include "gdict-defbox.h" +#include "gdict-utils.h" +#include "gdict-debug.h" +#include "gdict-private.h" +#include "gdict-enum-types.h" +#include "gdict-marshal.h" + +/** + * G_UNICODE_COMBINING_MARK was deprecated on glib 2.30 + * use G_UNICODE_SPACING_MARK + */ + +#if !GLIB_CHECK_VERSION(2, 29, 14) + #define G_UNICODE_SPACING_MARK G_UNICODE_COMBINING_MARK +#endif + +#define QUERY_MARGIN 48 +#define ERROR_MARGIN 24 + +typedef struct +{ + GdictDefinition *definition; + + gint begin; +} Definition; + +#define GDICT_DEFBOX_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_DEFBOX, GdictDefboxPrivate)) + +struct _GdictDefboxPrivate +{ + GtkWidget *text_view; + + /* the "find" pane */ + GtkWidget *find_pane; + GtkWidget *find_entry; + GtkWidget *find_next; + GtkWidget *find_prev; + GtkWidget *find_label; + + GtkWidget *progress_dialog; + + GtkTextBuffer *buffer; + + GdictContext *context; + GSList *definitions; + + gchar *word; + gchar *database; + gchar *font_name; + + guint show_find : 1; + guint is_searching : 1; + guint is_hovering : 1; + + GdkCursor *busy_cursor; + GdkCursor *hand_cursor; + GdkCursor *regular_cursor; + + guint start_id; + guint end_id; + guint define_id; + guint error_id; + guint hide_timeout; + + GtkTextTag *link_tag; + GtkTextTag *visited_link_tag; +}; + +enum +{ + PROP_0, + + PROP_CONTEXT, + PROP_WORD, + PROP_DATABASE, + PROP_FONT_NAME, + PROP_COUNT +}; + +enum +{ + SHOW_FIND, + HIDE_FIND, + FIND_NEXT, + FIND_PREVIOUS, + LINK_CLICKED, + + LAST_SIGNAL +}; + +static guint gdict_defbox_signals[LAST_SIGNAL] = { 0 }; +static GdkColor default_link_color = { 0, 0, 0, 0xeeee }; +static GdkColor default_visited_link_color = { 0, 0x5555, 0x1a1a, 0x8b8b }; + + +G_DEFINE_TYPE (GdictDefbox, gdict_defbox, GTK_TYPE_VBOX); + + +static Definition * +definition_new (void) +{ + Definition *def; + + def = g_slice_new (Definition); + def->definition = NULL; + def->begin = -1; + + return def; +} + +static void +definition_free (Definition *def) +{ + if (!def) + return; + + gdict_definition_unref (def->definition); + g_slice_free (Definition, def); +} + +static void +gdict_defbox_dispose (GObject *gobject) +{ + GdictDefbox *defbox = GDICT_DEFBOX (gobject); + GdictDefboxPrivate *priv = defbox->priv; + + if (priv->start_id) + { + g_signal_handler_disconnect (priv->context, priv->start_id); + g_signal_handler_disconnect (priv->context, priv->end_id); + g_signal_handler_disconnect (priv->context, priv->define_id); + + priv->start_id = 0; + priv->end_id = 0; + priv->define_id = 0; + } + + if (priv->error_id) + { + g_signal_handler_disconnect (priv->context, priv->error_id); + priv->error_id = 0; + } + + if (priv->context) + { + g_object_unref (priv->context); + priv->context = NULL; + } + + if (priv->buffer) + { + g_object_unref (priv->buffer); + priv->buffer = NULL; + } + + if (priv->busy_cursor) + { + gdk_cursor_unref (priv->busy_cursor); + priv->busy_cursor = NULL; + } + + if (priv->hand_cursor) + { + gdk_cursor_unref (priv->hand_cursor); + priv->hand_cursor = NULL; + } + + if (priv->regular_cursor) + { + gdk_cursor_unref (priv->regular_cursor); + priv->regular_cursor = NULL; + } + + G_OBJECT_CLASS (gdict_defbox_parent_class)->dispose (gobject); +} + +static void +gdict_defbox_finalize (GObject *object) +{ + GdictDefbox *defbox = GDICT_DEFBOX (object); + GdictDefboxPrivate *priv = defbox->priv; + + g_free (priv->database); + g_free (priv->word); + g_free (priv->font_name); + + if (priv->definitions) + { + g_slist_foreach (priv->definitions, (GFunc) definition_free, NULL); + g_slist_free (priv->definitions); + + priv->definitions = NULL; + } + + G_OBJECT_CLASS (gdict_defbox_parent_class)->finalize (object); +} + +static void +set_gdict_context (GdictDefbox *defbox, + GdictContext *context) +{ + GdictDefboxPrivate *priv; + + g_assert (GDICT_IS_DEFBOX (defbox)); + + priv = defbox->priv; + if (priv->context) + { + if (priv->start_id) + { + GDICT_NOTE (DEFBOX, "Removing old context handlers"); + + g_signal_handler_disconnect (priv->context, priv->start_id); + g_signal_handler_disconnect (priv->context, priv->define_id); + g_signal_handler_disconnect (priv->context, priv->end_id); + + priv->start_id = 0; + priv->end_id = 0; + priv->define_id = 0; + } + + if (priv->error_id) + { + g_signal_handler_disconnect (priv->context, priv->error_id); + + priv->error_id = 0; + } + + GDICT_NOTE (DEFBOX, "Removing old context"); + + g_object_unref (G_OBJECT (priv->context)); + } + + if (!context) + return; + + if (!GDICT_IS_CONTEXT (context)) + { + g_warning ("Object of type '%s' instead of a GdictContext\n", + g_type_name (G_OBJECT_TYPE (context))); + return; + } + + GDICT_NOTE (DEFBOX, "Setting new context"); + + priv->context = context; + g_object_ref (G_OBJECT (priv->context)); +} + +static void +gdict_defbox_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictDefbox *defbox = GDICT_DEFBOX (object); + GdictDefboxPrivate *priv = defbox->priv; + + switch (prop_id) + { + case PROP_WORD: + gdict_defbox_lookup (defbox, g_value_get_string (value)); + break; + case PROP_CONTEXT: + set_gdict_context (defbox, g_value_get_object (value)); + break; + case PROP_DATABASE: + g_free (priv->database); + priv->database = g_strdup (g_value_get_string (value)); + break; + case PROP_FONT_NAME: + gdict_defbox_set_font_name (defbox, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_defbox_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictDefbox *defbox = GDICT_DEFBOX (object); + GdictDefboxPrivate *priv = defbox->priv; + + switch (prop_id) + { + case PROP_WORD: + g_value_set_string (value, priv->word); + break; + case PROP_CONTEXT: + g_value_set_object (value, priv->context); + break; + case PROP_DATABASE: + g_value_set_string (value, priv->database); + break; + case PROP_FONT_NAME: + g_value_set_string (value, priv->font_name); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +/* + * this code has been copied from gtksourceview; it's the implementation + * for case-insensitive search in a GtkTextBuffer. this is non-trivial, as + * searches on a utf-8 text stream involve a norm(casefold(norm(utf8))) + * operation which can be costly on large buffers. luckily for us, it's + * not the case on a set of definitions. + */ + +#define GTK_TEXT_UNKNOWN_CHAR 0xFFFC + +/* this function acts like g_utf8_offset_to_pointer() except that if it finds a + * decomposable character it consumes the decomposition length from the given + * offset. So it's useful when the offset was calculated for the normalized + * version of str, but we need a pointer to str itself. */ +static const gchar * +pointer_from_offset_skipping_decomp (const gchar *str, gint offset) +{ + gchar *casefold, *normal; + const gchar *p, *q; + + p = str; + while (offset > 0) + { + q = g_utf8_next_char (p); + casefold = g_utf8_casefold (p, q - p); + normal = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD); + offset -= g_utf8_strlen (normal, -1); + g_free (casefold); + g_free (normal); + p = q; + } + return p; +} + +static gboolean +exact_prefix_cmp (const gchar *string, + const gchar *prefix, + guint prefix_len) +{ + GUnicodeType type; + + if (strncmp (string, prefix, prefix_len) != 0) + return FALSE; + if (string[prefix_len] == '\0') + return TRUE; + + type = g_unichar_type (g_utf8_get_char (string + prefix_len)); + + /* If string contains prefix, check that prefix is not followed + * by a unicode mark symbol, e.g. that trailing 'a' in prefix + * is not part of two-char a-with-hat symbol in string. */ + return type != G_UNICODE_SPACING_MARK && + type != G_UNICODE_ENCLOSING_MARK && + type != G_UNICODE_NON_SPACING_MARK; +} + +static const gchar * +utf8_strcasestr (const gchar *haystack, const gchar *needle) +{ + gsize needle_len; + gsize haystack_len; + const gchar *ret = NULL; + gchar *p; + gchar *casefold; + gchar *caseless_haystack; + gint i; + + g_return_val_if_fail (haystack != NULL, NULL); + g_return_val_if_fail (needle != NULL, NULL); + + casefold = g_utf8_casefold (haystack, -1); + caseless_haystack = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD); + g_free (casefold); + + needle_len = g_utf8_strlen (needle, -1); + haystack_len = g_utf8_strlen (caseless_haystack, -1); + + if (needle_len == 0) + { + ret = (gchar *)haystack; + goto finally_1; + } + + if (haystack_len < needle_len) + { + ret = NULL; + goto finally_1; + } + + p = (gchar*)caseless_haystack; + needle_len = strlen (needle); + i = 0; + + while (*p) + { + if (exact_prefix_cmp (p, needle, needle_len)) + { + ret = pointer_from_offset_skipping_decomp (haystack, i); + goto finally_1; + } + + p = g_utf8_next_char (p); + i++; + } + +finally_1: + g_free (caseless_haystack); + + return ret; +} + +static const gchar * +utf8_strrcasestr (const gchar *haystack, const gchar *needle) +{ + gsize needle_len; + gsize haystack_len; + const gchar *ret = NULL; + gchar *p; + gchar *casefold; + gchar *caseless_haystack; + gint i; + + g_return_val_if_fail (haystack != NULL, NULL); + g_return_val_if_fail (needle != NULL, NULL); + + casefold = g_utf8_casefold (haystack, -1); + caseless_haystack = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD); + g_free (casefold); + + needle_len = g_utf8_strlen (needle, -1); + haystack_len = g_utf8_strlen (caseless_haystack, -1); + + if (needle_len == 0) + { + ret = (gchar *)haystack; + goto finally_1; + } + + if (haystack_len < needle_len) + { + ret = NULL; + goto finally_1; + } + + i = haystack_len - needle_len; + p = g_utf8_offset_to_pointer (caseless_haystack, i); + needle_len = strlen (needle); + + while (p >= caseless_haystack) + { + if (exact_prefix_cmp (p, needle, needle_len)) + { + ret = pointer_from_offset_skipping_decomp (haystack, i); + goto finally_1; + } + + p = g_utf8_prev_char (p); + i--; + } + +finally_1: + g_free (caseless_haystack); + + return ret; +} + +static gboolean +utf8_caselessnmatch (const char *s1, const char *s2, + gssize n1, gssize n2) +{ + gchar *casefold; + gchar *normalized_s1; + gchar *normalized_s2; + gint len_s1; + gint len_s2; + gboolean ret = FALSE; + + g_return_val_if_fail (s1 != NULL, FALSE); + g_return_val_if_fail (s2 != NULL, FALSE); + g_return_val_if_fail (n1 > 0, FALSE); + g_return_val_if_fail (n2 > 0, FALSE); + + casefold = g_utf8_casefold (s1, n1); + normalized_s1 = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD); + g_free (casefold); + + casefold = g_utf8_casefold (s2, n2); + normalized_s2 = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD); + g_free (casefold); + + len_s1 = strlen (normalized_s1); + len_s2 = strlen (normalized_s2); + + if (len_s1 < len_s2) + goto finally_2; + + ret = (strncmp (normalized_s1, normalized_s2, len_s2) == 0); + +finally_2: + g_free (normalized_s1); + g_free (normalized_s2); + + return ret; +} + +/* FIXME: total horror */ +static gboolean +char_is_invisible (const GtkTextIter *iter) +{ + GSList *tags; + gboolean invisible = FALSE; + tags = gtk_text_iter_get_tags (iter); + while (tags) + { + gboolean this_invisible, invisible_set; + g_object_get (tags->data, "invisible", &this_invisible, + "invisible-set", &invisible_set, NULL); + if (invisible_set) + invisible = this_invisible; + tags = g_slist_delete_link (tags, tags); + } + return invisible; +} + +static void +forward_chars_with_skipping (GtkTextIter *iter, + gint count, + gboolean skip_invisible, + gboolean skip_nontext, + gboolean skip_decomp) +{ + gint i; + + g_return_if_fail (count >= 0); + + i = count; + + while (i > 0) + { + gboolean ignored = FALSE; + + /* minimal workaround to avoid the infinite loop of bug #168247. + * It doesn't fix the problemjust the symptom... + */ + if (gtk_text_iter_is_end (iter)) + return; + + if (skip_nontext && gtk_text_iter_get_char (iter) == GTK_TEXT_UNKNOWN_CHAR) + ignored = TRUE; + + /* FIXME: char_is_invisible() gets list of tags for each char there, + and checks every tag. It doesn't sound like a good idea. */ + if (!ignored && skip_invisible && char_is_invisible (iter)) + ignored = TRUE; + + if (!ignored && skip_decomp) + { + /* being UTF8 correct sucks; this accounts for extra + offsets coming from canonical decompositions of + UTF8 characters (e.g. accented characters) which + g_utf8_normalize() performs */ + gchar *normal; + gchar buffer[6]; + gint buffer_len; + + buffer_len = g_unichar_to_utf8 (gtk_text_iter_get_char (iter), buffer); + normal = g_utf8_normalize (buffer, buffer_len, G_NORMALIZE_NFD); + i -= (g_utf8_strlen (normal, -1) - 1); + g_free (normal); + } + + gtk_text_iter_forward_char (iter); + + if (!ignored) + --i; + } +} + +static gboolean +lines_match (const GtkTextIter *start, + const gchar **lines, + gboolean visible_only, + gboolean slice, + GtkTextIter *match_start, + GtkTextIter *match_end) +{ + GtkTextIter next; + gchar *line_text; + const gchar *found; + gint offset; + + if (*lines == NULL || **lines == '\0') + { + if (match_start) + *match_start = *start; + if (match_end) + *match_end = *start; + return TRUE; + } + + next = *start; + gtk_text_iter_forward_line (&next); + + /* No more text in buffer, but *lines is nonempty */ + if (gtk_text_iter_equal (start, &next)) + return FALSE; + + if (slice) + { + if (visible_only) + line_text = gtk_text_iter_get_visible_slice (start, &next); + else + line_text = gtk_text_iter_get_slice (start, &next); + } + else + { + if (visible_only) + line_text = gtk_text_iter_get_visible_text (start, &next); + else + line_text = gtk_text_iter_get_text (start, &next); + } + + if (match_start) /* if this is the first line we're matching */ + { + found = utf8_strcasestr (line_text, *lines); + } + else + { + /* If it's not the first line, we have to match from the + * start of the line. + */ + if (utf8_caselessnmatch (line_text, *lines, strlen (line_text), + strlen (*lines))) + found = line_text; + else + found = NULL; + } + + if (found == NULL) + { + g_free (line_text); + return FALSE; + } + + /* Get offset to start of search string */ + offset = g_utf8_strlen (line_text, found - line_text); + + next = *start; + + /* If match start needs to be returned, set it to the + * start of the search string. + */ + forward_chars_with_skipping (&next, offset, visible_only, !slice, FALSE); + if (match_start) + { + *match_start = next; + } + + /* Go to end of search string */ + forward_chars_with_skipping (&next, g_utf8_strlen (*lines, -1), visible_only, !slice, TRUE); + + g_free (line_text); + + ++lines; + + if (match_end) + *match_end = next; + + /* pass NULL for match_start, since we don't need to find the + * start again. + */ + return lines_match (&next, lines, visible_only, slice, NULL, match_end); +} + +static gboolean +backward_lines_match (const GtkTextIter *start, + const gchar **lines, + gboolean visible_only, + gboolean slice, + GtkTextIter *match_start, + GtkTextIter *match_end) +{ + GtkTextIter line, next; + gchar *line_text; + const gchar *found; + gint offset; + + if (*lines == NULL || **lines == '\0') + { + if (match_start) + *match_start = *start; + if (match_end) + *match_end = *start; + return TRUE; + } + + line = next = *start; + if (gtk_text_iter_get_line_offset (&next) == 0) + { + if (!gtk_text_iter_backward_line (&next)) + return FALSE; + } + else + gtk_text_iter_set_line_offset (&next, 0); + + if (slice) + { + if (visible_only) + line_text = gtk_text_iter_get_visible_slice (&next, &line); + else + line_text = gtk_text_iter_get_slice (&next, &line); + } + else + { + if (visible_only) + line_text = gtk_text_iter_get_visible_text (&next, &line); + else + line_text = gtk_text_iter_get_text (&next, &line); + } + + if (match_start) /* if this is the first line we're matching */ + { + found = utf8_strrcasestr (line_text, *lines); + } + else + { + /* If it's not the first line, we have to match from the + * start of the line. + */ + if (utf8_caselessnmatch (line_text, *lines, strlen (line_text), + strlen (*lines))) + found = line_text; + else + found = NULL; + } + + if (found == NULL) + { + g_free (line_text); + return FALSE; + } + + /* Get offset to start of search string */ + offset = g_utf8_strlen (line_text, found - line_text); + + forward_chars_with_skipping (&next, offset, visible_only, !slice, FALSE); + + /* If match start needs to be returned, set it to the + * start of the search string. + */ + if (match_start) + { + *match_start = next; + } + + /* Go to end of search string */ + forward_chars_with_skipping (&next, g_utf8_strlen (*lines, -1), visible_only, !slice, TRUE); + + g_free (line_text); + + ++lines; + + if (match_end) + *match_end = next; + + /* try to match the rest of the lines forward, passing NULL + * for match_start so lines_match will try to match the entire + * line */ + return lines_match (&next, lines, visible_only, + slice, NULL, match_end); +} + +/* strsplit () that retains the delimiter as part of the string. */ +static gchar ** +breakup_string (const char *string, + const char *delimiter, + gint max_tokens) +{ + GSList *string_list = NULL, *slist; + gchar **str_array, *s, *casefold, *new_string; + guint i, n = 1; + + g_return_val_if_fail (string != NULL, NULL); + g_return_val_if_fail (delimiter != NULL, NULL); + + if (max_tokens < 1) + max_tokens = G_MAXINT; + + s = strstr (string, delimiter); + if (s) + { + guint delimiter_len = strlen (delimiter); + + do + { + guint len; + + len = s - string + delimiter_len; + new_string = g_new (gchar, len + 1); + strncpy (new_string, string, len); + new_string[len] = 0; + casefold = g_utf8_casefold (new_string, -1); + g_free (new_string); + new_string = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD); + g_free (casefold); + string_list = g_slist_prepend (string_list, new_string); + n++; + string = s + delimiter_len; + s = strstr (string, delimiter); + } while (--max_tokens && s); + } + + if (*string) + { + n++; + casefold = g_utf8_casefold (string, -1); + new_string = g_utf8_normalize (casefold, -1, G_NORMALIZE_NFD); + g_free (casefold); + string_list = g_slist_prepend (string_list, new_string); + } + + str_array = g_new (gchar*, n); + + i = n - 1; + + str_array[i--] = NULL; + for (slist = string_list; slist; slist = slist->next) + str_array[i--] = slist->data; + + g_slist_free (string_list); + + return str_array; +} + +static gboolean +gdict_defbox_iter_forward_search (const GtkTextIter *iter, + const gchar *str, + GtkTextIter *match_start, + GtkTextIter *match_end, + const GtkTextIter *limit) +{ + gchar **lines = NULL; + GtkTextIter match; + gboolean retval = FALSE; + GtkTextIter search; + + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (str != NULL, FALSE); + + if (limit && gtk_text_iter_compare (iter, limit) >= 0) + return FALSE; + + if (*str == '\0') + { + /* If we can move one char, return the empty string there */ + match = *iter; + + if (gtk_text_iter_forward_char (&match)) + { + if (limit && gtk_text_iter_equal (&match, limit)) + return FALSE; + + if (match_start) + *match_start = match; + + if (match_end) + *match_end = match; + + return TRUE; + } + else + return FALSE; + } + + /* locate all lines */ + lines = breakup_string (str, "\n", -1); + + search = *iter; + + /* This loop has an inefficient worst-case, where + * gtk_text_iter_get_text () is called repeatedly on + * a single line. + */ + do + { + GtkTextIter end; + gboolean res; + + if (limit && gtk_text_iter_compare (&search, limit) >= 0) + break; + + res = lines_match (&search, (const gchar**)lines, + TRUE, FALSE, + &match, &end); + if (res) + { + if (limit == NULL || + (limit && gtk_text_iter_compare (&end, limit) <= 0)) + { + retval = TRUE; + + if (match_start) + *match_start = match; + + if (match_end) + *match_end = end; + } + + break; + } + } while (gtk_text_iter_forward_line (&search)); + + g_strfreev ((gchar**) lines); + + return retval; +} + +static gboolean +gdict_defbox_iter_backward_search (const GtkTextIter *iter, + const gchar *str, + GtkTextIter *match_start, + GtkTextIter *match_end, + const GtkTextIter *limit) +{ + gchar **lines = NULL; + GtkTextIter match; + gboolean retval = FALSE; + GtkTextIter search; + + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (str != NULL, FALSE); + + if (limit && gtk_text_iter_compare (iter, limit) <= 0) + return FALSE; + + if (*str == '\0') + { + /* If we can move one char, return the empty string there */ + match = *iter; + + if (gtk_text_iter_backward_char (&match)) + { + if (limit && gtk_text_iter_equal (&match, limit)) + return FALSE; + + if (match_start) + *match_start = match; + + if (match_end) + *match_end = match; + + return TRUE; + } + else + return FALSE; + } + + /* locate all lines */ + lines = breakup_string (str, "\n", -1); + + search = *iter; + + /* This loop has an inefficient worst-case, where + * gtk_text_iter_get_text () is called repeatedly on + * a single line. + */ + while (TRUE) + { + GtkTextIter end; + gboolean res; + + if (limit && gtk_text_iter_compare (&search, limit) <= 0) + break; + + res = backward_lines_match (&search, (const gchar**)lines, + TRUE, FALSE, + &match, &end); + if (res) + { + if (limit == NULL || + (limit && gtk_text_iter_compare (&end, limit) > 0)) + { + retval = TRUE; + + if (match_start) + *match_start = match; + + if (match_end) + *match_end = end; + + } + + break; + } + + if (gtk_text_iter_get_line_offset (&search) == 0) + { + if (!gtk_text_iter_backward_line (&search)) + break; + } + else + gtk_text_iter_set_line_offset (&search, 0); + } + + g_strfreev ((gchar**) lines); + + return retval; +} + +static gboolean +gdict_defbox_find_backward (GdictDefbox *defbox, + const gchar *text) +{ + GdictDefboxPrivate *priv = defbox->priv; + GtkTextIter start_iter, end_iter; + GtkTextIter match_start, match_end; + GtkTextIter iter; + GtkTextMark *last_search; + gboolean res; + + g_assert (GTK_IS_TEXT_BUFFER (priv->buffer)); + + gtk_text_buffer_get_bounds (priv->buffer, &start_iter, &end_iter); + + /* if there already has been another result, begin from there */ + last_search = gtk_text_buffer_get_mark (priv->buffer, "last-search-prev"); + if (last_search) + gtk_text_buffer_get_iter_at_mark (priv->buffer, &iter, last_search); + else + iter = end_iter; + + res = gdict_defbox_iter_backward_search (&iter, text, + &match_start, &match_end, + NULL); + if (res) + { + gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (priv->text_view), + &match_start, + 0.0, + TRUE, + 0.0, 0.0); + gtk_text_buffer_place_cursor (priv->buffer, &match_end); + gtk_text_buffer_move_mark (priv->buffer, + gtk_text_buffer_get_mark (priv->buffer, "selection_bound"), + &match_start); + gtk_text_buffer_create_mark (priv->buffer, "last-search-prev", &match_start, FALSE); + gtk_text_buffer_create_mark (priv->buffer, "last-search-next", &match_end, FALSE); + + return TRUE; + } + + return FALSE; +} + +static gboolean +hide_find_pane (gpointer user_data) +{ + GdictDefbox *defbox = user_data; + + gtk_widget_hide (defbox->priv->find_pane); + defbox->priv->show_find = FALSE; + + gtk_widget_grab_focus (defbox->priv->text_view); + + defbox->priv->hide_timeout = 0; + + return FALSE; +} + +static void +find_prev_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictDefbox *defbox = GDICT_DEFBOX (user_data); + GdictDefboxPrivate *priv = defbox->priv; + const gchar *text; + gboolean found; + + gtk_widget_hide (priv->find_label); + + text = gtk_entry_get_text (GTK_ENTRY (priv->find_entry)); + if (!text) + return; + + found = gdict_defbox_find_backward (defbox, text); + if (!found) + { + gchar *str; + + str = g_strconcat (" <i>", _("Not found"), "</i>", NULL); + gtk_label_set_markup (GTK_LABEL (priv->find_label), str); + gtk_widget_show (priv->find_label); + + g_free (str); + } + + if (priv->hide_timeout) + { + g_source_remove (priv->hide_timeout); + priv->hide_timeout = g_timeout_add (5000, hide_find_pane, defbox); + } +} + +static gboolean +gdict_defbox_find_forward (GdictDefbox *defbox, + const gchar *text, + gboolean is_typing) +{ + GdictDefboxPrivate *priv = defbox->priv; + GtkTextIter start_iter, end_iter; + GtkTextIter match_start, match_end; + GtkTextIter iter; + GtkTextMark *last_search; + gboolean res; + + g_assert (GTK_IS_TEXT_BUFFER (priv->buffer)); + + gtk_text_buffer_get_bounds (priv->buffer, &start_iter, &end_iter); + + if (!is_typing) + { + /* if there already has been another result, begin from there */ + last_search = gtk_text_buffer_get_mark (priv->buffer, "last-search-next"); + + if (last_search) + gtk_text_buffer_get_iter_at_mark (priv->buffer, &iter, last_search); + else + iter = start_iter; + } + else + { + last_search = gtk_text_buffer_get_mark (priv->buffer, "last-search-prev"); + + if (last_search) + gtk_text_buffer_get_iter_at_mark (priv->buffer, &iter, last_search); + else + iter = start_iter; + } + + res = gdict_defbox_iter_forward_search (&iter, text, + &match_start, + &match_end, + NULL); + if (res) + { + gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (priv->text_view), + &match_start, + 0.0, + TRUE, + 0.0, 0.0); + gtk_text_buffer_place_cursor (priv->buffer, &match_end); + gtk_text_buffer_move_mark (priv->buffer, + gtk_text_buffer_get_mark (priv->buffer, "selection_bound"), + &match_start); + gtk_text_buffer_create_mark (priv->buffer, "last-search-prev", &match_start, FALSE); + gtk_text_buffer_create_mark (priv->buffer, "last-search-next", &match_end, FALSE); + + return TRUE; + } + + return FALSE; +} + +static void +find_next_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictDefbox *defbox = GDICT_DEFBOX (user_data); + GdictDefboxPrivate *priv = defbox->priv; + const gchar *text; + gboolean found; + + gtk_widget_hide (priv->find_label); + + text = gtk_entry_get_text (GTK_ENTRY (priv->find_entry)); + if (!text) + return; + + found = gdict_defbox_find_forward (defbox, text, FALSE); + if (!found) + { + gchar *str; + + str = g_strconcat (" <i>", _("Not found"), "</i>", NULL); + gtk_label_set_markup (GTK_LABEL (priv->find_label), str); + gtk_widget_show (priv->find_label); + + g_free (str); + } + + if (priv->hide_timeout) + { + g_source_remove (priv->hide_timeout); + priv->hide_timeout = g_timeout_add (5000, hide_find_pane, defbox); + } +} + +static void +find_entry_changed_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictDefbox *defbox = GDICT_DEFBOX (user_data); + GdictDefboxPrivate *priv = defbox->priv; + gchar *text; + gboolean found; + + gtk_widget_hide (priv->find_label); + + text = gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); + if (!text) + return; + + found = gdict_defbox_find_forward (defbox, text, TRUE); + if (!found) + { + gchar *str; + + str = g_strconcat (" <i>", _("Not found"), "</i>", NULL); + gtk_label_set_markup (GTK_LABEL (priv->find_label), str); + gtk_widget_show (priv->find_label); + + g_free (str); + } + + g_free (text); + + if (priv->hide_timeout) + { + g_source_remove (priv->hide_timeout); + priv->hide_timeout = g_timeout_add (5000, hide_find_pane, defbox); + } +} + +static void +close_button_clicked (GtkButton *button, + gpointer data) +{ + GdictDefboxPrivate *priv = GDICT_DEFBOX (data)->priv; + + if (priv->hide_timeout) + g_source_remove (priv->hide_timeout); + + (void) hide_find_pane (data); +} + +static GtkWidget * +create_find_pane (GdictDefbox *defbox) +{ + GdictDefboxPrivate *priv; + GtkWidget *find_pane; + GtkWidget *label; + GtkWidget *sep; + GtkWidget *hbox1, *hbox2; + GtkWidget *button; + + priv = defbox->priv; + + find_pane = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (find_pane), 0); + + hbox1 = gtk_hbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX (find_pane), hbox1, TRUE, TRUE, 0); + gtk_widget_show (hbox1); + + button = gtk_button_new (); + gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_stock (GTK_STOCK_CLOSE, + GTK_ICON_SIZE_BUTTON)); + g_signal_connect (button, "clicked", + G_CALLBACK (close_button_clicked), defbox); + gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + hbox2 = gtk_hbox_new (FALSE, 12); + gtk_box_pack_start (GTK_BOX (hbox1), hbox2, TRUE, TRUE, 0); + gtk_widget_show (hbox2); + + label = gtk_label_new_with_mnemonic (_("F_ind:")); + gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0); + + priv->find_entry = gtk_entry_new (); + g_signal_connect (priv->find_entry, "changed", + G_CALLBACK (find_entry_changed_cb), defbox); + gtk_box_pack_start (GTK_BOX (hbox2), priv->find_entry, TRUE, TRUE, 0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->find_entry); + + sep = gtk_vseparator_new (); + gtk_box_pack_start (GTK_BOX (hbox1), sep, FALSE, FALSE, 0); + gtk_widget_show (sep); + + priv->find_prev = gtk_button_new_with_mnemonic (_("_Previous")); + gtk_button_set_image (GTK_BUTTON (priv->find_prev), + gtk_image_new_from_stock (GTK_STOCK_GO_BACK, + GTK_ICON_SIZE_MENU)); + g_signal_connect (priv->find_prev, "clicked", + G_CALLBACK (find_prev_clicked_cb), defbox); + gtk_box_pack_start (GTK_BOX (hbox1), priv->find_prev, FALSE, FALSE, 0); + + priv->find_next = gtk_button_new_with_mnemonic (_("_Next")); + gtk_button_set_image (GTK_BUTTON (priv->find_next), + gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, + GTK_ICON_SIZE_MENU)); + g_signal_connect (priv->find_next, "clicked", + G_CALLBACK (find_next_clicked_cb), defbox); + gtk_box_pack_start (GTK_BOX (hbox1), priv->find_next, FALSE, FALSE, 0); + + priv->find_label = gtk_label_new (NULL); + gtk_label_set_use_markup (GTK_LABEL (priv->find_label), TRUE); + gtk_box_pack_end (GTK_BOX (find_pane), priv->find_label, FALSE, FALSE, 0); + gtk_widget_hide (priv->find_label); + + return find_pane; +} + +static void +gdict_defbox_init_tags (GdictDefbox *defbox) +{ + GdictDefboxPrivate *priv = defbox->priv; + GdkColor *link_color, *visited_link_color; + + g_assert (GTK_IS_TEXT_BUFFER (priv->buffer)); + + gtk_text_buffer_create_tag (priv->buffer, "italic", + "style", PANGO_STYLE_ITALIC, + NULL); + gtk_text_buffer_create_tag (priv->buffer, "bold", + "weight", PANGO_WEIGHT_BOLD, + NULL); + gtk_text_buffer_create_tag (priv->buffer, "underline", + "underline", PANGO_UNDERLINE_SINGLE, + NULL); + + gtk_text_buffer_create_tag (priv->buffer, "big", + "scale", 1.6, + NULL); + gtk_text_buffer_create_tag (priv->buffer, "small", + "scale", PANGO_SCALE_SMALL, + NULL); + + link_color = visited_link_color = NULL; + gtk_widget_style_get (GTK_WIDGET (defbox), + "link-color", &link_color, + "visited-link-color", &visited_link_color, + NULL); + if (!link_color) + link_color = &default_link_color; + + if (!visited_link_color) + visited_link_color = &default_visited_link_color; + + priv->link_tag = + gtk_text_buffer_create_tag (priv->buffer, "link", + "underline", PANGO_UNDERLINE_SINGLE, + "foreground-gdk", link_color, + NULL); + priv->visited_link_tag = + gtk_text_buffer_create_tag (priv->buffer, "visited-link", + "underline", PANGO_UNDERLINE_SINGLE, + "foreground-gdk", visited_link_color, + NULL); + + if (link_color != &default_link_color) + gdk_color_free (link_color); + + if (visited_link_color != &default_visited_link_color) + gdk_color_free (visited_link_color); + + gtk_text_buffer_create_tag (priv->buffer, "phonetic", + "foreground", "dark gray", + NULL); + + gtk_text_buffer_create_tag (priv->buffer, "query-title", + "left-margin", QUERY_MARGIN, + "pixels-above-lines", 5, + "pixels-below-lines", 20, + NULL); + gtk_text_buffer_create_tag (priv->buffer, "query-from", + "foreground", "dark gray", + "scale", PANGO_SCALE_SMALL, + "left-margin", QUERY_MARGIN, + "pixels-above-lines", 5, + "pixels-below-lines", 10, + NULL); + + gtk_text_buffer_create_tag (priv->buffer, "error-title", + "foreground", "dark red", + "left-margin", ERROR_MARGIN, + NULL); + gtk_text_buffer_create_tag (priv->buffer, "error-message", + "left-margin", ERROR_MARGIN, + NULL); +} + +static void +follow_if_is_link (GdictDefbox *defbox, + GtkTextView *text_view, + GtkTextIter *iter) +{ + GSList *tags, *l; + + tags = gtk_text_iter_get_tags (iter); + + for (l = tags; l != NULL; l = l->next) + { + GtkTextTag *tag = l->data; + gchar *name; + + g_object_get (G_OBJECT (tag), "name", &name, NULL); + if (name && + (strcmp (name, "link") == 0 || + strcmp (name, "visited-link") == 0)) + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer (text_view); + GtkTextIter start, end; + gchar *link_str; + + start = *iter; + end = *iter; + + gtk_text_iter_backward_to_tag_toggle (&start, tag); + gtk_text_iter_forward_to_tag_toggle (&end, tag); + + link_str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); + + g_signal_emit (defbox, gdict_defbox_signals[LINK_CLICKED], 0, link_str); + + g_free (link_str); + g_free (name); + + break; + } + + g_free (name); + } + + g_slist_free (tags); +} + +static gboolean +defbox_event_after_cb (GtkWidget *text_view, + GdkEvent *event, + GdictDefbox *defbox) +{ + GtkTextIter iter; + GtkTextBuffer *buffer; + GdkEventButton *button_event; + gint bx, by; + + if (event->type != GDK_BUTTON_RELEASE) + return FALSE; + + button_event = (GdkEventButton *) event; + + if (button_event->button != 1) + return FALSE; + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); + if (gtk_text_buffer_get_has_selection (buffer)) + return FALSE; + + gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), + GTK_TEXT_WINDOW_WIDGET, + button_event->x, button_event->y, + &bx, &by); + + gtk_text_view_get_iter_at_location (GTK_TEXT_VIEW (text_view), + &iter, + bx, by); + + follow_if_is_link (defbox, GTK_TEXT_VIEW (text_view), &iter); + + return FALSE; +} + +static void +set_cursor_if_appropriate (GdictDefbox *defbox, + GtkTextView *text_view, + gint x, + gint y) +{ + GdictDefboxPrivate *priv; + GSList *tags, *l; + GtkTextIter iter; + gboolean hovering = FALSE; + + priv = defbox->priv; + + if (!priv->hand_cursor) + priv->hand_cursor = gdk_cursor_new (GDK_HAND2); + + if (!priv->regular_cursor) + priv->regular_cursor = gdk_cursor_new (GDK_XTERM); + + gtk_text_view_get_iter_at_location (text_view, &iter, x, y); + + tags = gtk_text_iter_get_tags (&iter); + for (l = tags; l != NULL; l = l->next) + { + GtkTextTag *tag = l->data; + gchar *name; + + g_object_get (G_OBJECT (tag), "name", &name, NULL); + if (name && + (strcmp (name, "link") == 0 || + strcmp (name, "visited-link") == 0)) + { + hovering = TRUE; + g_free (name); + + break; + } + + g_free (name); + } + + if (hovering != defbox->priv->is_hovering) + { + defbox->priv->is_hovering = hovering; + + if (defbox->priv->is_hovering) + gdk_window_set_cursor (gtk_text_view_get_window (text_view, + GTK_TEXT_WINDOW_TEXT), + defbox->priv->hand_cursor); + else + gdk_window_set_cursor (gtk_text_view_get_window (text_view, + GTK_TEXT_WINDOW_TEXT), + defbox->priv->regular_cursor); + } + + if (tags) + g_slist_free (tags); +} + +static gboolean +defbox_motion_notify_cb (GtkWidget *text_view, + GdkEventMotion *event, + GdictDefbox *defbox) +{ + gint bx, by; + + gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), + GTK_TEXT_WINDOW_WIDGET, + event->x, event->y, + &bx, &by); + + set_cursor_if_appropriate (defbox, GTK_TEXT_VIEW (text_view), bx, by); + + gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL); + + return FALSE; +} + +static gboolean +defbox_visibility_notify_cb (GtkWidget *text_view, + GdkEventVisibility *event, + GdictDefbox *defbox) +{ + gint wx, wy; + gint bx, by; + + gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL); + + gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), + GTK_TEXT_WINDOW_WIDGET, + wx, wy, + &bx, &by); + + set_cursor_if_appropriate (defbox, GTK_TEXT_VIEW (text_view), bx, by); + + return FALSE; +} + +static GObject * +gdict_defbox_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_params) +{ + GdictDefbox *defbox; + GdictDefboxPrivate *priv; + GObject *object; + GtkWidget *sw; + + object = G_OBJECT_CLASS (gdict_defbox_parent_class)->constructor (type, + n_construct_properties, + construct_params); + defbox = GDICT_DEFBOX (object); + priv = defbox->priv; + + gtk_widget_push_composite_child (); + + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_composite_name (sw, "gdict-defbox-scrolled-window"); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (defbox), sw, TRUE, TRUE, 0); + gtk_widget_show (sw); + + priv->buffer = gtk_text_buffer_new (NULL); + gdict_defbox_init_tags (defbox); + + priv->text_view = gtk_text_view_new_with_buffer (priv->buffer); + gtk_widget_set_composite_name (priv->text_view, "gdict-defbox-text-view"); + gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->text_view), FALSE); + gtk_text_view_set_left_margin (GTK_TEXT_VIEW (priv->text_view), 4); + gtk_container_add (GTK_CONTAINER (sw), priv->text_view); + gtk_widget_show (priv->text_view); + + priv->find_pane = create_find_pane (defbox); + gtk_widget_set_composite_name (priv->find_pane, "gdict-defbox-find-pane"); + gtk_box_pack_end (GTK_BOX (defbox), priv->find_pane, FALSE, FALSE, 0); + + /* stuff to make the link machinery work */ + g_signal_connect (priv->text_view, "event-after", + G_CALLBACK (defbox_event_after_cb), + defbox); + g_signal_connect (priv->text_view, "motion-notify-event", + G_CALLBACK (defbox_motion_notify_cb), + defbox); + g_signal_connect (priv->text_view, "visibility-notify-event", + G_CALLBACK (defbox_visibility_notify_cb), + defbox); + + gtk_widget_pop_composite_child (); + + return object; +} + +static void +gdict_defbox_style_set (GtkWidget *widget, + GtkStyle *old_style) +{ + GdictDefboxPrivate *priv = GDICT_DEFBOX (widget)->priv; + GdkColor *link_color, *visited_link_color; + + if (GTK_WIDGET_CLASS (gdict_defbox_parent_class)->style_set) + GTK_WIDGET_CLASS (gdict_defbox_parent_class)->style_set (widget, old_style); + + link_color = visited_link_color = NULL; + gtk_widget_style_get (widget, + "link-color", &link_color, + "visited-link-color", &visited_link_color, + NULL); + if (!link_color) + link_color = &default_link_color; + + if (!visited_link_color) + visited_link_color = &default_visited_link_color; + + g_object_set (G_OBJECT (priv->link_tag), + "foreground-gdk", link_color, + NULL); + + g_object_set (G_OBJECT (priv->visited_link_tag), + "foreground-gdk", visited_link_color, + NULL); + + if (link_color != &default_link_color) + gdk_color_free (link_color); + + if (visited_link_color != &default_visited_link_color) + gdk_color_free (visited_link_color); +} + +/* we override the GtkWidget::show_all method since we have widgets + * we don't want to show, such as the find pane + */ +static void +gdict_defbox_show_all (GtkWidget *widget) +{ + GdictDefbox *defbox = GDICT_DEFBOX (widget); + GdictDefboxPrivate *priv = defbox->priv; + + gtk_widget_show (widget); + + if (priv->show_find) + gtk_widget_show_all (priv->find_pane); +} + +static void +gdict_defbox_real_show_find (GdictDefbox *defbox) +{ + gtk_widget_show_all (defbox->priv->find_pane); + defbox->priv->show_find = TRUE; + + gtk_widget_grab_focus (defbox->priv->find_entry); + + defbox->priv->hide_timeout = g_timeout_add (5000, hide_find_pane, defbox); +} + +static void +gdict_defbox_real_find_next (GdictDefbox *defbox) +{ + /* synthetize a "clicked" signal to the "next" button */ + gtk_button_clicked (GTK_BUTTON (defbox->priv->find_next)); +} + +static void +gdict_defbox_real_find_previous (GdictDefbox *defbox) +{ + /* synthetize a "clicked" signal to the "prev" button */ + gtk_button_clicked (GTK_BUTTON (defbox->priv->find_prev)); +} + +static void +gdict_defbox_real_hide_find (GdictDefbox *defbox) +{ + gtk_widget_hide (defbox->priv->find_pane); + defbox->priv->show_find = FALSE; + + gtk_widget_grab_focus (defbox->priv->text_view); + + if (defbox->priv->hide_timeout) + { + g_source_remove (defbox->priv->hide_timeout); + defbox->priv->hide_timeout = 0; + } +} + +static void +gdict_defbox_class_init (GdictDefboxClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + GtkBindingSet *binding_set; + + gobject_class->constructor = gdict_defbox_constructor; + gobject_class->set_property = gdict_defbox_set_property; + gobject_class->get_property = gdict_defbox_get_property; + gobject_class->dispose = gdict_defbox_dispose; + gobject_class->finalize = gdict_defbox_finalize; + + widget_class->show_all = gdict_defbox_show_all; + widget_class->style_set = gdict_defbox_style_set; + + /** + * GdictDefbox:word: + * + * The word to look up. + * + * Since: 0.10 + */ + g_object_class_install_property (gobject_class, + PROP_WORD, + g_param_spec_string ("word", + "Word", + "The word to look up", + NULL, + G_PARAM_READWRITE)); + /** + * GdictDefbox:context: + * + * The #GdictContext object used to get the word definition. + * + * Since: 0.1 + */ + g_object_class_install_property (gobject_class, + PROP_CONTEXT, + g_param_spec_object ("context", + "Context", + "The GdictContext object used to get the word definition", + GDICT_TYPE_CONTEXT, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT))); + /** + * GdictDefbox:database + * + * The database used by the #GdictDefbox bound to this object to get the word + * definition. + * + * Since: 0.1 + */ + g_object_class_install_property (gobject_class, + PROP_DATABASE, + g_param_spec_string ("database", + "Database", + "The database used to query the GdictContext", + GDICT_DEFAULT_DATABASE, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictDefbox:font-name + * + * The name of the font used by the #GdictDefbox to display the definitions. + * use the same string you use for pango_font_description_from_string(). + * + * Since: 0.3 + */ + g_object_class_install_property (gobject_class, + PROP_FONT_NAME, + g_param_spec_string ("font-name", + "Font Name", + "The font to be used by the defbox", + GDICT_DEFAULT_FONT_NAME, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + + gdict_defbox_signals[SHOW_FIND] = + g_signal_new ("show-find", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GdictDefboxClass, show_find), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + gdict_defbox_signals[FIND_PREVIOUS] = + g_signal_new ("find-previous", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GdictDefboxClass, find_previous), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + gdict_defbox_signals[FIND_NEXT] = + g_signal_new ("find-next", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GdictDefboxClass, find_next), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + gdict_defbox_signals[HIDE_FIND] = + g_signal_new ("hide-find", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GdictDefboxClass, hide_find), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); + gdict_defbox_signals[LINK_CLICKED] = + g_signal_new ("link-clicked", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictDefboxClass, link_clicked), + NULL, NULL, + gdict_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); + + klass->show_find = gdict_defbox_real_show_find; + klass->hide_find = gdict_defbox_real_hide_find; + klass->find_next = gdict_defbox_real_find_next; + klass->find_previous = gdict_defbox_real_find_previous; + + binding_set = gtk_binding_set_by_class (klass); + gtk_binding_entry_add_signal (binding_set, + GDK_f, GDK_CONTROL_MASK, + "show-find", + 0); + gtk_binding_entry_add_signal (binding_set, + GDK_g, GDK_CONTROL_MASK, + "find-next", + 0); + gtk_binding_entry_add_signal (binding_set, + GDK_g, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + "find-previous", + 0); + gtk_binding_entry_add_signal (binding_set, + GDK_Escape, 0, + "hide-find", + 0); + + g_type_class_add_private (klass, sizeof (GdictDefboxPrivate)); +} + +static void +gdict_defbox_init (GdictDefbox *defbox) +{ + GdictDefboxPrivate *priv; + + gtk_box_set_spacing (GTK_BOX (defbox), 6); + + priv = GDICT_DEFBOX_GET_PRIVATE (defbox); + defbox->priv = priv; + + priv->context = NULL; + priv->database = g_strdup (GDICT_DEFAULT_DATABASE); + priv->font_name = g_strdup (GDICT_DEFAULT_FONT_NAME); + priv->word = NULL; + + priv->definitions = NULL; + + priv->busy_cursor = NULL; + priv->hand_cursor = NULL; + priv->regular_cursor = NULL; + + priv->show_find = FALSE; + priv->is_searching = FALSE; + priv->is_hovering = FALSE; + + priv->hide_timeout = 0; +} + +/** + * gdict_defbox_new: + * + * Creates a new #GdictDefbox widget. Use this widget to search for + * a word using a #GdictContext, and to show the resulting definition(s). + * You must set a #GdictContext for this widget using + * gdict_defbox_set_context(). + * + * Return value: a new #GdictDefbox widget. + * + * Since: 0.1 + */ +GtkWidget * +gdict_defbox_new (void) +{ + return g_object_new (GDICT_TYPE_DEFBOX, NULL); +} + +/** + * gdict_defbox_new_with_context: + * @context: a #GdictContext + * + * Creates a new #GdictDefbox widget. Use this widget to search for + * a word using @context, and to show the resulting definition. + * + * Return value: a new #GdictDefbox widget. + * + * Since: 0.1 + */ +GtkWidget * +gdict_defbox_new_with_context (GdictContext *context) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), NULL); + + return g_object_new (GDICT_TYPE_DEFBOX, "context", context, NULL); +} + +/** + * gdict_defbox_set_context: + * @defbox: a #GdictDefbox + * @context: a #GdictContext + * + * Sets @context as the #GdictContext to be used by @defbox in order + * to retrieve the definitions of a word. + * + * Since: 0.1 + */ +void +gdict_defbox_set_context (GdictDefbox *defbox, + GdictContext *context) +{ + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + g_return_if_fail (context == NULL || GDICT_IS_CONTEXT (context)); + + g_object_set (defbox, "context", context, NULL); +} + +/** + * gdict_defbox_get_context: + * @defbox: a #GdictDefbox + * + * Gets the #GdictContext used by @defbox. + * + * Return value: a #GdictContext. + * + * Since: 0.1 + */ +GdictContext * +gdict_defbox_get_context (GdictDefbox *defbox) +{ + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), NULL); + + return defbox->priv->context; +} + +/** + * gdict_defbox_set_database: + * @defbox: a #GdictDefbox + * @database: a database + * + * Sets @database as the database used by the #GdictContext bound to @defbox + * to query for word definitions. + * + * Since: 0.1 + */ +void +gdict_defbox_set_database (GdictDefbox *defbox, + const gchar *database) +{ + GdictDefboxPrivate *priv; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + priv = defbox->priv; + + g_free (priv->database); + priv->database = g_strdup (database); + + g_object_notify (G_OBJECT (defbox), "database"); +} + +/** + * gdict_defbox_get_database: + * @defbox: a #GdictDefbox + * + * Gets the database used by @defbox. See gdict_defbox_set_database(). + * + * Return value: the name of a database. The return string is owned by + * the #GdictDefbox widget and should not be modified or freed. + * + * Since: 0.1 + */ +const gchar * +gdict_defbox_get_database (GdictDefbox *defbox) +{ + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), NULL); + + return defbox->priv->database; +} + +/** + * gdict_defbox_get_word: + * @defbox: a #GdictDefbox + * + * Retrieves the word being looked up. + * + * Return value: the word looked up, or %NULL. The returned string is + * owned by the #GdictDefbox widget and should never be modified or + * freed. + * + * Since: 0.12 + */ +const gchar * +gdict_defbox_get_word (GdictDefbox *defbox) +{ + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), NULL); + + return defbox->priv->word; +} + +/** + * gdict_defbox_set_show_find: + * @defbox: a #GdictDefbox + * @show_find: %TRUE to show the find pane + * + * Whether @defbox should show the find pane. + * + * Since: 0.1 + */ +void +gdict_defbox_set_show_find (GdictDefbox *defbox, + gboolean show_find) +{ + GdictDefboxPrivate *priv; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + priv = defbox->priv; + + if (priv->show_find == show_find) + return; + + priv->show_find = show_find; + if (priv->show_find) + { + gtk_widget_show_all (priv->find_pane); + gtk_widget_grab_focus (priv->find_entry); + + if (!priv->hide_timeout) + priv->hide_timeout = g_timeout_add (5000, hide_find_pane, defbox); + } + else + { + gtk_widget_hide (priv->find_pane); + + if (priv->hide_timeout) + { + g_source_remove (priv->hide_timeout); + priv->hide_timeout = 0; + } + } +} + +/** + * gdict_defbox_get_show_find: + * @defbox: a #GdictDefbox + * + * Gets whether the find pane should be visible or not. + * + * Return value: %TRUE if the find pane is visible. + * + * Since: 0.1 + */ +gboolean +gdict_defbox_get_show_find (GdictDefbox *defbox) +{ + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), FALSE); + + return (defbox->priv->show_find == TRUE); +} + +static void +lookup_start_cb (GdictContext *context, + gpointer user_data) +{ + GdictDefbox *defbox = GDICT_DEFBOX (user_data); + GdictDefboxPrivate *priv = defbox->priv; + GdkWindow *window; + + priv->is_searching = TRUE; + + if (!priv->busy_cursor) + priv->busy_cursor = gdk_cursor_new (GDK_WATCH); + + window = gtk_text_view_get_window (GTK_TEXT_VIEW (priv->text_view), + GTK_TEXT_WINDOW_WIDGET); + + gdk_window_set_cursor (window, priv->busy_cursor); +} + +static void +lookup_end_cb (GdictContext *context, + gpointer user_data) +{ + GdictDefbox *defbox = GDICT_DEFBOX (user_data); + GdictDefboxPrivate *priv = defbox->priv; + GtkTextBuffer *buffer; + GtkTextIter start; + GdkWindow *window; + + /* explicitely move the cursor to the beginning */ + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view)); + gtk_text_buffer_get_start_iter (buffer, &start); + gtk_text_buffer_place_cursor (buffer, &start); + + window = gtk_text_view_get_window (GTK_TEXT_VIEW (priv->text_view), + GTK_TEXT_WINDOW_WIDGET); + + gdk_window_set_cursor (window, NULL); + + priv->is_searching = FALSE; +} + +static void +gdict_defbox_insert_word (GdictDefbox *defbox, + GtkTextIter *iter, + const gchar *word) +{ + GdictDefboxPrivate *priv; + gchar *text; + + if (!word) + return; + + g_assert (GDICT_IS_DEFBOX (defbox)); + priv = defbox->priv; + + g_assert (GTK_IS_TEXT_BUFFER (priv->buffer)); + + text = g_strdup_printf ("%s\n", word); + gtk_text_buffer_insert_with_tags_by_name (priv->buffer, + iter, + text, strlen (text), + "big", "bold", "query-title", + NULL); + g_free (text); +} + +/* escape a link string; links are expressed as "{...}". + * the link with the '{}' removed is stored inside link_str, while + * the returned value is a pointer to what follows the trailing '}'. + * link_str is allocated and should be freed. + */ +static const gchar * +escape_link (const gchar *str, + gchar **link_str) +{ + gsize str_len; + GString *link_buf; + const gchar *p; + + str_len = strlen (str); + link_buf = g_string_sized_new (str_len - 2); + + for (p = str + 1; *p != '}'; p++) + { + link_buf = g_string_append_c (link_buf, *p); + } + + if (link_str) + *link_str = g_string_free (link_buf, FALSE); + + p++; + + return p; +} + +static const gchar * +escape_phonethic (const gchar *str, + gchar **phon_str) +{ + gsize str_len; + GString *phon_buf; + const gchar *p; + + str_len = strlen (str); + phon_buf = g_string_sized_new (str_len - 2); + + for (p = str + 1; *p != '\\'; p++) + { + phon_buf = g_string_append_c (phon_buf, *p); + } + + if (phon_str) + *phon_str = g_string_free (phon_buf, FALSE); + + p++; + + return p; +} + +static void +gdict_defbox_insert_body (GdictDefbox *defbox, + GtkTextIter *iter, + const gchar *body) +{ + GdictDefboxPrivate *priv; + gchar **words; + gint len, i; + GtkTextIter end_iter; + + if (!body) + return; + + g_assert (GDICT_IS_DEFBOX (defbox)); + priv = defbox->priv; + + g_assert (GTK_IS_TEXT_BUFFER (priv->buffer)); + + words = g_strsplit (body, " ", -1); + len = g_strv_length (words); + end_iter = *iter; + + for (i = 0; i < len; i++) + { + gchar *w = words[i]; + gint w_len = strlen (w); + gchar *begin, *end; + + if (w_len == 0) + continue; + + begin = g_utf8_offset_to_pointer (w, 0); + + if (*begin == '{') + { + end = g_utf8_strrchr (w, -1, '}'); + + /* see this is a self contained link */ + if (end && *end == '}') + { + const gchar *rest; + gchar *link_str; + + rest = escape_link (w, &link_str); + + gtk_text_buffer_insert_with_tags_by_name (priv->buffer, + &end_iter, + link_str, -1, + "link", + NULL); + + gtk_text_buffer_insert (priv->buffer, &end_iter, rest, -1); + + gtk_text_buffer_get_end_iter (priv->buffer, &end_iter); + gtk_text_buffer_insert (priv->buffer, &end_iter, " ", 1); + + g_free (link_str); + + continue; + } + else + { + /* uh-oh: the link ends in another word */ + GString *buf; + gchar *next; + gint cur = i; + + buf = g_string_new (NULL); + next = words[cur++]; + + while (next && (end = g_utf8_strrchr (next, -1, '}')) == NULL) + { + buf = g_string_append (buf, next); + buf = g_string_append_c (buf, ' '); + + next = words[cur++]; + } + + buf = g_string_append (buf, next); + + next = g_string_free (buf, FALSE); + + if (end && *end == '}') + { + const gchar *rest; + gchar *link_str; + + rest = escape_link (next, &link_str); + + gtk_text_buffer_insert_with_tags_by_name (priv->buffer, + &end_iter, + link_str, -1, + "link", + NULL); + + gtk_text_buffer_insert (priv->buffer, &end_iter, rest, -1); + gtk_text_buffer_insert (priv->buffer, &end_iter, " ", 1); + + g_free (link_str); + } + + g_free (next); + i = cur; + + continue; + } + } + else if (*begin == '\\') + { + end = g_utf8_strrchr (w, -1, '\\'); + + if (end && *end == '\\') + { + const gchar *rest; + gchar *phon; + + rest = escape_phonethic (w, &phon); + + gtk_text_buffer_insert_with_tags_by_name (priv->buffer, + &end_iter, + phon, -1, + "italic", "phonetic", + NULL); + + gtk_text_buffer_insert (priv->buffer, &end_iter, rest, -1); + + gtk_text_buffer_get_end_iter (priv->buffer, &end_iter); + gtk_text_buffer_insert (priv->buffer, &end_iter, " ", -1); + + g_free (phon); + + continue; + } + } + + gtk_text_buffer_insert (priv->buffer, &end_iter, w, w_len); + + gtk_text_buffer_get_end_iter (priv->buffer, &end_iter); + gtk_text_buffer_insert (priv->buffer, &end_iter, " ", 1); + } + + gtk_text_buffer_get_end_iter (priv->buffer, &end_iter); + gtk_text_buffer_insert (priv->buffer, &end_iter, "\n", 1); + + *iter = end_iter; + + g_strfreev (words); +} + +static void +gdict_defbox_insert_from (GdictDefbox *defbox, + GtkTextIter *iter, + const gchar *database) +{ + GdictDefboxPrivate *priv; + gchar *text; + + if (!database) + return; + + g_assert (GDICT_IS_DEFBOX (defbox)); + priv = defbox->priv; + + g_assert (GTK_IS_TEXT_BUFFER (priv->buffer)); + + text = g_strdup_printf ("\t-- From %s\n\n", database); + gtk_text_buffer_insert_with_tags_by_name (priv->buffer, + iter, + text, strlen (text), + "small", "query-from", + NULL); + g_free (text); +} + +static void +gdict_defbox_insert_error (GdictDefbox *defbox, + GtkTextIter *iter, + const gchar *title, + const gchar *message) +{ + GdictDefboxPrivate *priv; + GtkTextMark *mark; + GtkTextIter cur_iter; + + if (!title) + return; + + g_assert (GDICT_IS_DEFBOX (defbox)); + priv = defbox->priv; + + g_assert (GTK_IS_TEXT_BUFFER (priv->buffer)); + + mark = gtk_text_buffer_create_mark (priv->buffer, "block-cursor", iter, FALSE); + gtk_text_buffer_get_iter_at_mark (priv->buffer, &cur_iter, mark); + + gtk_text_buffer_insert_with_tags_by_name (priv->buffer, + &cur_iter, + title, strlen (title), + "error-title", "big", "bold", + NULL); + gtk_text_buffer_get_iter_at_mark (priv->buffer, &cur_iter, mark); + + gtk_text_buffer_insert (priv->buffer, &cur_iter, "\n\n", -1); + gtk_text_buffer_get_iter_at_mark (priv->buffer, &cur_iter, mark); + + gtk_text_buffer_insert_with_tags_by_name (priv->buffer, + &cur_iter, + message, strlen (message), + "error-message", + NULL); +} + +static void +definition_found_cb (GdictContext *context, + GdictDefinition *definition, + gpointer user_data) +{ + GdictDefbox *defbox = GDICT_DEFBOX (user_data); + GdictDefboxPrivate *priv = defbox->priv; + GtkTextIter iter; + Definition *def; + + /* insert the word if this is the first definition */ + if (!priv->definitions) + { + gtk_text_buffer_get_start_iter (priv->buffer, &iter); + gdict_defbox_insert_word (defbox, &iter, + gdict_definition_get_word (definition)); + } + + def = definition_new (); + + gtk_text_buffer_get_end_iter (priv->buffer, &iter); + def->begin = gtk_text_iter_get_offset (&iter); + gdict_defbox_insert_body (defbox, &iter, gdict_definition_get_text (definition)); + + gtk_text_buffer_get_end_iter (priv->buffer, &iter); + gdict_defbox_insert_from (defbox, &iter, gdict_definition_get_database (definition)); + + def->definition = gdict_definition_ref (definition); + + priv->definitions = g_slist_append (priv->definitions, def); +} + +static void +error_cb (GdictContext *context, + const GError *error, + gpointer user_data) +{ + GdictDefbox *defbox = GDICT_DEFBOX (user_data); + GdictDefboxPrivate *priv = defbox->priv; + GtkTextIter iter; + + if (!error) + return; + + gdict_defbox_clear (defbox); + + gtk_text_buffer_get_start_iter (priv->buffer, &iter); + gdict_defbox_insert_error (defbox, &iter, + _("Error while looking up definition"), + error->message); + + g_free (priv->word); + priv->word = NULL; + + defbox->priv->is_searching = FALSE; +} + +/** + * gdict_defbox_lookup: + * @defbox: a #GdictDefbox + * @word: the word to look up + * + * Searches @word inside the dictionary sources using the #GdictContext + * provided when creating @defbox or set using gdict_defbox_set_context(). + * + * Since: 0.1 + */ +void +gdict_defbox_lookup (GdictDefbox *defbox, + const gchar *word) +{ + GdictDefboxPrivate *priv; + GError *define_error; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + priv = defbox->priv; + + if (!priv->context) + { + g_warning ("Attempting to look up `%s', but no GdictContext " + "has been set. Use gdict_defbox_set_context() " + "before invoking gdict_defbox_lookup().", + word); + return; + } + + if (priv->is_searching) + { + _gdict_show_error_dialog (GTK_WIDGET (defbox), + _("Another search is in progress"), + _("Please wait until the current search ends.")); + + return; + } + + gdict_defbox_clear (defbox); + + if (!priv->start_id) + { + priv->start_id = g_signal_connect (priv->context, "lookup-start", + G_CALLBACK (lookup_start_cb), + defbox); + priv->define_id = g_signal_connect (priv->context, "definition-found", + G_CALLBACK (definition_found_cb), + defbox); + priv->end_id = g_signal_connect (priv->context, "lookup-end", + G_CALLBACK (lookup_end_cb), + defbox); + } + + if (!priv->error_id) + priv->error_id = g_signal_connect (priv->context, "error", + G_CALLBACK (error_cb), + defbox); + + priv->word = g_strdup (word); + g_object_notify (G_OBJECT (defbox), "word"); + + define_error = NULL; + gdict_context_define_word (priv->context, + priv->database, + word, + &define_error); + if (define_error) + { + GtkTextIter iter; + + gtk_text_buffer_get_start_iter (priv->buffer, &iter); + gdict_defbox_insert_error (defbox, &iter, + _("Error while retrieving the definition"), + define_error->message); + + g_error_free (define_error); + } +} + +/** + * gdict_defbox_clear: + * @defbox: a @GdictDefbox + * + * Clears the buffer of @defbox + * + * Since: 0.1 + */ +void +gdict_defbox_clear (GdictDefbox *defbox) +{ + GdictDefboxPrivate *priv; + GtkTextIter start, end; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + priv = defbox->priv; + + /* destroy previously found definitions */ + if (priv->definitions) + { + g_slist_foreach (priv->definitions, + (GFunc) definition_free, + NULL); + g_slist_free (priv->definitions); + + priv->definitions = NULL; + } + + gtk_text_buffer_get_bounds (priv->buffer, &start, &end); + gtk_text_buffer_delete (priv->buffer, &start, &end); +} + +/** + * gdict_defbox_find_next: + * @defbox: a #GdictDefbox + * + * Emits the "find-next" signal. + * + * Since: 0.1 + */ +void +gdict_defbox_find_next (GdictDefbox *defbox) +{ + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + g_signal_emit (defbox, gdict_defbox_signals[FIND_NEXT], 0); +} + +/** + * gdict_defbox_find_previous: + * @defbox: a #GdictDefbox + * + * Emits the "find-previous" signal. + * + * Since: 0.1 + */ +void +gdict_defbox_find_previous (GdictDefbox *defbox) +{ + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + g_signal_emit (defbox, gdict_defbox_signals[FIND_PREVIOUS], 0); +} + +/** + * gdict_defbox_select_all: + * @defbox: a #GdictDefbox + * + * Selects all the text displayed by @defbox + * + * Since: 0.1 + */ +void +gdict_defbox_select_all (GdictDefbox *defbox) +{ + GdictDefboxPrivate *priv; + GtkTextBuffer *buffer; + GtkTextIter start, end; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + priv = defbox->priv; + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view)); + + gtk_text_buffer_get_bounds (buffer, &start, &end); + gtk_text_buffer_select_range (buffer, &start, &end); +} + +/** + * gdict_defbox_copy_to_clipboard: + * @defbox: a #GdictDefbox + * @clipboard: a #GtkClipboard + * + * Copies the selected text inside @defbox into @clipboard. + * + * Since: 0.1 + */ +void +gdict_defbox_copy_to_clipboard (GdictDefbox *defbox, + GtkClipboard *clipboard) +{ + GdictDefboxPrivate *priv; + GtkTextBuffer *buffer; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + g_return_if_fail (GTK_IS_CLIPBOARD (clipboard)); + + priv = defbox->priv; + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view)); + + gtk_text_buffer_copy_clipboard (buffer, clipboard); +} + +/** + * gdict_defbox_count_definitions: + * @defbox: a #GdictDefbox + * + * Gets the number of definitions displayed by @defbox + * + * Return value: the number of definitions. + * + * Since: 0.1 + */ +gint +gdict_defbox_count_definitions (GdictDefbox *defbox) +{ + GdictDefboxPrivate *priv; + + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), -1); + + priv = defbox->priv; + if (!priv->definitions) + return -1; + + return g_slist_length (priv->definitions); +} + +/** + * gdict_defbox_jump_to_definition: + * @defbox: a #GdictDefbox + * @number: the definition to jump to + * + * Scrolls to the definition identified by @number. If @number is -1, + * jumps to the last definition. + * + * Since: 0.1 + */ +void +gdict_defbox_jump_to_definition (GdictDefbox *defbox, + gint number) +{ + GdictDefboxPrivate *priv; + gint count; + Definition *def; + GtkTextBuffer *buffer; + GtkTextIter def_start; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + count = gdict_defbox_count_definitions (defbox) - 1; + if (count == -1) + return; + + if ((number == -1) || (number > count)) + number = count; + + priv = defbox->priv; + def = (Definition *) g_slist_nth_data (priv->definitions, number); + if (!def) + return; + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view)); + gtk_text_buffer_get_iter_at_offset (buffer, &def_start, def->begin); + gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (priv->text_view), + &def_start, + 0.0, + TRUE, + 0.0, 0.0); +} + +/** + * gdict_defbox_get_text: + * @defbox: a #GdictDefbox + * @length: return location for the text length or %NULL + * + * Gets the full contents of @defbox. + * + * Return value: a newly allocated string containing the text displayed by + * @defbox. + * + * Since: 0.1 + */ +gchar * +gdict_defbox_get_text (GdictDefbox *defbox, + gsize *length) +{ + GdictDefboxPrivate *priv; + GtkTextBuffer *buffer; + GtkTextIter start, end; + gchar *retval; + + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), NULL); + + priv = defbox->priv; + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view)); + + gtk_text_buffer_get_bounds (buffer, &start, &end); + + retval = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); + + if (length) + *length = strlen (retval); + + return retval; +} + +/** + * gdict_defbox_set_font_name: + * @defbox: a #GdictDefbox + * @font_name: a font description, or %NULL + * + * Sets @font_name as the font for @defbox. It calls internally + * pango_font_description_from_string() and gtk_widget_modify_font(). + * + * Passing %NULL for @font_name will reset any previously set font. + * + * Since: 0.3.0 + */ +void +gdict_defbox_set_font_name (GdictDefbox *defbox, + const gchar *font_name) +{ + GdictDefboxPrivate *priv; + PangoFontDescription *font_desc; + + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + priv = defbox->priv; + + if (font_name) + { + font_desc = pango_font_description_from_string (font_name); + g_return_if_fail (font_desc != NULL); + } + else + font_desc = NULL; + + gtk_widget_modify_font (priv->text_view, font_desc); + + if (font_desc) + pango_font_description_free (font_desc); + + g_free (priv->font_name); + priv->font_name = g_strdup (font_name); +} + +/** + * gdict_defbox_get_font_name: + * @defbox: a #GdictDefbox + * + * Retrieves the font currently used by @defbox. + * + * Return value: a font name. The returned string is owned by @defbox and + * should not be modified or freed. + * + * Since: 0.3 + */ +const gchar * +gdict_defbox_get_font_name (GdictDefbox *defbox) +{ + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), NULL); + + return defbox->priv->font_name; +} + +/** + * gdict_defbox_get_selected_word: + * @defbox: a #GdictDefbox + * + * Retrieves the selected word from the defbox widget + * + * Return value: a newly allocated string containing the selected + * word. Use g_free() when done using it. + * + * Since: 0.12 + */ +gchar * +gdict_defbox_get_selected_word (GdictDefbox *defbox) +{ + GdictDefboxPrivate *priv; + GtkTextBuffer *buffer; + + g_return_val_if_fail (GDICT_IS_DEFBOX (defbox), NULL); + + priv = defbox->priv; + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view)); + + if (!gtk_text_buffer_get_has_selection (buffer)) + return NULL; + else + { + GtkTextIter start, end; + gchar *retval; + + gtk_text_buffer_get_selection_bounds (buffer, &start, &end); + retval = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); + + return retval; + } +} diff --git a/mate-dictionary/libgdict/gdict-defbox.h b/mate-dictionary/libgdict/gdict-defbox.h new file mode 100644 index 00000000..4c1278f6 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-defbox.h @@ -0,0 +1,102 @@ +/* gdict-defbox.h - display widget for dictionary definitions + * + * Copyright (C) 2005-2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_DEFBOX_H__ +#define __GDICT_DEFBOX_H__ + +#include <gtk/gtk.h> +#include "gdict-context.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_DEFBOX (gdict_defbox_get_type ()) +#define GDICT_DEFBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_DEFBOX, GdictDefbox)) +#define GDICT_IS_DEFBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_DEFBOX)) +#define GDICT_DEFBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_DEFBOX, GdictDefboxClass)) +#define GDICT_IS_DEFBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_DEFBOX)) +#define GDICT_DEFBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_DEFBOX, GdictDefboxClass)) + +typedef struct _GdictDefbox GdictDefbox; +typedef struct _GdictDefboxClass GdictDefboxClass; +typedef struct _GdictDefboxPrivate GdictDefboxPrivate; + +struct _GdictDefbox +{ + /*< private >*/ + GtkVBox parent_instance; + + GdictDefboxPrivate *priv; +}; + +struct _GdictDefboxClass +{ + GtkVBoxClass parent_class; + + /* these are all RUN_ACTION signals for key bindings */ + void (*show_find) (GdictDefbox *defbox); + void (*hide_find) (GdictDefbox *defbox); + void (*find_previous) (GdictDefbox *defbox); + void (*find_next) (GdictDefbox *defbox); + + /* signals */ + void (*link_clicked) (GdictDefbox *defbox, + const gchar *link); + + /* padding for future expansion */ + void (*_gdict_defbox_1) (void); + void (*_gdict_defbox_2) (void); + void (*_gdict_defbox_3) (void); + void (*_gdict_defbox_4) (void); +}; + +GType gdict_defbox_get_type (void) G_GNUC_CONST; + +GtkWidget * gdict_defbox_new (void); +GtkWidget * gdict_defbox_new_with_context (GdictContext *context); +void gdict_defbox_set_context (GdictDefbox *defbox, + GdictContext *context); +GdictContext * gdict_defbox_get_context (GdictDefbox *defbox); +void gdict_defbox_set_database (GdictDefbox *defbox, + const gchar *database); +const gchar *gdict_defbox_get_database (GdictDefbox *defbox); +const gchar *gdict_defbox_get_word (GdictDefbox *defbox); +gchar * gdict_defbox_get_text (GdictDefbox *defbox, + gsize *length) G_GNUC_MALLOC; +void gdict_defbox_select_all (GdictDefbox *defbox); +void gdict_defbox_copy_to_clipboard (GdictDefbox *defbox, + GtkClipboard *clipboard); +void gdict_defbox_clear (GdictDefbox *defbox); +void gdict_defbox_lookup (GdictDefbox *defbox, + const gchar *word); +gint gdict_defbox_count_definitions (GdictDefbox *defbox); +void gdict_defbox_jump_to_definition (GdictDefbox *defbox, + gint number); +void gdict_defbox_set_show_find (GdictDefbox *defbox, + gboolean show_find); +gboolean gdict_defbox_get_show_find (GdictDefbox *defbox); +void gdict_defbox_find_next (GdictDefbox *defbox); +void gdict_defbox_find_previous (GdictDefbox *defbox); +void gdict_defbox_set_font_name (GdictDefbox *defbox, + const gchar *font_name); +const gchar *gdict_defbox_get_font_name (GdictDefbox *defbox); +gchar * gdict_defbox_get_selected_word (GdictDefbox *defbox) G_GNUC_MALLOC; + +G_END_DECLS + +#endif /* __GDICT_DEFBOX_H__ */ diff --git a/mate-dictionary/libgdict/gdict-enum-types.c.in b/mate-dictionary/libgdict/gdict-enum-types.c.in new file mode 100644 index 00000000..0dbbdc66 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-enum-types.c.in @@ -0,0 +1,33 @@ +/*** BEGIN file-header ***/ +#include "gdict-enum-types.h" +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +#include "@filename@" +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static GType g_enum_type_id = 0; + if (G_UNLIKELY (g_enum_type_id == 0)) + { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + g_enum_type_id = g_@type@_register_static("@EnumName@", values); + } + + return g_enum_type_id; +} +/*** END value-tail ***/ + diff --git a/mate-dictionary/libgdict/gdict-enum-types.h.in b/mate-dictionary/libgdict/gdict-enum-types.h.in new file mode 100644 index 00000000..bfaf3e29 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-enum-types.h.in @@ -0,0 +1,26 @@ +/*** BEGIN file-header ***/ +#ifndef __GDICT_ENUM_TYPES_H__ +#define __GDICT_ENUM_TYPES_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* !__GDICT_ENUM_TYPES_H__ */ +/*** END file-tail ***/ + +/*** BEGIN value-header ***/ +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define GDICT_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) + +/*** END value-header ***/ + diff --git a/mate-dictionary/libgdict/gdict-marshal.list b/mate-dictionary/libgdict/gdict-marshal.list new file mode 100644 index 00000000..39fa85e3 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-marshal.list @@ -0,0 +1,7 @@ +VOID:VOID +VOID:POINTER +VOID:BOXED +VOID:OBJECT +VOID:STRING +VOID:STRING,STRING +VOID:STRING,OBJECT diff --git a/mate-dictionary/libgdict/gdict-private.h b/mate-dictionary/libgdict/gdict-private.h new file mode 100644 index 00000000..224ba776 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-private.h @@ -0,0 +1,34 @@ +/* gdict-private.h - Private stuff for Gdict + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#include <gtk/gtk.h> +#include "gdict-debug.h" + +G_BEGIN_DECLS + +gboolean _gdict_has_ipv6 (void); + +void _gdict_show_error_dialog (GtkWidget *widget, + const gchar *title, + const gchar *detail); +void _gdict_show_gerror_dialog (GtkWidget *widget, + const gchar *title, + GError *error); + +G_END_DECLS diff --git a/mate-dictionary/libgdict/gdict-source-chooser.c b/mate-dictionary/libgdict/gdict-source-chooser.c new file mode 100644 index 00000000..ab640f85 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-source-chooser.c @@ -0,0 +1,917 @@ +/* gdict-source-chooser.h - display widget for dictionary sources + * + * Copyright (C) 2007 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-source-chooser + * @short_description: Display the list of available sources + * + * #GdictSourceChooser is a widget that shows the list of available + * dictionary sources using a #GdictSourceLoader instance as a model. + * It can be used to allow choosing the current dictionary source. + * + * #GdictSourceChooser is available since Gdict 0.12. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> + +#include <glib/gi18n-lib.h> + +#include <gdk/gdk.h> + +#include <gtk/gtk.h> + +#include "gdict-source-chooser.h" +#include "gdict-utils.h" +#include "gdict-private.h" +#include "gdict-enum-types.h" +#include "gdict-marshal.h" + +#define GDICT_SOURCE_CHOOSER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ + GDICT_TYPE_SOURCE_CHOOSER, \ + GdictSourceChooserPrivate)) + +struct _GdictSourceChooserPrivate +{ + GtkListStore *store; + + GtkWidget *treeview; + GtkWidget *refresh_button; + GtkWidget *buttons_box; + + GdictSourceLoader *loader; + gint n_sources; + + GdkCursor *busy_cursor; + + gchar *current_source; +}; + +enum +{ + SOURCE_TRANSPORT, + SOURCE_NAME, + SOURCE_DESCRIPTION, + SOURCE_CURRENT, + + SOURCE_N_COLUMNS +}; + +enum +{ + PROP_0, + + PROP_LOADER, + PROP_COUNT +}; + +enum +{ + SOURCE_ACTIVATED, + SELECTION_CHANGED, + + LAST_SIGNAL +}; + +static guint source_chooser_signals[LAST_SIGNAL] = { 0, }; + +G_DEFINE_TYPE (GdictSourceChooser, gdict_source_chooser, GTK_TYPE_VBOX); + +static void +gdict_source_chooser_finalize (GObject *gobject) +{ + GdictSourceChooser *chooser = GDICT_SOURCE_CHOOSER (gobject); + GdictSourceChooserPrivate *priv = chooser->priv; + + g_free (priv->current_source); + + G_OBJECT_CLASS (gdict_source_chooser_parent_class)->finalize (gobject); +} + +static void +gdict_source_chooser_dispose (GObject *gobject) +{ + GdictSourceChooser *chooser = GDICT_SOURCE_CHOOSER (gobject); + GdictSourceChooserPrivate *priv = chooser->priv; + + if (priv->store) + { + g_object_unref (priv->store); + priv->store = NULL; + } + + if (priv->loader) + { + g_object_unref (priv->loader); + priv->loader = NULL; + } + + if (priv->busy_cursor) + { + gdk_cursor_unref (priv->busy_cursor); + priv->busy_cursor = NULL; + } + + G_OBJECT_CLASS (gdict_source_chooser_parent_class)->dispose (gobject); +} + +static void +gdict_source_chooser_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) + { + case PROP_LOADER: + gdict_source_chooser_set_loader (GDICT_SOURCE_CHOOSER (gobject), + g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +gdict_source_chooser_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictSourceChooserPrivate *priv; + + priv = GDICT_SOURCE_CHOOSER (gobject)->priv; + + switch (prop_id) + { + case PROP_LOADER: + g_value_set_object (value, priv->loader); + break; + case PROP_COUNT: + g_value_set_int (value, priv->n_sources); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +row_activated_cb (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + gpointer data) +{ + GdictSourceChooser *chooser = GDICT_SOURCE_CHOOSER (data); + GdictSourceChooserPrivate *priv = chooser->priv; + GtkTreeIter iter; + gchar *name; + GdictSource *source; + + if (!priv->loader) + return; + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->store), &iter, path)) + return; + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + SOURCE_NAME, &name, + -1); + if (!name) + return; + + source = gdict_source_loader_get_source (priv->loader, name); + if (!source) + { + g_free (name); + return; + } + + g_signal_emit (chooser, source_chooser_signals[SOURCE_ACTIVATED], 0, + name, source); + + g_free (name); + g_object_unref (source); +} + +static void +refresh_button_clicked_cb (GtkButton *button, + gpointer data) +{ + gdict_source_chooser_refresh (GDICT_SOURCE_CHOOSER (data)); +} + +static void +selection_changed_cb (GtkTreeSelection *selection, + gpointer data) +{ + g_signal_emit (data, source_chooser_signals[SELECTION_CHANGED], 0); +} + +static GObject * +gdict_source_chooser_constructor (GType gtype, + guint n_params, + GObjectConstructParam *params) +{ + GdictSourceChooser *chooser; + GdictSourceChooserPrivate *priv; + GObjectClass *parent_class; + GObject *retval; + GtkWidget *sw; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkWidget *hbox; + + parent_class = G_OBJECT_CLASS (gdict_source_chooser_parent_class); + retval = parent_class->constructor (gtype, n_params, params); + + chooser = GDICT_SOURCE_CHOOSER (retval); + priv = chooser->priv; + + gtk_widget_push_composite_child (); + + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_composite_name (sw, "gdict-source-chooser-scrolled-window"); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (chooser), sw, TRUE, TRUE, 0); + gtk_widget_show (sw); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("sources", + renderer, + "text", SOURCE_DESCRIPTION, + "weight", SOURCE_CURRENT, + NULL); + priv->treeview = gtk_tree_view_new (); + gtk_widget_set_composite_name (priv->treeview, "gdict-source-chooser-treeview"); + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->treeview), FALSE); + gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview), column); + g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)), + "changed", G_CALLBACK (selection_changed_cb), + chooser); + g_signal_connect (priv->treeview, + "row-activated", G_CALLBACK (row_activated_cb), + chooser); + gtk_container_add (GTK_CONTAINER (sw), priv->treeview); + gtk_widget_show (priv->treeview); + + hbox = gtk_hbox_new (FALSE, 6); + priv->buttons_box = hbox; + + priv->refresh_button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (priv->refresh_button), + gtk_image_new_from_stock (GTK_STOCK_REFRESH, + GTK_ICON_SIZE_BUTTON)); + g_signal_connect (priv->refresh_button, + "clicked", G_CALLBACK (refresh_button_clicked_cb), + chooser); + gtk_box_pack_start (GTK_BOX (hbox), priv->refresh_button, FALSE, FALSE, 0); + gtk_widget_show (priv->refresh_button); + gtk_widget_set_tooltip_text (priv->refresh_button, + _("Reload the list of available sources")); + + gtk_box_pack_end (GTK_BOX (chooser), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + gtk_widget_pop_composite_child (); + + return retval; +} + +static void +gdict_source_chooser_class_init (GdictSourceChooserClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GdictSourceChooserPrivate)); + + gobject_class->finalize = gdict_source_chooser_finalize; + gobject_class->dispose = gdict_source_chooser_dispose; + gobject_class->set_property = gdict_source_chooser_set_property; + gobject_class->get_property = gdict_source_chooser_get_property; + gobject_class->constructor = gdict_source_chooser_constructor; + + /** + * GdictSourceChooser:loader: + * + * The #GdictSourceLoader used to retrieve the list of available + * dictionary sources. + * + * Since: 0.12 + */ + g_object_class_install_property (gobject_class, + PROP_LOADER, + g_param_spec_object ("loader", + "Loader", + "The GdictSourceLoader used to get the list of sources", + GDICT_TYPE_SOURCE_LOADER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + /** + * GdictSourceChooser:count: + * + * The number of available dictionary sources, or -1 if no + * #GdictSourceLoader is set. + * + * Since: 0.12 + */ + g_object_class_install_property (gobject_class, + PROP_COUNT, + g_param_spec_int ("count", + "Count", + "The number of available dictionary sources", + -1, G_MAXINT, -1, + G_PARAM_READABLE)); + + /** + * GdictSourceChooser::source-activated: + * @chooser: the #GdictSourceChooser that received the signal + * @source_name: the name of the activated source + * @source: the activated #GdictSource + * + * The ::source-activated signal is emitted each time the user + * activates a row in the source chooser widget, either by double + * clicking on it or by a keyboard event. + * + * Since: 0.12 + */ + source_chooser_signals[SOURCE_ACTIVATED] = + g_signal_new ("source-activated", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictSourceChooserClass, source_activated), + NULL, NULL, + gdict_marshal_VOID__STRING_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_STRING, + GDICT_TYPE_SOURCE); + /** + * GdictSourceChooser::selection-changed: + * @chooser: the #GdictSourceChooser that received the signal + * + * The ::selection-changed signal is emitted each time the + * selection inside the source chooser widget has been changed. + * + * Since: 0.12 + */ + source_chooser_signals[SELECTION_CHANGED] = + g_signal_new ("selection-changed", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictSourceChooserClass, selection_changed), + NULL, NULL, + gdict_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +gdict_source_chooser_init (GdictSourceChooser *chooser) +{ + GdictSourceChooserPrivate *priv; + + chooser->priv = priv = GDICT_SOURCE_CHOOSER_GET_PRIVATE (chooser); + + priv->store = gtk_list_store_new (SOURCE_N_COLUMNS, + G_TYPE_INT, /* TRANSPORT */ + G_TYPE_STRING, /* NAME */ + G_TYPE_STRING, /* DESCRIPTION */ + G_TYPE_INT /* CURRENT */); + + priv->loader = NULL; + priv->n_sources = -1; + + priv->busy_cursor = gdk_cursor_new (GDK_WATCH); +} + +/** + * gdict_source_chooser_new: + * + * Creates a new #GdictSourceChooser widget. This widget can be used to + * display the list of available dictionary sources. + * + * Return value: the newly created #GdictSourceChooser widget. + * + * Since: 0.12 + */ +GtkWidget * +gdict_source_chooser_new (void) +{ + return g_object_new (GDICT_TYPE_SOURCE_CHOOSER, NULL); +} + +/** + * gdict_source_chooser_new_with_loader: + * @loader: a #GdictSourceLoader + * + * Creates a new #GdictSourceChooser widget and sets @loader as the + * #GdictSourceLoader object to be used to retrieve the list of + * available dictionary sources. + * + * Return value: the newly created #GdictSourceChooser widget. + * + * Since: 0.12 + */ +GtkWidget * +gdict_source_chooser_new_with_loader (GdictSourceLoader *loader) +{ + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), NULL); + + return g_object_new (GDICT_TYPE_SOURCE_CHOOSER, "loader", loader, NULL); +} + +/** + * gdict_source_chooser_set_loader: + * @chooser: a #GdictSourceChooser + * @loader: a #GdictSourceLoader or %NULL to unset it + * + * Sets the #GdictSourceLoader to be used by the source chooser + * widget. + * + * Since: 0.12 + */ +void +gdict_source_chooser_set_loader (GdictSourceChooser *chooser, + GdictSourceLoader *loader) +{ + GdictSourceChooserPrivate *priv; + + g_return_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser)); + g_return_if_fail (loader == NULL || GDICT_IS_SOURCE_LOADER (loader)); + + priv = chooser->priv; + + if (priv->loader != loader) + { + if (priv->loader) + g_object_unref (priv->loader); + + if (loader) + { + priv->loader = g_object_ref (loader); + gdict_source_chooser_refresh (chooser); + } + + g_object_notify (G_OBJECT (chooser), "loader"); + } +} + +/** + * gdict_source_chooser_get_loader: + * @chooser: a #GdictSourceChooser + * + * Retrieves the #GdictSourceLoader used by @chooser. + * + * Return value: a #GdictSourceLoader or %NULL is none is set + * + * Since: 0.12 + */ +GdictSourceLoader * +gdict_source_chooser_get_loader (GdictSourceChooser *chooser) +{ + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), NULL); + + return chooser->priv->loader; +} + +typedef struct +{ + gchar *source_name; + GdictSourceChooser *chooser; + + guint found : 1; + guint do_select : 1; + guint do_activate : 1; +} SelectData; + +static gboolean +scan_for_source_name (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data) +{ + SelectData *select_data = user_data; + gchar *source_name = NULL; + + if (!select_data) + return TRUE; + + gtk_tree_model_get (model, iter, SOURCE_NAME, &source_name, -1); + if (!source_name) + return FALSE; + + if (strcmp (source_name, select_data->source_name) == 0) + { + GtkTreeView *tree_view; + GtkTreeSelection *selection; + + select_data->found = TRUE; + + tree_view = GTK_TREE_VIEW (select_data->chooser->priv->treeview); + + if (select_data->do_activate) + { + GtkTreeViewColumn *column; + + column = gtk_tree_view_get_column (tree_view, 2); + + gtk_list_store_set (GTK_LIST_STORE (model), iter, + SOURCE_CURRENT, PANGO_WEIGHT_BOLD, + -1); + + gtk_tree_view_row_activated (tree_view, path, column); + } + + selection = gtk_tree_view_get_selection (tree_view); + if (select_data->do_select) + gtk_tree_selection_select_path (selection, path); + else + gtk_tree_selection_unselect_path (selection, path); + } + else + { + gtk_list_store_set (GTK_LIST_STORE (model), iter, + SOURCE_CURRENT, PANGO_WEIGHT_NORMAL, + -1); + } + + g_free (source_name); + + return FALSE; +} + +/** + * gdict_source_chooser_select_source: + * @chooser: a #GdictSourceChooser + * @source_name: the name of a dictionary source + * + * Selects the dictionary source named @source_name inside @chooser. + * The selection is moved but the row containing the dictionary source + * is not activated. + * + * Return value: %TRUE if the source was found and selected + * + * Since: 0.12 + */ +gboolean +gdict_source_chooser_select_source (GdictSourceChooser *chooser, + const gchar *source_name) +{ + GdictSourceChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (source_name != NULL, FALSE); + + priv = chooser->priv; + + data.source_name = g_strdup (source_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = TRUE; + data.do_activate = FALSE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_source_name, + &data); + + retval = data.found; + + g_free (data.source_name); + + return retval; +} + +/** + * gdict_source_chooser_unselect_source: + * @chooser: a #GdictSourceChooser + * @source_name: the name of a dictionary source + * + * Unselects @source_name inside @chooser. + * + * Return value: %TRUE if the source was found and unselected + * + * Since: 0.12 + */ +gboolean +gdict_source_chooser_unselect_source (GdictSourceChooser *chooser, + const gchar *source_name) +{ + GdictSourceChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (source_name != NULL, FALSE); + + priv = chooser->priv; + + data.source_name = g_strdup (source_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = FALSE; + data.do_activate = FALSE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_source_name, + &data); + + retval = data.found; + + g_free (data.source_name); + + return retval; +} + +/** + * gdict_source_chooser_set_current_source: + * @chooser: a #GdictSourceChooser + * @source_name: the name of a dictionary source + * + * Sets the current dictionary source named @source_name. The row + * of the source, if found, will be selected and activated. + * + * Return value: %TRUE if the source was found + * + * Since: 0.12 + */ +gboolean +gdict_source_chooser_set_current_source (GdictSourceChooser *chooser, + const gchar *source_name) +{ + GdictSourceChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (source_name != NULL, FALSE); + + priv = chooser->priv; + + if (priv->current_source && !strcmp (priv->current_source, source_name)) + return TRUE; + + data.source_name = g_strdup (source_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = TRUE; + data.do_activate = TRUE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_source_name, + &data); + + retval = data.found; + + GDICT_NOTE (CHOOSER, "%s current source: %s", + data.found ? "set" : "not set", + data.source_name); + + if (data.found) + { + g_free (priv->current_source); + priv->current_source = data.source_name; + } + else + g_free (data.source_name); + + return retval; +} + +/** + * gdict_source_chooser_get_current_source: + * @chooser: a #GdictSourceChooser + * + * Retrieves the currently selected source. + * + * Return value: a newly allocated string containing the name of + * the currently selected source. Use g_free() when done using it + * + * Since: 0.12 + */ +gchar * +gdict_source_chooser_get_current_source (GdictSourceChooser *chooser) +{ + GdictSourceChooserPrivate *priv; + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + gchar *retval = NULL; + + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), NULL); + + priv = chooser->priv; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return NULL; + + gtk_tree_model_get (model, &iter, SOURCE_NAME, &retval, -1); + + g_free (priv->current_source); + priv->current_source = g_strdup (retval); + + return retval; +} + +/** + * gdict_source_chooser_get_sources: + * @chooser: a #GdictSouceChooser + * @length: return location for the length of the returned vector + * + * Retrieves the names of the available dictionary sources. + * + * Return value: a newly allocated, %NULL terminated string vector + * containing the names of the available sources. Use g_strfreev() + * when done using it. + * + * Since: 0.12 + */ +gchar ** +gdict_source_chooser_get_sources (GdictSourceChooser *chooser, + gsize *length) +{ + GdictSourceChooserPrivate *priv; + gchar **retval; + gsize retval_len; + + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), NULL); + + priv = chooser->priv; + + if (!priv->loader) + return NULL; + + retval = gdict_source_loader_get_names (priv->loader, &retval_len); + if (length) + *length = retval_len; + + return retval; +} + +/** + * gdict_source_chooser_count_sources: + * @chooser: a #GdictSourceChooser + * + * Retrieve the number of available dictionary sources. + * + * Return value: the number of available sources, or -1 if no + * #GdictSourceLoader has been set + * + * Since: 0.12 + */ +gint +gdict_source_chooser_count_sources (GdictSourceChooser *chooser) +{ + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), -1); + + return chooser->priv->n_sources; +} + +/** + * gdict_source_chooser_has_source: + * @chooser: a #GdictSourceChooser + * @source_name: the name of a dictionary source + * + * Checks whether @chooser has a dictionary source named @source_name. + * + * Return value: %TRUE if the dictionary source was found + * + * Since: 0.12 + */ +gboolean +gdict_source_chooser_has_source (GdictSourceChooser *chooser, + const gchar *source_name) +{ + GdictSourceChooserPrivate *priv; + + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), FALSE); + g_return_val_if_fail (source_name != NULL, FALSE); + + priv = chooser->priv; + + if (!priv->loader) + return FALSE; + + return gdict_source_loader_has_source (priv->loader, source_name); +} + +/** + * gdict_source_chooser_refresh: + * @chooser: a #GdictSourceChooser + * + * Forces a refresh on the contents of the source chooser widget + * + * Since: 0.12 + */ +void +gdict_source_chooser_refresh (GdictSourceChooser *chooser) +{ + GdictSourceChooserPrivate *priv; + + g_return_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser)); + + priv = chooser->priv; + + if (priv->loader) + { + const GSList *sources, *l; + + if (priv->treeview) + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), NULL); + + gtk_list_store_clear (priv->store); + + sources = gdict_source_loader_get_sources (priv->loader); + for (l = sources; l != NULL; l = l->next) + { + GdictSource *source = l->data; + const gchar *name, *description; + GdictSourceTransport transport; + gint weight; + + transport = gdict_source_get_transport (source); + name = gdict_source_get_name (source); + description = gdict_source_get_description (source); + weight = PANGO_WEIGHT_NORMAL; + + if (priv->current_source && !strcmp (priv->current_source, name)) + weight = PANGO_WEIGHT_BOLD; + + gtk_list_store_insert_with_values (priv->store, NULL, -1, + SOURCE_TRANSPORT, transport, + SOURCE_NAME, name, + SOURCE_DESCRIPTION, description, + SOURCE_CURRENT, weight, + -1); + } + + if (priv->treeview) + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); + } +} + +/** + * gdict_source_chooser_add_button: + * @chooser: a #GdictSourceChooser + * @button_text: text of the button + * + * Adds a #GtkButton with @button_text to the button area on + * the bottom of @chooser. The @button_text can also be a + * stock ID. + * + * Return value: the newly packed button. + * + * Since: 0.12 + */ +GtkWidget * +gdict_source_chooser_add_button (GdictSourceChooser *chooser, + const gchar *button_text) +{ + GdictSourceChooserPrivate *priv; + GtkWidget *button; + + g_return_val_if_fail (GDICT_IS_SOURCE_CHOOSER (chooser), NULL); + g_return_val_if_fail (button_text != NULL, NULL); + + priv = chooser->priv; + + button = gtk_button_new_from_stock (button_text); + + gtk_widget_set_can_default (button, TRUE); + + gtk_widget_show (button); + + gtk_box_pack_end (GTK_BOX (priv->buttons_box), button, FALSE, TRUE, 0); + + return button; +} + diff --git a/mate-dictionary/libgdict/gdict-source-chooser.h b/mate-dictionary/libgdict/gdict-source-chooser.h new file mode 100644 index 00000000..ed9bf3fc --- /dev/null +++ b/mate-dictionary/libgdict/gdict-source-chooser.h @@ -0,0 +1,93 @@ +/* gdict-source-chooser.h - display widget for dictionary sources + * + * Copyright (C) 2007 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_SOURCE_CHOOSER_H__ +#define __GDICT_SOURCE_CHOOSER_H__ + +#include <gtk/gtk.h> +#include "gdict-source-loader.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_SOURCE_CHOOSER (gdict_source_chooser_get_type ()) +#define GDICT_SOURCE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SOURCE_CHOOSER, GdictSourceChooser)) +#define GDICT_IS_SOURCE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SOURCE_CHOOSER)) +#define GDICT_SOURCE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SOURCE_CHOOSER, GdictSourceChooserClass)) +#define GDICT_IS_SOURCE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SOURCE_CHOOSER)) +#define GDICT_SOURCE_CHOOSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SOURCE_CHOOSER, GdictSourceChooserClass)) + +typedef struct _GdictSourceChooser GdictSourceChooser; +typedef struct _GdictSourceChooserPrivate GdictSourceChooserPrivate; +typedef struct _GdictSourceChooserClass GdictSourceChooserClass; + +struct _GdictSourceChooser +{ + /*< private >*/ + GtkVBox parent_instance; + + GdictSourceChooserPrivate *priv; +}; + +struct _GdictSourceChooserClass +{ + /*< private >*/ + GtkVBoxClass parent_class; + + /*< public >*/ + void (*source_activated) (GdictSourceChooser *chooser, + const gchar *source_name, + GdictSource *source); + void (*selection_changed) (GdictSourceChooser *chooser); + + /*< private >*/ + /* padding for future expansion */ + void (*_gdict_padding1) (void); + void (*_gdict_padding2) (void); + void (*_gdict_padding3) (void); + void (*_gdict_padding4) (void); + void (*_gdict_padding5) (void); + void (*_gdict_padding6) (void); +}; + +GType gdict_source_chooser_get_type (void) G_GNUC_CONST; + +GtkWidget * gdict_source_chooser_new (void); +GtkWidget * gdict_source_chooser_new_with_loader (GdictSourceLoader *loader); +void gdict_source_chooser_set_loader (GdictSourceChooser *chooser, + GdictSourceLoader *loader); +GdictSourceLoader *gdict_source_chooser_get_loader (GdictSourceChooser *chooser); +gboolean gdict_source_chooser_select_source (GdictSourceChooser *chooser, + const gchar *source_name); +gboolean gdict_source_chooser_unselect_source (GdictSourceChooser *chooser, + const gchar *source_name); +gboolean gdict_source_chooser_set_current_source (GdictSourceChooser *chooser, + const gchar *source_name); +gchar * gdict_source_chooser_get_current_source (GdictSourceChooser *chooser) G_GNUC_MALLOC; +gchar ** gdict_source_chooser_get_sources (GdictSourceChooser *chooser, + gsize *length) G_GNUC_MALLOC; +gint gdict_source_chooser_count_sources (GdictSourceChooser *chooser); +gboolean gdict_source_chooser_has_source (GdictSourceChooser *chooser, + const gchar *source_name); +void gdict_source_chooser_refresh (GdictSourceChooser *chooser); +GtkWidget * gdict_source_chooser_add_button (GdictSourceChooser *chooser, + const gchar *button_text); + +G_END_DECLS + +#endif /* __GDICT_SOURCE_CHOOSER_H__ */ diff --git a/mate-dictionary/libgdict/gdict-source-loader.c b/mate-dictionary/libgdict/gdict-source-loader.c new file mode 100644 index 00000000..71d919af --- /dev/null +++ b/mate-dictionary/libgdict/gdict-source-loader.c @@ -0,0 +1,600 @@ +/* gdict-source-loader.c - Source loader for Gdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-source-loader + * @short_description: Loader object for a set of dictionary sources + * + * #GdictSourceLoader allows searching for dictionary source definition + * files inside a set of paths and return a #GdictSource using its name. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <glib.h> +#include <glib/gstdio.h> +#include <glib/gi18n-lib.h> + +#include "gdict-source-loader.h" +#include "gdict-utils.h" +#include "gdict-enum-types.h" +#include "gdict-marshal.h" +#include "gdict-private.h" + +#define GDICT_SOURCE_FILE_SUFFIX ".desktop" + +#define GDICT_SOURCE_LOADER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoaderPrivate)) + +struct _GdictSourceLoaderPrivate +{ + GSList *paths; + + GSList *sources; + GHashTable *sources_by_name; + + guint paths_dirty : 1; +}; + +enum +{ + PROP_0, + + PROP_PATHS, + PROP_SOURCES +}; + +enum +{ + SOURCE_LOADED, + + LAST_SIGNAL +}; + +static guint loader_signals[LAST_SIGNAL] = { 0 }; + + + +G_DEFINE_TYPE (GdictSourceLoader, gdict_source_loader, G_TYPE_OBJECT); + + +static void +gdict_source_loader_finalize (GObject *object) +{ + GdictSourceLoaderPrivate *priv = GDICT_SOURCE_LOADER_GET_PRIVATE (object); + + if (priv->paths) + { + g_slist_foreach (priv->paths, + (GFunc) g_free, + NULL); + g_slist_free (priv->paths); + + priv->paths = NULL; + } + + if (priv->sources_by_name) + g_hash_table_destroy (priv->sources_by_name); + + if (priv->sources) + { + g_slist_foreach (priv->sources, + (GFunc) g_object_unref, + NULL); + g_slist_free (priv->sources); + + priv->sources = NULL; + } + + G_OBJECT_CLASS (gdict_source_loader_parent_class)->finalize (object); +} + +static void +gdict_source_loader_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) + { + case PROP_PATHS: + break; + case PROP_SOURCES: + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_source_loader_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) + { + case PROP_PATHS: + break; + case PROP_SOURCES: + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_source_loader_class_init (GdictSourceLoaderClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = gdict_source_loader_set_property; + gobject_class->get_property = gdict_source_loader_get_property; + gobject_class->finalize = gdict_source_loader_finalize; + + /** + * GdictSourceLoader:paths + * + * The search paths used by this object + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_PATHS, + g_param_spec_pointer ("paths", + _("Paths"), + _("Search paths used by this object"), + G_PARAM_READABLE)); + /** + * GdictSourceLoader:sources + * + * The #GdictSource objects found by this object + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_SOURCES, + g_param_spec_pointer ("sources", + _("Sources"), + _("Dictionary sources found"), + G_PARAM_READABLE)); + + /** + * GdictSourceLoader::source-loaded + * @loader: the object which received the signal + * @source: the new #GdictSource object found + * + * This signal is emitted when a new dictionary source has been added + * to the list. + * + * Since: 1.0 + */ + loader_signals[SOURCE_LOADED] = + g_signal_new ("source-loaded", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictSourceLoaderClass, source_loaded), + NULL, NULL, + gdict_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDICT_TYPE_SOURCE); + + g_type_class_add_private (klass, sizeof (GdictSourceLoaderPrivate)); +} + +static void +gdict_source_loader_init (GdictSourceLoader *loader) +{ + GdictSourceLoaderPrivate *priv; + + priv = GDICT_SOURCE_LOADER_GET_PRIVATE (loader); + loader->priv = priv; + + priv->paths = NULL; + /* add the default, system-wide path */ + priv->paths = g_slist_prepend (priv->paths, g_strdup (GDICTSOURCESDIR)); + + priv->sources = NULL; + priv->sources_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + NULL); + + /* ensure that the sources list will be updated */ + priv->paths_dirty = TRUE; +} + +/** + * gdict_source_loader_new: + * + * Creates a new #GdictSourceLoader object. This object is used to search + * into a list of paths for dictionary source files. See #GdictSource for + * more informations about the format of dictionary source files. + * + * Return value: a new #GdictSourceLoader object + * + * Since: 1.0 + */ +GdictSourceLoader * +gdict_source_loader_new (void) +{ + return g_object_new (GDICT_TYPE_SOURCE_LOADER, NULL); +} + +/** + * gdict_source_loader_update: + * @loader: a #GdictSourceLoader + * + * Queue an update of the sources inside @loader. + * + * Since: 1.0 + */ +void +gdict_source_loader_update (GdictSourceLoader *loader) +{ + g_return_if_fail (GDICT_IS_SOURCE_LOADER (loader)); + + loader->priv->paths_dirty = TRUE; +} + +/** + * gdict_source_loader_add_search_path: + * @loader: a #GdictSourceLoader + * @path: a path to be added to the search path list + * + * Adds @path to the search paths list of @loader. + * + * Since: 1.0 + */ +void +gdict_source_loader_add_search_path (GdictSourceLoader *loader, + const gchar *path) +{ + GSList *l; + + g_return_if_fail (GDICT_IS_SOURCE_LOADER (loader)); + g_return_if_fail (path != NULL); + + /* avoid duplications */ + for (l = loader->priv->paths; l != NULL; l = l->next) + if (strcmp (path, (gchar *) l->data) == 0) + return; + + loader->priv->paths = g_slist_append (loader->priv->paths, g_strdup (path)); + loader->priv->paths_dirty = TRUE; +} + +/** + * gdict_source_loader_get_paths: + * @loader: a #GdictSourceLoader + * + * Gets the list of paths used by @loader to search for dictionary source + * files. + * + * Return value: a list containing the paths. The returned list is owned + * by the #GdictSourceLoader object and should never be free or modified. + * + * Since: 1.0 + */ +const GSList * +gdict_source_loader_get_paths (GdictSourceLoader *loader) +{ + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), NULL); + + return loader->priv->paths; +} + +/* create the list of dictionary source files, by scanning the search path + * directories for .desktop files; we disavow symlinks and sub-directories + * for the time being. + */ +static GSList * +build_source_filenames (GdictSourceLoader *loader) +{ + GSList *retval, *d; + + g_assert (GDICT_IS_SOURCE_LOADER (loader)); + + if (!loader->priv->paths) + return NULL; + + retval = NULL; + for (d = loader->priv->paths; d != NULL; d = d->next) + { + gchar *path = (gchar *) d->data; + const gchar *filename; + GDir *dir; + + dir = g_dir_open (path, 0, NULL); + if (!dir) + continue; + + do + { + filename = g_dir_read_name (dir); + if (filename) + { + gchar *full_path; + + if (!g_str_has_suffix (filename, GDICT_SOURCE_FILE_SUFFIX)) + break; + + full_path = g_build_filename (path, filename, NULL); + if (g_file_test (full_path, G_FILE_TEST_IS_REGULAR)) + { + retval = g_slist_prepend (retval, full_path); + } + } + } + while (filename != NULL); + + g_dir_close (dir); + } + + return g_slist_reverse (retval); +} + +static void +gdict_source_loader_update_sources (GdictSourceLoader *loader) +{ + GSList *filenames, *f; + + g_assert (GDICT_IS_SOURCE_LOADER (loader)); + + g_slist_foreach (loader->priv->sources, + (GFunc) g_object_unref, + NULL); + g_slist_free (loader->priv->sources); + loader->priv->sources = NULL; + + filenames = build_source_filenames (loader); + for (f = filenames; f != NULL; f = f->next) + { + GdictSource *source; + GError *load_err; + gchar *path = (gchar *) f->data; + + g_assert (path != NULL); + + source = gdict_source_new (); + + load_err = NULL; + gdict_source_load_from_file (source, path, &load_err); + if (load_err) + { + g_warning ("Unable to load dictionary source at '%s': %s\n", + path, + load_err->message); + g_error_free (load_err); + + continue; + } + + loader->priv->sources = g_slist_append (loader->priv->sources, + source); + g_hash_table_replace (loader->priv->sources_by_name, + g_strdup (gdict_source_get_name (source)), + source); + + g_signal_emit (loader, loader_signals[SOURCE_LOADED], 0, source); + } + + g_slist_foreach (filenames, + (GFunc) g_free, + NULL); + g_slist_free (filenames); + + loader->priv->paths_dirty = FALSE; +} + +/** + * gdict_source_loader_get_names: + * @loader: a #GdictSourceLoader + * @length: return location for the number of source names, or %NULL + * + * Retrieves the list of dictionary source names available into the + * search paths of @loader. + * + * Return value: a newly allocated, %NULL terminated array of strings. You + * should free the returned string array with g_strfreev() + * + * Since: 1.0 + */ +gchar ** +gdict_source_loader_get_names (GdictSourceLoader *loader, + gsize *length) +{ + GSList *l; + gchar **names; + gsize i; + + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), NULL); + + if (loader->priv->paths_dirty) + gdict_source_loader_update_sources (loader); + + names = g_new0 (gchar *, g_slist_length (loader->priv->sources) + 1); + + i = 0; + for (l = loader->priv->sources; l != NULL; l = l->next) + { + GdictSource *s = GDICT_SOURCE (l->data); + + g_assert (s != NULL); + + names[i++] = g_strdup (gdict_source_get_name (s)); + } + names[i] = NULL; + + if (length) + *length = i; + + return names; +} + +/** + * gdict_source_loader_get_sources: + * @loader: a #GdictSourceLoader + * + * Retrieves the list of dictionary sources available into the search + * paths of @loader, in form of #GdictSource objects. + * + * Return value: a list of #GdictSource objects. The returned list + * is owned by the #GdictSourceLoader object, and should never be + * freed or modified. + * + * Since: 1.0 + */ +const GSList * +gdict_source_loader_get_sources (GdictSourceLoader *loader) +{ + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), NULL); + + if (loader->priv->paths_dirty) + gdict_source_loader_update_sources (loader); + + return loader->priv->sources; +} + +/** + * gdict_source_loader_get_source: + * @loader: a #GdictSourceLoader + * @name: a name of a dictionary source + * + * Retrieves a dictionary source using @name. You can use the returned + * #GdictSource object to create the right #GdictContext for that + * dictionary source. + * + * Return value: a referenced #GdictSource object. You should de-reference + * it using g_object_unref() when you finished using it. + * + * Since: 1.0 + */ +GdictSource * +gdict_source_loader_get_source (GdictSourceLoader *loader, + const gchar *name) +{ + GdictSource *retval; + + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), NULL); + g_return_val_if_fail (name != NULL, NULL); + + if (loader->priv->paths_dirty) + gdict_source_loader_update_sources (loader); + + retval = g_hash_table_lookup (loader->priv->sources_by_name, name); + if (retval) + return g_object_ref (retval); + + return NULL; +} + +/** + * gdict_source_loader_remove_source: + * @loader: a #GdictSourceLoader + * @name: name of a dictionary source + * + * Removes the dictionary source @name from @loader. This function will + * also remove the dictionary source definition file bound to it. + * + * Return value: %TRUE if the dictionary source was successfully removed + * + * Since: 1.0 + */ +gboolean +gdict_source_loader_remove_source (GdictSourceLoader *loader, + const gchar *name) +{ + GdictSourceLoaderPrivate *priv; + GSList *l; + + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), FALSE); + g_return_val_if_fail (name != NULL, FALSE); + + priv = loader->priv; + + if (priv->paths_dirty) + gdict_source_loader_update_sources (loader); + + for (l = priv->sources; l != NULL; l = l->next) + { + GdictSource *s = GDICT_SOURCE (l->data); + + if (strcmp (gdict_source_get_name (s), name) == 0) + { + gchar *filename; + + g_object_get (G_OBJECT (s), "filename", &filename, NULL); + + if (g_unlink (filename) == -1) + { + g_warning ("Unable to remove filename '%s' for the " + "dictionary source '%s'\n", + filename, + name); + + return FALSE; + } + + g_hash_table_remove (priv->sources_by_name, name); + + priv->sources = g_slist_remove_link (priv->sources, l); + + g_object_unref (s); + g_slist_free (l); + + return TRUE; + } + } + + return FALSE; +} + +/** + * gdict_source_loader_has_source: + * @loader: a #GdictSourceLoader + * @source_name: the name of a dictionary source + * + * Checks whether @loader has a dictionary source with name @source_name. + * + * Return value: %TRUE if the dictionary source is known + * + * Since: 0.12 + */ +gboolean +gdict_source_loader_has_source (GdictSourceLoader *loader, + const gchar *source_name) +{ + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), FALSE); + g_return_val_if_fail (source_name != NULL, FALSE); + + if (loader->priv->paths_dirty) + gdict_source_loader_update_sources (loader); + + return (g_hash_table_lookup (loader->priv->sources_by_name, source_name) != NULL); +} diff --git a/mate-dictionary/libgdict/gdict-source-loader.h b/mate-dictionary/libgdict/gdict-source-loader.h new file mode 100644 index 00000000..51f7bb78 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-source-loader.h @@ -0,0 +1,81 @@ +/* gdict-source-loader.h - Source loader for Gdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_SOURCE_LOADER_H__ +#define __GDICT_SOURCE_LOADER_H__ + +#include <glib-object.h> +#include "gdict-source.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_SOURCE_LOADER (gdict_source_loader_get_type ()) +#define GDICT_SOURCE_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoader)) +#define GDICT_IS_SOURCE_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SOURCE_LOADER)) +#define GDICT_SOURCE_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoaderClass)) +#define GDICT_IS_SOURCE_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SOURCE_LOADER)) +#define GDICT_SOURCE_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoaderClass)) + +typedef struct _GdictSourceLoader GdictSourceLoader; +typedef struct _GdictSourceLoaderClass GdictSourceLoaderClass; +typedef struct _GdictSourceLoaderPrivate GdictSourceLoaderPrivate; + + +struct _GdictSourceLoader +{ + /*< private >*/ + GObject parent_instance; + + GdictSourceLoaderPrivate *priv; +}; + +struct _GdictSourceLoaderClass +{ + GObjectClass parent_class; + + void (*source_loaded) (GdictSourceLoader *loader, + GdictSource *source); + + /* padding for future expansion */ + void (*_gdict_source_1) (void); + void (*_gdict_source_2) (void); + void (*_gdict_source_3) (void); + void (*_gdict_source_4) (void); +}; + +GType gdict_source_loader_get_type (void) G_GNUC_CONST; + +GdictSourceLoader * gdict_source_loader_new (void); +void gdict_source_loader_update (GdictSourceLoader *loader); +void gdict_source_loader_add_search_path (GdictSourceLoader *loader, + const gchar *path); +const GSList *gdict_source_loader_get_paths (GdictSourceLoader *loader); +gchar ** gdict_source_loader_get_names (GdictSourceLoader *loader, + gsize *length) G_GNUC_MALLOC; +const GSList *gdict_source_loader_get_sources (GdictSourceLoader *loader); +GdictSource * gdict_source_loader_get_source (GdictSourceLoader *loader, + const gchar *name); +gboolean gdict_source_loader_has_source (GdictSourceLoader *loader, + const gchar *source_name); +gboolean gdict_source_loader_remove_source (GdictSourceLoader *loader, + const gchar *name); + +G_END_DECLS + +#endif /* __GDICT_SOURCE_LOADER_H__ */ diff --git a/mate-dictionary/libgdict/gdict-source.c b/mate-dictionary/libgdict/gdict-source.c new file mode 100644 index 00000000..aea506d2 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-source.c @@ -0,0 +1,1195 @@ +/* gdict-source.c - Source configuration for Gdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-source + * @short_description: A dictionary source definition + * + * #GdictSource is the representation of a #GdictContext. Each dictionary + * source provides a list of available dictionaries (databases) and a list + * of available matching strategies. Using a #GdictContext you can query + * the dictionary source for matching words and for definitions. + * + * By using a #GdictSource object you can retrieve the appropriate + * #GdictContext, already set up with the right parameters. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <glib/gi18n-lib.h> + +#include "gdict-source.h" +#include "gdict-client-context.h" +#include "gdict-utils.h" +#include "gdict-enum-types.h" +#include "gdict-private.h" + +/* Main group */ +#define SOURCE_GROUP "Dictionary Source" + +/* Common keys */ +#define SOURCE_KEY_NAME "Name" +#define SOURCE_KEY_DESCRIPTION "Description" +#define SOURCE_KEY_TRANSPORT "Transport" +#define SOURCE_KEY_DATABASE "Database" +#define SOURCE_KEY_STRATEGY "Strategy" + +/* dictd transport keys */ +#define SOURCE_KEY_HOSTNAME "Hostname" +#define SOURCE_KEY_PORT "Port" + + +#define GDICT_SOURCE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SOURCE, GdictSourcePrivate)) + +struct _GdictSourcePrivate +{ + gchar *filename; + GKeyFile *keyfile; + + gchar *name; + gchar *description; + + gchar *database; + gchar *strategy; + + GdictSourceTransport transport; + + GdictContext *context; +}; + +enum +{ + PROP_0, + + PROP_FILENAME, + PROP_NAME, + PROP_DESCRIPTION, + PROP_DATABASE, + PROP_STRATEGY, + PROP_TRANSPORT, + PROP_CONTEXT +}; + +/* keep in sync with GdictSourceTransport */ +static const gchar *valid_transports[] = +{ + "dictd", /* GDICT_SOURCE_TRANSPORT_DICTD */ + + NULL /* GDICT_SOURCE_TRANSPORT_INVALID */ +}; + +#define IS_VALID_TRANSPORT(t) (((t) >= GDICT_SOURCE_TRANSPORT_DICTD) && \ + ((t) < GDICT_SOURCE_TRANSPORT_INVALID)) + +GQuark +gdict_source_error_quark (void) +{ + static GQuark quark = 0; + + if (G_UNLIKELY (quark == 0)) + quark = g_quark_from_static_string ("gdict-source-error-quark"); + + return quark; +} + + +G_DEFINE_TYPE (GdictSource, gdict_source, G_TYPE_OBJECT); + + + +static void +gdict_source_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictSource *source = GDICT_SOURCE (object); + + switch (prop_id) + { + case PROP_NAME: + gdict_source_set_name (source, g_value_get_string (value)); + break; + case PROP_DESCRIPTION: + gdict_source_set_description (source, g_value_get_string (value)); + break; + case PROP_TRANSPORT: + gdict_source_set_transport (source, g_value_get_enum (value), NULL); + break; + case PROP_DATABASE: + gdict_source_set_database (source, g_value_get_string (value)); + break; + case PROP_STRATEGY: + gdict_source_set_strategy (source, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_source_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictSource *source = GDICT_SOURCE (object); + GdictSourcePrivate *priv = source->priv; + + switch (prop_id) + { + case PROP_FILENAME: + g_value_set_string (value, priv->filename); + break; + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_DESCRIPTION: + g_value_set_string (value, priv->description); + break; + case PROP_DATABASE: + g_value_set_string (value, priv->database); + break; + case PROP_STRATEGY: + g_value_set_string (value, priv->strategy); + break; + case PROP_TRANSPORT: + g_value_set_enum (value, priv->transport); + break; + case PROP_CONTEXT: + g_value_set_object (value, gdict_source_peek_context (source)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_source_finalize (GObject *object) +{ + GdictSourcePrivate *priv = GDICT_SOURCE_GET_PRIVATE (object); + + g_free (priv->filename); + + if (priv->keyfile) + g_key_file_free (priv->keyfile); + + g_free (priv->name); + g_free (priv->description); + + g_free (priv->database); + g_free (priv->strategy); + + if (priv->context) + g_object_unref (priv->context); + + G_OBJECT_CLASS (gdict_source_parent_class)->finalize (object); +} + +static void +gdict_source_class_init (GdictSourceClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = gdict_source_set_property; + gobject_class->get_property = gdict_source_get_property; + gobject_class->finalize = gdict_source_finalize; + + /** + * GdictSource:filename + * + * The filename used by this dictionary source. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_FILENAME, + g_param_spec_string ("filename", + _("Filename"), + _("The filename used by this dictionary source"), + NULL, + G_PARAM_READABLE)); + /** + * GdictSource:name + * + * The display name of this dictionary source. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_NAME, + g_param_spec_string ("name", + _("Name"), + _("The display name of this dictonary source"), + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictSource:description + * + * The description of this dictionary source. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_DESCRIPTION, + g_param_spec_string ("description", + _("Description"), + _("The description of this dictionary source"), + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictSource:database + * + * The default database of this dictionary source. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_DATABASE, + g_param_spec_string ("database", + _("Database"), + _("The default database of this dictonary source"), + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictSource:strategy + * + * The default strategy of this dictionary source. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_STRATEGY, + g_param_spec_string ("strategy", + _("Strategy"), + _("The default strategy of this dictonary source"), + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictSource:transport + * + * The transport mechanism used by this source. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_TRANSPORT, + g_param_spec_enum ("transport", + _("Transport"), + _("The transport mechanism used by this dictionary source"), + GDICT_TYPE_SOURCE_TRANSPORT, + GDICT_SOURCE_TRANSPORT_INVALID, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + /** + * GdictSource:context + * + * The #GdictContext bound to this source. + * + * Since: 1.0 + */ + g_object_class_install_property (gobject_class, + PROP_CONTEXT, + g_param_spec_object ("context", + _("Context"), + _("The GdictContext bound to this source"), + GDICT_TYPE_CONTEXT, + G_PARAM_READABLE)); + + g_type_class_add_private (klass, sizeof (GdictSourcePrivate)); +} + +static void +gdict_source_init (GdictSource *source) +{ + GdictSourcePrivate *priv; + + priv = GDICT_SOURCE_GET_PRIVATE (source); + source->priv = priv; + + priv->filename = NULL; + priv->keyfile = g_key_file_new (); + + priv->name = NULL; + priv->description = NULL; + priv->database = NULL; + priv->strategy = NULL; + priv->transport = GDICT_SOURCE_TRANSPORT_INVALID; + + priv->context = NULL; +} + +/** + * gdict_source_new: + * + * Creates an empty #GdictSource object. Use gdict_load_from_file() to + * read an existing dictionary source definition file. + * + * Return value: an empty #GdictSource + */ +GdictSource * +gdict_source_new (void) +{ + return g_object_new (GDICT_TYPE_SOURCE, NULL); +} + +static GdictSourceTransport +gdict_source_resolve_transport (const gchar *transport) +{ + if (!transport) + return GDICT_SOURCE_TRANSPORT_INVALID; + + if (strcmp (transport, "dictd") == 0) + return GDICT_SOURCE_TRANSPORT_DICTD; + else + return GDICT_SOURCE_TRANSPORT_INVALID; + + g_assert_not_reached (); +} + +static GdictContext * +gdict_source_create_context (GdictSource *source, + GdictSourceTransport transport, + GError **error) +{ + GdictSourcePrivate *priv; + GdictContext *context; + + g_assert (GDICT_IS_SOURCE (source)); + + priv = source->priv; + + switch (transport) + { + case GDICT_SOURCE_TRANSPORT_DICTD: + { + gchar *hostname; + gint port; + + hostname = g_key_file_get_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_HOSTNAME, + NULL); + + port = g_key_file_get_integer (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_PORT, + NULL); + if (!port) + port = -1; + + context = gdict_client_context_new (hostname, port); + + if (hostname) + g_free (hostname); + } + break; + default: + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_PARSE, + _("Invalid transport type '%d'"), + transport); + return NULL; + } + + g_assert (context != NULL); + + if (priv->transport != transport) + priv->transport = transport; + + return context; +} + +static gboolean +gdict_source_parse (GdictSource *source, + GError **error) +{ + GdictSourcePrivate *priv; + GError *parse_error; + gchar *transport; + GdictSourceTransport t; + + priv = source->priv; + + if (!g_key_file_has_group (priv->keyfile, SOURCE_GROUP)) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_PARSE, + _("No '%s' group found inside the dictionary source definition"), + SOURCE_GROUP); + + return FALSE; + } + + /* fetch the name for the dictionary source definition */ + parse_error = NULL; + priv->name = g_key_file_get_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_NAME, + &parse_error); + if (parse_error) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_PARSE, + _("Unable to get the '%s' key inside the dictionary " + "source definition: %s"), + SOURCE_KEY_NAME, + parse_error->message); + g_error_free (parse_error); + + g_key_file_free (priv->keyfile); + priv->keyfile = NULL; + + return FALSE; + } + + /* if present, fetch the localized description */ + if (g_key_file_has_key (priv->keyfile, SOURCE_GROUP, SOURCE_KEY_DESCRIPTION, NULL)) + { + priv->description = g_key_file_get_locale_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DESCRIPTION, + NULL, + &parse_error); + if (parse_error) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_PARSE, + _("Unable to get the '%s' key inside the dictionary " + "source definition: %s"), + SOURCE_KEY_DESCRIPTION, + parse_error->message); + + g_error_free (parse_error); + g_key_file_free (priv->keyfile); + priv->keyfile = NULL; + g_free (priv->name); + + return FALSE; + } + } + + if (g_key_file_has_key (priv->keyfile, SOURCE_GROUP, SOURCE_KEY_DATABASE, NULL)) + { + priv->database = g_key_file_get_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DATABASE, + &parse_error); + if (parse_error) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_PARSE, + _("Unable to get the '%s' key inside the dictionary " + "source definition: %s"), + SOURCE_KEY_DATABASE, + parse_error->message); + + g_error_free (parse_error); + g_key_file_free (priv->keyfile); + priv->keyfile = NULL; + g_free (priv->name); + g_free (priv->description); + + return FALSE; + } + } + + if (g_key_file_has_key (priv->keyfile, SOURCE_GROUP, SOURCE_KEY_STRATEGY, NULL)) + { + priv->strategy = g_key_file_get_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_STRATEGY, + &parse_error); + if (parse_error) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_PARSE, + _("Unable to get the '%s' key inside the dictionary " + "source definition: %s"), + SOURCE_KEY_STRATEGY, + parse_error->message); + + g_error_free (parse_error); + g_key_file_free (priv->keyfile); + priv->keyfile = NULL; + + g_free (priv->name); + g_free (priv->description); + g_free (priv->database); + + return FALSE; + } + } + + transport = g_key_file_get_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_TRANSPORT, + &parse_error); + if (parse_error) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_PARSE, + _("Unable to get the '%s' key inside the dictionary " + "source definition file: %s"), + SOURCE_KEY_TRANSPORT, + parse_error->message); + + g_error_free (parse_error); + g_key_file_free (priv->keyfile); + priv->keyfile = NULL; + g_free (priv->name); + g_free (priv->description); + g_free (priv->database); + g_free (priv->strategy); + + return FALSE; + } + + t = gdict_source_resolve_transport (transport); + g_free (transport); + + priv->context = gdict_source_create_context (source, t, &parse_error); + if (parse_error) + { + g_propagate_error (error, parse_error); + + g_key_file_free (priv->keyfile); + priv->keyfile = NULL; + + g_free (priv->name); + g_free (priv->description); + g_free (priv->database); + g_free (priv->strategy); + + return FALSE; + } + + return TRUE; +} + +/** + * gdict_source_load_from_file: + * @source: an empty #GdictSource + * @filename: path to a dictionary source file + * @error: return location for a #GError or %NULL + * + * Loads a dictionary source definition file into an empty #GdictSource + * object. + * + * Return value: %TRUE if @filename was loaded successfully. + * + * Since: 1.0 + */ +gboolean +gdict_source_load_from_file (GdictSource *source, + const gchar *filename, + GError **error) +{ + GdictSourcePrivate *priv; + GError *read_error; + GError *parse_error; + + g_return_val_if_fail (GDICT_IS_SOURCE (source), FALSE); + g_return_val_if_fail (filename != NULL, FALSE); + + priv = source->priv; + + if (!priv->keyfile) + priv->keyfile = g_key_file_new (); + + read_error = NULL; + g_key_file_load_from_file (priv->keyfile, + filename, + G_KEY_FILE_KEEP_TRANSLATIONS, + &read_error); + if (read_error) + { + g_propagate_error (error, read_error); + + return FALSE; + } + + parse_error = NULL; + gdict_source_parse (source, &parse_error); + if (parse_error) + { + g_propagate_error (error, parse_error); + + return FALSE; + } + + g_assert (priv->context != NULL); + + priv->filename = g_strdup (filename); + + return TRUE; +} + +/** + * gdict_source_load_from_data: + * @source: a #GdictSource + * @data: string containing a dictionary source + * @length: length of @data + * @error: return location for a #GError or %NULL + * + * Loads a dictionary source definition from @data inside an empty + * #GdictSource object. + * + * Return value: %TRUE if @filename was loaded successfully. + * + * Since: 1.0 + */ +gboolean +gdict_source_load_from_data (GdictSource *source, + const gchar *data, + gsize length, + GError **error) +{ + GdictSourcePrivate *priv; + GError *read_error; + GError *parse_error; + + g_return_val_if_fail (GDICT_IS_SOURCE (source), FALSE); + g_return_val_if_fail (data != NULL, FALSE); + + priv = source->priv; + + if (!priv->keyfile) + priv->keyfile = g_key_file_new (); + + read_error = NULL; + g_key_file_load_from_data (priv->keyfile, + data, + length, + G_KEY_FILE_KEEP_TRANSLATIONS, + &read_error); + if (read_error) + { + g_propagate_error (error, read_error); + + return FALSE; + } + + parse_error = NULL; + gdict_source_parse (source, &parse_error); + if (parse_error) + { + g_propagate_error (error, parse_error); + + return FALSE; + } + + g_assert (priv->context != NULL); + + g_free (priv->filename); + priv->filename = NULL; + + return TRUE; +} + +/** + * gdict_source_to_data: + * @source: a #GdictSource + * @length: return loaction for the length of the string, or %NULL + * @error: return location for a #GError or %NULL + * + * Outputs a dictionary source as a string. + * + * Return value: a newly allocated string holding the contents of @source. + * + * Since: 1.0 + */ +gchar * +gdict_source_to_data (GdictSource *source, + gsize *length, + GError **error) +{ + GdictSourcePrivate *priv; + gchar *retval = NULL; + + g_return_val_if_fail (GDICT_IS_SOURCE (source), NULL); + + priv = source->priv; + + if (!priv->name) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_INVALID_NAME, + _("Dictionary source does not have name")); + + return NULL; + } + + if (!IS_VALID_TRANSPORT (priv->transport)) + { + g_set_error (error, GDICT_SOURCE_ERROR, + GDICT_SOURCE_ERROR_INVALID_TRANSPORT, + _("Dictionary source '%s' has invalid transport '%s'"), + priv->name, + valid_transports[priv->transport]); + + return NULL; + } + + if (priv->keyfile) + { + GError *write_error = NULL; + + retval = g_key_file_to_data (priv->keyfile, + length, + &write_error); + if (write_error) + g_propagate_error (error, write_error); + } + + return retval; +} + +/** + * gdict_source_set_name: + * @source: a #GdictSource + * @name: the UTF8-encoded name of the dictionary source + * + * Sets @name as the displayable name of the dictionary source. + * + * Since: 1.0 + */ +void +gdict_source_set_name (GdictSource *source, + const gchar *name) +{ + g_return_if_fail (GDICT_IS_SOURCE (source)); + g_return_if_fail (name != NULL); + + g_free (source->priv->name); + source->priv->name = g_strdup (name); + + if (!source->priv->keyfile) + source->priv->keyfile = g_key_file_new (); + + g_key_file_set_string (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_NAME, + name); +} + +/** + * gdict_source_get_name: + * @source: a #GdictSource + * + * Retrieves the name of @source. + * + * Return value: the name of a #GdictSource. The returned string is owned + * by the #GdictSource object, and should not be modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_source_get_name (GdictSource *source) +{ + g_return_val_if_fail (GDICT_IS_SOURCE (source), NULL); + + return source->priv->name; +} + +/** + * gdict_source_set_description: + * @source: a #GdictSource + * @description: a UTF-8 encoded description or %NULL + * + * Sets the description of @source. If @description is %NULL, unsets the + * currently set description. + * + * Since: 1.0 + */ +void +gdict_source_set_description (GdictSource *source, + const gchar *description) +{ + g_return_if_fail (GDICT_IS_SOURCE (source)); + + g_free (source->priv->description); + + if (!source->priv->keyfile) + source->priv->keyfile = g_key_file_new (); + + if (description && description[0] != '\0') + { + source->priv->description = g_strdup (description); + + g_key_file_set_string (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DESCRIPTION, + description); + } + else + { + if (g_key_file_has_key (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DESCRIPTION, + NULL)) + g_key_file_remove_key (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DESCRIPTION, + NULL); + } +} + +/** + * gdict_source_get_description: + * @source: a #GdictSource + * + * Retrieves the description of @source. + * + * Return value: the description of a #GdictSource. The returned string is + * owned by the #GdictSource object, and should not be modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_source_get_description (GdictSource *source) +{ + g_return_val_if_fail (GDICT_IS_SOURCE (source), NULL); + + return source->priv->description; +} + +/** + * gdict_source_set_database: + * @source: a #GdictSource + * @database: a UTF-8 encoded database name or %NULL + * + * Sets the default database of @source. If @database is %NULL, unsets the + * currently set database. + * + * Since: 1.0 + */ +void +gdict_source_set_database (GdictSource *source, + const gchar *database) +{ + g_return_if_fail (GDICT_IS_SOURCE (source)); + + g_free (source->priv->database); + + if (!source->priv->keyfile) + source->priv->keyfile = g_key_file_new (); + + if (database && database[0] != '\0') + { + source->priv->database = g_strdup (database); + + g_key_file_set_string (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DATABASE, + database); + } + else + { + if (g_key_file_has_key (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DATABASE, + NULL)) + g_key_file_remove_key (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_DATABASE, + NULL); + } +} + +/** + * gdict_source_get_database: + * @source: a #GdictSource + * + * Retrieves the default database of @source. + * + * Return value: the default strategy of a #GdictSource. The returned string + * is owned by the #GdictSource object, and should not be modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_source_get_database (GdictSource *source) +{ + g_return_val_if_fail (GDICT_IS_SOURCE (source), NULL); + + return source->priv->database; +} + +/** + * gdict_source_set_strategy: + * @source: a #GdictSource + * @strategy: a UTF-8 encoded strategy or %NULL + * + * Sets the description of @source. If @strategy is %NULL, unsets the + * currently set strategy. + * + * Since: 1.0 + */ +void +gdict_source_set_strategy (GdictSource *source, + const gchar *strategy) +{ + g_return_if_fail (GDICT_IS_SOURCE (source)); + + g_free (source->priv->strategy); + + if (!source->priv->keyfile) + source->priv->keyfile = g_key_file_new (); + + if (strategy && strategy[0] != '\0') + { + source->priv->strategy = g_strdup (strategy); + + g_key_file_set_string (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_STRATEGY, + strategy); + } + else + { + if (g_key_file_has_key (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_STRATEGY, + NULL)) + g_key_file_remove_key (source->priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_STRATEGY, + NULL); + } +} + +/** + * gdict_source_get_strategy: + * @source: a #GdictSource + * + * Retrieves the default strategy of @source. + * + * Return value: the default strategy of a #GdictSource. The returned string + * is owned by the #GdictSource object, and should not be modified or freed. + * + * Since: 1.0 + */ +const gchar * +gdict_source_get_strategy (GdictSource *source) +{ + g_return_val_if_fail (GDICT_IS_SOURCE (source), NULL); + + return source->priv->strategy; +} + +/** + * gdict_source_set_transportv + * @source: a #GdictSource + * @transport: a #GdictSourceTransport + * @first_transport_property: FIXME + * @var_args: FIXME + * + * FIXME + * + * Since: 1.0 + */ +void +gdict_source_set_transportv (GdictSource *source, + GdictSourceTransport transport, + const gchar *first_transport_property, + va_list var_args) +{ + GdictSourcePrivate *priv; + + g_return_if_fail (GDICT_IS_SOURCE (source)); + g_return_if_fail (IS_VALID_TRANSPORT (transport)); + + priv = source->priv; + + priv->transport = transport; + + if (priv->context) + g_object_unref (priv->context); + + switch (priv->transport) + { + case GDICT_SOURCE_TRANSPORT_DICTD: + priv->context = gdict_client_context_new (NULL, -1); + g_assert (GDICT_IS_CLIENT_CONTEXT (priv->context)); + + g_object_set_valist (G_OBJECT (priv->context), + first_transport_property, + var_args); + + break; + case GDICT_SOURCE_TRANSPORT_INVALID: + default: + g_assert_not_reached (); + break; + } + + /* update the keyfile */ + if (!priv->keyfile) + priv->keyfile = g_key_file_new (); + + g_key_file_set_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_TRANSPORT, + valid_transports[transport]); + + switch (priv->transport) + { + case GDICT_SOURCE_TRANSPORT_DICTD: + g_key_file_set_string (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_HOSTNAME, + gdict_client_context_get_hostname (GDICT_CLIENT_CONTEXT (priv->context))); + g_key_file_set_integer (priv->keyfile, + SOURCE_GROUP, + SOURCE_KEY_PORT, + gdict_client_context_get_port (GDICT_CLIENT_CONTEXT (priv->context))); + break; + case GDICT_SOURCE_TRANSPORT_INVALID: + default: + g_assert_not_reached (); + break; + } +} + +/** + * gdict_source_set_transport: + * @source: a #GdictSource + * @transport: a valid transport + * @first_transport_property: property for the context bound to + * the transport, or %NULL + * @Varargs: property value for first property name, then additionary + * properties, ending with %NULL + * + * Sets @transport as the choosen transport for @source. The @transport + * argument is a method of retrieving dictionary data from a source; it is + * used to create the right #GdictContext for this #GdictSource. After + * @transport, property name/value pairs should be listed, with a %NULL + * pointer ending the list. Properties are the same passed to a #GdictContext + * implementation instance using g_object_set(). + * + * Here's a simple example: + * + * <informalexample><programlisting> + * #include <gdict/gdict.h> + * GdictSource *source = gdict_source_new (); + * + * gdict_source_set_name (source, "My Source"); + * gdict_source_set_transport (source, GDICT_SOURCE_TRANSPORT_DICTD, + * "hostname", "dictionary-server.org", + * "port", 2628, + * NULL); + * </programlisting></informalexample> + * + * Since: 1.0 + */ +void +gdict_source_set_transport (GdictSource *source, + GdictSourceTransport transport, + const gchar *first_transport_property, + ...) +{ + va_list args; + + g_return_if_fail (GDICT_IS_SOURCE (source)); + g_return_if_fail (IS_VALID_TRANSPORT (transport)); + + va_start (args, first_transport_property); + + gdict_source_set_transportv (source, transport, + first_transport_property, + args); + + va_end (args); +} + +/** + * gdict_source_get_transport: + * @source: a #GdictSource + * + * FIXME + * + * Return value: FIXME + * + * Since: 1.0 + */ +GdictSourceTransport +gdict_source_get_transport (GdictSource *source) +{ + g_return_val_if_fail (GDICT_IS_SOURCE (source), GDICT_SOURCE_TRANSPORT_INVALID); + + return source->priv->transport; +} + +/** + * gdict_source_get_context: + * @source: a #GdictSource + * + * Gets the #GdictContext bound to @source. + * + * Return value: a #GdictContext for @source. Use g_object_unref() + * when you don't need it anymore. + * + * Since: 1.0 + */ +GdictContext * +gdict_source_get_context (GdictSource *source) +{ + GdictContext *retval; + + g_return_val_if_fail (GDICT_IS_SOURCE (source), NULL); + + retval = gdict_source_create_context (source, + source->priv->transport, + NULL); + + return retval; +} + +/** + * gdict_source_peek_context: + * @source: a #GdictSource + * + * Gets the #GdictContext bound to @source. The returned object is a + * referenced copy of the context held by @source; if you want a different + * instance, use gdict_source_get_context(). + * + * Return value: a referenced #GdictContext. Use g_object_unref() when + * finished using it. + * + * Since: 1.0 + */ +GdictContext * +gdict_source_peek_context (GdictSource *source) +{ + g_return_val_if_fail (GDICT_IS_SOURCE (source), NULL); + + if (!source->priv->context) + source->priv->context = gdict_source_create_context (source, + source->priv->transport, + NULL); + return g_object_ref (source->priv->context); +} diff --git a/mate-dictionary/libgdict/gdict-source.h b/mate-dictionary/libgdict/gdict-source.h new file mode 100644 index 00000000..b51ab97c --- /dev/null +++ b/mate-dictionary/libgdict/gdict-source.h @@ -0,0 +1,115 @@ +/* gdict-source.h - Source configuration for Gdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_SOURCE_H__ +#define __GDICT_SOURCE_H__ + +#include <stdarg.h> +#include <glib-object.h> +#include "gdict-context.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_SOURCE (gdict_source_get_type ()) +#define GDICT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SOURCE, GdictSource)) +#define GDICT_IS_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SOURCE)) +#define GDICT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SOURCE, GdictSourceClass)) +#define GDICT_IS_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SOURCE)) +#define GDICT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SOURCE, GdictSourceClass)) + + +typedef struct _GdictSource GdictSource; +typedef struct _GdictSourceClass GdictSourceClass; +typedef struct _GdictSourcePrivate GdictSourcePrivate; + +typedef enum +{ + GDICT_SOURCE_TRANSPORT_DICTD, + + GDICT_SOURCE_TRANSPORT_INVALID /* only for debug */ +} GdictSourceTransport; + +#define GDICT_SOURCE_ERROR (gdict_source_error_quark ()) + +typedef enum +{ + GDICT_SOURCE_ERROR_PARSE, + GDICT_SOURCE_ERROR_INVALID_NAME, + GDICT_SOURCE_ERROR_INVALID_TRANSPORT, + GDICT_SOURCE_ERROR_INVALID_BAD_PARAMETER +} GdictSourceError; + +GQuark gdict_source_error_quark (void); + +struct _GdictSource +{ + /*< private >*/ + GObject parent_instance; + + GdictSourcePrivate *priv; +}; + +struct _GdictSourceClass +{ + /*< private >*/ + GObjectClass parent_class; +}; + +GType gdict_source_get_type (void) G_GNUC_CONST; + +GdictSource * gdict_source_new (void); +gboolean gdict_source_load_from_file (GdictSource *source, + const gchar *filename, + GError **error); +gboolean gdict_source_load_from_data (GdictSource *source, + const gchar *data, + gsize length, + GError **error); +gchar * gdict_source_to_data (GdictSource *source, + gsize *length, + GError **error) G_GNUC_MALLOC; + +void gdict_source_set_name (GdictSource *source, + const gchar *name); +const gchar *gdict_source_get_name (GdictSource *source); +void gdict_source_set_description (GdictSource *source, + const gchar *description); +const gchar *gdict_source_get_description (GdictSource *source); +void gdict_source_set_database (GdictSource *source, + const gchar *database); +const gchar *gdict_source_get_database (GdictSource *source); +void gdict_source_set_strategy (GdictSource *source, + const gchar *strategy); +const gchar *gdict_source_get_strategy (GdictSource *source); +void gdict_source_set_transport (GdictSource *source, + GdictSourceTransport transport, + const gchar *first_transport_property, + ...); +void gdict_source_set_transportv (GdictSource *source, + GdictSourceTransport transport, + const gchar *first_transport_property, + va_list var_args); +GdictSourceTransport gdict_source_get_transport (GdictSource *source); + +GdictContext * gdict_source_get_context (GdictSource *source); +GdictContext * gdict_source_peek_context (GdictSource *source); + +G_END_DECLS + +#endif /* __GDICT_SOURCE_H__ */ diff --git a/mate-dictionary/libgdict/gdict-speller.c b/mate-dictionary/libgdict/gdict-speller.c new file mode 100644 index 00000000..455883a1 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-speller.c @@ -0,0 +1,827 @@ +/* gdict-speller.c - display widget for dictionary matches + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-speller + * @short_description: Display matching words + * + * #GdictSpeller is a widget showing a list of words returned by a + * #GdictContext query, using a specific database and a matching strategy. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> + +#include <gdk/gdkkeysyms.h> +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +#include "gdict-speller.h" +#include "gdict-utils.h" +#include "gdict-enum-types.h" +#include "gdict-marshal.h" +#include "gdict-debug.h" +#include "gdict-private.h" + +#define GDICT_SPELLER_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SPELLER, GdictSpellerPrivate)) + +struct _GdictSpellerPrivate +{ + GdictContext *context; + gchar *database; + gchar *strategy; + + gchar *word; + + GtkWidget *treeview; + GtkWidget *clear_button; + + GdkCursor *busy_cursor; + + GtkListStore *store; + gint results; + + guint start_id; + guint end_id; + guint match_id; + guint error_id; + + guint is_searching : 1; +}; + +typedef enum +{ + MATCH_DB, + MATCH_WORD, + MATCH_ERROR +} MatchType; + +enum +{ + MATCH_COLUMN_TYPE, + MATCH_COLUMN_DB_NAME, + MATCH_COLUMN_WORD, + + MATCH_N_COLUMNS +}; + +enum +{ + PROP_0, + + PROP_CONTEXT, + PROP_WORD, + PROP_DATABASE, + PROP_STRATEGY, + PROP_COUNT +}; + +enum +{ + WORD_ACTIVATED, + + LAST_SIGNAL +}; + +static guint speller_signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE (GdictSpeller, gdict_speller, GTK_TYPE_VBOX); + + +static void +set_gdict_context (GdictSpeller *speller, + GdictContext *context) +{ + GdictSpellerPrivate *priv; + + g_assert (GDICT_IS_SPELLER (speller)); + + priv = speller->priv; + if (priv->context) + { + if (priv->start_id) + { + GDICT_NOTE (SPELLER, "Removing old context handlers"); + + g_signal_handler_disconnect (priv->context, priv->start_id); + g_signal_handler_disconnect (priv->context, priv->match_id); + g_signal_handler_disconnect (priv->context, priv->end_id); + + priv->start_id = 0; + priv->end_id = 0; + priv->match_id = 0; + } + + if (priv->error_id) + { + g_signal_handler_disconnect (priv->context, priv->error_id); + + priv->error_id = 0; + } + + GDICT_NOTE (SPELLER, "Removing old context"); + + g_object_unref (G_OBJECT (priv->context)); + } + + if (!context) + return; + + if (!GDICT_IS_CONTEXT (context)) + { + g_warning ("Object of type `%s' instead of a GdictContext\n", + g_type_name (G_OBJECT_TYPE (context))); + return; + } + + GDICT_NOTE (SPELLER, "Setting new context\n"); + + priv->context = context; + g_object_ref (G_OBJECT (priv->context)); +} + +static void +gdict_speller_finalize (GObject *gobject) +{ + GdictSpeller *speller = GDICT_SPELLER (gobject); + GdictSpellerPrivate *priv = speller->priv; + + if (priv->context) + set_gdict_context (speller, NULL); + + if (priv->busy_cursor) + gdk_cursor_unref (priv->busy_cursor); + + g_free (priv->strategy); + g_free (priv->database); + g_free (priv->word); + + if (priv->store) + g_object_unref (priv->store); + + G_OBJECT_CLASS (gdict_speller_parent_class)->finalize (gobject); +} + + +static void +gdict_speller_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictSpeller *speller = GDICT_SPELLER (gobject); + GdictSpellerPrivate *priv = speller->priv; + + switch (prop_id) + { + case PROP_CONTEXT: + set_gdict_context (speller, g_value_get_object (value)); + break; + case PROP_DATABASE: + g_free (priv->database); + priv->database = g_strdup (g_value_get_string (value)); + break; + case PROP_STRATEGY: + g_free (priv->strategy); + priv->strategy = g_strdup (g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +gdict_speller_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictSpeller *speller = GDICT_SPELLER (gobject); + + switch (prop_id) + { + case PROP_DATABASE: + g_value_set_string (value, speller->priv->database); + break; + case PROP_STRATEGY: + g_value_set_string (value, speller->priv->strategy); + break; + case PROP_CONTEXT: + g_value_set_object (value, speller->priv->context); + break; + case PROP_COUNT: + g_value_set_int (value, speller->priv->results); + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +row_activated_cb (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + gpointer user_data) +{ + GdictSpeller *speller = GDICT_SPELLER (user_data); + GdictSpellerPrivate *priv = speller->priv; + GtkTreeIter iter; + gchar *word, *db_name; + gboolean valid; + + valid = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->store), + &iter, + path); + if (!valid) + { + g_warning ("Invalid iterator found"); + + return; + } + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + MATCH_COLUMN_WORD, &word, + MATCH_COLUMN_DB_NAME, &db_name, + -1); + if (word) + g_signal_emit (speller, speller_signals[WORD_ACTIVATED], 0, + word, db_name); + else + { + gchar *row = gtk_tree_path_to_string (path); + + g_warning ("Row %s activated, but no word attached", row); + g_free (row); + } + + g_free (word); + g_free (db_name); +} + +static void +clear_button_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictSpeller *speller = GDICT_SPELLER (user_data); + + gdict_speller_clear (speller); +} + +static GObject * +gdict_speller_constructor (GType type, + guint n_params, + GObjectConstructParam *params) +{ + GObject *object; + GdictSpeller *speller; + GdictSpellerPrivate *priv; + GtkWidget *sw; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkWidget *hbox; + + object = G_OBJECT_CLASS (gdict_speller_parent_class)->constructor (type, + n_params, + params); + speller = GDICT_SPELLER (object); + priv = speller->priv; + + gtk_widget_push_composite_child (); + + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_composite_name (sw, "gdict-speller-scrolled-window"); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (speller), sw, TRUE, TRUE, 0); + gtk_widget_show (sw); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("matches", + renderer, + "text", MATCH_COLUMN_WORD, + NULL); + + priv->treeview = gtk_tree_view_new (); + gtk_widget_set_composite_name (priv->treeview, "gdict-speller-treeview"); + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->treeview), FALSE); + gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview), column); + g_signal_connect (priv->treeview, "row-activated", + G_CALLBACK (row_activated_cb), speller); + gtk_container_add (GTK_CONTAINER (sw), priv->treeview); + gtk_widget_show (priv->treeview); + + hbox = gtk_hbox_new (FALSE, 0); + + priv->clear_button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (priv->clear_button), + gtk_image_new_from_stock (GTK_STOCK_CLEAR, + GTK_ICON_SIZE_SMALL_TOOLBAR)); + g_signal_connect (priv->clear_button, "clicked", + G_CALLBACK (clear_button_clicked_cb), + speller); + gtk_box_pack_start (GTK_BOX (hbox), priv->clear_button, FALSE, FALSE, 0); + gtk_widget_show (priv->clear_button); + gtk_widget_set_tooltip_text (priv->clear_button, + _("Clear the list of similar words")); + + gtk_box_pack_end (GTK_BOX (speller), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + gtk_widget_pop_composite_child (); + + return object; +} + +static void +gdict_speller_class_init (GdictSpellerClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gdict_speller_finalize; + gobject_class->set_property = gdict_speller_set_property; + gobject_class->get_property = gdict_speller_get_property; + gobject_class->constructor = gdict_speller_constructor; + + g_object_class_install_property (gobject_class, + PROP_CONTEXT, + g_param_spec_object ("context", + _("Context"), + _("The GdictContext object used to get the word definition"), + GDICT_TYPE_CONTEXT, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT))); + g_object_class_install_property (gobject_class, + PROP_DATABASE, + g_param_spec_string ("database", + _("Database"), + _("The database used to query the GdictContext"), + GDICT_DEFAULT_DATABASE, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + g_object_class_install_property (gobject_class, + PROP_DATABASE, + g_param_spec_string ("strategy", + _("Strategy"), + _("The strategy used to query the GdictContext"), + GDICT_DEFAULT_STRATEGY, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + + speller_signals[WORD_ACTIVATED] = + g_signal_new ("word-activated", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictSpellerClass, word_activated), + NULL, NULL, + gdict_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_STRING); + + g_type_class_add_private (gobject_class, sizeof (GdictSpellerPrivate)); +} + +static void +gdict_speller_init (GdictSpeller *speller) +{ + GdictSpellerPrivate *priv; + + speller->priv = priv = GDICT_SPELLER_GET_PRIVATE (speller); + + priv->database = NULL; + priv->strategy = NULL; + priv->word = NULL; + + priv->results = -1; + priv->context = NULL; + + priv->store = gtk_list_store_new (MATCH_N_COLUMNS, + G_TYPE_INT, /* MatchType */ + G_TYPE_STRING, /* db_name */ + G_TYPE_STRING /* word */); + + priv->start_id = 0; + priv->end_id = 0; + priv->match_id = 0; + priv->error_id = 0; +} + +/** + * gdict_speller_new: + * + * FIXME + * + * Return value: FIXME + * + * Since: + */ +GtkWidget * +gdict_speller_new (void) +{ + return g_object_new (GDICT_TYPE_SPELLER, NULL); +} + +/** + * gdict_speller_new_with_context: + * @context: a #GdictContext + * + * FIXME + * + * Return value: FIXME + * + * Since: + */ +GtkWidget * +gdict_speller_new_with_context (GdictContext *context) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), NULL); + + return g_object_new (GDICT_TYPE_SPELLER, + "context", context, + NULL); +} + +/** + * gdict_speller_set_context: + * @speller: a #GdictSpeller + * @context: a #GdictContext + * + * FIXME + * + * Since: + */ +void +gdict_speller_set_context (GdictSpeller *speller, + GdictContext *context) +{ + g_return_if_fail (GDICT_IS_SPELLER (speller)); + g_return_if_fail (context == NULL || GDICT_IS_CONTEXT (context)); + + set_gdict_context (speller, context); + + g_object_notify (G_OBJECT (speller), "context"); +} + +/** + * gdict_speller_get_context: + * @speller: a #GdictSpeller + * + * FIXME + * + * Return value: a #GdictContext + * + * Since: + */ +GdictContext * +gdict_speller_get_context (GdictSpeller *speller) +{ + g_return_val_if_fail (GDICT_IS_SPELLER (speller), NULL); + + return speller->priv->context; +} + +/** + * gdict_speller_set_database: + * @speller: a #GdictSpeller + * @database: FIXME + * + * FIXME + * + * Since: + */ +void +gdict_speller_set_database (GdictSpeller *speller, + const gchar *database) +{ + GdictSpellerPrivate *priv; + + g_return_if_fail (GDICT_IS_SPELLER (speller)); + + priv = speller->priv; + + if (!database || database[0] == '\0') + database = GDICT_DEFAULT_DATABASE; + + g_free (priv->database); + priv->database = g_strdup (database); + + g_object_notify (G_OBJECT (speller), "database"); +} + +/** + * gdict_speller_get_database: + * @speller: a #GdictSpeller + * + * FIXME + * + * Return value: FIXME + * + * Since: FIXME + */ +const gchar * +gdict_speller_get_database (GdictSpeller *speller) +{ + g_return_val_if_fail (GDICT_IS_SPELLER (speller), NULL); + + return speller->priv->database; +} + +/** + * gdict_speller_set_strategy: + * @speller: a #GdictSpeller + * @strategy: FIXME + * + * FIXME + * + * Since: FIXME + */ +void +gdict_speller_set_strategy (GdictSpeller *speller, + const gchar *strategy) +{ + GdictSpellerPrivate *priv; + + g_return_if_fail (GDICT_IS_SPELLER (speller)); + + priv = speller->priv; + + if (!strategy || strategy[0] == '\0') + strategy = GDICT_DEFAULT_STRATEGY; + + g_free (priv->strategy); + priv->strategy = g_strdup (strategy); + + g_object_notify (G_OBJECT (speller), "strategy"); +} + +/** + * gdict_speller_get_strategy: + * @speller: a #GdictSpeller + * + * FIXME + * + * Return value: FIXME + * + * Since: FIXME + */ +const gchar * +gdict_speller_get_strategy (GdictSpeller *speller) +{ + g_return_val_if_fail (GDICT_IS_SPELLER (speller), NULL); + + return speller->priv->strategy; +} + +/** + * gdict_speller_clear: + * @speller: a #GdictSpeller + * + * FIXME + * + * Since: FIXME + */ +void +gdict_speller_clear (GdictSpeller *speller) +{ + GdictSpellerPrivate *priv; + + g_return_if_fail (GDICT_IS_SPELLER (speller)); + priv = speller->priv; + + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), NULL); + + gtk_list_store_clear (priv->store); + priv->results = -1; + + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); +} + +static void +lookup_start_cb (GdictContext *context, + gpointer user_data) +{ + GdictSpeller *speller = GDICT_SPELLER (user_data); + GdictSpellerPrivate *priv = speller->priv; + + if (!priv->busy_cursor) + priv->busy_cursor = gdk_cursor_new (GDK_WATCH); + + if (gtk_widget_get_window (GTK_WIDGET (speller))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (speller)), priv->busy_cursor); + + priv->is_searching = TRUE; +} + +static void +lookup_end_cb (GdictContext *context, + gpointer user_data) +{ + GdictSpeller *speller = GDICT_SPELLER (user_data); + GdictSpellerPrivate *priv = speller->priv; + + if (gtk_widget_get_window (GTK_WIDGET (speller))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (speller)), NULL); + + g_free (priv->word); + priv->word = NULL; + + priv->is_searching = FALSE; +} + +static void +match_found_cb (GdictContext *context, + GdictMatch *match, + gpointer user_data) +{ + GdictSpeller *speller = GDICT_SPELLER (user_data); + GdictSpellerPrivate *priv = speller->priv; + GtkTreeIter iter; + + GDICT_NOTE (SPELLER, "MATCH: `%s' (from `%s')", + gdict_match_get_word (match), + gdict_match_get_database (match)); + + gtk_list_store_append (priv->store, &iter); + gtk_list_store_set (priv->store, &iter, + MATCH_COLUMN_TYPE, MATCH_WORD, + MATCH_COLUMN_DB_NAME, gdict_match_get_database (match), + MATCH_COLUMN_WORD, gdict_match_get_word (match), + -1); + + if (priv->results == -1) + priv->results = 1; + else + priv->results += 1; +} + +static void +error_cb (GdictContext *context, + const GError *error, + gpointer user_data) +{ + GdictSpeller *speller = GDICT_SPELLER (user_data); + GdictSpellerPrivate *priv = speller->priv; + + gdict_speller_clear (speller); + + if (gtk_widget_get_window (GTK_WIDGET (speller))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (speller)), NULL); + + g_free (priv->word); + priv->word = NULL; + + priv->is_searching = FALSE; +} + +/** + * gdict_speller_match: + * @speller: a #GdictSpeller + * @word: FIXME + * + * FIXME + * + * Since: FIXME + */ +void +gdict_speller_match (GdictSpeller *speller, + const gchar *word) +{ + GdictSpellerPrivate *priv; + GError *match_error; + + g_return_if_fail (GDICT_IS_SPELLER (speller)); + g_return_if_fail (word != NULL); + + priv = speller->priv; + + if (!priv->context) + { + g_warning ("Attempting to match `%s', but no GdictContext " + "has been set. Use gdict_speller_set_context() " + "before invoking gdict_speller_match().", + word); + + return; + } + + if (priv->is_searching) + { + _gdict_show_error_dialog (NULL, + _("Another search is in progress"), + _("Please wait until the current search ends.")); + + return; + } + + gdict_speller_clear (speller); + + if (!priv->start_id) + { + priv->start_id = g_signal_connect (priv->context, "lookup-start", + G_CALLBACK (lookup_start_cb), + speller); + priv->match_id = g_signal_connect (priv->context, "match-found", + G_CALLBACK (match_found_cb), + speller); + priv->end_id = g_signal_connect (priv->context, "lookup-end", + G_CALLBACK (lookup_end_cb), + speller); + } + + if (!priv->error_id) + priv->error_id = g_signal_connect (priv->context, "error", + G_CALLBACK (error_cb), + speller); + + g_free (priv->word); + priv->word = g_strdup (word); + + match_error = NULL; + gdict_context_match_word (priv->context, + priv->database, + priv->strategy, + priv->word, + &match_error); + if (match_error) + { + GtkTreeIter iter; + + gtk_list_store_append (priv->store, &iter); + gtk_list_store_set (priv->store, &iter, + MATCH_COLUMN_TYPE, MATCH_ERROR, + MATCH_COLUMN_DB_NAME, _("Error while matching"), + MATCH_COLUMN_WORD, NULL, + -1); + + g_warning ("Error while matching `%s': %s", + priv->word, + match_error->message); + + g_error_free (match_error); + } +} + +/** + * gdict_speller_count_match: + * @speller: a #GdictSpeller + * + * FIXME + * + * Return value: FIXME + * + * Since: FIXME + */ +gint +gdict_speller_count_matches (GdictSpeller *speller) +{ + g_return_val_if_fail (GDICT_IS_SPELLER (speller), -1); + + return speller->priv->results; +} + +/** + * gdict_speller_get_matches: + * @speller: a #GdictSpeller + * @length: FIXME + * + * FIXME + * + * Return value: FIXME + * + * Since: FIXME + */ +gchar ** +gdict_speller_get_matches (GdictSpeller *speller, + gsize length) +{ + g_return_val_if_fail (GDICT_IS_SPELLER (speller), NULL); + + return NULL; +} diff --git a/mate-dictionary/libgdict/gdict-speller.h b/mate-dictionary/libgdict/gdict-speller.h new file mode 100644 index 00000000..9d6e81ff --- /dev/null +++ b/mate-dictionary/libgdict/gdict-speller.h @@ -0,0 +1,87 @@ +/* gdict-speller.h - display widget for dictionary matches + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_SPELLER_H__ +#define __GDICT_SPELLER_H__ + +#include <gtk/gtk.h> +#include "gdict-context.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_SPELLER (gdict_speller_get_type ()) +#define GDICT_SPELLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SPELLER, GdictSpeller)) +#define GDICT_SPELLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SPELLER, GdictSpellerClass)) +#define GDICT_IS_SPELLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SPELLER)) +#define GDICT_IS_SPELLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SPELLER)) +#define GDICT_SPELLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SPELLER, GdictSpellerClass)) + +typedef struct _GdictSpeller GdictSpeller; +typedef struct _GdictSpellerPrivate GdictSpellerPrivate; +typedef struct _GdictSpellerClass GdictSpellerClass; + +struct _GdictSpeller +{ + GtkVBox parent_instance; + + /*< private >*/ + GdictSpellerPrivate *priv; +}; + +struct _GdictSpellerClass +{ + GtkVBoxClass parent_class; + + void (*word_activated) (GdictSpeller *speller, + const gchar *word, + const gchar *database); + + /* padding for future expansion */ + void (*_gdict_speller_1) (void); + void (*_gdict_speller_2) (void); + void (*_gdict_speller_3) (void); + void (*_gdict_speller_4) (void); +}; + +GType gdict_speller_get_type (void) G_GNUC_CONST; + +GtkWidget * gdict_speller_new (void); +GtkWidget * gdict_speller_new_with_context (GdictContext *context); + +void gdict_speller_set_context (GdictSpeller *speller, + GdictContext *context); +GdictContext * gdict_speller_get_context (GdictSpeller *speller); +void gdict_speller_set_database (GdictSpeller *speller, + const gchar *database); +const gchar *gdict_speller_get_database (GdictSpeller *speller); +void gdict_speller_set_strategy (GdictSpeller *speller, + const gchar *strategy); +const gchar *gdict_speller_get_strategy (GdictSpeller *speller); + +void gdict_speller_clear (GdictSpeller *speller); +void gdict_speller_match (GdictSpeller *speller, + const gchar *word); + +gint gdict_speller_count_matches (GdictSpeller *speller); +gchar ** gdict_speller_get_matches (GdictSpeller *speller, + gsize length); + +G_END_DECLS + +#endif /* __GDICT_SPELLER_H__ */ diff --git a/mate-dictionary/libgdict/gdict-strategy-chooser.c b/mate-dictionary/libgdict/gdict-strategy-chooser.c new file mode 100644 index 00000000..93df7073 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-strategy-chooser.c @@ -0,0 +1,1092 @@ +/* gdict-strategy-chooser.c - display widget for strategy names + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +/** + * SECTION:gdict-strategy-chooser + * @short_description: Display a list of matching strategies + * + * Each #GdictContext allows matching a word using a specific "matching + * strategy". The #GdictStrategyChooser widget queries a #GdictContext and + * displays the list of available matching strategies. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> + +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +#include "gdict-strategy-chooser.h" +#include "gdict-utils.h" +#include "gdict-debug.h" +#include "gdict-private.h" +#include "gdict-enum-types.h" +#include "gdict-marshal.h" + +#define GDICT_STRATEGY_CHOOSER_GET_PRIVATE(obj) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooserPrivate)) + +struct _GdictStrategyChooserPrivate +{ + GtkListStore *store; + + GtkWidget *treeview; + GtkWidget *clear_button; + GtkWidget *refresh_button; + GtkWidget *buttons_box; + + GdictContext *context; + gint results; + + guint start_id; + guint match_id; + guint end_id; + guint error_id; + + GdkCursor *busy_cursor; + + gchar *current_strat; + + guint is_searching : 1; +}; + +enum +{ + STRATEGY_NAME, + STRATEGY_ERROR +} StratType; + +enum +{ + STRAT_COLUMN_TYPE, + STRAT_COLUMN_NAME, + STRAT_COLUMN_DESCRIPTION, + STRAT_COLUMN_CURRENT, + + STRAT_N_COLUMNS +}; + +enum +{ + PROP_0, + + PROP_CONTEXT, + PROP_COUNT +}; + +enum +{ + STRATEGY_ACTIVATED, + CLOSED, + + LAST_SIGNAL +}; + +static guint db_chooser_signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE (GdictStrategyChooser, + gdict_strategy_chooser, + GTK_TYPE_VBOX); + + +static void +set_gdict_context (GdictStrategyChooser *chooser, + GdictContext *context) +{ + GdictStrategyChooserPrivate *priv; + + g_assert (GDICT_IS_STRATEGY_CHOOSER (chooser)); + priv = chooser->priv; + + if (priv->context) + { + if (priv->start_id) + { + GDICT_NOTE (CHOOSER, "Removing old context handlers"); + + g_signal_handler_disconnect (priv->context, priv->start_id); + g_signal_handler_disconnect (priv->context, priv->match_id); + g_signal_handler_disconnect (priv->context, priv->end_id); + + priv->start_id = 0; + priv->end_id = 0; + priv->match_id = 0; + } + + if (priv->error_id) + { + g_signal_handler_disconnect (priv->context, priv->error_id); + + priv->error_id = 0; + } + + GDICT_NOTE (CHOOSER, "Removing old context"); + + g_object_unref (G_OBJECT (priv->context)); + + priv->context = NULL; + priv->results = -1; + } + + if (!context) + return; + + if (!GDICT_IS_CONTEXT (context)) + { + g_warning ("Object of type '%s' instead of a GdictContext\n", + g_type_name (G_OBJECT_TYPE (context))); + return; + } + + GDICT_NOTE (CHOOSER, "Setting new context"); + + priv->context = g_object_ref (context); + priv->results = 0; +} + +static void +gdict_strategy_chooser_dispose (GObject *gobject) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (gobject); + GdictStrategyChooserPrivate *priv = chooser->priv; + + set_gdict_context (chooser, NULL); + + if (priv->busy_cursor) + { + gdk_cursor_unref (priv->busy_cursor); + priv->busy_cursor = NULL; + } + + if (priv->store) + { + g_object_unref (priv->store); + priv->store = NULL; + } + + G_OBJECT_CLASS (gdict_strategy_chooser_parent_class)->dispose (gobject); +} + +static void +gdict_strategy_chooser_finalize (GObject *gobject) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (gobject); + GdictStrategyChooserPrivate *priv = chooser->priv; + + g_free (priv->current_strat); + + G_OBJECT_CLASS (gdict_strategy_chooser_parent_class)->finalize (gobject); +} + +static void +gdict_strategy_chooser_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (gobject); + + switch (prop_id) + { + case PROP_CONTEXT: + set_gdict_context (chooser, g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +gdict_strategy_chooser_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (gobject); + + switch (prop_id) + { + case PROP_CONTEXT: + g_value_set_object (value, chooser->priv->context); + break; + case PROP_COUNT: + g_value_set_int (value, chooser->priv->results); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +row_activated_cb (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + gpointer user_data) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (user_data); + GdictStrategyChooserPrivate *priv = chooser->priv; + GtkTreeIter iter; + gchar *db_name, *db_desc; + gboolean valid; + + valid = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->store), + &iter, + path); + if (!valid) + { + g_warning ("Invalid iterator found"); + return; + } + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + STRAT_COLUMN_NAME, &db_name, + STRAT_COLUMN_DESCRIPTION, &db_desc, + -1); + if (db_name && db_desc) + { + g_signal_emit (chooser, db_chooser_signals[STRATEGY_ACTIVATED], 0, + db_name, db_desc); + } + else + { + gchar *row = gtk_tree_path_to_string (path); + + g_warning ("Row %s activated, but no strategy attached", row); + g_free (row); + } + + g_free (db_name); + g_free (db_desc); +} + +static void +refresh_button_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (user_data); + + gdict_strategy_chooser_refresh (chooser); +} + +static void +clear_button_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (user_data); + + gdict_strategy_chooser_clear (chooser); +} + +static GObject * +gdict_strategy_chooser_constructor (GType type, + guint n_params, + GObjectConstructParam *params) +{ + GObject *object; + GdictStrategyChooser *chooser; + GdictStrategyChooserPrivate *priv; + GtkWidget *sw; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkWidget *hbox; + + object = G_OBJECT_CLASS (gdict_strategy_chooser_parent_class)->constructor (type, + n_params, + params); + + chooser = GDICT_STRATEGY_CHOOSER (object); + priv = chooser->priv; + + gtk_widget_push_composite_child (); + + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_composite_name (sw, "gdict-strategy-chooser-scrolled-window"); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (chooser), sw, TRUE, TRUE, 0); + gtk_widget_show (sw); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("strategies", + renderer, + "text", STRAT_COLUMN_DESCRIPTION, + "weight", STRAT_COLUMN_CURRENT, + NULL); + priv->treeview = gtk_tree_view_new (); + gtk_widget_set_composite_name (priv->treeview, "gdict-strategy-chooser-treeview"); + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->treeview), FALSE); + gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview), column); + g_signal_connect (priv->treeview, "row-activated", + G_CALLBACK (row_activated_cb), chooser); + gtk_container_add (GTK_CONTAINER (sw), priv->treeview); + gtk_widget_show (priv->treeview); + + hbox = gtk_hbox_new (FALSE, 0); + + priv->refresh_button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (priv->refresh_button), + gtk_image_new_from_stock (GTK_STOCK_REFRESH, + GTK_ICON_SIZE_SMALL_TOOLBAR)); + g_signal_connect (priv->refresh_button, "clicked", + G_CALLBACK (refresh_button_clicked_cb), + chooser); + gtk_box_pack_start (GTK_BOX (hbox), priv->refresh_button, FALSE, FALSE, 0); + gtk_widget_show (priv->refresh_button); + gtk_widget_set_tooltip_text (priv->refresh_button, + _("Reload the list of available strategies")); + + priv->clear_button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (priv->clear_button), + gtk_image_new_from_stock (GTK_STOCK_CLEAR, + GTK_ICON_SIZE_SMALL_TOOLBAR)); + g_signal_connect (priv->clear_button, "clicked", + G_CALLBACK (clear_button_clicked_cb), + chooser); + gtk_box_pack_start (GTK_BOX (hbox), priv->clear_button, FALSE, FALSE, 0); + gtk_widget_show (priv->clear_button); + gtk_widget_set_tooltip_text (priv->clear_button, + _("Clear the list of available strategies")); + + gtk_box_pack_end (GTK_BOX (chooser), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + gtk_widget_pop_composite_child (); + + return object; +} + +static void +gdict_strategy_chooser_class_init (GdictStrategyChooserClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gdict_strategy_chooser_finalize; + gobject_class->dispose = gdict_strategy_chooser_dispose; + gobject_class->set_property = gdict_strategy_chooser_set_property; + gobject_class->get_property = gdict_strategy_chooser_get_property; + gobject_class->constructor = gdict_strategy_chooser_constructor; + + /** + * GdictStrategyChooser:context: + * + * The #GdictContext object used to retrieve the list of strategies. + */ + g_object_class_install_property (gobject_class, + PROP_CONTEXT, + g_param_spec_object ("context", + "Context", + "The GdictContext object used to get the list of strategies", + GDICT_TYPE_CONTEXT, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT))); + + /** + * GdictStrategyChooser::strategy-activated: + * @chooser: the widget that received the signal + * @name: the name of the activated strategy + * @description: the description of the activate strategy + * + * The ::strategy-activated signal is emitted each time the user + * activates a strategy in the @chooser, either by double click or + * using the keyboard. + */ + db_chooser_signals[STRATEGY_ACTIVATED] = + g_signal_new ("strategy-activated", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictStrategyChooserClass, strategy_activated), + NULL, NULL, + gdict_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_STRING); + + g_type_class_add_private (gobject_class, sizeof (GdictStrategyChooserPrivate)); +} + +static void +gdict_strategy_chooser_init (GdictStrategyChooser *chooser) +{ + GdictStrategyChooserPrivate *priv; + + chooser->priv = priv = GDICT_STRATEGY_CHOOSER_GET_PRIVATE (chooser); + + priv->results = -1; + priv->context = NULL; + + priv->store = gtk_list_store_new (STRAT_N_COLUMNS, + G_TYPE_INT, /* strat_type */ + G_TYPE_STRING, /* strat_name */ + G_TYPE_STRING, /* strat_desc */ + G_TYPE_INT /* strat_current */); + + priv->start_id = 0; + priv->end_id = 0; + priv->match_id = 0; + priv->error_id = 0; +} + +/** + * gdict_strategy_chooser_new: + * + * Creates a new #GdictStrategyChooser. Use this widget to show a list + * of matching strategies available on a dictionary source represented + * by a #GdictContext, set with gdict_strategy_chooser_set_context(). + * + * Return value: the newly created #GdictStrategyChooser widget + * + * Since: 0.9 + */ +GtkWidget * +gdict_strategy_chooser_new (void) +{ + return g_object_new (GDICT_TYPE_STRATEGY_CHOOSER, NULL); +} + +/** + * gdict_strategy_chooser_new_with_context: + * @context: a #GdictContext + * + * Creates a new #GdictStrategyChooser widget, using @context as the + * representation of a dictionary source. + * + * Return value: the newly created #GdictStrategyChooser widget + * + * Since: 0.9 + */ +GtkWidget * +gdict_strategy_chooser_new_with_context (GdictContext *context) +{ + g_return_val_if_fail (GDICT_IS_CONTEXT (context), NULL); + + return g_object_new (GDICT_TYPE_STRATEGY_CHOOSER, + "context", context, + NULL); +} + +/** + * gdict_strategy_chooser_get_context: + * @chooser: a #GdictStrategyChooser + * + * Retrieves the #GdictContext used by @chooser. + * + * Return value: a #GdictContext + * + * Since: + */ +GdictContext * +gdict_strategy_chooser_get_context (GdictStrategyChooser *chooser) +{ + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), NULL); + + return chooser->priv->context; +} + +/** + * gdict_strategy_chooser_set_context: + * @chooser: a #GdictStrategyChooser + * @context: a #GdictContext, or %NULL to unset the context + * + * Sets the #GdictContext to be used by @chooser to retrieve the + * list of matching strategies. + * + * Since: 0.9 + */ +void +gdict_strategy_chooser_set_context (GdictStrategyChooser *chooser, + GdictContext *context) +{ + g_return_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser)); + g_return_if_fail (context == NULL || GDICT_IS_CONTEXT (context)); + + set_gdict_context (chooser, context); + + g_object_notify (G_OBJECT (chooser), "context"); +} + +/** + * gdict_strategy_chooser_get_strategies: + * @chooser: a #GdictStrategyChooser + * @length: return location for the length of the returned string list + * + * Retrieves the list of matching strategies available. + * + * Return value: a string vector containing the names of the matching + * strategies. Use g_strfreev() to deallocate the memory when done + * + * Since:0.9 + */ +gchar ** +gdict_strategy_chooser_get_strategies (GdictStrategyChooser *chooser, + gsize *length) +{ + GdictStrategyChooserPrivate *priv; + GtkTreeIter iter; + gchar **retval; + gsize i; + + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), NULL); + + priv = chooser->priv; + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store), &iter)) + return NULL; + + i = 0; + retval = g_new (gchar*, priv->results); + + do + { + gchar *strat_name; + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + STRAT_COLUMN_NAME, &strat_name, + -1); + + retval[i++] = strat_name; + } + while (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter)); + + retval[i] = NULL; + + if (length) + *length = i; + + return retval; +} + +/** + * gdict_strategy_chooser_has_strategy: + * @chooser: a #GdictStrategyChooser + * @strategy: a strategy name + * + * Checks whether @strategy is available in the list of matching + * strategies displayed by @chooser. + * + * Return value: %TRUE if the strategy was found, %FALSE otherwise + * + * Since: 0.9 + */ +gboolean +gdict_strategy_chooser_has_strategy (GdictStrategyChooser *chooser, + const gchar *strategy) +{ + GdictStrategyChooserPrivate *priv; + GtkTreeIter iter; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), FALSE); + g_return_val_if_fail (strategy != NULL, FALSE); + + priv = chooser->priv; + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->store), &iter)) + return FALSE; + + retval = FALSE; + + do + { + gchar *strat_name; + + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + STRAT_COLUMN_NAME, &strat_name, + -1); + + if (strcmp (strat_name, strategy) == 0) + { + retval = TRUE; + g_free (strat_name); + break; + } + + g_free (strat_name); + } + while (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter)); + + return retval; +} + +/** + * gdict_strategy_chooser_count_strategies: + * @chooser: a #GdictStrategyChooser + * + * Returns the number of strategies found. + * + * Return value: the number of strategies or -1 if case of error + * + * Since: + */ +gint +gdict_strategy_chooser_count_strategies (GdictStrategyChooser *chooser) +{ + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), -1); + + return chooser->priv->results; +} + +static void +lookup_start_cb (GdictContext *context, + gpointer user_data) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (user_data); + GdictStrategyChooserPrivate *priv = chooser->priv; + + if (!priv->busy_cursor) + priv->busy_cursor = gdk_cursor_new (GDK_WATCH); + + if (gtk_widget_get_window (GTK_WIDGET (chooser))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (chooser)), priv->busy_cursor); + + priv->is_searching = TRUE; +} + +static void +lookup_end_cb (GdictContext *context, + gpointer user_data) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (user_data); + GdictStrategyChooserPrivate *priv = chooser->priv; + + if (gtk_widget_get_window (GTK_WIDGET (chooser))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (chooser)), NULL); + + priv->is_searching = FALSE; +} + +static void +strategy_found_cb (GdictContext *context, + GdictStrategy *strategy, + gpointer user_data) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (user_data); + GdictStrategyChooserPrivate *priv = chooser->priv; + const gchar *name, *description; + GtkTreeIter iter; + gint weight = PANGO_WEIGHT_NORMAL; + + name = gdict_strategy_get_name (strategy); + description = gdict_strategy_get_description (strategy); + + GDICT_NOTE (CHOOSER, "STRATEGY: `%s' (`%s')", + name, + description); + + if (priv->current_strat && !strcmp (priv->current_strat, name)) + weight = PANGO_WEIGHT_BOLD; + + gtk_list_store_append (priv->store, &iter); + gtk_list_store_set (priv->store, &iter, + STRAT_COLUMN_TYPE, STRATEGY_NAME, + STRAT_COLUMN_NAME, name, + STRAT_COLUMN_DESCRIPTION, description, + STRAT_COLUMN_CURRENT, weight, + -1); + + priv->results += 1; +} + +static void +error_cb (GdictContext *context, + const GError *error, + gpointer user_data) +{ + GdictStrategyChooser *chooser = GDICT_STRATEGY_CHOOSER (user_data); + + if (gtk_widget_get_window (GTK_WIDGET (chooser))) + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (chooser)), NULL); + + chooser->priv->is_searching = FALSE; + chooser->priv->results = 0; +} + +/** + * gdict_strategy_chooser_refresh: + * @chooser: a #GdictStrategyChooser + * + * Reloads the list of available strategies. + * + * Since: 0.10 + */ +void +gdict_strategy_chooser_refresh (GdictStrategyChooser *chooser) +{ + GdictStrategyChooserPrivate *priv; + GError *db_error; + + g_return_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser)); + + priv = chooser->priv; + + if (!priv->context) + { + g_warning ("Attempting to retrieve the available strategies, but " + "no GdictContext has been set. Use gdict_strategy_chooser_set_context() " + "before invoking gdict_strategy_chooser_refresh()."); + return; + } + + if (priv->is_searching) + return; + + gdict_strategy_chooser_clear (chooser); + + if (!priv->start_id) + { + priv->start_id = g_signal_connect (priv->context, "lookup-start", + G_CALLBACK (lookup_start_cb), + chooser); + priv->match_id = g_signal_connect (priv->context, "strategy-found", + G_CALLBACK (strategy_found_cb), + chooser); + priv->end_id = g_signal_connect (priv->context, "lookup-end", + G_CALLBACK (lookup_end_cb), + chooser); + } + + if (!priv->error_id) + priv->error_id = g_signal_connect (priv->context, "error", + G_CALLBACK (error_cb), + chooser); + + db_error = NULL; + gdict_context_lookup_strategies (priv->context, &db_error); + if (db_error) + { + GtkTreeIter iter; + + gtk_list_store_append (priv->store, &iter); + gtk_list_store_set (priv->store, &iter, + STRAT_COLUMN_TYPE, STRATEGY_ERROR, + STRAT_COLUMN_NAME, _("Error while matching"), + STRAT_COLUMN_DESCRIPTION, NULL, + -1); + + g_warning ("Error while retrieving strategies: %s", + db_error->message); + + g_error_free (db_error); + } +} + +/** + * gdict_strategy_chooser_clear: + * @chooser: a #GdictStrategyChooser + * + * Clears @chooser. + * + * Since: 0.10 + */ +void +gdict_strategy_chooser_clear (GdictStrategyChooser *chooser) +{ + GdictStrategyChooserPrivate *priv; + + g_return_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser)); + + priv = chooser->priv; + + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), NULL); + + gtk_list_store_clear (priv->store); + priv->results = 0; + + gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), + GTK_TREE_MODEL (priv->store)); +} + +typedef struct +{ + gchar *strat_name; + GdictStrategyChooser *chooser; + + guint found : 1; + guint do_select : 1; + guint do_activate : 1; +} SelectData; + +static gboolean +scan_for_strat_name (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data) +{ + SelectData *select_data = user_data; + gchar *strat_name = NULL; + + if (!select_data) + return TRUE; + + gtk_tree_model_get (model, iter, STRAT_COLUMN_NAME, &strat_name, -1); + if (!strat_name) + return FALSE; + + if (strcmp (strat_name, select_data->strat_name) == 0) + { + GtkTreeView *tree_view; + GtkTreeSelection *selection; + + select_data->found = TRUE; + + tree_view = GTK_TREE_VIEW (select_data->chooser->priv->treeview); + if (select_data->do_activate) + { + GtkTreeViewColumn *column; + + gtk_list_store_set (GTK_LIST_STORE (model), iter, + STRAT_COLUMN_CURRENT, PANGO_WEIGHT_BOLD, + -1); + + column = gtk_tree_view_get_column (tree_view, 2); + gtk_tree_view_row_activated (tree_view, path, column); + } + + selection = gtk_tree_view_get_selection (tree_view); + if (select_data->do_select) + gtk_tree_selection_select_path (selection, path); + else + gtk_tree_selection_unselect_path (selection, path); + } + else + { + gtk_list_store_set (GTK_LIST_STORE (model), iter, + STRAT_COLUMN_CURRENT, PANGO_WEIGHT_NORMAL, + -1); + } + + g_free (strat_name); + + return FALSE; +} + +/** + * gdict_strategy_chooser_select_strategy: + * @chooser: a #GdictStrategyChooser + * @strat_name: the name of the strategy to select + * + * Selects @strat_name, if available. + * + * Return value: %TRUE if the matching strategy was found and selected + * + * Since: 0.10 + */ +gboolean +gdict_strategy_chooser_select_strategy (GdictStrategyChooser *chooser, + const gchar *strat_name) +{ + GdictStrategyChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), FALSE); + g_return_val_if_fail (strat_name != NULL, FALSE); + + priv = chooser->priv; + + data.strat_name = g_strdup (strat_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = TRUE; + data.do_activate = FALSE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_strat_name, + &data); + + retval = data.found; + + g_free (data.strat_name); + + return retval; +} + +/** + * gdict_strategy_chooser_unselect_strategy: + * @chooser: a #GdictStrategyChooser + * @strat_name: the name of the strategy to unselect + * + * Unselects @strat_name from the list. + * + * Return value: %TRUE if the matching strategy was found and successfully + * unselected + * + * Since: 0.10 + */ +gboolean +gdict_strategy_chooser_unselect_strategy (GdictStrategyChooser *chooser, + const gchar *strat_name) +{ + GdictStrategyChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), FALSE); + g_return_val_if_fail (strat_name != NULL, FALSE); + + priv = chooser->priv; + + data.strat_name = g_strdup (strat_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = FALSE; + data.do_activate = FALSE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_strat_name, + &data); + + retval = data.found; + + g_free (data.strat_name); + + return retval; +} + +/** + * gdict_strategy_chooser_set_current_strategy: + * @chooser: a #GdictStrategyChooser + * @strat_name: the name of the matching strategy + * + * Sets @strat_name as the current matching strategy. + * + * Return value: %TRUE if the matching strategy was found + * + * Since: 0.10 + */ +gboolean +gdict_strategy_chooser_set_current_strategy (GdictStrategyChooser *chooser, + const gchar *strat_name) +{ + GdictStrategyChooserPrivate *priv; + SelectData data; + gboolean retval; + + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), FALSE); + g_return_val_if_fail (strat_name != NULL, FALSE); + + priv = chooser->priv; + + if (priv->current_strat && !strcmp (priv->current_strat, strat_name)) + return TRUE; + + data.strat_name = g_strdup (strat_name); + data.chooser = chooser; + data.found = FALSE; + data.do_select = TRUE; + data.do_activate = TRUE; + + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store), + scan_for_strat_name, + &data); + + retval = data.found; + + if (data.found) + { + g_free (priv->current_strat); + priv->current_strat = data.strat_name; + } + else + g_free (data.strat_name); + + return retval; +} + +/** + * gdict_strategy_chooser_get_current_strategy: + * @chooser: a #GdictStrategyChooser + * + * Retrieves the current matching strategy. + * + * Return value: a newly allocated string containing the name of + * the current matching strategy + * + * Since: 0.10 + */ +gchar * +gdict_strategy_chooser_get_current_strategy (GdictStrategyChooser *chooser) +{ + GdictStrategyChooserPrivate *priv; + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + gchar *retval = NULL; + + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), NULL); + + priv = chooser->priv; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return NULL; + + gtk_tree_model_get (model, &iter, STRAT_COLUMN_NAME, &retval, -1); + + g_free (priv->current_strat); + priv->current_strat = g_strdup (retval); + + return retval; +} + +/** + * gdict_strategy_chooser_add_button: + * @chooser: a #GdictStrategyChooser + * @button_text: text of the button (can be a stock id) + * + * Creates a new button and packs it into the #GdictStrategyChooser + * "action area". + * + * Return value: the packed #GtkButton + * + * Since: 0.10 + */ +GtkWidget * +gdict_strategy_chooser_add_button (GdictStrategyChooser *chooser, + const gchar *button_text) +{ + GdictStrategyChooserPrivate *priv; + GtkWidget *button; + + g_return_val_if_fail (GDICT_IS_STRATEGY_CHOOSER (chooser), NULL); + g_return_val_if_fail (button_text != NULL, NULL); + + priv = chooser->priv; + + button = gtk_button_new_from_stock (button_text); + + gtk_widget_set_can_default (button, TRUE); + + gtk_widget_show (button); + + gtk_box_pack_end (GTK_BOX (priv->buttons_box), button, FALSE, TRUE, 0); + + return button; +} diff --git a/mate-dictionary/libgdict/gdict-strategy-chooser.h b/mate-dictionary/libgdict/gdict-strategy-chooser.h new file mode 100644 index 00000000..efcf8e89 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-strategy-chooser.h @@ -0,0 +1,94 @@ +/* gdict-strategy-chooser.h - display widget for strategy names + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_STRATEGY_CHOOSER_H__ +#define __GDICT_STRATEGY_CHOOSER_H__ + +#include <gtk/gtk.h> +#include "gdict-context.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_STRATEGY_CHOOSER (gdict_strategy_chooser_get_type ()) +#define GDICT_STRATEGY_CHOOSER(obj) \ +(G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooser)) +#define GDICT_IS_STRATEGY_CHOOSER(obj) \ +(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_STRATEGY_CHOOSER)) +#define GDICT_STRATEGY_CHOOSER_CLASS(klass) \ +(G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooserClass)) +#define GDICT_IS_STRATEGY_CHOOSER_CLASS(klass) \ +(G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_STRATEGY_CHOOSER)) +#define GDICT_STRATEGY_CHOOSER_GET_CLASS(obj) \ +(G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooserClass)) + +typedef struct _GdictStrategyChooser GdictStrategyChooser; +typedef struct _GdictStrategyChooserPrivate GdictStrategyChooserPrivate; +typedef struct _GdictStrategyChooserClass GdictStrategyChooserClass; + +struct _GdictStrategyChooser +{ + GtkVBox parent_instance; + + GdictStrategyChooserPrivate *priv; +}; + +struct _GdictStrategyChooserClass +{ + GtkVBoxClass parent_class; + + void (*strategy_activated) (GdictStrategyChooser *chooser, + const gchar *name, + const gchar *description); + + void (*_gdict_padding1) (void); + void (*_gdict_padding2) (void); + void (*_gdict_padding3) (void); + void (*_gdict_padding4) (void); + void (*_gdict_padding5) (void); + void (*_gdict_padding6) (void); +}; + +GType gdict_strategy_chooser_get_type (void) G_GNUC_CONST; + +GtkWidget * gdict_strategy_chooser_new (void); +GtkWidget * gdict_strategy_chooser_new_with_context (GdictContext *context); + +GdictContext *gdict_strategy_chooser_get_context (GdictStrategyChooser *chooser); +void gdict_strategy_chooser_set_context (GdictStrategyChooser *chooser, + GdictContext *context); +gboolean gdict_strategy_chooser_select_strategy (GdictStrategyChooser *chooser, + const gchar *strat_name); +gboolean gdict_strategy_chooser_unselect_strategy (GdictStrategyChooser *chooser, + const gchar *strat_name); +gboolean gdict_strategy_chooser_set_current_strategy (GdictStrategyChooser *chooser, + const gchar *strat_name); +gchar * gdict_strategy_chooser_get_current_strategy (GdictStrategyChooser *chooser) G_GNUC_MALLOC; +gchar ** gdict_strategy_chooser_get_strategies (GdictStrategyChooser *chooser, + gsize *length) G_GNUC_MALLOC; +gint gdict_strategy_chooser_count_strategies (GdictStrategyChooser *chooser); +gboolean gdict_strategy_chooser_has_strategy (GdictStrategyChooser *chooser, + const gchar *strategy); +void gdict_strategy_chooser_refresh (GdictStrategyChooser *chooser); +void gdict_strategy_chooser_clear (GdictStrategyChooser *chooser); +GtkWidget * gdict_strategy_chooser_add_button (GdictStrategyChooser *chooser, + const gchar *button_text); + +G_END_DECLS + +#endif /* __GDICT_STRATEGY_CHOOSER_H__ */ diff --git a/mate-dictionary/libgdict/gdict-utils.c b/mate-dictionary/libgdict/gdict-utils.c new file mode 100644 index 00000000..cdace3d3 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-utils.c @@ -0,0 +1,333 @@ +/* gdict-utils.c - Utility functions for Gdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <stdarg.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <netdb.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <glib.h> +#include <glib/gi18n-lib.h> +#include <gtk/gtk.h> + +#include "gdict-context-private.h" +#include "gdict-debug.h" +#include "gdict-utils.h" +#include "gdict-version.h" +#include "gdict-private.h" + +guint gdict_major_version = GDICT_MAJOR_VERSION; +guint gdict_minor_version = GDICT_MINOR_VERSION; +guint gdict_micro_version = GDICT_MICRO_VERSION; + +guint gdict_debug_flags = 0; /* global gdict debug flag */ + +#ifdef GDICT_ENABLE_DEBUG +static const GDebugKey gdict_debug_keys[] = { + { "misc", GDICT_DEBUG_MISC }, + { "context", GDICT_DEBUG_CONTEXT }, + { "dict", GDICT_DEBUG_DICT }, + { "source", GDICT_DEBUG_SOURCE }, + { "loader", GDICT_DEBUG_LOADER }, + { "chooser", GDICT_DEBUG_CHOOSER }, + { "defbux", GDICT_DEBUG_DEFBOX }, + { "speller", GDICT_DEBUG_SPELLER }, +}; +#endif /* GDICT_ENABLE_DEBUG */ + +static gboolean gdict_is_initialized = FALSE; + +#ifdef GDICT_ENABLE_DEBUG +static gboolean +gdict_arg_debug_cb (const char *key, + const char *value, + gpointer user_data) +{ + gdict_debug_flags |= + g_parse_debug_string (value, + gdict_debug_keys, + G_N_ELEMENTS (gdict_debug_keys)); + return TRUE; +} + +static gboolean +gdict_arg_no_debug_cb (const char *key, + const char *value, + gpointer user_data) +{ + gdict_debug_flags &= + ~g_parse_debug_string (value, + gdict_debug_keys, + G_N_ELEMENTS (gdict_debug_keys)); + return TRUE; +} +#endif /* CLUTTER_ENABLE_DEBUG */ + +static GOptionEntry gdict_args[] = { +#ifdef GDICT_ENABLE_DEBUG + { "gdict-debug", 0, 0, G_OPTION_ARG_CALLBACK, gdict_arg_debug_cb, + N_("GDict debugging flags to set"), N_("FLAGS") }, + { "gdict-no-debug", 0, 0, G_OPTION_ARG_CALLBACK, gdict_arg_no_debug_cb, + N_("GDict debugging flags to unset"), N_("FLAGS") }, +#endif /* GDICT_ENABLE_DEBUG */ + { NULL, }, +}; + +static gboolean +pre_parse_hook (GOptionContext *context, + GOptionGroup *group, + gpointer data, + GError **error) +{ + const char *env_string; + + if (gdict_is_initialized) + return TRUE; + +#ifdef GDICT_ENABLE_DEBUG + env_string = g_getenv ("GDICT_DEBUG"); + if (env_string != NULL) + { + gdict_debug_flags = + g_parse_debug_string (env_string, + gdict_debug_keys, + G_N_ELEMENTS (gdict_debug_keys)); + } +#else + env_string = NULL; +#endif /* GDICT_ENABLE_DEBUG */ + + return TRUE; +} + +static gboolean +post_parse_hook (GOptionContext *context, + GOptionGroup *group, + gpointer data, + GError **error) +{ + gdict_is_initialized = TRUE; + + return TRUE; +} + +/** + * gdict_get_option_group: + * + * FIXME + * + * Return value: FIXME + * + * Since: 0.12 + */ +GOptionGroup * +gdict_get_option_group (void) +{ + GOptionGroup *group; + + group = g_option_group_new ("gdict", + _("GDict Options"), + _("Show GDict Options"), + NULL, + NULL); + + g_option_group_set_parse_hooks (group, pre_parse_hook, post_parse_hook); + g_option_group_add_entries (group, gdict_args); + g_option_group_set_translation_domain (group, GETTEXT_PACKAGE); + + return group; +} + +/** + * gdict_debug_init: + * @argc: FIXME + * @argv: FIXME + * + * FIXME + * + * Since: 0.12 + */ +void +gdict_debug_init (gint *argc, + gchar ***argv) +{ + GOptionContext *option_context; + GOptionGroup *gdict_group; + GError *error = NULL; + + if (gdict_is_initialized) + return; + + option_context = g_option_context_new (NULL); + g_option_context_set_ignore_unknown_options (option_context, TRUE); + g_option_context_set_help_enabled (option_context, FALSE); + + gdict_group = gdict_get_option_group (); + g_option_context_set_main_group (option_context, gdict_group); + + if (!g_option_context_parse (option_context, argc, argv, &error)) + { + g_warning ("%s", error->message); + g_error_free (error); + } + + g_option_context_free (option_context); +} + +gboolean +gdict_check_version (guint required_major, + guint required_minor, + guint required_micro) +{ + gint gdict_effective_micro = 100 * GDICT_MINOR_VERSION + GDICT_MICRO_VERSION; + gint required_effective_micro = 100 * required_minor + required_micro; + + if (required_major > GDICT_MAJOR_VERSION) + return FALSE; + + if (required_major < GDICT_MAJOR_VERSION) + return FALSE; + + if (required_effective_micro < gdict_effective_micro) + return FALSE; + + if (required_effective_micro > gdict_effective_micro) + return FALSE; + + return TRUE; +} +/* gdict_has_ipv6: checks for the existence of the IPv6 extensions; if + * IPv6 support was not enabled, this function always return false + */ +gboolean +_gdict_has_ipv6 (void) +{ +#ifdef ENABLE_IPV6 + int s; + + s = socket (AF_INET6, SOCK_STREAM, 0); + if (s != -1) + { + close(s); + + return TRUE; + } +#endif + + return FALSE; +} + +/* shows an error dialog making it transient for @parent */ +static void +show_error_dialog (GtkWindow *parent, + const gchar *message, + const gchar *detail) +{ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", message); + gtk_window_set_title (GTK_WINDOW (dialog), ""); + + if (detail) + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + "%s", detail); + + if (parent && gtk_window_get_group (parent)) + gtk_window_group_add_window (gtk_window_get_group (parent), GTK_WINDOW (dialog)); + + gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); +} + +/* find the toplevel widget for @widget */ +static GtkWindow * +get_toplevel_window (GtkWidget *widget) +{ + GtkWidget *toplevel; + + toplevel = gtk_widget_get_toplevel (widget); + if (!gtk_widget_is_toplevel (toplevel)) + return NULL; + else + return GTK_WINDOW (toplevel); +} + +/** + * gdict_show_error_dialog: + * @widget: the widget that emits the error + * @title: the primary error message + * @message: the secondary error message or %NULL + * + * Creates and shows an error dialog bound to @widget. + * + * Since: 1.0 + */ +void +_gdict_show_error_dialog (GtkWidget *widget, + const gchar *title, + const gchar *detail) +{ + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (title != NULL); + + show_error_dialog (get_toplevel_window (widget), title, detail); +} + +/** + * gdict_show_gerror_dialog: + * @widget: the widget that emits the error + * @title: the primary error message + * @error: a #GError + * + * Creates and shows an error dialog bound to @widget, using @error + * to fill the secondary text of the message dialog with the error + * message. Also takes care of freeing @error. + * + * Since: 1.0 + */ +void +_gdict_show_gerror_dialog (GtkWidget *widget, + const gchar *title, + GError *error) +{ + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (title != NULL); + g_return_if_fail (error != NULL); + + show_error_dialog (get_toplevel_window (widget), title, error->message); + + g_error_free (error); +} diff --git a/mate-dictionary/libgdict/gdict-utils.h b/mate-dictionary/libgdict/gdict-utils.h new file mode 100644 index 00000000..5f40eb5f --- /dev/null +++ b/mate-dictionary/libgdict/gdict-utils.h @@ -0,0 +1,85 @@ +/* gdict-utils.h - Utility functions for Gdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_UTILS_H__ +#define __GDICT_UTILS_H__ + +#include <glib-object.h> +#include <gtk/gtk.h> + +G_BEGIN_DECLS + +#define GDICT_DEFAULT_DATABASE "*" +#define GDICT_DEFAULT_STRATEGY "." + +#define GDICT_DEFAULT_FONT_NAME "Sans 10" + +/* properties shared between GdictContext implementations */ +typedef enum { + GDICT_CONTEXT_PROP_FIRST = 0x1000, + GDICT_CONTEXT_PROP_LOCAL_ONLY = GDICT_CONTEXT_PROP_FIRST, + GDICT_CONTEXT_PROP_LAST +} GdictContextProp; + +/* Status codes as defined by RFC 2229 */ +typedef enum { + GDICT_STATUS_INVALID = 0, + + GDICT_STATUS_N_DATABASES_PRESENT = 110, + GDICT_STATUS_N_STRATEGIES_PRESENT = 111, + GDICT_STATUS_DATABASE_INFO = 112, + GDICT_STATUS_HELP_TEXT = 113, + GDICT_STATUS_SERVER_INFO = 114, + GDICT_STATUS_CHALLENGE = 130, + GDICT_STATUS_N_DEFINITIONS_RETRIEVED = 150, + GDICT_STATUS_WORD_DB_NAME = 151, + GDICT_STATUS_N_MATCHES_FOUND = 152, + GDICT_STATUS_CONNECT = 220, + GDICT_STATUS_QUIT = 221, + GDICT_STATUS_AUTH_OK = 230, + GDICT_STATUS_OK = 250, + GDICT_STATUS_SEND_RESPONSE = 330, + /* Connect response codes */ + GDICT_STATUS_SERVER_DOWN = 420, + GDICT_STATUS_SHUTDOWN = 421, + /* Error codes */ + GDICT_STATUS_BAD_COMMAND = 500, + GDICT_STATUS_BAD_PARAMETERS = 501, + GDICT_STATUS_COMMAND_NOT_IMPLEMENTED = 502, + GDICT_STATUS_PARAMETER_NOT_IMPLEMENTED = 503, + GDICT_STATUS_NO_ACCESS = 530, + GDICT_STATUS_USE_SHOW_INFO = 531, + GDICT_STATUS_UNKNOWN_MECHANISM = 532, + GDICT_STATUS_BAD_DATABASE = 550, + GDICT_STATUS_BAD_STRATEGY = 551, + GDICT_STATUS_NO_MATCH = 552, + GDICT_STATUS_NO_DATABASES_PRESENT = 554, + GDICT_STATUS_NO_STRATEGIES_PRESENT = 555 +} GdictStatusCode; + +#define GDICT_IS_VALID_STATUS_CODE(x) (((x) > GDICT_STATUS_INVALID) && \ + ((x) <= GDICT_STATUS_NO_STRATEGIES_PRESENT)) + +GOptionGroup *gdict_get_option_group (void); +void gdict_debug_init (gint *argc, + gchar ***argv); + +G_END_DECLS + +#endif /* __GDICT_UTILS_H__ */ diff --git a/mate-dictionary/libgdict/gdict-version.h.in b/mate-dictionary/libgdict/gdict-version.h.in new file mode 100644 index 00000000..b9491cb9 --- /dev/null +++ b/mate-dictionary/libgdict/gdict-version.h.in @@ -0,0 +1,92 @@ +/* gdict-version.h - convenience version header for libgdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_VERSION_H__ +#define __GDICT_VERSION_H__ + +#include <glib.h> + +G_BEGIN_DECLS + +/** + * GDICT_MAJOR_VERSION: + * + * FIXME + */ +#define GDICT_MAJOR_VERSION (@GDICT_MAJOR_VERSION@) + +/** + * GDICT_MINOR_VERSION: + * + * FIXME + */ +#define GDICT_MINOR_VERSION (@GDICT_MINOR_VERSION@) + +/** + * GDICT_MICRO_VERSION: + * + * FIXME + */ +#define GDICT_MICRO_VERSION (@GDICT_MICRO_VERSION@) + +/** + * GDICT_VERSION: + * + * FIXME + * + * Since: 0.11 + */ +#define GDICT_VERSION (@GDICT_VERSION@) + +/** + * GDICT_VERSION_S: + * + * FIXME + * + * Since: 0.11 + */ +#define GDICT_VERSION_S "@GDICT_VERSION@" + +/** + * GDICT_VERSION_HEX: + * + * FIXME + * + * Since: 0.11 + */ +#define GDICT_VERSION_HEX (GDICT_MAJOR_VERSION << 24 | \ + GDICT_MINOR_VERSION << 16 | \ + GDICT_MICRO_VERSION << 8) + +#define GDICT_CHECK_VERSION(major,minor,micro) \ + (((major) >= GDICT_MAJOR_VERSION) || \ + (((major) == GDICT_MAJOR_VERSION) && ((minor) >= GDICT_MINOR_VERSION)) || \ + (((major) == GDICT_MAJOR_VERSION) && ((minor) == GDICT_MINOR_VERSION) && ((micro) >= GDICT_MICRO_VERSION))) + +extern guint gdict_major; +extern guint gdict_minor; +extern guint gdict_micro; + +gboolean gdict_check_version (guint required_major, + guint required_minor, + guint required_micro); + +G_END_DECLS + +#endif /* __GDICT_VERSION_H__ */ diff --git a/mate-dictionary/libgdict/gdict.h b/mate-dictionary/libgdict/gdict.h new file mode 100644 index 00000000..f5a32af1 --- /dev/null +++ b/mate-dictionary/libgdict/gdict.h @@ -0,0 +1,36 @@ +/* gdict.h - convenience header for libgdict + * + * Copyright (C) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + */ + +#ifndef __GDICT_H__ +#define __GDICT_H__ + +#include "gdict-context.h" +#include "gdict-client-context.h" +#include "gdict-source.h" +#include "gdict-source-loader.h" +#include "gdict-source-chooser.h" +#include "gdict-database-chooser.h" +#include "gdict-defbox.h" +#include "gdict-speller.h" +#include "gdict-strategy-chooser.h" +#include "gdict-utils.h" +#include "gdict-enum-types.h" +#include "gdict-version.h" + +#endif /* __GDICT_H__ */ diff --git a/mate-dictionary/libgdict/mate-dict.pc.in b/mate-dictionary/libgdict/mate-dict.pc.in new file mode 100644 index 00000000..9eff837e --- /dev/null +++ b/mate-dictionary/libgdict/mate-dict.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: gdict-1.0 +Description: MATE Dictionary Protocol client library +Requires: gtk+-2.0 +Version: @GDICT_VERSION@ +Libs: -L${libdir} -lmate-dict +Cflags: -I${includedir}/mate-dict + diff --git a/mate-dictionary/src/Makefile.am b/mate-dictionary/src/Makefile.am new file mode 100644 index 00000000..ddde3d26 --- /dev/null +++ b/mate-dictionary/src/Makefile.am @@ -0,0 +1,82 @@ +NULL = + +INCLUDES = \ + -DPREFIX=\""$(prefix)"\" \ + -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DLIBDIR=\""$(libdir)"\" \ + -DDATADIR=\""$(datadir)"\" \ + -DUIDATADIR=\""$(datadir)/mate-2.0/ui"\" \ + -DPKGDATADIR=\""$(datadir)/mate-dictionary"\" \ + -DMATELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ + $(NULL) + +bin_PROGRAMS = mate-dictionary + +if BUILD_GDICT_APPLET +libexec_PROGRAMS = mate-dictionary-applet +endif + +mate_dictionary_SOURCES = \ + gdict-about.c \ + gdict-about.h \ + gdict-app.c \ + gdict-app.h \ + gdict-common.c \ + gdict-common.h \ + gdict-pref-dialog.c \ + gdict-pref-dialog.h \ + gdict-print.c \ + gdict-print.h \ + gdict-sidebar.c \ + gdict-sidebar.h \ + gdict-source-dialog.c \ + gdict-source-dialog.h \ + gdict-window.c \ + gdict-window.h \ + main.c \ + $(NULL) +mate_dictionary_CFLAGS = \ + -I$(top_builddir)/mate-dictionary \ + -I$(top_srcdir)/mate-dictionary \ + $(MATE_UTILS_CFLAGS) \ + $(NULL) +mate_dictionary_LDADD = \ + -lm \ + $(top_builddir)/mate-dictionary/libgdict/libmatedict.la \ + $(MATE_UTILS_LIBS) \ + $(NULL) + +if BUILD_GDICT_APPLET + +mate_dictionary_applet_SOURCES = \ + gdict-about.c \ + gdict-about.h \ + gdict-aligned-window.c \ + gdict-aligned-window.h \ + gdict-applet.c \ + gdict-applet.h \ + gdict-common.c \ + gdict-common.h \ + gdict-pref-dialog.c \ + gdict-pref-dialog.h \ + gdict-print.c \ + gdict-print.h \ + gdict-sidebar.c \ + gdict-sidebar.h \ + gdict-source-dialog.c \ + gdict-source-dialog.h \ + $(NULL) +mate_dictionary_applet_CFLAGS = \ + -I$(top_builddir)/mate-dictionary \ + -I$(top_srcdir)/mate-dictionary \ + $(MATE_UTILS_CFLAGS) \ + $(APPLET_CFLAGS) \ + $(NULL) +mate_dictionary_applet_LDADD = \ + -lm \ + $(top_builddir)/mate-dictionary/libgdict/libmatedict.la \ + $(MATE_UTILS_LIBS) \ + $(APPLET_LIBS) \ + $(NULL) + +endif # BUILD_GDICT_APPLET diff --git a/mate-dictionary/src/gdict-about.c b/mate-dictionary/src/gdict-about.c new file mode 100644 index 00000000..dc74b560 --- /dev/null +++ b/mate-dictionary/src/gdict-about.c @@ -0,0 +1,90 @@ +/* gdict-about.c - GtkAboutDialog wrapper + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <glib/gi18n.h> +#include <gdk-pixbuf/gdk-pixbuf.h> + +#include "gdict-about.h" + +void +gdict_show_about_dialog (GtkWidget *parent) +{ + const gchar *authors[] = { + "Mike Hughes <[email protected]>", + "Spiros Papadimitriou <[email protected]>", + "Bradford Hovinen <[email protected]>", + "Vincent Noel <[email protected]>", + "Emmanuele Bassi <[email protected]>", + NULL + }; + + const gchar *documenters[] = { + "Sun MATE Documentation Team <[email protected]>", + "John Fleck <[email protected]>", + "Emmanuele Bassi <[email protected]>", + NULL + }; + + const gchar *translator_credits = _("translator-credits"); + const gchar *copyright = "Copyright \xc2\xa9 2005-2006 Emmanuele Bassi"; + const gchar *comments = _("Look up words in dictionaries"); + + const gchar *license = + "This program is free software; you can redistribute it and/or " + "modify it under the terms of the GNU General Public License as " + "published by the Free Software Foundation; either version 2 of " + "the License, or (at your option) any later version.\n" + "\n" + "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.\n" + "\n" + "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.\n"; + + g_return_if_fail (GTK_IS_WIDGET (parent)); + + gtk_show_about_dialog (GTK_IS_WINDOW (parent) ? GTK_WINDOW (parent) : NULL, + "name", _("Dictionary"), + "version", VERSION, + "copyright", copyright, + "comments", comments, + "authors", authors, + "documenters", documenters, + "translator-credits", translator_credits, + "logo-icon-name", "accessories-dictionary", + "license", license, + "wrap-license", TRUE, + "screen", gtk_widget_get_screen (parent), + NULL); +} diff --git a/mate-dictionary/src/gdict-about.h b/mate-dictionary/src/gdict-about.h new file mode 100644 index 00000000..2e6467cf --- /dev/null +++ b/mate-dictionary/src/gdict-about.h @@ -0,0 +1,30 @@ +/* gdict-about.h - GtkAboutDialog wrapper + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __GDICT_ABOUT_H__ +#define __GDICT_ABOUT_H__ + +#include <gtk/gtk.h> + +void gdict_show_about_dialog (GtkWidget *parent); + +#endif /* __GDICT_ABOUT_H__ */ diff --git a/mate-dictionary/src/gdict-aligned-window.c b/mate-dictionary/src/gdict-aligned-window.c new file mode 100644 index 00000000..c7ddf83e --- /dev/null +++ b/mate-dictionary/src/gdict-aligned-window.c @@ -0,0 +1,348 @@ +/* gdict-aligned-window.c - Popup window aligned to a widget + * + * Copyright (c) 2005-2006 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 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 Library 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 + * + * Ported from Seth Nickell's Python class: + * Copyright (c) 2003 Seth Nickell + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <gtk/gtk.h> + +#include "gdict-aligned-window.h" + +#define GDICT_ALIGNED_WINDOW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_ALIGNED_WINDOW, GdictAlignedWindowPrivate)) + +struct _GdictAlignedWindowPrivate +{ + GtkWidget *align_widget; + + guint motion_id; +}; + +enum +{ + PROP_0, + + PROP_ALIGN_WIDGET +}; + +static void gdict_aligned_window_finalize (GObject *object); +static void gdict_aligned_window_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void gdict_aligned_window_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); + +static void gdict_aligned_window_realize (GtkWidget *widget); +static void gdict_aligned_window_show (GtkWidget *widget); + +static gboolean gdict_aligned_window_motion_notify_cb (GtkWidget *widget, + GdkEventMotion *event, + GdictAlignedWindow *aligned_window); + + +G_DEFINE_TYPE (GdictAlignedWindow, gdict_aligned_window, GTK_TYPE_WINDOW); + + + +static void +gdict_aligned_window_class_init (GdictAlignedWindowClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gobject_class->set_property = gdict_aligned_window_set_property; + gobject_class->get_property = gdict_aligned_window_get_property; + gobject_class->finalize = gdict_aligned_window_finalize; + + widget_class->realize = gdict_aligned_window_realize; + widget_class->show = gdict_aligned_window_show; + + g_object_class_install_property (gobject_class, PROP_ALIGN_WIDGET, + g_param_spec_object ("align-widget", + "Align Widget", + "The widget the window should align to", + GTK_TYPE_WIDGET, + G_PARAM_READWRITE)); + + g_type_class_add_private (klass, sizeof (GdictAlignedWindowPrivate)); +} + +static void +gdict_aligned_window_init (GdictAlignedWindow *aligned_window) +{ + GdictAlignedWindowPrivate *priv = GDICT_ALIGNED_WINDOW_GET_PRIVATE (aligned_window); + GtkWindow *window = GTK_WINDOW (aligned_window); + + aligned_window->priv = priv; + + priv->align_widget = NULL; + priv->motion_id = 0; + + /* set window properties */ +#if 0 + gtk_window_set_modal (window, TRUE); +#endif + gtk_window_set_decorated (window, FALSE); + gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DOCK); +} + +static void +gdict_aligned_window_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictAlignedWindow *aligned_window = GDICT_ALIGNED_WINDOW (object); + + switch (prop_id) + { + case PROP_ALIGN_WIDGET: + g_value_set_object (value, aligned_window->priv->align_widget); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_aligned_window_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictAlignedWindow *aligned_window = GDICT_ALIGNED_WINDOW (object); + + switch (prop_id) + { + case PROP_ALIGN_WIDGET: + gdict_aligned_window_set_widget (aligned_window, + g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_aligned_window_position (GdictAlignedWindow *window) +{ + GdictAlignedWindowPrivate *priv; + GtkWidget *align_widget; + gint our_width, our_height; + gint entry_x, entry_y, entry_width, entry_height; + gint x, y; + GdkGravity gravity = GDK_GRAVITY_NORTH_WEST; + GdkWindow *gdk_window; + + g_assert (GDICT_IS_ALIGNED_WINDOW (window)); + priv = window->priv; + + if (!priv->align_widget) + return; + + align_widget = priv->align_widget; + gdk_window = gtk_widget_get_window (align_widget); + + gdk_flush (); + + gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (window)), + NULL, + NULL, + &our_width, + &our_height, + NULL); + + /* stick, skip taskbar and pager */ + gtk_window_stick (GTK_WINDOW (window)); + gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE); + gtk_window_set_skip_pager_hint (GTK_WINDOW (window), TRUE); + + /* make sure the align_widget is realized before we do anything */ + gtk_widget_realize (align_widget); + + /* get the positional and dimensional attributes of the align widget */ + gdk_window_get_origin (gdk_window, + &entry_x, + &entry_y); + gdk_window_get_geometry (gdk_window, + NULL, + NULL, + &entry_width, + &entry_height, + NULL); + + if (entry_x + our_width < gdk_screen_width ()) + x = entry_x + 1; + else + { + x = entry_x + entry_width - our_width - 1; + + gravity = GDK_GRAVITY_NORTH_EAST; + } + + if (entry_y + entry_height + our_height < gdk_screen_height ()) + y = entry_y + entry_height - 1; + else + { + y = entry_y - our_height + 1; + + if (gravity == GDK_GRAVITY_NORTH_EAST) + gravity = GDK_GRAVITY_SOUTH_EAST; + else + gravity = GDK_GRAVITY_SOUTH_WEST; + } + + gtk_window_set_gravity (GTK_WINDOW (window), gravity); + gtk_window_move (GTK_WINDOW (window), x, y); +} + +static void +gdict_aligned_window_realize (GtkWidget *widget) +{ + GTK_WIDGET_CLASS (gdict_aligned_window_parent_class)->realize (widget); + + gdict_aligned_window_position (GDICT_ALIGNED_WINDOW (widget)); +} + +static void +gdict_aligned_window_show (GtkWidget *widget) +{ + gdict_aligned_window_position (GDICT_ALIGNED_WINDOW (widget)); + + GTK_WIDGET_CLASS (gdict_aligned_window_parent_class)->show (widget); +} + +static void +gdict_aligned_window_finalize (GObject *object) +{ + G_OBJECT_CLASS (gdict_aligned_window_parent_class)->finalize (object); +} + +static gboolean +gdict_aligned_window_motion_notify_cb (GtkWidget *widget, + GdkEventMotion *event, + GdictAlignedWindow *aligned_window) +{ + GtkAllocation alloc; + GdkRectangle rect; + + gtk_widget_get_allocation (GTK_WIDGET (aligned_window), &alloc); + + rect.x = 0; + rect.y = 0; + rect.width = alloc.width; + rect.height = alloc.height; + + gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET (aligned_window)), + &rect, + FALSE); + + return FALSE; +} + + +/** + * gdict_aligned_window_new: + * @align_widget: a #GtkWidget to which the window should align + * + * Creates a new window, aligned to a previously created widget. + * + * Return value: a new #GdictAlignedWindow + */ +GtkWidget * +gdict_aligned_window_new (GtkWidget *align_widget) +{ + return g_object_new (GDICT_TYPE_ALIGNED_WINDOW, + "align-widget", align_widget, + NULL); +} + +/** + * gdict_aligned_window_set_widget: + * @aligned_window: a #GdictAlignedWindow + * @align_widget: the #GtkWidget @aligned_window should align to + * + * Sets @align_widget as the #GtkWidget to which @aligned_window should + * align. + * + * Note that @align_widget must have a #GdkWindow in order to + * #GdictAlignedWindow to work. + */ +void +gdict_aligned_window_set_widget (GdictAlignedWindow *aligned_window, + GtkWidget *align_widget) +{ + GdictAlignedWindowPrivate *priv; + + g_return_if_fail (GDICT_IS_ALIGNED_WINDOW (aligned_window)); + g_return_if_fail (GTK_IS_WIDGET (align_widget)); + +#if 0 + if (GTK_WIDGET_NO_WINDOW (align_widget)) + { + g_warning ("Attempting to set a widget of class '%s' as the " + "align widget, but widgets of this class does not " + "have a GdkWindow.", + g_type_name (G_OBJECT_TYPE (align_widget))); + + return; + } +#endif + + priv = GDICT_ALIGNED_WINDOW_GET_PRIVATE (aligned_window); + + if (priv->align_widget) + { + g_signal_handler_disconnect (priv->align_widget, priv->motion_id); + priv->align_widget = NULL; + } + + priv->align_widget = align_widget; + priv->motion_id = g_signal_connect (priv->align_widget, "motion-notify-event", + G_CALLBACK (gdict_aligned_window_motion_notify_cb), + aligned_window); +} + +/** + * gdict_aligned_window_get_widget: + * @aligned_window: a #GdictAlignedWindow + * + * Retrieves the #GtkWidget to which @aligned_window is aligned to. + * + * Return value: the align widget. + */ +GtkWidget * +gdict_aligned_window_get_widget (GdictAlignedWindow *aligned_window) +{ + g_return_val_if_fail (GDICT_IS_ALIGNED_WINDOW (aligned_window), NULL); + + return aligned_window->priv->align_widget; +} diff --git a/mate-dictionary/src/gdict-aligned-window.h b/mate-dictionary/src/gdict-aligned-window.h new file mode 100644 index 00000000..8647f272 --- /dev/null +++ b/mate-dictionary/src/gdict-aligned-window.h @@ -0,0 +1,69 @@ +/* gdict-aligned-widget.h - Popup window aligned to a widget + * + * Copyright (c) 2005 Emmanuele Bassi <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 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 Library 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 + * + * Ported from Seth Nickell's Python class: + * Copyright (c) 2003 Seth Nickell + */ + +#ifndef __GDICT_ALIGNED_WINDOW_H__ +#define __GDICT_ALIGNED_WINDOW_H__ + +#include <gtk/gtk.h> + +G_BEGIN_DECLS + +#define GDICT_TYPE_ALIGNED_WINDOW (gdict_aligned_window_get_type ()) +#define GDICT_ALIGNED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_ALIGNED_WINDOW, GdictAlignedWindow)) +#define GDICT_IS_ALIGNED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_ALIGNED_WINDOW)) +#define GDICT_ALIGNED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_ALIGNED_WINDOW, GdictAlignedWindowClass)) +#define GDICT_IS_ALIGNED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_ALIGNED_WINDOW)) +#define GDICT_ALIGNED_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_ALIGNED_WINDOW, GdictAlignedWindowClass)) + +typedef struct _GdictAlignedWindow GdictAlignedWindow; +typedef struct _GdictAlignedWindowClass GdictAlignedWindowClass; +typedef struct _GdictAlignedWindowPrivate GdictAlignedWindowPrivate; + +struct _GdictAlignedWindow +{ + /*< private >*/ + GtkWindow parent_instance; + + GdictAlignedWindowPrivate *priv; +}; + +struct _GdictAlignedWindowClass +{ + /*< private >*/ + GtkWindowClass parent_class; + + void (*_gdict_reserved1) (void); + void (*_gdict_reserved2) (void); + void (*_gdict_reserved3) (void); + void (*_gdict_reserved4) (void); +}; + +GType gdict_aligned_window_get_type (void) G_GNUC_CONST; + +GtkWidget *gdict_aligned_window_new (GtkWidget *align_widget); +void gdict_aligned_window_set_widget (GdictAlignedWindow *aligned_window, + GtkWidget *align_widget); +GtkWidget *gdict_aligned_window_get_widget (GdictAlignedWindow *aligned_window); + +G_END_DECLS + +#endif diff --git a/mate-dictionary/src/gdict-app.c b/mate-dictionary/src/gdict-app.c new file mode 100644 index 00000000..eab6bbd8 --- /dev/null +++ b/mate-dictionary/src/gdict-app.c @@ -0,0 +1,475 @@ +/* gdict-app.c - main application class + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> +#include <sys/stat.h> + +#include <gtk/gtk.h> +#include <glib.h> +#include <glib/gi18n.h> + +#include "gdict-common.h" +#include "gdict-pref-dialog.h" +#include "gdict-app.h" + +static GdictApp *singleton = NULL; + + +struct _GdictAppClass +{ + GObjectClass parent_class; +}; + + + +G_DEFINE_TYPE (GdictApp, gdict_app, G_TYPE_OBJECT); + + +static void +gdict_app_finalize (GObject *object) +{ + GdictApp *app = GDICT_APP (object); + + if (app->loader) + g_object_unref (app->loader); + + app->current_window = NULL; + + g_slist_foreach (app->windows, + (GFunc) gtk_widget_destroy, + NULL); + g_slist_free (app->windows); + + g_slist_foreach (app->lookup_words, (GFunc) g_free, NULL); + g_slist_free (app->lookup_words); + + g_slist_foreach (app->match_words, (GFunc) g_free, NULL); + g_slist_free (app->match_words); + + g_free (app->database); + g_free (app->source_name); + + G_OBJECT_CLASS (gdict_app_parent_class)->finalize (object); +} + +static void +gdict_app_class_init (GdictAppClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = gdict_app_finalize; +} + +static void +gdict_app_init (GdictApp *app) +{ + app->windows = NULL; + app->current_window = NULL; +} + +static void +gdict_window_destroy_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictWindow *window = GDICT_WINDOW (widget); + GdictApp *app = GDICT_APP (user_data); + + g_assert (GDICT_IS_APP (app)); + + app->windows = g_slist_remove (app->windows, window); + + if (window == app->current_window) + app->current_window = app->windows ? app->windows->data : NULL; + + if (app->windows == NULL) + gtk_main_quit (); +} + +static void +gdict_window_created_cb (GdictWindow *parent, + GdictWindow *new_window, + gpointer user_data) +{ + GdictApp *app = GDICT_APP (user_data); + + /* this might seem convoluted - but it's necessary, since I don't want + * GdictWindow to know about the GdictApp singleton. every time a new + * window is created by a GdictWindow, it will register its "child window" + * here; the lifetime handlers will check every child window created and + * destroyed, and will add/remove it to the windows list accordingly + */ + g_signal_connect (new_window, "created", + G_CALLBACK (gdict_window_created_cb), app); + g_signal_connect (new_window, "destroy", + G_CALLBACK (gdict_window_destroy_cb), app); + + if (gtk_window_get_group (GTK_WINDOW (parent))) + gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (parent)), + GTK_WINDOW (new_window)); + + app->windows = g_slist_prepend (app->windows, new_window); + app->current_window = new_window; +} + +static void +gdict_create_window (GdictApp *app) +{ + GSList *l; + + if (!singleton->lookup_words && !singleton->match_words) + { + GtkWidget *window; + + window = gdict_window_new (GDICT_WINDOW_ACTION_CLEAR, + singleton->loader, + singleton->source_name, + NULL); + g_signal_connect (window, "created", + G_CALLBACK (gdict_window_created_cb), app); + g_signal_connect (window, "destroy", + G_CALLBACK (gdict_window_destroy_cb), app); + + app->windows = g_slist_prepend (app->windows, window); + app->current_window = GDICT_WINDOW (window); + + gtk_widget_show (window); + + return; + } + + for (l = singleton->lookup_words; l != NULL; l = l->next) + { + gchar *word = l->data; + GtkWidget *window; + + window = gdict_window_new (GDICT_WINDOW_ACTION_LOOKUP, + singleton->loader, + singleton->source_name, + word); + + g_signal_connect (window, "created", + G_CALLBACK (gdict_window_created_cb), app); + g_signal_connect (window, "destroy", + G_CALLBACK (gdict_window_destroy_cb), app); + + app->windows = g_slist_prepend (app->windows, window); + app->current_window = GDICT_WINDOW (window); + + gtk_widget_show (window); + } + + for (l = singleton->match_words; l != NULL; l = l->next) + { + gchar *word = l->data; + GtkWidget *window; + + window = gdict_window_new (GDICT_WINDOW_ACTION_MATCH, + singleton->loader, + singleton->source_name, + word); + + g_signal_connect (window, "created", + G_CALLBACK (gdict_window_created_cb), app); + g_signal_connect (window, "destroy", + G_CALLBACK (gdict_window_destroy_cb), app); + + app->windows = g_slist_prepend (app->windows, window); + app->current_window = GDICT_WINDOW (window); + + gtk_widget_show (window); + } +} + +static void +definition_found_cb (GdictContext *context, + GdictDefinition *definition, + gpointer user_data) +{ + /* Translators: the first is the word found, the second is the + * database name and the last is the definition's text; please + * keep the new lines. */ + g_print (_("Definition for '%s'\n" + " From '%s':\n" + "\n" + "%s\n"), + gdict_definition_get_word (definition), + gdict_definition_get_database (definition), + gdict_definition_get_text (definition)); +} + +static void +error_cb (GdictContext *context, + const GError *error, + gpointer user_data) +{ + g_print (_("Error: %s\n"), error->message); + + gtk_main_quit (); +} + +static void +lookup_end_cb (GdictContext *context, + gpointer user_data) +{ + GdictApp *app = GDICT_APP (user_data); + + app->remaining_words -= 1; + + if (app->remaining_words == 0) + gtk_main_quit (); +} + +static void +gdict_look_up_word_and_quit (GdictApp *app) +{ + GdictSource *source; + GdictContext *context; + GSList *l; + + if ((!app->lookup_words) || (!app->match_words)) + { + g_print (_("See mate-dictionary --help for usage\n")); + + gdict_cleanup (); + exit (1); + } + + if (app->source_name) + source = gdict_source_loader_get_source (app->loader, app->source_name); + else + source = gdict_source_loader_get_source (app->loader, GDICT_DEFAULT_SOURCE_NAME); + + if (!source) + { + g_warning (_("Unable to find a suitable dictionary source")); + + gdict_cleanup (); + exit (1); + } + + /* we'll just use this one context, so we can destroy it along with + * the source that contains it + */ + context = gdict_source_peek_context (source); + g_assert (GDICT_IS_CONTEXT (context)); + + g_signal_connect (context, "definition-found", + G_CALLBACK (definition_found_cb), app); + g_signal_connect (context, "error", + G_CALLBACK (error_cb), app); + g_signal_connect (context, "lookup-end", + G_CALLBACK (lookup_end_cb), app); + + app->remaining_words = 0; + for (l = app->lookup_words; l != NULL; l = l->next) + { + gchar *word = l->data; + GError *err = NULL; + + app->remaining_words += 1; + + gdict_context_define_word (context, + app->database, + word, + &err); + + if (err) + { + g_warning (_("Error while looking up the definition of \"%s\":\n%s"), + word, + err->message); + + g_error_free (err); + } + } + + gtk_main (); + + g_object_unref (source); + + gdict_cleanup (); + exit (0); +} + +void +gdict_init (int *argc, char ***argv) +{ + GError *mateconf_error, *err = NULL; + GOptionContext *context; + gchar *loader_path; + gchar **lookup_words = NULL; + gchar **match_words = NULL; + gchar *database = NULL; + gchar *strategy = NULL; + gchar *source_name = NULL; + gboolean no_window = FALSE; + gboolean list_sources = FALSE; + + const GOptionEntry gdict_app_goptions[] = + { + { "look-up", 0, 0, G_OPTION_ARG_STRING_ARRAY, &lookup_words, + N_("Words to look up"), N_("word") }, + { "match", 0, 0, G_OPTION_ARG_STRING_ARRAY, &match_words, + N_("Words to match"), N_("word") }, + { "source", 's', 0, G_OPTION_ARG_STRING, &source_name, + N_("Dictionary source to use"), N_("source") }, + { "list-sources", 'l', 0, G_OPTION_ARG_NONE, &list_sources, + N_("Show available dictionary sources"), NULL }, + { "no-window", 'n', 0, G_OPTION_ARG_NONE, &no_window, + N_("Print result to the console"), NULL }, + { "database", 'D', 0, G_OPTION_ARG_STRING, &database, + N_("Database to use"), N_("db") }, + { "strategy", 'S', 0, G_OPTION_ARG_STRING, &strategy, + N_("Strategy to use"), N_("strat") }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &lookup_words, + N_("Words to look up"), N_("word") }, + { NULL }, + }; + + /* we must have GLib's type system up and running in order to create the + * singleton object for mate-dictionary; thus, we can't rely on + * mate_program_init() calling g_type_init() for us. + */ + g_type_init (); + + g_assert (singleton == NULL); + + singleton = GDICT_APP (g_object_new (GDICT_TYPE_APP, NULL)); + g_assert (GDICT_IS_APP (singleton)); + + /* create the new option context */ + context = g_option_context_new (_(" - Look up words in dictionaries")); + + g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); + g_option_context_add_main_entries (context, gdict_app_goptions, GETTEXT_PACKAGE); + g_option_context_add_group (context, gdict_get_option_group ()); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); + + g_option_context_parse (context, argc, argv, &err); + if (err) + { + g_critical ("Failed to parse argument: %s", err->message); + g_error_free (err); + g_option_context_free (context); + gdict_cleanup (); + + exit (1); + } + + g_set_application_name (_("Dictionary")); + gtk_window_set_default_icon_name ("accessories-dictionary"); + + if (!gdict_create_data_dir ()) + { + gdict_cleanup (); + + exit (1); + } + + mateconf_error = NULL; + singleton->mateconf_client = mateconf_client_get_default (); + mateconf_client_add_dir (singleton->mateconf_client, + GDICT_MATECONF_DIR, + MATECONF_CLIENT_PRELOAD_ONELEVEL, + &mateconf_error); + if (mateconf_error) + { + g_warning ("Unable to access MateConf: %s\n", mateconf_error->message); + + g_error_free (mateconf_error); + g_object_unref (singleton->mateconf_client); + } + + /* add user's path for fetching dictionary sources */ + singleton->loader = gdict_source_loader_new (); + loader_path = gdict_get_data_dir (); + gdict_source_loader_add_search_path (singleton->loader, loader_path); + g_free (loader_path); + + if (lookup_words) + { + gsize i; + gsize length = g_strv_length (lookup_words); + + for (i = 0; i < length; i++) + singleton->lookup_words = g_slist_prepend (singleton->lookup_words, + g_strdup (lookup_words[i])); + } + + if (match_words) + { + gsize i; + gsize length = g_strv_length (match_words); + + for (i = 0; i < length; i++) + singleton->match_words = g_slist_prepend (singleton->match_words, + g_strdup (match_words[i])); + } + + if (database) + singleton->database = g_strdup (database); + + if (source_name) + singleton->source_name = g_strdup (source_name); + + if (no_window) + singleton->no_window = TRUE; + + if (list_sources) + singleton->list_sources = TRUE; +} + +void +gdict_main (void) +{ + if (!singleton) + { + g_warning ("You must initialize GdictApp using gdict_init()\n"); + return; + } + + if (!singleton->no_window) + gdict_create_window (singleton); + else + gdict_look_up_word_and_quit (singleton); + + gtk_main (); +} + +void +gdict_cleanup (void) +{ + if (!singleton) + { + g_warning ("You must initialize GdictApp using gdict_init()\n"); + return; + } + + g_object_unref (singleton); +} diff --git a/mate-dictionary/src/gdict-app.h b/mate-dictionary/src/gdict-app.h new file mode 100644 index 00000000..c66f8958 --- /dev/null +++ b/mate-dictionary/src/gdict-app.h @@ -0,0 +1,72 @@ +/* gdict-app.h - main application class + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __GDICT_APP_H__ +#define __GDICT_APP_H__ + +#include <gtk/gtk.h> +#include <mateconf/mateconf-client.h> +#include <libgdict/gdict.h> + +#include "gdict-window.h" + +G_BEGIN_DECLS + +#define GDICT_TYPE_APP (gdict_app_get_type ()) +#define GDICT_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_APP, GdictApp)) +#define GDICT_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_APP)) + +typedef struct _GdictApp GdictApp; +typedef struct _GdictAppClass GdictAppClass; + + +struct _GdictApp +{ + GObject parent_instance; + + MateConfClient *mateconf_client; + + GSList *lookup_words; + GSList *match_words; + gint remaining_words; + + gchar *database; + gchar *source_name; + gboolean no_window; + gboolean list_sources; + + GdictSourceLoader *loader; + + GdictWindow *current_window; + GSList *windows; +}; + + +GType gdict_app_get_type (void) G_GNUC_CONST; + +void gdict_init (int *argc, char ***argv); +void gdict_main (void); +void gdict_cleanup (void); + +G_END_DECLS + +#endif /* __GDICT_APP_H__ */ diff --git a/mate-dictionary/src/gdict-applet.c b/mate-dictionary/src/gdict-applet.c new file mode 100644 index 00000000..442381a6 --- /dev/null +++ b/mate-dictionary/src/gdict-applet.c @@ -0,0 +1,1333 @@ +/* gdict-applet.c - MATE Dictionary Applet + * + * Copyright (c) 2005 Emmanuele Bassi <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <glib/gi18n.h> +#include <gdk/gdkkeysyms.h> +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gtk/gtk.h> +#include <mateconf/mateconf-client.h> + +#include "gdict-applet.h" +#include "gdict-about.h" +#include "gdict-pref-dialog.h" +#include "gdict-print.h" +#include "gdict-common.h" +#include "gdict-aligned-window.h" + +#define GDICT_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_APPLET, GdictAppletClass)) +#define GDICT_APPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_APPLET, GdictAppletClass)) + +struct _GdictAppletClass +{ + MatePanelAppletClass parent_class; +}; + +#define GDICT_APPLET_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_APPLET, GdictAppletPrivate)) + +struct _GdictAppletPrivate +{ + guint size; + GtkOrientation orient; + + MateConfClient *mateconf_client; + guint notify_id; + guint font_notify_id; + + gchar *database; + gchar *strategy; + gchar *source_name; + gchar *print_font; + gchar *defbox_font; + + gchar *word; + GdictContext *context; + guint lookup_start_id; + guint lookup_end_id; + guint error_id; + + GdictSourceLoader *loader; + + GtkWidget *box; + GtkWidget *toggle; + GtkWidget *image; + GtkWidget *entry; + GtkWidget *window; + GtkWidget *frame; + GtkWidget *defbox; + + guint idle_draw_id; + + GdkPixbuf *icon; + + gint window_width; + gint window_height; + + guint is_window_showing : 1; +}; + +#define WINDOW_MIN_WIDTH 300 +#define WINDOW_MIN_HEIGHT 200 +#define WINDOW_NUM_COLUMNS 47 +#define WINDOW_NUM_ROWS 20 + +G_DEFINE_TYPE (GdictApplet, gdict_applet, PANEL_TYPE_APPLET); + + +static const GtkTargetEntry drop_types[] = +{ + { "text/plain", 0, 0 }, + { "TEXT", 0, 0 }, + { "STRING", 0, 0 }, + { "UTF8_STRING", 0, 0 }, +}; +static const guint n_drop_types = G_N_ELEMENTS (drop_types); + + +static void +set_atk_name_description (GtkWidget *widget, + const char *name, + const char *description) +{ + AtkObject *aobj; + + aobj = gtk_widget_get_accessible (widget); + if (!GTK_IS_ACCESSIBLE (aobj)) + return; + + atk_object_set_name (aobj, name); + atk_object_set_description (aobj, description); +} + +static void +set_window_default_size (GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + GtkWidget *widget, *defbox; + gint width, height; + gint font_size; + GdkScreen *screen; + gint monitor_num; + GtkRequisition req; + GdkRectangle monitor; + + if (!priv->window) + return; + + widget = priv->window; + defbox = priv->defbox; + + /* Size based on the font size */ + font_size = pango_font_description_get_size (gtk_widget_get_style (defbox)->font_desc); + font_size = PANGO_PIXELS (font_size); + + width = font_size * WINDOW_NUM_COLUMNS; + height = font_size * WINDOW_NUM_ROWS; + + /* Use at least the requisition size of the window... */ + gtk_widget_size_request (widget, &req); + width = MAX (width, req.width); + height = MAX (height, req.height); + + /* ... but make it no larger than half the monitor size */ + screen = gtk_widget_get_screen (widget); + monitor_num = gdk_screen_get_monitor_at_window (screen, + gtk_widget_get_window (widget)); + + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + + width = MIN (width, monitor.width / 2); + height = MIN (height, monitor.height / 2); + + /* Set size */ + gtk_widget_set_size_request (priv->frame, width, height); +} + +static void +clear_cb (GtkWidget *widget, + GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + + gtk_entry_set_text (GTK_ENTRY (priv->entry), ""); + + if (!priv->defbox) + return; + + gdict_defbox_clear (GDICT_DEFBOX (priv->defbox)); +} + +static void +print_cb (GtkWidget *widget, + GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + + if (!priv->defbox) + return; + + gdict_show_print_dialog (GTK_WINDOW (priv->window), + GDICT_DEFBOX (priv->defbox)); +} + +static void +save_cb (GtkWidget *widget, + GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + GtkWidget *dialog; + + if (!priv->defbox) + return; + + dialog = gtk_file_chooser_dialog_new (_("Save a Copy"), + GTK_WINDOW (priv->window), + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); + gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); + + /* default to user's $HOME */ + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), g_get_home_dir ()); + gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), _("Untitled document")); + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) + { + gchar *filename; + gchar *text; + gsize len; + GError *write_error = NULL; + + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + + text = gdict_defbox_get_text (GDICT_DEFBOX (priv->defbox), &len); + + g_file_set_contents (filename, + text, + len, + &write_error); + if (write_error) + { + gchar *message; + + message = g_strdup_printf (_("Error while writing to '%s'"), filename); + + gdict_show_error_dialog (GTK_WINDOW (priv->window), + message, + write_error->message); + + g_error_free (write_error); + g_free (message); + } + + g_free (text); + g_free (filename); + } + + gtk_widget_destroy (dialog); +} + +static void +gdict_applet_set_menu_items_sensitive (GdictApplet *applet, + gboolean is_sensitive) +{ + MateComponentUIComponent *popup_component; + + popup_component = mate_panel_applet_get_popup_component (MATE_PANEL_APPLET (applet)); + if (!MATECOMPONENT_IS_UI_COMPONENT (popup_component)) + return; + + matecomponent_ui_component_set_prop (popup_component, + "/commands/Clear", + "sensitive", (is_sensitive ? "1" : "0"), + NULL); + matecomponent_ui_component_set_prop (popup_component, + "/commands/Print", + "sensitive", (is_sensitive ? "1" : "0"), + NULL); + matecomponent_ui_component_set_prop (popup_component, + "/commands/Save", + "sensitive", (is_sensitive ? "1" : "0"), + NULL); +} + +static gboolean +window_key_press_event_cb (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + GdictApplet *applet = GDICT_APPLET (user_data); + + if (event->keyval == GDK_Escape) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (applet->priv->toggle), FALSE); + gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (applet->priv->toggle)); + + return TRUE; + } + else if ((event->keyval == GDK_l) && + (event->state & GDK_CONTROL_MASK)) + { + gtk_widget_grab_focus (applet->priv->entry); + + return TRUE; + } + + return FALSE; +} + +static void +window_show_cb (GtkWidget *window, + GdictApplet *applet) +{ + set_window_default_size (applet); +} + +static void +gdict_applet_build_window (GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + GtkWidget *window; + GtkWidget *frame; + GtkWidget *vbox; + GtkWidget *bbox; + GtkWidget *button; + + if (!priv->entry) + { + g_warning ("No entry widget defined"); + + return; + } + + window = gdict_aligned_window_new (priv->toggle); + g_signal_connect (window, "key-press-event", + G_CALLBACK (window_key_press_event_cb), + applet); + g_signal_connect (window, "show", + G_CALLBACK (window_show_cb), + applet); + + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER (window), frame); + gtk_widget_show (frame); + priv->frame = frame; + + vbox = gtk_vbox_new (FALSE, 12); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); + gtk_container_add (GTK_CONTAINER (frame), vbox); + gtk_widget_show (vbox); + + priv->defbox = gdict_defbox_new (); + if (priv->context) + gdict_defbox_set_context (GDICT_DEFBOX (priv->defbox), priv->context); + + gtk_box_pack_start (GTK_BOX (vbox), priv->defbox, TRUE, TRUE, 0); + gtk_widget_show (priv->defbox); + gtk_widget_set_can_focus (priv->defbox, TRUE); + gtk_widget_set_can_default (priv->defbox, TRUE); + + bbox = gtk_hbutton_box_new (); + gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END); + gtk_box_set_spacing (GTK_BOX (bbox), 6); + gtk_box_pack_end (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); + gtk_widget_show (bbox); + + button = gtk_button_new_from_stock (GTK_STOCK_CLEAR); + gtk_widget_set_tooltip_text (button, _("Clear the definitions found")); + set_atk_name_description (button, + _("Clear definition"), + _("Clear the text of the definition")); + + g_signal_connect (button, "clicked", G_CALLBACK (clear_cb), applet); + gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gtk_button_new_from_stock (GTK_STOCK_PRINT); + gtk_widget_set_tooltip_text (button, _("Print the definitions found")); + set_atk_name_description (button, + _("Print definition"), + _("Print the text of the definition")); + + g_signal_connect (button, "clicked", G_CALLBACK (print_cb), applet); + gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gtk_button_new_from_stock (GTK_STOCK_SAVE); + gtk_widget_set_tooltip_text (button, _("Save the definitions found")); + set_atk_name_description (button, + _("Save definition"), + _("Save the text of the definition to a file")); + + g_signal_connect (button, "clicked", G_CALLBACK (save_cb), applet); + gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_window_set_default (GTK_WINDOW (window), priv->defbox); + + priv->window = window; + priv->is_window_showing = FALSE; +} + +static gboolean +gdict_applet_icon_toggled_cb (GtkWidget *widget, + GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + + if (!priv->window) + gdict_applet_build_window (applet); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) + { + gtk_window_set_screen (GTK_WINDOW (priv->window), + gtk_widget_get_screen (GTK_WIDGET (applet))); + gtk_window_present (GTK_WINDOW (priv->window)); + gtk_widget_grab_focus (priv->defbox); + + priv->is_window_showing = TRUE; + } + else + { + /* force hiding the find pane */ + gdict_defbox_set_show_find (GDICT_DEFBOX (priv->defbox), FALSE); + + gtk_widget_grab_focus (priv->entry); + gtk_widget_hide (priv->window); + + priv->is_window_showing = FALSE; + } + + return FALSE; +} + +static void +gdict_applet_entry_activate_cb (GtkWidget *widget, + GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + gchar *text; + + text = gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); + if (!text) + return; + + g_free (priv->word); + priv->word = text; + + if (!priv->window) + gdict_applet_build_window (applet); + + gdict_defbox_lookup (GDICT_DEFBOX (priv->defbox), priv->word); +} + +static gboolean +gdict_applet_entry_key_press_cb (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + GdictAppletPrivate *priv = GDICT_APPLET (user_data)->priv; + + if (event->keyval == GDK_Escape) + { + if (priv->is_window_showing) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->toggle), FALSE); + gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (priv->toggle)); + + return TRUE; + } + } + else if (event->keyval == GDK_Tab) + { + if (priv->is_window_showing) + gtk_widget_grab_focus (priv->defbox); + } + + return FALSE; +} + +static gboolean +gdict_applet_icon_button_press_event_cb (GtkWidget *widget, + GdkEventButton *event, + GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + + /* we don't want to block the applet's popup menu unless the + * user is toggling the button + */ + if (event->button != 1) + g_signal_stop_emission_by_name (priv->toggle, "button-press-event"); + + return FALSE; +} + +static gboolean +gdict_applet_entry_button_press_event_cb (GtkWidget *widget, + GdkEventButton *event, + GdictApplet *applet) +{ + mate_panel_applet_request_focus (MATE_PANEL_APPLET (applet), event->time); + + return FALSE; +} + +static gboolean +gdict_applet_draw (GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + GtkWidget *box; + GtkWidget *hbox; + gchar *text = NULL; + + if (priv->entry) + text = gtk_editable_get_chars (GTK_EDITABLE (priv->entry), 0, -1); + + if (priv->box) + gtk_widget_destroy (priv->box); + + switch (priv->orient) + { + case GTK_ORIENTATION_VERTICAL: + box = gtk_vbox_new (FALSE, 0); + break; + case GTK_ORIENTATION_HORIZONTAL: + box = gtk_hbox_new (FALSE, 0); + break; + default: + g_assert_not_reached (); + break; + } + + gtk_container_add (GTK_CONTAINER (applet), box); + gtk_widget_show (box); + + /* toggle button */ + priv->toggle = gtk_toggle_button_new (); + gtk_widget_set_tooltip_text (priv->toggle, _("Click to view the dictionary window")); + set_atk_name_description (priv->toggle, + _("Toggle dictionary window"), + _("Show or hide the definition window")); + + gtk_button_set_relief (GTK_BUTTON (priv->toggle), + GTK_RELIEF_NONE); + g_signal_connect (priv->toggle, "toggled", + G_CALLBACK (gdict_applet_icon_toggled_cb), + applet); + g_signal_connect (priv->toggle, "button-press-event", + G_CALLBACK (gdict_applet_icon_button_press_event_cb), + applet); + gtk_box_pack_start (GTK_BOX (box), priv->toggle, FALSE, FALSE, 0); + gtk_widget_show (priv->toggle); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); + gtk_container_add (GTK_CONTAINER (priv->toggle), hbox); + gtk_widget_show (hbox); + + if (priv->icon) + { + GdkPixbuf *scaled; + + priv->image = gtk_image_new (); + gtk_image_set_pixel_size (GTK_IMAGE (priv->image), priv->size - 10); + + scaled = gdk_pixbuf_scale_simple (priv->icon, + priv->size - 5, + priv->size - 5, + GDK_INTERP_BILINEAR); + + gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), scaled); + g_object_unref (scaled); + + gtk_box_pack_start (GTK_BOX (hbox), priv->image, FALSE, FALSE, 0); + + gtk_widget_show (priv->image); + } + else + { + priv->image = gtk_image_new (); + + gtk_image_set_pixel_size (GTK_IMAGE (priv->image), priv->size - 10); + gtk_image_set_from_stock (GTK_IMAGE (priv->image), + GTK_STOCK_MISSING_IMAGE, + -1); + + gtk_box_pack_start (GTK_BOX (hbox), priv->image, FALSE, FALSE, 0); + gtk_widget_show (priv->image); + } + + /* entry */ + priv->entry = gtk_entry_new (); + gtk_widget_set_tooltip_text (priv->entry, _("Type the word you want to look up")); + set_atk_name_description (priv->entry, + _("Dictionary entry"), + _("Look up words in dictionaries")); + + gtk_editable_set_editable (GTK_EDITABLE (priv->entry), TRUE); + gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), 12); + g_signal_connect (priv->entry, "activate", + G_CALLBACK (gdict_applet_entry_activate_cb), + applet); + g_signal_connect (priv->entry, "button-press-event", + G_CALLBACK (gdict_applet_entry_button_press_event_cb), + applet); + g_signal_connect (priv->entry, "key-press-event", + G_CALLBACK (gdict_applet_entry_key_press_cb), + applet); + gtk_box_pack_end (GTK_BOX (box), priv->entry, FALSE, FALSE, 0); + gtk_widget_show (priv->entry); + + if (text) + { + gtk_entry_set_text (GTK_ENTRY (priv->entry), text); + + g_free (text); + } + + priv->box = box; + +#if 0 + gtk_widget_grab_focus (priv->entry); +#endif + + gtk_widget_show_all (GTK_WIDGET (applet)); + + return FALSE; +} + +static void +gdict_applet_queue_draw (GdictApplet *applet) +{ + if (!applet->priv->idle_draw_id) + applet->priv->idle_draw_id = g_idle_add ((GSourceFunc) gdict_applet_draw, + applet); +} + +static void +gdict_applet_lookup_start_cb (GdictContext *context, + GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + + if (!priv->window) + gdict_applet_build_window (applet); + + if (!priv->is_window_showing) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->toggle), TRUE); + + gtk_window_present (GTK_WINDOW (priv->window)); + gtk_widget_grab_focus (priv->defbox); + + priv->is_window_showing = TRUE; + } + + gdict_applet_set_menu_items_sensitive (applet, FALSE); +} + +static void +gdict_applet_lookup_end_cb (GdictContext *context, + GdictApplet *applet) +{ + gdict_applet_set_menu_items_sensitive (applet, TRUE); + + gtk_window_present (GTK_WINDOW (applet->priv->window)); +} + +static void +gdict_applet_error_cb (GdictContext *context, + const GError *error, + GdictApplet *applet) +{ + /* disable menu items */ + gdict_applet_set_menu_items_sensitive (applet, FALSE); +} + +static void +gdict_applet_cmd_lookup (MateComponentUIComponent *component, + GdictApplet *applet, + const gchar *cname) +{ + GdictAppletPrivate *priv = applet->priv; + gchar *text = NULL;; + + text = gtk_editable_get_chars (GTK_EDITABLE (priv->entry), 0, -1); + if (!text) + return; + + g_free (priv->word); + priv->word = text; + + if (!priv->window) + gdict_applet_build_window (applet); + + gdict_defbox_lookup (GDICT_DEFBOX (priv->defbox), priv->word); +} + +static void +gdict_applet_cmd_clear (MateComponentUIComponent *component, + GdictApplet *applet, + const gchar *cname) +{ + clear_cb (NULL, applet); +} + +static void +gdict_applet_cmd_print (MateComponentUIComponent *component, + GdictApplet *applet, + const gchar *cname) +{ + print_cb (NULL, applet); +} + +static void +gdict_applet_cmd_preferences (MateComponentUIComponent *component, + GdictApplet *applet, + const gchar *cname) +{ + gdict_show_pref_dialog (GTK_WIDGET (applet), + _("Dictionary Preferences"), + applet->priv->loader); +} + +static void +gdict_applet_cmd_about (MateComponentUIComponent *component, + GdictApplet *applet, + const gchar *cname) +{ + gdict_show_about_dialog (GTK_WIDGET (applet)); +} + +static void +gdict_applet_cmd_help (MateComponentUIComponent *component, + GdictApplet *applet, + const gchar *cname) +{ + GError *err = NULL; + + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (applet)), + "ghelp:mate-dictionary#mate-dictionary-applet", + gtk_get_current_event_time (), &err); + + if (err) + { + gdict_show_error_dialog (NULL, + _("There was an error while displaying help"), + err->message); + g_error_free (err); + } +} + +static void +gdict_applet_change_background (MatePanelApplet *applet, + MatePanelAppletBackgroundType type, + GdkColor *color, + GdkPixmap *pixmap) +{ + if (MATE_PANEL_APPLET_CLASS (gdict_applet_parent_class)->change_background) + MATE_PANEL_APPLET_CLASS (gdict_applet_parent_class)->change_background (applet, + type, + color, + pixmap); +} + +static void +gdict_applet_change_orient (MatePanelApplet *applet, + MatePanelAppletOrient orient) +{ + GdictAppletPrivate *priv = GDICT_APPLET (applet)->priv; + guint new_size; + GtkAllocation allocation; + + gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation); + switch (orient) + { + case MATE_PANEL_APPLET_ORIENT_LEFT: + case MATE_PANEL_APPLET_ORIENT_RIGHT: + priv->orient = GTK_ORIENTATION_VERTICAL; + new_size = allocation.width; + break; + case MATE_PANEL_APPLET_ORIENT_UP: + case MATE_PANEL_APPLET_ORIENT_DOWN: + priv->orient = GTK_ORIENTATION_HORIZONTAL; + new_size = allocation.height; + break; + } + + if (new_size != priv->size) + priv->size = new_size; + + gdict_applet_queue_draw (GDICT_APPLET (applet)); + + if (MATE_PANEL_APPLET_CLASS (gdict_applet_parent_class)->change_orient) + MATE_PANEL_APPLET_CLASS (gdict_applet_parent_class)->change_orient (applet, + orient); +} + +static void +gdict_applet_size_allocate (GtkWidget *widget, + GdkRectangle *allocation) +{ + GdictApplet *applet = GDICT_APPLET (widget); + GdictAppletPrivate *priv = applet->priv; + guint new_size; + + if (priv->orient == GTK_ORIENTATION_HORIZONTAL) + new_size = allocation->height; + else + new_size = allocation->width; + + if (priv->size != new_size) + { + priv->size = new_size; + + gtk_image_set_pixel_size (GTK_IMAGE (priv->image), priv->size - 10); + + /* re-scale the icon, if it was found */ + if (priv->icon) + { + GdkPixbuf *scaled; + + scaled = gdk_pixbuf_scale_simple (priv->icon, + priv->size - 5, + priv->size - 5, + GDK_INTERP_BILINEAR); + + gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), scaled); + g_object_unref (scaled); + } + } + + if (GTK_WIDGET_CLASS (gdict_applet_parent_class)->size_allocate) + GTK_WIDGET_CLASS (gdict_applet_parent_class)->size_allocate (widget, + allocation); +} + +static void +gdict_applet_style_set (GtkWidget *widget, + GtkStyle *old_style) +{ + if (GTK_WIDGET_CLASS (gdict_applet_parent_class)->style_set) + GTK_WIDGET_CLASS (gdict_applet_parent_class)->style_set (widget, + old_style); +#if 0 + set_window_default_size (GDICT_APPLET (widget)); +#endif +} + +static void +gdict_applet_set_database (GdictApplet *applet, + const gchar *database) +{ + GdictAppletPrivate *priv = applet->priv; + + g_free (priv->database); + + if (database) + priv->database = g_strdup (database); + else + priv->database = gdict_mateconf_get_string_with_default (priv->mateconf_client, + GDICT_MATECONF_DATABASE_KEY, + GDICT_DEFAULT_DATABASE); + if (priv->defbox) + gdict_defbox_set_database (GDICT_DEFBOX (priv->defbox), + priv->database); +} + +static void +gdict_applet_set_strategy (GdictApplet *applet, + const gchar *strategy) +{ + GdictAppletPrivate *priv = applet->priv; + + g_free (priv->strategy); + + if (strategy) + priv->strategy = g_strdup (strategy); + else + priv->strategy = gdict_mateconf_get_string_with_default (priv->mateconf_client, + GDICT_MATECONF_STRATEGY_KEY, + GDICT_DEFAULT_STRATEGY); +} + +static GdictContext * +get_context_from_loader (GdictApplet *applet) +{ + GdictAppletPrivate *priv = applet->priv; + GdictSource *source; + GdictContext *retval; + + if (!priv->source_name) + priv->source_name = g_strdup (GDICT_DEFAULT_SOURCE_NAME); + + source = gdict_source_loader_get_source (priv->loader, + priv->source_name); + if (!source) + { + gchar *detail; + + detail = g_strdup_printf (_("No dictionary source available with name '%s'"), + priv->source_name); + + gdict_show_error_dialog (NULL, + _("Unable to find dictionary source"), + NULL); + + g_free (detail); + + return NULL; + } + + gdict_applet_set_database (applet, gdict_source_get_database (source)); + gdict_applet_set_strategy (applet, gdict_source_get_strategy (source)); + + retval = gdict_source_get_context (source); + if (!retval) + { + gchar *detail; + + detail = g_strdup_printf (_("No context available for source '%s'"), + gdict_source_get_description (source)); + + gdict_show_error_dialog (NULL, + _("Unable to create a context"), + detail); + + g_free (detail); + g_object_unref (source); + + return NULL; + } + + g_object_unref (source); + + return retval; +} + +static void +gdict_applet_set_print_font (GdictApplet *applet, + const gchar *print_font) +{ + GdictAppletPrivate *priv = applet->priv; + + g_free (priv->print_font); + + if (print_font) + priv->print_font = g_strdup (print_font); + else + priv->print_font = gdict_mateconf_get_string_with_default (priv->mateconf_client, + GDICT_MATECONF_PRINT_FONT_KEY, + GDICT_DEFAULT_PRINT_FONT); +} + +static void +gdict_applet_set_defbox_font (GdictApplet *applet, + const gchar *defbox_font) +{ + GdictAppletPrivate *priv = applet->priv; + + g_free (priv->defbox_font); + + if (defbox_font) + priv->defbox_font = g_strdup (defbox_font); + else + priv->defbox_font = gdict_mateconf_get_string_with_default (priv->mateconf_client, + DOCUMENT_FONT_KEY, + GDICT_DEFAULT_DEFBOX_FONT); + + if (priv->defbox) + gdict_defbox_set_font_name (GDICT_DEFBOX (priv->defbox), + priv->defbox_font); +} + +static void +gdict_applet_set_context (GdictApplet *applet, + GdictContext *context) +{ + GdictAppletPrivate *priv = applet->priv; + + if (priv->context) + { + g_signal_handler_disconnect (priv->context, priv->lookup_start_id); + g_signal_handler_disconnect (priv->context, priv->lookup_end_id); + g_signal_handler_disconnect (priv->context, priv->error_id); + + priv->lookup_start_id = 0; + priv->lookup_end_id = 0; + priv->error_id = 0; + + g_object_unref (priv->context); + priv->context = NULL; + } + + if (priv->defbox) + gdict_defbox_set_context (GDICT_DEFBOX (priv->defbox), context); + + if (!context) + return; + + /* attach our callbacks */ + priv->lookup_start_id = g_signal_connect (context, "lookup-start", + G_CALLBACK (gdict_applet_lookup_start_cb), + applet); + priv->lookup_end_id = g_signal_connect (context, "lookup-end", + G_CALLBACK (gdict_applet_lookup_end_cb), + applet); + priv->error_id = g_signal_connect (context, "error", + G_CALLBACK (gdict_applet_error_cb), + applet); + + priv->context = context; +} + +static void +gdict_applet_set_source_name (GdictApplet *applet, + const gchar *source_name) +{ + GdictAppletPrivate *priv = applet->priv; + GdictContext *context; + + g_free (priv->source_name); + + if (source_name) + priv->source_name = g_strdup (source_name); + else + priv->source_name = gdict_mateconf_get_string_with_default (priv->mateconf_client, + GDICT_MATECONF_SOURCE_KEY, + GDICT_DEFAULT_SOURCE_NAME); + + context = get_context_from_loader (applet); + gdict_applet_set_context (applet, context); +} + +static void +gdict_applet_mateconf_notify_cb (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + GdictApplet *applet = GDICT_APPLET (user_data); + + if (strcmp (entry->key, GDICT_MATECONF_PRINT_FONT_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_applet_set_print_font (applet, mateconf_value_get_string (entry->value)); + else + gdict_applet_set_print_font (applet, GDICT_DEFAULT_PRINT_FONT); + } + else if (strcmp (entry->key, GDICT_MATECONF_SOURCE_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_applet_set_source_name (applet, mateconf_value_get_string (entry->value)); + else + gdict_applet_set_source_name (applet, GDICT_DEFAULT_SOURCE_NAME); + } + else if (strcmp (entry->key, GDICT_MATECONF_DATABASE_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_applet_set_database (applet, mateconf_value_get_string (entry->value)); + else + gdict_applet_set_database (applet, GDICT_DEFAULT_DATABASE); + } + else if (strcmp (entry->key, GDICT_MATECONF_STRATEGY_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_applet_set_strategy (applet, mateconf_value_get_string (entry->value)); + else + gdict_applet_set_strategy (applet, GDICT_DEFAULT_STRATEGY); + } + else if (strcmp (entry->key, DOCUMENT_FONT_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_applet_set_defbox_font (applet, mateconf_value_get_string (entry->value)); + else + gdict_applet_set_defbox_font (applet, GDICT_DEFAULT_DEFBOX_FONT); + } +} + +static void +gdict_applet_finalize (GObject *object) +{ + GdictApplet *applet = GDICT_APPLET (object); + GdictAppletPrivate *priv = applet->priv; + + if (priv->idle_draw_id) + g_source_remove (priv->idle_draw_id); + + if (priv->notify_id) + mateconf_client_notify_remove (priv->mateconf_client, priv->notify_id); + + if (priv->font_notify_id) + mateconf_client_notify_remove (priv->mateconf_client, priv->font_notify_id); + + if (priv->mateconf_client) + g_object_unref (priv->mateconf_client); + + if (priv->context) + { + if (priv->lookup_start_id) + { + g_signal_handler_disconnect (priv->context, priv->lookup_start_id); + g_signal_handler_disconnect (priv->context, priv->lookup_end_id); + g_signal_handler_disconnect (priv->context, priv->error_id); + } + + g_object_unref (priv->context); + } + + if (priv->loader) + g_object_unref (priv->loader); + + if (priv->icon) + g_object_unref (priv->icon); + + g_free (priv->source_name); + g_free (priv->print_font); + g_free (priv->defbox_font); + g_free (priv->word); + + G_OBJECT_CLASS (gdict_applet_parent_class)->finalize (object); +} + +static void +gdict_applet_class_init (GdictAppletClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + MatePanelAppletClass *applet_class = MATE_PANEL_APPLET_CLASS (klass); + + gobject_class->finalize = gdict_applet_finalize; + + widget_class->size_allocate = gdict_applet_size_allocate; + widget_class->style_set = gdict_applet_style_set; + + applet_class->change_background = gdict_applet_change_background; + applet_class->change_orient = gdict_applet_change_orient; + + g_type_class_add_private (gobject_class, sizeof (GdictAppletPrivate)); +} + +static void +gdict_applet_init (GdictApplet *applet) +{ + GdictAppletPrivate *priv; + gchar *data_dir; + GError *mateconf_error; + + priv = GDICT_APPLET_GET_PRIVATE (applet); + applet->priv = priv; + + if (!priv->loader) + priv->loader = gdict_source_loader_new (); + + /* add our data dir inside $HOME to the loader's search paths */ + data_dir = gdict_get_data_dir (); + gdict_source_loader_add_search_path (priv->loader, data_dir); + g_free (data_dir); + + gtk_window_set_default_icon_name ("accessories-dictionary"); + + mate_panel_applet_set_flags (MATE_PANEL_APPLET (applet), + MATE_PANEL_APPLET_EXPAND_MINOR); + + /* get the default mateconf client */ + if (!priv->mateconf_client) + priv->mateconf_client = mateconf_client_get_default (); + + mateconf_error = NULL; + mateconf_client_add_dir (priv->mateconf_client, + GDICT_MATECONF_DIR, + MATECONF_CLIENT_PRELOAD_ONELEVEL, + &mateconf_error); + if (mateconf_error) + { + gdict_show_gerror_dialog (NULL, + _("Unable to connect to MateConf"), + mateconf_error); + mateconf_error = NULL; + } + + priv->notify_id = mateconf_client_notify_add (priv->mateconf_client, + GDICT_MATECONF_DIR, + gdict_applet_mateconf_notify_cb, + applet, NULL, + &mateconf_error); + if (mateconf_error) + { + gdict_show_gerror_dialog (NULL, + _("Unable to get notification for preferences"), + mateconf_error); + + mateconf_error = NULL; + } + + priv->font_notify_id = mateconf_client_notify_add (priv->mateconf_client, + DOCUMENT_FONT_KEY, + gdict_applet_mateconf_notify_cb, + applet, NULL, + &mateconf_error); + if (mateconf_error) + { + gdict_show_gerror_dialog (NULL, + _("Unable to get notification for the document font"), + mateconf_error); + + mateconf_error = NULL; + } + +#ifndef GDICT_APPLET_STAND_ALONE + mate_panel_applet_set_background_widget (MATE_PANEL_APPLET (applet), + GTK_WIDGET (applet)); + + priv->size = mate_panel_applet_get_size (MATE_PANEL_APPLET (applet)); + + switch (mate_panel_applet_get_orient (MATE_PANEL_APPLET (applet))) + { + case MATE_PANEL_APPLET_ORIENT_LEFT: + case MATE_PANEL_APPLET_ORIENT_RIGHT: + priv->orient = GTK_ORIENTATION_VERTICAL; + break; + case MATE_PANEL_APPLET_ORIENT_UP: + case MATE_PANEL_APPLET_ORIENT_DOWN: + priv->orient = GTK_ORIENTATION_HORIZONTAL; + break; + } +#else + priv->size = 24; + priv->orient = GTK_ORIENTATION_HORIZONTAL; + g_message ("(in %s) applet { size = %d, orient = %s }", + G_STRFUNC, + priv->size, + (priv->orient == GTK_ORIENTATION_HORIZONTAL ? "H" : "V")); +#endif /* !GDICT_APPLET_STAND_ALONE */ + + priv->icon = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), + "accessories-dictionary", + 48, + 0, + NULL); + + /* force first draw */ + gdict_applet_draw (applet); + + /* force retrieval of the configuration from MateConf */ + gdict_applet_set_source_name (applet, NULL); + gdict_applet_set_defbox_font (applet, NULL); + gdict_applet_set_print_font (applet, NULL); +} + +#ifndef GDICT_APPLET_STAND_ALONE +static const MateComponentUIVerb gdict_applet_menu_verbs[] = +{ + MATECOMPONENT_UI_UNSAFE_VERB ("LookUp", gdict_applet_cmd_lookup), + + MATECOMPONENT_UI_UNSAFE_VERB ("Clear", gdict_applet_cmd_clear), + MATECOMPONENT_UI_UNSAFE_VERB ("Print", gdict_applet_cmd_print), + + MATECOMPONENT_UI_UNSAFE_VERB ("Preferences", gdict_applet_cmd_preferences), + MATECOMPONENT_UI_UNSAFE_VERB ("Help", gdict_applet_cmd_help), + MATECOMPONENT_UI_UNSAFE_VERB ("About", gdict_applet_cmd_about), + + MATECOMPONENT_UI_VERB_END +}; + +static gboolean +gdict_applet_factory (MatePanelApplet *applet, + const gchar *iid, + gpointer data) +{ + gboolean retval = FALSE; + + if (((!strcmp (iid, "OAFIID:MATE_DictionaryApplet")) || + (!strcmp (iid, "OAFIID:MATE_GDictApplet"))) && + gdict_create_data_dir ()) + { + /* Set up the menu */ + mate_panel_applet_setup_menu_from_file (applet, UIDATADIR, + "MATE_DictionaryApplet.xml", + NULL, + gdict_applet_menu_verbs, + applet); + + gtk_widget_show (GTK_WIDGET (applet)); + + /* set the menu items insensitive */ + gdict_applet_set_menu_items_sensitive (GDICT_APPLET (applet), FALSE); + + retval = TRUE; + } + + return retval; +} + +/* this defines the main () for the applet */ +MATE_PANEL_APPLET_MATECOMPONENT_FACTORY ("OAFIID:MATE_DictionaryApplet_Factory", + GDICT_TYPE_APPLET, + "mate-dictionary-applet", + VERSION, + gdict_applet_factory, + NULL); + +#else /* GDICT_APPLET_STAND_ALONE */ + +int +main (int argc, char *argv[]) +{ + GtkWidget *window; + GtkWidget *applet; + + /* gettext stuff */ + bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + gtk_init (&argc, &argv); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); + + applet = GTK_WIDGET (g_object_new (GDICT_TYPE_APPLET, NULL)); + g_message ("(in %s) typeof(applet) = '%s'", + G_STRFUNC, + g_type_name (G_OBJECT_TYPE (applet))); + + gdict_applet_queue_draw (GDICT_APPLET (applet)); + + gtk_container_set_border_width (GTK_CONTAINER (window), 12); + gtk_container_add (GTK_CONTAINER (window), applet); + + gtk_widget_show_all (window); + + gtk_main (); + + return 0; +} + +#endif /* !GDICT_APPLET_STAND_ALONE */ diff --git a/mate-dictionary/src/gdict-applet.h b/mate-dictionary/src/gdict-applet.h new file mode 100644 index 00000000..48f61c24 --- /dev/null +++ b/mate-dictionary/src/gdict-applet.h @@ -0,0 +1,48 @@ +/* gdict-applet.h - MATE Dictionary Applet + * + * Copyright (c) 2005 Emmanuele Bassi <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __GDICT_APPLET_H__ +#define __GDICT_APPLET_H__ + +#include <gtk/gtk.h> +#include <mate-panel-applet.h> +#include <libgdict/gdict.h> + +G_BEGIN_DECLS + +#define GDICT_TYPE_APPLET (gdict_applet_get_type ()) +#define GDICT_APPLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_APPLET, GdictApplet)) +#define GDICT_IS_APPLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_APPLET)) + +typedef struct _GdictApplet GdictApplet; +typedef struct _GdictAppletClass GdictAppletClass; +typedef struct _GdictAppletPrivate GdictAppletPrivate; + +struct _GdictApplet +{ + MatePanelApplet parent_instance; + + GdictAppletPrivate *priv; +}; + +GType gdict_applet_get_type (void); + +G_END_DECLS + +#endif /* __GDICT_APPLET_H__ */ diff --git a/mate-dictionary/src/gdict-common.c b/mate-dictionary/src/gdict-common.c new file mode 100644 index 00000000..8f106c18 --- /dev/null +++ b/mate-dictionary/src/gdict-common.c @@ -0,0 +1,201 @@ +/* gdict-common.h - shared code between application and applet + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <sys/types.h> +#include <errno.h> + +#include <glib.h> +#include <glib/gi18n.h> +#include <glib/gstdio.h> + +#include <gtk/gtk.h> + +#include "gdict-common.h" + +gchar * +gdict_get_data_dir (void) +{ + gchar *retval; + + retval = g_build_filename (g_get_home_dir (), + ".mate2", + "mate-dictionary", + NULL); + + return retval; +} + +/* create the data directory inside $HOME, if it doesn't exist yet */ +gboolean +gdict_create_data_dir (void) +{ + gchar *data_dir_name; + + data_dir_name = gdict_get_data_dir (); + if (g_mkdir (data_dir_name, 0700) == -1) + { + /* this is weird, but sometimes there's a "mate-dictionary" file + * inside $HOME/.mate2; see bug #329126. + */ + if ((errno == EEXIST) && + (g_file_test (data_dir_name, G_FILE_TEST_IS_REGULAR))) + { + gchar *backup = g_strdup_printf ("%s.pre-2-14", data_dir_name); + + if (g_rename (data_dir_name, backup) == -1) + { + GtkWidget *error_dialog; + + error_dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Unable to rename file '%s' to '%s': %s"), + data_dir_name, + backup, + g_strerror (errno)); + + gtk_dialog_run (GTK_DIALOG (error_dialog)); + + gtk_widget_destroy (error_dialog); + g_free (backup); + g_free (data_dir_name); + + return FALSE; + } + + g_free (backup); + + if (g_mkdir (data_dir_name, 0700) == -1) + { + GtkWidget *error_dialog; + + error_dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Unable to create the data directory '%s': %s"), + data_dir_name, + g_strerror (errno)); + + gtk_dialog_run (GTK_DIALOG (error_dialog)); + + gtk_widget_destroy (error_dialog); + g_free (data_dir_name); + + return FALSE; + } + + goto success; + } + + if (errno != EEXIST) + { + GtkWidget *error_dialog; + + error_dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Unable to create the data directory '%s': %s"), + data_dir_name, + g_strerror (errno)); + + gtk_dialog_run (GTK_DIALOG (error_dialog)); + + gtk_widget_destroy (error_dialog); + g_free (data_dir_name); + + return FALSE; + } + } + +success: + g_free (data_dir_name); + + return TRUE; +} + +/* shows an error dialog making it transient for @parent */ +void +gdict_show_error_dialog (GtkWindow *parent, + const gchar *message, + const gchar *detail) +{ + GtkWidget *dialog; + + g_return_if_fail ((parent == NULL) || (GTK_IS_WINDOW (parent))); + g_return_if_fail (message != NULL); + + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", message); + gtk_window_set_title (GTK_WINDOW (dialog), ""); + + if (detail) + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + "%s", detail); + + if (parent && gtk_window_get_group (parent)) + gtk_window_group_add_window (gtk_window_get_group (parent), GTK_WINDOW (dialog)); + + gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); +} + +void +gdict_show_gerror_dialog (GtkWindow *parent, + const gchar *message, + GError *error) +{ + g_return_if_fail ((parent == NULL) || (GTK_IS_WINDOW (parent))); + g_return_if_fail (message != NULL); + g_return_if_fail (error != NULL); + + gdict_show_error_dialog (parent, message, error->message); + + g_error_free (error); + error = NULL; +} + +gchar * +gdict_mateconf_get_string_with_default (MateConfClient *client, + const gchar *key, + const gchar *def) +{ + gchar *val; + + val = mateconf_client_get_string (client, key, NULL); + return val ? val : g_strdup (def); +} + diff --git a/mate-dictionary/src/gdict-common.h b/mate-dictionary/src/gdict-common.h new file mode 100644 index 00000000..f8bc903d --- /dev/null +++ b/mate-dictionary/src/gdict-common.h @@ -0,0 +1,48 @@ +/* gdict-common.h - shared code between application and applet + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __GDICT_COMMON_H__ +#define __GDICT_COMMON_H__ + +#include <gtk/gtk.h> +#include <mateconf/mateconf-client.h> + +G_BEGIN_DECLS + +gboolean gdict_create_data_dir (void); +gchar * gdict_get_data_dir (void) G_GNUC_MALLOC; + +void gdict_show_error_dialog (GtkWindow *parent, + const gchar *message, + const gchar *detail); +void gdict_show_gerror_dialog (GtkWindow *parent, + const gchar *message, + GError *error); + +gchar * gdict_mateconf_get_string_with_default (MateConfClient *client, + const gchar *key, + const gchar *def); + + +G_END_DECLS + +#endif /* __GDICT_COMMON_H__ */ diff --git a/mate-dictionary/src/gdict-pref-dialog.c b/mate-dictionary/src/gdict-pref-dialog.c new file mode 100644 index 00000000..24b61980 --- /dev/null +++ b/mate-dictionary/src/gdict-pref-dialog.c @@ -0,0 +1,744 @@ +/* gdict-pref-dialog.c - preferences dialog + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <sys/types.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <glib/gi18n.h> +#include <mateconf/mateconf-client.h> + +#include "gdict-source-dialog.h" +#include "gdict-pref-dialog.h" +#include "gdict-common.h" + +#define GDICT_PREFERENCES_UI PKGDATADIR "/mate-dictionary-preferences.ui" + +#define DEFAULT_MIN_WIDTH 220 +#define DEFAULT_MIN_HEIGHT 330 + +/******************* + * GdictPrefDialog * + *******************/ + +static GtkWidget *global_dialog = NULL; + +enum +{ + SOURCES_ACTIVE_COLUMN = 0, + SOURCES_NAME_COLUMN, + SOURCES_DESCRIPTION_COLUMN, + + SOURCES_N_COLUMNS +}; + +struct _GdictPrefDialog +{ + GtkDialog parent_instance; + + GtkBuilder *builder; + + MateConfClient *mateconf_client; + guint notify_id; + + gchar *active_source; + GdictSourceLoader *loader; + GtkListStore *sources_list; + + /* direct pointers to widgets */ + GtkWidget *notebook; + + GtkWidget *sources_view; + GtkWidget *sources_add; + GtkWidget *sources_remove; + + gchar *print_font; + GtkWidget *font_button; + + GtkWidget *help_button; + GtkWidget *close_button; +}; + +struct _GdictPrefDialogClass +{ + GtkDialogClass parent_class; +}; + +enum +{ + PROP_0, + + PROP_SOURCE_LOADER +}; + + +G_DEFINE_TYPE (GdictPrefDialog, gdict_pref_dialog, GTK_TYPE_DIALOG); + + +static gboolean +select_active_source_name (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) +{ + GdictPrefDialog *dialog = GDICT_PREF_DIALOG (data); + gboolean is_active; + + gtk_tree_model_get (model, iter, + SOURCES_ACTIVE_COLUMN, &is_active, + -1); + if (is_active) + { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->sources_view)); + + gtk_tree_selection_select_iter (selection, iter); + + return TRUE; + } + + return FALSE; +} + +static void +update_sources_view (GdictPrefDialog *dialog) +{ + const GSList *sources, *l; + + gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->sources_view), NULL); + + gtk_list_store_clear (dialog->sources_list); + + /* force update of the sources list */ + gdict_source_loader_update (dialog->loader); + + sources = gdict_source_loader_get_sources (dialog->loader); + for (l = sources; l != NULL; l = l->next) + { + GdictSource *source = GDICT_SOURCE (l->data); + GtkTreeIter iter; + const gchar *name, *description; + gboolean is_active = FALSE; + + name = gdict_source_get_name (source); + description = gdict_source_get_description (source); + if (!description) + description = name; + + if (strcmp (name, dialog->active_source) == 0) + is_active = TRUE; + + gtk_list_store_append (dialog->sources_list, &iter); + gtk_list_store_set (dialog->sources_list, &iter, + SOURCES_ACTIVE_COLUMN, is_active, + SOURCES_NAME_COLUMN, name, + SOURCES_DESCRIPTION_COLUMN, description, + -1); + } + + gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->sources_view), + GTK_TREE_MODEL (dialog->sources_list)); + + /* select the currently active source name */ + gtk_tree_model_foreach (GTK_TREE_MODEL (dialog->sources_list), + select_active_source_name, + dialog); +} + +static void +source_renderer_toggled_cb (GtkCellRendererToggle *renderer, + const gchar *path, + GdictPrefDialog *dialog) +{ + GtkTreePath *treepath; + GtkTreeIter iter; + gboolean res; + gboolean is_active; + gchar *name; + + treepath = gtk_tree_path_new_from_string (path); + res = gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->sources_list), + &iter, + treepath); + if (!res) + { + gtk_tree_path_free (treepath); + + return; + } + + gtk_tree_model_get (GTK_TREE_MODEL (dialog->sources_list), &iter, + SOURCES_NAME_COLUMN, &name, + SOURCES_ACTIVE_COLUMN, &is_active, + -1); + if (!is_active && name != NULL) + { + g_free (dialog->active_source); + dialog->active_source = g_strdup (name); + + mateconf_client_set_string (dialog->mateconf_client, + GDICT_MATECONF_SOURCE_KEY, + dialog->active_source, + NULL); + + update_sources_view (dialog); + + g_free (name); + } + + gtk_tree_path_free (treepath); +} + +static void +sources_view_row_activated_cb (GtkTreeView *tree_view, + GtkTreePath *tree_path, + GtkTreeViewColumn *tree_iter, + GdictPrefDialog *dialog) +{ + GtkWidget *edit_dialog; + gchar *source_name; + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (tree_view); + if (!model) + return; + + if (!gtk_tree_model_get_iter (model, &iter, tree_path)) + return; + + gtk_tree_model_get (model, &iter, SOURCES_NAME_COLUMN, &source_name, -1); + if (!source_name) + return; + + edit_dialog = gdict_source_dialog_new (GTK_WINDOW (dialog), + _("Edit Dictionary Source"), + GDICT_SOURCE_DIALOG_EDIT, + dialog->loader, + source_name); + gtk_dialog_run (GTK_DIALOG (edit_dialog)); + + gtk_widget_destroy (edit_dialog); + g_free (source_name); + + update_sources_view (dialog); +} + +static void +build_sources_view (GdictPrefDialog *dialog) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *renderer; + + if (dialog->sources_list) + return; + + dialog->sources_list = gtk_list_store_new (SOURCES_N_COLUMNS, + G_TYPE_BOOLEAN, /* active */ + G_TYPE_STRING, /* name */ + G_TYPE_STRING /* description */); + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dialog->sources_list), + SOURCES_DESCRIPTION_COLUMN, + GTK_SORT_ASCENDING); + + renderer = gtk_cell_renderer_toggle_new (); + gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (renderer), TRUE); + g_signal_connect (renderer, "toggled", + G_CALLBACK (source_renderer_toggled_cb), + dialog); + + column = gtk_tree_view_column_new_with_attributes ("active", + renderer, + "active", SOURCES_ACTIVE_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->sources_view), column); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("description", + renderer, + "text", SOURCES_DESCRIPTION_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->sources_view), column); + + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (dialog->sources_view), FALSE); + gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->sources_view), + GTK_TREE_MODEL (dialog->sources_list)); + + g_signal_connect (dialog->sources_view, "row-activated", + G_CALLBACK (sources_view_row_activated_cb), + dialog); +} + +static void +source_add_clicked_cb (GtkWidget *widget, + GdictPrefDialog *dialog) +{ + GtkWidget *add_dialog; + + add_dialog = gdict_source_dialog_new (GTK_WINDOW (dialog), + _("Add Dictionary Source"), + GDICT_SOURCE_DIALOG_CREATE, + dialog->loader, + NULL); + + gtk_dialog_run (GTK_DIALOG (add_dialog)); + + gtk_widget_destroy (add_dialog); + + update_sources_view (dialog); +} + +static void +source_remove_clicked_cb (GtkWidget *widget, + GdictPrefDialog *dialog) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + gboolean is_selected; + gchar *name, *description; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->sources_view)); + if (!selection) + return; + + is_selected = gtk_tree_selection_get_selected (selection, &model, &iter); + if (!is_selected) + return; + + gtk_tree_model_get (model, &iter, + SOURCES_NAME_COLUMN, &name, + SOURCES_DESCRIPTION_COLUMN, &description, + -1); + if (!name) + return; + else + { + GtkWidget *confirm_dialog; + gint response; + + confirm_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_NONE, + _("Remove \"%s\"?"), description); + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (confirm_dialog), + _("This will permanently remove the " + "dictionary source from the list.")); + + gtk_dialog_add_button (GTK_DIALOG (confirm_dialog), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + gtk_dialog_add_button (GTK_DIALOG (confirm_dialog), + GTK_STOCK_REMOVE, + GTK_RESPONSE_OK); + + gtk_window_set_title (GTK_WINDOW (confirm_dialog), ""); + + response = gtk_dialog_run (GTK_DIALOG (confirm_dialog)); + if (response == GTK_RESPONSE_CANCEL) + { + gtk_widget_destroy (confirm_dialog); + + goto out; + } + + gtk_widget_destroy (confirm_dialog); + } + + if (gdict_source_loader_remove_source (dialog->loader, name)) + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + else + { + GtkWidget *error_dialog; + gchar *message; + + message = g_strdup_printf (_("Unable to remove source '%s'"), + description); + + error_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", message); + gtk_window_set_title (GTK_WINDOW (error_dialog), ""); + + gtk_dialog_run (GTK_DIALOG (error_dialog)); + + gtk_widget_destroy (error_dialog); + } + +out: + g_free (name); + g_free (description); + + update_sources_view (dialog); +} + +static void +set_source_loader (GdictPrefDialog *dialog, + GdictSourceLoader *loader) +{ + if (!dialog->sources_list) + return; + + if (dialog->loader) + g_object_unref (dialog->loader); + + dialog->loader = g_object_ref (loader); + + update_sources_view (dialog); +} + +static void +font_button_font_set_cb (GtkWidget *font_button, + GdictPrefDialog *dialog) +{ + const gchar *font; + + font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (font_button)); + if (!font || font[0] == '\0') + return; + + if (dialog->print_font && (strcmp (dialog->print_font, font) == 0)) + return; + + g_free (dialog->print_font); + dialog->print_font = g_strdup (font); + + mateconf_client_set_string (dialog->mateconf_client, + GDICT_MATECONF_PRINT_FONT_KEY, + dialog->print_font, + NULL); +} + +static void +gdict_pref_dialog_mateconf_notify_cb (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + GdictPrefDialog *dialog = GDICT_PREF_DIALOG (user_data); + + if (strcmp (entry->key, GDICT_MATECONF_SOURCE_KEY) == 0) + { + if (entry->value && entry->value->type == MATECONF_VALUE_STRING) + { + g_free (dialog->active_source); + dialog->active_source = g_strdup (mateconf_value_get_string (entry->value)); + } + else + { + g_free (dialog->active_source); + dialog->active_source = g_strdup (GDICT_DEFAULT_SOURCE_NAME); + } + + update_sources_view (dialog); + } + else if (strcmp (entry->key, GDICT_MATECONF_PRINT_FONT_KEY) == 0) + { + if (entry->value && entry->value->type == MATECONF_VALUE_STRING) + { + g_free (dialog->print_font); + dialog->print_font = g_strdup (mateconf_value_get_string (entry->value)); + } + else + { + g_free (dialog->print_font); + dialog->print_font = g_strdup (GDICT_DEFAULT_PRINT_FONT); + } + + gtk_font_button_set_font_name (GTK_FONT_BUTTON (dialog->font_button), + dialog->print_font); + } +} + +static void +response_cb (GtkDialog *dialog, + gint response_id, + gpointer user_data) +{ + GError *err = NULL; + + switch (response_id) + { + case GTK_RESPONSE_HELP: + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)), + "ghelp:mate-dictionary#mate-dictionary-preferences", + gtk_get_current_event_time (), &err); + if (err) + { + GtkWidget *error_dialog; + gchar *message; + + message = g_strdup_printf (_("There was an error while displaying help")); + error_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", message); + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (error_dialog), + "%s", err->message); + gtk_window_set_title (GTK_WINDOW (error_dialog), ""); + + gtk_dialog_run (GTK_DIALOG (error_dialog)); + + gtk_widget_destroy (error_dialog); + g_error_free (err); + } + + /* we don't want the dialog to close itself */ + g_signal_stop_emission_by_name (dialog, "response"); + break; + case GTK_RESPONSE_ACCEPT: + default: + gtk_widget_hide (GTK_WIDGET (dialog)); + break; + } +} + +static void +gdict_pref_dialog_finalize (GObject *object) +{ + GdictPrefDialog *dialog = GDICT_PREF_DIALOG (object); + + if (dialog->notify_id); + mateconf_client_notify_remove (dialog->mateconf_client, dialog->notify_id); + + if (dialog->mateconf_client) + g_object_unref (dialog->mateconf_client); + + if (dialog->builder) + g_object_unref (dialog->builder); + + if (dialog->active_source) + g_free (dialog->active_source); + + if (dialog->loader) + g_object_unref (dialog->loader); + + G_OBJECT_CLASS (gdict_pref_dialog_parent_class)->finalize (object); +} + +static void +gdict_pref_dialog_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictPrefDialog *dialog = GDICT_PREF_DIALOG (object); + + switch (prop_id) + { + case PROP_SOURCE_LOADER: + set_source_loader (dialog, g_value_get_object (value)); + break; + default: + break; + } +} + +static void +gdict_pref_dialog_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictPrefDialog *dialog = GDICT_PREF_DIALOG (object); + + switch (prop_id) + { + case PROP_SOURCE_LOADER: + g_value_set_object (value, dialog->loader); + break; + default: + break; + } +} + +static void +gdict_pref_dialog_class_init (GdictPrefDialogClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = gdict_pref_dialog_set_property; + gobject_class->get_property = gdict_pref_dialog_get_property; + gobject_class->finalize = gdict_pref_dialog_finalize; + + g_object_class_install_property (gobject_class, + PROP_SOURCE_LOADER, + g_param_spec_object ("source-loader", + "Source Loader", + "The GdictSourceLoader used by the application", + GDICT_TYPE_SOURCE_LOADER, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY))); +} + +static void +gdict_pref_dialog_init (GdictPrefDialog *dialog) +{ + gchar *font; + GError *error = NULL; + + gtk_window_set_default_size (GTK_WINDOW (dialog), + DEFAULT_MIN_WIDTH, + DEFAULT_MIN_HEIGHT); + + gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2); + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); + + /* add buttons */ + gtk_dialog_add_button (GTK_DIALOG (dialog), + "gtk-help", + GTK_RESPONSE_HELP); + gtk_dialog_add_button (GTK_DIALOG (dialog), + "gtk-close", + GTK_RESPONSE_ACCEPT); + + dialog->mateconf_client = mateconf_client_get_default (); + mateconf_client_add_dir (dialog->mateconf_client, + GDICT_MATECONF_DIR, + MATECONF_CLIENT_PRELOAD_ONELEVEL, + NULL); + dialog->notify_id = mateconf_client_notify_add (dialog->mateconf_client, + GDICT_MATECONF_DIR, + gdict_pref_dialog_mateconf_notify_cb, + dialog, + NULL, + NULL); + + /* get the UI from the GtkBuilder file */ + dialog->builder = gtk_builder_new (); + gtk_builder_add_from_file (dialog->builder, GDICT_PREFERENCES_UI, &error); + + if (error) { + g_critical ("Unable to load the preferences user interface: %s", error->message); + g_error_free (error); + g_assert_not_reached (); + } + + /* the main widget */ + gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), + GTK_WIDGET (gtk_builder_get_object (dialog->builder, "preferences_root"))); + + /* keep all the interesting widgets around */ + dialog->notebook = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "preferences_notebook")); + + dialog->sources_view = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "sources_treeview")); + build_sources_view (dialog); + + dialog->active_source = gdict_mateconf_get_string_with_default (dialog->mateconf_client, + GDICT_MATECONF_SOURCE_KEY, + GDICT_DEFAULT_SOURCE_NAME); + + dialog->sources_add = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "add_button")); + gtk_widget_set_tooltip_text (dialog->sources_add, + _("Add a new dictionary source")); + g_signal_connect (dialog->sources_add, "clicked", + G_CALLBACK (source_add_clicked_cb), dialog); + + dialog->sources_remove = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "remove_button")); + gtk_widget_set_tooltip_text (dialog->sources_remove, + _("Remove the currently selected dictionary source")); + g_signal_connect (dialog->sources_remove, "clicked", + G_CALLBACK (source_remove_clicked_cb), dialog); + + font = mateconf_client_get_string (dialog->mateconf_client, + GDICT_MATECONF_PRINT_FONT_KEY, + NULL); + if (!font) + font = g_strdup (GDICT_DEFAULT_PRINT_FONT); + + dialog->font_button = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "print_font_button")); + gtk_font_button_set_font_name (GTK_FONT_BUTTON (dialog->font_button), font); + gtk_widget_set_tooltip_text (dialog->font_button, + _("Set the font used for printing the definitions")); + g_signal_connect (dialog->font_button, "font-set", + G_CALLBACK (font_button_font_set_cb), dialog); + g_free (font); + + gtk_widget_show_all (dialog->notebook); + + /* we want to intercept the response signal before any other + * callbacks might be attached by the users of the + * GdictPrefDialog widget. + */ + g_signal_connect (dialog, "response", + G_CALLBACK (response_cb), + NULL); +} + +void +gdict_show_pref_dialog (GtkWidget *parent, + const gchar *title, + GdictSourceLoader *loader) +{ + GtkWidget *dialog; + + g_return_if_fail (GTK_IS_WIDGET (parent)); + g_return_if_fail (GDICT_IS_SOURCE_LOADER (loader)); + + if (parent) + dialog = g_object_get_data (G_OBJECT (parent), "gdict-pref-dialog"); + else + dialog = global_dialog; + + if (!dialog) + { + dialog = g_object_new (GDICT_TYPE_PREF_DIALOG, + "source-loader", loader, + "title", title, + NULL); + + g_object_ref_sink (dialog); + + g_signal_connect (dialog, "delete-event", + G_CALLBACK (gtk_widget_hide_on_delete), + NULL); + + if (parent && GTK_IS_WINDOW (parent)) + { + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); + gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); + g_object_set_data_full (G_OBJECT (parent), "gdict-pref-dialog", + dialog, + g_object_unref); + } + else + global_dialog = dialog; + } + + gtk_window_set_screen (GTK_WINDOW (dialog), + gtk_widget_get_screen (parent)); + gtk_window_present (GTK_WINDOW (dialog)); +} diff --git a/mate-dictionary/src/gdict-pref-dialog.h b/mate-dictionary/src/gdict-pref-dialog.h new file mode 100644 index 00000000..7cae7e57 --- /dev/null +++ b/mate-dictionary/src/gdict-pref-dialog.h @@ -0,0 +1,65 @@ +/* gdict-pref-dialog.h - preferences dialog + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __GDICT_PREF_DIALOG_H__ +#define __GDICT_PREF_DIALOG_H__ + +#include <gtk/gtk.h> +#include <libgdict/gdict.h> + +G_BEGIN_DECLS + +#define GDICT_TYPE_PREF_DIALOG (gdict_pref_dialog_get_type ()) +#define GDICT_PREF_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_PREF_DIALOG, GdictPrefDialog)) +#define GDICT_IS_PREF_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_PREF_DIALOG)) + +#define GDICT_DEFAULT_DEFBOX_FONT "Sans 10" +#define GDICT_DEFAULT_PRINT_FONT "Serif 10" +#define GDICT_DEFAULT_SOURCE_NAME "Default" + +#define GDICT_MATECONF_DIR "/apps/mate-dictionary" +#define GDICT_MATECONF_DATABASE_KEY GDICT_MATECONF_DIR "/database" +#define GDICT_MATECONF_STRATEGY_KEY GDICT_MATECONF_DIR "/strategy" +#define GDICT_MATECONF_PRINT_FONT_KEY GDICT_MATECONF_DIR "/print-font" +#define GDICT_MATECONF_SOURCE_KEY GDICT_MATECONF_DIR "/source-name" +#define GDICT_MATECONF_WINDOW_WIDTH_KEY GDICT_MATECONF_DIR "/default-window-width" +#define GDICT_MATECONF_WINDOW_HEIGHT_KEY GDICT_MATECONF_DIR "/default-window-height" +#define GDICT_MATECONF_WINDOW_IS_MAXIMIZED_KEY GDICT_MATECONF_DIR "/window-is-maximized" +#define GDICT_MATECONF_SIDEBAR_VISIBLE_KEY GDICT_MATECONF_DIR "/sidebar-visible" +#define GDICT_MATECONF_SIDEBAR_PAGE_KEY GDICT_MATECONF_DIR "/sidebar-page" +#define GDICT_MATECONF_SIDEBAR_WIDTH_KEY GDICT_MATECONF_DIR "/sidebar-width" +#define GDICT_MATECONF_STATUSBAR_VISIBLE_KEY GDICT_MATECONF_DIR "/statusbar-visible" + +#define DOCUMENT_FONT_KEY "/desktop/mate/interface/document_font_name" + +typedef struct _GdictPrefDialog GdictPrefDialog; +typedef struct _GdictPrefDialogClass GdictPrefDialogClass; + +GType gdict_pref_dialog_get_type (void) G_GNUC_CONST; + +void gdict_show_pref_dialog (GtkWidget *parent, + const gchar *title, + GdictSourceLoader *loader); + +G_END_DECLS + +#endif /* __GDICT_PREF_DIALOG_H__ */ diff --git a/mate-dictionary/src/gdict-print.c b/mate-dictionary/src/gdict-print.c new file mode 100644 index 00000000..855dbab6 --- /dev/null +++ b/mate-dictionary/src/gdict-print.c @@ -0,0 +1,322 @@ +/* gdict-print.c - print-related helper functions + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <string.h> +#include <math.h> + +#include <gtk/gtk.h> +#include <glib/gi18n.h> + +#include <mateconf/mateconf-client.h> + +#include <libgdict/gdict.h> + +#include "gdict-pref-dialog.h" +#include "gdict-print.h" + +#define HEADER_HEIGHT(lines) ((lines) * 72 / 25.4) +#define HEADER_GAP(lines) ((lines) * 72 / 25.4) + +typedef struct _GdictPrintData +{ + GdictDefbox *defbox; + gchar *word; + + PangoFontDescription *font_desc; + gdouble font_size; + + gchar **lines; + + gint n_lines; + gint lines_per_page; + gint n_pages; +} GdictPrintData; + +static void +begin_print (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data) +{ + GdictPrintData *data = user_data; + gchar *contents; + gdouble height; + + height = gtk_print_context_get_height (context) + - HEADER_HEIGHT (10) + - HEADER_GAP (3); + + contents = gdict_defbox_get_text (data->defbox, NULL); + + data->lines = g_strsplit (contents, "\n", 0); + data->n_lines = g_strv_length (data->lines); + data->lines_per_page = floor (height / data->font_size); + + data->n_pages = (data->n_lines - 1) / data->lines_per_page + 1; + + gtk_print_operation_set_n_pages (operation, data->n_pages); + + g_free (contents); +} + +static void +draw_page (GtkPrintOperation *operation, + GtkPrintContext *context, + gint page_number, + gpointer user_data) +{ + GdictPrintData *data = user_data; + cairo_t *cr; + PangoLayout *layout; + gint text_width, text_height; + gdouble width; + gint line, i; + PangoFontDescription *desc; + gchar *page_str; + + cr = gtk_print_context_get_cairo_context (context); + width = gtk_print_context_get_width (context); + + cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT (10)); + + cairo_set_source_rgb (cr, 0.8, 0.8, 0.8); + cairo_fill_preserve (cr); + + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_set_line_width (cr, 1); + cairo_stroke (cr); + + /* header */ + layout = gtk_print_context_create_pango_layout (context); + + desc = pango_font_description_from_string ("sans 14"); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, data->word, -1); + pango_layout_get_pixel_size (layout, &text_width, &text_height); + + if (text_width > width) + { + pango_layout_set_width (layout, width); + pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_START); + pango_layout_get_pixel_size (layout, &text_width, &text_height); + } + + cairo_move_to (cr, (width - text_width) / 2, + (HEADER_HEIGHT (10) - text_height) / 2); + pango_cairo_show_layout (cr, layout); + + page_str = g_strdup_printf ("%d/%d", page_number + 1, data->n_pages); + pango_layout_set_text (layout, page_str, -1); + g_free (page_str); + + pango_layout_set_width (layout, -1); + pango_layout_get_pixel_size (layout, &text_width, &text_height); + cairo_move_to (cr, width - text_width - 4, + (HEADER_HEIGHT (10) - text_height) / 2); + pango_cairo_show_layout (cr, layout); + + g_object_unref (layout); + + /* text */ + layout = gtk_print_context_create_pango_layout (context); + pango_font_description_set_size (data->font_desc, + data->font_size * PANGO_SCALE); + pango_layout_set_font_description (layout, data->font_desc); + + cairo_move_to (cr, 0, HEADER_HEIGHT (10) + HEADER_GAP (3)); + line = page_number * data->lines_per_page; + for (i = 0; i < data->lines_per_page && line < data->n_lines; i++) + { + pango_layout_set_text (layout, data->lines[line], -1); + + pango_cairo_show_layout (cr, layout); + cairo_rel_move_to (cr, 0, data->font_size); + line++; + } + + g_object_unref (layout); +} + +static void +end_print (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data) +{ + GdictPrintData *data = user_data; + + pango_font_description_free (data->font_desc); + g_free (data->word); + g_strfreev (data->lines); + g_free (data); +} + +static gchar * +get_print_font (void) +{ + MateConfClient *client; + gchar *print_font; + + client = mateconf_client_get_default (); + print_font = mateconf_client_get_string (client, + GDICT_MATECONF_PRINT_FONT_KEY, + NULL); + if (!print_font) + print_font = g_strdup (GDICT_DEFAULT_PRINT_FONT); + + g_object_unref (client); + + return print_font; +} + +void +gdict_show_print_preview (GtkWindow *parent, + GdictDefbox *defbox) +{ + GtkPrintOperation *operation; + GdictPrintData *data; + gchar *print_font; + gchar *word; + GError *error; + + g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent)); + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + g_object_get (defbox, "word", &word, NULL); + if (!word) + { + g_warning ("Preview should be disabled."); + return; + } + + data = g_new0 (GdictPrintData, 1); + data->defbox = defbox; + data->word = word; + + operation = gtk_print_operation_new (); + print_font = get_print_font (); + data->font_desc = pango_font_description_from_string (print_font); + data->font_size = pango_font_description_get_size (data->font_desc) + / PANGO_SCALE; + g_free (print_font); + + g_signal_connect (operation, "begin-print", + G_CALLBACK (begin_print), data); + g_signal_connect (operation, "draw-page", + G_CALLBACK (draw_page), data); + g_signal_connect (operation, "end-print", + G_CALLBACK (end_print), data); + + error = NULL; + gtk_print_operation_run (operation, + GTK_PRINT_OPERATION_ACTION_PREVIEW, + parent, + &error); + g_object_unref (operation); + + if (error) + { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Unable to display the preview: %s"), + error->message); + g_error_free (error); + + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), NULL); + + gtk_widget_show (dialog); + } +} + +void +gdict_show_print_dialog (GtkWindow *parent, + GdictDefbox *defbox) +{ + GtkPrintOperation *operation; + GdictPrintData *data; + gchar *print_font; + gchar *word; + GError *error; + + g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent)); + g_return_if_fail (GDICT_IS_DEFBOX (defbox)); + + g_object_get (defbox, "word", &word, NULL); + if (!word) + { + g_warning ("Print should be disabled."); + return; + } + + data = g_new0 (GdictPrintData, 1); + data->defbox = defbox; + data->word = word; + + operation = gtk_print_operation_new (); + print_font = get_print_font (); + data->font_desc = pango_font_description_from_string (print_font); + data->font_size = pango_font_description_get_size (data->font_desc) + / PANGO_SCALE; + g_free (print_font); + + g_signal_connect (operation, "begin-print", + G_CALLBACK (begin_print), data); + g_signal_connect (operation, "draw-page", + G_CALLBACK (draw_page), data); + g_signal_connect (operation, "end-print", + G_CALLBACK (end_print), data); + + error = NULL; + gtk_print_operation_run (operation, + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, + parent, + &error); + g_object_unref (operation); + + if (error) + { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Unable to display the preview: %s"), + error->message); + g_error_free (error); + + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), NULL); + + gtk_widget_show (dialog); + } +} diff --git a/mate-dictionary/src/gdict-print.h b/mate-dictionary/src/gdict-print.h new file mode 100644 index 00000000..5c0fe25f --- /dev/null +++ b/mate-dictionary/src/gdict-print.h @@ -0,0 +1,38 @@ +/* gdict-print.h - print-related helper functions + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __GDICT_PRINT_H__ +#define __GDICT_PRINT_H__ + +#include <gtk/gtk.h> +#include <libgdict/gdict-defbox.h> + +G_BEGIN_DECLS + +void gdict_show_print_preview (GtkWindow *parent, + GdictDefbox *defbox); +void gdict_show_print_dialog (GtkWindow *parent, + GdictDefbox *defbox); + +G_END_DECLS + +#endif /* __GDICT_PRINT_H__ */ diff --git a/mate-dictionary/src/gdict-sidebar.c b/mate-dictionary/src/gdict-sidebar.c new file mode 100644 index 00000000..c8f51be0 --- /dev/null +++ b/mate-dictionary/src/gdict-sidebar.c @@ -0,0 +1,568 @@ +/* gdict-sidebar.c - sidebar widget + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * + * Based on the equivalent widget from Evince + * by Jonathan Blandford, + * Copyright (C) 2004 Red Hat, Inc. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> + +#include <gdk/gdkkeysyms.h> +#include <gtk/gtk.h> +#include <glib/gi18n.h> + +#include "gdict-sidebar.h" + +typedef struct +{ + guint index; + + gchar *id; + gchar *name; + + GtkWidget *child; + GtkWidget *menu_item; +} SidebarPage; + +#define GDICT_SIDEBAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SIDEBAR, GdictSidebarPrivate)) + +struct _GdictSidebarPrivate +{ + GHashTable *pages_by_id; + GSList *pages; + + GtkWidget *hbox; + GtkWidget *notebook; + GtkWidget *menu; + GtkWidget *close_button; + GtkWidget *label; + GtkWidget *select_button; +}; + +enum +{ + PAGE_CHANGED, + CLOSED, + + LAST_SIGNAL +}; + +static guint sidebar_signals[LAST_SIGNAL] = { 0 }; +static GQuark sidebar_page_id_quark = 0; + +G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_VBOX); + +SidebarPage * +sidebar_page_new (const gchar *id, + const gchar *name, + GtkWidget *widget) +{ + SidebarPage *page; + + page = g_slice_new (SidebarPage); + + page->id = g_strdup (id); + page->name = g_strdup (name); + page->child = widget; + page->index = -1; + page->menu_item = NULL; + + return page; +} + +void +sidebar_page_free (SidebarPage *page) +{ + if (G_LIKELY (page)) + { + g_free (page->name); + g_free (page->id); + + g_slice_free (SidebarPage, page); + } +} + +static void +gdict_sidebar_finalize (GObject *object) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (object); + GdictSidebarPrivate *priv = sidebar->priv; + + if (priv->pages_by_id) + g_hash_table_destroy (priv->pages_by_id); + + if (priv->pages) + { + g_slist_foreach (priv->pages, (GFunc) sidebar_page_free, NULL); + g_slist_free (priv->pages); + } + + G_OBJECT_CLASS (gdict_sidebar_parent_class)->finalize (object); +} + +static void +gdict_sidebar_dispose (GObject *object) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (object); + + if (sidebar->priv->menu) + { + gtk_menu_detach (GTK_MENU (sidebar->priv->menu)); + sidebar->priv->menu = NULL; + } + + G_OBJECT_CLASS (gdict_sidebar_parent_class)->dispose (object); +} + +static void +gdict_sidebar_menu_position_function (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) +{ + GtkWidget *widget; + GtkAllocation allocation; + + g_assert (GTK_IS_BUTTON (user_data)); + + widget = GTK_WIDGET (user_data); + + gdk_window_get_origin (gtk_widget_get_window (widget), x, y); + + gtk_widget_get_allocation (widget, &allocation); + *x += allocation.x; + *y += allocation.y + allocation.height; + + *push_in = FALSE; +} + +static gboolean +gdict_sidebar_select_button_press_cb (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (user_data); + GtkAllocation allocation; + + if (event->button == 1) + { + GtkRequisition req; + gint width; + + gtk_widget_get_allocation (widget, &allocation); + width = allocation.width; + gtk_widget_set_size_request (sidebar->priv->menu, -1, -1); + gtk_widget_size_request (sidebar->priv->menu, &req); + gtk_widget_set_size_request (sidebar->priv->menu, + MAX (width, req.width), -1); + gtk_widget_grab_focus (widget); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); + gtk_menu_popup (GTK_MENU (sidebar->priv->menu), + NULL, NULL, + gdict_sidebar_menu_position_function, widget, + event->button, event->time); + + return TRUE; + } + + return FALSE; +} + +static gboolean +gdict_sidebar_select_key_press_cb (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (user_data); + + if (event->keyval == GDK_space || + event->keyval == GDK_KP_Space || + event->keyval == GDK_Return || + event->keyval == GDK_KP_Enter) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); + gtk_menu_popup (GTK_MENU (sidebar->priv->menu), + NULL, NULL, + gdict_sidebar_menu_position_function, widget, + 1, event->time); + + return TRUE; + } + + return FALSE; +} + +static void +gdict_sidebar_close_clicked_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (user_data); + + g_signal_emit (sidebar, sidebar_signals[CLOSED], 0); +} + +static void +gdict_sidebar_menu_deactivate_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (user_data); + GdictSidebarPrivate *priv = sidebar->priv; + GtkToggleButton *select_button = GTK_TOGGLE_BUTTON (priv->select_button); + + gtk_toggle_button_set_active (select_button, FALSE); +} + +static void +gdict_sidebar_menu_detach_cb (GtkWidget *widget, + GtkMenu *menu) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (widget); + + sidebar->priv->menu = NULL; +} + +static void +gdict_sidebar_menu_item_activate (GtkWidget *widget, + gpointer user_data) +{ + GdictSidebar *sidebar = GDICT_SIDEBAR (user_data); + GdictSidebarPrivate *priv = sidebar->priv; + GtkWidget *menu_item; + const gchar *id; + SidebarPage *page; + gint current_index; + + menu_item = gtk_menu_get_active (GTK_MENU (priv->menu)); + id = g_object_get_qdata (G_OBJECT (menu_item), sidebar_page_id_quark); + g_assert (id != NULL); + + page = g_hash_table_lookup (priv->pages_by_id, id); + g_assert (page != NULL); + + current_index = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook)); + if (current_index == page->index) + return; + + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), + page->index); + gtk_label_set_text (GTK_LABEL (priv->label), page->name); + + g_signal_emit (sidebar, sidebar_signals[PAGE_CHANGED], 0); +} + +static void +gdict_sidebar_class_init (GdictSidebarClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (gobject_class, sizeof (GdictSidebarPrivate)); + + sidebar_page_id_quark = g_quark_from_static_string ("gdict-sidebar-page-id"); + + gobject_class->finalize = gdict_sidebar_finalize; + gobject_class->dispose = gdict_sidebar_dispose; + + sidebar_signals[PAGE_CHANGED] = + g_signal_new ("page-changed", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictSidebarClass, page_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + sidebar_signals[CLOSED] = + g_signal_new ("closed", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictSidebarClass, closed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +gdict_sidebar_init (GdictSidebar *sidebar) +{ + GdictSidebarPrivate *priv; + GtkWidget *hbox; + GtkWidget *select_hbox; + GtkWidget *select_button; + GtkWidget *close_button; + GtkWidget *arrow; + + sidebar->priv = priv = GDICT_SIDEBAR_GET_PRIVATE (sidebar); + + /* we store all the pages inside the list, but we keep + * a pointer inside the hash table for faster look up + * times; what's inside the table will be destroyed with + * the list, so there's no need to supply the destroy + * functions for keys and values. + */ + priv->pages = NULL; + priv->pages_by_id = g_hash_table_new (g_str_hash, g_str_equal); + + /* top option menu */ + hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (sidebar), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + priv->hbox = hbox; + + select_button = gtk_toggle_button_new (); + gtk_button_set_relief (GTK_BUTTON (select_button), GTK_RELIEF_NONE); + g_signal_connect (select_button, "button-press-event", + G_CALLBACK (gdict_sidebar_select_button_press_cb), + sidebar); + g_signal_connect (select_button, "key-press-event", + G_CALLBACK (gdict_sidebar_select_key_press_cb), + sidebar); + priv->select_button = select_button; + + select_hbox = gtk_hbox_new (FALSE, 0); + + priv->label = gtk_label_new (NULL); + gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (select_hbox), priv->label, FALSE, FALSE, 0); + gtk_widget_show (priv->label); + + arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); + gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0); + gtk_widget_show (arrow); + + gtk_container_add (GTK_CONTAINER (select_button), select_hbox); + gtk_widget_show (select_hbox); + + gtk_box_pack_start (GTK_BOX (hbox), select_button, TRUE, TRUE, 0); + gtk_widget_show (select_button); + + close_button = gtk_button_new (); + gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE); + gtk_button_set_image (GTK_BUTTON (close_button), + gtk_image_new_from_stock (GTK_STOCK_CLOSE, + GTK_ICON_SIZE_SMALL_TOOLBAR)); + g_signal_connect (close_button, "clicked", + G_CALLBACK (gdict_sidebar_close_clicked_cb), + sidebar); + gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0); + gtk_widget_show (close_button); + priv->close_button = close_button; + + sidebar->priv->menu = gtk_menu_new (); + g_signal_connect (sidebar->priv->menu, "deactivate", + G_CALLBACK (gdict_sidebar_menu_deactivate_cb), + sidebar); + gtk_menu_attach_to_widget (GTK_MENU (sidebar->priv->menu), + GTK_WIDGET (sidebar), + gdict_sidebar_menu_detach_cb); + gtk_widget_show (sidebar->priv->menu); + + sidebar->priv->notebook = gtk_notebook_new (); + gtk_notebook_set_show_border (GTK_NOTEBOOK (sidebar->priv->notebook), FALSE); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (sidebar->priv->notebook), FALSE); + gtk_box_pack_start (GTK_BOX (sidebar), sidebar->priv->notebook, TRUE, TRUE, 6); + gtk_widget_show (sidebar->priv->notebook); +} + +/* + * Public API + */ + +GtkWidget * +gdict_sidebar_new (void) +{ + return g_object_new (GDICT_TYPE_SIDEBAR, NULL); +} + +void +gdict_sidebar_add_page (GdictSidebar *sidebar, + const gchar *page_id, + const gchar *page_name, + GtkWidget *page_widget) +{ + GdictSidebarPrivate *priv; + SidebarPage *page; + GtkWidget *menu_item; + + g_return_if_fail (GDICT_IS_SIDEBAR (sidebar)); + g_return_if_fail (page_id != NULL); + g_return_if_fail (page_name != NULL); + g_return_if_fail (GTK_IS_WIDGET (page_widget)); + + priv = sidebar->priv; + + if (g_hash_table_lookup (priv->pages_by_id, page_id)) + { + g_warning ("Attempting to add a page to the sidebar with " + "id `%s', but there already is a page with the " + "same id. Aborting...", + page_id); + return; + } + + /* add the page inside the page list */ + page = sidebar_page_new (page_id, page_name, page_widget); + + priv->pages = g_slist_append (priv->pages, page); + g_hash_table_insert (priv->pages_by_id, page->id, page); + + page->index = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), + page_widget, + NULL); + + /* add the menu item for the page */ + menu_item = gtk_image_menu_item_new_with_label (page_name); + g_object_set_qdata_full (G_OBJECT (menu_item), + sidebar_page_id_quark, + g_strdup (page_id), + (GDestroyNotify) g_free); + g_signal_connect (menu_item, "activate", + G_CALLBACK (gdict_sidebar_menu_item_activate), + sidebar); + gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), menu_item); + gtk_widget_show (menu_item); + page->menu_item = menu_item; + + gtk_menu_shell_select_item (GTK_MENU_SHELL (priv->menu), menu_item); + gtk_label_set_text (GTK_LABEL (priv->label), page_name); + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), page->index); +} + +void +gdict_sidebar_remove_page (GdictSidebar *sidebar, + const gchar *page_id) +{ + GdictSidebarPrivate *priv; + SidebarPage *page; + GList *children, *l; + + g_return_if_fail (GDICT_IS_SIDEBAR (sidebar)); + g_return_if_fail (page_id != NULL); + + priv = sidebar->priv; + + if ((page = g_hash_table_lookup (priv->pages_by_id, page_id)) == NULL) + { + g_warning ("Attempting to remove a page from the sidebar with " + "id `%s', but there is no page with this id. Aborting...", + page_id); + return; + } + + children = gtk_container_get_children (GTK_CONTAINER (priv->menu)); + for (l = children; l != NULL; l = l->next) + { + GtkWidget *menu_item = l->data; + + if (menu_item == page->menu_item) + { + gtk_container_remove (GTK_CONTAINER (priv->menu), menu_item); + break; + } + } + g_list_free (children); + + gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), page->index); + + g_hash_table_remove (priv->pages_by_id, page->id); + priv->pages = g_slist_remove (priv->pages, page); + + sidebar_page_free (page); + + /* select the first page, if present */ + page = priv->pages->data; + if (page) + { + gtk_menu_shell_select_item (GTK_MENU_SHELL (priv->menu), page->menu_item); + gtk_label_set_text (GTK_LABEL (priv->label), page->name); + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), page->index); + } + else + gtk_widget_hide (GTK_WIDGET (sidebar)); +} + +void +gdict_sidebar_view_page (GdictSidebar *sidebar, + const gchar *page_id) +{ + GdictSidebarPrivate *priv; + SidebarPage *page; + + g_return_if_fail (GDICT_IS_SIDEBAR (sidebar)); + g_return_if_fail (page_id != NULL); + + priv = sidebar->priv; + page = g_hash_table_lookup (priv->pages_by_id, page_id); + if (!page) + return; + + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), page->index); + gtk_label_set_text (GTK_LABEL (priv->label), page->name); + gtk_menu_shell_select_item (GTK_MENU_SHELL (priv->menu), page->menu_item); +} + +const gchar * +gdict_sidebar_current_page (GdictSidebar *sidebar) +{ + GdictSidebarPrivate *priv; + gint index; + SidebarPage *page; + + g_return_val_if_fail (GDICT_IS_SIDEBAR (sidebar), NULL); + + priv = sidebar->priv; + + index = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook)); + page = g_slist_nth_data (priv->pages, index); + g_assert (page != NULL); + + return page->id; +} + +gchar ** +gdict_sidebar_list_pages (GdictSidebar *sidebar, + gsize *length) +{ + GdictSidebarPrivate *priv; + gchar **retval; + gint i; + GSList *l; + + g_return_val_if_fail (GDICT_IS_SIDEBAR (sidebar), NULL); + + priv = sidebar->priv; + + retval = g_new (gchar*, g_slist_length (priv->pages) + 1); + for (l = priv->pages, i = 0; l; l = l->next, i++) + retval[i++] = g_strdup (l->data); + + retval[i] = NULL; + + if (length) + *length = i; + + return retval; +} diff --git a/mate-dictionary/src/gdict-sidebar.h b/mate-dictionary/src/gdict-sidebar.h new file mode 100644 index 00000000..82fa5c4c --- /dev/null +++ b/mate-dictionary/src/gdict-sidebar.h @@ -0,0 +1,75 @@ +/* gdict-sidebar.h - sidebar widget + * + * Copyright (C) 2006 Emmanuele Bassi <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * + * Based on the equivalent widget from Evince + * by Jonathan Blandford, + * Copyright (C) 2004 Red Hat, Inc. + */ + +#ifndef __GDICT_SIDEBAR_H__ +#define __GDICT_SIDEBAR_H__ + +#include <gtk/gtk.h> + +#define GDICT_TYPE_SIDEBAR (gdict_sidebar_get_type ()) +#define GDICT_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SIDEBAR, GdictSidebar)) +#define GDICT_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SIDEBAR)) +#define GDICT_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_SIDEBAR, GdictSidebarClass)) +#define GDICT_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDICT_TYPE_SIDEBAR)) +#define GDICT_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_SIDEBAR, GdictSidebarClass)) + +typedef struct _GdictSidebar GdictSidebar; +typedef struct _GdictSidebarPrivate GdictSidebarPrivate; +typedef struct _GdictSidebarClass GdictSidebarClass; + +struct _GdictSidebar +{ + GtkVBox parent_instance; + + GdictSidebarPrivate *priv; +}; + +struct _GdictSidebarClass +{ + GtkVBoxClass parent_class; + + void (*page_changed) (GdictSidebar *sidebar); + void (*closed) (GdictSidebar *sidebar); + + void (*_gdict_padding_1) (void); + void (*_gdict_padding_2) (void); + void (*_gdict_padding_3) (void); + void (*_gdict_padding_4) (void); +}; + +GType gdict_sidebar_get_type (void) G_GNUC_CONST; + +GtkWidget * gdict_sidebar_new (void); +void gdict_sidebar_add_page (GdictSidebar *sidebar, + const gchar *page_id, + const gchar *page_name, + GtkWidget *page_widget); +void gdict_sidebar_remove_page (GdictSidebar *sidebar, + const gchar *page_id); +void gdict_sidebar_view_page (GdictSidebar *sidebar, + const gchar *page_id); +const gchar *gdict_sidebar_current_page (GdictSidebar *sidebar); +gchar ** gdict_sidebar_list_pages (GdictSidebar *sidebar, + gsize *length) G_GNUC_MALLOC; + +#endif /* __GDICT_SIDEBAR_H__ */ diff --git a/mate-dictionary/src/gdict-source-dialog.c b/mate-dictionary/src/gdict-source-dialog.c new file mode 100644 index 00000000..2a3014ab --- /dev/null +++ b/mate-dictionary/src/gdict-source-dialog.c @@ -0,0 +1,759 @@ +/* gdict-source-dialog.c - source dialog + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <sys/types.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <glib/gi18n.h> +#include <mateconf/mateconf-client.h> + +#include "gdict-source-dialog.h" +#include "gdict-common.h" + +#define GDICT_SOURCE_UI PKGDATADIR "/mate-dictionary-source.ui" + +/********************* + * GdictSourceDialog * + *********************/ + +struct _GdictSourceDialog +{ + GtkDialog parent_instance; + + GtkBuilder *builder; + + MateConfClient *mateconf_client; + guint notify_id; + + GdictSourceLoader *loader; + GdictSource *source; + gchar *source_name; + GdictContext *context; + + GdictSourceDialogAction action; + + GdictSourceTransport transport; + + GtkWidget *add_button; + GtkWidget *close_button; + GtkWidget *cancel_button; + GtkWidget *help_button; + + GtkWidget *db_chooser; + GtkWidget *strat_chooser; + + GtkWidget *transport_combo; +}; + +struct _GdictSourceDialogClass +{ + GtkDialogClass parent_class; +}; + +enum +{ + PROP_0, + + PROP_SOURCE_LOADER, + PROP_SOURCE_NAME, + PROP_ACTION +}; + +G_DEFINE_TYPE (GdictSourceDialog, gdict_source_dialog, GTK_TYPE_DIALOG); + +static void +set_source_loader (GdictSourceDialog *dialog, + GdictSourceLoader *loader) +{ + if (dialog->loader) + g_object_unref (dialog->loader); + + dialog->loader = g_object_ref (loader); +} + +static void +transport_combo_changed_cb (GtkWidget *widget, + gpointer user_data) +{ + GdictSourceDialog *dialog = GDICT_SOURCE_DIALOG (user_data); + gint transport; + + transport = gtk_combo_box_get_active (GTK_COMBO_BOX (widget)); + if (transport == dialog->transport) + return; + + if (transport == GDICT_SOURCE_TRANSPORT_DICTD) + { + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_label"))); + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_entry"))); + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_label"))); + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_entry"))); + + if (dialog->action == GDICT_SOURCE_DIALOG_CREATE) + { + gtk_widget_set_sensitive (dialog->add_button, TRUE); + + dialog->transport = GDICT_SOURCE_TRANSPORT_DICTD; + } + } + else + { + gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_label"))); + gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_entry"))); + gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_label"))); + gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_entry"))); + + if (dialog->action == GDICT_SOURCE_DIALOG_CREATE) + { + gtk_widget_set_sensitive (dialog->add_button, FALSE); + + dialog->transport = GDICT_SOURCE_TRANSPORT_INVALID; + } + } +} + +static gchar * +get_text_from_entry (GdictSourceDialog *dialog, + const gchar *entry_name) +{ + GtkWidget *entry; + gchar *retval; + + entry = GTK_WIDGET (gtk_builder_get_object (dialog->builder, entry_name)); + if (!entry) + return NULL; + + retval = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1); + + return retval; +} + +static void +set_text_to_entry (GdictSourceDialog *dialog, + const gchar *entry_name, + const gchar *text) +{ + GtkWidget *entry; + + entry = GTK_WIDGET (gtk_builder_get_object (dialog->builder, entry_name)); + if (!entry) + return; + + gtk_entry_set_text (GTK_ENTRY (entry), text); +} + +static void +set_transport_settings (GdictSourceDialog *dialog) +{ + switch (dialog->transport) + { + case GDICT_SOURCE_TRANSPORT_DICTD: + { + GdictClientContext *context; + const gchar *hostname; + gchar *port_str; + guint port; + + context = GDICT_CLIENT_CONTEXT (dialog->context); + hostname = gdict_client_context_get_hostname (context); + port = gdict_client_context_get_port (context); + port_str = g_strdup_printf ("%d", port); + + set_text_to_entry (dialog, "hostname_entry", hostname); + set_text_to_entry (dialog, "port_entry", port_str); + + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_label"))); + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_entry"))); + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_label"))); + gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_entry"))); + + g_free (port_str); + } + break; + case GDICT_SOURCE_TRANSPORT_INVALID: + default: + break; + } +} + +static void +update_dialog_ui (GdictSourceDialog *dialog) +{ + GdictSource *source; + + /* TODO - add code to update the contents of the dialog depending + * on the action; if we are in _CREATE, no action is needed + */ + switch (dialog->action) + { + case GDICT_SOURCE_DIALOG_VIEW: + case GDICT_SOURCE_DIALOG_EDIT: + if (!dialog->source_name) + { + g_warning ("Attempting to retrieve source, but no " + "source name has been defined. Aborting..."); + return; + } + + source = gdict_source_loader_get_source (dialog->loader, + dialog->source_name); + if (!source) + { + g_warning ("Attempting to retrieve source, but no " + "source named `%s' was found. Aborting...", + dialog->source_name); + return; + } + + g_object_ref (source); + + dialog->source = source; + set_text_to_entry (dialog, "description_entry", + gdict_source_get_description (source)); + + dialog->transport = gdict_source_get_transport (source); + gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->transport_combo), + (gint) dialog->transport); + + /* set the context for the database and strategy choosers */ + dialog->context = gdict_source_get_context (source); + if (!dialog->context) + { + g_warning ("Attempting to retrieve the context, but " + "none was found for source `%s'.", + dialog->source_name); + return; + } + + set_transport_settings (dialog); + + gdict_database_chooser_set_context (GDICT_DATABASE_CHOOSER (dialog->db_chooser), + dialog->context); + gdict_database_chooser_refresh (GDICT_DATABASE_CHOOSER (dialog->db_chooser)); + gdict_strategy_chooser_set_context (GDICT_STRATEGY_CHOOSER (dialog->strat_chooser), + dialog->context); + gdict_strategy_chooser_refresh (GDICT_STRATEGY_CHOOSER (dialog->strat_chooser)); + break; + case GDICT_SOURCE_DIALOG_CREATE: + /* DICTD transport is default */ + gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->transport_combo), 0); + g_signal_emit_by_name (dialog->transport_combo, "changed"); + break; + default: + g_assert_not_reached (); + break; + } +} + +static void +build_new_source (GdictSourceDialog *dialog) +{ + GdictSource *source; + gchar *name, *text; + GdictSourceTransport transport; + gchar *host, *port; + gchar *data; + gsize length; + GError *error; + gchar *filename; + GdictDatabaseChooser *db_chooser; + GdictStrategyChooser *strat_chooser; + + source = gdict_source_new (); + + /* use the timestamp and the pid to get a unique name */ + name = g_strdup_printf ("source-%lu-%u", + (gulong) time (NULL), + (guint) getpid ()); + gdict_source_set_name (source, name); + g_free (name); + + text = get_text_from_entry (dialog, "description_entry"); + gdict_source_set_description (source, text); + g_free (text); + + db_chooser = GDICT_DATABASE_CHOOSER (dialog->db_chooser); + text = gdict_database_chooser_get_current_database (db_chooser); + gdict_source_set_database (source, text); + g_free (text); + + strat_chooser = GDICT_STRATEGY_CHOOSER (dialog->strat_chooser); + text = gdict_strategy_chooser_get_current_strategy (strat_chooser); + gdict_source_set_strategy (source, text); + g_free (text); + + /* get the selected transport id */ + transport = dialog->transport; + switch (transport) + { + case GDICT_SOURCE_TRANSPORT_DICTD: + host = get_text_from_entry (dialog, "hostname_entry"); + port = get_text_from_entry (dialog, "port_entry"); + + gdict_source_set_transport (source, GDICT_SOURCE_TRANSPORT_DICTD, + "hostname", host, + "port", atoi (port), + NULL); + + g_free (host); + g_free (port); + break; + case GDICT_SOURCE_TRANSPORT_INVALID: + default: + g_warning ("Invalid transport"); + return; + } + + error = NULL; + data = gdict_source_to_data (source, &length, &error); + if (error) + { + gdict_show_gerror_dialog (GTK_WINDOW (dialog), + _("Unable to create a source file"), + error); + + g_object_unref (source); + return; + } + + name = g_strdup_printf ("%s.desktop", gdict_source_get_name (source)); + filename = g_build_filename (g_get_home_dir (), + ".mate2", + "mate-dictionary", + name, + NULL); + g_free (name); + + g_file_set_contents (filename, data, length, &error); + if (error) + gdict_show_gerror_dialog (GTK_WINDOW (dialog), + _("Unable to save source file"), + error); + + g_free (filename); + g_free (data); + g_object_unref (source); +} + +static void +save_source (GdictSourceDialog *dialog) +{ + GdictSource *source; + GdictDatabaseChooser *db_chooser; + GdictStrategyChooser *strat_chooser; + gchar *name, *text; + GdictSourceTransport transport; + gchar *host, *port; + gchar *data; + gsize length; + GError *error; + gchar *filename; + + source = gdict_source_loader_get_source (dialog->loader, + dialog->source_name); + if (!source) + { + g_warning ("Attempting to save source `%s', but no " + "source for that name was found.", + dialog->source_name); + + return; + } + + text = get_text_from_entry (dialog, "description_entry"); + gdict_source_set_description (source, text); + g_free (text); + + db_chooser = GDICT_DATABASE_CHOOSER (dialog->db_chooser); + text = gdict_database_chooser_get_current_database (db_chooser); + gdict_source_set_database (source, text); + g_free (text); + + strat_chooser = GDICT_STRATEGY_CHOOSER (dialog->strat_chooser); + text = gdict_strategy_chooser_get_current_strategy (strat_chooser); + gdict_source_set_strategy (source, text); + g_free (text); + + + /* get the selected transport id */ + transport = dialog->transport; + switch (transport) + { + case GDICT_SOURCE_TRANSPORT_DICTD: + host = get_text_from_entry (dialog, "hostname_entry"); + port = get_text_from_entry (dialog, "port_entry"); + + gdict_source_set_transport (source, GDICT_SOURCE_TRANSPORT_DICTD, + "hostname", host, + "port", atoi (port), + NULL); + + g_free (host); + g_free (port); + break; + case GDICT_SOURCE_TRANSPORT_INVALID: + default: + g_warning ("Invalid transport"); + return; + } + + error = NULL; + data = gdict_source_to_data (source, &length, &error); + if (error) + { + gdict_show_gerror_dialog (GTK_WINDOW (dialog), + _("Unable to create a source file"), + error); + + g_object_unref (source); + return; + } + + name = g_strdup_printf ("%s.desktop", gdict_source_get_name (source)); + filename = g_build_filename (g_get_home_dir (), + ".mate2", + "mate-dictionary", + name, + NULL); + g_free (name); + + g_file_set_contents (filename, data, length, &error); + if (error) + gdict_show_gerror_dialog (GTK_WINDOW (dialog), + _("Unable to save source file"), + error); + + g_free (filename); + g_free (data); + g_object_unref (source); +} + +static void +gdict_source_dialog_response_cb (GtkDialog *dialog, + gint response_id, + gpointer user_data) +{ + GError *err = NULL; + + switch (response_id) + { + case GTK_RESPONSE_ACCEPT: + build_new_source (GDICT_SOURCE_DIALOG (dialog)); + break; + case GTK_RESPONSE_HELP: + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)), + "ghelp:mate-dictionary#mate-dictionary-add-source", + gtk_get_current_event_time (), &err); + if (err) + { + gdict_show_gerror_dialog (GTK_WINDOW (dialog), + _("There was an error while displaying help"), + err); + g_error_free (err); + } + + /* we don't want the dialog to close itself */ + g_signal_stop_emission_by_name (dialog, "response"); + break; + case GTK_RESPONSE_CLOSE: + save_source (GDICT_SOURCE_DIALOG (dialog)); + break; + case GTK_RESPONSE_CANCEL: + break; + default: + break; + } +} + +static void +gdict_source_dialog_finalize (GObject *object) +{ + GdictSourceDialog *dialog = GDICT_SOURCE_DIALOG (object); + + if (dialog->mateconf_client) + g_object_unref (dialog->mateconf_client); + + if (dialog->builder) + g_object_unref (dialog->builder); + + if (dialog->source_name) + g_free (dialog->source_name); + + if (dialog->source) + g_object_unref (dialog->source); + + if (dialog->loader) + g_object_unref (dialog->loader); + + G_OBJECT_CLASS (gdict_source_dialog_parent_class)->finalize (object); +} + +static void +gdict_source_dialog_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictSourceDialog *dialog = GDICT_SOURCE_DIALOG (object); + + switch (prop_id) + { + case PROP_SOURCE_LOADER: + set_source_loader (dialog, g_value_get_object (value)); + break; + case PROP_SOURCE_NAME: + g_free (dialog->source_name); + dialog->source_name = g_strdup (g_value_get_string (value)); + break; + case PROP_ACTION: + dialog->action = (GdictSourceDialogAction) g_value_get_int (value); + break; + default: + break; + } +} + +static void +gdict_source_dialog_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictSourceDialog *dialog = GDICT_SOURCE_DIALOG (object); + + switch (prop_id) + { + case PROP_SOURCE_LOADER: + g_value_set_object (value, dialog->loader); + break; + case PROP_SOURCE_NAME: + g_value_set_string (value, dialog->source_name); + break; + case PROP_ACTION: + g_value_set_int (value, dialog->action); + break; + default: + break; + } +} + +static GObject * +gdict_source_dialog_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_params) +{ + GObject *object; + GdictSourceDialog *dialog; + GtkWidget *vbox; + GError *error = NULL; + + object = G_OBJECT_CLASS (gdict_source_dialog_parent_class)->constructor (type, + n_construct_properties, + construct_params); + dialog = GDICT_SOURCE_DIALOG (object); + + gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2); + + gtk_widget_push_composite_child (); + + /* get the UI from the GtkBuilder file */ + dialog->builder = gtk_builder_new (); + gtk_builder_add_from_file (dialog->builder, GDICT_SOURCE_UI, &error); + + if (error) { + g_critical ("Unable to load the user interface definition file: %s", + error->message); + g_error_free (error); + g_assert_not_reached (); + } + + /* the main widget */ + gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), + GTK_WIDGET (gtk_builder_get_object (dialog->builder, "source_root"))); + + /* the transport combo changes the UI by changing the visible widgets + * bound to the transport's own options. + */ + dialog->transport_combo = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "transport_combo")); + g_signal_connect (dialog->transport_combo, "changed", + G_CALLBACK (transport_combo_changed_cb), + dialog); + + /* the help button is always visible */ + dialog->help_button = gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_HELP, + GTK_RESPONSE_HELP); + + vbox = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "db-vbox")); + dialog->db_chooser = gdict_database_chooser_new (); + gtk_box_pack_start (GTK_BOX (vbox), dialog->db_chooser, TRUE, TRUE, 0); + gtk_widget_show (dialog->db_chooser); + + vbox = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "strat-vbox")); + dialog->strat_chooser = gdict_strategy_chooser_new (); + gtk_box_pack_start (GTK_BOX (vbox), dialog->strat_chooser, TRUE, TRUE, 0); + gtk_widget_show (dialog->strat_chooser); + + /* the UI changes depending on the action that the source dialog + * should perform + */ + switch (dialog->action) + { + case GDICT_SOURCE_DIALOG_VIEW: + /* disable every editable widget */ + gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "name_entry")), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "description_entry")), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "hostname_entry")), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "port_entry")), FALSE); + + gtk_widget_set_sensitive (dialog->transport_combo, FALSE); + + /* we just allow closing the dialog */ + dialog->close_button = gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CLOSE, + GTK_RESPONSE_CLOSE); + break; + case GDICT_SOURCE_DIALOG_CREATE: + dialog->cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + dialog->add_button = gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_ADD, + GTK_RESPONSE_ACCEPT); + /* the "add" button sensitivity is controlled by the transport_combo + * since it's the only setting that makes a source usable. + */ + gtk_widget_set_sensitive (dialog->add_button, FALSE); + break; + case GDICT_SOURCE_DIALOG_EDIT: + dialog->cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + dialog->close_button = gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CLOSE, + GTK_RESPONSE_CLOSE); + break; + default: + g_assert_not_reached (); + break; + } + + /* this will take care of updating the contents of the dialog + * based on the action + */ + update_dialog_ui (dialog); + + gtk_widget_pop_composite_child (); + + return object; +} + +static void +gdict_source_dialog_class_init (GdictSourceDialogClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->constructor = gdict_source_dialog_constructor; + gobject_class->set_property = gdict_source_dialog_set_property; + gobject_class->get_property = gdict_source_dialog_get_property; + gobject_class->finalize = gdict_source_dialog_finalize; + + g_object_class_install_property (gobject_class, + PROP_SOURCE_LOADER, + g_param_spec_object ("source-loader", + "Source Loader", + "The GdictSourceLoader used by the application", + GDICT_TYPE_SOURCE_LOADER, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY))); + g_object_class_install_property (gobject_class, + PROP_SOURCE_NAME, + g_param_spec_string ("source-name", + "Source Name", + "The source name", + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT))); + g_object_class_install_property (gobject_class, + PROP_ACTION, + g_param_spec_int ("action", + "Action", + "The action the source dialog should perform", + -1, + GDICT_SOURCE_DIALOG_EDIT, + GDICT_SOURCE_DIALOG_VIEW, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY))); +} + +static void +gdict_source_dialog_init (GdictSourceDialog *dialog) +{ + gtk_widget_set_size_request (GTK_WIDGET (dialog), 400, 300); + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); + + dialog->transport = GDICT_SOURCE_TRANSPORT_INVALID; + + g_signal_connect (dialog, "response", + G_CALLBACK (gdict_source_dialog_response_cb), + NULL); +} + +GtkWidget * +gdict_source_dialog_new (GtkWindow *parent, + const gchar *title, + GdictSourceDialogAction action, + GdictSourceLoader *loader, + const gchar *source_name) +{ + GtkWidget *retval; + + g_return_val_if_fail ((parent == NULL || GTK_IS_WINDOW (parent)), NULL); + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), NULL); + + retval = g_object_new (GDICT_TYPE_SOURCE_DIALOG, + "source-loader", loader, + "source-name", source_name, + "action", action, + "title", title, + NULL); + + if (parent) + { + gtk_window_set_transient_for (GTK_WINDOW (retval), parent); + gtk_window_set_destroy_with_parent (GTK_WINDOW (retval), TRUE); + gtk_window_set_screen (GTK_WINDOW (retval), + gtk_widget_get_screen (GTK_WIDGET (parent))); + } + + return retval; +} diff --git a/mate-dictionary/src/gdict-source-dialog.h b/mate-dictionary/src/gdict-source-dialog.h new file mode 100644 index 00000000..ecddd8ff --- /dev/null +++ b/mate-dictionary/src/gdict-source-dialog.h @@ -0,0 +1,54 @@ +/* gdict-source-dialog.h - source dialog + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __GDICT_SOURCE_DIALOG_H__ +#define __GDICT_SOURCE_DIALOG_H__ + +#include <gtk/gtk.h> +#include <libgdict/gdict.h> + +G_BEGIN_DECLS + +#define GDICT_TYPE_SOURCE_DIALOG (gdict_source_dialog_get_type ()) +#define GDICT_SOURCE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_SOURCE_DIALOG, GdictSourceDialog)) +#define GDICT_IS_SOURCE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_SOURCE_DIALOG)) + +typedef enum +{ + GDICT_SOURCE_DIALOG_VIEW, + GDICT_SOURCE_DIALOG_CREATE, + GDICT_SOURCE_DIALOG_EDIT +} GdictSourceDialogAction; + +typedef struct _GdictSourceDialog GdictSourceDialog; +typedef struct _GdictSourceDialogClass GdictSourceDialogClass; + +GType gdict_source_dialog_get_type (void) G_GNUC_CONST; +GtkWidget *gdict_source_dialog_new (GtkWindow *parent, + const gchar *title, + GdictSourceDialogAction action, + GdictSourceLoader *loader, + const gchar *source_name); + +G_END_DECLS + +#endif /* __GDICT_SOURCE_DIALOG_H__ */ diff --git a/mate-dictionary/src/gdict-window.c b/mate-dictionary/src/gdict-window.c new file mode 100644 index 00000000..1be0256c --- /dev/null +++ b/mate-dictionary/src/gdict-window.c @@ -0,0 +1,2214 @@ +/* gdict-window.c - main application window + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +#include <gtk/gtk.h> +#include <glib.h> +#include <glib/gi18n.h> + +#include <libgdict/gdict.h> + +#include "gdict-sidebar.h" +#include "gdict-print.h" +#include "gdict-pref-dialog.h" +#include "gdict-about.h" +#include "gdict-window.h" +#include "gdict-common.h" + +#define GDICT_WINDOW_COLUMNS 56 +#define GDICT_WINDOW_ROWS 33 + +#define GDICT_WINDOW_MIN_WIDTH 400 +#define GDICT_WINDOW_MIN_HEIGHT 330 + +/* sidebar pages logical ids */ +#define GDICT_SIDEBAR_SPELLER_PAGE "speller" +#define GDICT_SIDEBAR_DATABASES_PAGE "db-chooser" +#define GDICT_SIDEBAR_STRATEGIES_PAGE "strat-chooser" +#define GDICT_SIDEBAR_SOURCES_PAGE "source-chooser" + +enum +{ + COMPLETION_TEXT_COLUMN, + + COMPLETION_N_COLUMNS +}; + +enum +{ + PROP_0, + + PROP_ACTION, + PROP_SOURCE_LOADER, + PROP_SOURCE_NAME, + PROP_PRINT_FONT, + PROP_DEFBOX_FONT, + PROP_WORD, + PROP_WINDOW_ID +}; + +enum +{ + CREATED, + + LAST_SIGNAL +}; + +static guint gdict_window_signals[LAST_SIGNAL] = { 0 }; + +static const GtkTargetEntry drop_types[] = +{ + { "text/plain", 0, 0 }, + { "TEXT", 0, 0 }, + { "STRING", 0, 0 }, + { "UTF8_STRING", 0, 0 }, +}; +static const guint n_drop_types = G_N_ELEMENTS (drop_types); + + + +G_DEFINE_TYPE (GdictWindow, gdict_window, GTK_TYPE_WINDOW); + + +static void +gdict_window_finalize (GObject *gobject) +{ + GdictWindow *window = GDICT_WINDOW (gobject); + + g_free (window->source_name); + g_free (window->print_font); + g_free (window->defbox_font); + g_free (window->word); + g_free (window->database); + g_free (window->strategy); + + G_OBJECT_CLASS (gdict_window_parent_class)->finalize (gobject); +} + +static void +gdict_window_dispose (GObject *gobject) +{ + GdictWindow *window = GDICT_WINDOW (gobject); + + if (window->notify_id) + { + mateconf_client_notify_remove (window->mateconf_client, window->notify_id); + window->notify_id = 0; + } + + if (window->font_notify_id) + { + mateconf_client_notify_remove (window->mateconf_client, + window->font_notify_id); + window->font_notify_id = 0; + } + + if (window->mateconf_client) + { + g_object_unref (window->mateconf_client); + window->mateconf_client = NULL; + } + + if (window->context) + { + if (window->lookup_start_id) + { + g_signal_handler_disconnect (window->context, + window->lookup_start_id); + g_signal_handler_disconnect (window->context, + window->definition_id); + g_signal_handler_disconnect (window->context, + window->lookup_end_id); + g_signal_handler_disconnect (window->context, + window->error_id); + + window->lookup_start_id = 0; + window->definition_id = 0; + window->lookup_end_id = 0; + window->error_id = 0; + } + + g_object_unref (window->context); + window->context = NULL; + } + + if (window->loader) + { + g_object_unref (window->loader); + window->loader = NULL; + } + + if (window->ui_manager) + { + g_object_unref (window->ui_manager); + window->ui_manager = NULL; + } + + if (window->action_group) + { + g_object_unref (window->action_group); + window->action_group = NULL; + } + + if (window->completion) + { + g_object_unref (window->completion); + window->completion = NULL; + } + + if (window->completion_model) + { + g_object_unref (window->completion_model); + window->completion_model = NULL; + } + + if (window->busy_cursor) + { + gdk_cursor_unref (window->busy_cursor); + window->busy_cursor = NULL; + } + + G_OBJECT_CLASS (gdict_window_parent_class)->dispose (gobject); +} + +static const gchar *toggle_state[] = { + "/MainMenu/FileMenu/SaveAsMenu", + "/MainMenu/FileMenu/FilePreviewMenu", + "/MainMenu/FileMenu/FilePrintMenu", + "/MainMenu/GoMenu", +}; + +static gint n_toggle_state = G_N_ELEMENTS (toggle_state); + +static void +gdict_window_ensure_menu_state (GdictWindow *window) +{ + gint i; + gboolean is_sensitive; + + g_assert (GDICT_IS_WINDOW (window)); + + if (!window->ui_manager) + return; + + is_sensitive = !!(window->word != NULL); + for (i = 0; i < n_toggle_state; i++) + { + GtkWidget *item; + + item = gtk_ui_manager_get_widget (window->ui_manager, toggle_state[i]); + if (!item) + continue; + + gtk_widget_set_sensitive (item, is_sensitive); + } +} + +static void +gdict_window_set_sidebar_visible (GdictWindow *window, + gboolean is_visible) +{ + g_assert (GDICT_IS_WINDOW (window)); + + if (is_visible != window->sidebar_visible) + { + GtkAction *action; + + if (is_visible) + gtk_widget_show (window->sidebar_frame); + else + gtk_widget_hide (window->sidebar_frame); + + action = gtk_action_group_get_action (window->action_group, + "ViewSidebar"); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), is_visible); + + window->sidebar_visible = is_visible; + } +} + +static void +gdict_window_set_statusbar_visible (GdictWindow *window, + gboolean is_visible) +{ + g_assert (GDICT_IS_WINDOW (window)); + + if (is_visible != window->statusbar_visible) + { + GtkAction *action; + + if (is_visible) + gtk_widget_show (window->status); + else + gtk_widget_hide (window->status); + + action = gtk_action_group_get_action (window->action_group, + "ViewStatusbar"); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), is_visible); + + window->statusbar_visible = is_visible; + } +} + +static void +gdict_window_definition_cb (GdictContext *context, + GdictDefinition *definition, + GdictWindow *window) +{ + gint total, n; + gdouble fraction; + + g_assert (GDICT_IS_WINDOW (window)); + + total = gdict_definition_get_total (definition); + n = window->current_definition + 1; + + fraction = CLAMP (((gdouble) n / (gdouble) total), 0.0, 1.0); + + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (window->progress), + fraction); + while (gtk_events_pending ()) + gtk_main_iteration (); + + window->current_definition = n; +} + +static void +gdict_window_lookup_start_cb (GdictContext *context, + GdictWindow *window) +{ + gchar *message; + + if (!window->word) + return; + + if (!window->busy_cursor) + window->busy_cursor = gdk_cursor_new (GDK_WATCH); + + message = g_strdup_printf (_("Searching for '%s'..."), window->word); + + if (window->status && window->statusbar_visible) + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, message); + + if (window->progress) + gtk_widget_show (window->progress); + + window->max_definition = -1; + window->last_definition = 0; + window->current_definition = 0; + + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), window->busy_cursor); + + g_free (message); +} + +static void +gdict_window_lookup_end_cb (GdictContext *context, + GdictWindow *window) +{ + gchar *message; + gint count; + GtkTreeIter iter; + GdictSource *source; + GdictContext *speller_context; + + count = window->current_definition; + + window->max_definition = count - 1; + + if (count == 0) + message = g_strdup (_("No definitions found")); + else + message = g_strdup_printf (ngettext("A definition found", + "%d definitions found", + count), + count); + + if (window->status && window->statusbar_visible) + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, message); + + if (window->progress) + gtk_widget_hide (window->progress); + + /* we clone the context, so that the signals that it + * fires do not get caught by the signal handlers we + * use for getting the definitions. + */ + source = gdict_source_loader_get_source (window->loader, window->source_name); + speller_context = gdict_source_get_context (source); + gdict_speller_set_context (GDICT_SPELLER (window->speller), speller_context); + g_object_unref (speller_context); + g_object_unref (source); + + /* search for similar words; if we have a no-match we already started + * looking in the error signal handler + */ + if (count != 0 && window->word) + { + gdict_speller_set_strategy (GDICT_SPELLER (window->speller), window->strategy); + gdict_speller_match (GDICT_SPELLER (window->speller), window->word); + gtk_list_store_append (window->completion_model, &iter); + gtk_list_store_set (window->completion_model, &iter, + COMPLETION_TEXT_COLUMN, window->word, + -1); + } + + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), NULL); + g_free (message); + + if (count == 0) + { + g_free (window->word); + window->word = NULL; + } + + gdict_window_ensure_menu_state (window); +} + +static void +gdict_window_error_cb (GdictContext *context, + const GError *error, + GdictWindow *window) +{ + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), NULL); + + if (window->status && window->statusbar_visible) + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, + _("No definitions found")); + + gtk_widget_hide (window->progress); + + /* launch the speller only on NO_MATCH */ + if (error->code == GDICT_CONTEXT_ERROR_NO_MATCH) + { + GdictSource *source; + GdictContext *context; + + gdict_window_set_sidebar_visible (window, TRUE); + gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_SPELLER_PAGE); + + /* we clone the context, so that the signals that it + * fires do not get caught by the signal handlers we + * use for getting the definitions. + */ + source = gdict_source_loader_get_source (window->loader, + window->source_name); + context = gdict_source_get_context (source); + + gdict_speller_set_context (GDICT_SPELLER (window->speller), + context); + g_object_unref (context); + g_object_unref (source); + + gdict_speller_set_strategy (GDICT_SPELLER (window->speller), + window->strategy); + + gdict_speller_match (GDICT_SPELLER (window->speller), + window->word); + } + + /* unset the word and update the UI */ + g_free (window->word); + window->word = NULL; + + gdict_window_ensure_menu_state (window); +} + +static void +gdict_window_set_database (GdictWindow *window, + const gchar *database) +{ + g_free (window->database); + + if (database) + window->database = g_strdup (database); + else + window->database = gdict_mateconf_get_string_with_default (window->mateconf_client, + GDICT_MATECONF_DATABASE_KEY, + GDICT_DEFAULT_DATABASE); + + if (window->defbox) + gdict_defbox_set_database (GDICT_DEFBOX (window->defbox), + window->database); + + if (window->db_chooser) + gdict_database_chooser_set_current_database (GDICT_DATABASE_CHOOSER (window->db_chooser), + window->database); +} + +static void +gdict_window_set_strategy (GdictWindow *window, + const gchar *strategy) +{ + g_free (window->strategy); + + if (strategy && strategy[0] != '\0') + window->strategy = g_strdup (strategy); + else + window->strategy = gdict_mateconf_get_string_with_default (window->mateconf_client, + GDICT_MATECONF_STRATEGY_KEY, + GDICT_DEFAULT_STRATEGY); + + if (window->speller) + gdict_speller_set_strategy (GDICT_SPELLER (window->speller), + window->strategy); + + if (window->strat_chooser) + gdict_strategy_chooser_set_current_strategy (GDICT_STRATEGY_CHOOSER (window->strat_chooser), + window->strategy); +} + +static GdictContext * +get_context_from_loader (GdictWindow *window) +{ + GdictSource *source; + GdictContext *retval; + + if (!window->source_name) + window->source_name = g_strdup (GDICT_DEFAULT_SOURCE_NAME); + + source = gdict_source_loader_get_source (window->loader, + window->source_name); + if (!source && + strcmp (window->source_name, GDICT_DEFAULT_SOURCE_NAME) != 0) + { + g_free (window->source_name); + window->source_name = g_strdup (GDICT_DEFAULT_SOURCE_NAME); + + source = gdict_source_loader_get_source (window->loader, + window->source_name); + } + + if (!source) + { + gchar *detail; + + detail = g_strdup_printf (_("No dictionary source available with name '%s'"), + window->source_name); + + gdict_show_error_dialog (GTK_WINDOW (window), + _("Unable to find dictionary source"), + detail); + + g_free (detail); + + return NULL; + } + + gdict_window_set_database (window, gdict_source_get_database (source)); + gdict_window_set_strategy (window, gdict_source_get_strategy (source)); + + retval = gdict_source_get_context (source); + if (!retval) + { + gchar *detail; + + detail = g_strdup_printf (_("No context available for source '%s'"), + gdict_source_get_description (source)); + + gdict_show_error_dialog (GTK_WINDOW (window), + _("Unable to create a context"), + detail); + + g_free (detail); + g_object_unref (source); + + return NULL; + } + + g_object_unref (source); + + return retval; +} + +static void +gdict_window_set_defbox_font (GdictWindow *window, + const gchar *defbox_font) +{ + g_free (window->defbox_font); + + if (defbox_font) + window->defbox_font = g_strdup (defbox_font); + else + window->defbox_font = gdict_mateconf_get_string_with_default (window->mateconf_client, + DOCUMENT_FONT_KEY, + GDICT_DEFAULT_DEFBOX_FONT); + + if (window->defbox) + gdict_defbox_set_font_name (GDICT_DEFBOX (window->defbox), + window->defbox_font); +} + +static void +gdict_window_set_print_font (GdictWindow *window, + const gchar *print_font) +{ + g_free (window->print_font); + + if (print_font) + window->print_font = g_strdup (print_font); + else + window->print_font = gdict_mateconf_get_string_with_default (window->mateconf_client, + GDICT_MATECONF_PRINT_FONT_KEY, + GDICT_DEFAULT_PRINT_FONT); +} + +static void +gdict_window_set_word (GdictWindow *window, + const gchar *word, + const gchar *database) +{ + gchar *title; + + g_free (window->word); + window->word = NULL; + + if (word && word[0] != '\0') + window->word = g_strdup (word); + else + return; + + if (!database || database[0] == '\0') + database = window->database; + + if (window->word) + title = g_strdup_printf (_("%s - Dictionary"), window->word); + else + title = g_strdup (_("Dictionary")); + + gtk_window_set_title (GTK_WINDOW (window), title); + g_free (title); + + if (window->defbox) + { + gdict_defbox_set_database (GDICT_DEFBOX (window->defbox), database); + gdict_defbox_lookup (GDICT_DEFBOX (window->defbox), word); + } +} + +static void +gdict_window_set_context (GdictWindow *window, + GdictContext *context) +{ + if (window->context) + { + g_signal_handler_disconnect (window->context, window->definition_id); + g_signal_handler_disconnect (window->context, window->lookup_start_id); + g_signal_handler_disconnect (window->context, window->lookup_end_id); + g_signal_handler_disconnect (window->context, window->error_id); + + window->definition_id = 0; + window->lookup_start_id = 0; + window->lookup_end_id = 0; + window->error_id = 0; + + g_object_unref (window->context); + window->context = NULL; + } + + if (window->defbox) + gdict_defbox_set_context (GDICT_DEFBOX (window->defbox), context); + + if (window->db_chooser) + gdict_database_chooser_set_context (GDICT_DATABASE_CHOOSER (window->db_chooser), context); + + if (window->strat_chooser) + gdict_strategy_chooser_set_context (GDICT_STRATEGY_CHOOSER (window->strat_chooser), context); + + if (!context) + return; + + /* attach our callbacks */ + window->definition_id = g_signal_connect (context, "definition-found", + G_CALLBACK (gdict_window_definition_cb), + window); + window->lookup_start_id = g_signal_connect (context, "lookup-start", + G_CALLBACK (gdict_window_lookup_start_cb), + window); + window->lookup_end_id = g_signal_connect (context, "lookup-end", + G_CALLBACK (gdict_window_lookup_end_cb), + window); + window->error_id = g_signal_connect (context, "error", + G_CALLBACK (gdict_window_error_cb), + window); + + window->context = context; +} + +static void +gdict_window_set_source_name (GdictWindow *window, + const gchar *source_name) +{ + GdictContext *context; + + if (window->source_name && source_name && + strcmp (window->source_name, source_name) == 0) + return; + + g_free (window->source_name); + + if (source_name) + window->source_name = g_strdup (source_name); + else + window->source_name = gdict_mateconf_get_string_with_default (window->mateconf_client, + GDICT_MATECONF_SOURCE_KEY, + GDICT_DEFAULT_SOURCE_NAME); + + context = get_context_from_loader (window); + gdict_window_set_context (window, context); + + if (window->source_chooser) + gdict_source_chooser_set_current_source (GDICT_SOURCE_CHOOSER (window->source_chooser), + window->source_name); + + g_object_notify (G_OBJECT (window), "source-name"); +} + +static void +gdict_window_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdictWindow *window = GDICT_WINDOW (object); + + switch (prop_id) + { + case PROP_ACTION: + window->action = g_value_get_enum (value); + break; + case PROP_SOURCE_LOADER: + if (window->loader) + g_object_unref (window->loader); + window->loader = g_value_get_object (value); + g_object_ref (window->loader); + break; + case PROP_SOURCE_NAME: + gdict_window_set_source_name (window, g_value_get_string (value)); + break; + case PROP_WORD: + gdict_window_set_word (window, g_value_get_string (value), NULL); + break; + case PROP_PRINT_FONT: + gdict_window_set_print_font (window, g_value_get_string (value)); + break; + case PROP_DEFBOX_FONT: + gdict_window_set_defbox_font (window, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_window_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdictWindow *window = GDICT_WINDOW (object); + + switch (prop_id) + { + case PROP_ACTION: + g_value_set_enum (value, window->action); + break; + case PROP_SOURCE_LOADER: + g_value_set_object (value, window->loader); + break; + case PROP_SOURCE_NAME: + g_value_set_string (value, window->source_name); + break; + case PROP_WORD: + g_value_set_string (value, window->word); + break; + case PROP_PRINT_FONT: + g_value_set_string (value, window->print_font); + break; + case PROP_DEFBOX_FONT: + g_value_set_string (value, window->defbox_font); + break; + case PROP_WINDOW_ID: + g_value_set_uint (value, window->window_id); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdict_window_cmd_file_new (GtkAction *action, + GdictWindow *window) +{ + GtkWidget *new_window; + gchar *word = NULL; + + /* store the default size of the window and its state, so that + * it's picked up by the newly created window + */ + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_WIDTH_KEY, + window->default_width, + NULL); + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_HEIGHT_KEY, + window->default_height, + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_WINDOW_IS_MAXIMIZED_KEY, + window->is_maximized, + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_VISIBLE_KEY, + window->sidebar_visible, + NULL); + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_WIDTH_KEY, + window->sidebar_width, + NULL); + mateconf_client_set_string (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_PAGE_KEY, + gdict_sidebar_current_page (GDICT_SIDEBAR (window->sidebar)), + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_STATUSBAR_VISIBLE_KEY, + window->statusbar_visible, + NULL); + + word = gdict_defbox_get_selected_word (GDICT_DEFBOX (window->defbox)); + if (word) + { + new_window = gdict_window_new (GDICT_WINDOW_ACTION_LOOKUP, + window->loader, + NULL, word); + g_free (word); + } + else + new_window = gdict_window_new (GDICT_WINDOW_ACTION_CLEAR, + window->loader, + NULL, NULL); + + gtk_widget_show (new_window); + + g_signal_emit (window, gdict_window_signals[CREATED], 0, new_window); +} + +static void +gdict_window_cmd_save_as (GtkAction *action, + GdictWindow *window) +{ + GtkWidget *dialog; + + g_assert (GDICT_IS_WINDOW (window)); + + dialog = gtk_file_chooser_dialog_new (_("Save a Copy"), + GTK_WINDOW (window), + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); + gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); + + /* default to user's home */ + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), g_get_home_dir ()); + gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), _("Untitled document")); + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) + { + gchar *filename; + gchar *text; + gsize len; + GError *write_error = NULL; + + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + + text = gdict_defbox_get_text (GDICT_DEFBOX (window->defbox), &len); + + g_file_set_contents (filename, + text, + len, + &write_error); + if (write_error) + { + gchar *message; + + message = g_strdup_printf (_("Error while writing to '%s'"), filename); + + gdict_show_gerror_dialog (GTK_WINDOW (window), + message, + write_error); + + g_free (message); + } + + g_free (text); + g_free (filename); + } + + gtk_widget_destroy (dialog); +} + +static void +gdict_window_cmd_file_preview (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_show_print_preview (GTK_WINDOW (window), + GDICT_DEFBOX (window->defbox)); +} + +static void +gdict_window_cmd_file_print (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_show_print_dialog (GTK_WINDOW (window), + GDICT_DEFBOX (window->defbox)); +} + +static void +gdict_window_cmd_file_close_window (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + /* store the default size of the window and its state */ + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_WIDTH_KEY, + window->default_width, + NULL); + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_HEIGHT_KEY, + window->default_height, + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_WINDOW_IS_MAXIMIZED_KEY, + window->is_maximized, + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_VISIBLE_KEY, + window->sidebar_visible, + NULL); + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_WIDTH_KEY, + window->sidebar_width, + NULL); + mateconf_client_set_string (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_PAGE_KEY, + gdict_sidebar_current_page (GDICT_SIDEBAR (window->sidebar)), + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_STATUSBAR_VISIBLE_KEY, + window->statusbar_visible, + NULL); + + /* if this was called from the uimanager, destroy the widget; + * otherwise, if it was called from the delete_event, the widget + * will destroy itself. + */ + if (action) + gtk_widget_destroy (GTK_WIDGET (window)); +} + +static void +gdict_window_cmd_edit_copy (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_defbox_copy_to_clipboard (GDICT_DEFBOX (window->defbox), + gtk_clipboard_get (GDK_SELECTION_CLIPBOARD)); +} + +static void +gdict_window_cmd_edit_select_all (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_defbox_select_all (GDICT_DEFBOX (window->defbox)); +} + +static void +gdict_window_cmd_edit_find (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_defbox_set_show_find (GDICT_DEFBOX (window->defbox), TRUE); +} + +static void +gdict_window_cmd_edit_find_next (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_defbox_find_next (GDICT_DEFBOX (window->defbox)); +} + +static void +gdict_window_cmd_edit_find_previous (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_defbox_find_previous (GDICT_DEFBOX (window->defbox)); +} + +static void +gdict_window_cmd_edit_preferences (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_show_pref_dialog (GTK_WIDGET (window), + _("Dictionary Preferences"), + window->loader); +} + +static void +gdict_window_cmd_view_sidebar (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + if (window->sidebar_visible) + gdict_window_set_sidebar_visible (window, FALSE); + else + gdict_window_set_sidebar_visible (window, TRUE); +} + +static void +gdict_window_cmd_view_statusbar (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + if (window->statusbar_visible) + gdict_window_set_statusbar_visible (window, FALSE); + else + gdict_window_set_statusbar_visible (window, TRUE); +} + +static void +gdict_window_cmd_view_speller (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_SPELLER_PAGE); + gdict_window_set_sidebar_visible (window, TRUE); +} + +static void +gdict_window_cmd_view_databases (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_DATABASES_PAGE); + gdict_window_set_sidebar_visible (window, TRUE); +} + +static void +gdict_window_cmd_view_strategies (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_STRATEGIES_PAGE); + gdict_window_set_sidebar_visible (window, TRUE); +} + +static void +gdict_window_cmd_view_sources (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_SOURCES_PAGE); + gdict_window_set_sidebar_visible (window, TRUE); +} + +static void +gdict_window_cmd_go_first_def (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + window->last_definition = 0; + gdict_defbox_jump_to_definition (GDICT_DEFBOX (window->defbox), + window->last_definition); +} + +static void +gdict_window_cmd_go_previous_def (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + if (window->last_definition == 0) + return; + + window->last_definition -= 1; + gdict_defbox_jump_to_definition (GDICT_DEFBOX (window->defbox), + window->last_definition); +} + +static void +gdict_window_cmd_go_next_def (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + if (window->max_definition == -1) + window->max_definition = gdict_defbox_count_definitions (GDICT_DEFBOX (window->defbox)) - 1; + + if (window->last_definition == window->max_definition) + return; + + window->last_definition += 1; + gdict_defbox_jump_to_definition (GDICT_DEFBOX (window->defbox), + window->last_definition); +} + +static void +gdict_window_cmd_go_last_def (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + if (window->max_definition == -1) + window->last_definition = gdict_defbox_count_definitions (GDICT_DEFBOX (window->defbox)) - 1; + + window->last_definition = window->max_definition; + gdict_defbox_jump_to_definition (GDICT_DEFBOX (window->defbox), + window->last_definition); +} + +static void +gdict_window_cmd_help_contents (GtkAction *action, + GdictWindow *window) +{ + GError *err = NULL; + + g_return_if_fail (GDICT_IS_WINDOW (window)); + + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), + "ghelp:mate-dictionary", + gtk_get_current_event_time (), &err); + if (err) + { + gdict_show_gerror_dialog (GTK_WINDOW (window), + _("There was an error while displaying help"), + err); + g_error_free (err); + } +} + +static void +gdict_window_cmd_help_about (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_show_about_dialog (GTK_WIDGET (window)); +} + +static void +gdict_window_cmd_lookup (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gtk_widget_grab_focus (window->entry); +} + +static void +gdict_window_cmd_escape (GtkAction *action, + GdictWindow *window) +{ + g_assert (GDICT_IS_WINDOW (window)); + + gdict_defbox_set_show_find (GDICT_DEFBOX (window->defbox), FALSE); +} + +static const GtkActionEntry entries[] = +{ + { "File", NULL, N_("_File") }, + { "Edit", NULL, N_("_Edit") }, + { "View", NULL, N_("_View") }, + { "Go", NULL, N_("_Go") }, + { "Help", NULL, N_("_Help") }, + + /* File menu */ + { "FileNew", GTK_STOCK_NEW, N_("_New"), "<control>N", + N_("New look up"), G_CALLBACK (gdict_window_cmd_file_new) }, + { "FileSaveAs", GTK_STOCK_SAVE_AS, N_("_Save a Copy..."), NULL, NULL, + G_CALLBACK (gdict_window_cmd_save_as) }, + { "FilePreview", NULL, N_("P_review..."), "<control><shift>P", + N_("Preview this document"), G_CALLBACK (gdict_window_cmd_file_preview) }, + { "FilePrint", GTK_STOCK_PRINT, N_("_Print..."), "<control>P", + N_("Print this document"), G_CALLBACK (gdict_window_cmd_file_print) }, + { "FileCloseWindow", GTK_STOCK_CLOSE, NULL, "<control>W", NULL, + G_CALLBACK (gdict_window_cmd_file_close_window) }, + + /* Edit menu */ + { "EditCopy", GTK_STOCK_COPY, NULL, "<control>C", NULL, + G_CALLBACK (gdict_window_cmd_edit_copy) }, + { "EditSelectAll", NULL, N_("Select _All"), "<control>A", NULL, + G_CALLBACK (gdict_window_cmd_edit_select_all) }, + { "EditFind", GTK_STOCK_FIND, NULL, "<control>F", + N_("Find a word or phrase in the document"), + G_CALLBACK (gdict_window_cmd_edit_find) }, + { "EditFindNext", NULL, N_("Find Ne_xt"), "<control>G", NULL, + G_CALLBACK (gdict_window_cmd_edit_find_next) }, + { "EditFindPrevious", NULL, N_("Find Pre_vious"), "<control><shift>G", NULL, + G_CALLBACK (gdict_window_cmd_edit_find_previous) }, + { "EditPreferences", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL, NULL, + G_CALLBACK (gdict_window_cmd_edit_preferences) }, + + /* Go menu */ + { "GoPreviousDef", GTK_STOCK_GO_BACK, N_("_Previous Definition"), "<control>Page_Up", + N_("Go to the previous definition"), G_CALLBACK (gdict_window_cmd_go_previous_def) }, + { "GoNextDef", GTK_STOCK_GO_FORWARD, N_("_Next Definition"), "<control>Page_Down", + N_("Go to the next definition"), G_CALLBACK (gdict_window_cmd_go_next_def) }, + { "GoFirstDef", GTK_STOCK_GOTO_FIRST, N_("_First Definition"), "<control>Home", + N_("Go to the first definition"), G_CALLBACK (gdict_window_cmd_go_first_def) }, + { "GoLastDef", GTK_STOCK_GOTO_LAST, N_("_Last Definition"), "<control>End", + N_("Go to the last definition"), G_CALLBACK (gdict_window_cmd_go_last_def) }, + + /* View menu */ + { "ViewSpeller", NULL, N_("Similar _Words"), "<control>T", NULL, + G_CALLBACK (gdict_window_cmd_view_speller), }, + { "ViewSource", NULL, N_("Dictionary Sources"), "<control>D", NULL, + G_CALLBACK (gdict_window_cmd_view_sources), }, + { "ViewDB", NULL, N_("Available _Databases"), "<control>B", NULL, + G_CALLBACK (gdict_window_cmd_view_databases), }, + { "ViewStrat", NULL, N_("Available St_rategies"), "<control>R", NULL, + G_CALLBACK (gdict_window_cmd_view_strategies), }, + + /* Help menu */ + { "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", NULL, + G_CALLBACK (gdict_window_cmd_help_contents) }, + { "HelpAbout", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL, + G_CALLBACK (gdict_window_cmd_help_about) }, + + /* Accelerators */ + { "Lookup", NULL, "", "<control>L", NULL, G_CALLBACK (gdict_window_cmd_lookup) }, + { "Escape", NULL, "", "Escape", "", G_CALLBACK (gdict_window_cmd_escape) }, + { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, G_CALLBACK (gdict_window_cmd_edit_find) }, +}; + +static const GtkToggleActionEntry toggle_entries[] = { + /* View menu */ + { "ViewSidebar", NULL, N_("_Sidebar"), "F9", NULL, + G_CALLBACK (gdict_window_cmd_view_sidebar), FALSE }, + { "ViewStatusbar", NULL, N_("S_tatusbar"), NULL, NULL, + G_CALLBACK (gdict_window_cmd_view_statusbar), FALSE }, +}; + +static gboolean +gdict_window_delete_event_cb (GtkWidget *widget, + GdkEvent *event, + gpointer user_data) +{ + gdict_window_cmd_file_close_window (NULL, GDICT_WINDOW (widget)); + + return FALSE; +} + +static gboolean +gdict_window_state_event_cb (GtkWidget *widget, + GdkEventWindowState *event, + gpointer user_data) +{ + GdictWindow *window = GDICT_WINDOW (widget); + + if (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) + window->is_maximized = TRUE; + else + window->is_maximized = FALSE; + + return FALSE; +} + +static void +gdict_window_mateconf_notify_cb (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + GdictWindow *window; + + window = GDICT_WINDOW (user_data); + + if (strcmp (entry->key, GDICT_MATECONF_PRINT_FONT_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_window_set_print_font (window, mateconf_value_get_string (entry->value)); + else + gdict_window_set_print_font (window, GDICT_DEFAULT_PRINT_FONT); + } + else if (strcmp (entry->key, GDICT_MATECONF_SOURCE_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_window_set_source_name (window, mateconf_value_get_string (entry->value)); + else + gdict_window_set_source_name (window, GDICT_DEFAULT_SOURCE_NAME); + } + else if (strcmp (entry->key, GDICT_MATECONF_DATABASE_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_window_set_database (window, mateconf_value_get_string (entry->value)); + else + gdict_window_set_database (window, GDICT_DEFAULT_DATABASE); + } + else if (strcmp (entry->key, DOCUMENT_FONT_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_STRING)) + gdict_window_set_defbox_font (window, mateconf_value_get_string (entry->value)); + else + gdict_window_set_defbox_font (window, GDICT_DEFAULT_DEFBOX_FONT); + } + else if (strcmp (entry->key, GDICT_MATECONF_SIDEBAR_VISIBLE_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_BOOL)) + gdict_window_set_sidebar_visible (window, + mateconf_value_get_bool (entry->value)); + else + gdict_window_set_sidebar_visible (window, FALSE); + } + else if (strcmp (entry->key, GDICT_MATECONF_STATUSBAR_VISIBLE_KEY) == 0) + { + if (entry->value && (entry->value->type == MATECONF_VALUE_BOOL)) + gdict_window_set_statusbar_visible (window, + mateconf_value_get_bool (entry->value)); + else + gdict_window_set_statusbar_visible (window, FALSE); + } +} + +static void +lookup_word (GdictWindow *window, + gpointer dummy) +{ + const gchar *entry_text; + gchar *word; + + g_assert (GDICT_IS_WINDOW (window)); + + if (!window->context) + return; + + entry_text = gtk_entry_get_text (GTK_ENTRY (window->entry)); + if (!entry_text || *entry_text == '\0') + return; + + word = g_strdup (entry_text); + gdict_window_set_word (window, g_strstrip (word), NULL); + + g_free (word); +} + +static void +source_activated_cb (GdictSourceChooser *chooser, + const gchar *source_name, + GdictSource *source, + GdictWindow *window) +{ + g_signal_handlers_block_by_func (chooser, source_activated_cb, window); + gdict_window_set_source_name (window, source_name); + g_signal_handlers_unblock_by_func (chooser, source_activated_cb, window); + + if (window->status && window->statusbar_visible) + { + gchar *message; + + message = g_strdup_printf (_("Dictionary source `%s' selected"), + gdict_source_get_description (source)); + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, message); + g_free (message); + } +} + +static void +strategy_activated_cb (GdictStrategyChooser *chooser, + const gchar *strat_name, + const gchar *strat_desc, + GdictWindow *window) +{ + g_signal_handlers_block_by_func (chooser, strategy_activated_cb, window); + gdict_window_set_strategy (window, strat_name); + g_signal_handlers_unblock_by_func (chooser, strategy_activated_cb, window); + + if (window->status && window->statusbar_visible) + { + gchar *message; + + message = g_strdup_printf (_("Strategy `%s' selected"), strat_desc); + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, message); + g_free (message); + } +} + +static void +database_activated_cb (GdictDatabaseChooser *chooser, + const gchar *db_name, + const gchar *db_desc, + GdictWindow *window) +{ + g_signal_handlers_block_by_func (chooser, database_activated_cb, window); + gdict_window_set_database (window, db_name); + g_signal_handlers_unblock_by_func (chooser, database_activated_cb, window); + + if (window->status && window->statusbar_visible) + { + gchar *message; + + message = g_strdup_printf (_("Database `%s' selected"), db_desc); + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, message); + g_free (message); + } +} + +static void +speller_word_activated_cb (GdictSpeller *speller, + const gchar *word, + const gchar *db_name, + GdictWindow *window) +{ + gtk_entry_set_text (GTK_ENTRY (window->entry), word); + + gdict_window_set_word (window, word, db_name); + + if (window->status && window->statusbar_visible) + { + gchar *message; + + message = g_strdup_printf (_("Word `%s' selected"), word); + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, message); + g_free (message); + } +} + +static void +sidebar_page_changed_cb (GdictSidebar *sidebar, + GdictWindow *window) +{ + const gchar *page_id; + const gchar *message; + + page_id = gdict_sidebar_current_page (sidebar); + + switch (page_id[0]) + { + case 's': + { + switch (page_id[1]) + { + case 'p': /* speller */ + message = _("Double-click on the word to look up"); + if (window->word) + gdict_speller_match (GDICT_SPELLER (window->speller), + window->word); + break; + case 't': /* strat-chooser */ + message = _("Double-click on the matching strategy to use"); + + gdict_strategy_chooser_refresh (GDICT_STRATEGY_CHOOSER (window->strat_chooser)); + break; + case 'o': /* source-chooser */ + message = _("Double-click on the source to use"); + gdict_source_chooser_refresh (GDICT_SOURCE_CHOOSER (window->source_chooser)); + break; + default: + message = NULL; + } + } + break; + case 'd': /* db-chooser */ + message = _("Double-click on the database to use"); + + gdict_database_chooser_refresh (GDICT_DATABASE_CHOOSER (window->db_chooser)); + break; + default: + message = NULL; + break; + } + + if (message && window->status && window->statusbar_visible) + gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, message); +} + +static void +sidebar_closed_cb (GdictSidebar *sidebar, + GdictWindow *window) +{ + gdict_window_set_sidebar_visible (window, FALSE); +} + +static void +gdict_window_link_clicked (GdictDefbox *defbox, + const gchar *link_text, + GdictWindow *window) +{ + GtkWidget *new_window; + + /* store the default size of the window and its state, so that + * it's picked up by the newly created window + */ + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_WIDTH_KEY, + window->default_width, + NULL); + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_HEIGHT_KEY, + window->default_height, + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_WINDOW_IS_MAXIMIZED_KEY, + window->is_maximized, + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_VISIBLE_KEY, + window->sidebar_visible, + NULL); + mateconf_client_set_int (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_WIDTH_KEY, + window->sidebar_width, + NULL); + mateconf_client_set_string (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_PAGE_KEY, + gdict_sidebar_current_page (GDICT_SIDEBAR (window->sidebar)), + NULL); + mateconf_client_set_bool (window->mateconf_client, + GDICT_MATECONF_STATUSBAR_VISIBLE_KEY, + window->statusbar_visible, + NULL); + + new_window = gdict_window_new (GDICT_WINDOW_ACTION_LOOKUP, + window->loader, + NULL, link_text); + gtk_widget_show (new_window); + + g_signal_emit (window, gdict_window_signals[CREATED], 0, new_window); +} + +static void +gdict_window_drag_data_received_cb (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *data, + guint info, + guint time_, + gpointer user_data) +{ + GdictWindow *window = GDICT_WINDOW (user_data); + gchar *text; + + text = (gchar *) gtk_selection_data_get_text (data); + if (text) + { + gtk_entry_set_text (GTK_ENTRY (window->entry), text); + + gdict_window_set_word (window, text, NULL); + g_free (text); + + gtk_drag_finish (context, TRUE, FALSE, time_); + } + else + gtk_drag_finish (context, FALSE, FALSE, time_); +} + +static void +gdict_window_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) +{ + GdictWindow *window = GDICT_WINDOW (widget); + + if (!window->is_maximized) + { + window->default_width = allocation->width; + window->default_height = allocation->height; + } + + if (GTK_WIDGET_CLASS (gdict_window_parent_class)->size_allocate) + GTK_WIDGET_CLASS (gdict_window_parent_class)->size_allocate (widget, + allocation); +} + +static void +set_window_default_size (GdictWindow *window) +{ + GtkWidget *widget; + gboolean is_maximized; + gint width, height; + gint font_size; + GdkScreen *screen; + gint monitor_num; + GtkRequisition req; + GdkRectangle monitor; + + g_assert (GDICT_IS_WINDOW (window)); + + widget = GTK_WIDGET (window); + + /* make sure that the widget is realized */ + gtk_widget_realize (widget); + + /* recover the state from MateConf */ + width = mateconf_client_get_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_WIDTH_KEY, + NULL); + height = mateconf_client_get_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_HEIGHT_KEY, + NULL); + is_maximized = mateconf_client_get_bool (window->mateconf_client, + GDICT_MATECONF_WINDOW_IS_MAXIMIZED_KEY, + NULL); + + /* XXX - the user wants mate-dictionary to resize itself, so + * we compute the minimum safe geometry needed for displaying + * the text returned by a dictionary server, which is based + * on the font size and the ANSI terminal. this is dumb, + * I know, but dictionary servers return pre-formatted text + * and we can't reformat it ourselves. + */ + if (width == -1 || height == -1) + { + /* Size based on the font size */ + GtkWidget *defbox = window->defbox; + + font_size = pango_font_description_get_size (gtk_widget_get_style (defbox)->font_desc); + font_size = PANGO_PIXELS (font_size); + + width = font_size * GDICT_WINDOW_COLUMNS; + height = font_size * GDICT_WINDOW_ROWS; + + /* Use at least the requisition size of the window... */ + gtk_widget_size_request (widget, &req); + width = MAX (width, req.width); + height = MAX (height, req.height); + + /* ... but make it no larger than the monitor */ + screen = gtk_widget_get_screen (widget); + monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget)); + + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + width = MIN (width, monitor.width * 3 / 4); + height = MIN (height, monitor.height * 3 / 4); + } + + /* Set default size */ + gtk_window_set_default_size (GTK_WINDOW (widget), + width, + height); + + if (is_maximized) + gtk_window_maximize (GTK_WINDOW (widget)); +} + +static void +gdict_window_style_set (GtkWidget *widget, + GtkStyle *old_style) +{ + + if (GTK_WIDGET_CLASS (gdict_window_parent_class)->style_set) + GTK_WIDGET_CLASS (gdict_window_parent_class)->style_set (widget, old_style); + + set_window_default_size (GDICT_WINDOW (widget)); +} + +static void +gdict_window_handle_notify_position_cb (GtkWidget *widget, + GParamSpec *pspec, + gpointer user_data) +{ + GdictWindow *window = GDICT_WINDOW (user_data); + gint window_width, pos; + GtkAllocation allocation; + + pos = gtk_paned_get_position (GTK_PANED (widget)); + gtk_widget_get_allocation (GTK_WIDGET (window), &allocation); + window_width = allocation.width; + + window->sidebar_width = window_width - pos; +} + +static GObject * +gdict_window_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_params) +{ + GObject *object; + GdictWindow *window; + gint width, height, sidebar_width; + gboolean is_maximized; + GtkWidget *hbox; + GtkWidget *handle; + GtkWidget *frame1, *frame2; + GtkWidget *vbox; + GtkWidget *button; + GtkActionGroup *action_group; + GtkAccelGroup *accel_group; + PangoFontDescription *font_desc; + gchar *font_name, *sidebar_page; + GError *error; + gboolean sidebar_visible; + gboolean statusbar_visible; + GtkAllocation allocation; + + object = G_OBJECT_CLASS (gdict_window_parent_class)->constructor (type, + n_construct_properties, + construct_params); + window = GDICT_WINDOW (object); + + gtk_widget_push_composite_child (); + + window->main_box = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (window), window->main_box); + gtk_widget_show (window->main_box); + + /* build menus */ + action_group = gtk_action_group_new ("MenuActions"); + window->action_group = action_group; + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, entries, + G_N_ELEMENTS (entries), + window); + gtk_action_group_add_toggle_actions (action_group, toggle_entries, + G_N_ELEMENTS (toggle_entries), + window); + + window->ui_manager = gtk_ui_manager_new (); + gtk_ui_manager_insert_action_group (window->ui_manager, action_group, 0); + + accel_group = gtk_ui_manager_get_accel_group (window->ui_manager); + gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); + + error = NULL; + if (!gtk_ui_manager_add_ui_from_file (window->ui_manager, + PKGDATADIR "/mate-dictionary-ui.xml", + &error)) + { + g_warning ("Building menus failed: %s", error->message); + g_error_free (error); + } + else + { + window->menubar = gtk_ui_manager_get_widget (window->ui_manager, "/MainMenu"); + + gtk_box_pack_start (GTK_BOX (window->main_box), window->menubar, FALSE, FALSE, 0); + gtk_widget_show (window->menubar); + + gdict_window_ensure_menu_state (window); + } + + vbox = gtk_vbox_new (FALSE, 6); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); + gtk_container_add (GTK_CONTAINER (window->main_box), vbox); + gtk_widget_show (vbox); + + hbox = gtk_hbox_new (FALSE, 12); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + button = gtk_button_new_with_mnemonic (_("Look _up:")); + g_signal_connect_swapped (button, "clicked", + G_CALLBACK (lookup_word), + window); + gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + window->completion_model = gtk_list_store_new (COMPLETION_N_COLUMNS, + G_TYPE_STRING); + + window->completion = gtk_entry_completion_new (); + gtk_entry_completion_set_popup_completion (window->completion, TRUE); + gtk_entry_completion_set_model (window->completion, + GTK_TREE_MODEL (window->completion_model)); + gtk_entry_completion_set_text_column (window->completion, + COMPLETION_TEXT_COLUMN); + + window->entry = gtk_entry_new (); + if (window->word) + gtk_entry_set_text (GTK_ENTRY (window->entry), window->word); + + gtk_entry_set_completion (GTK_ENTRY (window->entry), + window->completion); + g_signal_connect_swapped (window->entry, "activate", + G_CALLBACK (lookup_word), + window); + gtk_box_pack_start (GTK_BOX (hbox), window->entry, TRUE, TRUE, 0); + gtk_widget_show (window->entry); + + handle = gtk_hpaned_new (); + gtk_box_pack_start (GTK_BOX (vbox), handle, TRUE, TRUE, 0); + gtk_widget_show (handle); + + frame1 = gtk_vbox_new (FALSE, 0); + frame2 = gtk_vbox_new (FALSE, 0); + + window->defbox = gdict_defbox_new (); + if (window->context) + gdict_defbox_set_context (GDICT_DEFBOX (window->defbox), window->context); + + g_signal_connect (window->defbox, "link-clicked", + G_CALLBACK (gdict_window_link_clicked), + window); + + gtk_drag_dest_set (window->defbox, + GTK_DEST_DEFAULT_ALL, + drop_types, n_drop_types, + GDK_ACTION_COPY); + g_signal_connect (window->defbox, "drag-data-received", + G_CALLBACK (gdict_window_drag_data_received_cb), + window); + gtk_container_add (GTK_CONTAINER (frame1), window->defbox); + gtk_widget_show (window->defbox); + + /* Sidebar */ + window->sidebar = gdict_sidebar_new (); + g_signal_connect (window->sidebar, "page-changed", + G_CALLBACK (sidebar_page_changed_cb), + window); + g_signal_connect (window->sidebar, "closed", + G_CALLBACK (sidebar_closed_cb), + window); + + /* Speller */ + window->speller = gdict_speller_new (); + if (window->context) + gdict_speller_set_context (GDICT_SPELLER (window->speller), + window->context); + g_signal_connect (window->speller, "word-activated", + G_CALLBACK (speller_word_activated_cb), + window); + gdict_sidebar_add_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_SPELLER_PAGE, + _("Similar words"), + window->speller); + gtk_widget_show (window->speller); + + /* Database chooser */ + if (window->context) + gdict_database_chooser_set_context (GDICT_DATABASE_CHOOSER (window->db_chooser), + window->context); + g_signal_connect (window->db_chooser, "database-activated", + G_CALLBACK (database_activated_cb), + window); + gdict_sidebar_add_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_DATABASES_PAGE, + _("Available dictionaries"), + window->db_chooser); + gtk_widget_show (window->db_chooser); + + /* Strategy chooser */ + if (window->context) + gdict_strategy_chooser_set_context (GDICT_STRATEGY_CHOOSER (window->strat_chooser), + window->context); + g_signal_connect (window->strat_chooser, "strategy-activated", + G_CALLBACK (strategy_activated_cb), + window); + gdict_sidebar_add_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_STRATEGIES_PAGE, + _("Available strategies"), + window->strat_chooser); + gtk_widget_show (window->strat_chooser); + + /* Source chooser */ + window->source_chooser = gdict_source_chooser_new_with_loader (window->loader); + g_signal_connect (window->source_chooser, "source-activated", + G_CALLBACK (source_activated_cb), + window); + gdict_sidebar_add_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_SOURCES_PAGE, + _("Dictionary sources"), + window->source_chooser); + gtk_widget_show (window->source_chooser); + + gtk_container_add (GTK_CONTAINER (frame2), window->sidebar); + gtk_widget_show (window->sidebar); + + gtk_paned_pack1 (GTK_PANED (handle), frame1, TRUE, FALSE); + gtk_paned_pack2 (GTK_PANED (handle), frame2, FALSE, TRUE); + + window->defbox_frame = frame1; + window->sidebar_frame = frame2; + + gtk_widget_show (window->defbox_frame); + + window->status = gtk_statusbar_new (); + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->status), TRUE); + gtk_box_pack_end (GTK_BOX (window->main_box), window->status, FALSE, FALSE, 0); + statusbar_visible = mateconf_client_get_bool (window->mateconf_client, + GDICT_MATECONF_STATUSBAR_VISIBLE_KEY, + NULL); + gdict_window_set_statusbar_visible (window, statusbar_visible); + + window->progress = gtk_progress_bar_new (); + gtk_box_pack_end (GTK_BOX (window->status), window->progress, FALSE, FALSE, 0); + + /* retrieve the font size from mateconf */ + font_name = gdict_mateconf_get_string_with_default (window->mateconf_client, + DOCUMENT_FONT_KEY, + GDICT_DEFAULT_DEFBOX_FONT); + + gdict_window_set_defbox_font (window, font_name); + font_desc = pango_font_description_from_string (font_name); + g_free (font_name); + + sidebar_visible = mateconf_client_get_bool (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_VISIBLE_KEY, + NULL); + gdict_window_set_sidebar_visible (window, sidebar_visible); + + /* retrieve the window state from mateconf */ + is_maximized = mateconf_client_get_bool (window->mateconf_client, + GDICT_MATECONF_WINDOW_IS_MAXIMIZED_KEY, + NULL); + + width = mateconf_client_get_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_WIDTH_KEY, + NULL); + height = mateconf_client_get_int (window->mateconf_client, + GDICT_MATECONF_WINDOW_HEIGHT_KEY, + NULL); + sidebar_width = mateconf_client_get_int (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_WIDTH_KEY, + NULL); + sidebar_page = mateconf_client_get_string (window->mateconf_client, + GDICT_MATECONF_SIDEBAR_PAGE_KEY, + NULL); + + /* if the (width, height) tuple is not defined, use the font to + * calculate the right window geometry + */ + if (width == -1 || height == -1) + { + gint font_size; + + font_size = pango_font_description_get_size (font_desc); + font_size = PANGO_PIXELS (font_size); + + width = MAX (GDICT_WINDOW_COLUMNS * font_size, GDICT_WINDOW_MIN_WIDTH); + height = MAX (GDICT_WINDOW_ROWS * font_size, GDICT_WINDOW_MIN_HEIGHT); + } + else + { + window->default_width = width; + window->default_height = height; + } + + pango_font_description_free (font_desc); + + window->is_maximized = is_maximized; + + gtk_window_set_title (GTK_WINDOW (window), _("Dictionary")); + gtk_window_set_default_size (GTK_WINDOW (window), + width, + height); + if (is_maximized) + gtk_window_maximize (GTK_WINDOW (window)); + + gtk_widget_get_allocation (GTK_WIDGET (window), &allocation); + gtk_paned_set_position (GTK_PANED (handle), allocation.width - sidebar_width); + if (sidebar_page) + { + gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), sidebar_page); + g_free (sidebar_page); + } + + g_signal_connect (window, "delete-event", + G_CALLBACK (gdict_window_delete_event_cb), + NULL); + g_signal_connect (window, "window-state-event", + G_CALLBACK (gdict_window_state_event_cb), + NULL); + g_signal_connect (handle, "notify::position", + G_CALLBACK (gdict_window_handle_notify_position_cb), + window); + + gtk_widget_grab_focus (window->entry); + + gtk_widget_pop_composite_child (); + + return object; +} + +static void +gdict_window_class_init (GdictWindowClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gobject_class->finalize = gdict_window_finalize; + gobject_class->dispose = gdict_window_dispose; + gobject_class->set_property = gdict_window_set_property; + gobject_class->get_property = gdict_window_get_property; + gobject_class->constructor = gdict_window_constructor; + + widget_class->style_set = gdict_window_style_set; + widget_class->size_allocate = gdict_window_size_allocate; + + g_object_class_install_property (gobject_class, + PROP_ACTION, + g_param_spec_enum ("action", + "Action", + "The default action performed by the window", + GDICT_TYPE_WINDOW_ACTION, + GDICT_WINDOW_ACTION_CLEAR, + (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); + g_object_class_install_property (gobject_class, + PROP_SOURCE_LOADER, + g_param_spec_object ("source-loader", + "Source Loader", + "The GdictSourceLoader to be used to load dictionary sources", + GDICT_TYPE_SOURCE_LOADER, + (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY))); + g_object_class_install_property (gobject_class, + PROP_SOURCE_NAME, + g_param_spec_string ("source-name", + "Source Name", + "The name of the GdictSource to be used", + GDICT_DEFAULT_SOURCE_NAME, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + g_object_class_install_property (gobject_class, + PROP_PRINT_FONT, + g_param_spec_string ("print-font", + "Print Font", + "The font name to be used when printing", + GDICT_DEFAULT_PRINT_FONT, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + g_object_class_install_property (gobject_class, + PROP_DEFBOX_FONT, + g_param_spec_string ("defbox-font", + "Defbox Font", + "The font name to be used by the defbox widget", + GDICT_DEFAULT_DEFBOX_FONT, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + g_object_class_install_property (gobject_class, + PROP_WORD, + g_param_spec_string ("word", + "Word", + "The word to search", + NULL, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + g_object_class_install_property (gobject_class, + PROP_WINDOW_ID, + g_param_spec_uint ("window-id", + "Window ID", + "The unique identifier for this window", + 0, + G_MAXUINT, + 0, + G_PARAM_READABLE)); + + gdict_window_signals[CREATED] = + g_signal_new ("created", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdictWindowClass, created), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDICT_TYPE_WINDOW); +} + +static void +gdict_window_init (GdictWindow *window) +{ + GError *mateconf_error; + + window->action = GDICT_WINDOW_ACTION_CLEAR; + + window->loader = NULL; + window->context = NULL; + + window->mateconf_client = mateconf_client_get_default (); + + mateconf_error = NULL; + mateconf_client_add_dir (window->mateconf_client, + GDICT_MATECONF_DIR, + MATECONF_CLIENT_PRELOAD_NONE, + &mateconf_error); + if (mateconf_error) + { + gdict_show_gerror_dialog (NULL, + _("Unable to connect to MateConf"), + mateconf_error); + } + + window->notify_id = mateconf_client_notify_add (window->mateconf_client, + GDICT_MATECONF_DIR, + gdict_window_mateconf_notify_cb, + window, + NULL, + &mateconf_error); + if (mateconf_error) + { + gdict_show_gerror_dialog (NULL, + _("Unable to get notification for preferences"), + mateconf_error); + } + + window->font_notify_id = mateconf_client_notify_add (window->mateconf_client, + DOCUMENT_FONT_KEY, + gdict_window_mateconf_notify_cb, + window, + NULL, + &mateconf_error); + if (mateconf_error) + { + gdict_show_gerror_dialog (NULL, + _("Unable to get notification for the document font"), + mateconf_error); + } + + window->word = NULL; + window->source_name = NULL; + window->print_font = NULL; + window->defbox_font = NULL; + + window->database = NULL; + window->strategy = NULL; + + window->default_width = -1; + window->default_height = -1; + window->is_maximized = FALSE; + + window->window_id = (gulong) time (NULL); + + /* we need to create the chooser widgets for the sidebar before + * we set the construction properties + */ + window->db_chooser = gdict_database_chooser_new (); + window->strat_chooser = gdict_strategy_chooser_new (); +} + +GtkWidget * +gdict_window_new (GdictWindowAction action, + GdictSourceLoader *loader, + const gchar *source_name, + const gchar *word) +{ + GtkWidget *retval; + GdictWindow *window; + + g_return_val_if_fail (GDICT_IS_SOURCE_LOADER (loader), NULL); + + retval = g_object_new (GDICT_TYPE_WINDOW, + "action", action, + "source-loader", loader, + "source-name", source_name, + NULL); + + window = GDICT_WINDOW (retval); + + if (word && word[0] != '\0') + { + switch (action) + { + case GDICT_WINDOW_ACTION_LOOKUP: + gtk_entry_set_text (GTK_ENTRY (window->entry), word); + gdict_window_set_word (window, word, NULL); + break; + case GDICT_WINDOW_ACTION_MATCH: + { + GdictSource *source; + GdictContext *context; + + gtk_entry_set_text (GTK_ENTRY (window->entry), word); + + gdict_window_set_sidebar_visible (window, TRUE); + gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), + GDICT_SIDEBAR_SPELLER_PAGE); + + /* we clone the context, so that the signals that it + * fires do not get caught by the signal handlers we + * use for getting the definitions. + */ + source = gdict_source_loader_get_source (window->loader, + window->source_name); + context = gdict_source_get_context (source); + + gdict_speller_set_context (GDICT_SPELLER (window->speller), context); + + g_object_unref (context); + g_object_unref (source); + + gdict_speller_set_strategy (GDICT_SPELLER (window->speller), + window->strategy); + + gdict_speller_match (GDICT_SPELLER (window->speller), word); + } + case GDICT_WINDOW_ACTION_CLEAR: + gdict_defbox_clear (GDICT_DEFBOX (window->defbox)); + break; + default: + g_assert_not_reached (); + break; + } + } + + return retval; +} + +/* GdictWindowAction */ +static const GEnumValue _gdict_window_action_values[] = { + { GDICT_WINDOW_ACTION_LOOKUP, "GDICT_WINDOW_ACTION_LOOKUP", "lookup" }, + { GDICT_WINDOW_ACTION_MATCH, "GDICT_WINDOW_ACTION_MATCH", "match" }, + { GDICT_WINDOW_ACTION_CLEAR, "GDICT_WINDOW_ACTION_CLEAR", "clear" }, + { 0, NULL, NULL } +}; + +GType +gdict_window_action_get_type (void) +{ + static GType our_type = 0; + + if (!our_type) + our_type = g_enum_register_static ("GdictWindowAction", _gdict_window_action_values); + + return our_type; +} diff --git a/mate-dictionary/src/gdict-window.h b/mate-dictionary/src/gdict-window.h new file mode 100644 index 00000000..36455cba --- /dev/null +++ b/mate-dictionary/src/gdict-window.h @@ -0,0 +1,129 @@ +/* gdict-window.h - main application window + * + * This file is part of MATE Dictionary + * + * Copyright (C) 2005 Emmanuele Bassi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __GDICT_WINDOW_H__ +#define __GDICT_WINDOW_H__ + +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gtk/gtk.h> +#include <mateconf/mateconf-client.h> +#include <libgdict/gdict.h> + +G_BEGIN_DECLS + +#define GDICT_TYPE_WINDOW (gdict_window_get_type ()) +#define GDICT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDICT_TYPE_WINDOW, GdictWindow)) +#define GDICT_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDICT_TYPE_WINDOW)) + +typedef enum { + GDICT_WINDOW_ACTION_LOOKUP, + GDICT_WINDOW_ACTION_MATCH, + GDICT_WINDOW_ACTION_CLEAR +} GdictWindowAction; + +#define GDICT_TYPE_WINDOW_ACTION (gdict_window_action_get_type ()) +GType gdict_window_action_get_type (void) G_GNUC_CONST; + +typedef struct _GdictWindow GdictWindow; +typedef struct _GdictWindowClass GdictWindowClass; + +struct _GdictWindow +{ + GtkWindow parent_instance; + + GtkWidget *main_box; + GtkWidget *menubar; + GtkWidget *entry; + + /* sidebar widgets */ + GtkWidget *speller; + GtkWidget *db_chooser; + GtkWidget *strat_chooser; + GtkWidget *source_chooser; + + GtkWidget *sidebar; + GtkWidget *sidebar_frame; + + GtkWidget *defbox; + GtkWidget *defbox_frame; + + GtkWidget *status; + GtkWidget *progress; + + GtkUIManager *ui_manager; + GtkActionGroup *action_group; + + GtkEntryCompletion *completion; + GtkListStore *completion_model; + + GdictWindowAction action; + + gchar *word; + gint max_definition; + gint last_definition; + gint current_definition; + + gchar *source_name; + GdictSourceLoader *loader; + GdictContext *context; + guint definition_id; + guint lookup_start_id; + guint lookup_end_id; + guint error_id; + + gchar *database; + gchar *strategy; + gchar *print_font; + gchar *defbox_font; + + MateConfClient *mateconf_client; + guint notify_id; + guint font_notify_id; + + GdkCursor *busy_cursor; + + gint default_width; + gint default_height; + gint sidebar_width; + + guint is_maximized : 1; + guint sidebar_visible : 1; + guint statusbar_visible : 1; + + gulong window_id; +}; + +struct _GdictWindowClass +{ + GtkWindowClass parent_class; + + void (*created) (GdictWindow *parent_window, + GdictWindow *new_window); +}; + +GType gdict_window_get_type (void) G_GNUC_CONST; +GtkWidget *gdict_window_new (GdictWindowAction action, + GdictSourceLoader *loader, + const gchar *source_name, + const gchar *word); + +#endif /* __GDICT_WINDOW_H__ */ diff --git a/mate-dictionary/src/main.c b/mate-dictionary/src/main.c new file mode 100644 index 00000000..f6dcc94d --- /dev/null +++ b/mate-dictionary/src/main.c @@ -0,0 +1,24 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <libintl.h> + +#include "gdict-app.h" + +int main (int argc, char *argv[]) +{ + bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + gdict_init (&argc, &argv); + + gdict_main (); + + gdict_cleanup (); + + return EXIT_SUCCESS; +} |