From 528c1e5ff51e213936e800fc5a9a25da99c0bdf2 Mon Sep 17 00:00:00 2001 From: Perberos Date: Mon, 7 Nov 2011 16:46:58 -0300 Subject: initial --- AUTHORS | 13 + BUGS | 7 + COPYING | 340 ++ HACKING | 65 + MAINTAINERS | 12 + Makefile.am | 75 + NEWS | 1350 +++++ README | 135 + autogen.sh | 23 + configure.ac | 600 ++ data/Makefile.am | 49 + data/gedit-bugreport.sh.in | 73 + data/gedit.1 | 76 + data/gedit.desktop.in.in | 18 + data/gedit.pc.in | 11 + data/gedit.schemas.in.in | 537 ++ distro/archlinux/PKGBUILD | 39 + distro/archlinux/mate-text-editor.install | 22 + distro/ubuntu/build | 33 + distro/ubuntu/postinst | 8 + distro/ubuntu/postrm | 7 + distro/ubuntu/preinst | 6 + distro/ubuntu/prerm | 7 + docs/Makefile.am | 5 + docs/class-diagram.dia | Bin 0 -> 8258 bytes docs/reference/Makefile.am | 121 + docs/reference/gedit-docs.sgml | 37 + docs/reference/gedit-overrides.txt | 0 docs/reference/gedit-sections.txt | 809 +++ docs/reference/gedit.types | 32 + gedit.doap | 39 + gedit/Makefile.am | 254 + gedit/bacon-message-connection.c | 396 ++ gedit/bacon-message-connection.h | 43 + gedit/dialogs/Makefile.am | 31 + gedit/dialogs/gedit-close-confirmation-dialog.c | 790 +++ gedit/dialogs/gedit-close-confirmation-dialog.h | 75 + gedit/dialogs/gedit-encodings-dialog.c | 499 ++ gedit/dialogs/gedit-encodings-dialog.h | 86 + gedit/dialogs/gedit-encodings-dialog.ui | 256 + gedit/dialogs/gedit-preferences-dialog.c | 1189 ++++ gedit/dialogs/gedit-preferences-dialog.h | 87 + gedit/dialogs/gedit-preferences-dialog.ui | 1107 ++++ gedit/dialogs/gedit-search-dialog.c | 634 ++ gedit/dialogs/gedit-search-dialog.h | 128 + gedit/dialogs/gedit-search-dialog.ui | 255 + gedit/gedit-app.c | 911 +++ gedit/gedit-app.h | 142 + gedit/gedit-close-button.c | 80 + gedit/gedit-close-button.h | 56 + gedit/gedit-commands-documents.c | 87 + gedit/gedit-commands-edit.c | 174 + gedit/gedit-commands-file-print.c | 91 + gedit/gedit-commands-file.c | 1885 ++++++ gedit/gedit-commands-help.c | 115 + gedit/gedit-commands-search.c | 716 +++ gedit/gedit-commands-view.c | 154 + gedit/gedit-commands.h | 166 + gedit/gedit-debug.c | 159 + gedit/gedit-debug.h | 93 + gedit/gedit-dirs.c | 320 + gedit/gedit-dirs.h | 54 + gedit/gedit-document-input-stream.c | 479 ++ gedit/gedit-document-input-stream.h | 68 + gedit/gedit-document-loader.c | 357 ++ gedit/gedit-document-loader.h | 130 + gedit/gedit-document-output-stream.c | 391 ++ gedit/gedit-document-output-stream.h | 64 + gedit/gedit-document-saver.c | 359 ++ gedit/gedit-document-saver.h | 133 + gedit/gedit-document.c | 2732 +++++++++ gedit/gedit-document.h | 338 ++ gedit/gedit-documents-panel.c | 828 +++ gedit/gedit-documents-panel.h | 85 + gedit/gedit-encodings-combo-box.c | 468 ++ gedit/gedit-encodings-combo-box.h | 78 + gedit/gedit-encodings.c | 473 ++ gedit/gedit-encodings.h | 62 + gedit/gedit-enum-types.c.template | 39 + gedit/gedit-enum-types.h.template | 27 + gedit/gedit-file-chooser-dialog.c | 560 ++ gedit/gedit-file-chooser-dialog.h | 89 + gedit/gedit-gio-document-loader.c | 708 +++ gedit/gedit-gio-document-loader.h | 79 + gedit/gedit-gio-document-saver.c | 775 +++ gedit/gedit-gio-document-saver.h | 76 + gedit/gedit-help.c | 122 + gedit/gedit-help.h | 44 + gedit/gedit-history-entry.c | 632 ++ gedit/gedit-history-entry.h | 96 + gedit/gedit-io-error-message-area.c | 1288 ++++ gedit/gedit-io-error-message-area.h | 68 + gedit/gedit-language-manager.c | 90 + gedit/gedit-language-manager.h | 47 + gedit/gedit-marshal.list | 13 + gedit/gedit-message-area.c | 626 ++ gedit/gedit-message-area.h | 129 + gedit/gedit-message-bus.c | 1158 ++++ gedit/gedit-message-bus.h | 129 + gedit/gedit-message-type.c | 526 ++ gedit/gedit-message-type.h | 67 + gedit/gedit-message.c | 593 ++ gedit/gedit-message.h | 71 + gedit/gedit-metadata-manager.c | 563 ++ gedit/gedit-metadata-manager.h | 50 + gedit/gedit-notebook.c | 1099 ++++ gedit/gedit-notebook.h | 143 + gedit/gedit-object-module.c | 343 ++ gedit/gedit-object-module.h | 94 + gedit/gedit-panel.c | 950 +++ gedit/gedit-panel.h | 130 + gedit/gedit-plugin-info-priv.h | 68 + gedit/gedit-plugin-info.c | 394 ++ gedit/gedit-plugin-info.h | 63 + gedit/gedit-plugin-loader.c | 131 + gedit/gedit-plugin-loader.h | 106 + gedit/gedit-plugin-manager.c | 889 +++ gedit/gedit-plugin-manager.h | 83 + gedit/gedit-plugin.c | 334 + gedit/gedit-plugin.h | 240 + gedit/gedit-plugins-engine.c | 861 +++ gedit/gedit-plugins-engine.h | 107 + gedit/gedit-prefs-manager-app.c | 1620 +++++ gedit/gedit-prefs-manager-app.h | 84 + gedit/gedit-prefs-manager-private.h | 45 + gedit/gedit-prefs-manager.c | 1241 ++++ gedit/gedit-prefs-manager.h | 423 ++ gedit/gedit-print-job.c | 865 +++ gedit/gedit-print-job.h | 133 + gedit/gedit-print-preferences.ui | 497 ++ gedit/gedit-print-preview.c | 1327 ++++ gedit/gedit-print-preview.h | 71 + gedit/gedit-progress-message-area.c | 261 + gedit/gedit-progress-message-area.h | 112 + gedit/gedit-session.c | 601 ++ gedit/gedit-session.h | 47 + gedit/gedit-smart-charset-converter.c | 422 ++ gedit/gedit-smart-charset-converter.h | 66 + gedit/gedit-spinner.c | 989 +++ gedit/gedit-spinner.h | 95 + gedit/gedit-status-combo-box.c | 418 ++ gedit/gedit-status-combo-box.h | 82 + gedit/gedit-statusbar.c | 448 ++ gedit/gedit-statusbar.h | 99 + gedit/gedit-style-scheme-manager.c | 364 ++ gedit/gedit-style-scheme-manager.h | 56 + gedit/gedit-tab-label.c | 371 ++ gedit/gedit-tab-label.h | 66 + gedit/gedit-tab.c | 2832 +++++++++ gedit/gedit-tab.h | 165 + gedit/gedit-ui.h | 188 + gedit/gedit-ui.xml | 203 + gedit/gedit-utils.c | 1546 +++++ gedit/gedit-utils.h | 162 + gedit/gedit-view.c | 2181 +++++++ gedit/gedit-view.h | 108 + gedit/gedit-window-private.h | 124 + gedit/gedit-window.c | 4798 +++++++++++++++ gedit/gedit-window.h | 195 + gedit/gedit.c | 766 +++ gedit/gedit.rc | 1 + gedit/gedittextregion.c | 647 ++ gedit/gedittextregion.h | 88 + gedit/osx/Makefile.am | 23 + gedit/osx/gedit-osx-delegate.h | 16 + gedit/osx/gedit-osx-delegate.m | 84 + gedit/osx/gedit-osx.c | 94 + gedit/osx/gedit-osx.h | 17 + gedit/smclient/Makefile.am | 52 + gedit/smclient/eggdesktopfile.c | 1510 +++++ gedit/smclient/eggdesktopfile.h | 160 + gedit/smclient/eggsmclient-osx.c | 235 + gedit/smclient/eggsmclient-private.h | 53 + gedit/smclient/eggsmclient-win32.c | 353 ++ gedit/smclient/eggsmclient-xsmp.c | 1370 +++++ gedit/smclient/eggsmclient.c | 589 ++ gedit/smclient/eggsmclient.h | 117 + help/C/figures/gedit_format_bold.png | Bin 0 -> 726 bytes help/C/figures/gedit_format_italic.png | Bin 0 -> 689 bytes help/C/figures/gedit_format_strikethrough.png | Bin 0 -> 743 bytes help/C/figures/gedit_format_underline.png | Bin 0 -> 737 bytes help/C/figures/gedit_recent_files_menu_icon.png | Bin 0 -> 192 bytes help/C/figures/gedit_window.png | Bin 0 -> 35054 bytes help/C/gedit.xml | 1986 ++++++ help/C/legal.xml | 73 + help/Makefile.am | 18 + help/ar/ar.po | 4057 +++++++++++++ help/bg/bg.po | 3332 ++++++++++ help/bg/figures/gedit_window.png | Bin 0 -> 30289 bytes help/ca/ca.po | 4698 ++++++++++++++ help/ca/figures/gedit_window.png | Bin 0 -> 29283 bytes help/cs/cs.po | 4386 ++++++++++++++ help/cs/figures/gedit_window.png | Bin 0 -> 30439 bytes help/da/da.po | 4673 ++++++++++++++ help/de/de.po | 4715 ++++++++++++++ help/de/figures/gedit_window.png | Bin 0 -> 30621 bytes help/el/el.po | 2824 +++++++++ help/el/figures/gedit_window.png | Bin 0 -> 33502 bytes help/es/es.po | 4690 ++++++++++++++ help/es/figures/gedit_window.png | Bin 0 -> 30275 bytes help/fi/fi.po | 4545 ++++++++++++++ help/fi/figures/gedit_window.png | Bin 0 -> 24939 bytes help/fr/figures/gedit_recent_files_menu_icon.png | Bin 0 -> 430 bytes help/fr/figures/gedit_window.png | Bin 0 -> 23551 bytes help/fr/fr.po | 4470 ++++++++++++++ help/gedit.omf.in | 9 + help/hu/hu.po | 4406 ++++++++++++++ help/it/figures/gedit_window.png | Bin 0 -> 31468 bytes help/it/it.po | 4679 ++++++++++++++ help/ja/figures/gedit_window.png | Bin 0 -> 38561 bytes help/ja/ja.po | 4472 ++++++++++++++ help/ko/figures/gedit_window.png | Bin 0 -> 33894 bytes help/ko/ko.po | 4399 ++++++++++++++ help/oc/oc.po | 3650 +++++++++++ help/pt_BR/pt_BR.po | 4672 ++++++++++++++ help/ru/ru.po | 4488 ++++++++++++++ help/sv/figures/gedit_window.png | Bin 0 -> 37511 bytes help/sv/sv.po | 3026 +++++++++ help/th/th.po | 3777 ++++++++++++ help/uk/figures/gedit_window.png | Bin 0 -> 26281 bytes help/uk/uk.po | 4362 +++++++++++++ help/zh_CN/figures/gedit_window.png | Bin 0 -> 15743 bytes help/zh_CN/zh_CN.po | 5100 ++++++++++++++++ help/zh_HK/figures/gedit_window.png | Bin 0 -> 15743 bytes help/zh_HK/zh_HK.po | 2717 +++++++++ help/zh_TW/figures/gedit_window.png | Bin 0 -> 15743 bytes help/zh_TW/zh_TW.po | 2686 ++++++++ osx/Info.plist.in | 260 + osx/Makefile.am | 3 + pixmaps/Makefile.am | 12 + pixmaps/gedit-logo.png | Bin 0 -> 25918 bytes pixmaps/gedit-plugin.png | Bin 0 -> 2525 bytes pixmaps/gedit.ico | Bin 0 -> 9662 bytes plugin-loaders/Makefile.am | 7 + plugin-loaders/c/Makefile.am | 24 + plugin-loaders/c/gedit-plugin-loader-c.c | 182 + plugin-loaders/c/gedit-plugin-loader-c.h | 60 + plugin-loaders/python/Makefile.am | 36 + plugin-loaders/python/bindings/Makefile.am | 115 + plugin-loaders/python/bindings/gedit.defs | 1461 +++++ plugin-loaders/python/bindings/gedit.override | 461 ++ plugin-loaders/python/bindings/geditcommands.defs | 45 + .../python/bindings/geditcommands.override | 122 + .../python/bindings/geditmessage.override | 556 ++ .../python/bindings/geditplugin.override | 193 + plugin-loaders/python/bindings/geditutils.defs | 67 + plugin-loaders/python/bindings/geditutils.override | 85 + plugin-loaders/python/gedit-plugin-loader-python.c | 719 +++ plugin-loaders/python/gedit-plugin-loader-python.h | 61 + plugin-loaders/python/gedit-plugin-python.c | 281 + plugin-loaders/python/gedit-plugin-python.h | 88 + plugins/Makefile.am | 42 + plugins/changecase/Makefile.am | 34 + .../changecase/changecase.gedit-plugin.desktop.in | 8 + plugins/changecase/gedit-changecase-plugin.c | 395 ++ plugins/changecase/gedit-changecase-plugin.h | 72 + plugins/checkupdate/Makefile.am | 49 + .../checkupdate.gedit-plugin.desktop.in | 9 + plugins/checkupdate/gedit-check-update-plugin.c | 697 +++ plugins/checkupdate/gedit-check-update-plugin.h | 74 + plugins/checkupdate/gedit-check-update.schemas.in | 13 + plugins/docinfo/Makefile.am | 34 + plugins/docinfo/docinfo.gedit-plugin.desktop.in | 7 + plugins/docinfo/docinfo.ui | 621 ++ plugins/docinfo/gedit-docinfo-plugin.c | 580 ++ plugins/docinfo/gedit-docinfo-plugin.h | 75 + plugins/externaltools/Makefile.am | 15 + plugins/externaltools/data/Makefile.am | 65 + plugins/externaltools/data/build.desktop.in | 9 + plugins/externaltools/data/build.tool.in | 15 + .../data/open-terminal-here-osx.desktop.in | 8 + .../data/open-terminal-here-osx.tool.in | 16 + .../data/open-terminal-here.desktop.in | 8 + .../externaltools/data/open-terminal-here.tool.in | 4 + .../data/remove-trailing-spaces.desktop.in | 9 + .../data/remove-trailing-spaces.tool.in | 3 + plugins/externaltools/data/run-command.desktop.in | 8 + plugins/externaltools/data/run-command.tool.in | 4 + .../externaltools.gedit-plugin.desktop.in | 9 + plugins/externaltools/scripts/Makefile.am | 4 + plugins/externaltools/scripts/gedit-tool-merge.pl | 78 + plugins/externaltools/tools/Makefile.am | 23 + plugins/externaltools/tools/__init__.py | 281 + plugins/externaltools/tools/capture.py | 214 + plugins/externaltools/tools/filelookup.py | 145 + plugins/externaltools/tools/functions.py | 303 + plugins/externaltools/tools/library.py | 493 ++ plugins/externaltools/tools/linkparsing.py | 231 + plugins/externaltools/tools/manager.py | 948 +++ plugins/externaltools/tools/outputpanel.py | 224 + plugins/externaltools/tools/outputpanel.ui | 53 + plugins/externaltools/tools/tools.ui | 606 ++ plugins/filebrowser/Makefile.am | 104 + .../filebrowser.gedit-plugin.desktop.in | 10 + plugins/filebrowser/gedit-file-bookmarks-store.c | 879 +++ plugins/filebrowser/gedit-file-bookmarks-store.h | 90 + .../gedit-file-browser-enum-register.c.template | 20 + .../gedit-file-browser-enum-types.c.template | 45 + .../gedit-file-browser-enum-types.h.template | 29 + plugins/filebrowser/gedit-file-browser-error.h | 41 + .../filebrowser/gedit-file-browser-marshal.list | 5 + plugins/filebrowser/gedit-file-browser-messages.c | 1033 ++++ plugins/filebrowser/gedit-file-browser-messages.h | 35 + plugins/filebrowser/gedit-file-browser-plugin.c | 1254 ++++ plugins/filebrowser/gedit-file-browser-plugin.h | 71 + plugins/filebrowser/gedit-file-browser-store.c | 3625 +++++++++++ plugins/filebrowser/gedit-file-browser-store.h | 200 + plugins/filebrowser/gedit-file-browser-utils.c | 198 + plugins/filebrowser/gedit-file-browser-utils.h | 27 + plugins/filebrowser/gedit-file-browser-view.c | 1256 ++++ plugins/filebrowser/gedit-file-browser-view.h | 84 + .../filebrowser/gedit-file-browser-widget-ui.xml | 54 + plugins/filebrowser/gedit-file-browser-widget.c | 3143 ++++++++++ plugins/filebrowser/gedit-file-browser-widget.h | 121 + plugins/filebrowser/gedit-file-browser.schemas.in | 97 + plugins/modelines/Makefile.am | 38 + plugins/modelines/gedit-modeline-plugin.c | 248 + plugins/modelines/gedit-modeline-plugin.h | 48 + plugins/modelines/language-mappings | 14 + plugins/modelines/modeline-parser.c | 852 +++ plugins/modelines/modeline-parser.h | 37 + .../modelines/modelines.gedit-plugin.desktop.in | 8 + plugins/pythonconsole/Makefile.am | 15 + .../pythonconsole.gedit-plugin.desktop.in | 10 + plugins/pythonconsole/pythonconsole/Makefile.am | 17 + plugins/pythonconsole/pythonconsole/__init__.py | 78 + plugins/pythonconsole/pythonconsole/config.py | 134 + plugins/pythonconsole/pythonconsole/config.ui | 107 + plugins/pythonconsole/pythonconsole/console.py | 370 ++ plugins/quickopen/Makefile.am | 15 + .../quickopen/quickopen.gedit-plugin.desktop.in | 10 + plugins/quickopen/quickopen/Makefile.am | 13 + plugins/quickopen/quickopen/__init__.py | 46 + plugins/quickopen/quickopen/popup.py | 534 ++ plugins/quickopen/quickopen/virtualdirs.py | 87 + plugins/quickopen/quickopen/windowhelper.py | 198 + plugins/snippets/Makefile.am | 15 + plugins/snippets/data/Makefile.am | 33 + plugins/snippets/data/c.xml | 283 + plugins/snippets/data/chdr.xml | 241 + plugins/snippets/data/cpp.xml | 183 + plugins/snippets/data/css.xml | 557 ++ plugins/snippets/data/docbook.xml | 118 + plugins/snippets/data/fortran.xml | 164 + plugins/snippets/data/global.xml | 2 + plugins/snippets/data/haskell.xml | 14 + plugins/snippets/data/html.xml | 246 + plugins/snippets/data/idl.xml | 49 + plugins/snippets/data/java.xml | 91 + plugins/snippets/data/javascript.xml | 11 + plugins/snippets/data/lang/Makefile.am | 9 + plugins/snippets/data/lang/snippets.lang | 162 + plugins/snippets/data/latex.xml | 38 + plugins/snippets/data/mallard.xml | 207 + plugins/snippets/data/perl.xml | 126 + plugins/snippets/data/php.xml | 224 + plugins/snippets/data/python.xml | 112 + plugins/snippets/data/ruby.xml | 166 + plugins/snippets/data/sh.xml | 47 + plugins/snippets/data/snippets.xml | 98 + plugins/snippets/data/tcl.xml | 55 + plugins/snippets/data/xml.xml | 25 + plugins/snippets/data/xslt.xml | 143 + plugins/snippets/snippets.gedit-plugin.desktop.in | 9 + plugins/snippets/snippets/Completion.py | 165 + plugins/snippets/snippets/Document.py | 1089 ++++ plugins/snippets/snippets/Exporter.py | 98 + plugins/snippets/snippets/Helper.py | 182 + plugins/snippets/snippets/Importer.py | 100 + plugins/snippets/snippets/LanguageManager.py | 21 + plugins/snippets/snippets/Library.py | 993 +++ plugins/snippets/snippets/Makefile.am | 28 + plugins/snippets/snippets/Manager.py | 1157 ++++ plugins/snippets/snippets/Parser.py | 259 + plugins/snippets/snippets/Placeholder.py | 700 +++ plugins/snippets/snippets/Snippet.py | 355 ++ plugins/snippets/snippets/SubstitutionParser.py | 202 + plugins/snippets/snippets/WindowHelper.py | 209 + plugins/snippets/snippets/__init__.py | 101 + plugins/snippets/snippets/snippets.ui | 647 ++ plugins/sort/Makefile.am | 34 + plugins/sort/gedit-sort-plugin.c | 588 ++ plugins/sort/gedit-sort-plugin.h | 73 + plugins/sort/sort.gedit-plugin.desktop.in | 9 + plugins/sort/sort.ui | 275 + plugins/spell/Makefile.am | 63 + plugins/spell/gedit-automatic-spell-checker.c | 1015 ++++ plugins/spell/gedit-automatic-spell-checker.h | 67 + plugins/spell/gedit-spell-checker-dialog.c | 722 +++ plugins/spell/gedit-spell-checker-dialog.h | 92 + plugins/spell/gedit-spell-checker-language.c | 439 ++ plugins/spell/gedit-spell-checker-language.h | 51 + plugins/spell/gedit-spell-checker.c | 520 ++ plugins/spell/gedit-spell-checker.h | 109 + plugins/spell/gedit-spell-language-dialog.c | 309 + plugins/spell/gedit-spell-language-dialog.h | 67 + plugins/spell/gedit-spell-marshal.list | 6 + plugins/spell/gedit-spell-plugin.c | 1217 ++++ plugins/spell/gedit-spell-plugin.h | 75 + plugins/spell/gedit-spell-utils.c | 94 + plugins/spell/gedit-spell-utils.h | 37 + plugins/spell/languages-dialog.ui | 145 + plugins/spell/spell-checker.ui | 482 ++ plugins/spell/spell.gedit-plugin.desktop.in | 9 + plugins/taglist/HTML.tags.xml.in | 2672 ++++++++ plugins/taglist/Latex.tags.xml.in | 344 ++ plugins/taglist/Makefile.am | 60 + plugins/taglist/XSLT.tags.xml.in | 337 + plugins/taglist/XUL.tags.xml.in | 536 ++ plugins/taglist/gedit-taglist-plugin-panel.c | 776 +++ plugins/taglist/gedit-taglist-plugin-panel.h | 89 + plugins/taglist/gedit-taglist-plugin-parser.c | 655 ++ plugins/taglist/gedit-taglist-plugin-parser.h | 68 + plugins/taglist/gedit-taglist-plugin.c | 160 + plugins/taglist/gedit-taglist-plugin.h | 85 + plugins/taglist/taglist.gedit-plugin.desktop.in | 8 + plugins/time/Makefile.am | 36 + plugins/time/gedit-time-dialog.ui | 297 + plugins/time/gedit-time-plugin.c | 1272 ++++ plugins/time/gedit-time-plugin.h | 78 + plugins/time/gedit-time-setup-dialog.ui | 330 + plugins/time/time.gedit-plugin.desktop.in | 8 + po/LINGUAS | 97 + po/Makefile.in.in~ | 217 + po/POTFILES.in | 112 + po/POTFILES.skip | 12 + po/af.po | 6097 +++++++++++++++++++ po/am.po | 4655 ++++++++++++++ po/ar.po | 5305 ++++++++++++++++ po/as.po | 5293 ++++++++++++++++ po/ast.po | 5514 +++++++++++++++++ po/az.po | 4813 +++++++++++++++ po/be.po | 5700 +++++++++++++++++ po/be@latin.po | 5297 ++++++++++++++++ po/bg.po | 5200 ++++++++++++++++ po/bn.po | 5447 +++++++++++++++++ po/bn_IN.po | 5251 ++++++++++++++++ po/br.po | 4895 +++++++++++++++ po/bs.po | 4852 +++++++++++++++ po/ca.po | 6405 ++++++++++++++++++++ po/ca@valencia.po | 6403 +++++++++++++++++++ po/crh.po | 5387 ++++++++++++++++ po/cs.po | 5249 ++++++++++++++++ po/cy.po | 5548 +++++++++++++++++ po/da.po | 5868 ++++++++++++++++++ po/de.po | 5529 +++++++++++++++++ po/dz.po | 5464 +++++++++++++++++ po/el.po | 5262 ++++++++++++++++ po/en@shaw.po | 5067 ++++++++++++++++ po/en_CA.po | 4709 ++++++++++++++ po/en_GB.po | 6272 +++++++++++++++++++ po/eo.po | 5183 ++++++++++++++++ po/es.po | 5398 +++++++++++++++++ po/et.po | 3966 ++++++++++++ po/eu.po | 5348 ++++++++++++++++ po/fa.po | 4600 ++++++++++++++ po/fi.po | 5478 +++++++++++++++++ po/fr.po | 5264 ++++++++++++++++ po/ga.po | 4949 +++++++++++++++ po/gl.po | 5208 ++++++++++++++++ po/gu.po | 5045 +++++++++++++++ po/he.po | 5522 +++++++++++++++++ po/hi.po | 5091 ++++++++++++++++ po/hr.po | 5032 +++++++++++++++ po/hu.po | 5167 ++++++++++++++++ po/hy.po | 4555 ++++++++++++++ po/id.po | 5155 ++++++++++++++++ po/is.po | 4557 ++++++++++++++ po/it.po | 5241 ++++++++++++++++ po/ja.po | 5252 ++++++++++++++++ po/ka.po | 4890 +++++++++++++++ po/kk.po | 4854 +++++++++++++++ po/kn.po | 5214 ++++++++++++++++ po/ko.po | 5055 +++++++++++++++ po/ku.po | 5180 ++++++++++++++++ po/la.po | 4876 +++++++++++++++ po/lt.po | 5403 +++++++++++++++++ po/lv.po | 5450 +++++++++++++++++ po/mai.po | 5109 ++++++++++++++++ po/mg.po | 4864 +++++++++++++++ po/mi.po | 4590 ++++++++++++++ po/mk.po | 5084 ++++++++++++++++ po/ml.po | 5401 +++++++++++++++++ po/mn.po | 4826 +++++++++++++++ po/mr.po | 5073 ++++++++++++++++ po/ms.po | 4794 +++++++++++++++ po/nb.po | 5128 ++++++++++++++++ po/nds.po | 4800 +++++++++++++++ po/ne.po | 5049 +++++++++++++++ po/nl.po | 5389 ++++++++++++++++ po/nn.po | 6129 +++++++++++++++++++ po/oc.po | 4946 +++++++++++++++ po/or.po | 5292 ++++++++++++++++ po/pa.po | 5454 +++++++++++++++++ po/pl.po | 5245 ++++++++++++++++ po/ps.po | 4782 +++++++++++++++ po/pt.po | 6335 +++++++++++++++++++ po/pt_BR.po | 5450 +++++++++++++++++ po/ro.po | 5291 ++++++++++++++++ po/ru.po | 5223 ++++++++++++++++ po/rw.po | 5489 +++++++++++++++++ po/si.po | 4934 +++++++++++++++ po/sk.po | 5183 ++++++++++++++++ po/sl.po | 5078 ++++++++++++++++ po/sq.po | 5042 +++++++++++++++ po/sr.po | 6344 +++++++++++++++++++ po/sr@latin.po | 6344 +++++++++++++++++++ po/sv.po | 5350 ++++++++++++++++ po/ta.po | 5241 ++++++++++++++++ po/te.po | 5054 +++++++++++++++ po/th.po | 6166 +++++++++++++++++++ po/tk.po | 4795 +++++++++++++++ po/tr.po | 6170 +++++++++++++++++++ po/uk.po | 5185 ++++++++++++++++ po/vi.po | 4782 +++++++++++++++ po/wa.po | 4720 +++++++++++++++ po/xh.po | 4673 ++++++++++++++ po/zh_CN.po | 5153 ++++++++++++++++ po/zh_HK.po | 5276 ++++++++++++++++ po/zh_TW.po | 5328 ++++++++++++++++ tests/Makefile.am | 28 + tests/document-input-stream.c | 156 + tests/document-loader.c | 251 + tests/document-output-stream.c | 134 + tests/document-saver.c | 735 +++ tests/setup-document-saver.sh | 27 + tests/smart-converter.c | 353 ++ win32/Makefile.am | 4 + win32/README | 17 + win32/build-installer.sh | 260 + win32/gedit.iss.in | 60 + win32/querymodules.bat | 3 + 532 files changed, 709826 insertions(+) create mode 100755 AUTHORS create mode 100755 BUGS create mode 100755 COPYING create mode 100755 HACKING create mode 100755 MAINTAINERS create mode 100755 Makefile.am create mode 100755 NEWS create mode 100755 README create mode 100755 autogen.sh create mode 100755 configure.ac create mode 100755 data/Makefile.am create mode 100755 data/gedit-bugreport.sh.in create mode 100755 data/gedit.1 create mode 100755 data/gedit.desktop.in.in create mode 100755 data/gedit.pc.in create mode 100755 data/gedit.schemas.in.in create mode 100644 distro/archlinux/PKGBUILD create mode 100644 distro/archlinux/mate-text-editor.install create mode 100755 distro/ubuntu/build create mode 100755 distro/ubuntu/postinst create mode 100755 distro/ubuntu/postrm create mode 100755 distro/ubuntu/preinst create mode 100755 distro/ubuntu/prerm create mode 100755 docs/Makefile.am create mode 100755 docs/class-diagram.dia create mode 100755 docs/reference/Makefile.am create mode 100755 docs/reference/gedit-docs.sgml create mode 100755 docs/reference/gedit-overrides.txt create mode 100755 docs/reference/gedit-sections.txt create mode 100755 docs/reference/gedit.types create mode 100755 gedit.doap create mode 100755 gedit/Makefile.am create mode 100755 gedit/bacon-message-connection.c create mode 100755 gedit/bacon-message-connection.h create mode 100755 gedit/dialogs/Makefile.am create mode 100755 gedit/dialogs/gedit-close-confirmation-dialog.c create mode 100755 gedit/dialogs/gedit-close-confirmation-dialog.h create mode 100755 gedit/dialogs/gedit-encodings-dialog.c create mode 100755 gedit/dialogs/gedit-encodings-dialog.h create mode 100755 gedit/dialogs/gedit-encodings-dialog.ui create mode 100755 gedit/dialogs/gedit-preferences-dialog.c create mode 100755 gedit/dialogs/gedit-preferences-dialog.h create mode 100755 gedit/dialogs/gedit-preferences-dialog.ui create mode 100755 gedit/dialogs/gedit-search-dialog.c create mode 100755 gedit/dialogs/gedit-search-dialog.h create mode 100755 gedit/dialogs/gedit-search-dialog.ui create mode 100755 gedit/gedit-app.c create mode 100755 gedit/gedit-app.h create mode 100755 gedit/gedit-close-button.c create mode 100755 gedit/gedit-close-button.h create mode 100755 gedit/gedit-commands-documents.c create mode 100755 gedit/gedit-commands-edit.c create mode 100755 gedit/gedit-commands-file-print.c create mode 100755 gedit/gedit-commands-file.c create mode 100755 gedit/gedit-commands-help.c create mode 100755 gedit/gedit-commands-search.c create mode 100755 gedit/gedit-commands-view.c create mode 100755 gedit/gedit-commands.h create mode 100755 gedit/gedit-debug.c create mode 100755 gedit/gedit-debug.h create mode 100755 gedit/gedit-dirs.c create mode 100755 gedit/gedit-dirs.h create mode 100755 gedit/gedit-document-input-stream.c create mode 100755 gedit/gedit-document-input-stream.h create mode 100755 gedit/gedit-document-loader.c create mode 100755 gedit/gedit-document-loader.h create mode 100755 gedit/gedit-document-output-stream.c create mode 100755 gedit/gedit-document-output-stream.h create mode 100755 gedit/gedit-document-saver.c create mode 100755 gedit/gedit-document-saver.h create mode 100755 gedit/gedit-document.c create mode 100755 gedit/gedit-document.h create mode 100755 gedit/gedit-documents-panel.c create mode 100755 gedit/gedit-documents-panel.h create mode 100755 gedit/gedit-encodings-combo-box.c create mode 100755 gedit/gedit-encodings-combo-box.h create mode 100755 gedit/gedit-encodings.c create mode 100755 gedit/gedit-encodings.h create mode 100755 gedit/gedit-enum-types.c.template create mode 100755 gedit/gedit-enum-types.h.template create mode 100755 gedit/gedit-file-chooser-dialog.c create mode 100755 gedit/gedit-file-chooser-dialog.h create mode 100755 gedit/gedit-gio-document-loader.c create mode 100755 gedit/gedit-gio-document-loader.h create mode 100755 gedit/gedit-gio-document-saver.c create mode 100755 gedit/gedit-gio-document-saver.h create mode 100755 gedit/gedit-help.c create mode 100755 gedit/gedit-help.h create mode 100755 gedit/gedit-history-entry.c create mode 100755 gedit/gedit-history-entry.h create mode 100755 gedit/gedit-io-error-message-area.c create mode 100755 gedit/gedit-io-error-message-area.h create mode 100755 gedit/gedit-language-manager.c create mode 100755 gedit/gedit-language-manager.h create mode 100755 gedit/gedit-marshal.list create mode 100755 gedit/gedit-message-area.c create mode 100755 gedit/gedit-message-area.h create mode 100755 gedit/gedit-message-bus.c create mode 100755 gedit/gedit-message-bus.h create mode 100755 gedit/gedit-message-type.c create mode 100755 gedit/gedit-message-type.h create mode 100755 gedit/gedit-message.c create mode 100755 gedit/gedit-message.h create mode 100755 gedit/gedit-metadata-manager.c create mode 100755 gedit/gedit-metadata-manager.h create mode 100755 gedit/gedit-notebook.c create mode 100755 gedit/gedit-notebook.h create mode 100755 gedit/gedit-object-module.c create mode 100755 gedit/gedit-object-module.h create mode 100755 gedit/gedit-panel.c create mode 100755 gedit/gedit-panel.h create mode 100755 gedit/gedit-plugin-info-priv.h create mode 100755 gedit/gedit-plugin-info.c create mode 100755 gedit/gedit-plugin-info.h create mode 100755 gedit/gedit-plugin-loader.c create mode 100755 gedit/gedit-plugin-loader.h create mode 100755 gedit/gedit-plugin-manager.c create mode 100755 gedit/gedit-plugin-manager.h create mode 100755 gedit/gedit-plugin.c create mode 100755 gedit/gedit-plugin.h create mode 100755 gedit/gedit-plugins-engine.c create mode 100755 gedit/gedit-plugins-engine.h create mode 100755 gedit/gedit-prefs-manager-app.c create mode 100755 gedit/gedit-prefs-manager-app.h create mode 100755 gedit/gedit-prefs-manager-private.h create mode 100755 gedit/gedit-prefs-manager.c create mode 100755 gedit/gedit-prefs-manager.h create mode 100755 gedit/gedit-print-job.c create mode 100755 gedit/gedit-print-job.h create mode 100755 gedit/gedit-print-preferences.ui create mode 100755 gedit/gedit-print-preview.c create mode 100755 gedit/gedit-print-preview.h create mode 100755 gedit/gedit-progress-message-area.c create mode 100755 gedit/gedit-progress-message-area.h create mode 100755 gedit/gedit-session.c create mode 100755 gedit/gedit-session.h create mode 100755 gedit/gedit-smart-charset-converter.c create mode 100755 gedit/gedit-smart-charset-converter.h create mode 100755 gedit/gedit-spinner.c create mode 100755 gedit/gedit-spinner.h create mode 100755 gedit/gedit-status-combo-box.c create mode 100755 gedit/gedit-status-combo-box.h create mode 100755 gedit/gedit-statusbar.c create mode 100755 gedit/gedit-statusbar.h create mode 100755 gedit/gedit-style-scheme-manager.c create mode 100755 gedit/gedit-style-scheme-manager.h create mode 100755 gedit/gedit-tab-label.c create mode 100755 gedit/gedit-tab-label.h create mode 100755 gedit/gedit-tab.c create mode 100755 gedit/gedit-tab.h create mode 100755 gedit/gedit-ui.h create mode 100755 gedit/gedit-ui.xml create mode 100755 gedit/gedit-utils.c create mode 100755 gedit/gedit-utils.h create mode 100755 gedit/gedit-view.c create mode 100755 gedit/gedit-view.h create mode 100755 gedit/gedit-window-private.h create mode 100755 gedit/gedit-window.c create mode 100755 gedit/gedit-window.h create mode 100755 gedit/gedit.c create mode 100755 gedit/gedit.rc create mode 100755 gedit/gedittextregion.c create mode 100755 gedit/gedittextregion.h create mode 100755 gedit/osx/Makefile.am create mode 100755 gedit/osx/gedit-osx-delegate.h create mode 100755 gedit/osx/gedit-osx-delegate.m create mode 100755 gedit/osx/gedit-osx.c create mode 100755 gedit/osx/gedit-osx.h create mode 100755 gedit/smclient/Makefile.am create mode 100755 gedit/smclient/eggdesktopfile.c create mode 100755 gedit/smclient/eggdesktopfile.h create mode 100755 gedit/smclient/eggsmclient-osx.c create mode 100755 gedit/smclient/eggsmclient-private.h create mode 100755 gedit/smclient/eggsmclient-win32.c create mode 100755 gedit/smclient/eggsmclient-xsmp.c create mode 100755 gedit/smclient/eggsmclient.c create mode 100755 gedit/smclient/eggsmclient.h create mode 100755 help/C/figures/gedit_format_bold.png create mode 100755 help/C/figures/gedit_format_italic.png create mode 100755 help/C/figures/gedit_format_strikethrough.png create mode 100755 help/C/figures/gedit_format_underline.png create mode 100755 help/C/figures/gedit_recent_files_menu_icon.png create mode 100755 help/C/figures/gedit_window.png create mode 100755 help/C/gedit.xml create mode 100755 help/C/legal.xml create mode 100755 help/Makefile.am create mode 100755 help/ar/ar.po create mode 100755 help/bg/bg.po create mode 100755 help/bg/figures/gedit_window.png create mode 100755 help/ca/ca.po create mode 100755 help/ca/figures/gedit_window.png create mode 100755 help/cs/cs.po create mode 100755 help/cs/figures/gedit_window.png create mode 100755 help/da/da.po create mode 100755 help/de/de.po create mode 100755 help/de/figures/gedit_window.png create mode 100755 help/el/el.po create mode 100755 help/el/figures/gedit_window.png create mode 100755 help/es/es.po create mode 100755 help/es/figures/gedit_window.png create mode 100755 help/fi/fi.po create mode 100755 help/fi/figures/gedit_window.png create mode 100755 help/fr/figures/gedit_recent_files_menu_icon.png create mode 100755 help/fr/figures/gedit_window.png create mode 100755 help/fr/fr.po create mode 100755 help/gedit.omf.in create mode 100755 help/hu/hu.po create mode 100755 help/it/figures/gedit_window.png create mode 100755 help/it/it.po create mode 100755 help/ja/figures/gedit_window.png create mode 100755 help/ja/ja.po create mode 100755 help/ko/figures/gedit_window.png create mode 100755 help/ko/ko.po create mode 100755 help/oc/oc.po create mode 100755 help/pt_BR/pt_BR.po create mode 100755 help/ru/ru.po create mode 100755 help/sv/figures/gedit_window.png create mode 100755 help/sv/sv.po create mode 100755 help/th/th.po create mode 100755 help/uk/figures/gedit_window.png create mode 100755 help/uk/uk.po create mode 100755 help/zh_CN/figures/gedit_window.png create mode 100755 help/zh_CN/zh_CN.po create mode 100755 help/zh_HK/figures/gedit_window.png create mode 100755 help/zh_HK/zh_HK.po create mode 100755 help/zh_TW/figures/gedit_window.png create mode 100755 help/zh_TW/zh_TW.po create mode 100755 osx/Info.plist.in create mode 100755 osx/Makefile.am create mode 100755 pixmaps/Makefile.am create mode 100755 pixmaps/gedit-logo.png create mode 100755 pixmaps/gedit-plugin.png create mode 100755 pixmaps/gedit.ico create mode 100755 plugin-loaders/Makefile.am create mode 100755 plugin-loaders/c/Makefile.am create mode 100755 plugin-loaders/c/gedit-plugin-loader-c.c create mode 100755 plugin-loaders/c/gedit-plugin-loader-c.h create mode 100755 plugin-loaders/python/Makefile.am create mode 100755 plugin-loaders/python/bindings/Makefile.am create mode 100755 plugin-loaders/python/bindings/gedit.defs create mode 100755 plugin-loaders/python/bindings/gedit.override create mode 100755 plugin-loaders/python/bindings/geditcommands.defs create mode 100755 plugin-loaders/python/bindings/geditcommands.override create mode 100755 plugin-loaders/python/bindings/geditmessage.override create mode 100755 plugin-loaders/python/bindings/geditplugin.override create mode 100755 plugin-loaders/python/bindings/geditutils.defs create mode 100755 plugin-loaders/python/bindings/geditutils.override create mode 100755 plugin-loaders/python/gedit-plugin-loader-python.c create mode 100755 plugin-loaders/python/gedit-plugin-loader-python.h create mode 100755 plugin-loaders/python/gedit-plugin-python.c create mode 100755 plugin-loaders/python/gedit-plugin-python.h create mode 100755 plugins/Makefile.am create mode 100755 plugins/changecase/Makefile.am create mode 100755 plugins/changecase/changecase.gedit-plugin.desktop.in create mode 100755 plugins/changecase/gedit-changecase-plugin.c create mode 100755 plugins/changecase/gedit-changecase-plugin.h create mode 100755 plugins/checkupdate/Makefile.am create mode 100755 plugins/checkupdate/checkupdate.gedit-plugin.desktop.in create mode 100755 plugins/checkupdate/gedit-check-update-plugin.c create mode 100755 plugins/checkupdate/gedit-check-update-plugin.h create mode 100755 plugins/checkupdate/gedit-check-update.schemas.in create mode 100755 plugins/docinfo/Makefile.am create mode 100755 plugins/docinfo/docinfo.gedit-plugin.desktop.in create mode 100755 plugins/docinfo/docinfo.ui create mode 100755 plugins/docinfo/gedit-docinfo-plugin.c create mode 100755 plugins/docinfo/gedit-docinfo-plugin.h create mode 100755 plugins/externaltools/Makefile.am create mode 100755 plugins/externaltools/data/Makefile.am create mode 100755 plugins/externaltools/data/build.desktop.in create mode 100755 plugins/externaltools/data/build.tool.in create mode 100755 plugins/externaltools/data/open-terminal-here-osx.desktop.in create mode 100755 plugins/externaltools/data/open-terminal-here-osx.tool.in create mode 100755 plugins/externaltools/data/open-terminal-here.desktop.in create mode 100755 plugins/externaltools/data/open-terminal-here.tool.in create mode 100755 plugins/externaltools/data/remove-trailing-spaces.desktop.in create mode 100755 plugins/externaltools/data/remove-trailing-spaces.tool.in create mode 100755 plugins/externaltools/data/run-command.desktop.in create mode 100755 plugins/externaltools/data/run-command.tool.in create mode 100755 plugins/externaltools/externaltools.gedit-plugin.desktop.in create mode 100755 plugins/externaltools/scripts/Makefile.am create mode 100755 plugins/externaltools/scripts/gedit-tool-merge.pl create mode 100755 plugins/externaltools/tools/Makefile.am create mode 100755 plugins/externaltools/tools/__init__.py create mode 100755 plugins/externaltools/tools/capture.py create mode 100755 plugins/externaltools/tools/filelookup.py create mode 100755 plugins/externaltools/tools/functions.py create mode 100755 plugins/externaltools/tools/library.py create mode 100755 plugins/externaltools/tools/linkparsing.py create mode 100755 plugins/externaltools/tools/manager.py create mode 100755 plugins/externaltools/tools/outputpanel.py create mode 100755 plugins/externaltools/tools/outputpanel.ui create mode 100755 plugins/externaltools/tools/tools.ui create mode 100755 plugins/filebrowser/Makefile.am create mode 100755 plugins/filebrowser/filebrowser.gedit-plugin.desktop.in create mode 100755 plugins/filebrowser/gedit-file-bookmarks-store.c create mode 100755 plugins/filebrowser/gedit-file-bookmarks-store.h create mode 100755 plugins/filebrowser/gedit-file-browser-enum-register.c.template create mode 100755 plugins/filebrowser/gedit-file-browser-enum-types.c.template create mode 100755 plugins/filebrowser/gedit-file-browser-enum-types.h.template create mode 100755 plugins/filebrowser/gedit-file-browser-error.h create mode 100755 plugins/filebrowser/gedit-file-browser-marshal.list create mode 100755 plugins/filebrowser/gedit-file-browser-messages.c create mode 100755 plugins/filebrowser/gedit-file-browser-messages.h create mode 100755 plugins/filebrowser/gedit-file-browser-plugin.c create mode 100755 plugins/filebrowser/gedit-file-browser-plugin.h create mode 100755 plugins/filebrowser/gedit-file-browser-store.c create mode 100755 plugins/filebrowser/gedit-file-browser-store.h create mode 100755 plugins/filebrowser/gedit-file-browser-utils.c create mode 100755 plugins/filebrowser/gedit-file-browser-utils.h create mode 100755 plugins/filebrowser/gedit-file-browser-view.c create mode 100755 plugins/filebrowser/gedit-file-browser-view.h create mode 100755 plugins/filebrowser/gedit-file-browser-widget-ui.xml create mode 100755 plugins/filebrowser/gedit-file-browser-widget.c create mode 100755 plugins/filebrowser/gedit-file-browser-widget.h create mode 100755 plugins/filebrowser/gedit-file-browser.schemas.in create mode 100755 plugins/modelines/Makefile.am create mode 100755 plugins/modelines/gedit-modeline-plugin.c create mode 100755 plugins/modelines/gedit-modeline-plugin.h create mode 100755 plugins/modelines/language-mappings create mode 100755 plugins/modelines/modeline-parser.c create mode 100755 plugins/modelines/modeline-parser.h create mode 100755 plugins/modelines/modelines.gedit-plugin.desktop.in create mode 100755 plugins/pythonconsole/Makefile.am create mode 100755 plugins/pythonconsole/pythonconsole.gedit-plugin.desktop.in create mode 100755 plugins/pythonconsole/pythonconsole/Makefile.am create mode 100755 plugins/pythonconsole/pythonconsole/__init__.py create mode 100755 plugins/pythonconsole/pythonconsole/config.py create mode 100755 plugins/pythonconsole/pythonconsole/config.ui create mode 100755 plugins/pythonconsole/pythonconsole/console.py create mode 100755 plugins/quickopen/Makefile.am create mode 100755 plugins/quickopen/quickopen.gedit-plugin.desktop.in create mode 100755 plugins/quickopen/quickopen/Makefile.am create mode 100755 plugins/quickopen/quickopen/__init__.py create mode 100755 plugins/quickopen/quickopen/popup.py create mode 100755 plugins/quickopen/quickopen/virtualdirs.py create mode 100755 plugins/quickopen/quickopen/windowhelper.py create mode 100755 plugins/snippets/Makefile.am create mode 100755 plugins/snippets/data/Makefile.am create mode 100755 plugins/snippets/data/c.xml create mode 100755 plugins/snippets/data/chdr.xml create mode 100755 plugins/snippets/data/cpp.xml create mode 100755 plugins/snippets/data/css.xml create mode 100755 plugins/snippets/data/docbook.xml create mode 100755 plugins/snippets/data/fortran.xml create mode 100755 plugins/snippets/data/global.xml create mode 100755 plugins/snippets/data/haskell.xml create mode 100755 plugins/snippets/data/html.xml create mode 100755 plugins/snippets/data/idl.xml create mode 100755 plugins/snippets/data/java.xml create mode 100755 plugins/snippets/data/javascript.xml create mode 100755 plugins/snippets/data/lang/Makefile.am create mode 100755 plugins/snippets/data/lang/snippets.lang create mode 100755 plugins/snippets/data/latex.xml create mode 100755 plugins/snippets/data/mallard.xml create mode 100755 plugins/snippets/data/perl.xml create mode 100755 plugins/snippets/data/php.xml create mode 100755 plugins/snippets/data/python.xml create mode 100755 plugins/snippets/data/ruby.xml create mode 100755 plugins/snippets/data/sh.xml create mode 100755 plugins/snippets/data/snippets.xml create mode 100755 plugins/snippets/data/tcl.xml create mode 100755 plugins/snippets/data/xml.xml create mode 100755 plugins/snippets/data/xslt.xml create mode 100755 plugins/snippets/snippets.gedit-plugin.desktop.in create mode 100755 plugins/snippets/snippets/Completion.py create mode 100755 plugins/snippets/snippets/Document.py create mode 100755 plugins/snippets/snippets/Exporter.py create mode 100755 plugins/snippets/snippets/Helper.py create mode 100755 plugins/snippets/snippets/Importer.py create mode 100755 plugins/snippets/snippets/LanguageManager.py create mode 100755 plugins/snippets/snippets/Library.py create mode 100755 plugins/snippets/snippets/Makefile.am create mode 100755 plugins/snippets/snippets/Manager.py create mode 100755 plugins/snippets/snippets/Parser.py create mode 100755 plugins/snippets/snippets/Placeholder.py create mode 100755 plugins/snippets/snippets/Snippet.py create mode 100755 plugins/snippets/snippets/SubstitutionParser.py create mode 100755 plugins/snippets/snippets/WindowHelper.py create mode 100755 plugins/snippets/snippets/__init__.py create mode 100755 plugins/snippets/snippets/snippets.ui create mode 100755 plugins/sort/Makefile.am create mode 100755 plugins/sort/gedit-sort-plugin.c create mode 100755 plugins/sort/gedit-sort-plugin.h create mode 100755 plugins/sort/sort.gedit-plugin.desktop.in create mode 100755 plugins/sort/sort.ui create mode 100755 plugins/spell/Makefile.am create mode 100755 plugins/spell/gedit-automatic-spell-checker.c create mode 100755 plugins/spell/gedit-automatic-spell-checker.h create mode 100755 plugins/spell/gedit-spell-checker-dialog.c create mode 100755 plugins/spell/gedit-spell-checker-dialog.h create mode 100755 plugins/spell/gedit-spell-checker-language.c create mode 100755 plugins/spell/gedit-spell-checker-language.h create mode 100755 plugins/spell/gedit-spell-checker.c create mode 100755 plugins/spell/gedit-spell-checker.h create mode 100755 plugins/spell/gedit-spell-language-dialog.c create mode 100755 plugins/spell/gedit-spell-language-dialog.h create mode 100755 plugins/spell/gedit-spell-marshal.list create mode 100755 plugins/spell/gedit-spell-plugin.c create mode 100755 plugins/spell/gedit-spell-plugin.h create mode 100755 plugins/spell/gedit-spell-utils.c create mode 100755 plugins/spell/gedit-spell-utils.h create mode 100755 plugins/spell/languages-dialog.ui create mode 100755 plugins/spell/spell-checker.ui create mode 100755 plugins/spell/spell.gedit-plugin.desktop.in create mode 100755 plugins/taglist/HTML.tags.xml.in create mode 100755 plugins/taglist/Latex.tags.xml.in create mode 100755 plugins/taglist/Makefile.am create mode 100755 plugins/taglist/XSLT.tags.xml.in create mode 100755 plugins/taglist/XUL.tags.xml.in create mode 100755 plugins/taglist/gedit-taglist-plugin-panel.c create mode 100755 plugins/taglist/gedit-taglist-plugin-panel.h create mode 100755 plugins/taglist/gedit-taglist-plugin-parser.c create mode 100755 plugins/taglist/gedit-taglist-plugin-parser.h create mode 100755 plugins/taglist/gedit-taglist-plugin.c create mode 100755 plugins/taglist/gedit-taglist-plugin.h create mode 100755 plugins/taglist/taglist.gedit-plugin.desktop.in create mode 100755 plugins/time/Makefile.am create mode 100755 plugins/time/gedit-time-dialog.ui create mode 100755 plugins/time/gedit-time-plugin.c create mode 100755 plugins/time/gedit-time-plugin.h create mode 100755 plugins/time/gedit-time-setup-dialog.ui create mode 100755 plugins/time/time.gedit-plugin.desktop.in create mode 100755 po/LINGUAS create mode 100644 po/Makefile.in.in~ create mode 100755 po/POTFILES.in create mode 100755 po/POTFILES.skip create mode 100755 po/af.po create mode 100755 po/am.po create mode 100755 po/ar.po create mode 100755 po/as.po create mode 100755 po/ast.po create mode 100755 po/az.po create mode 100755 po/be.po create mode 100755 po/be@latin.po create mode 100755 po/bg.po create mode 100755 po/bn.po create mode 100755 po/bn_IN.po create mode 100755 po/br.po create mode 100755 po/bs.po create mode 100755 po/ca.po create mode 100755 po/ca@valencia.po create mode 100755 po/crh.po create mode 100755 po/cs.po create mode 100755 po/cy.po create mode 100755 po/da.po create mode 100755 po/de.po create mode 100755 po/dz.po create mode 100755 po/el.po create mode 100755 po/en@shaw.po create mode 100755 po/en_CA.po create mode 100755 po/en_GB.po create mode 100755 po/eo.po create mode 100755 po/es.po create mode 100755 po/et.po create mode 100755 po/eu.po create mode 100755 po/fa.po create mode 100755 po/fi.po create mode 100755 po/fr.po create mode 100755 po/ga.po create mode 100755 po/gl.po create mode 100755 po/gu.po create mode 100755 po/he.po create mode 100755 po/hi.po create mode 100755 po/hr.po create mode 100755 po/hu.po create mode 100755 po/hy.po create mode 100755 po/id.po create mode 100755 po/is.po create mode 100755 po/it.po create mode 100755 po/ja.po create mode 100755 po/ka.po create mode 100755 po/kk.po create mode 100755 po/kn.po create mode 100755 po/ko.po create mode 100755 po/ku.po create mode 100755 po/la.po create mode 100755 po/lt.po create mode 100755 po/lv.po create mode 100755 po/mai.po create mode 100755 po/mg.po create mode 100755 po/mi.po create mode 100755 po/mk.po create mode 100755 po/ml.po create mode 100755 po/mn.po create mode 100755 po/mr.po create mode 100755 po/ms.po create mode 100755 po/nb.po create mode 100755 po/nds.po create mode 100755 po/ne.po create mode 100755 po/nl.po create mode 100755 po/nn.po create mode 100755 po/oc.po create mode 100755 po/or.po create mode 100755 po/pa.po create mode 100755 po/pl.po create mode 100755 po/ps.po create mode 100755 po/pt.po create mode 100755 po/pt_BR.po create mode 100755 po/ro.po create mode 100755 po/ru.po create mode 100755 po/rw.po create mode 100755 po/si.po create mode 100755 po/sk.po create mode 100755 po/sl.po create mode 100755 po/sq.po create mode 100755 po/sr.po create mode 100755 po/sr@latin.po create mode 100755 po/sv.po create mode 100755 po/ta.po create mode 100755 po/te.po create mode 100755 po/th.po create mode 100755 po/tk.po create mode 100755 po/tr.po create mode 100755 po/uk.po create mode 100755 po/vi.po create mode 100755 po/wa.po create mode 100755 po/xh.po create mode 100755 po/zh_CN.po create mode 100755 po/zh_HK.po create mode 100755 po/zh_TW.po create mode 100755 tests/Makefile.am create mode 100755 tests/document-input-stream.c create mode 100755 tests/document-loader.c create mode 100755 tests/document-output-stream.c create mode 100755 tests/document-saver.c create mode 100755 tests/setup-document-saver.sh create mode 100755 tests/smart-converter.c create mode 100755 win32/Makefile.am create mode 100755 win32/README create mode 100755 win32/build-installer.sh create mode 100755 win32/gedit.iss.in create mode 100755 win32/querymodules.bat diff --git a/AUTHORS b/AUTHORS new file mode 100755 index 00000000..994fb9c5 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,13 @@ +Active authors: + +Paolo Maggi +Paolo Borelli +Steve Frécinaux +Jesse van den Kieboom + +Old contributors: + +Chema Celorio +James Willcox +Federico Mena Quintero + diff --git a/BUGS b/BUGS new file mode 100755 index 00000000..7a3e2154 --- /dev/null +++ b/BUGS @@ -0,0 +1,7 @@ +Search on http://bugzilla.mate.org for a list of known gedit's bug. + +If you find a new bug, please report it at +http://bugzilla.mate.org/enter_bug.cgi?product=gedit. + +Thanks, +Paolo diff --git a/COPYING b/COPYING new file mode 100755 index 00000000..d60c31a9 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/HACKING b/HACKING new file mode 100755 index 00000000..30fbe174 --- /dev/null +++ b/HACKING @@ -0,0 +1,65 @@ +guidelines for gedit +==================== + +gedit source code is maintained using the git version control system +and is available at the following location: + + git://git.mate.org/gedit + +Or if you have an account on MATE servers: + + ssh://USERNAME@git.mate.org/git/gedit + +A Web Interface is available at: + + http://git.mate.org/cgit/gedit + +Please don't commit directly to the git repository unless +you have been given the green light to commit freely to gedit. +When in doubt assume you haven't ;-). + +Please attach patches in bugzilla (http://bugzilla.mate.org). +If the patch fixes a bug that is not reported yet in bugzilla or is +an enhancement, create a new bugreport. + +If you are a translator feel free to mark strings for translation, +fix typos in the code, etc. + +Please send patches for build & configure fixes too. I really appreciate +your help, I just want to review these fixes before applying. + +If you are a "build sheriff", feel free to commit fixes for build and +configure (please, send me an e-mail with the patch you have applied). + +When committing to the gedit git repository make sure to include a +meaningful commit message. Changes without a sufficient commit message +will be reverted. Commit messages should have the following format: + +=== begin example commit === +Short explanation of the commit + +Longer explanation explaining exactly what's changed, whether any +external or private interfaces changed, what bugs were fixed (with bug +tracker reference if applicable) and so forth. Be concise but not too brief. +=== end example commit === + + - Always add a brief description of the commit to the _first_ line of + the commit and terminate by two newlines (it will work without the + second newline, but that is not nice for the interfaces). + + - First line (the brief description) must only be one sentence and + should start with a capital letter unless it starts with a lowercase + symbol or identifier. Don't use a trailing period either. Don't exceed + 72 characters. + + - The main description (the body) is normal prose and should use normal + punctuation and capital letters where appropriate. Normally, for patches + sent to a mailing list it's copied from there. + + - When committing code on behalf of others use the --author option, e.g. + git commit -a --author "Joe Coder " and --signoff. + + +Thanks, + + The gedit team. diff --git a/MAINTAINERS b/MAINTAINERS new file mode 100755 index 00000000..20a87acc --- /dev/null +++ b/MAINTAINERS @@ -0,0 +1,12 @@ +Paolo Borelli +E-mail: pborelli@gnome.org +Userid: pborelli + +Paolo Maggi +E-mail: paolo@gnome.org +Userid: paolo + +Jesse van den Kieboom +E-mail: jessevdk@gnome.org +Userid: jessevdk + diff --git a/Makefile.am b/Makefile.am new file mode 100755 index 00000000..b288648a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,75 @@ +## Process this file with automake to produce Makefile.in +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = gedit pixmaps po data plugin-loaders plugins docs tests win32 osx + +if !OS_OSX +SUBDIRS += help +endif + +distuninstallcheck_listfiles = find . -type f -print | grep -v scrollkeeper + +EXTRA_DIST = \ + BUGS \ + ChangeLog-20011116 \ + ChangeLog-20051212 \ + ChangeLog-20090418 \ + HACKING \ + MAINTAINERS \ + gedit.doap \ + xmldocs.make \ + omf.make \ + mate-doc-utils.make \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in + +DISTCLEANFILES = \ + mate-doc-utils.make \ + intltool-extract \ + intltool-merge \ + intltool-update + +MAINTAINERCLEANFILES = \ + aclocal.m4 \ + config.guess \ + config.h.in \ + config.sub \ + depcomp \ + gtk-doc.make \ + install-sh \ + ltmain.sh \ + missing \ + mkinstalldirs \ + omf.make \ + py-compile \ + xmldocs.make \ + m4/mate-doc-utils.m4 \ + m4/gtk-doc.m4 \ + m4/intltool.m4 \ + m4/libtool.m4 \ + m4/ltoptions.m4 \ + m4/ltsugar.m4 \ + m4/ltversion.m4 \ + m4/lt~obsolete.m4 \ + `find "$(srcdir)" -type f -name Makefile.in -print` + +DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc + +CHANGELOG_START = GEDIT_2_26_1 + +dist-hook: + @if test -d "$(srcdir)/.git"; \ + then \ + echo Creating ChangeLog && \ + (GIT_DIR=$(top_srcdir)/.git \ + ./missing --run git log $(CHANGELOG_START)^^.. --stat -M -C --name-status --date=short --no-color) | \ + fmt --split-only > ChangeLog.tmp \ + && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ + || ( rm -f ChangeLog.tmp ; \ + echo Failed to generate ChangeLog >&2 ); \ + else \ + echo A git clone is required to generate a ChangeLog >&2; \ + fi + +-include $(top_srcdir)/git.mk diff --git a/NEWS b/NEWS new file mode 100755 index 00000000..dda2bf2a --- /dev/null +++ b/NEWS @@ -0,0 +1,1350 @@ +============ +gedit 2.30.4 +============ + +New Features and Fixes +====================== +- Add mallard snippets (Paul Cutler) + +New and updated translations +============================ +- ca (Carles Ferrando Garcia) +- cs (Marek Černocký) +- de (Mario Blättermann) +- el (Michael Kotsarinis) +- es (Jorge González) +- fr (Claude Paroz) +- he (Yaron Shahrabani) +- hu (Gabor Kelemen) +- id (Andika Triwidada) +- ja (Hideki Yamane (Debian-JP)) +- kk (Baurzhan Muftakhidinov) +- kn (Shankar Prasad) +- zh_CN (du baodao) +- zh_CN (朱涛) + + +============ +gedit 2.30.3 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- ca (Gil Forcada) +- ca@valencia (Gil Forcada) +- de (Mario Blättermann) +- et (Ivar Smolin) +- fi (Tommi Vainikainen) +- hu (Gabor Kelemen) +- kn (Shankar Prasad) +- or (Manoj Kumar Giri) +- th (Kittiphong Meesawat) +- uk (Maxim Dziumanenko) + + +============ +gedit 2.30.2 +============ + +New Features and Fixes +====================== +- Fix cut and paste typo that broke syntax detection (Jesse van den Kieboom) + + +============ +gedit 2.30.1 +============ + +New Features and Fixes +====================== +- Properly handle encoding conversion errors when saving (Jesse van den Kieboom) +- New logo (Henry Peters) +- Misc bugfixes + +New and updated translations +============================ +- ast (Xandru Armesto) +- bn_IN (Runa Bhattacharjee) +- crh (Reşat SABIQ) +- cs (Petr Kovar) +- hu (Gabor Kelemen) +- id (Andika Triwidada) +- ko (Changwoo Ryu) +- nl (Hannie Dumoleyn) +- ro (Adi Roiban) +- ru (Alexander Saprykin) +- th (Kittiphong Meesawat) + + +============ +gedit 2.30.0 +============ + +New Features and Fixes +====================== +- Fix a crash in the new file saving code (Paolo Borelli) +- Misc bugfixes + +New and updated translations +============================ +- bn (Sadia Afroz) +- ca (Gil Forcada) +- crh (Reşat SABIQ) +- cs (Marek Černocký) +- da (Ask Hjorth Larsen) +- el (Kostas Papadimas) +- et (Mattias Põldaru) +- eu (Iñaki Larrañaga Murgoitio) +- fi (Tommi Vainikainen) +- hu (Gabor Kelemen) +- ja (Hideki Yamane (Debian-JP)) +- ko (Changwoo Ryu) +- lt (Gintautas Miliauskas) +- lv (Rūdolfs Mazurs) +- ml ("Last-Translator: \n") +- pt (Duarte Loreto) +- ro (Adi Roiban) +- ru (Alexander Saprykin) +- zh_CN (Eleanor Chen) + + +============ +gedit 2.29.9 +============ + +New Features and Fixes +====================== +- Fix a file corruption bug in the new file saving code (Paolo Borelli) +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- bg (Krasimir Chonov) +- de (Hendrik Richter) +- en_GB (Philip Withnall) +- eu (Iñaki Larrañaga Murgoitio) +- fr (Claude Paroz) +- gl (Antón Méixome) +- hu (Gabor Kelemen) +- it (Milo Casagrande) +- nb (Kjartan Maraas) +- pa (A S Alam) +- pt_BR (Og Maciel) +- ru (Leonid Kanter) +- sr@latin (Goran Rakić) +- sr (Горан Ракић) +- sv (Daniel Nylander) +- ta (Dr,T,Vasudevan) +- uk (Maxim Dziumanenko) + + +============ +gedit 2.29.8 +============ + +New Features and Fixes +====================== +- Rework encoding validation (Paolo Borelli) +- Misc bugfixes + +New and updated translations +============================ +- bg (Krasimir Chonov) +- de (Mario Blättermann) +- en_GB (Bruce Cowan) +- es (Jorge González) +- fr (Claude Paroz) +- gl (Fran Diéguez) +- he (Liel Fridman) +- nb (Kjartan Maraas) +- nn (Torstein Adolf Winterseth) +- pl (Piotr Drąg) +- sl (Matej Urbančič) +- zh_HK (Chao-Hsiung Liao) +- zh_TW (Chao-Hsiung Liao) + + +============ +gedit 2.29.7 +============ + +New Features and Fixes +====================== +- Many string fixes (Philip Withnall) +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- cs (Petr Kovar) +- de (Mario Blättermann) +- en_GB (Philip Withnall) +- es (Jorge González) +- et (Mattias Põldaru) +- fr (Claude Paroz) +- gl (Fran Diéguez) +- nb (Kjartan Maraas) +- pt_BR (Vladimir Melo) +- ro (Adi Roiban) +- sl (Matej Urbančič) +- ta (Dr,T,Vasudevan) +- zh_HK (Chao-Hsiung Liao) +- zh_TW (Chao-Hsiung Liao) + + +============ +gedit 2.29.6 +============ + +New Features and Fixes +====================== +- Add "Open" to the filebrowser context menu (Paolo Borelli) +- Add option to ignore a version until the next is released + in the checkupdate plugin (Ignacio Casal Quinteiro) +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- bg (Alexander Shopov) +- de (Christian Kirbach) +- es (Jorge González) +- et (Mattias Põldaru) +- pt_BR (Henrique P. Machado) +- sl (Matej Urbančič) +- zh_HK (Chao-Hsiung Liao) +- zh_TW (Chao-Hsiung Liao) + +============ +gedit 2.29.5 +============ + +New Features and Fixes +====================== +- Rework file saving and file loading to always use gio and take + advantage of gio stream converters to perform encoding conversion + and manage line terminators (Ignacio Casal Quinteiro, + Jesse van den Kieboom, Paolo Borelli) +- Experimental python support on win32 (Ignacio Casal Quinteiro) +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- bg (Alexander Shopov) +- bn (Sadia Afroz) +- es (Jorge González) +- fr (Claude Paroz) +- nb (Kjartan Maraas) +- ta (Dr,T,Vasudevan) + + +============ +gedit 2.29.4 +============ + +New Features and Fixes +====================== +- Several refactorings (Paolo Borelli) +- Don't check words that are marked no-spell-check (Jesse van den Kieboom) +- Tools outputpanel refactored (Per Arneng) +- Added support for platform specific tools (Jesse van den Kieboom) +- Improved menu integration and several fixes on OS X (Jesse van den Kieboom) +- Add xslt and html snippets (Paolo Borelli) +- Remember autospell per document (Ignacio Casal Quinteiro) +- Misc bugfixes + +New and updated translations +============================ +- cs (Marek Černocký) +- et (Mattias Põldaru) +- hu (Gabor Kelemen) +- nds (Nils-Christoph Fiedler) +- ro (Adi Roiban) +- sv (Daniel Nylander) +- uk (Maxim Dziumanenko) +- zh_CN (樊栖江(Fan Qijiang)) + +============ +gedit 2.29.3 +============ + +New Features and Fixes +====================== +- Use gio metadata system +- Misc bugfixes + +New and updated translations +============================ +- el (Nikos Charonitakis) + +============ +gedit 2.29.2 +============ + +New Features and Fixes +====================== +- Order hidden files after normal files on filebrowser (Jesse van den Kieboom) +- Removed indent plugin, this is now supported by gtksourceview (Jesse van den Kieboom) +- Implemented file open support on OS X (Jesse van den Kieboom) +- Fixed OS X native vs X11 built (Jesse van den Kieboom) +- Basic mac OS X integration (Jesse van den Kieboom) +- Use GtkSpinner instead of GeditSpinner (Ignacio Casal Quinteiro) +- Misc bugfixes + +New and updated translations +============================ +- crh (Reşat SABIQ) +- en@shaw (Thomas Thurman) +- es (Jorge González) +- lv (Rūdolfs Mazurs) +- ro (Adi Roiban) +- sl (Matej Urbančič) +- ta (Dr,T,Vasudevan) +- th (อาคม โชติพันธวานนท์) +- th (Theppitak Karoonboonyanan) +- zh_CN (樊栖江(Fan Qijiang)) + +============ +gedit 2.29.1 +============ + +New Features and Fixes +====================== +- Use the new completion framework in the snippets plugin (Jesse van den Kieboom) +- Misc bugfixes + +New and updated translations +============================ +- br (Denis ARNAUD) +- ca (Gil Forcada) +- sl (Matej Urbančič) +- zh_CN (Richard Ma) + +============ +gedit 2.28.0 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- as (Amitakhya Phukan) +- bg (Alexander Shopov) +- bn_IN (Runa Bhattacharjee) +- br (Denis Arnaud) +- ca (Gil Forcada) +- cs (Jiri Eischmann) +- da (Ask H. Larsen) +- en_GB (Philip Withnall) +- et (Ivar Smolin) +- fi (Tommi Vainikainen) +- gl (Antón Méixome) +- gu (Sweta Kothari) +- hi (Rajesh Ranjan) +- kn (Shankar Prasad) +- lt (Gintautas Miliauskas) +- mai (Sangeeta Kumari) +- ml (Ani) +- mr (Sandeep Shedmake) +- nb (Kjartan Maraas) +- or (Manoj Kumar Giri) +- pa (A S Alam) +- pt_BR (Carlos José Pereira) +- ro (Adi Roiban) +- sl (Matej Urbančič) +- sr (Miloš Popović) +- ta (ifelix) +- te (krishnababu k) +- tr (Baris Cicek) +- uk (Maxim V. Dziumanenko) +- zh_HK (Chao-Hsiung Liao) +- zh_TW (Chao-Hsiung Liao) + + +============ +gedit 2.27.6 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- bn_IN (Runa Bhattacharjee) +- bn (Maruf Ovee) +- br (Denis Arnaud) +- cs (Jiri Eischmann) +- de (Mario Blättermann) +- el (Μάριος Ζηντίλης) +- es (Jorge González) +- et (Ivar Smolin) +- eu (Iñaki Larrañaga Murgoitio) +- fr (Claude Paroz) +- gu (Sweta Kothari) +- hu (Gabor Kelemen) +- it (Milo Casagrande) +- kn (Shankar Prasad) +- ko (Changwoo Ryu) +- nb (Kjartan Maraas) +- pl (Tomasz Dominikowski) +- pt_BR (Fábio Nogueira) +- pt_BR (Rodrigo L. M. Flores) +- pt (Duarte Loreto) +- sr@latin (Goran Rakić) +- sr (Горан Ракић) +- sv (Daniel Nylander) +- ta (I. Felix) +- tr (Baris Cicek) +- zh_HK (Chao-Hsiung Liao) +- zh_TW (Chao-Hsiung Liao) + + +============ +gedit 2.27.5 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- bg (Yavor Doganov) +- br (Denis Arnaud) +- ca (Gil Forcada) +- ca@valencia (Carles Ferrando Garcia) +- eo (Jacob Nordfalk) +- es (Jorge González) +- et (Ivar Smolin) +- fi (Tommi Vainikainen) +- gl (Antón Méixome) +- pl (Piotr Drąg) +- pt_BR (André Gondim) +- ro (Lucian Adrian Grijincu) +- sv (Daniel Nylander) +- th (Akom C.) + + +============ +gedit 2.27.4 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- cy (Iestyn Pryce) +- de (Christian Kirbach) +- es (Jorge González) +- et (Ivar Smolin) +- ga (Seán de Búrca) +- nb (Kjartan Maraas) +- ta (Dr.T.Vasudevan) + + +============ +gedit 2.27.3 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- cs (Marek Černocký) +- cs (Petr Kovar) +- de (Mario Blättermann) +- es (Jorge González) +- et (Ivar Smolin) +- gl (Antón Méixome) +- gu (Sweta Kothari) +- pt_BR (César Veiga) +- sv (Daniel Nylander) +- ta (Dr.T.Vasudevan) +- uk (wanderlust) + + +============ +gedit 2.27.2 +============ + +New Features and Fixes +====================== +- New Check Update plugin (Ignacio Casal Quinteiro) +- Remember the search dialog position (Ignacio Casal Quinteiro) +- Do not append the final endline for empty files (Paolo Borelli) +- Mac osx dmg package (Jesse van den Kieboom) +- Misc bugfixes + +New and updated translations +============================ +- ca (Gil Forcada) +- da (Kenneth Nielsen) +- es (Jorge González) +- et (Ivar Smolin) +- eu (Iñaki Larrañaga Murgoitio) +- ml (Praveen Arimbrathodiyil) +- nb (Kjartan Maraas) + + +============ +gedit 2.27.1 +============ + +New Features and Fixes +====================== +- Remove the mmap document loader (Paolo Borelli) +- Remove open location dialog and sample plugin (Paolo Borelli) +- Added public API for document saving (Jesse van den Kieboom) +- Put external tools in a submenu (Jesse van den Kieboom) +- Added language support for external tools (Jesse van den Kieboom) +- Implemented asynchronous reading and writing on external tools (Jesse van den Kieboom) +- Add Quick Open plugin (Jesse van den Kieboom) +- Misc bugfixes + +New and updated translations +============================ +- bn (Runa Bhattacharjee) +- es (Jorge González) +- fr (Claude Paroz) +- id (Mohammad DAMT) +- ta (Dr.T.Vaasudevan) + + +============ +gedit 2.26.2 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- ar (Khaled Hosny) +- ca (Joan Duran) +- el (Michael Kotsarinis) +- es (Jorge González) +- et (Mattias Põldaru) +- zh_CN (TeliuTe) + + +============ +gedit 2.26.1 +============ + +New Features and Fixes +====================== +- Ensure plugins are resident modules (Paolo Borelli) +- Add Fortran 95 snippets (Jens Domke) +- Misc bugfixes + +New and updated translations +============================ +- Jorge Gonzalez (es) +- Miloš Popović (sr) +- Osama Khalid (ar) +- Raivis Dejus (lv) +- Reşat SABIQ (crh) +- Shankar Prasad (kn) +- Takeshi AIHANA (ja) +- Thanos Lefteris (el) + + +============ +gedit 2.26.0 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- Amitakhya Phukan (as) +- Gintautas Miliauskas (lt) +- I. Felix (ta) +- Ignacio Casal Quinteiro (gl) +- Jennie Petoumenou (el) +- Krishnababu K (te) +- Manoj Kumar Giri (or) +- Rajesh Ranjan (hi) +- Runa Bhattacharjee (bn_IN) +- Yuriy Penkin (ru) + + +============ +gedit 2.25.8 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- Baris Cicek (tr) +- Claude Paroz (fr) +- Duarte Loreto (pt) +- Gabor Kelemen (hu) +- Jesse van den Kieboom (nl) +- Mattias Põldaru (et) +- Milo Casagrande (it) +- Philip Withnall (en_GB) +- Rajesh Ranjan (hi) +- Rajesh Ranjan (mai) +- Sandeep Shedmake (mr) +- Sweta Kothari (gu) +- Takeshi AIHANA (ja) +- Theppitak Karoonboonyanan (th) + + +============ +gedit 2.25.7 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- Adi Roiban (ro) +- Alexander Shopov (bg) +- Chao-Hsiung Liao (zh_HK) +- Chao-Hsiung Liao (zh_TW) +- Clytie Siddall (vi) +- Duarte Loreto (pt) +- Ihar Hrachyshka (be@latin) +- Inaki Larranaga Murgoitio (eu) +- Kenneth Nielsen (da) +- Mikel González (ast) +- Sweta Kothari (gu) +- Tomasz Dominikowski (pl) +- Wouter Bolsterlee (nl) + + +============ +gedit 2.25.6 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- Andre Gondim (pt_BR) +- Andre Klapper (de) +- Changwoo Ryu (ko) +- Christian Kirbach (de) +- Gabor Kelemen (hu) +- Gil Forcada (ca) +- Raivis DEjus (lv) +- Yair Hershkovitz (he) +- 甘露(Gan Lu) (zh_CN.po) + + +============ +gedit 2.25.5 +============ + +New Features and Fixes +====================== +- Add Fullscreen Mode (Ignacio Casal Quinteiro) +- Add a configuration dialog for the python console (B. Clausius) +- Rescan plugins when opening the preference dialog (Ignacio Casal Quinteiro) +- Misc bugfixes + +New and updated translations +============================ +- Daniel Nylander (sv) +- Ilkka Tuohela (fi) +- Ivar Smolin (et) +- Joan Duran (ca) +- Jorge Gonzalez (es) +- Kamil Paral (cs) +- Kjartan Maraas (nb) +- Marcel Telka (sk) +- Petr Kovar (cs) +- Shankar Prasad (kn) +- Theppitak Karoonboonyanan (th) + + +============ +gedit 2.25.4 +============ + +New Features and Fixes +====================== +- Add quick syntax highlightig and tab width selection in the statusbar (Jesse van den Kieboom) +- More work on the internal bus system (Jesse van den Kieboom) +- Bugfixes and features for the snippets plugin (Jesse van den Kieboom) +- Parse syntax highlighting language from modelines (Sergej Chodarev) +- Misc bugfixes + +New and updated translations +============================ +- César Veiga (pt_BR) +- Jorge Gonzalez (es) + + +============ +gedit 2.25.3 +============ + +New Features and Fixes +====================== +- Win32 port with installer (Ignacio Casal Quinteiro) +- Internal bus system to allow plugin intercomminication (Jesse van den Kieboom) +- Use GtkSourceView to detect language highlighting (Paolo Borelli) +- Misc bugfixes + +New and updated translations +============================ +- Jorge Gonzalez (es) +- Theppitak Karoonboonyanan (th) +- Alexander Shopov (bg) +- Claude Paroz (fr) + + +============ +gedit 2.25.2 +============ + +New Features and Fixes +====================== +- Fixes to the new plugin system (Paolo Borelli) + +New and updated translations +============================ +- Daniel Nylander (sv) + + +============ +gedit 2.25.1 +============ + +New Features and Fixes +====================== +- Rework the plugin system to have loaders as shared objects (Jesse van den Kieboom) +- Fix build on OSX (Jesse van den Kieboom) + +New and updated translations +============================ +- Jorge Gonzalez (es) +- Yuriy Penkin (ru) + + +============ +gedit 2.24.2 +============ + +New Features and Fixes +====================== +- Fix icon lookup in the filebrowser plugin (Jesse van den Kieboom) +- Allow to move to a line relative to the current line (Ignacio Casal Quinteiro) +- Misc bugfixes + +New and updated translations +============================ +- Ignacio Casal Quinteiro (gl) +- Leonardo Ferreira Fontenelle (pt_BR) +- Rafael Garcia (la) + + +============ +gedit 2.24.1 +============ + +New Features and Fixes +====================== +- Fix performance problem with large dirs in the filebrowser + plugin (Paolo Borelli, Jesse van den Kieboom) +- Misc bugfixes + +New and updated translations +============================ +- Robert Sedak (hr) +- Anas Afif Emad (ar) +- Ask H. Larsen (da) +- Vladimir Melo (pt_BR) + + +============ +gedit 2.24.0 +============ + +New and updated translations +============================ +- Anas Afif Emad (ar) +- I. Felix (ta) +- Ivar Smolin (et) +- Jiri Eischmann (cs) +- Kenneth Nielsen (da) +- Konstantinos Kouratoras (el) +- Mişu Moldovan (ro) +- Tomasz Dominikowski (pl) +- Yuriy Penkin (ru) + + +============= +gedit 2.23.92 +============= + +New Features and Fixes +====================== +- Revert a workaround for a gvfs bug that has now been fixed (Paolo Borelli) + +New and updated translations +============================ +- Alexander Shopov (bg) +- Baris Cicek (tr) +- Changwoo Ryu (ko) +- Christian Kirbach (de) +- Gabor Kelemen (hu) +- Gil Forcada (ca) +- Gintautas Miliauskas (lt) +- Hendrik Richter (de) +- Khaled Hosny (ar) +- Laurent Dhima (sq) +- Milo Casagrande (it) +- Miloš Popović (sr) +- Pema Geyleg (dz) +- Praveen Arimbrathodiyil (ml) +- Robert Sedak (hr) +- Sandeep Shedmake (mr) +- Vladimir Melo (pt_BR) + + +============= +gedit 2.23.92 +============= + +New Features and Fixes +====================== +- Bugfixes related to the gio port (Jesse van den Kieboom, Paolo Borelli) + +New and updated translations +============================ +- Duarte Loreto (pt) +- Funda Wang (zh_CN) +- Laurent Dhima (sq) +- Nguyễn Thái Ngọc Duy (vi) +- Philip Withnall (en_GB) +- Praveen Arimbrathodiyil (ml) +- Robert Sedak (hr) +- Runa Bhattacharjee (bn_IN) +- Seán de Búrca (ga) +- Sweta Kothari (gu.po) +- Wouter Bolsterlee (nl) + + +============= +gedit 2.23.91 +============= + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- Arangel Angov (mk) +- Chao-Hsiung Liao (zh_HK) +- Chao-Hsiung Liao (zh_TW) +- Daniel Nylander (sv) +- Fábio Nogueira, Vladimir Melo (pt_BR) +- Goran Rakic (sr@latin) +- Ilkka Tuohela (fi) +- Inaki Larranaga Murgoitio (eu) +- Ivar Smolin (et) +- Jorge Gonzalez (es) +- Kjartan Maraas (nb) +- Manoj Kumar Giri (or) +- Robert-André Mauchin (fr) +- Seán de Búrca (ga) +- Shankar Prasad (kn) +- Sweta Kothari (gu) +- Takeshi AIHANA (ja) +- Theppitak Karoonboonyanan (th) + + +============= +gedit 2.23.90 +============= + +New Features and Fixes +====================== +- Misc bugfixes related to the gio migration (Jesse van den Kieboom) + +New and updated translations +============================ +- Ignacio Casal Quinteiro (gl) +- Jorge Gonzalez (es) +- Takeshi AIHANA (ja) +- Christian Kirbach (de) +- Ivar Smolin (et) +- Kjartan Maraas (nb) +- Gil Forcada (ca) +- Ilkka Tuohela (fi) +- Runa Bhattacharjee (bn_IN) + + +============ +gedit 2.23.2 +============ + +New Features and Fixes +====================== +- remove libmate dependency, use eggsmclient for XSMP support (Johan Dahlin, Dan Winship) + +============ +gedit 2.23.2 +============ + +New Features and Fixes +====================== +- Port to gio/vfs, remove mate-vfs dependency (Jesse van den Kieboom) +- Port to gtkbuilder, remove libglade dependency (Jesse van den Kieboom) + +New and updated translations +============================ +- Andre Klapper (de) +- Clytie Siddall (vi) +- Daniel Nylander (sv) +- Djihed Afifi (ar) +- Duarte Loreto (pt) +- Fábio Nogueira (pt_BR) +- Gabor Kelemen (hu) +- Gil Forcada (ca) +- Ignacio Casal Quinteiro (gl) +- Ilkka Tuohela (fi) +- Inaki Larranaga Murgoitio (eu) +- Ivar Smolin (et) +- Jorge Gonzalez (es) +- Khaled Hosny (ar) +- Leonardo Ferreira Fontenelle (pt_BR) +- Luca Ferretti (it) +- Máté Őry (hu) +- Philipp Kerling (de) +- Rajesh Ranjan (mai) +- Sweta Kothari (gu) +- Theppitak Karoonboonyanan (th) +- Wouter Bolsterlee (nl) +- Yair Hershkovitz (he) +- Yannig Marchegay (oc) +- Zabeeh Khan (ps) + + +============ +gedit 2.23.1 +============ + +New Features and Fixes +====================== +- port the filebrowser plugin to gio/gvfs (Mikael Hermansson, Jesse van den Kieboom) +- start porting internals to gio/gvfs (Paolo Borelli) +- rework some of the python plugins core code (Steve Frécinaux) + +New and updated translations +============================ +- Jorge Gonzalez (es) +- Claude Paroz (fr) +- Kjartan Maraas (nb) +- Jiri Eischmann (cs) +- Yavor Doganov (bg) + + +============ +gedit 2.22.1 +============ + +New Features and Fixes +====================== +- Make Ctrl+D delete the current line +- Misc bugfixes + +New and updated translations +============================ +- Yair Hershkovitz (he) +- Philip Withnall (en_GB.po) +- Ivar Smolin (et) +- Artur Flinta (pl) +- Claude Paroz (fr) +- Praveen Arimbrathodiyil (ml) +- Jorge Gonzalez (es) + + +============ +gedit 2.22.0 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- Ankit Patel (gu) +- Baris Cicek (tr) +- Changwoo Ryu (ko) +- Djihed Afifi (ar) +- Duarte Loreto (pt) +- Friedel Wolff (af) +- Gabor Kelemen (hu) +- Gintautas Miliauskas (lt) +- Guntupalli Karunakar (hi) +- Ivar Smolin (et) +- Jiri Eischmann (cs) +- Jorge Gonzalez (es) +- Kostas Papadimas (el) +- Luca Ferretti (it) +- Maxim Dziumanenko (uk) +- Rahul Bhalerao (mr) +- Runa Bhattacharjee (bn_IN) +- Stéphane Raimbault (fr) +- Yuri Kozlov (ru) + + +============ +gedit 2.21.2 +============ + +New Features and Fixes +====================== +- Misc bugfixes + +New and updated translations +============================ +- Arangel Angov (mk) +- Artur Flinta (pl) +- Chao-Hsiung Liao (zh_HK) +- Chao-Hsiung Liao (zh_TW) +- Claude Paroz (fr) +- Daniel Nylander (sv) +- David Lodge (en_GB) +- Djihed Afifi (ar) +- Duarte Loreto (pt) +- Gil Forcada (ca) +- Hendrik Brandt (de) +- Ignacio Casal Quinteiro (gl) +- Ihar Hrachyshka (be@latin) +- Ilkka Tuohela (fi) +- Inaki Larranaga Murgoitio (eu) +- Ivar Smolin (et) +- Jiri Eischmann (cs) +- Jonh Wendell (pt_BR) +- Jorge Gonzalez (es) +- Kenneth Nielsen (da) +- Kjartan Maraas (nb) +- Luca Ferretti (it) +- Mark Krapviner (he) +- Nikos Charonitakis (el) +- Pawan Chitrakar (ne) +- Sandeep Shedmake (mr) +- Takeshi AIHANA (ja) +- Theppitak Karoonboonyanan (th) +- Wouter Bolsterlee (nl) +- Yannig Marchegay (oc) + + +============ +gedit 2.21.1 +============ + +New Features and Fixes +====================== +- Reimplemented printing using GtkPrint and remove libmateprint[ui] + dependency (Paolo Maggi, Paolo Borelli) +- Improvements to the plugin system code (Steve Frécinaux) +- Handle viewports as well as workspaces (Steve Frécinaux) +- Misc bugfixes + +New and updated translations +============================ +- Alexander Shopov (bg) +- Amitakhya Phukan (as) +- Andre Klapper (de) +- Ani Peter (ml) +- Clytie Siddall (vi) +- Gabor Kelemen (hu) +- Ignacio Casal Quinteiro (gl) +- Ilkka Tuohela (fi) +- Inaki Larranaga Murgoitio (eu) +- Ivar Smolin (et) +- Kjartan Maraas (nb) +- Krishna Babu K (te) +- Matej Urbančič (sl) +- Og Maciel (pt_BR) +- Seán de Búrca (ga) +- Shankar Prasad (kn) +- Sohaib Afifi (ar) +- Takeshi AIHANA (ja) +- Yair Hershkovitz (he) +- Yannig Marchegay (oc) + + +============ +gedit 2.20.3 +============ + +New Features and Fixes +====================== +- Properly preserve file permissions and ownership when saving (Paolo Borelli) + +New and updated translations +============================ +- Gabor Kelemen (hu) +- Ivar Smolin (et) + + +============ +gedit 2.20.2 +============ + +New Features and Fixes +====================== +- Fix tools loading in External Tools plugin (Curtis Hovey) +- Fix crash when gtksourceview doesn't find any highlighting file (Paolo Borelli) +- Misc bugfixes + +New and updated translations +============================ + +- Aleś Navicki (be@latin) +- Alexander Shopov (bg) +- Ankit Patel (gu) +- Claude Paroz (fr) +- Daniel Nylander (sv) +- Duarte Loreto (pt) +- Gintautas Miliauskas (lt) +- Ignacio Casal Quinteiro (gl) +- Ihar Hrachyshka (be) +- Ilkka Tuohela (fi) +- Jorge Gonzalez (es) +- Kenneth Nielsen (da) +- Milo Casagrande (it) +- Rhys Jones (cy) +- Tino Meinen (nl) + + +============ +gedit 2.20.1 +============ + +New Features and Fixes +====================== +- Fix crash with invalid taglist file in taglist plugin (Paolo Borelli) +- Fix slash-escaping in the find dialog history (Paolo Borelli) +- Support .hidden file in the file browser plugin (Paolo Borelli) +- Bugfixes to the snippet plugin (Paolo Borelli, Jesse van den Kieboom) + +New and updated translations +============================ +- Baris Cicek (tr) +- Gintautas Miliauskas (lt) +- Takeshi AIHANA (ja) +- Vincent van Adrighem (nl) + + +============ +gedit 2.20.0 +============ + +New and updated translations +============================ +- Alexander Shopov (bg) +- Artur Flinta (pl) +- Gabor Kelemen (hu) +- Gintautas Miliauskas (lt) +- Hendrik Richter (de) +- Jamil Ahmed (bn) +- Jorge Gonzalez (es) +- Kiran Chandra (te) +- Laurent Dhima (sq) +- Maxim Dziumanenko (uk) +- Nickolay V. Shmyrev (ru) +- Shankar Prasad (kn) +- Sohaib Afifi (ar) +- Yannig Marchegay (oc) + + +============= +gedit 2.19.92 +============= + +New Features and Fixes +====================== +- Fix themeing of the message areas with new GTK+ (Ignacio Casal Quinteiro) +- Misc bugfixes + +New and updated translations +============================ +- Ani Peter (ml) +- Clytie Siddall (vi) +- Duarte Loreto (pt) +- Gabor Kelemen (hu) +- Goran Rakić (sr.po, sr@Latn) +- Inaki Larranaga Murgoitio (eu) +- Ivar Smolin (et) +- Josep Puigdemont i Casamajó (ca) +- Jovan Naumovski (mk) +- Kenneth Nielsen (da) +- Kjartan Maraas (nb) +- Milo Casagrande (it) +- Og Maciel (pt_BR) +- Rajesh Ranjan (hi) +- Takeshi AIHANA (ja) +- Tirumurthi Vasudevan (ta) + + +============= +gedit 2.19.91 +============= + +New Features and Fixes +====================== +- Escape slashes when selecting text to search (Paolo Maggi) +- Support indent-width setting in modeline (Paolo Borelli) +- Adapt to the latest GtkSourceView changes (Paolo M., Paolo B.) +- Misc bugfixes + +New and updated translations +============================ +- Ani Peter (ml) +- Ankit Patel (gu) +- Funda Wang (zh_CN) +- Gabor Kelemen (hu) +- Ivar Smolin (et) +- Jorge Gonzalez (es) +- Josep Puigdemont i Casamajó (ca) +- Stéphane Raimbault (fr) +- Takeshi AIHANA (ja) +- Theppitak Karoonboonyanan (th) +- Young-Ho Cha (ko) + + +============= +gedit 2.19.90 +============= + +New Features and Fixes +====================== +- User Interface to install and uninstall style schemes (Paolo Maggi) +- Make search match color customizable in the style scheme (Paolo M.) +- Tooltips on the document list and tag list (Alexandre Mazari) +- Misc bugfixes + +New and updated translations +============================ +- Ankit Patel (gu) +- Daniel Nylander (sv) +- Danishka Navin (si) +- Hendrik Richter (de) +- Ilkka Tuohela (fi) +- Inaki Larranaga Murgoitio (eu) +- Jorge Gonzalez (es) +- Kjartan Maraas (nb) +- Kostas Papadimas (el) +- Leonardo Ferreira Fontenelle (pt_BR) +- Takeshi AIHANA (ja) +- Theppitak Karoonboonyanan (th) +- Tirumurthi Vasudevan (ta) +- Žygimantas Beručka (lt) + + +============ +gedit 2.19.3 +============ + +New Features and Fixes +====================== +- Remove color settings and syntax highlighting editor from the + preferences dialog and use a style scheme selector (Paolo Borelli, + Paolo Maggi) +- Many improvements to the snippets plugin, notably support for importing + and exporting snippets, support for regex snippets and support for + activating snippets on drag'n'drop (Jesse van den Kieboom) +- Split DocumentLoader and DocumentSaver in abstract class and + subclasses for easier maintainance (Steve Frécinaux) +- Add a mateconf preference for smart-home-end (Paolo Borelli) +- Fix external tool saving bug (Alexandre Mazari) +- Adapt to latest GtkSourceView API changes +- Misc Bugfixes + +New and updated translations +============================ +- Ankit Patel (gu) +- Changwoo Ryu (ko) +- Daniel Nylander (sv) +- Danishka Navin (si) +- Funda Wang (zh_CN) +- Ilkka Tuohela (fi) +- Inaki Larranaga Murgoitio (eu) +- Ivar Smolin (et) +- Jorge Gonzalez (es) +- Luca Ferretti (it) +- Máté Őry (hu) +- Reinout van Schouwen (nl) +- Takeshi AIHANA (ja) +- Theppitak Karoonboonyanan (th) +- Tirumurthi Vasudevan (ta) + + +============ +gedit 2.19.2 +============ + +New Features and Fixes +====================== +- Many improvements and fixes to the snippets plugin, in particular + support regex substitution inside snippet placeholders (Jesse van den Kieboom) +- Add a Document::save signal to notify the start of the saving + operation (Alex Cornejo, Steve Frécinaux) +- Adapt to latest GtkSourceView API changes (Paolo Borelli) +- Misc Bugfixes +- Remove Syntax Highlighting configuration from the preference dialog + since it was a pain to use and needs to be rethought to support + gtksourceview 2 style schemes. + +New and updated translations +============================ +- Changwoo Ryu (ko) +- Clytie Siddall (vi) +- Daniel Nylander (sv) +- Jorge Gonzalez (es) +- Jovan Naumovski (mk) +- Nguyễn Thái Ngọc Duy (vi) + + +============ +gedit 2.19.1 +============ + +New Features and Fixes +====================== +- Port to gtksourceview 2: gedit now depends on gtksourceview 1.90.1 + and on pygtksourceview 1.90.1 (if python plugins are enabled) + This brings to gedit a way more accurate and powerful highlighting + engine. +- Remove Syntax Highlighting configuration from the preference dialog + since it was a pain to use and needs to be rethought to support + gtksourceview 2 style schemes. + + diff --git a/README b/README new file mode 100755 index 00000000..0ffa8f8b --- /dev/null +++ b/README @@ -0,0 +1,135 @@ +General Information +=================== + +This is version 2.30.4 of gedit. gedit is a small and lightweight UTF-8 text +editor for the MATE environment. + +gedit is part of MATE and uses the latest GTK+ and MATE libraries. +Complete MATE integration is featured, with support for Drag and Drop (DnD) +from Caja (the MATE file manager), the use of the MATE help system, +the MATE Virtual File System and the MATE print framework. + +gedit uses a Multiple Document Interface (MDI), which lets you edit more than +one document at the same time. + +gedit supports most standard editing features, plus several not found in your +average text editor (plugins being the most notable of these). + +gedit plugins may also be written in the python scripting language: to enable +python support you need the pygtk and mate-python-desktop bindings. + +Although new features are always under development, currently gedit has: + + * Complete support for UTF-8 text + * Syntax highlighting + * Support for editing remote files + * Search and Replace + * Printing and Print Previewing Support + * File Revert + * A complete preferences interface + * Configurable Plugin system, with optional python support + + +Some of the plugins, packaged and installed with gedit include, among others: + + * Word count + * Spell checker + * Change case of selected text + * File Browser + * Automatic snippet expansion + * Sort + * Insert Date/Time + * External Tools + * Tag list + +Other external plugins are also available. + + +gedit is released under the GNU General Public License (GPL) version 2, see +the file 'COPYING' for more information. + + +The official web site is: + + http://www.gedit.org + +You can download the latest gedit tarball from: + + http://download.mate.org/sources/gedit/ + +Information about gedit mailing lists can be found at + + http://mail.mate.org/mailman/listinfo/gedit-list + + +Installation +============ + +gedit requires GTK+-2.16.x, GtkSourceView 2.4.x and MateConf libraries. +PyGobject 2.12.x, PyGtk 2.12.x and PyGtkSourceView 2.4.x are required to +enable python plugins support. + +Simple install procedure: + + % gzip -cd gedit-2.30.4.tar.gz | tar xvf - # unpack the sources + % cd gedit-2.30.4 # change to the toplevel directory + % ./configure # run the `configure' script + % make # build gedit + [ Become root if necessary ] + % make install # install gedit + +See the file 'INSTALL' for more detailed information. + + +How to report bugs +================== + +Bugs should be reported to the MATE bug tracking system. +(http://bugzilla.mate.org, product gedit). You will need to create an +account for yourself. + +You can also report bugs using the MATE program bug-buddy. + +In the bug report please include: + +* Information about your system. For instance: + + - What operating system and version + - What version of X + - What version of the gtk+, glib and mate libraries + - For Linux, what version of the C library + + And anything else you think is relevant. + +* How to reproduce the bug. + +* If the bug was a crash, the exact text that was printed out when the + crash occurred. + +* Further information such as stack traces may be useful, but is not + necessary. If you do send a stack trace, and the error is an X error, + it will be more useful if the stack trace is produced running the test + program with the --sync command line option. + +See the file 'BUGS' for the list of known bugs. + + +Patches +======= + +Patches should also be submitted to bugzilla.mate.org. If the patch +fixes an existing bug, add the patch as an attachment to that bug +report. + +Otherwise, enter a new bug report that describes the patch, and attach +the patch to that bug report. + +Patches should be in unified diff form. (The -u option to GNU diff.) + +If you are interested in helping us to develop gedit, please see the +file 'AUTHOR' for contact information and/or send a message to the gedit +mailing list. See also the file 'HACKING' for more detailed information. + + + The gedit team. + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000..38168f06 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME=mate-text-editor + +(test -f $srcdir/configure.ac \ + && test -f $srcdir/autogen.sh \ + && test -d $srcdir/gedit \ + && test -f $srcdir/gedit/gedit.c) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +which mate-autogen.sh || { + echo "You need to install mate-common from the MATE CVS" + exit 1 +} + +REQUIRED_AUTOMAKE_VERSION=1.9 MATE_DATADIR="$mate_datadir" USE_COMMON_DOC_BUILD=yes . mate-autogen.sh diff --git a/configure.ac b/configure.ac new file mode 100755 index 00000000..a65cd394 --- /dev/null +++ b/configure.ac @@ -0,0 +1,600 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.63.2) + +m4_define(gedit_major_version, 2011) +m4_define(gedit_minor_version, 10) +m4_define(gedit_micro_version, 26) +m4_define(gedit_version, gedit_major_version.gedit_minor_version.gedit_micro_version) + +AC_INIT([gedit],[gedit_version],[http://bugzilla.mate.org/enter_bug.cgi?product=gedit],[gedit],[http://projects.mate.org/gedit/]) + +AC_CONFIG_HEADERS(config.h) +AC_CONFIG_SRCDIR(gedit/gedit.c) +AC_CONFIG_MACRO_DIR([m4]) + +AC_DEFINE(GEDIT_MAJOR_VERSION, gedit_major_version, [Gedit major version]) +AC_SUBST(GEDIT_MAJOR_VERSION, gedit_major_version) +AC_DEFINE(GEDIT_MINOR_VERSION, gedit_minor_version, [Gedit minor version]) +AC_SUBST(GEDIT_MINOR_VERSION, gedit_minor_version) +AC_DEFINE(GEDIT_MICRO_VERSION, gedit_micro_version, [Gedit micro version]) +AC_SUBST(GEDIT_MICRO_VERSION, gedit_micro_version) + +AM_INIT_AUTOMAKE([1.10 dist-bzip2 no-dist-gzip -Wno-portability]) +AM_MAINTAINER_MODE +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + +# Checks for programs +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_SYS_LARGEFILE +PKG_PROG_PKG_CONFIG +# needed on osx +AC_PROG_OBJC + +# Initialize libtool +LT_PREREQ([2.2.6]) +LT_INIT(disable-static) + +GEDIT_API_VERSION=2.20 +AC_SUBST(GEDIT_API_VERSION) + +AC_PATH_PROG(MATECONFTOOL, mateconftool-2) + +GTK_DOC_CHECK([1.0],[--flavour=no-tmpl]) + +AC_CHECK_FUNC(sigaction) +AC_CHECK_LIB(m, floor) + +dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work +AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4") + +dnl active plugins for gedit.schemas +ACTIVE_PLUGINS="docinfo,modelines,filebrowser,spell,time" +AC_SUBST(ACTIVE_PLUGINS) + +dnl toolbar style for gedit schemas +TOOLBAR_STYLE="GEDIT_TOOLBAR_SYSTEM" +AC_SUBST(TOOLBAR_STYLE) + +dnl check for win32 platform +AC_MSG_CHECKING([for Win32 platform]) +case "$host" in + *-*-mingw*|*-*-cygwin*) + platform_win32=yes + TOOLBAR_STYLE="GEDIT_TOOLBAR_ICONS" + ;; + *) + platform_win32=no + ;; +esac +AC_MSG_RESULT([$platform_win32]) +AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes") + +AC_MSG_CHECKING([for native Win32]) +case "$host" in + *-*-mingw*) + os_win32=yes + AC_CHECK_TOOL(WINDRES, windres) + ACTIVE_PLUGINS="${ACTIVE_PLUGINS},checkupdate" + ;; + *) + os_win32=no + ;; +esac +AC_MSG_RESULT([$os_win32]) +AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes") + +dnl check for osx platform +AC_MSG_CHECKING([for Mac OS X platform]) +case "$host" in + *-*-darwin*) + platform_osx=yes + ;; + *) + platform_osx=no + ;; +esac +AC_MSG_RESULT([$platform_osx]) +AM_CONDITIONAL(PLATFORM_OSX, test "$platform_osx" = "yes") + +dnl check for native osx +gdk_windowing=`$PKG_CONFIG --variable=target gdk-2.0` + +AC_MSG_CHECKING([for native Mac OS X]) +if test "$gdk_windowing" = "quartz"; then + os_osx=yes + ACTIVE_PLUGINS="${ACTIVE_PLUGINS},checkupdate" +else + os_osx=no +fi +AC_MSG_RESULT([$os_osx]) +AM_CONDITIONAL(OS_OSX, test "$os_osx" = "yes") + +if test "$platform_osx" = "yes"; then + AC_DEFINE([PLATFORM_OSX],[1],[Defined if platform is Mac OSX]) +fi + +AC_SUBST(DEFAULT_FONT) +AC_SUBST(DEFAULT_PRINT_FONT) + +if test "$os_osx" = "yes"; then + AC_DEFINE([OS_OSX],[1],[Defined if os is Mac OSX]) + + PKG_CHECK_MODULES(IGE_MAC, ige-mac-integration) + + AC_SUBST(IGE_MAC_CFLAGS) + AC_SUBST(IGE_MAC_LIBS) +fi + +dnl =============================================================== +dnl Expanded dirs +dnl =============================================================== + +# This macro expands DIR and assigns it to RET. +# If DIR is NONE, then it's replaced by DEFAULT. +# Based on AC_DEFINE_DIR +AC_DEFUN([GEDIT_FULLPATH], [ + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_expand=[$]$1 + test "x$ac_expand" = xNONE && ac_expand="[$]$2" + ac_expand=`eval echo [$]ac_expand` + $3=`eval echo [$]ac_expand` +]) + +dnl FULL_LIBEXECDIR is used for X-MATE-Bugzilla-ExtraInfoScript expansion +dnl in data/gedit.desktop.in.in +GEDIT_FULLPATH(libexecdir, NONE, FULL_LIBEXECDIR) +AC_SUBST(FULL_LIBEXECDIR) + +dnl ================================================================ +dnl Gettext stuff. +dnl ================================================================ + +IT_PROG_INTLTOOL([0.40.0]) +AC_SUBST([GETTEXT_PACKAGE], [gedit]) +AM_GNU_GETTEXT_VERSION([0.17]) +AM_GLIB_GNU_GETTEXT +AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME], [Define to the gettext package name.]) + +dnl ================================================================ +dnl Use gvfs metadata or the old xml file store. +dnl ================================================================ + +if test "x$os_osx" != "xno" || test "x$os_win32" != "xno"; then + gvfs_metadata_default="no" +else + gvfs_metadata_default="yes" +fi + +AC_ARG_ENABLE([gvfs-metadata], + AS_HELP_STRING([--enable-gvfs-metadata], [Enable using gvfs to store metadata]), + [enable_gvfs_metadata=$enableval], + [enable_gvfs_metadata=$gvfs_metadata_default]) + +AM_CONDITIONAL(ENABLE_GVFS_METADATA, test "x$enable_gvfs_metadata" != "xno") + +if test "x$enable_gvfs_metadata" != "xno"; then + AC_DEFINE([ENABLE_GVFS_METADATA], [1], [Define to enable using gvfs metadata]) +fi + +dnl ================================================================ +dnl check update plugin +dnl ================================================================ + +AC_ARG_ENABLE([updater], + AS_HELP_STRING([--disable-updater],[Disable check update plugin (default: enabled)]), + [enable_updater=$enableval], + [enable_updater=yes]) + +if test "x$enable_updater" != "xno"; then + PKG_CHECK_MODULES(LIBSOUP, \ + libsoup-2.4, + have_libsoup=yes, + have_libsoup=no) + + if test "x$have_libsoup" = "xyes"; then + if test "x$os_win32" = "xyes"; then + enable_updater=yes + elif test "x$os_osx" = "xyes"; then + enable_updater=yes + else + enable_updater=no + fi + else + enable_updater=no + fi +fi + +AM_CONDITIONAL(ENABLE_UPDATER, test x"$enable_updater" = "xyes") + +dnl ================================================================ +dnl spell plugins checks: enchant and iso-codes +dnl ================================================================ + +ENCHANT_REQUIRED=1.2.0 +ISO_CODES_REQUIRED=0.35 + +AC_ARG_ENABLE([spell], + AS_HELP_STRING([--disable-spell],[Disable spell plugin (default: enabled)]), + [enable_enchant=$enableval], + [enable_enchant=yes]) + +if test "x$enable_enchant" = "xyes" ; then + + PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED, \ + have_enchant=yes, have_enchant=no) + + if test "x$have_enchant" = "xyes"; then + + PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED], + [have_iso_codes=yes],[have_iso_codes=no]) + + if test "x$have_iso_codes" = "xyes"; then + AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains]) + if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \ + $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then + result=yes + else + result=no + have_iso_codes=no + fi + AC_MSG_RESULT([$result]) + fi + + if test "x$have_iso_codes" = "xyes"; then + AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix]) + AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package]) + else + AC_MSG_ERROR([iso-codes is required to build the spell plugin. Use --disable-spell to build without spell plugin.]) + fi + else + enable_enchant=no + AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spell plugin.]) + fi +fi + +AM_CONDITIONAL(ENABLE_ENCHANT, test x"$enable_enchant" = "xyes") + +dnl ================================================================ +dnl libsocket checks - needed for bacon-connection on solaris. +dnl ================================================================ +AC_SEARCH_LIBS(bind, socket) + +dnl ================================================================ +dnl Start of pkg-config checks +dnl ================================================================ + +PKG_CHECK_MODULES(GEDIT, [ + libxml-2.0 >= 2.5.0 + glib-2.0 >= 2.22.0 + gthread-2.0 >= 2.13.0 + gio-2.0 >= 2.23.1 + gtk+-2.0 >= 2.16.0 + gtksourceview-2.0 >= 2.9.7 + mateconf-2.0 >= 1.1.11 +]) + +if test "$os_osx" = "no" && + test "$os_win32" = "no"; then + PKG_CHECK_MODULES(X11, [ + x11 + ]) +else + X11_CFLAGS= + X11_LIBS= +fi + +GEDIT_CFLAGS="$GEDIT_CFLAGS $X11_CFLAGS" +GEDIT_LIBS="$GEDIT_LIBS $X11_LIBS" + +AC_SUBST(GEDIT_CFLAGS) +AC_SUBST(GEDIT_LIBS) + +dnl FIXME: Remove this when removing gedit-message-area + +if $PKG_CONFIG --atleast-version 2.17.1 gtk+-2.0; then + gtkatleast= +else + gtkatleast=no +fi + +AM_CONDITIONAL(BUILD_MESSAGE_AREA, test "$gtkatleast" = "no") + +dnl FIXME: Remove this when removing gedit-spinner + +if $PKG_CONFIG --atleast-version 2.19.0 gtk+-2.0; then + gtkatleast= +else + gtkatleast=no +fi + +AM_CONDITIONAL(BUILD_SPINNER, test "$gtkatleast" = "no") +if test "$gtkatleast" = "no"; then + AC_DEFINE([BUILD_SPINNER],[1],[Whether to use GeditSpinner instead of GtkSpinner]) +fi + +if test "$os_osx" = "no" && + test "$os_win32" = "no"; then + PKG_CHECK_MODULES(EGG_SMCLIENT, [ + sm >= 1.0.0 + ]) +else + EGG_SMCLIENT_CFLAGS= + EGG_SMCLIENT_LIBS= +fi + +AC_SUBST(EGG_SMCLIENT_CFLAGS) +AC_SUBST(EGG_SMCLIENT_LIBS) + +dnl ================================================================ +dnl MateConf related settings +dnl ================================================================ + +AM_MATECONF_SOURCE_2 + +dnl ================================================================ +dnl Python +dnl ================================================================ + +AC_MSG_CHECKING([whether Python support is requested]) +AC_ARG_ENABLE([python], + AS_HELP_STRING([--enable-python],[Enable python support]), + [enable_python=$enableval have_python=$enableval], + [enable_python=autodetect have_python=yes]) +AC_MSG_RESULT([$enable_python]) + +if test "x$have_python" != "xno"; then + AM_PATH_PYTHON([2.5],[],[no]) + if test "x$PYTHON" = "x:"; then + have_python=no + fi +fi + +if test "x$have_python" != "xno"; then + AM_CHECK_PYTHON_HEADERS([],[have_python=no]) +fi + +if test "x$have_python" != "xno"; then + PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'` + PYTHON_LIBS="-lpython$PYTHON_VERSION" + + if test "$os_win32" = yes; then + PYTHON_LIBS=`echo $PYTHON_LIBS | sed 's/\.//g'` + PYTHON_LIB_LOC="-I$PY_EXEC_PREFIX/libs" + PYTHON_CFLAGS="-I$PY_EXEC_PREFIX/include" + PYTHON_EXTRA_LIBS= + else + PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'` + PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config" + PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION" + PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile" + PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` + PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE` + PYTHON_EXTRA_LIBS="$PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS" + fi + AC_SUBST([PYTHON_LIBS]) + AC_SUBST([PYTHON_LIB_LOC]) + AC_SUBST([PYTHON_CFLAGS]) + AC_SUBST([PYTHON_EXTRA_LIBS]) +fi + +if test "x$have_python" != "xyes"; then + if test "x$enable_python" = "xyes"; then + AC_MSG_ERROR([Python not found]) + elif test "x$enable_python" = "xautodetect"; then + enable_python=no + AC_MSG_WARN([Python not found, disabling python support]) + fi +fi + +if test "x$have_python" != "xno"; then + PYGOBJECT_REQUIRED=2.15.4 + PYGTK_REQUIRED=2.12.0 + PYGTKSOURCEVIEW_REQUIRED=2.9.2 + + PKG_CHECK_MODULES([PYGTK], [ + pygobject-2.0 >= $PYGOBJECT_REQUIRED + pygtk-2.0 >= $PYGTK_REQUIRED + pygtksourceview-2.0 >= $PYGTKSOURCEVIEW_REQUIRED], + [], + [ + have_python=no + if test "x$enable_python" = "xyes"; then + AC_MSG_ERROR([$PYGTK_PKG_ERRORS]) + elif test "x$enable_python" = "xautodetect"; then + enable_python=no + AC_MSG_WARN([$PYGTK_PKG_ERRORS]) + AC_MSG_WARN([Disabling python support]) + fi + ]) +fi + +if test "x$have_python" != "xno"; then + AC_MSG_CHECKING([for pygtk defs]) + PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0` + AC_MSG_RESULT([$PYGTK_DEFSDIR]) + + AC_MSG_CHECKING([for pygobject defs]) + PYGOBJECT_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygobject-2.0` + AC_MSG_RESULT([$PYGOBJECT_DEFSDIR]) + + AC_MSG_CHECKING([for pygtk codegen]) + PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py" + AC_MSG_RESULT([$PYGTK_CODEGEN]) + + AC_MSG_CHECKING([for pygtk h2def]) + PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py" + AC_MSG_RESULT([$PYGTK_H2DEF]) + + AC_SUBST([PYGTK_DEFSDIR]) + AC_SUBST([PYGOBJECT_DEFSDIR]) + AC_SUBST([PYGTK_CODEGEN]) + AC_SUBST([PYGTK_H2DEF]) + + dnl Check for -fno-strict-aliasing + FLAGS="-fno-strict-aliasing" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $FLAGS" + AC_MSG_CHECKING([whether [$]CC understands $FLAGS]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[compiler_has_option=yes],[compiler_has_option=no]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT($compiler_has_option) + if test $compiler_has_option = yes; then + NO_STRICT_ALIASING_CFLAGS="$FLAGS" + fi + AC_SUBST([NO_STRICT_ALIASING_CFLAGS]) +fi + +if test "x$have_python" != "xno" -a "x$enable_python" != "xno"; then + enable_python=yes + AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support]) +fi + +AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"]) + +dnl This allows the bug-report script to know whether python has been enabled +AC_SUBST(enable_python) + +dnl ================================================================ +dnl Misc +dnl ================================================================ +AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) +AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums) + +MATE_COMPILE_WARNINGS(yes) + +AC_ARG_ENABLE(deprecations, + [AS_HELP_STRING([--enable-deprecations], + [warn about deprecated usages [default=no]])],, + [enable_deprecations=no]) + +if test "x$enable_deprecations" = "xyes"; then + DISABLE_DEPRECATED_CFLAGS="\ +-DG_DISABLE_DEPRECATED \ +-DGDK_DISABLE_DEPRECATED \ +-DGTK_DISABLE_DEPRECATED \ +-DGDK_PIXBUF_DISABLE_DEPRECATED \ +-DMATE_DISABLE_DEPRECATED" + AC_SUBST(DISABLE_DEPRECATED_CFLAGS) +fi + +# on win32 plugins must be able to resolve all symbols at link time +# so we create a lib +if test "$platform_win32" = yes; then + GEDIT_IMPLIB="-lgedit-$GEDIT_API_VERSION" + PLUGIN_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -Wl,\$(top_builddir)/gedit/libgedit-\$(GEDIT_API_VERSION).a" + LOADER_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -Wl,\$(top_builddir)/gedit/libgedit-\$(GEDIT_API_VERSION).a" + if test "$os_win32" = yes; then + PLUGIN_LIBTOOL_FLAGS="${PLUGIN_LIBTOOL_FLAGS} -mwindows" + LOADER_LIBTOOL_FLAGS="${LOADER_LIBTOOL_FLAGS} -mwindows" + fi +else + GEDIT_IMPLIB="" + PLUGIN_LIBTOOL_FLAGS="-module -avoid-version" + LOADER_LIBTOOL_FLAGS="-module -avoid-version" +fi +AC_SUBST(GEDIT_IMPLIB) +AC_SUBST(PLUGIN_LIBTOOL_FLAGS) +AC_SUBST(LOADER_LIBTOOL_FLAGS) + +GEDIT_PLUGINS_DATA_DIR="$datadir/gedit-2/plugins" +AC_SUBST(GEDIT_PLUGINS_DATA_DIR) + +GEDIT_PLUGINS_LIBS_DIR="$libdir/gedit-2/plugins" +AC_SUBST(GEDIT_PLUGINS_LIBS_DIR) + +MATE_DOC_INIT([0.9.0],, + [AC_MSG_WARN([[mate-doc-utils not found: documentation will not be built.]])]) + +AC_CONFIG_FILES([ +Makefile +data/gedit.desktop.in +data/gedit-bugreport.sh +data/gedit.pc +data/gedit.schemas.in +data/Makefile +docs/Makefile +docs/reference/Makefile +gedit/dialogs/Makefile +gedit/smclient/Makefile +gedit/osx/Makefile +gedit/Makefile +help/Makefile +pixmaps/Makefile +plugin-loaders/Makefile +plugin-loaders/c/Makefile +plugin-loaders/python/Makefile +plugin-loaders/python/bindings/Makefile +plugins/Makefile +plugins/changecase/Makefile +plugins/checkupdate/Makefile +plugins/docinfo/Makefile +plugins/externaltools/data/Makefile +plugins/externaltools/Makefile +plugins/externaltools/scripts/Makefile +plugins/externaltools/tools/Makefile +plugins/filebrowser/Makefile +plugins/modelines/Makefile +plugins/pythonconsole/Makefile +plugins/pythonconsole/pythonconsole/Makefile +plugins/quickopen/Makefile +plugins/quickopen/quickopen/Makefile +plugins/snippets/data/lang/Makefile +plugins/snippets/data/Makefile +plugins/snippets/Makefile +plugins/snippets/snippets/Makefile +plugins/sort/Makefile +plugins/spell/Makefile +plugins/taglist/Makefile +plugins/time/Makefile +po/Makefile.in +tests/Makefile +win32/gedit.iss +win32/Makefile +osx/Info.plist +osx/Makefile]) + +AC_OUTPUT + +echo " + +Configuration: + + Source code location: ${srcdir} + Compiler: ${CC} + Python Plugins Support: $enable_python + Spell Plugin enabled: $enable_enchant + Gvfs metadata enabled: $enable_gvfs_metadata +" + +if expr ${GEDIT_MINOR_VERSION} % 2 > /dev/null; then + stable_version=`expr ${GEDIT_MINOR_VERSION} - 1` + +cat << EOF + *** IMPORTANT *** + +This is an unstable version of gedit. +It is for test purposes only. + +Please, DO NOT use it in a production environment. +It will probably crash and you will lose your data. + +If you are looking for a stable release of gedit, either download +it from: + + http://ftp.mate.org/pub/mate/sources/gedit/2.${stable_version}/ + +Or checkout the mate-${stable_version} branch of the gedit module from: + + git://git.mate.org/gedit + +Thanks, +The gedit team + + *** END OF WARNING *** +EOF + +fi diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100755 index 00000000..0a09ccaf --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,49 @@ +desktopdir = $(datadir)/applications +desktop_in_files = gedit.desktop.in +desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +@INTLTOOL_DESKTOP_RULE@ + +schemasdir = $(MATECONF_SCHEMA_FILE_DIR) +schemas_in_files = gedit.schemas.in +schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) +@INTLTOOL_SCHEMAS_RULE@ + +man_MANS = gedit.1 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = gedit-@GEDIT_API_VERSION@.pc + +gedit-@GEDIT_API_VERSION@.pc: gedit.pc + cp gedit.pc gedit-@GEDIT_API_VERSION@.pc + +bugreportdir = $(libexecdir)/gedit-2 +bugreport_SCRIPTS = gedit-bugreport.sh + +if MATECONF_SCHEMAS_INSTALL +install-data-local: + if test -z "$(DESTDIR)" ; then \ + for p in $(schemas_DATA) ; do \ + MATECONF_CONFIG_SOURCE=$(MATECONF_SCHEMA_CONFIG_SOURCE) $(MATECONFTOOL) --makefile-install-rule $(top_builddir)/data/$$p ; \ + done \ + fi +else +install-data-local: +endif + +EXTRA_DIST = \ + $(desktop_in_files) \ + $(schemas_in_files) \ + gedit.schemas.in.in \ + $(man_MANS) \ + gedit.pc.in \ + gedit-bugreport.sh.in + +CLEANFILES = \ + $(desktop_DATA) \ + $(schemas_DATA) \ + $(pkgconfig_DATA) + + + + +-include $(top_srcdir)/git.mk diff --git a/data/gedit-bugreport.sh.in b/data/gedit-bugreport.sh.in new file mode 100755 index 00000000..24ee6a48 --- /dev/null +++ b/data/gedit-bugreport.sh.in @@ -0,0 +1,73 @@ +#!/bin/sh + +ENABLE_PYTHON=@enable_python@ + +PKG_CONFIG_MODULES="glib-2.0 gtk+-2.0 gtksourceview-2.0 \ + pygobject-2.0 pygtk-2.0 \ + pygtksourceview-2.0 enchant iso-codes" + +echo_padded () +{ + echo -n " - $1 " + N=$(echo -n $1 | wc -m) + while test $N -le 20 + do + echo -n " " + N=`expr $N + 1` + done +} + +#if (which mateconftool-2 >/dev/null) +#then +# echo "MateConf configuration dump:" +# mateconftool-2 --dump /apps/gedit-2 | grep -Ev " /dev/null) +then + for i in $PKG_CONFIG_MODULES + do + echo_padded "`echo -n $i | sed -r -e 's/^(.*)-[0-9]\.[0-9]$/\1/'`" + pkg-config --modversion $i 2>/dev/null || echo + done +else + echo " pkg-config unavailable" +fi +echo + +echo "Python module versions:" +if test "$ENABLE_PYTHON" = "yes" +then + echo_padded "python" + python -V 2>&1 | cut -c8- + + echo_padded "pygtk" + python -c "import gtk, sys; \ + sys.stdout.write('%d.%d.%d ' % gtk.pygtk_version); \ + sys.stdout.write('(GTK+ %d.%d.%d)' % gtk.gtk_version)" \ + 2>/dev/null + echo +else + echo " Python support was not enabled at compile time." +fi +echo + diff --git a/data/gedit.1 b/data/gedit.1 new file mode 100755 index 00000000..8a1e87c9 --- /dev/null +++ b/data/gedit.1 @@ -0,0 +1,76 @@ +.TH GEDIT 1 "24 Apr 2006" +.SH NAME +\fBgedit\fP \- text editor for the MATE Desktop + +.SH SYNOPSIS +.B gedit +[\fIOPTION\fR]... [\fIFILE\fR]... +.SH DESCRIPTION +.B gedit +is the official text editor of the MATE desktop environment. + +While aiming at simplicity and ease of use, +.B gedit +is a powerful general purpose text editor. +It can be used to create and edit all kinds of text files. + +.B gedit +features a flexible plugin system which can be used to dynamically add +new advanced features to +.B gedit +itself. +.LP +.SH OPTIONS + +.TP +\fB\-\-help\fR +Prints the command line options. +.TP +\fB\-\-encoding\fR +Set the character encoding to be used for opening the files listed on the command line". +.TP +\fB\-\-new\-window\fR +Create a new toplevel window in an existing instance of +.B gedit. +.TP +\fB\-\-new\-document\fR +Create a new document in an existing instance of +.B gedit. +.TP +\fB+[num]\fR +For the first file, go to the line specified by "num" (do not insert a space between the "+" sign and the number). +If "num" is missing, go to the last line. +.TP +\fBfilename(s)...\fR +Specifies the file to open when +.B gedit +starts. If this is not specified, +.B gedit +will load a blank file with an "Unsaved Document" label. Multiple files can be loaded if they are +separated by spaces. +.B gedit +also supports handling of remote files. For example, you can pass the location +of a webpage to +.B gedit, +like "http://www.mate.org", or load a file from a FTP server, +like "ftp://ftp.mate.org/robots.txt". +.TP +\fB\-\-list-encodings\fR +Display list of possible values for the encoding option and exit +.TP +\fB\-\-version\fR +Output version information and exit + +.SH BUGS +If you find a bug, please report it at http://bugzilla.mate.org/enter_bug.cgi?product=gedit. +.SH AUTHORS +Paolo Maggi (paolo@gnome.org) +.TP +Paolo Borelli (pborelli@katamail.com) +.TP +James Willcox (jwillcox@gnome.org) +.TP +Federico Mena Quintero (federico@novell.com) +.TP +Chema Celorio + diff --git a/data/gedit.desktop.in.in b/data/gedit.desktop.in.in new file mode 100755 index 00000000..a8c456e2 --- /dev/null +++ b/data/gedit.desktop.in.in @@ -0,0 +1,18 @@ +[Desktop Entry] +_Name=gedit +_GenericName=Text Editor +_Comment=Edit text files +Exec=gedit %U +Terminal=false +Type=Application +StartupNotify=true +MimeType=text/plain; +Icon=accessories-text-editor +Categories=MATE;GTK;Utility;TextEditor; +X-MATE-DocPath=gedit/gedit.xml +_X-MATE-FullName=gedit Text Editor +X-MATE-Bugzilla-Bugzilla=MATE +X-MATE-Bugzilla-Product=gedit +X-MATE-Bugzilla-Component=general +X-MATE-Bugzilla-Version=@VERSION@ +X-MATE-Bugzilla-ExtraInfoScript=@FULL_LIBEXECDIR@/gedit-2/gedit-bugreport.sh diff --git a/data/gedit.pc.in b/data/gedit.pc.in new file mode 100755 index 00000000..78a3f1e6 --- /dev/null +++ b/data/gedit.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: gedit +Description: gedit +Requires: gtksourceview-2.0 +Version: @VERSION@ +Cflags: -I${includedir}/gedit-@GEDIT_API_VERSION@ +Libs: -L${libdir} @GEDIT_IMPLIB@ diff --git a/data/gedit.schemas.in.in b/data/gedit.schemas.in.in new file mode 100755 index 00000000..62bd4f84 --- /dev/null +++ b/data/gedit.schemas.in.in @@ -0,0 +1,537 @@ + + + + /schemas/apps/gedit-2/preferences/editor/font/use_default_font + /apps/gedit-2/preferences/editor/font/use_default_font + gedit + bool + TRUE + + Use Default Font + Whether to use the system's default fixed width font for editing + text instead of a font specific to gedit. If this option is turned + off, then the font named in the "Editor Font" option will be + used instead of the system font. + + + + + /schemas/apps/gedit-2/preferences/editor/font/editor_font + /apps/gedit-2/preferences/editor/font/editor_font + gedit + string + + Monospace 12 + Editor Font + A custom font that will be used for the editing area. + This will only take effect if the "Use Default Font" option is + turned off. + + + + + /schemas/apps/gedit-2/preferences/editor/colors/scheme + /apps/gedit-2/preferences/editor/colors/scheme + gedit + string + classic + + Style Scheme + The ID of a GtkSourceView Style Scheme used to + color the text. + + + + + /schemas/apps/gedit-2/preferences/editor/save/create_backup_copy + /apps/gedit-2/preferences/editor/save/create_backup_copy + gedit + bool + FALSE + + Create Backup Copies + Whether gedit should create backup copies for the files + it saves. You can set the backup file extension with the + "Backup Copy Extension" option. + + + + + /schemas/apps/gedit-2/preferences/editor/save/auto_save + /apps/gedit-2/preferences/editor/save/auto_save + gedit + bool + FALSE + + Autosave + Whether gedit should automatically save modified files + after a time interval. You can set the time interval with the + "Autosave Interval" option. + + + + + /schemas/apps/gedit-2/preferences/editor/save/auto_save_interval + /apps/gedit-2/preferences/editor/save/auto_save_interval + gedit + int + 10 + + Autosave Interval + Number of minutes after which gedit will automatically + save modified files. This will only take effect if the "Autosave" + option is turned on. + + + + + /schemas/apps/gedit-2/preferences/editor/undo/undo_actions_limit + /apps/gedit-2/preferences/editor/undo/undo_actions_limit + gedit + int + 25 + + Undo Actions Limit (DEPRECATED) + Maximum number of actions that gedit will be able to + undo or redo. Use "-1" for unlimited number of actions. + Deprecated since 2.12.0 + + + + + /schemas/apps/gedit-2/preferences/editor/undo/max_undo_actions + /apps/gedit-2/preferences/editor/undo/max_undo_actions + gedit + int + 2000 + + Maximum Number of Undo Actions + Maximum number of actions that gedit will be able to + undo or redo. Use "-1" for unlimited number of actions. + + + + + /schemas/apps/gedit-2/preferences/editor/wrap_mode/wrap_mode + /apps/gedit-2/preferences/editor/wrap_mode/wrap_mode + gedit + string + GTK_WRAP_WORD + + Line Wrapping Mode + Specifies how to wrap long lines in the editing area. + Use "GTK_WRAP_NONE" for no wrapping, "GTK_WRAP_WORD" for + wrapping at word boundaries, and "GTK_WRAP_CHAR" for wrapping + at individual character boundaries. Note that the values are + case-sensitive, so make sure they appear exactly as mentioned + here. + + + + + /schemas/apps/gedit-2/preferences/editor/tabs/tabs_size + /apps/gedit-2/preferences/editor/tabs/tabs_size + gedit + int + 8 + + Tab Size + Specifies the number of spaces that should be displayed + instead of Tab characters. + + + + + /schemas/apps/gedit-2/preferences/editor/tabs/insert_spaces + /apps/gedit-2/preferences/editor/tabs/insert_spaces + gedit + bool + FALSE + + Insert spaces + Whether gedit should insert spaces instead of tabs. + + + + + /schemas/apps/gedit-2/preferences/editor/auto_indent/auto_indent + /apps/gedit-2/preferences/editor/auto_indent/auto_indent + gedit + bool + FALSE + + Automatic indent + Whether gedit should enable automatic indentation. + + + + + /schemas/apps/gedit-2/preferences/editor/line_numbers/display_line_numbers + /apps/gedit-2/preferences/editor/line_numbers/display_line_numbers + gedit + bool + FALSE + + Display Line Numbers + Whether gedit should display line numbers in the editing + area. + + + + + /schemas/apps/gedit-2/preferences/editor/current_line/highlight_current_line + /apps/gedit-2/preferences/editor/current_line/highlight_current_line + gedit + bool + FALSE + + Highlight Current Line + Whether gedit should highlight the current line. + + + + + /schemas/apps/gedit-2/preferences/editor/bracket_matching/bracket_matching + /apps/gedit-2/preferences/editor/bracket_matching/bracket_matching + gedit + bool + FALSE + + Highlight Matching Bracket + Whether gedit should highlight the bracket matching the selected one. + + + + + /schemas/apps/gedit-2/preferences/editor/right_margin/display_right_margin + /apps/gedit-2/preferences/editor/right_margin/display_right_margin + gedit + bool + FALSE + + Display Right Margin + Whether gedit should display the right margin in the editing + area. + + + + + /schemas/apps/gedit-2/preferences/editor/right_margin/right_margin_position + /apps/gedit-2/preferences/editor/right_margin/right_margin_position + gedit + int + 80 + + Right Margin Position + Specifies the position of the right margin. + + + + + /schemas/apps/gedit-2/preferences/editor/smart_home_end/smart_home_end + /apps/gedit-2/preferences/editor/smart_home_end/smart_home_end + gedit + string + after + + Smart Home End + Specifies how the cursor moves when the HOME and END keys + are pressed. Use "DISABLED" to always move at the start/end of + the line, "AFTER" to move to the start/end of the line the first + time the keys are pressed and to the start/end of the text ignoring + whitespaces the second time the keys are pressed, "BEFORE" to + move to the start/end of the text before moving to the start/end + of the line and "ALWAYS" to always move to the start/end of the + text instead of the start/end of the line. + + + + + /schemas/apps/gedit-2/preferences/ui/toolbar/toolbar_visible + /apps/gedit-2/preferences/ui/toolbar/toolbar_visible + gedit + bool + TRUE + + Toolbar is Visible + Whether the toolbar should be visible in editing windows. + + + + + /schemas/apps/gedit-2/preferences/ui/toolbar/toolbar_buttons_style + /apps/gedit-2/preferences/ui/toolbar/toolbar_buttons_style + gedit + string + @TOOLBAR_STYLE@ + + Toolbar Buttons Style + Style for the toolbar buttons. Possible values are + "GEDIT_TOOLBAR_SYSTEM" to use the system's default style, + "GEDIT_TOOLBAR_ICONS" to display icons only, + "GEDIT_TOOLBAR_ICONS_AND_TEXT" to display both icons and text, and + "GEDIT_TOOLBAR_ICONS_BOTH_HORIZ" to display prioritized text beside icons. + Note that the values are case-sensitive, so make sure they + appear exactly as mentioned here. + + + + + /schemas/apps/gedit-2/preferences/ui/statusbar/statusbar_visible + /apps/gedit-2/preferences/ui/statusbar/statusbar_visible + gedit + bool + TRUE + + Status Bar is Visible + Whether the status bar at the bottom of editing windows + should be visible. + + + + + /schemas/apps/gedit-2/preferences/ui/side_pane/side_pane_visible + /apps/gedit-2/preferences/ui/side_pane/side_pane_visible + gedit + bool + FALSE + + Side Pane is Visible + Whether the side pane at the left of editing windows + should be visible. + + + + + /schemas/apps/gedit-2/preferences/ui/bottom_panel/bottom_panel_visible + /apps/gedit-2/preferences/ui/bottom_panel/bottom_panel_visible + gedit + bool + FALSE + + Bottom Panel is Visible + Whether the bottom panel at the bottom of editing windows + should be visible. + + + + + /schemas/apps/gedit-2/preferences/print/page/print_syntax_highlighting + /apps/gedit-2/preferences/print/page/print_syntax_highlighting + gedit + bool + TRUE + + Print Syntax Highlighting + Whether gedit should print syntax highlighting when + printing documents. + + + + + /schemas/apps/gedit-2/preferences/print/page/print_header + /apps/gedit-2/preferences/print/page/print_header + gedit + bool + TRUE + + Print Header + Whether gedit should include a document header when + printing documents. + + + + + /schemas/apps/gedit-2/preferences/print/page/print_wrap_mode + /apps/gedit-2/preferences/print/page/print_wrap_mode + gedit + string + GTK_WRAP_WORD + + Printing Line Wrapping Mode + Specifies how to wrap long lines for printing. Use + "GTK_WRAP_NONE" for no wrapping, "GTK_WRAP_WORD" for wrapping + at word boundaries, and "GTK_WRAP_CHAR" for wrapping at + individual character boundaries. Note that the values are + case-sensitive, so make sure they appear exactly as mentioned + here. + + + + + /schemas/apps/gedit-2/preferences/print/page/print_line_numbers + /apps/gedit-2/preferences/print/page/print_line_numbers + gedit + int + 0 + + Print Line Numbers + If this value is 0, then no line numbers will be + inserted when printing a document. Otherwise, gedit will + print line numbers every such number of lines. + + + + + /schemas/apps/gedit-2/preferences/print/fonts/print_font_body_pango + /apps/gedit-2/preferences/print/fonts/print_font_body_pango + gedit + string + + Monospace 9 + Body Font for Printing + Specifies the font to use for a document's body when + printing documents. + + + + + /schemas/apps/gedit-2/preferences/print/fonts/print_font_header_pango + /apps/gedit-2/preferences/print/fonts/print_font_header_pango + gedit + string + + Sans 11 + Header Font for Printing + Specifies the font to use for page headers when printing + a document. This will only take effect if the "Print Header" + option is turned on. + + + + + /schemas/apps/gedit-2/preferences/print/fonts/print_font_numbers_pango + /apps/gedit-2/preferences/print/fonts/print_font_numbers_pango + gedit + string + + Sans 8 + Line Number Font for Printing + Specifies the font to use for line numbers when + printing. This will only take effect if the "Print Line + Numbers" option is non-zero. + + + + + /schemas/apps/gedit-2/preferences/ui/recents/max_recents + /apps/gedit-2/preferences/ui/recents/max_recents + gedit + int + 5 + + Maximum Recent Files + Specifies the maximum number of recently opened files + that will be displayed in the "Recent Files" submenu. + + + + + /schemas/apps/gedit-2/preferences/encodings/auto_detected + /apps/gedit-2/preferences/encodings/auto_detected + gedit + list + string + + [UTF-8,CURRENT,ISO-8859-15,UTF-16] + Automatically Detected Encodings + Sorted list of encodings used by gedit for automatically detecting the encoding of + a file. "CURRENT" represents the current locale encoding. Only recognized encodings are used. + + + + + /schemas/apps/gedit-2/preferences/encodings/shown_in_menu + /apps/gedit-2/preferences/encodings/shown_in_menu + gedit + list + string + + [ISO-8859-15] + Encodings shown in menu + List of encodings shown in the Character Encoding menu in open/save file selector. + Only recognized encodings are used. + + + + + /schemas/apps/gedit-2/preferences/syntax_highlighting/enable + /apps/gedit-2/preferences/syntax_highlighting/enable + gedit + bool + TRUE + + Enable Syntax Highlighting + Whether gedit should enable syntax highlighting. + + + + + /schemas/apps/gedit-2/plugins/active-plugins + /apps/gedit-2/plugins/active-plugins + gedit + list + string + [@ACTIVE_PLUGINS@] + + Active plugins + List of active plugins. It contains the "Location" of the active plugins. See the .gedit-plugin file for obtaining + the "Location" of a given plugin. + + + + + /schemas/apps/gedit-2/preferences/editor/save/writable_vfs_schemes + /apps/gedit-2/preferences/editor/save/writable_vfs_schemes + gedit + list + string + [dav,davs,ftp,sftp,smb,ssh] + + Writable VFS schemes + List of VFS schemes gedit supports in write mode. The 'file' scheme + is writable by default. + + + + + /schemas/apps/gedit-2/preferences/editor/cursor_position/restore_cursor_position + /apps/gedit-2/preferences/editor/cursor_position/restore_cursor_position + gedit + bool + TRUE + + Restore Previous Cursor Position + Whether gedit should restore the previous cursor position when a file is loaded. + + + + + /schemas/apps/gedit-2/preferences/editor/search_highlighting/enable + /apps/gedit-2/preferences/editor/search_highlighting/enable + gedit + bool + TRUE + + Enable Search Highlighting + Whether gedit should highlight all the occurrences of the searched text. + + + + + diff --git a/distro/archlinux/PKGBUILD b/distro/archlinux/PKGBUILD new file mode 100644 index 00000000..8e3cf254 --- /dev/null +++ b/distro/archlinux/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: neocrust + +pkgname=mate-text-editor +pkgver=2011.08.31 +pkgrel=1 +pkgdesc="An powerfull text editor for MATE" +arch=('i686' 'x86_64') +license=('GPL') +depends=('mate-conf' 'gtk2' 'gtksourceview2' 'libxml2' 'pygtksourceview2') +makedepends=('pkgconfig' 'mate-doc-utils' 'intltool') +options=('!emptydirs' '!libtool') +conflicts=('gedit') +url="http://matsusoft.com.ar/projects" +groups=('mate-extras') +install=mate-text-editor.install +source=(http://sourceforge.net/projects/matede/files/${pkgver}/${pkgname}.tar.gz/download) +sha256sums=('181779b25161a030f6ed25bce1af160d1d82bbbda43f26ab2329219e3e2539ec') + +build() { + cd "${srcdir}/${pkgname}" + intltoolize --force --copy --automake || die "intltoolize failed" + + PYTHON=/usr/bin/python2 ./configure --prefix=/usr --sysconfdir=/etc \ + --localstatedir=/var --libexecdir=/usr/lib/ \ + --disable-scrollkeeper --enable-python || return 1 + make || return 1 + +} + +package() { + cd "${srcdir}/${pkgname}" + + make MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="${pkgdir}" install || return 1 + + install -m755 -d "${pkgdir}/usr/share/mateconf/schemas" + mateconf-merge-schema "${pkgdir}/usr/share/mateconf/schemas/${pkgname}.schemas" --domain ${pkgname} ${pkgdir}/etc/mateconf/schemas/*.schemas || return 1 + rm -f ${pkgdir}/etc/mateconf/schemas/*.schemas +} + diff --git a/distro/archlinux/mate-text-editor.install b/distro/archlinux/mate-text-editor.install new file mode 100644 index 00000000..b32e92c3 --- /dev/null +++ b/distro/archlinux/mate-text-editor.install @@ -0,0 +1,22 @@ +pkgname=mate-text-editor + +post_install() { + usr/sbin/mateconfpkg --install ${pkgname} + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor +} + +pre_upgrade() { + pre_remove $1 +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + usr/sbin/mateconfpkg --uninstall ${pkgname} +} + +post_remove() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor +} diff --git a/distro/ubuntu/build b/distro/ubuntu/build new file mode 100755 index 00000000..c5ad62ab --- /dev/null +++ b/distro/ubuntu/build @@ -0,0 +1,33 @@ +#!/bin/bash + +# fill it +pkgname=mate-text-editor +pkgver=2011.08.31 +pkgrel=1 +pkgdesc="An powerfull text editor for MATE" +depends=('mate-conf') + +# editar esta funcion! +build() { + cd $pkgsrc + # descomprimir + tar xvzf download + # entramos a la carpeta + cd ${pkgname} + + intltoolize --force --copy --automake || die "intltoolize failed" + + ./configure --prefix=/usr --sysconfdir=/etc \ + --localstatedir=/var --libexecdir=/usr/lib/ \ + --disable-scrollkeeper --enable-python || return 1 + make || return 1 + + make MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="${pkgdir}" install || return 1 + + install -m755 -d "${pkgdir}/usr/share/mateconf/schemas" + mateconf-merge-schema "${pkgdir}/usr/share/mateconf/schemas/${pkgname}.schemas" --domain ${pkgname} ${pkgdir}/etc/mateconf/schemas/*.schemas || return 1 + rm -f ${pkgdir}/etc/mateconf/schemas/*.schemas +} + +# esto incluye la parte que se repite en la mayoria de los builds +. /usr/share/mate-doc-utils/mate-debian.sh diff --git a/distro/ubuntu/postinst b/distro/ubuntu/postinst new file mode 100755 index 00000000..4b277286 --- /dev/null +++ b/distro/ubuntu/postinst @@ -0,0 +1,8 @@ +#!/bin/sh -e + +pkgname=mate-text-editor + +/usr/sbin/mateconfpkg --install ${pkgname} +gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor + +exit 0 diff --git a/distro/ubuntu/postrm b/distro/ubuntu/postrm new file mode 100755 index 00000000..09b0c596 --- /dev/null +++ b/distro/ubuntu/postrm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +pkgname=mate-text-editor + +gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor + +exit 0 diff --git a/distro/ubuntu/preinst b/distro/ubuntu/preinst new file mode 100755 index 00000000..d38cd063 --- /dev/null +++ b/distro/ubuntu/preinst @@ -0,0 +1,6 @@ +#!/bin/sh -e + +pkgname=mate-text-editor + +/usr/sbin/mateconfpkg --uninstall ${pkgname} + diff --git a/distro/ubuntu/prerm b/distro/ubuntu/prerm new file mode 100755 index 00000000..dd14f340 --- /dev/null +++ b/distro/ubuntu/prerm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +pkgname=mate-text-editor + +/usr/sbin/mateconfpkg --uninstall ${pkgname} + +exit 0 diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100755 index 00000000..ffdce490 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = reference + +EXTRA_DIST = class-diagram.dia + +-include $(top_srcdir)/git.mk diff --git a/docs/class-diagram.dia b/docs/class-diagram.dia new file mode 100755 index 00000000..25264b7d Binary files /dev/null and b/docs/class-diagram.dia differ diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am new file mode 100755 index 00000000..389a9aba --- /dev/null +++ b/docs/reference/Makefile.am @@ -0,0 +1,121 @@ +## Process this file with automake to produce Makefile.in + +# see /gtk-doc/examples/Makefile.am + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# The name of the module, e.g. 'glib'. +DOC_MODULE=gedit + +# The top-level SGML file. You can change this if you want to. +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 the functions and macros. +DOC_SOURCE_DIR=../../gedit + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-mktmpl +# e.g. MKTMPL_OPTIONS=--only-section-tmpl +MKTMPL_OPTIONS= + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS= + +# Used for dependencies. The docs will be rebuilt if any of these change. +HFILE_GLOB=$(top_srcdir)/gedit/*.h +CFILE_GLOB=$(top_srcdir)/gedit/*.c + +# Header files to ignore when scanning (These are internal to gedit). +IGNORE_HFILES= \ + gedit-commands.h \ + gedit-document-loader.h \ + gedit-document-saver.h \ + gedit-documents-panel.h \ + gedit-io-error-message-area.h \ + gedit-languages-manager.h \ + gedit-message-area.h \ + gedit-object-module.h \ + gedit-plugin-manager.h \ + gedit-plugins-engine.h \ + gedit-prefs-manager-private.h \ + gedit-session.h \ + gedit-spinner.h \ + gedit-ui.h \ + gedit-window-private.h \ + gedit-output-window.h \ + gedit-close-confirmation-dialog.h \ + gedit-encodings-dialog.h \ + gedit-open-location-dialog.h \ + gedit-page-setup-dialog.h \ + gedit-preferences-dialog.h \ + gedit-search-dialog.h \ + gedit-marshal.h \ + gedit-enum-types.h + +# These files are not part of gedit but were copied into it for some reason. +# Do not parse them to make the docs. +IGNORE_HFILES += \ + bacon-message-connection.h \ + gedittextregion.h \ + sexy-icon-entry.h + +# Images to copy into HTML directory. +HTML_IMAGES= + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files= + +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +GTKDOC_CFLAGS= \ + -I$(top_srcdir)/gedit \ + -I$(top_builddir)/gedit \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(GEDIT_CFLAGS) + +GTKDOC_LIBS= \ + $(top_builddir)/gedit/libgedit.la \ + $(GEDIT_LIBS) + +if ENABLE_PYTHON +GTKDOC_CFLAGS += \ + $(NO_STRICT_ALIASING_CFLAGS) \ + $(PYGTK_CFLAGS) \ + $(PYTHON_CFLAGS) \ + $(AM_CFLAGS) +GTKDOC_LIBS += \ + $(top_builddir)/plugin-loaders/python/bindings/gedit.la +endif + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in + +regenerate-types: + grep _get_type $(DOC_SOURCE_DIR)/gedit-*.h | grep -oR '^.*\.h' | sort | uniq - | sed -r 's/^.*\.h$/#include "\0"/' > gedit.types + grep _get_type $(DOC_SOURCE_DIR)/gedit-*.h | grep -oR '^.*\.h' | sort | uniq - | sed -re 'y/-/_/' -e 's/^(.*)\.h$/\1_get_type/' >> gedit.types.new + +-include $(top_srcdir)/git.mk diff --git a/docs/reference/gedit-docs.sgml b/docs/reference/gedit-docs.sgml new file mode 100755 index 00000000..f2199b5b --- /dev/null +++ b/docs/reference/gedit-docs.sgml @@ -0,0 +1,37 @@ + + + + + gedit Reference Manual + + + + gedit + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/gedit-overrides.txt b/docs/reference/gedit-overrides.txt new file mode 100755 index 00000000..e69de29b diff --git a/docs/reference/gedit-sections.txt b/docs/reference/gedit-sections.txt new file mode 100755 index 00000000..5ad2ac24 --- /dev/null +++ b/docs/reference/gedit-sections.txt @@ -0,0 +1,809 @@ +
+gedit-app +GeditAppPrivate +GeditApp +GeditApp +GeditLockdownMask +gedit_app_get_default +gedit_app_create_window +gedit_app_get_windows +gedit_app_get_active_window +gedit_app_get_documents +gedit_app_get_views +gedit_app_get_lockdown + +GEDIT_APP +GEDIT_IS_APP +GEDIT_TYPE_APP +gedit_app_get_type +GEDIT_APP_CLASS +GEDIT_IS_APP_CLASS +GEDIT_APP_GET_CLASS +
+ +
+gedit-document +GeditSearchFlags +GeditDocumentPrivate +GeditDocument +GeditDocument +GeditDocumentSaveFlags +GEDIT_DOCUMENT_ERROR +gedit_document_error_quark +gedit_document_new +gedit_document_get_uri +gedit_document_get_uri_for_display +gedit_document_get_short_name_for_display +gedit_document_get_mime_type +gedit_document_get_readonly +gedit_document_load +gedit_document_insert_file +gedit_document_load_cancel +gedit_document_save +gedit_document_save_as +gedit_document_is_untouched +gedit_document_is_untitled +gedit_document_get_deleted +gedit_document_goto_line +gedit_document_set_search_text +gedit_document_get_search_text +gedit_document_get_can_search_again +gedit_document_search_forward +gedit_document_search_backward +gedit_document_replace_all +gedit_document_set_language +gedit_document_set_enable_search_highlighting +gedit_document_get_enable_search_highlighting +GEDIT_SEARCH_IS_DONT_SET_FLAGS +GEDIT_SEARCH_SET_DONT_SET_FLAGS +GEDIT_SEARCH_IS_ENTIRE_WORD +GEDIT_SEARCH_SET_ENTIRE_WORD +GEDIT_SEARCH_IS_CASE_SENSITIVE +GEDIT_SEARCH_SET_CASE_SENSITIVE + +GEDIT_DOCUMENT +GEDIT_IS_DOCUMENT +GEDIT_TYPE_DOCUMENT +gedit_document_get_type +GEDIT_DOCUMENT_CLASS +GEDIT_IS_DOCUMENT_CLASS +GEDIT_DOCUMENT_GET_CLASS +
+ +
+gedit-encodings-option-menu +GeditEncodingsOptionMenuPrivate +GeditEncodingsOptionMenu +GeditEncodingsOptionMenu +gedit_encodings_option_menu_new +gedit_encodings_option_menu_get_selected_encoding +gedit_encodings_option_menu_set_selected_encoding + +GEDIT_ENCODINGS_OPTION_MENU +GEDIT_IS_ENCODINGS_OPTION_MENU +GEDIT_TYPE_ENCODINGS_OPTION_MENU +gedit_encodings_option_menu_get_type +GEDIT_ENCODINGS_OPTION_MENU_CLASS +GEDIT_IS_ENCODINGS_OPTION_MENU_CLASS +GEDIT_ENCODINGS_OPTION_MENU_GET_CLASS +
+ +
+gedit-file-chooser-dialog +GeditFileChooserDialogPrivate +GeditFileChooserDialog +GeditFileChooserDialog +gedit_file_chooser_dialog_new +gedit_file_chooser_dialog_set_encoding + +GEDIT_FILE_CHOOSER_DIALOG +GEDIT_IS_FILE_CHOOSER_DIALOG +GEDIT_TYPE_FILE_CHOOSER_DIALOG +gedit_file_chooser_dialog_get_type +GEDIT_FILE_CHOOSER_DIALOG_CLASS +GEDIT_IS_FILE_CHOOSER_DIALOG_CLASS +GEDIT_FILE_CHOOSER_DIALOG_GET_CLASS +
+ +
+gedit-message-bus +GeditMessageBus +GeditMessageBus +GeditMessageCallback +gedit_message_bus_get_default +gedit_message_bus_new +gedit_message_bus_lookup +gedit_message_bus_register +gedit_message_bus_unregister +gedit_message_bus_unregister_all +gedit_message_bus_is_registered +gedit_message_bus_foreach +gedit_message_bus_connect +gedit_message_bus_disconnect +gedit_message_bus_disconnect_by_func +gedit_message_bus_block +gedit_message_bus_block_by_func +gedit_message_bus_unblock +gedit_message_bus_unblock_by_func +gedit_message_bus_send_message +gedit_message_bus_send_message_sync +gedit_message_bus_send +gedit_message_bus_send_sync + +GEDIT_MESSAGE_BUS +GEDIT_IS_MESSAGE_BUS +GEDIT_TYPE_MESSAGE_BUS +gedit_message_bus_get_type +GEDIT_MESSAGE_BUS_CLASS +GEDIT_IS_MESSAGE_BUS_CLASS +GEDIT_MESSAGE_BUS_GET_CLASS +
+ +
+gedit-message-type +GeditMessageType +GeditMessageType +gedit_message_type_get_type +gedit_message_type_is_supported +gedit_message_type_identifier +gedit_message_type_is_valid_object_path +gedit_message_type_new +gedit_message_type_new_valist +gedit_message_type_ref +gedit_message_type_unref +gedit_message_type_set +gedit_message_type_set_valist +gedit_message_type_instantiate +gedit_message_type_instantiate_valist +gedit_message_type_get_object_path +gedit_message_type_get_method +gedit_message_type_lookup +gedit_message_type_foreach + +GEDIT_TYPE_MESSAGE_TYPE +
+ +
+gedit-message +GeditMessage +GeditMessage +gedit_message_get +gedit_message_get_valist +gedit_message_get_value +gedit_message_set +gedit_message_set_valist +gedit_message_set_value +gedit_message_set_valuesv +gedit_message_get_object_path +gedit_message_get_method +gedit_message_has_key +gedit_message_get_key_type +gedit_message_validate + +GEDIT_MESSAGE +GEDIT_IS_MESSAGE +GEDIT_TYPE_MESSAGE +gedit_message_get_type +GEDIT_MESSAGE_CLASS +GEDIT_IS_MESSAGE_CLASS +GEDIT_MESSAGE_GET_CLASS +
+ +
+gedit-notebook +GeditNotebookPrivate +GeditNotebook +GeditNotebook +gedit_notebook_new +gedit_notebook_add_tab +gedit_notebook_remove_tab +gedit_notebook_remove_all_tabs +gedit_notebook_reorder_tab +gedit_notebook_move_tab +gedit_notebook_set_always_show_tabs +gedit_notebook_set_close_buttons_sensitive +gedit_notebook_get_close_buttons_sensitive +gedit_notebook_set_tab_drag_and_drop_enabled +gedit_notebook_get_tab_drag_and_drop_enabled + +GEDIT_NOTEBOOK +GEDIT_IS_NOTEBOOK +GEDIT_TYPE_NOTEBOOK +gedit_notebook_get_type +GEDIT_NOTEBOOK_CLASS +GEDIT_IS_NOTEBOOK_CLASS +GEDIT_NOTEBOOK_GET_CLASS +
+ +
+gedit-panel +GeditPanelPrivate +GeditPanel +GeditPanel +gedit_panel_new +gedit_panel_add_item +gedit_panel_add_item_with_stock_icon +gedit_panel_remove_item +gedit_panel_activate_item +gedit_panel_item_is_active +gedit_panel_get_orientation +gedit_panel_get_n_items + +GEDIT_PANEL +GEDIT_IS_PANEL +GEDIT_TYPE_PANEL +gedit_panel_get_type +GEDIT_PANEL_CLASS +GEDIT_IS_PANEL_CLASS +GEDIT_PANEL_GET_CLASS +
+ +
+gedit-plugin +GeditPlugin +GeditPlugin +gedit_plugin_activate +gedit_plugin_deactivate +gedit_plugin_update_ui +gedit_plugin_is_configurable +gedit_plugin_create_configure_dialog +GEDIT_PLUGIN_REGISTER_TYPE + +GEDIT_PLUGIN +GEDIT_IS_PLUGIN +GEDIT_TYPE_PLUGIN +gedit_plugin_get_type +GEDIT_PLUGIN_CLASS +GEDIT_IS_PLUGIN_CLASS +GEDIT_PLUGIN_GET_CLASS +GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE +GEDIT_PLUGIN_REGISTER_TYPE +GEDIT_PLUGIN_DEFINE_TYPE_WITH_CODE +GEDIT_PLUGIN_DEFINE_TYPE +
+ +
+gedit-print-job-preview +GeditPrintJobPreviewPrivate +GeditPrintJobPreview +GeditPrintJobPreview +gedit_print_job_preview_new + +GEDIT_PRINT_JOB_PREVIEW +GEDIT_IS_PRINT_JOB_PREVIEW +GEDIT_TYPE_PRINT_JOB_PREVIEW +gedit_print_job_preview_get_type +GEDIT_PRINT_JOB_PREVIEW_CLASS +GEDIT_IS_PRINT_JOB_PREVIEW_CLASS +GEDIT_PRINT_JOB_PREVIEW_GET_CLASS +
+ +
+gedit-print +GeditPrintJob +GeditPrintJob +gedit_print_job_new +gedit_print_job_save_config +gedit_print_dialog_new + +GEDIT_PRINT_JOB +GEDIT_IS_PRINT_JOB +GEDIT_TYPE_PRINT_JOB +gedit_print_job_get_type +GEDIT_PRINT_JOB_CLASS +GEDIT_IS_PRINT_JOB_CLASS +GEDIT_PRINT_JOB_GET_CLASS +
+ +
+gedit-progress-message-area +GeditProgressMessageAreaPrivate +GeditProgressMessageArea +GeditProgressMessageArea +gedit_progress_message_area_new +gedit_progress_message_area_set_stock_image +gedit_progress_message_area_set_markup +gedit_progress_message_area_set_text +gedit_progress_message_area_set_fraction +gedit_progress_message_area_pulse + +GEDIT_PROGRESS_MESSAGE_AREA +GEDIT_IS_PROGRESS_MESSAGE_AREA +GEDIT_TYPE_PROGRESS_MESSAGE_AREA +gedit_progress_message_area_get_type +GEDIT_PROGRESS_MESSAGE_AREA_CLASS +GEDIT_IS_PROGRESS_MESSAGE_AREA_CLASS +GEDIT_PROGRESS_MESSAGE_AREA_GET_CLASS +
+ +
+gedit-statusbar +GeditStatusbarPrivate +GeditStatusbar +GeditStatusbar +gedit_statusbar_new +GeditStatus +gedit_statusbar_set_window_state +gedit_statusbar_set_overwrite +gedit_statusbar_set_cursor_position +gedit_statusbar_clear_overwrite +gedit_statusbar_flash_message + +GEDIT_STATUSBAR +GEDIT_IS_STATUSBAR +GEDIT_TYPE_STATUSBAR +gedit_statusbar_get_type +GEDIT_STATUSBAR_CLASS +GEDIT_IS_STATUSBAR_CLASS +GEDIT_STATUSBAR_GET_CLASS +
+ +
+gedit-tab +GeditTabState +GeditTabPrivate +GeditTab +GeditTab +gedit_tab_get_view +gedit_tab_get_document +gedit_tab_get_from_document +gedit_tab_get_state +gedit_tab_get_auto_save_enabled +gedit_tab_set_auto_save_enabled +gedit_tab_get_auto_save_interval +gedit_tab_set_auto_save_interval + +GEDIT_TAB +GEDIT_IS_TAB +GEDIT_TYPE_TAB +gedit_tab_get_type +GEDIT_TAB_CLASS +GEDIT_IS_TAB_CLASS +GEDIT_TAB_GET_CLASS +
+ +
+gedit-view +GeditViewPrivate +GeditView +GeditView +gedit_view_new +gedit_view_cut_clipboard +gedit_view_copy_clipboard +gedit_view_paste_clipboard +gedit_view_delete_selection +gedit_view_select_all +gedit_view_scroll_to_cursor +gedit_view_set_colors +gedit_view_set_font + +GEDIT_VIEW +GEDIT_IS_VIEW +GEDIT_TYPE_VIEW +gedit_view_get_type +GEDIT_VIEW_CLASS +GEDIT_IS_VIEW_CLASS +GEDIT_VIEW_GET_CLASS +
+ +
+gedit-window +GeditWindowState +GeditWindowPrivate +GeditWindow +GeditWindow +gedit_window_create_tab +gedit_window_create_tab_from_uri +gedit_window_close_tab +gedit_window_close_all_tabs +gedit_window_close_tabs +gedit_window_get_active_tab +gedit_window_set_active_tab +gedit_window_get_active_view +gedit_window_get_active_document +gedit_window_get_documents +gedit_window_get_unsaved_documents +gedit_window_get_views +gedit_window_get_group +gedit_window_get_side_panel +gedit_window_get_bottom_panel +gedit_window_get_statusbar +gedit_window_get_ui_manager +gedit_window_get_state +gedit_window_get_tab_from_location +gedit_window_get_tab_from_uri +gedit_window_get_message_bus + +GEDIT_WINDOW +GEDIT_IS_WINDOW +GEDIT_TYPE_WINDOW +gedit_window_get_type +GEDIT_WINDOW_CLASS +GEDIT_IS_WINDOW_CLASS +GEDIT_WINDOW_GET_CLASS +
+ +
+gedit-convert +GeditConvertError +GEDIT_CONVERT_ERROR +gedit_convert_error_quark +gedit_convert_to_utf8 +gedit_convert_from_utf8 +
+ +
+gedit-debug +GeditDebugSection +DEBUG_VIEW +DEBUG_SEARCH +DEBUG_PRINT +DEBUG_PREFS +DEBUG_PLUGINS +DEBUG_TAB +DEBUG_DOCUMENT +DEBUG_COMMANDS +DEBUG_APP +DEBUG_SESSION +DEBUG_UTILS +DEBUG_METADATA +DEBUG_WINDOW +DEBUG_LOADER +DEBUG_SAVER +gedit_debug_init +gedit_debug +gedit_debug_message +
+ +
+gedit-encodings +GeditEncoding +GEDIT_TYPE_ENCODING +gedit_encoding_get_type +gedit_encoding_copy +gedit_encoding_free +gedit_encoding_get_from_charset +gedit_encoding_get_from_index +gedit_encoding_to_string +gedit_encoding_get_name +gedit_encoding_get_charset +gedit_encoding_get_utf8 +gedit_encoding_get_current +
+ +
+gedit-help +gedit_help_display +
+ +
+gedit-metadata-manager +gedit_metadata_manager_shutdown +gedit_metadata_manager_get +gedit_metadata_manager_set +
+ +
+gedit-prefs-manager-app +gedit_prefs_manager_app_init +gedit_prefs_manager_app_shutdown +gedit_prefs_manager_get_window_state +gedit_prefs_manager_set_window_state +gedit_prefs_manager_window_state_can_set +gedit_prefs_manager_get_window_size +gedit_prefs_manager_get_default_window_size +gedit_prefs_manager_set_window_size +gedit_prefs_manager_window_size_can_set +gedit_prefs_manager_get_side_panel_size +gedit_prefs_manager_get_default_side_panel_size +gedit_prefs_manager_set_side_panel_size +gedit_prefs_manager_side_panel_size_can_set +gedit_prefs_manager_get_bottom_panel_size +gedit_prefs_manager_get_default_bottom_panel_size +gedit_prefs_manager_set_bottom_panel_size +gedit_prefs_manager_bottom_panel_size_can_set +
+ +
+gedit-prefs-manager +GEDIT_BASE_KEY +GPM_PREFS_DIR +GPM_FONT_DIR +GPM_USE_DEFAULT_FONT +GPM_EDITOR_FONT +GPM_COLORS_DIR +GPM_USE_DEFAULT_COLORS +GPM_BACKGROUND_COLOR +GPM_TEXT_COLOR +GPM_SELECTED_TEXT_COLOR +GPM_SELECTION_COLOR +GPM_SAVE_DIR +GPM_CREATE_BACKUP_COPY +GPM_BACKUP_COPY_EXTENSION +GPM_AUTO_SAVE +GPM_AUTO_SAVE_INTERVAL +GPM_UNDO_DIR +GPM_UNDO_ACTIONS_LIMIT +GPM_WRAP_MODE_DIR +GPM_WRAP_MODE +GPM_TABS_DIR +GPM_TABS_SIZE +GPM_INSERT_SPACES +GPM_AUTO_INDENT_DIR +GPM_AUTO_INDENT +GPM_LINE_NUMBERS_DIR +GPM_DISPLAY_LINE_NUMBERS +GPM_CURRENT_LINE_DIR +GPM_HIGHLIGHT_CURRENT_LINE +GPM_BRACKET_MATCHING_DIR +GPM_BRACKET_MATCHING +GPM_RIGHT_MARGIN_DIR +GPM_DISPLAY_RIGHT_MARGIN +GPM_RIGHT_MARGIN_POSITION +GPM_CURSOR_POSITION_DIR +GPM_RESTORE_CURSOR_POSITION +GPM_SEARCH_HIGHLIGHTING_DIR +GPM_SEARCH_HIGHLIGHTING_ENABLE +GPM_TOOLBAR_DIR +GPM_TOOLBAR_VISIBLE +GPM_TOOLBAR_BUTTONS_STYLE +GPM_STATUSBAR_DIR +GPM_STATUSBAR_VISIBLE +GPM_SIDE_PANE_DIR +GPM_SIDE_PANE_VISIBLE +GPM_BOTTOM_PANEL_DIR +GPM_BOTTOM_PANEL_VISIBLE +GPM_RECENTS_DIR +GPM_MAX_RECENTS +GPM_PRINT_PAGE_DIR +GPM_PRINT_SYNTAX +GPM_PRINT_HEADER +GPM_PRINT_WRAP_MODE +GPM_PRINT_LINE_NUMBERS +GPM_PRINT_FONT_DIR +GPM_PRINT_FONT_BODY +GPM_PRINT_FONT_BODY_PANGO +GPM_PRINT_FONT_HEADER +GPM_PRINT_FONT_HEADER_PANGO +GPM_PRINT_FONT_NUMBERS +GPM_PRINT_FONT_NUMBERS_PANGO +GPM_WINDOW_DIR +GPM_WINDOW_STATE +GPM_WINDOW_WIDTH +GPM_WINDOW_HEIGHT +GPM_SIDE_PANEL_SIZE +GPM_BOTTOM_PANEL_SIZE +GPM_ENCODINGS_DIR +GPM_AUTO_DETECTED_ENCODINGS +GPM_SHOWN_IN_MENU_ENCODINGS +GPM_SYNTAX_HL_DIR +GPM_SYNTAX_HL_ENABLE +GPM_WRITABLE_VFS_SCHEMES +GPM_LOCKDOWN_DIR +GPM_LOCKDOWN_COMMAND_LINE +GPM_LOCKDOWN_PRINTING +GPM_LOCKDOWN_PRINT_SETUP +GPM_LOCKDOWN_SAVE_TO_DISK +GPM_DEFAULT_USE_DEFAULT_FONT +GPM_DEFAULT_EDITOR_FONT +GPM_DEFAULT_USE_DEFAULT_COLORS +GPM_DEFAULT_BACKGROUND_COLOR +GPM_DEFAULT_TEXT_COLOR +GPM_DEFAULT_SELECTED_TEXT_COLOR +GPM_DEFAULT_SELECTION_COLOR +GPM_DEFAULT_CREATE_BACKUP_COPY +GPM_DEFAULT_BACKUP_COPY_EXTENSION +GPM_DEFAULT_AUTO_SAVE +GPM_DEFAULT_AUTO_SAVE_INTERVAL +GPM_DEFAULT_UNDO_ACTIONS_LIMIT +GPM_DEFAULT_WRAP_MODE +GPM_DEFAULT_TABS_SIZE +GPM_DEFAULT_INSERT_SPACES +GPM_DEFAULT_AUTO_INDENT +GPM_DEFAULT_DISPLAY_LINE_NUMBERS +GPM_DEFAULT_AUTO_DETECTED_ENCODINGS +GPM_DEFAULT_TOOLBAR_VISIBLE +GPM_DEFAULT_TOOLBAR_BUTTONS_STYLE +GPM_DEFAULT_TOOLBAR_SHOW_TOOLTIPS +GPM_DEFAULT_STATUSBAR_VISIBLE +GPM_DEFAULT_SIDE_PANE_VISIBLE +GPM_DEFAULT_BOTTOM_PANEL_VISIBLE +GPM_DEFAULT_PRINT_SYNTAX +GPM_DEFAULT_PRINT_HEADER +GPM_DEFAULT_PRINT_WRAP_MODE +GPM_DEFAULT_PRINT_LINE_NUMBERS +GPM_DEFAULT_PRINT_FONT_BODY_PANGO +GPM_DEFAULT_PRINT_FONT_HEADER_PANGO +GPM_DEFAULT_PRINT_FONT_NUMBERS_PANGO +GPM_DEFAULT_MAX_RECENTS +GPM_DEFAULT_WINDOW_STATE +GPM_DEFAULT_WINDOW_WIDTH +GPM_DEFAULT_WINDOW_HEIGHT +GPM_DEFAULT_WINDOW_STATE_STR +GPM_DEFAULT_WINDOW_WIDTH_STR +GPM_DEFAULT_WINDOW_HEIGHT_STR +GPM_DEFAULT_SIDE_PANEL_SIZE +GPM_DEFAULT_BOTTOM_PANEL_SIZE +GPM_DEFAULT_SIDE_PANEL_SIZE_STR +GPM_DEFAULT_BOTTOM_PANEL_SIZE_STR +GPM_DEFAULT_HIGHLIGHT_CURRENT_LINE +GPM_DEFAULT_BRACKET_MATCHING +GPM_DEFAULT_DISPLAY_RIGHT_MARGIN +GPM_DEFAULT_RIGHT_MARGIN_POSITION +GPM_DEFAULT_SYNTAX_HL_ENABLE +GPM_DEFAULT_WRITABLE_VFS_SCHEMES +GPM_DEFAULT_RESTORE_CURSOR_POSITION +GPM_DEFAULT_SEARCH_HIGHLIGHTING_ENABLE +GeditToolbarSetting +gedit_prefs_manager_init +gedit_prefs_manager_shutdown +gedit_prefs_manager_get_use_default_font +gedit_prefs_manager_set_use_default_font +gedit_prefs_manager_use_default_font_can_set +gedit_prefs_manager_get_editor_font +gedit_prefs_manager_set_editor_font +gedit_prefs_manager_editor_font_can_set +gedit_prefs_manager_get_use_default_colors +gedit_prefs_manager_set_use_default_colors +gedit_prefs_manager_use_default_colors_can_set +gedit_prefs_manager_get_background_color +gedit_prefs_manager_set_background_color +gedit_prefs_manager_background_color_can_set +gedit_prefs_manager_get_text_color +gedit_prefs_manager_set_text_color +gedit_prefs_manager_text_color_can_set +gedit_prefs_manager_get_selection_color +gedit_prefs_manager_set_selection_color +gedit_prefs_manager_selection_color_can_set +gedit_prefs_manager_get_selected_text_color +gedit_prefs_manager_set_selected_text_color +gedit_prefs_manager_selected_text_color_can_set +gedit_prefs_manager_get_create_backup_copy +gedit_prefs_manager_set_create_backup_copy +gedit_prefs_manager_create_backup_copy_can_set +gedit_prefs_manager_get_backup_extension +gedit_prefs_manager_get_auto_save +gedit_prefs_manager_set_auto_save +gedit_prefs_manager_auto_save_can_set +gedit_prefs_manager_get_auto_save_interval +gedit_prefs_manager_set_auto_save_interval +gedit_prefs_manager_auto_save_interval_can_set +gedit_prefs_manager_get_undo_actions_limit +gedit_prefs_manager_set_undo_actions_limit +gedit_prefs_manager_undo_actions_limit_can_set +gedit_prefs_manager_get_wrap_mode +gedit_prefs_manager_set_wrap_mode +gedit_prefs_manager_wrap_mode_can_set +gedit_prefs_manager_get_tabs_size +gedit_prefs_manager_set_tabs_size +gedit_prefs_manager_tabs_size_can_set +gedit_prefs_manager_get_insert_spaces +gedit_prefs_manager_set_insert_spaces +gedit_prefs_manager_insert_spaces_can_set +gedit_prefs_manager_get_auto_indent +gedit_prefs_manager_set_auto_indent +gedit_prefs_manager_auto_indent_can_set +gedit_prefs_manager_get_display_line_numbers +gedit_prefs_manager_set_display_line_numbers +gedit_prefs_manager_display_line_numbers_can_set +gedit_prefs_manager_get_toolbar_visible +gedit_prefs_manager_set_toolbar_visible +gedit_prefs_manager_toolbar_visible_can_set +gedit_prefs_manager_get_toolbar_buttons_style +gedit_prefs_manager_set_toolbar_buttons_style +gedit_prefs_manager_toolbar_buttons_style_can_set +gedit_prefs_manager_get_statusbar_visible +gedit_prefs_manager_set_statusbar_visible +gedit_prefs_manager_statusbar_visible_can_set +gedit_prefs_manager_get_side_pane_visible +gedit_prefs_manager_set_side_pane_visible +gedit_prefs_manager_side_pane_visible_can_set +gedit_prefs_manager_get_bottom_panel_visible +gedit_prefs_manager_set_bottom_panel_visible +gedit_prefs_manager_bottom_panel_visible_can_set +gedit_prefs_manager_get_print_syntax_hl +gedit_prefs_manager_set_print_syntax_hl +gedit_prefs_manager_print_syntax_hl_can_set +gedit_prefs_manager_get_print_header +gedit_prefs_manager_set_print_header +gedit_prefs_manager_print_header_can_set +gedit_prefs_manager_get_print_wrap_mode +gedit_prefs_manager_set_print_wrap_mode +gedit_prefs_manager_print_wrap_mode_can_set +gedit_prefs_manager_get_print_line_numbers +gedit_prefs_manager_set_print_line_numbers +gedit_prefs_manager_print_line_numbers_can_set +gedit_prefs_manager_get_print_font_body +gedit_prefs_manager_set_print_font_body +gedit_prefs_manager_print_font_body_can_set +gedit_prefs_manager_get_default_print_font_body +gedit_prefs_manager_get_print_font_header +gedit_prefs_manager_set_print_font_header +gedit_prefs_manager_print_font_header_can_set +gedit_prefs_manager_get_default_print_font_header +gedit_prefs_manager_get_print_font_numbers +gedit_prefs_manager_set_print_font_numbers +gedit_prefs_manager_print_font_numbers_can_set +gedit_prefs_manager_get_default_print_font_numbers +gedit_prefs_manager_get_max_recents +gedit_prefs_manager_get_auto_detected_encodings +gedit_prefs_manager_get_shown_in_menu_encodings +gedit_prefs_manager_set_shown_in_menu_encodings +gedit_prefs_manager_shown_in_menu_encodings_can_set +gedit_prefs_manager_get_highlight_current_line +gedit_prefs_manager_set_highlight_current_line +gedit_prefs_manager_highlight_current_line_can_set +gedit_prefs_manager_get_bracket_matching +gedit_prefs_manager_set_bracket_matching +gedit_prefs_manager_bracket_matching_can_set +gedit_prefs_manager_get_display_right_margin +gedit_prefs_manager_set_display_right_margin +gedit_prefs_manager_display_right_margin_can_set +gedit_prefs_manager_get_right_margin_position +gedit_prefs_manager_set_right_margin_position +gedit_prefs_manager_right_margin_position_can_set +gedit_prefs_manager_get_enable_syntax_highlighting +gedit_prefs_manager_set_enable_syntax_highlighting +gedit_prefs_manager_enable_syntax_highlighting_can_set +gedit_prefs_manager_get_writable_vfs_schemes +gedit_prefs_manager_get_restore_cursor_position +gedit_prefs_manager_get_enable_search_highlighting +gedit_prefs_manager_set_enable_search_highlighting +gedit_prefs_manager_enable_search_highlighting_can_set +gedit_prefs_manager_get_lockdown +
+ +
+gedit-utils +GBOOLEAN_TO_POINTER +GPOINTER_TO_BOOLEAN +IS_VALID_BOOLEAN +gedit_utils_uri_has_writable_scheme +gedit_utils_uri_has_file_scheme +gedit_utils_menu_position_under_widget +gedit_utils_menu_position_under_tree_view +gedit_gtk_button_new_with_stock_icon +gedit_dialog_add_button +gedit_utils_escape_underscores +gedit_utils_escape_slashes +gedit_utils_str_middle_truncate +g_utf8_caselessnmatch +gedit_utils_set_atk_name_description +gedit_utils_set_atk_relation +gedit_utils_uri_exists +gedit_utils_escape_search_text +gedit_utils_unescape_search_text +gedit_utils_get_stdin +gedit_warning +gedit_utils_make_valid_utf8 +gedit_utils_uri_get_dirname +gedit_utils_replace_home_dir_with_tilde +gedit_utils_get_current_workspace +gedit_utils_get_window_workspace +gedit_utils_activate_url +gedit_utils_is_valid_uri +gedit_utils_get_glade_widgets +gedit_utils_make_canonical_uri_from_shell_arg +gedit_utils_format_uri_for_display +
+ +
+gedit-enum-types +GEDIT_TYPE_LOCKDOWN_MASK +gedit_lockdown_mask_get_type +GEDIT_TYPE_CONVERT_ERROR +gedit_convert_error_get_type +GEDIT_TYPE_DEBUG_SECTION +gedit_debug_section_get_type +GEDIT_TYPE_SEARCH_FLAGS +gedit_search_flags_get_type +GEDIT_TYPE_DOCUMENT_SAVE_FLAGS +gedit_document_save_flags_get_type +GEDIT_TYPE_TOOLBAR_SETTING +gedit_toolbar_setting_get_type +GEDIT_TYPE_TAB_STATE +gedit_tab_state_get_type +GEDIT_TYPE_WINDOW_STATE +gedit_window_state_get_type +
+ diff --git a/docs/reference/gedit.types b/docs/reference/gedit.types new file mode 100755 index 00000000..3cb6ce8b --- /dev/null +++ b/docs/reference/gedit.types @@ -0,0 +1,32 @@ +#include "gedit-app.h" +#include "gedit-document.h" +#include "gedit-encodings.h" +#include "gedit-encodings-combo-box.h" +#include "gedit-file-chooser-dialog.h" +#include "gedit-message.h" +#include "gedit-message-bus.h" +#include "gedit-message-type.h" +#include "gedit-notebook.h" +#include "gedit-panel.h" +#include "gedit-plugin.h" +#include "gedit-progress-message-area.h" +#include "gedit-statusbar.h" +#include "gedit-tab.h" +#include "gedit-view.h" +#include "gedit-window.h" +gedit_app_get_type +gedit_document_get_type +gedit_encoding_get_type +gedit_encodings_combo_box_get_type +gedit_file_chooser_dialog_get_type +gedit_message_get_type +gedit_message_bus_get_type +gedit_message_type_get_type +gedit_notebook_get_type +gedit_panel_get_type +gedit_plugin_get_type +gedit_progress_message_area_get_type +gedit_statusbar_get_type +gedit_tab_get_type +gedit_view_get_type +gedit_window_get_type diff --git a/gedit.doap b/gedit.doap new file mode 100755 index 00000000..8bfbb0f1 --- /dev/null +++ b/gedit.doap @@ -0,0 +1,39 @@ + + + gedit + MATE Text Editor + + + + + + + + + + Paolo Borelli + + pborelli + + + + + Paolo Maggi + + paolo + + + + + Jesse van den Kieboom + + jessevdk + + + + + diff --git a/gedit/Makefile.am b/gedit/Makefile.am new file mode 100755 index 00000000..f08c6427 --- /dev/null +++ b/gedit/Makefile.am @@ -0,0 +1,254 @@ +## Process this file with automake to produce Makefile.in +SUBDIRS = dialogs smclient + +if OS_OSX +SUBDIRS += osx +endif + +bin_PROGRAMS = gedit + +noinst_LTLIBRARIES = libgedit.la + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(srcdir) \ + -I$(srcdir)/smclient \ + $(GEDIT_CFLAGS) \ + $(IGE_MAC_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) \ + -DDATADIR=\""$(datadir)"\" \ + -DLIBDIR=\""$(libdir)"\" + +gedit_SOURCES = \ + gedit.c + +gedit_LDADD = libgedit.la $(GEDIT_LIBS) $(IGE_MAC_LIBS) $(EGG_SMCLIENT_LIBS) + +if PLATFORM_WIN32 +gedit_LDFLAGS = -Wl,--export-all-symbols -Wl,--out-implib,libgedit-$(GEDIT_API_VERSION).a +if OS_WIN32 +gedit_LDFLAGS += -mwindows +endif +else +gedit_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*" +endif + +libgedit_la_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*" + +libgedit_la_LIBADD = \ + dialogs/libdialogs.la \ + smclient/libeggsmclient.la + +# GEDIT_LIBS must be the last to ensure correct order on some platforms +libgedit_la_LIBADD += $(GEDIT_LIBS) + +if OS_OSX +gedit_LDFLAGS += -framework Carbon + +libgedit_la_LIBADD += osx/libosx.la +endif + +BUILT_SOURCES = \ + gedit-enum-types.c \ + gedit-enum-types.h \ + gedit-marshal.c \ + gedit-marshal.h + +if OS_WIN32 +gedit-res.o: gedit.rc + $(WINDRES) -i gedit.rc --input-format=rc -o gedit-res.o -O coff + +gedit_LDADD += gedit-res.o +endif + +NOINST_H_FILES = \ + gedit-close-button.h \ + gedit-dirs.h \ + gedit-document-input-stream.h \ + gedit-document-loader.h \ + gedit-document-output-stream.h \ + gedit-document-saver.h \ + gedit-documents-panel.h \ + gedit-gio-document-loader.h \ + gedit-gio-document-saver.h \ + gedit-history-entry.h \ + gedit-io-error-message-area.h \ + gedit-language-manager.h \ + gedit-object-module.h \ + gedit-plugin-info.h \ + gedit-plugin-info-priv.h \ + gedit-plugin-loader.h \ + gedit-plugin-manager.h \ + gedit-plugins-engine.h \ + gedit-prefs-manager-private.h \ + gedit-print-job.h \ + gedit-print-preview.h \ + gedit-session.h \ + gedit-smart-charset-converter.h \ + gedit-style-scheme-manager.h \ + gedit-tab-label.h \ + gedittextregion.h \ + gedit-ui.h \ + gedit-window-private.h + +INST_H_FILES = \ + gedit-app.h \ + gedit-commands.h \ + gedit-debug.h \ + gedit-document.h \ + gedit-encodings.h \ + gedit-encodings-combo-box.h \ + gedit-file-chooser-dialog.h \ + gedit-help.h \ + gedit-message-bus.h \ + gedit-message-type.h \ + gedit-message.h \ + gedit-notebook.h \ + gedit-panel.h \ + gedit-plugin.h \ + gedit-prefs-manager-app.h \ + gedit-prefs-manager.h \ + gedit-progress-message-area.h \ + gedit-statusbar.h \ + gedit-status-combo-box.h \ + gedit-tab.h \ + gedit-utils.h \ + gedit-view.h \ + gedit-window.h + +if !ENABLE_GVFS_METADATA +INST_H_FILES += gedit-metadata-manager.h +endif + +headerdir = $(prefix)/include/gedit-@GEDIT_API_VERSION@/gedit + +header_DATA = \ + $(INST_H_FILES) + + +libgedit_la_SOURCES = \ + $(BUILT_SOURCES) \ + $(BACON_FILES) \ + $(POSIXIO_FILES) \ + gedit-app.c \ + gedit-close-button.c \ + gedit-commands-documents.c \ + gedit-commands-edit.c \ + gedit-commands-file.c \ + gedit-commands-file-print.c \ + gedit-commands-help.c \ + gedit-commands-search.c \ + gedit-commands-view.c \ + gedit-debug.c \ + gedit-dirs.c \ + gedit-document.c \ + gedit-document-input-stream.c \ + gedit-document-loader.c \ + gedit-document-output-stream.c \ + gedit-gio-document-loader.c \ + gedit-document-saver.c \ + gedit-gio-document-saver.c \ + gedit-documents-panel.c \ + gedit-encodings.c \ + gedit-encodings-combo-box.c \ + gedit-file-chooser-dialog.c \ + gedit-help.c \ + gedit-history-entry.c \ + gedit-io-error-message-area.c \ + gedit-language-manager.c \ + gedit-message-bus.c \ + gedit-message-type.c \ + gedit-message.c \ + gedit-object-module.c \ + gedit-notebook.c \ + gedit-panel.c \ + gedit-plugin-info.c \ + gedit-plugin.c \ + gedit-plugin-loader.c \ + gedit-plugin-manager.c \ + gedit-plugins-engine.c \ + gedit-prefs-manager-app.c \ + gedit-prefs-manager.c \ + gedit-prefs-manager-private.h \ + gedit-print-job.c \ + gedit-print-preview.c \ + gedit-progress-message-area.c \ + gedit-session.c \ + gedit-smart-charset-converter.c \ + gedit-statusbar.c \ + gedit-status-combo-box.c \ + gedit-style-scheme-manager.c \ + gedit-tab.c \ + gedit-tab-label.c \ + gedit-utils.c \ + gedit-view.c \ + gedit-window.c \ + gedittextregion.c \ + $(NOINST_H_FILES) \ + $(INST_H_FILES) + +if !ENABLE_GVFS_METADATA +libgedit_la_SOURCES += gedit-metadata-manager.c +endif + +gedit-enum-types.h: gedit-enum-types.h.template $(INST_H_FILES) $(GLIB_MKENUMS) + $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template gedit-enum-types.h.template $(INST_H_FILES)) > $@ + +gedit-enum-types.c: gedit-enum-types.c.template $(INST_H_FILES) $(GLIB_MKENUMS) + $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template gedit-enum-types.c.template $(INST_H_FILES)) > $@ + +gedit-marshal.h: gedit-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=gedit_marshal > $@ + +gedit-marshal.c: gedit-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) echo "#include \"gedit-marshal.h\"" > $@ && \ + $(GLIB_GENMARSHAL) $< --body --prefix=gedit_marshal >> $@ + +uidir = $(datadir)/gedit-2/ui/ +ui_DATA = \ + gedit-ui.xml \ + gedit-print-preferences.ui + +EXTRA_DIST = \ + $(ui_DATA) \ + gedit-enum-types.h.template \ + gedit-enum-types.c.template \ + gedit-marshal.list \ + gedit.rc + +CLEANFILES = $(BUILT_SOURCES) + +dist-hook: + cd $(distdir); rm -f $(BUILT_SOURCES) + +install-exec-hook: +if PLATFORM_WIN32 + $(mkinstalldirs) "$(DESTDIR)$(libdir)" + $(INSTALL_DATA) libgedit-$(GEDIT_API_VERSION).a "$(DESTDIR)$(libdir)" +else + rm -f $(DESTDIR)$(bindir)/mate-text-editor + ln -s gedit $(DESTDIR)$(bindir)/mate-text-editor +endif + +if !OS_WIN32 +BACON_DIR=$(srcdir)/../../libbacon/src/ +BACON_FILES=bacon-message-connection.h bacon-message-connection.c + +regenerate-built-sources: + BACONFILES="$(BACON_FILES)" BACONDIR="$(BACON_DIR)" $(top_srcdir)/gedit/update-from-bacon.sh +else +BACON_DIR= +endif + +if BUILD_MESSAGE_AREA +libgedit_la_SOURCES += gedit-message-area.c +INST_H_FILES += gedit-message-area.h +endif + +if BUILD_SPINNER +libgedit_la_SOURCES += gedit-spinner.c +NOINST_H_FILES += gedit-spinner.h +endif + +-include $(top_srcdir)/git.mk diff --git a/gedit/bacon-message-connection.c b/gedit/bacon-message-connection.c new file mode 100755 index 00000000..c8000de2 --- /dev/null +++ b/gedit/bacon-message-connection.c @@ -0,0 +1,396 @@ +/* + * Copyright (C) 2003 Bastien Nocera + * + * 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bacon-message-connection.h" + +#ifndef UNIX_PATH_MAX +#define UNIX_PATH_MAX 108 +#endif + +struct BaconMessageConnection { + /* A server accepts connections */ + gboolean is_server; + + /* The socket path itself */ + char *path; + + /* File descriptor of the socket */ + int fd; + /* Channel to watch */ + GIOChannel *chan; + /* Event id returned by g_io_add_watch() */ + int conn_id; + + /* Connections accepted by this connection */ + GSList *accepted_connections; + + /* callback */ + void (*func) (const char *message, gpointer user_data); + gpointer data; +}; + +static gboolean +test_is_socket (const char *path) +{ + struct stat s; + + if (stat (path, &s) == -1) + return FALSE; + + if (S_ISSOCK (s.st_mode)) + return TRUE; + + return FALSE; +} + +static gboolean +is_owned_by_user_and_socket (const char *path) +{ + struct stat s; + + if (stat (path, &s) == -1) + return FALSE; + + if (s.st_uid != geteuid ()) + return FALSE; + + if ((s.st_mode & S_IFSOCK) != S_IFSOCK) + return FALSE; + + return TRUE; +} + +static gboolean server_cb (GIOChannel *source, + GIOCondition condition, gpointer data); + +static gboolean +setup_connection (BaconMessageConnection *conn) +{ + g_return_val_if_fail (conn->chan == NULL, FALSE); + + conn->chan = g_io_channel_unix_new (conn->fd); + if (!conn->chan) { + return FALSE; + } + g_io_channel_set_line_term (conn->chan, "\n", 1); + conn->conn_id = g_io_add_watch (conn->chan, G_IO_IN, server_cb, conn); + + return TRUE; +} + +static void +accept_new_connection (BaconMessageConnection *server_conn) +{ + BaconMessageConnection *conn; + int alen; + + g_return_if_fail (server_conn->is_server); + + conn = g_new0 (BaconMessageConnection, 1); + conn->is_server = FALSE; + conn->func = server_conn->func; + conn->data = server_conn->data; + + conn->fd = accept (server_conn->fd, NULL, (guint *)&alen); + + server_conn->accepted_connections = + g_slist_prepend (server_conn->accepted_connections, conn); + + setup_connection (conn); +} + +static gboolean +server_cb (GIOChannel *source, GIOCondition condition, gpointer data) +{ + BaconMessageConnection *conn = (BaconMessageConnection *)data; + char *message, *subs, buf; + int cd, rc, offset; + gboolean finished; + + offset = 0; + if (conn->is_server && conn->fd == g_io_channel_unix_get_fd (source)) { + accept_new_connection (conn); + return TRUE; + } + message = g_malloc (1); + cd = conn->fd; + rc = read (cd, &buf, 1); + while (rc > 0 && buf != '\n') + { + message = g_realloc (message, rc + offset + 1); + message[offset] = buf; + offset = offset + rc; + rc = read (cd, &buf, 1); + } + if (rc <= 0) { + g_io_channel_shutdown (conn->chan, FALSE, NULL); + g_io_channel_unref (conn->chan); + conn->chan = NULL; + close (conn->fd); + conn->fd = -1; + g_free (message); + conn->conn_id = 0; + + return FALSE; + } + message[offset] = '\0'; + + subs = message; + finished = FALSE; + + while (finished == FALSE && *subs != '\0') + { + if (conn->func != NULL) + (*conn->func) (subs, conn->data); + + subs += strlen (subs) + 1; + if (subs - message >= offset) + finished = TRUE; + } + + g_free (message); + + return TRUE; +} + +static char * +find_file_with_pattern (const char *dir, const char *pattern) +{ + GDir *filedir; + char *found_filename; + const char *filename; + GPatternSpec *pat; + + filedir = g_dir_open (dir, 0, NULL); + if (filedir == NULL) + return NULL; + + pat = g_pattern_spec_new (pattern); + if (pat == NULL) + { + g_dir_close (filedir); + return NULL; + } + + found_filename = NULL; + + while ((filename = g_dir_read_name (filedir))) + { + if (g_pattern_match_string (pat, filename)) + { + char *tmp = g_build_filename (dir, filename, NULL); + if (is_owned_by_user_and_socket (tmp)) + found_filename = g_strdup (filename); + g_free (tmp); + } + + if (found_filename != NULL) + break; + } + + g_pattern_spec_free (pat); + g_dir_close (filedir); + + return found_filename; +} + +static char * +socket_filename (const char *prefix) +{ + char *pattern, *newfile, *path, *filename; + const char *tmpdir; + + pattern = g_strdup_printf ("%s.%s.*", prefix, g_get_user_name ()); + tmpdir = g_get_tmp_dir (); + filename = find_file_with_pattern (tmpdir, pattern); + if (filename == NULL) + { + newfile = g_strdup_printf ("%s.%s.%u", prefix, + g_get_user_name (), g_random_int ()); + path = g_build_filename (tmpdir, newfile, NULL); + g_free (newfile); + } else { + path = g_build_filename (tmpdir, filename, NULL); + g_free (filename); + } + + g_free (pattern); + return path; +} + +static gboolean +try_server (BaconMessageConnection *conn) +{ + struct sockaddr_un uaddr; + + uaddr.sun_family = AF_UNIX; + strncpy (uaddr.sun_path, conn->path, + MIN (strlen(conn->path)+1, UNIX_PATH_MAX)); + conn->fd = socket (PF_UNIX, SOCK_STREAM, 0); + if (bind (conn->fd, (struct sockaddr *) &uaddr, sizeof (uaddr)) == -1) + { + conn->fd = -1; + return FALSE; + } + listen (conn->fd, 5); + + if (!setup_connection (conn)) + return FALSE; + return TRUE; +} + +static gboolean +try_client (BaconMessageConnection *conn) +{ + struct sockaddr_un uaddr; + + uaddr.sun_family = AF_UNIX; + strncpy (uaddr.sun_path, conn->path, + MIN(strlen(conn->path)+1, UNIX_PATH_MAX)); + conn->fd = socket (PF_UNIX, SOCK_STREAM, 0); + if (connect (conn->fd, (struct sockaddr *) &uaddr, + sizeof (uaddr)) == -1) + { + conn->fd = -1; + return FALSE; + } + + return setup_connection (conn); +} + +BaconMessageConnection * +bacon_message_connection_new (const char *prefix) +{ + BaconMessageConnection *conn; + + g_return_val_if_fail (prefix != NULL, NULL); + + conn = g_new0 (BaconMessageConnection, 1); + conn->path = socket_filename (prefix); + + if (test_is_socket (conn->path) == FALSE) + { + if (!try_server (conn)) + { + bacon_message_connection_free (conn); + return NULL; + } + + conn->is_server = TRUE; + return conn; + } + + if (try_client (conn) == FALSE) + { + unlink (conn->path); + try_server (conn); + if (conn->fd == -1) + { + bacon_message_connection_free (conn); + return NULL; + } + + conn->is_server = TRUE; + return conn; + } + + conn->is_server = FALSE; + return conn; +} + +void +bacon_message_connection_free (BaconMessageConnection *conn) +{ + GSList *child_conn; + + g_return_if_fail (conn != NULL); + /* Only servers can accept other connections */ + g_return_if_fail (conn->is_server != FALSE || + conn->accepted_connections == NULL); + + child_conn = conn->accepted_connections; + while (child_conn != NULL) { + bacon_message_connection_free (child_conn->data); + child_conn = g_slist_next (child_conn); + } + g_slist_free (conn->accepted_connections); + + if (conn->conn_id) { + g_source_remove (conn->conn_id); + conn->conn_id = 0; + } + if (conn->chan) { + g_io_channel_shutdown (conn->chan, FALSE, NULL); + g_io_channel_unref (conn->chan); + } + + if (conn->is_server != FALSE) { + unlink (conn->path); + } + if (conn->fd != -1) { + close (conn->fd); + } + + g_free (conn->path); + g_free (conn); +} + +void +bacon_message_connection_set_callback (BaconMessageConnection *conn, + BaconMessageReceivedFunc func, + gpointer user_data) +{ + g_return_if_fail (conn != NULL); + + conn->func = func; + conn->data = user_data; +} + +void +bacon_message_connection_send (BaconMessageConnection *conn, + const char *message) +{ + g_return_if_fail (conn != NULL); + g_return_if_fail (message != NULL); + + g_io_channel_write_chars (conn->chan, message, strlen (message), + NULL, NULL); + g_io_channel_write_chars (conn->chan, "\n", 1, NULL, NULL); + g_io_channel_flush (conn->chan, NULL); +} + +gboolean +bacon_message_connection_get_is_server (BaconMessageConnection *conn) +{ + g_return_val_if_fail (conn != NULL, FALSE); + + return conn->is_server; +} + diff --git a/gedit/bacon-message-connection.h b/gedit/bacon-message-connection.h new file mode 100755 index 00000000..aac7a2d1 --- /dev/null +++ b/gedit/bacon-message-connection.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2003 Bastien Nocera + * + * 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 BACON_MESSAGE_CONNECTION_H +#define BACON_MESSAGE_CONNECTION_H + +#include + +G_BEGIN_DECLS + +typedef void (*BaconMessageReceivedFunc) (const char *message, + gpointer user_data); + +typedef struct BaconMessageConnection BaconMessageConnection; + +BaconMessageConnection *bacon_message_connection_new (const char *prefix); +void bacon_message_connection_free (BaconMessageConnection *conn); +void bacon_message_connection_set_callback (BaconMessageConnection *conn, + BaconMessageReceivedFunc func, + gpointer user_data); +void bacon_message_connection_send (BaconMessageConnection *conn, + const char *message); +gboolean bacon_message_connection_get_is_server (BaconMessageConnection *conn); + +G_END_DECLS + +#endif /* BACON_MESSAGE_CONNECTION_H */ diff --git a/gedit/dialogs/Makefile.am b/gedit/dialogs/Makefile.am new file mode 100755 index 00000000..c0762571 --- /dev/null +++ b/gedit/dialogs/Makefile.am @@ -0,0 +1,31 @@ +uidir = $(datadir)/gedit-2/ui/ + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/gedit \ + -I$(top_builddir)/gedit \ + $(GEDIT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) + +noinst_LTLIBRARIES = libdialogs.la + +libdialogs_la_SOURCES = \ + gedit-preferences-dialog.h \ + gedit-preferences-dialog.c \ + gedit-close-confirmation-dialog.c \ + gedit-close-confirmation-dialog.h \ + gedit-encodings-dialog.c \ + gedit-encodings-dialog.h \ + gedit-search-dialog.h \ + gedit-search-dialog.c + +ui_DATA = \ + gedit-encodings-dialog.ui \ + gedit-preferences-dialog.ui \ + gedit-search-dialog.ui + +EXTRA_DIST = $(ui_DATA) + +-include $(top_srcdir)/git.mk diff --git a/gedit/dialogs/gedit-close-confirmation-dialog.c b/gedit/dialogs/gedit-close-confirmation-dialog.c new file mode 100755 index 00000000..36cbf117 --- /dev/null +++ b/gedit/dialogs/gedit-close-confirmation-dialog.c @@ -0,0 +1,790 @@ +/* + * gedit-close-confirmation-dialog.c + * This file is part of gedit + * + * Copyright (C) 2004-2005 MATE Foundation + * + * 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. + */ + +/* + * Modified by the gedit Team, 2004-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gedit-close-confirmation-dialog.h" +#include +#include +#include + + +/* Properties */ +enum +{ + PROP_0, + PROP_UNSAVED_DOCUMENTS, + PROP_LOGOUT_MODE +}; + +/* Mode */ +enum +{ + SINGLE_DOC_MODE, + MULTIPLE_DOCS_MODE +}; + +/* Columns */ +enum +{ + SAVE_COLUMN, + NAME_COLUMN, + DOC_COLUMN, /* a handy pointer to the document */ + N_COLUMNS +}; + +struct _GeditCloseConfirmationDialogPrivate +{ + gboolean logout_mode; + + GList *unsaved_documents; + + GList *selected_documents; + + GtkTreeModel *list_store; + + gboolean disable_save_to_disk; +}; + +#define GEDIT_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG, \ + GeditCloseConfirmationDialogPrivate)) + +#define GET_MODE(priv) (((priv->unsaved_documents != NULL) && \ + (priv->unsaved_documents->next == NULL)) ? \ + SINGLE_DOC_MODE : MULTIPLE_DOCS_MODE) + +G_DEFINE_TYPE(GeditCloseConfirmationDialog, gedit_close_confirmation_dialog, GTK_TYPE_DIALOG) + +static void set_unsaved_document (GeditCloseConfirmationDialog *dlg, + const GList *list); + +static GList *get_selected_docs (GtkTreeModel *store); + +/* Since we connect in the costructor we are sure this handler will be called + * before the user ones + */ +static void +response_cb (GeditCloseConfirmationDialog *dlg, + gint response_id, + gpointer data) +{ + GeditCloseConfirmationDialogPrivate *priv; + + g_return_if_fail (GEDIT_IS_CLOSE_CONFIRMATION_DIALOG (dlg)); + + priv = dlg->priv; + + if (priv->selected_documents != NULL) + g_list_free (priv->selected_documents); + + if (response_id == GTK_RESPONSE_YES) + { + if (GET_MODE (priv) == SINGLE_DOC_MODE) + { + priv->selected_documents = + g_list_copy (priv->unsaved_documents); + } + else + { + g_return_if_fail (priv->list_store); + + priv->selected_documents = + get_selected_docs (priv->list_store); + } + } + else + priv->selected_documents = NULL; +} + +static void +set_logout_mode (GeditCloseConfirmationDialog *dlg, + gboolean logout_mode) +{ + dlg->priv->logout_mode = logout_mode; + + if (logout_mode) + { + gtk_dialog_add_button (GTK_DIALOG (dlg), + _("Log Out _without Saving"), + GTK_RESPONSE_NO); + + gedit_dialog_add_button (GTK_DIALOG (dlg), + _("_Cancel Logout"), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + } + else + { + gtk_dialog_add_button (GTK_DIALOG (dlg), + _("Close _without Saving"), + GTK_RESPONSE_NO); + + gtk_dialog_add_button (GTK_DIALOG (dlg), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); + } + + if (dlg->priv->disable_save_to_disk) + { + gtk_dialog_set_default_response (GTK_DIALOG (dlg), + GTK_RESPONSE_NO); + } + else + { + const gchar *stock_id = GTK_STOCK_SAVE; + + if (GET_MODE (dlg->priv) == SINGLE_DOC_MODE) + { + GeditDocument *doc; + + doc = GEDIT_DOCUMENT (dlg->priv->unsaved_documents->data); + + if (gedit_document_get_readonly (doc) || + gedit_document_is_untitled (doc)) + stock_id = GTK_STOCK_SAVE_AS; + } + + gtk_dialog_add_button (GTK_DIALOG (dlg), + stock_id, + GTK_RESPONSE_YES); + + gtk_dialog_set_default_response (GTK_DIALOG (dlg), + GTK_RESPONSE_YES); + } +} + +static void +gedit_close_confirmation_dialog_init (GeditCloseConfirmationDialog *dlg) +{ + AtkObject *atk_obj; + + dlg->priv = GEDIT_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE (dlg); + + dlg->priv->disable_save_to_disk = + gedit_app_get_lockdown (gedit_app_get_default ()) + & GEDIT_LOCKDOWN_SAVE_TO_DISK; + + gtk_container_set_border_width (GTK_CONTAINER (dlg), 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + 14); + gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE); + gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE); + gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dlg), TRUE); + + gtk_window_set_title (GTK_WINDOW (dlg), ""); + + gtk_window_set_modal (GTK_WINDOW (dlg), TRUE); + gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE); + + atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dlg)); + atk_object_set_role (atk_obj, ATK_ROLE_ALERT); + atk_object_set_name (atk_obj, _("Question")); + + g_signal_connect (dlg, + "response", + G_CALLBACK (response_cb), + NULL); +} + +static void +gedit_close_confirmation_dialog_finalize (GObject *object) +{ + GeditCloseConfirmationDialogPrivate *priv; + + priv = GEDIT_CLOSE_CONFIRMATION_DIALOG (object)->priv; + + if (priv->unsaved_documents != NULL) + g_list_free (priv->unsaved_documents); + + if (priv->selected_documents != NULL) + g_list_free (priv->selected_documents); + + /* Call the parent's destructor */ + G_OBJECT_CLASS (gedit_close_confirmation_dialog_parent_class)->finalize (object); +} + +static void +gedit_close_confirmation_dialog_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditCloseConfirmationDialog *dlg; + + dlg = GEDIT_CLOSE_CONFIRMATION_DIALOG (object); + + switch (prop_id) + { + case PROP_UNSAVED_DOCUMENTS: + set_unsaved_document (dlg, g_value_get_pointer (value)); + break; + + case PROP_LOGOUT_MODE: + set_logout_mode (dlg, g_value_get_boolean (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_close_confirmation_dialog_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditCloseConfirmationDialogPrivate *priv; + + priv = GEDIT_CLOSE_CONFIRMATION_DIALOG (object)->priv; + + switch( prop_id ) + { + case PROP_UNSAVED_DOCUMENTS: + g_value_set_pointer (value, priv->unsaved_documents); + break; + + case PROP_LOGOUT_MODE: + g_value_set_boolean (value, priv->logout_mode); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_close_confirmation_dialog_class_init (GeditCloseConfirmationDialogClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = gedit_close_confirmation_dialog_set_property; + gobject_class->get_property = gedit_close_confirmation_dialog_get_property; + gobject_class->finalize = gedit_close_confirmation_dialog_finalize; + + g_type_class_add_private (klass, sizeof (GeditCloseConfirmationDialogPrivate)); + + g_object_class_install_property (gobject_class, + PROP_UNSAVED_DOCUMENTS, + g_param_spec_pointer ("unsaved_documents", + "Unsaved Documents", + "List of Unsaved Documents", + (G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY))); + + g_object_class_install_property (gobject_class, + PROP_LOGOUT_MODE, + g_param_spec_boolean ("logout_mode", + "Logout Mode", + "Whether the dialog is in logout mode", + FALSE, + (G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY))); +} + +static GList * +get_selected_docs (GtkTreeModel *store) +{ + GList *list; + gboolean valid; + GtkTreeIter iter; + + list = NULL; + valid = gtk_tree_model_get_iter_first (store, &iter); + + while (valid) + { + gboolean to_save; + GeditDocument *doc; + + gtk_tree_model_get (store, &iter, + SAVE_COLUMN, &to_save, + DOC_COLUMN, &doc, + -1); + if (to_save) + list = g_list_prepend (list, doc); + + valid = gtk_tree_model_iter_next (store, &iter); + } + + list = g_list_reverse (list); + + return list; +} + +GList * +gedit_close_confirmation_dialog_get_selected_documents (GeditCloseConfirmationDialog *dlg) +{ + g_return_val_if_fail (GEDIT_IS_CLOSE_CONFIRMATION_DIALOG (dlg), NULL); + + return g_list_copy (dlg->priv->selected_documents); +} + +GtkWidget * +gedit_close_confirmation_dialog_new (GtkWindow *parent, + GList *unsaved_documents, + gboolean logout_mode) +{ + GtkWidget *dlg; + g_return_val_if_fail (unsaved_documents != NULL, NULL); + + dlg = GTK_WIDGET (g_object_new (GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG, + "unsaved_documents", unsaved_documents, + "logout_mode", logout_mode, + NULL)); + g_return_val_if_fail (dlg != NULL, NULL); + + if (parent != NULL) + { + gtk_window_group_add_window (gedit_window_get_group (GEDIT_WINDOW (parent)), + GTK_WINDOW (dlg)); + + gtk_window_set_transient_for (GTK_WINDOW (dlg), parent); + } + + return dlg; +} + +GtkWidget * +gedit_close_confirmation_dialog_new_single (GtkWindow *parent, + GeditDocument *doc, + gboolean logout_mode) +{ + GtkWidget *dlg; + GList *unsaved_documents; + g_return_val_if_fail (doc != NULL, NULL); + + unsaved_documents = g_list_prepend (NULL, doc); + + dlg = gedit_close_confirmation_dialog_new (parent, + unsaved_documents, + logout_mode); + + g_list_free (unsaved_documents); + + return dlg; +} + +static gchar * +get_text_secondary_label (GeditDocument *doc) +{ + glong seconds; + gchar *secondary_msg; + + seconds = MAX (1, _gedit_document_get_seconds_since_last_save_or_load (doc)); + + if (seconds < 55) + { + secondary_msg = g_strdup_printf ( + ngettext ("If you don't save, changes from the last %ld second " + "will be permanently lost.", + "If you don't save, changes from the last %ld seconds " + "will be permanently lost.", + seconds), + seconds); + } + else if (seconds < 75) /* 55 <= seconds < 75 */ + { + secondary_msg = g_strdup (_("If you don't save, changes from the last minute " + "will be permanently lost.")); + } + else if (seconds < 110) /* 75 <= seconds < 110 */ + { + secondary_msg = g_strdup_printf ( + ngettext ("If you don't save, changes from the last minute and %ld " + "second will be permanently lost.", + "If you don't save, changes from the last minute and %ld " + "seconds will be permanently lost.", + seconds - 60 ), + seconds - 60); + } + else if (seconds < 3600) + { + secondary_msg = g_strdup_printf ( + ngettext ("If you don't save, changes from the last %ld minute " + "will be permanently lost.", + "If you don't save, changes from the last %ld minutes " + "will be permanently lost.", + seconds / 60), + seconds / 60); + } + else if (seconds < 7200) + { + gint minutes; + seconds -= 3600; + + minutes = seconds / 60; + if (minutes < 5) + { + secondary_msg = g_strdup (_("If you don't save, changes from the last hour " + "will be permanently lost.")); + } + else + { + secondary_msg = g_strdup_printf ( + ngettext ("If you don't save, changes from the last hour and %d " + "minute will be permanently lost.", + "If you don't save, changes from the last hour and %d " + "minutes will be permanently lost.", + minutes), + minutes); + } + } + else + { + gint hours; + + hours = seconds / 3600; + + secondary_msg = g_strdup_printf ( + ngettext ("If you don't save, changes from the last %d hour " + "will be permanently lost.", + "If you don't save, changes from the last %d hours " + "will be permanently lost.", + hours), + hours); + } + + return secondary_msg; +} + +static void +build_single_doc_dialog (GeditCloseConfirmationDialog *dlg) +{ + GtkWidget *hbox; + GtkWidget *vbox; + GtkWidget *primary_label; + GtkWidget *secondary_label; + GtkWidget *image; + GeditDocument *doc; + gchar *doc_name; + gchar *str; + gchar *markup_str; + + g_return_if_fail (dlg->priv->unsaved_documents->data != NULL); + doc = GEDIT_DOCUMENT (dlg->priv->unsaved_documents->data); + + /* Image */ + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, + GTK_ICON_SIZE_DIALOG); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); + + /* Primary label */ + primary_label = gtk_label_new (NULL); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + doc_name = gedit_document_get_short_name_for_display (doc); + + if (dlg->priv->disable_save_to_disk) + { + str = g_markup_printf_escaped (_("Changes to document \"%s\" will be permanently lost."), + doc_name); + } + else + { + str = g_markup_printf_escaped (_("Save changes to document \"%s\" before closing?"), + doc_name); + } + + g_free (doc_name); + + markup_str = g_strconcat ("", str, "", NULL); + g_free (str); + + gtk_label_set_markup (GTK_LABEL (primary_label), markup_str); + g_free (markup_str); + + /* Secondary label */ + if (dlg->priv->disable_save_to_disk) + str = g_strdup (_("Saving has been disabled by the system administrator.")); + else + str = get_text_secondary_label (doc); + secondary_label = gtk_label_new (str); + g_free (str); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0.0, 0.5); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + + hbox = gtk_hbox_new (FALSE, 12); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + + vbox = gtk_vbox_new (FALSE, 12); + + gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); + + gtk_box_pack_start (GTK_BOX (vbox), primary_label, FALSE, FALSE, 0); + + gtk_box_pack_start (GTK_BOX (vbox), secondary_label, FALSE, FALSE, 0); + + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + hbox, + FALSE, + FALSE, + 0); + + gtk_widget_show_all (hbox); +} + +static void +populate_model (GtkTreeModel *store, GList *docs) +{ + GtkTreeIter iter; + + while (docs != NULL) + { + GeditDocument *doc; + gchar *name; + + doc = GEDIT_DOCUMENT (docs->data); + + name = gedit_document_get_short_name_for_display (doc); + + gtk_list_store_append (GTK_LIST_STORE (store), &iter); + gtk_list_store_set (GTK_LIST_STORE (store), &iter, + SAVE_COLUMN, TRUE, + NAME_COLUMN, name, + DOC_COLUMN, doc, + -1); + + g_free (name); + + docs = g_list_next (docs); + } +} + +static void +save_toggled (GtkCellRendererToggle *renderer, gchar *path_str, GtkTreeModel *store) +{ + GtkTreePath *path = gtk_tree_path_new_from_string (path_str); + GtkTreeIter iter; + gboolean active; + + gtk_tree_model_get_iter (store, &iter, path); + gtk_tree_model_get (store, &iter, SAVE_COLUMN, &active, -1); + + active ^= 1; + + gtk_list_store_set (GTK_LIST_STORE (store), &iter, + SAVE_COLUMN, active, -1); + + gtk_tree_path_free (path); +} + +static GtkWidget * +create_treeview (GeditCloseConfirmationDialogPrivate *priv) +{ + GtkListStore *store; + GtkWidget *treeview; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + treeview = gtk_tree_view_new (); + gtk_widget_set_size_request (treeview, 260, 120); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); + gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview), FALSE); + + /* Create and populate the model */ + store = gtk_list_store_new (N_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); + populate_model (GTK_TREE_MODEL (store), priv->unsaved_documents); + + /* Set model to the treeview */ + gtk_tree_view_set_model (GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (store)); + g_object_unref (store); + + priv->list_store = GTK_TREE_MODEL (store); + + /* Add columns */ + if (!priv->disable_save_to_disk) + { + renderer = gtk_cell_renderer_toggle_new (); + g_signal_connect (renderer, "toggled", + G_CALLBACK (save_toggled), store); + + column = gtk_tree_view_column_new_with_attributes ("Save?", + renderer, + "active", + SAVE_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column); + } + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Name", + renderer, + "text", + NAME_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column); + + return treeview; +} + +static void +build_multiple_docs_dialog (GeditCloseConfirmationDialog *dlg) +{ + GeditCloseConfirmationDialogPrivate *priv; + GtkWidget *hbox; + GtkWidget *image; + GtkWidget *vbox; + GtkWidget *primary_label; + GtkWidget *vbox2; + GtkWidget *select_label; + GtkWidget *scrolledwindow; + GtkWidget *treeview; + GtkWidget *secondary_label; + gchar *str; + gchar *markup_str; + + priv = dlg->priv; + + hbox = gtk_hbox_new (FALSE, 12); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + hbox, TRUE, TRUE, 0); + + /* Image */ + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, + GTK_ICON_SIZE_DIALOG); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + + vbox = gtk_vbox_new (FALSE, 12); + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); + + /* Primary label */ + primary_label = gtk_label_new (NULL); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + if (priv->disable_save_to_disk) + str = g_strdup_printf ( + ngettext ("Changes to %d document will be permanently lost.", + "Changes to %d documents will be permanently lost.", + g_list_length (priv->unsaved_documents)), + g_list_length (priv->unsaved_documents)); + else + str = g_strdup_printf ( + ngettext ("There is %d document with unsaved changes. " + "Save changes before closing?", + "There are %d documents with unsaved changes. " + "Save changes before closing?", + g_list_length (priv->unsaved_documents)), + g_list_length (priv->unsaved_documents)); + + markup_str = g_strconcat ("", str, "", NULL); + g_free (str); + + gtk_label_set_markup (GTK_LABEL (primary_label), markup_str); + g_free (markup_str); + gtk_box_pack_start (GTK_BOX (vbox), primary_label, FALSE, FALSE, 0); + + vbox2 = gtk_vbox_new (FALSE, 8); + gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0); + + if (priv->disable_save_to_disk) + select_label = gtk_label_new_with_mnemonic (_("Docum_ents with unsaved changes:")); + else + select_label = gtk_label_new_with_mnemonic (_("S_elect the documents you want to save:")); + + gtk_box_pack_start (GTK_BOX (vbox2), select_label, FALSE, FALSE, 0); + gtk_label_set_line_wrap (GTK_LABEL (select_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (select_label), 0.0, 0.5); + + scrolledwindow = gtk_scrolled_window_new (NULL, NULL); + gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow), + GTK_SHADOW_IN); + + treeview = create_treeview (priv); + gtk_container_add (GTK_CONTAINER (scrolledwindow), treeview); + + /* Secondary label */ + if (priv->disable_save_to_disk) + secondary_label = gtk_label_new (_("Saving has been disabled by the system administrator.")); + else + secondary_label = gtk_label_new (_("If you don't save, " + "all your changes will be permanently lost.")); + + gtk_box_pack_start (GTK_BOX (vbox2), secondary_label, FALSE, FALSE, 0); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + + gtk_label_set_mnemonic_widget (GTK_LABEL (select_label), treeview); + + gtk_widget_show_all (hbox); +} + +static void +set_unsaved_document (GeditCloseConfirmationDialog *dlg, + const GList *list) +{ + GeditCloseConfirmationDialogPrivate *priv; + + g_return_if_fail (list != NULL); + + priv = dlg->priv; + g_return_if_fail (priv->unsaved_documents == NULL); + + priv->unsaved_documents = g_list_copy ((GList *)list); + + if (GET_MODE (priv) == SINGLE_DOC_MODE) + { + build_single_doc_dialog (dlg); + } + else + { + build_multiple_docs_dialog (dlg); + } +} + +const GList * +gedit_close_confirmation_dialog_get_unsaved_documents (GeditCloseConfirmationDialog *dlg) +{ + g_return_val_if_fail (GEDIT_IS_CLOSE_CONFIRMATION_DIALOG (dlg), NULL); + + return dlg->priv->unsaved_documents; +} diff --git a/gedit/dialogs/gedit-close-confirmation-dialog.h b/gedit/dialogs/gedit-close-confirmation-dialog.h new file mode 100755 index 00000000..887fc1b4 --- /dev/null +++ b/gedit/dialogs/gedit-close-confirmation-dialog.h @@ -0,0 +1,75 @@ +/* + * gedit-close-confirmation-dialog.h + * This file is part of gedit + * + * Copyright (C) 2004-2005 MATE Foundation + * + * 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. + */ + +/* + * Modified by the gedit Team, 2004-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __GEDIT_CLOSE_CONFIRMATION_DIALOG_H__ +#define __GEDIT_CLOSE_CONFIRMATION_DIALOG_H__ + +#include +#include + +#include + +#define GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG (gedit_close_confirmation_dialog_get_type ()) +#define GEDIT_CLOSE_CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG, GeditCloseConfirmationDialog)) +#define GEDIT_CLOSE_CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG, GeditCloseConfirmationDialogClass)) +#define GEDIT_IS_CLOSE_CONFIRMATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG)) +#define GEDIT_IS_CLOSE_CONFIRMATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG)) +#define GEDIT_CLOSE_CONFIRMATION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GEDIT_TYPE_CLOSE_CONFIRMATION_DIALOG, GeditCloseConfirmationDialogClass)) + +typedef struct _GeditCloseConfirmationDialog GeditCloseConfirmationDialog; +typedef struct _GeditCloseConfirmationDialogClass GeditCloseConfirmationDialogClass; +typedef struct _GeditCloseConfirmationDialogPrivate GeditCloseConfirmationDialogPrivate; + +struct _GeditCloseConfirmationDialog +{ + GtkDialog parent; + + /*< private > */ + GeditCloseConfirmationDialogPrivate *priv; +}; + +struct _GeditCloseConfirmationDialogClass +{ + GtkDialogClass parent_class; +}; + +GType gedit_close_confirmation_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_close_confirmation_dialog_new (GtkWindow *parent, + GList *unsaved_documents, + gboolean logout_mode); +GtkWidget *gedit_close_confirmation_dialog_new_single (GtkWindow *parent, + GeditDocument *doc, + gboolean logout_mode); + +const GList *gedit_close_confirmation_dialog_get_unsaved_documents (GeditCloseConfirmationDialog *dlg); + +GList *gedit_close_confirmation_dialog_get_selected_documents (GeditCloseConfirmationDialog *dlg); + +#endif /* __GEDIT_CLOSE_CONFIRMATION_DIALOG_H__ */ + diff --git a/gedit/dialogs/gedit-encodings-dialog.c b/gedit/dialogs/gedit-encodings-dialog.c new file mode 100755 index 00000000..b4800805 --- /dev/null +++ b/gedit/dialogs/gedit-encodings-dialog.c @@ -0,0 +1,499 @@ +/* + * gedit-encodings-dialog.c + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include +#include +#include + +#include "gedit-encodings-dialog.h" +#include "gedit-encodings.h" +#include "gedit-prefs-manager.h" +#include "gedit-utils.h" +#include "gedit-debug.h" +#include "gedit-help.h" +#include "gedit-dirs.h" + +#define GEDIT_ENCODINGS_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_ENCODINGS_DIALOG, \ + GeditEncodingsDialogPrivate)) + +struct _GeditEncodingsDialogPrivate +{ + GtkListStore *available_liststore; + GtkListStore *displayed_liststore; + GtkWidget *available_treeview; + GtkWidget *displayed_treeview; + GtkWidget *add_button; + GtkWidget *remove_button; + + GSList *show_in_menu_list; +}; + +G_DEFINE_TYPE(GeditEncodingsDialog, gedit_encodings_dialog, GTK_TYPE_DIALOG) + +static void +gedit_encodings_dialog_finalize (GObject *object) +{ + GeditEncodingsDialogPrivate *priv = GEDIT_ENCODINGS_DIALOG (object)->priv; + + g_slist_free (priv->show_in_menu_list); + + G_OBJECT_CLASS (gedit_encodings_dialog_parent_class)->finalize (object); +} + +static void +gedit_encodings_dialog_class_init (GeditEncodingsDialogClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_encodings_dialog_finalize; + + g_type_class_add_private (object_class, sizeof (GeditEncodingsDialogPrivate)); +} + +enum { + COLUMN_NAME, + COLUMN_CHARSET, + N_COLUMNS +}; + +static void +count_selected_items_func (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) +{ + int *count = data; + + *count += 1; +} + +static void +available_selection_changed_callback (GtkTreeSelection *selection, + GeditEncodingsDialog *dialogs) +{ + int count; + + count = 0; + gtk_tree_selection_selected_foreach (selection, + count_selected_items_func, + &count); + + gtk_widget_set_sensitive (dialogs->priv->add_button, count > 0); +} + +static void +displayed_selection_changed_callback (GtkTreeSelection *selection, + GeditEncodingsDialog *dialogs) +{ + int count; + + count = 0; + gtk_tree_selection_selected_foreach (selection, + count_selected_items_func, + &count); + + gtk_widget_set_sensitive (dialogs->priv->remove_button, count > 0); +} + +static void +get_selected_encodings_func (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) +{ + GSList **list = data; + gchar *charset; + const GeditEncoding *enc; + + charset = NULL; + gtk_tree_model_get (model, iter, COLUMN_CHARSET, &charset, -1); + + enc = gedit_encoding_get_from_charset (charset); + g_free (charset); + + *list = g_slist_prepend (*list, (gpointer)enc); +} + +static void +update_shown_in_menu_tree_model (GtkListStore *store, + GSList *list) +{ + GtkTreeIter iter; + + gtk_list_store_clear (store); + + while (list != NULL) + { + const GeditEncoding *enc; + + enc = (const GeditEncoding*) list->data; + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + COLUMN_CHARSET, + gedit_encoding_get_charset (enc), + COLUMN_NAME, + gedit_encoding_get_name (enc), -1); + + list = g_slist_next (list); + } +} + +static void +add_button_clicked_callback (GtkWidget *button, + GeditEncodingsDialog *dialog) +{ + GtkTreeSelection *selection; + GSList *encodings; + GSList *tmp; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->available_treeview)); + + encodings = NULL; + gtk_tree_selection_selected_foreach (selection, + get_selected_encodings_func, + &encodings); + + tmp = encodings; + while (tmp != NULL) + { + if (g_slist_find (dialog->priv->show_in_menu_list, tmp->data) == NULL) + dialog->priv->show_in_menu_list = g_slist_prepend (dialog->priv->show_in_menu_list, + tmp->data); + + tmp = g_slist_next (tmp); + } + + g_slist_free (encodings); + + update_shown_in_menu_tree_model (GTK_LIST_STORE (dialog->priv->displayed_liststore), + dialog->priv->show_in_menu_list); +} + +static void +remove_button_clicked_callback (GtkWidget *button, + GeditEncodingsDialog *dialog) +{ + GtkTreeSelection *selection; + GSList *encodings; + GSList *tmp; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->displayed_treeview)); + + encodings = NULL; + gtk_tree_selection_selected_foreach (selection, + get_selected_encodings_func, + &encodings); + + tmp = encodings; + while (tmp != NULL) + { + dialog->priv->show_in_menu_list = g_slist_remove (dialog->priv->show_in_menu_list, + tmp->data); + + tmp = g_slist_next (tmp); + } + + g_slist_free (encodings); + + update_shown_in_menu_tree_model (GTK_LIST_STORE (dialog->priv->displayed_liststore), + dialog->priv->show_in_menu_list); +} + +static void +init_shown_in_menu_tree_model (GeditEncodingsDialog *dialog) +{ + GtkTreeIter iter; + GSList *list, *tmp; + + /* add data to the list store */ + list = gedit_prefs_manager_get_shown_in_menu_encodings (); + + tmp = list; + + while (tmp != NULL) + { + const GeditEncoding *enc; + + enc = (const GeditEncoding *) tmp->data; + + dialog->priv->show_in_menu_list = g_slist_prepend (dialog->priv->show_in_menu_list, + tmp->data); + + gtk_list_store_append (dialog->priv->displayed_liststore, + &iter); + gtk_list_store_set (dialog->priv->displayed_liststore, + &iter, + COLUMN_CHARSET, + gedit_encoding_get_charset (enc), + COLUMN_NAME, + gedit_encoding_get_name (enc), -1); + + tmp = g_slist_next (tmp); + } + + g_slist_free (list); +} + +static void +response_handler (GtkDialog *dialog, + gint response_id, + GeditEncodingsDialog *dlg) +{ + if (response_id == GTK_RESPONSE_HELP) + { + gedit_help_display (GTK_WINDOW (dialog), "gedit", NULL); + g_signal_stop_emission_by_name (dialog, "response"); + return; + } + + if (response_id == GTK_RESPONSE_OK) + { + g_return_if_fail (gedit_prefs_manager_shown_in_menu_encodings_can_set ()); + gedit_prefs_manager_set_shown_in_menu_encodings (dlg->priv->show_in_menu_list); + } +} + +static void +gedit_encodings_dialog_init (GeditEncodingsDialog *dlg) +{ + GtkWidget *content; + GtkCellRenderer *cell_renderer; + GtkTreeModel *sort_model; + GtkTreeViewColumn *column; + GtkTreeIter parent_iter; + GtkTreeSelection *selection; + const GeditEncoding *enc; + GtkWidget *error_widget; + int i; + gboolean ret; + gchar *file; + gchar *root_objects[] = { + "encodings-dialog-contents", + NULL + }; + + dlg->priv = GEDIT_ENCODINGS_DIALOG_GET_PRIVATE (dlg); + + gtk_dialog_add_buttons (GTK_DIALOG (dlg), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, + GTK_RESPONSE_OK, + GTK_STOCK_HELP, + GTK_RESPONSE_HELP, + NULL); + + gtk_window_set_title (GTK_WINDOW (dlg), _("Character Encodings")); + gtk_window_set_default_size (GTK_WINDOW (dlg), 650, 400); + gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE); + + /* HIG defaults */ + gtk_container_set_border_width (GTK_CONTAINER (dlg), 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + 2); /* 2 * 5 + 2 = 12 */ + gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), + 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), 6); + + gtk_dialog_set_default_response (GTK_DIALOG (dlg), + GTK_RESPONSE_OK); + + g_signal_connect (dlg, + "response", + G_CALLBACK (response_handler), + dlg); + + file = gedit_dirs_get_ui_file ("gedit-encodings-dialog.ui"); + ret = gedit_utils_get_ui_objects (file, + root_objects, + &error_widget, + "encodings-dialog-contents", &content, + "add-button", &dlg->priv->add_button, + "remove-button", &dlg->priv->remove_button, + "available-treeview", &dlg->priv->available_treeview, + "displayed-treeview", &dlg->priv->displayed_treeview, + NULL); + g_free (file); + + if (!ret) + { + gtk_widget_show (error_widget); + + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + error_widget, + TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (error_widget), 5); + + return; + } + + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + content, TRUE, TRUE, 0); + g_object_unref (content); + gtk_container_set_border_width (GTK_CONTAINER (content), 5); + + g_signal_connect (dlg->priv->add_button, + "clicked", + G_CALLBACK (add_button_clicked_callback), + dlg); + g_signal_connect (dlg->priv->remove_button, + "clicked", + G_CALLBACK (remove_button_clicked_callback), + dlg); + + /* Tree view of available encodings */ + dlg->priv->available_liststore = gtk_list_store_new (N_COLUMNS, + G_TYPE_STRING, + G_TYPE_STRING); + + cell_renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("_Description"), + cell_renderer, + "text", COLUMN_NAME, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (dlg->priv->available_treeview), + column); + gtk_tree_view_column_set_sort_column_id (column, COLUMN_NAME); + + cell_renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("_Encoding"), + cell_renderer, + "text", + COLUMN_CHARSET, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (dlg->priv->available_treeview), + column); + gtk_tree_view_column_set_sort_column_id (column, COLUMN_CHARSET); + + /* Add the data */ + i = 0; + while ((enc = gedit_encoding_get_from_index (i)) != NULL) + { + gtk_list_store_append (dlg->priv->available_liststore, + &parent_iter); + gtk_list_store_set (dlg->priv->available_liststore, + &parent_iter, + COLUMN_CHARSET, + gedit_encoding_get_charset (enc), + COLUMN_NAME, + gedit_encoding_get_name (enc), -1); + + ++i; + } + + /* Sort model */ + sort_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (dlg->priv->available_liststore)); + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model), + COLUMN_NAME, + GTK_SORT_ASCENDING); + + gtk_tree_view_set_model (GTK_TREE_VIEW (dlg->priv->available_treeview), + sort_model); + g_object_unref (G_OBJECT (dlg->priv->available_liststore)); + g_object_unref (G_OBJECT (sort_model)); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dlg->priv->available_treeview)); + gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection), + GTK_SELECTION_MULTIPLE); + + available_selection_changed_callback (selection, dlg); + g_signal_connect (selection, + "changed", + G_CALLBACK (available_selection_changed_callback), + dlg); + + /* Tree view of selected encodings */ + dlg->priv->displayed_liststore = gtk_list_store_new (N_COLUMNS, + G_TYPE_STRING, + G_TYPE_STRING); + + cell_renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("_Description"), + cell_renderer, + "text", COLUMN_NAME, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (dlg->priv->displayed_treeview), + column); + gtk_tree_view_column_set_sort_column_id (column, COLUMN_NAME); + + cell_renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes (_("_Encoding"), + cell_renderer, + "text", + COLUMN_CHARSET, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (dlg->priv->displayed_treeview), + column); + gtk_tree_view_column_set_sort_column_id (column, COLUMN_CHARSET); + + /* Add the data */ + init_shown_in_menu_tree_model (dlg); + + /* Sort model */ + sort_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (dlg->priv->displayed_liststore)); + + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE + (sort_model), COLUMN_NAME, + GTK_SORT_ASCENDING); + + gtk_tree_view_set_model (GTK_TREE_VIEW (dlg->priv->displayed_treeview), + sort_model); + g_object_unref (G_OBJECT (sort_model)); + g_object_unref (G_OBJECT (dlg->priv->displayed_liststore)); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dlg->priv->displayed_treeview)); + gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection), + GTK_SELECTION_MULTIPLE); + + displayed_selection_changed_callback (selection, dlg); + g_signal_connect (selection, + "changed", + G_CALLBACK (displayed_selection_changed_callback), + dlg); +} + +GtkWidget * +gedit_encodings_dialog_new (void) +{ + GtkWidget *dlg; + + dlg = GTK_WIDGET (g_object_new (GEDIT_TYPE_ENCODINGS_DIALOG, NULL)); + + return dlg; +} + diff --git a/gedit/dialogs/gedit-encodings-dialog.h b/gedit/dialogs/gedit-encodings-dialog.h new file mode 100755 index 00000000..a09cbe5c --- /dev/null +++ b/gedit/dialogs/gedit-encodings-dialog.h @@ -0,0 +1,86 @@ +/* + * gedit-encodings-dialog.h + * This file is part of gedit + * + * Copyright (C) 2003-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_ENCODINGS_DIALOG_H__ +#define __GEDIT_ENCODINGS_DIALOG_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_ENCODINGS_DIALOG (gedit_encodings_dialog_get_type()) +#define GEDIT_ENCODINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_ENCODINGS_DIALOG, GeditEncodingsDialog)) +#define GEDIT_ENCODINGS_DIALOG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_ENCODINGS_DIALOG, GeditEncodingsDialog const)) +#define GEDIT_ENCODINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_ENCODINGS_DIALOG, GeditEncodingsDialogClass)) +#define GEDIT_IS_ENCODINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_ENCODINGS_DIALOG)) +#define GEDIT_IS_ENCODINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_ENCODINGS_DIALOG)) +#define GEDIT_ENCODINGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_ENCODINGS_DIALOG, GeditEncodingsDialogClass)) + + +/* Private structure type */ +typedef struct _GeditEncodingsDialogPrivate GeditEncodingsDialogPrivate; + +/* + * Main object structure + */ +typedef struct _GeditEncodingsDialog GeditEncodingsDialog; + +struct _GeditEncodingsDialog +{ + GtkDialog dialog; + + /*< private > */ + GeditEncodingsDialogPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditEncodingsDialogClass GeditEncodingsDialogClass; + +struct _GeditEncodingsDialogClass +{ + GtkDialogClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_encodings_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_encodings_dialog_new (void); + +G_END_DECLS + +#endif /* __GEDIT_ENCODINGS_DIALOG_H__ */ + diff --git a/gedit/dialogs/gedit-encodings-dialog.ui b/gedit/dialogs/gedit-encodings-dialog.ui new file mode 100755 index 00000000..0f37b432 --- /dev/null +++ b/gedit/dialogs/gedit-encodings-dialog.ui @@ -0,0 +1,256 @@ + + + + + 650 + 400 + Character encodings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + True + True + False + + + True + False + 0 + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + + + + + 0 + False + True + GTK_PACK_END + + + + + 6 + True + True + 6 + + + True + False + 6 + + + True + A_vailable encodings: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + available-treeview + + + 0 + False + False + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN + GTK_CORNER_TOP_LEFT + + + True + True + True + True + False + True + + + + + 0 + True + True + + + + + True + False + 0 + + + True + True + gtk-add + True + GTK_RELIEF_NORMAL + + + 0 + False + False + + + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + True + False + 6 + + + True + E_ncodings shown in menu: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + displayed-treeview + + + 0 + False + False + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN + GTK_CORNER_TOP_LEFT + + + True + True + True + True + False + True + + + + + 0 + True + True + + + + + True + False + 0 + + + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + + + 0 + False + False + + + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + helpbutton1 + closebutton1 + button1 + + + diff --git a/gedit/dialogs/gedit-preferences-dialog.c b/gedit/dialogs/gedit-preferences-dialog.c new file mode 100755 index 00000000..52f180fa --- /dev/null +++ b/gedit/dialogs/gedit-preferences-dialog.c @@ -0,0 +1,1189 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-preferences-dialog.c + * This file is part of gedit + * + * Copyright (C) 2001-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2001-2003. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include + +#include + +#include "gedit-preferences-dialog.h" +#include "gedit-utils.h" +#include "gedit-debug.h" +#include "gedit-document.h" +#include "gedit-style-scheme-manager.h" +#include "gedit-plugin-manager.h" +#include "gedit-help.h" +#include "gedit-dirs.h" + +/* + * gedit-preferences dialog is a singleton since we don't + * want two dialogs showing an inconsistent state of the + * preferences. + * When gedit_show_preferences_dialog is called and there + * is already a prefs dialog dialog open, it is reparented + * and shown. + */ + +static GtkWidget *preferences_dialog = NULL; + + +enum +{ + ID_COLUMN = 0, + NAME_COLUMN, + DESC_COLUMN, + NUM_COLUMNS +}; + + +#define GEDIT_PREFERENCES_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_PREFERENCES_DIALOG, \ + GeditPreferencesDialogPrivate)) + +struct _GeditPreferencesDialogPrivate +{ + GtkWidget *notebook; + + /* Font */ + GtkWidget *default_font_checkbutton; + GtkWidget *font_button; + GtkWidget *font_hbox; + + /* Style Scheme */ + GtkListStore *schemes_treeview_model; + GtkWidget *schemes_treeview; + GtkWidget *install_scheme_button; + GtkWidget *uninstall_scheme_button; + + GtkWidget *install_scheme_file_schooser; + + /* Tabs */ + GtkWidget *tabs_width_spinbutton; + GtkWidget *insert_spaces_checkbutton; + GtkWidget *tabs_width_hbox; + + /* Auto indentation */ + GtkWidget *auto_indent_checkbutton; + + /* Text Wrapping */ + GtkWidget *wrap_text_checkbutton; + GtkWidget *split_checkbutton; + + /* File Saving */ + GtkWidget *backup_copy_checkbutton; + GtkWidget *auto_save_checkbutton; + GtkWidget *auto_save_spinbutton; + GtkWidget *autosave_hbox; + + /* Line numbers */ + GtkWidget *display_line_numbers_checkbutton; + + /* Highlight current line */ + GtkWidget *highlight_current_line_checkbutton; + + /* Highlight matching bracket */ + GtkWidget *bracket_matching_checkbutton; + + /* Right margin */ + GtkWidget *right_margin_checkbutton; + GtkWidget *right_margin_position_spinbutton; + GtkWidget *right_margin_position_hbox; + + /* Plugins manager */ + GtkWidget *plugin_manager_place_holder; + + /* Style Scheme editor dialog */ + GtkWidget *style_scheme_dialog; +}; + + +G_DEFINE_TYPE(GeditPreferencesDialog, gedit_preferences_dialog, GTK_TYPE_DIALOG) + + +static void +gedit_preferences_dialog_class_init (GeditPreferencesDialogClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GeditPreferencesDialogPrivate)); +} + +static void +dialog_response_handler (GtkDialog *dlg, + gint res_id) +{ + gedit_debug (DEBUG_PREFS); + + switch (res_id) + { + case GTK_RESPONSE_HELP: + gedit_help_display (GTK_WINDOW (dlg), + NULL, + "gedit-prefs"); + + g_signal_stop_emission_by_name (dlg, "response"); + + break; + + default: + gtk_widget_destroy (GTK_WIDGET(dlg)); + } +} + +static void +tabs_width_spinbutton_value_changed (GtkSpinButton *spin_button, + GeditPreferencesDialog *dlg) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (spin_button == GTK_SPIN_BUTTON (dlg->priv->tabs_width_spinbutton)); + + gedit_prefs_manager_set_tabs_size (gtk_spin_button_get_value_as_int (spin_button)); +} + +static void +insert_spaces_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->insert_spaces_checkbutton)); + + gedit_prefs_manager_set_insert_spaces (gtk_toggle_button_get_active (button)); +} + +static void +auto_indent_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->auto_indent_checkbutton)); + + gedit_prefs_manager_set_auto_indent (gtk_toggle_button_get_active (button)); +} + +static void +auto_save_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->auto_save_checkbutton)); + + if (gtk_toggle_button_get_active (button)) + { + gtk_widget_set_sensitive (dlg->priv->auto_save_spinbutton, + gedit_prefs_manager_auto_save_interval_can_set()); + + gedit_prefs_manager_set_auto_save (TRUE); + } + else + { + gtk_widget_set_sensitive (dlg->priv->auto_save_spinbutton, FALSE); + gedit_prefs_manager_set_auto_save (FALSE); + } +} + +static void +backup_copy_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->backup_copy_checkbutton)); + + gedit_prefs_manager_set_create_backup_copy (gtk_toggle_button_get_active (button)); +} + +static void +auto_save_spinbutton_value_changed (GtkSpinButton *spin_button, + GeditPreferencesDialog *dlg) +{ + g_return_if_fail (spin_button == GTK_SPIN_BUTTON (dlg->priv->auto_save_spinbutton)); + + gedit_prefs_manager_set_auto_save_interval ( + MAX (1, gtk_spin_button_get_value_as_int (spin_button))); +} + +static void +setup_editor_page (GeditPreferencesDialog *dlg) +{ + gboolean auto_save; + gint auto_save_interval; + + gedit_debug (DEBUG_PREFS); + + /* Set initial state */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->priv->tabs_width_spinbutton), + (guint) gedit_prefs_manager_get_tabs_size ()); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->insert_spaces_checkbutton), + gedit_prefs_manager_get_insert_spaces ()); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->auto_indent_checkbutton), + gedit_prefs_manager_get_auto_indent ()); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_copy_checkbutton), + gedit_prefs_manager_get_create_backup_copy ()); + + auto_save = gedit_prefs_manager_get_auto_save (); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->auto_save_checkbutton), + auto_save); + + auto_save_interval = gedit_prefs_manager_get_auto_save_interval (); + if (auto_save_interval <= 0) + auto_save_interval = GPM_DEFAULT_AUTO_SAVE_INTERVAL; + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->priv->auto_save_spinbutton), + auto_save_interval); + + /* Set widget sensitivity */ + gtk_widget_set_sensitive (dlg->priv->tabs_width_hbox, + gedit_prefs_manager_tabs_size_can_set ()); + gtk_widget_set_sensitive (dlg->priv->insert_spaces_checkbutton, + gedit_prefs_manager_insert_spaces_can_set ()); + gtk_widget_set_sensitive (dlg->priv->auto_indent_checkbutton, + gedit_prefs_manager_auto_indent_can_set ()); + gtk_widget_set_sensitive (dlg->priv->backup_copy_checkbutton, + gedit_prefs_manager_create_backup_copy_can_set ()); + gtk_widget_set_sensitive (dlg->priv->autosave_hbox, + gedit_prefs_manager_auto_save_can_set ()); + gtk_widget_set_sensitive (dlg->priv->auto_save_spinbutton, + auto_save && + gedit_prefs_manager_auto_save_interval_can_set ()); + + /* Connect signal */ + g_signal_connect (dlg->priv->tabs_width_spinbutton, + "value_changed", + G_CALLBACK (tabs_width_spinbutton_value_changed), + dlg); + g_signal_connect (dlg->priv->insert_spaces_checkbutton, + "toggled", + G_CALLBACK (insert_spaces_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->auto_indent_checkbutton, + "toggled", + G_CALLBACK (auto_indent_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->auto_save_checkbutton, + "toggled", + G_CALLBACK (auto_save_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->backup_copy_checkbutton, + "toggled", + G_CALLBACK (backup_copy_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->auto_save_spinbutton, + "value_changed", + G_CALLBACK (auto_save_spinbutton_value_changed), + dlg); +} + +static void +display_line_numbers_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + g_return_if_fail (button == + GTK_TOGGLE_BUTTON (dlg->priv->display_line_numbers_checkbutton)); + + gedit_prefs_manager_set_display_line_numbers (gtk_toggle_button_get_active (button)); +} + +static void +highlight_current_line_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + g_return_if_fail (button == + GTK_TOGGLE_BUTTON (dlg->priv->highlight_current_line_checkbutton)); + + gedit_prefs_manager_set_highlight_current_line (gtk_toggle_button_get_active (button)); +} + +static void +bracket_matching_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + g_return_if_fail (button == + GTK_TOGGLE_BUTTON (dlg->priv->bracket_matching_checkbutton)); + + gedit_prefs_manager_set_bracket_matching ( + gtk_toggle_button_get_active (button)); +} + +static gboolean split_button_state = TRUE; + +static void +wrap_mode_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->wrap_text_checkbutton))) + { + gedit_prefs_manager_set_wrap_mode (GTK_WRAP_NONE); + + gtk_widget_set_sensitive (dlg->priv->split_checkbutton, + FALSE); + gtk_toggle_button_set_inconsistent ( + GTK_TOGGLE_BUTTON (dlg->priv->split_checkbutton), TRUE); + } + else + { + gtk_widget_set_sensitive (dlg->priv->split_checkbutton, + TRUE); + + gtk_toggle_button_set_inconsistent ( + GTK_TOGGLE_BUTTON (dlg->priv->split_checkbutton), FALSE); + + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->split_checkbutton))) + { + split_button_state = TRUE; + + gedit_prefs_manager_set_wrap_mode (GTK_WRAP_WORD); + } + else + { + split_button_state = FALSE; + + gedit_prefs_manager_set_wrap_mode (GTK_WRAP_CHAR); + } + } +} + +static void +right_margin_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + gboolean active; + + g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->right_margin_checkbutton)); + + active = gtk_toggle_button_get_active (button); + + gedit_prefs_manager_set_display_right_margin (active); + + gtk_widget_set_sensitive (dlg->priv->right_margin_position_hbox, + active && + gedit_prefs_manager_right_margin_position_can_set ()); +} + +static void +right_margin_position_spinbutton_value_changed (GtkSpinButton *spin_button, + GeditPreferencesDialog *dlg) +{ + gint value; + + g_return_if_fail (spin_button == GTK_SPIN_BUTTON (dlg->priv->right_margin_position_spinbutton)); + + value = CLAMP (gtk_spin_button_get_value_as_int (spin_button), 1, 160); + + gedit_prefs_manager_set_right_margin_position (value); +} + +static void +setup_view_page (GeditPreferencesDialog *dlg) +{ + GtkWrapMode wrap_mode; + gboolean display_right_margin; + gboolean wrap_mode_can_set; + + gedit_debug (DEBUG_PREFS); + + /* Set initial state */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->display_line_numbers_checkbutton), + gedit_prefs_manager_get_display_line_numbers ()); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->highlight_current_line_checkbutton), + gedit_prefs_manager_get_highlight_current_line ()); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->bracket_matching_checkbutton), + gedit_prefs_manager_get_bracket_matching ()); + + wrap_mode = gedit_prefs_manager_get_wrap_mode (); + switch (wrap_mode ) + { + case GTK_WRAP_WORD: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (dlg->priv->wrap_text_checkbutton), TRUE); + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (dlg->priv->split_checkbutton), TRUE); + break; + case GTK_WRAP_CHAR: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (dlg->priv->wrap_text_checkbutton), TRUE); + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (dlg->priv->split_checkbutton), FALSE); + break; + default: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (dlg->priv->wrap_text_checkbutton), FALSE); + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (dlg->priv->split_checkbutton), split_button_state); + gtk_toggle_button_set_inconsistent ( + GTK_TOGGLE_BUTTON (dlg->priv->split_checkbutton), TRUE); + + } + + display_right_margin = gedit_prefs_manager_get_display_right_margin (); + + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (dlg->priv->right_margin_checkbutton), + display_right_margin); + + gtk_spin_button_set_value ( + GTK_SPIN_BUTTON (dlg->priv->right_margin_position_spinbutton), + (guint)CLAMP (gedit_prefs_manager_get_right_margin_position (), 1, 160)); + + /* Set widgets sensitivity */ + gtk_widget_set_sensitive (dlg->priv->display_line_numbers_checkbutton, + gedit_prefs_manager_display_line_numbers_can_set ()); + gtk_widget_set_sensitive (dlg->priv->highlight_current_line_checkbutton, + gedit_prefs_manager_highlight_current_line_can_set ()); + gtk_widget_set_sensitive (dlg->priv->bracket_matching_checkbutton, + gedit_prefs_manager_bracket_matching_can_set ()); + wrap_mode_can_set = gedit_prefs_manager_wrap_mode_can_set (); + gtk_widget_set_sensitive (dlg->priv->wrap_text_checkbutton, + wrap_mode_can_set); + gtk_widget_set_sensitive (dlg->priv->split_checkbutton, + wrap_mode_can_set && + (wrap_mode != GTK_WRAP_NONE)); + gtk_widget_set_sensitive (dlg->priv->right_margin_checkbutton, + gedit_prefs_manager_display_right_margin_can_set ()); + gtk_widget_set_sensitive (dlg->priv->right_margin_position_hbox, + display_right_margin && + gedit_prefs_manager_right_margin_position_can_set ()); + + /* Connect signals */ + g_signal_connect (dlg->priv->display_line_numbers_checkbutton, + "toggled", + G_CALLBACK (display_line_numbers_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->highlight_current_line_checkbutton, + "toggled", + G_CALLBACK (highlight_current_line_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->bracket_matching_checkbutton, + "toggled", + G_CALLBACK (bracket_matching_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->wrap_text_checkbutton, + "toggled", + G_CALLBACK (wrap_mode_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->split_checkbutton, + "toggled", + G_CALLBACK (wrap_mode_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->right_margin_checkbutton, + "toggled", + G_CALLBACK (right_margin_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->right_margin_position_spinbutton, + "value_changed", + G_CALLBACK (right_margin_position_spinbutton_value_changed), + dlg); +} + +static void +default_font_font_checkbutton_toggled (GtkToggleButton *button, + GeditPreferencesDialog *dlg) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->default_font_checkbutton)); + + if (gtk_toggle_button_get_active (button)) + { + gtk_widget_set_sensitive (dlg->priv->font_hbox, FALSE); + gedit_prefs_manager_set_use_default_font (TRUE); + } + else + { + gtk_widget_set_sensitive (dlg->priv->font_hbox, + gedit_prefs_manager_editor_font_can_set ()); + gedit_prefs_manager_set_use_default_font (FALSE); + } +} + +static void +editor_font_button_font_set (GtkFontButton *font_button, + GeditPreferencesDialog *dlg) +{ + const gchar *font_name; + + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (font_button == GTK_FONT_BUTTON (dlg->priv->font_button)); + + /* FIXME: Can this fail? Gtk docs are a bit terse... 21-02-2004 pbor */ + font_name = gtk_font_button_get_font_name (font_button); + if (!font_name) + { + g_warning ("Could not get font name"); + return; + } + + gedit_prefs_manager_set_editor_font (font_name); +} + +static void +setup_font_colors_page_font_section (GeditPreferencesDialog *dlg) +{ + gboolean use_default_font; + gchar *editor_font = NULL; + gchar *label; + + gedit_debug (DEBUG_PREFS); + + gtk_widget_set_tooltip_text (dlg->priv->font_button, + _("Click on this button to select the font to be used by the editor")); + + gedit_utils_set_atk_relation (dlg->priv->font_button, + dlg->priv->default_font_checkbutton, + ATK_RELATION_CONTROLLED_BY); + gedit_utils_set_atk_relation (dlg->priv->default_font_checkbutton, + dlg->priv->font_button, + ATK_RELATION_CONTROLLER_FOR); + + editor_font = gedit_prefs_manager_get_system_font (); + label = g_strdup_printf(_("_Use the system fixed width font (%s)"), + editor_font); + gtk_button_set_label (GTK_BUTTON (dlg->priv->default_font_checkbutton), + label); + g_free (editor_font); + g_free (label); + + /* read current config and setup initial state */ + use_default_font = gedit_prefs_manager_get_use_default_font (); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->default_font_checkbutton), + use_default_font); + + editor_font = gedit_prefs_manager_get_editor_font (); + if (editor_font != NULL) + { + gtk_font_button_set_font_name (GTK_FONT_BUTTON (dlg->priv->font_button), + editor_font); + g_free (editor_font); + } + + /* Connect signals */ + g_signal_connect (dlg->priv->default_font_checkbutton, + "toggled", + G_CALLBACK (default_font_font_checkbutton_toggled), + dlg); + g_signal_connect (dlg->priv->font_button, + "font_set", + G_CALLBACK (editor_font_button_font_set), + dlg); + + /* Set initial widget sensitivity */ + gtk_widget_set_sensitive (dlg->priv->default_font_checkbutton, + gedit_prefs_manager_use_default_font_can_set ()); + + if (use_default_font) + gtk_widget_set_sensitive (dlg->priv->font_hbox, FALSE); + else + gtk_widget_set_sensitive (dlg->priv->font_hbox, + gedit_prefs_manager_editor_font_can_set ()); +} + +static void +set_buttons_sensisitivity_according_to_scheme (GeditPreferencesDialog *dlg, + const gchar *scheme_id) +{ + gboolean editable; + + editable = (scheme_id != NULL) && + _gedit_style_scheme_manager_scheme_is_gedit_user_scheme ( + gedit_get_style_scheme_manager (), + scheme_id); + + gtk_widget_set_sensitive (dlg->priv->uninstall_scheme_button, + editable); +} + +static void +style_scheme_changed (GtkWidget *treeview, + GeditPreferencesDialog *dlg) +{ + GtkTreePath *path; + GtkTreeIter iter; + gchar *id; + + gtk_tree_view_get_cursor (GTK_TREE_VIEW (dlg->priv->schemes_treeview), &path, NULL); + gtk_tree_model_get_iter (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model), + &iter, path); + gtk_tree_path_free (path); + gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model), + &iter, ID_COLUMN, &id, -1); + + gedit_prefs_manager_set_source_style_scheme (id); + + set_buttons_sensisitivity_according_to_scheme (dlg, id); + + g_free (id); +} + +static const gchar * +ensure_color_scheme_id (const gchar *id) +{ + GtkSourceStyleScheme *scheme = NULL; + GtkSourceStyleSchemeManager *manager = gedit_get_style_scheme_manager (); + + if (id == NULL) + { + gchar *pref_id; + + pref_id = gedit_prefs_manager_get_source_style_scheme (); + scheme = gtk_source_style_scheme_manager_get_scheme (manager, + pref_id); + g_free (pref_id); + } + else + { + scheme = gtk_source_style_scheme_manager_get_scheme (manager, + id); + } + + if (scheme == NULL) + { + /* Fall-back to classic style scheme */ + scheme = gtk_source_style_scheme_manager_get_scheme (manager, + "classic"); + } + + if (scheme == NULL) + { + /* Cannot determine default style scheme -> broken GtkSourceView installation */ + return NULL; + } + + return gtk_source_style_scheme_get_id (scheme); +} + +/* If def_id is NULL, use the default scheme as returned by + * gedit_style_scheme_manager_get_default_scheme. If this one returns NULL + * use the first available scheme as default */ +static const gchar * +populate_color_scheme_list (GeditPreferencesDialog *dlg, const gchar *def_id) +{ + GSList *schemes; + GSList *l; + + gtk_list_store_clear (dlg->priv->schemes_treeview_model); + + def_id = ensure_color_scheme_id (def_id); + if (def_id == NULL) + { + g_warning ("Cannot build the list of available color schemes.\n" + "Please check your GtkSourceView installation."); + return NULL; + } + + schemes = gedit_style_scheme_manager_list_schemes_sorted (gedit_get_style_scheme_manager ()); + l = schemes; + while (l != NULL) + { + GtkSourceStyleScheme *scheme; + const gchar *id; + const gchar *name; + const gchar *description; + GtkTreeIter iter; + + scheme = GTK_SOURCE_STYLE_SCHEME (l->data); + + id = gtk_source_style_scheme_get_id (scheme); + name = gtk_source_style_scheme_get_name (scheme); + description = gtk_source_style_scheme_get_description (scheme); + + gtk_list_store_append (dlg->priv->schemes_treeview_model, &iter); + gtk_list_store_set (dlg->priv->schemes_treeview_model, + &iter, + ID_COLUMN, id, + NAME_COLUMN, name, + DESC_COLUMN, description, + -1); + + g_return_val_if_fail (def_id != NULL, NULL); + if (strcmp (id, def_id) == 0) + { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dlg->priv->schemes_treeview)); + gtk_tree_selection_select_iter (selection, &iter); + } + + l = g_slist_next (l); + } + + g_slist_free (schemes); + + return def_id; +} + +static void +add_scheme_chooser_response_cb (GtkDialog *chooser, + gint res_id, + GeditPreferencesDialog *dlg) +{ + gchar* filename; + const gchar *scheme_id; + + if (res_id != GTK_RESPONSE_ACCEPT) + { + gtk_widget_hide (GTK_WIDGET (chooser)); + return; + } + + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); + if (filename == NULL) + return; + + gtk_widget_hide (GTK_WIDGET (chooser)); + + scheme_id = _gedit_style_scheme_manager_install_scheme ( + gedit_get_style_scheme_manager (), + filename); + g_free (filename); + + if (scheme_id == NULL) + { + gedit_warning (GTK_WINDOW (dlg), + _("The selected color scheme cannot be installed.")); + + return; + } + + gedit_prefs_manager_set_source_style_scheme (scheme_id); + + scheme_id = populate_color_scheme_list (dlg, scheme_id); + + set_buttons_sensisitivity_according_to_scheme (dlg, scheme_id); +} + +static void +install_scheme_clicked (GtkButton *button, + GeditPreferencesDialog *dlg) +{ + GtkWidget *chooser; + GtkFileFilter *filter; + + if (dlg->priv->install_scheme_file_schooser != NULL) { + gtk_window_present (GTK_WINDOW (dlg->priv->install_scheme_file_schooser)); + gtk_widget_grab_focus (dlg->priv->install_scheme_file_schooser); + return; + } + + chooser = gtk_file_chooser_dialog_new (_("Add Scheme"), + GTK_WINDOW (dlg), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + NULL); + + gedit_dialog_add_button (GTK_DIALOG (chooser), + _("A_dd Scheme"), + GTK_STOCK_ADD, + GTK_RESPONSE_ACCEPT); + + gtk_window_set_destroy_with_parent (GTK_WINDOW (chooser), TRUE); + + /* Filters */ + filter = gtk_file_filter_new (); + gtk_file_filter_set_name (filter, _("Color Scheme Files")); + gtk_file_filter_add_pattern (filter, "*.xml"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); + + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), filter); + + filter = gtk_file_filter_new (); + gtk_file_filter_set_name (filter, _("All Files")); + gtk_file_filter_add_pattern (filter, "*"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); + + gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_ACCEPT); + + g_signal_connect (chooser, + "response", + G_CALLBACK (add_scheme_chooser_response_cb), + dlg); + + dlg->priv->install_scheme_file_schooser = chooser; + + g_object_add_weak_pointer (G_OBJECT (chooser), + (gpointer) &dlg->priv->install_scheme_file_schooser); + + gtk_widget_show (chooser); +} + +static void +uninstall_scheme_clicked (GtkButton *button, + GeditPreferencesDialog *dlg) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dlg->priv->schemes_treeview)); + model = GTK_TREE_MODEL (dlg->priv->schemes_treeview_model); + + if (gtk_tree_selection_get_selected (selection, + &model, + &iter)) + { + gchar *id; + gchar *name; + + gtk_tree_model_get (model, &iter, + ID_COLUMN, &id, + NAME_COLUMN, &name, + -1); + + if (!_gedit_style_scheme_manager_uninstall_scheme (gedit_get_style_scheme_manager (), id)) + { + gedit_warning (GTK_WINDOW (dlg), + _("Could not remove color scheme \"%s\"."), + name); + } + else + { + const gchar *real_new_id; + gchar *new_id = NULL; + GtkTreePath *path; + GtkTreeIter new_iter; + gboolean new_iter_set = FALSE; + + /* If the removed style scheme is the last of the list, + * set as new default style scheme the previous one, + * otherwise set the next one. + * To make this possible, we need to get the id of the + * new default style scheme before re-populating the list. + * Fall back to "classic" if it is not possible to get + * the id + */ + path = gtk_tree_model_get_path (model, &iter); + + /* Try to move to the next path */ + gtk_tree_path_next (path); + if (!gtk_tree_model_get_iter (model, &new_iter, path)) + { + /* It seems the removed style scheme was the + * last of the list. Try to move to the + * previous one */ + gtk_tree_path_free (path); + + path = gtk_tree_model_get_path (model, &iter); + + gtk_tree_path_prev (path); + if (gtk_tree_model_get_iter (model, &new_iter, path)) + new_iter_set = TRUE; + } + else + new_iter_set = TRUE; + + gtk_tree_path_free (path); + + if (new_iter_set) + gtk_tree_model_get (model, &new_iter, + ID_COLUMN, &new_id, + -1); + + real_new_id = populate_color_scheme_list (dlg, new_id); + g_free (new_id); + + set_buttons_sensisitivity_according_to_scheme (dlg, real_new_id); + + if (real_new_id != NULL) + gedit_prefs_manager_set_source_style_scheme (real_new_id); + } + + g_free (id); + g_free (name); + } +} + +static void +scheme_description_cell_data_func (GtkTreeViewColumn *column, + GtkCellRenderer *renderer, + GtkTreeModel *model, + GtkTreeIter *iter, + gpointer data) +{ + gchar *name; + gchar *desc; + gchar *text; + + gtk_tree_model_get (model, iter, + NAME_COLUMN, &name, + DESC_COLUMN, &desc, + -1); + + if (desc != NULL) + { + text = g_markup_printf_escaped ("%s - %s", + name, + desc); + } + else + { + text = g_markup_printf_escaped ("%s", + name); + } + + g_free (name); + g_free (desc); + + g_object_set (G_OBJECT (renderer), + "markup", + text, + NULL); + + g_free (text); +} + +static void +setup_font_colors_page_style_scheme_section (GeditPreferencesDialog *dlg) +{ + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkTreeSelection *selection; + const gchar *def_id; + + gedit_debug (DEBUG_PREFS); + + /* Create GtkListStore for styles & setup treeview. */ + dlg->priv->schemes_treeview_model = gtk_list_store_new (NUM_COLUMNS, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_STRING); + + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dlg->priv->schemes_treeview_model), + 0, + GTK_SORT_ASCENDING); + gtk_tree_view_set_model (GTK_TREE_VIEW (dlg->priv->schemes_treeview), + GTK_TREE_MODEL (dlg->priv->schemes_treeview_model)); + + column = gtk_tree_view_column_new (); + + renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + gtk_tree_view_column_set_cell_data_func (column, + renderer, + scheme_description_cell_data_func, + dlg, + NULL); + + gtk_tree_view_append_column (GTK_TREE_VIEW (dlg->priv->schemes_treeview), + column); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dlg->priv->schemes_treeview)); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); + + def_id = populate_color_scheme_list (dlg, NULL); + + /* Connect signals */ + g_signal_connect (dlg->priv->schemes_treeview, + "cursor-changed", + G_CALLBACK (style_scheme_changed), + dlg); + g_signal_connect (dlg->priv->install_scheme_button, + "clicked", + G_CALLBACK (install_scheme_clicked), + dlg); + g_signal_connect (dlg->priv->uninstall_scheme_button, + "clicked", + G_CALLBACK (uninstall_scheme_clicked), + dlg); + + /* Set initial widget sensitivity */ + set_buttons_sensisitivity_according_to_scheme (dlg, def_id); +} + +static void +setup_font_colors_page (GeditPreferencesDialog *dlg) +{ + setup_font_colors_page_font_section (dlg); + setup_font_colors_page_style_scheme_section (dlg); +} + +static void +setup_plugins_page (GeditPreferencesDialog *dlg) +{ + GtkWidget *page_content; + + gedit_debug (DEBUG_PREFS); + + page_content = gedit_plugin_manager_new (); + g_return_if_fail (page_content != NULL); + + gtk_box_pack_start (GTK_BOX (dlg->priv->plugin_manager_place_holder), + page_content, + TRUE, + TRUE, + 0); + + gtk_widget_show_all (page_content); +} + +static void +gedit_preferences_dialog_init (GeditPreferencesDialog *dlg) +{ + GtkWidget *error_widget; + gboolean ret; + gchar *file; + gchar *root_objects[] = { + "notebook", + "adjustment1", + "adjustment2", + "adjustment3", + "install_scheme_image", + NULL + }; + + gedit_debug (DEBUG_PREFS); + + dlg->priv = GEDIT_PREFERENCES_DIALOG_GET_PRIVATE (dlg); + + gtk_dialog_add_buttons (GTK_DIALOG (dlg), + GTK_STOCK_CLOSE, + GTK_RESPONSE_CLOSE, + GTK_STOCK_HELP, + GTK_RESPONSE_HELP, + NULL); + + gtk_window_set_title (GTK_WINDOW (dlg), _("gedit Preferences")); + gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE); + gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE); + gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE); + + /* HIG defaults */ + gtk_container_set_border_width (GTK_CONTAINER (dlg), 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), 2); /* 2 * 5 + 2 = 12 */ + gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), 6); + + g_signal_connect (dlg, + "response", + G_CALLBACK (dialog_response_handler), + NULL); + + file = gedit_dirs_get_ui_file ("gedit-preferences-dialog.ui"); + ret = gedit_utils_get_ui_objects (file, + root_objects, + &error_widget, + + "notebook", &dlg->priv->notebook, + + "display_line_numbers_checkbutton", &dlg->priv->display_line_numbers_checkbutton, + "highlight_current_line_checkbutton", &dlg->priv->highlight_current_line_checkbutton, + "bracket_matching_checkbutton", &dlg->priv->bracket_matching_checkbutton, + "wrap_text_checkbutton", &dlg->priv->wrap_text_checkbutton, + "split_checkbutton", &dlg->priv->split_checkbutton, + + "right_margin_checkbutton", &dlg->priv->right_margin_checkbutton, + "right_margin_position_spinbutton", &dlg->priv->right_margin_position_spinbutton, + "right_margin_position_hbox", &dlg->priv->right_margin_position_hbox, + + "tabs_width_spinbutton", &dlg->priv->tabs_width_spinbutton, + "tabs_width_hbox", &dlg->priv->tabs_width_hbox, + "insert_spaces_checkbutton", &dlg->priv->insert_spaces_checkbutton, + + "auto_indent_checkbutton", &dlg->priv->auto_indent_checkbutton, + + "autosave_hbox", &dlg->priv->autosave_hbox, + "backup_copy_checkbutton", &dlg->priv->backup_copy_checkbutton, + "auto_save_checkbutton", &dlg->priv->auto_save_checkbutton, + "auto_save_spinbutton", &dlg->priv->auto_save_spinbutton, + + "default_font_checkbutton", &dlg->priv->default_font_checkbutton, + "font_button", &dlg->priv->font_button, + "font_hbox", &dlg->priv->font_hbox, + + "schemes_treeview", &dlg->priv->schemes_treeview, + "install_scheme_button", &dlg->priv->install_scheme_button, + "uninstall_scheme_button", &dlg->priv->uninstall_scheme_button, + + "plugin_manager_place_holder", &dlg->priv->plugin_manager_place_holder, + + NULL); + g_free (file); + + if (!ret) + { + gtk_widget_show (error_widget); + + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + error_widget, + TRUE, TRUE, 0); + + return; + } + + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + dlg->priv->notebook, FALSE, FALSE, 0); + g_object_unref (dlg->priv->notebook); + gtk_container_set_border_width (GTK_CONTAINER (dlg->priv->notebook), 5); + + setup_editor_page (dlg); + setup_view_page (dlg); + setup_font_colors_page (dlg); + setup_plugins_page (dlg); +} + +void +gedit_show_preferences_dialog (GeditWindow *parent) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (GEDIT_IS_WINDOW (parent)); + + if (preferences_dialog == NULL) + { + preferences_dialog = GTK_WIDGET (g_object_new (GEDIT_TYPE_PREFERENCES_DIALOG, NULL)); + g_signal_connect (preferences_dialog, + "destroy", + G_CALLBACK (gtk_widget_destroyed), + &preferences_dialog); + } + + if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (preferences_dialog))) + { + gtk_window_set_transient_for (GTK_WINDOW (preferences_dialog), + GTK_WINDOW (parent)); + } + + gtk_window_present (GTK_WINDOW (preferences_dialog)); +} diff --git a/gedit/dialogs/gedit-preferences-dialog.h b/gedit/dialogs/gedit-preferences-dialog.h new file mode 100755 index 00000000..bafebb06 --- /dev/null +++ b/gedit/dialogs/gedit-preferences-dialog.h @@ -0,0 +1,87 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-preferences-dialog.c + * This file is part of gedit + * + * Copyright (C) 2001-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PREFERENCES_DIALOG_H__ +#define __GEDIT_PREFERENCES_DIALOG_H__ + +#include "gedit-window.h" + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_PREFERENCES_DIALOG (gedit_preferences_dialog_get_type()) +#define GEDIT_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PREFERENCES_DIALOG, GeditPreferencesDialog)) +#define GEDIT_PREFERENCES_DIALOG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PREFERENCES_DIALOG, GeditPreferencesDialog const)) +#define GEDIT_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PREFERENCES_DIALOG, GeditPreferencesDialogClass)) +#define GEDIT_IS_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PREFERENCES_DIALOG)) +#define GEDIT_IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PREFERENCES_DIALOG)) +#define GEDIT_PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PREFERENCES_DIALOG, GeditPreferencesDialogClass)) + + +/* Private structure type */ +typedef struct _GeditPreferencesDialogPrivate GeditPreferencesDialogPrivate; + +/* + * Main object structure + */ +typedef struct _GeditPreferencesDialog GeditPreferencesDialog; + +struct _GeditPreferencesDialog +{ + GtkDialog dialog; + + /*< private > */ + GeditPreferencesDialogPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditPreferencesDialogClass GeditPreferencesDialogClass; + +struct _GeditPreferencesDialogClass +{ + GtkDialogClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_preferences_dialog_get_type (void) G_GNUC_CONST; + +void gedit_show_preferences_dialog (GeditWindow *parent); + +G_END_DECLS + +#endif /* __GEDIT_PREFERENCES_DIALOG_H__ */ + diff --git a/gedit/dialogs/gedit-preferences-dialog.ui b/gedit/dialogs/gedit-preferences-dialog.ui new file mode 100755 index 00000000..42d41e31 --- /dev/null +++ b/gedit/dialogs/gedit-preferences-dialog.ui @@ -0,0 +1,1107 @@ + + + + + + 80 + 1 + 160 + 1 + 10 + + + 8 + 1 + 24 + 1 + 4 + + + 8 + 1 + 100 + 1 + 10 + + + gtk-add + + + Preferences + False + True + dialog + False + + + True + vertical + + + True + True + 6 + + + True + 12 + vertical + 18 + + + True + vertical + 6 + + + True + 0 + Text Wrapping + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + Enable text _wrapping + True + True + False + True + True + + + False + False + 0 + + + + + Do not _split words over two lines + True + True + False + True + True + + + False + False + 1 + + + + + 1 + + + + + 1 + + + + + 0 + + + + + True + vertical + 6 + + + True + 0 + Line Numbers + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + 6 + + + _Display line numbers + True + True + False + True + True + + + False + False + 0 + + + + + 1 + + + + + 1 + + + + + False + False + 1 + + + + + True + vertical + 6 + + + True + 0 + Current Line + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + Highlight current _line + True + True + False + True + True + + + False + False + 0 + + + + + 1 + + + + + 1 + + + + + False + 2 + + + + + True + vertical + 6 + + + True + 0 + Right Margin + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + Display right _margin + True + True + False + True + True + + + False + False + 0 + + + + + True + 6 + + + True + 0 + _Right margin at column: + True + right_margin_position_spinbutton + + + False + False + 0 + + + + + True + True + adjustment1 + 1 + True + True + + + False + False + 1 + + + + + False + False + 1 + + + + + 1 + + + + + 1 + + + + + False + False + 3 + + + + + True + vertical + 6 + + + True + 0 + Bracket Matching + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + Highlight matching _bracket + True + True + False + True + True + + + False + False + 0 + + + + + 1 + + + + + 1 + + + + + 4 + + + + + + + True + View + + + False + + + + + True + 12 + vertical + 18 + + + True + vertical + 6 + + + True + 0 + Tab Stops + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + True + 6 + + + True + _Tab width: + True + center + tabs_width_spinbutton + + + False + False + 0 + + + + + True + True + adjustment2 + 1 + True + + + False + False + 1 + + + + + 0 + + + + + Insert _spaces instead of tabs + True + True + False + True + True + + + False + False + 1 + + + + + False + False + 1 + + + + + False + False + 1 + + + + + False + False + 0 + + + + + True + vertical + 6 + + + True + 0 + Automatic Indentation + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + _Enable automatic indentation + True + True + False + True + True + + + False + False + 1 + + + + + False + False + 1 + + + + + False + False + 1 + + + + + True + vertical + 6 + + + True + 0 + File Saving + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + Create a _backup copy of files before saving + True + True + False + True + True + + + False + False + 0 + + + + + True + 6 + + + _Autosave files every + True + True + False + True + True + + + False + False + 0 + + + + + True + True + adjustment3 + 1 + True + + + False + False + 1 + + + + + True + _minutes + True + center + auto_save_spinbutton + + + False + False + 2 + + + + + 1 + + + + + False + False + 1 + + + + + 1 + + + + + False + False + 2 + + + + + 1 + + + + + True + Editor + + + 1 + False + + + + + True + 12 + vertical + 18 + + + True + vertical + 6 + + + True + 0 + Font + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + _Use the system fixed width font (%s) + True + True + False + True + True + + + False + False + 0 + + + + + True + 12 + + + True + 0 + Editor _font: + True + center + font_button + + + False + False + 0 + + + + + True + True + False + Pick the editor font + True + + + 1 + + + + + False + False + 1 + + + + + 1 + + + + + 1 + + + + + False + False + 0 + + + + + True + vertical + 6 + + + True + 0 + Color Scheme + + + + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + vertical + 6 + + + True + True + automatic + automatic + etched-in + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + True + + + + + 0 + + + + + True + 6 + end + + + _Add... + True + True + False + install_scheme_image + True + + + False + False + 0 + + + + + gtk-remove + True + True + False + True + + + False + False + 1 + + + + + False + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 2 + + + + + True + Font & Colors + + + 2 + False + + + + + True + 12 + vertical + + + + + + 3 + + + + + True + Plugins + + + 3 + False + + + + + 1 + + + + + True + end + + + gtk-help + True + True + True + False + True + + + False + False + 0 + + + + + gtk-close + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + helpbutton1 + closebutton1 + + + diff --git a/gedit/dialogs/gedit-search-dialog.c b/gedit/dialogs/gedit-search-dialog.c new file mode 100755 index 00000000..5a059932 --- /dev/null +++ b/gedit/dialogs/gedit-search-dialog.c @@ -0,0 +1,634 @@ +/* + * gedit-search-dialog.c + * This file is part of gedit + * + * Copyright (C) 2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "gedit-search-dialog.h" +#include "gedit-history-entry.h" +#include "gedit-utils.h" +#include "gedit-marshal.h" +#include "gedit-dirs.h" + +#define GEDIT_SEARCH_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_SEARCH_DIALOG, \ + GeditSearchDialogPrivate)) + +/* Signals */ +enum +{ + SHOW_REPLACE, + LAST_SIGNAL +}; + +static guint dialog_signals [LAST_SIGNAL] = { 0 }; + +struct _GeditSearchDialogPrivate +{ + gboolean show_replace; + + GtkWidget *table; + GtkWidget *search_label; + GtkWidget *search_entry; + GtkWidget *search_text_entry; + GtkWidget *replace_label; + GtkWidget *replace_entry; + GtkWidget *replace_text_entry; + GtkWidget *match_case_checkbutton; + GtkWidget *entire_word_checkbutton; + GtkWidget *backwards_checkbutton; + GtkWidget *wrap_around_checkbutton; + GtkWidget *find_button; + GtkWidget *replace_button; + GtkWidget *replace_all_button; + + gboolean ui_error; +}; + +G_DEFINE_TYPE(GeditSearchDialog, gedit_search_dialog, GTK_TYPE_DIALOG) + +enum +{ + PROP_0, + PROP_SHOW_REPLACE +}; + +static void +gedit_search_dialog_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditSearchDialog *dlg = GEDIT_SEARCH_DIALOG (object); + + switch (prop_id) + { + case PROP_SHOW_REPLACE: + gedit_search_dialog_set_show_replace (dlg, + g_value_get_boolean (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_search_dialog_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditSearchDialog *dlg = GEDIT_SEARCH_DIALOG (object); + + switch (prop_id) + { + case PROP_SHOW_REPLACE: + g_value_set_boolean (value, dlg->priv->show_replace); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +void +gedit_search_dialog_present_with_time (GeditSearchDialog *dialog, + guint32 timestamp) +{ + g_return_if_fail (GEDIT_SEARCH_DIALOG (dialog)); + + gtk_window_present_with_time (GTK_WINDOW (dialog), timestamp); + + gtk_widget_grab_focus (dialog->priv->search_text_entry); +} + +static gboolean +show_replace (GeditSearchDialog *dlg) +{ + gedit_search_dialog_set_show_replace (dlg, TRUE); + + return TRUE; +} + +static void +gedit_search_dialog_class_init (GeditSearchDialogClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkBindingSet *binding_set; + + object_class->set_property = gedit_search_dialog_set_property; + object_class->get_property = gedit_search_dialog_get_property; + + klass->show_replace = show_replace; + + dialog_signals[SHOW_REPLACE] = + g_signal_new ("show_replace", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditSearchDialogClass, show_replace), + NULL, NULL, + gedit_marshal_BOOLEAN__NONE, + G_TYPE_BOOLEAN, 0); + + g_object_class_install_property (object_class, PROP_SHOW_REPLACE, + g_param_spec_boolean ("show-replace", + "Show Replace", + "Whether the dialog is used for Search&Replace", + FALSE, + G_PARAM_READWRITE)); + + g_type_class_add_private (object_class, sizeof (GeditSearchDialogPrivate)); + + binding_set = gtk_binding_set_by_class (klass); + + /* Note: we cannot use the keyval/modifier associated with the + * GTK_STOCK_FIND_AND_REPLACE stock item since MATE HIG suggests Ctrl+h + * for Replace while gtk+ uses Ctrl+r */ + gtk_binding_entry_add_signal (binding_set, GDK_h, GDK_CONTROL_MASK, "show_replace", 0); + gtk_binding_entry_add_signal (binding_set, GDK_H, GDK_CONTROL_MASK, "show_replace", 0); +} + +static void +insert_text_handler (GtkEditable *editable, + const gchar *text, + gint length, + gint *position, + gpointer data) +{ + static gboolean insert_text = FALSE; + gchar *escaped_text; + gint new_len; + + /* To avoid recursive behavior */ + if (insert_text) + return; + + escaped_text = gedit_utils_escape_search_text (text); + + new_len = strlen (escaped_text); + + if (new_len == length) + { + g_free (escaped_text); + return; + } + + insert_text = TRUE; + + g_signal_stop_emission_by_name (editable, "insert_text"); + + gtk_editable_insert_text (editable, escaped_text, new_len, position); + + insert_text = FALSE; + + g_free (escaped_text); +} + +static void +search_text_entry_changed (GtkEditable *editable, + GeditSearchDialog *dialog) +{ + const gchar *search_string; + + search_string = gtk_entry_get_text (GTK_ENTRY (editable)); + g_return_if_fail (search_string != NULL); + + if (*search_string != '\0') + { + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_FIND_RESPONSE, TRUE); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, TRUE); + } + else + { + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_FIND_RESPONSE, FALSE); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, FALSE); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, FALSE); + } +} + +static void +response_handler (GeditSearchDialog *dialog, + gint response_id, + gpointer data) +{ + const gchar *str; + + switch (response_id) + { + case GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE: + case GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE: + str = gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_text_entry)); + if (*str != '\0') + { + gchar *text; + + text = gedit_utils_unescape_search_text (str); + gedit_history_entry_prepend_text + (GEDIT_HISTORY_ENTRY (dialog->priv->replace_entry), + text); + + g_free (text); + } + /* fall through, so that we also save the find entry */ + case GEDIT_SEARCH_DIALOG_FIND_RESPONSE: + str = gtk_entry_get_text (GTK_ENTRY (dialog->priv->search_text_entry)); + if (*str != '\0') + { + gchar *text; + + text = gedit_utils_unescape_search_text (str); + gedit_history_entry_prepend_text + (GEDIT_HISTORY_ENTRY (dialog->priv->search_entry), + text); + + g_free (text); + } + } +} + +static void +show_replace_widgets (GeditSearchDialog *dlg, + gboolean show_replace) +{ + if (show_replace) + { + gtk_widget_show (dlg->priv->replace_label); + gtk_widget_show (dlg->priv->replace_entry); + gtk_widget_show (dlg->priv->replace_all_button); + gtk_widget_show (dlg->priv->replace_button); + + gtk_table_set_row_spacings (GTK_TABLE (dlg->priv->table), 12); + + gtk_window_set_title (GTK_WINDOW (dlg), _("Replace")); + } + else + { + gtk_widget_hide (dlg->priv->replace_label); + gtk_widget_hide (dlg->priv->replace_entry); + gtk_widget_hide (dlg->priv->replace_all_button); + gtk_widget_hide (dlg->priv->replace_button); + + gtk_table_set_row_spacings (GTK_TABLE (dlg->priv->table), 0); + + gtk_window_set_title (GTK_WINDOW (dlg), _("Find")); + } + + gtk_widget_show (dlg->priv->find_button); +} + +static void +gedit_search_dialog_init (GeditSearchDialog *dlg) +{ + GtkWidget *content; + GtkWidget *error_widget; + gboolean ret; + gchar *file; + gchar *root_objects[] = { + "search_dialog_content", + NULL + }; + + dlg->priv = GEDIT_SEARCH_DIALOG_GET_PRIVATE (dlg); + + gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE); + gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE); + gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE); + + gtk_dialog_add_buttons (GTK_DIALOG (dlg), + GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, + NULL); + + /* HIG defaults */ + gtk_container_set_border_width (GTK_CONTAINER (dlg), 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + 2); /* 2 * 5 + 2 = 12 */ + gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), + 5); + gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), + 6); + + file = gedit_dirs_get_ui_file ("gedit-search-dialog.ui"); + ret = gedit_utils_get_ui_objects (file, + root_objects, + &error_widget, + "search_dialog_content", &content, + "table", &dlg->priv->table, + "search_label", &dlg->priv->search_label, + "replace_with_label", &dlg->priv->replace_label, + "match_case_checkbutton", &dlg->priv->match_case_checkbutton, + "entire_word_checkbutton", &dlg->priv->entire_word_checkbutton, + "search_backwards_checkbutton", &dlg->priv->backwards_checkbutton, + "wrap_around_checkbutton", &dlg->priv->wrap_around_checkbutton, + NULL); + g_free (file); + + if (!ret) + { + gtk_widget_show (error_widget); + + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + error_widget, + TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (error_widget), + 5); + + dlg->priv->ui_error = TRUE; + + return; + } + + dlg->priv->search_entry = gedit_history_entry_new ("gedit2_search_for_entry", + TRUE); + gtk_widget_set_size_request (dlg->priv->search_entry, 300, -1); + gedit_history_entry_set_escape_func + (GEDIT_HISTORY_ENTRY (dlg->priv->search_entry), + (GeditHistoryEntryEscapeFunc) gedit_utils_escape_search_text); + + dlg->priv->search_text_entry = gedit_history_entry_get_entry + (GEDIT_HISTORY_ENTRY (dlg->priv->search_entry)); + gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->search_text_entry), + TRUE); + gtk_widget_show (dlg->priv->search_entry); + gtk_table_attach_defaults (GTK_TABLE (dlg->priv->table), + dlg->priv->search_entry, + 1, 2, 0, 1); + + dlg->priv->replace_entry = gedit_history_entry_new ("gedit2_replace_with_entry", + TRUE); + gedit_history_entry_set_escape_func + (GEDIT_HISTORY_ENTRY (dlg->priv->replace_entry), + (GeditHistoryEntryEscapeFunc) gedit_utils_escape_search_text); + + dlg->priv->replace_text_entry = gedit_history_entry_get_entry + (GEDIT_HISTORY_ENTRY (dlg->priv->replace_entry)); + gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->replace_text_entry), + TRUE); + gtk_widget_show (dlg->priv->replace_entry); + gtk_table_attach_defaults (GTK_TABLE (dlg->priv->table), + dlg->priv->replace_entry, + 1, 2, 1, 2); + + gtk_label_set_mnemonic_widget (GTK_LABEL (dlg->priv->search_label), + dlg->priv->search_entry); + gtk_label_set_mnemonic_widget (GTK_LABEL (dlg->priv->replace_label), + dlg->priv->replace_entry); + + dlg->priv->find_button = gtk_button_new_from_stock (GTK_STOCK_FIND); + dlg->priv->replace_all_button = gtk_button_new_with_mnemonic (_("Replace _All")); + dlg->priv->replace_button = gedit_gtk_button_new_with_stock_icon (_("_Replace"), + GTK_STOCK_FIND_AND_REPLACE); + + gtk_dialog_add_action_widget (GTK_DIALOG (dlg), + dlg->priv->replace_all_button, + GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE); + gtk_dialog_add_action_widget (GTK_DIALOG (dlg), + dlg->priv->replace_button, + GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE); + gtk_dialog_add_action_widget (GTK_DIALOG (dlg), + dlg->priv->find_button, + GEDIT_SEARCH_DIALOG_FIND_RESPONSE); + g_object_set (G_OBJECT (dlg->priv->find_button), + "can-default", TRUE, + NULL); + + gtk_dialog_set_default_response (GTK_DIALOG (dlg), + GEDIT_SEARCH_DIALOG_FIND_RESPONSE); + + /* insensitive by default */ + gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg), + GEDIT_SEARCH_DIALOG_FIND_RESPONSE, + FALSE); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg), + GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, + FALSE); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg), + GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, + FALSE); + + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), + content, FALSE, FALSE, 0); + g_object_unref (content); + gtk_container_set_border_width (GTK_CONTAINER (content), 5); + + g_signal_connect (dlg->priv->search_text_entry, + "insert_text", + G_CALLBACK (insert_text_handler), + NULL); + g_signal_connect (dlg->priv->replace_text_entry, + "insert_text", + G_CALLBACK (insert_text_handler), + NULL); + g_signal_connect (dlg->priv->search_text_entry, + "changed", + G_CALLBACK (search_text_entry_changed), + dlg); + + g_signal_connect (dlg, + "response", + G_CALLBACK (response_handler), + NULL); +} + +GtkWidget * +gedit_search_dialog_new (GtkWindow *parent, + gboolean show_replace) +{ + GeditSearchDialog *dlg; + + dlg = g_object_new (GEDIT_TYPE_SEARCH_DIALOG, + "show-replace", show_replace, + NULL); + + if (parent != NULL) + { + gtk_window_set_transient_for (GTK_WINDOW (dlg), + parent); + + gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), + TRUE); + } + + return GTK_WIDGET (dlg); +} + +gboolean +gedit_search_dialog_get_show_replace (GeditSearchDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); + + return dialog->priv->show_replace; +} + +void +gedit_search_dialog_set_show_replace (GeditSearchDialog *dialog, + gboolean show_replace) +{ + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); + + if (dialog->priv->ui_error) + return; + + dialog->priv->show_replace = show_replace != FALSE; + show_replace_widgets (dialog, dialog->priv->show_replace); + + g_object_notify (G_OBJECT (dialog), "show-replace"); +} + +void +gedit_search_dialog_set_search_text (GeditSearchDialog *dialog, + const gchar *text) +{ + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); + g_return_if_fail (text != NULL); + + gtk_entry_set_text (GTK_ENTRY (dialog->priv->search_text_entry), + text); + + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_FIND_RESPONSE, + (text != '\0')); + + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE, + (text != '\0')); +} + +/* + * The text must be unescaped before searching. + */ +const gchar * +gedit_search_dialog_get_search_text (GeditSearchDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), NULL); + + return gtk_entry_get_text (GTK_ENTRY (dialog->priv->search_text_entry)); +} + +void +gedit_search_dialog_set_replace_text (GeditSearchDialog *dialog, + const gchar *text) +{ + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); + g_return_if_fail (text != NULL); + + gtk_entry_set_text (GTK_ENTRY (dialog->priv->replace_text_entry), + text); +} + +const gchar * +gedit_search_dialog_get_replace_text (GeditSearchDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), NULL); + + return gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_text_entry)); +} + +void +gedit_search_dialog_set_match_case (GeditSearchDialog *dialog, + gboolean match_case) +{ + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->match_case_checkbutton), + match_case); +} + +gboolean +gedit_search_dialog_get_match_case (GeditSearchDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); + + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->match_case_checkbutton)); +} + +void +gedit_search_dialog_set_entire_word (GeditSearchDialog *dialog, + gboolean entire_word) +{ + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->entire_word_checkbutton), + entire_word); +} + +gboolean +gedit_search_dialog_get_entire_word (GeditSearchDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); + + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->entire_word_checkbutton)); +} + +void +gedit_search_dialog_set_backwards (GeditSearchDialog *dialog, + gboolean backwards) +{ + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->backwards_checkbutton), + backwards); +} + +gboolean +gedit_search_dialog_get_backwards (GeditSearchDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); + + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->backwards_checkbutton)); +} + +void +gedit_search_dialog_set_wrap_around (GeditSearchDialog *dialog, + gboolean wrap_around) +{ + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog)); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->wrap_around_checkbutton), + wrap_around); +} + +gboolean +gedit_search_dialog_get_wrap_around (GeditSearchDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog), FALSE); + + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->wrap_around_checkbutton)); +} diff --git a/gedit/dialogs/gedit-search-dialog.h b/gedit/dialogs/gedit-search-dialog.h new file mode 100755 index 00000000..a225be14 --- /dev/null +++ b/gedit/dialogs/gedit-search-dialog.h @@ -0,0 +1,128 @@ +/* + * gedit-search-dialog.h + * This file is part of gedit + * + * Copyright (C) 2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_SEARCH_DIALOG_H__ +#define __GEDIT_SEARCH_DIALOG_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_SEARCH_DIALOG (gedit_search_dialog_get_type()) +#define GEDIT_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialog)) +#define GEDIT_SEARCH_DIALOG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialog const)) +#define GEDIT_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialogClass)) +#define GEDIT_IS_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_SEARCH_DIALOG)) +#define GEDIT_IS_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_SEARCH_DIALOG)) +#define GEDIT_SEARCH_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_SEARCH_DIALOG, GeditSearchDialogClass)) + +/* Private structure type */ +typedef struct _GeditSearchDialogPrivate GeditSearchDialogPrivate; + +/* + * Main object structure + */ +typedef struct _GeditSearchDialog GeditSearchDialog; + +struct _GeditSearchDialog +{ + GtkDialog dialog; + + /*< private > */ + GeditSearchDialogPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditSearchDialogClass GeditSearchDialogClass; + +struct _GeditSearchDialogClass +{ + GtkDialogClass parent_class; + + /* Key bindings */ + gboolean (* show_replace) (GeditSearchDialog *dlg); +}; + +enum +{ + GEDIT_SEARCH_DIALOG_FIND_RESPONSE = 100, + GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, + GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE +}; + +/* + * Public methods + */ +GType gedit_search_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_search_dialog_new (GtkWindow *parent, + gboolean show_replace); + +void gedit_search_dialog_present_with_time (GeditSearchDialog *dialog, + guint32 timestamp); + +gboolean gedit_search_dialog_get_show_replace (GeditSearchDialog *dialog); + +void gedit_search_dialog_set_show_replace (GeditSearchDialog *dialog, + gboolean show_replace); + + +void gedit_search_dialog_set_search_text (GeditSearchDialog *dialog, + const gchar *text); +const gchar *gedit_search_dialog_get_search_text (GeditSearchDialog *dialog); + +void gedit_search_dialog_set_replace_text (GeditSearchDialog *dialog, + const gchar *text); +const gchar *gedit_search_dialog_get_replace_text (GeditSearchDialog *dialog); + +void gedit_search_dialog_set_match_case (GeditSearchDialog *dialog, + gboolean match_case); +gboolean gedit_search_dialog_get_match_case (GeditSearchDialog *dialog); + +void gedit_search_dialog_set_entire_word (GeditSearchDialog *dialog, + gboolean entire_word); +gboolean gedit_search_dialog_get_entire_word (GeditSearchDialog *dialog); + +void gedit_search_dialog_set_backwards (GeditSearchDialog *dialog, + gboolean backwards); +gboolean gedit_search_dialog_get_backwards (GeditSearchDialog *dialog); + +void gedit_search_dialog_set_wrap_around (GeditSearchDialog *dialog, + gboolean wrap_around); +gboolean gedit_search_dialog_get_wrap_around (GeditSearchDialog *dialog); + +G_END_DECLS + +#endif /* __GEDIT_SEARCH_DIALOG_H__ */ diff --git a/gedit/dialogs/gedit-search-dialog.ui b/gedit/dialogs/gedit-search-dialog.ui new file mode 100755 index 00000000..35b6c390 --- /dev/null +++ b/gedit/dialogs/gedit-search-dialog.ui @@ -0,0 +1,255 @@ + + + + + Replace + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + True + False + 8 + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + + + True + True + True + Replace All + True + GTK_RELIEF_NORMAL + True + + + + + True + True + True + Replace + True + GTK_RELIEF_NORMAL + True + + + + + True + True + True + gtk-find + True + GTK_RELIEF_NORMAL + True + + + + + 0 + False + False + GTK_PACK_END + + + + + 5 + True + False + 18 + + + True + 2 + 2 + False + 12 + 12 + + + True + _Search for: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + True + Replace _with: + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + 0 + True + True + + + + + True + False + 12 + + + True + True + _Match case + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + True + True + Match _entire word only + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + True + True + Search _backwards + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + True + True + _Wrap around + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + close_button + replace_all_button + replace_button + find_next_button + + + diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c new file mode 100755 index 00000000..14148fef --- /dev/null +++ b/gedit/gedit-app.c @@ -0,0 +1,911 @@ +/* + * gedit-app.c + * This file is part of gedit + * + * Copyright (C) 2005-2006 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#include "gedit-app.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-commands.h" +#include "gedit-notebook.h" +#include "gedit-debug.h" +#include "gedit-utils.h" +#include "gedit-enum-types.h" +#include "gedit-dirs.h" + +#ifdef OS_OSX +#include +#endif + +#define GEDIT_PAGE_SETUP_FILE "gedit-page-setup" +#define GEDIT_PRINT_SETTINGS_FILE "gedit-print-settings" + +#define GEDIT_APP_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_APP, GeditAppPrivate)) + +/* Properties */ +enum +{ + PROP_0, + PROP_LOCKDOWN +}; + +struct _GeditAppPrivate +{ + GList *windows; + GeditWindow *active_window; + + GeditLockdownMask lockdown; + + GtkPageSetup *page_setup; + GtkPrintSettings *print_settings; +}; + +G_DEFINE_TYPE(GeditApp, gedit_app, G_TYPE_OBJECT) + +static void +gedit_app_finalize (GObject *object) +{ + GeditApp *app = GEDIT_APP (object); + + g_list_free (app->priv->windows); + + if (app->priv->page_setup) + g_object_unref (app->priv->page_setup); + if (app->priv->print_settings) + g_object_unref (app->priv->print_settings); + + G_OBJECT_CLASS (gedit_app_parent_class)->finalize (object); +} + +static void +gedit_app_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditApp *app = GEDIT_APP (object); + + switch (prop_id) + { + case PROP_LOCKDOWN: + g_value_set_flags (value, gedit_app_get_lockdown (app)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_app_class_init (GeditAppClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_app_finalize; + object_class->get_property = gedit_app_get_property; + + g_object_class_install_property (object_class, + PROP_LOCKDOWN, + g_param_spec_flags ("lockdown", + "Lockdown", + "The lockdown mask", + GEDIT_TYPE_LOCKDOWN_MASK, + 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof(GeditAppPrivate)); +} + +static gboolean +ensure_user_config_dir (void) +{ + gchar *config_dir; + gboolean ret = TRUE; + gint res; + + config_dir = gedit_dirs_get_user_config_dir (); + if (config_dir == NULL) + { + g_warning ("Could not get config directory\n"); + return FALSE; + } + + res = g_mkdir_with_parents (config_dir, 0755); + if (res < 0) + { + g_warning ("Could not create config directory\n"); + ret = FALSE; + } + + g_free (config_dir); + + return ret; +} + +static void +load_accels (void) +{ + gchar *filename; + + filename = gedit_dirs_get_user_accels_file (); + if (filename != NULL) + { + gedit_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename); + gtk_accel_map_load (filename); + g_free (filename); + } +} + +static void +save_accels (void) +{ + gchar *filename; + + filename = gedit_dirs_get_user_accels_file (); + if (filename != NULL) + { + gedit_debug_message (DEBUG_APP, "Saving keybindings in %s\n", filename); + gtk_accel_map_save (filename); + g_free (filename); + } +} + +static gchar * +get_page_setup_file (void) +{ + gchar *config_dir; + gchar *setup = NULL; + + config_dir = gedit_dirs_get_user_config_dir (); + + if (config_dir != NULL) + { + setup = g_build_filename (config_dir, + GEDIT_PAGE_SETUP_FILE, + NULL); + g_free (config_dir); + } + + return setup; +} + +static void +load_page_setup (GeditApp *app) +{ + gchar *filename; + GError *error = NULL; + + g_return_if_fail (app->priv->page_setup == NULL); + + filename = get_page_setup_file (); + + app->priv->page_setup = gtk_page_setup_new_from_file (filename, + &error); + if (error) + { + /* Ignore file not found error */ + if (error->domain != G_FILE_ERROR || + error->code != G_FILE_ERROR_NOENT) + { + g_warning ("%s", error->message); + } + + g_error_free (error); + } + + g_free (filename); + + /* fall back to default settings */ + if (app->priv->page_setup == NULL) + app->priv->page_setup = gtk_page_setup_new (); +} + +static void +save_page_setup (GeditApp *app) +{ + gchar *filename; + GError *error = NULL; + + if (app->priv->page_setup == NULL) + return; + + filename = get_page_setup_file (); + + gtk_page_setup_to_file (app->priv->page_setup, + filename, + &error); + if (error) + { + g_warning ("%s", error->message); + g_error_free (error); + } + + g_free (filename); +} + +static gchar * +get_print_settings_file (void) +{ + gchar *config_dir; + gchar *settings = NULL; + + config_dir = gedit_dirs_get_user_config_dir (); + + if (config_dir != NULL) + { + settings = g_build_filename (config_dir, + GEDIT_PRINT_SETTINGS_FILE, + NULL); + g_free (config_dir); + } + + return settings; +} + +static void +load_print_settings (GeditApp *app) +{ + gchar *filename; + GError *error = NULL; + + g_return_if_fail (app->priv->print_settings == NULL); + + filename = get_print_settings_file (); + + app->priv->print_settings = gtk_print_settings_new_from_file (filename, + &error); + if (error) + { + /* Ignore file not found error */ + if (error->domain != G_FILE_ERROR || + error->code != G_FILE_ERROR_NOENT) + { + g_warning ("%s", error->message); + } + + g_error_free (error); + } + + g_free (filename); + + /* fall back to default settings */ + if (app->priv->print_settings == NULL) + app->priv->print_settings = gtk_print_settings_new (); +} + +static void +save_print_settings (GeditApp *app) +{ + gchar *filename; + GError *error = NULL; + + if (app->priv->print_settings == NULL) + return; + + filename = get_print_settings_file (); + + gtk_print_settings_to_file (app->priv->print_settings, + filename, + &error); + if (error) + { + g_warning ("%s", error->message); + g_error_free (error); + } + + g_free (filename); +} + +static void +gedit_app_init (GeditApp *app) +{ + app->priv = GEDIT_APP_GET_PRIVATE (app); + + load_accels (); + + /* initial lockdown state */ + app->priv->lockdown = gedit_prefs_manager_get_lockdown (); +} + +static void +app_weak_notify (gpointer data, + GObject *where_the_app_was) +{ + gtk_main_quit (); +} + +/** + * gedit_app_get_default: + * + * Returns the #GeditApp object. This object is a singleton and + * represents the running gedit instance. + * + * Return value: the #GeditApp pointer + */ +GeditApp * +gedit_app_get_default (void) +{ + static GeditApp *app = NULL; + + if (app != NULL) + return app; + + app = GEDIT_APP (g_object_new (GEDIT_TYPE_APP, NULL)); + + g_object_add_weak_pointer (G_OBJECT (app), + (gpointer) &app); + g_object_weak_ref (G_OBJECT (app), + app_weak_notify, + NULL); + + return app; +} + +static void +set_active_window (GeditApp *app, + GeditWindow *window) +{ + app->priv->active_window = window; +} + +static gboolean +window_focus_in_event (GeditWindow *window, + GdkEventFocus *event, + GeditApp *app) +{ + /* updates active_view and active_child when a new toplevel receives focus */ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), FALSE); + + set_active_window (app, window); + + return FALSE; +} + +static gboolean +window_delete_event (GeditWindow *window, + GdkEvent *event, + GeditApp *app) +{ + GeditWindowState ws; + + ws = gedit_window_get_state (window); + + if (ws & + (GEDIT_WINDOW_STATE_SAVING | + GEDIT_WINDOW_STATE_PRINTING | + GEDIT_WINDOW_STATE_SAVING_SESSION)) + return TRUE; + + _gedit_cmd_file_quit (NULL, window); + + /* Do not destroy the window */ + return TRUE; +} + +static void +window_destroy (GeditWindow *window, + GeditApp *app) +{ + app->priv->windows = g_list_remove (app->priv->windows, + window); + + if (window == app->priv->active_window) + { + set_active_window (app, app->priv->windows != NULL ? app->priv->windows->data : NULL); + } + +/* CHECK: I don't think we have to disconnect this function, since windows + is being destroyed */ +/* + g_signal_handlers_disconnect_by_func (window, + G_CALLBACK (window_focus_in_event), + app); + g_signal_handlers_disconnect_by_func (window, + G_CALLBACK (window_destroy), + app); +*/ + if (app->priv->windows == NULL) + { +#ifdef OS_OSX + if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "gedit-is-quitting-all"))) + { + /* Create hidden proxy window on OS X to handle the menu */ + gedit_app_create_window (app, NULL); + return; + } +#endif + /* Last window is gone... save some settings and exit */ + ensure_user_config_dir (); + + save_accels (); + save_page_setup (app); + save_print_settings (app); + + g_object_unref (app); + } +} + +/* Generates a unique string for a window role */ +static gchar * +gen_role (void) +{ + GTimeVal result; + static gint serial; + + g_get_current_time (&result); + + return g_strdup_printf ("gedit-window-%ld-%ld-%d-%s", + result.tv_sec, + result.tv_usec, + serial++, + g_get_host_name ()); +} + +static GeditWindow * +gedit_app_create_window_real (GeditApp *app, + gboolean set_geometry, + const gchar *role) +{ + GeditWindow *window; + + gedit_debug (DEBUG_APP); + + /* + * We need to be careful here, there is a race condition: + * when another gedit is launched it checks active_window, + * so we must do our best to ensure that active_window + * is never NULL when at least a window exists. + */ + if (app->priv->windows == NULL) + { + window = g_object_new (GEDIT_TYPE_WINDOW, NULL); + set_active_window (app, window); + } + else + { + window = g_object_new (GEDIT_TYPE_WINDOW, NULL); + } + + app->priv->windows = g_list_prepend (app->priv->windows, + window); + + gedit_debug_message (DEBUG_APP, "Window created"); + + if (role != NULL) + { + gtk_window_set_role (GTK_WINDOW (window), role); + } + else + { + gchar *newrole; + + newrole = gen_role (); + gtk_window_set_role (GTK_WINDOW (window), newrole); + g_free (newrole); + } + + if (set_geometry) + { + GdkWindowState state; + gint w, h; + + state = gedit_prefs_manager_get_window_state (); + + if ((state & GDK_WINDOW_STATE_MAXIMIZED) != 0) + { + gedit_prefs_manager_get_default_window_size (&w, &h); + gtk_window_set_default_size (GTK_WINDOW (window), w, h); + gtk_window_maximize (GTK_WINDOW (window)); + } + else + { + gedit_prefs_manager_get_window_size (&w, &h); + gtk_window_set_default_size (GTK_WINDOW (window), w, h); + gtk_window_unmaximize (GTK_WINDOW (window)); + } + + if ((state & GDK_WINDOW_STATE_STICKY ) != 0) + gtk_window_stick (GTK_WINDOW (window)); + else + gtk_window_unstick (GTK_WINDOW (window)); + } + + g_signal_connect (window, + "focus_in_event", + G_CALLBACK (window_focus_in_event), + app); + g_signal_connect (window, + "delete_event", + G_CALLBACK (window_delete_event), + app); + g_signal_connect (window, + "destroy", + G_CALLBACK (window_destroy), + app); + + return window; +} + +/** + * gedit_app_create_window: + * @app: the #GeditApp + * + * Create a new #GeditWindow part of @app. + * + * Return value: the new #GeditWindow + */ +GeditWindow * +gedit_app_create_window (GeditApp *app, + GdkScreen *screen) +{ + GeditWindow *window; + + window = gedit_app_create_window_real (app, TRUE, NULL); + + if (screen != NULL) + gtk_window_set_screen (GTK_WINDOW (window), screen); + + return window; +} + +/* + * Same as _create_window, but doesn't set the geometry. + * The session manager takes care of it. Used in mate-session. + */ +GeditWindow * +_gedit_app_restore_window (GeditApp *app, + const gchar *role) +{ + GeditWindow *window; + + window = gedit_app_create_window_real (app, FALSE, role); + + return window; +} + +/** + * gedit_app_get_windows: + * @app: the #GeditApp + * + * Returns all the windows currently present in #GeditApp. + * + * Return value: the list of #GeditWindows objects. The list + * should not be freed + */ +const GList * +gedit_app_get_windows (GeditApp *app) +{ + g_return_val_if_fail (GEDIT_IS_APP (app), NULL); + + return app->priv->windows; +} + +/** + * gedit_app_get_active_window: + * @app: the #GeditApp + * + * Retrives the #GeditWindow currently active. + * + * Return value: the active #GeditWindow + */ +GeditWindow * +gedit_app_get_active_window (GeditApp *app) +{ + g_return_val_if_fail (GEDIT_IS_APP (app), NULL); + + /* make sure our active window is always realized: + * this is needed on startup if we launch two gedit fast + * enough that the second instance comes up before the + * first one shows its window. + */ + if (!GTK_WIDGET_REALIZED (GTK_WIDGET (app->priv->active_window))) + gtk_widget_realize (GTK_WIDGET (app->priv->active_window)); + + return app->priv->active_window; +} + +static gboolean +is_in_viewport (GeditWindow *window, + GdkScreen *screen, + gint workspace, + gint viewport_x, + gint viewport_y) +{ + GdkScreen *s; + GdkDisplay *display; + GdkWindow *gdkwindow; + const gchar *cur_name; + const gchar *name; + gint cur_n; + gint n; + gint ws; + gint sc_width, sc_height; + gint x, y, width, height; + gint vp_x, vp_y; + + /* Check for screen and display match */ + display = gdk_screen_get_display (screen); + cur_name = gdk_display_get_name (display); + cur_n = gdk_screen_get_number (screen); + + s = gtk_window_get_screen (GTK_WINDOW (window)); + display = gdk_screen_get_display (s); + name = gdk_display_get_name (display); + n = gdk_screen_get_number (s); + + if (strcmp (cur_name, name) != 0 || cur_n != n) + return FALSE; + + /* Check for workspace match */ + ws = gedit_utils_get_window_workspace (GTK_WINDOW (window)); + if (ws != workspace && ws != GEDIT_ALL_WORKSPACES) + return FALSE; + + /* Check for viewport match */ + gdkwindow = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_window_get_position (gdkwindow, &x, &y); + + #if GTK_CHECK_VERSION(3, 0, 0) + width = gdk_window_get_width(gdkwindow); + height = gdk_window_get_height(gdkwindow); + #else + gdk_drawable_get_size(gdkwindow, &width, &height); + #endif + + gedit_utils_get_current_viewport (screen, &vp_x, &vp_y); + x += vp_x; + y += vp_y; + + sc_width = gdk_screen_get_width (screen); + sc_height = gdk_screen_get_height (screen); + + return x + width * .25 >= viewport_x && + x + width * .75 <= viewport_x + sc_width && + y >= viewport_y && + y + height <= viewport_y + sc_height; +} + +/** + * _gedit_app_get_window_in_viewport + * @app: the #GeditApp + * @screen: the #GdkScreen + * @workspace: the workspace number + * @viewport_x: the viewport horizontal origin + * @viewport_y: the viewport vertical origin + * + * Since a workspace can be larger than the screen, it is divided into several + * equal parts called viewports. This function retrives the #GeditWindow in + * the given viewport of the given workspace. + * + * Return value: the #GeditWindow in the given viewport of the given workspace. + */ +GeditWindow * +_gedit_app_get_window_in_viewport (GeditApp *app, + GdkScreen *screen, + gint workspace, + gint viewport_x, + gint viewport_y) +{ + GeditWindow *window; + + GList *l; + + g_return_val_if_fail (GEDIT_IS_APP (app), NULL); + + /* first try if the active window */ + window = app->priv->active_window; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + if (is_in_viewport (window, screen, workspace, viewport_x, viewport_y)) + return window; + + /* otherwise try to see if there is a window on this workspace */ + for (l = app->priv->windows; l != NULL; l = l->next) + { + window = l->data; + + if (is_in_viewport (window, screen, workspace, viewport_x, viewport_y)) + return window; + } + + /* no window on this workspace... create a new one */ + return gedit_app_create_window (app, screen); +} + +/** + * gedit_app_get_documents: + * @app: the #GeditApp + * + * Returns all the documents currently open in #GeditApp. + * + * Return value: a newly allocated list of #GeditDocument objects + */ +GList * +gedit_app_get_documents (GeditApp *app) +{ + GList *res = NULL; + GList *windows; + + g_return_val_if_fail (GEDIT_IS_APP (app), NULL); + + windows = app->priv->windows; + + while (windows != NULL) + { + res = g_list_concat (res, + gedit_window_get_documents (GEDIT_WINDOW (windows->data))); + + windows = g_list_next (windows); + } + + return res; +} + +/** + * gedit_app_get_views: + * @app: the #GeditApp + * + * Returns all the views currently present in #GeditApp. + * + * Return value: a newly allocated list of #GeditView objects + */ +GList * +gedit_app_get_views (GeditApp *app) +{ + GList *res = NULL; + GList *windows; + + g_return_val_if_fail (GEDIT_IS_APP (app), NULL); + + windows = app->priv->windows; + + while (windows != NULL) + { + res = g_list_concat (res, + gedit_window_get_views (GEDIT_WINDOW (windows->data))); + + windows = g_list_next (windows); + } + + return res; +} + +/** + * gedit_app_get_lockdown: + * @app: a #GeditApp + * + * Gets the lockdown mask (see #GeditLockdownMask) for the application. + * The lockdown mask determines which functions are locked down using + * the MATE-wise lockdown MateConf keys. + **/ +GeditLockdownMask +gedit_app_get_lockdown (GeditApp *app) +{ + g_return_val_if_fail (GEDIT_IS_APP (app), GEDIT_LOCKDOWN_ALL); + + return app->priv->lockdown; +} + +static void +app_lockdown_changed (GeditApp *app) +{ + GList *l; + + for (l = app->priv->windows; l != NULL; l = l->next) + _gedit_window_set_lockdown (GEDIT_WINDOW (l->data), + app->priv->lockdown); + + g_object_notify (G_OBJECT (app), "lockdown"); +} + +void +_gedit_app_set_lockdown (GeditApp *app, + GeditLockdownMask lockdown) +{ + g_return_if_fail (GEDIT_IS_APP (app)); + + app->priv->lockdown = lockdown; + + app_lockdown_changed (app); +} + +void +_gedit_app_set_lockdown_bit (GeditApp *app, + GeditLockdownMask bit, + gboolean value) +{ + g_return_if_fail (GEDIT_IS_APP (app)); + + if (value) + app->priv->lockdown |= bit; + else + app->priv->lockdown &= ~bit; + + app_lockdown_changed (app); +} + +/* Returns a copy */ +GtkPageSetup * +_gedit_app_get_default_page_setup (GeditApp *app) +{ + g_return_val_if_fail (GEDIT_IS_APP (app), NULL); + + if (app->priv->page_setup == NULL) + load_page_setup (app); + + return gtk_page_setup_copy (app->priv->page_setup); +} + +void +_gedit_app_set_default_page_setup (GeditApp *app, + GtkPageSetup *page_setup) +{ + g_return_if_fail (GEDIT_IS_APP (app)); + g_return_if_fail (GTK_IS_PAGE_SETUP (page_setup)); + + if (app->priv->page_setup != NULL) + g_object_unref (app->priv->page_setup); + + app->priv->page_setup = g_object_ref (page_setup); +} + +/* Returns a copy */ +GtkPrintSettings * +_gedit_app_get_default_print_settings (GeditApp *app) +{ + g_return_val_if_fail (GEDIT_IS_APP (app), NULL); + + if (app->priv->print_settings == NULL) + load_print_settings (app); + + return gtk_print_settings_copy (app->priv->print_settings); +} + +void +_gedit_app_set_default_print_settings (GeditApp *app, + GtkPrintSettings *settings) +{ + g_return_if_fail (GEDIT_IS_APP (app)); + g_return_if_fail (GTK_IS_PRINT_SETTINGS (settings)); + + if (app->priv->print_settings != NULL) + g_object_unref (app->priv->print_settings); + + app->priv->print_settings = g_object_ref (settings); +} + diff --git a/gedit/gedit-app.h b/gedit/gedit-app.h new file mode 100755 index 00000000..5311930a --- /dev/null +++ b/gedit/gedit-app.h @@ -0,0 +1,142 @@ +/* + * gedit-app.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_APP_H__ +#define __GEDIT_APP_H__ + +#include + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_APP (gedit_app_get_type()) +#define GEDIT_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_APP, GeditApp)) +#define GEDIT_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_APP, GeditAppClass)) +#define GEDIT_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_APP)) +#define GEDIT_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_APP)) +#define GEDIT_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_APP, GeditAppClass)) + +/* Private structure type */ +typedef struct _GeditAppPrivate GeditAppPrivate; + +/* + * Main object structure + */ +typedef struct _GeditApp GeditApp; + +struct _GeditApp +{ + GObject object; + + /*< private > */ + GeditAppPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditAppClass GeditAppClass; + +struct _GeditAppClass +{ + GObjectClass parent_class; +}; + +/* + * Lockdown mask definition + */ +typedef enum +{ + GEDIT_LOCKDOWN_COMMAND_LINE = 1 << 0, + GEDIT_LOCKDOWN_PRINTING = 1 << 1, + GEDIT_LOCKDOWN_PRINT_SETUP = 1 << 2, + GEDIT_LOCKDOWN_SAVE_TO_DISK = 1 << 3, + GEDIT_LOCKDOWN_ALL = 0xF +} GeditLockdownMask; + +/* + * Public methods + */ +GType gedit_app_get_type (void) G_GNUC_CONST; + +GeditApp *gedit_app_get_default (void); + +GeditWindow *gedit_app_create_window (GeditApp *app, + GdkScreen *screen); + +const GList *gedit_app_get_windows (GeditApp *app); +GeditWindow *gedit_app_get_active_window (GeditApp *app); + +/* Returns a newly allocated list with all the documents */ +GList *gedit_app_get_documents (GeditApp *app); + +/* Returns a newly allocated list with all the views */ +GList *gedit_app_get_views (GeditApp *app); + +/* Lockdown state */ +GeditLockdownMask gedit_app_get_lockdown (GeditApp *app); + +/* + * Non exported functions + */ +GeditWindow *_gedit_app_restore_window (GeditApp *app, + const gchar *role); +GeditWindow *_gedit_app_get_window_in_viewport (GeditApp *app, + GdkScreen *screen, + gint workspace, + gint viewport_x, + gint viewport_y); +void _gedit_app_set_lockdown (GeditApp *app, + GeditLockdownMask lockdown); +void _gedit_app_set_lockdown_bit (GeditApp *app, + GeditLockdownMask bit, + gboolean value); +/* + * This one is a gedit-window function, but we declare it here to avoid + * #include headaches since it needs the GeditLockdownMask declaration. + */ +void _gedit_window_set_lockdown (GeditWindow *window, + GeditLockdownMask lockdown); + +/* global print config */ +GtkPageSetup *_gedit_app_get_default_page_setup (GeditApp *app); +void _gedit_app_set_default_page_setup (GeditApp *app, + GtkPageSetup *page_setup); +GtkPrintSettings *_gedit_app_get_default_print_settings (GeditApp *app); +void _gedit_app_set_default_print_settings (GeditApp *app, + GtkPrintSettings *settings); + +G_END_DECLS + +#endif /* __GEDIT_APP_H__ */ diff --git a/gedit/gedit-close-button.c b/gedit/gedit-close-button.c new file mode 100755 index 00000000..0e9f157e --- /dev/null +++ b/gedit/gedit-close-button.c @@ -0,0 +1,80 @@ +/* + * gedit-close-button.c + * This file is part of gedit + * + * Copyright (C) 2010 - Paolo Borelli + * + * 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. + */ + +#include "gedit-close-button.h" + +G_DEFINE_TYPE (GeditCloseButton, gedit_close_button, GTK_TYPE_BUTTON) + +static void +gedit_close_button_style_set (GtkWidget *button, + GtkStyle *previous_style) +{ + gint h, w; + + gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), + GTK_ICON_SIZE_MENU, &w, &h); + + gtk_widget_set_size_request (button, w + 2, h + 2); + + GTK_WIDGET_CLASS (gedit_close_button_parent_class)->style_set (button, previous_style); +} + +static void +gedit_close_button_class_init (GeditCloseButtonClass *klass) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + widget_class->style_set = gedit_close_button_style_set; +} + +static void +gedit_close_button_init (GeditCloseButton *button) +{ + GtkRcStyle *rcstyle; + GtkWidget *image; + + /* make it as small as possible */ + rcstyle = gtk_rc_style_new (); + rcstyle->xthickness = rcstyle->ythickness = 0; + gtk_widget_modify_style (GTK_WIDGET (button), rcstyle); + g_object_unref (rcstyle); + + image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, + GTK_ICON_SIZE_MENU); + gtk_widget_show (image); + + gtk_container_add (GTK_CONTAINER (button), image); +} + +GtkWidget * +gedit_close_button_new () +{ + GeditCloseButton *button; + + button = g_object_new (GEDIT_TYPE_CLOSE_BUTTON, + "relief", GTK_RELIEF_NONE, + "focus-on-click", FALSE, + NULL); + + return GTK_WIDGET (button); +} + diff --git a/gedit/gedit-close-button.h b/gedit/gedit-close-button.h new file mode 100755 index 00000000..4f631380 --- /dev/null +++ b/gedit/gedit-close-button.h @@ -0,0 +1,56 @@ +/* + * gedit-close-button.h + * This file is part of gedit + * + * Copyright (C) 2010 - Paolo Borelli + * + * 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 __GEDIT_CLOSE_BUTTON_H__ +#define __GEDIT_CLOSE_BUTTON_H__ + +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_CLOSE_BUTTON (gedit_close_button_get_type ()) +#define GEDIT_CLOSE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButton)) +#define GEDIT_CLOSE_BUTTON_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButton const)) +#define GEDIT_CLOSE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButtonClass)) +#define GEDIT_IS_CLOSE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_CLOSE_BUTTON)) +#define GEDIT_IS_CLOSE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_CLOSE_BUTTON)) +#define GEDIT_CLOSE_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButtonClass)) + +typedef struct _GeditCloseButton GeditCloseButton; +typedef struct _GeditCloseButtonClass GeditCloseButtonClass; +typedef struct _GeditCloseButtonPrivate GeditCloseButtonPrivate; + +struct _GeditCloseButton { + GtkButton parent; +}; + +struct _GeditCloseButtonClass { + GtkButtonClass parent_class; +}; + +GType gedit_close_button_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_close_button_new (void); + +G_END_DECLS + +#endif /* __GEDIT_CLOSE_BUTTON_H__ */ diff --git a/gedit/gedit-commands-documents.c b/gedit/gedit-commands-documents.c new file mode 100755 index 00000000..016ebbe8 --- /dev/null +++ b/gedit/gedit-commands-documents.c @@ -0,0 +1,87 @@ +/* + * gedit-documents-commands.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gedit-commands.h" +#include "gedit-window.h" +#include "gedit-notebook.h" +#include "gedit-debug.h" + +void +_gedit_cmd_documents_previous_document (GtkAction *action, + GeditWindow *window) +{ + GtkNotebook *notebook; + + gedit_debug (DEBUG_COMMANDS); + + notebook = GTK_NOTEBOOK (_gedit_window_get_notebook (window)); + gtk_notebook_prev_page (notebook); +} + +void +_gedit_cmd_documents_next_document (GtkAction *action, + GeditWindow *window) +{ + GtkNotebook *notebook; + + gedit_debug (DEBUG_COMMANDS); + + notebook = GTK_NOTEBOOK (_gedit_window_get_notebook (window)); + gtk_notebook_next_page (notebook); +} + +void +_gedit_cmd_documents_move_to_new_window (GtkAction *action, + GeditWindow *window) +{ + GeditNotebook *old_notebook; + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_window_get_active_tab (window); + + if (tab == NULL) + return; + + old_notebook = GEDIT_NOTEBOOK (_gedit_window_get_notebook (window)); + + g_return_if_fail (gtk_notebook_get_n_pages (GTK_NOTEBOOK (old_notebook)) > 1); + + _gedit_window_move_tab_to_new_window (window, tab); +} diff --git a/gedit/gedit-commands-edit.c b/gedit/gedit-commands-edit.c new file mode 100755 index 00000000..e2cedeb6 --- /dev/null +++ b/gedit/gedit-commands-edit.c @@ -0,0 +1,174 @@ +/* + * gedit-commands-edit.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gedit-commands.h" +#include "gedit-window.h" +#include "gedit-debug.h" +#include "gedit-view.h" +#include "dialogs/gedit-preferences-dialog.h" + +void +_gedit_cmd_edit_undo (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + GtkSourceBuffer *active_document; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view); + + active_document = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); + + gtk_source_buffer_undo (active_document); + + gedit_view_scroll_to_cursor (active_view); + + gtk_widget_grab_focus (GTK_WIDGET (active_view)); +} + +void +_gedit_cmd_edit_redo (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + GtkSourceBuffer *active_document; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view); + + active_document = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); + + gtk_source_buffer_redo (active_document); + + gedit_view_scroll_to_cursor (active_view); + + gtk_widget_grab_focus (GTK_WIDGET (active_view)); +} + +void +_gedit_cmd_edit_cut (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view); + + gedit_view_cut_clipboard (active_view); + + gtk_widget_grab_focus (GTK_WIDGET (active_view)); +} + +void +_gedit_cmd_edit_copy (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view); + + gedit_view_copy_clipboard (active_view); + + gtk_widget_grab_focus (GTK_WIDGET (active_view)); +} + +void +_gedit_cmd_edit_paste (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view); + + gedit_view_paste_clipboard (active_view); + + gtk_widget_grab_focus (GTK_WIDGET (active_view)); +} + +void +_gedit_cmd_edit_delete (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view); + + gedit_view_delete_selection (active_view); + + gtk_widget_grab_focus (GTK_WIDGET (active_view)); +} + +void +_gedit_cmd_edit_select_all (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view); + + gedit_view_select_all (active_view); + + gtk_widget_grab_focus (GTK_WIDGET (active_view)); +} + +void +_gedit_cmd_edit_preferences (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + gedit_show_preferences_dialog (window); +} diff --git a/gedit/gedit-commands-file-print.c b/gedit/gedit-commands-file-print.c new file mode 100755 index 00000000..455e2e21 --- /dev/null +++ b/gedit/gedit-commands-file-print.c @@ -0,0 +1,91 @@ +/* + * gedit-commands-file-print.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "gedit-commands.h" +#include "gedit-window.h" +#include "gedit-tab.h" +#include "gedit-debug.h" + +#if !GTK_CHECK_VERSION (2, 17, 4) +void +_gedit_cmd_file_page_setup (GtkAction *action, + GeditWindow *window) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_window_get_active_tab (window); + if (tab == NULL) + return; + + _gedit_tab_page_setup (tab); +} +#endif + +void +_gedit_cmd_file_print_preview (GtkAction *action, + GeditWindow *window) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_window_get_active_tab (window); + if (tab == NULL) + return; + + _gedit_tab_print_preview (tab); +} + +void +_gedit_cmd_file_print (GtkAction *action, + GeditWindow *window) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_window_get_active_tab (window); + if (tab == NULL) + return; + + _gedit_tab_print (tab); +} + diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c new file mode 100755 index 00000000..985b0417 --- /dev/null +++ b/gedit/gedit-commands-file.c @@ -0,0 +1,1885 @@ +/* + * gedit-commands-file.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include /* For strlen and strcmp */ + +#include +#include +#include + +#include "gedit-commands.h" +#include "gedit-window.h" +#include "gedit-window-private.h" +#include "gedit-statusbar.h" +#include "gedit-debug.h" +#include "gedit-utils.h" +#include "gedit-file-chooser-dialog.h" +#include "dialogs/gedit-close-confirmation-dialog.h" + + +/* Defined constants */ +#define GEDIT_OPEN_DIALOG_KEY "gedit-open-dialog-key" +#define GEDIT_TAB_TO_SAVE_AS "gedit-tab-to-save-as" +#define GEDIT_LIST_OF_TABS_TO_SAVE_AS "gedit-list-of-tabs-to-save-as" +#define GEDIT_IS_CLOSING_ALL "gedit-is-closing-all" +#define GEDIT_IS_QUITTING "gedit-is-quitting" +#define GEDIT_IS_CLOSING_TAB "gedit-is-closing-tab" +#define GEDIT_IS_QUITTING_ALL "gedit-is-quitting-all" + +static void tab_state_changed_while_saving (GeditTab *tab, + GParamSpec *pspec, + GeditWindow *window); + +void +_gedit_cmd_file_new (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + gedit_window_create_tab (window, TRUE); +} + +static GeditTab * +get_tab_from_file (GList *docs, GFile *file) +{ + GeditTab *tab = NULL; + + while (docs != NULL) + { + GeditDocument *d; + GFile *l; + + d = GEDIT_DOCUMENT (docs->data); + + l = gedit_document_get_location (d); + if (l != NULL) + { + if (g_file_equal (l, file)) + { + tab = gedit_tab_get_from_document (d); + g_object_unref (l); + break; + } + + g_object_unref (l); + } + + docs = g_list_next (docs); + } + + return tab; +} + +static gboolean +is_duplicated_file (GSList *files, GFile *file) +{ + while (files != NULL) + { + if (g_file_equal (files->data, file)) + return TRUE; + + files = g_slist_next (files); + } + + return FALSE; +} + +/* File loading */ +static gint +load_file_list (GeditWindow *window, + GSList *files, + const GeditEncoding *encoding, + gint line_pos, + gboolean create) +{ + GeditTab *tab; + gint loaded_files = 0; /* Number of files to load */ + gboolean jump_to = TRUE; /* Whether to jump to the new tab */ + GList *win_docs; + GSList *files_to_load = NULL; + GSList *l; + + gedit_debug (DEBUG_COMMANDS); + + win_docs = gedit_window_get_documents (window); + + /* Remove the uris corresponding to documents already open + * in "window" and remove duplicates from "uris" list */ + for (l = files; l != NULL; l = l->next) + { + if (!is_duplicated_file (files_to_load, l->data)) + { + tab = get_tab_from_file (win_docs, l->data); + if (tab != NULL) + { + if (l == files) + { + gedit_window_set_active_tab (window, tab); + jump_to = FALSE; + + if (line_pos > 0) + { + GeditDocument *doc; + GeditView *view; + + doc = gedit_tab_get_document (tab); + view = gedit_tab_get_view (tab); + + /* document counts lines starting from 0 */ + gedit_document_goto_line (doc, line_pos - 1); + gedit_view_scroll_to_cursor (view); + } + } + + ++loaded_files; + } + else + { + files_to_load = g_slist_prepend (files_to_load, + l->data); + } + } + } + + g_list_free (win_docs); + + if (files_to_load == NULL) + return loaded_files; + + files_to_load = g_slist_reverse (files_to_load); + l = files_to_load; + + tab = gedit_window_get_active_tab (window); + if (tab != NULL) + { + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + + if (gedit_document_is_untouched (doc) && + (gedit_tab_get_state (tab) == GEDIT_TAB_STATE_NORMAL)) + { + gchar *uri; + + // FIXME: pass the GFile to tab when api is there + uri = g_file_get_uri (l->data); + _gedit_tab_load (tab, + uri, + encoding, + line_pos, + create); + g_free (uri); + + l = g_slist_next (l); + jump_to = FALSE; + + ++loaded_files; + } + } + + while (l != NULL) + { + gchar *uri; + + g_return_val_if_fail (l->data != NULL, 0); + + // FIXME: pass the GFile to tab when api is there + uri = g_file_get_uri (l->data); + tab = gedit_window_create_tab_from_uri (window, + uri, + encoding, + line_pos, + create, + jump_to); + g_free (uri); + + if (tab != NULL) + { + jump_to = FALSE; + ++loaded_files; + } + + l = g_slist_next (l); + } + + if (loaded_files == 1) + { + GeditDocument *doc; + gchar *uri_for_display; + + g_return_val_if_fail (tab != NULL, loaded_files); + + doc = gedit_tab_get_document (tab); + uri_for_display = gedit_document_get_uri_for_display (doc); + + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + _("Loading file '%s'\342\200\246"), + uri_for_display); + + g_free (uri_for_display); + } + else + { + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + ngettext("Loading %d file\342\200\246", + "Loading %d files\342\200\246", + loaded_files), + loaded_files); + } + + /* Free uris_to_load. Note that l points to the first element of uris_to_load */ + g_slist_free (files_to_load); + + return loaded_files; +} + + +// FIXME: we should expose API with GFile and just make the uri +// variants backward compat wrappers + +static gint +load_uri_list (GeditWindow *window, + const GSList *uris, + const GeditEncoding *encoding, + gint line_pos, + gboolean create) +{ + GSList *files = NULL; + const GSList *u; + gint ret; + + for (u = uris; u != NULL; u = u->next) + { + gchar *uri = u->data; + + if (gedit_utils_is_valid_uri (uri)) + files = g_slist_prepend (files, g_file_new_for_uri (uri)); + else + g_warning ("invalid uri: %s", uri); + } + files = g_slist_reverse (files); + + ret = load_file_list (window, files, encoding, line_pos, create); + + g_slist_foreach (files, (GFunc) g_object_unref, NULL); + g_slist_free (files); + + return ret; +} + +/** + * gedit_commands_load_uri: + * + * Do nothing if URI does not exist + */ +void +gedit_commands_load_uri (GeditWindow *window, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos) +{ + GSList *uris = NULL; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (uri != NULL); + g_return_if_fail (gedit_utils_is_valid_uri (uri)); + + gedit_debug_message (DEBUG_COMMANDS, "Loading URI '%s'", uri); + + uris = g_slist_prepend (uris, (gchar *)uri); + + load_uri_list (window, uris, encoding, line_pos, FALSE); + + g_slist_free (uris); +} + +/** + * gedit_commands_load_uris: + * + * Ignore non-existing URIs + */ +gint +gedit_commands_load_uris (GeditWindow *window, + const GSList *uris, + const GeditEncoding *encoding, + gint line_pos) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), 0); + g_return_val_if_fail ((uris != NULL) && (uris->data != NULL), 0); + + gedit_debug (DEBUG_COMMANDS); + + return load_uri_list (window, uris, encoding, line_pos, FALSE); +} + +/* + * This should become public once we convert all api to GFile: + */ +static gint +gedit_commands_load_files (GeditWindow *window, + GSList *files, + const GeditEncoding *encoding, + gint line_pos) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), 0); + g_return_val_if_fail ((files != NULL) && (files->data != NULL), 0); + + gedit_debug (DEBUG_COMMANDS); + + return load_file_list (window, files, encoding, line_pos, FALSE); +} + +/* + * From the command line we can specify a line position for the + * first doc. Beside specifying a not existing uri creates a + * titled document. + */ +gint +_gedit_cmd_load_files_from_prompt (GeditWindow *window, + GSList *files, + const GeditEncoding *encoding, + gint line_pos) +{ + gedit_debug (DEBUG_COMMANDS); + + return load_file_list (window, files, encoding, line_pos, TRUE); +} + +static void +open_dialog_destroyed (GeditWindow *window, + GeditFileChooserDialog *dialog) +{ + gedit_debug (DEBUG_COMMANDS); + + g_object_set_data (G_OBJECT (window), + GEDIT_OPEN_DIALOG_KEY, + NULL); +} + +static void +open_dialog_response_cb (GeditFileChooserDialog *dialog, + gint response_id, + GeditWindow *window) +{ + GSList *files; + const GeditEncoding *encoding; + + gedit_debug (DEBUG_COMMANDS); + + if (response_id != GTK_RESPONSE_OK) + { + gtk_widget_destroy (GTK_WIDGET (dialog)); + + return; + } + + files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (dialog)); + g_return_if_fail (files != NULL); + + encoding = gedit_file_chooser_dialog_get_encoding (dialog); + + gtk_widget_destroy (GTK_WIDGET (dialog)); + + /* Remember the folder we navigated to */ + _gedit_window_set_default_location (window, files->data); + + gedit_commands_load_files (window, + files, + encoding, + 0); + + g_slist_foreach (files, (GFunc) g_object_unref, NULL); + g_slist_free (files); +} + +void +_gedit_cmd_file_open (GtkAction *action, + GeditWindow *window) +{ + GtkWidget *open_dialog; + gpointer data; + GeditDocument *doc; + GFile *default_path = NULL; + + gedit_debug (DEBUG_COMMANDS); + + data = g_object_get_data (G_OBJECT (window), GEDIT_OPEN_DIALOG_KEY); + + if (data != NULL) + { + g_return_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (data)); + + gtk_window_present (GTK_WINDOW (data)); + + return; + } + + /* Translators: "Open Files" is the title of the file chooser window */ + open_dialog = gedit_file_chooser_dialog_new (_("Open Files"), + GTK_WINDOW (window), + GTK_FILE_CHOOSER_ACTION_OPEN, + NULL, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_OK, + NULL); + + g_object_set_data (G_OBJECT (window), + GEDIT_OPEN_DIALOG_KEY, + open_dialog); + + g_object_weak_ref (G_OBJECT (open_dialog), + (GWeakNotify) open_dialog_destroyed, + window); + + /* Set the curret folder uri */ + doc = gedit_window_get_active_document (window); + if (doc != NULL) + { + GFile *file; + + file = gedit_document_get_location (doc); + + if (file != NULL) + { + default_path = g_file_get_parent (file); + g_object_unref (file); + } + } + + if (default_path == NULL) + default_path = _gedit_window_get_default_location (window); + + if (default_path != NULL) + { + gchar *uri; + + uri = g_file_get_uri (default_path); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (open_dialog), + uri); + + g_free (uri); + g_object_unref (default_path); + } + + g_signal_connect (open_dialog, + "response", + G_CALLBACK (open_dialog_response_cb), + window); + + gtk_widget_show (open_dialog); +} + +/* File saving */ +static void file_save_as (GeditTab *tab, GeditWindow *window); + +static gboolean +is_read_only (GFile *location) +{ + gboolean ret = TRUE; /* default to read only */ + GFileInfo *info; + + gedit_debug (DEBUG_COMMANDS); + + info = g_file_query_info (location, + G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, + G_FILE_QUERY_INFO_NONE, + NULL, + NULL); + + if (info != NULL) + { + if (g_file_info_has_attribute (info, + G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) + { + ret = !g_file_info_get_attribute_boolean (info, + G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE); + } + + g_object_unref (info); + } + + return ret; +} + +/* FIXME: modify this dialog to be similar to the one provided by gtk+ for + * already existing files - Paolo (Oct. 11, 2005) */ +static gboolean +replace_read_only_file (GtkWindow *parent, GFile *file) +{ + GtkWidget *dialog; + gint ret; + gchar *parse_name; + gchar *name_for_display; + + gedit_debug (DEBUG_COMMANDS); + + parse_name = g_file_get_parse_name (file); + + /* Truncate the name so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the name doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + name_for_display = gedit_utils_str_middle_truncate (parse_name, 50); + g_free (parse_name); + + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + _("The file \"%s\" is read-only."), + name_for_display); + g_free (name_for_display); + + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + _("Do you want to try to replace it " + "with the one you are saving?")); + + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + + gedit_dialog_add_button (GTK_DIALOG (dialog), + _("_Replace"), + GTK_STOCK_SAVE_AS, + GTK_RESPONSE_YES); + + gtk_dialog_set_default_response (GTK_DIALOG (dialog), + GTK_RESPONSE_CANCEL); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + ret = gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); + + return (ret == GTK_RESPONSE_YES); +} + +static void +save_dialog_response_cb (GeditFileChooserDialog *dialog, + gint response_id, + GeditWindow *window) +{ + GFile *file; + const GeditEncoding *encoding; + GeditTab *tab; + gpointer data; + GSList *tabs_to_save_as; + GeditDocumentNewlineType newline_type; + + gedit_debug (DEBUG_COMMANDS); + + tab = GEDIT_TAB (g_object_get_data (G_OBJECT (dialog), + GEDIT_TAB_TO_SAVE_AS)); + + if (response_id != GTK_RESPONSE_OK) + { + gtk_widget_destroy (GTK_WIDGET (dialog)); + + goto save_next_tab; + } + + file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog)); + g_return_if_fail (file != NULL); + + encoding = gedit_file_chooser_dialog_get_encoding (dialog); + newline_type = gedit_file_chooser_dialog_get_newline_type (dialog); + + gtk_widget_destroy (GTK_WIDGET (dialog)); + + if (tab != NULL) + { + GeditDocument *doc; + gchar *parse_name; + gchar *uri; + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + parse_name = g_file_get_parse_name (file); + + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + _("Saving file '%s'\342\200\246"), + parse_name); + + g_free (parse_name); + + /* let's remember the dir we navigated too, + * even if the saving fails... */ + _gedit_window_set_default_location (window, file); + + // FIXME: pass the GFile to tab when api is there + uri = g_file_get_uri (file); + _gedit_tab_save_as (tab, uri, encoding, newline_type); + g_free (uri); + } + + g_object_unref (file); + +save_next_tab: + + data = g_object_get_data (G_OBJECT (window), + GEDIT_LIST_OF_TABS_TO_SAVE_AS); + if (data == NULL) + return; + + /* Save As the next tab of the list (we are Saving All files) */ + tabs_to_save_as = (GSList *)data; + g_return_if_fail (tab == GEDIT_TAB (tabs_to_save_as->data)); + + /* Remove the first item of the list */ + tabs_to_save_as = g_slist_delete_link (tabs_to_save_as, + tabs_to_save_as); + + g_object_set_data (G_OBJECT (window), + GEDIT_LIST_OF_TABS_TO_SAVE_AS, + tabs_to_save_as); + + if (tabs_to_save_as != NULL) + { + tab = GEDIT_TAB (tabs_to_save_as->data); + + if (GPOINTER_TO_BOOLEAN (g_object_get_data (G_OBJECT (tab), + GEDIT_IS_CLOSING_TAB)) == TRUE) + { + g_object_set_data (G_OBJECT (tab), + GEDIT_IS_CLOSING_TAB, + NULL); + + /* Trace tab state changes */ + g_signal_connect (tab, + "notify::state", + G_CALLBACK (tab_state_changed_while_saving), + window); + } + + gedit_window_set_active_tab (window, tab); + file_save_as (tab, window); + } +} + +static GtkFileChooserConfirmation +confirm_overwrite_callback (GtkFileChooser *dialog, + gpointer data) +{ + gchar *uri; + GFile *file; + GtkFileChooserConfirmation res; + + gedit_debug (DEBUG_COMMANDS); + + uri = gtk_file_chooser_get_uri (dialog); + file = g_file_new_for_uri (uri); + g_free (uri); + + if (is_read_only (file)) + { + if (replace_read_only_file (GTK_WINDOW (dialog), file)) + res = GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; + else + res = GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; + } + else + { + /* fall back to the default confirmation dialog */ + res = GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; + } + + g_object_unref (file); + + return res; +} + +static void +file_save_as (GeditTab *tab, + GeditWindow *window) +{ + GtkWidget *save_dialog; + GtkWindowGroup *wg; + GeditDocument *doc; + GFile *file; + gboolean uri_set = FALSE; + const GeditEncoding *encoding; + GeditDocumentNewlineType newline_type; + + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + gedit_debug (DEBUG_COMMANDS); + + save_dialog = gedit_file_chooser_dialog_new (_("Save As\342\200\246"), + GTK_WINDOW (window), + GTK_FILE_CHOOSER_ACTION_SAVE, + NULL, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_OK, + NULL); + + gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (save_dialog), + TRUE); + g_signal_connect (save_dialog, + "confirm-overwrite", + G_CALLBACK (confirm_overwrite_callback), + NULL); + + wg = gedit_window_get_group (window); + + gtk_window_group_add_window (wg, + GTK_WINDOW (save_dialog)); + + /* Save As dialog is modal to its main window */ + gtk_window_set_modal (GTK_WINDOW (save_dialog), TRUE); + + /* Set the suggested file name */ + doc = gedit_tab_get_document (tab); + file = gedit_document_get_location (doc); + + if (file != NULL) + { + uri_set = gtk_file_chooser_set_file (GTK_FILE_CHOOSER (save_dialog), + file, + NULL); + + g_object_unref (file); + } + + + if (!uri_set) + { + GFile *default_path; + gchar *docname; + + default_path = _gedit_window_get_default_location (window); + docname = gedit_document_get_short_name_for_display (doc); + + if (default_path != NULL) + { + gchar *uri; + + uri = g_file_get_uri (default_path); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (save_dialog), + uri); + + g_free (uri); + g_object_unref (default_path); + } + + gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (save_dialog), + docname); + + g_free (docname); + } + + /* Set suggested encoding */ + encoding = gedit_document_get_encoding (doc); + g_return_if_fail (encoding != NULL); + + newline_type = gedit_document_get_newline_type (doc); + + gedit_file_chooser_dialog_set_encoding (GEDIT_FILE_CHOOSER_DIALOG (save_dialog), + encoding); + + gedit_file_chooser_dialog_set_newline_type (GEDIT_FILE_CHOOSER_DIALOG (save_dialog), + newline_type); + + g_object_set_data (G_OBJECT (save_dialog), + GEDIT_TAB_TO_SAVE_AS, + tab); + + g_signal_connect (save_dialog, + "response", + G_CALLBACK (save_dialog_response_cb), + window); + + gtk_widget_show (save_dialog); +} + +static void +file_save (GeditTab *tab, + GeditWindow *window) +{ + GeditDocument *doc; + gchar *uri_for_display; + + gedit_debug (DEBUG_COMMANDS); + + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + if (gedit_document_is_untitled (doc) || + gedit_document_get_readonly (doc)) + { + gedit_debug_message (DEBUG_COMMANDS, "Untitled or Readonly"); + + file_save_as (tab, window); + + return; + } + + uri_for_display = gedit_document_get_uri_for_display (doc); + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + _("Saving file '%s'\342\200\246"), + uri_for_display); + + g_free (uri_for_display); + + _gedit_tab_save (tab); +} + +void +_gedit_cmd_file_save (GtkAction *action, + GeditWindow *window) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_window_get_active_tab (window); + if (tab == NULL) + return; + + file_save (tab, window); +} + +void +_gedit_cmd_file_save_as (GtkAction *action, + GeditWindow *window) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_window_get_active_tab (window); + if (tab == NULL) + return; + + file_save_as (tab, window); +} + +static gboolean +document_needs_saving (GeditDocument *doc) +{ + if (gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc))) + return TRUE; + + /* we check if it was deleted only for local files + * since for remote files it may hang */ + if (gedit_document_is_local (doc) && gedit_document_get_deleted (doc)) + return TRUE; + + return FALSE; +} + +/* + * The docs in the list must belong to the same GeditWindow. + */ +void +_gedit_cmd_file_save_documents_list (GeditWindow *window, + GList *docs) +{ + GList *l; + GSList *tabs_to_save_as = NULL; + + gedit_debug (DEBUG_COMMANDS); + + g_return_if_fail (!(gedit_window_get_state (window) & + (GEDIT_WINDOW_STATE_PRINTING | + GEDIT_WINDOW_STATE_SAVING_SESSION))); + + l = docs; + while (l != NULL) + { + GeditDocument *doc; + GeditTab *t; + GeditTabState state; + + g_return_if_fail (GEDIT_IS_DOCUMENT (l->data)); + + doc = GEDIT_DOCUMENT (l->data); + t = gedit_tab_get_from_document (doc); + state = gedit_tab_get_state (t); + + g_return_if_fail (state != GEDIT_TAB_STATE_PRINTING); + g_return_if_fail (state != GEDIT_TAB_STATE_PRINT_PREVIEWING); + g_return_if_fail (state != GEDIT_TAB_STATE_CLOSING); + + if ((state == GEDIT_TAB_STATE_NORMAL) || + (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) || + (state == GEDIT_TAB_STATE_GENERIC_NOT_EDITABLE)) + { + /* FIXME: manage the case of local readonly files owned by the + user is running gedit - Paolo (Dec. 8, 2005) */ + if (gedit_document_is_untitled (doc) || + gedit_document_get_readonly (doc)) + { + if (document_needs_saving (doc)) + { + tabs_to_save_as = g_slist_prepend (tabs_to_save_as, + t); + } + } + else + { + file_save (t, window); + } + } + else + { + /* If the state is: + - GEDIT_TAB_STATE_LOADING: we do not save since we are sure the file is unmodified + - GEDIT_TAB_STATE_REVERTING: we do not save since the user wants + to return back to the version of the file she previously saved + - GEDIT_TAB_STATE_SAVING: well, we are already saving (no need to save again) + - GEDIT_TAB_STATE_PRINTING, GEDIT_TAB_STATE_PRINT_PREVIEWING: there is not a + real reason for not saving in this case, we do not save to avoid to run + two operations using the message area at the same time (may be we can remove + this limitation in the future). Note that SaveAll, ClosAll + and Quit are unsensitive if the window state is PRINTING. + - GEDIT_TAB_STATE_GENERIC_ERROR: we do not save since the document contains + errors (I don't think this is a very frequent case, we should probably remove + this state) + - GEDIT_TAB_STATE_LOADING_ERROR: there is nothing to save + - GEDIT_TAB_STATE_REVERTING_ERROR: there is nothing to save and saving the current + document will overwrite the copy of the file the user wants to go back to + - GEDIT_TAB_STATE_SAVING_ERROR: we do not save since we just failed to save, so there is + no reason to automatically retry... we wait for user intervention + - GEDIT_TAB_STATE_CLOSING: this state is invalid in this case + */ + + gchar *uri_for_display; + + uri_for_display = gedit_document_get_uri_for_display (doc); + gedit_debug_message (DEBUG_COMMANDS, + "File '%s' not saved. State: %d", + uri_for_display, + state); + g_free (uri_for_display); + } + + l = g_list_next (l); + } + + if (tabs_to_save_as != NULL) + { + GeditTab *tab; + + tabs_to_save_as = g_slist_reverse (tabs_to_save_as ); + + g_return_if_fail (g_object_get_data (G_OBJECT (window), + GEDIT_LIST_OF_TABS_TO_SAVE_AS) == NULL); + + g_object_set_data (G_OBJECT (window), + GEDIT_LIST_OF_TABS_TO_SAVE_AS, + tabs_to_save_as); + + tab = GEDIT_TAB (tabs_to_save_as->data); + + gedit_window_set_active_tab (window, tab); + file_save_as (tab, window); + } +} + +void +gedit_commands_save_all_documents (GeditWindow *window) +{ + GList *docs; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + gedit_debug (DEBUG_COMMANDS); + + docs = gedit_window_get_documents (window); + + _gedit_cmd_file_save_documents_list (window, docs); + + g_list_free (docs); +} + +void +_gedit_cmd_file_save_all (GtkAction *action, + GeditWindow *window) +{ + gedit_commands_save_all_documents (window); +} + +void +gedit_commands_save_document (GeditWindow *window, + GeditDocument *document) +{ + GeditTab *tab; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (GEDIT_IS_DOCUMENT (document)); + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_tab_get_from_document (document); + file_save (tab, window); +} + +/* File revert */ +static void +do_revert (GeditWindow *window, + GeditTab *tab) +{ + GeditDocument *doc; + gchar *docname; + + gedit_debug (DEBUG_COMMANDS); + + doc = gedit_tab_get_document (tab); + docname = gedit_document_get_short_name_for_display (doc); + + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + _("Reverting the document '%s'\342\200\246"), + docname); + + g_free (docname); + + _gedit_tab_revert (tab); +} + +static void +revert_dialog_response_cb (GtkDialog *dialog, + gint response_id, + GeditWindow *window) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + /* FIXME: we are relying on the fact that the dialog is + modal so the active tab can't be changed... + not very nice - Paolo (Oct 11, 2005) */ + tab = gedit_window_get_active_tab (window); + if (tab == NULL) + return; + + gtk_widget_destroy (GTK_WIDGET (dialog)); + + if (response_id == GTK_RESPONSE_OK) + { + do_revert (window, tab); + } +} + +static GtkWidget * +revert_dialog (GeditWindow *window, + GeditDocument *doc) +{ + GtkWidget *dialog; + gchar *docname; + gchar *primary_msg; + gchar *secondary_msg; + glong seconds; + + gedit_debug (DEBUG_COMMANDS); + + docname = gedit_document_get_short_name_for_display (doc); + primary_msg = g_strdup_printf (_("Revert unsaved changes to document '%s'?"), + docname); + g_free (docname); + + seconds = MAX (1, _gedit_document_get_seconds_since_last_save_or_load (doc)); + + if (seconds < 55) + { + secondary_msg = g_strdup_printf ( + ngettext ("Changes made to the document in the last %ld second " + "will be permanently lost.", + "Changes made to the document in the last %ld seconds " + "will be permanently lost.", + seconds), + seconds); + } + else if (seconds < 75) /* 55 <= seconds < 75 */ + { + secondary_msg = g_strdup (_("Changes made to the document in the last minute " + "will be permanently lost.")); + } + else if (seconds < 110) /* 75 <= seconds < 110 */ + { + secondary_msg = g_strdup_printf ( + ngettext ("Changes made to the document in the last minute and " + "%ld second will be permanently lost.", + "Changes made to the document in the last minute and " + "%ld seconds will be permanently lost.", + seconds - 60 ), + seconds - 60); + } + else if (seconds < 3600) + { + secondary_msg = g_strdup_printf ( + ngettext ("Changes made to the document in the last %ld minute " + "will be permanently lost.", + "Changes made to the document in the last %ld minutes " + "will be permanently lost.", + seconds / 60), + seconds / 60); + } + else if (seconds < 7200) + { + gint minutes; + seconds -= 3600; + + minutes = seconds / 60; + if (minutes < 5) + { + secondary_msg = g_strdup (_("Changes made to the document in the last hour " + "will be permanently lost.")); + } + else + { + secondary_msg = g_strdup_printf ( + ngettext ("Changes made to the document in the last hour and " + "%d minute will be permanently lost.", + "Changes made to the document in the last hour and " + "%d minutes will be permanently lost.", + minutes), + minutes); + } + } + else + { + gint hours; + + hours = seconds / 3600; + + secondary_msg = g_strdup_printf ( + ngettext ("Changes made to the document in the last %d hour " + "will be permanently lost.", + "Changes made to the document in the last %d hours " + "will be permanently lost.", + hours), + hours); + } + + dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + "%s", primary_msg); + + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + "%s", secondary_msg); + g_free (primary_msg); + g_free (secondary_msg); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + + gedit_dialog_add_button (GTK_DIALOG (dialog), + _("_Revert"), + GTK_STOCK_REVERT_TO_SAVED, + GTK_RESPONSE_OK); + + gtk_dialog_set_default_response (GTK_DIALOG (dialog), + GTK_RESPONSE_CANCEL); + + return dialog; +} + +void +_gedit_cmd_file_revert (GtkAction *action, + GeditWindow *window) +{ + GeditTab *tab; + GeditDocument *doc; + GtkWidget *dialog; + GtkWindowGroup *wg; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_window_get_active_tab (window); + g_return_if_fail (tab != NULL); + + /* If we are already displaying a notification + * reverting will drop local modifications, do + * not bug the user further */ + if (gedit_tab_get_state (tab) == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) + { + do_revert (window, tab); + return; + } + + doc = gedit_tab_get_document (tab); + g_return_if_fail (doc != NULL); + g_return_if_fail (!gedit_document_is_untitled (doc)); + + dialog = revert_dialog (window, doc); + + wg = gedit_window_get_group (window); + + gtk_window_group_add_window (wg, GTK_WINDOW (dialog)); + + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + + g_signal_connect (dialog, + "response", + G_CALLBACK (revert_dialog_response_cb), + window); + + gtk_widget_show (dialog); +} + +/* Close tab */ +static gboolean +really_close_tab (GeditTab *tab) +{ + GtkWidget *toplevel; + GeditWindow *window; + + gedit_debug (DEBUG_COMMANDS); + + g_return_val_if_fail (gedit_tab_get_state (tab) == GEDIT_TAB_STATE_CLOSING, + FALSE); + + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (tab)); + g_return_val_if_fail (GEDIT_IS_WINDOW (toplevel), FALSE); + + window = GEDIT_WINDOW (toplevel); + + gedit_window_close_tab (window, tab); + + if (gedit_window_get_active_tab (window) == NULL) + { + gboolean is_quitting; + + is_quitting = GPOINTER_TO_BOOLEAN (g_object_get_data (G_OBJECT (window), + GEDIT_IS_QUITTING)); + + if (is_quitting) + gtk_widget_destroy (GTK_WIDGET (window)); + } + + return FALSE; +} + +static void +tab_state_changed_while_saving (GeditTab *tab, + GParamSpec *pspec, + GeditWindow *window) +{ + GeditTabState ts; + + ts = gedit_tab_get_state (tab); + + gedit_debug_message (DEBUG_COMMANDS, "State while saving: %d\n", ts); + + /* When the state become NORMAL, it means the saving operation is + finished */ + if (ts == GEDIT_TAB_STATE_NORMAL) + { + GeditDocument *doc; + + g_signal_handlers_disconnect_by_func (tab, + G_CALLBACK (tab_state_changed_while_saving), + window); + + doc = gedit_tab_get_document (tab); + g_return_if_fail (doc != NULL); + + /* If the saving operation failed or was interrupted, then the + document is still "modified" -> do not close the tab */ + if (document_needs_saving (doc)) + return; + + /* Close the document only if it has been succesfully saved. + Tab state is set to CLOSING (it is a state without exiting + transitions) and the tab is closed in a idle handler */ + _gedit_tab_mark_for_closing (tab); + + g_idle_add_full (G_PRIORITY_HIGH_IDLE, + (GSourceFunc)really_close_tab, + tab, + NULL); + } +} + +static void +save_and_close (GeditTab *tab, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + /* Trace tab state changes */ + g_signal_connect (tab, + "notify::state", + G_CALLBACK (tab_state_changed_while_saving), + window); + + file_save (tab, window); +} + +static void +save_as_and_close (GeditTab *tab, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + g_object_set_data (G_OBJECT (tab), + GEDIT_IS_CLOSING_TAB, + NULL); + + /* Trace tab state changes */ + g_signal_connect (tab, + "notify::state", + G_CALLBACK (tab_state_changed_while_saving), + window); + + gedit_window_set_active_tab (window, tab); + file_save_as (tab, window); +} + +static void +save_and_close_all_documents (const GList *docs, + GeditWindow *window) +{ + GList *tabs; + GList *l; + GSList *sl; + GSList *tabs_to_save_as; + GSList *tabs_to_save_and_close; + GList *tabs_to_close; + + gedit_debug (DEBUG_COMMANDS); + + g_return_if_fail (!(gedit_window_get_state (window) & GEDIT_WINDOW_STATE_PRINTING)); + + tabs = gtk_container_get_children ( + GTK_CONTAINER (_gedit_window_get_notebook (window))); + + tabs_to_save_as = NULL; + tabs_to_save_and_close = NULL; + tabs_to_close = NULL; + + l = tabs; + while (l != NULL) + { + GeditTab *t; + GeditTabState state; + GeditDocument *doc; + + t = GEDIT_TAB (l->data); + + state = gedit_tab_get_state (t); + doc = gedit_tab_get_document (t); + + /* If the state is: ([*] invalid states) + - GEDIT_TAB_STATE_NORMAL: close (and if needed save) + - GEDIT_TAB_STATE_LOADING: close, we are sure the file is unmodified + - GEDIT_TAB_STATE_REVERTING: since the user wants + to return back to the version of the file she previously saved, we can close + without saving (CHECK: are we sure this is the right behavior, suppose the case + the original file has been deleted) + - [*] GEDIT_TAB_STATE_SAVING: invalid, ClosAll + and Quit are unsensitive if the window state is SAVING. + - [*] GEDIT_TAB_STATE_PRINTING, GEDIT_TAB_STATE_PRINT_PREVIEWING: there is not a + real reason for not closing in this case, we do not save to avoid to run + two operations using the message area at the same time (may be we can remove + this limitation in the future). Note that ClosAll + and Quit are unsensitive if the window state is PRINTING. + - GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW: close (and if needed save) + - GEDIT_TAB_STATE_LOADING_ERROR: close without saving (if the state is LOADING_ERROR then the + document is not modified) + - GEDIT_TAB_STATE_REVERTING_ERROR: we do not close since the document contains errors + - GEDIT_TAB_STATE_SAVING_ERROR: we do not close since the document contains errors + - GEDIT_TAB_STATE_GENERIC_ERROR: we do not close since the document contains + errors (CHECK: we should problably remove this state) + - [*] GEDIT_TAB_STATE_CLOSING: this state is invalid in this case + */ + + g_return_if_fail (state != GEDIT_TAB_STATE_PRINTING); + g_return_if_fail (state != GEDIT_TAB_STATE_PRINT_PREVIEWING); + g_return_if_fail (state != GEDIT_TAB_STATE_CLOSING); + g_return_if_fail (state != GEDIT_TAB_STATE_SAVING); + + if ((state != GEDIT_TAB_STATE_SAVING_ERROR) && + (state != GEDIT_TAB_STATE_GENERIC_ERROR) && + (state != GEDIT_TAB_STATE_REVERTING_ERROR)) + { + if ((g_list_index ((GList *)docs, doc) >= 0) && + (state != GEDIT_TAB_STATE_LOADING) && + (state != GEDIT_TAB_STATE_LOADING_ERROR) && + (state != GEDIT_TAB_STATE_REVERTING)) /* CHECK: is this the right behavior with REVERTING ?*/ + { + /* The document must be saved before closing */ + g_return_if_fail (document_needs_saving (doc)); + + /* FIXME: manage the case of local readonly files owned by the + user is running gedit - Paolo (Dec. 8, 2005) */ + if (gedit_document_is_untitled (doc) || + gedit_document_get_readonly (doc)) + { + g_object_set_data (G_OBJECT (t), + GEDIT_IS_CLOSING_TAB, + GBOOLEAN_TO_POINTER (TRUE)); + + tabs_to_save_as = g_slist_prepend (tabs_to_save_as, + t); + } + else + { + tabs_to_save_and_close = g_slist_prepend (tabs_to_save_and_close, + t); + } + } + else + { + /* The document must be closed without saving */ + tabs_to_close = g_list_prepend (tabs_to_close, + t); + } + } + + l = g_list_next (l); + } + + g_list_free (tabs); + + /* Close all tabs to close (in a sync way) */ + gedit_window_close_tabs (window, tabs_to_close); + g_list_free (tabs_to_close); + + /* Save and close all the files in tabs_to_save_and_close */ + sl = tabs_to_save_and_close; + while (sl != NULL) + { + save_and_close (GEDIT_TAB (sl->data), + window); + sl = g_slist_next (sl); + } + g_slist_free (tabs_to_save_and_close); + + /* Save As and close all the files in tabs_to_save_as */ + if (tabs_to_save_as != NULL) + { + GeditTab *tab; + + tabs_to_save_as = g_slist_reverse (tabs_to_save_as ); + + g_return_if_fail (g_object_get_data (G_OBJECT (window), + GEDIT_LIST_OF_TABS_TO_SAVE_AS) == NULL); + + g_object_set_data (G_OBJECT (window), + GEDIT_LIST_OF_TABS_TO_SAVE_AS, + tabs_to_save_as); + + tab = GEDIT_TAB (tabs_to_save_as->data); + + save_as_and_close (tab, window); + } +} + +static void +save_and_close_document (const GList *docs, + GeditWindow *window) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + g_return_if_fail (docs->next == NULL); + + tab = gedit_tab_get_from_document (GEDIT_DOCUMENT (docs->data)); + g_return_if_fail (tab != NULL); + + save_and_close (tab, window); +} + +static void +close_all_tabs (GeditWindow *window) +{ + gboolean is_quitting; + + gedit_debug (DEBUG_COMMANDS); + + /* There is no document to save -> close all tabs */ + gedit_window_close_all_tabs (window); + + is_quitting = GPOINTER_TO_BOOLEAN (g_object_get_data (G_OBJECT (window), + GEDIT_IS_QUITTING)); + + if (is_quitting) + gtk_widget_destroy (GTK_WIDGET (window)); + + return; +} + +static void +close_document (GeditWindow *window, + GeditDocument *doc) +{ + GeditTab *tab; + + gedit_debug (DEBUG_COMMANDS); + + tab = gedit_tab_get_from_document (doc); + g_return_if_fail (tab != NULL); + + gedit_window_close_tab (window, tab); +} + +static void +close_confirmation_dialog_response_handler (GeditCloseConfirmationDialog *dlg, + gint response_id, + GeditWindow *window) +{ + GList *selected_documents; + gboolean is_closing_all; + + gedit_debug (DEBUG_COMMANDS); + + is_closing_all = GPOINTER_TO_BOOLEAN (g_object_get_data (G_OBJECT (window), + GEDIT_IS_CLOSING_ALL)); + + gtk_widget_hide (GTK_WIDGET (dlg)); + + switch (response_id) + { + case GTK_RESPONSE_YES: /* Save and Close */ + selected_documents = gedit_close_confirmation_dialog_get_selected_documents (dlg); + if (selected_documents == NULL) + { + if (is_closing_all) + { + /* There is no document to save -> close all tabs */ + /* We call gtk_widget_destroy before close_all_tabs + * because close_all_tabs could destroy the gedit window */ + gtk_widget_destroy (GTK_WIDGET (dlg)); + + close_all_tabs (window); + + return; + } + else + g_return_if_reached (); + } + else + { + if (is_closing_all) + { + save_and_close_all_documents (selected_documents, + window); + } + else + { + save_and_close_document (selected_documents, + window); + } + } + + g_list_free (selected_documents); + + break; + + case GTK_RESPONSE_NO: /* Close without Saving */ + if (is_closing_all) + { + /* We call gtk_widget_destroy before close_all_tabs + * because close_all_tabs could destroy the gedit window */ + gtk_widget_destroy (GTK_WIDGET (dlg)); + + close_all_tabs (window); + + return; + } + else + { + const GList *unsaved_documents; + + unsaved_documents = gedit_close_confirmation_dialog_get_unsaved_documents (dlg); + g_return_if_fail (unsaved_documents->next == NULL); + + close_document (window, + GEDIT_DOCUMENT (unsaved_documents->data)); + } + + break; + default: /* Do not close */ + + /* Reset is_quitting flag */ + g_object_set_data (G_OBJECT (window), + GEDIT_IS_QUITTING, + GBOOLEAN_TO_POINTER (FALSE)); + +#ifdef OS_OSX + g_object_set_data (G_OBJECT (window), + GEDIT_IS_QUITTING_ALL, + GINT_TO_POINTER (FALSE)); +#endif + break; + } + + gtk_widget_destroy (GTK_WIDGET (dlg)); +} + +/* Returns TRUE if the tab can be immediately closed */ +static gboolean +tab_can_close (GeditTab *tab, + GtkWindow *window) +{ + GeditDocument *doc; + + gedit_debug (DEBUG_COMMANDS); + + doc = gedit_tab_get_document (tab); + + if (!_gedit_tab_can_close (tab)) + { + GtkWidget *dlg; + + dlg = gedit_close_confirmation_dialog_new_single ( + window, + doc, + FALSE); + + g_signal_connect (dlg, + "response", + G_CALLBACK (close_confirmation_dialog_response_handler), + window); + + gtk_widget_show (dlg); + + return FALSE; + } + + return TRUE; +} + +/* CHECK: we probably need this one public for plugins... + * maybe even a _list variant. Or maybe it's better make + * gedit_window_close_tab always run the confirm dialog? + * we should not allow closing a tab without resetting the + * GEDIT_IS_CLOSING_ALL flag! + */ +void +_gedit_cmd_file_close_tab (GeditTab *tab, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + g_return_if_fail (GTK_WIDGET (window) == gtk_widget_get_toplevel (GTK_WIDGET (tab))); + + g_object_set_data (G_OBJECT (window), + GEDIT_IS_CLOSING_ALL, + GBOOLEAN_TO_POINTER (FALSE)); + + g_object_set_data (G_OBJECT (window), + GEDIT_IS_QUITTING, + GBOOLEAN_TO_POINTER (FALSE)); + + g_object_set_data (G_OBJECT (window), + GEDIT_IS_QUITTING_ALL, + GINT_TO_POINTER (FALSE)); + + + if (tab_can_close (tab, GTK_WINDOW (window))) + gedit_window_close_tab (window, tab); +} + +void +_gedit_cmd_file_close (GtkAction *action, + GeditWindow *window) +{ + GeditTab *active_tab; + + gedit_debug (DEBUG_COMMANDS); + + active_tab = gedit_window_get_active_tab (window); + + if (active_tab == NULL) + { +#ifdef OS_OSX + /* Close the window on OS X */ + gtk_widget_destroy (GTK_WIDGET (window)); +#endif + return; + } + + _gedit_cmd_file_close_tab (active_tab, window); +} + +/* Close all tabs */ +static void +file_close_all (GeditWindow *window, + gboolean is_quitting) +{ + GList *unsaved_docs; + GtkWidget *dlg; + + gedit_debug (DEBUG_COMMANDS); + + g_return_if_fail (!(gedit_window_get_state (window) & + (GEDIT_WINDOW_STATE_SAVING | + GEDIT_WINDOW_STATE_PRINTING | + GEDIT_WINDOW_STATE_SAVING_SESSION))); + + g_object_set_data (G_OBJECT (window), + GEDIT_IS_CLOSING_ALL, + GBOOLEAN_TO_POINTER (TRUE)); + + g_object_set_data (G_OBJECT (window), + GEDIT_IS_QUITTING, + GBOOLEAN_TO_POINTER (is_quitting)); + + unsaved_docs = gedit_window_get_unsaved_documents (window); + + if (unsaved_docs == NULL) + { + /* There is no document to save -> close all tabs */ + gedit_window_close_all_tabs (window); + + if (is_quitting) + gtk_widget_destroy (GTK_WIDGET (window)); + + return; + } + + if (unsaved_docs->next == NULL) + { + /* There is only one unsaved document */ + GeditTab *tab; + GeditDocument *doc; + + doc = GEDIT_DOCUMENT (unsaved_docs->data); + + tab = gedit_tab_get_from_document (doc); + g_return_if_fail (tab != NULL); + + gedit_window_set_active_tab (window, tab); + + dlg = gedit_close_confirmation_dialog_new_single ( + GTK_WINDOW (window), + doc, + FALSE); + } + else + { + dlg = gedit_close_confirmation_dialog_new (GTK_WINDOW (window), + unsaved_docs, + FALSE); + } + + g_list_free (unsaved_docs); + + g_signal_connect (dlg, + "response", + G_CALLBACK (close_confirmation_dialog_response_handler), + window); + + gtk_widget_show (dlg); +} + +void +_gedit_cmd_file_close_all (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + g_return_if_fail (!(gedit_window_get_state (window) & + (GEDIT_WINDOW_STATE_SAVING | + GEDIT_WINDOW_STATE_PRINTING | + GEDIT_WINDOW_STATE_SAVING_SESSION))); + + file_close_all (window, FALSE); +} + +/* Quit */ +#ifdef OS_OSX +static void +quit_all () +{ + GList *windows; + GList *item; + GeditApp *app; + + app = gedit_app_get_default (); + windows = g_list_copy ((GList *)gedit_app_get_windows (app)); + + for (item = windows; item; item = g_list_next (item)) + { + GeditWindow *window = GEDIT_WINDOW (item->data); + + g_object_set_data (G_OBJECT (window), + GEDIT_IS_QUITTING_ALL, + GINT_TO_POINTER (TRUE)); + + if (!(gedit_window_get_state (window) & + (GEDIT_WINDOW_STATE_SAVING | + GEDIT_WINDOW_STATE_PRINTING | + GEDIT_WINDOW_STATE_SAVING_SESSION))) + { + file_close_all (window, TRUE); + } + } + + g_list_free (windows); +} +#endif + +void +_gedit_cmd_file_quit (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + +#ifdef OS_OSX + if (action != NULL) + { + quit_all (); + return; + } +#endif + + g_return_if_fail (!(gedit_window_get_state (window) & + (GEDIT_WINDOW_STATE_SAVING | + GEDIT_WINDOW_STATE_PRINTING | + GEDIT_WINDOW_STATE_SAVING_SESSION))); + + file_close_all (window, TRUE); +} diff --git a/gedit/gedit-commands-help.c b/gedit/gedit-commands-help.c new file mode 100755 index 00000000..3b71106e --- /dev/null +++ b/gedit/gedit-commands-help.c @@ -0,0 +1,115 @@ +/* + * gedit-help-commands.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "gedit-commands.h" +#include "gedit-debug.h" +#include "gedit-help.h" +#include "gedit-dirs.h" + +void +_gedit_cmd_help_contents (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + gedit_help_display (GTK_WINDOW (window), NULL, NULL); +} + +void +_gedit_cmd_help_about (GtkAction *action, + GeditWindow *window) +{ + static const gchar * const authors[] = { + "Paolo Maggi ", + "Paolo Borelli ", + "Steve Fr\303\251cinaux ", + "Jesse van den Kieboom ", + "Ignacio Casal Quinteiro ", + "James Willcox ", + "Chema Celorio", + "Federico Mena Quintero ", + NULL + }; + + static const gchar * const documenters[] = { + "Sun MATE Documentation Team ", + "Eric Baudais ", + NULL + }; + + static const gchar copyright[] = \ + "Copyright \xc2\xa9 1998-2000 Evan Lawrence, Alex Robert\n" + "Copyright \xc2\xa9 2000-2002 Chema Celorio, Paolo Maggi\n" + "Copyright \xc2\xa9 2003-2006 Paolo Maggi\n" + "Copyright \xc2\xa9 2004-2010 Paolo Borelli, Jesse van den Kieboom\nSteve Fr\303\251cinaux, Ignacio Casal Quinteiro"; + + static const gchar comments[] = \ + N_("gedit is a small and lightweight text editor for the " + "MATE Desktop"); + + GdkPixbuf *logo; + gchar *data_dir; + gchar *logo_file; + + gedit_debug (DEBUG_COMMANDS); + + data_dir = gedit_dirs_get_gedit_data_dir (); + logo_file = g_build_filename (data_dir, + "logo", + "gedit-logo.png", + NULL); + g_free (data_dir); + logo = gdk_pixbuf_new_from_file (logo_file, NULL); + g_free (logo_file); + + gtk_show_about_dialog (GTK_WINDOW (window), + "program-name", "gedit", + "authors", authors, + "comments", _(comments), + "copyright", copyright, + "documenters", documenters, + "logo", logo, + "translator-credits", _("translator-credits"), + "version", VERSION, + "website", "http://www.gedit.org", + NULL); + + if (logo) + g_object_unref (logo); +} diff --git a/gedit/gedit-commands-search.c b/gedit/gedit-commands-search.c new file mode 100755 index 00000000..3a44a218 --- /dev/null +++ b/gedit/gedit-commands-search.c @@ -0,0 +1,716 @@ +/* + * gedit-search-commands.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2006 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "gedit-commands.h" +#include "gedit-debug.h" +#include "gedit-statusbar.h" +#include "gedit-window.h" +#include "gedit-window-private.h" +#include "gedit-utils.h" +#include "dialogs/gedit-search-dialog.h" + +#define GEDIT_SEARCH_DIALOG_KEY "gedit-search-dialog-key" +#define GEDIT_LAST_SEARCH_DATA_KEY "gedit-last-search-data-key" + +typedef struct _LastSearchData LastSearchData; +struct _LastSearchData +{ + gint x; + gint y; +}; + +static void +last_search_data_free (LastSearchData *data) +{ + g_slice_free (LastSearchData, data); +} + +static void +last_search_data_restore_position (GeditSearchDialog *dlg) +{ + LastSearchData *data; + + data = g_object_get_data (G_OBJECT (dlg), GEDIT_LAST_SEARCH_DATA_KEY); + + if (data != NULL) + { + gtk_window_move (GTK_WINDOW (dlg), + data->x, + data->y); + } +} + +static void +last_search_data_store_position (GeditSearchDialog *dlg) +{ + LastSearchData *data; + + data = g_object_get_data (G_OBJECT (dlg), GEDIT_LAST_SEARCH_DATA_KEY); + + if (data == NULL) + { + data = g_slice_new (LastSearchData); + + g_object_set_data_full (G_OBJECT (dlg), + GEDIT_LAST_SEARCH_DATA_KEY, + data, + (GDestroyNotify) last_search_data_free); + } + + gtk_window_get_position (GTK_WINDOW (dlg), + &data->x, + &data->y); +} + +/* Use occurences only for Replace All */ +static void +text_found (GeditWindow *window, + gint occurrences) +{ + if (occurrences > 1) + { + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + ngettext("Found and replaced %d occurrence", + "Found and replaced %d occurrences", + occurrences), + occurrences); + } + else + { + if (occurrences == 1) + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + _("Found and replaced one occurrence")); + else + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + " "); + } +} + +#define MAX_MSG_LENGTH 40 +static void +text_not_found (GeditWindow *window, + const gchar *text) +{ + gchar *searched; + + searched = gedit_utils_str_end_truncate (text, MAX_MSG_LENGTH); + + gedit_statusbar_flash_message (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + /* Translators: %s is replaced by the text + entered by the user in the search box */ + _("\"%s\" not found"), searched); + g_free (searched); +} + +static gboolean +run_search (GeditView *view, + gboolean wrap_around, + gboolean search_backwards) +{ + GeditDocument *doc; + GtkTextIter start_iter; + GtkTextIter match_start; + GtkTextIter match_end; + gboolean found = FALSE; + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + + if (!search_backwards) + { + gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), + NULL, + &start_iter); + + found = gedit_document_search_forward (doc, + &start_iter, + NULL, + &match_start, + &match_end); + } + else + { + gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), + &start_iter, + NULL); + + found = gedit_document_search_backward (doc, + NULL, + &start_iter, + &match_start, + &match_end); + } + + if (!found && wrap_around) + { + if (!search_backwards) + found = gedit_document_search_forward (doc, + NULL, + NULL, /* FIXME: set the end_inter */ + &match_start, + &match_end); + else + found = gedit_document_search_backward (doc, + NULL, /* FIXME: set the start_inter */ + NULL, + &match_start, + &match_end); + } + + if (found) + { + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), + &match_start); + + gtk_text_buffer_move_mark_by_name (GTK_TEXT_BUFFER (doc), + "selection_bound", + &match_end); + + gedit_view_scroll_to_cursor (view); + } + else + { + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), + &start_iter); + } + + return found; +} + +static void +do_find (GeditSearchDialog *dialog, + GeditWindow *window) +{ + GeditView *active_view; + GeditDocument *doc; + gchar *search_text; + const gchar *entry_text; + gboolean match_case; + gboolean entire_word; + gboolean wrap_around; + gboolean search_backwards; + guint flags = 0; + guint old_flags = 0; + gboolean found; + + /* TODO: make the dialog insensitive when all the tabs are closed + * and assert here that the view is not NULL */ + active_view = gedit_window_get_active_view (window); + if (active_view == NULL) + return; + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); + + entry_text = gedit_search_dialog_get_search_text (dialog); + + match_case = gedit_search_dialog_get_match_case (dialog); + entire_word = gedit_search_dialog_get_entire_word (dialog); + search_backwards = gedit_search_dialog_get_backwards (dialog); + wrap_around = gedit_search_dialog_get_wrap_around (dialog); + + GEDIT_SEARCH_SET_CASE_SENSITIVE (flags, match_case); + GEDIT_SEARCH_SET_ENTIRE_WORD (flags, entire_word); + + search_text = gedit_document_get_search_text (doc, &old_flags); + + if ((search_text == NULL) || + (strcmp (search_text, entry_text) != 0) || + (flags != old_flags)) + { + gedit_document_set_search_text (doc, entry_text, flags); + } + + g_free (search_text); + + found = run_search (active_view, + wrap_around, + search_backwards); + + if (found) + text_found (window, 0); + else + text_not_found (window, entry_text); + + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, + found); +} + +/* FIXME: move in gedit-document.c and share it with gedit-view */ +static gboolean +get_selected_text (GtkTextBuffer *doc, + gchar **selected_text, + gint *len) +{ + GtkTextIter start, end; + + g_return_val_if_fail (selected_text != NULL, FALSE); + g_return_val_if_fail (*selected_text == NULL, FALSE); + + if (!gtk_text_buffer_get_selection_bounds (doc, &start, &end)) + { + if (len != NULL) + len = 0; + + return FALSE; + } + + *selected_text = gtk_text_buffer_get_slice (doc, &start, &end, TRUE); + + if (len != NULL) + *len = g_utf8_strlen (*selected_text, -1); + + return TRUE; +} + +static void +replace_selected_text (GtkTextBuffer *buffer, + const gchar *replace) +{ + g_return_if_fail (gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL)); + g_return_if_fail (replace != NULL); + + gtk_text_buffer_begin_user_action (buffer); + + gtk_text_buffer_delete_selection (buffer, FALSE, TRUE); + + gtk_text_buffer_insert_at_cursor (buffer, replace, strlen (replace)); + + gtk_text_buffer_end_user_action (buffer); +} + +static void +do_replace (GeditSearchDialog *dialog, + GeditWindow *window) +{ + GeditDocument *doc; + const gchar *search_entry_text; + const gchar *replace_entry_text; + gchar *unescaped_search_text; + gchar *unescaped_replace_text; + gchar *selected_text = NULL; + gboolean match_case; + + doc = gedit_window_get_active_document (window); + if (doc == NULL) + return; + + search_entry_text = gedit_search_dialog_get_search_text (dialog); + g_return_if_fail ((search_entry_text) != NULL); + g_return_if_fail ((*search_entry_text) != '\0'); + + /* replace text may be "", we just delete */ + replace_entry_text = gedit_search_dialog_get_replace_text (dialog); + g_return_if_fail ((replace_entry_text) != NULL); + + unescaped_search_text = gedit_utils_unescape_search_text (search_entry_text); + + get_selected_text (GTK_TEXT_BUFFER (doc), + &selected_text, + NULL); + + match_case = gedit_search_dialog_get_match_case (dialog); + + if ((selected_text == NULL) || + (match_case && (strcmp (selected_text, unescaped_search_text) != 0)) || + (!match_case && !g_utf8_caselessnmatch (selected_text, + unescaped_search_text, + strlen (selected_text), + strlen (unescaped_search_text)) != 0)) + { + do_find (dialog, window); + g_free (unescaped_search_text); + g_free (selected_text); + + return; + } + + unescaped_replace_text = gedit_utils_unescape_search_text (replace_entry_text); + replace_selected_text (GTK_TEXT_BUFFER (doc), unescaped_replace_text); + + g_free (unescaped_search_text); + g_free (selected_text); + g_free (unescaped_replace_text); + + do_find (dialog, window); +} + +static void +do_replace_all (GeditSearchDialog *dialog, + GeditWindow *window) +{ + GeditView *active_view; + GeditDocument *doc; + const gchar *search_entry_text; + const gchar *replace_entry_text; + gboolean match_case; + gboolean entire_word; + guint flags = 0; + gint count; + + active_view = gedit_window_get_active_view (window); + if (active_view == NULL) + return; + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); + + search_entry_text = gedit_search_dialog_get_search_text (dialog); + g_return_if_fail ((search_entry_text) != NULL); + g_return_if_fail ((*search_entry_text) != '\0'); + + /* replace text may be "", we just delete all occurrencies */ + replace_entry_text = gedit_search_dialog_get_replace_text (dialog); + g_return_if_fail ((replace_entry_text) != NULL); + + match_case = gedit_search_dialog_get_match_case (dialog); + entire_word = gedit_search_dialog_get_entire_word (dialog); + + GEDIT_SEARCH_SET_CASE_SENSITIVE (flags, match_case); + GEDIT_SEARCH_SET_ENTIRE_WORD (flags, entire_word); + + count = gedit_document_replace_all (doc, + search_entry_text, + replace_entry_text, + flags); + + if (count > 0) + { + text_found (window, count); + } + else + { + text_not_found (window, search_entry_text); + } + + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE, + FALSE); +} + +static void +search_dialog_response_cb (GeditSearchDialog *dialog, + gint response_id, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + switch (response_id) + { + case GEDIT_SEARCH_DIALOG_FIND_RESPONSE: + do_find (dialog, window); + break; + case GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE: + do_replace (dialog, window); + break; + case GEDIT_SEARCH_DIALOG_REPLACE_ALL_RESPONSE: + do_replace_all (dialog, window); + break; + default: + last_search_data_store_position (dialog); + gtk_widget_hide (GTK_WIDGET (dialog)); + } +} + +static gboolean +search_dialog_delete_event_cb (GtkWidget *widget, + GdkEventAny *event, + gpointer user_data) +{ + gedit_debug (DEBUG_COMMANDS); + + /* prevent destruction */ + return TRUE; +} + +static void +search_dialog_destroyed (GeditWindow *window, + GeditSearchDialog *dialog) +{ + gedit_debug (DEBUG_COMMANDS); + + g_object_set_data (G_OBJECT (window), + GEDIT_SEARCH_DIALOG_KEY, + NULL); + g_object_set_data (G_OBJECT (dialog), + GEDIT_LAST_SEARCH_DATA_KEY, + NULL); +} + +static GtkWidget * +create_dialog (GeditWindow *window, gboolean show_replace) +{ + GtkWidget *dialog; + + dialog = gedit_search_dialog_new (GTK_WINDOW (window), show_replace); + + g_signal_connect (dialog, + "response", + G_CALLBACK (search_dialog_response_cb), + window); + g_signal_connect (dialog, + "delete-event", + G_CALLBACK (search_dialog_delete_event_cb), + NULL); + + g_object_set_data (G_OBJECT (window), + GEDIT_SEARCH_DIALOG_KEY, + dialog); + + g_object_weak_ref (G_OBJECT (dialog), + (GWeakNotify) search_dialog_destroyed, + window); + + return dialog; +} + +void +_gedit_cmd_search_find (GtkAction *action, + GeditWindow *window) +{ + gpointer data; + GtkWidget *search_dialog; + GeditDocument *doc; + gboolean selection_exists; + gchar *find_text = NULL; + gint sel_len; + + gedit_debug (DEBUG_COMMANDS); + + data = g_object_get_data (G_OBJECT (window), GEDIT_SEARCH_DIALOG_KEY); + + if (data == NULL) + { + search_dialog = create_dialog (window, FALSE); + } + else + { + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (data)); + + search_dialog = GTK_WIDGET (data); + + /* turn the dialog into a find dialog if needed */ + if (gedit_search_dialog_get_show_replace (GEDIT_SEARCH_DIALOG (search_dialog))) + gedit_search_dialog_set_show_replace (GEDIT_SEARCH_DIALOG (search_dialog), + FALSE); + } + + doc = gedit_window_get_active_document (window); + g_return_if_fail (doc != NULL); + + selection_exists = get_selected_text (GTK_TEXT_BUFFER (doc), + &find_text, + &sel_len); + + if (selection_exists && find_text != NULL && sel_len < 80) + { + gedit_search_dialog_set_search_text (GEDIT_SEARCH_DIALOG (search_dialog), + find_text); + g_free (find_text); + } + else + { + g_free (find_text); + } + + gtk_widget_show (search_dialog); + last_search_data_restore_position (GEDIT_SEARCH_DIALOG (search_dialog)); + gedit_search_dialog_present_with_time (GEDIT_SEARCH_DIALOG (search_dialog), + GDK_CURRENT_TIME); +} + +void +_gedit_cmd_search_replace (GtkAction *action, + GeditWindow *window) +{ + gpointer data; + GtkWidget *replace_dialog; + GeditDocument *doc; + gboolean selection_exists; + gchar *find_text = NULL; + gint sel_len; + + gedit_debug (DEBUG_COMMANDS); + + data = g_object_get_data (G_OBJECT (window), GEDIT_SEARCH_DIALOG_KEY); + + if (data == NULL) + { + replace_dialog = create_dialog (window, TRUE); + } + else + { + g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (data)); + + replace_dialog = GTK_WIDGET (data); + + /* turn the dialog into a find dialog if needed */ + if (!gedit_search_dialog_get_show_replace (GEDIT_SEARCH_DIALOG (replace_dialog))) + gedit_search_dialog_set_show_replace (GEDIT_SEARCH_DIALOG (replace_dialog), + TRUE); + } + + doc = gedit_window_get_active_document (window); + g_return_if_fail (doc != NULL); + + selection_exists = get_selected_text (GTK_TEXT_BUFFER (doc), + &find_text, + &sel_len); + + if (selection_exists && find_text != NULL && sel_len < 80) + { + gedit_search_dialog_set_search_text (GEDIT_SEARCH_DIALOG (replace_dialog), + find_text); + g_free (find_text); + } + else + { + g_free (find_text); + } + + gtk_widget_show (replace_dialog); + last_search_data_restore_position (GEDIT_SEARCH_DIALOG (replace_dialog)); + gedit_search_dialog_present_with_time (GEDIT_SEARCH_DIALOG (replace_dialog), + GDK_CURRENT_TIME); +} + +static void +do_find_again (GeditWindow *window, + gboolean backward) +{ + GeditView *active_view; + gboolean wrap_around = TRUE; + gpointer data; + + active_view = gedit_window_get_active_view (window); + g_return_if_fail (active_view != NULL); + + data = g_object_get_data (G_OBJECT (window), GEDIT_SEARCH_DIALOG_KEY); + + if (data != NULL) + wrap_around = gedit_search_dialog_get_wrap_around (GEDIT_SEARCH_DIALOG (data)); + + run_search (active_view, + wrap_around, + backward); +} + +void +_gedit_cmd_search_find_next (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + do_find_again (window, FALSE); +} + +void +_gedit_cmd_search_find_prev (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + do_find_again (window, TRUE); +} + +void +_gedit_cmd_search_clear_highlight (GtkAction *action, + GeditWindow *window) +{ + GeditDocument *doc; + + gedit_debug (DEBUG_COMMANDS); + + doc = gedit_window_get_active_document (window); + gedit_document_set_search_text (GEDIT_DOCUMENT (doc), + "", + GEDIT_SEARCH_DONT_SET_FLAGS); +} + +void +_gedit_cmd_search_goto_line (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + if (active_view == NULL) + return; + + /* Focus the view if needed: we need to focus the view otherwise + activating the binding for goto line has no effect */ + gtk_widget_grab_focus (GTK_WIDGET (active_view)); + + + /* goto line is builtin in GeditView, just activate + * the corrisponding binding. + */ + gtk_bindings_activate (GTK_OBJECT (active_view), + GDK_i, + GDK_CONTROL_MASK); +} + +void +_gedit_cmd_search_incremental_search (GtkAction *action, + GeditWindow *window) +{ + GeditView *active_view; + + gedit_debug (DEBUG_COMMANDS); + + active_view = gedit_window_get_active_view (window); + if (active_view == NULL) + return; + + /* Focus the view if needed: we need to focus the view otherwise + activating the binding for incremental search has no effect */ + gtk_widget_grab_focus (GTK_WIDGET (active_view)); + + /* incremental search is builtin in GeditView, just activate + * the corrisponding binding. + */ + gtk_bindings_activate (GTK_OBJECT (active_view), + GDK_k, + GDK_CONTROL_MASK); +} diff --git a/gedit/gedit-commands-view.c b/gedit/gedit-commands-view.c new file mode 100755 index 00000000..2366e49c --- /dev/null +++ b/gedit/gedit-commands-view.c @@ -0,0 +1,154 @@ +/* + * gedit-view-commands.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gedit-commands.h" +#include "gedit-debug.h" +#include "gedit-window.h" +#include "gedit-window-private.h" + + +void +_gedit_cmd_view_show_toolbar (GtkAction *action, + GeditWindow *window) +{ + gboolean visible; + + gedit_debug (DEBUG_COMMANDS); + + visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + + if (visible) + gtk_widget_show (window->priv->toolbar); + else + gtk_widget_hide (window->priv->toolbar); +} + +void +_gedit_cmd_view_show_statusbar (GtkAction *action, + GeditWindow *window) +{ + gboolean visible; + + gedit_debug (DEBUG_COMMANDS); + + visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + + if (visible) + gtk_widget_show (window->priv->statusbar); + else + gtk_widget_hide (window->priv->statusbar); +} + +void +_gedit_cmd_view_show_side_pane (GtkAction *action, + GeditWindow *window) +{ + gboolean visible; + GeditPanel *panel; + + gedit_debug (DEBUG_COMMANDS); + + visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + + panel = gedit_window_get_side_panel (window); + + if (visible) + { + gtk_widget_show (GTK_WIDGET (panel)); + gtk_widget_grab_focus (GTK_WIDGET (panel)); + } + else + { + gtk_widget_hide (GTK_WIDGET (panel)); + } +} + +void +_gedit_cmd_view_show_bottom_pane (GtkAction *action, + GeditWindow *window) +{ + gboolean visible; + GeditPanel *panel; + + gedit_debug (DEBUG_COMMANDS); + + visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + + panel = gedit_window_get_bottom_panel (window); + + if (visible) + { + gtk_widget_show (GTK_WIDGET (panel)); + gtk_widget_grab_focus (GTK_WIDGET (panel)); + } + else + { + gtk_widget_hide (GTK_WIDGET (panel)); + } +} + +void +_gedit_cmd_view_toggle_fullscreen_mode (GtkAction *action, + GeditWindow *window) +{ + gedit_debug (DEBUG_COMMANDS); + + if (_gedit_window_is_fullscreen (window)) + _gedit_window_unfullscreen (window); + else + _gedit_window_fullscreen (window); +} + +void +_gedit_cmd_view_leave_fullscreen_mode (GtkAction *action, + GeditWindow *window) +{ + GtkAction *view_action; + + view_action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "ViewFullscreen"); + g_signal_handlers_block_by_func + (view_action, G_CALLBACK (_gedit_cmd_view_toggle_fullscreen_mode), + window); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (view_action), + FALSE); + _gedit_window_unfullscreen (window); + g_signal_handlers_unblock_by_func + (view_action, G_CALLBACK (_gedit_cmd_view_toggle_fullscreen_mode), + window); +} diff --git a/gedit/gedit-commands.h b/gedit/gedit-commands.h new file mode 100755 index 00000000..08e70885 --- /dev/null +++ b/gedit/gedit-commands.h @@ -0,0 +1,166 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-commands.h + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_COMMANDS_H__ +#define __GEDIT_COMMANDS_H__ + +#include +#include + +G_BEGIN_DECLS + +/* Do nothing if URI does not exist */ +void gedit_commands_load_uri (GeditWindow *window, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos); + +/* Ignore non-existing URIs */ +gint gedit_commands_load_uris (GeditWindow *window, + const GSList *uris, + const GeditEncoding *encoding, + gint line_pos); + +void gedit_commands_save_document (GeditWindow *window, + GeditDocument *document); + +void gedit_commands_save_all_documents (GeditWindow *window); + +/* + * Non-exported functions + */ + +/* Create titled documens for non-existing URIs */ +gint _gedit_cmd_load_files_from_prompt (GeditWindow *window, + GSList *files, + const GeditEncoding *encoding, + gint line_pos); + +void _gedit_cmd_file_new (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_open (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_save (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_save_as (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_save_all (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_revert (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_open_uri (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_print_preview (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_print (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_close (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_close_all (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_file_quit (GtkAction *action, + GeditWindow *window); + +void _gedit_cmd_edit_undo (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_edit_redo (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_edit_cut (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_edit_copy (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_edit_paste (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_edit_delete (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_edit_select_all (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_edit_preferences (GtkAction *action, + GeditWindow *window); + +void _gedit_cmd_view_show_toolbar (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_view_show_statusbar (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_view_show_side_pane (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_view_show_bottom_pane (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_view_toggle_fullscreen_mode (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_view_leave_fullscreen_mode (GtkAction *action, + GeditWindow *window); + +void _gedit_cmd_search_find (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_search_find_next (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_search_find_prev (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_search_replace (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_search_clear_highlight (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_search_goto_line (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_search_incremental_search (GtkAction *action, + GeditWindow *window); + +void _gedit_cmd_documents_previous_document (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_documents_next_document (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_documents_move_to_new_window (GtkAction *action, + GeditWindow *window); + +void _gedit_cmd_help_contents (GtkAction *action, + GeditWindow *window); +void _gedit_cmd_help_about (GtkAction *action, + GeditWindow *window); + +void _gedit_cmd_file_close_tab (GeditTab *tab, + GeditWindow *window); + +void _gedit_cmd_file_save_documents_list (GeditWindow *window, + GList *docs); + + +#if !GTK_CHECK_VERSION (2, 17, 4) +void _gedit_cmd_file_page_setup (GtkAction *action, + GeditWindow *window); +#endif + + +G_END_DECLS + +#endif /* __GEDIT_COMMANDS_H__ */ diff --git a/gedit/gedit-debug.c b/gedit/gedit-debug.c new file mode 100755 index 00000000..163a5a54 --- /dev/null +++ b/gedit/gedit-debug.c @@ -0,0 +1,159 @@ +/* + * gedit-debug.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002 - 2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include "gedit-debug.h" + +#define ENABLE_PROFILING + +#ifdef ENABLE_PROFILING +static GTimer *timer = NULL; +static gdouble last = 0.0; +#endif + +static GeditDebugSection debug = GEDIT_NO_DEBUG; + +void +gedit_debug_init (void) +{ + if (g_getenv ("GEDIT_DEBUG") != NULL) + { + /* enable all debugging */ + debug = ~GEDIT_NO_DEBUG; + goto out; + } + + if (g_getenv ("GEDIT_DEBUG_VIEW") != NULL) + debug = debug | GEDIT_DEBUG_VIEW; + if (g_getenv ("GEDIT_DEBUG_SEARCH") != NULL) + debug = debug | GEDIT_DEBUG_SEARCH; + if (g_getenv ("GEDIT_DEBUG_PREFS") != NULL) + debug = debug | GEDIT_DEBUG_PREFS; + if (g_getenv ("GEDIT_DEBUG_PRINT") != NULL) + debug = debug | GEDIT_DEBUG_PRINT; + if (g_getenv ("GEDIT_DEBUG_PLUGINS") != NULL) + debug = debug | GEDIT_DEBUG_PLUGINS; + if (g_getenv ("GEDIT_DEBUG_TAB") != NULL) + debug = debug | GEDIT_DEBUG_TAB; + if (g_getenv ("GEDIT_DEBUG_DOCUMENT") != NULL) + debug = debug | GEDIT_DEBUG_DOCUMENT; + if (g_getenv ("GEDIT_DEBUG_COMMANDS") != NULL) + debug = debug | GEDIT_DEBUG_COMMANDS; + if (g_getenv ("GEDIT_DEBUG_APP") != NULL) + debug = debug | GEDIT_DEBUG_APP; + if (g_getenv ("GEDIT_DEBUG_SESSION") != NULL) + debug = debug | GEDIT_DEBUG_SESSION; + if (g_getenv ("GEDIT_DEBUG_UTILS") != NULL) + debug = debug | GEDIT_DEBUG_UTILS; + if (g_getenv ("GEDIT_DEBUG_METADATA") != NULL) + debug = debug | GEDIT_DEBUG_METADATA; + if (g_getenv ("GEDIT_DEBUG_WINDOW") != NULL) + debug = debug | GEDIT_DEBUG_WINDOW; + if (g_getenv ("GEDIT_DEBUG_LOADER") != NULL) + debug = debug | GEDIT_DEBUG_LOADER; + if (g_getenv ("GEDIT_DEBUG_SAVER") != NULL) + debug = debug | GEDIT_DEBUG_SAVER; + +out: + +#ifdef ENABLE_PROFILING + if (debug != GEDIT_NO_DEBUG) + timer = g_timer_new (); +#endif + return; +} + +void +gedit_debug_message (GeditDebugSection section, + const gchar *file, + gint line, + const gchar *function, + const gchar *format, ...) +{ + if (G_UNLIKELY (debug & section)) + { +#ifdef ENABLE_PROFILING + gdouble seconds; +#endif + + va_list args; + gchar *msg; + + g_return_if_fail (format != NULL); + + va_start (args, format); + msg = g_strdup_vprintf (format, args); + va_end (args); + +#ifdef ENABLE_PROFILING + g_return_if_fail (timer != NULL); + + seconds = g_timer_elapsed (timer, NULL); + g_print ("[%f (%f)] %s:%d (%s) %s\n", + seconds, seconds - last, file, line, function, msg); + last = seconds; +#else + g_print ("%s:%d (%s) %s\n", file, line, function, msg); +#endif + + fflush (stdout); + + g_free (msg); + } +} + +void gedit_debug (GeditDebugSection section, + const gchar *file, + gint line, + const gchar *function) +{ + if (G_UNLIKELY (debug & section)) + { +#ifdef ENABLE_PROFILING + gdouble seconds; + + g_return_if_fail (timer != NULL); + + seconds = g_timer_elapsed (timer, NULL); + g_print ("[%f (%f)] %s:%d (%s)\n", + seconds, seconds - last, file, line, function); + last = seconds; +#else + g_print ("%s:%d (%s)\n", file, line, function); +#endif + fflush (stdout); + } +} diff --git a/gedit/gedit-debug.h b/gedit/gedit-debug.h new file mode 100755 index 00000000..af7d7370 --- /dev/null +++ b/gedit/gedit-debug.h @@ -0,0 +1,93 @@ +/* + * gedit-debug.h + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002 - 2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_DEBUG_H__ +#define __GEDIT_DEBUG_H__ + +#include + +/* + * Set an environmental var of the same name to turn on + * debugging output. Setting GEDIT_DEBUG will turn on all + * sections. + */ +typedef enum { + GEDIT_NO_DEBUG = 0, + GEDIT_DEBUG_VIEW = 1 << 0, + GEDIT_DEBUG_SEARCH = 1 << 1, + GEDIT_DEBUG_PRINT = 1 << 2, + GEDIT_DEBUG_PREFS = 1 << 3, + GEDIT_DEBUG_PLUGINS = 1 << 4, + GEDIT_DEBUG_TAB = 1 << 5, + GEDIT_DEBUG_DOCUMENT = 1 << 6, + GEDIT_DEBUG_COMMANDS = 1 << 7, + GEDIT_DEBUG_APP = 1 << 8, + GEDIT_DEBUG_SESSION = 1 << 9, + GEDIT_DEBUG_UTILS = 1 << 10, + GEDIT_DEBUG_METADATA = 1 << 11, + GEDIT_DEBUG_WINDOW = 1 << 12, + GEDIT_DEBUG_LOADER = 1 << 13, + GEDIT_DEBUG_SAVER = 1 << 14 +} GeditDebugSection; + + +#define DEBUG_VIEW GEDIT_DEBUG_VIEW, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_SEARCH GEDIT_DEBUG_SEARCH, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_PRINT GEDIT_DEBUG_PRINT, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_PREFS GEDIT_DEBUG_PREFS, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_PLUGINS GEDIT_DEBUG_PLUGINS, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_TAB GEDIT_DEBUG_TAB, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_DOCUMENT GEDIT_DEBUG_DOCUMENT,__FILE__, __LINE__, G_STRFUNC +#define DEBUG_COMMANDS GEDIT_DEBUG_COMMANDS,__FILE__, __LINE__, G_STRFUNC +#define DEBUG_APP GEDIT_DEBUG_APP, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_SESSION GEDIT_DEBUG_SESSION, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_UTILS GEDIT_DEBUG_UTILS, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_METADATA GEDIT_DEBUG_METADATA,__FILE__, __LINE__, G_STRFUNC +#define DEBUG_WINDOW GEDIT_DEBUG_WINDOW, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_LOADER GEDIT_DEBUG_LOADER, __FILE__, __LINE__, G_STRFUNC +#define DEBUG_SAVER GEDIT_DEBUG_SAVER, __FILE__, __LINE__, G_STRFUNC + +void gedit_debug_init (void); + +void gedit_debug (GeditDebugSection section, + const gchar *file, + gint line, + const gchar *function); + +void gedit_debug_message (GeditDebugSection section, + const gchar *file, + gint line, + const gchar *function, + const gchar *format, ...) G_GNUC_PRINTF(5, 6); + + +#endif /* __GEDIT_DEBUG_H__ */ diff --git a/gedit/gedit-dirs.c b/gedit/gedit-dirs.c new file mode 100755 index 00000000..a1467f61 --- /dev/null +++ b/gedit/gedit-dirs.c @@ -0,0 +1,320 @@ +/* + * gedit-dirs.c + * This file is part of gedit + * + * Copyright (C) 2008 Ignacio Casal Quinteiro + * + * 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 +#endif + +#include "gedit-dirs.h" + +#ifdef OS_OSX +#include +#endif + +gchar * +gedit_dirs_get_user_config_dir (void) +{ + gchar *config_dir = NULL; + +#ifndef G_OS_WIN32 + const gchar *envvar; + const gchar *home; + + /* Support old libmate env var */ + envvar = g_getenv ("MATE22_USER_DIR"); + if (envvar != NULL) + { + config_dir = g_build_filename (envvar, + "gedit", + NULL); + + } + else + { + home = g_get_home_dir (); + + if (home != NULL) + { + config_dir = g_build_filename (home, + ".mate2", + "gedit", + NULL); + } + } +#else + config_dir = g_build_filename (g_get_user_config_dir (), + "gedit", + NULL); +#endif + + return config_dir; +} + +gchar * +gedit_dirs_get_user_cache_dir (void) +{ + const gchar *cache_dir; + + cache_dir = g_get_user_cache_dir (); + + return g_build_filename (cache_dir, + "gedit", + NULL); +} + +gchar * +gedit_dirs_get_user_plugins_dir (void) +{ + gchar *config_dir; + gchar *plugin_dir; + + config_dir = gedit_dirs_get_user_config_dir (); + + plugin_dir = g_build_filename (config_dir, + "plugins", + NULL); + g_free (config_dir); + + return plugin_dir; +} + +gchar * +gedit_dirs_get_user_accels_file (void) +{ + gchar *accels = NULL; + +#ifndef G_OS_WIN32 + const gchar *envvar; + const gchar *home; + + /* on linux accels are stored in .mate2/accels + * for historic reasons (backward compat with the + * old libmate that took care of saving them */ + + /* Support old libmate env var */ + envvar = g_getenv ("MATE22_USER_DIR"); + if (envvar != NULL) + { + accels = g_build_filename (envvar, + "accels", + "gedit", + NULL); + } + else + { + home = g_get_home_dir (); + + if (home != NULL) + { + accels = g_build_filename (home, + ".mate2", + "accels", + "gedit", + NULL); + } + } +#else + { + gchar *config_dir = NULL; + + config_dir = gedit_dirs_get_user_config_dir (); + accels = g_build_filename (config_dir, + "accels", + "gedit", + NULL); + + g_free (config_dir); + } +#endif + + return accels; +} + +gchar * +gedit_dirs_get_gedit_data_dir (void) +{ + gchar *data_dir; + +#ifdef G_OS_WIN32 + gchar *win32_dir; + + win32_dir = g_win32_get_package_installation_directory_of_module (NULL); + + data_dir = g_build_filename (win32_dir, + "share", + "gedit-2", + NULL); + + g_free (win32_dir); +#elif defined (OS_OSX) + IgeMacBundle *bundle = ige_mac_bundle_get_default (); + + if (ige_mac_bundle_get_is_app_bundle (bundle)) + { + const gchar *bundle_data_dir = ige_mac_bundle_get_datadir (bundle); + + data_dir = g_build_filename (bundle_data_dir, + "gedit-2", + NULL); + } + else + { + data_dir = g_build_filename (DATADIR, "gedit-2", NULL); + } +#else + data_dir = g_build_filename (DATADIR, + "gedit-2", + NULL); +#endif + + return data_dir; +} + +gchar * +gedit_dirs_get_gedit_locale_dir (void) +{ + gchar *locale_dir; + +#ifdef G_OS_WIN32 + gchar *win32_dir; + + win32_dir = g_win32_get_package_installation_directory_of_module (NULL); + + locale_dir = g_build_filename (win32_dir, + "share", + "locale", + NULL); + + g_free (win32_dir); +#elif defined (OS_OSX) + IgeMacBundle *bundle = ige_mac_bundle_get_default (); + + if (ige_mac_bundle_get_is_app_bundle (bundle)) + { + locale_dir = g_strdup (ige_mac_bundle_get_localedir (bundle)); + } + else + { + locale_dir = g_build_filename (DATADIR, + "locale", + NULL); + } +#else + locale_dir = g_build_filename (DATADIR, + "locale", + NULL); +#endif + + return locale_dir; +} + +gchar * +gedit_dirs_get_gedit_lib_dir (void) +{ + gchar *lib_dir; + +#ifdef G_OS_WIN32 + gchar *win32_dir; + + win32_dir = g_win32_get_package_installation_directory_of_module (NULL); + + lib_dir = g_build_filename (win32_dir, + "lib", + "gedit-2", + NULL); + + g_free (win32_dir); +#elif defined (OS_OSX) + IgeMacBundle *bundle = ige_mac_bundle_get_default (); + + if (ige_mac_bundle_get_is_app_bundle (bundle)) + { + const gchar *path = ige_mac_bundle_get_resourcesdir (bundle); + lib_dir = g_build_filename (path, + "lib", + "gedit-2", + NULL); + } + else + { + lib_dir = g_build_filename (LIBDIR, + "gedit-2", + NULL); + } +#else + lib_dir = g_build_filename (LIBDIR, + "gedit-2", + NULL); +#endif + + return lib_dir; +} + +gchar * +gedit_dirs_get_gedit_plugins_dir (void) +{ + gchar *lib_dir; + gchar *plugin_dir; + + lib_dir = gedit_dirs_get_gedit_lib_dir (); + + plugin_dir = g_build_filename (lib_dir, + "plugins", + NULL); + g_free (lib_dir); + + return plugin_dir; +} + +gchar * +gedit_dirs_get_gedit_plugin_loaders_dir (void) +{ + gchar *lib_dir; + gchar *loader_dir; + + lib_dir = gedit_dirs_get_gedit_lib_dir (); + + loader_dir = g_build_filename (lib_dir, + "plugin-loaders", + NULL); + g_free (lib_dir); + + return loader_dir; +} + +gchar * +gedit_dirs_get_ui_file (const gchar *file) +{ + gchar *datadir; + gchar *ui_file; + + g_return_val_if_fail (file != NULL, NULL); + + datadir = gedit_dirs_get_gedit_data_dir (); + ui_file = g_build_filename (datadir, + "ui", + file, + NULL); + g_free (datadir); + + return ui_file; +} diff --git a/gedit/gedit-dirs.h b/gedit/gedit-dirs.h new file mode 100755 index 00000000..eddd00d0 --- /dev/null +++ b/gedit/gedit-dirs.h @@ -0,0 +1,54 @@ +/* + * gedit-dirs.h + * This file is part of gedit + * + * Copyright (C) 2008 Ignacio Casal Quinteiro + * + * 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 __GEDIT_DIRS_H__ +#define __GEDIT_DIRS_H__ + +#include + +G_BEGIN_DECLS + +gchar *gedit_dirs_get_user_config_dir (void); + +gchar *gedit_dirs_get_user_cache_dir (void); + +gchar *gedit_dirs_get_user_plugins_dir (void); + +gchar *gedit_dirs_get_user_accels_file (void); + +gchar *gedit_dirs_get_gedit_data_dir (void); + +gchar *gedit_dirs_get_gedit_locale_dir (void); + +gchar *gedit_dirs_get_gedit_lib_dir (void); + +gchar *gedit_dirs_get_gedit_plugins_dir (void); + +gchar *gedit_dirs_get_gedit_plugin_loaders_dir + (void); + +gchar *gedit_dirs_get_ui_file (const gchar *file); + +G_END_DECLS + +#endif /* __GEDIT_DIRS_H__ */ diff --git a/gedit/gedit-document-input-stream.c b/gedit/gedit-document-input-stream.c new file mode 100755 index 00000000..5a1f9614 --- /dev/null +++ b/gedit/gedit-document-input-stream.c @@ -0,0 +1,479 @@ +/* + * gedit-document-input-stream.c + * This file is part of gedit + * + * Copyright (C) 2010 - Ignacio Casal Quinteiro + * + * gedit 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. + * + * gedit 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 gedit; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#include "config.h" + +#include +#include +#include +#include "gedit-document-input-stream.h" +#include "gedit-enum-types.h" + +/* NOTE: never use async methods on this stream, the stream is just + * a wrapper around GtkTextBuffer api so that we can use GIO Stream + * methods, but the undelying code operates on a GtkTextBuffer, so + * there is no I/O involved and should be accessed only by the main + * thread */ + + +G_DEFINE_TYPE (GeditDocumentInputStream, gedit_document_input_stream, G_TYPE_INPUT_STREAM); + +struct _GeditDocumentInputStreamPrivate +{ + GtkTextBuffer *buffer; + GtkTextMark *pos; + gint bytes_partial; + + GeditDocumentNewlineType newline_type; + + guint newline_added : 1; + guint is_initialized : 1; +}; + +enum +{ + PROP_0, + PROP_BUFFER, + PROP_NEWLINE_TYPE +}; + +static gssize gedit_document_input_stream_read (GInputStream *stream, + void *buffer, + gsize count, + GCancellable *cancellable, + GError **error); +static gboolean gedit_document_input_stream_close (GInputStream *stream, + GCancellable *cancellable, + GError **error); + +static void +gedit_document_input_stream_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditDocumentInputStream *stream = GEDIT_DOCUMENT_INPUT_STREAM (object); + + switch (prop_id) + { + case PROP_BUFFER: + stream->priv->buffer = GTK_TEXT_BUFFER (g_value_get_object (value)); + break; + + case PROP_NEWLINE_TYPE: + stream->priv->newline_type = g_value_get_enum (value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_input_stream_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditDocumentInputStream *stream = GEDIT_DOCUMENT_INPUT_STREAM (object); + + switch (prop_id) + { + case PROP_BUFFER: + g_value_set_object (value, stream->priv->buffer); + break; + + case PROP_NEWLINE_TYPE: + g_value_set_enum (value, stream->priv->newline_type); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_input_stream_class_init (GeditDocumentInputStreamClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GeditDocumentInputStreamPrivate)); + + gobject_class->get_property = gedit_document_input_stream_get_property; + gobject_class->set_property = gedit_document_input_stream_set_property; + + stream_class->read_fn = gedit_document_input_stream_read; + stream_class->close_fn = gedit_document_input_stream_close; + + g_object_class_install_property (gobject_class, + PROP_BUFFER, + g_param_spec_object ("buffer", + "Buffer", + "The buffer which is read", + GTK_TYPE_TEXT_BUFFER, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + /** + * GeditDocumentInputStream:newline-type: + * + * The :newline-type property determines what is considered + * as a line ending when reading complete lines from the stream. + */ + g_object_class_install_property (gobject_class, + PROP_NEWLINE_TYPE, + g_param_spec_enum ("newline-type", + "Newline type", + "The accepted types of line ending", + GEDIT_TYPE_DOCUMENT_NEWLINE_TYPE, + GEDIT_DOCUMENT_NEWLINE_TYPE_LF, + G_PARAM_READWRITE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_CONSTRUCT_ONLY)); +} + +static void +gedit_document_input_stream_init (GeditDocumentInputStream *stream) +{ + stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, + GEDIT_TYPE_DOCUMENT_INPUT_STREAM, + GeditDocumentInputStreamPrivate); +} + +static gsize +get_new_line_size (GeditDocumentInputStream *stream) +{ + gsize ret; + + switch (stream->priv->newline_type) + { + case GEDIT_DOCUMENT_NEWLINE_TYPE_CR: + case GEDIT_DOCUMENT_NEWLINE_TYPE_LF: + ret = 1; + break; + + case GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF: + ret = 2; + break; + + default: + g_warn_if_reached (); + ret = 1; + break; + } + + return ret; +} + +/** + * gedit_document_input_stream_new: + * @buffer: a #GtkTextBuffer + * + * Reads the data from @buffer. + * + * Returns: a new #GInputStream to read @buffer + */ +GInputStream * +gedit_document_input_stream_new (GtkTextBuffer *buffer, + GeditDocumentNewlineType type) +{ + GeditDocumentInputStream *stream; + + g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); + + stream = g_object_new (GEDIT_TYPE_DOCUMENT_INPUT_STREAM, + "buffer", buffer, + "newline-type", type, + NULL); + + return G_INPUT_STREAM (stream); +} + +gsize +gedit_document_input_stream_get_total_size (GeditDocumentInputStream *stream) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_INPUT_STREAM (stream), 0); + + return gtk_text_buffer_get_char_count (stream->priv->buffer); +} + +gsize +gedit_document_input_stream_tell (GeditDocumentInputStream *stream) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_INPUT_STREAM (stream), 0); + + /* FIXME: is this potentially inefficient? If yes, we could keep + track of the offset internally, assuming the mark doesn't move + during the operation */ + if (!stream->priv->is_initialized) + { + return 0; + } + else + { + GtkTextIter iter; + + gtk_text_buffer_get_iter_at_mark (stream->priv->buffer, + &iter, + stream->priv->pos); + return gtk_text_iter_get_offset (&iter); + } +} + +static const gchar * +get_new_line (GeditDocumentInputStream *stream) +{ + const gchar *ret; + + switch (stream->priv->newline_type) + { + case GEDIT_DOCUMENT_NEWLINE_TYPE_CR: + ret = "\r"; + break; + + case GEDIT_DOCUMENT_NEWLINE_TYPE_LF: + ret = "\n"; + break; + + case GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF: + ret = "\r\n"; + break; + + default: + g_warn_if_reached (); + ret = "\n"; + break; + } + + return ret; +} + +static gsize +read_line (GeditDocumentInputStream *stream, + gchar *outbuf, + gsize space_left) +{ + GtkTextIter start, next, end; + gchar *buf; + gint bytes; /* int since it's what iter_get_offset returns */ + gsize bytes_to_write, newline_size, read; + const gchar *newline; + gboolean is_last; + + gtk_text_buffer_get_iter_at_mark (stream->priv->buffer, + &start, + stream->priv->pos); + + if (gtk_text_iter_is_end (&start)) + return 0; + + end = next = start; + newline = get_new_line (stream); + + /* Check needed for empty lines */ + if (!gtk_text_iter_ends_line (&end)) + gtk_text_iter_forward_to_line_end (&end); + + gtk_text_iter_forward_line (&next); + + buf = gtk_text_iter_get_slice (&start, &end); + + /* the bytes of a line includes also the newline, so with the + offsets we remove the newline and we add the new newline size */ + bytes = gtk_text_iter_get_bytes_in_line (&start) - stream->priv->bytes_partial; + + /* bytes_in_line includes the newlines, so we remove that assuming that + they are single byte characters */ + bytes = bytes - (gtk_text_iter_get_offset (&next) - gtk_text_iter_get_offset (&end)); + is_last = gtk_text_iter_is_end (&end); + + /* bytes_to_write contains the amount of bytes we would like to write. + This means its the amount of bytes in the line (without the newline + in the buffer) + the amount of bytes for the newline we want to + write (newline_size) */ + bytes_to_write = bytes; + + /* do not add the new newline_size for the last line */ + newline_size = get_new_line_size (stream); + if (!is_last) + bytes_to_write += newline_size; + + if (bytes_to_write > space_left) + { + gchar *ptr; + gint char_offset; + gint written; + gsize to_write; + + /* Here the line does not fit in the buffer, we thus write + the amount of bytes we can still fit, storing the position + for the next read with the mark. Do not try to write the + new newline in this case, it will be handled in the next + iteration */ + to_write = MIN (space_left, bytes); + ptr = buf; + written = 0; + char_offset = 0; + + while (written < to_write) + { + gint w; + + ptr = g_utf8_next_char (ptr); + w = (ptr - buf); + if (w > to_write) + { + break; + } + else + { + written = w; + ++char_offset; + } + } + + memcpy (outbuf, buf, written); + + /* Note: offset is one past what we wrote */ + gtk_text_iter_forward_chars (&start, char_offset); + stream->priv->bytes_partial += written; + read = written; + } + else + { + /* First just copy the bytes without the newline */ + memcpy (outbuf, buf, bytes); + + /* Then add the newline, but not for the last line */ + if (!is_last) + { + memcpy (outbuf + bytes, newline, newline_size); + } + + start = next; + stream->priv->bytes_partial = 0; + read = bytes_to_write; + } + + gtk_text_buffer_move_mark (stream->priv->buffer, + stream->priv->pos, + &start); + + g_free (buf); + return read; +} + +static gssize +gedit_document_input_stream_read (GInputStream *stream, + void *buffer, + gsize count, + GCancellable *cancellable, + GError **error) +{ + GeditDocumentInputStream *dstream; + GtkTextIter iter; + gssize space_left, read, n; + + dstream = GEDIT_DOCUMENT_INPUT_STREAM (stream); + + if (count < 6) + { + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NO_SPACE, + "Not enougth space in destination"); + return -1; + } + + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return -1; + + /* Initialize the mark to the first char in the text buffer */ + if (!dstream->priv->is_initialized) + { + gtk_text_buffer_get_start_iter (dstream->priv->buffer, &iter); + dstream->priv->pos = gtk_text_buffer_create_mark (dstream->priv->buffer, + NULL, + &iter, + FALSE); + + dstream->priv->is_initialized = TRUE; + } + + space_left = count; + read = 0; + + do + { + n = read_line (dstream, buffer + read, space_left); + read += n; + space_left -= n; + } while (space_left > 0 && n != 0 && dstream->priv->bytes_partial == 0); + + /* Make sure that non-empty files are always terminated with \n (see bug #95676). + * Note that we strip the trailing \n when loading the file */ + gtk_text_buffer_get_iter_at_mark (dstream->priv->buffer, + &iter, + dstream->priv->pos); + + if (gtk_text_iter_is_end (&iter) && + !gtk_text_iter_is_start (&iter)) + { + gssize newline_size; + + newline_size = get_new_line_size (dstream); + + if (space_left >= newline_size && + !dstream->priv->newline_added) + { + const gchar *newline; + + newline = get_new_line (dstream); + + memcpy (buffer + read, newline, newline_size); + + read += newline_size; + dstream->priv->newline_added = TRUE; + } + } + + return read; +} + +static gboolean +gedit_document_input_stream_close (GInputStream *stream, + GCancellable *cancellable, + GError **error) +{ + GeditDocumentInputStream *dstream = GEDIT_DOCUMENT_INPUT_STREAM (stream); + + dstream->priv->newline_added = FALSE; + + if (dstream->priv->is_initialized) + { + gtk_text_buffer_delete_mark (dstream->priv->buffer, dstream->priv->pos); + } + + return TRUE; +} diff --git a/gedit/gedit-document-input-stream.h b/gedit/gedit-document-input-stream.h new file mode 100755 index 00000000..01f6a491 --- /dev/null +++ b/gedit/gedit-document-input-stream.h @@ -0,0 +1,68 @@ +/* + * gedit-document-input-stream.h + * This file is part of gedit + * + * Copyright (C) 2010 - Ignacio Casal Quinteiro + * + * gedit 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. + * + * gedit 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 gedit; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#ifndef __GEDIT_DOCUMENT_INPUT_STREAM_H__ +#define __GEDIT_DOCUMENT_INPUT_STREAM_H__ + +#include +#include + +#include "gedit-document.h" + +G_BEGIN_DECLS + +#define GEDIT_TYPE_DOCUMENT_INPUT_STREAM (gedit_document_input_stream_get_type ()) +#define GEDIT_DOCUMENT_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DOCUMENT_INPUT_STREAM, GeditDocumentInputStream)) +#define GEDIT_DOCUMENT_INPUT_STREAM_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DOCUMENT_INPUT_STREAM, GeditDocumentInputStream const)) +#define GEDIT_DOCUMENT_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_DOCUMENT_INPUT_STREAM, GeditDocumentInputStreamClass)) +#define GEDIT_IS_DOCUMENT_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_DOCUMENT_INPUT_STREAM)) +#define GEDIT_IS_DOCUMENT_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DOCUMENT_INPUT_STREAM)) +#define GEDIT_DOCUMENT_INPUT_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_DOCUMENT_INPUT_STREAM, GeditDocumentInputStreamClass)) + +typedef struct _GeditDocumentInputStream GeditDocumentInputStream; +typedef struct _GeditDocumentInputStreamClass GeditDocumentInputStreamClass; +typedef struct _GeditDocumentInputStreamPrivate GeditDocumentInputStreamPrivate; + +struct _GeditDocumentInputStream +{ + GInputStream parent; + + GeditDocumentInputStreamPrivate *priv; +}; + +struct _GeditDocumentInputStreamClass +{ + GInputStreamClass parent_class; +}; + +GType gedit_document_input_stream_get_type (void) G_GNUC_CONST; + +GInputStream *gedit_document_input_stream_new (GtkTextBuffer *buffer, + GeditDocumentNewlineType type); + +gsize gedit_document_input_stream_get_total_size (GeditDocumentInputStream *stream); + +gsize gedit_document_input_stream_tell (GeditDocumentInputStream *stream); + +G_END_DECLS + +#endif /* __GEDIT_DOCUMENT_INPUT_STREAM_H__ */ diff --git a/gedit/gedit-document-loader.c b/gedit/gedit-document-loader.c new file mode 100755 index 00000000..05368c8b --- /dev/null +++ b/gedit/gedit-document-loader.c @@ -0,0 +1,357 @@ +/* + * gedit-document-loader.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2007 - Paolo Maggi, Steve Frécinaux + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gedit-document-loader.h" +#include "gedit-debug.h" +#include "gedit-metadata-manager.h" +#include "gedit-utils.h" +#include "gedit-marshal.h" +#include "gedit-enum-types.h" + +/* Those are for the the gedit_document_loader_new() factory */ +#include "gedit-gio-document-loader.h" + +G_DEFINE_ABSTRACT_TYPE(GeditDocumentLoader, gedit_document_loader, G_TYPE_OBJECT) + +/* Signals */ + +enum { + LOADING, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +/* Properties */ + +enum +{ + PROP_0, + PROP_DOCUMENT, + PROP_URI, + PROP_ENCODING, + PROP_NEWLINE_TYPE +}; + +static void +gedit_document_loader_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditDocumentLoader *loader = GEDIT_DOCUMENT_LOADER (object); + + switch (prop_id) + { + case PROP_DOCUMENT: + g_return_if_fail (loader->document == NULL); + loader->document = g_value_get_object (value); + break; + case PROP_URI: + g_return_if_fail (loader->uri == NULL); + loader->uri = g_value_dup_string (value); + break; + case PROP_ENCODING: + g_return_if_fail (loader->encoding == NULL); + loader->encoding = g_value_get_boxed (value); + break; + case PROP_NEWLINE_TYPE: + loader->auto_detected_newline_type = g_value_get_enum (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_loader_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditDocumentLoader *loader = GEDIT_DOCUMENT_LOADER (object); + + switch (prop_id) + { + case PROP_DOCUMENT: + g_value_set_object (value, loader->document); + break; + case PROP_URI: + g_value_set_string (value, loader->uri); + break; + case PROP_ENCODING: + g_value_set_boxed (value, gedit_document_loader_get_encoding (loader)); + break; + case PROP_NEWLINE_TYPE: + g_value_set_enum (value, loader->auto_detected_newline_type); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_loader_finalize (GObject *object) +{ + GeditDocumentLoader *loader = GEDIT_DOCUMENT_LOADER (object); + + g_free (loader->uri); + + if (loader->info) + g_object_unref (loader->info); + + G_OBJECT_CLASS (gedit_document_loader_parent_class)->finalize (object); +} + +static void +gedit_document_loader_dispose (GObject *object) +{ + GeditDocumentLoader *loader = GEDIT_DOCUMENT_LOADER (object); + + if (loader->info != NULL) + { + g_object_unref (loader->info); + loader->info = NULL; + } + + G_OBJECT_CLASS (gedit_document_loader_parent_class)->dispose (object); +} + +static void +gedit_document_loader_class_init (GeditDocumentLoaderClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_document_loader_finalize; + object_class->dispose = gedit_document_loader_dispose; + object_class->get_property = gedit_document_loader_get_property; + object_class->set_property = gedit_document_loader_set_property; + + g_object_class_install_property (object_class, + PROP_DOCUMENT, + g_param_spec_object ("document", + "Document", + "The GeditDocument this GeditDocumentLoader is associated with", + GEDIT_TYPE_DOCUMENT, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_URI, + g_param_spec_string ("uri", + "URI", + "The URI this GeditDocumentLoader loads the document from", + "", + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_ENCODING, + g_param_spec_boxed ("encoding", + "Encoding", + "The encoding of the saved file", + GEDIT_TYPE_ENCODING, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_NEWLINE_TYPE, + g_param_spec_enum ("newline-type", + "Newline type", + "The accepted types of line ending", + GEDIT_TYPE_DOCUMENT_NEWLINE_TYPE, + GEDIT_DOCUMENT_NEWLINE_TYPE_LF, + G_PARAM_READWRITE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB)); + + signals[LOADING] = + g_signal_new ("loading", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentLoaderClass, loading), + NULL, NULL, + gedit_marshal_VOID__BOOLEAN_POINTER, + G_TYPE_NONE, + 2, + G_TYPE_BOOLEAN, + G_TYPE_POINTER); +} + +static void +gedit_document_loader_init (GeditDocumentLoader *loader) +{ + loader->used = FALSE; + loader->auto_detected_newline_type = GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT; +} + +void +gedit_document_loader_loading (GeditDocumentLoader *loader, + gboolean completed, + GError *error) +{ + /* the object will be unrefed in the callback of the loading signal + * (when completed == TRUE), so we need to prevent finalization. + */ + if (completed) + { + g_object_ref (loader); + } + + g_signal_emit (loader, signals[LOADING], 0, completed, error); + + if (completed) + { + if (error == NULL) + gedit_debug_message (DEBUG_LOADER, "load completed"); + else + gedit_debug_message (DEBUG_LOADER, "load failed"); + + g_object_unref (loader); + } +} + +/* This is a factory method that returns an appopriate loader + * for the given uri. + */ +GeditDocumentLoader * +gedit_document_loader_new (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding) +{ + GeditDocumentLoader *loader; + GType loader_type; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + /* At the moment we just use gio loader in all cases... + * In the future it would be great to have a PolicyKit + * loader to get permission to save systen files etc */ + loader_type = GEDIT_TYPE_GIO_DOCUMENT_LOADER; + + loader = GEDIT_DOCUMENT_LOADER (g_object_new (loader_type, + "document", doc, + "uri", uri, + "encoding", encoding, + NULL)); + + return loader; +} + +/* If enconding == NULL, the encoding will be autodetected */ +void +gedit_document_loader_load (GeditDocumentLoader *loader) +{ + gedit_debug (DEBUG_LOADER); + + g_return_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader)); + + /* the loader can be used just once, then it must be thrown away */ + g_return_if_fail (loader->used == FALSE); + loader->used = TRUE; + + GEDIT_DOCUMENT_LOADER_GET_CLASS (loader)->load (loader); +} + +gboolean +gedit_document_loader_cancel (GeditDocumentLoader *loader) +{ + gedit_debug (DEBUG_LOADER); + + g_return_val_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader), FALSE); + + return GEDIT_DOCUMENT_LOADER_GET_CLASS (loader)->cancel (loader); +} + +GeditDocument * +gedit_document_loader_get_document (GeditDocumentLoader *loader) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader), NULL); + + return loader->document; +} + +/* Returns STDIN_URI if loading from stdin */ +const gchar * +gedit_document_loader_get_uri (GeditDocumentLoader *loader) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader), NULL); + + return loader->uri; +} + +goffset +gedit_document_loader_get_bytes_read (GeditDocumentLoader *loader) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader), 0); + + return GEDIT_DOCUMENT_LOADER_GET_CLASS (loader)->get_bytes_read (loader); +} + +const GeditEncoding * +gedit_document_loader_get_encoding (GeditDocumentLoader *loader) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader), NULL); + + if (loader->encoding != NULL) + return loader->encoding; + + g_return_val_if_fail (loader->auto_detected_encoding != NULL, + gedit_encoding_get_current ()); + + return loader->auto_detected_encoding; +} + +GeditDocumentNewlineType +gedit_document_loader_get_newline_type (GeditDocumentLoader *loader) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader), + GEDIT_DOCUMENT_NEWLINE_TYPE_LF); + + return loader->auto_detected_newline_type; +} + +GFileInfo * +gedit_document_loader_get_info (GeditDocumentLoader *loader) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader), NULL); + + return loader->info; +} diff --git a/gedit/gedit-document-loader.h b/gedit/gedit-document-loader.h new file mode 100755 index 00000000..a627fba0 --- /dev/null +++ b/gedit/gedit-document-loader.h @@ -0,0 +1,130 @@ +/* + * gedit-document-loader.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2007 - Paolo Maggi, Steve Frécinaux + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_DOCUMENT_LOADER_H__ +#define __GEDIT_DOCUMENT_LOADER_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_DOCUMENT_LOADER (gedit_document_loader_get_type()) +#define GEDIT_DOCUMENT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_DOCUMENT_LOADER, GeditDocumentLoader)) +#define GEDIT_DOCUMENT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_DOCUMENT_LOADER, GeditDocumentLoaderClass)) +#define GEDIT_IS_DOCUMENT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_DOCUMENT_LOADER)) +#define GEDIT_IS_DOCUMENT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DOCUMENT_LOADER)) +#define GEDIT_DOCUMENT_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_DOCUMENT_LOADER, GeditDocumentLoaderClass)) + +/* Private structure type */ +typedef struct _GeditDocumentLoaderPrivate GeditDocumentLoaderPrivate; + +/* + * Main object structure + */ +typedef struct _GeditDocumentLoader GeditDocumentLoader; + +struct _GeditDocumentLoader +{ + GObject object; + + GeditDocument *document; + gboolean used; + + /* Info on the current file */ + GFileInfo *info; + gchar *uri; + const GeditEncoding *encoding; + const GeditEncoding *auto_detected_encoding; + GeditDocumentNewlineType auto_detected_newline_type; +}; + +/* + * Class definition + */ +typedef struct _GeditDocumentLoaderClass GeditDocumentLoaderClass; + +struct _GeditDocumentLoaderClass +{ + GObjectClass parent_class; + + /* Signals */ + void (* loading) (GeditDocumentLoader *loader, + gboolean completed, + const GError *error); + + /* VTable */ + void (* load) (GeditDocumentLoader *loader); + gboolean (* cancel) (GeditDocumentLoader *loader); + goffset (* get_bytes_read) (GeditDocumentLoader *loader); +}; + +/* + * Public methods + */ +GType gedit_document_loader_get_type (void) G_GNUC_CONST; + +/* If enconding == NULL, the encoding will be autodetected */ +GeditDocumentLoader *gedit_document_loader_new (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding); + +void gedit_document_loader_loading (GeditDocumentLoader *loader, + gboolean completed, + GError *error); + +void gedit_document_loader_load (GeditDocumentLoader *loader); +#if 0 +gboolean gedit_document_loader_load_from_stdin (GeditDocumentLoader *loader); +#endif +gboolean gedit_document_loader_cancel (GeditDocumentLoader *loader); + +GeditDocument *gedit_document_loader_get_document (GeditDocumentLoader *loader); + +/* Returns STDIN_URI if loading from stdin */ +#define STDIN_URI "stdin:" +const gchar *gedit_document_loader_get_uri (GeditDocumentLoader *loader); + +const GeditEncoding *gedit_document_loader_get_encoding (GeditDocumentLoader *loader); + +GeditDocumentNewlineType gedit_document_loader_get_newline_type (GeditDocumentLoader *loader); + +goffset gedit_document_loader_get_bytes_read (GeditDocumentLoader *loader); + +/* You can get from the info: content_type, time_modified, standard_size, access_can_write + and also the metadata*/ +GFileInfo *gedit_document_loader_get_info (GeditDocumentLoader *loader); + +G_END_DECLS + +#endif /* __GEDIT_DOCUMENT_LOADER_H__ */ diff --git a/gedit/gedit-document-output-stream.c b/gedit/gedit-document-output-stream.c new file mode 100755 index 00000000..e1ef5af5 --- /dev/null +++ b/gedit/gedit-document-output-stream.c @@ -0,0 +1,391 @@ +/* + * gedit-document-output-stream.c + * This file is part of gedit + * + * Copyright (C) 2010 - Ignacio Casal Quinteiro + * + * gedit 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. + * + * gedit 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 gedit; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#include "config.h" + +#include +#include +#include +#include +#include "gedit-document-output-stream.h" + +/* NOTE: never use async methods on this stream, the stream is just + * a wrapper around GtkTextBuffer api so that we can use GIO Stream + * methods, but the undelying code operates on a GtkTextBuffer, so + * there is no I/O involved and should be accessed only by the main + * thread */ + +#define GEDIT_DOCUMENT_OUTPUT_STREAM_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object),\ + GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM,\ + GeditDocumentOutputStreamPrivate)) + +#define MAX_UNICHAR_LEN 6 + +struct _GeditDocumentOutputStreamPrivate +{ + GeditDocument *doc; + GtkTextIter pos; + + gchar *buffer; + gsize buflen; + + guint is_initialized : 1; + guint is_closed : 1; +}; + +enum +{ + PROP_0, + PROP_DOCUMENT +}; + +G_DEFINE_TYPE (GeditDocumentOutputStream, gedit_document_output_stream, G_TYPE_OUTPUT_STREAM) + +static gssize gedit_document_output_stream_write (GOutputStream *stream, + const void *buffer, + gsize count, + GCancellable *cancellable, + GError **error); + +static gboolean gedit_document_output_stream_close (GOutputStream *stream, + GCancellable *cancellable, + GError **error); + +static void +gedit_document_output_stream_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditDocumentOutputStream *stream = GEDIT_DOCUMENT_OUTPUT_STREAM (object); + + switch (prop_id) + { + case PROP_DOCUMENT: + stream->priv->doc = GEDIT_DOCUMENT (g_value_get_object (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_output_stream_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditDocumentOutputStream *stream = GEDIT_DOCUMENT_OUTPUT_STREAM (object); + + switch (prop_id) + { + case PROP_DOCUMENT: + g_value_set_object (value, stream->priv->doc); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_output_stream_finalize (GObject *object) +{ + GeditDocumentOutputStream *stream = GEDIT_DOCUMENT_OUTPUT_STREAM (object); + + g_free (stream->priv->buffer); + + G_OBJECT_CLASS (gedit_document_output_stream_parent_class)->finalize (object); +} + +static void +gedit_document_output_stream_constructed (GObject *object) +{ + GeditDocumentOutputStream *stream = GEDIT_DOCUMENT_OUTPUT_STREAM (object); + + if (!stream->priv->doc) + { + g_critical ("This should never happen, a problem happened constructing the Document Output Stream!"); + return; + } + + /* Init the undoable action */ + gtk_source_buffer_begin_not_undoable_action (GTK_SOURCE_BUFFER (stream->priv->doc)); + /* clear the buffer */ + gtk_text_buffer_set_text (GTK_TEXT_BUFFER (stream->priv->doc), + "", 0); + gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (stream->priv->doc), + FALSE); + + gtk_source_buffer_end_not_undoable_action (GTK_SOURCE_BUFFER (stream->priv->doc)); +} + +static void +gedit_document_output_stream_class_init (GeditDocumentOutputStreamClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GOutputStreamClass *stream_class = G_OUTPUT_STREAM_CLASS (klass); + + object_class->get_property = gedit_document_output_stream_get_property; + object_class->set_property = gedit_document_output_stream_set_property; + object_class->finalize = gedit_document_output_stream_finalize; + object_class->constructed = gedit_document_output_stream_constructed; + + stream_class->write_fn = gedit_document_output_stream_write; + stream_class->close_fn = gedit_document_output_stream_close; + + g_object_class_install_property (object_class, + PROP_DOCUMENT, + g_param_spec_object ("document", + "Document", + "The document which is written", + GEDIT_TYPE_DOCUMENT, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_type_class_add_private (object_class, sizeof (GeditDocumentOutputStreamPrivate)); +} + +static void +gedit_document_output_stream_init (GeditDocumentOutputStream *stream) +{ + stream->priv = GEDIT_DOCUMENT_OUTPUT_STREAM_GET_PRIVATE (stream); + + stream->priv->buffer = NULL; + stream->priv->buflen = 0; + + stream->priv->is_initialized = FALSE; + stream->priv->is_closed = FALSE; +} + +static GeditDocumentNewlineType +get_newline_type (GtkTextIter *end) +{ + GeditDocumentNewlineType res; + GtkTextIter copy; + gunichar c; + + copy = *end; + c = gtk_text_iter_get_char (©); + + if (g_unichar_break_type (c) == G_UNICODE_BREAK_CARRIAGE_RETURN) + { + if (gtk_text_iter_forward_char (©) && + g_unichar_break_type (gtk_text_iter_get_char (©)) == G_UNICODE_BREAK_LINE_FEED) + { + res = GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF; + } + else + { + res = GEDIT_DOCUMENT_NEWLINE_TYPE_CR; + } + } + else + { + res = GEDIT_DOCUMENT_NEWLINE_TYPE_LF; + } + + return res; +} + +GOutputStream * +gedit_document_output_stream_new (GeditDocument *doc) +{ + return G_OUTPUT_STREAM (g_object_new (GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM, + "document", doc, NULL)); +} + +GeditDocumentNewlineType +gedit_document_output_stream_detect_newline_type (GeditDocumentOutputStream *stream) +{ + GeditDocumentNewlineType type; + GtkTextIter iter; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT_OUTPUT_STREAM (stream), + GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT); + + type = GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT; + + gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (stream->priv->doc), + &iter); + + if (gtk_text_iter_ends_line (&iter) || gtk_text_iter_forward_to_line_end (&iter)) + { + type = get_newline_type (&iter); + } + + return type; +} + +/* If the last char is a newline, remove it from the buffer (otherwise + GtkTextView shows it as an empty line). See bug #324942. */ +static void +remove_ending_newline (GeditDocumentOutputStream *stream) +{ + GtkTextIter end; + GtkTextIter start; + + gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (stream->priv->doc), &end); + start = end; + + gtk_text_iter_set_line_offset (&start, 0); + + if (gtk_text_iter_ends_line (&start) && + gtk_text_iter_backward_line (&start)) + { + if (!gtk_text_iter_ends_line (&start)) + { + gtk_text_iter_forward_to_line_end (&start); + } + + /* Delete the empty line which is from 'start' to 'end' */ + gtk_text_buffer_delete (GTK_TEXT_BUFFER (stream->priv->doc), + &start, + &end); + } +} + +static void +end_append_text_to_document (GeditDocumentOutputStream *stream) +{ + remove_ending_newline (stream); + + gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (stream->priv->doc), + FALSE); + + gtk_source_buffer_end_not_undoable_action (GTK_SOURCE_BUFFER (stream->priv->doc)); +} + +static gssize +gedit_document_output_stream_write (GOutputStream *stream, + const void *buffer, + gsize count, + GCancellable *cancellable, + GError **error) +{ + GeditDocumentOutputStream *ostream; + gchar *text; + gsize len; + gboolean freetext = FALSE; + const gchar *end; + gsize nvalid; + gboolean valid; + + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return -1; + + ostream = GEDIT_DOCUMENT_OUTPUT_STREAM (stream); + + if (!ostream->priv->is_initialized) + { + /* Init the undoable action */ + gtk_source_buffer_begin_not_undoable_action (GTK_SOURCE_BUFFER (ostream->priv->doc)); + + gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (ostream->priv->doc), + &ostream->priv->pos); + ostream->priv->is_initialized = TRUE; + } + + if (ostream->priv->buflen > 0) + { + len = ostream->priv->buflen + count; + text = g_new (gchar , len + 1); + memcpy (text, ostream->priv->buffer, ostream->priv->buflen); + memcpy (text + ostream->priv->buflen, buffer, count); + text[len] = '\0'; + g_free (ostream->priv->buffer); + ostream->priv->buffer = NULL; + ostream->priv->buflen = 0; + freetext = TRUE; + } + else + { + text = (gchar *) buffer; + len = count; + } + + /* validate */ + valid = g_utf8_validate (text, len, &end); + nvalid = end - text; + + if (!valid) + { + gsize remainder; + + remainder = len - nvalid; + + if ((remainder < MAX_UNICHAR_LEN) && + (g_utf8_get_char_validated (text + nvalid, remainder) == (gunichar)-2)) + { + ostream->priv->buffer = g_strndup (end, remainder); + ostream->priv->buflen = remainder; + len -= remainder; + } + else + { + /* TODO: we cuould escape invalid text and tag it in red + * and make the doc readonly. + */ + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA, + _("Invalid UTF-8 sequence in input")); + + if (freetext) + g_free (text); + + return -1; + } + } + + gtk_text_buffer_insert (GTK_TEXT_BUFFER (ostream->priv->doc), + &ostream->priv->pos, text, len); + + if (freetext) + g_free (text); + + return count; +} + +static gboolean +gedit_document_output_stream_close (GOutputStream *stream, + GCancellable *cancellable, + GError **error) +{ + GeditDocumentOutputStream *ostream = GEDIT_DOCUMENT_OUTPUT_STREAM (stream); + + if (!ostream->priv->is_closed && ostream->priv->is_initialized) + { + end_append_text_to_document (ostream); + ostream->priv->is_closed = TRUE; + } + + if (ostream->priv->buflen > 0) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA, + _("Incomplete UTF-8 sequence in input")); + return FALSE; + } + + return TRUE; +} diff --git a/gedit/gedit-document-output-stream.h b/gedit/gedit-document-output-stream.h new file mode 100755 index 00000000..a3f99fce --- /dev/null +++ b/gedit/gedit-document-output-stream.h @@ -0,0 +1,64 @@ +/* + * gedit-document-output-stream.h + * This file is part of gedit + * + * Copyright (C) 2010 - Ignacio Casal Quinteiro + * + * gedit 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. + * + * gedit 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 gedit; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + + +#ifndef __GEDIT_DOCUMENT_OUTPUT_STREAM_H__ +#define __GEDIT_DOCUMENT_OUTPUT_STREAM_H__ + +#include +#include "gedit-document.h" + +G_BEGIN_DECLS + +#define GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM (gedit_document_output_stream_get_type ()) +#define GEDIT_DOCUMENT_OUTPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM, GeditDocumentOutputStream)) +#define GEDIT_DOCUMENT_OUTPUT_STREAM_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM, GeditDocumentOutputStream const)) +#define GEDIT_DOCUMENT_OUTPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM, GeditDocumentOutputStreamClass)) +#define GEDIT_IS_DOCUMENT_OUTPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM)) +#define GEDIT_IS_DOCUMENT_OUTPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM)) +#define GEDIT_DOCUMENT_OUTPUT_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_DOCUMENT_OUTPUT_STREAM, GeditDocumentOutputStreamClass)) + +typedef struct _GeditDocumentOutputStream GeditDocumentOutputStream; +typedef struct _GeditDocumentOutputStreamClass GeditDocumentOutputStreamClass; +typedef struct _GeditDocumentOutputStreamPrivate GeditDocumentOutputStreamPrivate; + +struct _GeditDocumentOutputStream +{ + GOutputStream parent; + + GeditDocumentOutputStreamPrivate *priv; +}; + +struct _GeditDocumentOutputStreamClass +{ + GOutputStreamClass parent_class; +}; + +GType gedit_document_output_stream_get_type (void) G_GNUC_CONST; + +GOutputStream *gedit_document_output_stream_new (GeditDocument *doc); + +GeditDocumentNewlineType gedit_document_output_stream_detect_newline_type (GeditDocumentOutputStream *stream); + +G_END_DECLS + +#endif /* __GEDIT_DOCUMENT_OUTPUT_STREAM_H__ */ diff --git a/gedit/gedit-document-saver.c b/gedit/gedit-document-saver.c new file mode 100755 index 00000000..1a064da6 --- /dev/null +++ b/gedit/gedit-document-saver.c @@ -0,0 +1,359 @@ +/* + * gedit-document-saver.c + * This file is part of gedit + * + * Copyright (C) 2005-2006 - Paolo Borelli and Paolo Maggi + * Copyright (C) 2007 - Paolo Borelli, Paolo Maggi, Steve Frécinaux + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +#include "gedit-document-saver.h" +#include "gedit-debug.h" +#include "gedit-prefs-manager.h" +#include "gedit-marshal.h" +#include "gedit-utils.h" +#include "gedit-enum-types.h" +#include "gedit-gio-document-saver.h" + +G_DEFINE_ABSTRACT_TYPE(GeditDocumentSaver, gedit_document_saver, G_TYPE_OBJECT) + +/* Signals */ + +enum { + SAVING, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +/* Properties */ + +enum { + PROP_0, + PROP_DOCUMENT, + PROP_URI, + PROP_ENCODING, + PROP_NEWLINE_TYPE, + PROP_FLAGS +}; + +static void +gedit_document_saver_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditDocumentSaver *saver = GEDIT_DOCUMENT_SAVER (object); + + switch (prop_id) + { + case PROP_DOCUMENT: + g_return_if_fail (saver->document == NULL); + saver->document = g_value_get_object (value); + break; + case PROP_URI: + g_return_if_fail (saver->uri == NULL); + saver->uri = g_value_dup_string (value); + break; + case PROP_ENCODING: + g_return_if_fail (saver->encoding == NULL); + saver->encoding = g_value_get_boxed (value); + break; + case PROP_NEWLINE_TYPE: + saver->newline_type = g_value_get_enum (value); + break; + case PROP_FLAGS: + saver->flags = g_value_get_flags (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_saver_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditDocumentSaver *saver = GEDIT_DOCUMENT_SAVER (object); + + switch (prop_id) + { + case PROP_DOCUMENT: + g_value_set_object (value, saver->document); + break; + case PROP_URI: + g_value_set_string (value, saver->uri); + break; + case PROP_ENCODING: + g_value_set_boxed (value, saver->encoding); + break; + case PROP_NEWLINE_TYPE: + g_value_set_enum (value, saver->newline_type); + break; + case PROP_FLAGS: + g_value_set_flags (value, saver->flags); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_saver_finalize (GObject *object) +{ + GeditDocumentSaver *saver = GEDIT_DOCUMENT_SAVER (object); + + g_free (saver->uri); + + G_OBJECT_CLASS (gedit_document_saver_parent_class)->finalize (object); +} + +static void +gedit_document_saver_dispose (GObject *object) +{ + GeditDocumentSaver *saver = GEDIT_DOCUMENT_SAVER (object); + + if (saver->info != NULL) + { + g_object_unref (saver->info); + saver->info = NULL; + } + + G_OBJECT_CLASS (gedit_document_saver_parent_class)->dispose (object); +} + +static void +gedit_document_saver_class_init (GeditDocumentSaverClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_document_saver_finalize; + object_class->dispose = gedit_document_saver_dispose; + object_class->set_property = gedit_document_saver_set_property; + object_class->get_property = gedit_document_saver_get_property; + + g_object_class_install_property (object_class, + PROP_DOCUMENT, + g_param_spec_object ("document", + "Document", + "The GeditDocument this GeditDocumentSaver is associated with", + GEDIT_TYPE_DOCUMENT, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_URI, + g_param_spec_string ("uri", + "URI", + "The URI this GeditDocumentSaver saves the document to", + "", + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_ENCODING, + g_param_spec_boxed ("encoding", + "URI", + "The encoding of the saved file", + GEDIT_TYPE_ENCODING, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_NEWLINE_TYPE, + g_param_spec_enum ("newline-type", + "Newline type", + "The accepted types of line ending", + GEDIT_TYPE_DOCUMENT_NEWLINE_TYPE, + GEDIT_DOCUMENT_NEWLINE_TYPE_LF, + G_PARAM_READWRITE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_FLAGS, + g_param_spec_flags ("flags", + "Flags", + "The flags for the saving operation", + GEDIT_TYPE_DOCUMENT_SAVE_FLAGS, + 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + signals[SAVING] = + g_signal_new ("saving", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentSaverClass, saving), + NULL, NULL, + gedit_marshal_VOID__BOOLEAN_POINTER, + G_TYPE_NONE, + 2, + G_TYPE_BOOLEAN, + G_TYPE_POINTER); +} + +static void +gedit_document_saver_init (GeditDocumentSaver *saver) +{ + saver->used = FALSE; +} + +GeditDocumentSaver * +gedit_document_saver_new (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentNewlineType newline_type, + GeditDocumentSaveFlags flags) +{ + GeditDocumentSaver *saver; + GType saver_type; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + saver_type = GEDIT_TYPE_GIO_DOCUMENT_SAVER; + + if (encoding == NULL) + encoding = gedit_encoding_get_utf8 (); + + saver = GEDIT_DOCUMENT_SAVER (g_object_new (saver_type, + "document", doc, + "uri", uri, + "encoding", encoding, + "newline_type", newline_type, + "flags", flags, + NULL)); + + return saver; +} + +void +gedit_document_saver_saving (GeditDocumentSaver *saver, + gboolean completed, + GError *error) +{ + /* the object will be unrefed in the callback of the saving + * signal, so we need to prevent finalization. + */ + if (completed) + { + g_object_ref (saver); + } + + g_signal_emit (saver, signals[SAVING], 0, completed, error); + + if (completed) + { + if (error == NULL) + gedit_debug_message (DEBUG_SAVER, "save completed"); + else + gedit_debug_message (DEBUG_SAVER, "save failed"); + + g_object_unref (saver); + } +} + +void +gedit_document_saver_save (GeditDocumentSaver *saver, + GTimeVal *old_mtime) +{ + gedit_debug (DEBUG_SAVER); + + g_return_if_fail (GEDIT_IS_DOCUMENT_SAVER (saver)); + g_return_if_fail (saver->uri != NULL && strlen (saver->uri) > 0); + + g_return_if_fail (saver->used == FALSE); + saver->used = TRUE; + + // CHECK: + // - sanity check a max len for the uri? + // report async (in an idle handler) or sync (bool ret) + // async is extra work here, sync is special casing in the caller + + /* never keep backup of autosaves */ + if ((saver->flags & GEDIT_DOCUMENT_SAVE_PRESERVE_BACKUP) != 0) + saver->keep_backup = FALSE; + else + saver->keep_backup = gedit_prefs_manager_get_create_backup_copy (); + + GEDIT_DOCUMENT_SAVER_GET_CLASS (saver)->save (saver, old_mtime); +} + +GeditDocument * +gedit_document_saver_get_document (GeditDocumentSaver *saver) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_SAVER (saver), NULL); + + return saver->document; +} + +const gchar * +gedit_document_saver_get_uri (GeditDocumentSaver *saver) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_SAVER (saver), NULL); + + return saver->uri; +} + +/* Returns 0 if file size is unknown */ +goffset +gedit_document_saver_get_file_size (GeditDocumentSaver *saver) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_SAVER (saver), 0); + + return GEDIT_DOCUMENT_SAVER_GET_CLASS (saver)->get_file_size (saver); +} + +goffset +gedit_document_saver_get_bytes_written (GeditDocumentSaver *saver) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_SAVER (saver), 0); + + return GEDIT_DOCUMENT_SAVER_GET_CLASS (saver)->get_bytes_written (saver); +} + +GFileInfo * +gedit_document_saver_get_info (GeditDocumentSaver *saver) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT_SAVER (saver), NULL); + + return saver->info; +} diff --git a/gedit/gedit-document-saver.h b/gedit/gedit-document-saver.h new file mode 100755 index 00000000..ccc0b5c7 --- /dev/null +++ b/gedit/gedit-document-saver.h @@ -0,0 +1,133 @@ +/* + * gedit-document-saver.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyrhing (C) 2007 - Paolo Maggi, Steve Frécinaux + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_DOCUMENT_SAVER_H__ +#define __GEDIT_DOCUMENT_SAVER_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_DOCUMENT_SAVER (gedit_document_saver_get_type()) +#define GEDIT_DOCUMENT_SAVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_DOCUMENT_SAVER, GeditDocumentSaver)) +#define GEDIT_DOCUMENT_SAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_DOCUMENT_SAVER, GeditDocumentSaverClass)) +#define GEDIT_IS_DOCUMENT_SAVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_DOCUMENT_SAVER)) +#define GEDIT_IS_DOCUMENT_SAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DOCUMENT_SAVER)) +#define GEDIT_DOCUMENT_SAVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_DOCUMENT_SAVER, GeditDocumentSaverClass)) + +/* + * Main object structure + */ +typedef struct _GeditDocumentSaver GeditDocumentSaver; + +struct _GeditDocumentSaver +{ + GObject object; + + /*< private >*/ + GFileInfo *info; + GeditDocument *document; + gboolean used; + + gchar *uri; + const GeditEncoding *encoding; + GeditDocumentNewlineType newline_type; + + GeditDocumentSaveFlags flags; + + gboolean keep_backup; +}; + +/* + * Class definition + */ +typedef struct _GeditDocumentSaverClass GeditDocumentSaverClass; + +struct _GeditDocumentSaverClass +{ + GObjectClass parent_class; + + /* Signals */ + void (* saving) (GeditDocumentSaver *saver, + gboolean completed, + const GError *error); + + /* VTable */ + void (* save) (GeditDocumentSaver *saver, + GTimeVal *old_mtime); + goffset (* get_file_size) (GeditDocumentSaver *saver); + goffset (* get_bytes_written) (GeditDocumentSaver *saver); +}; + +/* + * Public methods + */ +GType gedit_document_saver_get_type (void) G_GNUC_CONST; + +/* If enconding == NULL, the encoding will be autodetected */ +GeditDocumentSaver *gedit_document_saver_new (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentNewlineType newline_type, + GeditDocumentSaveFlags flags); + +void gedit_document_saver_saving (GeditDocumentSaver *saver, + gboolean completed, + GError *error); +void gedit_document_saver_save (GeditDocumentSaver *saver, + GTimeVal *old_mtime); + +#if 0 +void gedit_document_saver_cancel (GeditDocumentSaver *saver); +#endif + +GeditDocument *gedit_document_saver_get_document (GeditDocumentSaver *saver); + +const gchar *gedit_document_saver_get_uri (GeditDocumentSaver *saver); + +/* If backup_uri is NULL no backup will be made */ +const gchar *gedit_document_saver_get_backup_uri (GeditDocumentSaver *saver); +void *gedit_document_saver_set_backup_uri (GeditDocumentSaver *saver, + const gchar *backup_uri); + +/* Returns 0 if file size is unknown */ +goffset gedit_document_saver_get_file_size (GeditDocumentSaver *saver); + +goffset gedit_document_saver_get_bytes_written (GeditDocumentSaver *saver); + +GFileInfo *gedit_document_saver_get_info (GeditDocumentSaver *saver); + +G_END_DECLS + +#endif /* __GEDIT_DOCUMENT_SAVER_H__ */ diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c new file mode 100755 index 00000000..d9612263 --- /dev/null +++ b/gedit/gedit-document.c @@ -0,0 +1,2732 @@ +/* + * gedit-document.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include + +#include "gedit-prefs-manager-app.h" +#include "gedit-document.h" +#include "gedit-debug.h" +#include "gedit-utils.h" +#include "gedit-language-manager.h" +#include "gedit-style-scheme-manager.h" +#include "gedit-document-loader.h" +#include "gedit-document-saver.h" +#include "gedit-marshal.h" +#include "gedit-enum-types.h" +#include "gedittextregion.h" + +#ifndef ENABLE_GVFS_METADATA +#include "gedit-metadata-manager.h" +#else +#define METADATA_QUERY "metadata::*" +#endif + +#undef ENABLE_PROFILE + +#ifdef ENABLE_PROFILE +#define PROFILE(x) x +#else +#define PROFILE(x) +#endif + +PROFILE (static GTimer *timer = NULL) + +#ifdef MAXPATHLEN +#define GEDIT_MAX_PATH_LEN MAXPATHLEN +#elif defined (PATH_MAX) +#define GEDIT_MAX_PATH_LEN PATH_MAX +#else +#define GEDIT_MAX_PATH_LEN 2048 +#endif + +#define GEDIT_DOCUMENT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_DOCUMENT, GeditDocumentPrivate)) + +static void gedit_document_load_real (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create); +static void gedit_document_save_real (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentSaveFlags flags); +static void to_search_region_range (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end); +static void insert_text_cb (GeditDocument *doc, + GtkTextIter *pos, + const gchar *text, + gint length); + +static void delete_range_cb (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end); + +struct _GeditDocumentPrivate +{ + gchar *uri; + gint untitled_number; + gchar *short_name; + + GFileInfo *metadata_info; + + const GeditEncoding *encoding; + + gchar *content_type; + + GTimeVal mtime; + GTimeVal time_of_last_save_or_load; + + guint search_flags; + gchar *search_text; + gint num_of_lines_search_text; + + GeditDocumentNewlineType newline_type; + + /* Temp data while loading */ + GeditDocumentLoader *loader; + gboolean create; /* Create file if uri points + * to a non existing file */ + const GeditEncoding *requested_encoding; + gint requested_line_pos; + + /* Saving stuff */ + GeditDocumentSaver *saver; + + /* Search highlighting support variables */ + GeditTextRegion *to_search_region; + GtkTextTag *found_tag; + + /* Mount operation factory */ + GeditMountOperationFactory mount_operation_factory; + gpointer mount_operation_userdata; + + gint readonly : 1; + gint last_save_was_manually : 1; + gint language_set_by_user : 1; + gint stop_cursor_moved_emission : 1; + gint dispose_has_run : 1; +}; + +enum { + PROP_0, + + PROP_URI, + PROP_SHORTNAME, + PROP_CONTENT_TYPE, + PROP_MIME_TYPE, + PROP_READ_ONLY, + PROP_ENCODING, + PROP_CAN_SEARCH_AGAIN, + PROP_ENABLE_SEARCH_HIGHLIGHTING, + PROP_NEWLINE_TYPE +}; + +enum { + CURSOR_MOVED, + LOAD, + LOADING, + LOADED, + SAVE, + SAVING, + SAVED, + SEARCH_HIGHLIGHT_UPDATED, + LAST_SIGNAL +}; + +static guint document_signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE(GeditDocument, gedit_document, GTK_TYPE_SOURCE_BUFFER) + +GQuark +gedit_document_error_quark (void) +{ + static GQuark quark = 0; + + if (G_UNLIKELY (quark == 0)) + quark = g_quark_from_static_string ("gedit_io_load_error"); + + return quark; +} + +static GHashTable *allocated_untitled_numbers = NULL; + +static gint +get_untitled_number (void) +{ + gint i = 1; + + if (allocated_untitled_numbers == NULL) + allocated_untitled_numbers = g_hash_table_new (NULL, NULL); + + g_return_val_if_fail (allocated_untitled_numbers != NULL, -1); + + while (TRUE) + { + if (g_hash_table_lookup (allocated_untitled_numbers, GINT_TO_POINTER (i)) == NULL) + { + g_hash_table_insert (allocated_untitled_numbers, + GINT_TO_POINTER (i), + GINT_TO_POINTER (i)); + + return i; + } + + ++i; + } +} + +static void +release_untitled_number (gint n) +{ + g_return_if_fail (allocated_untitled_numbers != NULL); + + g_hash_table_remove (allocated_untitled_numbers, GINT_TO_POINTER (n)); +} + +static void +gedit_document_dispose (GObject *object) +{ + GeditDocument *doc = GEDIT_DOCUMENT (object); + + gedit_debug (DEBUG_DOCUMENT); + + /* Metadata must be saved here and not in finalize + * because the language is gone by the time finalize runs. + * beside if some plugin prevents proper finalization by + * holding a ref to the doc, we still save the metadata */ + if ((!doc->priv->dispose_has_run) && (doc->priv->uri != NULL)) + { + GtkTextIter iter; + gchar *position; + const gchar *language = NULL; + + if (doc->priv->language_set_by_user) + { + GtkSourceLanguage *lang; + + lang = gedit_document_get_language (doc); + + if (lang == NULL) + language = "_NORMAL_"; + else + language = gtk_source_language_get_id (lang); + } + + gtk_text_buffer_get_iter_at_mark ( + GTK_TEXT_BUFFER (doc), + &iter, + gtk_text_buffer_get_insert (GTK_TEXT_BUFFER (doc))); + + position = g_strdup_printf ("%d", + gtk_text_iter_get_offset (&iter)); + + if (language == NULL) + gedit_document_set_metadata (doc, GEDIT_METADATA_ATTRIBUTE_POSITION, + position, NULL); + else + gedit_document_set_metadata (doc, GEDIT_METADATA_ATTRIBUTE_POSITION, + position, GEDIT_METADATA_ATTRIBUTE_LANGUAGE, + language, NULL); + g_free (position); + } + + if (doc->priv->loader) + { + g_object_unref (doc->priv->loader); + doc->priv->loader = NULL; + } + + if (doc->priv->metadata_info != NULL) + { + g_object_unref (doc->priv->metadata_info); + doc->priv->metadata_info = NULL; + } + + doc->priv->dispose_has_run = TRUE; + + G_OBJECT_CLASS (gedit_document_parent_class)->dispose (object); +} + +static void +gedit_document_finalize (GObject *object) +{ + GeditDocument *doc = GEDIT_DOCUMENT (object); + + gedit_debug (DEBUG_DOCUMENT); + + if (doc->priv->untitled_number > 0) + { + g_return_if_fail (doc->priv->uri == NULL); + release_untitled_number (doc->priv->untitled_number); + } + + g_free (doc->priv->uri); + g_free (doc->priv->content_type); + g_free (doc->priv->search_text); + + if (doc->priv->to_search_region != NULL) + { + /* we can't delete marks if we're finalizing the buffer */ + gedit_text_region_destroy (doc->priv->to_search_region, FALSE); + } + + G_OBJECT_CLASS (gedit_document_parent_class)->finalize (object); +} + +static void +gedit_document_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditDocument *doc = GEDIT_DOCUMENT (object); + + switch (prop_id) + { + case PROP_URI: + g_value_set_string (value, doc->priv->uri); + break; + case PROP_SHORTNAME: + g_value_take_string (value, gedit_document_get_short_name_for_display (doc)); + break; + case PROP_CONTENT_TYPE: + g_value_take_string (value, gedit_document_get_content_type (doc)); + break; + case PROP_MIME_TYPE: + g_value_take_string (value, gedit_document_get_mime_type (doc)); + break; + case PROP_READ_ONLY: + g_value_set_boolean (value, doc->priv->readonly); + break; + case PROP_ENCODING: + g_value_set_boxed (value, doc->priv->encoding); + break; + case PROP_CAN_SEARCH_AGAIN: + g_value_set_boolean (value, gedit_document_get_can_search_again (doc)); + break; + case PROP_ENABLE_SEARCH_HIGHLIGHTING: + g_value_set_boolean (value, gedit_document_get_enable_search_highlighting (doc)); + break; + case PROP_NEWLINE_TYPE: + g_value_set_enum (value, doc->priv->newline_type); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_document_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditDocument *doc = GEDIT_DOCUMENT (object); + + switch (prop_id) + { + case PROP_ENABLE_SEARCH_HIGHLIGHTING: + gedit_document_set_enable_search_highlighting (doc, + g_value_get_boolean (value)); + break; + case PROP_NEWLINE_TYPE: + gedit_document_set_newline_type (doc, + g_value_get_enum (value)); + break; + case PROP_SHORTNAME: + gedit_document_set_short_name_for_display (doc, + g_value_get_string (value)); + break; + case PROP_CONTENT_TYPE: + gedit_document_set_content_type (doc, + g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +emit_cursor_moved (GeditDocument *doc) +{ + if (!doc->priv->stop_cursor_moved_emission) + { + g_signal_emit (doc, + document_signals[CURSOR_MOVED], + 0); + } +} + +static void +gedit_document_mark_set (GtkTextBuffer *buffer, + const GtkTextIter *iter, + GtkTextMark *mark) +{ + GeditDocument *doc = GEDIT_DOCUMENT (buffer); + + if (GTK_TEXT_BUFFER_CLASS (gedit_document_parent_class)->mark_set) + GTK_TEXT_BUFFER_CLASS (gedit_document_parent_class)->mark_set (buffer, + iter, + mark); + + if (mark == gtk_text_buffer_get_insert (buffer)) + { + emit_cursor_moved (doc); + } +} + +static void +gedit_document_changed (GtkTextBuffer *buffer) +{ + emit_cursor_moved (GEDIT_DOCUMENT (buffer)); + + GTK_TEXT_BUFFER_CLASS (gedit_document_parent_class)->changed (buffer); +} + +static void +gedit_document_class_init (GeditDocumentClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkTextBufferClass *buf_class = GTK_TEXT_BUFFER_CLASS (klass); + + object_class->dispose = gedit_document_dispose; + object_class->finalize = gedit_document_finalize; + object_class->get_property = gedit_document_get_property; + object_class->set_property = gedit_document_set_property; + + buf_class->mark_set = gedit_document_mark_set; + buf_class->changed = gedit_document_changed; + + klass->load = gedit_document_load_real; + klass->save = gedit_document_save_real; + + g_object_class_install_property (object_class, PROP_URI, + g_param_spec_string ("uri", + "URI", + "The document's URI", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_SHORTNAME, + g_param_spec_string ("shortname", + "Short Name", + "The document's short name", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_CONTENT_TYPE, + g_param_spec_string ("content-type", + "Content Type", + "The document's Content Type", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_MIME_TYPE, + g_param_spec_string ("mime-type", + "MIME Type", + "The document's MIME Type", + "text/plain", + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_READ_ONLY, + g_param_spec_boolean ("read-only", + "Read Only", + "Whether the document is read only or not", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_ENCODING, + g_param_spec_boxed ("encoding", + "Encoding", + "The GeditEncoding used for the document", + GEDIT_TYPE_ENCODING, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_CAN_SEARCH_AGAIN, + g_param_spec_boolean ("can-search-again", + "Can search again", + "Wheter it's possible to search again in the document", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_ENABLE_SEARCH_HIGHLIGHTING, + g_param_spec_boolean ("enable-search-highlighting", + "Enable Search Highlighting", + "Whether all the occurences of the searched string must be highlighted", + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * GeditDocument:newline-type: + * + * The :newline-type property determines what is considered + * as a line ending when saving the document + */ + g_object_class_install_property (object_class, PROP_NEWLINE_TYPE, + g_param_spec_enum ("newline-type", + "Newline type", + "The accepted types of line ending", + GEDIT_TYPE_DOCUMENT_NEWLINE_TYPE, + GEDIT_DOCUMENT_NEWLINE_TYPE_LF, + G_PARAM_READWRITE | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_BLURB)); + + /* This signal is used to update the cursor position is the statusbar, + * it's emitted either when the insert mark is moved explicitely or + * when the buffer changes (insert/delete). + * We prevent the emission of the signal during replace_all to + * improve performance. + */ + document_signals[CURSOR_MOVED] = + g_signal_new ("cursor-moved", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, cursor_moved), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + /** + * GeditDocument::load: + * @document: the #GeditDocument. + * @uri: the uri where to load the document from. + * @encoding: the #GeditEncoding to encode the document. + * @line_pos: the line to show. + * @create: whether the document should be created if it doesn't exist. + * + * The "load" signal is emitted when a document is loaded. + * + * Since: 2.22 + */ + document_signals[LOAD] = + g_signal_new ("load", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, load), + NULL, NULL, + gedit_marshal_VOID__STRING_BOXED_INT_BOOLEAN, + G_TYPE_NONE, + 4, + G_TYPE_STRING, + /* we rely on the fact that the GeditEncoding pointer stays + * the same forever */ + GEDIT_TYPE_ENCODING | G_SIGNAL_TYPE_STATIC_SCOPE, + G_TYPE_INT, + G_TYPE_BOOLEAN); + + + document_signals[LOADING] = + g_signal_new ("loading", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, loading), + NULL, NULL, + gedit_marshal_VOID__UINT64_UINT64, + G_TYPE_NONE, + 2, + G_TYPE_UINT64, + G_TYPE_UINT64); + + document_signals[LOADED] = + g_signal_new ("loaded", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, loaded), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + + /** + * GeditDocument::save: + * @document: the #GeditDocument. + * @uri: the uri where the document is about to be saved. + * @encoding: the #GeditEncoding used to save the document. + * @flags: the #GeditDocumentSaveFlags for the save operation. + * + * The "save" signal is emitted when the document is saved. + * + * Since: 2.20 + */ + document_signals[SAVE] = + g_signal_new ("save", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, save), + NULL, NULL, + gedit_marshal_VOID__STRING_BOXED_FLAGS, + G_TYPE_NONE, + 3, + G_TYPE_STRING, + /* we rely on the fact that the GeditEncoding pointer stays + * the same forever */ + GEDIT_TYPE_ENCODING | G_SIGNAL_TYPE_STATIC_SCOPE, + GEDIT_TYPE_DOCUMENT_SAVE_FLAGS); + + document_signals[SAVING] = + g_signal_new ("saving", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, saving), + NULL, NULL, + gedit_marshal_VOID__UINT64_UINT64, + G_TYPE_NONE, + 2, + G_TYPE_UINT64, + G_TYPE_UINT64); + + document_signals[SAVED] = + g_signal_new ("saved", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, saved), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + + document_signals[SEARCH_HIGHLIGHT_UPDATED] = + g_signal_new ("search_highlight_updated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditDocumentClass, search_highlight_updated), + NULL, NULL, + gedit_marshal_VOID__BOXED_BOXED, + G_TYPE_NONE, + 2, + GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, + GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE); + + g_type_class_add_private (object_class, sizeof(GeditDocumentPrivate)); +} + +static void +set_language (GeditDocument *doc, + GtkSourceLanguage *lang, + gboolean set_by_user) +{ + GtkSourceLanguage *old_lang; + + gedit_debug (DEBUG_DOCUMENT); + + old_lang = gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (doc)); + + if (old_lang == lang) + return; + + gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (doc), lang); + + if (lang != NULL) + gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (doc), + gedit_prefs_manager_get_enable_syntax_highlighting ()); + else + gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (doc), + FALSE); + + if (set_by_user && (doc->priv->uri != NULL)) + { + gedit_document_set_metadata (doc, GEDIT_METADATA_ATTRIBUTE_LANGUAGE, + (lang == NULL) ? "_NORMAL_" : gtk_source_language_get_id (lang), + NULL); + } + + doc->priv->language_set_by_user = set_by_user; +} + +static void +set_encoding (GeditDocument *doc, + const GeditEncoding *encoding, + gboolean set_by_user) +{ + g_return_if_fail (encoding != NULL); + + gedit_debug (DEBUG_DOCUMENT); + + if (doc->priv->encoding == encoding) + return; + + doc->priv->encoding = encoding; + + if (set_by_user) + { + const gchar *charset; + + charset = gedit_encoding_get_charset (encoding); + + gedit_document_set_metadata (doc, GEDIT_METADATA_ATTRIBUTE_ENCODING, + charset, NULL); + } + + g_object_notify (G_OBJECT (doc), "encoding"); +} + +static GtkSourceStyleScheme * +get_default_style_scheme (void) +{ + gchar *scheme_id; + GtkSourceStyleScheme *def_style; + GtkSourceStyleSchemeManager *manager; + + manager = gedit_get_style_scheme_manager (); + scheme_id = gedit_prefs_manager_get_source_style_scheme (); + def_style = gtk_source_style_scheme_manager_get_scheme (manager, + scheme_id); + + if (def_style == NULL) + { + g_warning ("Default style scheme '%s' cannot be found, falling back to 'classic' style scheme ", scheme_id); + + def_style = gtk_source_style_scheme_manager_get_scheme (manager, "classic"); + if (def_style == NULL) + { + g_warning ("Style scheme 'classic' cannot be found, check your GtkSourceView installation."); + } + } + + g_free (scheme_id); + + return def_style; +} + +static void +on_uri_changed (GeditDocument *doc, + GParamSpec *pspec, + gpointer useless) +{ +#ifdef ENABLE_GVFS_METADATA + GFile *location; + + location = gedit_document_get_location (doc); + + /* load metadata for this uri: we load sync since metadata is + * always local so it should be fast and we need the information + * right after the uri was set. + */ + if (location != NULL) + { + GError *error = NULL; + + if (doc->priv->metadata_info != NULL) + g_object_unref (doc->priv->metadata_info); + + doc->priv->metadata_info = g_file_query_info (location, + METADATA_QUERY, + G_FILE_QUERY_INFO_NONE, + NULL, + &error); + + if (error != NULL) + { + if (error->code != G_FILE_ERROR_ISDIR && + error->code != G_FILE_ERROR_NOTDIR && + error->code != G_FILE_ERROR_NOENT) + { + g_warning ("%s", error->message); + } + + g_error_free (error); + } + + g_object_unref (location); + } +#endif +} + +static GtkSourceLanguage * +guess_language (GeditDocument *doc, + const gchar *content_type) +{ + gchar *data; + GtkSourceLanguage *language = NULL; + + data = gedit_document_get_metadata (doc, GEDIT_METADATA_ATTRIBUTE_LANGUAGE); + + if (data != NULL) + { + gedit_debug_message (DEBUG_DOCUMENT, "Language from metadata: %s", data); + + if (strcmp (data, "_NORMAL_") != 0) + { + language = gtk_source_language_manager_get_language ( + gedit_get_language_manager (), + data); + } + + g_free (data); + } + else + { + GFile *file; + gchar *basename = NULL; + + file = gedit_document_get_location (doc); + gedit_debug_message (DEBUG_DOCUMENT, "Sniffing Language"); + + if (file) + { + basename = g_file_get_basename (file); + } + else if (doc->priv->short_name != NULL) + { + basename = g_strdup (doc->priv->short_name); + } + + language = gtk_source_language_manager_guess_language ( + gedit_get_language_manager (), + basename, + content_type); + + g_free (basename); + + if (file != NULL) + { + g_object_unref (file); + } + } + + return language; +} + +static void +on_content_type_changed (GeditDocument *doc, + GParamSpec *pspec, + gpointer useless) +{ + if (!doc->priv->language_set_by_user) + { + GtkSourceLanguage *language; + + language = guess_language (doc, doc->priv->content_type); + + gedit_debug_message (DEBUG_DOCUMENT, "Language: %s", + language != NULL ? gtk_source_language_get_name (language) : "None"); + + set_language (doc, language, FALSE); + } +} + +static gchar * +get_default_content_type (void) +{ + return g_content_type_from_mime_type ("text/plain"); +} + +static void +gedit_document_init (GeditDocument *doc) +{ + GtkSourceStyleScheme *style_scheme; + + gedit_debug (DEBUG_DOCUMENT); + + doc->priv = GEDIT_DOCUMENT_GET_PRIVATE (doc); + + doc->priv->uri = NULL; + doc->priv->untitled_number = get_untitled_number (); + + doc->priv->metadata_info = NULL; + + doc->priv->content_type = get_default_content_type (); + + doc->priv->readonly = FALSE; + + doc->priv->stop_cursor_moved_emission = FALSE; + + doc->priv->last_save_was_manually = TRUE; + doc->priv->language_set_by_user = FALSE; + + doc->priv->dispose_has_run = FALSE; + + doc->priv->mtime.tv_sec = 0; + doc->priv->mtime.tv_usec = 0; + + g_get_current_time (&doc->priv->time_of_last_save_or_load); + + doc->priv->encoding = gedit_encoding_get_utf8 (); + + doc->priv->newline_type = GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT; + + gtk_source_buffer_set_max_undo_levels (GTK_SOURCE_BUFFER (doc), + gedit_prefs_manager_get_undo_actions_limit ()); + + gtk_source_buffer_set_highlight_matching_brackets (GTK_SOURCE_BUFFER (doc), + gedit_prefs_manager_get_bracket_matching ()); + + gedit_document_set_enable_search_highlighting (doc, + gedit_prefs_manager_get_enable_search_highlighting ()); + + style_scheme = get_default_style_scheme (); + if (style_scheme != NULL) + gtk_source_buffer_set_style_scheme (GTK_SOURCE_BUFFER (doc), + style_scheme); + + g_signal_connect_after (doc, + "insert-text", + G_CALLBACK (insert_text_cb), + NULL); + + g_signal_connect_after (doc, + "delete-range", + G_CALLBACK (delete_range_cb), + NULL); + + g_signal_connect (doc, + "notify::content-type", + G_CALLBACK (on_content_type_changed), + NULL); + + g_signal_connect (doc, + "notify::uri", + G_CALLBACK (on_uri_changed), + NULL); +} + +GeditDocument * +gedit_document_new (void) +{ + gedit_debug (DEBUG_DOCUMENT); + + return GEDIT_DOCUMENT (g_object_new (GEDIT_TYPE_DOCUMENT, NULL)); +} + +static void +set_content_type_no_guess (GeditDocument *doc, + const gchar *content_type) +{ + gedit_debug (DEBUG_DOCUMENT); + + if (doc->priv->content_type != NULL && content_type != NULL && + (0 == strcmp (doc->priv->content_type, content_type))) + return; + + g_free (doc->priv->content_type); + + if (content_type == NULL || g_content_type_is_unknown (content_type)) + doc->priv->content_type = get_default_content_type (); + else + doc->priv->content_type = g_strdup (content_type); + + g_object_notify (G_OBJECT (doc), "content-type"); +} + +static void +set_content_type (GeditDocument *doc, + const gchar *content_type) +{ + gedit_debug (DEBUG_DOCUMENT); + + if (content_type == NULL) + { + GFile *file; + gchar *guessed_type = NULL; + + /* If content type is null, we guess from the filename */ + file = gedit_document_get_location (doc); + if (file != NULL) + { + gchar *basename; + + basename = g_file_get_basename (file); + guessed_type = g_content_type_guess (basename, NULL, 0, NULL); + + g_free (basename); + g_object_unref (file); + } + + set_content_type_no_guess (doc, guessed_type); + + g_free (guessed_type); + } + else + { + set_content_type_no_guess (doc, content_type); + } +} + +void +gedit_document_set_content_type (GeditDocument *doc, + const gchar *content_type) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + set_content_type (doc, content_type); +} + +static void +set_uri (GeditDocument *doc, + const gchar *uri) +{ + gedit_debug (DEBUG_DOCUMENT); + + g_return_if_fail ((uri == NULL) || gedit_utils_is_valid_uri (uri)); + + if (uri != NULL) + { + if (doc->priv->uri == uri) + return; + + g_free (doc->priv->uri); + doc->priv->uri = g_strdup (uri); + + if (doc->priv->untitled_number > 0) + { + release_untitled_number (doc->priv->untitled_number); + doc->priv->untitled_number = 0; + } + } + + g_object_notify (G_OBJECT (doc), "uri"); + + if (doc->priv->short_name == NULL) + { + g_object_notify (G_OBJECT (doc), "shortname"); + } +} + +GFile * +gedit_document_get_location (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + return doc->priv->uri == NULL ? NULL : g_file_new_for_uri (doc->priv->uri); +} + +gchar * +gedit_document_get_uri (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + return g_strdup (doc->priv->uri); +} + +void +gedit_document_set_uri (GeditDocument *doc, + const gchar *uri) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (uri != NULL); + + set_uri (doc, uri); + set_content_type (doc, NULL); +} + +/* Never returns NULL */ +gchar * +gedit_document_get_uri_for_display (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), g_strdup ("")); + + if (doc->priv->uri == NULL) + return g_strdup_printf (_("Unsaved Document %d"), + doc->priv->untitled_number); + else + return gedit_utils_uri_for_display (doc->priv->uri); +} + +/* Never returns NULL */ +gchar * +gedit_document_get_short_name_for_display (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), g_strdup ("")); + + if (doc->priv->short_name != NULL) + return g_strdup (doc->priv->short_name); + else if (doc->priv->uri == NULL) + return g_strdup_printf (_("Unsaved Document %d"), + doc->priv->untitled_number); + else + return gedit_utils_basename_for_display (doc->priv->uri); +} + +void +gedit_document_set_short_name_for_display (GeditDocument *doc, + const gchar *short_name) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + g_free (doc->priv->short_name); + doc->priv->short_name = g_strdup (short_name); + + g_object_notify (G_OBJECT (doc), "shortname"); +} + +gchar * +gedit_document_get_content_type (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + return g_strdup (doc->priv->content_type); +} + +/* Never returns NULL */ +gchar * +gedit_document_get_mime_type (GeditDocument *doc) +{ + gchar *mime_type = NULL; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), g_strdup ("text/plain")); + + if ((doc->priv->content_type != NULL) && + (!g_content_type_is_unknown (doc->priv->content_type))) + { + mime_type = g_content_type_get_mime_type (doc->priv->content_type); + } + + return mime_type != NULL ? mime_type : g_strdup ("text/plain"); +} + +/* Note: do not emit the notify::read-only signal */ +static gboolean +set_readonly (GeditDocument *doc, + gboolean readonly) +{ + gedit_debug (DEBUG_DOCUMENT); + + readonly = (readonly != FALSE); + + if (doc->priv->readonly == readonly) + return FALSE; + + doc->priv->readonly = readonly; + + return TRUE; +} + +/** + * gedit_document_set_readonly: + * @doc: a #GeditDocument + * @readonly: %TRUE to se the document as read-only + * + * If @readonly is %TRUE sets @doc as read-only. + */ +void +_gedit_document_set_readonly (GeditDocument *doc, + gboolean readonly) +{ + gedit_debug (DEBUG_DOCUMENT); + + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + if (set_readonly (doc, readonly)) + { + g_object_notify (G_OBJECT (doc), "read-only"); + } +} + +gboolean +gedit_document_get_readonly (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), TRUE); + + return doc->priv->readonly; +} + +gboolean +_gedit_document_check_externally_modified (GeditDocument *doc) +{ + GFile *gfile; + GFileInfo *info; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + + if (doc->priv->uri == NULL) + { + return FALSE; + } + + gfile = g_file_new_for_uri (doc->priv->uri); + info = g_file_query_info (gfile, + G_FILE_ATTRIBUTE_TIME_MODIFIED "," \ + G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, + G_FILE_QUERY_INFO_NONE, + NULL, NULL); + g_object_unref (gfile); + + if (info != NULL) + { + /* While at it also check if permissions changed */ + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) + { + gboolean read_only; + + read_only = !g_file_info_get_attribute_boolean (info, + G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE); + + _gedit_document_set_readonly (doc, read_only); + } + + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) + { + GTimeVal timeval; + + g_file_info_get_modification_time (info, &timeval); + g_object_unref (info); + + return (timeval.tv_sec > doc->priv->mtime.tv_sec) || + (timeval.tv_sec == doc->priv->mtime.tv_sec && + timeval.tv_usec > doc->priv->mtime.tv_usec); + } + } + + return FALSE; +} + +static void +reset_temp_loading_data (GeditDocument *doc) +{ + /* the loader has been used, throw it away */ + g_object_unref (doc->priv->loader); + doc->priv->loader = NULL; + + doc->priv->requested_encoding = NULL; + doc->priv->requested_line_pos = 0; +} + +static void +document_loader_loaded (GeditDocumentLoader *loader, + const GError *error, + GeditDocument *doc) +{ + /* load was successful */ + if (error == NULL || + (error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK)) + { + GtkTextIter iter; + GFileInfo *info; + const gchar *content_type = NULL; + gboolean read_only = FALSE; + GTimeVal mtime = {0, 0}; + + info = gedit_document_loader_get_info (loader); + + if (info) + { + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE)) + content_type = g_file_info_get_attribute_string (info, + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); + + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) + g_file_info_get_modification_time (info, &mtime); + + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) + read_only = !g_file_info_get_attribute_boolean (info, + G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE); + } + + doc->priv->mtime = mtime; + + set_readonly (doc, read_only); + + g_get_current_time (&doc->priv->time_of_last_save_or_load); + + set_encoding (doc, + gedit_document_loader_get_encoding (loader), + (doc->priv->requested_encoding != NULL)); + + set_content_type (doc, content_type); + + gedit_document_set_newline_type (doc, + gedit_document_loader_get_newline_type (loader)); + + /* move the cursor at the requested line if any */ + if (doc->priv->requested_line_pos > 0) + { + /* line_pos - 1 because get_iter_at_line counts from 0 */ + gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc), + &iter, + doc->priv->requested_line_pos - 1); + } + /* else, if enabled, to the position stored in the metadata */ + else if (gedit_prefs_manager_get_restore_cursor_position ()) + { + gchar *pos; + gint offset; + + pos = gedit_document_get_metadata (doc, GEDIT_METADATA_ATTRIBUTE_POSITION); + + offset = pos ? atoi (pos) : 0; + g_free (pos); + + gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (doc), + &iter, + MAX (offset, 0)); + + /* make sure it's a valid position, if the file + * changed we may have ended up in the middle of + * a utf8 character cluster */ + if (!gtk_text_iter_is_cursor_position (&iter)) + { + gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (doc), + &iter); + } + } + /* otherwise to the top */ + else + { + gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (doc), + &iter); + } + + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &iter); + } + + /* special case creating a named new doc */ + else if (doc->priv->create && + (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_NOT_FOUND) && + (gedit_utils_uri_has_file_scheme (doc->priv->uri))) + { + reset_temp_loading_data (doc); + + g_signal_emit (doc, + document_signals[LOADED], + 0, + NULL); + + return; + } + + g_signal_emit (doc, + document_signals[LOADED], + 0, + error); + + reset_temp_loading_data (doc); +} + +static void +document_loader_loading (GeditDocumentLoader *loader, + gboolean completed, + const GError *error, + GeditDocument *doc) +{ + if (completed) + { + document_loader_loaded (loader, error, doc); + } + else + { + goffset size = 0; + goffset read; + GFileInfo *info; + + info = gedit_document_loader_get_info (loader); + + if (info && g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE)) + size = g_file_info_get_attribute_uint64 (info, + G_FILE_ATTRIBUTE_STANDARD_SIZE); + + read = gedit_document_loader_get_bytes_read (loader); + + g_signal_emit (doc, + document_signals[LOADING], + 0, + read, + size); + } +} + +static void +gedit_document_load_real (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create) +{ + g_return_if_fail (doc->priv->loader == NULL); + + gedit_debug_message (DEBUG_DOCUMENT, "load_real: uri = %s", uri); + + /* create a loader. It will be destroyed when loading is completed */ + doc->priv->loader = gedit_document_loader_new (doc, uri, encoding); + + g_signal_connect (doc->priv->loader, + "loading", + G_CALLBACK (document_loader_loading), + doc); + + doc->priv->create = create; + doc->priv->requested_encoding = encoding; + doc->priv->requested_line_pos = line_pos; + + set_uri (doc, uri); + set_content_type (doc, NULL); + + gedit_document_loader_load (doc->priv->loader); +} + +/** + * gedit_document_load: + * @doc: the #GeditDocument. + * @uri: the uri where to load the document from. + * @encoding: the #GeditEncoding to encode the document. + * @line_pos: the line to show. + * @create: whether the document should be created if it doesn't exist. + * + * Load a document. This results in the "load" signal to be emitted. + */ +void +gedit_document_load (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (uri != NULL); + g_return_if_fail (gedit_utils_is_valid_uri (uri)); + + g_signal_emit (doc, document_signals[LOAD], 0, uri, encoding, line_pos, create); +} + +/** + * gedit_document_load_cancel: + * @doc: the #GeditDocument. + * + * Cancel load of a document. + */ +gboolean +gedit_document_load_cancel (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + + if (doc->priv->loader == NULL) + return FALSE; + + return gedit_document_loader_cancel (doc->priv->loader); +} + +static void +document_saver_saving (GeditDocumentSaver *saver, + gboolean completed, + const GError *error, + GeditDocument *doc) +{ + gedit_debug (DEBUG_DOCUMENT); + + if (completed) + { + /* save was successful */ + if (error == NULL) + { + const gchar *uri; + const gchar *content_type = NULL; + GTimeVal mtime = {0, 0}; + GFileInfo *info; + + uri = gedit_document_saver_get_uri (saver); + set_uri (doc, uri); + + info = gedit_document_saver_get_info (saver); + + if (info != NULL) + { + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE)) + content_type = g_file_info_get_attribute_string (info, + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); + + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) + g_file_info_get_modification_time (info, &mtime); + } + + set_content_type (doc, content_type); + doc->priv->mtime = mtime; + + g_get_current_time (&doc->priv->time_of_last_save_or_load); + + _gedit_document_set_readonly (doc, FALSE); + + gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (doc), + FALSE); + + set_encoding (doc, + doc->priv->requested_encoding, + TRUE); + } + + g_signal_emit (doc, + document_signals[SAVED], + 0, + error); + + /* the saver has been used, throw it away */ + g_object_unref (doc->priv->saver); + doc->priv->saver = NULL; + } + else + { + goffset size = 0; + goffset written = 0; + + size = gedit_document_saver_get_file_size (saver); + written = gedit_document_saver_get_bytes_written (saver); + + gedit_debug_message (DEBUG_DOCUMENT, "save progress: %" G_GINT64_FORMAT " of %" G_GINT64_FORMAT, written, size); + + g_signal_emit (doc, + document_signals[SAVING], + 0, + written, + size); + } +} + +static void +gedit_document_save_real (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentSaveFlags flags) +{ + g_return_if_fail (doc->priv->saver == NULL); + + /* create a saver, it will be destroyed once saving is complete */ + doc->priv->saver = gedit_document_saver_new (doc, uri, encoding, + doc->priv->newline_type, + flags); + + g_signal_connect (doc->priv->saver, + "saving", + G_CALLBACK (document_saver_saving), + doc); + + doc->priv->requested_encoding = encoding; + + gedit_document_saver_save (doc->priv->saver, + &doc->priv->mtime); +} + +/** + * gedit_document_save: + * @doc: the #GeditDocument. + * @flags: optionnal #GeditDocumentSaveFlags. + * + * Save the document to its previous location. This results in the "save" + * signal to be emitted. + */ +void +gedit_document_save (GeditDocument *doc, + GeditDocumentSaveFlags flags) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (doc->priv->uri != NULL); + + g_signal_emit (doc, + document_signals[SAVE], + 0, + doc->priv->uri, + doc->priv->encoding, + flags); +} + +/** + * gedit_document_save_as: + * @doc: the #GeditDocument. + * @uri: the uri where to save the document. + * @encoding: the #GeditEncoding to encode the document. + * @flags: optionnal #GeditDocumentSaveFlags. + * + * Save the document to a new location. This results in the "save" signal + * to be emitted. + */ +void +gedit_document_save_as (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentSaveFlags flags) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (uri != NULL); + g_return_if_fail (encoding != NULL); + + /* priv->mtime refers to the the old uri (if any). Thus, it should be + * ignored when saving as. */ + g_signal_emit (doc, + document_signals[SAVE], + 0, + uri, + encoding, + flags | GEDIT_DOCUMENT_SAVE_IGNORE_MTIME); +} + +gboolean +gedit_document_insert_file (GeditDocument *doc, + GtkTextIter *iter, + const gchar *uri, + const GeditEncoding *encoding) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (gtk_text_iter_get_buffer (iter) == + GTK_TEXT_BUFFER (doc), FALSE); + + /* TODO */ + + return FALSE; +} + +gboolean +gedit_document_is_untouched (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), TRUE); + + return (doc->priv->uri == NULL) && + (!gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc))); +} + +gboolean +gedit_document_is_untitled (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), TRUE); + + return (doc->priv->uri == NULL); +} + +gboolean +gedit_document_is_local (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + + if (doc->priv->uri == NULL) + { + return FALSE; + } + + return gedit_utils_uri_has_file_scheme (doc->priv->uri); +} + +gboolean +gedit_document_get_deleted (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + + return doc->priv->uri && !gedit_utils_uri_exists (doc->priv->uri); +} + +/* + * If @line is bigger than the lines of the document, the cursor is moved + * to the last line and FALSE is returned. + */ +gboolean +gedit_document_goto_line (GeditDocument *doc, + gint line) +{ + gboolean ret = TRUE; + guint line_count; + GtkTextIter iter; + + gedit_debug (DEBUG_DOCUMENT); + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + g_return_val_if_fail (line >= -1, FALSE); + + line_count = gtk_text_buffer_get_line_count (GTK_TEXT_BUFFER (doc)); + + if (line >= line_count) + { + ret = FALSE; + gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (doc), + &iter); + } + else + { + gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc), + &iter, + line); + } + + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &iter); + + return ret; +} + +gboolean +gedit_document_goto_line_offset (GeditDocument *doc, + gint line, + gint line_offset) +{ + gboolean ret = TRUE; + guint offset_count; + GtkTextIter iter; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + g_return_val_if_fail (line >= -1, FALSE); + g_return_val_if_fail (line_offset >= -1, FALSE); + + gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc), + &iter, + line); + + offset_count = gtk_text_iter_get_chars_in_line (&iter); + if (line_offset > offset_count) + { + ret = FALSE; + } + else + { + gtk_text_iter_set_line_offset (&iter, line_offset); + } + + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &iter); + + return ret; +} + +static gint +compute_num_of_lines (const gchar *text) +{ + const gchar *p; + gint len; + gint n = 1; + + g_return_val_if_fail (text != NULL, 0); + + len = strlen (text); + p = text; + + while (len > 0) + { + gint del, par; + + pango_find_paragraph_boundary (p, len, &del, &par); + + if (del == par) /* not found */ + break; + + p += par; + len -= par; + ++n; + } + + return n; +} + +void +gedit_document_set_search_text (GeditDocument *doc, + const gchar *text, + guint flags) +{ + gchar *converted_text; + gboolean notify = FALSE; + gboolean update_to_search_region = FALSE; + + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail ((text == NULL) || (doc->priv->search_text != text)); + g_return_if_fail ((text == NULL) || g_utf8_validate (text, -1, NULL)); + + gedit_debug_message (DEBUG_DOCUMENT, "text = %s", text); + + if (text != NULL) + { + if (*text != '\0') + { + converted_text = gedit_utils_unescape_search_text (text); + notify = !gedit_document_get_can_search_again (doc); + } + else + { + converted_text = g_strdup(""); + notify = gedit_document_get_can_search_again (doc); + } + + g_free (doc->priv->search_text); + + doc->priv->search_text = converted_text; + doc->priv->num_of_lines_search_text = compute_num_of_lines (doc->priv->search_text); + update_to_search_region = TRUE; + } + + if (!GEDIT_SEARCH_IS_DONT_SET_FLAGS (flags)) + { + if (doc->priv->search_flags != flags) + update_to_search_region = TRUE; + + doc->priv->search_flags = flags; + + } + + if (update_to_search_region) + { + GtkTextIter begin; + GtkTextIter end; + + gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc), + &begin, + &end); + + to_search_region_range (doc, + &begin, + &end); + } + + if (notify) + g_object_notify (G_OBJECT (doc), "can-search-again"); +} + +gchar * +gedit_document_get_search_text (GeditDocument *doc, + guint *flags) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + if (flags != NULL) + *flags = doc->priv->search_flags; + + return gedit_utils_escape_search_text (doc->priv->search_text); +} + +gboolean +gedit_document_get_can_search_again (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + + return ((doc->priv->search_text != NULL) && + (*doc->priv->search_text != '\0')); +} + +gboolean +gedit_document_search_forward (GeditDocument *doc, + const GtkTextIter *start, + const GtkTextIter *end, + GtkTextIter *match_start, + GtkTextIter *match_end) +{ + GtkTextIter iter; + GtkSourceSearchFlags search_flags; + gboolean found = FALSE; + GtkTextIter m_start; + GtkTextIter m_end; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + g_return_val_if_fail ((start == NULL) || + (gtk_text_iter_get_buffer (start) == GTK_TEXT_BUFFER (doc)), FALSE); + g_return_val_if_fail ((end == NULL) || + (gtk_text_iter_get_buffer (end) == GTK_TEXT_BUFFER (doc)), FALSE); + + if (doc->priv->search_text == NULL) + { + gedit_debug_message (DEBUG_DOCUMENT, "doc->priv->search_text == NULL\n"); + return FALSE; + } + else + gedit_debug_message (DEBUG_DOCUMENT, "doc->priv->search_text == \"%s\"\n", doc->priv->search_text); + + if (start == NULL) + gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (doc), &iter); + else + iter = *start; + + search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; + + if (!GEDIT_SEARCH_IS_CASE_SENSITIVE (doc->priv->search_flags)) + { + search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; + } + + while (!found) + { + found = gtk_source_iter_forward_search (&iter, + doc->priv->search_text, + search_flags, + &m_start, + &m_end, + end); + + if (found && GEDIT_SEARCH_IS_ENTIRE_WORD (doc->priv->search_flags)) + { + found = gtk_text_iter_starts_word (&m_start) && + gtk_text_iter_ends_word (&m_end); + + if (!found) + iter = m_end; + } + else + break; + } + + if (found && (match_start != NULL)) + *match_start = m_start; + + if (found && (match_end != NULL)) + *match_end = m_end; + + return found; +} + +gboolean +gedit_document_search_backward (GeditDocument *doc, + const GtkTextIter *start, + const GtkTextIter *end, + GtkTextIter *match_start, + GtkTextIter *match_end) +{ + GtkTextIter iter; + GtkSourceSearchFlags search_flags; + gboolean found = FALSE; + GtkTextIter m_start; + GtkTextIter m_end; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + g_return_val_if_fail ((start == NULL) || + (gtk_text_iter_get_buffer (start) == GTK_TEXT_BUFFER (doc)), FALSE); + g_return_val_if_fail ((end == NULL) || + (gtk_text_iter_get_buffer (end) == GTK_TEXT_BUFFER (doc)), FALSE); + + if (doc->priv->search_text == NULL) + { + gedit_debug_message (DEBUG_DOCUMENT, "doc->priv->search_text == NULL\n"); + return FALSE; + } + else + gedit_debug_message (DEBUG_DOCUMENT, "doc->priv->search_text == \"%s\"\n", doc->priv->search_text); + + if (end == NULL) + gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (doc), &iter); + else + iter = *end; + + search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; + + if (!GEDIT_SEARCH_IS_CASE_SENSITIVE (doc->priv->search_flags)) + { + search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; + } + + while (!found) + { + found = gtk_source_iter_backward_search (&iter, + doc->priv->search_text, + search_flags, + &m_start, + &m_end, + start); + + if (found && GEDIT_SEARCH_IS_ENTIRE_WORD (doc->priv->search_flags)) + { + found = gtk_text_iter_starts_word (&m_start) && + gtk_text_iter_ends_word (&m_end); + + if (!found) + iter = m_start; + } + else + break; + } + + if (found && (match_start != NULL)) + *match_start = m_start; + + if (found && (match_end != NULL)) + *match_end = m_end; + + return found; +} + +gint +gedit_document_replace_all (GeditDocument *doc, + const gchar *find, + const gchar *replace, + guint flags) +{ + GtkTextIter iter; + GtkTextIter m_start; + GtkTextIter m_end; + GtkSourceSearchFlags search_flags = 0; + gboolean found = TRUE; + gint cont = 0; + gchar *search_text; + gchar *replace_text; + gint replace_text_len; + GtkTextBuffer *buffer; + gboolean brackets_highlighting; + gboolean search_highliting; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), 0); + g_return_val_if_fail (replace != NULL, 0); + g_return_val_if_fail ((find != NULL) || (doc->priv->search_text != NULL), 0); + + buffer = GTK_TEXT_BUFFER (doc); + + if (find == NULL) + search_text = g_strdup (doc->priv->search_text); + else + search_text = gedit_utils_unescape_search_text (find); + + replace_text = gedit_utils_unescape_search_text (replace); + + gtk_text_buffer_get_start_iter (buffer, &iter); + + search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; + + if (!GEDIT_SEARCH_IS_CASE_SENSITIVE (flags)) + { + search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; + } + + replace_text_len = strlen (replace_text); + + /* disable cursor_moved emission until the end of the + * replace_all so that we don't spend all the time + * updating the position in the statusbar + */ + doc->priv->stop_cursor_moved_emission = TRUE; + + /* also avoid spending time matching brackets */ + brackets_highlighting = gtk_source_buffer_get_highlight_matching_brackets (GTK_SOURCE_BUFFER (buffer)); + gtk_source_buffer_set_highlight_matching_brackets (GTK_SOURCE_BUFFER (buffer), FALSE); + + /* and do search highliting later */ + search_highliting = gedit_document_get_enable_search_highlighting (doc); + gedit_document_set_enable_search_highlighting (doc, FALSE); + + gtk_text_buffer_begin_user_action (buffer); + + do + { + found = gtk_source_iter_forward_search (&iter, + search_text, + search_flags, + &m_start, + &m_end, + NULL); + + if (found && GEDIT_SEARCH_IS_ENTIRE_WORD (flags)) + { + gboolean word; + + word = gtk_text_iter_starts_word (&m_start) && + gtk_text_iter_ends_word (&m_end); + + if (!word) + { + iter = m_end; + continue; + } + } + + if (found) + { + ++cont; + + gtk_text_buffer_delete (buffer, + &m_start, + &m_end); + gtk_text_buffer_insert (buffer, + &m_start, + replace_text, + replace_text_len); + + iter = m_start; + } + + } while (found); + + gtk_text_buffer_end_user_action (buffer); + + /* re-enable cursor_moved emission and notify + * the current position + */ + doc->priv->stop_cursor_moved_emission = FALSE; + emit_cursor_moved (doc); + + gtk_source_buffer_set_highlight_matching_brackets (GTK_SOURCE_BUFFER (buffer), + brackets_highlighting); + gedit_document_set_enable_search_highlighting (doc, search_highliting); + + g_free (search_text); + g_free (replace_text); + + return cont; +} + +void +gedit_document_set_language (GeditDocument *doc, + GtkSourceLanguage *lang) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + set_language (doc, lang, TRUE); +} + +GtkSourceLanguage * +gedit_document_get_language (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + return gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (doc)); +} + +const GeditEncoding * +gedit_document_get_encoding (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + return doc->priv->encoding; +} + +glong +_gedit_document_get_seconds_since_last_save_or_load (GeditDocument *doc) +{ + GTimeVal current_time; + + gedit_debug (DEBUG_DOCUMENT); + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), -1); + + g_get_current_time (¤t_time); + + return (current_time.tv_sec - doc->priv->time_of_last_save_or_load.tv_sec); +} + +static void +get_search_match_colors (GeditDocument *doc, + gboolean *foreground_set, + GdkColor *foreground, + gboolean *background_set, + GdkColor *background) +{ + GtkSourceStyleScheme *style_scheme; + GtkSourceStyle *style; + gchar *bg; + gchar *fg; + + style_scheme = gtk_source_buffer_get_style_scheme (GTK_SOURCE_BUFFER (doc)); + if (style_scheme == NULL) + goto fallback; + + style = gtk_source_style_scheme_get_style (style_scheme, + "search-match"); + if (style == NULL) + goto fallback; + + g_object_get (style, + "foreground-set", foreground_set, + "foreground", &fg, + "background-set", background_set, + "background", &bg, + NULL); + + if (*foreground_set) + { + if (fg == NULL || + !gdk_color_parse (fg, foreground)) + { + *foreground_set = FALSE; + } + } + + if (*background_set) + { + if (bg == NULL || + !gdk_color_parse (bg, background)) + { + *background_set = FALSE; + } + } + + g_free (fg); + g_free (bg); + + return; + + fallback: + gedit_debug_message (DEBUG_DOCUMENT, + "Falling back to hard-coded colors " + "for the \"found\" text tag."); + + gdk_color_parse ("#FFFF78", background); + *background_set = TRUE; + *foreground_set = FALSE; + + return; +} + +static void +sync_found_tag (GeditDocument *doc, + GParamSpec *pspec, + gpointer data) +{ + GdkColor fg; + GdkColor bg; + gboolean fg_set; + gboolean bg_set; + + gedit_debug (DEBUG_DOCUMENT); + + g_return_if_fail (GTK_TEXT_TAG (doc->priv->found_tag)); + + get_search_match_colors (doc, + &fg_set, &fg, + &bg_set, &bg); + + g_object_set (doc->priv->found_tag, + "foreground-gdk", fg_set ? &fg : NULL, + NULL); + g_object_set (doc->priv->found_tag, + "background-gdk", bg_set ? &bg : NULL, + NULL); +} + +static void +text_tag_set_highest_priority (GtkTextTag *tag, + GtkTextBuffer *buffer) +{ + GtkTextTagTable *table; + gint n; + + table = gtk_text_buffer_get_tag_table (buffer); + n = gtk_text_tag_table_get_size (table); + gtk_text_tag_set_priority (tag, n - 1); +} + +static void +search_region (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end) +{ + GtkTextIter iter; + GtkTextIter m_start; + GtkTextIter m_end; + GtkSourceSearchFlags search_flags = 0; + gboolean found = TRUE; + + GtkTextBuffer *buffer; + + gedit_debug (DEBUG_DOCUMENT); + + buffer = GTK_TEXT_BUFFER (doc); + + if (doc->priv->found_tag == NULL) + { + doc->priv->found_tag = gtk_text_buffer_create_tag (GTK_TEXT_BUFFER (doc), + "found", + NULL); + + sync_found_tag (doc, NULL, NULL); + + g_signal_connect (doc, + "notify::style-scheme", + G_CALLBACK (sync_found_tag), + NULL); + } + + /* make sure the 'found' tag has the priority over + * syntax highlighting tags */ + text_tag_set_highest_priority (doc->priv->found_tag, + GTK_TEXT_BUFFER (doc)); + + + if (doc->priv->search_text == NULL) + return; + + g_return_if_fail (doc->priv->num_of_lines_search_text > 0); + + gtk_text_iter_backward_lines (start, doc->priv->num_of_lines_search_text); + gtk_text_iter_forward_lines (end, doc->priv->num_of_lines_search_text); + + if (gtk_text_iter_has_tag (start, doc->priv->found_tag) && + !gtk_text_iter_begins_tag (start, doc->priv->found_tag)) + gtk_text_iter_backward_to_tag_toggle (start, doc->priv->found_tag); + + if (gtk_text_iter_has_tag (end, doc->priv->found_tag) && + !gtk_text_iter_ends_tag (end, doc->priv->found_tag)) + gtk_text_iter_forward_to_tag_toggle (end, doc->priv->found_tag); + + /* + g_print ("[%u (%u), %u (%u)]\n", gtk_text_iter_get_line (start), gtk_text_iter_get_offset (start), + gtk_text_iter_get_line (end), gtk_text_iter_get_offset (end)); + */ + + gtk_text_buffer_remove_tag (buffer, + doc->priv->found_tag, + start, + end); + + if (*doc->priv->search_text == '\0') + return; + + iter = *start; + + search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; + + if (!GEDIT_SEARCH_IS_CASE_SENSITIVE (doc->priv->search_flags)) + { + search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; + } + + do + { + if ((end != NULL) && gtk_text_iter_is_end (end)) + end = NULL; + + found = gtk_source_iter_forward_search (&iter, + doc->priv->search_text, + search_flags, + &m_start, + &m_end, + end); + + iter = m_end; + + if (found && GEDIT_SEARCH_IS_ENTIRE_WORD (doc->priv->search_flags)) + { + gboolean word; + + word = gtk_text_iter_starts_word (&m_start) && + gtk_text_iter_ends_word (&m_end); + + if (!word) + continue; + } + + if (found) + { + gtk_text_buffer_apply_tag (buffer, + doc->priv->found_tag, + &m_start, + &m_end); + } + + } while (found); +} + +static void +to_search_region_range (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end) +{ + gedit_debug (DEBUG_DOCUMENT); + + if (doc->priv->to_search_region == NULL) + return; + + gtk_text_iter_set_line_offset (start, 0); + gtk_text_iter_forward_to_line_end (end); + + /* + g_print ("+ [%u (%u), %u (%u)]\n", gtk_text_iter_get_line (start), gtk_text_iter_get_offset (start), + gtk_text_iter_get_line (end), gtk_text_iter_get_offset (end)); + */ + + /* Add the region to the refresh region */ + gedit_text_region_add (doc->priv->to_search_region, start, end); + + /* Notify views of the updated highlight region */ + gtk_text_iter_backward_lines (start, doc->priv->num_of_lines_search_text); + gtk_text_iter_forward_lines (end, doc->priv->num_of_lines_search_text); + + g_signal_emit (doc, document_signals [SEARCH_HIGHLIGHT_UPDATED], 0, start, end); +} + +void +_gedit_document_search_region (GeditDocument *doc, + const GtkTextIter *start, + const GtkTextIter *end) +{ + GeditTextRegion *region; + + gedit_debug (DEBUG_DOCUMENT); + + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (start != NULL); + g_return_if_fail (end != NULL); + + if (doc->priv->to_search_region == NULL) + return; + + /* + g_print ("U [%u (%u), %u (%u)]\n", gtk_text_iter_get_line (start), gtk_text_iter_get_offset (start), + gtk_text_iter_get_line (end), gtk_text_iter_get_offset (end)); + */ + + /* get the subregions not yet highlighted */ + region = gedit_text_region_intersect (doc->priv->to_search_region, + start, + end); + if (region) + { + gint i; + GtkTextIter start_search; + GtkTextIter end_search; + + i = gedit_text_region_subregions (region); + gedit_text_region_nth_subregion (region, + 0, + &start_search, + NULL); + + gedit_text_region_nth_subregion (region, + i - 1, + NULL, + &end_search); + + gedit_text_region_destroy (region, TRUE); + + gtk_text_iter_order (&start_search, &end_search); + + search_region (doc, &start_search, &end_search); + + /* remove the just highlighted region */ + gedit_text_region_subtract (doc->priv->to_search_region, + start, + end); + } +} + +static void +insert_text_cb (GeditDocument *doc, + GtkTextIter *pos, + const gchar *text, + gint length) +{ + GtkTextIter start; + GtkTextIter end; + + gedit_debug (DEBUG_DOCUMENT); + + start = end = *pos; + + /* + * pos is invalidated when + * insertion occurs (because the buffer contents change), but the + * default signal handler revalidates it to point to the end of the + * inserted text + */ + gtk_text_iter_backward_chars (&start, + g_utf8_strlen (text, length)); + + to_search_region_range (doc, &start, &end); +} + +static void +delete_range_cb (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end) +{ + GtkTextIter d_start; + GtkTextIter d_end; + + gedit_debug (DEBUG_DOCUMENT); + + d_start = *start; + d_end = *end; + + to_search_region_range (doc, &d_start, &d_end); +} + +void +gedit_document_set_enable_search_highlighting (GeditDocument *doc, + gboolean enable) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + enable = enable != FALSE; + + if ((doc->priv->to_search_region != NULL) == enable) + return; + + if (doc->priv->to_search_region != NULL) + { + /* Disable search highlighting */ + if (doc->priv->found_tag != NULL) + { + /* If needed remove the found_tag */ + GtkTextIter begin; + GtkTextIter end; + + gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc), + &begin, + &end); + + gtk_text_buffer_remove_tag (GTK_TEXT_BUFFER (doc), + doc->priv->found_tag, + &begin, + &end); + } + + gedit_text_region_destroy (doc->priv->to_search_region, + TRUE); + doc->priv->to_search_region = NULL; + } + else + { + doc->priv->to_search_region = gedit_text_region_new (GTK_TEXT_BUFFER (doc)); + if (gedit_document_get_can_search_again (doc)) + { + /* If search_text is not empty, highligth all its occurrences */ + GtkTextIter begin; + GtkTextIter end; + + gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc), + &begin, + &end); + + to_search_region_range (doc, + &begin, + &end); + } + } +} + +gboolean +gedit_document_get_enable_search_highlighting (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE); + + return (doc->priv->to_search_region != NULL); +} + +void +gedit_document_set_newline_type (GeditDocument *doc, + GeditDocumentNewlineType newline_type) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + if (doc->priv->newline_type != newline_type) + { + doc->priv->newline_type = newline_type; + + g_object_notify (G_OBJECT (doc), "newline-type"); + } +} + +GeditDocumentNewlineType +gedit_document_get_newline_type (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), 0); + + return doc->priv->newline_type; +} + +void +_gedit_document_set_mount_operation_factory (GeditDocument *doc, + GeditMountOperationFactory callback, + gpointer userdata) +{ + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + doc->priv->mount_operation_factory = callback; + doc->priv->mount_operation_userdata = userdata; +} + +GMountOperation * +_gedit_document_create_mount_operation (GeditDocument *doc) +{ + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + if (doc->priv->mount_operation_factory == NULL) + return g_mount_operation_new (); + else + return doc->priv->mount_operation_factory (doc, + doc->priv->mount_operation_userdata); +} + +#ifndef ENABLE_GVFS_METADATA +gchar * +gedit_document_get_metadata (GeditDocument *doc, + const gchar *key) +{ + gchar *value = NULL; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + g_return_val_if_fail (key != NULL, NULL); + + if (!gedit_document_is_untitled (doc)) + { + value = gedit_metadata_manager_get (doc->priv->uri, key); + } + + return value; +} + +void +gedit_document_set_metadata (GeditDocument *doc, + const gchar *first_key, + ...) +{ + const gchar *key; + const gchar *value; + va_list var_args; + + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (first_key != NULL); + + if (gedit_document_is_untitled (doc)) + { + /* Can't set metadata for untitled documents */ + return; + } + + va_start (var_args, first_key); + + for (key = first_key; key; key = va_arg (var_args, const gchar *)) + { + value = va_arg (var_args, const gchar *); + + gedit_metadata_manager_set (doc->priv->uri, + key, + value); + } + + va_end (var_args); +} + +#else + +/** + * gedit_document_get_metadata: + * @doc: a #GeditDocument + * @key: name of the key + * + * Gets the metadata assigned to @key. + * + * Returns: the value assigned to @key. + */ +gchar * +gedit_document_get_metadata (GeditDocument *doc, + const gchar *key) +{ + gchar *value = NULL; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + g_return_val_if_fail (key != NULL, NULL); + + if (doc->priv->metadata_info && g_file_info_has_attribute (doc->priv->metadata_info, + key)) + { + value = g_strdup (g_file_info_get_attribute_string (doc->priv->metadata_info, + key)); + } + + return value; +} + +static void +set_attributes_cb (GObject *source, + GAsyncResult *res, + gpointer useless) +{ + g_file_set_attributes_finish (G_FILE (source), + res, + NULL, + NULL); +} + +/** + * gedit_document_set_metadata: + * @doc: a #GeditDocument + * @first_key: name of the first key to set + * @...: value for the first key, followed optionally by more key/value pairs, + * followed by %NULL. + * + * Sets metadata on a document. + */ +void +gedit_document_set_metadata (GeditDocument *doc, + const gchar *first_key, + ...) +{ + const gchar *key; + const gchar *value; + va_list var_args; + GFileInfo *info; + GFile *location; + + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (first_key != NULL); + + info = g_file_info_new (); + + va_start (var_args, first_key); + + for (key = first_key; key; key = va_arg (var_args, const gchar *)) + { + value = va_arg (var_args, const gchar *); + + if (value != NULL) + { + g_file_info_set_attribute_string (info, + key, value); + } + else + { + /* Unset the key */ + g_file_info_set_attribute (info, key, + G_FILE_ATTRIBUTE_TYPE_INVALID, + NULL); + } + } + + va_end (var_args); + + if (doc->priv->metadata_info != NULL) + g_file_info_copy_into (info, doc->priv->metadata_info); + + location = gedit_document_get_location (doc); + + if (location != NULL) + { + g_file_set_attributes_async (location, + info, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT, + NULL, + set_attributes_cb, + NULL); + + g_object_unref (location); + } + + g_object_unref (info); +} +#endif diff --git a/gedit/gedit-document.h b/gedit/gedit-document.h new file mode 100755 index 00000000..cf966b15 --- /dev/null +++ b/gedit/gedit-document.h @@ -0,0 +1,338 @@ +/* + * gedit-document.h + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_DOCUMENT_H__ +#define __GEDIT_DOCUMENT_H__ + +#include +#include +#include + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_DOCUMENT (gedit_document_get_type()) +#define GEDIT_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_DOCUMENT, GeditDocument)) +#define GEDIT_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_DOCUMENT, GeditDocumentClass)) +#define GEDIT_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_DOCUMENT)) +#define GEDIT_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DOCUMENT)) +#define GEDIT_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_DOCUMENT, GeditDocumentClass)) + +#ifdef G_OS_WIN32 +#define GEDIT_METADATA_ATTRIBUTE_POSITION "position" +#define GEDIT_METADATA_ATTRIBUTE_ENCODING "encoding" +#define GEDIT_METADATA_ATTRIBUTE_LANGUAGE "language" +#else +#define GEDIT_METADATA_ATTRIBUTE_POSITION "metadata::gedit-position" +#define GEDIT_METADATA_ATTRIBUTE_ENCODING "metadata::gedit-encoding" +#define GEDIT_METADATA_ATTRIBUTE_LANGUAGE "metadata::gedit-language" +#endif + +typedef enum +{ + GEDIT_DOCUMENT_NEWLINE_TYPE_LF, + GEDIT_DOCUMENT_NEWLINE_TYPE_CR, + GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF +} GeditDocumentNewlineType; + +#ifdef G_OS_WIN32 +#define GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF +#else +#define GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT GEDIT_DOCUMENT_NEWLINE_TYPE_LF +#endif + +typedef enum +{ + GEDIT_SEARCH_DONT_SET_FLAGS = 1 << 0, + GEDIT_SEARCH_ENTIRE_WORD = 1 << 1, + GEDIT_SEARCH_CASE_SENSITIVE = 1 << 2 + +} GeditSearchFlags; + +/** + * GeditDocumentSaveFlags: + * @GEDIT_DOCUMENT_SAVE_IGNORE_MTIME: save file despite external modifications. + * @GEDIT_DOCUMENT_SAVE_IGNORE_BACKUP: write the file directly without attempting to backup. + * @GEDIT_DOCUMENT_SAVE_PRESERVE_BACKUP: preserve previous backup file, needed to support autosaving. + */ +typedef enum +{ + GEDIT_DOCUMENT_SAVE_IGNORE_MTIME = 1 << 0, + GEDIT_DOCUMENT_SAVE_IGNORE_BACKUP = 1 << 1, + GEDIT_DOCUMENT_SAVE_PRESERVE_BACKUP = 1 << 2 +} GeditDocumentSaveFlags; + +/* Private structure type */ +typedef struct _GeditDocumentPrivate GeditDocumentPrivate; + +/* + * Main object structure + */ +typedef struct _GeditDocument GeditDocument; + +struct _GeditDocument +{ + GtkSourceBuffer buffer; + + /*< private > */ + GeditDocumentPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditDocumentClass GeditDocumentClass; + +struct _GeditDocumentClass +{ + GtkSourceBufferClass parent_class; + + /* Signals */ // CHECK: ancora da rivedere + + void (* cursor_moved) (GeditDocument *document); + + /* Document load */ + void (* load) (GeditDocument *document, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create); + + void (* loading) (GeditDocument *document, + goffset size, + goffset total_size); + + void (* loaded) (GeditDocument *document, + const GError *error); + + /* Document save */ + void (* save) (GeditDocument *document, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentSaveFlags flags); + + void (* saving) (GeditDocument *document, + goffset size, + goffset total_size); + + void (* saved) (GeditDocument *document, + const GError *error); + + void (* search_highlight_updated) + (GeditDocument *document, + GtkTextIter *start, + GtkTextIter *end); +}; + + +#define GEDIT_DOCUMENT_ERROR gedit_document_error_quark () + +enum +{ + GEDIT_DOCUMENT_ERROR_EXTERNALLY_MODIFIED, + GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP, + GEDIT_DOCUMENT_ERROR_TOO_BIG, + GEDIT_DOCUMENT_ERROR_ENCODING_AUTO_DETECTION_FAILED, + GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK, + GEDIT_DOCUMENT_NUM_ERRORS +}; + +GQuark gedit_document_error_quark (void); + +GType gedit_document_get_type (void) G_GNUC_CONST; + +GeditDocument *gedit_document_new (void); + +GFile *gedit_document_get_location (GeditDocument *doc); + +gchar *gedit_document_get_uri (GeditDocument *doc); +void gedit_document_set_uri (GeditDocument *doc, + const gchar *uri); + +gchar *gedit_document_get_uri_for_display + (GeditDocument *doc); +gchar *gedit_document_get_short_name_for_display + (GeditDocument *doc); + +void gedit_document_set_short_name_for_display + (GeditDocument *doc, + const gchar *name); + +gchar *gedit_document_get_content_type + (GeditDocument *doc); + +void gedit_document_set_content_type + (GeditDocument *doc, + const gchar *content_type); + +gchar *gedit_document_get_mime_type (GeditDocument *doc); + +gboolean gedit_document_get_readonly (GeditDocument *doc); + +void gedit_document_load (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create); + +gboolean gedit_document_insert_file (GeditDocument *doc, + GtkTextIter *iter, + const gchar *uri, + const GeditEncoding *encoding); + +gboolean gedit_document_load_cancel (GeditDocument *doc); + +void gedit_document_save (GeditDocument *doc, + GeditDocumentSaveFlags flags); + +void gedit_document_save_as (GeditDocument *doc, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentSaveFlags flags); + +gboolean gedit_document_is_untouched (GeditDocument *doc); +gboolean gedit_document_is_untitled (GeditDocument *doc); + +gboolean gedit_document_is_local (GeditDocument *doc); + +gboolean gedit_document_get_deleted (GeditDocument *doc); + +gboolean gedit_document_goto_line (GeditDocument *doc, + gint line); + +gboolean gedit_document_goto_line_offset(GeditDocument *doc, + gint line, + gint line_offset); + +void gedit_document_set_search_text (GeditDocument *doc, + const gchar *text, + guint flags); + +gchar *gedit_document_get_search_text (GeditDocument *doc, + guint *flags); + +gboolean gedit_document_get_can_search_again + (GeditDocument *doc); + +gboolean gedit_document_search_forward (GeditDocument *doc, + const GtkTextIter *start, + const GtkTextIter *end, + GtkTextIter *match_start, + GtkTextIter *match_end); + +gboolean gedit_document_search_backward (GeditDocument *doc, + const GtkTextIter *start, + const GtkTextIter *end, + GtkTextIter *match_start, + GtkTextIter *match_end); + +gint gedit_document_replace_all (GeditDocument *doc, + const gchar *find, + const gchar *replace, + guint flags); + +void gedit_document_set_language (GeditDocument *doc, + GtkSourceLanguage *lang); +GtkSourceLanguage + *gedit_document_get_language (GeditDocument *doc); + +const GeditEncoding + *gedit_document_get_encoding (GeditDocument *doc); + +void gedit_document_set_enable_search_highlighting + (GeditDocument *doc, + gboolean enable); + +gboolean gedit_document_get_enable_search_highlighting + (GeditDocument *doc); + +void gedit_document_set_newline_type (GeditDocument *doc, + GeditDocumentNewlineType newline_type); + +GeditDocumentNewlineType + gedit_document_get_newline_type (GeditDocument *doc); + +gchar *gedit_document_get_metadata (GeditDocument *doc, + const gchar *key); + +void gedit_document_set_metadata (GeditDocument *doc, + const gchar *first_key, + ...); + +/* + * Non exported functions + */ +void _gedit_document_set_readonly (GeditDocument *doc, + gboolean readonly); + +glong _gedit_document_get_seconds_since_last_save_or_load + (GeditDocument *doc); + +/* Note: this is a sync stat: use only on local files */ +gboolean _gedit_document_check_externally_modified + (GeditDocument *doc); + +void _gedit_document_search_region (GeditDocument *doc, + const GtkTextIter *start, + const GtkTextIter *end); + +/* Search macros */ +#define GEDIT_SEARCH_IS_DONT_SET_FLAGS(sflags) ((sflags & GEDIT_SEARCH_DONT_SET_FLAGS) != 0) +#define GEDIT_SEARCH_SET_DONT_SET_FLAGS(sflags,state) ((state == TRUE) ? \ +(sflags |= GEDIT_SEARCH_DONT_SET_FLAGS) : (sflags &= ~GEDIT_SEARCH_DONT_SET_FLAGS)) + +#define GEDIT_SEARCH_IS_ENTIRE_WORD(sflags) ((sflags & GEDIT_SEARCH_ENTIRE_WORD) != 0) +#define GEDIT_SEARCH_SET_ENTIRE_WORD(sflags,state) ((state == TRUE) ? \ +(sflags |= GEDIT_SEARCH_ENTIRE_WORD) : (sflags &= ~GEDIT_SEARCH_ENTIRE_WORD)) + +#define GEDIT_SEARCH_IS_CASE_SENSITIVE(sflags) ((sflags & GEDIT_SEARCH_CASE_SENSITIVE) != 0) +#define GEDIT_SEARCH_SET_CASE_SENSITIVE(sflags,state) ((state == TRUE) ? \ +(sflags |= GEDIT_SEARCH_CASE_SENSITIVE) : (sflags &= ~GEDIT_SEARCH_CASE_SENSITIVE)) + +typedef GMountOperation *(*GeditMountOperationFactory)(GeditDocument *doc, + gpointer userdata); + +void _gedit_document_set_mount_operation_factory + (GeditDocument *doc, + GeditMountOperationFactory callback, + gpointer userdata); +GMountOperation + *_gedit_document_create_mount_operation + (GeditDocument *doc); + +G_END_DECLS + +#endif /* __GEDIT_DOCUMENT_H__ */ diff --git a/gedit/gedit-documents-panel.c b/gedit/gedit-documents-panel.c new file mode 100755 index 00000000..911654b2 --- /dev/null +++ b/gedit/gedit-documents-panel.c @@ -0,0 +1,828 @@ +/* + * gedit-documents-panel.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "gedit-documents-panel.h" +#include "gedit-utils.h" +#include "gedit-notebook.h" + +#include + +#define GEDIT_DOCUMENTS_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_DOCUMENTS_PANEL, \ + GeditDocumentsPanelPrivate)) + +struct _GeditDocumentsPanelPrivate +{ + GeditWindow *window; + + GtkWidget *treeview; + GtkTreeModel *model; + + guint adding_tab : 1; + guint is_reodering : 1; +}; + +G_DEFINE_TYPE(GeditDocumentsPanel, gedit_documents_panel, GTK_TYPE_VBOX) + +enum +{ + PROP_0, + PROP_WINDOW +}; + +enum +{ + PIXBUF_COLUMN, + NAME_COLUMN, + TAB_COLUMN, + N_COLUMNS +}; + +#define MAX_DOC_NAME_LENGTH 60 + +static gchar * +tab_get_name (GeditTab *tab) +{ + GeditDocument *doc; + gchar *name; + gchar *docname; + gchar *tab_name; + + g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL); + + doc = gedit_tab_get_document (tab); + + name = gedit_document_get_short_name_for_display (doc); + + /* Truncate the name so it doesn't get insanely wide. */ + docname = gedit_utils_str_middle_truncate (name, MAX_DOC_NAME_LENGTH); + + if (gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc))) + { + if (gedit_document_get_readonly (doc)) + { + tab_name = g_markup_printf_escaped ("%s [%s]", + docname, + _("Read-Only")); + } + else + { + tab_name = g_markup_printf_escaped ("%s", + docname); + } + } + else + { + if (gedit_document_get_readonly (doc)) + { + tab_name = g_markup_printf_escaped ("%s [%s]", + docname, + _("Read-Only")); + } + else + { + tab_name = g_markup_escape_text (docname, -1); + } + } + + g_free (docname); + g_free (name); + + return tab_name; +} + +static void +get_iter_from_tab (GeditDocumentsPanel *panel, GeditTab *tab, GtkTreeIter *iter) +{ + gint num; + GtkWidget *nb; + GtkTreePath *path; + + nb = _gedit_window_get_notebook (panel->priv->window); + num = gtk_notebook_page_num (GTK_NOTEBOOK (nb), + GTK_WIDGET (tab)); + + path = gtk_tree_path_new_from_indices (num, -1); + gtk_tree_model_get_iter (panel->priv->model, + iter, + path); + gtk_tree_path_free (path); +} + +static void +window_active_tab_changed (GeditWindow *window, + GeditTab *tab, + GeditDocumentsPanel *panel) +{ + g_return_if_fail (tab != NULL); + + if (!_gedit_window_is_removing_tabs (window)) + { + GtkTreeIter iter; + GtkTreeSelection *selection; + + get_iter_from_tab (panel, tab, &iter); + + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE (panel->priv->model), + &iter)) + { + selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (panel->priv->treeview)); + + gtk_tree_selection_select_iter (selection, &iter); + } + } +} + +static void +refresh_list (GeditDocumentsPanel *panel) +{ + /* TODO: refresh the list only if the panel is visible */ + + GList *tabs; + GList *l; + GtkWidget *nb; + GtkListStore *list_store; + GeditTab *active_tab; + + /* g_debug ("refresh_list"); */ + + list_store = GTK_LIST_STORE (panel->priv->model); + + gtk_list_store_clear (list_store); + + active_tab = gedit_window_get_active_tab (panel->priv->window); + + nb = _gedit_window_get_notebook (panel->priv->window); + + tabs = gtk_container_get_children (GTK_CONTAINER (nb)); + l = tabs; + + panel->priv->adding_tab = TRUE; + + while (l != NULL) + { + GdkPixbuf *pixbuf; + gchar *name; + GtkTreeIter iter; + + name = tab_get_name (GEDIT_TAB (l->data)); + pixbuf = _gedit_tab_get_icon (GEDIT_TAB (l->data)); + + /* Add a new row to the model */ + gtk_list_store_append (list_store, &iter); + gtk_list_store_set (list_store, + &iter, + PIXBUF_COLUMN, pixbuf, + NAME_COLUMN, name, + TAB_COLUMN, l->data, + -1); + + g_free (name); + if (pixbuf != NULL) + g_object_unref (pixbuf); + + if (l->data == active_tab) + { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (panel->priv->treeview)); + + gtk_tree_selection_select_iter (selection, &iter); + } + + l = g_list_next (l); + } + + panel->priv->adding_tab = FALSE; + + g_list_free (tabs); +} + +static void +sync_name_and_icon (GeditTab *tab, + GParamSpec *pspec, + GeditDocumentsPanel *panel) +{ + GdkPixbuf *pixbuf; + gchar *name; + GtkTreeIter iter; + + get_iter_from_tab (panel, tab, &iter); + + name = tab_get_name (tab); + pixbuf = _gedit_tab_get_icon (tab); + + gtk_list_store_set (GTK_LIST_STORE (panel->priv->model), + &iter, + PIXBUF_COLUMN, pixbuf, + NAME_COLUMN, name, + TAB_COLUMN, tab, + -1); + + g_free (name); + if (pixbuf != NULL) + g_object_unref (pixbuf); +} + +static void +window_tab_removed (GeditWindow *window, + GeditTab *tab, + GeditDocumentsPanel *panel) +{ + g_signal_handlers_disconnect_by_func (tab, + G_CALLBACK (sync_name_and_icon), + panel); + + if (_gedit_window_is_removing_tabs (window)) + gtk_list_store_clear (GTK_LIST_STORE (panel->priv->model)); + else + refresh_list (panel); +} + +static void +window_tab_added (GeditWindow *window, + GeditTab *tab, + GeditDocumentsPanel *panel) +{ + GtkTreeIter iter; + GtkTreeIter sibling; + GdkPixbuf *pixbuf; + gchar *name; + + g_signal_connect (tab, + "notify::name", + G_CALLBACK (sync_name_and_icon), + panel); + + g_signal_connect (tab, + "notify::state", + G_CALLBACK (sync_name_and_icon), + panel); + + get_iter_from_tab (panel, tab, &sibling); + + panel->priv->adding_tab = TRUE; + + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE (panel->priv->model), + &sibling)) + { + gtk_list_store_insert_after (GTK_LIST_STORE (panel->priv->model), + &iter, + &sibling); + } + else + { + GeditTab *active_tab; + + gtk_list_store_append (GTK_LIST_STORE (panel->priv->model), + &iter); + + active_tab = gedit_window_get_active_tab (panel->priv->window); + + if (tab == active_tab) + { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (panel->priv->treeview)); + + gtk_tree_selection_select_iter (selection, &iter); + } + } + + name = tab_get_name (tab); + pixbuf = _gedit_tab_get_icon (tab); + + gtk_list_store_set (GTK_LIST_STORE (panel->priv->model), + &iter, + PIXBUF_COLUMN, pixbuf, + NAME_COLUMN, name, + TAB_COLUMN, tab, + -1); + + g_free (name); + if (pixbuf != NULL) + g_object_unref (pixbuf); + + panel->priv->adding_tab = FALSE; +} + +static void +window_tabs_reordered (GeditWindow *window, + GeditDocumentsPanel *panel) +{ + if (panel->priv->is_reodering) + return; + + refresh_list (panel); +} + +static void +set_window (GeditDocumentsPanel *panel, + GeditWindow *window) +{ + g_return_if_fail (panel->priv->window == NULL); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + panel->priv->window = g_object_ref (window); + + g_signal_connect (window, + "tab_added", + G_CALLBACK (window_tab_added), + panel); + g_signal_connect (window, + "tab_removed", + G_CALLBACK (window_tab_removed), + panel); + g_signal_connect (window, + "tabs_reordered", + G_CALLBACK (window_tabs_reordered), + panel); + g_signal_connect (window, + "active_tab_changed", + G_CALLBACK (window_active_tab_changed), + panel); +} + +static void +treeview_cursor_changed (GtkTreeView *view, + GeditDocumentsPanel *panel) +{ + GtkTreeIter iter; + GtkTreeSelection *selection; + gpointer tab; + + selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (panel->priv->treeview)); + + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) + { + gtk_tree_model_get (panel->priv->model, + &iter, + TAB_COLUMN, + &tab, + -1); + + if (gedit_window_get_active_tab (panel->priv->window) != tab) + { + gedit_window_set_active_tab (panel->priv->window, + GEDIT_TAB (tab)); + } + } +} + +static void +gedit_documents_panel_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditDocumentsPanel *panel = GEDIT_DOCUMENTS_PANEL (object); + + switch (prop_id) + { + case PROP_WINDOW: + set_window (panel, g_value_get_object (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_documents_panel_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditDocumentsPanel *panel = GEDIT_DOCUMENTS_PANEL (object); + + switch (prop_id) + { + case PROP_WINDOW: + g_value_set_object (value, + GEDIT_DOCUMENTS_PANEL_GET_PRIVATE (panel)->window); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_documents_panel_finalize (GObject *object) +{ + /* GeditDocumentsPanel *tab = GEDIT_DOCUMENTS_PANEL (object); */ + + /* TODO: disconnect signal with window */ + + G_OBJECT_CLASS (gedit_documents_panel_parent_class)->finalize (object); +} + +static void +gedit_documents_panel_dispose (GObject *object) +{ + GeditDocumentsPanel *panel = GEDIT_DOCUMENTS_PANEL (object); + + if (panel->priv->window != NULL) + { + g_object_unref (panel->priv->window); + panel->priv->window = NULL; + } + + G_OBJECT_CLASS (gedit_documents_panel_parent_class)->dispose (object); +} + +static void +gedit_documents_panel_class_init (GeditDocumentsPanelClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_documents_panel_finalize; + object_class->dispose = gedit_documents_panel_dispose; + object_class->get_property = gedit_documents_panel_get_property; + object_class->set_property = gedit_documents_panel_set_property; + + g_object_class_install_property (object_class, + PROP_WINDOW, + g_param_spec_object ("window", + "Window", + "The GeditWindow this GeditDocumentsPanel is associated with", + GEDIT_TYPE_WINDOW, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof (GeditDocumentsPanelPrivate)); +} + +static GtkTreePath * +get_current_path (GeditDocumentsPanel *panel) +{ + gint num; + GtkWidget *nb; + GtkTreePath *path; + + nb = _gedit_window_get_notebook (panel->priv->window); + num = gtk_notebook_get_current_page (GTK_NOTEBOOK (nb)); + + path = gtk_tree_path_new_from_indices (num, -1); + + return path; +} + +static void +menu_position (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + GeditDocumentsPanel *panel) +{ + GtkTreePath *path; + GdkRectangle rect; + gint wx, wy; + GtkRequisition requisition; + GtkWidget *w; + + w = panel->priv->treeview; + + path = get_current_path (panel); + + gtk_tree_view_get_cell_area (GTK_TREE_VIEW (w), + path, + NULL, + &rect); + + wx = rect.x; + wy = rect.y; + + gdk_window_get_origin (w->window, x, y); + + gtk_widget_size_request (GTK_WIDGET (menu), &requisition); + + if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL) + { + *x += w->allocation.x + w->allocation.width - requisition.width - 10; + } + else + { + *x += w->allocation.x + 10; + } + + wy = MAX (*y + 5, *y + wy + 5); + wy = MIN (wy, *y + w->allocation.height - requisition.height - 5); + + *y = wy; + + *push_in = TRUE; +} + +static gboolean +show_popup_menu (GeditDocumentsPanel *panel, + GdkEventButton *event) +{ + GtkWidget *menu; + + menu = gtk_ui_manager_get_widget (gedit_window_get_ui_manager (panel->priv->window), + "/NotebookPopup"); + g_return_val_if_fail (menu != NULL, FALSE); + + if (event != NULL) + { + gtk_menu_popup (GTK_MENU (menu), + NULL, + NULL, + NULL, + NULL, + event->button, + event->time); + } + else + { + gtk_menu_popup (GTK_MENU (menu), + NULL, + NULL, + (GtkMenuPositionFunc) menu_position, + panel, + 0, + gtk_get_current_event_time ()); + + gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE); + } + + return TRUE; +} + +static gboolean +panel_button_press_event (GtkTreeView *treeview, + GdkEventButton *event, + GeditDocumentsPanel *panel) +{ + if ((GDK_BUTTON_PRESS == event->type) && (3 == event->button)) + { + GtkTreePath* path = NULL; + + if (event->window == gtk_tree_view_get_bin_window (treeview)) + { + /* Change the cursor position */ + if (gtk_tree_view_get_path_at_pos (treeview, + event->x, + event->y, + &path, + NULL, + NULL, + NULL)) + { + + gtk_tree_view_set_cursor (treeview, + path, + NULL, + FALSE); + + gtk_tree_path_free (path); + + /* A row exists at mouse position */ + return show_popup_menu (panel, event); + } + } + } + + return FALSE; +} + +static gboolean +panel_popup_menu (GtkWidget *treeview, + GeditDocumentsPanel *panel) +{ + /* Only respond if the treeview is the actual focus */ + if (gtk_window_get_focus (GTK_WINDOW (panel->priv->window)) == treeview) + { + return show_popup_menu (panel, NULL); + } + + return FALSE; +} + +static gboolean +treeview_query_tooltip (GtkWidget *widget, + gint x, + gint y, + gboolean keyboard_tip, + GtkTooltip *tooltip, + gpointer data) +{ + GtkTreeIter iter; + GtkTreeView *tree_view = GTK_TREE_VIEW (widget); + GtkTreeModel *model = gtk_tree_view_get_model (tree_view); + GtkTreePath *path = NULL; + gpointer *tab; + gchar *tip; + + if (keyboard_tip) + { + gtk_tree_view_get_cursor (tree_view, &path, NULL); + + if (path == NULL) + { + return FALSE; + } + } + else + { + gint bin_x, bin_y; + + gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, + x, y, + &bin_x, &bin_y); + + if (!gtk_tree_view_get_path_at_pos (tree_view, + bin_x, bin_y, + &path, + NULL, NULL, NULL)) + { + return FALSE; + } + } + + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, + &iter, + TAB_COLUMN, + &tab, + -1); + + tip = _gedit_tab_get_tooltips (GEDIT_TAB (tab)); + gtk_tooltip_set_markup (tooltip, tip); + + g_free (tip); + gtk_tree_path_free (path); + + return TRUE; +} + +static void +treeview_row_inserted (GtkTreeModel *tree_model, + GtkTreePath *path, + GtkTreeIter *iter, + GeditDocumentsPanel *panel) +{ + GeditTab *tab; + gint *indeces; + GtkWidget *nb; + gint old_position; + gint new_position; + + if (panel->priv->adding_tab) + return; + + tab = gedit_window_get_active_tab (panel->priv->window); + g_return_if_fail (tab != NULL); + + panel->priv->is_reodering = TRUE; + + indeces = gtk_tree_path_get_indices (path); + + /* g_debug ("New Index: %d (path: %s)", indeces[0], gtk_tree_path_to_string (path));*/ + + nb = _gedit_window_get_notebook (panel->priv->window); + + new_position = indeces[0]; + old_position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), + GTK_WIDGET (tab)); + if (new_position > old_position) + new_position = MAX (0, new_position - 1); + + gedit_notebook_reorder_tab (GEDIT_NOTEBOOK (nb), + tab, + new_position); + + panel->priv->is_reodering = FALSE; +} + +static void +gedit_documents_panel_init (GeditDocumentsPanel *panel) +{ + GtkWidget *sw; + GtkTreeViewColumn *column; + GtkCellRenderer *cell; + GtkTreeSelection *selection; + + panel->priv = GEDIT_DOCUMENTS_PANEL_GET_PRIVATE (panel); + + panel->priv->adding_tab = FALSE; + panel->priv->is_reodering = FALSE; + + /* Create the scrolled window */ + sw = gtk_scrolled_window_new (NULL, NULL); + g_return_if_fail (sw != NULL); + + 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_widget_show (sw); + gtk_box_pack_start (GTK_BOX (panel), sw, TRUE, TRUE, 0); + + /* Create the empty model */ + panel->priv->model = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, + GDK_TYPE_PIXBUF, + G_TYPE_STRING, + G_TYPE_POINTER)); + + /* Create the treeview */ + panel->priv->treeview = gtk_tree_view_new_with_model (panel->priv->model); + g_object_unref (G_OBJECT (panel->priv->model)); + gtk_container_add (GTK_CONTAINER (sw), panel->priv->treeview); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (panel->priv->treeview), FALSE); + gtk_tree_view_set_reorderable (GTK_TREE_VIEW (panel->priv->treeview), TRUE); + + g_object_set (panel->priv->treeview, "has-tooltip", TRUE, NULL); + + gtk_widget_show (panel->priv->treeview); + + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_title (column, _("Documents")); + + cell = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_column_pack_start (column, cell, FALSE); + gtk_tree_view_column_add_attribute (column, cell, "pixbuf", PIXBUF_COLUMN); + cell = gtk_cell_renderer_text_new (); + gtk_tree_view_column_pack_start (column, cell, TRUE); + gtk_tree_view_column_add_attribute (column, cell, "markup", NAME_COLUMN); + + gtk_tree_view_append_column (GTK_TREE_VIEW (panel->priv->treeview), + column); + + selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (panel->priv->treeview)); + + gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); + + g_signal_connect (panel->priv->treeview, + "cursor_changed", + G_CALLBACK (treeview_cursor_changed), + panel); + g_signal_connect (panel->priv->treeview, + "button-press-event", + G_CALLBACK (panel_button_press_event), + panel); + g_signal_connect (panel->priv->treeview, + "popup-menu", + G_CALLBACK (panel_popup_menu), + panel); + g_signal_connect (panel->priv->treeview, + "query-tooltip", + G_CALLBACK (treeview_query_tooltip), + NULL); + + g_signal_connect (panel->priv->model, + "row-inserted", + G_CALLBACK (treeview_row_inserted), + panel); +} + +GtkWidget * +gedit_documents_panel_new (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return GTK_WIDGET (g_object_new (GEDIT_TYPE_DOCUMENTS_PANEL, + "window", window, + NULL)); +} diff --git a/gedit/gedit-documents-panel.h b/gedit/gedit-documents-panel.h new file mode 100755 index 00000000..b6191bf8 --- /dev/null +++ b/gedit/gedit-documents-panel.h @@ -0,0 +1,85 @@ +/* + * gedit-documents-panel.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_DOCUMENTS_PANEL_H__ +#define __GEDIT_DOCUMENTS_PANEL_H__ + +#include + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_DOCUMENTS_PANEL (gedit_documents_panel_get_type()) +#define GEDIT_DOCUMENTS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_DOCUMENTS_PANEL, GeditDocumentsPanel)) +#define GEDIT_DOCUMENTS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_DOCUMENTS_PANEL, GeditDocumentsPanelClass)) +#define GEDIT_IS_DOCUMENTS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_DOCUMENTS_PANEL)) +#define GEDIT_IS_DOCUMENTS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DOCUMENTS_PANEL)) +#define GEDIT_DOCUMENTS_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_DOCUMENTS_PANEL, GeditDocumentsPanelClass)) + +/* Private structure type */ +typedef struct _GeditDocumentsPanelPrivate GeditDocumentsPanelPrivate; + +/* + * Main object structure + */ +typedef struct _GeditDocumentsPanel GeditDocumentsPanel; + +struct _GeditDocumentsPanel +{ + GtkVBox vbox; + + /*< private > */ + GeditDocumentsPanelPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditDocumentsPanelClass GeditDocumentsPanelClass; + +struct _GeditDocumentsPanelClass +{ + GtkVBoxClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_documents_panel_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_documents_panel_new (GeditWindow *window); + +G_END_DECLS + +#endif /* __GEDIT_DOCUMENTS_PANEL_H__ */ diff --git a/gedit/gedit-encodings-combo-box.c b/gedit/gedit-encodings-combo-box.c new file mode 100755 index 00000000..1626bb97 --- /dev/null +++ b/gedit/gedit-encodings-combo-box.c @@ -0,0 +1,468 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-encodings-combo-box.c + * This file is part of gedit + * + * Copyright (C) 2003-2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id: gedit-encodings-combo-box.c 6112 2008-01-23 08:26:24Z sfre $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include +#include + +#define ENCODING_KEY "Enconding" + +#define GEDIT_ENCODINGS_COMBO_BOX_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_ENCODINGS_COMBO_BOX, \ + GeditEncodingsComboBoxPrivate)) + +struct _GeditEncodingsComboBoxPrivate +{ + GtkListStore *store; + glong changed_id; + + guint activated_item; + + guint save_mode : 1; +}; + +enum +{ + NAME_COLUMN, + ENCODING_COLUMN, + ADD_COLUMN, + N_COLUMNS +}; + +/* Properties */ +enum +{ + PROP_0, + PROP_SAVE_MODE +}; + + +G_DEFINE_TYPE(GeditEncodingsComboBox, gedit_encodings_combo_box, GTK_TYPE_COMBO_BOX) + +static void update_menu (GeditEncodingsComboBox *combo_box); + +static void +gedit_encodings_combo_box_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditEncodingsComboBox *combo; + + combo = GEDIT_ENCODINGS_COMBO_BOX (object); + + switch (prop_id) + { + case PROP_SAVE_MODE: + combo->priv->save_mode = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_encodings_combo_box_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditEncodingsComboBox *combo; + + combo = GEDIT_ENCODINGS_COMBO_BOX (object); + + switch (prop_id) + { + case PROP_SAVE_MODE: + g_value_set_boolean (value, combo->priv->save_mode); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_encodings_combo_box_dispose (GObject *object) +{ + GeditEncodingsComboBox *combo = GEDIT_ENCODINGS_COMBO_BOX (object); + + if (combo->priv->store != NULL) + { + g_object_unref (combo->priv->store); + combo->priv->store = NULL; + } + + G_OBJECT_CLASS (gedit_encodings_combo_box_parent_class)->dispose (object); +} + +static void +gedit_encodings_combo_box_class_init (GeditEncodingsComboBoxClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->set_property = gedit_encodings_combo_box_set_property; + object_class->get_property = gedit_encodings_combo_box_get_property; + object_class->dispose = gedit_encodings_combo_box_dispose; + + g_object_class_install_property (object_class, + PROP_SAVE_MODE, + g_param_spec_boolean ("save-mode", + "Save Mode", + "Save Mode", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof (GeditEncodingsComboBoxPrivate)); +} + +static void +dialog_response_cb (GtkDialog *dialog, + gint response_id, + GeditEncodingsComboBox *menu) +{ + if (response_id == GTK_RESPONSE_OK) + { + update_menu (menu); + } + + gtk_widget_destroy (GTK_WIDGET (dialog)); +} + +static void +add_or_remove (GeditEncodingsComboBox *menu, + GtkTreeModel *model) +{ + GtkTreeIter iter; + gboolean add_item = FALSE; + + if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (menu), &iter)) + { + gtk_tree_model_get (model, &iter, + ADD_COLUMN, &add_item, + -1); + } + + if (!add_item) + { + menu->priv->activated_item = gtk_combo_box_get_active (GTK_COMBO_BOX (menu)); + } + else + { + GtkWidget *dialog; + + GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menu)); + +#if !GTK_CHECK_VERSION (2, 18, 0) + if (!GTK_WIDGET_TOPLEVEL (toplevel)) +#else + if (!gtk_widget_is_toplevel (toplevel)) +#endif + toplevel = NULL; + + g_signal_handler_block (menu, menu->priv->changed_id); + gtk_combo_box_set_active (GTK_COMBO_BOX (menu), + menu->priv->activated_item); + g_signal_handler_unblock (menu, menu->priv->changed_id); + + dialog = gedit_encodings_dialog_new(); + + if (toplevel != NULL) + { + GtkWindowGroup *wg; + + gtk_window_set_transient_for (GTK_WINDOW (dialog), + GTK_WINDOW (toplevel)); + + wg = GTK_WINDOW (toplevel)->group; + if (wg == NULL) + { + wg = gtk_window_group_new (); + gtk_window_group_add_window (wg, + GTK_WINDOW (toplevel)); + } + + gtk_window_group_add_window (wg, + GTK_WINDOW (dialog)); + } + + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + + g_signal_connect (dialog, + "response", + G_CALLBACK (dialog_response_cb), + menu); + + gtk_widget_show (dialog); + } +} + +static gboolean +separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) +{ + gchar *str; + gboolean ret; + + gtk_tree_model_get (model, iter, NAME_COLUMN, &str, -1); + ret = (str == NULL || *str == '\0'); + g_free (str); + + return ret; +} + +static void +update_menu (GeditEncodingsComboBox *menu) +{ + GtkListStore *store; + GtkTreeIter iter; + GSList *encodings, *l; + gchar *str; + const GeditEncoding *utf8_encoding; + const GeditEncoding *current_encoding; + + store = menu->priv->store; + + /* Unset the previous model */ + g_signal_handler_block (menu, menu->priv->changed_id); + gtk_list_store_clear (store); + gtk_combo_box_set_model (GTK_COMBO_BOX (menu), + NULL); + + utf8_encoding = gedit_encoding_get_utf8 (); + current_encoding = gedit_encoding_get_current (); + + if (!menu->priv->save_mode) + { + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, _("Automatically Detected"), + ENCODING_COLUMN, NULL, + ADD_COLUMN, FALSE, + -1); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, "", + ENCODING_COLUMN, NULL, + ADD_COLUMN, FALSE, + -1); + } + + if (current_encoding != utf8_encoding) + str = gedit_encoding_to_string (utf8_encoding); + else + str = g_strdup_printf (_("Current Locale (%s)"), + gedit_encoding_get_charset (utf8_encoding)); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, str, + ENCODING_COLUMN, utf8_encoding, + ADD_COLUMN, FALSE, + -1); + + g_free (str); + + if ((utf8_encoding != current_encoding) && + (current_encoding != NULL)) + { + str = g_strdup_printf (_("Current Locale (%s)"), + gedit_encoding_get_charset (current_encoding)); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, str, + ENCODING_COLUMN, current_encoding, + ADD_COLUMN, FALSE, + -1); + + g_free (str); + } + + encodings = gedit_prefs_manager_get_shown_in_menu_encodings (); + + for (l = encodings; l != NULL; l = g_slist_next (l)) + { + const GeditEncoding *enc = (const GeditEncoding *)l->data; + + if ((enc != current_encoding) && + (enc != utf8_encoding) && + (enc != NULL)) + { + str = gedit_encoding_to_string (enc); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, str, + ENCODING_COLUMN, enc, + ADD_COLUMN, FALSE, + -1); + + g_free (str); + } + } + + g_slist_free (encodings); + + if (gedit_prefs_manager_shown_in_menu_encodings_can_set ()) + { + gtk_list_store_append (store, &iter); + /* separator */ + gtk_list_store_set (store, &iter, + NAME_COLUMN, "", + ENCODING_COLUMN, NULL, + ADD_COLUMN, FALSE, + -1); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, _("Add or Remove..."), + ENCODING_COLUMN, NULL, + ADD_COLUMN, TRUE, + -1); + } + + /* set the model back */ + gtk_combo_box_set_model (GTK_COMBO_BOX (menu), + GTK_TREE_MODEL (menu->priv->store)); + gtk_combo_box_set_active (GTK_COMBO_BOX (menu), 0); + + g_signal_handler_unblock (menu, menu->priv->changed_id); +} + +static void +gedit_encodings_combo_box_init (GeditEncodingsComboBox *menu) +{ + GtkCellRenderer *text_renderer; + + menu->priv = GEDIT_ENCODINGS_COMBO_BOX_GET_PRIVATE (menu); + + menu->priv->store = gtk_list_store_new (N_COLUMNS, + G_TYPE_STRING, + G_TYPE_POINTER, + G_TYPE_BOOLEAN); + + /* Setup up the cells */ + text_renderer = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (menu), + text_renderer, TRUE); + + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (menu), + text_renderer, + "text", + NAME_COLUMN, + NULL); + + gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (menu), + separator_func, NULL, + NULL); + + menu->priv->changed_id = g_signal_connect (menu, "changed", + G_CALLBACK (add_or_remove), + menu->priv->store); + + update_menu (menu); +} + +GtkWidget * +gedit_encodings_combo_box_new (gboolean save_mode) +{ + return g_object_new (GEDIT_TYPE_ENCODINGS_COMBO_BOX, + "save_mode", save_mode, + NULL); +} + +const GeditEncoding * +gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu) +{ + GtkTreeIter iter; + + g_return_val_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (menu), NULL); + + if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (menu), &iter)) + { + const GeditEncoding *ret; + GtkTreeModel *model; + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (menu)); + + gtk_tree_model_get (model, &iter, + ENCODING_COLUMN, &ret, + -1); + + return ret; + } + + return NULL; +} + +void +gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu, + const GeditEncoding *encoding) +{ + GtkTreeIter iter; + GtkTreeModel *model; + gboolean b; + g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (menu)); + g_return_if_fail (GTK_IS_COMBO_BOX (menu)); + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (menu)); + b = gtk_tree_model_get_iter_first (model, &iter); + + while (b) + { + const GeditEncoding *enc; + + gtk_tree_model_get (model, &iter, + ENCODING_COLUMN, &enc, + -1); + + if (enc == encoding) + { + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (menu), + &iter); + + return; + } + + b = gtk_tree_model_iter_next (model, &iter); + } +} diff --git a/gedit/gedit-encodings-combo-box.h b/gedit/gedit-encodings-combo-box.h new file mode 100755 index 00000000..586f8007 --- /dev/null +++ b/gedit/gedit-encodings-combo-box.h @@ -0,0 +1,78 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-encodings-combo-box.h + * This file is part of gedit + * + * Copyright (C) 2003-2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id: gedit-encodings-option-menu.h 4429 2005-12-12 17:28:04Z pborelli $ + */ + +#ifndef __GEDIT_ENCODINGS_COMBO_BOX_H__ +#define __GEDIT_ENCODINGS_COMBO_BOX_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_ENCODINGS_COMBO_BOX (gedit_encodings_combo_box_get_type ()) +#define GEDIT_ENCODINGS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_ENCODINGS_COMBO_BOX, GeditEncodingsComboBox)) +#define GEDIT_ENCODINGS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_ENCODINGS_COMBO_BOX, GeditEncodingsComboBoxClass)) +#define GEDIT_IS_ENCODINGS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_ENCODINGS_COMBO_BOX)) +#define GEDIT_IS_ENCODINGS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_ENCODINGS_COMBO_BOX)) +#define GEDIT_ENCODINGS_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_ENCODINGS_COMBO_BOX, GeditEncodingsComboBoxClass)) + + +typedef struct _GeditEncodingsComboBox GeditEncodingsComboBox; +typedef struct _GeditEncodingsComboBoxClass GeditEncodingsComboBoxClass; + +typedef struct _GeditEncodingsComboBoxPrivate GeditEncodingsComboBoxPrivate; + +struct _GeditEncodingsComboBox +{ + GtkComboBox parent; + + GeditEncodingsComboBoxPrivate *priv; +}; + +struct _GeditEncodingsComboBoxClass +{ + GtkComboBoxClass parent_class; +}; + +GType gedit_encodings_combo_box_get_type (void) G_GNUC_CONST; + +/* Constructor */ +GtkWidget *gedit_encodings_combo_box_new (gboolean save_mode); + +const GeditEncoding *gedit_encodings_combo_box_get_selected_encoding (GeditEncodingsComboBox *menu); +void gedit_encodings_combo_box_set_selected_encoding (GeditEncodingsComboBox *menu, + const GeditEncoding *encoding); + +G_END_DECLS + +#endif /* __GEDIT_ENCODINGS_COMBO_BOX_H__ */ + + diff --git a/gedit/gedit-encodings.c b/gedit/gedit-encodings.c new file mode 100755 index 00000000..cf97bf56 --- /dev/null +++ b/gedit/gedit-encodings.c @@ -0,0 +1,473 @@ +/* + * gedit-encodings.c + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include + +#include "gedit-encodings.h" + + +struct _GeditEncoding +{ + gint index; + const gchar *charset; + const gchar *name; +}; + +/* + * The original versions of the following tables are taken from profterm + * + * Copyright (C) 2002 Red Hat, Inc. + */ + +typedef enum +{ + + GEDIT_ENCODING_ISO_8859_1, + GEDIT_ENCODING_ISO_8859_2, + GEDIT_ENCODING_ISO_8859_3, + GEDIT_ENCODING_ISO_8859_4, + GEDIT_ENCODING_ISO_8859_5, + GEDIT_ENCODING_ISO_8859_6, + GEDIT_ENCODING_ISO_8859_7, + GEDIT_ENCODING_ISO_8859_8, + GEDIT_ENCODING_ISO_8859_9, + GEDIT_ENCODING_ISO_8859_10, + GEDIT_ENCODING_ISO_8859_13, + GEDIT_ENCODING_ISO_8859_14, + GEDIT_ENCODING_ISO_8859_15, + GEDIT_ENCODING_ISO_8859_16, + + GEDIT_ENCODING_UTF_7, + GEDIT_ENCODING_UTF_16, + GEDIT_ENCODING_UTF_16_BE, + GEDIT_ENCODING_UTF_16_LE, + GEDIT_ENCODING_UTF_32, + GEDIT_ENCODING_UCS_2, + GEDIT_ENCODING_UCS_4, + + GEDIT_ENCODING_ARMSCII_8, + GEDIT_ENCODING_BIG5, + GEDIT_ENCODING_BIG5_HKSCS, + GEDIT_ENCODING_CP_866, + + GEDIT_ENCODING_EUC_JP, + GEDIT_ENCODING_EUC_JP_MS, + GEDIT_ENCODING_CP932, + GEDIT_ENCODING_EUC_KR, + GEDIT_ENCODING_EUC_TW, + + GEDIT_ENCODING_GB18030, + GEDIT_ENCODING_GB2312, + GEDIT_ENCODING_GBK, + GEDIT_ENCODING_GEOSTD8, + + GEDIT_ENCODING_IBM_850, + GEDIT_ENCODING_IBM_852, + GEDIT_ENCODING_IBM_855, + GEDIT_ENCODING_IBM_857, + GEDIT_ENCODING_IBM_862, + GEDIT_ENCODING_IBM_864, + + GEDIT_ENCODING_ISO_2022_JP, + GEDIT_ENCODING_ISO_2022_KR, + GEDIT_ENCODING_ISO_IR_111, + GEDIT_ENCODING_JOHAB, + GEDIT_ENCODING_KOI8_R, + GEDIT_ENCODING_KOI8__R, + GEDIT_ENCODING_KOI8_U, + + GEDIT_ENCODING_SHIFT_JIS, + GEDIT_ENCODING_TCVN, + GEDIT_ENCODING_TIS_620, + GEDIT_ENCODING_UHC, + GEDIT_ENCODING_VISCII, + + GEDIT_ENCODING_WINDOWS_1250, + GEDIT_ENCODING_WINDOWS_1251, + GEDIT_ENCODING_WINDOWS_1252, + GEDIT_ENCODING_WINDOWS_1253, + GEDIT_ENCODING_WINDOWS_1254, + GEDIT_ENCODING_WINDOWS_1255, + GEDIT_ENCODING_WINDOWS_1256, + GEDIT_ENCODING_WINDOWS_1257, + GEDIT_ENCODING_WINDOWS_1258, + + GEDIT_ENCODING_LAST, + + GEDIT_ENCODING_UTF_8, + GEDIT_ENCODING_UNKNOWN + +} GeditEncodingIndex; + +static const GeditEncoding utf8_encoding = { + GEDIT_ENCODING_UTF_8, + "UTF-8", + N_("Unicode") +}; + +/* initialized in gedit_encoding_lazy_init() */ +static GeditEncoding unknown_encoding = { + GEDIT_ENCODING_UNKNOWN, + NULL, + NULL +}; + +static const GeditEncoding encodings [] = { + + { GEDIT_ENCODING_ISO_8859_1, + "ISO-8859-1", N_("Western") }, + { GEDIT_ENCODING_ISO_8859_2, + "ISO-8859-2", N_("Central European") }, + { GEDIT_ENCODING_ISO_8859_3, + "ISO-8859-3", N_("South European") }, + { GEDIT_ENCODING_ISO_8859_4, + "ISO-8859-4", N_("Baltic") }, + { GEDIT_ENCODING_ISO_8859_5, + "ISO-8859-5", N_("Cyrillic") }, + { GEDIT_ENCODING_ISO_8859_6, + "ISO-8859-6", N_("Arabic") }, + { GEDIT_ENCODING_ISO_8859_7, + "ISO-8859-7", N_("Greek") }, + { GEDIT_ENCODING_ISO_8859_8, + "ISO-8859-8", N_("Hebrew Visual") }, + { GEDIT_ENCODING_ISO_8859_9, + "ISO-8859-9", N_("Turkish") }, + { GEDIT_ENCODING_ISO_8859_10, + "ISO-8859-10", N_("Nordic") }, + { GEDIT_ENCODING_ISO_8859_13, + "ISO-8859-13", N_("Baltic") }, + { GEDIT_ENCODING_ISO_8859_14, + "ISO-8859-14", N_("Celtic") }, + { GEDIT_ENCODING_ISO_8859_15, + "ISO-8859-15", N_("Western") }, + { GEDIT_ENCODING_ISO_8859_16, + "ISO-8859-16", N_("Romanian") }, + + { GEDIT_ENCODING_UTF_7, + "UTF-7", N_("Unicode") }, + { GEDIT_ENCODING_UTF_16, + "UTF-16", N_("Unicode") }, + { GEDIT_ENCODING_UTF_16_BE, + "UTF-16BE", N_("Unicode") }, + { GEDIT_ENCODING_UTF_16_LE, + "UTF-16LE", N_("Unicode") }, + { GEDIT_ENCODING_UTF_32, + "UTF-32", N_("Unicode") }, + { GEDIT_ENCODING_UCS_2, + "UCS-2", N_("Unicode") }, + { GEDIT_ENCODING_UCS_4, + "UCS-4", N_("Unicode") }, + + { GEDIT_ENCODING_ARMSCII_8, + "ARMSCII-8", N_("Armenian") }, + { GEDIT_ENCODING_BIG5, + "BIG5", N_("Chinese Traditional") }, + { GEDIT_ENCODING_BIG5_HKSCS, + "BIG5-HKSCS", N_("Chinese Traditional") }, + { GEDIT_ENCODING_CP_866, + "CP866", N_("Cyrillic/Russian") }, + + { GEDIT_ENCODING_EUC_JP, + "EUC-JP", N_("Japanese") }, + { GEDIT_ENCODING_EUC_JP_MS, + "EUC-JP-MS", N_("Japanese") }, + { GEDIT_ENCODING_CP932, + "CP932", N_("Japanese") }, + + { GEDIT_ENCODING_EUC_KR, + "EUC-KR", N_("Korean") }, + { GEDIT_ENCODING_EUC_TW, + "EUC-TW", N_("Chinese Traditional") }, + + { GEDIT_ENCODING_GB18030, + "GB18030", N_("Chinese Simplified") }, + { GEDIT_ENCODING_GB2312, + "GB2312", N_("Chinese Simplified") }, + { GEDIT_ENCODING_GBK, + "GBK", N_("Chinese Simplified") }, + { GEDIT_ENCODING_GEOSTD8, + "GEORGIAN-ACADEMY", N_("Georgian") }, /* FIXME GEOSTD8 ? */ + + { GEDIT_ENCODING_IBM_850, + "IBM850", N_("Western") }, + { GEDIT_ENCODING_IBM_852, + "IBM852", N_("Central European") }, + { GEDIT_ENCODING_IBM_855, + "IBM855", N_("Cyrillic") }, + { GEDIT_ENCODING_IBM_857, + "IBM857", N_("Turkish") }, + { GEDIT_ENCODING_IBM_862, + "IBM862", N_("Hebrew") }, + { GEDIT_ENCODING_IBM_864, + "IBM864", N_("Arabic") }, + + { GEDIT_ENCODING_ISO_2022_JP, + "ISO-2022-JP", N_("Japanese") }, + { GEDIT_ENCODING_ISO_2022_KR, + "ISO-2022-KR", N_("Korean") }, + { GEDIT_ENCODING_ISO_IR_111, + "ISO-IR-111", N_("Cyrillic") }, + { GEDIT_ENCODING_JOHAB, + "JOHAB", N_("Korean") }, + { GEDIT_ENCODING_KOI8_R, + "KOI8R", N_("Cyrillic") }, + { GEDIT_ENCODING_KOI8__R, + "KOI8-R", N_("Cyrillic") }, + { GEDIT_ENCODING_KOI8_U, + "KOI8U", N_("Cyrillic/Ukrainian") }, + + { GEDIT_ENCODING_SHIFT_JIS, + "SHIFT_JIS", N_("Japanese") }, + { GEDIT_ENCODING_TCVN, + "TCVN", N_("Vietnamese") }, + { GEDIT_ENCODING_TIS_620, + "TIS-620", N_("Thai") }, + { GEDIT_ENCODING_UHC, + "UHC", N_("Korean") }, + { GEDIT_ENCODING_VISCII, + "VISCII", N_("Vietnamese") }, + + { GEDIT_ENCODING_WINDOWS_1250, + "WINDOWS-1250", N_("Central European") }, + { GEDIT_ENCODING_WINDOWS_1251, + "WINDOWS-1251", N_("Cyrillic") }, + { GEDIT_ENCODING_WINDOWS_1252, + "WINDOWS-1252", N_("Western") }, + { GEDIT_ENCODING_WINDOWS_1253, + "WINDOWS-1253", N_("Greek") }, + { GEDIT_ENCODING_WINDOWS_1254, + "WINDOWS-1254", N_("Turkish") }, + { GEDIT_ENCODING_WINDOWS_1255, + "WINDOWS-1255", N_("Hebrew") }, + { GEDIT_ENCODING_WINDOWS_1256, + "WINDOWS-1256", N_("Arabic") }, + { GEDIT_ENCODING_WINDOWS_1257, + "WINDOWS-1257", N_("Baltic") }, + { GEDIT_ENCODING_WINDOWS_1258, + "WINDOWS-1258", N_("Vietnamese") } +}; + +static void +gedit_encoding_lazy_init (void) +{ + static gboolean initialized = FALSE; + const gchar *locale_charset; + + if (initialized) + return; + + if (g_get_charset (&locale_charset) == FALSE) + { + unknown_encoding.charset = g_strdup (locale_charset); + } + + initialized = TRUE; +} + +const GeditEncoding * +gedit_encoding_get_from_charset (const gchar *charset) +{ + gint i; + + g_return_val_if_fail (charset != NULL, NULL); + + gedit_encoding_lazy_init (); + + if (charset == NULL) + return NULL; + + if (g_ascii_strcasecmp (charset, "UTF-8") == 0) + return gedit_encoding_get_utf8 (); + + i = 0; + while (i < GEDIT_ENCODING_LAST) + { + if (g_ascii_strcasecmp (charset, encodings[i].charset) == 0) + return &encodings[i]; + + ++i; + } + + if (unknown_encoding.charset != NULL) + { + if (g_ascii_strcasecmp (charset, unknown_encoding.charset) == 0) + return &unknown_encoding; + } + + return NULL; +} + +const GeditEncoding * +gedit_encoding_get_from_index (gint idx) +{ + g_return_val_if_fail (idx >= 0, NULL); + + if (idx >= GEDIT_ENCODING_LAST) + return NULL; + + gedit_encoding_lazy_init (); + + return &encodings[idx]; +} + +const GeditEncoding * +gedit_encoding_get_utf8 (void) +{ + gedit_encoding_lazy_init (); + + return &utf8_encoding; +} + +const GeditEncoding * +gedit_encoding_get_current (void) +{ + static gboolean initialized = FALSE; + static const GeditEncoding *locale_encoding = NULL; + + const gchar *locale_charset; + + gedit_encoding_lazy_init (); + + if (initialized != FALSE) + return locale_encoding; + + if (g_get_charset (&locale_charset) == FALSE) + { + g_return_val_if_fail (locale_charset != NULL, &utf8_encoding); + + locale_encoding = gedit_encoding_get_from_charset (locale_charset); + } + else + { + locale_encoding = &utf8_encoding; + } + + if (locale_encoding == NULL) + { + locale_encoding = &unknown_encoding; + } + + g_return_val_if_fail (locale_encoding != NULL, NULL); + + initialized = TRUE; + + return locale_encoding; +} + +gchar * +gedit_encoding_to_string (const GeditEncoding* enc) +{ + g_return_val_if_fail (enc != NULL, NULL); + + gedit_encoding_lazy_init (); + + g_return_val_if_fail (enc->charset != NULL, NULL); + + if (enc->name != NULL) + { + return g_strdup_printf ("%s (%s)", _(enc->name), enc->charset); + } + else + { + if (g_ascii_strcasecmp (enc->charset, "ANSI_X3.4-1968") == 0) + return g_strdup_printf ("US-ASCII (%s)", enc->charset); + else + return g_strdup (enc->charset); + } +} + +const gchar * +gedit_encoding_get_charset (const GeditEncoding* enc) +{ + g_return_val_if_fail (enc != NULL, NULL); + + gedit_encoding_lazy_init (); + + g_return_val_if_fail (enc->charset != NULL, NULL); + + return enc->charset; +} + +const gchar * +gedit_encoding_get_name (const GeditEncoding* enc) +{ + g_return_val_if_fail (enc != NULL, NULL); + + gedit_encoding_lazy_init (); + + return (enc->name == NULL) ? _("Unknown") : _(enc->name); +} + +/* These are to make language bindings happy. Since Encodings are + * const, copy() just returns the same pointer and fres() doesn't + * do nothing */ + +GeditEncoding * +gedit_encoding_copy (const GeditEncoding *enc) +{ + g_return_val_if_fail (enc != NULL, NULL); + + return (GeditEncoding *) enc; +} + +void +gedit_encoding_free (GeditEncoding *enc) +{ + g_return_if_fail (enc != NULL); +} + +/** + * gedit_encoding_get_type: + * + * Retrieves the GType object which is associated with the + * #GeditEncoding class. + * + * Return value: the GType associated with #GeditEncoding. + **/ +GType +gedit_encoding_get_type (void) +{ + static GType our_type = 0; + + if (!our_type) + our_type = g_boxed_type_register_static ( + "GeditEncoding", + (GBoxedCopyFunc) gedit_encoding_copy, + (GBoxedFreeFunc) gedit_encoding_free); + + return our_type; +} + diff --git a/gedit/gedit-encodings.h b/gedit/gedit-encodings.h new file mode 100755 index 00000000..7e0aa8d2 --- /dev/null +++ b/gedit/gedit-encodings.h @@ -0,0 +1,62 @@ +/* + * gedit-encodings.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_ENCODINGS_H__ +#define __GEDIT_ENCODINGS_H__ + +#include +#include + +G_BEGIN_DECLS + +typedef struct _GeditEncoding GeditEncoding; + +#define GEDIT_TYPE_ENCODING (gedit_encoding_get_type ()) + +GType gedit_encoding_get_type (void) G_GNUC_CONST; + +const GeditEncoding *gedit_encoding_get_from_charset (const gchar *charset); +const GeditEncoding *gedit_encoding_get_from_index (gint index); + +gchar *gedit_encoding_to_string (const GeditEncoding *enc); + +const gchar *gedit_encoding_get_name (const GeditEncoding *enc); +const gchar *gedit_encoding_get_charset (const GeditEncoding *enc); + +const GeditEncoding *gedit_encoding_get_utf8 (void); +const GeditEncoding *gedit_encoding_get_current (void); + +/* These should not be used, they are just to make python bindings happy */ +GeditEncoding *gedit_encoding_copy (const GeditEncoding *enc); +void gedit_encoding_free (GeditEncoding *enc); + +G_END_DECLS + +#endif /* __GEDIT_ENCODINGS_H__ */ diff --git a/gedit/gedit-enum-types.c.template b/gedit/gedit-enum-types.c.template new file mode 100755 index 00000000..7a67ac79 --- /dev/null +++ b/gedit/gedit-enum-types.c.template @@ -0,0 +1,39 @@ +/*** BEGIN file-header ***/ +#include "gedit-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 the_type = 0; + + if (the_type == 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 } + }; + the_type = g_@type@_register_static ( + g_intern_static_string ("@EnumName@"), + values); + } + return the_type; +} + +/*** END value-tail ***/ diff --git a/gedit/gedit-enum-types.h.template b/gedit/gedit-enum-types.h.template new file mode 100755 index 00000000..78f39ce8 --- /dev/null +++ b/gedit/gedit-enum-types.h.template @@ -0,0 +1,27 @@ +/*** BEGIN file-header ***/ +#ifndef __GEDIT_ENUM_TYPES_H__ +#define __GEDIT_ENUM_TYPES_H__ + +#include + +G_BEGIN_DECLS + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* Enumerations from "@filename@" */ + +/*** END file-production ***/ + +/*** BEGIN enumeration-production ***/ +#define GEDIT_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) +GType @enum_name@_get_type (void) G_GNUC_CONST; + +/*** END enumeration-production ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* __GEDIT_ENUM_TYPES_H__ */ +/*** END file-tail ***/ + diff --git a/gedit/gedit-file-chooser-dialog.c b/gedit/gedit-file-chooser-dialog.c new file mode 100755 index 00000000..94858338 --- /dev/null +++ b/gedit/gedit-file-chooser-dialog.c @@ -0,0 +1,560 @@ +/* + * gedit-file-chooser-dialog.c + * This file is part of gedit + * + * Copyright (C) 2005-2007 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +/* TODO: Override set_extra_widget */ +/* TODO: add encoding property */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include +#include + +#include "gedit-file-chooser-dialog.h" +#include "gedit-encodings-combo-box.h" +#include "gedit-language-manager.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-debug.h" +#include "gedit-enum-types.h" + +#define GEDIT_FILE_CHOOSER_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_FILE_CHOOSER_DIALOG, GeditFileChooserDialogPrivate)) + +#define ALL_FILES _("All Files") +#define ALL_TEXT_FILES _("All Text Files") + +struct _GeditFileChooserDialogPrivate +{ + GtkWidget *option_menu; + GtkWidget *extra_widget; + + GtkWidget *newline_label; + GtkWidget *newline_combo; + GtkListStore *newline_store; +}; + +G_DEFINE_TYPE(GeditFileChooserDialog, gedit_file_chooser_dialog, GTK_TYPE_FILE_CHOOSER_DIALOG) + +static void +gedit_file_chooser_dialog_class_init (GeditFileChooserDialogClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof(GeditFileChooserDialogPrivate)); +} + +static void +create_option_menu (GeditFileChooserDialog *dialog) +{ + GtkWidget *label; + GtkWidget *menu; + + label = gtk_label_new_with_mnemonic (_("C_haracter Encoding:")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + menu = gedit_encodings_combo_box_new ( + gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE); + + gtk_label_set_mnemonic_widget (GTK_LABEL (label), menu); + + gtk_box_pack_start (GTK_BOX (dialog->priv->extra_widget), + label, + FALSE, + TRUE, + 0); + + gtk_box_pack_start (GTK_BOX (dialog->priv->extra_widget), + menu, + TRUE, + TRUE, + 0); + + gtk_widget_show (label); + gtk_widget_show (menu); + + dialog->priv->option_menu = menu; +} + +static void +update_newline_visibility (GeditFileChooserDialog *dialog) +{ + if (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE) + { + gtk_widget_show (dialog->priv->newline_label); + gtk_widget_show (dialog->priv->newline_combo); + } + else + { + gtk_widget_hide (dialog->priv->newline_label); + gtk_widget_hide (dialog->priv->newline_combo); + } +} + +static void +newline_combo_append (GtkComboBox *combo, + GtkListStore *store, + GtkTreeIter *iter, + const gchar *label, + GeditDocumentNewlineType newline_type) +{ + gtk_list_store_append (store, iter); + gtk_list_store_set (store, iter, 0, label, 1, newline_type, -1); + + if (newline_type == GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT) + { + gtk_combo_box_set_active_iter (combo, iter); + } +} + +static void +create_newline_combo (GeditFileChooserDialog *dialog) +{ + GtkWidget *label, *combo; + GtkListStore *store; + GtkCellRenderer *renderer; + GtkTreeIter iter; + + label = gtk_label_new_with_mnemonic (_("L_ine Ending:")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + store = gtk_list_store_new (2, G_TYPE_STRING, GEDIT_TYPE_DOCUMENT_NEWLINE_TYPE); + combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); + renderer = gtk_cell_renderer_text_new (); + + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), + renderer, + TRUE); + + gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), + renderer, + "text", + 0); + + newline_combo_append (GTK_COMBO_BOX (combo), + store, + &iter, + _("Unix/Linux"), + GEDIT_DOCUMENT_NEWLINE_TYPE_LF); + + newline_combo_append (GTK_COMBO_BOX (combo), + store, + &iter, + _("Mac OS Classic"), + GEDIT_DOCUMENT_NEWLINE_TYPE_CR); + + newline_combo_append (GTK_COMBO_BOX (combo), + store, + &iter, + _("Windows"), + GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF); + + gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); + + gtk_box_pack_start (GTK_BOX (dialog->priv->extra_widget), + label, + FALSE, + TRUE, + 0); + + gtk_box_pack_start (GTK_BOX (dialog->priv->extra_widget), + combo, + TRUE, + TRUE, + 0); + + dialog->priv->newline_combo = combo; + dialog->priv->newline_label = label; + dialog->priv->newline_store = store; + + update_newline_visibility (dialog); +} + +static void +create_extra_widget (GeditFileChooserDialog *dialog) +{ + dialog->priv->extra_widget = gtk_hbox_new (FALSE, 6); + + gtk_widget_show (dialog->priv->extra_widget); + + create_option_menu (dialog); + create_newline_combo (dialog); + + gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), + dialog->priv->extra_widget); + +} + +static void +action_changed (GeditFileChooserDialog *dialog, + GParamSpec *pspec, + gpointer data) +{ + GtkFileChooserAction action; + + action = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)); + + switch (action) + { + case GTK_FILE_CHOOSER_ACTION_OPEN: + g_object_set (dialog->priv->option_menu, + "save_mode", FALSE, + NULL); + gtk_widget_show (dialog->priv->option_menu); + break; + case GTK_FILE_CHOOSER_ACTION_SAVE: + g_object_set (dialog->priv->option_menu, + "save_mode", TRUE, + NULL); + gtk_widget_show (dialog->priv->option_menu); + break; + default: + gtk_widget_hide (dialog->priv->option_menu); + } + + update_newline_visibility (dialog); +} + +static void +filter_changed (GeditFileChooserDialog *dialog, + GParamSpec *pspec, + gpointer data) +{ + GtkFileFilter *filter; + + if (!gedit_prefs_manager_active_file_filter_can_set ()) + return; + + filter = gtk_file_chooser_get_filter (GTK_FILE_CHOOSER (dialog)); + if (filter != NULL) + { + const gchar *name; + gint id = 0; + + name = gtk_file_filter_get_name (filter); + g_return_if_fail (name != NULL); + + if (strcmp (name, ALL_TEXT_FILES) == 0) + id = 1; + + gedit_debug_message (DEBUG_COMMANDS, "Active filter: %s (%d)", name, id); + + gedit_prefs_manager_set_active_file_filter (id); + } +} + +/* FIXME: use globs too - Paolo (Aug. 27, 2007) */ +static gboolean +all_text_files_filter (const GtkFileFilterInfo *filter_info, + gpointer data) +{ + static GSList *known_mime_types = NULL; + GSList *mime_types; + + if (known_mime_types == NULL) + { + GtkSourceLanguageManager *lm; + const gchar * const *languages; + + lm = gedit_get_language_manager (); + languages = gtk_source_language_manager_get_language_ids (lm); + + while ((languages != NULL) && (*languages != NULL)) + { + gchar **mime_types; + gint i; + GtkSourceLanguage *lang; + + lang = gtk_source_language_manager_get_language (lm, *languages); + g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE (lang), FALSE); + ++languages; + + mime_types = gtk_source_language_get_mime_types (lang); + if (mime_types == NULL) + continue; + + for (i = 0; mime_types[i] != NULL; i++) + { + if (!g_content_type_is_a (mime_types[i], "text/plain")) + { + gedit_debug_message (DEBUG_COMMANDS, + "Mime-type %s is not related to text/plain", + mime_types[i]); + + known_mime_types = g_slist_prepend (known_mime_types, + g_strdup (mime_types[i])); + } + } + + g_strfreev (mime_types); + } + + /* known_mime_types always has "text/plain" as first item" */ + known_mime_types = g_slist_prepend (known_mime_types, g_strdup ("text/plain")); + } + + /* known mime_types contains "text/plain" and then the list of mime-types unrelated to "text/plain" + * that gedit recognizes */ + + if (filter_info->mime_type == NULL) + return FALSE; + + /* + * The filter is matching: + * - the mime-types beginning with "text/" + * - the mime-types inheriting from a known mime-type (note the text/plain is + * the first known mime-type) + */ + + if (strncmp (filter_info->mime_type, "text/", 5) == 0) + return TRUE; + + mime_types = known_mime_types; + while (mime_types != NULL) + { + if (g_content_type_is_a (filter_info->mime_type, (const gchar*)mime_types->data)) + return TRUE; + + mime_types = g_slist_next (mime_types); + } + + return FALSE; +} + +static void +gedit_file_chooser_dialog_init (GeditFileChooserDialog *dialog) +{ + dialog->priv = GEDIT_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog); +} + +static GtkWidget * +gedit_file_chooser_dialog_new_valist (const gchar *title, + GtkWindow *parent, + GtkFileChooserAction action, + const GeditEncoding *encoding, + const gchar *first_button_text, + va_list varargs) +{ + GtkWidget *result; + const char *button_text = first_button_text; + gint response_id; + GtkFileFilter *filter; + gint active_filter; + + g_return_val_if_fail (parent != NULL, NULL); + + result = g_object_new (GEDIT_TYPE_FILE_CHOOSER_DIALOG, + "title", title, + "file-system-backend", NULL, + "local-only", FALSE, + "action", action, + "select-multiple", action == GTK_FILE_CHOOSER_ACTION_OPEN, + NULL); + + create_extra_widget (GEDIT_FILE_CHOOSER_DIALOG (result)); + + g_signal_connect (result, + "notify::action", + G_CALLBACK (action_changed), + NULL); + + if (encoding != NULL) + gedit_encodings_combo_box_set_selected_encoding ( + GEDIT_ENCODINGS_COMBO_BOX (GEDIT_FILE_CHOOSER_DIALOG (result)->priv->option_menu), + encoding); + + active_filter = gedit_prefs_manager_get_active_file_filter (); + gedit_debug_message (DEBUG_COMMANDS, "Active filter: %d", active_filter); + + /* Filters */ + filter = gtk_file_filter_new (); + + gtk_file_filter_set_name (filter, ALL_FILES); + gtk_file_filter_add_pattern (filter, "*"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (result), filter); + + if (active_filter != 1) + { + /* Make this filter the default */ + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (result), filter); + } + + filter = gtk_file_filter_new (); + gtk_file_filter_set_name (filter, ALL_TEXT_FILES); + gtk_file_filter_add_custom (filter, + GTK_FILE_FILTER_MIME_TYPE, + all_text_files_filter, + NULL, + NULL); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (result), filter); + + if (active_filter == 1) + { + /* Make this filter the default */ + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (result), filter); + } + + g_signal_connect (result, + "notify::filter", + G_CALLBACK (filter_changed), + NULL); + + gtk_window_set_transient_for (GTK_WINDOW (result), parent); + gtk_window_set_destroy_with_parent (GTK_WINDOW (result), TRUE); + + while (button_text) + { + response_id = va_arg (varargs, gint); + + gtk_dialog_add_button (GTK_DIALOG (result), button_text, response_id); + if ((response_id == GTK_RESPONSE_OK) || + (response_id == GTK_RESPONSE_ACCEPT) || + (response_id == GTK_RESPONSE_YES) || + (response_id == GTK_RESPONSE_APPLY)) + gtk_dialog_set_default_response (GTK_DIALOG (result), response_id); + + button_text = va_arg (varargs, const gchar *); + } + + return result; +} + +/** + * gedit_file_chooser_dialog_new: + * @title: Title of the dialog, or %NULL + * @parent: Transient parent of the dialog, or %NULL + * @action: Open or save mode for the dialog + * @first_button_text: stock ID or text to go in the first button, or %NULL + * @Varargs: response ID for the first button, then additional (button, id) pairs, ending with %NULL + * + * Creates a new #GeditFileChooserDialog. This function is analogous to + * gtk_dialog_new_with_buttons(). + * + * Return value: a new #GeditFileChooserDialog + * + **/ +GtkWidget * +gedit_file_chooser_dialog_new (const gchar *title, + GtkWindow *parent, + GtkFileChooserAction action, + const GeditEncoding *encoding, + const gchar *first_button_text, + ...) +{ + GtkWidget *result; + va_list varargs; + + va_start (varargs, first_button_text); + result = gedit_file_chooser_dialog_new_valist (title, parent, action, + encoding, first_button_text, + varargs); + va_end (varargs); + + return result; +} + +void +gedit_file_chooser_dialog_set_encoding (GeditFileChooserDialog *dialog, + const GeditEncoding *encoding) +{ + g_return_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog)); + g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (dialog->priv->option_menu)); + + gedit_encodings_combo_box_set_selected_encoding ( + GEDIT_ENCODINGS_COMBO_BOX (dialog->priv->option_menu), + encoding); +} + +const GeditEncoding * +gedit_file_chooser_dialog_get_encoding (GeditFileChooserDialog *dialog) +{ + g_return_val_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog), NULL); + g_return_val_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (dialog->priv->option_menu), NULL); + g_return_val_if_fail ((gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_OPEN || + gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE), NULL); + + return gedit_encodings_combo_box_get_selected_encoding ( + GEDIT_ENCODINGS_COMBO_BOX (dialog->priv->option_menu)); +} + +void +gedit_file_chooser_dialog_set_newline_type (GeditFileChooserDialog *dialog, + GeditDocumentNewlineType newline_type) +{ + GtkTreeIter iter; + GtkTreeModel *model; + + g_return_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog)); + g_return_if_fail (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE); + + model = GTK_TREE_MODEL (dialog->priv->newline_store); + + if (!gtk_tree_model_get_iter_first (model, &iter)) + { + return; + } + + do + { + GeditDocumentNewlineType nt; + + gtk_tree_model_get (model, &iter, 1, &nt, -1); + + if (newline_type == nt) + { + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->priv->newline_combo), + &iter); + break; + } + } while (gtk_tree_model_iter_next (model, &iter)); +} + +GeditDocumentNewlineType +gedit_file_chooser_dialog_get_newline_type (GeditFileChooserDialog *dialog) +{ + GtkTreeIter iter; + GeditDocumentNewlineType newline_type; + + g_return_val_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog), GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT); + g_return_val_if_fail (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE, + GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT); + + gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->priv->newline_combo), + &iter); + + gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->newline_store), + &iter, + 1, + &newline_type, + -1); + + return newline_type; +} diff --git a/gedit/gedit-file-chooser-dialog.h b/gedit/gedit-file-chooser-dialog.h new file mode 100755 index 00000000..090045c5 --- /dev/null +++ b/gedit/gedit-file-chooser-dialog.h @@ -0,0 +1,89 @@ +/* + * gedit-file-chooser-dialog.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_FILE_CHOOSER_DIALOG_H__ +#define __GEDIT_FILE_CHOOSER_DIALOG_H__ + +#include + +#include +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_FILE_CHOOSER_DIALOG (gedit_file_chooser_dialog_get_type ()) +#define GEDIT_FILE_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_CHOOSER_DIALOG, GeditFileChooserDialog)) +#define GEDIT_FILE_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_CHOOSER_DIALOG, GeditFileChooserDialogClass)) +#define GEDIT_IS_FILE_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_CHOOSER_DIALOG)) +#define GEDIT_IS_FILE_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_CHOOSER_DIALOG)) +#define GEDIT_FILE_CHOOSER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_CHOOSER_DIALOG, GeditFileChooserDialogClass)) + +typedef struct _GeditFileChooserDialog GeditFileChooserDialog; +typedef struct _GeditFileChooserDialogClass GeditFileChooserDialogClass; + +typedef struct _GeditFileChooserDialogPrivate GeditFileChooserDialogPrivate; + +struct _GeditFileChooserDialogClass +{ + GtkFileChooserDialogClass parent_class; +}; + +struct _GeditFileChooserDialog +{ + GtkFileChooserDialog parent_instance; + + GeditFileChooserDialogPrivate *priv; +}; + +GType gedit_file_chooser_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_file_chooser_dialog_new (const gchar *title, + GtkWindow *parent, + GtkFileChooserAction action, + const GeditEncoding *encoding, + const gchar *first_button_text, + ...); + +void gedit_file_chooser_dialog_set_encoding (GeditFileChooserDialog *dialog, + const GeditEncoding *encoding); + +const GeditEncoding + *gedit_file_chooser_dialog_get_encoding (GeditFileChooserDialog *dialog); + +void gedit_file_chooser_dialog_set_newline_type (GeditFileChooserDialog *dialog, + GeditDocumentNewlineType newline_type); + +GeditDocumentNewlineType + gedit_file_chooser_dialog_get_newline_type (GeditFileChooserDialog *dialog); + +G_END_DECLS + +#endif /* __GEDIT_FILE_CHOOSER_DIALOG_H__ */ diff --git a/gedit/gedit-gio-document-loader.c b/gedit/gedit-gio-document-loader.c new file mode 100755 index 00000000..73cfe113 --- /dev/null +++ b/gedit/gedit-gio-document-loader.c @@ -0,0 +1,708 @@ +/* + * gedit-gio-document-loader.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2007 - Paolo Maggi, Steve Frécinaux + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2008. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "gedit-gio-document-loader.h" +#include "gedit-document-output-stream.h" +#include "gedit-smart-charset-converter.h" +#include "gedit-prefs-manager.h" +#include "gedit-debug.h" +#include "gedit-utils.h" + +#ifndef ENABLE_GVFS_METADATA +#include "gedit-metadata-manager.h" +#endif + +typedef struct +{ + GeditGioDocumentLoader *loader; + GCancellable *cancellable; + + gssize read; + gboolean tried_mount; +} AsyncData; + +#define READ_CHUNK_SIZE 8192 +#define REMOTE_QUERY_ATTRIBUTES G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," \ + G_FILE_ATTRIBUTE_STANDARD_TYPE "," \ + G_FILE_ATTRIBUTE_TIME_MODIFIED "," \ + G_FILE_ATTRIBUTE_STANDARD_SIZE "," \ + G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "," \ + GEDIT_METADATA_ATTRIBUTE_ENCODING + +#define GEDIT_GIO_DOCUMENT_LOADER_GET_PRIVATE(object) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_GIO_DOCUMENT_LOADER, \ + GeditGioDocumentLoaderPrivate)) + +static void gedit_gio_document_loader_load (GeditDocumentLoader *loader); +static gboolean gedit_gio_document_loader_cancel (GeditDocumentLoader *loader); +static goffset gedit_gio_document_loader_get_bytes_read (GeditDocumentLoader *loader); + +static void open_async_read (AsyncData *async); + +struct _GeditGioDocumentLoaderPrivate +{ + /* Info on the current file */ + GFile *gfile; + + goffset bytes_read; + + /* Handle for remote files */ + GCancellable *cancellable; + GInputStream *stream; + GOutputStream *output; + GeditSmartCharsetConverter *converter; + + gchar buffer[READ_CHUNK_SIZE]; + + GError *error; +}; + +G_DEFINE_TYPE(GeditGioDocumentLoader, gedit_gio_document_loader, GEDIT_TYPE_DOCUMENT_LOADER) + +static void +gedit_gio_document_loader_dispose (GObject *object) +{ + GeditGioDocumentLoaderPrivate *priv; + + priv = GEDIT_GIO_DOCUMENT_LOADER (object)->priv; + + if (priv->cancellable != NULL) + { + g_cancellable_cancel (priv->cancellable); + g_object_unref (priv->cancellable); + priv->cancellable = NULL; + } + + if (priv->stream != NULL) + { + g_object_unref (priv->stream); + priv->stream = NULL; + } + + if (priv->output != NULL) + { + g_object_unref (priv->output); + priv->output = NULL; + } + + if (priv->converter != NULL) + { + g_object_unref (priv->converter); + priv->converter = NULL; + } + + if (priv->gfile != NULL) + { + g_object_unref (priv->gfile); + priv->gfile = NULL; + } + + if (priv->error != NULL) + { + g_error_free (priv->error); + priv->error = NULL; + } + + G_OBJECT_CLASS (gedit_gio_document_loader_parent_class)->dispose (object); +} + +static void +gedit_gio_document_loader_class_init (GeditGioDocumentLoaderClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GeditDocumentLoaderClass *loader_class = GEDIT_DOCUMENT_LOADER_CLASS (klass); + + object_class->dispose = gedit_gio_document_loader_dispose; + + loader_class->load = gedit_gio_document_loader_load; + loader_class->cancel = gedit_gio_document_loader_cancel; + loader_class->get_bytes_read = gedit_gio_document_loader_get_bytes_read; + + g_type_class_add_private (object_class, sizeof(GeditGioDocumentLoaderPrivate)); +} + +static void +gedit_gio_document_loader_init (GeditGioDocumentLoader *gvloader) +{ + gvloader->priv = GEDIT_GIO_DOCUMENT_LOADER_GET_PRIVATE (gvloader); + + gvloader->priv->converter = NULL; + gvloader->priv->error = NULL; +} + +static AsyncData * +async_data_new (GeditGioDocumentLoader *gvloader) +{ + AsyncData *async; + + async = g_slice_new (AsyncData); + async->loader = gvloader; + async->cancellable = g_object_ref (gvloader->priv->cancellable); + async->tried_mount = FALSE; + + return async; +} + +static void +async_data_free (AsyncData *async) +{ + g_object_unref (async->cancellable); + g_slice_free (AsyncData, async); +} + +static const GeditEncoding * +get_metadata_encoding (GeditDocumentLoader *loader) +{ + const GeditEncoding *enc = NULL; + +#ifndef ENABLE_GVFS_METADATA + gchar *charset; + const gchar *uri; + + uri = gedit_document_loader_get_uri (loader); + + charset = gedit_metadata_manager_get (uri, "encoding"); + + if (charset == NULL) + return NULL; + + enc = gedit_encoding_get_from_charset (charset); + + g_free (charset); +#else + GFileInfo *info; + + info = gedit_document_loader_get_info (loader); + + /* check if the encoding was set in the metadata */ + if (g_file_info_has_attribute (info, GEDIT_METADATA_ATTRIBUTE_ENCODING)) + { + const gchar *charset; + + charset = g_file_info_get_attribute_string (info, + GEDIT_METADATA_ATTRIBUTE_ENCODING); + + if (charset == NULL) + return NULL; + + enc = gedit_encoding_get_from_charset (charset); + } +#endif + + return enc; +} + +static void +remote_load_completed_or_failed (GeditGioDocumentLoader *loader, AsyncData *async) +{ + gedit_document_loader_loading (GEDIT_DOCUMENT_LOADER (loader), + TRUE, + loader->priv->error); + + if (async) + async_data_free (async); +} + +static void +async_failed (AsyncData *async, GError *error) +{ + g_propagate_error (&async->loader->priv->error, error); + remote_load_completed_or_failed (async->loader, async); +} + +static void +close_input_stream_ready_cb (GInputStream *stream, + GAsyncResult *res, + AsyncData *async) +{ + GError *error = NULL; + + gedit_debug (DEBUG_LOADER); + + /* check cancelled state manually */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + gedit_debug_message (DEBUG_SAVER, "Finished closing input stream"); + + if (!g_input_stream_close_finish (stream, res, &error)) + { + gedit_debug_message (DEBUG_SAVER, "Closing input stream error: %s", error->message); + + async_failed (async, error); + return; + } + + gedit_debug_message (DEBUG_SAVER, "Close output stream"); + if (!g_output_stream_close (async->loader->priv->output, + async->cancellable, &error)) + { + async_failed (async, error); + return; + } + + remote_load_completed_or_failed (async->loader, async); +} + +static void +write_complete (AsyncData *async) +{ + GeditDocumentLoader *loader; + + loader = GEDIT_DOCUMENT_LOADER (async->loader); + + if (async->loader->priv->stream) + g_input_stream_close_async (G_INPUT_STREAM (async->loader->priv->stream), + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback)close_input_stream_ready_cb, + async); +} + +/* prototype, because they call each other... isn't C lovely */ +static void read_file_chunk (AsyncData *async); + +static void +write_file_chunk (AsyncData *async) +{ + GeditGioDocumentLoader *gvloader; + gssize bytes_written; + GError *error = NULL; + + gvloader = async->loader; + + /* we use sync methods on doc stream since it is in memory. Using async + would be racy and we can endup with invalidated iters */ + bytes_written = g_output_stream_write (G_OUTPUT_STREAM (gvloader->priv->output), + gvloader->priv->buffer, + async->read, + async->cancellable, + &error); + + gedit_debug_message (DEBUG_SAVER, "Written: %" G_GSSIZE_FORMAT, bytes_written); + if (bytes_written == -1) + { + gedit_debug_message (DEBUG_SAVER, "Write error: %s", error->message); + async_failed (async, error); + return; + } + + /* note that this signal blocks the read... check if it isn't + * a performance problem + */ + gedit_document_loader_loading (GEDIT_DOCUMENT_LOADER (gvloader), + FALSE, + NULL); + + read_file_chunk (async); +} + +static void +async_read_cb (GInputStream *stream, + GAsyncResult *res, + AsyncData *async) +{ + gedit_debug (DEBUG_LOADER); + GeditGioDocumentLoader *gvloader; + GError *error = NULL; + + gedit_debug (DEBUG_LOADER); + + /* manually check cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + gvloader = async->loader; + + async->read = g_input_stream_read_finish (stream, res, &error); + + /* error occurred */ + if (async->read == -1) + { + async_failed (async, error); + return; + } + + /* Check for the extremely unlikely case where the file size overflows. */ + if (gvloader->priv->bytes_read + async->read < gvloader->priv->bytes_read) + { + g_set_error (&gvloader->priv->error, + GEDIT_DOCUMENT_ERROR, + GEDIT_DOCUMENT_ERROR_TOO_BIG, + "File too big"); + + async_failed (async, gvloader->priv->error); + return; + } + + /* Bump the size. */ + gvloader->priv->bytes_read += async->read; + + /* end of the file, we are done! */ + if (async->read == 0) + { + GeditDocumentLoader *loader; + + loader = GEDIT_DOCUMENT_LOADER (gvloader); + + loader->auto_detected_encoding = + gedit_smart_charset_converter_get_guessed (gvloader->priv->converter); + + loader->auto_detected_newline_type = + gedit_document_output_stream_detect_newline_type (GEDIT_DOCUMENT_OUTPUT_STREAM (gvloader->priv->output)); + + /* Check if we needed some fallback char, if so, check if there was + a previous error and if not set a fallback used error */ + /* FIXME Uncomment this when we want to manage conversion fallback */ + /*if ((gedit_smart_charset_converter_get_num_fallbacks (gvloader->priv->converter) != 0) && + gvloader->priv->error == NULL) + { + g_set_error_literal (&gvloader->priv->error, + GEDIT_DOCUMENT_ERROR, + GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK, + "There was a conversion error and it was " + "needed to use a fallback char"); + }*/ + + write_complete (async); + + return; + } + + write_file_chunk (async); +} + +static void +read_file_chunk (AsyncData *async) +{ + GeditGioDocumentLoader *gvloader; + + gvloader = async->loader; + + g_input_stream_read_async (G_INPUT_STREAM (gvloader->priv->stream), + gvloader->priv->buffer, + READ_CHUNK_SIZE, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback) async_read_cb, + async); +} + +static GSList * +get_candidate_encodings (GeditGioDocumentLoader *gvloader) +{ + const GeditEncoding *metadata; + GSList *encodings = NULL; + + encodings = gedit_prefs_manager_get_auto_detected_encodings (); + + metadata = get_metadata_encoding (GEDIT_DOCUMENT_LOADER (gvloader)); + if (metadata != NULL) + { + encodings = g_slist_prepend (encodings, (gpointer)metadata); + } + + return encodings; +} + +static void +finish_query_info (AsyncData *async) +{ + GeditGioDocumentLoader *gvloader; + GeditDocumentLoader *loader; + GInputStream *conv_stream; + GFileInfo *info; + GSList *candidate_encodings; + + gvloader = async->loader; + loader = GEDIT_DOCUMENT_LOADER (gvloader); + info = loader->info; + + /* if it's not a regular file, error out... */ + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_TYPE) && + g_file_info_get_file_type (info) != G_FILE_TYPE_REGULAR) + { + g_set_error (&gvloader->priv->error, + G_IO_ERROR, + G_IO_ERROR_NOT_REGULAR_FILE, + "Not a regular file"); + + remote_load_completed_or_failed (gvloader, async); + + return; + } + + /* Get the candidate encodings */ + if (loader->encoding == NULL) + { + candidate_encodings = get_candidate_encodings (gvloader); + } + else + { + candidate_encodings = g_slist_prepend (NULL, (gpointer) loader->encoding); + } + + gvloader->priv->converter = gedit_smart_charset_converter_new (candidate_encodings); + g_slist_free (candidate_encodings); + + conv_stream = g_converter_input_stream_new (gvloader->priv->stream, + G_CONVERTER (gvloader->priv->converter)); + g_object_unref (gvloader->priv->stream); + + gvloader->priv->stream = conv_stream; + + /* Output stream */ + gvloader->priv->output = gedit_document_output_stream_new (loader->document); + + /* start reading */ + read_file_chunk (async); +} + +static void +query_info_cb (GFile *source, + GAsyncResult *res, + AsyncData *async) +{ + GeditGioDocumentLoader *gvloader; + GFileInfo *info; + GError *error = NULL; + + gedit_debug (DEBUG_LOADER); + + /* manually check the cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + gvloader = async->loader; + + /* finish the info query */ + info = g_file_query_info_finish (gvloader->priv->gfile, + res, + &error); + + if (info == NULL) + { + /* propagate the error and clean up */ + async_failed (async, error); + return; + } + + GEDIT_DOCUMENT_LOADER (gvloader)->info = info; + + finish_query_info (async); +} + +static void +mount_ready_callback (GFile *file, + GAsyncResult *res, + AsyncData *async) +{ + GError *error = NULL; + gboolean mounted; + + gedit_debug (DEBUG_LOADER); + + /* manual check for cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + mounted = g_file_mount_enclosing_volume_finish (file, res, &error); + + if (!mounted) + { + async_failed (async, error); + } + else + { + /* try again to open the file for reading */ + open_async_read (async); + } +} + +static void +recover_not_mounted (AsyncData *async) +{ + GeditDocument *doc; + GMountOperation *mount_operation; + + gedit_debug (DEBUG_LOADER); + + doc = gedit_document_loader_get_document (GEDIT_DOCUMENT_LOADER (async->loader)); + mount_operation = _gedit_document_create_mount_operation (doc); + + async->tried_mount = TRUE; + g_file_mount_enclosing_volume (async->loader->priv->gfile, + G_MOUNT_MOUNT_NONE, + mount_operation, + async->cancellable, + (GAsyncReadyCallback) mount_ready_callback, + async); + + g_object_unref (mount_operation); +} + +static void +async_read_ready_callback (GObject *source, + GAsyncResult *res, + AsyncData *async) +{ + GError *error = NULL; + GeditGioDocumentLoader *gvloader; + + gedit_debug (DEBUG_LOADER); + + /* manual check for cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + gvloader = async->loader; + + gvloader->priv->stream = G_INPUT_STREAM (g_file_read_finish (gvloader->priv->gfile, + res, &error)); + + if (!gvloader->priv->stream) + { + if (error->code == G_IO_ERROR_NOT_MOUNTED && !async->tried_mount) + { + recover_not_mounted (async); + g_error_free (error); + return; + } + + /* Propagate error */ + g_propagate_error (&gvloader->priv->error, error); + gedit_document_loader_loading (GEDIT_DOCUMENT_LOADER (gvloader), + TRUE, + gvloader->priv->error); + + async_data_free (async); + return; + } + + /* get the file info: note we cannot use + * g_file_input_stream_query_info_async since it is not able to get the + * content type etc, beside it is not supported by gvfs. + * Using the file instead of the stream is slightly racy, but for + * loading this is not too bad... + */ + g_file_query_info_async (gvloader->priv->gfile, + REMOTE_QUERY_ATTRIBUTES, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback) query_info_cb, + async); +} + +static void +open_async_read (AsyncData *async) +{ + g_file_read_async (async->loader->priv->gfile, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback) async_read_ready_callback, + async); +} + +static void +gedit_gio_document_loader_load (GeditDocumentLoader *loader) +{ + GeditGioDocumentLoader *gvloader = GEDIT_GIO_DOCUMENT_LOADER (loader); + AsyncData *async; + + gedit_debug (DEBUG_LOADER); + + /* make sure no load operation is currently running */ + g_return_if_fail (gvloader->priv->cancellable == NULL); + + gvloader->priv->gfile = g_file_new_for_uri (loader->uri); + + /* loading start */ + gedit_document_loader_loading (GEDIT_DOCUMENT_LOADER (gvloader), + FALSE, + NULL); + + gvloader->priv->cancellable = g_cancellable_new (); + async = async_data_new (gvloader); + + open_async_read (async); +} + +static goffset +gedit_gio_document_loader_get_bytes_read (GeditDocumentLoader *loader) +{ + return GEDIT_GIO_DOCUMENT_LOADER (loader)->priv->bytes_read; +} + +static gboolean +gedit_gio_document_loader_cancel (GeditDocumentLoader *loader) +{ + GeditGioDocumentLoader *gvloader = GEDIT_GIO_DOCUMENT_LOADER (loader); + + if (gvloader->priv->cancellable == NULL) + return FALSE; + + g_cancellable_cancel (gvloader->priv->cancellable); + + g_set_error (&gvloader->priv->error, + G_IO_ERROR, + G_IO_ERROR_CANCELLED, + "Operation cancelled"); + + remote_load_completed_or_failed (gvloader, NULL); + + return TRUE; +} diff --git a/gedit/gedit-gio-document-loader.h b/gedit/gedit-gio-document-loader.h new file mode 100755 index 00000000..78c9e8ad --- /dev/null +++ b/gedit/gedit-gio-document-loader.h @@ -0,0 +1,79 @@ +/* + * gedit-gio-document-loader.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2007 - Paolo Maggi, Steve Frécinaux + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2008. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_GIO_DOCUMENT_LOADER_H__ +#define __GEDIT_GIO_DOCUMENT_LOADER_H__ + +#include +#include "gedit-document-loader.h" + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_GIO_DOCUMENT_LOADER (gedit_gio_document_loader_get_type()) +#define GEDIT_GIO_DOCUMENT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_GIO_DOCUMENT_LOADER, GeditGioDocumentLoader)) +#define GEDIT_GIO_DOCUMENT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_GIO_DOCUMENT_LOADER, GeditGioDocumentLoaderClass)) +#define GEDIT_IS_GIO_DOCUMENT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_GIO_DOCUMENT_LOADER)) +#define GEDIT_IS_GIO_DOCUMENT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_GIO_DOCUMENT_LOADER)) +#define GEDIT_GIO_DOCUMENT_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_GIO_DOCUMENT_LOADER, GeditGioDocumentLoaderClass)) + +/* Private structure type */ +typedef struct _GeditGioDocumentLoaderPrivate GeditGioDocumentLoaderPrivate; + +/* + * Main object structure + */ +typedef struct _GeditGioDocumentLoader GeditGioDocumentLoader; + +struct _GeditGioDocumentLoader +{ + GeditDocumentLoader loader; + + /*< private > */ + GeditGioDocumentLoaderPrivate *priv; +}; + +/* + * Class definition + */ +typedef GeditDocumentLoaderClass GeditGioDocumentLoaderClass; + +/* + * Public methods + */ +GType gedit_gio_document_loader_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GEDIT_GIO_DOCUMENT_LOADER_H__ */ diff --git a/gedit/gedit-gio-document-saver.c b/gedit/gedit-gio-document-saver.c new file mode 100755 index 00000000..f1f63b62 --- /dev/null +++ b/gedit/gedit-gio-document-saver.c @@ -0,0 +1,775 @@ +/* + * gedit-gio-document-saver.c + * This file is part of gedit + * + * Copyright (C) 2005-2006 - Paolo Borelli and Paolo Maggi + * Copyright (C) 2007 - Paolo Borelli, Paolo Maggi, Steve Frécinaux + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include "gedit-gio-document-saver.h" +#include "gedit-document-input-stream.h" +#include "gedit-debug.h" + +#define WRITE_CHUNK_SIZE 8192 + +typedef struct +{ + GeditGioDocumentSaver *saver; + gchar buffer[WRITE_CHUNK_SIZE]; + GCancellable *cancellable; + gboolean tried_mount; + gssize written; + gssize read; + GError *error; +} AsyncData; + +#define REMOTE_QUERY_ATTRIBUTES G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," \ + G_FILE_ATTRIBUTE_TIME_MODIFIED + +#define GEDIT_GIO_DOCUMENT_SAVER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_GIO_DOCUMENT_SAVER, \ + GeditGioDocumentSaverPrivate)) + +static void gedit_gio_document_saver_save (GeditDocumentSaver *saver, + GTimeVal *old_mtime); +static goffset gedit_gio_document_saver_get_file_size (GeditDocumentSaver *saver); +static goffset gedit_gio_document_saver_get_bytes_written (GeditDocumentSaver *saver); + + +static void check_modified_async (AsyncData *async); + +struct _GeditGioDocumentSaverPrivate +{ + GTimeVal old_mtime; + + goffset size; + goffset bytes_written; + + GFile *gfile; + GCancellable *cancellable; + GOutputStream *stream; + GInputStream *input; + + GError *error; +}; + +G_DEFINE_TYPE(GeditGioDocumentSaver, gedit_gio_document_saver, GEDIT_TYPE_DOCUMENT_SAVER) + +static void +gedit_gio_document_saver_dispose (GObject *object) +{ + GeditGioDocumentSaverPrivate *priv = GEDIT_GIO_DOCUMENT_SAVER (object)->priv; + + if (priv->cancellable != NULL) + { + g_cancellable_cancel (priv->cancellable); + g_object_unref (priv->cancellable); + priv->cancellable = NULL; + } + + if (priv->gfile != NULL) + { + g_object_unref (priv->gfile); + priv->gfile = NULL; + } + + if (priv->error != NULL) + { + g_error_free (priv->error); + priv->error = NULL; + } + + if (priv->stream != NULL) + { + g_object_unref (priv->stream); + priv->stream = NULL; + } + + if (priv->input != NULL) + { + g_object_unref (priv->input); + priv->input = NULL; + } + + G_OBJECT_CLASS (gedit_gio_document_saver_parent_class)->dispose (object); +} + +static AsyncData * +async_data_new (GeditGioDocumentSaver *gvsaver) +{ + AsyncData *async; + + async = g_slice_new (AsyncData); + async->saver = gvsaver; + async->cancellable = g_object_ref (gvsaver->priv->cancellable); + + async->tried_mount = FALSE; + async->written = 0; + async->read = 0; + + async->error = NULL; + + return async; +} + +static void +async_data_free (AsyncData *async) +{ + g_object_unref (async->cancellable); + + if (async->error) + { + g_error_free (async->error); + } + + g_slice_free (AsyncData, async); +} + +static void +gedit_gio_document_saver_class_init (GeditGioDocumentSaverClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GeditDocumentSaverClass *saver_class = GEDIT_DOCUMENT_SAVER_CLASS (klass); + + object_class->dispose = gedit_gio_document_saver_dispose; + + saver_class->save = gedit_gio_document_saver_save; + saver_class->get_file_size = gedit_gio_document_saver_get_file_size; + saver_class->get_bytes_written = gedit_gio_document_saver_get_bytes_written; + + g_type_class_add_private (object_class, sizeof(GeditGioDocumentSaverPrivate)); +} + +static void +gedit_gio_document_saver_init (GeditGioDocumentSaver *gvsaver) +{ + gvsaver->priv = GEDIT_GIO_DOCUMENT_SAVER_GET_PRIVATE (gvsaver); + + gvsaver->priv->cancellable = g_cancellable_new (); + gvsaver->priv->error = NULL; +} + +static void +remote_save_completed_or_failed (GeditGioDocumentSaver *gvsaver, + AsyncData *async) +{ + gedit_document_saver_saving (GEDIT_DOCUMENT_SAVER (gvsaver), + TRUE, + gvsaver->priv->error); + + if (async) + async_data_free (async); +} + +static void +async_failed (AsyncData *async, + GError *error) +{ + g_propagate_error (&async->saver->priv->error, error); + remote_save_completed_or_failed (async->saver, async); +} + +/* BEGIN NOTE: + * + * This fixes an issue in GOutputStream that applies the atomic replace + * save strategy. The stream moves the written file to the original file + * when the stream is closed. However, there is no way currently to tell + * the stream that the save should be aborted (there could be a + * conversion error). The patch explicitly closes the output stream + * in all these cases with a GCancellable in the cancelled state, causing + * the output stream to close, but not move the file. This makes use + * of an implementation detail in the local gio file stream and should be + * properly fixed by adding the appropriate API in gio. Until then, at least + * we prevent data corruption for now. + * + * Relevant bug reports: + * + * Bug 615110 - write file ignore encoding errors (gedit) + * https://bugzilla.mate.org/show_bug.cgi?id=615110 + * + * Bug 602412 - g_file_replace does not restore original file when there is + * errors while writing (glib/gio) + * https://bugzilla.mate.org/show_bug.cgi?id=602412 + */ +static void +cancel_output_stream_ready_cb (GOutputStream *stream, + GAsyncResult *result, + AsyncData *async) +{ + GError *error; + + g_output_stream_close_finish (stream, result, NULL); + + /* check cancelled state manually */ + if (g_cancellable_is_cancelled (async->cancellable) || async->error == NULL) + { + async_data_free (async); + return; + } + + error = async->error; + async->error = NULL; + + async_failed (async, error); +} + +static void +cancel_output_stream (AsyncData *async) +{ + GCancellable *cancellable; + + gedit_debug_message (DEBUG_SAVER, "Cancel output stream"); + + cancellable = g_cancellable_new (); + g_cancellable_cancel (cancellable); + + g_output_stream_close_async (async->saver->priv->stream, + G_PRIORITY_HIGH, + cancellable, + (GAsyncReadyCallback)cancel_output_stream_ready_cb, + async); + + g_object_unref (cancellable); +} + +static void +cancel_output_stream_and_fail (AsyncData *async, + GError *error) +{ + + gedit_debug_message (DEBUG_SAVER, "Cancel output stream and fail"); + + g_propagate_error (&async->error, error); + cancel_output_stream (async); +} + +/* + * END NOTE + */ + +static void +remote_get_info_cb (GFile *source, + GAsyncResult *res, + AsyncData *async) +{ + GeditGioDocumentSaver *saver; + GFileInfo *info; + GError *error = NULL; + + gedit_debug (DEBUG_SAVER); + + /* check cancelled state manually */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + saver = async->saver; + + gedit_debug_message (DEBUG_SAVER, "Finished query info on file"); + info = g_file_query_info_finish (source, res, &error); + + if (info != NULL) + { + if (GEDIT_DOCUMENT_SAVER (saver)->info != NULL) + g_object_unref (GEDIT_DOCUMENT_SAVER (saver)->info); + + GEDIT_DOCUMENT_SAVER (saver)->info = info; + } + else + { + gedit_debug_message (DEBUG_SAVER, "Query info failed: %s", error->message); + g_propagate_error (&saver->priv->error, error); + } + + remote_save_completed_or_failed (saver, async); +} + +static void +close_async_ready_get_info_cb (GOutputStream *stream, + GAsyncResult *res, + AsyncData *async) +{ + GError *error = NULL; + + gedit_debug (DEBUG_SAVER); + + /* check cancelled state manually */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + gedit_debug_message (DEBUG_SAVER, "Finished closing stream"); + + if (!g_output_stream_close_finish (stream, res, &error)) + { + gedit_debug_message (DEBUG_SAVER, "Closing stream error: %s", error->message); + + async_failed (async, error); + return; + } + + /* get the file info: note we cannot use + * g_file_output_stream_query_info_async since it is not able to get the + * content type etc, beside it is not supported by gvfs. + * I'm not sure this is actually necessary, can't we just use + * g_content_type_guess (since we have the file name and the data) + */ + gedit_debug_message (DEBUG_SAVER, "Query info on file"); + g_file_query_info_async (async->saver->priv->gfile, + REMOTE_QUERY_ATTRIBUTES, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback) remote_get_info_cb, + async); +} + +static void +write_complete (AsyncData *async) +{ + GError *error = NULL; + + /* first we close the input stream */ + gedit_debug_message (DEBUG_SAVER, "Close input stream"); + if (!g_input_stream_close (async->saver->priv->input, + async->cancellable, &error)) + { + gedit_debug_message (DEBUG_SAVER, "Closing input stream error: %s", error->message); + cancel_output_stream_and_fail (async, error); + return; + } + + /* now we close the output stream */ + gedit_debug_message (DEBUG_SAVER, "Close output stream"); + g_output_stream_close_async (async->saver->priv->stream, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback)close_async_ready_get_info_cb, + async); +} + +/* prototype, because they call each other... isn't C lovely */ +static void read_file_chunk (AsyncData *async); +static void write_file_chunk (AsyncData *async); + +static void +async_write_cb (GOutputStream *stream, + GAsyncResult *res, + AsyncData *async) +{ + GeditGioDocumentSaver *gvsaver; + gssize bytes_written; + GError *error = NULL; + + gedit_debug (DEBUG_SAVER); + + /* Check cancelled state manually */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + cancel_output_stream (async); + return; + } + + bytes_written = g_output_stream_write_finish (stream, res, &error); + + gedit_debug_message (DEBUG_SAVER, "Written: %" G_GSSIZE_FORMAT, bytes_written); + + if (bytes_written == -1) + { + gedit_debug_message (DEBUG_SAVER, "Write error: %s", error->message); + cancel_output_stream_and_fail (async, error); + return; + } + + gvsaver = async->saver; + async->written += bytes_written; + + /* write again */ + if (async->written != async->read) + { + write_file_chunk (async); + return; + } + + /* note that this signal blocks the write... check if it isn't + * a performance problem + */ + gedit_document_saver_saving (GEDIT_DOCUMENT_SAVER (gvsaver), + FALSE, + NULL); + + read_file_chunk (async); +} + +static void +write_file_chunk (AsyncData *async) +{ + GeditGioDocumentSaver *gvsaver; + + gedit_debug (DEBUG_SAVER); + + gvsaver = async->saver; + + g_output_stream_write_async (G_OUTPUT_STREAM (gvsaver->priv->stream), + async->buffer + async->written, + async->read - async->written, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback) async_write_cb, + async); +} + +static void +read_file_chunk (AsyncData *async) +{ + GeditGioDocumentSaver *gvsaver; + GeditDocumentInputStream *dstream; + GError *error = NULL; + + gedit_debug (DEBUG_SAVER); + + gvsaver = async->saver; + async->written = 0; + + /* we use sync methods on doc stream since it is in memory. Using async + would be racy and we can endup with invalidated iters */ + async->read = g_input_stream_read (gvsaver->priv->input, + async->buffer, + WRITE_CHUNK_SIZE, + async->cancellable, + &error); + + if (error != NULL) + { + cancel_output_stream_and_fail (async, error); + return; + } + + /* Check if we finished reading and writing */ + if (async->read == 0) + { + write_complete (async); + return; + } + + /* Get how many chars have been read */ + dstream = GEDIT_DOCUMENT_INPUT_STREAM (gvsaver->priv->input); + gvsaver->priv->bytes_written = gedit_document_input_stream_tell (dstream); + + write_file_chunk (async); +} + +static void +async_replace_ready_callback (GFile *source, + GAsyncResult *res, + AsyncData *async) +{ + GeditGioDocumentSaver *gvsaver; + GeditDocumentSaver *saver; + GCharsetConverter *converter; + GFileOutputStream *file_stream; + GError *error = NULL; + + gedit_debug (DEBUG_SAVER); + + /* Check cancelled state manually */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + gvsaver = async->saver; + saver = GEDIT_DOCUMENT_SAVER (gvsaver); + file_stream = g_file_replace_finish (source, res, &error); + + /* handle any error that might occur */ + if (!file_stream) + { + gedit_debug_message (DEBUG_SAVER, "Opening file failed: %s", error->message); + async_failed (async, error); + return; + } + + /* FIXME: manage converter error? */ + gedit_debug_message (DEBUG_SAVER, "Encoding charset: %s", + gedit_encoding_get_charset (saver->encoding)); + + if (saver->encoding != gedit_encoding_get_utf8 ()) + { + converter = g_charset_converter_new (gedit_encoding_get_charset (saver->encoding), + "UTF-8", + NULL); + gvsaver->priv->stream = g_converter_output_stream_new (G_OUTPUT_STREAM (file_stream), + G_CONVERTER (converter)); + + g_object_unref (file_stream); + g_object_unref (converter); + } + else + { + gvsaver->priv->stream = G_OUTPUT_STREAM (file_stream); + } + + gvsaver->priv->input = gedit_document_input_stream_new (GTK_TEXT_BUFFER (saver->document), + saver->newline_type); + + gvsaver->priv->size = gedit_document_input_stream_get_total_size (GEDIT_DOCUMENT_INPUT_STREAM (gvsaver->priv->input)); + + read_file_chunk (async); +} + +static void +begin_write (AsyncData *async) +{ + GeditGioDocumentSaver *gvsaver; + GeditDocumentSaver *saver; + gboolean backup; + + gedit_debug_message (DEBUG_SAVER, "Start replacing file contents"); + + /* For remote files we simply use g_file_replace_async. There is no + * backup as of yet + */ + gvsaver = async->saver; + saver = GEDIT_DOCUMENT_SAVER (gvsaver); + + /* Do not make backups for remote files so they do not clutter remote systems */ + backup = (saver->keep_backup && gedit_document_is_local (saver->document)); + + gedit_debug_message (DEBUG_SAVER, "File contents size: %" G_GINT64_FORMAT, gvsaver->priv->size); + gedit_debug_message (DEBUG_SAVER, "Calling replace_async"); + gedit_debug_message (DEBUG_SAVER, backup ? "Keep backup" : "Discard backup"); + + g_file_replace_async (gvsaver->priv->gfile, + NULL, + backup, + G_FILE_CREATE_NONE, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback) async_replace_ready_callback, + async); +} + +static void +mount_ready_callback (GFile *file, + GAsyncResult *res, + AsyncData *async) +{ + GError *error = NULL; + gboolean mounted; + + gedit_debug (DEBUG_SAVER); + + /* manual check for cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + mounted = g_file_mount_enclosing_volume_finish (file, res, &error); + + if (!mounted) + { + async_failed (async, error); + } + else + { + /* try again to get the modified state */ + check_modified_async (async); + } +} + +static void +recover_not_mounted (AsyncData *async) +{ + GeditDocument *doc; + GMountOperation *mount_operation; + + gedit_debug (DEBUG_LOADER); + + doc = gedit_document_saver_get_document (GEDIT_DOCUMENT_SAVER (async->saver)); + mount_operation = _gedit_document_create_mount_operation (doc); + + async->tried_mount = TRUE; + g_file_mount_enclosing_volume (async->saver->priv->gfile, + G_MOUNT_MOUNT_NONE, + mount_operation, + async->cancellable, + (GAsyncReadyCallback) mount_ready_callback, + async); + + g_object_unref (mount_operation); +} + +static void +check_modification_callback (GFile *source, + GAsyncResult *res, + AsyncData *async) +{ + GeditGioDocumentSaver *gvsaver; + GError *error = NULL; + GFileInfo *info; + + gedit_debug (DEBUG_SAVER); + + /* manually check cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_data_free (async); + return; + } + + gvsaver = async->saver; + info = g_file_query_info_finish (source, res, &error); + if (info == NULL) + { + if (error->code == G_IO_ERROR_NOT_MOUNTED && !async->tried_mount) + { + recover_not_mounted (async); + g_error_free (error); + return; + } + + /* it's perfectly fine if the file doesn't exist yet */ + if (error->code != G_IO_ERROR_NOT_FOUND) + { + gedit_debug_message (DEBUG_SAVER, "Error getting modification: %s", error->message); + + async_failed (async, error); + return; + } + } + + /* check if the mtime is > what we know about it (if we have it) */ + if (info != NULL && g_file_info_has_attribute (info, + G_FILE_ATTRIBUTE_TIME_MODIFIED)) + { + GTimeVal mtime; + GTimeVal old_mtime; + + g_file_info_get_modification_time (info, &mtime); + old_mtime = gvsaver->priv->old_mtime; + + if ((old_mtime.tv_sec > 0 || old_mtime.tv_usec > 0) && + (mtime.tv_sec != old_mtime.tv_sec || mtime.tv_usec != old_mtime.tv_usec) && + (GEDIT_DOCUMENT_SAVER (gvsaver)->flags & GEDIT_DOCUMENT_SAVE_IGNORE_MTIME) == 0) + { + gedit_debug_message (DEBUG_SAVER, "File is externally modified"); + g_set_error (&gvsaver->priv->error, + GEDIT_DOCUMENT_ERROR, + GEDIT_DOCUMENT_ERROR_EXTERNALLY_MODIFIED, + "Externally modified"); + + remote_save_completed_or_failed (gvsaver, async); + g_object_unref (info); + + return; + } + } + + if (info != NULL) + g_object_unref (info); + + /* modification check passed, start write */ + begin_write (async); +} + +static void +check_modified_async (AsyncData *async) +{ + gedit_debug_message (DEBUG_SAVER, "Check externally modified"); + + g_file_query_info_async (async->saver->priv->gfile, + G_FILE_ATTRIBUTE_TIME_MODIFIED, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_HIGH, + async->cancellable, + (GAsyncReadyCallback) check_modification_callback, + async); +} + +static gboolean +save_remote_file_real (GeditGioDocumentSaver *gvsaver) +{ + AsyncData *async; + + gedit_debug_message (DEBUG_SAVER, "Starting gio save"); + + /* First find out if the file is modified externally. This requires + * a stat, but I don't think we can do this any other way + */ + async = async_data_new (gvsaver); + + check_modified_async (async); + + /* return false to stop timeout */ + return FALSE; +} + +static void +gedit_gio_document_saver_save (GeditDocumentSaver *saver, + GTimeVal *old_mtime) +{ + GeditGioDocumentSaver *gvsaver = GEDIT_GIO_DOCUMENT_SAVER (saver); + + gvsaver->priv->old_mtime = *old_mtime; + gvsaver->priv->gfile = g_file_new_for_uri (saver->uri); + + /* saving start */ + gedit_document_saver_saving (saver, FALSE, NULL); + + g_timeout_add_full (G_PRIORITY_HIGH, + 0, + (GSourceFunc) save_remote_file_real, + gvsaver, + NULL); +} + +static goffset +gedit_gio_document_saver_get_file_size (GeditDocumentSaver *saver) +{ + return GEDIT_GIO_DOCUMENT_SAVER (saver)->priv->size; +} + +static goffset +gedit_gio_document_saver_get_bytes_written (GeditDocumentSaver *saver) +{ + return GEDIT_GIO_DOCUMENT_SAVER (saver)->priv->bytes_written; +} diff --git a/gedit/gedit-gio-document-saver.h b/gedit/gedit-gio-document-saver.h new file mode 100755 index 00000000..18e05df1 --- /dev/null +++ b/gedit/gedit-gio-document-saver.h @@ -0,0 +1,76 @@ +/* + * gedit-gio-document-saver.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyrhing (C) 2007 - Paolo Maggi, Steve Frécinaux + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __GEDIT_GIO_DOCUMENT_SAVER_H__ +#define __GEDIT_GIO_DOCUMENT_SAVER_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_GIO_DOCUMENT_SAVER (gedit_gio_document_saver_get_type()) +#define GEDIT_GIO_DOCUMENT_SAVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_GIO_DOCUMENT_SAVER, GeditGioDocumentSaver)) +#define GEDIT_GIO_DOCUMENT_SAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_GIO_DOCUMENT_SAVER, GeditGioDocumentSaverClass)) +#define GEDIT_IS_GIO_DOCUMENT_SAVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_GIO_DOCUMENT_SAVER)) +#define GEDIT_IS_GIO_DOCUMENT_SAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_GIO_DOCUMENT_SAVER)) +#define GEDIT_GIO_DOCUMENT_SAVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_GIO_DOCUMENT_SAVER, GeditGioDocumentSaverClass)) + +/* Private structure type */ +typedef struct _GeditGioDocumentSaverPrivate GeditGioDocumentSaverPrivate; + +/* + * Main object structure + */ +typedef struct _GeditGioDocumentSaver GeditGioDocumentSaver; + +struct _GeditGioDocumentSaver +{ + GeditDocumentSaver saver; + + /*< private > */ + GeditGioDocumentSaverPrivate *priv; +}; + +/* + * Class definition + */ +typedef GeditDocumentSaverClass GeditGioDocumentSaverClass; + +/* + * Public methods + */ +GType gedit_gio_document_saver_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GEDIT_GIO_DOCUMENT_SAVER_H__ */ diff --git a/gedit/gedit-help.c b/gedit/gedit-help.c new file mode 100755 index 00000000..8ddf6a96 --- /dev/null +++ b/gedit/gedit-help.c @@ -0,0 +1,122 @@ +/* + * gedit-help.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "gedit-help.h" + +#include +#include +#include + +#ifdef OS_OSX +#include "osx/gedit-osx.h" +#endif + +gboolean +gedit_help_display (GtkWindow *parent, + const gchar *name, /* "gedit" if NULL */ + const gchar *link_id) +{ + GError *error = NULL; + gboolean ret; + gchar *link; + + g_return_val_if_fail ((parent == NULL) || GTK_IS_WINDOW (parent), FALSE); + +#ifdef OS_OSX + if (name == NULL || strcmp(name, "gedit.xml") == NULL || strcmp(name, "gedit") == 0) + { + return gedit_osx_show_help (link_id); + } + else + { + return FALSE; + } +#endif + + if (name == NULL) + name = "gedit"; + else if (strcmp (name, "gedit.xml") == 0) + { + g_warning ("%s: Using \"gedit.xml\" for the help name is deprecated, use \"gedit\" or simply NULL instead", G_STRFUNC); + + name = "gedit"; + } + +#ifndef G_OS_WIN32 + if (link_id) + link = g_strdup_printf ("ghelp:%s?%s", name, link_id); + else + link = g_strdup_printf ("ghelp:%s", name); +#else + if (link_id) + link = g_strdup_printf ("http://library.mate.org/users/gedit/stable/%s", + link_id); + else + link = g_strdup ("http://library.mate.org/users/gedit/stable/"); +#endif + + ret = gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (parent)), + link, + GDK_CURRENT_TIME, + &error); + + g_free (link); + + if (error != NULL) + { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("There was an error displaying the help.")); + + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + "%s", error->message); + + g_signal_connect (G_OBJECT (dialog), + "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + gtk_widget_show (dialog); + + g_error_free (error); + } + + return ret; +} diff --git a/gedit/gedit-help.h b/gedit/gedit-help.h new file mode 100755 index 00000000..ae59afdc --- /dev/null +++ b/gedit/gedit-help.h @@ -0,0 +1,44 @@ +/* + * gedit-help.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_HELP_H__ +#define __GEDIT_HELP_H__ + +#include + +G_BEGIN_DECLS + +gboolean gedit_help_display (GtkWindow *parent, + const gchar *name, /* "gedit" if NULL */ + const gchar *link_id); + +G_END_DECLS + +#endif /* __GEDIT_HELP_H__ */ diff --git a/gedit/gedit-history-entry.c b/gedit/gedit-history-entry.c new file mode 100755 index 00000000..999d4097 --- /dev/null +++ b/gedit/gedit-history-entry.c @@ -0,0 +1,632 @@ +/* + * gedit-history-entry.c + * This file is part of gedit + * + * Copyright (C) 2006 - Paolo Borelli + * + * 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. + */ + +/* + * Modified by the gedit Team, 2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include "gedit-history-entry.h" + +enum { + PROP_0, + PROP_HISTORY_ID, + PROP_HISTORY_LENGTH +}; + +#define MIN_ITEM_LEN 3 + +#define GEDIT_HISTORY_ENTRY_HISTORY_LENGTH_DEFAULT 10 + +#define GEDIT_HISTORY_ENTRY_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_HISTORY_ENTRY, \ + GeditHistoryEntryPrivate)) + +struct _GeditHistoryEntryPrivate +{ + gchar *history_id; + guint history_length; + + GtkEntryCompletion *completion; + + MateConfClient *mateconf_client; +}; + +G_DEFINE_TYPE(GeditHistoryEntry, gedit_history_entry, GTK_TYPE_COMBO_BOX_ENTRY) + +static void +gedit_history_entry_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *spec) +{ + GeditHistoryEntry *entry; + + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (object)); + + entry = GEDIT_HISTORY_ENTRY (object); + + switch (prop_id) { + case PROP_HISTORY_ID: + entry->priv->history_id = g_value_dup_string (value); + break; + case PROP_HISTORY_LENGTH: + gedit_history_entry_set_history_length (entry, + g_value_get_uint (value)); + break; + default: + break; + } +} + +static void +gedit_history_entry_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *spec) +{ + GeditHistoryEntryPrivate *priv; + + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (object)); + + priv = GEDIT_HISTORY_ENTRY (object)->priv; + + switch (prop_id) { + case PROP_HISTORY_ID: + g_value_set_string (value, priv->history_id); + break; + case PROP_HISTORY_LENGTH: + g_value_set_uint (value, priv->history_length); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, spec); + } +} + +static void +gedit_history_entry_destroy (GtkObject *object) +{ + gedit_history_entry_set_enable_completion (GEDIT_HISTORY_ENTRY (object), + FALSE); + + GTK_OBJECT_CLASS (gedit_history_entry_parent_class)->destroy (object); +} + +static void +gedit_history_entry_finalize (GObject *object) +{ + GeditHistoryEntryPrivate *priv; + + priv = GEDIT_HISTORY_ENTRY (object)->priv; + + g_free (priv->history_id); + + if (priv->mateconf_client != NULL) + { + g_object_unref (G_OBJECT (priv->mateconf_client)); + priv->mateconf_client = NULL; + } + + G_OBJECT_CLASS (gedit_history_entry_parent_class)->finalize (object); +} + +static void +gedit_history_entry_class_init (GeditHistoryEntryClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass); + + object_class->set_property = gedit_history_entry_set_property; + object_class->get_property = gedit_history_entry_get_property; + object_class->finalize = gedit_history_entry_finalize; + gtkobject_class->destroy = gedit_history_entry_destroy; + + g_object_class_install_property (object_class, + PROP_HISTORY_ID, + g_param_spec_string ("history-id", + "History ID", + "History ID", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_HISTORY_LENGTH, + g_param_spec_uint ("history-length", + "Max History Length", + "Max History Length", + 0, + G_MAXUINT, + GEDIT_HISTORY_ENTRY_HISTORY_LENGTH_DEFAULT, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /* TODO: Add enable-completion property */ + + g_type_class_add_private (object_class, sizeof(GeditHistoryEntryPrivate)); +} + +static GtkListStore * +get_history_store (GeditHistoryEntry *entry) +{ + GtkTreeModel *store; + + store = gtk_combo_box_get_model (GTK_COMBO_BOX (entry)); + g_return_val_if_fail (GTK_IS_LIST_STORE (store), NULL); + + return (GtkListStore *) store; +} + +static char * +get_history_key (GeditHistoryEntry *entry) +{ + gchar *tmp; + gchar *key; + + /* + * We store the data under /apps/mate-settings/ + * like the old MateEntry did. Maybe we should + * consider moving it to the /gedit MateConf prefix... + * Or maybe we should just switch away from MateConf. + */ + + tmp = mateconf_escape_key (entry->priv->history_id, -1); + key = g_strconcat ("/apps/mate-settings/", + "gedit", + "/history-", + tmp, + NULL); + g_free (tmp); + + return key; +} + +static GSList * +get_history_list (GeditHistoryEntry *entry) +{ + GtkListStore *store; + GtkTreeIter iter; + gboolean valid; + GSList *list = NULL; + + store = get_history_store (entry); + + valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), + &iter); + + while (valid) + { + gchar *str; + + gtk_tree_model_get (GTK_TREE_MODEL (store), + &iter, + 0, &str, + -1); + + list = g_slist_prepend (list, str); + + valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), + &iter); + } + + return g_slist_reverse (list); +} + +static void +gedit_history_entry_save_history (GeditHistoryEntry *entry) +{ + GSList *mateconf_items; + gchar *key; + + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + + mateconf_items = get_history_list (entry); + key = get_history_key (entry); + + mateconf_client_set_list (entry->priv->mateconf_client, + key, + MATECONF_VALUE_STRING, + mateconf_items, + NULL); + + g_slist_foreach (mateconf_items, (GFunc) g_free, NULL); + g_slist_free (mateconf_items); + g_free (key); +} + +static gboolean +remove_item (GtkListStore *store, + const gchar *text) +{ + GtkTreeIter iter; + + g_return_val_if_fail (text != NULL, FALSE); + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) + return FALSE; + + do + { + gchar *item_text; + + gtk_tree_model_get (GTK_TREE_MODEL (store), + &iter, + 0, + &item_text, + -1); + + if (item_text != NULL && + strcmp (item_text, text) == 0) + { + gtk_list_store_remove (store, &iter); + g_free (item_text); + return TRUE; + } + + g_free (item_text); + + } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter)); + + return FALSE; +} + +static void +clamp_list_store (GtkListStore *store, + guint max) +{ + GtkTreePath *path; + GtkTreeIter iter; + + /* -1 because TreePath counts from 0 */ + path = gtk_tree_path_new_from_indices (max - 1, -1); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path)) + { + while (1) + { + if (!gtk_list_store_remove (store, &iter)) + break; + } + } + + gtk_tree_path_free (path); +} + +static void +insert_history_item (GeditHistoryEntry *entry, + const gchar *text, + gboolean prepend) +{ + GtkListStore *store; + GtkTreeIter iter; + + if (g_utf8_strlen (text, -1) <= MIN_ITEM_LEN) + return; + + store = get_history_store (entry); + + /* remove the text from the store if it was already + * present. If it wasn't, clamp to max history - 1 + * before inserting the new row, otherwise appending + * would not work */ + + if (!remove_item (store, text)) + clamp_list_store (store, + entry->priv->history_length - 1); + + if (prepend) + gtk_list_store_insert (store, &iter, 0); + else + gtk_list_store_append (store, &iter); + + gtk_list_store_set (store, + &iter, + 0, + text, + -1); + + gedit_history_entry_save_history (entry); +} + +void +gedit_history_entry_prepend_text (GeditHistoryEntry *entry, + const gchar *text) +{ + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + g_return_if_fail (text != NULL); + + insert_history_item (entry, text, TRUE); +} + +void +gedit_history_entry_append_text (GeditHistoryEntry *entry, + const gchar *text) +{ + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + g_return_if_fail (text != NULL); + + insert_history_item (entry, text, FALSE); +} + +static void +gedit_history_entry_load_history (GeditHistoryEntry *entry) +{ + GSList *mateconf_items, *l; + GtkListStore *store; + GtkTreeIter iter; + gchar *key; + guint i; + + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + + store = get_history_store (entry); + key = get_history_key (entry); + + mateconf_items = mateconf_client_get_list (entry->priv->mateconf_client, + key, + MATECONF_VALUE_STRING, + NULL); + + gtk_list_store_clear (store); + + for (l = mateconf_items, i = 0; + l != NULL && i < entry->priv->history_length; + l = l->next, i++) + { + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, + &iter, + 0, + l->data, + -1); + } + + g_slist_foreach (mateconf_items, (GFunc) g_free, NULL); + g_slist_free (mateconf_items); + g_free (key); +} + +void +gedit_history_entry_clear (GeditHistoryEntry *entry) +{ + GtkListStore *store; + + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + + store = get_history_store (entry); + gtk_list_store_clear (store); + + gedit_history_entry_save_history (entry); +} + +static void +gedit_history_entry_init (GeditHistoryEntry *entry) +{ + GeditHistoryEntryPrivate *priv; + + priv = GEDIT_HISTORY_ENTRY_GET_PRIVATE (entry); + entry->priv = priv; + + priv->history_id = NULL; + priv->history_length = GEDIT_HISTORY_ENTRY_HISTORY_LENGTH_DEFAULT; + + priv->completion = NULL; + + priv->mateconf_client = mateconf_client_get_default (); +} + +void +gedit_history_entry_set_history_length (GeditHistoryEntry *entry, + guint history_length) +{ + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + g_return_if_fail (history_length > 0); + + entry->priv->history_length = history_length; + + /* TODO: update if we currently have more items than max */ +} + +guint +gedit_history_entry_get_history_length (GeditHistoryEntry *entry) +{ + g_return_val_if_fail (GEDIT_IS_HISTORY_ENTRY (entry), 0); + + return entry->priv->history_length; +} + +gchar * +gedit_history_entry_get_history_id (GeditHistoryEntry *entry) +{ + g_return_val_if_fail (GEDIT_IS_HISTORY_ENTRY (entry), NULL); + + return g_strdup (entry->priv->history_id); +} + +void +gedit_history_entry_set_enable_completion (GeditHistoryEntry *entry, + gboolean enable) +{ + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + + if (enable) + { + if (entry->priv->completion != NULL) + return; + + entry->priv->completion = gtk_entry_completion_new (); + gtk_entry_completion_set_model (entry->priv->completion, + GTK_TREE_MODEL (get_history_store (entry))); + + /* Use model column 0 as the text column */ + gtk_entry_completion_set_text_column (entry->priv->completion, 0); + + gtk_entry_completion_set_minimum_key_length (entry->priv->completion, + MIN_ITEM_LEN); + + gtk_entry_completion_set_popup_completion (entry->priv->completion, FALSE); + gtk_entry_completion_set_inline_completion (entry->priv->completion, TRUE); + + /* Assign the completion to the entry */ + gtk_entry_set_completion (GTK_ENTRY (gedit_history_entry_get_entry(entry)), + entry->priv->completion); + } + else + { + if (entry->priv->completion == NULL) + return; + + gtk_entry_set_completion (GTK_ENTRY (gedit_history_entry_get_entry (entry)), + NULL); + + g_object_unref (entry->priv->completion); + + entry->priv->completion = NULL; + } +} + +gboolean +gedit_history_entry_get_enable_completion (GeditHistoryEntry *entry) +{ + g_return_val_if_fail (GEDIT_IS_HISTORY_ENTRY (entry), FALSE); + + return entry->priv->completion != NULL; +} + +GtkWidget * +gedit_history_entry_new (const gchar *history_id, + gboolean enable_completion) +{ + GtkWidget *ret; + GtkListStore *store; + + g_return_val_if_fail (history_id != NULL, NULL); + + /* Note that we are setting the model, so + * user must be careful to always manipulate + * data in the history through gedit_history_entry_ + * functions. + */ + + store = gtk_list_store_new (1, G_TYPE_STRING); + + ret = g_object_new (GEDIT_TYPE_HISTORY_ENTRY, + "history-id", history_id, + "model", store, + "text-column", 0, + NULL); + + g_object_unref (store); + + /* loading has to happen after the model + * has been set. However the model is not a + * G_PARAM_CONSTRUCT property of GtkComboBox + * so we cannot do this in the constructor. + * For now we simply do here since this widget is + * not bound to other programming languages. + * A maybe better alternative is to override the + * model property of combobox and mark CONTRUCT_ONLY. + * This would also ensure that the model cannot be + * set explicitely at a later time. + */ + gedit_history_entry_load_history (GEDIT_HISTORY_ENTRY (ret)); + + gedit_history_entry_set_enable_completion (GEDIT_HISTORY_ENTRY (ret), + enable_completion); + + return ret; +} + +/* + * Utility function to get the editable text entry internal widget. + * I would prefer to not expose this implementation detail and + * simply make the GeditHistoryEntry widget implement the + * GtkEditable interface. Unfortunately both GtkEditable and + * GtkComboBox have a "changed" signal and I am not sure how to + * handle the conflict. + */ +GtkWidget * +gedit_history_entry_get_entry (GeditHistoryEntry *entry) +{ + g_return_val_if_fail (GEDIT_IS_HISTORY_ENTRY (entry), NULL); + + return gtk_bin_get_child (GTK_BIN (entry)); +} + +static void +escape_cell_data_func (GtkTreeViewColumn *col, + GtkCellRenderer *renderer, + GtkTreeModel *model, + GtkTreeIter *iter, + GeditHistoryEntryEscapeFunc escape_func) +{ + gchar *str; + gchar *escaped; + + gtk_tree_model_get (model, iter, 0, &str, -1); + escaped = escape_func (str); + g_object_set (renderer, "text", escaped, NULL); + + g_free (str); + g_free (escaped); +} + +void +gedit_history_entry_set_escape_func (GeditHistoryEntry *entry, + GeditHistoryEntryEscapeFunc escape_func) +{ + GList *cells; + + g_return_if_fail (GEDIT_IS_HISTORY_ENTRY (entry)); + + cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (entry)); + + /* We only have one cell renderer */ + g_return_if_fail (cells->data != NULL && cells->next == NULL); + + if (escape_func != NULL) + gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (entry), + GTK_CELL_RENDERER (cells->data), + (GtkCellLayoutDataFunc) escape_cell_data_func, + escape_func, + NULL); + else + gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (entry), + GTK_CELL_RENDERER (cells->data), + NULL, + NULL, + NULL); + + g_list_free (cells); +} diff --git a/gedit/gedit-history-entry.h b/gedit/gedit-history-entry.h new file mode 100755 index 00000000..59e810c2 --- /dev/null +++ b/gedit/gedit-history-entry.h @@ -0,0 +1,96 @@ +/* + * gedit-history-entry.h + * This file is part of gedit + * + * Copyright (C) 2006 - Paolo Borelli + * + * 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. + */ + +/* + * Modified by the gedit Team, 2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_HISTORY_ENTRY_H__ +#define __GEDIT_HISTORY_ENTRY_H__ + + +G_BEGIN_DECLS + +#define GEDIT_TYPE_HISTORY_ENTRY (gedit_history_entry_get_type ()) +#define GEDIT_HISTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_HISTORY_ENTRY, GeditHistoryEntry)) +#define GEDIT_HISTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_HISTORY_ENTRY, GeditHistoryEntryClass)) +#define GEDIT_IS_HISTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_HISTORY_ENTRY)) +#define GEDIT_IS_HISTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_HISTORY_ENTRY)) +#define GEDIT_HISTORY_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_HISTORY_ENTRY, GeditHistoryEntryClass)) + + +typedef struct _GeditHistoryEntry GeditHistoryEntry; +typedef struct _GeditHistoryEntryClass GeditHistoryEntryClass; +typedef struct _GeditHistoryEntryPrivate GeditHistoryEntryPrivate; + +struct _GeditHistoryEntryClass +{ + GtkComboBoxEntryClass parent_class; +}; + +struct _GeditHistoryEntry +{ + GtkComboBoxEntry parent_instance; + + GeditHistoryEntryPrivate *priv; +}; + +GType gedit_history_entry_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_history_entry_new (const gchar *history_id, + gboolean enable_completion); + +void gedit_history_entry_prepend_text (GeditHistoryEntry *entry, + const gchar *text); + +void gedit_history_entry_append_text (GeditHistoryEntry *entry, + const gchar *text); + +void gedit_history_entry_clear (GeditHistoryEntry *entry); + +void gedit_history_entry_set_history_length (GeditHistoryEntry *entry, + guint max_saved); + +guint gedit_history_entry_get_history_length (GeditHistoryEntry *gentry); + +gchar *gedit_history_entry_get_history_id (GeditHistoryEntry *entry); + +void gedit_history_entry_set_enable_completion + (GeditHistoryEntry *entry, + gboolean enable); + +gboolean gedit_history_entry_get_enable_completion + (GeditHistoryEntry *entry); + +GtkWidget *gedit_history_entry_get_entry (GeditHistoryEntry *entry); + +typedef gchar * (* GeditHistoryEntryEscapeFunc) (const gchar *str); +void gedit_history_entry_set_escape_func (GeditHistoryEntry *entry, + GeditHistoryEntryEscapeFunc escape_func); + +G_END_DECLS + +#endif /* __GEDIT_HISTORY_ENTRY_H__ */ diff --git a/gedit/gedit-io-error-message-area.c b/gedit/gedit-io-error-message-area.c new file mode 100755 index 00000000..e116a15b --- /dev/null +++ b/gedit/gedit-io-error-message-area.c @@ -0,0 +1,1288 @@ +/* + * gedit-io-error-message-area.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +/* + * Verbose error reporting for file I/O operations (load, save, revert, create) + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include + +#include "gedit-utils.h" +#include "gedit-document.h" +#include "gedit-io-error-message-area.h" +#include "gedit-prefs-manager.h" +#include + +#if !GTK_CHECK_VERSION (2, 17, 1) +#include "gedit-message-area.h" +#endif + +#define MAX_URI_IN_DIALOG_LENGTH 50 + +static gboolean +is_recoverable_error (const GError *error) +{ + gboolean is_recoverable = FALSE; + + if (error->domain == G_IO_ERROR) + { + switch (error->code) { + case G_IO_ERROR_PERMISSION_DENIED: + case G_IO_ERROR_NOT_FOUND: + case G_IO_ERROR_HOST_NOT_FOUND: + case G_IO_ERROR_TIMED_OUT: + case G_IO_ERROR_NOT_MOUNTABLE_FILE: + case G_IO_ERROR_NOT_MOUNTED: + case G_IO_ERROR_BUSY: + is_recoverable = TRUE; + } + } + + return is_recoverable; +} + +static gboolean +is_gio_error (const GError *error, + gint code) +{ + return error->domain == G_IO_ERROR && error->code == code; +} + +static void +set_contents (GtkWidget *area, + GtkWidget *contents) +{ +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_set_contents (GEDIT_MESSAGE_AREA (area), + contents); +#else + GtkWidget *content_area; + + content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (area)); + gtk_container_add (GTK_CONTAINER (content_area), contents); +#endif +} + +#if GTK_CHECK_VERSION (2, 17, 1) +static void +info_bar_add_stock_button_with_text (GtkInfoBar *infobar, + const gchar *text, + const gchar *stock_id, + gint response_id) +{ + GtkWidget *button; + GtkWidget *image; + + button = gtk_info_bar_add_button (infobar, text, response_id); + image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (button), image); +} +#endif + +static void +set_message_area_text_and_icon (GtkWidget *message_area, + const gchar *icon_stock_id, + const gchar *primary_text, + const gchar *secondary_text) +{ + GtkWidget *hbox_content; + GtkWidget *image; + GtkWidget *vbox; + gchar *primary_markup; + gchar *secondary_markup; + GtkWidget *primary_label; + GtkWidget *secondary_label; + + hbox_content = gtk_hbox_new (FALSE, 8); + + image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG); + gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); + + vbox = gtk_vbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); + + primary_markup = g_strdup_printf ("%s", primary_text); + primary_label = gtk_label_new (primary_markup); + g_free (primary_markup); + gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5); + GTK_WIDGET_SET_FLAGS (primary_label, GTK_CAN_FOCUS); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + if (secondary_text != NULL) + { + secondary_markup = g_strdup_printf ("%s", + secondary_text); + secondary_label = gtk_label_new (secondary_markup); + g_free (secondary_markup); + gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS (secondary_label, GTK_CAN_FOCUS); + gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); + } + + gtk_widget_show_all (hbox_content); + set_contents (message_area, hbox_content); +} + +static GtkWidget * +create_io_loading_error_message_area (const gchar *primary_text, + const gchar *secondary_text, + gboolean recoverable_error) +{ + GtkWidget *message_area; + +#if !GTK_CHECK_VERSION (2, 17, 1) + message_area = gedit_message_area_new_with_buttons ( + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + NULL); +#else + message_area = gtk_info_bar_new_with_buttons ( + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + NULL); + gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), + GTK_MESSAGE_ERROR); +#endif + + set_message_area_text_and_icon (message_area, + "gtk-dialog-error", + primary_text, + secondary_text); + + if (recoverable_error) + { +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (message_area), + _("_Retry"), + GTK_STOCK_REFRESH, + GTK_RESPONSE_OK); +#else + info_bar_add_stock_button_with_text (GTK_INFO_BAR (message_area), + _("_Retry"), + GTK_STOCK_REFRESH, + GTK_RESPONSE_OK); +#endif + } + + return message_area; +} + +static gboolean +parse_gio_error (gint code, + gchar **error_message, + gchar **message_details, + const gchar *uri, + const gchar *uri_for_display) +{ + gboolean ret = TRUE; + + switch (code) + { + case G_IO_ERROR_NOT_FOUND: + case G_IO_ERROR_NOT_DIRECTORY: + *error_message = g_strdup_printf (_("Could not find the file %s."), + uri_for_display); + *message_details = g_strdup (_("Please check that you typed the " + "location correctly and try again.")); + break; + case G_IO_ERROR_NOT_SUPPORTED: + { + gchar *scheme_string; + gchar *scheme_markup; + + scheme_string = g_uri_parse_scheme (uri); + + if ((scheme_string != NULL) && g_utf8_validate (scheme_string, -1, NULL)) + { + scheme_markup = g_markup_printf_escaped ("%s:", scheme_string); + + /* Translators: %s is a URI scheme (like for example http:, ftp:, etc.) */ + *message_details = g_strdup_printf (_("gedit cannot handle %s locations."), + scheme_markup); + g_free (scheme_markup); + } + else + { + *message_details = g_strdup (_("gedit cannot handle this location.")); + } + + g_free (scheme_string); + } + break; + + case G_IO_ERROR_NOT_MOUNTABLE_FILE: + *message_details = g_strdup (_("The location of the file cannot be mounted.")); + break; + + case G_IO_ERROR_NOT_MOUNTED: + *message_details = g_strdup( _("The location of the file cannot be accessed because it is not mounted.")); + + break; + case G_IO_ERROR_IS_DIRECTORY: + *error_message = g_strdup_printf (_("%s is a directory."), + uri_for_display); + *message_details = g_strdup (_("Please check that you typed the " + "location correctly and try again.")); + break; + + case G_IO_ERROR_INVALID_FILENAME: + *error_message = g_strdup_printf (_("%s is not a valid location."), + uri_for_display); + *message_details = g_strdup (_("Please check that you typed the " + "location correctly and try again.")); + break; + + case G_IO_ERROR_HOST_NOT_FOUND: + /* This case can be hit for user-typed strings like "foo" due to + * the code that guesses web addresses when there's no initial "/". + * But this case is also hit for legitimate web addresses when + * the proxy is set up wrong. + */ + { + gchar *hn = NULL; + + if (gedit_utils_decode_uri (uri, NULL, NULL, &hn, NULL, NULL)) + { + if (hn != NULL) + { + gchar *host_markup; + gchar *host_name; + + host_name = gedit_utils_make_valid_utf8 (hn); + g_free (hn); + + host_markup = g_markup_printf_escaped ("%s", host_name); + g_free (host_name); + + /* Translators: %s is a host name */ + *message_details = g_strdup_printf ( + _("Host %s could not be found. " + "Please check that your proxy settings " + "are correct and try again."), + host_markup); + + g_free (host_markup); + } + } + + if (!*message_details) + { + /* use the same string as INVALID_HOST */ + *message_details = g_strdup_printf ( + _("Hostname was invalid. " + "Please check that you typed the location " + "correctly and try again.")); + } + } + break; + + case G_IO_ERROR_NOT_REGULAR_FILE: + *message_details = g_strdup_printf (_("%s is not a regular file."), + uri_for_display); + break; + + case G_IO_ERROR_TIMED_OUT: + *message_details = g_strdup (_("Connection timed out. Please try again.")); + break; + + default: + ret = FALSE; + break; + } + + return ret; +} + +static gboolean +parse_gedit_error (gint code, + gchar **error_message, + gchar **message_details, + const gchar *uri, + const gchar *uri_for_display) +{ + gboolean ret = TRUE; + + switch (code) + { + case GEDIT_DOCUMENT_ERROR_TOO_BIG: + *message_details = g_strdup (_("The file is too big.")); + break; + + default: + ret = FALSE; + break; + } + + return ret; +} + +static void +parse_error (const GError *error, + gchar **error_message, + gchar **message_details, + const gchar *uri, + const gchar *uri_for_display) +{ + gboolean ret = FALSE; + + if (error->domain == G_IO_ERROR) + { + ret = parse_gio_error (error->code, + error_message, + message_details, + uri, + uri_for_display); + } + else if (error->domain == GEDIT_DOCUMENT_ERROR) + { + ret = parse_gedit_error (error->code, + error_message, + message_details, + uri, + uri_for_display); + } + + if (!ret) + { + g_warning ("Hit unhandled case %d (%s) in %s.", + error->code, error->message, G_STRFUNC); + *message_details = g_strdup_printf (_("Unexpected error: %s"), + error->message); + } +} + +GtkWidget * +gedit_unrecoverable_reverting_error_message_area_new (const gchar *uri, + const GError *error) +{ + gchar *error_message = NULL; + gchar *message_details = NULL; + gchar *full_formatted_uri; + gchar *uri_for_display; + gchar *temp_uri_for_display; + GtkWidget *message_area; + + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail ((error->domain == GEDIT_DOCUMENT_ERROR) || + (error->domain == G_IO_ERROR), NULL); + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + + if (is_gio_error (error, G_IO_ERROR_NOT_FOUND)) + { + message_details = g_strdup (_("gedit cannot find the file. " + "Perhaps it has recently been deleted.")); + } + else + { + parse_error (error, &error_message, &message_details, uri, uri_for_display); + } + + if (error_message == NULL) + { + error_message = g_strdup_printf (_("Could not revert the file %s."), + uri_for_display); + } + + message_area = create_io_loading_error_message_area (error_message, + message_details, + FALSE); + + g_free (uri_for_display); + g_free (error_message); + g_free (message_details); + + return message_area; +} + +static void +create_combo_box (GtkWidget *message_area, GtkWidget *vbox) +{ + GtkWidget *hbox; + GtkWidget *label; + GtkWidget *menu; + gchar *label_markup; + + hbox = gtk_hbox_new (FALSE, 6); + + label_markup = g_strdup_printf ("%s", + _("Ch_aracter Encoding:")); + label = gtk_label_new_with_mnemonic (label_markup); + g_free (label_markup); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + menu = gedit_encodings_combo_box_new (TRUE); + g_object_set_data (G_OBJECT (message_area), + "gedit-message-area-encoding-menu", + menu); + + gtk_label_set_mnemonic_widget (GTK_LABEL (label), menu); + gtk_box_pack_start (GTK_BOX (hbox), + label, + FALSE, + FALSE, + 0); + + gtk_box_pack_start (GTK_BOX (hbox), + menu, + FALSE, + FALSE, + 0); + + gtk_widget_show_all (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); +} + +static GtkWidget * +create_conversion_error_message_area (const gchar *primary_text, + const gchar *secondary_text, + gboolean edit_anyway) +{ + GtkWidget *message_area; + GtkWidget *hbox_content; + GtkWidget *image; + GtkWidget *vbox; + gchar *primary_markup; + gchar *secondary_markup; + GtkWidget *primary_label; + GtkWidget *secondary_label; + +#if !GTK_CHECK_VERSION (2, 17, 1) + message_area = gedit_message_area_new (); + + gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (message_area), + _("_Retry"), + GTK_STOCK_REDO, + GTK_RESPONSE_OK); + + if (edit_anyway) + { + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + _("Edit Any_way"), + GTK_RESPONSE_YES); + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + _("D_on't Edit"), + GTK_RESPONSE_NO); + } + else + { + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + } +#else + message_area = gtk_info_bar_new (); + + info_bar_add_stock_button_with_text (GTK_INFO_BAR (message_area), + _("_Retry"), + GTK_STOCK_REDO, + GTK_RESPONSE_OK); + + if (edit_anyway) + { + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + /* Translators: the access key chosen for this string should be + different from other main menu access keys (Open, Edit, View...) */ + _("Edit Any_way"), + GTK_RESPONSE_YES); + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + /* Translators: the access key chosen for this string should be + different from other main menu access keys (Open, Edit, View...) */ + _("D_on't Edit"), + GTK_RESPONSE_NO); + gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), + GTK_MESSAGE_WARNING); + } + else + { + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), + GTK_MESSAGE_ERROR); + } +#endif + + hbox_content = gtk_hbox_new (FALSE, 8); + + image = gtk_image_new_from_stock ("gtk-dialog-error", GTK_ICON_SIZE_DIALOG); + gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); + + vbox = gtk_vbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); + + primary_markup = g_strdup_printf ("%s", primary_text); + primary_label = gtk_label_new (primary_markup); + g_free (primary_markup); + gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5); + GTK_WIDGET_SET_FLAGS (primary_label, GTK_CAN_FOCUS); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + if (secondary_text != NULL) + { + secondary_markup = g_strdup_printf ("%s", + secondary_text); + secondary_label = gtk_label_new (secondary_markup); + g_free (secondary_markup); + gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS (secondary_label, GTK_CAN_FOCUS); + gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); + } + + create_combo_box (message_area, vbox); + gtk_widget_show_all (hbox_content); + set_contents (message_area, hbox_content); + + return message_area; +} + +GtkWidget * +gedit_io_loading_error_message_area_new (const gchar *uri, + const GeditEncoding *encoding, + const GError *error) +{ + gchar *error_message = NULL; + gchar *message_details = NULL; + gchar *full_formatted_uri; + gchar *encoding_name; + gchar *uri_for_display; + gchar *temp_uri_for_display; + GtkWidget *message_area; + gboolean edit_anyway = FALSE; + gboolean convert_error = FALSE; + + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail ((error->domain == G_CONVERT_ERROR) || + (error->domain == GEDIT_DOCUMENT_ERROR) || + (error->domain == G_IO_ERROR), NULL); + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + + if (encoding != NULL) + encoding_name = gedit_encoding_to_string (encoding); + else + encoding_name = g_strdup ("UTF-8"); + + if (is_gio_error (error, G_IO_ERROR_TOO_MANY_LINKS)) + { + message_details = g_strdup (_("The number of followed links is limited and the actual file could not be found within this limit.")); + } + else if (is_gio_error (error, G_IO_ERROR_PERMISSION_DENIED)) + { + message_details = g_strdup (_("You do not have the permissions necessary to open the file.")); + } + else if ((is_gio_error (error, G_IO_ERROR_INVALID_DATA) && encoding == NULL) || + (error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_ENCODING_AUTO_DETECTION_FAILED)) + { + message_details = g_strconcat (_("gedit has not been able to detect " + "the character encoding."), "\n", + _("Please check that you are not trying to open a binary file."), "\n", + _("Select a character encoding from the menu and try again."), NULL); + convert_error = TRUE; + } + else if (error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK) + { + error_message = g_strdup_printf (_("There was a problem opening the file %s."), + uri_for_display); + message_details = g_strconcat (_("The file you opened has some invalid characters. " + "If you continue editing this file you could make this " + "document useless."), "\n", + _("You can also choose another character encoding and try again."), + NULL); + edit_anyway = TRUE; + convert_error = TRUE; + } + else if (is_gio_error (error, G_IO_ERROR_INVALID_DATA) && encoding != NULL) + { + error_message = g_strdup_printf (_("Could not open the file %s using the %s character encoding."), + uri_for_display, + encoding_name); + message_details = g_strconcat (_("Please check that you are not trying to open a binary file."), "\n", + _("Select a different character encoding from the menu and try again."), NULL); + convert_error = TRUE; + } + else + { + parse_error (error, &error_message, &message_details, uri, uri_for_display); + } + + if (error_message == NULL) + { + error_message = g_strdup_printf (_("Could not open the file %s."), + uri_for_display); + } + + if (convert_error) + { + message_area = create_conversion_error_message_area (error_message, + message_details, + edit_anyway); + } + else + { + message_area = create_io_loading_error_message_area (error_message, + message_details, + is_recoverable_error (error)); + } + + g_free (uri_for_display); + g_free (encoding_name); + g_free (error_message); + g_free (message_details); + + return message_area; +} + +GtkWidget * +gedit_conversion_error_while_saving_message_area_new ( + const gchar *uri, + const GeditEncoding *encoding, + const GError *error) +{ + gchar *error_message = NULL; + gchar *message_details = NULL; + gchar *full_formatted_uri; + gchar *encoding_name; + gchar *uri_for_display; + gchar *temp_uri_for_display; + GtkWidget *message_area; + + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (error->domain == G_CONVERT_ERROR || + error->domain == G_IO_ERROR, NULL); + g_return_val_if_fail (encoding != NULL, NULL); + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + + encoding_name = gedit_encoding_to_string (encoding); + + error_message = g_strdup_printf (_("Could not save the file %s using the %s character encoding."), + uri_for_display, + encoding_name); + message_details = g_strconcat (_("The document contains one or more characters that cannot be encoded " + "using the specified character encoding."), "\n", + _("Select a different character encoding from the menu and try again."), NULL); + + message_area = create_conversion_error_message_area ( + error_message, + message_details, + FALSE); + + g_free (uri_for_display); + g_free (encoding_name); + g_free (error_message); + g_free (message_details); + + return message_area; +} + +const GeditEncoding * +gedit_conversion_error_message_area_get_encoding (GtkWidget *message_area) +{ + gpointer menu; + +#if !GTK_CHECK_VERSION (2, 17, 1) + g_return_val_if_fail (GEDIT_IS_MESSAGE_AREA (message_area), NULL); +#else + g_return_val_if_fail (GTK_IS_INFO_BAR (message_area), NULL); +#endif + + menu = g_object_get_data (G_OBJECT (message_area), + "gedit-message-area-encoding-menu"); + g_return_val_if_fail (menu, NULL); + + return gedit_encodings_combo_box_get_selected_encoding + (GEDIT_ENCODINGS_COMBO_BOX (menu)); +} + +GtkWidget * +gedit_file_already_open_warning_message_area_new (const gchar *uri) +{ + GtkWidget *message_area; + GtkWidget *hbox_content; + GtkWidget *image; + GtkWidget *vbox; + gchar *primary_markup; + gchar *secondary_markup; + GtkWidget *primary_label; + GtkWidget *secondary_label; + gchar *primary_text; + const gchar *secondary_text; + gchar *full_formatted_uri; + gchar *uri_for_display; + gchar *temp_uri_for_display; + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + +#if !GTK_CHECK_VERSION (2, 17, 1) + message_area = gedit_message_area_new (); + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + _("Edit Any_way"), + GTK_RESPONSE_YES); + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + _("D_on't Edit"), + GTK_RESPONSE_CANCEL); +#else + message_area = gtk_info_bar_new (); + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + /* Translators: the access key chosen for this string should be + different from other main menu access keys (Open, Edit, View...) */ + _("Edit Any_way"), + GTK_RESPONSE_YES); + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + /* Translators: the access key chosen for this string should be + different from other main menu access keys (Open, Edit, View...) */ + _("D_on't Edit"), + GTK_RESPONSE_CANCEL); + gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), + GTK_MESSAGE_WARNING); +#endif + + hbox_content = gtk_hbox_new (FALSE, 8); + + image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); + gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); + + vbox = gtk_vbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); + + primary_text = g_strdup_printf (_("This file (%s) is already open in another gedit window."), uri_for_display); + g_free (uri_for_display); + + primary_markup = g_strdup_printf ("%s", primary_text); + g_free (primary_text); + primary_label = gtk_label_new (primary_markup); + g_free (primary_markup); + gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5); + GTK_WIDGET_SET_FLAGS (primary_label, GTK_CAN_FOCUS); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + secondary_text = _("gedit opened this instance of the file in a non-editable way. " + "Do you want to edit it anyway?"); + secondary_markup = g_strdup_printf ("%s", + secondary_text); + secondary_label = gtk_label_new (secondary_markup); + g_free (secondary_markup); + gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS (secondary_label, GTK_CAN_FOCUS); + gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); + + gtk_widget_show_all (hbox_content); + set_contents (message_area, hbox_content); + + return message_area; +} + +GtkWidget * +gedit_externally_modified_saving_error_message_area_new ( + const gchar *uri, + const GError *error) +{ + GtkWidget *message_area; + GtkWidget *hbox_content; + GtkWidget *image; + GtkWidget *vbox; + gchar *primary_markup; + gchar *secondary_markup; + GtkWidget *primary_label; + GtkWidget *secondary_label; + gchar *primary_text; + const gchar *secondary_text; + gchar *full_formatted_uri; + gchar *uri_for_display; + gchar *temp_uri_for_display; + + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (error->domain == GEDIT_DOCUMENT_ERROR, NULL); + g_return_val_if_fail (error->code == GEDIT_DOCUMENT_ERROR_EXTERNALLY_MODIFIED, NULL); + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + +#if !GTK_CHECK_VERSION (2, 17, 1) + message_area = gedit_message_area_new (); + gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (message_area), + _("S_ave Anyway"), + GTK_STOCK_SAVE, + GTK_RESPONSE_YES); + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + _("D_on't Save"), + GTK_RESPONSE_CANCEL); +#else + message_area = gtk_info_bar_new (); + + info_bar_add_stock_button_with_text (GTK_INFO_BAR (message_area), + _("S_ave Anyway"), + GTK_STOCK_SAVE, + GTK_RESPONSE_YES); + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + _("D_on't Save"), + GTK_RESPONSE_CANCEL); + gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), + GTK_MESSAGE_WARNING); +#endif + + hbox_content = gtk_hbox_new (FALSE, 8); + + image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); + gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); + + vbox = gtk_vbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); + + // FIXME: review this message, it's not clear since for the user the "modification" + // could be interpreted as the changes he made in the document. beside "reading" is + // not accurate (since last load/save) + primary_text = g_strdup_printf (_("The file %s has been modified since reading it."), + uri_for_display); + g_free (uri_for_display); + + primary_markup = g_strdup_printf ("%s", primary_text); + g_free (primary_text); + primary_label = gtk_label_new (primary_markup); + g_free (primary_markup); + gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5); + GTK_WIDGET_SET_FLAGS (primary_label, GTK_CAN_FOCUS); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + secondary_text = _("If you save it, all the external changes could be lost. Save it anyway?"); + secondary_markup = g_strdup_printf ("%s", + secondary_text); + secondary_label = gtk_label_new (secondary_markup); + g_free (secondary_markup); + gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS (secondary_label, GTK_CAN_FOCUS); + gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); + + gtk_widget_show_all (hbox_content); + set_contents (message_area, hbox_content); + + return message_area; +} + +GtkWidget * +gedit_no_backup_saving_error_message_area_new (const gchar *uri, + const GError *error) +{ + GtkWidget *message_area; + GtkWidget *hbox_content; + GtkWidget *image; + GtkWidget *vbox; + gchar *primary_markup; + gchar *secondary_markup; + GtkWidget *primary_label; + GtkWidget *secondary_label; + gchar *primary_text; + const gchar *secondary_text; + gchar *full_formatted_uri; + gchar *uri_for_display; + gchar *temp_uri_for_display; + + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (((error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP) || + (error->domain == G_IO_ERROR && + error->code == G_IO_ERROR_CANT_CREATE_BACKUP)), NULL); + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + +#if !GTK_CHECK_VERSION (2, 17, 1) + message_area = gedit_message_area_new (); + gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (message_area), + _("S_ave Anyway"), + GTK_STOCK_SAVE, + GTK_RESPONSE_YES); + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + _("D_on't Save"), + GTK_RESPONSE_CANCEL); +#else + message_area = gtk_info_bar_new (); + + info_bar_add_stock_button_with_text (GTK_INFO_BAR (message_area), + _("S_ave Anyway"), + GTK_STOCK_SAVE, + GTK_RESPONSE_YES); + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + _("D_on't Save"), + GTK_RESPONSE_CANCEL); + gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), + GTK_MESSAGE_WARNING); +#endif + + hbox_content = gtk_hbox_new (FALSE, 8); + + image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); + gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); + + vbox = gtk_vbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); + + // FIXME: review this messages + + if (gedit_prefs_manager_get_create_backup_copy ()) + primary_text = g_strdup_printf (_("Could not create a backup file while saving %s"), + uri_for_display); + else + primary_text = g_strdup_printf (_("Could not create a temporary backup file while saving %s"), + uri_for_display); + + g_free (uri_for_display); + + primary_markup = g_strdup_printf ("%s", primary_text); + g_free (primary_text); + primary_label = gtk_label_new (primary_markup); + g_free (primary_markup); + gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5); + GTK_WIDGET_SET_FLAGS (primary_label, GTK_CAN_FOCUS); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + secondary_text = _("gedit could not back up the old copy of the file before saving the new one. " + "You can ignore this warning and save the file anyway, but if an error " + "occurs while saving, you could lose the old copy of the file. Save anyway?"); + secondary_markup = g_strdup_printf ("%s", + secondary_text); + secondary_label = gtk_label_new (secondary_markup); + g_free (secondary_markup); + gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS (secondary_label, GTK_CAN_FOCUS); + gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); + + gtk_widget_show_all (hbox_content); + set_contents (message_area, hbox_content); + + return message_area; +} + +GtkWidget * +gedit_unrecoverable_saving_error_message_area_new (const gchar *uri, + const GError *error) +{ + gchar *error_message = NULL; + gchar *message_details = NULL; + gchar *full_formatted_uri; + gchar *scheme_string; + gchar *scheme_markup; + gchar *uri_for_display; + gchar *temp_uri_for_display; + GtkWidget *message_area; + + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail ((error->domain == GEDIT_DOCUMENT_ERROR) || + (error->domain == G_IO_ERROR), NULL); + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + + if (is_gio_error (error, G_IO_ERROR_NOT_SUPPORTED)) + { + scheme_string = g_uri_parse_scheme (uri); + + if ((scheme_string != NULL) && g_utf8_validate (scheme_string, -1, NULL)) + { + scheme_markup = g_markup_printf_escaped ("%s:", scheme_string); + + /* Translators: %s is a URI scheme (like for example http:, ftp:, etc.) */ + message_details = g_strdup_printf (_("gedit cannot handle %s locations in write mode. " + "Please check that you typed the " + "location correctly and try again."), + scheme_markup); + g_free (scheme_markup); + } + else + { + message_details = g_strdup (_("gedit cannot handle this location in write mode. " + "Please check that you typed the " + "location correctly and try again.")); + } + + g_free (scheme_string); + } + else if (is_gio_error (error, G_IO_ERROR_INVALID_FILENAME)) + { + message_details = g_strdup (_("%s is not a valid location. " + "Please check that you typed the " + "location correctly and try again.")); + } + else if (is_gio_error (error, G_IO_ERROR_PERMISSION_DENIED)) + { + message_details = g_strdup (_("You do not have the permissions necessary to save the file. " + "Please check that you typed the " + "location correctly and try again.")); + } + else if (is_gio_error (error, G_IO_ERROR_NO_SPACE)) + { + message_details = g_strdup (_("There is not enough disk space to save the file. " + "Please free some disk space and try again.")); + } + else if (is_gio_error (error, G_IO_ERROR_READ_ONLY)) + { + message_details = g_strdup (_("You are trying to save the file on a read-only disk. " + "Please check that you typed the location " + "correctly and try again.")); + } + else if (is_gio_error (error, G_IO_ERROR_EXISTS)) + { + message_details = g_strdup (_("A file with the same name already exists. " + "Please use a different name.")); + } + else if (is_gio_error (error, G_IO_ERROR_FILENAME_TOO_LONG)) + { + message_details = g_strdup (_("The disk where you are trying to save the file has " + "a limitation on length of the file names. " + "Please use a shorter name.")); + } + else if (error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_TOO_BIG) + { + message_details = g_strdup (_("The disk where you are trying to save the file has " + "a limitation on file sizes. Please try saving " + "a smaller file or saving it to a disk that does not " + "have this limitation.")); + } + else + { + parse_error (error, + &error_message, + &message_details, + uri, + uri_for_display); + } + + if (error_message == NULL) + { + error_message = g_strdup_printf (_("Could not save the file %s."), + uri_for_display); + } + + message_area = create_io_loading_error_message_area (error_message, + message_details, + FALSE); + + g_free (uri_for_display); + g_free (error_message); + g_free (message_details); + + return message_area; +} + +GtkWidget * +gedit_externally_modified_message_area_new (const gchar *uri, + gboolean document_modified) +{ + gchar *full_formatted_uri; + gchar *uri_for_display; + gchar *temp_uri_for_display; + const gchar *primary_text; + const gchar *secondary_text; + GtkWidget *message_area; + + g_return_val_if_fail (uri != NULL, NULL); + + full_formatted_uri = gedit_utils_uri_for_display (uri); + + /* Truncate the URI so it doesn't get insanely wide. Note that even + * though the dialog uses wrapped text, if the URI doesn't contain + * white space then the text-wrapping code is too stupid to wrap it. + */ + temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri, + MAX_URI_IN_DIALOG_LENGTH); + g_free (full_formatted_uri); + + uri_for_display = g_markup_printf_escaped ("%s", temp_uri_for_display); + g_free (temp_uri_for_display); + + // FIXME: review this message, it's not clear since for the user the "modification" + // could be interpreted as the changes he made in the document. beside "reading" is + // not accurate (since last load/save) + primary_text = g_strdup_printf (_("The file %s changed on disk."), + uri_for_display); + g_free (uri_for_display); + + if (document_modified) + secondary_text = _("Do you want to drop your changes and reload the file?"); + else + secondary_text = _("Do you want to reload the file?"); + +#if !GTK_CHECK_VERSION (2, 17, 1) + message_area = gedit_message_area_new (); + + gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (message_area), + _("_Reload"), + GTK_STOCK_REFRESH, + GTK_RESPONSE_OK); + + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (message_area), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); +#else + message_area = gtk_info_bar_new (); + + info_bar_add_stock_button_with_text (GTK_INFO_BAR (message_area), + _("_Reload"), + GTK_STOCK_REFRESH, + GTK_RESPONSE_OK); + gtk_info_bar_add_button (GTK_INFO_BAR (message_area), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), + GTK_MESSAGE_WARNING); +#endif + + set_message_area_text_and_icon (message_area, + "gtk-dialog-warning", + primary_text, + secondary_text); + + return message_area; +} + diff --git a/gedit/gedit-io-error-message-area.h b/gedit/gedit-io-error-message-area.h new file mode 100755 index 00000000..69a4d90e --- /dev/null +++ b/gedit/gedit-io-error-message-area.h @@ -0,0 +1,68 @@ +/* + * gedit-io-error-message-area.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_IO_ERROR_MESSAGE_AREA_H__ +#define __GEDIT_IO_ERROR_MESSAGE_AREA_H__ + +#include + +G_BEGIN_DECLS + +GtkWidget *gedit_io_loading_error_message_area_new (const gchar *uri, + const GeditEncoding *encoding, + const GError *error); + +GtkWidget *gedit_unrecoverable_reverting_error_message_area_new (const gchar *uri, + const GError *error); + +GtkWidget *gedit_conversion_error_while_saving_message_area_new (const gchar *uri, + const GeditEncoding *encoding, + const GError *error); + +const GeditEncoding + *gedit_conversion_error_message_area_get_encoding (GtkWidget *message_area); + +GtkWidget *gedit_file_already_open_warning_message_area_new (const gchar *uri); + +GtkWidget *gedit_externally_modified_saving_error_message_area_new (const gchar *uri, + const GError *error); + +GtkWidget *gedit_no_backup_saving_error_message_area_new (const gchar *uri, + const GError *error); + +GtkWidget *gedit_unrecoverable_saving_error_message_area_new (const gchar *uri, + const GError *error); + +GtkWidget *gedit_externally_modified_message_area_new (const gchar *uri, + gboolean document_modified); + +G_END_DECLS + +#endif /* __GEDIT_IO_ERROR_MESSAGE_AREA_H__ */ diff --git a/gedit/gedit-language-manager.c b/gedit/gedit-language-manager.c new file mode 100755 index 00000000..a402e4a5 --- /dev/null +++ b/gedit/gedit-language-manager.c @@ -0,0 +1,90 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-languages-manager.c + * This file is part of gedit + * + * Copyright (C) 2003-2006 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003-2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#include + +#include "gedit-language-manager.h" +#include "gedit-prefs-manager.h" +#include "gedit-utils.h" +#include "gedit-debug.h" + +static GtkSourceLanguageManager *language_manager = NULL; + +GtkSourceLanguageManager * +gedit_get_language_manager (void) +{ + if (language_manager == NULL) + { + language_manager = gtk_source_language_manager_new (); + } + + return language_manager; +} + +static gint +language_compare (gconstpointer a, gconstpointer b) +{ + GtkSourceLanguage *lang_a = (GtkSourceLanguage *)a; + GtkSourceLanguage *lang_b = (GtkSourceLanguage *)b; + const gchar *name_a = gtk_source_language_get_name (lang_a); + const gchar *name_b = gtk_source_language_get_name (lang_b); + + return g_utf8_collate (name_a, name_b); +} + +GSList * +gedit_language_manager_list_languages_sorted (GtkSourceLanguageManager *lm, + gboolean include_hidden) +{ + GSList *languages = NULL; + const gchar * const *ids; + + ids = gtk_source_language_manager_get_language_ids (lm); + if (ids == NULL) + return NULL; + + while (*ids != NULL) + { + GtkSourceLanguage *lang; + + lang = gtk_source_language_manager_get_language (lm, *ids); + g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE (lang), NULL); + ++ids; + + if (include_hidden || !gtk_source_language_get_hidden (lang)) + { + languages = g_slist_prepend (languages, lang); + } + } + + return g_slist_sort (languages, (GCompareFunc)language_compare); +} + diff --git a/gedit/gedit-language-manager.h b/gedit/gedit-language-manager.h new file mode 100755 index 00000000..02438d32 --- /dev/null +++ b/gedit/gedit-language-manager.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-languages-manager.h + * This file is part of gedit + * + * Copyright (C) 2003-2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_LANGUAGES_MANAGER_H__ +#define __GEDIT_LANGUAGES_MANAGER_H__ + +#include + +G_BEGIN_DECLS + +GtkSourceLanguageManager *gedit_get_language_manager (void); + +GSList *gedit_language_manager_list_languages_sorted + (GtkSourceLanguageManager *lm, + gboolean include_hidden); + +G_END_DECLS + +#endif /* __GEDIT_LANGUAGES_MANAGER_H__ */ diff --git a/gedit/gedit-marshal.list b/gedit/gedit-marshal.list new file mode 100755 index 00000000..d2882947 --- /dev/null +++ b/gedit/gedit-marshal.list @@ -0,0 +1,13 @@ +BOOLEAN:NONE +BOOLEAN:OBJECT +VOID:BOOLEAN +VOID:BOOLEAN,POINTER +VOID:BOXED,BOXED +VOID:OBJECT +VOID:POINTER +VOID:STRING,BOXED,FLAGS +VOID:STRING,BOXED,INT,BOOLEAN +VOID:UINT,POINTER +VOID:UINT64,UINT64 +VOID:VOID +VOID:INT,INT diff --git a/gedit/gedit-message-area.c b/gedit/gedit-message-area.c new file mode 100755 index 00000000..09240515 --- /dev/null +++ b/gedit/gedit-message-area.c @@ -0,0 +1,626 @@ +/* + * gedit-message-area.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +/* TODO: Style properties */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include "gedit-message-area.h" + +#define GEDIT_MESSAGE_AREA_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_MESSAGE_AREA, \ + GeditMessageAreaPrivate)) + +struct _GeditMessageAreaPrivate +{ + GtkWidget *main_hbox; + + GtkWidget *contents; + GtkWidget *action_area; + + gboolean changing_style; +}; + +typedef struct _ResponseData ResponseData; + +struct _ResponseData +{ + gint response_id; +}; + +enum { + RESPONSE, + CLOSE, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL]; + +G_DEFINE_TYPE(GeditMessageArea, gedit_message_area, GTK_TYPE_HBOX) + + +static void +gedit_message_area_finalize (GObject *object) +{ + /* + GeditMessageArea *message_area = GEDIT_MESSAGE_AREA (object); + */ + + G_OBJECT_CLASS (gedit_message_area_parent_class)->finalize (object); +} + +static ResponseData * +get_response_data (GtkWidget *widget, + gboolean create) +{ + ResponseData *ad = g_object_get_data (G_OBJECT (widget), + "gedit-message-area-response-data"); + + if (ad == NULL && create) + { + ad = g_new (ResponseData, 1); + + g_object_set_data_full (G_OBJECT (widget), + "gedit-message-area-response-data", + ad, + g_free); + } + + return ad; +} + +static GtkWidget * +find_button (GeditMessageArea *message_area, + gint response_id) +{ + GList *children, *tmp_list; + GtkWidget *child = NULL; + + children = gtk_container_get_children ( + GTK_CONTAINER (message_area->priv->action_area)); + + for (tmp_list = children; tmp_list; tmp_list = tmp_list->next) + { + ResponseData *rd = get_response_data (tmp_list->data, FALSE); + + if (rd && rd->response_id == response_id) + { + child = tmp_list->data; + break; + } + } + + g_list_free (children); + + return child; +} + +static void +gedit_message_area_close (GeditMessageArea *message_area) +{ + if (!find_button (message_area, GTK_RESPONSE_CANCEL)) + return; + + /* emit response signal */ + gedit_message_area_response (GEDIT_MESSAGE_AREA (message_area), + GTK_RESPONSE_CANCEL); +} + +static gboolean +paint_message_area (GtkWidget *widget, + GdkEventExpose *event, + gpointer user_data) +{ + gtk_paint_flat_box (widget->style, + widget->window, + GTK_STATE_NORMAL, + GTK_SHADOW_OUT, + NULL, + widget, + "tooltip", + widget->allocation.x + 1, + widget->allocation.y + 1, + widget->allocation.width - 2, + widget->allocation.height - 2); + + return FALSE; +} + +static void +gedit_message_area_class_init (GeditMessageAreaClass *klass) +{ + GObjectClass *object_class; + GtkBindingSet *binding_set; + + object_class = G_OBJECT_CLASS (klass); + object_class->finalize = gedit_message_area_finalize; + + klass->close = gedit_message_area_close; + + g_type_class_add_private (object_class, sizeof(GeditMessageAreaPrivate)); + + signals[RESPONSE] = g_signal_new ("response", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditMessageAreaClass, response), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + signals[CLOSE] = g_signal_new ("close", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditMessageAreaClass, close), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + binding_set = gtk_binding_set_by_class (klass); + + gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "close", 0); +} + +static void +style_set (GtkWidget *widget, + GtkStyle *prev_style, + GeditMessageArea *message_area) +{ + GtkWidget *window; + GtkStyle *style; + + if (message_area->priv->changing_style) + return; + + /* This is a hack needed to use the tooltip background color */ + window = gtk_window_new (GTK_WINDOW_POPUP); + gtk_widget_set_name (window, "gtk-tooltip"); + gtk_widget_ensure_style (window); + style = gtk_widget_get_style (window); + + message_area->priv->changing_style = TRUE; + gtk_widget_set_style (GTK_WIDGET (message_area), style); + message_area->priv->changing_style = FALSE; + + gtk_widget_destroy (window); + + gtk_widget_queue_draw (GTK_WIDGET (message_area)); +} + +static void +gedit_message_area_init (GeditMessageArea *message_area) +{ + message_area->priv = GEDIT_MESSAGE_AREA_GET_PRIVATE (message_area); + + message_area->priv->main_hbox = gtk_hbox_new (FALSE, 16); /* FIXME: use style properties */ + gtk_widget_show (message_area->priv->main_hbox); + gtk_container_set_border_width (GTK_CONTAINER (message_area->priv->main_hbox), + 8); /* FIXME: use style properties */ + + message_area->priv->action_area = gtk_vbox_new (TRUE, 10); /* FIXME: use style properties */ + gtk_widget_show (message_area->priv->action_area); + gtk_box_pack_end (GTK_BOX (message_area->priv->main_hbox), + message_area->priv->action_area, + FALSE, + TRUE, + 0); + + gtk_box_pack_start (GTK_BOX (message_area), + message_area->priv->main_hbox, + TRUE, + TRUE, + 0); + + gtk_widget_set_app_paintable (GTK_WIDGET (message_area), TRUE); + + g_signal_connect (message_area, + "expose-event", + G_CALLBACK (paint_message_area), + NULL); + + /* Note that we connect to style-set on one of the internal + * widgets, not on the message area itself, since gtk does + * not deliver any further style-set signals for a widget on + * which the style has been forced with gtk_widget_set_style() */ + g_signal_connect (message_area->priv->main_hbox, + "style-set", + G_CALLBACK (style_set), + message_area); +} + +static gint +get_response_for_widget (GeditMessageArea *message_area, + GtkWidget *widget) +{ + ResponseData *rd; + + rd = get_response_data (widget, FALSE); + if (!rd) + return GTK_RESPONSE_NONE; + else + return rd->response_id; +} + +static void +action_widget_activated (GtkWidget *widget, GeditMessageArea *message_area) +{ + gint response_id; + + response_id = get_response_for_widget (message_area, widget); + + gedit_message_area_response (message_area, response_id); +} + +void +gedit_message_area_add_action_widget (GeditMessageArea *message_area, + GtkWidget *child, + gint response_id) +{ + ResponseData *ad; + guint signal_id; + + g_return_if_fail (GEDIT_IS_MESSAGE_AREA (message_area)); + g_return_if_fail (GTK_IS_WIDGET (child)); + + ad = get_response_data (child, TRUE); + + ad->response_id = response_id; + + if (GTK_IS_BUTTON (child)) + signal_id = g_signal_lookup ("clicked", GTK_TYPE_BUTTON); + else + signal_id = GTK_WIDGET_GET_CLASS (child)->activate_signal; + + if (signal_id) + { + GClosure *closure; + + closure = g_cclosure_new_object (G_CALLBACK (action_widget_activated), + G_OBJECT (message_area)); + + g_signal_connect_closure_by_id (child, + signal_id, + 0, + closure, + FALSE); + } + else + g_warning ("Only 'activatable' widgets can be packed into the action area of a GeditMessageArea"); + + if (response_id != GTK_RESPONSE_HELP) + gtk_box_pack_start (GTK_BOX (message_area->priv->action_area), + child, + FALSE, + FALSE, + 0); + else + gtk_box_pack_end (GTK_BOX (message_area->priv->action_area), + child, + FALSE, + FALSE, + 0); +} + +/** + * gedit_message_area_set_contents: + * @message_area: a #GeditMessageArea + * @contents: widget you want to add to the contents area + * + * Adds the @contents widget to the contents area of #GeditMessageArea. + */ +void +gedit_message_area_set_contents (GeditMessageArea *message_area, + GtkWidget *contents) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_AREA (message_area)); + g_return_if_fail (GTK_IS_WIDGET (contents)); + + message_area->priv->contents = contents; + gtk_box_pack_start (GTK_BOX (message_area->priv->main_hbox), + message_area->priv->contents, + TRUE, + TRUE, + 0); +} + +/** + * gedit_message_area_add_button: + * @message_area: a #GeditMessageArea + * @button_text: text of button, or stock ID + * @response_id: response ID for the button + * + * Adds a button with the given text (or a stock button, if button_text is a stock ID) + * and sets things up so that clicking the button will emit the "response" signal + * with the given response_id. The button is appended to the end of the message area's + * action area. The button widget is returned, but usually you don't need it. + * + * Returns: the button widget that was added + */ +GtkWidget* +gedit_message_area_add_button (GeditMessageArea *message_area, + const gchar *button_text, + gint response_id) +{ + GtkWidget *button; + + g_return_val_if_fail (GEDIT_IS_MESSAGE_AREA (message_area), NULL); + g_return_val_if_fail (button_text != NULL, NULL); + + button = gtk_button_new_from_stock (button_text); + + GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); + + gtk_widget_show (button); + + gedit_message_area_add_action_widget (message_area, + button, + response_id); + + return button; +} + +static void +add_buttons_valist (GeditMessageArea *message_area, + const gchar *first_button_text, + va_list args) +{ + const gchar* text; + gint response_id; + + g_return_if_fail (GEDIT_IS_MESSAGE_AREA (message_area)); + + if (first_button_text == NULL) + return; + + text = first_button_text; + response_id = va_arg (args, gint); + + while (text != NULL) + { + gedit_message_area_add_button (message_area, + text, + response_id); + + text = va_arg (args, gchar*); + if (text == NULL) + break; + + response_id = va_arg (args, int); + } +} + +/** + * gedit_message_area_add_buttons: + * @message_area: a #GeditMessageArea + * @first_button_text: button text or stock ID + * @...: response ID for first button, then more text-response_id pairs + * + * Adds more buttons, same as calling gedit_message_area_add_button() repeatedly. + * The variable argument list should be NULL-terminated as with + * gedit_message_area_new_with_buttons(). Each button must have both text and response ID. + */ +void +gedit_message_area_add_buttons (GeditMessageArea *message_area, + const gchar *first_button_text, + ...) +{ + va_list args; + + va_start (args, first_button_text); + + add_buttons_valist (message_area, + first_button_text, + args); + + va_end (args); +} + +/** + * gedit_message_area_new: + * + * Creates a new #GeditMessageArea object. + * + * Returns: a new #GeditMessageArea object + */ +GtkWidget * +gedit_message_area_new (void) +{ + return g_object_new (GEDIT_TYPE_MESSAGE_AREA, NULL); +} + +/** + * gedit_message_area_new_with_buttons: + * @first_button_text: stock ID or text to go in first button, or NULL + * @...: response ID for first button, then additional buttons, ending with NULL + * + * Creates a new #GeditMessageArea with buttons. Button text/response ID pairs + * should be listed, with a NULL pointer ending the list. Button text can be either + * a stock ID such as GTK_STOCK_OK, or some arbitrary text. A response ID can be any + * positive number, or one of the values in the GtkResponseType enumeration. If + * the user clicks one of these dialog buttons, GeditMessageArea will emit the "response" + * signal with the corresponding response ID. + * + * Returns: a new #GeditMessageArea + */ +GtkWidget * +gedit_message_area_new_with_buttons (const gchar *first_button_text, + ...) +{ + GeditMessageArea *message_area; + va_list args; + + message_area = GEDIT_MESSAGE_AREA (gedit_message_area_new ()); + + va_start (args, first_button_text); + + add_buttons_valist (message_area, + first_button_text, + args); + + va_end (args); + + return GTK_WIDGET (message_area); +} + +/** + * gedit_message_area_set_response_sensitive: + * @message_area: a #GeditMessageArea + * @response_id: a response ID + * @setting: TRUE for sensitive + * + * Calls gtk_widget_set_sensitive (widget, setting) for each widget in the dialog's + * action area with the given response_id. A convenient way to sensitize/desensitize + * dialog buttons. + */ +void +gedit_message_area_set_response_sensitive (GeditMessageArea *message_area, + gint response_id, + gboolean setting) +{ + GList *children; + GList *tmp_list; + + g_return_if_fail (GEDIT_IS_MESSAGE_AREA (message_area)); + + children = gtk_container_get_children (GTK_CONTAINER (message_area->priv->action_area)); + + tmp_list = children; + while (tmp_list != NULL) + { + GtkWidget *widget = tmp_list->data; + ResponseData *rd = get_response_data (widget, FALSE); + + if (rd && rd->response_id == response_id) + gtk_widget_set_sensitive (widget, setting); + + tmp_list = g_list_next (tmp_list); + } + + g_list_free (children); +} + +/** + * gedit_message_area_set_default_response: + * @message_area: a #GeditMessageArea + * @response_id: a response ID + * + * Sets the last widget in the message area's action area with the given response_id + * as the default widget for the dialog. Pressing "Enter" normally activates the + * default widget. + */ +void +gedit_message_area_set_default_response (GeditMessageArea *message_area, + gint response_id) +{ + GList *children; + GList *tmp_list; + + g_return_if_fail (GEDIT_IS_MESSAGE_AREA (message_area)); + + children = gtk_container_get_children (GTK_CONTAINER (message_area->priv->action_area)); + + tmp_list = children; + while (tmp_list != NULL) + { + GtkWidget *widget = tmp_list->data; + ResponseData *rd = get_response_data (widget, FALSE); + + if (rd && rd->response_id == response_id) + gtk_widget_grab_default (widget); + + tmp_list = g_list_next (tmp_list); + } + + g_list_free (children); +} + +/** + * gedit_message_area_set_default_response: + * @message_area: a #GeditMessageArea + * @response_id: a response ID + * + * Emits the 'response' signal with the given @response_id. + */ +void +gedit_message_area_response (GeditMessageArea *message_area, + gint response_id) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_AREA (message_area)); + + g_signal_emit (message_area, + signals[RESPONSE], + 0, + response_id); +} + +/** + * gedit_message_area_add_stock_button_with_text: + * @message_area: a #GeditMessageArea + * @text: the text to visualize in the button + * @stock_id: the stock ID of the button + * @response_id: a response ID + * + * Same as gedit_message_area_add_button() but with a specific text. + */ +GtkWidget * +gedit_message_area_add_stock_button_with_text (GeditMessageArea *message_area, + const gchar *text, + const gchar *stock_id, + gint response_id) +{ + GtkWidget *button; + + g_return_val_if_fail (GEDIT_IS_MESSAGE_AREA (message_area), NULL); + g_return_val_if_fail (text != NULL, NULL); + g_return_val_if_fail (stock_id != NULL, NULL); + + button = gtk_button_new_with_mnemonic (text); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_stock (stock_id, + GTK_ICON_SIZE_BUTTON)); + + GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); + + gtk_widget_show (button); + + gedit_message_area_add_action_widget (message_area, + button, + response_id); + + return button; +} + diff --git a/gedit/gedit-message-area.h b/gedit/gedit-message-area.h new file mode 100755 index 00000000..01dfff0c --- /dev/null +++ b/gedit/gedit-message-area.h @@ -0,0 +1,129 @@ +/* + * gedit-message-area.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_MESSAGE_AREA_H__ +#define __GEDIT_MESSAGE_AREA_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_MESSAGE_AREA (gedit_message_area_get_type()) +#define GEDIT_MESSAGE_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_MESSAGE_AREA, GeditMessageArea)) +#define GEDIT_MESSAGE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_MESSAGE_AREA, GeditMessageAreaClass)) +#define GEDIT_IS_MESSAGE_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_MESSAGE_AREA)) +#define GEDIT_IS_MESSAGE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_MESSAGE_AREA)) +#define GEDIT_MESSAGE_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_MESSAGE_AREA, GeditMessageAreaClass)) + +/* Private structure type */ +typedef struct _GeditMessageAreaPrivate GeditMessageAreaPrivate; + +/* + * Main object structure + */ +typedef struct _GeditMessageArea GeditMessageArea; + +struct _GeditMessageArea +{ + GtkHBox parent; + + /*< private > */ + GeditMessageAreaPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditMessageAreaClass GeditMessageAreaClass; + +struct _GeditMessageAreaClass +{ + GtkHBoxClass parent_class; + + /* Signals */ + void (* response) (GeditMessageArea *message_area, gint response_id); + + /* Keybinding signals */ + void (* close) (GeditMessageArea *message_area); + + /* Padding for future expansion */ + void (*_gedit_reserved1) (void); + void (*_gedit_reserved2) (void); +}; + +/* + * Public methods + */ +GType gedit_message_area_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_message_area_new (void); + +GtkWidget *gedit_message_area_new_with_buttons (const gchar *first_button_text, + ...); + +void gedit_message_area_set_contents (GeditMessageArea *message_area, + GtkWidget *contents); + +void gedit_message_area_add_action_widget (GeditMessageArea *message_area, + GtkWidget *child, + gint response_id); + +GtkWidget *gedit_message_area_add_button (GeditMessageArea *message_area, + const gchar *button_text, + gint response_id); + +GtkWidget *gedit_message_area_add_stock_button_with_text + (GeditMessageArea *message_area, + const gchar *text, + const gchar *stock_id, + gint response_id); + +void gedit_message_area_add_buttons (GeditMessageArea *message_area, + const gchar *first_button_text, + ...); + +void gedit_message_area_set_response_sensitive + (GeditMessageArea *message_area, + gint response_id, + gboolean setting); +void gedit_message_area_set_default_response + (GeditMessageArea *message_area, + gint response_id); + +/* Emit response signal */ +void gedit_message_area_response (GeditMessageArea *message_area, + gint response_id); + +G_END_DECLS + +#endif /* __GEDIT_MESSAGE_AREA_H__ */ diff --git a/gedit/gedit-message-bus.c b/gedit/gedit-message-bus.c new file mode 100755 index 00000000..bb6017a3 --- /dev/null +++ b/gedit/gedit-message-bus.c @@ -0,0 +1,1158 @@ +#include "gedit-message-bus.h" + +#include +#include +#include + +/** + * GeditMessageCallback: + * @bus: the #GeditMessageBus on which the message was sent + * @message: the #GeditMessage which was sent + * @userdata: the supplied user data when connecting the callback + * + * Callback signature used for connecting callback functions to be called + * when a message is received (see gedit_message_bus_connect()). + * + */ + +/** + * SECTION:gedit-message-bus + * @short_description: internal message communication bus + * @include: gedit/gedit-message-bus.h + * + * gedit has a communication bus very similar to DBus. Its primary use is to + * allow easy communication between plugins, but it can also be used to expose + * gedit functionality to external applications by providing DBus bindings for + * the internal gedit message bus. + * + * There are two different communication busses available. The default bus + * (see gedit_message_bus_get_default()) is an application wide communication + * bus. In addition, each #GeditWindow has a separate, private bus + * (see gedit_window_get_message_bus()). This makes it easier for plugins to + * communicate to other plugins in the same window. + * + * The concept of the message bus is very simple. You can register a message + * type on the bus, specified as a Method at a specific Object Path with a + * certain set of Method Arguments. You can then connect callback functions + * for this message type on the bus. Whenever a message with the Object Path + * and Method for which callbacks are connected is sent over the bus, the + * callbacks are called. There is no distinction between Methods and Signals + * (signals are simply messages where sender and receiver have switched places). + * + * + * Registering a message type + * + * GeditMessageBus *bus = gedit_message_bus_get_default (); + * + * // Register 'method' at '/plugins/example' with one required + * // string argument 'arg1' + * GeditMessageType *message_type = gedit_message_bus_register ("/plugins/example", "method", + * 0, + * "arg1", G_TYPE_STRING, + * NULL); + * + * + * + * Connecting a callback + * + * static void + * example_method_cb (GeditMessageBus *bus, + * GeditMessage *message, + * gpointer userdata) + * { + * gchar *arg1 = NULL; + * + * gedit_message_get (message, "arg1", &arg1, NULL); + * g_message ("Evoked /plugins/example.method with: %s", arg1); + * g_free (arg1); + * } + * + * GeditMessageBus *bus = gedit_message_bus_get_default (); + * + * guint id = gedit_message_bus_connect (bus, + * "/plugins/example", "method", + * example_method_cb, + * NULL, + * NULL); + * + * + * + * + * Sending a message + * + * GeditMessageBus *bus = gedit_message_bus_get_default (); + * + * gedit_message_bus_send (bus, + * "/plugins/example", "method", + * "arg1", "Hello World", + * NULL); + * + * + * + * Since: 2.25.3 + * + */ + +#define GEDIT_MESSAGE_BUS_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_MESSAGE_BUS, GeditMessageBusPrivate)) + +typedef struct +{ + gchar *object_path; + gchar *method; + + GList *listeners; +} Message; + +typedef struct +{ + guint id; + gboolean blocked; + + GDestroyNotify destroy_data; + GeditMessageCallback callback; + gpointer userdata; +} Listener; + +typedef struct +{ + Message *message; + GList *listener; +} IdMap; + +struct _GeditMessageBusPrivate +{ + GHashTable *messages; + GHashTable *idmap; + + GList *message_queue; + guint idle_id; + + guint next_id; + + GHashTable *types; /* mapping from identifier to GeditMessageType */ +}; + +/* signals */ +enum +{ + DISPATCH, + REGISTERED, + UNREGISTERED, + LAST_SIGNAL +}; + +static guint message_bus_signals[LAST_SIGNAL]; + +static void gedit_message_bus_dispatch_real (GeditMessageBus *bus, + GeditMessage *message); + +G_DEFINE_TYPE(GeditMessageBus, gedit_message_bus, G_TYPE_OBJECT) + +static void +listener_free (Listener *listener) +{ + if (listener->destroy_data) + listener->destroy_data (listener->userdata); + + g_free (listener); +} + +static void +message_free (Message *message) +{ + g_free (message->method); + g_free (message->object_path); + + g_list_foreach (message->listeners, (GFunc)listener_free, NULL); + g_list_free (message->listeners); + + g_free (message); +} + +static void +message_queue_free (GList *queue) +{ + g_list_foreach (queue, (GFunc)g_object_unref, NULL); + g_list_free (queue); +} + +static void +gedit_message_bus_finalize (GObject *object) +{ + GeditMessageBus *bus = GEDIT_MESSAGE_BUS (object); + + if (bus->priv->idle_id != 0) + g_source_remove (bus->priv->idle_id); + + message_queue_free (bus->priv->message_queue); + + g_hash_table_destroy (bus->priv->messages); + g_hash_table_destroy (bus->priv->idmap); + g_hash_table_destroy (bus->priv->types); + + G_OBJECT_CLASS (gedit_message_bus_parent_class)->finalize (object); +} + +static void +gedit_message_bus_class_init (GeditMessageBusClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_message_bus_finalize; + + klass->dispatch = gedit_message_bus_dispatch_real; + + /** + * GeditMessageBus::dispatch: + * @bus: a #GeditMessageBus + * @message: the #GeditMessage to dispatch + * + * The "dispatch" signal is emitted when a message is to be dispatched. + * The message is dispatched in the default handler of this signal. + * Primary use of this signal is to customize the dispatch of a message + * (for instance to automatically dispatch all messages over DBus). + *2 + */ + message_bus_signals[DISPATCH] = + g_signal_new ("dispatch", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditMessageBusClass, dispatch), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_MESSAGE); + + /** + * GeditMessageBus::registered: + * @bus: a #GeditMessageBus + * @message_type: the registered #GeditMessageType + * + * The "registered" signal is emitted when a message has been registered + * on the bus. + * + */ + message_bus_signals[REGISTERED] = + g_signal_new ("registered", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditMessageBusClass, registered), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, + 1, + GEDIT_TYPE_MESSAGE_TYPE); + + /** + * GeditMessageBus::unregistered: + * @bus: a #GeditMessageBus + * @message_type: the unregistered #GeditMessageType + * + * The "unregistered" signal is emitted when a message has been + * unregistered from the bus. + * + */ + message_bus_signals[UNREGISTERED] = + g_signal_new ("unregistered", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditMessageBusClass, unregistered), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, + 1, + GEDIT_TYPE_MESSAGE_TYPE); + + g_type_class_add_private (object_class, sizeof(GeditMessageBusPrivate)); +} + +static Message * +message_new (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method) +{ + Message *message = g_new (Message, 1); + + message->object_path = g_strdup (object_path); + message->method = g_strdup (method); + message->listeners = NULL; + + g_hash_table_insert (bus->priv->messages, + gedit_message_type_identifier (object_path, method), + message); + return message; +} + +static Message * +lookup_message (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + gboolean create) +{ + gchar *identifier; + Message *message; + + identifier = gedit_message_type_identifier (object_path, method); + message = (Message *)g_hash_table_lookup (bus->priv->messages, identifier); + g_free (identifier); + + if (!message && !create) + return NULL; + + if (!message) + message = message_new (bus, object_path, method); + + return message; +} + +static guint +add_listener (GeditMessageBus *bus, + Message *message, + GeditMessageCallback callback, + gpointer userdata, + GDestroyNotify destroy_data) +{ + Listener *listener; + IdMap *idmap; + + listener = g_new (Listener, 1); + listener->id = ++bus->priv->next_id; + listener->callback = callback; + listener->userdata = userdata; + listener->blocked = FALSE; + listener->destroy_data = destroy_data; + + message->listeners = g_list_append (message->listeners, listener); + + idmap = g_new (IdMap, 1); + idmap->message = message; + idmap->listener = g_list_last (message->listeners); + + g_hash_table_insert (bus->priv->idmap, GINT_TO_POINTER (listener->id), idmap); + return listener->id; +} + +static void +remove_listener (GeditMessageBus *bus, + Message *message, + GList *listener) +{ + Listener *lst; + + lst = (Listener *)listener->data; + + /* remove from idmap */ + g_hash_table_remove (bus->priv->idmap, GINT_TO_POINTER (lst->id)); + listener_free (lst); + + /* remove from list of listeners */ + message->listeners = g_list_delete_link (message->listeners, listener); + + if (!message->listeners) + { + /* remove message because it does not have any listeners */ + g_hash_table_remove (bus->priv->messages, message); + } +} + +static void +block_listener (GeditMessageBus *bus, + Message *message, + GList *listener) +{ + Listener *lst; + + lst = (Listener *)listener->data; + lst->blocked = TRUE; +} + +static void +unblock_listener (GeditMessageBus *bus, + Message *message, + GList *listener) +{ + Listener *lst; + + lst = (Listener *)listener->data; + lst->blocked = FALSE; +} + +static void +dispatch_message_real (GeditMessageBus *bus, + Message *msg, + GeditMessage *message) +{ + GList *item; + + for (item = msg->listeners; item; item = item->next) + { + Listener *listener = (Listener *)item->data; + + if (!listener->blocked) + listener->callback (bus, message, listener->userdata); + } +} + +static void +gedit_message_bus_dispatch_real (GeditMessageBus *bus, + GeditMessage *message) +{ + const gchar *object_path; + const gchar *method; + Message *msg; + + object_path = gedit_message_get_object_path (message); + method = gedit_message_get_method (message); + + msg = lookup_message (bus, object_path, method, FALSE); + + if (msg) + dispatch_message_real (bus, msg, message); +} + +static void +dispatch_message (GeditMessageBus *bus, + GeditMessage *message) +{ + g_signal_emit (bus, message_bus_signals[DISPATCH], 0, message); +} + +static gboolean +idle_dispatch (GeditMessageBus *bus) +{ + GList *list; + GList *item; + + /* make sure to set idle_id to 0 first so that any new async messages + will be queued properly */ + bus->priv->idle_id = 0; + + /* reverse queue to get correct delivery order */ + list = g_list_reverse (bus->priv->message_queue); + bus->priv->message_queue = NULL; + + for (item = list; item; item = item->next) + { + GeditMessage *msg = GEDIT_MESSAGE (item->data); + + dispatch_message (bus, msg); + } + + message_queue_free (list); + return FALSE; +} + +typedef void (*MatchCallback) (GeditMessageBus *, Message *, GList *); + +static void +process_by_id (GeditMessageBus *bus, + guint id, + MatchCallback processor) +{ + IdMap *idmap; + + idmap = (IdMap *)g_hash_table_lookup (bus->priv->idmap, GINT_TO_POINTER (id)); + + if (idmap == NULL) + { + g_warning ("No handler registered with id `%d'", id); + return; + } + + processor (bus, idmap->message, idmap->listener); +} + +static void +process_by_match (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata, + MatchCallback processor) +{ + Message *message; + GList *item; + + message = lookup_message (bus, object_path, method, FALSE); + + if (!message) + { + g_warning ("No such handler registered for %s.%s", object_path, method); + return; + } + + for (item = message->listeners; item; item = item->next) + { + Listener *listener = (Listener *)item->data; + + if (listener->callback == callback && + listener->userdata == userdata) + { + processor (bus, message, item); + return; + } + } + + g_warning ("No such handler registered for %s.%s", object_path, method); +} + +static void +gedit_message_bus_init (GeditMessageBus *self) +{ + self->priv = GEDIT_MESSAGE_BUS_GET_PRIVATE (self); + + self->priv->messages = g_hash_table_new_full (g_str_hash, + g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)message_free); + + self->priv->idmap = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + NULL, + (GDestroyNotify)g_free); + + self->priv->types = g_hash_table_new_full (g_str_hash, + g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)gedit_message_type_unref); +} + +/** + * gedit_message_bus_get_default: + * + * Get the default application #GeditMessageBus. + * + * Return value: the default #GeditMessageBus + * + */ +GeditMessageBus * +gedit_message_bus_get_default (void) +{ + static GeditMessageBus *default_bus = NULL; + + if (G_UNLIKELY (default_bus == NULL)) + { + default_bus = g_object_new (GEDIT_TYPE_MESSAGE_BUS, NULL); + g_object_add_weak_pointer (G_OBJECT (default_bus), + (gpointer) &default_bus); + } + + return default_bus; +} + +/** + * gedit_message_bus_new: + * + * Create a new message bus. Use gedit_message_bus_get_default() to get the + * default, application wide, message bus. Creating a new bus is useful for + * associating a specific bus with for instance a #GeditWindow. + * + * Return value: a new #GeditMessageBus + * + */ +GeditMessageBus * +gedit_message_bus_new (void) +{ + return GEDIT_MESSAGE_BUS (g_object_new (GEDIT_TYPE_MESSAGE_BUS, NULL)); +} + +/** + * gedit_message_bus_lookup: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * + * Get the registered #GeditMessageType for @method at @object_path. The + * returned #GeditMessageType is owned by the bus and should not be unreffed. + * + * Return value: the registered #GeditMessageType or %NULL if no message type + * is registered for @method at @object_path + * + */ +GeditMessageType * +gedit_message_bus_lookup (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method) +{ + gchar *identifier; + GeditMessageType *message_type; + + g_return_val_if_fail (GEDIT_IS_MESSAGE_BUS (bus), NULL); + g_return_val_if_fail (object_path != NULL, NULL); + g_return_val_if_fail (method != NULL, NULL); + + identifier = gedit_message_type_identifier (object_path, method); + message_type = GEDIT_MESSAGE_TYPE (g_hash_table_lookup (bus->priv->types, identifier)); + + g_free (identifier); + return message_type; +} + +/** + * gedit_message_bus_register: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method to register + * @num_optional: the number of optional arguments + * @...: NULL terminated list of key/gtype method argument pairs + * + * Register a message on the bus. A message must be registered on the bus before + * it can be send. This function registers the type arguments for @method at + * @object_path. The arguments are specified with the variable arguments which + * should contain pairs of const gchar *key and GType terminated by %NULL. The + * last @num_optional arguments are registered as optional (and are thus not + * required when sending a message). + * + * This function emits a #GeditMessageBus::registered signal. + * + * Return value: the registered #GeditMessageType. The returned reference is + * owned by the bus. If you want to keep it alive after + * unregistering, use gedit_message_type_ref(). + * + */ +GeditMessageType * +gedit_message_bus_register (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + guint num_optional, + ...) +{ + gchar *identifier; + gpointer data; + va_list var_args; + GeditMessageType *message_type; + + g_return_val_if_fail (GEDIT_IS_MESSAGE_BUS (bus), NULL); + g_return_val_if_fail (gedit_message_type_is_valid_object_path (object_path), NULL); + + if (gedit_message_bus_is_registered (bus, object_path, method)) + { + g_warning ("Message type for '%s.%s' is already registered", object_path, method); + return NULL; + } + + identifier = gedit_message_type_identifier (object_path, method); + data = g_hash_table_lookup (bus->priv->types, identifier); + + va_start (var_args, num_optional); + message_type = gedit_message_type_new_valist (object_path, + method, + num_optional, + var_args); + va_end (var_args); + + if (message_type) + { + g_hash_table_insert (bus->priv->types, identifier, message_type); + g_signal_emit (bus, message_bus_signals[REGISTERED], 0, message_type); + } + else + { + g_free (identifier); + } + + return message_type; +} + +static void +gedit_message_bus_unregister_real (GeditMessageBus *bus, + GeditMessageType *message_type, + gboolean remove_from_store) +{ + gchar *identifier; + + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + + identifier = gedit_message_type_identifier (gedit_message_type_get_object_path (message_type), + gedit_message_type_get_method (message_type)); + + /* Keep message type alive for signal emission */ + gedit_message_type_ref (message_type); + + if (!remove_from_store || g_hash_table_remove (bus->priv->types, identifier)) + g_signal_emit (bus, message_bus_signals[UNREGISTERED], 0, message_type); + + gedit_message_type_unref (message_type); + g_free (identifier); +} + +/** + * gedit_message_bus_unregister: + * @bus: a #GeditMessageBus + * @message_type: the #GeditMessageType to unregister + * + * Unregisters a previously registered message type. This is especially useful + * for plugins which should unregister message types when they are deactivated. + * + * This function emits the #GeditMessageBus::unregistered signal. + * + */ +void +gedit_message_bus_unregister (GeditMessageBus *bus, + GeditMessageType *message_type) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + gedit_message_bus_unregister_real (bus, message_type, TRUE); +} + +typedef struct +{ + GeditMessageBus *bus; + const gchar *object_path; +} UnregisterInfo; + +static gboolean +unregister_each (const gchar *identifier, + GeditMessageType *message_type, + UnregisterInfo *info) +{ + if (strcmp (gedit_message_type_get_object_path (message_type), + info->object_path) == 0) + { + gedit_message_bus_unregister_real (info->bus, message_type, FALSE); + return TRUE; + } + + return FALSE; +} + +/** + * gedit_message_bus_unregister_all: + * @bus: a #GeditMessageBus + * @object_path: the object path + * + * Unregisters all message types for @object_path. This is especially useful for + * plugins which should unregister message types when they are deactivated. + * + * This function emits the #GeditMessageBus::unregistered signal for all + * unregistered message types. + * + */ +void +gedit_message_bus_unregister_all (GeditMessageBus *bus, + const gchar *object_path) +{ + UnregisterInfo info = {bus, object_path}; + + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + g_return_if_fail (object_path != NULL); + + g_hash_table_foreach_remove (bus->priv->types, + (GHRFunc)unregister_each, + &info); +} + +/** + * gedit_message_bus_is_registered: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * + * Check whether a message type @method at @object_path is registered on the + * bus. + * + * Return value: %TRUE if the @method at @object_path is a registered message + * type on the bus + * + */ +gboolean +gedit_message_bus_is_registered (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method) +{ + gchar *identifier; + gboolean ret; + + g_return_val_if_fail (GEDIT_IS_MESSAGE_BUS (bus), FALSE); + g_return_val_if_fail (object_path != NULL, FALSE); + g_return_val_if_fail (method != NULL, FALSE); + + identifier = gedit_message_type_identifier (object_path, method); + ret = g_hash_table_lookup (bus->priv->types, identifier) != NULL; + + g_free(identifier); + return ret; +} + +typedef struct +{ + GeditMessageBusForeach func; + gpointer userdata; +} ForeachInfo; + +static void +foreach_type (const gchar *key, + GeditMessageType *message_type, + ForeachInfo *info) +{ + gedit_message_type_ref (message_type); + info->func (message_type, info->userdata); + gedit_message_type_unref (message_type); +} + +/** + * gedit_message_bus_foreach: + * @bus: the #GeditMessagebus + * @func: the callback function + * @userdata: the user data to supply to the callback function + * + * Calls @func for each message type registered on the bus + * + */ +void +gedit_message_bus_foreach (GeditMessageBus *bus, + GeditMessageBusForeach func, + gpointer userdata) +{ + ForeachInfo info = {func, userdata}; + + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + g_return_if_fail (func != NULL); + + g_hash_table_foreach (bus->priv->types, (GHFunc)foreach_type, &info); +} + +/** + * gedit_message_bus_connect: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * @callback: function to be called when message @method at @object_path is sent + * @userdata: userdata to use for the callback + * @destroy_data: function to evoke with @userdata as argument when @userdata + * needs to be freed + * + * Connect a callback handler to be evoked when message @method at @object_path + * is sent over the bus. + * + * Return value: the callback identifier + * + */ +guint +gedit_message_bus_connect (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata, + GDestroyNotify destroy_data) +{ + Message *message; + + g_return_val_if_fail (GEDIT_IS_MESSAGE_BUS (bus), 0); + g_return_val_if_fail (object_path != NULL, 0); + g_return_val_if_fail (method != NULL, 0); + g_return_val_if_fail (callback != NULL, 0); + + /* lookup the message and create if it does not exist yet */ + message = lookup_message (bus, object_path, method, TRUE); + + return add_listener (bus, message, callback, userdata, destroy_data); +} + +/** + * gedit_message_bus_disconnect: + * @bus: a #GeditMessageBus + * @id: the callback id as returned by gedit_message_bus_connect() + * + * Disconnects a previously connected message callback. + * + */ +void +gedit_message_bus_disconnect (GeditMessageBus *bus, + guint id) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + + process_by_id (bus, id, remove_listener); +} + +/** + * gedit_message_bus_disconnect_by_func: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * @callback: the connected callback + * @userdata: the userdata with which the callback was connected + * + * Disconnects a previously connected message callback by matching the + * provided callback function and userdata. See also + * gedit_message_bus_disconnect(). + * + */ +void +gedit_message_bus_disconnect_by_func (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + + process_by_match (bus, object_path, method, callback, userdata, remove_listener); +} + +/** + * gedit_message_bus_block: + * @bus: a #GeditMessageBus + * @id: the callback id + * + * Blocks evoking the callback specified by @id. Unblock the callback by + * using gedit_message_bus_unblock(). + * + */ +void +gedit_message_bus_block (GeditMessageBus *bus, + guint id) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + + process_by_id (bus, id, block_listener); +} + +/** + * gedit_message_bus_block_by_func: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * @callback: the callback to block + * @userdata: the userdata with which the callback was connected + * + * Blocks evoking the callback that matches provided @callback and @userdata. + * Unblock the callback using gedit_message_unblock_by_func(). + * + */ +void +gedit_message_bus_block_by_func (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + + process_by_match (bus, object_path, method, callback, userdata, block_listener); +} + +/** + * gedit_message_bus_unblock: + * @bus: a #GeditMessageBus + * @id: the callback id + * + * Unblocks the callback specified by @id. + * + */ +void +gedit_message_bus_unblock (GeditMessageBus *bus, + guint id) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + + process_by_id (bus, id, unblock_listener); +} + +/** + * gedit_message_bus_unblock_by_func: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * @callback: the callback to block + * @userdata: the userdata with which the callback was connected + * + * Unblocks the callback that matches provided @callback and @userdata. + * + */ +void +gedit_message_bus_unblock_by_func (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + + process_by_match (bus, object_path, method, callback, userdata, unblock_listener); +} + +static gboolean +validate_message (GeditMessage *message) +{ + if (!gedit_message_validate (message)) + { + g_warning ("Message '%s.%s' is invalid", gedit_message_get_object_path (message), + gedit_message_get_method (message)); + return FALSE; + } + + return TRUE; +} + +static void +send_message_real (GeditMessageBus *bus, + GeditMessage *message) +{ + if (!validate_message (message)) + { + return; + } + + bus->priv->message_queue = g_list_prepend (bus->priv->message_queue, + g_object_ref (message)); + + if (bus->priv->idle_id == 0) + bus->priv->idle_id = g_idle_add_full (G_PRIORITY_HIGH, + (GSourceFunc)idle_dispatch, + bus, + NULL); +} + +/** + * gedit_message_bus_send_message: + * @bus: a #GeditMessageBus + * @message: the message to send + * + * This sends the provided @message asynchronously over the bus. To send + * a message synchronously, use gedit_message_bus_send_message_sync(). The + * convenience function gedit_message_bus_send() can be used to easily send + * a message without constructing the message object explicitly first. + * + */ +void +gedit_message_bus_send_message (GeditMessageBus *bus, + GeditMessage *message) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + send_message_real (bus, message); +} + +static void +send_message_sync_real (GeditMessageBus *bus, + GeditMessage *message) +{ + if (!validate_message (message)) + { + return; + } + + dispatch_message (bus, message); +} + +/** + * gedit_message_bus_send_message_sync: + * @bus: a #GeditMessageBus + * @message: the message to send + * + * This sends the provided @message synchronously over the bus. To send + * a message asynchronously, use gedit_message_bus_send_message(). The + * convenience function gedit_message_bus_send_sync() can be used to easily send + * a message without constructing the message object explicitly first. + * + */ +void +gedit_message_bus_send_message_sync (GeditMessageBus *bus, + GeditMessage *message) +{ + g_return_if_fail (GEDIT_IS_MESSAGE_BUS (bus)); + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + send_message_sync_real (bus, message); +} + +static GeditMessage * +create_message (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + va_list var_args) +{ + GeditMessageType *message_type; + + message_type = gedit_message_bus_lookup (bus, object_path, method); + + if (!message_type) + { + g_warning ("Could not find message type for '%s.%s'", object_path, method); + return NULL; + } + + return gedit_message_type_instantiate_valist (message_type, + var_args); +} + +/** + * gedit_message_bus_send: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * @...: NULL terminated list of key/value pairs + * + * This provides a convenient way to quickly send a message @method at + * @object_path asynchronously over the bus. The variable argument list + * specifies key (string) value pairs used to construct the message arguments. + * To send a message synchronously use gedit_message_bus_send_sync(). + * + */ +void +gedit_message_bus_send (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + ...) +{ + va_list var_args; + GeditMessage *message; + + va_start (var_args, method); + + message = create_message (bus, object_path, method, var_args); + + if (message) + { + send_message_real (bus, message); + g_object_unref (message); + } + else + { + g_warning ("Could not instantiate message"); + } + + va_end (var_args); +} + +/** + * gedit_message_bus_send_sync: + * @bus: a #GeditMessageBus + * @object_path: the object path + * @method: the method + * @...: NULL terminated list of key/value pairs + * + * This provides a convenient way to quickly send a message @method at + * @object_path synchronously over the bus. The variable argument list + * specifies key (string) value pairs used to construct the message + * arguments. To send a message asynchronously use gedit_message_bus_send(). + * + * Return value: the constructed #GeditMessage. The caller owns a reference + * to the #GeditMessage and should call g_object_unref() when + * it is no longer needed + */ +GeditMessage * +gedit_message_bus_send_sync (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + ...) +{ + va_list var_args; + GeditMessage *message; + + va_start (var_args, method); + message = create_message (bus, object_path, method, var_args); + + if (message) + send_message_sync_real (bus, message); + + va_end (var_args); + + return message; +} + +// ex:ts=8:noet: diff --git a/gedit/gedit-message-bus.h b/gedit/gedit-message-bus.h new file mode 100755 index 00000000..b60eabd0 --- /dev/null +++ b/gedit/gedit-message-bus.h @@ -0,0 +1,129 @@ +#ifndef __GEDIT_MESSAGE_BUS_H__ +#define __GEDIT_MESSAGE_BUS_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_MESSAGE_BUS (gedit_message_bus_get_type ()) +#define GEDIT_MESSAGE_BUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_MESSAGE_BUS, GeditMessageBus)) +#define GEDIT_MESSAGE_BUS_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_MESSAGE_BUS, GeditMessageBus const)) +#define GEDIT_MESSAGE_BUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_MESSAGE_BUS, GeditMessageBusClass)) +#define GEDIT_IS_MESSAGE_BUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_MESSAGE_BUS)) +#define GEDIT_IS_MESSAGE_BUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_MESSAGE_BUS)) +#define GEDIT_MESSAGE_BUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_MESSAGE_BUS, GeditMessageBusClass)) + +typedef struct _GeditMessageBus GeditMessageBus; +typedef struct _GeditMessageBusClass GeditMessageBusClass; +typedef struct _GeditMessageBusPrivate GeditMessageBusPrivate; + +struct _GeditMessageBus { + GObject parent; + + GeditMessageBusPrivate *priv; +}; + +struct _GeditMessageBusClass { + GObjectClass parent_class; + + void (*dispatch) (GeditMessageBus *bus, + GeditMessage *message); + void (*registered) (GeditMessageBus *bus, + GeditMessageType *message_type); + void (*unregistered) (GeditMessageBus *bus, + GeditMessageType *message_type); +}; + +typedef void (* GeditMessageCallback) (GeditMessageBus *bus, + GeditMessage *message, + gpointer userdata); + +typedef void (* GeditMessageBusForeach) (GeditMessageType *message_type, + gpointer userdata); + +GType gedit_message_bus_get_type (void) G_GNUC_CONST; + +GeditMessageBus *gedit_message_bus_get_default (void); +GeditMessageBus *gedit_message_bus_new (void); + +/* registering messages */ +GeditMessageType *gedit_message_bus_lookup (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method); +GeditMessageType *gedit_message_bus_register (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + guint num_optional, + ...) G_GNUC_NULL_TERMINATED; + +void gedit_message_bus_unregister (GeditMessageBus *bus, + GeditMessageType *message_type); + +void gedit_message_bus_unregister_all (GeditMessageBus *bus, + const gchar *object_path); + +gboolean gedit_message_bus_is_registered (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method); + +void gedit_message_bus_foreach (GeditMessageBus *bus, + GeditMessageBusForeach func, + gpointer userdata); + + +/* connecting to message events */ +guint gedit_message_bus_connect (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata, + GDestroyNotify destroy_data); + +void gedit_message_bus_disconnect (GeditMessageBus *bus, + guint id); + +void gedit_message_bus_disconnect_by_func (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata); + +/* blocking message event callbacks */ +void gedit_message_bus_block (GeditMessageBus *bus, + guint id); +void gedit_message_bus_block_by_func (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata); + +void gedit_message_bus_unblock (GeditMessageBus *bus, + guint id); +void gedit_message_bus_unblock_by_func (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + GeditMessageCallback callback, + gpointer userdata); + +/* sending messages */ +void gedit_message_bus_send_message (GeditMessageBus *bus, + GeditMessage *message); +void gedit_message_bus_send_message_sync (GeditMessageBus *bus, + GeditMessage *message); + +void gedit_message_bus_send (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + ...) G_GNUC_NULL_TERMINATED; +GeditMessage *gedit_message_bus_send_sync (GeditMessageBus *bus, + const gchar *object_path, + const gchar *method, + ...) G_GNUC_NULL_TERMINATED; + +G_END_DECLS + +#endif /* __GEDIT_MESSAGE_BUS_H__ */ + +// ex:ts=8:noet: diff --git a/gedit/gedit-message-type.c b/gedit/gedit-message-type.c new file mode 100755 index 00000000..61e782b3 --- /dev/null +++ b/gedit/gedit-message-type.c @@ -0,0 +1,526 @@ +#include "gedit-message-type.h" + +/** + * SECTION:gedit-message-type + * @short_description: message type description + * @include: gedit/gedit-message-type.h + * + * A message type is a prototype description for a #GeditMessage used to + * transmit messages on a #GeditMessageBus. The message type describes + * the Object Path, Method and Arguments of the message. + * + * A message type can contain any number of required and optional arguments. + * To instantiate a #GeditMessage from a #GeditMessageType, use + * gedit_message_type_instantiate(). + * + * Registering a new message type on a #GeditMessageBus with + * gedit_message_bus_register() internally creates a new #GeditMessageType. When + * then using gedit_message_bus_send(), an actual instantiation of the + * registered type is internally created and send over the bus. + * + * + * + * // Defining a new message type + * GeditMessageType *message_type = gedit_message_type_new ("/plugins/example", + * "method", + * 0, + * "arg1", G_TYPE_STRING, + * NULL); + * + * // Instantiating an actual message from the type + * GeditMessage *message = gedit_message_type_instantiate (message_type, + * "arg1", "Hello World", + * NULL); + * + * + * + * Since: 2.25.3 + * + */ +typedef struct +{ + GType type; + gboolean required; +} ArgumentInfo; + +struct _GeditMessageType +{ + gint ref_count; + + gchar *object_path; + gchar *method; + + guint num_arguments; + guint num_required; + + GHashTable *arguments; // mapping of key -> ArgumentInfo +}; + +/** + * gedit_message_type_ref: + * @message_type: the #GeditMessageType + * + * Increases the reference count on @message_type. + * + * Return value: @message_type + * + */ +GeditMessageType * +gedit_message_type_ref (GeditMessageType *message_type) +{ + g_return_val_if_fail (message_type != NULL, NULL); + g_atomic_int_inc (&message_type->ref_count); + + return message_type; +} + +/** + * gedit_message_type_unref: + * @message_type: the #GeditMessageType + * + * Decreases the reference count on @message_type. When the reference count + * drops to 0, @message_type is destroyed. + * + */ +void +gedit_message_type_unref (GeditMessageType *message_type) +{ + g_return_if_fail (message_type != NULL); + + if (!g_atomic_int_dec_and_test (&message_type->ref_count)) + return; + + g_free (message_type->object_path); + g_free (message_type->method); + + g_hash_table_destroy (message_type->arguments); + g_free (message_type); +} + +/** + * gedit_message_type_get_type: + * + * Retrieves the GType object which is associated with the + * #GeditMessageType class. + * + * Return value: the GType associated with #GeditMessageType. + **/ +GType +gedit_message_type_get_type (void) +{ + static GType our_type = 0; + + if (!our_type) + our_type = g_boxed_type_register_static ( + "GeditMessageType", + (GBoxedCopyFunc) gedit_message_type_ref, + (GBoxedFreeFunc) gedit_message_type_unref); + + return our_type; +} + +/** + * gedit_message_type_identifier: + * @object_path: the object path + * @method: the method + * + * Get the string identifier for @method at @object_path. + * + * Return value: the identifier for @method at @object_path + * + */ +gchar * +gedit_message_type_identifier (const gchar *object_path, + const gchar *method) +{ + return g_strconcat (object_path, ".", method, NULL); +} + +/** + * gedit_message_type_is_valid_object_path: + * @object_path: the object path + * + * Returns whether @object_path is a valid object path + * + * Return value: %TRUE if @object_path is a valid object path + * + */ +gboolean +gedit_message_type_is_valid_object_path (const gchar *object_path) +{ + if (!object_path) + return FALSE; + + /* needs to start with / */ + if (*object_path != '/') + return FALSE; + + while (*object_path) + { + if (*object_path == '/') + { + ++object_path; + + if (!*object_path || !(g_ascii_isalpha (*object_path) || *object_path == '_')) + return FALSE; + } + else if (!(g_ascii_isalnum (*object_path) || *object_path == '_')) + { + return FALSE; + } + + ++object_path; + } + + return TRUE; +} + +/** + * gedit_message_type_is_supported: + * @type: the #GType + * + * Returns if @type is #GType supported by the message system. + * + * Return value: %TRUE if @type is a supported #GType + * + */ +gboolean +gedit_message_type_is_supported (GType type) +{ + gint i = 0; + + static const GType type_list[] = + { + G_TYPE_BOOLEAN, + G_TYPE_CHAR, + G_TYPE_UCHAR, + G_TYPE_INT, + G_TYPE_UINT, + G_TYPE_LONG, + G_TYPE_ULONG, + G_TYPE_INT64, + G_TYPE_UINT64, + G_TYPE_ENUM, + G_TYPE_FLAGS, + G_TYPE_FLOAT, + G_TYPE_DOUBLE, + G_TYPE_STRING, + G_TYPE_POINTER, + G_TYPE_BOXED, + G_TYPE_OBJECT, + G_TYPE_INVALID + }; + + if (!G_TYPE_IS_VALUE_TYPE (type)) + return FALSE; + + while (type_list[i] != G_TYPE_INVALID) + { + if (g_type_is_a (type, type_list[i])) + return TRUE; + i++; + } + + return FALSE; +} + +/** + * gedit_message_type_new_valist: + * @object_path: the object path + * @method: the method + * @num_optional: number of optional arguments + * @var_args: key/gtype pair variable argument list + * + * Create a new #GeditMessageType for @method at @object_path. Argument names + * and values are supplied by the NULL terminated variable argument list. + * The last @num_optional provided arguments are considered optional. + * + * Return value: the newly constructed #GeditMessageType + * + */ +GeditMessageType * +gedit_message_type_new_valist (const gchar *object_path, + const gchar *method, + guint num_optional, + va_list var_args) +{ + GeditMessageType *message_type; + + g_return_val_if_fail (object_path != NULL, NULL); + g_return_val_if_fail (method != NULL, NULL); + g_return_val_if_fail (gedit_message_type_is_valid_object_path (object_path), NULL); + + message_type = g_new0(GeditMessageType, 1); + + message_type->ref_count = 1; + message_type->object_path = g_strdup(object_path); + message_type->method = g_strdup(method); + message_type->num_arguments = 0; + message_type->arguments = g_hash_table_new_full (g_str_hash, + g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)g_free); + + gedit_message_type_set_valist (message_type, num_optional, var_args); + return message_type; +} + +/** + * gedit_message_type_new: + * @object_path: the object path + * @method: the method + * @num_optional: number of optional arguments + * @...: key/gtype pair variable argument list + * + * Create a new #GeditMessageType for @method at @object_path. Argument names + * and values are supplied by the NULL terminated variable argument list. + * The last @num_optional provided arguments are considered optional. + * + * Return value: the newly constructed #GeditMessageType + * + */ +GeditMessageType * +gedit_message_type_new (const gchar *object_path, + const gchar *method, + guint num_optional, + ...) +{ + GeditMessageType *message_type; + va_list var_args; + + va_start(var_args, num_optional); + message_type = gedit_message_type_new_valist (object_path, method, num_optional, var_args); + va_end(var_args); + + return message_type; +} + +/** + * gedit_message_type_set: + * @message_type: the #GeditMessageType + * @num_optional: number of optional arguments + * @...: key/gtype pair variable argument list + * + * Sets argument names/types supplied by the NULL terminated variable + * argument list. The last @num_optional provided arguments are considered + * optional. + * + */ +void +gedit_message_type_set (GeditMessageType *message_type, + guint num_optional, + ...) +{ + va_list va_args; + + va_start (va_args, num_optional); + gedit_message_type_set_valist (message_type, num_optional, va_args); + va_end (va_args); +} + +/** + * gedit_message_type_set_valist: + * @message_type: the #GeditMessageType + * @num_optional: number of optional arguments + * @var_args: key/gtype pair variable argument list + * + * Sets argument names/types supplied by the NULL terminated variable + * argument list @var_args. The last @num_optional provided arguments are + * considered optional. + * + */ +void +gedit_message_type_set_valist (GeditMessageType *message_type, + guint num_optional, + va_list var_args) +{ + const gchar *key; + ArgumentInfo **optional = g_new0(ArgumentInfo *, num_optional); + guint i; + guint added = 0; + + // parse key -> gtype pair arguments + while ((key = va_arg (var_args, const gchar *)) != NULL) + { + // get corresponding GType + GType gtype = va_arg (var_args, GType); + ArgumentInfo *info; + + if (!gedit_message_type_is_supported (gtype)) + { + g_error ("Message type '%s' is not supported", g_type_name (gtype)); + + gedit_message_type_unref (message_type); + g_free (optional); + + return; + } + + info = g_new(ArgumentInfo, 1); + info->type = gtype; + info->required = TRUE; + + g_hash_table_insert (message_type->arguments, g_strdup (key), info); + + ++message_type->num_arguments; + ++added; + + if (num_optional > 0) + { + for (i = num_optional - 1; i > 0; --i) + optional[i] = optional[i - 1]; + + *optional = info; + } + } + + message_type->num_required += added; + + // set required for last num_optional arguments + for (i = 0; i < num_optional; ++i) + { + if (optional[i]) + { + optional[i]->required = FALSE; + --message_type->num_required; + } + } + + g_free (optional); +} + +/** + * gedit_message_type_instantiate_valist: + * @message_type: the #GeditMessageType + * @va_args: NULL terminated variable list of key/value pairs + * + * Instantiate a new message from the message type with specific values + * for the message arguments. + * + * Return value: the newly created message + * + */ +GeditMessage * +gedit_message_type_instantiate_valist (GeditMessageType *message_type, + va_list va_args) +{ + GeditMessage *message; + + g_return_val_if_fail (message_type != NULL, NULL); + + message = GEDIT_MESSAGE (g_object_new (GEDIT_TYPE_MESSAGE, "type", message_type, NULL)); + gedit_message_set_valist (message, va_args); + + return message; +} + +/** + * gedit_message_type_instantiate: + * @message_type: the #GeditMessageType + * @...: NULL terminated variable list of key/value pairs + * + * Instantiate a new message from the message type with specific values + * for the message arguments. + * + * Return value: the newly created message + * + */ +GeditMessage * +gedit_message_type_instantiate (GeditMessageType *message_type, + ...) +{ + GeditMessage *message; + va_list va_args; + + va_start (va_args, message_type); + message = gedit_message_type_instantiate_valist (message_type, va_args); + va_end (va_args); + + return message; +} + +/** + * gedit_message_type_get_object_path: + * @message_type: the #GeditMessageType + * + * Get the message type object path. + * + * Return value: the message type object path + * + */ +const gchar * +gedit_message_type_get_object_path (GeditMessageType *message_type) +{ + return message_type->object_path; +} + +/** + * gedit_message_type_get_method: + * @message_type: the #GeditMessageType + * + * Get the message type method. + * + * Return value: the message type method + * + */ +const gchar * +gedit_message_type_get_method (GeditMessageType *message_type) +{ + return message_type->method; +} + +/** + * gedit_message_type_lookup: + * @message_type: the #GeditMessageType + * @key: the argument key + * + * Get the argument key #GType. + * + * Return value: the #GType of @key + * + */ +GType +gedit_message_type_lookup (GeditMessageType *message_type, + const gchar *key) +{ + ArgumentInfo *info = g_hash_table_lookup (message_type->arguments, key); + + if (!info) + return G_TYPE_INVALID; + + return info->type; +} + +typedef struct +{ + GeditMessageTypeForeach func; + gpointer user_data; +} ForeachInfo; + +static void +foreach_gtype (const gchar *key, + ArgumentInfo *info, + ForeachInfo *finfo) +{ + finfo->func (key, info->type, info->required, finfo->user_data); +} + +/** + * gedit_message_type_foreach: + * @message_type: the #GeditMessageType + * @func: the callback function + * @user_data: user data supplied to the callback function + * + * Calls @func for each argument in the message type. + * + */ +void +gedit_message_type_foreach (GeditMessageType *message_type, + GeditMessageTypeForeach func, + gpointer user_data) +{ + ForeachInfo info = {func, user_data}; + g_hash_table_foreach (message_type->arguments, (GHFunc)foreach_gtype, &info); +} + +// ex:ts=8:noet: diff --git a/gedit/gedit-message-type.h b/gedit/gedit-message-type.h new file mode 100755 index 00000000..d3140cdc --- /dev/null +++ b/gedit/gedit-message-type.h @@ -0,0 +1,67 @@ +#ifndef __GEDIT_MESSAGE_TYPE_H__ +#define __GEDIT_MESSAGE_TYPE_H__ + +#include +#include + +#include "gedit-message.h" + +G_BEGIN_DECLS + +#define GEDIT_TYPE_MESSAGE_TYPE (gedit_message_type_get_type ()) +#define GEDIT_MESSAGE_TYPE(x) ((GeditMessageType *)(x)) + +typedef void (*GeditMessageTypeForeach) (const gchar *key, + GType type, + gboolean required, + gpointer user_data); + +typedef struct _GeditMessageType GeditMessageType; + +GType gedit_message_type_get_type (void) G_GNUC_CONST; + +gboolean gedit_message_type_is_supported (GType type); +gchar *gedit_message_type_identifier (const gchar *object_path, + const gchar *method); +gboolean gedit_message_type_is_valid_object_path (const gchar *object_path); + +GeditMessageType *gedit_message_type_new (const gchar *object_path, + const gchar *method, + guint num_optional, + ...) G_GNUC_NULL_TERMINATED; +GeditMessageType *gedit_message_type_new_valist (const gchar *object_path, + const gchar *method, + guint num_optional, + va_list va_args); + +void gedit_message_type_set (GeditMessageType *message_type, + guint num_optional, + ...) G_GNUC_NULL_TERMINATED; +void gedit_message_type_set_valist (GeditMessageType *message_type, + guint num_optional, + va_list va_args); + +GeditMessageType *gedit_message_type_ref (GeditMessageType *message_type); +void gedit_message_type_unref (GeditMessageType *message_type); + + +GeditMessage *gedit_message_type_instantiate_valist (GeditMessageType *message_type, + va_list va_args); +GeditMessage *gedit_message_type_instantiate (GeditMessageType *message_type, + ...) G_GNUC_NULL_TERMINATED; + +const gchar *gedit_message_type_get_object_path (GeditMessageType *message_type); +const gchar *gedit_message_type_get_method (GeditMessageType *message_type); + +GType gedit_message_type_lookup (GeditMessageType *message_type, + const gchar *key); + +void gedit_message_type_foreach (GeditMessageType *message_type, + GeditMessageTypeForeach func, + gpointer user_data); + +G_END_DECLS + +#endif /* __GEDIT_MESSAGE_TYPE_H__ */ + +// ex:ts=8:noet: diff --git a/gedit/gedit-message.c b/gedit/gedit-message.c new file mode 100755 index 00000000..f1e12daa --- /dev/null +++ b/gedit/gedit-message.c @@ -0,0 +1,593 @@ +#include "gedit-message.h" +#include "gedit-message-type.h" + +#include +#include + +/** + * SECTION:gedit-message + * @short_description: message bus message object + * @include: gedit/gedit-message.h + * + * Communication on a #GeditMessageBus is done through messages. Messages are + * sent over the bus and received by connecting callbacks on the message bus. + * A #GeditMessage is an instantiation of a #GeditMessageType, containing + * values for the arguments as specified in the message type. + * + * A message can be seen as a method call, or signal emission depending on + * who is the sender and who is the receiver. There is no explicit distinction + * between methods and signals. + * + * Since: 2.25.3 + * + */ +#define GEDIT_MESSAGE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_MESSAGE, GeditMessagePrivate)) + +enum { + PROP_0, + + PROP_OBJECT_PATH, + PROP_METHOD, + PROP_TYPE +}; + +struct _GeditMessagePrivate +{ + GeditMessageType *type; + gboolean valid; + + GHashTable *values; +}; + +G_DEFINE_TYPE (GeditMessage, gedit_message, G_TYPE_OBJECT) + +static void +gedit_message_finalize (GObject *object) +{ + GeditMessage *message = GEDIT_MESSAGE (object); + + gedit_message_type_unref (message->priv->type); + g_hash_table_destroy (message->priv->values); + + G_OBJECT_CLASS (gedit_message_parent_class)->finalize (object); +} + +static void +gedit_message_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditMessage *msg = GEDIT_MESSAGE (object); + + switch (prop_id) + { + case PROP_OBJECT_PATH: + g_value_set_string (value, gedit_message_type_get_object_path (msg->priv->type)); + break; + case PROP_METHOD: + g_value_set_string (value, gedit_message_type_get_method (msg->priv->type)); + break; + case PROP_TYPE: + g_value_set_boxed (value, msg->priv->type); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_message_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditMessage *msg = GEDIT_MESSAGE (object); + + switch (prop_id) + { + case PROP_TYPE: + msg->priv->type = GEDIT_MESSAGE_TYPE (g_value_dup_boxed (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static GValue * +add_value (GeditMessage *message, + const gchar *key) +{ + GValue *value; + GType type = gedit_message_type_lookup (message->priv->type, key); + + if (type == G_TYPE_INVALID) + return NULL; + + value = g_new0 (GValue, 1); + g_value_init (value, type); + g_value_reset (value); + + g_hash_table_insert (message->priv->values, g_strdup (key), value); + + return value; +} + +static void +gedit_message_class_init (GeditMessageClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + object_class->finalize = gedit_message_finalize; + object_class->get_property = gedit_message_get_property; + object_class->set_property = gedit_message_set_property; + + /** + * GeditMessage:object_path: + * + * The messages object path (e.g. /gedit/object/path). + * + */ + g_object_class_install_property (object_class, PROP_OBJECT_PATH, + g_param_spec_string ("object-path", + "OBJECT_PATH", + "The message object path", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GeditMessage:method: + * + * The messages method. + * + */ + g_object_class_install_property (object_class, PROP_METHOD, + g_param_spec_string ("method", + "METHOD", + "The message method", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * GeditMEssage:type: + * + * The message type. + * + */ + g_object_class_install_property (object_class, PROP_TYPE, + g_param_spec_boxed ("type", + "TYPE", + "The message type", + GEDIT_TYPE_MESSAGE_TYPE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof(GeditMessagePrivate)); +} + +static void +destroy_value (GValue *value) +{ + g_value_unset (value); + g_free (value); +} + +static void +gedit_message_init (GeditMessage *self) +{ + self->priv = GEDIT_MESSAGE_GET_PRIVATE (self); + + self->priv->values = g_hash_table_new_full (g_str_hash, + g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)destroy_value); +} + +static gboolean +set_value_real (GValue *to, + const GValue *from) +{ + GType from_type; + GType to_type; + + from_type = G_VALUE_TYPE (from); + to_type = G_VALUE_TYPE (to); + + if (!g_type_is_a (from_type, to_type)) + { + if (!g_value_transform (from, to)) + { + g_warning ("%s: Unable to make conversion from %s to %s", + G_STRLOC, + g_type_name (from_type), + g_type_name (to_type)); + return FALSE; + } + + return TRUE; + } + + g_value_copy (from, to); + return TRUE; +} + +inline static GValue * +value_lookup (GeditMessage *message, + const gchar *key, + gboolean create) +{ + GValue *ret = (GValue *)g_hash_table_lookup (message->priv->values, key); + + if (!ret && create) + ret = add_value (message, key); + + return ret; +} + +/** + * gedit_message_get_method: + * @message: the #GeditMessage + * + * Get the message method. + * + * Return value: the message method + * + */ +const gchar * +gedit_message_get_method (GeditMessage *message) +{ + g_return_val_if_fail (GEDIT_IS_MESSAGE (message), NULL); + + return gedit_message_type_get_method (message->priv->type); +} + +/** + * gedit_message_get_object_path: + * @message: the #GeditMessage + * + * Get the message object path. + * + * Return value: the message object path + * + */ +const gchar * +gedit_message_get_object_path (GeditMessage *message) +{ + g_return_val_if_fail (GEDIT_IS_MESSAGE (message), NULL); + + return gedit_message_type_get_object_path (message->priv->type); +} + +/** + * gedit_message_set: + * @message: the #GeditMessage + * @...: a NULL terminated variable list of key/value pairs + * + * Set values of message arguments. The supplied @var_args should contain + * pairs of keys and argument values. + * + */ +void +gedit_message_set (GeditMessage *message, + ...) +{ + va_list ap; + + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + va_start (ap, message); + gedit_message_set_valist (message, ap); + va_end (ap); +} + +/** + * gedit_message_set_valist: + * @message: the #GeditMessage + * @var_args: a NULL terminated variable list of key/value pairs + * + * Set values of message arguments. The supplied @var_args should contain + * pairs of keys and argument values. + * + */ +void +gedit_message_set_valist (GeditMessage *message, + va_list var_args) +{ + const gchar *key; + + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + while ((key = va_arg (var_args, const gchar *)) != NULL) + { + /* lookup the key */ + GValue *container = value_lookup (message, key, TRUE); + GValue value = {0,}; + gchar *error = NULL; + + if (!container) + { + g_warning ("%s: Cannot set value for %s, does not exist", + G_STRLOC, + key); + + /* skip value */ + va_arg (var_args, gpointer); + continue; + } + + g_value_init (&value, G_VALUE_TYPE (container)); + G_VALUE_COLLECT (&value, var_args, 0, &error); + + if (error) + { + g_warning ("%s: %s", G_STRLOC, error); + continue; + } + + set_value_real (container, &value); + g_value_unset (&value); + } +} + +/** + * gedit_message_set_value: + * @message: the #GeditMessage + * @key: the argument key + * @value: the argument value + * + * Set value of message argument @key to @value. + * + */ +void +gedit_message_set_value (GeditMessage *message, + const gchar *key, + GValue *value) +{ + GValue *container; + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + container = value_lookup (message, key, TRUE); + + if (!container) + { + g_warning ("%s: Cannot set value for %s, does not exist", + G_STRLOC, + key); + return; + } + + set_value_real (container, value); +} + +/** + * gedit_message_set_valuesv: + * @message: the #GeditMessage + * @keys: keys to set values for + * @values: values to set + * @n_values: number of arguments to set values for + * + * Set message argument values. + * + */ +void +gedit_message_set_valuesv (GeditMessage *message, + const gchar **keys, + GValue *values, + gint n_values) +{ + gint i; + + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + for (i = 0; i < n_values; i++) + { + gedit_message_set_value (message, keys[i], &values[i]); + } +} + +/** + * gedit_message_get: + * @message: the #GeditMessage + * @...: a NULL variable argument list of key/value container pairs + * + * Get values of message arguments. The supplied @var_args should contain + * pairs of keys and pointers to variables which are set to the argument + * value for the specified key. + * + */ +void +gedit_message_get (GeditMessage *message, + ...) +{ + va_list ap; + + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + va_start (ap, message); + gedit_message_get_valist (message, ap); + va_end (ap); +} + +/** + * gedit_message_get_valist: + * @message: the #GeditMessage + * @var_args: a NULL variable argument list of key/value container pairs + * + * Get values of message arguments. The supplied @var_args should contain + * pairs of keys and pointers to variables which are set to the argument + * value for the specified key. + * + */ +void +gedit_message_get_valist (GeditMessage *message, + va_list var_args) +{ + const gchar *key; + + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + while ((key = va_arg (var_args, const gchar *)) != NULL) + { + GValue *container; + GValue copy = {0,}; + gchar *error = NULL; + + container = value_lookup (message, key, FALSE); + + if (!container) + { + /* skip value */ + va_arg (var_args, gpointer); + continue; + } + + /* copy the value here, to be sure it isn't tainted */ + g_value_init (©, G_VALUE_TYPE (container)); + g_value_copy (container, ©); + + G_VALUE_LCOPY (©, var_args, 0, &error); + + if (error) + { + g_warning ("%s: %s", G_STRLOC, error); + g_free (error); + + /* purposely leak the value here, because it might + be in a bad state */ + continue; + } + + g_value_unset (©); + } +} + +/** + * gedit_message_get_value: + * @message: the #GeditMessage + * @key: the argument key + * @value: value return container + * + * Get the value of a specific message argument. @value will be initialized + * with the correct type. + * + */ +void +gedit_message_get_value (GeditMessage *message, + const gchar *key, + GValue *value) +{ + GValue *container; + + g_return_if_fail (GEDIT_IS_MESSAGE (message)); + + container = value_lookup (message, key, FALSE); + + if (!container) + { + g_warning ("%s: Invalid key `%s'", + G_STRLOC, + key); + return; + } + + g_value_init (value, G_VALUE_TYPE (container)); + set_value_real (value, container); +} + +/** + * gedit_message_get_key_type: + * @message: the #GeditMessage + * @key: the argument key + * + * Get the type of a message argument. + * + * Return value: the type of @key + * + */ +GType +gedit_message_get_key_type (GeditMessage *message, + const gchar *key) +{ + g_return_val_if_fail (GEDIT_IS_MESSAGE (message), G_TYPE_INVALID); + g_return_val_if_fail (message->priv->type != NULL, G_TYPE_INVALID); + + return gedit_message_type_lookup (message->priv->type, key); +} + +/** + * gedit_message_has_key: + * @message: the #GeditMessage + * @key: the argument key + * + * Check whether the message has a specific key. + * + * Return value: %TRUE if @message has argument @key + * + */ +gboolean +gedit_message_has_key (GeditMessage *message, + const gchar *key) +{ + g_return_val_if_fail (GEDIT_IS_MESSAGE (message), FALSE); + + return value_lookup (message, key, FALSE) != NULL; +} + +typedef struct +{ + GeditMessage *message; + gboolean valid; +} ValidateInfo; + +static void +validate_key (const gchar *key, + GType type, + gboolean required, + ValidateInfo *info) +{ + GValue *value; + + if (!info->valid || !required) + return; + + value = value_lookup (info->message, key, FALSE); + + if (!value) + info->valid = FALSE; +} + +/** + * gedit_message_validate: + * @message: the #GeditMessage + * + * Validates the message arguments according to the message type. + * + * Return value: %TRUE if the message is valid + * + */ +gboolean +gedit_message_validate (GeditMessage *message) +{ + ValidateInfo info = {message, TRUE}; + + g_return_val_if_fail (GEDIT_IS_MESSAGE (message), FALSE); + g_return_val_if_fail (message->priv->type != NULL, FALSE); + + if (!message->priv->valid) + { + gedit_message_type_foreach (message->priv->type, + (GeditMessageTypeForeach)validate_key, + &info); + + message->priv->valid = info.valid; + } + + return message->priv->valid; +} + +// ex:ts=8:noet: diff --git a/gedit/gedit-message.h b/gedit/gedit-message.h new file mode 100755 index 00000000..9d17ac9e --- /dev/null +++ b/gedit/gedit-message.h @@ -0,0 +1,71 @@ +#ifndef __GEDIT_MESSAGE_H__ +#define __GEDIT_MESSAGE_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_MESSAGE (gedit_message_get_type ()) +#define GEDIT_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_MESSAGE, GeditMessage)) +#define GEDIT_MESSAGE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_MESSAGE, GeditMessage const)) +#define GEDIT_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_MESSAGE, GeditMessageClass)) +#define GEDIT_IS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_MESSAGE)) +#define GEDIT_IS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_MESSAGE)) +#define GEDIT_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_MESSAGE, GeditMessageClass)) + +typedef struct _GeditMessage GeditMessage; +typedef struct _GeditMessageClass GeditMessageClass; +typedef struct _GeditMessagePrivate GeditMessagePrivate; + +struct _GeditMessage { + GObject parent; + + GeditMessagePrivate *priv; +}; + +struct _GeditMessageClass { + GObjectClass parent_class; +}; + +GType gedit_message_get_type (void) G_GNUC_CONST; + +struct _GeditMessageType gedit_message_get_message_type (GeditMessage *message); + +void gedit_message_get (GeditMessage *message, + ...) G_GNUC_NULL_TERMINATED; +void gedit_message_get_valist (GeditMessage *message, + va_list var_args); +void gedit_message_get_value (GeditMessage *message, + const gchar *key, + GValue *value); + +void gedit_message_set (GeditMessage *message, + ...) G_GNUC_NULL_TERMINATED; +void gedit_message_set_valist (GeditMessage *message, + va_list var_args); +void gedit_message_set_value (GeditMessage *message, + const gchar *key, + GValue *value); +void gedit_message_set_valuesv (GeditMessage *message, + const gchar **keys, + GValue *values, + gint n_values); + +const gchar *gedit_message_get_object_path (GeditMessage *message); +const gchar *gedit_message_get_method (GeditMessage *message); + +gboolean gedit_message_has_key (GeditMessage *message, + const gchar *key); + +GType gedit_message_get_key_type (GeditMessage *message, + const gchar *key); + +gboolean gedit_message_validate (GeditMessage *message); + + +G_END_DECLS + +#endif /* __GEDIT_MESSAGE_H__ */ + +// ex:ts=8:noet: diff --git a/gedit/gedit-metadata-manager.c b/gedit/gedit-metadata-manager.c new file mode 100755 index 00000000..bdb00fff --- /dev/null +++ b/gedit/gedit-metadata-manager.c @@ -0,0 +1,563 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-metadata-manager.c + * This file is part of gedit + * + * Copyright (C) 2003-2007 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include "gedit-metadata-manager.h" +#include "gedit-debug.h" +#include "gedit-dirs.h" + +/* +#define GEDIT_METADATA_VERBOSE_DEBUG 1 +*/ + +#define METADATA_FILE "gedit-metadata.xml" + +#define MAX_ITEMS 50 + +typedef struct _GeditMetadataManager GeditMetadataManager; + +typedef struct _Item Item; + +struct _Item +{ + time_t atime; /* time of last access */ + + GHashTable *values; +}; + +struct _GeditMetadataManager +{ + gboolean values_loaded; /* It is true if the file + has been read */ + + guint timeout_id; + + GHashTable *items; +}; + +static gboolean gedit_metadata_manager_save (gpointer data); + + +static GeditMetadataManager *gedit_metadata_manager = NULL; + +static void +item_free (gpointer data) +{ + Item *item; + + g_return_if_fail (data != NULL); + +#ifdef GEDIT_METADATA_VERBOSE_DEBUG + gedit_debug (DEBUG_METADATA); +#endif + + item = (Item *)data; + + if (item->values != NULL) + g_hash_table_destroy (item->values); + + g_free (item); +} + +static void +gedit_metadata_manager_arm_timeout (void) +{ + if (gedit_metadata_manager->timeout_id == 0) + { + gedit_metadata_manager->timeout_id = + g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, + 2, + (GSourceFunc)gedit_metadata_manager_save, + NULL, + NULL); + } +} + +static gboolean +gedit_metadata_manager_init (void) +{ + gedit_debug (DEBUG_METADATA); + + if (gedit_metadata_manager != NULL) + return TRUE; + + gedit_metadata_manager = g_new0 (GeditMetadataManager, 1); + + gedit_metadata_manager->values_loaded = FALSE; + + gedit_metadata_manager->items = + g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + item_free); + + return TRUE; +} + +/* This function must be called before exiting gedit */ +void +gedit_metadata_manager_shutdown (void) +{ + gedit_debug (DEBUG_METADATA); + + if (gedit_metadata_manager == NULL) + return; + + if (gedit_metadata_manager->timeout_id) + { + g_source_remove (gedit_metadata_manager->timeout_id); + gedit_metadata_manager->timeout_id = 0; + gedit_metadata_manager_save (NULL); + } + + if (gedit_metadata_manager->items != NULL) + g_hash_table_destroy (gedit_metadata_manager->items); + + g_free (gedit_metadata_manager); + gedit_metadata_manager = NULL; +} + +static void +parseItem (xmlDocPtr doc, xmlNodePtr cur) +{ + Item *item; + + xmlChar *uri; + xmlChar *atime; + +#ifdef GEDIT_METADATA_VERBOSE_DEBUG + gedit_debug (DEBUG_METADATA); +#endif + + if (xmlStrcmp (cur->name, (const xmlChar *)"document") != 0) + return; + + uri = xmlGetProp (cur, (const xmlChar *)"uri"); + if (uri == NULL) + return; + + atime = xmlGetProp (cur, (const xmlChar *)"atime"); + if (atime == NULL) + { + xmlFree (uri); + return; + } + + item = g_new0 (Item, 1); + + item->atime = g_ascii_strtoull ((char *)atime, NULL, 0); + + item->values = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + + cur = cur->xmlChildrenNode; + + while (cur != NULL) + { + if (xmlStrcmp (cur->name, (const xmlChar *)"entry") == 0) + { + xmlChar *key; + xmlChar *value; + + key = xmlGetProp (cur, (const xmlChar *)"key"); + value = xmlGetProp (cur, (const xmlChar *)"value"); + + if ((key != NULL) && (value != NULL)) + g_hash_table_insert (item->values, + g_strdup ((gchar *)key), + g_strdup ((gchar *)value)); + + if (key != NULL) + xmlFree (key); + if (value != NULL) + xmlFree (value); + } + + cur = cur->next; + } + + g_hash_table_insert (gedit_metadata_manager->items, + g_strdup ((gchar *)uri), + item); + + xmlFree (uri); + xmlFree (atime); +} + +static gchar * +get_metadata_filename (void) +{ + gchar *cache_dir; + gchar *metadata; + + cache_dir = gedit_dirs_get_user_cache_dir (); + + metadata = g_build_filename (cache_dir, + METADATA_FILE, + NULL); + + g_free (cache_dir); + + return metadata; +} + +static gboolean +load_values (void) +{ + xmlDocPtr doc; + xmlNodePtr cur; + gchar *file_name; + + gedit_debug (DEBUG_METADATA); + + g_return_val_if_fail (gedit_metadata_manager != NULL, FALSE); + g_return_val_if_fail (gedit_metadata_manager->values_loaded == FALSE, FALSE); + + gedit_metadata_manager->values_loaded = TRUE; + + xmlKeepBlanksDefault (0); + + /* FIXME: file locking - Paolo */ + file_name = get_metadata_filename (); + if ((file_name == NULL) || + (!g_file_test (file_name, G_FILE_TEST_EXISTS))) + { + g_free (file_name); + return FALSE; + } + + doc = xmlParseFile (file_name); + g_free (file_name); + + if (doc == NULL) + { + return FALSE; + } + + cur = xmlDocGetRootElement (doc); + if (cur == NULL) + { + g_message ("The metadata file '%s' is empty", METADATA_FILE); + xmlFreeDoc (doc); + + return FALSE; + } + + if (xmlStrcmp (cur->name, (const xmlChar *) "metadata")) + { + g_message ("File '%s' is of the wrong type", METADATA_FILE); + xmlFreeDoc (doc); + + return FALSE; + } + + cur = xmlDocGetRootElement (doc); + cur = cur->xmlChildrenNode; + + while (cur != NULL) + { + parseItem (doc, cur); + + cur = cur->next; + } + + xmlFreeDoc (doc); + + return TRUE; +} + +gchar * +gedit_metadata_manager_get (const gchar *uri, + const gchar *key) +{ + Item *item; + gchar *value; + + g_return_val_if_fail (uri != NULL, NULL); + g_return_val_if_fail (key != NULL, NULL); + + gedit_debug_message (DEBUG_METADATA, "URI: %s --- key: %s", uri, key ); + + gedit_metadata_manager_init (); + + if (!gedit_metadata_manager->values_loaded) + { + gboolean res; + + res = load_values (); + + if (!res) + return NULL; + } + + item = (Item *)g_hash_table_lookup (gedit_metadata_manager->items, + uri); + + if (item == NULL) + return NULL; + + item->atime = time (NULL); + + if (item->values == NULL) + return NULL; + + value = g_hash_table_lookup (item->values, key); + + if (value == NULL) + return NULL; + else + return g_strdup (value); +} + +void +gedit_metadata_manager_set (const gchar *uri, + const gchar *key, + const gchar *value) +{ + Item *item; + + g_return_if_fail (uri != NULL); + g_return_if_fail (key != NULL); + + gedit_debug_message (DEBUG_METADATA, "URI: %s --- key: %s --- value: %s", uri, key, value); + + gedit_metadata_manager_init (); + + if (!gedit_metadata_manager->values_loaded) + { + gboolean res; + + res = load_values (); + + if (!res) + return; + } + + item = (Item *)g_hash_table_lookup (gedit_metadata_manager->items, + uri); + + if (item == NULL) + { + item = g_new0 (Item, 1); + + g_hash_table_insert (gedit_metadata_manager->items, + g_strdup (uri), + item); + } + + if (item->values == NULL) + item->values = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + if (value != NULL) + g_hash_table_insert (item->values, + g_strdup (key), + g_strdup (value)); + else + g_hash_table_remove (item->values, + key); + + item->atime = time (NULL); + + gedit_metadata_manager_arm_timeout (); +} + +static void +save_values (const gchar *key, const gchar *value, xmlNodePtr parent) +{ + xmlNodePtr xml_node; + +#ifdef GEDIT_METADATA_VERBOSE_DEBUG + gedit_debug (DEBUG_METADATA); +#endif + + g_return_if_fail (key != NULL); + + if (value == NULL) + return; + + xml_node = xmlNewChild (parent, + NULL, + (const xmlChar *)"entry", + NULL); + + xmlSetProp (xml_node, + (const xmlChar *)"key", + (const xmlChar *)key); + xmlSetProp (xml_node, + (const xmlChar *)"value", + (const xmlChar *)value); + +#ifdef GEDIT_METADATA_VERBOSE_DEBUG + gedit_debug_message (DEBUG_METADATA, "entry: %s = %s", key, value); +#endif +} + +static void +save_item (const gchar *key, const gpointer *data, xmlNodePtr parent) +{ + xmlNodePtr xml_node; + const Item *item = (const Item *)data; + gchar *atime; + +#ifdef GEDIT_METADATA_VERBOSE_DEBUG + gedit_debug (DEBUG_METADATA); +#endif + + g_return_if_fail (key != NULL); + + if (item == NULL) + return; + + xml_node = xmlNewChild (parent, NULL, (const xmlChar *)"document", NULL); + + xmlSetProp (xml_node, (const xmlChar *)"uri", (const xmlChar *)key); + +#ifdef GEDIT_METADATA_VERBOSE_DEBUG + gedit_debug_message (DEBUG_METADATA, "uri: %s", key); +#endif + + atime = g_strdup_printf ("%ld", item->atime); + xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime); + +#ifdef GEDIT_METADATA_VERBOSE_DEBUG + gedit_debug_message (DEBUG_METADATA, "atime: %s", atime); +#endif + + g_free (atime); + + g_hash_table_foreach (item->values, + (GHFunc)save_values, + xml_node); +} + +static void +get_oldest (const gchar *key, const gpointer value, const gchar ** key_to_remove) +{ + const Item *item = (const Item *)value; + + if (*key_to_remove == NULL) + { + *key_to_remove = key; + } + else + { + const Item *item_to_remove = + g_hash_table_lookup (gedit_metadata_manager->items, + *key_to_remove); + + g_return_if_fail (item_to_remove != NULL); + + if (item->atime < item_to_remove->atime) + { + *key_to_remove = key; + } + } +} + +static void +resize_items (void) +{ + while (g_hash_table_size (gedit_metadata_manager->items) > MAX_ITEMS) + { + gpointer key_to_remove = NULL; + + g_hash_table_foreach (gedit_metadata_manager->items, + (GHFunc)get_oldest, + &key_to_remove); + + g_return_if_fail (key_to_remove != NULL); + + g_hash_table_remove (gedit_metadata_manager->items, + key_to_remove); + } +} + +static gboolean +gedit_metadata_manager_save (gpointer data) +{ + xmlDocPtr doc; + xmlNodePtr root; + gchar *file_name; + + gedit_debug (DEBUG_METADATA); + + gedit_metadata_manager->timeout_id = 0; + + resize_items (); + + xmlIndentTreeOutput = TRUE; + + doc = xmlNewDoc ((const xmlChar *)"1.0"); + if (doc == NULL) + return TRUE; + + /* Create metadata root */ + root = xmlNewDocNode (doc, NULL, (const xmlChar *)"metadata", NULL); + xmlDocSetRootElement (doc, root); + + g_hash_table_foreach (gedit_metadata_manager->items, + (GHFunc)save_item, + root); + + /* FIXME: lock file - Paolo */ + file_name = get_metadata_filename (); + if (file_name != NULL) + { + gchar *cache_dir; + int res; + + /* make sure the cache dir exists */ + cache_dir = gedit_dirs_get_user_cache_dir (); + res = g_mkdir_with_parents (cache_dir, 0755); + if (res != -1) + { + xmlSaveFormatFile (file_name, doc, 1); + } + + g_free (cache_dir); + g_free (file_name); + } + + xmlFreeDoc (doc); + + gedit_debug_message (DEBUG_METADATA, "DONE"); + + return FALSE; +} + diff --git a/gedit/gedit-metadata-manager.h b/gedit/gedit-metadata-manager.h new file mode 100755 index 00000000..6ee324f6 --- /dev/null +++ b/gedit/gedit-metadata-manager.h @@ -0,0 +1,50 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-metadata-manager.h + * This file is part of gedit + * + * Copyright (C) 2003 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2003. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __GEDIT_METADATA_MANAGER_H__ +#define __GEDIT_METADATA_MANAGER_H__ + +#include + +G_BEGIN_DECLS + + +/* This function must be called before exiting gedit */ +void gedit_metadata_manager_shutdown (void); + + +gchar *gedit_metadata_manager_get (const gchar *uri, + const gchar *key); +void gedit_metadata_manager_set (const gchar *uri, + const gchar *key, + const gchar *value); + +G_END_DECLS + +#endif /* __GEDIT_METADATA_MANAGER_H__ */ diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c new file mode 100755 index 00000000..2578815a --- /dev/null +++ b/gedit/gedit-notebook.c @@ -0,0 +1,1099 @@ +/* + * gedit-notebook.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +/* This file is a modified version of the epiphany file ephy-notebook.c + * Here the relevant copyright: + * + * Copyright (C) 2002 Christophe Fergeau + * Copyright (C) 2003 Marco Pesenti Gritti + * Copyright (C) 2003, 2004 Christian Persch + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "gedit-notebook.h" +#include "gedit-tab.h" +#include "gedit-tab-label.h" +#include "gedit-marshal.h" +#include "gedit-window.h" + +#ifdef BUILD_SPINNER +#include "gedit-spinner.h" +#endif + +#define AFTER_ALL_TABS -1 +#define NOT_IN_APP_WINDOWS -2 + +#define GEDIT_NOTEBOOK_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_NOTEBOOK, GeditNotebookPrivate)) + +struct _GeditNotebookPrivate +{ + GList *focused_pages; + gulong motion_notify_handler_id; + gint x_start; + gint y_start; + gint drag_in_progress : 1; + gint always_show_tabs : 1; + gint close_buttons_sensitive : 1; + gint tab_drag_and_drop_enabled : 1; + guint destroy_has_run : 1; +}; + +G_DEFINE_TYPE(GeditNotebook, gedit_notebook, GTK_TYPE_NOTEBOOK) + +static void gedit_notebook_finalize (GObject *object); + +static gboolean gedit_notebook_change_current_page (GtkNotebook *notebook, + gint offset); + +static void move_current_tab_to_another_notebook (GeditNotebook *src, + GeditNotebook *dest, + GdkEventMotion *event, + gint dest_position); + +/* Local variables */ +static GdkCursor *cursor = NULL; + +/* Signals */ +enum +{ + TAB_ADDED, + TAB_REMOVED, + TABS_REORDERED, + TAB_DETACHED, + TAB_CLOSE_REQUEST, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void +gedit_notebook_destroy (GtkObject *object) +{ + GeditNotebook *notebook = GEDIT_NOTEBOOK (object); + + if (!notebook->priv->destroy_has_run) + { + GList *children, *l; + + children = gtk_container_get_children (GTK_CONTAINER (notebook)); + + for (l = children; l != NULL; l = g_list_next (l)) + { + gedit_notebook_remove_tab (notebook, + GEDIT_TAB (l->data)); + } + + g_list_free (children); + notebook->priv->destroy_has_run = TRUE; + } + + GTK_OBJECT_CLASS (gedit_notebook_parent_class)->destroy (object); +} + +static void +gedit_notebook_class_init (GeditNotebookClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass); + GtkNotebookClass *notebook_class = GTK_NOTEBOOK_CLASS (klass); + + object_class->finalize = gedit_notebook_finalize; + gtkobject_class->destroy = gedit_notebook_destroy; + + notebook_class->change_current_page = gedit_notebook_change_current_page; + + signals[TAB_ADDED] = + g_signal_new ("tab_added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditNotebookClass, tab_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_TAB); + signals[TAB_REMOVED] = + g_signal_new ("tab_removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditNotebookClass, tab_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_TAB); + signals[TAB_DETACHED] = + g_signal_new ("tab_detached", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditNotebookClass, tab_detached), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_TAB); + signals[TABS_REORDERED] = + g_signal_new ("tabs_reordered", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditNotebookClass, tabs_reordered), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[TAB_CLOSE_REQUEST] = + g_signal_new ("tab-close-request", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditNotebookClass, tab_close_request), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_TAB); + + g_type_class_add_private (object_class, sizeof(GeditNotebookPrivate)); +} + +static GeditNotebook * +find_notebook_at_pointer (gint abs_x, gint abs_y) +{ + GdkWindow *win_at_pointer; + GdkWindow *toplevel_win; + gpointer toplevel = NULL; + gint x, y; + + /* FIXME multi-head */ + win_at_pointer = gdk_window_at_pointer (&x, &y); + if (win_at_pointer == NULL) + { + /* We are outside all windows of the same application */ + return NULL; + } + + toplevel_win = gdk_window_get_toplevel (win_at_pointer); + + /* get the GtkWidget which owns the toplevel GdkWindow */ + gdk_window_get_user_data (toplevel_win, &toplevel); + + /* toplevel should be an GeditWindow */ + if ((toplevel != NULL) && + GEDIT_IS_WINDOW (toplevel)) + { + return GEDIT_NOTEBOOK (_gedit_window_get_notebook + (GEDIT_WINDOW (toplevel))); + } + + /* We are outside all windows containing a notebook */ + return NULL; +} + +static gboolean +is_in_notebook_window (GeditNotebook *notebook, + gint abs_x, + gint abs_y) +{ + GeditNotebook *nb_at_pointer; + + g_return_val_if_fail (notebook != NULL, FALSE); + + nb_at_pointer = find_notebook_at_pointer (abs_x, abs_y); + + return (nb_at_pointer == notebook); +} + +static gint +find_tab_num_at_pos (GeditNotebook *notebook, + gint abs_x, + gint abs_y) +{ + GtkPositionType tab_pos; + int page_num = 0; + GtkNotebook *nb = GTK_NOTEBOOK (notebook); + GtkWidget *page; + + tab_pos = gtk_notebook_get_tab_pos (GTK_NOTEBOOK (notebook)); + + if (GTK_NOTEBOOK (notebook)->first_tab == NULL) + { + return AFTER_ALL_TABS; + } + + /* For some reason unfullscreen + quick click can + cause a wrong click event to be reported to the tab */ + if (!is_in_notebook_window (notebook, abs_x, abs_y)) + { + return NOT_IN_APP_WINDOWS; + } + + while ((page = gtk_notebook_get_nth_page (nb, page_num)) != NULL) + { + GtkWidget *tab; + gint max_x, max_y; + gint x_root, y_root; + + tab = gtk_notebook_get_tab_label (nb, page); + g_return_val_if_fail (tab != NULL, AFTER_ALL_TABS); + + if (!GTK_WIDGET_MAPPED (GTK_WIDGET (tab))) + { + ++page_num; + continue; + } + + gdk_window_get_origin (GDK_WINDOW (tab->window), + &x_root, &y_root); + + max_x = x_root + tab->allocation.x + tab->allocation.width; + max_y = y_root + tab->allocation.y + tab->allocation.height; + + if (((tab_pos == GTK_POS_TOP) || + (tab_pos == GTK_POS_BOTTOM)) && + (abs_x <= max_x)) + { + return page_num; + } + else if (((tab_pos == GTK_POS_LEFT) || + (tab_pos == GTK_POS_RIGHT)) && + (abs_y <= max_y)) + { + return page_num; + } + + ++page_num; + } + + return AFTER_ALL_TABS; +} + +static gint +find_notebook_and_tab_at_pos (gint abs_x, + gint abs_y, + GeditNotebook **notebook, + gint *page_num) +{ + *notebook = find_notebook_at_pointer (abs_x, abs_y); + if (*notebook == NULL) + { + return NOT_IN_APP_WINDOWS; + } + + *page_num = find_tab_num_at_pos (*notebook, abs_x, abs_y); + + if (*page_num < 0) + { + return *page_num; + } + else + { + return 0; + } +} + +/** + * gedit_notebook_move_tab: + * @src: a #GeditNotebook + * @dest: a #GeditNotebook + * @tab: a #GeditTab + * @dest_position: the position for @tab + * + * Moves @tab from @src to @dest. + * If dest_position is greater than or equal to the number of tabs + * of the destination nootebook or negative, tab will be moved to the + * end of the tabs. + */ +void +gedit_notebook_move_tab (GeditNotebook *src, + GeditNotebook *dest, + GeditTab *tab, + gint dest_position) +{ + g_return_if_fail (GEDIT_IS_NOTEBOOK (src)); + g_return_if_fail (GEDIT_IS_NOTEBOOK (dest)); + g_return_if_fail (src != dest); + g_return_if_fail (GEDIT_IS_TAB (tab)); + + /* make sure the tab isn't destroyed while we move it */ + g_object_ref (tab); + gedit_notebook_remove_tab (src, tab); + gedit_notebook_add_tab (dest, tab, dest_position, TRUE); + g_object_unref (tab); +} + +/** + * gedit_notebook_reorder_tab: + * @src: a #GeditNotebook + * @tab: a #GeditTab + * @dest_position: the position for @tab + * + * Reorders the page containing @tab, so that it appears in @dest_position position. + * If dest_position is greater than or equal to the number of tabs + * of the destination notebook or negative, tab will be moved to the + * end of the tabs. + */ +void +gedit_notebook_reorder_tab (GeditNotebook *src, + GeditTab *tab, + gint dest_position) +{ + gint old_position; + + g_return_if_fail (GEDIT_IS_NOTEBOOK (src)); + g_return_if_fail (GEDIT_IS_TAB (tab)); + + old_position = gtk_notebook_page_num (GTK_NOTEBOOK (src), + GTK_WIDGET (tab)); + + if (old_position == dest_position) + return; + + gtk_notebook_reorder_child (GTK_NOTEBOOK (src), + GTK_WIDGET (tab), + dest_position); + + if (!src->priv->drag_in_progress) + { + g_signal_emit (G_OBJECT (src), + signals[TABS_REORDERED], + 0); + } +} + +static void +drag_start (GeditNotebook *notebook, + guint32 time) +{ + notebook->priv->drag_in_progress = TRUE; + + /* get a new cursor, if necessary */ + /* FIXME multi-head */ + if (cursor == NULL) + cursor = gdk_cursor_new (GDK_FLEUR); + + /* grab the pointer */ + gtk_grab_add (GTK_WIDGET (notebook)); + + /* FIXME multi-head */ + if (!gdk_pointer_is_grabbed ()) + { + gdk_pointer_grab (gtk_widget_get_window (GTK_WIDGET (notebook)), + FALSE, + GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, + NULL, + cursor, + time); + } +} + +static void +drag_stop (GeditNotebook *notebook) +{ + if (notebook->priv->drag_in_progress) + { + g_signal_emit (G_OBJECT (notebook), + signals[TABS_REORDERED], + 0); + } + + notebook->priv->drag_in_progress = FALSE; + if (notebook->priv->motion_notify_handler_id != 0) + { + g_signal_handler_disconnect (G_OBJECT (notebook), + notebook->priv->motion_notify_handler_id); + notebook->priv->motion_notify_handler_id = 0; + } +} + +/* This function is only called during dnd, we don't need to emit TABS_REORDERED + * here, instead we do it on drag_stop + */ +static void +move_current_tab (GeditNotebook *notebook, + gint dest_position) +{ + gint cur_page_num; + + cur_page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); + + if (dest_position != cur_page_num) + { + GtkWidget *cur_tab; + + cur_tab = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), + cur_page_num); + + gedit_notebook_reorder_tab (GEDIT_NOTEBOOK (notebook), + GEDIT_TAB (cur_tab), + dest_position); + } +} + +static gboolean +motion_notify_cb (GeditNotebook *notebook, + GdkEventMotion *event, + gpointer data) +{ + GeditNotebook *dest; + gint page_num; + gint result; + + if (notebook->priv->drag_in_progress == FALSE) + { + if (notebook->priv->tab_drag_and_drop_enabled == FALSE) + return FALSE; + + if (gtk_drag_check_threshold (GTK_WIDGET (notebook), + notebook->priv->x_start, + notebook->priv->y_start, + event->x_root, + event->y_root)) + { + drag_start (notebook, event->time); + return TRUE; + } + + return FALSE; + } + + result = find_notebook_and_tab_at_pos ((gint)event->x_root, + (gint)event->y_root, + &dest, + &page_num); + + if (result != NOT_IN_APP_WINDOWS) + { + if (dest != notebook) + { + move_current_tab_to_another_notebook (notebook, + dest, + event, + page_num); + } + else + { + g_return_val_if_fail (page_num >= -1, FALSE); + move_current_tab (notebook, page_num); + } + } + + return FALSE; +} + +static void +move_current_tab_to_another_notebook (GeditNotebook *src, + GeditNotebook *dest, + GdkEventMotion *event, + gint dest_position) +{ + GeditTab *tab; + gint cur_page; + + /* This is getting tricky, the tab was dragged in a notebook + * in another window of the same app, we move the tab + * to that new notebook, and let this notebook handle the + * drag + */ + g_return_if_fail (GEDIT_IS_NOTEBOOK (dest)); + g_return_if_fail (dest != src); + + cur_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (src)); + tab = GEDIT_TAB (gtk_notebook_get_nth_page (GTK_NOTEBOOK (src), + cur_page)); + + /* stop drag in origin window */ + /* ungrab the pointer if it's grabbed */ + drag_stop (src); + if (gdk_pointer_is_grabbed ()) + { + gdk_pointer_ungrab (event->time); + } + gtk_grab_remove (GTK_WIDGET (src)); + + gedit_notebook_move_tab (src, dest, tab, dest_position); + + /* start drag handling in dest notebook */ + dest->priv->motion_notify_handler_id = + g_signal_connect (G_OBJECT (dest), + "motion-notify-event", + G_CALLBACK (motion_notify_cb), + NULL); + + drag_start (dest, event->time); +} + +static gboolean +button_release_cb (GeditNotebook *notebook, + GdkEventButton *event, + gpointer data) +{ + if (notebook->priv->drag_in_progress) + { + gint cur_page_num; + GtkWidget *cur_page; + + cur_page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); + cur_page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), + cur_page_num); + + /* CHECK: I don't follow the code here -- Paolo */ + if (!is_in_notebook_window (notebook, event->x_root, event->y_root) && + (gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) > 1)) + { + /* Tab was detached */ + g_signal_emit (G_OBJECT (notebook), + signals[TAB_DETACHED], + 0, + cur_page); + } + + /* ungrab the pointer if it's grabbed */ + if (gdk_pointer_is_grabbed ()) + { + gdk_pointer_ungrab (event->time); + } + gtk_grab_remove (GTK_WIDGET (notebook)); + } + + /* This must be called even if a drag isn't happening */ + drag_stop (notebook); + + return FALSE; +} + +static gboolean +button_press_cb (GeditNotebook *notebook, + GdkEventButton *event, + gpointer data) +{ + gint tab_clicked; + + if (notebook->priv->drag_in_progress) + return TRUE; + + tab_clicked = find_tab_num_at_pos (notebook, + event->x_root, + event->y_root); + + if ((event->button == 1) && + (event->type == GDK_BUTTON_PRESS) && + (tab_clicked >= 0)) + { + notebook->priv->x_start = event->x_root; + notebook->priv->y_start = event->y_root; + + notebook->priv->motion_notify_handler_id = + g_signal_connect (G_OBJECT (notebook), + "motion-notify-event", + G_CALLBACK (motion_notify_cb), + NULL); + } + else if ((event->type == GDK_BUTTON_PRESS) && + (event->button == 3)) + { + if (tab_clicked == -1) + { + // CHECK: do we really need it? + + /* consume event, so that we don't pop up the context menu when + * the mouse if not over a tab label + */ + return TRUE; + } + else + { + /* Switch to the page the mouse is over, but don't consume the event */ + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), + tab_clicked); + } + } + + return FALSE; +} + +/** + * gedit_notebook_new: + * + * Creates a new #GeditNotebook object. + * + * Returns: a new #GeditNotebook + */ +GtkWidget * +gedit_notebook_new (void) +{ + return GTK_WIDGET (g_object_new (GEDIT_TYPE_NOTEBOOK, NULL)); +} + +static void +gedit_notebook_switch_page_cb (GtkNotebook *notebook, + GtkNotebookPage *page, + guint page_num, + gpointer data) +{ + GeditNotebook *nb = GEDIT_NOTEBOOK (notebook); + GtkWidget *child; + GeditView *view; + + child = gtk_notebook_get_nth_page (notebook, page_num); + + /* Remove the old page, we dont want to grow unnecessarily + * the list */ + if (nb->priv->focused_pages) + { + nb->priv->focused_pages = + g_list_remove (nb->priv->focused_pages, child); + } + + nb->priv->focused_pages = g_list_append (nb->priv->focused_pages, + child); + + /* give focus to the view */ + view = gedit_tab_get_view (GEDIT_TAB (child)); + gtk_widget_grab_focus (GTK_WIDGET (view)); +} + +/* + * update_tabs_visibility: Hide tabs if there is only one tab + * and the pref is not set. + */ +static void +update_tabs_visibility (GeditNotebook *nb, + gboolean before_inserting) +{ + gboolean show_tabs; + guint num; + + num = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)); + + if (before_inserting) num++; + + show_tabs = (nb->priv->always_show_tabs || num > 1); + + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nb), show_tabs); +} + +static void +gedit_notebook_init (GeditNotebook *notebook) +{ + notebook->priv = GEDIT_NOTEBOOK_GET_PRIVATE (notebook); + + notebook->priv->close_buttons_sensitive = TRUE; + notebook->priv->tab_drag_and_drop_enabled = TRUE; + + gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE); + gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); + + notebook->priv->always_show_tabs = TRUE; + + g_signal_connect (notebook, + "button-press-event", + (GCallback)button_press_cb, + NULL); + g_signal_connect (notebook, + "button-release-event", + (GCallback)button_release_cb, + NULL); + gtk_widget_add_events (GTK_WIDGET (notebook), + GDK_BUTTON1_MOTION_MASK); + + g_signal_connect_after (G_OBJECT (notebook), + "switch_page", + G_CALLBACK (gedit_notebook_switch_page_cb), + NULL); +} + +static void +gedit_notebook_finalize (GObject *object) +{ + GeditNotebook *notebook = GEDIT_NOTEBOOK (object); + + g_list_free (notebook->priv->focused_pages); + + G_OBJECT_CLASS (gedit_notebook_parent_class)->finalize (object); +} + +/* + * We need to override this because when we don't show the tabs, like in + * fullscreen we need to have wrap around too + */ +static gboolean +gedit_notebook_change_current_page (GtkNotebook *notebook, + gint offset) +{ + gboolean wrap_around; + gint current; + + current = gtk_notebook_get_current_page (notebook); + + if (current != -1) + { + current = current + offset; + + g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)), + "gtk-keynav-wrap-around", &wrap_around, + NULL); + + if (wrap_around) + { + if (current < 0) + { + current = gtk_notebook_get_n_pages (notebook) - 1; + } + else if (current >= gtk_notebook_get_n_pages (notebook)) + { + current = 0; + } + } + + gtk_notebook_set_current_page (notebook, current); + } + else + { + gtk_widget_error_bell (GTK_WIDGET (notebook)); + } + + return TRUE; +} + +static void +close_button_clicked_cb (GeditTabLabel *tab_label, GeditNotebook *notebook) +{ + GeditTab *tab; + + tab = gedit_tab_label_get_tab (tab_label); + g_signal_emit (notebook, signals[TAB_CLOSE_REQUEST], 0, tab); +} + +static GtkWidget * +create_tab_label (GeditNotebook *nb, + GeditTab *tab) +{ + GtkWidget *tab_label; + + tab_label = gedit_tab_label_new (tab); + + g_signal_connect (tab_label, + "close-clicked", + G_CALLBACK (close_button_clicked_cb), + nb); + + g_object_set_data (G_OBJECT (tab), "tab-label", tab_label); + + return tab_label; +} + +static void +remove_tab_label (GeditNotebook *nb, + GeditTab *tab) +{ + GtkWidget *tab_label; + + tab_label = gedit_tab_label_new (tab); + + g_signal_handlers_disconnect_by_func (tab_label, + G_CALLBACK (close_button_clicked_cb), + nb); + + g_object_set_data (G_OBJECT (tab), "tab-label", NULL); +} + +static GtkWidget * +get_tab_label (GeditTab *tab) +{ + GtkWidget *tab_label; + + tab_label = GTK_WIDGET (g_object_get_data (G_OBJECT (tab), "tab-label")); + g_return_val_if_fail (tab_label != NULL, NULL); + + return tab_label; +} + +/** + * gedit_notebook_set_always_show_tabs: + * @nb: a #GeditNotebook + * @show_tabs: %TRUE to always show the tabs + * + * Sets the visibility of the tabs in the @nb. + */ +void +gedit_notebook_set_always_show_tabs (GeditNotebook *nb, + gboolean show_tabs) +{ + g_return_if_fail (GEDIT_IS_NOTEBOOK (nb)); + + nb->priv->always_show_tabs = (show_tabs != FALSE); + + update_tabs_visibility (nb, FALSE); +} + +/** + * gedit_notebook_add_tab: + * @nb: a #GeditNotebook + * @tab: a #GeditTab + * @position: the position where the @tab should be added + * @jump_to: %TRUE to set the @tab as active + * + * Adds the specified @tab to the @nb. + */ +void +gedit_notebook_add_tab (GeditNotebook *nb, + GeditTab *tab, + gint position, + gboolean jump_to) +{ + GtkWidget *tab_label; + + g_return_if_fail (GEDIT_IS_NOTEBOOK (nb)); + g_return_if_fail (GEDIT_IS_TAB (tab)); + + tab_label = create_tab_label (nb, tab); + gtk_notebook_insert_page (GTK_NOTEBOOK (nb), + GTK_WIDGET (tab), + tab_label, + position); + update_tabs_visibility (nb, TRUE); + + g_signal_emit (G_OBJECT (nb), signals[TAB_ADDED], 0, tab); + + /* The signal handler may have reordered the tabs */ + position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), + GTK_WIDGET (tab)); + + if (jump_to) + { + GeditView *view; + + gtk_notebook_set_current_page (GTK_NOTEBOOK (nb), position); + g_object_set_data (G_OBJECT (tab), + "jump_to", + GINT_TO_POINTER (jump_to)); + view = gedit_tab_get_view (tab); + + gtk_widget_grab_focus (GTK_WIDGET (view)); + } +} + +static void +smart_tab_switching_on_closure (GeditNotebook *nb, + GeditTab *tab) +{ + gboolean jump_to; + + jump_to = GPOINTER_TO_INT (g_object_get_data + (G_OBJECT (tab), "jump_to")); + + if (!jump_to || !nb->priv->focused_pages) + { + gtk_notebook_next_page (GTK_NOTEBOOK (nb)); + } + else + { + GList *l; + GtkWidget *child; + int page_num; + + /* activate the last focused tab */ + l = g_list_last (nb->priv->focused_pages); + child = GTK_WIDGET (l->data); + page_num = gtk_notebook_page_num (GTK_NOTEBOOK (nb), + child); + gtk_notebook_set_current_page (GTK_NOTEBOOK (nb), + page_num); + } +} + +static void +remove_tab (GeditTab *tab, + GeditNotebook *nb) +{ + gint position; + + position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), GTK_WIDGET (tab)); + + /* we ref the tab so that it's still alive while the tabs_removed + * signal is processed. + */ + g_object_ref (tab); + + remove_tab_label (nb, tab); + gtk_notebook_remove_page (GTK_NOTEBOOK (nb), position); + update_tabs_visibility (nb, FALSE); + + g_signal_emit (G_OBJECT (nb), signals[TAB_REMOVED], 0, tab); + + g_object_unref (tab); +} + +/** + * gedit_notebook_remove_tab: + * @nb: a #GeditNotebook + * @tab: a #GeditTab + * + * Removes @tab from @nb. + */ +void +gedit_notebook_remove_tab (GeditNotebook *nb, + GeditTab *tab) +{ + gint position, curr; + + g_return_if_fail (GEDIT_IS_NOTEBOOK (nb)); + g_return_if_fail (GEDIT_IS_TAB (tab)); + + /* Remove the page from the focused pages list */ + nb->priv->focused_pages = g_list_remove (nb->priv->focused_pages, + tab); + + position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), GTK_WIDGET (tab)); + curr = gtk_notebook_get_current_page (GTK_NOTEBOOK (nb)); + + if (position == curr) + { + smart_tab_switching_on_closure (nb, tab); + } + + remove_tab (tab, nb); +} + +/** + * gedit_notebook_remove_all_tabs: + * @nb: a #GeditNotebook + * + * Removes all #GeditTab from @nb. + */ +void +gedit_notebook_remove_all_tabs (GeditNotebook *nb) +{ + g_return_if_fail (GEDIT_IS_NOTEBOOK (nb)); + + g_list_free (nb->priv->focused_pages); + nb->priv->focused_pages = NULL; + + gtk_container_foreach (GTK_CONTAINER (nb), + (GtkCallback)remove_tab, + nb); +} + +static void +set_close_buttons_sensitivity (GeditTab *tab, + GeditNotebook *nb) +{ + GtkWidget *tab_label; + + tab_label = get_tab_label (tab); + + gedit_tab_label_set_close_button_sensitive (GEDIT_TAB_LABEL (tab_label), + nb->priv->close_buttons_sensitive); +} + +/** + * gedit_notebook_set_close_buttons_sensitive: + * @nb: a #GeditNotebook + * @sensitive: %TRUE to make the buttons sensitive + * + * Sets whether the close buttons in the tabs of @nb are sensitive. + */ +void +gedit_notebook_set_close_buttons_sensitive (GeditNotebook *nb, + gboolean sensitive) +{ + g_return_if_fail (GEDIT_IS_NOTEBOOK (nb)); + + sensitive = (sensitive != FALSE); + + if (sensitive == nb->priv->close_buttons_sensitive) + return; + + nb->priv->close_buttons_sensitive = sensitive; + + gtk_container_foreach (GTK_CONTAINER (nb), + (GtkCallback)set_close_buttons_sensitivity, + nb); +} + +/** + * gedit_notebook_get_close_buttons_sensitive: + * @nb: a #GeditNotebook + * + * Whether the close buttons are sensitive. + * + * Returns: %TRUE if the close buttons are sensitive + */ +gboolean +gedit_notebook_get_close_buttons_sensitive (GeditNotebook *nb) +{ + g_return_val_if_fail (GEDIT_IS_NOTEBOOK (nb), TRUE); + + return nb->priv->close_buttons_sensitive; +} + +/** + * gedit_notebook_set_tab_drag_and_drop_enabled: + * @nb: a #GeditNotebook + * @enable: %TRUE to enable the drag and drop + * + * Sets whether drag and drop of tabs in the @nb is enabled. + */ +void +gedit_notebook_set_tab_drag_and_drop_enabled (GeditNotebook *nb, + gboolean enable) +{ + g_return_if_fail (GEDIT_IS_NOTEBOOK (nb)); + + enable = (enable != FALSE); + + if (enable == nb->priv->tab_drag_and_drop_enabled) + return; + + nb->priv->tab_drag_and_drop_enabled = enable; +} + +/** + * gedit_notebook_get_tab_drag_and_drop_enabled: + * @nb: a #GeditNotebook + * + * Whether the drag and drop is enabled in the @nb. + * + * Returns: %TRUE if the drag and drop is enabled. + */ +gboolean +gedit_notebook_get_tab_drag_and_drop_enabled (GeditNotebook *nb) +{ + g_return_val_if_fail (GEDIT_IS_NOTEBOOK (nb), TRUE); + + return nb->priv->tab_drag_and_drop_enabled; +} + diff --git a/gedit/gedit-notebook.h b/gedit/gedit-notebook.h new file mode 100755 index 00000000..ada7c274 --- /dev/null +++ b/gedit/gedit-notebook.h @@ -0,0 +1,143 @@ +/* + * gedit-notebook.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +/* This file is a modified version of the epiphany file ephy-notebook.h + * Here the relevant copyright: + * + * Copyright (C) 2002 Christophe Fergeau + * Copyright (C) 2003 Marco Pesenti Gritti + * Copyright (C) 2003, 2004 Christian Persch + * + */ + +#ifndef GEDIT_NOTEBOOK_H +#define GEDIT_NOTEBOOK_H + +#include + +#include +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_NOTEBOOK (gedit_notebook_get_type ()) +#define GEDIT_NOTEBOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_NOTEBOOK, GeditNotebook)) +#define GEDIT_NOTEBOOK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_NOTEBOOK, GeditNotebookClass)) +#define GEDIT_IS_NOTEBOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_NOTEBOOK)) +#define GEDIT_IS_NOTEBOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_NOTEBOOK)) +#define GEDIT_NOTEBOOK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_NOTEBOOK, GeditNotebookClass)) + +/* Private structure type */ +typedef struct _GeditNotebookPrivate GeditNotebookPrivate; + +/* + * Main object structure + */ +typedef struct _GeditNotebook GeditNotebook; + +struct _GeditNotebook +{ + GtkNotebook notebook; + + /*< private >*/ + GeditNotebookPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditNotebookClass GeditNotebookClass; + +struct _GeditNotebookClass +{ + GtkNotebookClass parent_class; + + /* Signals */ + void (* tab_added) (GeditNotebook *notebook, + GeditTab *tab); + void (* tab_removed) (GeditNotebook *notebook, + GeditTab *tab); + void (* tab_detached) (GeditNotebook *notebook, + GeditTab *tab); + void (* tabs_reordered) (GeditNotebook *notebook); + void (* tab_close_request) + (GeditNotebook *notebook, + GeditTab *tab); +}; + +/* + * Public methods + */ +GType gedit_notebook_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_notebook_new (void); + +void gedit_notebook_add_tab (GeditNotebook *nb, + GeditTab *tab, + gint position, + gboolean jump_to); + +void gedit_notebook_remove_tab (GeditNotebook *nb, + GeditTab *tab); + +void gedit_notebook_remove_all_tabs (GeditNotebook *nb); + +void gedit_notebook_reorder_tab (GeditNotebook *src, + GeditTab *tab, + gint dest_position); + +void gedit_notebook_move_tab (GeditNotebook *src, + GeditNotebook *dest, + GeditTab *tab, + gint dest_position); + +/* FIXME: do we really need this function ? */ +void gedit_notebook_set_always_show_tabs + (GeditNotebook *nb, + gboolean show_tabs); + +void gedit_notebook_set_close_buttons_sensitive + (GeditNotebook *nb, + gboolean sensitive); + +gboolean gedit_notebook_get_close_buttons_sensitive + (GeditNotebook *nb); + +void gedit_notebook_set_tab_drag_and_drop_enabled + (GeditNotebook *nb, + gboolean enable); + +gboolean gedit_notebook_get_tab_drag_and_drop_enabled + (GeditNotebook *nb); + +G_END_DECLS + +#endif /* GEDIT_NOTEBOOK_H */ diff --git a/gedit/gedit-object-module.c b/gedit/gedit-object-module.c new file mode 100755 index 00000000..3c6f09c1 --- /dev/null +++ b/gedit/gedit-object-module.c @@ -0,0 +1,343 @@ +/* + * gedit-object-module.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +/* This is a modified version of ephy-module.c from Epiphany source code. + * Here the original copyright assignment: + * + * Copyright (C) 2003 Marco Pesenti Gritti + * Copyright (C) 2003, 2004 Christian Persch + * + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id: gedit-module.c 6314 2008-06-05 12:57:53Z pborelli $ + */ + +#include "config.h" + +#include "gedit-object-module.h" +#include "gedit-debug.h" + +typedef GType (*GeditObjectModuleRegisterFunc) (GTypeModule *); + +enum { + PROP_0, + PROP_MODULE_NAME, + PROP_PATH, + PROP_TYPE_REGISTRATION, + PROP_RESIDENT +}; + +struct _GeditObjectModulePrivate +{ + GModule *library; + + GType type; + gchar *path; + gchar *module_name; + gchar *type_registration; + + gboolean resident; +}; + +G_DEFINE_TYPE (GeditObjectModule, gedit_object_module, G_TYPE_TYPE_MODULE); + +static gboolean +gedit_object_module_load (GTypeModule *gmodule) +{ + GeditObjectModule *module = GEDIT_OBJECT_MODULE (gmodule); + GeditObjectModuleRegisterFunc register_func; + gchar *path; + + gedit_debug_message (DEBUG_PLUGINS, "Loading %s module from %s", + module->priv->module_name, module->priv->path); + + path = g_module_build_path (module->priv->path, module->priv->module_name); + g_return_val_if_fail (path != NULL, FALSE); + gedit_debug_message (DEBUG_PLUGINS, "Module filename: %s", path); + + module->priv->library = g_module_open (path, + G_MODULE_BIND_LAZY); + g_free (path); + + if (module->priv->library == NULL) + { + g_warning ("%s: %s", module->priv->module_name, g_module_error()); + + return FALSE; + } + + /* extract symbols from the lib */ + if (!g_module_symbol (module->priv->library, module->priv->type_registration, + (void *) ®ister_func)) + { + g_warning ("%s: %s", module->priv->module_name, g_module_error()); + g_module_close (module->priv->library); + + return FALSE; + } + + /* symbol can still be NULL even though g_module_symbol + * returned TRUE */ + if (register_func == NULL) + { + g_warning ("Symbol '%s' should not be NULL", module->priv->type_registration); + g_module_close (module->priv->library); + + return FALSE; + } + + module->priv->type = register_func (gmodule); + + if (module->priv->type == 0) + { + g_warning ("Invalid object contained by module %s", module->priv->module_name); + return FALSE; + } + + if (module->priv->resident) + { + g_module_make_resident (module->priv->library); + } + + return TRUE; +} + +static void +gedit_object_module_unload (GTypeModule *gmodule) +{ + GeditObjectModule *module = GEDIT_OBJECT_MODULE (gmodule); + + gedit_debug_message (DEBUG_PLUGINS, "Unloading %s", module->priv->path); + + g_module_close (module->priv->library); + + module->priv->library = NULL; + module->priv->type = 0; +} + +static void +gedit_object_module_init (GeditObjectModule *module) +{ + gedit_debug_message (DEBUG_PLUGINS, "GeditObjectModule %p initialising", module); + + module->priv = G_TYPE_INSTANCE_GET_PRIVATE (module, + GEDIT_TYPE_OBJECT_MODULE, + GeditObjectModulePrivate); +} + +static void +gedit_object_module_finalize (GObject *object) +{ + GeditObjectModule *module = GEDIT_OBJECT_MODULE (object); + + gedit_debug_message (DEBUG_PLUGINS, "GeditObjectModule %p finalising", module); + + g_free (module->priv->path); + g_free (module->priv->module_name); + g_free (module->priv->type_registration); + + G_OBJECT_CLASS (gedit_object_module_parent_class)->finalize (object); +} + +static void +gedit_object_module_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditObjectModule *module = GEDIT_OBJECT_MODULE (object); + + switch (prop_id) + { + case PROP_MODULE_NAME: + g_value_set_string (value, module->priv->module_name); + break; + case PROP_PATH: + g_value_set_string (value, module->priv->path); + break; + case PROP_TYPE_REGISTRATION: + g_value_set_string (value, module->priv->type_registration); + break; + case PROP_RESIDENT: + g_value_set_boolean (value, module->priv->resident); + break; + default: + g_return_if_reached (); + } +} + +static void +gedit_object_module_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditObjectModule *module = GEDIT_OBJECT_MODULE (object); + + switch (prop_id) + { + case PROP_MODULE_NAME: + module->priv->module_name = g_value_dup_string (value); + g_type_module_set_name (G_TYPE_MODULE (object), + module->priv->module_name); + break; + case PROP_PATH: + module->priv->path = g_value_dup_string (value); + break; + case PROP_TYPE_REGISTRATION: + module->priv->type_registration = g_value_dup_string (value); + break; + case PROP_RESIDENT: + module->priv->resident = g_value_get_boolean (value); + break; + default: + g_return_if_reached (); + } +} + +static void +gedit_object_module_class_init (GeditObjectModuleClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (klass); + + object_class->set_property = gedit_object_module_set_property; + object_class->get_property = gedit_object_module_get_property; + object_class->finalize = gedit_object_module_finalize; + + module_class->load = gedit_object_module_load; + module_class->unload = gedit_object_module_unload; + + g_object_class_install_property (object_class, + PROP_MODULE_NAME, + g_param_spec_string ("module-name", + "Module Name", + "The module to load for this object", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_PATH, + g_param_spec_string ("path", + "Path", + "The path to use when loading this module", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_TYPE_REGISTRATION, + g_param_spec_string ("type-registration", + "Type Registration", + "The name of the type registration function", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_RESIDENT, + g_param_spec_boolean ("resident", + "Resident", + "Whether the module is resident", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_type_class_add_private (klass, sizeof (GeditObjectModulePrivate)); +} + +GeditObjectModule * +gedit_object_module_new (const gchar *module_name, + const gchar *path, + const gchar *type_registration, + gboolean resident) +{ + return (GeditObjectModule *)g_object_new (GEDIT_TYPE_OBJECT_MODULE, + "module-name", + module_name, + "path", + path, + "type-registration", + type_registration, + "resident", + resident, + NULL); +} + +GObject * +gedit_object_module_new_object (GeditObjectModule *module, + const gchar *first_property_name, + ...) +{ + va_list var_args; + GObject *result; + + g_return_val_if_fail (module->priv->type != 0, NULL); + + gedit_debug_message (DEBUG_PLUGINS, "Creating object of type %s", + g_type_name (module->priv->type)); + + va_start (var_args, first_property_name); + result = g_object_new_valist (module->priv->type, first_property_name, var_args); + va_end (var_args); + + return result; +} + +const gchar * +gedit_object_module_get_path (GeditObjectModule *module) +{ + g_return_val_if_fail (GEDIT_IS_OBJECT_MODULE (module), NULL); + + return module->priv->path; +} + +const gchar * +gedit_object_module_get_module_name (GeditObjectModule *module) +{ + g_return_val_if_fail (GEDIT_IS_OBJECT_MODULE (module), NULL); + + return module->priv->module_name; +} + +const gchar * +gedit_object_module_get_type_registration (GeditObjectModule *module) +{ + g_return_val_if_fail (GEDIT_IS_OBJECT_MODULE (module), NULL); + + return module->priv->type_registration; +} + +GType +gedit_object_module_get_object_type (GeditObjectModule *module) +{ + g_return_val_if_fail (GEDIT_IS_OBJECT_MODULE (module), 0); + + return module->priv->type; +} diff --git a/gedit/gedit-object-module.h b/gedit/gedit-object-module.h new file mode 100755 index 00000000..06210794 --- /dev/null +++ b/gedit/gedit-object-module.h @@ -0,0 +1,94 @@ +/* + * gedit-object-module.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +/* This is a modified version of gedit-module.h from Epiphany source code. + * Here the original copyright assignment: + * + * Copyright (C) 2003 Marco Pesenti Gritti + * Copyright (C) 2003, 2004 Christian Persch + * + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id: gedit-module.h 6263 2008-05-05 10:52:10Z sfre $ + */ + +#ifndef __GEDIT_OBJECT_MODULE_H__ +#define __GEDIT_OBJECT_MODULE_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_OBJECT_MODULE (gedit_object_module_get_type ()) +#define GEDIT_OBJECT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_OBJECT_MODULE, GeditObjectModule)) +#define GEDIT_OBJECT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_OBJECT_MODULE, GeditObjectModuleClass)) +#define GEDIT_IS_OBJECT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_OBJECT_MODULE)) +#define GEDIT_IS_OBJECT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_OBJECT_MODULE)) +#define GEDIT_OBJECT_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_OBJECT_MODULE, GeditObjectModuleClass)) + +typedef struct _GeditObjectModule GeditObjectModule; +typedef struct _GeditObjectModulePrivate GeditObjectModulePrivate; + +struct _GeditObjectModule +{ + GTypeModule parent; + + GeditObjectModulePrivate *priv; +}; + +typedef struct _GeditObjectModuleClass GeditObjectModuleClass; + +struct _GeditObjectModuleClass +{ + GTypeModuleClass parent_class; + + /* Virtual class methods */ + void (* garbage_collect) (); +}; + +GType gedit_object_module_get_type (void) G_GNUC_CONST; + +GeditObjectModule *gedit_object_module_new (const gchar *module_name, + const gchar *path, + const gchar *type_registration, + gboolean resident); + +GObject *gedit_object_module_new_object (GeditObjectModule *module, + const gchar *first_property_name, + ...); + +GType gedit_object_module_get_object_type (GeditObjectModule *module); +const gchar *gedit_object_module_get_path (GeditObjectModule *module); +const gchar *gedit_object_module_get_module_name (GeditObjectModule *module); +const gchar *gedit_object_module_get_type_registration (GeditObjectModule *module); + +G_END_DECLS + +#endif diff --git a/gedit/gedit-panel.c b/gedit/gedit-panel.c new file mode 100755 index 00000000..fb1f9672 --- /dev/null +++ b/gedit/gedit-panel.c @@ -0,0 +1,950 @@ +/* + * gedit-panel.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#include "gedit-panel.h" + +#include +#include +#include +#include + +#include "gedit-close-button.h" +#include "gedit-window.h" +#include "gedit-debug.h" + +#define PANEL_ITEM_KEY "GeditPanelItemKey" + +#define GEDIT_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_PANEL, GeditPanelPrivate)) + +struct _GeditPanelPrivate +{ + GtkOrientation orientation; + + /* Title bar (vertical panel only) */ + GtkWidget *title_image; + GtkWidget *title_label; + + /* Notebook */ + GtkWidget *notebook; +}; + +typedef struct _GeditPanelItem GeditPanelItem; + +struct _GeditPanelItem +{ + gchar *name; + GtkWidget *icon; +}; + +/* Properties */ +enum { + PROP_0, + PROP_ORIENTATION +}; + +/* Signals */ +enum { + ITEM_ADDED, + ITEM_REMOVED, + CLOSE, + FOCUS_DOCUMENT, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL]; + +static GObject *gedit_panel_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_properties); + + +G_DEFINE_TYPE(GeditPanel, gedit_panel, GTK_TYPE_VBOX) + +static void +gedit_panel_finalize (GObject *obj) +{ + if (G_OBJECT_CLASS (gedit_panel_parent_class)->finalize) + (*G_OBJECT_CLASS (gedit_panel_parent_class)->finalize) (obj); +} + +static void +gedit_panel_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditPanel *panel = GEDIT_PANEL (object); + + switch (prop_id) + { + case PROP_ORIENTATION: + g_value_set_enum(value, panel->priv->orientation); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_panel_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditPanel *panel = GEDIT_PANEL (object); + + switch (prop_id) + { + case PROP_ORIENTATION: + panel->priv->orientation = g_value_get_enum (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_panel_close (GeditPanel *panel) +{ + gtk_widget_hide (GTK_WIDGET (panel)); +} + +static void +gedit_panel_focus_document (GeditPanel *panel) +{ + GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (panel)); +#if !GTK_CHECK_VERSION (2, 18, 0) + if (GTK_WIDGET_TOPLEVEL (toplevel) && GEDIT_IS_WINDOW (toplevel)) +#else + if (gtk_widget_is_toplevel (toplevel) && GEDIT_IS_WINDOW (toplevel)) +#endif + { + GeditView *view; + + view = gedit_window_get_active_view (GEDIT_WINDOW (toplevel)); + if (view != NULL) + gtk_widget_grab_focus (GTK_WIDGET (view)); + } +} + +static void +gedit_panel_grab_focus (GtkWidget *w) +{ + gint n; + GtkWidget *tab; + GeditPanel *panel = GEDIT_PANEL (w); + + n = gtk_notebook_get_current_page (GTK_NOTEBOOK (panel->priv->notebook)); + if (n == -1) + return; + + tab = gtk_notebook_get_nth_page (GTK_NOTEBOOK (panel->priv->notebook), + n); + g_return_if_fail (tab != NULL); + + gtk_widget_grab_focus (tab); +} + +static void +gedit_panel_class_init (GeditPanelClass *klass) +{ + GtkBindingSet *binding_set; + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GeditPanelPrivate)); + + object_class->constructor = gedit_panel_constructor; + object_class->finalize = gedit_panel_finalize; + object_class->get_property = gedit_panel_get_property; + object_class->set_property = gedit_panel_set_property; + + g_object_class_install_property (object_class, + PROP_ORIENTATION, + g_param_spec_enum ("orientation", + "Orientation", + "The panel's orientation", + GTK_TYPE_ORIENTATION, + GTK_ORIENTATION_VERTICAL, + G_PARAM_WRITABLE | + G_PARAM_READABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + widget_class->grab_focus = gedit_panel_grab_focus; + + klass->close = gedit_panel_close; + klass->focus_document = gedit_panel_focus_document; + + signals[ITEM_ADDED] = + g_signal_new ("item_added", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditPanelClass, item_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GTK_TYPE_WIDGET); + signals[ITEM_REMOVED] = + g_signal_new ("item_removed", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditPanelClass, item_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GTK_TYPE_WIDGET); + + /* Keybinding signals */ + signals[CLOSE] = + g_signal_new ("close", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditPanelClass, close), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + signals[FOCUS_DOCUMENT] = + g_signal_new ("focus_document", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditPanelClass, focus_document), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + binding_set = gtk_binding_set_by_class (klass); + + gtk_binding_entry_add_signal (binding_set, + GDK_Escape, + 0, + "close", + 0); + gtk_binding_entry_add_signal (binding_set, + GDK_Return, + GDK_CONTROL_MASK, + "focus_document", + 0); +} + +/* This is ugly, since it supports only known + * storage types of GtkImage, otherwise fall back + * to the empty icon. + * See http://bugzilla.mate.org/show_bug.cgi?id=317520. + */ +static void +set_gtk_image_from_gtk_image (GtkImage *image, + GtkImage *source) +{ + switch (gtk_image_get_storage_type (source)) + { + case GTK_IMAGE_EMPTY: + gtk_image_clear (image); + break; + case GTK_IMAGE_PIXMAP: + { + GdkPixmap *pm; + GdkBitmap *bm; + + gtk_image_get_pixmap (source, &pm, &bm); + gtk_image_set_from_pixmap (image, pm, bm); + } + break; + case GTK_IMAGE_IMAGE: + { + GdkImage *i; + GdkBitmap *bm; + + gtk_image_get_image (source, &i, &bm); + gtk_image_set_from_image (image, i, bm); + } + break; + case GTK_IMAGE_PIXBUF: + { + GdkPixbuf *pb; + + pb = gtk_image_get_pixbuf (source); + gtk_image_set_from_pixbuf (image, pb); + } + break; + case GTK_IMAGE_STOCK: + { + gchar *s_id; + GtkIconSize s; + + gtk_image_get_stock (source, &s_id, &s); + gtk_image_set_from_stock (image, s_id, s); + } + break; + case GTK_IMAGE_ICON_SET: + { + GtkIconSet *is; + GtkIconSize s; + + gtk_image_get_icon_set (source, &is, &s); + gtk_image_set_from_icon_set (image, is, s); + } + break; + case GTK_IMAGE_ANIMATION: + { + GdkPixbufAnimation *a; + + a = gtk_image_get_animation (source); + gtk_image_set_from_animation (image, a); + } + break; + case GTK_IMAGE_ICON_NAME: + { + const gchar *n; + GtkIconSize s; + + gtk_image_get_icon_name (source, &n, &s); + gtk_image_set_from_icon_name (image, n, s); + } + break; + default: + gtk_image_set_from_stock (image, + GTK_STOCK_FILE, + GTK_ICON_SIZE_MENU); + } +} + +static void +sync_title (GeditPanel *panel, + GeditPanelItem *item) +{ + if (panel->priv->orientation != GTK_ORIENTATION_VERTICAL) + return; + + if (item != NULL) + { + gtk_label_set_text (GTK_LABEL (panel->priv->title_label), + item->name); + + set_gtk_image_from_gtk_image (GTK_IMAGE (panel->priv->title_image), + GTK_IMAGE (item->icon)); + } + else + { + gtk_label_set_text (GTK_LABEL (panel->priv->title_label), + _("Empty")); + + gtk_image_set_from_stock (GTK_IMAGE (panel->priv->title_image), + GTK_STOCK_FILE, + GTK_ICON_SIZE_MENU); + } +} + +static void +notebook_page_changed (GtkNotebook *notebook, + GtkNotebookPage *page, + guint page_num, + GeditPanel *panel) +{ + GtkWidget *item; + GeditPanelItem *data; + + item = gtk_notebook_get_nth_page (notebook, page_num); + g_return_if_fail (item != NULL); + + data = (GeditPanelItem *)g_object_get_data (G_OBJECT (item), + PANEL_ITEM_KEY); + g_return_if_fail (data != NULL); + + sync_title (panel, data); +} + +static void +panel_show (GeditPanel *panel, + gpointer user_data) +{ + gint page; + GtkNotebook *nb; + + nb = GTK_NOTEBOOK (panel->priv->notebook); + + page = gtk_notebook_get_current_page (nb); + + if (page != -1) + notebook_page_changed (nb, NULL, page, panel); +} + +static void +gedit_panel_init (GeditPanel *panel) +{ + panel->priv = GEDIT_PANEL_GET_PRIVATE (panel); +} + +static void +close_button_clicked_cb (GtkWidget *widget, + GtkWidget *panel) +{ + gtk_widget_hide (panel); +} + +static GtkWidget * +create_close_button (GeditPanel *panel) +{ + GtkWidget *button; + + button = gedit_close_button_new (); + + gtk_widget_set_tooltip_text (button, _("Hide panel")); + + g_signal_connect (button, + "clicked", + G_CALLBACK (close_button_clicked_cb), + panel); + + return button; +} + +static void +build_notebook_for_panel (GeditPanel *panel) +{ + /* Create the panel notebook */ + panel->priv->notebook = gtk_notebook_new (); + + gtk_notebook_set_tab_pos (GTK_NOTEBOOK (panel->priv->notebook), + GTK_POS_BOTTOM); + gtk_notebook_set_scrollable (GTK_NOTEBOOK (panel->priv->notebook), + TRUE); + gtk_notebook_popup_enable (GTK_NOTEBOOK (panel->priv->notebook)); + + gtk_widget_show (GTK_WIDGET (panel->priv->notebook)); + + g_signal_connect (panel->priv->notebook, + "switch-page", + G_CALLBACK (notebook_page_changed), + panel); +} + +static void +build_horizontal_panel (GeditPanel *panel) +{ + GtkWidget *box; + GtkWidget *sidebar; + GtkWidget *close_button; + + box = gtk_hbox_new(FALSE, 0); + + gtk_box_pack_start (GTK_BOX (box), + panel->priv->notebook, + TRUE, + TRUE, + 0); + + /* Toolbar, close button and first separator */ + sidebar = gtk_vbox_new(FALSE, 6); + gtk_container_set_border_width (GTK_CONTAINER (sidebar), 4); + + gtk_box_pack_start (GTK_BOX (box), + sidebar, + FALSE, + FALSE, + 0); + + close_button = create_close_button (panel); + + gtk_box_pack_start (GTK_BOX (sidebar), + close_button, + FALSE, + FALSE, + 0); + + gtk_widget_show_all (box); + + gtk_box_pack_start (GTK_BOX (panel), + box, + TRUE, + TRUE, + 0); +} + +static void +build_vertical_panel (GeditPanel *panel) +{ + GtkWidget *close_button; + GtkWidget *title_hbox; + GtkWidget *icon_name_hbox; + GtkWidget *dummy_label; + + /* Create title hbox */ + title_hbox = gtk_hbox_new (FALSE, 6); + gtk_container_set_border_width (GTK_CONTAINER (title_hbox), 5); + + gtk_box_pack_start (GTK_BOX (panel), title_hbox, FALSE, FALSE, 0); + + icon_name_hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (title_hbox), + icon_name_hbox, + TRUE, + TRUE, + 0); + + panel->priv->title_image = + gtk_image_new_from_stock (GTK_STOCK_FILE, + GTK_ICON_SIZE_MENU); + gtk_box_pack_start (GTK_BOX (icon_name_hbox), + panel->priv->title_image, + FALSE, + TRUE, + 0); + + dummy_label = gtk_label_new (" "); + + gtk_box_pack_start (GTK_BOX (icon_name_hbox), + dummy_label, + FALSE, + FALSE, + 0); + + panel->priv->title_label = gtk_label_new (_("Empty")); + gtk_misc_set_alignment (GTK_MISC (panel->priv->title_label), 0, 0.5); + gtk_label_set_ellipsize(GTK_LABEL (panel->priv->title_label), PANGO_ELLIPSIZE_END); + + gtk_box_pack_start (GTK_BOX (icon_name_hbox), + panel->priv->title_label, + TRUE, + TRUE, + 0); + + close_button = create_close_button (panel); + + gtk_box_pack_start (GTK_BOX (title_hbox), + close_button, + FALSE, + FALSE, + 0); + + gtk_widget_show_all (title_hbox); + + gtk_box_pack_start (GTK_BOX (panel), + panel->priv->notebook, + TRUE, + TRUE, + 0); +} + +static GObject * +gedit_panel_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_properties) +{ + + /* Invoke parent constructor. */ + GeditPanelClass *klass = GEDIT_PANEL_CLASS (g_type_class_peek (GEDIT_TYPE_PANEL)); + GObjectClass *parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); + GObject *obj = parent_class->constructor (type, + n_construct_properties, + construct_properties); + + /* Build the panel, now that we know the orientation + (_init has been called previously) */ + GeditPanel *panel = GEDIT_PANEL (obj); + + build_notebook_for_panel (panel); + if (panel->priv->orientation == GTK_ORIENTATION_HORIZONTAL) + build_horizontal_panel (panel); + else + build_vertical_panel (panel); + + g_signal_connect (panel, + "show", + G_CALLBACK (panel_show), + NULL); + + return obj; +} + +/** + * gedit_panel_new: + * @orientation: a #GtkOrientation + * + * Creates a new #GeditPanel with the given @orientation. You shouldn't create + * a new panel use gedit_window_get_side_panel() or gedit_window_get_bottom_panel() + * instead. + * + * Returns: a new #GeditPanel object. + */ +GtkWidget * +gedit_panel_new (GtkOrientation orientation) +{ + return GTK_WIDGET (g_object_new (GEDIT_TYPE_PANEL, "orientation", orientation, NULL)); +} + +static GtkWidget * +build_tab_label (GeditPanel *panel, + GtkWidget *item, + const gchar *name, + GtkWidget *icon) +{ + GtkWidget *hbox, *label_hbox, *label_ebox; + GtkWidget *label; + + /* set hbox spacing and label padding (see below) so that there's an + * equal amount of space around the label */ + hbox = gtk_hbox_new (FALSE, 4); + + label_ebox = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (label_ebox), FALSE); + gtk_box_pack_start (GTK_BOX (hbox), label_ebox, TRUE, TRUE, 0); + + label_hbox = gtk_hbox_new (FALSE, 4); + gtk_container_add (GTK_CONTAINER (label_ebox), label_hbox); + + /* setup icon */ + gtk_box_pack_start (GTK_BOX (label_hbox), icon, FALSE, FALSE, 0); + + /* setup label */ + label = gtk_label_new (name); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 0, 0); + gtk_box_pack_start (GTK_BOX (label_hbox), label, TRUE, TRUE, 0); + + gtk_widget_set_tooltip_text (label_ebox, name); + + gtk_widget_show_all (hbox); + + if (panel->priv->orientation == GTK_ORIENTATION_VERTICAL) + gtk_widget_hide(label); + + g_object_set_data (G_OBJECT (item), "label", label); + g_object_set_data (G_OBJECT (item), "hbox", hbox); + + return hbox; +} + +/** + * gedit_panel_add_item: + * @panel: a #GeditPanel + * @item: the #GtkWidget to add to the @panel + * @name: the name to be shown in the @panel + * @image: the image to be shown in the @panel + * + * Adds a new item to the @panel. + */ +void +gedit_panel_add_item (GeditPanel *panel, + GtkWidget *item, + const gchar *name, + GtkWidget *image) +{ + GeditPanelItem *data; + GtkWidget *tab_label; + GtkWidget *menu_label; + gint w, h; + + g_return_if_fail (GEDIT_IS_PANEL (panel)); + g_return_if_fail (GTK_IS_WIDGET (item)); + g_return_if_fail (name != NULL); + g_return_if_fail (image == NULL || GTK_IS_IMAGE (image)); + + data = g_new (GeditPanelItem, 1); + + data->name = g_strdup (name); + + if (image == NULL) + { + /* default to empty */ + data->icon = gtk_image_new_from_stock (GTK_STOCK_FILE, + GTK_ICON_SIZE_MENU); + } + else + { + data->icon = image; + } + + gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h); + gtk_widget_set_size_request (data->icon, w, h); + + g_object_set_data (G_OBJECT (item), + PANEL_ITEM_KEY, + data); + + tab_label = build_tab_label (panel, item, data->name, data->icon); + + menu_label = gtk_label_new (name); + gtk_misc_set_alignment (GTK_MISC (menu_label), 0.0, 0.5); + + if (!GTK_WIDGET_VISIBLE (item)) + gtk_widget_show (item); + + gtk_notebook_append_page_menu (GTK_NOTEBOOK (panel->priv->notebook), + item, + tab_label, + menu_label); + + g_signal_emit (G_OBJECT (panel), signals[ITEM_ADDED], 0, item); +} + +/** + * gedit_panel_add_item_with_stock_icon: + * @panel: a #GeditPanel + * @item: the #GtkWidget to add to the @panel + * @name: the name to be shown in the @panel + * @stock_id: a stock id + * + * Same as gedit_panel_add_item() but using an image from stock. + */ +void +gedit_panel_add_item_with_stock_icon (GeditPanel *panel, + GtkWidget *item, + const gchar *name, + const gchar *stock_id) +{ + GtkWidget *icon = NULL; + + if (stock_id != NULL) + { + icon = gtk_image_new_from_stock (stock_id, + GTK_ICON_SIZE_MENU); + } + + gedit_panel_add_item (panel, item, name, icon); +} + +/** + * gedit_panel_remove_item: + * @panel: a #GeditPanel + * @item: the item to be removed from the panel + * + * Removes the widget @item from the panel if it is in the @panel and returns + * TRUE if there was not any problem. + * + * Returns: TRUE if it was well removed. + */ +gboolean +gedit_panel_remove_item (GeditPanel *panel, + GtkWidget *item) +{ + GeditPanelItem *data; + gint page_num; + + g_return_val_if_fail (GEDIT_IS_PANEL (panel), FALSE); + g_return_val_if_fail (GTK_IS_WIDGET (item), FALSE); + + page_num = gtk_notebook_page_num (GTK_NOTEBOOK (panel->priv->notebook), + item); + + if (page_num == -1) + return FALSE; + + data = (GeditPanelItem *)g_object_get_data (G_OBJECT (item), + PANEL_ITEM_KEY); + g_return_val_if_fail (data != NULL, FALSE); + + g_free (data->name); + g_free (data); + + g_object_set_data (G_OBJECT (item), + PANEL_ITEM_KEY, + NULL); + + /* ref the item to keep it alive during signal emission */ + g_object_ref (G_OBJECT (item)); + + gtk_notebook_remove_page (GTK_NOTEBOOK (panel->priv->notebook), + page_num); + + /* if we removed all the pages, reset the title */ + if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (panel->priv->notebook)) == 0) + sync_title (panel, NULL); + + g_signal_emit (G_OBJECT (panel), signals[ITEM_REMOVED], 0, item); + + g_object_unref (G_OBJECT (item)); + + return TRUE; +} + +/** + * gedit_panel_activate_item: + * @panel: a #GeditPanel + * @item: the item to be activated + * + * Switches to the page that contains @item. + * + * Returns: TRUE if it was activated + */ +gboolean +gedit_panel_activate_item (GeditPanel *panel, + GtkWidget *item) +{ + gint page_num; + + g_return_val_if_fail (GEDIT_IS_PANEL (panel), FALSE); + g_return_val_if_fail (GTK_IS_WIDGET (item), FALSE); + + page_num = gtk_notebook_page_num (GTK_NOTEBOOK (panel->priv->notebook), + item); + + if (page_num == -1) + return FALSE; + + gtk_notebook_set_current_page (GTK_NOTEBOOK (panel->priv->notebook), + page_num); + + return TRUE; +} + +/** + * gedit_panel_item_is_active: + * @panel: a #GeditPanel + * @item: a widget contained in #GeditPanel + * + * Wheter @item is the one current active in @panel + * + * Returns: TRUE if the widget is active + */ +gboolean +gedit_panel_item_is_active (GeditPanel *panel, + GtkWidget *item) +{ + gint cur_page; + gint page_num; + + g_return_val_if_fail (GEDIT_IS_PANEL (panel), FALSE); + g_return_val_if_fail (GTK_IS_WIDGET (item), FALSE); + + page_num = gtk_notebook_page_num (GTK_NOTEBOOK (panel->priv->notebook), + item); + + if (page_num == -1) + return FALSE; + + cur_page = gtk_notebook_get_current_page ( + GTK_NOTEBOOK (panel->priv->notebook)); + + return (page_num == cur_page); +} + +/** + * gedit_panel_get_orientation: + * @panel: a #GeditPanel + * + * Gets the orientation of the @panel. + * + * Returns: the #GtkOrientation of #GeditPanel + */ +GtkOrientation +gedit_panel_get_orientation (GeditPanel *panel) +{ + g_return_val_if_fail (GEDIT_IS_PANEL (panel), GTK_ORIENTATION_VERTICAL); + + return panel->priv->orientation; +} + +/** + * gedit_panel_get_n_items: + * @panel: a #GeditPanel + * + * Gets the number of items in a @panel. + * + * Returns: the number of items contained in #GeditPanel + */ +gint +gedit_panel_get_n_items (GeditPanel *panel) +{ + g_return_val_if_fail (GEDIT_IS_PANEL (panel), -1); + + return gtk_notebook_get_n_pages (GTK_NOTEBOOK (panel->priv->notebook)); +} + +gint +_gedit_panel_get_active_item_id (GeditPanel *panel) +{ + gint cur_page; + GtkWidget *item; + GeditPanelItem *data; + + g_return_val_if_fail (GEDIT_IS_PANEL (panel), 0); + + cur_page = gtk_notebook_get_current_page ( + GTK_NOTEBOOK (panel->priv->notebook)); + if (cur_page == -1) + return 0; + + item = gtk_notebook_get_nth_page ( + GTK_NOTEBOOK (panel->priv->notebook), + cur_page); + + /* FIXME: for now we use as the hash of the name as id. + * However the name is not guaranteed to be unique and + * it is a translated string, so it's subotimal, but should + * be good enough for now since we don't want to add an + * ad hoc id argument. + */ + + data = (GeditPanelItem *)g_object_get_data (G_OBJECT (item), + PANEL_ITEM_KEY); + g_return_val_if_fail (data != NULL, 0); + + return g_str_hash (data->name); +} + +void +_gedit_panel_set_active_item_by_id (GeditPanel *panel, + gint id) +{ + gint n, i; + + g_return_if_fail (GEDIT_IS_PANEL (panel)); + + if (id == 0) + return; + + n = gtk_notebook_get_n_pages ( + GTK_NOTEBOOK (panel->priv->notebook)); + + for (i = 0; i < n; i++) + { + GtkWidget *item; + GeditPanelItem *data; + + item = gtk_notebook_get_nth_page ( + GTK_NOTEBOOK (panel->priv->notebook), i); + + data = (GeditPanelItem *)g_object_get_data (G_OBJECT (item), + PANEL_ITEM_KEY); + g_return_if_fail (data != NULL); + + if (g_str_hash (data->name) == id) + { + gtk_notebook_set_current_page ( + GTK_NOTEBOOK (panel->priv->notebook), i); + + return; + } + } +} diff --git a/gedit/gedit-panel.h b/gedit/gedit-panel.h new file mode 100755 index 00000000..87b0536c --- /dev/null +++ b/gedit/gedit-panel.h @@ -0,0 +1,130 @@ +/* + * gedit-panel.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PANEL_H__ +#define __GEDIT_PANEL_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_PANEL (gedit_panel_get_type()) +#define GEDIT_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PANEL, GeditPanel)) +#define GEDIT_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PANEL, GeditPanelClass)) +#define GEDIT_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PANEL)) +#define GEDIT_IS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PANEL)) +#define GEDIT_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PANEL, GeditPanelClass)) + +/* Private structure type */ +typedef struct _GeditPanelPrivate GeditPanelPrivate; + +/* + * Main object structure + */ +typedef struct _GeditPanel GeditPanel; + +struct _GeditPanel +{ + GtkVBox vbox; + + /*< private > */ + GeditPanelPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditPanelClass GeditPanelClass; + +struct _GeditPanelClass +{ + GtkVBoxClass parent_class; + + void (* item_added) (GeditPanel *panel, + GtkWidget *item); + void (* item_removed) (GeditPanel *panel, + GtkWidget *item); + + /* Keybinding signals */ + void (* close) (GeditPanel *panel); + void (* focus_document) (GeditPanel *panel); + + /* Padding for future expansion */ + void (*_gedit_reserved1) (void); + void (*_gedit_reserved2) (void); + void (*_gedit_reserved3) (void); + void (*_gedit_reserved4) (void); +}; + +/* + * Public methods + */ +GType gedit_panel_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_panel_new (GtkOrientation orientation); + +void gedit_panel_add_item (GeditPanel *panel, + GtkWidget *item, + const gchar *name, + GtkWidget *image); + +void gedit_panel_add_item_with_stock_icon (GeditPanel *panel, + GtkWidget *item, + const gchar *name, + const gchar *stock_id); + +gboolean gedit_panel_remove_item (GeditPanel *panel, + GtkWidget *item); + +gboolean gedit_panel_activate_item (GeditPanel *panel, + GtkWidget *item); + +gboolean gedit_panel_item_is_active (GeditPanel *panel, + GtkWidget *item); + +GtkOrientation gedit_panel_get_orientation (GeditPanel *panel); + +gint gedit_panel_get_n_items (GeditPanel *panel); + + +/* + * Non exported functions + */ +gint _gedit_panel_get_active_item_id (GeditPanel *panel); + +void _gedit_panel_set_active_item_by_id (GeditPanel *panel, + gint id); + +G_END_DECLS + +#endif /* __GEDIT_PANEL_H__ */ diff --git a/gedit/gedit-plugin-info-priv.h b/gedit/gedit-plugin-info-priv.h new file mode 100755 index 00000000..247b51c5 --- /dev/null +++ b/gedit/gedit-plugin-info-priv.h @@ -0,0 +1,68 @@ +/* + * gedit-plugin-info-priv.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 - Paolo Maggi + * Copyright (C) 2007 - Paolo Maggi, Steve Frécinaux + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PLUGIN_INFO_PRIV_H__ +#define __GEDIT_PLUGIN_INFO_PRIV_H__ + +#include "gedit-plugin-info.h" +#include "gedit-plugin.h" + +struct _GeditPluginInfo +{ + gint refcount; + + GeditPlugin *plugin; + gchar *file; + + gchar *module_name; + gchar *loader; + gchar **dependencies; + + gchar *name; + gchar *desc; + gchar *icon_name; + gchar **authors; + gchar *copyright; + gchar *website; + gchar *version; + + /* A plugin is unavailable if it is not possible to activate it + due to an error loading the plugin module (e.g. for Python plugins + when the interpreter has not been correctly initializated) */ + gint available : 1; +}; + +GeditPluginInfo *_gedit_plugin_info_new (const gchar *file); +void _gedit_plugin_info_ref (GeditPluginInfo *info); +void _gedit_plugin_info_unref (GeditPluginInfo *info); + + +#endif /* __GEDIT_PLUGIN_INFO_PRIV_H__ */ diff --git a/gedit/gedit-plugin-info.c b/gedit/gedit-plugin-info.c new file mode 100755 index 00000000..31411c42 --- /dev/null +++ b/gedit/gedit-plugin-info.c @@ -0,0 +1,394 @@ +/* + * gedit-plugin-info.c + * This file is part of gedit + * + * Copyright (C) 2002-2005 - Paolo Maggi + * Copyright (C) 2007 - Paolo Maggi, Steve Frécinaux + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "gedit-plugin-info.h" +#include "gedit-plugin-info-priv.h" +#include "gedit-debug.h" +#include "gedit-plugin.h" + +void +_gedit_plugin_info_ref (GeditPluginInfo *info) +{ + g_atomic_int_inc (&info->refcount); +} + +static GeditPluginInfo * +gedit_plugin_info_copy (GeditPluginInfo *info) +{ + _gedit_plugin_info_ref (info); + return info; +} + +void +_gedit_plugin_info_unref (GeditPluginInfo *info) +{ + if (!g_atomic_int_dec_and_test (&info->refcount)) + return; + + if (info->plugin != NULL) + { + gedit_debug_message (DEBUG_PLUGINS, "Unref plugin %s", info->name); + + g_object_unref (info->plugin); + } + + g_free (info->file); + g_free (info->module_name); + g_strfreev (info->dependencies); + g_free (info->name); + g_free (info->desc); + g_free (info->icon_name); + g_free (info->website); + g_free (info->copyright); + g_free (info->loader); + g_free (info->version); + g_strfreev (info->authors); + + g_free (info); +} + +/** + * gedit_plugin_info_get_type: + * + * Retrieves the #GType object which is associated with the #GeditPluginInfo + * class. + * + * Return value: the GType associated with #GeditPluginInfo. + **/ +GType +gedit_plugin_info_get_type (void) +{ + static GType the_type = 0; + + if (G_UNLIKELY (!the_type)) + the_type = g_boxed_type_register_static ( + "GeditPluginInfo", + (GBoxedCopyFunc) gedit_plugin_info_copy, + (GBoxedFreeFunc) _gedit_plugin_info_unref); + + return the_type; +} + +/** + * gedit_plugin_info_new: + * @filename: the filename where to read the plugin information + * + * Creates a new #GeditPluginInfo from a file on the disk. + * + * Return value: a newly created #GeditPluginInfo. + */ +GeditPluginInfo * +_gedit_plugin_info_new (const gchar *file) +{ + GeditPluginInfo *info; + GKeyFile *plugin_file = NULL; + gchar *str; + + g_return_val_if_fail (file != NULL, NULL); + + gedit_debug_message (DEBUG_PLUGINS, "Loading plugin: %s", file); + + info = g_new0 (GeditPluginInfo, 1); + info->refcount = 1; + info->file = g_strdup (file); + + plugin_file = g_key_file_new (); + if (!g_key_file_load_from_file (plugin_file, file, G_KEY_FILE_NONE, NULL)) + { + g_warning ("Bad plugin file: %s", file); + goto error; + } + + if (!g_key_file_has_key (plugin_file, + "Gedit Plugin", + "IAge", + NULL)) + { + gedit_debug_message (DEBUG_PLUGINS, + "IAge key does not exist in file: %s", file); + goto error; + } + + /* Check IAge=2 */ + if (g_key_file_get_integer (plugin_file, + "Gedit Plugin", + "IAge", + NULL) != 2) + { + gedit_debug_message (DEBUG_PLUGINS, + "Wrong IAge in file: %s", file); + goto error; + } + + /* Get module name */ + str = g_key_file_get_string (plugin_file, + "Gedit Plugin", + "Module", + NULL); + + if ((str != NULL) && (*str != '\0')) + { + info->module_name = str; + } + else + { + g_warning ("Could not find 'Module' in %s", file); + goto error; + } + + /* Get the dependency list */ + info->dependencies = g_key_file_get_string_list (plugin_file, + "Gedit Plugin", + "Depends", + NULL, + NULL); + if (info->dependencies == NULL) + { + gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Depends' in %s", file); + info->dependencies = g_new0 (gchar *, 1); + } + + /* Get the loader for this plugin */ + str = g_key_file_get_string (plugin_file, + "Gedit Plugin", + "Loader", + NULL); + + if ((str != NULL) && (*str != '\0')) + { + info->loader = str; + } + else + { + /* default to the C loader */ + info->loader = g_strdup("c"); + } + + /* Get Name */ + str = g_key_file_get_locale_string (plugin_file, + "Gedit Plugin", + "Name", + NULL, NULL); + if (str) + info->name = str; + else + { + g_warning ("Could not find 'Name' in %s", file); + goto error; + } + + /* Get Description */ + str = g_key_file_get_locale_string (plugin_file, + "Gedit Plugin", + "Description", + NULL, NULL); + if (str) + info->desc = str; + else + gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Description' in %s", file); + + /* Get Icon */ + str = g_key_file_get_locale_string (plugin_file, + "Gedit Plugin", + "Icon", + NULL, NULL); + if (str) + info->icon_name = str; + else + gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Icon' in %s, using 'gedit-plugin'", file); + + + /* Get Authors */ + info->authors = g_key_file_get_string_list (plugin_file, + "Gedit Plugin", + "Authors", + NULL, + NULL); + if (info->authors == NULL) + gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Authors' in %s", file); + + + /* Get Copyright */ + str = g_key_file_get_string (plugin_file, + "Gedit Plugin", + "Copyright", + NULL); + if (str) + info->copyright = str; + else + gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Copyright' in %s", file); + + /* Get Website */ + str = g_key_file_get_string (plugin_file, + "Gedit Plugin", + "Website", + NULL); + if (str) + info->website = str; + else + gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Website' in %s", file); + + /* Get Version */ + str = g_key_file_get_string (plugin_file, + "Gedit Plugin", + "Version", + NULL); + if (str) + info->version = str; + else + gedit_debug_message (DEBUG_PLUGINS, "Could not find 'Version' in %s", file); + + g_key_file_free (plugin_file); + + /* If we know nothing about the availability of the plugin, + set it as available */ + info->available = TRUE; + + return info; + +error: + g_free (info->file); + g_free (info->module_name); + g_free (info->name); + g_free (info->loader); + g_free (info); + g_key_file_free (plugin_file); + + return NULL; +} + +gboolean +gedit_plugin_info_is_active (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, FALSE); + + return info->available && info->plugin != NULL; +} + +gboolean +gedit_plugin_info_is_available (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, FALSE); + + return info->available != FALSE; +} + +gboolean +gedit_plugin_info_is_configurable (GeditPluginInfo *info) +{ + gedit_debug_message (DEBUG_PLUGINS, "Is '%s' configurable?", info->name); + + g_return_val_if_fail (info != NULL, FALSE); + + if (info->plugin == NULL || !info->available) + return FALSE; + + return gedit_plugin_is_configurable (info->plugin); +} + +const gchar * +gedit_plugin_info_get_module_name (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + return info->module_name; +} + +const gchar * +gedit_plugin_info_get_name (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + return info->name; +} + +const gchar * +gedit_plugin_info_get_description (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + return info->desc; +} + +const gchar * +gedit_plugin_info_get_icon_name (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + /* use the gedit-plugin icon as a default if the plugin does not + have its own */ + if (info->icon_name != NULL && + gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), + info->icon_name)) + return info->icon_name; + else + return "gedit-plugin"; +} + +const gchar ** +gedit_plugin_info_get_authors (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, (const gchar **)NULL); + + return (const gchar **) info->authors; +} + +const gchar * +gedit_plugin_info_get_website (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + return info->website; +} + +const gchar * +gedit_plugin_info_get_copyright (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + return info->copyright; +} + +const gchar * +gedit_plugin_info_get_version (GeditPluginInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + return info->version; +} diff --git a/gedit/gedit-plugin-info.h b/gedit/gedit-plugin-info.h new file mode 100755 index 00000000..ac9e2fa7 --- /dev/null +++ b/gedit/gedit-plugin-info.h @@ -0,0 +1,63 @@ +/* + * gedit-plugin-info.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 - Paolo Maggi + * Copyright (C) 2007 - Paolo Maggi, Steve Frécinaux + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PLUGIN_INFO_H__ +#define __GEDIT_PLUGIN_INFO_H__ + +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_PLUGIN_INFO (gedit_plugin_info_get_type ()) +#define GEDIT_PLUGIN_INFO(obj) ((GeditPluginInfo *) (obj)) + +typedef struct _GeditPluginInfo GeditPluginInfo; + +GType gedit_plugin_info_get_type (void) G_GNUC_CONST; + +gboolean gedit_plugin_info_is_active (GeditPluginInfo *info); +gboolean gedit_plugin_info_is_available (GeditPluginInfo *info); +gboolean gedit_plugin_info_is_configurable (GeditPluginInfo *info); + +const gchar *gedit_plugin_info_get_module_name (GeditPluginInfo *info); + +const gchar *gedit_plugin_info_get_name (GeditPluginInfo *info); +const gchar *gedit_plugin_info_get_description (GeditPluginInfo *info); +const gchar *gedit_plugin_info_get_icon_name (GeditPluginInfo *info); +const gchar **gedit_plugin_info_get_authors (GeditPluginInfo *info); +const gchar *gedit_plugin_info_get_website (GeditPluginInfo *info); +const gchar *gedit_plugin_info_get_copyright (GeditPluginInfo *info); +const gchar *gedit_plugin_info_get_version (GeditPluginInfo *info); + +G_END_DECLS + +#endif /* __GEDIT_PLUGIN_INFO_H__ */ + diff --git a/gedit/gedit-plugin-loader.c b/gedit/gedit-plugin-loader.c new file mode 100755 index 00000000..2dccde49 --- /dev/null +++ b/gedit/gedit-plugin-loader.c @@ -0,0 +1,131 @@ +/* + * gedit-plugin-loader.c + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +#include "gedit-plugin-loader.h" + +static void +gedit_plugin_loader_base_init (gpointer g_class) +{ + static gboolean initialized = FALSE; + + if (G_UNLIKELY (!initialized)) + { + /* create interface signals here. */ + initialized = TRUE; + } +} + +GType +gedit_plugin_loader_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) + { + static const GTypeInfo info = + { + sizeof (GeditPluginLoaderInterface), + gedit_plugin_loader_base_init, /* base_init */ + NULL, /* base_finalize */ + NULL, /* class_init */ + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL /* instance_init */ + }; + + type = g_type_register_static (G_TYPE_INTERFACE, "GeditPluginLoader", &info, 0); + } + + return type; +} + +const gchar * +gedit_plugin_loader_type_get_id (GType type) +{ + GTypeClass *klass; + GeditPluginLoaderInterface *iface; + + klass = g_type_class_ref (type); + + if (klass == NULL) + { + g_warning ("Could not get class info for plugin loader"); + return NULL; + } + + iface = g_type_interface_peek (klass, GEDIT_TYPE_PLUGIN_LOADER); + + if (iface == NULL) + { + g_warning ("Could not get plugin loader interface"); + g_type_class_unref (klass); + + return NULL; + } + + g_return_val_if_fail (iface->get_id != NULL, NULL); + return iface->get_id (); +} + +GeditPlugin * +gedit_plugin_loader_load (GeditPluginLoader *loader, + GeditPluginInfo *info, + const gchar *path) +{ + GeditPluginLoaderInterface *iface; + + g_return_val_if_fail (GEDIT_IS_PLUGIN_LOADER (loader), NULL); + + iface = GEDIT_PLUGIN_LOADER_GET_INTERFACE (loader); + g_return_val_if_fail (iface->load != NULL, NULL); + + return iface->load (loader, info, path); +} + +void +gedit_plugin_loader_unload (GeditPluginLoader *loader, + GeditPluginInfo *info) +{ + GeditPluginLoaderInterface *iface; + + g_return_if_fail (GEDIT_IS_PLUGIN_LOADER (loader)); + + iface = GEDIT_PLUGIN_LOADER_GET_INTERFACE (loader); + g_return_if_fail (iface->unload != NULL); + + iface->unload (loader, info); +} + +void +gedit_plugin_loader_garbage_collect (GeditPluginLoader *loader) +{ + GeditPluginLoaderInterface *iface; + + g_return_if_fail (GEDIT_IS_PLUGIN_LOADER (loader)); + + iface = GEDIT_PLUGIN_LOADER_GET_INTERFACE (loader); + + if (iface->garbage_collect != NULL) + iface->garbage_collect (loader); +} diff --git a/gedit/gedit-plugin-loader.h b/gedit/gedit-plugin-loader.h new file mode 100755 index 00000000..a064e5ec --- /dev/null +++ b/gedit/gedit-plugin-loader.h @@ -0,0 +1,106 @@ +/* + * gedit-plugin-loader.h + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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 __GEDIT_PLUGIN_LOADER_H__ +#define __GEDIT_PLUGIN_LOADER_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_PLUGIN_LOADER (gedit_plugin_loader_get_type ()) +#define GEDIT_PLUGIN_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_PLUGIN_LOADER, GeditPluginLoader)) +#define GEDIT_IS_PLUGIN_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_PLUGIN_LOADER)) +#define GEDIT_PLUGIN_LOADER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GEDIT_TYPE_PLUGIN_LOADER, GeditPluginLoaderInterface)) + +typedef struct _GeditPluginLoader GeditPluginLoader; /* dummy object */ +typedef struct _GeditPluginLoaderInterface GeditPluginLoaderInterface; + +struct _GeditPluginLoaderInterface { + GTypeInterface parent; + + const gchar *(*get_id) (void); + + GeditPlugin *(*load) (GeditPluginLoader *loader, + GeditPluginInfo *info, + const gchar *path); + + void (*unload) (GeditPluginLoader *loader, + GeditPluginInfo *info); + + void (*garbage_collect) (GeditPluginLoader *loader); +}; + +GType gedit_plugin_loader_get_type (void); + +const gchar *gedit_plugin_loader_type_get_id (GType type); +GeditPlugin *gedit_plugin_loader_load (GeditPluginLoader *loader, + GeditPluginInfo *info, + const gchar *path); +void gedit_plugin_loader_unload (GeditPluginLoader *loader, + GeditPluginInfo *info); +void gedit_plugin_loader_garbage_collect (GeditPluginLoader *loader); + +/** + * GEDIT_PLUGIN_LOADER_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init): + * + * Utility macro used to register interfaces for gobject types in plugin loaders. + */ +#define GEDIT_PLUGIN_LOADER_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \ + const GInterfaceInfo g_implement_interface_info = \ + { \ + (GInterfaceInitFunc) iface_init, \ + NULL, \ + NULL \ + }; \ + \ + g_type_module_add_interface (type_module, \ + g_define_type_id, \ + TYPE_IFACE, \ + &g_implement_interface_info); + +/** + * GEDIT_PLUGIN_LOADER_REGISTER_TYPE(PluginLoaderName, plugin_loader_name, PARENT_TYPE, loader_interface_init): + * + * Utility macro used to register plugin loaders. + */ +#define GEDIT_PLUGIN_LOADER_REGISTER_TYPE(PluginLoaderName, plugin_loader_name, PARENT_TYPE, loader_iface_init) \ + G_DEFINE_DYNAMIC_TYPE_EXTENDED (PluginLoaderName, \ + plugin_loader_name, \ + PARENT_TYPE, \ + 0, \ + GEDIT_PLUGIN_LOADER_IMPLEMENT_INTERFACE(GEDIT_TYPE_PLUGIN_LOADER, loader_iface_init)); \ + \ + \ +G_MODULE_EXPORT GType \ +register_gedit_plugin_loader (GTypeModule *type_module) \ +{ \ + plugin_loader_name##_register_type (type_module); \ + \ + return plugin_loader_name##_get_type(); \ +} + +G_END_DECLS + +#endif /* __GEDIT_PLUGIN_LOADER_H__ */ diff --git a/gedit/gedit-plugin-manager.c b/gedit/gedit-plugin-manager.c new file mode 100755 index 00000000..b72abad9 --- /dev/null +++ b/gedit/gedit-plugin-manager.c @@ -0,0 +1,889 @@ +/* + * gedit-plugin-manager.c + * This file is part of gedit + * + * Copyright (C) 2002 Paolo Maggi and James Willcox + * Copyright (C) 2003-2006 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include + +#include "gedit-plugin-manager.h" +#include "gedit-utils.h" +#include "gedit-plugins-engine.h" +#include "gedit-plugin.h" +#include "gedit-debug.h" + +enum +{ + ACTIVE_COLUMN, + AVAILABLE_COLUMN, + INFO_COLUMN, + N_COLUMNS +}; + +#define PLUGIN_MANAGER_NAME_TITLE _("Plugin") +#define PLUGIN_MANAGER_ACTIVE_TITLE _("Enabled") + +#define GEDIT_PLUGIN_MANAGER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_PLUGIN_MANAGER, GeditPluginManagerPrivate)) + +struct _GeditPluginManagerPrivate +{ + GtkWidget *tree; + + GtkWidget *about_button; + GtkWidget *configure_button; + + GeditPluginsEngine *engine; + + GtkWidget *about; + + GtkWidget *popup_menu; +}; + +G_DEFINE_TYPE(GeditPluginManager, gedit_plugin_manager, GTK_TYPE_VBOX) + +static GeditPluginInfo *plugin_manager_get_selected_plugin (GeditPluginManager *pm); +static void plugin_manager_toggle_active (GeditPluginManager *pm, GtkTreeIter *iter, GtkTreeModel *model); +static void gedit_plugin_manager_finalize (GObject *object); + +static void +gedit_plugin_manager_class_init (GeditPluginManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_plugin_manager_finalize; + + g_type_class_add_private (object_class, sizeof (GeditPluginManagerPrivate)); +} + +static void +about_button_cb (GtkWidget *button, + GeditPluginManager *pm) +{ + GeditPluginInfo *info; + + gedit_debug (DEBUG_PLUGINS); + + info = plugin_manager_get_selected_plugin (pm); + + g_return_if_fail (info != NULL); + + /* if there is another about dialog already open destroy it */ + if (pm->priv->about) + gtk_widget_destroy (pm->priv->about); + + pm->priv->about = g_object_new (GTK_TYPE_ABOUT_DIALOG, + "program-name", gedit_plugin_info_get_name (info), + "copyright", gedit_plugin_info_get_copyright (info), + "authors", gedit_plugin_info_get_authors (info), + "comments", gedit_plugin_info_get_description (info), + "website", gedit_plugin_info_get_website (info), + "logo-icon-name", gedit_plugin_info_get_icon_name (info), + "version", gedit_plugin_info_get_version (info), + NULL); + + gtk_window_set_destroy_with_parent (GTK_WINDOW (pm->priv->about), + TRUE); + + g_signal_connect (pm->priv->about, + "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + g_signal_connect (pm->priv->about, + "destroy", + G_CALLBACK (gtk_widget_destroyed), + &pm->priv->about); + + gtk_window_set_transient_for (GTK_WINDOW (pm->priv->about), + GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET(pm)))); + gtk_widget_show (pm->priv->about); +} + +static void +configure_button_cb (GtkWidget *button, + GeditPluginManager *pm) +{ + GeditPluginInfo *info; + GtkWindow *toplevel; + + gedit_debug (DEBUG_PLUGINS); + + info = plugin_manager_get_selected_plugin (pm); + + g_return_if_fail (info != NULL); + + gedit_debug_message (DEBUG_PLUGINS, "Configuring: %s\n", + gedit_plugin_info_get_name (info)); + + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET(pm))); + + gedit_plugins_engine_configure_plugin (pm->priv->engine, + info, toplevel); + + gedit_debug_message (DEBUG_PLUGINS, "Done"); +} + +static void +plugin_manager_view_info_cell_cb (GtkTreeViewColumn *tree_column, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) +{ + GeditPluginInfo *info; + gchar *text; + + g_return_if_fail (tree_model != NULL); + g_return_if_fail (tree_column != NULL); + + gtk_tree_model_get (tree_model, iter, INFO_COLUMN, &info, -1); + + if (info == NULL) + return; + + text = g_markup_printf_escaped ("%s\n%s", + gedit_plugin_info_get_name (info), + gedit_plugin_info_get_description (info)); + g_object_set (G_OBJECT (cell), + "markup", text, + "sensitive", gedit_plugin_info_is_available (info), + NULL); + + g_free (text); +} + +static void +plugin_manager_view_icon_cell_cb (GtkTreeViewColumn *tree_column, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) +{ + GeditPluginInfo *info; + + g_return_if_fail (tree_model != NULL); + g_return_if_fail (tree_column != NULL); + + gtk_tree_model_get (tree_model, iter, INFO_COLUMN, &info, -1); + + if (info == NULL) + return; + + g_object_set (G_OBJECT (cell), + "icon-name", gedit_plugin_info_get_icon_name (info), + "sensitive", gedit_plugin_info_is_available (info), + NULL); +} + + +static void +active_toggled_cb (GtkCellRendererToggle *cell, + gchar *path_str, + GeditPluginManager *pm) +{ + GtkTreeIter iter; + GtkTreePath *path; + GtkTreeModel *model; + + gedit_debug (DEBUG_PLUGINS); + + path = gtk_tree_path_new_from_string (path_str); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree)); + g_return_if_fail (model != NULL); + + gtk_tree_model_get_iter (model, &iter, path); + + if (&iter != NULL) + plugin_manager_toggle_active (pm, &iter, model); + + gtk_tree_path_free (path); +} + +static void +cursor_changed_cb (GtkTreeView *view, + gpointer data) +{ + GeditPluginManager *pm = data; + GeditPluginInfo *info; + + gedit_debug (DEBUG_PLUGINS); + + info = plugin_manager_get_selected_plugin (pm); + + gtk_widget_set_sensitive (GTK_WIDGET (pm->priv->about_button), + info != NULL); + gtk_widget_set_sensitive (GTK_WIDGET (pm->priv->configure_button), + (info != NULL) && + gedit_plugin_info_is_configurable (info)); +} + +static void +row_activated_cb (GtkTreeView *tree_view, + GtkTreePath *path, + GtkTreeViewColumn *column, + gpointer data) +{ + GeditPluginManager *pm = data; + GtkTreeIter iter; + GtkTreeModel *model; + + gedit_debug (DEBUG_PLUGINS); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree)); + + g_return_if_fail (model != NULL); + + gtk_tree_model_get_iter (model, &iter, path); + + g_return_if_fail (&iter != NULL); + + plugin_manager_toggle_active (pm, &iter, model); +} + +static void +plugin_manager_populate_lists (GeditPluginManager *pm) +{ + const GList *plugins; + GtkListStore *model; + GtkTreeIter iter; + + gedit_debug (DEBUG_PLUGINS); + + plugins = gedit_plugins_engine_get_plugin_list (pm->priv->engine); + + model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree))); + + while (plugins) + { + GeditPluginInfo *info; + info = (GeditPluginInfo *)plugins->data; + + gtk_list_store_append (model, &iter); + gtk_list_store_set (model, &iter, + ACTIVE_COLUMN, gedit_plugin_info_is_active (info), + AVAILABLE_COLUMN, gedit_plugin_info_is_available (info), + INFO_COLUMN, info, + -1); + + plugins = plugins->next; + } + + if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) + { + GtkTreeSelection *selection; + GeditPluginInfo* info; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (pm->priv->tree)); + g_return_if_fail (selection != NULL); + + gtk_tree_selection_select_iter (selection, &iter); + + gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, + INFO_COLUMN, &info, -1); + + gtk_widget_set_sensitive (GTK_WIDGET (pm->priv->configure_button), + gedit_plugin_info_is_configurable (info)); + } +} + +static gboolean +plugin_manager_set_active (GeditPluginManager *pm, + GtkTreeIter *iter, + GtkTreeModel *model, + gboolean active) +{ + GeditPluginInfo *info; + gboolean res = TRUE; + + gedit_debug (DEBUG_PLUGINS); + + gtk_tree_model_get (model, iter, INFO_COLUMN, &info, -1); + + g_return_val_if_fail (info != NULL, FALSE); + + if (active) + { + /* activate the plugin */ + if (!gedit_plugins_engine_activate_plugin (pm->priv->engine, info)) { + gedit_debug_message (DEBUG_PLUGINS, "Could not activate %s.\n", + gedit_plugin_info_get_name (info)); + + res = FALSE; + } + } + else + { + /* deactivate the plugin */ + if (!gedit_plugins_engine_deactivate_plugin (pm->priv->engine, info)) { + gedit_debug_message (DEBUG_PLUGINS, "Could not deactivate %s.\n", + gedit_plugin_info_get_name (info)); + + res = FALSE; + } + } + + return res; +} + +static void +plugin_manager_toggle_active (GeditPluginManager *pm, + GtkTreeIter *iter, + GtkTreeModel *model) +{ + gboolean active; + + gedit_debug (DEBUG_PLUGINS); + + gtk_tree_model_get (model, iter, ACTIVE_COLUMN, &active, -1); + + active ^= 1; + + plugin_manager_set_active (pm, iter, model, active); +} + +static GeditPluginInfo * +plugin_manager_get_selected_plugin (GeditPluginManager *pm) +{ + GeditPluginInfo *info = NULL; + GtkTreeModel *model; + GtkTreeIter iter; + GtkTreeSelection *selection; + + gedit_debug (DEBUG_PLUGINS); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree)); + g_return_val_if_fail (model != NULL, NULL); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (pm->priv->tree)); + g_return_val_if_fail (selection != NULL, NULL); + + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) + { + gtk_tree_model_get (model, &iter, INFO_COLUMN, &info, -1); + } + + return info; +} + +static void +plugin_manager_set_active_all (GeditPluginManager *pm, + gboolean active) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + gedit_debug (DEBUG_PLUGINS); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree)); + + g_return_if_fail (model != NULL); + + gtk_tree_model_get_iter_first (model, &iter); + + do { + plugin_manager_set_active (pm, &iter, model, active); + } + while (gtk_tree_model_iter_next (model, &iter)); +} + +/* Callback used as the interactive search comparison function */ +static gboolean +name_search_cb (GtkTreeModel *model, + gint column, + const gchar *key, + GtkTreeIter *iter, + gpointer data) +{ + GeditPluginInfo *info; + gchar *normalized_string; + gchar *normalized_key; + gchar *case_normalized_string; + gchar *case_normalized_key; + gint key_len; + gboolean retval; + + gtk_tree_model_get (model, iter, INFO_COLUMN, &info, -1); + if (!info) + return FALSE; + + normalized_string = g_utf8_normalize (gedit_plugin_info_get_name (info), -1, G_NORMALIZE_ALL); + normalized_key = g_utf8_normalize (key, -1, G_NORMALIZE_ALL); + case_normalized_string = g_utf8_casefold (normalized_string, -1); + case_normalized_key = g_utf8_casefold (normalized_key, -1); + + key_len = strlen (case_normalized_key); + + /* Oddly enough, this callback must return whether to stop the search + * because we found a match, not whether we actually matched. + */ + retval = (strncmp (case_normalized_key, case_normalized_string, key_len) != 0); + + g_free (normalized_key); + g_free (normalized_string); + g_free (case_normalized_key); + g_free (case_normalized_string); + + return retval; +} + +static void +enable_plugin_menu_cb (GtkMenu *menu, + GeditPluginManager *pm) +{ + GtkTreeModel *model; + GtkTreeIter iter; + GtkTreeSelection *selection; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->tree)); + g_return_if_fail (model != NULL); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (pm->priv->tree)); + g_return_if_fail (selection != NULL); + + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) + plugin_manager_toggle_active (pm, &iter, model); +} + +static void +enable_all_menu_cb (GtkMenu *menu, + GeditPluginManager *pm) +{ + plugin_manager_set_active_all (pm, TRUE); +} + +static void +disable_all_menu_cb (GtkMenu *menu, + GeditPluginManager *pm) +{ + plugin_manager_set_active_all (pm, FALSE); +} + +static GtkWidget * +create_tree_popup_menu (GeditPluginManager *pm) +{ + GtkWidget *menu; + GtkWidget *item; + GtkWidget *image; + GeditPluginInfo *info; + + info = plugin_manager_get_selected_plugin (pm); + + menu = gtk_menu_new (); + + item = gtk_image_menu_item_new_with_mnemonic (_("_About")); + image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, + GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + g_signal_connect (item, "activate", + G_CALLBACK (about_button_cb), pm); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_image_menu_item_new_with_mnemonic (_("C_onfigure")); + image = gtk_image_new_from_stock (GTK_STOCK_PREFERENCES, + GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + g_signal_connect (item, "activate", + G_CALLBACK (configure_button_cb), pm); + gtk_widget_set_sensitive (item, gedit_plugin_info_is_configurable (info)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_check_menu_item_new_with_mnemonic (_("A_ctivate")); + gtk_widget_set_sensitive (item, gedit_plugin_info_is_available (info)); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + gedit_plugin_info_is_active (info)); + g_signal_connect (item, "toggled", + G_CALLBACK (enable_plugin_menu_cb), pm); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_separator_menu_item_new (); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_menu_item_new_with_mnemonic (_("Ac_tivate All")); + g_signal_connect (item, "activate", + G_CALLBACK (enable_all_menu_cb), pm); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_menu_item_new_with_mnemonic (_("_Deactivate All")); + g_signal_connect (item, "activate", + G_CALLBACK (disable_all_menu_cb), pm); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + gtk_widget_show_all (menu); + + return menu; +} + +static void +tree_popup_menu_detach (GeditPluginManager *pm, + GtkMenu *menu) +{ + pm->priv->popup_menu = NULL; +} + +static void +show_tree_popup_menu (GtkTreeView *tree, + GeditPluginManager *pm, + GdkEventButton *event) +{ + if (pm->priv->popup_menu) + gtk_widget_destroy (pm->priv->popup_menu); + + pm->priv->popup_menu = create_tree_popup_menu (pm); + + gtk_menu_attach_to_widget (GTK_MENU (pm->priv->popup_menu), + GTK_WIDGET (pm), + (GtkMenuDetachFunc) tree_popup_menu_detach); + + if (event != NULL) + { + gtk_menu_popup (GTK_MENU (pm->priv->popup_menu), NULL, NULL, + NULL, NULL, + event->button, event->time); + } + else + { + gtk_menu_popup (GTK_MENU (pm->priv->popup_menu), NULL, NULL, + gedit_utils_menu_position_under_tree_view, tree, + 0, gtk_get_current_event_time ()); + + gtk_menu_shell_select_first (GTK_MENU_SHELL (pm->priv->popup_menu), + FALSE); + } +} + +static gboolean +button_press_event_cb (GtkWidget *tree, + GdkEventButton *event, + GeditPluginManager *pm) +{ + /* We want the treeview selection to be updated before showing the menu. + * This code is evil, thanks to Federico Mena Quintero's black magic. + * See: http://mail.mate.org/archives/gtk-devel-list/2006-February/msg00168.html + * FIXME: Let's remove it asap. + */ + + static gboolean in_press = FALSE; + gboolean handled; + + if (in_press) + return FALSE; /* we re-entered */ + + if (GDK_BUTTON_PRESS != event->type || 3 != event->button) + return FALSE; /* let the normal handler run */ + + in_press = TRUE; + handled = gtk_widget_event (tree, (GdkEvent *) event); + in_press = FALSE; + + if (!handled) + return FALSE; + + /* The selection is fully updated by now */ + show_tree_popup_menu (GTK_TREE_VIEW (tree), pm, event); + return TRUE; +} + +static gboolean +popup_menu_cb (GtkTreeView *tree, + GeditPluginManager *pm) +{ + show_tree_popup_menu (tree, pm, NULL); + return TRUE; +} + +static gint +model_name_sort_func (GtkTreeModel *model, + GtkTreeIter *iter1, + GtkTreeIter *iter2, + gpointer user_data) +{ + GeditPluginInfo *info1, *info2; + + gtk_tree_model_get (model, iter1, INFO_COLUMN, &info1, -1); + gtk_tree_model_get (model, iter2, INFO_COLUMN, &info2, -1); + + return g_utf8_collate (gedit_plugin_info_get_name (info1), + gedit_plugin_info_get_name (info2)); +} + +static void +plugin_manager_construct_tree (GeditPluginManager *pm) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *cell; + GtkListStore *model; + + gedit_debug (DEBUG_PLUGINS); + + model = gtk_list_store_new (N_COLUMNS, + G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN, + G_TYPE_POINTER); + + gtk_tree_view_set_model (GTK_TREE_VIEW (pm->priv->tree), + GTK_TREE_MODEL (model)); + g_object_unref (model); + + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (pm->priv->tree), TRUE); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (pm->priv->tree), FALSE); + + /* first column */ + cell = gtk_cell_renderer_toggle_new (); + g_object_set (cell, "xpad", 6, NULL); + g_signal_connect (cell, + "toggled", + G_CALLBACK (active_toggled_cb), + pm); + column = gtk_tree_view_column_new_with_attributes (PLUGIN_MANAGER_ACTIVE_TITLE, + cell, + "active", + ACTIVE_COLUMN, + "activatable", + AVAILABLE_COLUMN, + "sensitive", + AVAILABLE_COLUMN, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (pm->priv->tree), column); + + /* second column */ + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_title (column, PLUGIN_MANAGER_NAME_TITLE); + gtk_tree_view_column_set_resizable (column, TRUE); + + cell = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_column_pack_start (column, cell, FALSE); + g_object_set (cell, "stock-size", GTK_ICON_SIZE_SMALL_TOOLBAR, NULL); + gtk_tree_view_column_set_cell_data_func (column, cell, + plugin_manager_view_icon_cell_cb, + pm, NULL); + + cell = gtk_cell_renderer_text_new (); + gtk_tree_view_column_pack_start (column, cell, TRUE); + g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL); + gtk_tree_view_column_set_cell_data_func (column, cell, + plugin_manager_view_info_cell_cb, + pm, NULL); + + + gtk_tree_view_column_set_spacing (column, 6); + gtk_tree_view_append_column (GTK_TREE_VIEW (pm->priv->tree), column); + + /* Sort on the plugin names */ + gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (model), + model_name_sort_func, + NULL, + NULL); + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), + GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, + GTK_SORT_ASCENDING); + + /* Enable search for our non-string column */ + gtk_tree_view_set_search_column (GTK_TREE_VIEW (pm->priv->tree), + INFO_COLUMN); + gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (pm->priv->tree), + name_search_cb, + NULL, + NULL); + + g_signal_connect (pm->priv->tree, + "cursor_changed", + G_CALLBACK (cursor_changed_cb), + pm); + g_signal_connect (pm->priv->tree, + "row_activated", + G_CALLBACK (row_activated_cb), + pm); + + g_signal_connect (pm->priv->tree, + "button-press-event", + G_CALLBACK (button_press_event_cb), + pm); + g_signal_connect (pm->priv->tree, + "popup-menu", + G_CALLBACK (popup_menu_cb), + pm); + gtk_widget_show (pm->priv->tree); +} + +static void +plugin_toggled_cb (GeditPluginsEngine *engine, + GeditPluginInfo *info, + GeditPluginManager *pm) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + gboolean info_found = FALSE; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (pm->priv->tree)); + + if (gtk_tree_selection_get_selected (selection, &model, &iter)) + { + /* There is an item selected: it's probably the one we want! */ + GeditPluginInfo *tinfo; + gtk_tree_model_get (model, &iter, INFO_COLUMN, &tinfo, -1); + info_found = info == tinfo; + } + + if (!info_found) + { + gtk_tree_model_get_iter_first (model, &iter); + + do + { + GeditPluginInfo *tinfo; + gtk_tree_model_get (model, &iter, INFO_COLUMN, &tinfo, -1); + info_found = info == tinfo; + } + while (!info_found && gtk_tree_model_iter_next (model, &iter)); + } + + if (!info_found) + { + g_warning ("GeditPluginManager: plugin '%s' not found in the tree model", + gedit_plugin_info_get_name (info)); + return; + } + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, ACTIVE_COLUMN, gedit_plugin_info_is_active (info), -1); +} + +static void +gedit_plugin_manager_init (GeditPluginManager *pm) +{ + GtkWidget *label; + GtkWidget *viewport; + GtkWidget *hbuttonbox; + + gedit_debug (DEBUG_PLUGINS); + + pm->priv = GEDIT_PLUGIN_MANAGER_GET_PRIVATE (pm); + + /* + * Always we create the manager, firstly we rescan the plugins directory + */ + gedit_plugins_engine_rescan_plugins (gedit_plugins_engine_get_default ()); + + gtk_box_set_spacing (GTK_BOX (pm), 6); + + label = gtk_label_new_with_mnemonic (_("Active _Plugins:")); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + + gtk_box_pack_start (GTK_BOX (pm), label, FALSE, TRUE, 0); + + viewport = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (viewport), + GTK_SHADOW_IN); + + gtk_box_pack_start (GTK_BOX (pm), viewport, TRUE, TRUE, 0); + + pm->priv->tree = gtk_tree_view_new (); + gtk_container_add (GTK_CONTAINER (viewport), pm->priv->tree); + + gtk_label_set_mnemonic_widget (GTK_LABEL (label), pm->priv->tree); + + hbuttonbox = gtk_hbutton_box_new (); + gtk_box_pack_start (GTK_BOX (pm), hbuttonbox, FALSE, FALSE, 0); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END); + gtk_box_set_spacing (GTK_BOX (hbuttonbox), 8); + + pm->priv->about_button = gedit_gtk_button_new_with_stock_icon (_("_About Plugin"), + GTK_STOCK_ABOUT); + gtk_container_add (GTK_CONTAINER (hbuttonbox), pm->priv->about_button); + + pm->priv->configure_button = gedit_gtk_button_new_with_stock_icon (_("C_onfigure Plugin"), + GTK_STOCK_PREFERENCES); + gtk_container_add (GTK_CONTAINER (hbuttonbox), pm->priv->configure_button); + + /* setup a window of a sane size. */ + gtk_widget_set_size_request (GTK_WIDGET (viewport), 270, 100); + + g_signal_connect (pm->priv->about_button, + "clicked", + G_CALLBACK (about_button_cb), + pm); + g_signal_connect (pm->priv->configure_button, + "clicked", + G_CALLBACK (configure_button_cb), + pm); + + plugin_manager_construct_tree (pm); + + /* get the plugin engine and populate the treeview */ + pm->priv->engine = gedit_plugins_engine_get_default (); + + g_signal_connect_after (pm->priv->engine, + "activate-plugin", + G_CALLBACK (plugin_toggled_cb), + pm); + g_signal_connect_after (pm->priv->engine, + "deactivate-plugin", + G_CALLBACK (plugin_toggled_cb), + pm); + + if (gedit_plugins_engine_get_plugin_list (pm->priv->engine) != NULL) + { + plugin_manager_populate_lists (pm); + } + else + { + gtk_widget_set_sensitive (pm->priv->about_button, FALSE); + gtk_widget_set_sensitive (pm->priv->configure_button, FALSE); + } +} + +static void +gedit_plugin_manager_finalize (GObject *object) +{ + GeditPluginManager *pm = GEDIT_PLUGIN_MANAGER (object); + + g_signal_handlers_disconnect_by_func (pm->priv->engine, + plugin_toggled_cb, + pm); + + if (pm->priv->popup_menu) + gtk_widget_destroy (pm->priv->popup_menu); + + G_OBJECT_CLASS (gedit_plugin_manager_parent_class)->finalize (object); + +} + +GtkWidget *gedit_plugin_manager_new (void) +{ + return g_object_new (GEDIT_TYPE_PLUGIN_MANAGER,0); +} diff --git a/gedit/gedit-plugin-manager.h b/gedit/gedit-plugin-manager.h new file mode 100755 index 00000000..53392ba5 --- /dev/null +++ b/gedit/gedit-plugin-manager.h @@ -0,0 +1,83 @@ +/* + * gedit-plugin-manager.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PLUGIN_MANAGER_H__ +#define __GEDIT_PLUGIN_MANAGER_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_PLUGIN_MANAGER (gedit_plugin_manager_get_type()) +#define GEDIT_PLUGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PLUGIN_MANAGER, GeditPluginManager)) +#define GEDIT_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PLUGIN_MANAGER, GeditPluginManagerClass)) +#define GEDIT_IS_PLUGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PLUGIN_MANAGER)) +#define GEDIT_IS_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGIN_MANAGER)) +#define GEDIT_PLUGIN_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PLUGIN_MANAGER, GeditPluginManagerClass)) + +/* Private structure type */ +typedef struct _GeditPluginManagerPrivate GeditPluginManagerPrivate; + +/* + * Main object structure + */ +typedef struct _GeditPluginManager GeditPluginManager; + +struct _GeditPluginManager +{ + GtkVBox vbox; + + /*< private > */ + GeditPluginManagerPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditPluginManagerClass GeditPluginManagerClass; + +struct _GeditPluginManagerClass +{ + GtkVBoxClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_plugin_manager_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_plugin_manager_new (void); + +G_END_DECLS + +#endif /* __GEDIT_PLUGIN_MANAGER_H__ */ diff --git a/gedit/gedit-plugin.c b/gedit/gedit-plugin.c new file mode 100755 index 00000000..2b00e3fd --- /dev/null +++ b/gedit/gedit-plugin.c @@ -0,0 +1,334 @@ +/* + * gedit-plugin.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "gedit-plugin.h" +#include "gedit-dirs.h" + +/* properties */ +enum { + PROP_0, + PROP_INSTALL_DIR, + PROP_DATA_DIR_NAME, + PROP_DATA_DIR +}; + +typedef struct _GeditPluginPrivate GeditPluginPrivate; + +struct _GeditPluginPrivate +{ + gchar *install_dir; + gchar *data_dir_name; +}; + +#define GEDIT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_PLUGIN, GeditPluginPrivate)) + +G_DEFINE_TYPE(GeditPlugin, gedit_plugin, G_TYPE_OBJECT) + +static void +dummy (GeditPlugin *plugin, GeditWindow *window) +{ + /* Empty */ +} + +static GtkWidget * +create_configure_dialog (GeditPlugin *plugin) +{ + return NULL; +} + +static gboolean +is_configurable (GeditPlugin *plugin) +{ + return (GEDIT_PLUGIN_GET_CLASS (plugin)->create_configure_dialog != + create_configure_dialog); +} + +static void +gedit_plugin_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) + { + case PROP_INSTALL_DIR: + g_value_take_string (value, gedit_plugin_get_install_dir (GEDIT_PLUGIN (object))); + break; + case PROP_DATA_DIR: + g_value_take_string (value, gedit_plugin_get_data_dir (GEDIT_PLUGIN (object))); + break; + default: + g_return_if_reached (); + } +} + +static void +gedit_plugin_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditPluginPrivate *priv = GEDIT_PLUGIN_GET_PRIVATE (object); + + switch (prop_id) + { + case PROP_INSTALL_DIR: + priv->install_dir = g_value_dup_string (value); + break; + case PROP_DATA_DIR_NAME: + priv->data_dir_name = g_value_dup_string (value); + break; + default: + g_return_if_reached (); + } +} + +static void +gedit_plugin_finalize (GObject *object) +{ + GeditPluginPrivate *priv = GEDIT_PLUGIN_GET_PRIVATE (object); + + g_free (priv->install_dir); + g_free (priv->data_dir_name); + + G_OBJECT_CLASS (gedit_plugin_parent_class)->finalize (object); +} + +static void +gedit_plugin_class_init (GeditPluginClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + klass->activate = dummy; + klass->deactivate = dummy; + klass->update_ui = dummy; + + klass->create_configure_dialog = create_configure_dialog; + klass->is_configurable = is_configurable; + + object_class->get_property = gedit_plugin_get_property; + object_class->set_property = gedit_plugin_set_property; + object_class->finalize = gedit_plugin_finalize; + + g_object_class_install_property (object_class, + PROP_INSTALL_DIR, + g_param_spec_string ("install-dir", + "Install Directory", + "The directory where the plugin is installed", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* the basename of the data dir is set at construction time by the plugin loader + * while the full path is constructed on the fly to take into account relocability + * that's why we have a writeonly prop and a readonly prop */ + g_object_class_install_property (object_class, + PROP_DATA_DIR_NAME, + g_param_spec_string ("data-dir-name", + "Basename of the data directory", + "The basename of the directory where the plugin should look for its data files", + NULL, + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property (object_class, + PROP_DATA_DIR, + g_param_spec_string ("data-dir", + "Data Directory", + "The full path of the directory where the plugin should look for its data files", + NULL, + G_PARAM_READABLE)); + + g_type_class_add_private (klass, sizeof (GeditPluginPrivate)); +} + +static void +gedit_plugin_init (GeditPlugin *plugin) +{ + /* Empty */ +} + +/** + * gedit_plugin_get_install_dir: + * @plugin: a #GeditPlugin + * + * Get the path of the directory where the plugin is installed. + * + * Return value: a newly allocated string with the path of the + * directory where the plugin is installed + */ +gchar * +gedit_plugin_get_install_dir (GeditPlugin *plugin) +{ + g_return_val_if_fail (GEDIT_IS_PLUGIN (plugin), NULL); + + return g_strdup (GEDIT_PLUGIN_GET_PRIVATE (plugin)->install_dir); +} + +/** + * gedit_plugin_get_data_dir: + * @plugin: a #GeditPlugin + * + * Get the path of the directory where the plugin should look for + * its data files. + * + * Return value: a newly allocated string with the path of the + * directory where the plugin should look for its data files + */ +gchar * +gedit_plugin_get_data_dir (GeditPlugin *plugin) +{ + GeditPluginPrivate *priv; + gchar *gedit_lib_dir; + gchar *data_dir; + + g_return_val_if_fail (GEDIT_IS_PLUGIN (plugin), NULL); + + priv = GEDIT_PLUGIN_GET_PRIVATE (plugin); + + /* If it's a "user" plugin the data dir is + * install_dir/data_dir_name if instead it's a + * "system" plugin the data dir is under gedit_data_dir, + * so it's under $prefix/share/gedit-2/plugins/data_dir_name + * where data_dir_name usually it's the name of the plugin + */ + gedit_lib_dir = gedit_dirs_get_gedit_lib_dir (); + + /* CHECK: is checking the prefix enough or should we be more + * careful about normalizing paths etc? */ + if (g_str_has_prefix (priv->install_dir, gedit_lib_dir)) + { + gchar *gedit_data_dir; + + gedit_data_dir = gedit_dirs_get_gedit_data_dir (); + + data_dir = g_build_filename (gedit_data_dir, + "plugins", + priv->data_dir_name, + NULL); + + g_free (gedit_data_dir); + } + else + { + data_dir = g_build_filename (priv->install_dir, + priv->data_dir_name, + NULL); + } + + g_free (gedit_lib_dir); + + return data_dir; +} + +/** + * gedit_plugin_activate: + * @plugin: a #GeditPlugin + * @window: a #GeditWindow + * + * Activates the plugin. + */ +void +gedit_plugin_activate (GeditPlugin *plugin, + GeditWindow *window) +{ + g_return_if_fail (GEDIT_IS_PLUGIN (plugin)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + GEDIT_PLUGIN_GET_CLASS (plugin)->activate (plugin, window); +} + +/** + * gedit_plugin_deactivate: + * @plugin: a #GeditPlugin + * @window: a #GeditWindow + * + * Deactivates the plugin. + */ +void +gedit_plugin_deactivate (GeditPlugin *plugin, + GeditWindow *window) +{ + g_return_if_fail (GEDIT_IS_PLUGIN (plugin)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + GEDIT_PLUGIN_GET_CLASS (plugin)->deactivate (plugin, window); +} + +/** + * gedit_plugin_update_ui: + * @plugin: a #GeditPlugin + * @window: a #GeditWindow + * + * Triggers an update of the user interface to take into account state changes + * caused by the plugin. + */ +void +gedit_plugin_update_ui (GeditPlugin *plugin, + GeditWindow *window) +{ + g_return_if_fail (GEDIT_IS_PLUGIN (plugin)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + GEDIT_PLUGIN_GET_CLASS (plugin)->update_ui (plugin, window); +} + +/** + * gedit_plugin_is_configurable: + * @plugin: a #GeditPlugin + * + * Whether the plugin is configurable. + * + * Returns: TRUE if the plugin is configurable: + */ +gboolean +gedit_plugin_is_configurable (GeditPlugin *plugin) +{ + g_return_val_if_fail (GEDIT_IS_PLUGIN (plugin), FALSE); + + return GEDIT_PLUGIN_GET_CLASS (plugin)->is_configurable (plugin); +} + +/** + * gedit_plugin_create_configure_dialog: + * @plugin: a #GeditPlugin + * + * Creates the configure dialog widget for the plugin. + * + * Returns: the configure dialog widget for the plugin. + */ +GtkWidget * +gedit_plugin_create_configure_dialog (GeditPlugin *plugin) +{ + g_return_val_if_fail (GEDIT_IS_PLUGIN (plugin), NULL); + + return GEDIT_PLUGIN_GET_CLASS (plugin)->create_configure_dialog (plugin); +} diff --git a/gedit/gedit-plugin.h b/gedit/gedit-plugin.h new file mode 100755 index 00000000..8cf41d80 --- /dev/null +++ b/gedit/gedit-plugin.h @@ -0,0 +1,240 @@ +/* + * gedit-plugin.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PLUGIN_H__ +#define __GEDIT_PLUGIN_H__ + +#include + +#include +#include + +/* TODO: add a .h file that includes all the .h files normally needed to + * develop a plugin */ + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_PLUGIN (gedit_plugin_get_type()) +#define GEDIT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PLUGIN, GeditPlugin)) +#define GEDIT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PLUGIN, GeditPluginClass)) +#define GEDIT_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PLUGIN)) +#define GEDIT_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGIN)) +#define GEDIT_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PLUGIN, GeditPluginClass)) + +/* + * Main object structure + */ +typedef struct _GeditPlugin GeditPlugin; + +struct _GeditPlugin +{ + GObject parent; +}; + +/* + * Class definition + */ +typedef struct _GeditPluginClass GeditPluginClass; + +struct _GeditPluginClass +{ + GObjectClass parent_class; + + /* Virtual public methods */ + + void (*activate) (GeditPlugin *plugin, + GeditWindow *window); + void (*deactivate) (GeditPlugin *plugin, + GeditWindow *window); + + void (*update_ui) (GeditPlugin *plugin, + GeditWindow *window); + + GtkWidget *(*create_configure_dialog) + (GeditPlugin *plugin); + + /* Plugins should not override this, it's handled automatically by + the GeditPluginClass */ + gboolean (*is_configurable) + (GeditPlugin *plugin); + + /* Padding for future expansion */ + void (*_gedit_reserved1) (void); + void (*_gedit_reserved2) (void); + void (*_gedit_reserved3) (void); + void (*_gedit_reserved4) (void); +}; + +/* + * Public methods + */ +GType gedit_plugin_get_type (void) G_GNUC_CONST; + +gchar *gedit_plugin_get_install_dir (GeditPlugin *plugin); +gchar *gedit_plugin_get_data_dir (GeditPlugin *plugin); + +void gedit_plugin_activate (GeditPlugin *plugin, + GeditWindow *window); +void gedit_plugin_deactivate (GeditPlugin *plugin, + GeditWindow *window); + +void gedit_plugin_update_ui (GeditPlugin *plugin, + GeditWindow *window); + +gboolean gedit_plugin_is_configurable (GeditPlugin *plugin); +GtkWidget *gedit_plugin_create_configure_dialog + (GeditPlugin *plugin); + +/** + * GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE(PluginName, plugin_name, CODE): + * + * Utility macro used to register plugins with additional code. + */ +#define GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE(PluginName, plugin_name, CODE) \ + G_DEFINE_DYNAMIC_TYPE_EXTENDED (PluginName, \ + plugin_name, \ + GEDIT_TYPE_PLUGIN, \ + 0, \ + GTypeModule *module G_GNUC_UNUSED = type_module; /* back compat */ \ + CODE) \ + \ +/* This is not very nice, but G_DEFINE_DYNAMIC wants it and our old macro \ + * did not support it */ \ +static void \ +plugin_name##_class_finalize (PluginName##Class *klass) \ +{ \ +} \ + \ + \ +G_MODULE_EXPORT GType \ +register_gedit_plugin (GTypeModule *type_module) \ +{ \ + plugin_name##_register_type (type_module); \ + \ + return plugin_name##_get_type(); \ +} + +/** + * GEDIT_PLUGIN_REGISTER_TYPE(PluginName, plugin_name): + * + * Utility macro used to register plugins. + */ +#define GEDIT_PLUGIN_REGISTER_TYPE(PluginName, plugin_name) \ + GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE(PluginName, plugin_name, ;) + +/** + * GEDIT_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE): + * + * Utility macro used to register gobject types in plugins with additional code. + * + * Deprecated: use G_DEFINE_DYNAMIC_TYPE_EXTENDED instead + */ +#define GEDIT_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE) \ + \ +static GType g_define_type_id = 0; \ + \ +GType \ +object_name##_get_type (void) \ +{ \ + return g_define_type_id; \ +} \ + \ +static void object_name##_init (ObjectName *self); \ +static void object_name##_class_init (ObjectName##Class *klass); \ +static gpointer object_name##_parent_class = NULL; \ +static void object_name##_class_intern_init (gpointer klass) \ +{ \ + object_name##_parent_class = g_type_class_peek_parent (klass); \ + object_name##_class_init ((ObjectName##Class *) klass); \ +} \ + \ +GType \ +object_name##_register_type (GTypeModule *type_module) \ +{ \ + GTypeModule *module G_GNUC_UNUSED = type_module; /* back compat */ \ + static const GTypeInfo our_info = \ + { \ + sizeof (ObjectName##Class), \ + NULL, /* base_init */ \ + NULL, /* base_finalize */ \ + (GClassInitFunc) object_name##_class_intern_init, \ + NULL, \ + NULL, /* class_data */ \ + sizeof (ObjectName), \ + 0, /* n_preallocs */ \ + (GInstanceInitFunc) object_name##_init \ + }; \ + \ + g_define_type_id = g_type_module_register_type (type_module, \ + PARENT_TYPE, \ + #ObjectName, \ + &our_info, \ + 0); \ + \ + CODE \ + \ + return g_define_type_id; \ +} + + +/** + * GEDIT_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE): + * + * Utility macro used to register gobject types in plugins. + * + * Deprecated: use G_DEFINE_DYNAMIC instead + */ +#define GEDIT_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE) \ + GEDIT_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, ;) + +/** + * GEDIT_PLUGIN_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init): + * + * Utility macro used to register interfaces for gobject types in plugins. + */ +#define GEDIT_PLUGIN_IMPLEMENT_INTERFACE(object_name, TYPE_IFACE, iface_init) \ + const GInterfaceInfo object_name##_interface_info = \ + { \ + (GInterfaceInitFunc) iface_init, \ + NULL, \ + NULL \ + }; \ + \ + g_type_module_add_interface (type_module, \ + g_define_type_id, \ + TYPE_IFACE, \ + &object_name##_interface_info); + +G_END_DECLS + +#endif /* __GEDIT_PLUGIN_H__ */ diff --git a/gedit/gedit-plugins-engine.c b/gedit/gedit-plugins-engine.c new file mode 100755 index 00000000..1a34692b --- /dev/null +++ b/gedit/gedit-plugins-engine.c @@ -0,0 +1,861 @@ +/* + * gedit-plugins-engine.c + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include + +#include "gedit-plugins-engine.h" +#include "gedit-plugin-info-priv.h" +#include "gedit-plugin.h" +#include "gedit-debug.h" +#include "gedit-app.h" +#include "gedit-prefs-manager.h" +#include "gedit-plugin-loader.h" +#include "gedit-object-module.h" +#include "gedit-dirs.h" + +#define GEDIT_PLUGINS_ENGINE_BASE_KEY "/apps/gedit-2/plugins" +#define GEDIT_PLUGINS_ENGINE_KEY GEDIT_PLUGINS_ENGINE_BASE_KEY "/active-plugins" + +#define PLUGIN_EXT ".gedit-plugin" +#define LOADER_EXT G_MODULE_SUFFIX + +typedef struct +{ + GeditPluginLoader *loader; + GeditObjectModule *module; +} LoaderInfo; + +/* Signals */ +enum +{ + ACTIVATE_PLUGIN, + DEACTIVATE_PLUGIN, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL]; + +G_DEFINE_TYPE(GeditPluginsEngine, gedit_plugins_engine, G_TYPE_OBJECT) + +struct _GeditPluginsEnginePrivate +{ + GList *plugin_list; + GHashTable *loaders; + + gboolean activate_from_prefs; +}; + +GeditPluginsEngine *default_engine = NULL; + +static void gedit_plugins_engine_activate_plugin_real (GeditPluginsEngine *engine, + GeditPluginInfo *info); +static void gedit_plugins_engine_deactivate_plugin_real (GeditPluginsEngine *engine, + GeditPluginInfo *info); + +typedef gboolean (*LoadDirCallback)(GeditPluginsEngine *engine, const gchar *filename, gpointer userdata); + +static gboolean +load_dir_real (GeditPluginsEngine *engine, + const gchar *dir, + const gchar *suffix, + LoadDirCallback callback, + gpointer userdata) +{ + GError *error = NULL; + GDir *d; + const gchar *dirent; + gboolean ret = TRUE; + + g_return_val_if_fail (dir != NULL, TRUE); + + gedit_debug_message (DEBUG_PLUGINS, "DIR: %s", dir); + + d = g_dir_open (dir, 0, &error); + if (!d) + { + g_warning ("%s", error->message); + g_error_free (error); + return TRUE; + } + + while ((dirent = g_dir_read_name (d))) + { + gchar *filename; + + if (!g_str_has_suffix (dirent, suffix)) + continue; + + filename = g_build_filename (dir, dirent, NULL); + + ret = callback (engine, filename, userdata); + + g_free (filename); + + if (!ret) + break; + } + + g_dir_close (d); + return ret; +} + +static gboolean +load_plugin_info (GeditPluginsEngine *engine, + const gchar *filename, + gpointer userdata) +{ + GeditPluginInfo *info; + + info = _gedit_plugin_info_new (filename); + + if (info == NULL) + return TRUE; + + /* If a plugin with this name has already been loaded + * drop this one (user plugins override system plugins) */ + if (gedit_plugins_engine_get_plugin_info (engine, gedit_plugin_info_get_module_name (info)) != NULL) + { + gedit_debug_message (DEBUG_PLUGINS, "Two or more plugins named '%s'. " + "Only the first will be considered.\n", + gedit_plugin_info_get_module_name (info)); + + _gedit_plugin_info_unref (info); + + return TRUE; + } + + engine->priv->plugin_list = g_list_prepend (engine->priv->plugin_list, info); + + gedit_debug_message (DEBUG_PLUGINS, "Plugin %s loaded", info->name); + return TRUE; +} + +static void +load_all_plugins (GeditPluginsEngine *engine) +{ + gchar *plugin_dir; + const gchar *pdirs_env = NULL; + + /* load user plugins */ + plugin_dir = gedit_dirs_get_user_plugins_dir (); + if (g_file_test (plugin_dir, G_FILE_TEST_IS_DIR)) + { + load_dir_real (engine, + plugin_dir, + PLUGIN_EXT, + load_plugin_info, + NULL); + + } + g_free (plugin_dir); + + /* load system plugins */ + pdirs_env = g_getenv ("GEDIT_PLUGINS_PATH"); + + gedit_debug_message (DEBUG_PLUGINS, "GEDIT_PLUGINS_PATH=%s", pdirs_env); + + if (pdirs_env != NULL) + { + gchar **pdirs; + gint i; + + pdirs = g_strsplit (pdirs_env, G_SEARCHPATH_SEPARATOR_S, 0); + + for (i = 0; pdirs[i] != NULL; i++) + { + if (!load_dir_real (engine, + pdirs[i], + PLUGIN_EXT, + load_plugin_info, + NULL)) + { + break; + } + } + + g_strfreev (pdirs); + } + else + { + plugin_dir = gedit_dirs_get_gedit_plugins_dir (); + + load_dir_real (engine, + plugin_dir, + PLUGIN_EXT, + load_plugin_info, + NULL); + + g_free (plugin_dir); + } +} + +static guint +hash_lowercase (gconstpointer data) +{ + gchar *lowercase; + guint ret; + + lowercase = g_ascii_strdown ((const gchar *)data, -1); + ret = g_str_hash (lowercase); + g_free (lowercase); + + return ret; +} + +static gboolean +equal_lowercase (gconstpointer a, gconstpointer b) +{ + return g_ascii_strcasecmp ((const gchar *)a, (const gchar *)b) == 0; +} + +static void +loader_destroy (LoaderInfo *info) +{ + if (!info) + return; + + if (info->loader) + g_object_unref (info->loader); + + g_free (info); +} + +static void +add_loader (GeditPluginsEngine *engine, + const gchar *loader_id, + GeditObjectModule *module) +{ + LoaderInfo *info; + + info = g_new (LoaderInfo, 1); + info->loader = NULL; + info->module = module; + + g_hash_table_insert (engine->priv->loaders, g_strdup (loader_id), info); +} + +static void +gedit_plugins_engine_init (GeditPluginsEngine *engine) +{ + gedit_debug (DEBUG_PLUGINS); + + if (!g_module_supported ()) + { + g_warning ("gedit is not able to initialize the plugins engine."); + return; + } + + engine->priv = G_TYPE_INSTANCE_GET_PRIVATE (engine, + GEDIT_TYPE_PLUGINS_ENGINE, + GeditPluginsEnginePrivate); + + load_all_plugins (engine); + + /* make sure that the first reactivation will read active plugins + from the prefs */ + engine->priv->activate_from_prefs = TRUE; + + /* mapping from loadername -> loader object */ + engine->priv->loaders = g_hash_table_new_full (hash_lowercase, + equal_lowercase, + (GDestroyNotify)g_free, + (GDestroyNotify)loader_destroy); +} + +static void +loader_garbage_collect (const char *id, LoaderInfo *info) +{ + if (info->loader) + gedit_plugin_loader_garbage_collect (info->loader); +} + +void +gedit_plugins_engine_garbage_collect (GeditPluginsEngine *engine) +{ + g_hash_table_foreach (engine->priv->loaders, + (GHFunc) loader_garbage_collect, + NULL); +} + +static void +gedit_plugins_engine_finalize (GObject *object) +{ + GeditPluginsEngine *engine = GEDIT_PLUGINS_ENGINE (object); + GList *item; + + gedit_debug (DEBUG_PLUGINS); + + /* Firs deactivate all plugins */ + for (item = engine->priv->plugin_list; item; item = item->next) + { + GeditPluginInfo *info = GEDIT_PLUGIN_INFO (item->data); + + if (gedit_plugin_info_is_active (info)) + gedit_plugins_engine_deactivate_plugin_real (engine, info); + } + + /* unref the loaders */ + g_hash_table_destroy (engine->priv->loaders); + + /* and finally free the infos */ + for (item = engine->priv->plugin_list; item; item = item->next) + { + GeditPluginInfo *info = GEDIT_PLUGIN_INFO (item->data); + + _gedit_plugin_info_unref (info); + } + + g_list_free (engine->priv->plugin_list); + + G_OBJECT_CLASS (gedit_plugins_engine_parent_class)->finalize (object); +} + +static void +gedit_plugins_engine_class_init (GeditPluginsEngineClass *klass) +{ + GType the_type = G_TYPE_FROM_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_plugins_engine_finalize; + klass->activate_plugin = gedit_plugins_engine_activate_plugin_real; + klass->deactivate_plugin = gedit_plugins_engine_deactivate_plugin_real; + + signals[ACTIVATE_PLUGIN] = + g_signal_new ("activate-plugin", + the_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditPluginsEngineClass, activate_plugin), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, + 1, + GEDIT_TYPE_PLUGIN_INFO | G_SIGNAL_TYPE_STATIC_SCOPE); + + signals[DEACTIVATE_PLUGIN] = + g_signal_new ("deactivate-plugin", + the_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditPluginsEngineClass, deactivate_plugin), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, + 1, + GEDIT_TYPE_PLUGIN_INFO | G_SIGNAL_TYPE_STATIC_SCOPE); + + g_type_class_add_private (klass, sizeof (GeditPluginsEnginePrivate)); +} + +static gboolean +load_loader (GeditPluginsEngine *engine, + const gchar *filename, + gpointer data) +{ + GeditObjectModule *module; + gchar *base; + gchar *path; + const gchar *id; + GType type; + + /* try to load in the module */ + path = g_path_get_dirname (filename); + base = g_path_get_basename (filename); + + /* for now they are all resident */ + module = gedit_object_module_new (base, + path, + "register_gedit_plugin_loader", + TRUE); + + g_free (base); + g_free (path); + + /* make sure to load the type definition */ + if (!g_type_module_use (G_TYPE_MODULE (module))) + { + g_object_unref (module); + g_warning ("Plugin loader module `%s' could not be loaded", filename); + + return TRUE; + } + + /* get the exported type and check the name as exported by the + * loader interface */ + type = gedit_object_module_get_object_type (module); + id = gedit_plugin_loader_type_get_id (type); + + add_loader (engine, id, module); + g_type_module_unuse (G_TYPE_MODULE (module)); + + return TRUE; +} + +static void +ensure_loader (LoaderInfo *info) +{ + if (info->loader == NULL && info->module != NULL) + { + /* create a new loader object */ + GeditPluginLoader *loader; + loader = (GeditPluginLoader *)gedit_object_module_new_object (info->module, NULL); + + if (loader == NULL || !GEDIT_IS_PLUGIN_LOADER (loader)) + { + g_warning ("Loader object is not a valid GeditPluginLoader instance"); + + if (loader != NULL && G_IS_OBJECT (loader)) + g_object_unref (loader); + } + else + { + info->loader = loader; + } + } +} + +static GeditPluginLoader * +get_plugin_loader (GeditPluginsEngine *engine, GeditPluginInfo *info) +{ + const gchar *loader_id; + LoaderInfo *loader_info; + + loader_id = info->loader; + + loader_info = (LoaderInfo *)g_hash_table_lookup ( + engine->priv->loaders, + loader_id); + + if (loader_info == NULL) + { + gchar *loader_dir; + + loader_dir = gedit_dirs_get_gedit_plugin_loaders_dir (); + + /* loader could not be found in the hash, try to find it by + scanning */ + load_dir_real (engine, + loader_dir, + LOADER_EXT, + (LoadDirCallback)load_loader, + NULL); + g_free (loader_dir); + + loader_info = (LoaderInfo *)g_hash_table_lookup ( + engine->priv->loaders, + loader_id); + } + + if (loader_info == NULL) + { + /* cache non-existent so we don't scan again */ + add_loader (engine, loader_id, NULL); + return NULL; + } + + ensure_loader (loader_info); + return loader_info->loader; +} + +GeditPluginsEngine * +gedit_plugins_engine_get_default (void) +{ + if (default_engine != NULL) + return default_engine; + + default_engine = GEDIT_PLUGINS_ENGINE (g_object_new (GEDIT_TYPE_PLUGINS_ENGINE, NULL)); + g_object_add_weak_pointer (G_OBJECT (default_engine), + (gpointer) &default_engine); + return default_engine; +} + +const GList * +gedit_plugins_engine_get_plugin_list (GeditPluginsEngine *engine) +{ + gedit_debug (DEBUG_PLUGINS); + + return engine->priv->plugin_list; +} + +static gint +compare_plugin_info_and_name (GeditPluginInfo *info, + const gchar *module_name) +{ + return strcmp (gedit_plugin_info_get_module_name (info), module_name); +} + +GeditPluginInfo * +gedit_plugins_engine_get_plugin_info (GeditPluginsEngine *engine, + const gchar *name) +{ + GList *l = g_list_find_custom (engine->priv->plugin_list, + name, + (GCompareFunc) compare_plugin_info_and_name); + + return l == NULL ? NULL : (GeditPluginInfo *) l->data; +} + +static void +save_active_plugin_list (GeditPluginsEngine *engine) +{ + GSList *active_plugins = NULL; + GList *l; + + for (l = engine->priv->plugin_list; l != NULL; l = l->next) + { + GeditPluginInfo *info = (GeditPluginInfo *) l->data; + + if (gedit_plugin_info_is_active (info)) + { + active_plugins = g_slist_prepend (active_plugins, + (gpointer)gedit_plugin_info_get_module_name (info)); + } + } + + gedit_prefs_manager_set_active_plugins (active_plugins); + + g_slist_free (active_plugins); +} + +static gboolean +load_plugin (GeditPluginsEngine *engine, + GeditPluginInfo *info) +{ + GeditPluginLoader *loader; + gchar *path; + + if (gedit_plugin_info_is_active (info)) + return TRUE; + + if (!gedit_plugin_info_is_available (info)) + return FALSE; + + loader = get_plugin_loader (engine, info); + + if (loader == NULL) + { + g_warning ("Could not find loader `%s' for plugin `%s'", info->loader, info->name); + info->available = FALSE; + return FALSE; + } + + path = g_path_get_dirname (info->file); + g_return_val_if_fail (path != NULL, FALSE); + + info->plugin = gedit_plugin_loader_load (loader, info, path); + + g_free (path); + + if (info->plugin == NULL) + { + g_warning ("Error loading plugin '%s'", info->name); + info->available = FALSE; + return FALSE; + } + + return TRUE; +} + +static void +gedit_plugins_engine_activate_plugin_real (GeditPluginsEngine *engine, + GeditPluginInfo *info) +{ + const GList *wins; + + if (!load_plugin (engine, info)) + return; + + for (wins = gedit_app_get_windows (gedit_app_get_default ()); + wins != NULL; + wins = wins->next) + { + gedit_plugin_activate (info->plugin, GEDIT_WINDOW (wins->data)); + } +} + +gboolean +gedit_plugins_engine_activate_plugin (GeditPluginsEngine *engine, + GeditPluginInfo *info) +{ + gedit_debug (DEBUG_PLUGINS); + + g_return_val_if_fail (info != NULL, FALSE); + + if (!gedit_plugin_info_is_available (info)) + return FALSE; + + if (gedit_plugin_info_is_active (info)) + return TRUE; + + g_signal_emit (engine, signals[ACTIVATE_PLUGIN], 0, info); + + if (gedit_plugin_info_is_active (info)) + save_active_plugin_list (engine); + + return gedit_plugin_info_is_active (info); +} + +static void +call_plugin_deactivate (GeditPlugin *plugin, + GeditWindow *window) +{ + gedit_plugin_deactivate (plugin, window); + + /* ensure update of ui manager, because we suspect it does something + with expected static strings in the type module (when unloaded the + strings don't exist anymore, and ui manager updates in an idle + func) */ + gtk_ui_manager_ensure_update (gedit_window_get_ui_manager (window)); +} + +static void +gedit_plugins_engine_deactivate_plugin_real (GeditPluginsEngine *engine, + GeditPluginInfo *info) +{ + const GList *wins; + GeditPluginLoader *loader; + + if (!gedit_plugin_info_is_active (info) || + !gedit_plugin_info_is_available (info)) + return; + + for (wins = gedit_app_get_windows (gedit_app_get_default ()); + wins != NULL; + wins = wins->next) + { + call_plugin_deactivate (info->plugin, GEDIT_WINDOW (wins->data)); + } + + /* first unref the plugin (the loader still has one) */ + g_object_unref (info->plugin); + + /* find the loader and tell it to gc and unload the plugin */ + loader = get_plugin_loader (engine, info); + + gedit_plugin_loader_garbage_collect (loader); + gedit_plugin_loader_unload (loader, info); + + info->plugin = NULL; +} + +gboolean +gedit_plugins_engine_deactivate_plugin (GeditPluginsEngine *engine, + GeditPluginInfo *info) +{ + gedit_debug (DEBUG_PLUGINS); + + g_return_val_if_fail (info != NULL, FALSE); + + if (!gedit_plugin_info_is_active (info)) + return TRUE; + + g_signal_emit (engine, signals[DEACTIVATE_PLUGIN], 0, info); + if (!gedit_plugin_info_is_active (info)) + save_active_plugin_list (engine); + + return !gedit_plugin_info_is_active (info); +} + +void +gedit_plugins_engine_activate_plugins (GeditPluginsEngine *engine, + GeditWindow *window) +{ + GSList *active_plugins = NULL; + GList *pl; + + gedit_debug (DEBUG_PLUGINS); + + g_return_if_fail (GEDIT_IS_PLUGINS_ENGINE (engine)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + /* the first time, we get the 'active' plugins from mateconf */ + if (engine->priv->activate_from_prefs) + { + active_plugins = gedit_prefs_manager_get_active_plugins (); + } + + for (pl = engine->priv->plugin_list; pl; pl = pl->next) + { + GeditPluginInfo *info = (GeditPluginInfo*)pl->data; + + if (engine->priv->activate_from_prefs && + g_slist_find_custom (active_plugins, + gedit_plugin_info_get_module_name (info), + (GCompareFunc)strcmp) == NULL) + continue; + + /* If plugin is not active, don't try to activate/load it */ + if (!engine->priv->activate_from_prefs && + !gedit_plugin_info_is_active (info)) + continue; + + if (load_plugin (engine, info)) + gedit_plugin_activate (info->plugin, + window); + } + + if (engine->priv->activate_from_prefs) + { + g_slist_foreach (active_plugins, (GFunc) g_free, NULL); + g_slist_free (active_plugins); + engine->priv->activate_from_prefs = FALSE; + } + + gedit_debug_message (DEBUG_PLUGINS, "End"); + + /* also call update_ui after activation */ + gedit_plugins_engine_update_plugins_ui (engine, window); +} + +void +gedit_plugins_engine_deactivate_plugins (GeditPluginsEngine *engine, + GeditWindow *window) +{ + GList *pl; + + gedit_debug (DEBUG_PLUGINS); + + g_return_if_fail (GEDIT_IS_PLUGINS_ENGINE (engine)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + for (pl = engine->priv->plugin_list; pl; pl = pl->next) + { + GeditPluginInfo *info = (GeditPluginInfo*)pl->data; + + /* check if the plugin is actually active */ + if (!gedit_plugin_info_is_active (info)) + continue; + + /* call deactivate for the plugin for this window */ + gedit_plugin_deactivate (info->plugin, window); + } + + gedit_debug_message (DEBUG_PLUGINS, "End"); +} + +void +gedit_plugins_engine_update_plugins_ui (GeditPluginsEngine *engine, + GeditWindow *window) +{ + GList *pl; + + gedit_debug (DEBUG_PLUGINS); + + g_return_if_fail (GEDIT_IS_PLUGINS_ENGINE (engine)); + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + /* call update_ui for all active plugins */ + for (pl = engine->priv->plugin_list; pl; pl = pl->next) + { + GeditPluginInfo *info = (GeditPluginInfo*)pl->data; + + if (!gedit_plugin_info_is_active (info)) + continue; + + gedit_debug_message (DEBUG_PLUGINS, "Updating UI of %s", info->name); + gedit_plugin_update_ui (info->plugin, window); + } +} + +void +gedit_plugins_engine_configure_plugin (GeditPluginsEngine *engine, + GeditPluginInfo *info, + GtkWindow *parent) +{ + GtkWidget *conf_dlg; + + GtkWindowGroup *wg; + + gedit_debug (DEBUG_PLUGINS); + + g_return_if_fail (info != NULL); + + conf_dlg = gedit_plugin_create_configure_dialog (info->plugin); + g_return_if_fail (conf_dlg != NULL); + gtk_window_set_transient_for (GTK_WINDOW (conf_dlg), + parent); + + wg = gtk_window_get_group (parent); + if (wg == NULL) + { + wg = gtk_window_group_new (); + gtk_window_group_add_window (wg, parent); + } + + gtk_window_group_add_window (wg, + GTK_WINDOW (conf_dlg)); + + gtk_window_set_modal (GTK_WINDOW (conf_dlg), TRUE); + gtk_widget_show (conf_dlg); +} + +void +gedit_plugins_engine_active_plugins_changed (GeditPluginsEngine *engine) +{ + gboolean to_activate; + GSList *active_plugins; + GList *pl; + + gedit_debug (DEBUG_PLUGINS); + + active_plugins = gedit_prefs_manager_get_active_plugins (); + + for (pl = engine->priv->plugin_list; pl; pl = pl->next) + { + GeditPluginInfo *info = (GeditPluginInfo*)pl->data; + + if (!gedit_plugin_info_is_available (info)) + continue; + + to_activate = (g_slist_find_custom (active_plugins, + gedit_plugin_info_get_module_name (info), + (GCompareFunc)strcmp) != NULL); + + if (!gedit_plugin_info_is_active (info) && to_activate) + g_signal_emit (engine, signals[ACTIVATE_PLUGIN], 0, info); + else if (gedit_plugin_info_is_active (info) && !to_activate) + g_signal_emit (engine, signals[DEACTIVATE_PLUGIN], 0, info); + } + + g_slist_foreach (active_plugins, (GFunc) g_free, NULL); + g_slist_free (active_plugins); +} + +void +gedit_plugins_engine_rescan_plugins (GeditPluginsEngine *engine) +{ + gedit_debug (DEBUG_PLUGINS); + + load_all_plugins (engine); +} diff --git a/gedit/gedit-plugins-engine.h b/gedit/gedit-plugins-engine.h new file mode 100755 index 00000000..f2ebff63 --- /dev/null +++ b/gedit/gedit-plugins-engine.h @@ -0,0 +1,107 @@ +/* + * gedit-plugins-engine.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PLUGINS_ENGINE_H__ +#define __GEDIT_PLUGINS_ENGINE_H__ + +#include +#include "gedit-window.h" +#include "gedit-plugin-info.h" +#include "gedit-plugin.h" + +G_BEGIN_DECLS + +#define GEDIT_TYPE_PLUGINS_ENGINE (gedit_plugins_engine_get_type ()) +#define GEDIT_PLUGINS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PLUGINS_ENGINE, GeditPluginsEngine)) +#define GEDIT_PLUGINS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PLUGINS_ENGINE, GeditPluginsEngineClass)) +#define GEDIT_IS_PLUGINS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PLUGINS_ENGINE)) +#define GEDIT_IS_PLUGINS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGINS_ENGINE)) +#define GEDIT_PLUGINS_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PLUGINS_ENGINE, GeditPluginsEngineClass)) + +typedef struct _GeditPluginsEngine GeditPluginsEngine; +typedef struct _GeditPluginsEnginePrivate GeditPluginsEnginePrivate; + +struct _GeditPluginsEngine +{ + GObject parent; + GeditPluginsEnginePrivate *priv; +}; + +typedef struct _GeditPluginsEngineClass GeditPluginsEngineClass; + +struct _GeditPluginsEngineClass +{ + GObjectClass parent_class; + + void (* activate_plugin) (GeditPluginsEngine *engine, + GeditPluginInfo *info); + + void (* deactivate_plugin) (GeditPluginsEngine *engine, + GeditPluginInfo *info); +}; + +GType gedit_plugins_engine_get_type (void) G_GNUC_CONST; + +GeditPluginsEngine *gedit_plugins_engine_get_default (void); + +void gedit_plugins_engine_garbage_collect (GeditPluginsEngine *engine); + +const GList *gedit_plugins_engine_get_plugin_list (GeditPluginsEngine *engine); + +GeditPluginInfo *gedit_plugins_engine_get_plugin_info (GeditPluginsEngine *engine, + const gchar *name); + +/* plugin load and unloading (overall, for all windows) */ +gboolean gedit_plugins_engine_activate_plugin (GeditPluginsEngine *engine, + GeditPluginInfo *info); +gboolean gedit_plugins_engine_deactivate_plugin (GeditPluginsEngine *engine, + GeditPluginInfo *info); + +void gedit_plugins_engine_configure_plugin (GeditPluginsEngine *engine, + GeditPluginInfo *info, + GtkWindow *parent); + +/* plugin activation/deactivation per window, private to GeditWindow */ +void gedit_plugins_engine_activate_plugins (GeditPluginsEngine *engine, + GeditWindow *window); +void gedit_plugins_engine_deactivate_plugins (GeditPluginsEngine *engine, + GeditWindow *window); +void gedit_plugins_engine_update_plugins_ui (GeditPluginsEngine *engine, + GeditWindow *window); + +/* private for mateconf notification */ +void gedit_plugins_engine_active_plugins_changed + (GeditPluginsEngine *engine); + +void gedit_plugins_engine_rescan_plugins (GeditPluginsEngine *engine); + +G_END_DECLS + +#endif /* __GEDIT_PLUGINS_ENGINE_H__ */ diff --git a/gedit/gedit-prefs-manager-app.c b/gedit/gedit-prefs-manager-app.c new file mode 100755 index 00000000..ce35db8d --- /dev/null +++ b/gedit/gedit-prefs-manager-app.c @@ -0,0 +1,1620 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-prefs-manager.c + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2003. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gedit-prefs-manager.h" +#include "gedit-prefs-manager-private.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-app.h" +#include "gedit-debug.h" +#include "gedit-view.h" +#include "gedit-window.h" +#include "gedit-window-private.h" +#include "gedit-plugins-engine.h" +#include "gedit-style-scheme-manager.h" +#include "gedit-dirs.h" + +static void gedit_prefs_manager_editor_font_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_system_font_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_tabs_size_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_wrap_mode_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_line_numbers_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_auto_indent_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_undo_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_right_margin_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_smart_home_end_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_hl_current_line_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_bracket_matching_changed(MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_syntax_hl_enable_changed(MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_search_hl_enable_changed(MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_source_style_scheme_changed + (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_max_recents_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_auto_save_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_active_plugins_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +static void gedit_prefs_manager_lockdown_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data); + +/* GUI state is serialized to a .desktop file, not in mateconf */ + +#define GEDIT_STATE_DEFAULT_WINDOW_STATE 0 +#define GEDIT_STATE_DEFAULT_WINDOW_WIDTH 650 +#define GEDIT_STATE_DEFAULT_WINDOW_HEIGHT 500 +#define GEDIT_STATE_DEFAULT_SIDE_PANEL_SIZE 200 +#define GEDIT_STATE_DEFAULT_BOTTOM_PANEL_SIZE 140 + +#define GEDIT_STATE_FILE_LOCATION "gedit-2" + +#define GEDIT_STATE_WINDOW_GROUP "window" +#define GEDIT_STATE_WINDOW_STATE "state" +#define GEDIT_STATE_WINDOW_HEIGHT "height" +#define GEDIT_STATE_WINDOW_WIDTH "width" +#define GEDIT_STATE_SIDE_PANEL_SIZE "side_panel_size" +#define GEDIT_STATE_BOTTOM_PANEL_SIZE "bottom_panel_size" +#define GEDIT_STATE_SIDE_PANEL_ACTIVE_PAGE "side_panel_active_page" +#define GEDIT_STATE_BOTTOM_PANEL_ACTIVE_PAGE "bottom_panel_active_page" + +#define GEDIT_STATE_FILEFILTER_GROUP "filefilter" +#define GEDIT_STATE_FILEFILTER_ID "id" + +static gint window_state = -1; +static gint window_height = -1; +static gint window_width = -1; +static gint side_panel_size = -1; +static gint bottom_panel_size = -1; +static gint side_panel_active_page = -1; +static gint bottom_panel_active_page = -1; +static gint active_file_filter = -1; + + +static gchar * +get_state_filename (void) +{ + gchar *config_dir; + gchar *filename = NULL; + + config_dir = gedit_dirs_get_user_config_dir (); + + if (config_dir != NULL) + { + filename = g_build_filename (config_dir, + GEDIT_STATE_FILE_LOCATION, + NULL); + g_free (config_dir); + } + + return filename; +} + +static GKeyFile * +get_gedit_state_file (void) +{ + static GKeyFile *state_file = NULL; + + if (state_file == NULL) + { + gchar *filename; + GError *err = NULL; + + state_file = g_key_file_new (); + + filename = get_state_filename (); + + if (!g_key_file_load_from_file (state_file, + filename, + G_KEY_FILE_NONE, + &err)) + { + if (err->domain != G_FILE_ERROR || + err->code != G_FILE_ERROR_NOENT) + { + g_warning ("Could not load gedit state file: %s\n", + err->message); + } + + g_error_free (err); + } + + g_free (filename); + } + + return state_file; +} + +static void +gedit_state_get_int (const gchar *group, + const gchar *key, + gint defval, + gint *result) +{ + GKeyFile *state_file; + gint res; + GError *err = NULL; + + state_file = get_gedit_state_file (); + res = g_key_file_get_integer (state_file, + group, + key, + &err); + + if (err != NULL) + { + if ((err->domain != G_KEY_FILE_ERROR) || + ((err->code != G_KEY_FILE_ERROR_GROUP_NOT_FOUND && + err->code != G_KEY_FILE_ERROR_KEY_NOT_FOUND))) + { + g_warning ("Could not get state value %s::%s : %s\n", + group, + key, + err->message); + } + + *result = defval; + g_error_free (err); + } + else + { + *result = res; + } +} + +static void +gedit_state_set_int (const gchar *group, + const gchar *key, + gint value) +{ + GKeyFile *state_file; + + state_file = get_gedit_state_file (); + g_key_file_set_integer (state_file, + group, + key, + value); +} + +static gboolean +gedit_state_file_sync (void) +{ + GKeyFile *state_file; + gchar *config_dir; + gchar *filename = NULL; + gchar *content = NULL; + gsize length; + gint res; + GError *err = NULL; + gboolean ret = FALSE; + + state_file = get_gedit_state_file (); + g_return_val_if_fail (state_file != NULL, FALSE); + + config_dir = gedit_dirs_get_user_config_dir (); + if (config_dir == NULL) + { + g_warning ("Could not get config directory\n"); + return ret; + } + + res = g_mkdir_with_parents (config_dir, 0755); + if (res < 0) + { + g_warning ("Could not create config directory\n"); + goto out; + } + + content = g_key_file_to_data (state_file, + &length, + &err); + + if (err != NULL) + { + g_warning ("Could not get data from state file: %s\n", + err->message); + goto out; + } + + if (content != NULL) + { + filename = get_state_filename (); + if (!g_file_set_contents (filename, + content, + length, + &err)) + { + g_warning ("Could not write gedit state file: %s\n", + err->message); + goto out; + } + } + + ret = TRUE; + + out: + if (err != NULL) + g_error_free (err); + + g_free (config_dir); + g_free (filename); + g_free (content); + + return ret; +} + +/* Window state */ +gint +gedit_prefs_manager_get_window_state (void) +{ + if (window_state == -1) + { + gedit_state_get_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_WINDOW_STATE, + GEDIT_STATE_DEFAULT_WINDOW_STATE, + &window_state); + } + + return window_state; +} + +void +gedit_prefs_manager_set_window_state (gint ws) +{ + g_return_if_fail (ws > -1); + + window_state = ws; + + gedit_state_set_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_WINDOW_STATE, + ws); +} + +gboolean +gedit_prefs_manager_window_state_can_set (void) +{ + return TRUE; +} + +/* Window size */ +void +gedit_prefs_manager_get_window_size (gint *width, gint *height) +{ + g_return_if_fail (width != NULL && height != NULL); + + if (window_width == -1) + { + gedit_state_get_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_WINDOW_WIDTH, + GEDIT_STATE_DEFAULT_WINDOW_WIDTH, + &window_width); + } + + if (window_height == -1) + { + gedit_state_get_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_WINDOW_HEIGHT, + GEDIT_STATE_DEFAULT_WINDOW_HEIGHT, + &window_height); + } + + *width = window_width; + *height = window_height; +} + +void +gedit_prefs_manager_get_default_window_size (gint *width, gint *height) +{ + g_return_if_fail (width != NULL && height != NULL); + + *width = GEDIT_STATE_DEFAULT_WINDOW_WIDTH; + *height = GEDIT_STATE_DEFAULT_WINDOW_HEIGHT; +} + +void +gedit_prefs_manager_set_window_size (gint width, gint height) +{ + g_return_if_fail (width > -1 && height > -1); + + window_width = width; + window_height = height; + + gedit_state_set_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_WINDOW_WIDTH, + width); + gedit_state_set_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_WINDOW_HEIGHT, + height); +} + +gboolean +gedit_prefs_manager_window_size_can_set (void) +{ + return TRUE; +} + +/* Side panel */ +gint +gedit_prefs_manager_get_side_panel_size (void) +{ + if (side_panel_size == -1) + { + gedit_state_get_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_SIDE_PANEL_SIZE, + GEDIT_STATE_DEFAULT_SIDE_PANEL_SIZE, + &side_panel_size); + } + + return side_panel_size; +} + +gint +gedit_prefs_manager_get_default_side_panel_size (void) +{ + return GEDIT_STATE_DEFAULT_SIDE_PANEL_SIZE; +} + +void +gedit_prefs_manager_set_side_panel_size (gint ps) +{ + g_return_if_fail (ps > -1); + + if (side_panel_size == ps) + return; + + side_panel_size = ps; + gedit_state_set_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_SIDE_PANEL_SIZE, + ps); +} + +gboolean +gedit_prefs_manager_side_panel_size_can_set (void) +{ + return TRUE; +} + +gint +gedit_prefs_manager_get_side_panel_active_page (void) +{ + if (side_panel_active_page == -1) + { + gedit_state_get_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_SIDE_PANEL_ACTIVE_PAGE, + 0, + &side_panel_active_page); + } + + return side_panel_active_page; +} + +void +gedit_prefs_manager_set_side_panel_active_page (gint id) +{ + if (side_panel_active_page == id) + return; + + side_panel_active_page = id; + gedit_state_set_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_SIDE_PANEL_ACTIVE_PAGE, + id); +} + +gboolean +gedit_prefs_manager_side_panel_active_page_can_set (void) +{ + return TRUE; +} + +/* Bottom panel */ +gint +gedit_prefs_manager_get_bottom_panel_size (void) +{ + if (bottom_panel_size == -1) + { + gedit_state_get_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_BOTTOM_PANEL_SIZE, + GEDIT_STATE_DEFAULT_BOTTOM_PANEL_SIZE, + &bottom_panel_size); + } + + return bottom_panel_size; +} + +gint +gedit_prefs_manager_get_default_bottom_panel_size (void) +{ + return GEDIT_STATE_DEFAULT_BOTTOM_PANEL_SIZE; +} + +void +gedit_prefs_manager_set_bottom_panel_size (gint ps) +{ + g_return_if_fail (ps > -1); + + if (bottom_panel_size == ps) + return; + + bottom_panel_size = ps; + gedit_state_set_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_BOTTOM_PANEL_SIZE, + ps); +} + +gboolean +gedit_prefs_manager_bottom_panel_size_can_set (void) +{ + return TRUE; +} + +gint +gedit_prefs_manager_get_bottom_panel_active_page (void) +{ + if (bottom_panel_active_page == -1) + { + gedit_state_get_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_BOTTOM_PANEL_ACTIVE_PAGE, + 0, + &bottom_panel_active_page); + } + + return bottom_panel_active_page; +} + +void +gedit_prefs_manager_set_bottom_panel_active_page (gint id) +{ + if (bottom_panel_active_page == id) + return; + + bottom_panel_active_page = id; + gedit_state_set_int (GEDIT_STATE_WINDOW_GROUP, + GEDIT_STATE_BOTTOM_PANEL_ACTIVE_PAGE, + id); +} + +gboolean +gedit_prefs_manager_bottom_panel_active_page_can_set (void) +{ + return TRUE; +} + +/* File filter */ +gint +gedit_prefs_manager_get_active_file_filter (void) +{ + if (active_file_filter == -1) + { + gedit_state_get_int (GEDIT_STATE_FILEFILTER_GROUP, + GEDIT_STATE_FILEFILTER_ID, + 0, + &active_file_filter); + } + + return active_file_filter; +} + +void +gedit_prefs_manager_set_active_file_filter (gint id) +{ + g_return_if_fail (id >= 0); + + if (active_file_filter == id) + return; + + active_file_filter = id; + gedit_state_set_int (GEDIT_STATE_FILEFILTER_GROUP, + GEDIT_STATE_FILEFILTER_ID, + id); +} + +gboolean +gedit_prefs_manager_active_file_filter_can_set (void) +{ + return TRUE; +} + +/* Normal prefs are stored in MateConf */ + +gboolean +gedit_prefs_manager_app_init (void) +{ + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager == NULL, FALSE); + + gedit_prefs_manager_init (); + + if (gedit_prefs_manager != NULL) + { + /* TODO: notify, add dirs */ + mateconf_client_add_dir (gedit_prefs_manager->mateconf_client, + GPM_PREFS_DIR, + MATECONF_CLIENT_PRELOAD_RECURSIVE, + NULL); + + mateconf_client_add_dir (gedit_prefs_manager->mateconf_client, + GPM_PLUGINS_DIR, + MATECONF_CLIENT_PRELOAD_RECURSIVE, + NULL); + + mateconf_client_add_dir (gedit_prefs_manager->mateconf_client, + GPM_LOCKDOWN_DIR, + MATECONF_CLIENT_PRELOAD_RECURSIVE, + NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_FONT_DIR, + gedit_prefs_manager_editor_font_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_SYSTEM_FONT, + gedit_prefs_manager_system_font_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_TABS_DIR, + gedit_prefs_manager_tabs_size_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_WRAP_MODE_DIR, + gedit_prefs_manager_wrap_mode_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_LINE_NUMBERS_DIR, + gedit_prefs_manager_line_numbers_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_AUTO_INDENT_DIR, + gedit_prefs_manager_auto_indent_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_UNDO_DIR, + gedit_prefs_manager_undo_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_RIGHT_MARGIN_DIR, + gedit_prefs_manager_right_margin_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_SMART_HOME_END_DIR, + gedit_prefs_manager_smart_home_end_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_CURRENT_LINE_DIR, + gedit_prefs_manager_hl_current_line_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_BRACKET_MATCHING_DIR, + gedit_prefs_manager_bracket_matching_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_SYNTAX_HL_ENABLE, + gedit_prefs_manager_syntax_hl_enable_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_SEARCH_HIGHLIGHTING_ENABLE, + gedit_prefs_manager_search_hl_enable_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_SOURCE_STYLE_DIR, + gedit_prefs_manager_source_style_scheme_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_MAX_RECENTS, + gedit_prefs_manager_max_recents_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_SAVE_DIR, + gedit_prefs_manager_auto_save_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_ACTIVE_PLUGINS, + gedit_prefs_manager_active_plugins_changed, + NULL, NULL, NULL); + + mateconf_client_notify_add (gedit_prefs_manager->mateconf_client, + GPM_LOCKDOWN_DIR, + gedit_prefs_manager_lockdown_changed, + NULL, NULL, NULL); + } + + return gedit_prefs_manager != NULL; +} + +/* This function must be called before exiting gedit */ +void +gedit_prefs_manager_app_shutdown (void) +{ + gedit_debug (DEBUG_PREFS); + + gedit_prefs_manager_shutdown (); + + gedit_state_file_sync (); +} + + +static void +gedit_prefs_manager_editor_font_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + GList *views; + GList *l; + gchar *font = NULL; + gboolean def = TRUE; + gint ts; + + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_USE_DEFAULT_FONT) == 0) + { + if (entry->value->type == MATECONF_VALUE_BOOL) + def = mateconf_value_get_bool (entry->value); + else + def = GPM_DEFAULT_USE_DEFAULT_FONT; + + if (def) + font = gedit_prefs_manager_get_system_font (); + else + font = gedit_prefs_manager_get_editor_font (); + } + else if (strcmp (entry->key, GPM_EDITOR_FONT) == 0) + { + if (entry->value->type == MATECONF_VALUE_STRING) + font = g_strdup (mateconf_value_get_string (entry->value)); + else + font = g_strdup (GPM_DEFAULT_EDITOR_FONT); + + def = gedit_prefs_manager_get_use_default_font (); + } + else + return; + + g_return_if_fail (font != NULL); + + ts = gedit_prefs_manager_get_tabs_size (); + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + /* Note: we use def=FALSE to avoid GeditView to query mateconf */ + gedit_view_set_font (GEDIT_VIEW (l->data), FALSE, font); + gtk_source_view_set_tab_width (GTK_SOURCE_VIEW (l->data), ts); + + l = l->next; + } + + g_list_free (views); + g_free (font); +} + +static void +gedit_prefs_manager_system_font_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + GList *views; + GList *l; + gchar *font; + gint ts; + + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_SYSTEM_FONT) != 0) + return; + + if (!gedit_prefs_manager_get_use_default_font ()) + return; + + if (entry->value->type == MATECONF_VALUE_STRING) + font = g_strdup (mateconf_value_get_string (entry->value)); + else + font = g_strdup (GPM_DEFAULT_SYSTEM_FONT); + + ts = gedit_prefs_manager_get_tabs_size (); + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + /* Note: we use def=FALSE to avoid GeditView to query mateconf */ + gedit_view_set_font (GEDIT_VIEW (l->data), FALSE, font); + + gtk_source_view_set_tab_width (GTK_SOURCE_VIEW (l->data), ts); + l = l->next; + } + + g_list_free (views); + g_free (font); +} + +static void +gedit_prefs_manager_tabs_size_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_TABS_SIZE) == 0) + { + gint tab_width; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_INT) + tab_width = mateconf_value_get_int (entry->value); + else + tab_width = GPM_DEFAULT_TABS_SIZE; + + tab_width = CLAMP (tab_width, 1, 24); + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_tab_width (GTK_SOURCE_VIEW (l->data), + tab_width); + + l = l->next; + } + + g_list_free (views); + } + else if (strcmp (entry->key, GPM_INSERT_SPACES) == 0) + { + gboolean enable; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_BOOL) + enable = mateconf_value_get_bool (entry->value); + else + enable = GPM_DEFAULT_INSERT_SPACES; + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_insert_spaces_instead_of_tabs ( + GTK_SOURCE_VIEW (l->data), + enable); + + l = l->next; + } + + g_list_free (views); + } +} + +static GtkWrapMode +get_wrap_mode_from_string (const gchar* str) +{ + GtkWrapMode res; + + g_return_val_if_fail (str != NULL, GTK_WRAP_WORD); + + if (strcmp (str, "GTK_WRAP_NONE") == 0) + res = GTK_WRAP_NONE; + else + { + if (strcmp (str, "GTK_WRAP_CHAR") == 0) + res = GTK_WRAP_CHAR; + else + res = GTK_WRAP_WORD; + } + + return res; +} + +static void +gedit_prefs_manager_wrap_mode_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_WRAP_MODE) == 0) + { + GtkWrapMode wrap_mode; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_STRING) + wrap_mode = + get_wrap_mode_from_string (mateconf_value_get_string (entry->value)); + else + wrap_mode = get_wrap_mode_from_string (GPM_DEFAULT_WRAP_MODE); + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (l->data), + wrap_mode); + + l = l->next; + } + + g_list_free (views); + } +} + +static void +gedit_prefs_manager_line_numbers_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_DISPLAY_LINE_NUMBERS) == 0) + { + gboolean dln; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_BOOL) + dln = mateconf_value_get_bool (entry->value); + else + dln = GPM_DEFAULT_DISPLAY_LINE_NUMBERS; + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (l->data), + dln); + + l = l->next; + } + + g_list_free (views); + } +} + +static void +gedit_prefs_manager_hl_current_line_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_HIGHLIGHT_CURRENT_LINE) == 0) + { + gboolean hl; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_BOOL) + hl = mateconf_value_get_bool (entry->value); + else + hl = GPM_DEFAULT_HIGHLIGHT_CURRENT_LINE; + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_highlight_current_line (GTK_SOURCE_VIEW (l->data), + hl); + + l = l->next; + } + + g_list_free (views); + } +} + +static void +gedit_prefs_manager_bracket_matching_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_BRACKET_MATCHING) == 0) + { + gboolean enable; + GList *docs; + GList *l; + + if (entry->value->type == MATECONF_VALUE_BOOL) + enable = mateconf_value_get_bool (entry->value); + else + enable = GPM_DEFAULT_BRACKET_MATCHING; + + docs = gedit_app_get_documents (gedit_app_get_default ()); + l = docs; + + while (l != NULL) + { + gtk_source_buffer_set_highlight_matching_brackets (GTK_SOURCE_BUFFER (l->data), + enable); + + l = l->next; + } + + g_list_free (docs); + } +} + +static void +gedit_prefs_manager_auto_indent_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_AUTO_INDENT) == 0) + { + gboolean enable; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_BOOL) + enable = mateconf_value_get_bool (entry->value); + else + enable = GPM_DEFAULT_AUTO_INDENT; + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_auto_indent (GTK_SOURCE_VIEW (l->data), + enable); + + l = l->next; + } + + g_list_free (views); + } +} + +static void +gedit_prefs_manager_undo_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_UNDO_ACTIONS_LIMIT) == 0) + { + gint ul; + GList *docs; + GList *l; + + if (entry->value->type == MATECONF_VALUE_INT) + ul = mateconf_value_get_int (entry->value); + else + ul = GPM_DEFAULT_UNDO_ACTIONS_LIMIT; + + ul = CLAMP (ul, -1, 250); + + docs = gedit_app_get_documents (gedit_app_get_default ()); + l = docs; + + while (l != NULL) + { + gtk_source_buffer_set_max_undo_levels (GTK_SOURCE_BUFFER (l->data), + ul); + + l = l->next; + } + + g_list_free (docs); + } +} + +static void +gedit_prefs_manager_right_margin_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_RIGHT_MARGIN_POSITION) == 0) + { + gint pos; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_INT) + pos = mateconf_value_get_int (entry->value); + else + pos = GPM_DEFAULT_RIGHT_MARGIN_POSITION; + + pos = CLAMP (pos, 1, 160); + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_right_margin_position (GTK_SOURCE_VIEW (l->data), + pos); + + l = l->next; + } + + g_list_free (views); + } + else if (strcmp (entry->key, GPM_DISPLAY_RIGHT_MARGIN) == 0) + { + gboolean display; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_BOOL) + display = mateconf_value_get_bool (entry->value); + else + display = GPM_DEFAULT_DISPLAY_RIGHT_MARGIN; + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_show_right_margin (GTK_SOURCE_VIEW (l->data), + display); + + l = l->next; + } + + g_list_free (views); + } +} + +static GtkSourceSmartHomeEndType +get_smart_home_end_from_string (const gchar *str) +{ + GtkSourceSmartHomeEndType res; + + g_return_val_if_fail (str != NULL, GTK_SOURCE_SMART_HOME_END_AFTER); + + if (strcmp (str, "DISABLED") == 0) + res = GTK_SOURCE_SMART_HOME_END_DISABLED; + else if (strcmp (str, "BEFORE") == 0) + res = GTK_SOURCE_SMART_HOME_END_BEFORE; + else if (strcmp (str, "ALWAYS") == 0) + res = GTK_SOURCE_SMART_HOME_END_ALWAYS; + else + res = GTK_SOURCE_SMART_HOME_END_AFTER; + + return res; +} + +static void +gedit_prefs_manager_smart_home_end_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_SMART_HOME_END) == 0) + { + GtkSourceSmartHomeEndType smart_he; + GList *views; + GList *l; + + if (entry->value->type == MATECONF_VALUE_STRING) + smart_he = + get_smart_home_end_from_string (mateconf_value_get_string (entry->value)); + else + smart_he = get_smart_home_end_from_string (GPM_DEFAULT_SMART_HOME_END); + + views = gedit_app_get_views (gedit_app_get_default ()); + l = views; + + while (l != NULL) + { + gtk_source_view_set_smart_home_end (GTK_SOURCE_VIEW (l->data), + smart_he); + + l = l->next; + } + + g_list_free (views); + } +} + +static void +gedit_prefs_manager_syntax_hl_enable_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_SYNTAX_HL_ENABLE) == 0) + { + gboolean enable; + GList *docs; + GList *l; + const GList *windows; + + if (entry->value->type == MATECONF_VALUE_BOOL) + enable = mateconf_value_get_bool (entry->value); + else + enable = GPM_DEFAULT_SYNTAX_HL_ENABLE; + + docs = gedit_app_get_documents (gedit_app_get_default ()); + l = docs; + + while (l != NULL) + { + g_return_if_fail (GTK_IS_SOURCE_BUFFER (l->data)); + + gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (l->data), + enable); + + l = l->next; + } + + g_list_free (docs); + + /* update the sensitivity of the Higlight Mode menu item */ + windows = gedit_app_get_windows (gedit_app_get_default ()); + while (windows != NULL) + { + GtkUIManager *ui; + GtkAction *a; + + ui = gedit_window_get_ui_manager (GEDIT_WINDOW (windows->data)); + + a = gtk_ui_manager_get_action (ui, + "/MenuBar/ViewMenu/ViewHighlightModeMenu"); + + gtk_action_set_sensitive (a, enable); + + windows = g_list_next (windows); + } + } +} + +static void +gedit_prefs_manager_search_hl_enable_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_SEARCH_HIGHLIGHTING_ENABLE) == 0) + { + gboolean enable; + GList *docs; + GList *l; + + if (entry->value->type == MATECONF_VALUE_BOOL) + enable = mateconf_value_get_bool (entry->value); + else + enable = GPM_DEFAULT_SEARCH_HIGHLIGHTING_ENABLE; + + docs = gedit_app_get_documents (gedit_app_get_default ()); + l = docs; + + while (l != NULL) + { + g_return_if_fail (GEDIT_IS_DOCUMENT (l->data)); + + gedit_document_set_enable_search_highlighting (GEDIT_DOCUMENT (l->data), + enable); + + l = l->next; + } + + g_list_free (docs); + } +} + +static void +gedit_prefs_manager_source_style_scheme_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_SOURCE_STYLE_SCHEME) == 0) + { + static gchar *old_scheme = NULL; + const gchar *scheme; + GtkSourceStyleScheme *style; + GList *docs; + GList *l; + + if (entry->value->type == MATECONF_VALUE_STRING) + scheme = mateconf_value_get_string (entry->value); + else + scheme = GPM_DEFAULT_SOURCE_STYLE_SCHEME; + + if (old_scheme != NULL && (strcmp (scheme, old_scheme) == 0)) + return; + + g_free (old_scheme); + old_scheme = g_strdup (scheme); + + style = gtk_source_style_scheme_manager_get_scheme ( + gedit_get_style_scheme_manager (), + scheme); + + if (style == NULL) + { + g_warning ("Default style scheme '%s' not found, falling back to 'classic'", scheme); + + style = gtk_source_style_scheme_manager_get_scheme ( + gedit_get_style_scheme_manager (), + "classic"); + + if (style == NULL) + { + g_warning ("Style scheme 'classic' cannot be found, check your GtkSourceView installation."); + return; + } + } + + docs = gedit_app_get_documents (gedit_app_get_default ()); + for (l = docs; l != NULL; l = l->next) + { + g_return_if_fail (GTK_IS_SOURCE_BUFFER (l->data)); + + gtk_source_buffer_set_style_scheme (GTK_SOURCE_BUFFER (l->data), + style); + } + + g_list_free (docs); + } +} + +static void +gedit_prefs_manager_max_recents_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_MAX_RECENTS) == 0) + { + const GList *windows; + gint max; + + if (entry->value->type == MATECONF_VALUE_INT) + { + max = mateconf_value_get_int (entry->value); + + if (max < 0) + max = GPM_DEFAULT_MAX_RECENTS; + } + else + max = GPM_DEFAULT_MAX_RECENTS; + + windows = gedit_app_get_windows (gedit_app_get_default ()); + while (windows != NULL) + { + GeditWindow *w = windows->data; + + gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (w->priv->toolbar_recent_menu), + max); + + windows = g_list_next (windows); + } + + /* FIXME: we have no way at the moment to trigger the + * update of the inline recents in the File menu */ + } +} + +static void +gedit_prefs_manager_auto_save_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + GList *docs; + GList *l; + + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_AUTO_SAVE) == 0) + { + gboolean auto_save; + + if (entry->value->type == MATECONF_VALUE_BOOL) + auto_save = mateconf_value_get_bool (entry->value); + else + auto_save = GPM_DEFAULT_AUTO_SAVE; + + docs = gedit_app_get_documents (gedit_app_get_default ()); + l = docs; + + while (l != NULL) + { + GeditDocument *doc = GEDIT_DOCUMENT (l->data); + GeditTab *tab = gedit_tab_get_from_document (doc); + + gedit_tab_set_auto_save_enabled (tab, auto_save); + + l = l->next; + } + + g_list_free (docs); + } + else if (strcmp (entry->key, GPM_AUTO_SAVE_INTERVAL) == 0) + { + gint auto_save_interval; + + if (entry->value->type == MATECONF_VALUE_INT) + { + auto_save_interval = mateconf_value_get_int (entry->value); + + if (auto_save_interval <= 0) + auto_save_interval = GPM_DEFAULT_AUTO_SAVE_INTERVAL; + } + else + auto_save_interval = GPM_DEFAULT_AUTO_SAVE_INTERVAL; + + docs = gedit_app_get_documents (gedit_app_get_default ()); + l = docs; + + while (l != NULL) + { + GeditDocument *doc = GEDIT_DOCUMENT (l->data); + GeditTab *tab = gedit_tab_get_from_document (doc); + + gedit_tab_set_auto_save_interval (tab, auto_save_interval); + + l = l->next; + } + + g_list_free (docs); + } +} + +static void +gedit_prefs_manager_active_plugins_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (strcmp (entry->key, GPM_ACTIVE_PLUGINS) == 0) + { + if ((entry->value->type == MATECONF_VALUE_LIST) && + (mateconf_value_get_list_type (entry->value) == MATECONF_VALUE_STRING)) + { + GeditPluginsEngine *engine; + + engine = gedit_plugins_engine_get_default (); + + gedit_plugins_engine_active_plugins_changed (engine); + } + } +} + +static void +gedit_prefs_manager_lockdown_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + GeditApp *app; + gboolean locked; + + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (entry->key != NULL); + g_return_if_fail (entry->value != NULL); + + if (entry->value->type == MATECONF_VALUE_BOOL) + locked = mateconf_value_get_bool (entry->value); + else + locked = FALSE; + + app = gedit_app_get_default (); + + if (strcmp (entry->key, GPM_LOCKDOWN_COMMAND_LINE) == 0) + _gedit_app_set_lockdown_bit (app, + GEDIT_LOCKDOWN_COMMAND_LINE, + locked); + + else if (strcmp (entry->key, GPM_LOCKDOWN_PRINTING) == 0) + _gedit_app_set_lockdown_bit (app, + GEDIT_LOCKDOWN_PRINTING, + locked); + + else if (strcmp (entry->key, GPM_LOCKDOWN_PRINT_SETUP) == 0) + _gedit_app_set_lockdown_bit (app, + GEDIT_LOCKDOWN_PRINT_SETUP, + locked); + + else if (strcmp (entry->key, GPM_LOCKDOWN_SAVE_TO_DISK) == 0) + _gedit_app_set_lockdown_bit (app, + GEDIT_LOCKDOWN_SAVE_TO_DISK, + locked); +} diff --git a/gedit/gedit-prefs-manager-app.h b/gedit/gedit-prefs-manager-app.h new file mode 100755 index 00000000..592b643f --- /dev/null +++ b/gedit/gedit-prefs-manager-app.h @@ -0,0 +1,84 @@ +/* + * gedit-prefs-manager-app.h + * This file is part of gedit + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + * + */ + +#ifndef __GEDIT_PREFS_MANAGER_APP_H__ +#define __GEDIT_PREFS_MANAGER_APP_H__ + +#include +#include + +/** LIFE CYCLE MANAGEMENT FUNCTIONS **/ + +gboolean gedit_prefs_manager_app_init (void); + +/* This function must be called before exiting gedit */ +void gedit_prefs_manager_app_shutdown (void); + + +/* Window state */ +gint gedit_prefs_manager_get_window_state (void); +void gedit_prefs_manager_set_window_state (gint ws); +gboolean gedit_prefs_manager_window_state_can_set (void); + +/* Window size */ +void gedit_prefs_manager_get_window_size (gint *width, + gint *height); +void gedit_prefs_manager_get_default_window_size (gint *width, + gint *height); +void gedit_prefs_manager_set_window_size (gint width, + gint height); +gboolean gedit_prefs_manager_window_size_can_set (void); + +/* Side panel */ +gint gedit_prefs_manager_get_side_panel_size (void); +gint gedit_prefs_manager_get_default_side_panel_size(void); +void gedit_prefs_manager_set_side_panel_size (gint ps); +gboolean gedit_prefs_manager_side_panel_size_can_set (void); +gint gedit_prefs_manager_get_side_panel_active_page (void); +void gedit_prefs_manager_set_side_panel_active_page (gint id); +gboolean gedit_prefs_manager_side_panel_active_page_can_set (void); + +/* Bottom panel */ +gint gedit_prefs_manager_get_bottom_panel_size (void); +gint gedit_prefs_manager_get_default_bottom_panel_size(void); +void gedit_prefs_manager_set_bottom_panel_size (gint ps); +gboolean gedit_prefs_manager_bottom_panel_size_can_set (void); +gint gedit_prefs_manager_get_bottom_panel_active_page (void); +void gedit_prefs_manager_set_bottom_panel_active_page (gint id); +gboolean gedit_prefs_manager_bottom_panel_active_page_can_set (void); + +/* File filter */ +gint gedit_prefs_manager_get_active_file_filter (void); +void gedit_prefs_manager_set_active_file_filter (gint id); +gboolean gedit_prefs_manager_active_file_filter_can_set (void); + + +#endif /* __GEDIT_PREFS_MANAGER_APP_H__ */ diff --git a/gedit/gedit-prefs-manager-private.h b/gedit/gedit-prefs-manager-private.h new file mode 100755 index 00000000..7a8e94a5 --- /dev/null +++ b/gedit/gedit-prefs-manager-private.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-prefs-manager-private.h + * This file is part of gedit + * + * Copyright (C) 2002 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __GEDIT_PREFS_MANAGER_PRIVATE_H__ +#define __GEDIT_PREFS_MANAGER_PRIVATE_H__ + +#include + +typedef struct _GeditPrefsManager GeditPrefsManager; + +struct _GeditPrefsManager { + MateConfClient *mateconf_client; +}; + +extern GeditPrefsManager *gedit_prefs_manager; + +#endif /* __GEDIT_PREFS_MANAGER_PRIVATE_H__ */ + + diff --git a/gedit/gedit-prefs-manager.c b/gedit/gedit-prefs-manager.c new file mode 100755 index 00000000..c606e748 --- /dev/null +++ b/gedit/gedit-prefs-manager.c @@ -0,0 +1,1241 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-prefs-manager.c + * This file is part of gedit + * + * Copyright (C) 2002 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include +#include + +#include "gedit-prefs-manager.h" +#include "gedit-prefs-manager-private.h" +#include "gedit-debug.h" +#include "gedit-encodings.h" +#include "gedit-utils.h" + +#define DEFINE_BOOL_PREF(name, key, def) gboolean \ +gedit_prefs_manager_get_ ## name (void) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + return gedit_prefs_manager_get_bool (key, \ + (def)); \ +} \ + \ +void \ +gedit_prefs_manager_set_ ## name (gboolean v) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + gedit_prefs_manager_set_bool (key, \ + v); \ +} \ + \ +gboolean \ +gedit_prefs_manager_ ## name ## _can_set (void) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + return gedit_prefs_manager_key_is_writable (key); \ +} + + + +#define DEFINE_INT_PREF(name, key, def) gint \ +gedit_prefs_manager_get_ ## name (void) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + return gedit_prefs_manager_get_int (key, \ + (def)); \ +} \ + \ +void \ +gedit_prefs_manager_set_ ## name (gint v) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + gedit_prefs_manager_set_int (key, \ + v); \ +} \ + \ +gboolean \ +gedit_prefs_manager_ ## name ## _can_set (void) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + return gedit_prefs_manager_key_is_writable (key); \ +} + + + +#define DEFINE_STRING_PREF(name, key, def) gchar* \ +gedit_prefs_manager_get_ ## name (void) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + return gedit_prefs_manager_get_string (key, \ + def); \ +} \ + \ +void \ +gedit_prefs_manager_set_ ## name (const gchar* v) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + gedit_prefs_manager_set_string (key, \ + v); \ +} \ + \ +gboolean \ +gedit_prefs_manager_ ## name ## _can_set (void) \ +{ \ + gedit_debug (DEBUG_PREFS); \ + \ + return gedit_prefs_manager_key_is_writable (key); \ +} + + +GeditPrefsManager *gedit_prefs_manager = NULL; + + +static GtkWrapMode get_wrap_mode_from_string (const gchar* str); + +static gboolean mateconf_client_get_bool_with_default (MateConfClient* client, + const gchar* key, + gboolean def, + GError** err); + +static gchar *mateconf_client_get_string_with_default (MateConfClient* client, + const gchar* key, + const gchar* def, + GError** err); + +static gint mateconf_client_get_int_with_default (MateConfClient* client, + const gchar* key, + gint def, + GError** err); + +static gboolean gedit_prefs_manager_get_bool (const gchar* key, + gboolean def); + +static gint gedit_prefs_manager_get_int (const gchar* key, + gint def); + +static gchar *gedit_prefs_manager_get_string (const gchar* key, + const gchar* def); + + +gboolean +gedit_prefs_manager_init (void) +{ + gedit_debug (DEBUG_PREFS); + + if (gedit_prefs_manager == NULL) + { + MateConfClient *mateconf_client; + + mateconf_client = mateconf_client_get_default (); + if (mateconf_client == NULL) + { + g_warning (_("Cannot initialize preferences manager.")); + return FALSE; + } + + gedit_prefs_manager = g_new0 (GeditPrefsManager, 1); + + gedit_prefs_manager->mateconf_client = mateconf_client; + } + + if (gedit_prefs_manager->mateconf_client == NULL) + { + g_free (gedit_prefs_manager); + gedit_prefs_manager = NULL; + } + + return gedit_prefs_manager != NULL; + +} + +void +gedit_prefs_manager_shutdown (void) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (gedit_prefs_manager != NULL); + + g_object_unref (gedit_prefs_manager->mateconf_client); + gedit_prefs_manager->mateconf_client = NULL; +} + +static gboolean +gedit_prefs_manager_get_bool (const gchar* key, gboolean def) +{ + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, def); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, def); + + return mateconf_client_get_bool_with_default (gedit_prefs_manager->mateconf_client, + key, + def, + NULL); +} + +static gint +gedit_prefs_manager_get_int (const gchar* key, gint def) +{ + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, def); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, def); + + return mateconf_client_get_int_with_default (gedit_prefs_manager->mateconf_client, + key, + def, + NULL); +} + +static gchar * +gedit_prefs_manager_get_string (const gchar* key, const gchar* def) +{ + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, + def ? g_strdup (def) : NULL); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, + def ? g_strdup (def) : NULL); + + return mateconf_client_get_string_with_default (gedit_prefs_manager->mateconf_client, + key, + def, + NULL); +} + +static void +gedit_prefs_manager_set_bool (const gchar* key, gboolean value) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (gedit_prefs_manager != NULL); + g_return_if_fail (gedit_prefs_manager->mateconf_client != NULL); + g_return_if_fail (mateconf_client_key_is_writable ( + gedit_prefs_manager->mateconf_client, key, NULL)); + + mateconf_client_set_bool (gedit_prefs_manager->mateconf_client, key, value, NULL); +} + +static void +gedit_prefs_manager_set_int (const gchar* key, gint value) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (gedit_prefs_manager != NULL); + g_return_if_fail (gedit_prefs_manager->mateconf_client != NULL); + g_return_if_fail (mateconf_client_key_is_writable ( + gedit_prefs_manager->mateconf_client, key, NULL)); + + mateconf_client_set_int (gedit_prefs_manager->mateconf_client, key, value, NULL); +} + +static void +gedit_prefs_manager_set_string (const gchar* key, const gchar* value) +{ + gedit_debug (DEBUG_PREFS); + + g_return_if_fail (value != NULL); + + g_return_if_fail (gedit_prefs_manager != NULL); + g_return_if_fail (gedit_prefs_manager->mateconf_client != NULL); + g_return_if_fail (mateconf_client_key_is_writable ( + gedit_prefs_manager->mateconf_client, key, NULL)); + + mateconf_client_set_string (gedit_prefs_manager->mateconf_client, key, value, NULL); +} + +static gboolean +gedit_prefs_manager_key_is_writable (const gchar* key) +{ + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, FALSE); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, FALSE); + + return mateconf_client_key_is_writable (gedit_prefs_manager->mateconf_client, key, NULL); +} + +/* Use default font */ +DEFINE_BOOL_PREF (use_default_font, + GPM_USE_DEFAULT_FONT, + GPM_DEFAULT_USE_DEFAULT_FONT) + +/* Editor font */ +DEFINE_STRING_PREF (editor_font, + GPM_EDITOR_FONT, + GPM_DEFAULT_EDITOR_FONT) + +/* System font */ +gchar * +gedit_prefs_manager_get_system_font (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_get_string (GPM_SYSTEM_FONT, + GPM_DEFAULT_SYSTEM_FONT); +} + +/* Create backup copy */ +DEFINE_BOOL_PREF (create_backup_copy, + GPM_CREATE_BACKUP_COPY, + GPM_DEFAULT_CREATE_BACKUP_COPY) + +/* Auto save */ +DEFINE_BOOL_PREF (auto_save, + GPM_AUTO_SAVE, + GPM_DEFAULT_AUTO_SAVE) + +/* Auto save interval */ +DEFINE_INT_PREF (auto_save_interval, + GPM_AUTO_SAVE_INTERVAL, + GPM_DEFAULT_AUTO_SAVE_INTERVAL) + + +/* Undo actions limit: if < 1 then no limits */ +DEFINE_INT_PREF (undo_actions_limit, + GPM_UNDO_ACTIONS_LIMIT, + GPM_DEFAULT_UNDO_ACTIONS_LIMIT) + +static GtkWrapMode +get_wrap_mode_from_string (const gchar* str) +{ + GtkWrapMode res; + + g_return_val_if_fail (str != NULL, GTK_WRAP_WORD); + + if (strcmp (str, "GTK_WRAP_NONE") == 0) + res = GTK_WRAP_NONE; + else + { + if (strcmp (str, "GTK_WRAP_CHAR") == 0) + res = GTK_WRAP_CHAR; + else + res = GTK_WRAP_WORD; + } + + return res; +} + +/* Wrap mode */ +GtkWrapMode +gedit_prefs_manager_get_wrap_mode (void) +{ + gchar *str; + GtkWrapMode res; + + gedit_debug (DEBUG_PREFS); + + str = gedit_prefs_manager_get_string (GPM_WRAP_MODE, + GPM_DEFAULT_WRAP_MODE); + + res = get_wrap_mode_from_string (str); + + g_free (str); + + return res; +} + +void +gedit_prefs_manager_set_wrap_mode (GtkWrapMode wp) +{ + const gchar * str; + + gedit_debug (DEBUG_PREFS); + + switch (wp) + { + case GTK_WRAP_NONE: + str = "GTK_WRAP_NONE"; + break; + + case GTK_WRAP_CHAR: + str = "GTK_WRAP_CHAR"; + break; + + default: /* GTK_WRAP_WORD */ + str = "GTK_WRAP_WORD"; + } + + gedit_prefs_manager_set_string (GPM_WRAP_MODE, + str); +} + +gboolean +gedit_prefs_manager_wrap_mode_can_set (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_key_is_writable (GPM_WRAP_MODE); +} + + +/* Tabs size */ +DEFINE_INT_PREF (tabs_size, + GPM_TABS_SIZE, + GPM_DEFAULT_TABS_SIZE) + +/* Insert spaces */ +DEFINE_BOOL_PREF (insert_spaces, + GPM_INSERT_SPACES, + GPM_DEFAULT_INSERT_SPACES) + +/* Auto indent */ +DEFINE_BOOL_PREF (auto_indent, + GPM_AUTO_INDENT, + GPM_DEFAULT_AUTO_INDENT) + +/* Display line numbers */ +DEFINE_BOOL_PREF (display_line_numbers, + GPM_DISPLAY_LINE_NUMBERS, + GPM_DEFAULT_DISPLAY_LINE_NUMBERS) + +/* Toolbar visibility */ +DEFINE_BOOL_PREF (toolbar_visible, + GPM_TOOLBAR_VISIBLE, + GPM_DEFAULT_TOOLBAR_VISIBLE) + + +/* Toolbar suttons style */ +GeditToolbarSetting +gedit_prefs_manager_get_toolbar_buttons_style (void) +{ + gchar *str; + GeditToolbarSetting res; + + gedit_debug (DEBUG_PREFS); + + str = gedit_prefs_manager_get_string (GPM_TOOLBAR_BUTTONS_STYLE, + GPM_DEFAULT_TOOLBAR_BUTTONS_STYLE); + + if (strcmp (str, "GEDIT_TOOLBAR_ICONS") == 0) + res = GEDIT_TOOLBAR_ICONS; + else + { + if (strcmp (str, "GEDIT_TOOLBAR_ICONS_AND_TEXT") == 0) + res = GEDIT_TOOLBAR_ICONS_AND_TEXT; + else + { + if (strcmp (str, "GEDIT_TOOLBAR_ICONS_BOTH_HORIZ") == 0) + res = GEDIT_TOOLBAR_ICONS_BOTH_HORIZ; + else + res = GEDIT_TOOLBAR_SYSTEM; + } + } + + g_free (str); + + return res; +} + +void +gedit_prefs_manager_set_toolbar_buttons_style (GeditToolbarSetting tbs) +{ + const gchar * str; + + gedit_debug (DEBUG_PREFS); + + switch (tbs) + { + case GEDIT_TOOLBAR_ICONS: + str = "GEDIT_TOOLBAR_ICONS"; + break; + + case GEDIT_TOOLBAR_ICONS_AND_TEXT: + str = "GEDIT_TOOLBAR_ICONS_AND_TEXT"; + break; + + case GEDIT_TOOLBAR_ICONS_BOTH_HORIZ: + str = "GEDIT_TOOLBAR_ICONS_BOTH_HORIZ"; + break; + default: /* GEDIT_TOOLBAR_SYSTEM */ + str = "GEDIT_TOOLBAR_SYSTEM"; + } + + gedit_prefs_manager_set_string (GPM_TOOLBAR_BUTTONS_STYLE, + str); + +} + +gboolean +gedit_prefs_manager_toolbar_buttons_style_can_set (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_key_is_writable (GPM_TOOLBAR_BUTTONS_STYLE); + +} + +/* Statusbar visiblity */ +DEFINE_BOOL_PREF (statusbar_visible, + GPM_STATUSBAR_VISIBLE, + GPM_DEFAULT_STATUSBAR_VISIBLE) + +/* Side Pane visiblity */ +DEFINE_BOOL_PREF (side_pane_visible, + GPM_SIDE_PANE_VISIBLE, + GPM_DEFAULT_SIDE_PANE_VISIBLE) + +/* Bottom Panel visiblity */ +DEFINE_BOOL_PREF (bottom_panel_visible, + GPM_BOTTOM_PANEL_VISIBLE, + GPM_DEFAULT_BOTTOM_PANEL_VISIBLE) + +/* Print syntax highlighting */ +DEFINE_BOOL_PREF (print_syntax_hl, + GPM_PRINT_SYNTAX, + GPM_DEFAULT_PRINT_SYNTAX) + +/* Print header */ +DEFINE_BOOL_PREF (print_header, + GPM_PRINT_HEADER, + GPM_DEFAULT_PRINT_HEADER) + + +/* Print Wrap mode */ +GtkWrapMode +gedit_prefs_manager_get_print_wrap_mode (void) +{ + gchar *str; + GtkWrapMode res; + + gedit_debug (DEBUG_PREFS); + + str = gedit_prefs_manager_get_string (GPM_PRINT_WRAP_MODE, + GPM_DEFAULT_PRINT_WRAP_MODE); + + if (strcmp (str, "GTK_WRAP_NONE") == 0) + res = GTK_WRAP_NONE; + else + { + if (strcmp (str, "GTK_WRAP_WORD") == 0) + res = GTK_WRAP_WORD; + else + res = GTK_WRAP_CHAR; + } + + g_free (str); + + return res; +} + +void +gedit_prefs_manager_set_print_wrap_mode (GtkWrapMode pwp) +{ + const gchar *str; + + gedit_debug (DEBUG_PREFS); + + switch (pwp) + { + case GTK_WRAP_NONE: + str = "GTK_WRAP_NONE"; + break; + + case GTK_WRAP_WORD: + str = "GTK_WRAP_WORD"; + break; + + default: /* GTK_WRAP_CHAR */ + str = "GTK_WRAP_CHAR"; + } + + gedit_prefs_manager_set_string (GPM_PRINT_WRAP_MODE, str); +} + +gboolean +gedit_prefs_manager_print_wrap_mode_can_set (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_key_is_writable (GPM_PRINT_WRAP_MODE); +} + +/* Print line numbers */ +DEFINE_INT_PREF (print_line_numbers, + GPM_PRINT_LINE_NUMBERS, + GPM_DEFAULT_PRINT_LINE_NUMBERS) + +/* Printing fonts */ +DEFINE_STRING_PREF (print_font_body, + GPM_PRINT_FONT_BODY, + GPM_DEFAULT_PRINT_FONT_BODY) + +const gchar * +gedit_prefs_manager_get_default_print_font_body (void) +{ + return GPM_DEFAULT_PRINT_FONT_BODY; +} + +DEFINE_STRING_PREF (print_font_header, + GPM_PRINT_FONT_HEADER, + GPM_DEFAULT_PRINT_FONT_HEADER) + +const gchar * +gedit_prefs_manager_get_default_print_font_header (void) +{ + return GPM_DEFAULT_PRINT_FONT_HEADER; +} + +DEFINE_STRING_PREF (print_font_numbers, + GPM_PRINT_FONT_NUMBERS, + GPM_DEFAULT_PRINT_FONT_NUMBERS) + +const gchar * +gedit_prefs_manager_get_default_print_font_numbers (void) +{ + return GPM_DEFAULT_PRINT_FONT_NUMBERS; +} + +/* Max number of files in "Recent Files" menu. + * This is configurable only using mateconftool or mateconf-editor + */ +gint +gedit_prefs_manager_get_max_recents (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_get_int (GPM_MAX_RECENTS, + GPM_DEFAULT_MAX_RECENTS); + +} + +/* Encodings */ + +static gboolean +data_exists (GSList *list, + const gpointer data) +{ + while (list != NULL) + { + if (list->data == data) + return TRUE; + + list = g_slist_next (list); + } + + return FALSE; +} + +GSList * +gedit_prefs_manager_get_auto_detected_encodings (void) +{ + GSList *strings; + GSList *res = NULL; + + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, NULL); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, NULL); + + strings = mateconf_client_get_list (gedit_prefs_manager->mateconf_client, + GPM_AUTO_DETECTED_ENCODINGS, + MATECONF_VALUE_STRING, + NULL); + + if (strings == NULL) + { + gint i = 0; + const gchar* s[] = GPM_DEFAULT_AUTO_DETECTED_ENCODINGS; + + while (s[i] != NULL) + { + strings = g_slist_prepend (strings, g_strdup (s[i])); + + ++i; + } + + + strings = g_slist_reverse (strings); + } + + if (strings != NULL) + { + GSList *tmp; + const GeditEncoding *enc; + + tmp = strings; + + while (tmp) + { + const char *charset = tmp->data; + + if (strcmp (charset, "CURRENT") == 0) + g_get_charset (&charset); + + g_return_val_if_fail (charset != NULL, NULL); + enc = gedit_encoding_get_from_charset (charset); + + if (enc != NULL) + { + if (!data_exists (res, (gpointer)enc)) + res = g_slist_prepend (res, (gpointer)enc); + + } + + tmp = g_slist_next (tmp); + } + + g_slist_foreach (strings, (GFunc) g_free, NULL); + g_slist_free (strings); + + res = g_slist_reverse (res); + } + + gedit_debug_message (DEBUG_PREFS, "Done"); + + return res; +} + +GSList * +gedit_prefs_manager_get_shown_in_menu_encodings (void) +{ + GSList *strings; + GSList *res = NULL; + + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, NULL); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, NULL); + + strings = mateconf_client_get_list (gedit_prefs_manager->mateconf_client, + GPM_SHOWN_IN_MENU_ENCODINGS, + MATECONF_VALUE_STRING, + NULL); + + if (strings != NULL) + { + GSList *tmp; + const GeditEncoding *enc; + + tmp = strings; + + while (tmp) + { + const char *charset = tmp->data; + + if (strcmp (charset, "CURRENT") == 0) + g_get_charset (&charset); + + g_return_val_if_fail (charset != NULL, NULL); + enc = gedit_encoding_get_from_charset (charset); + + if (enc != NULL) + { + if (!data_exists (res, (gpointer)enc)) + res = g_slist_prepend (res, (gpointer)enc); + } + + tmp = g_slist_next (tmp); + } + + g_slist_foreach (strings, (GFunc) g_free, NULL); + g_slist_free (strings); + + res = g_slist_reverse (res); + } + + return res; +} + +void +gedit_prefs_manager_set_shown_in_menu_encodings (const GSList *encs) +{ + GSList *list = NULL; + + g_return_if_fail (gedit_prefs_manager != NULL); + g_return_if_fail (gedit_prefs_manager->mateconf_client != NULL); + g_return_if_fail (gedit_prefs_manager_shown_in_menu_encodings_can_set ()); + + while (encs != NULL) + { + const GeditEncoding *enc; + const gchar *charset; + + enc = (const GeditEncoding *)encs->data; + + charset = gedit_encoding_get_charset (enc); + g_return_if_fail (charset != NULL); + + list = g_slist_prepend (list, (gpointer)charset); + + encs = g_slist_next (encs); + } + + list = g_slist_reverse (list); + + mateconf_client_set_list (gedit_prefs_manager->mateconf_client, + GPM_SHOWN_IN_MENU_ENCODINGS, + MATECONF_VALUE_STRING, + list, + NULL); + + g_slist_free (list); +} + +gboolean +gedit_prefs_manager_shown_in_menu_encodings_can_set (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_key_is_writable (GPM_SHOWN_IN_MENU_ENCODINGS); + +} + +/* Highlight current line */ +DEFINE_BOOL_PREF (highlight_current_line, + GPM_HIGHLIGHT_CURRENT_LINE, + GPM_DEFAULT_HIGHLIGHT_CURRENT_LINE) + +/* Highlight matching bracket */ +DEFINE_BOOL_PREF (bracket_matching, + GPM_BRACKET_MATCHING, + GPM_DEFAULT_BRACKET_MATCHING) + +/* Display Right Margin */ +DEFINE_BOOL_PREF (display_right_margin, + GPM_DISPLAY_RIGHT_MARGIN, + GPM_DEFAULT_DISPLAY_RIGHT_MARGIN) + +/* Right Margin Position */ +DEFINE_INT_PREF (right_margin_position, + GPM_RIGHT_MARGIN_POSITION, + GPM_DEFAULT_RIGHT_MARGIN_POSITION) + +static GtkSourceSmartHomeEndType +get_smart_home_end_from_string (const gchar *str) +{ + GtkSourceSmartHomeEndType res; + + g_return_val_if_fail (str != NULL, GTK_SOURCE_SMART_HOME_END_AFTER); + + if (strcmp (str, "DISABLED") == 0) + res = GTK_SOURCE_SMART_HOME_END_DISABLED; + else if (strcmp (str, "BEFORE") == 0) + res = GTK_SOURCE_SMART_HOME_END_BEFORE; + else if (strcmp (str, "ALWAYS") == 0) + res = GTK_SOURCE_SMART_HOME_END_ALWAYS; + else + res = GTK_SOURCE_SMART_HOME_END_AFTER; + + return res; +} + +GtkSourceSmartHomeEndType +gedit_prefs_manager_get_smart_home_end (void) +{ + gchar *str; + GtkSourceSmartHomeEndType res; + + gedit_debug (DEBUG_PREFS); + + str = gedit_prefs_manager_get_string (GPM_SMART_HOME_END, + GPM_DEFAULT_SMART_HOME_END); + + res = get_smart_home_end_from_string (str); + + g_free (str); + + return res; +} + +void +gedit_prefs_manager_set_smart_home_end (GtkSourceSmartHomeEndType smart_he) +{ + const gchar *str; + + gedit_debug (DEBUG_PREFS); + + switch (smart_he) + { + case GTK_SOURCE_SMART_HOME_END_DISABLED: + str = "DISABLED"; + break; + + case GTK_SOURCE_SMART_HOME_END_BEFORE: + str = "BEFORE"; + break; + + case GTK_SOURCE_SMART_HOME_END_ALWAYS: + str = "ALWAYS"; + break; + + default: /* GTK_SOURCE_SMART_HOME_END_AFTER */ + str = "AFTER"; + } + + gedit_prefs_manager_set_string (GPM_WRAP_MODE, str); +} + +gboolean +gedit_prefs_manager_smart_home_end_can_set (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_key_is_writable (GPM_SMART_HOME_END); +} + +/* Enable syntax highlighting */ +DEFINE_BOOL_PREF (enable_syntax_highlighting, + GPM_SYNTAX_HL_ENABLE, + GPM_DEFAULT_SYNTAX_HL_ENABLE) + +/* Enable search highlighting */ +DEFINE_BOOL_PREF (enable_search_highlighting, + GPM_SEARCH_HIGHLIGHTING_ENABLE, + GPM_DEFAULT_SEARCH_HIGHLIGHTING_ENABLE) + +/* Source style scheme */ +DEFINE_STRING_PREF (source_style_scheme, + GPM_SOURCE_STYLE_SCHEME, + GPM_DEFAULT_SOURCE_STYLE_SCHEME) + +GSList * +gedit_prefs_manager_get_writable_vfs_schemes (void) +{ + GSList *strings; + + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, NULL); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, NULL); + + strings = mateconf_client_get_list (gedit_prefs_manager->mateconf_client, + GPM_WRITABLE_VFS_SCHEMES, + MATECONF_VALUE_STRING, + NULL); + + if (strings == NULL) + { + gint i = 0; + const gchar* s[] = GPM_DEFAULT_WRITABLE_VFS_SCHEMES; + + while (s[i] != NULL) + { + strings = g_slist_prepend (strings, g_strdup (s[i])); + + ++i; + } + + strings = g_slist_reverse (strings); + } + + /* The 'file' scheme is writable by default. */ + strings = g_slist_prepend (strings, g_strdup ("file")); + + gedit_debug_message (DEBUG_PREFS, "Done"); + + return strings; +} + +gboolean +gedit_prefs_manager_get_restore_cursor_position (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_get_bool (GPM_RESTORE_CURSOR_POSITION, + GPM_DEFAULT_RESTORE_CURSOR_POSITION); +} + +/* Plugins: we just store/return a list of strings, all the magic has to + * happen in the plugin engine */ + +GSList * +gedit_prefs_manager_get_active_plugins (void) +{ + GSList *plugins; + + gedit_debug (DEBUG_PREFS); + + g_return_val_if_fail (gedit_prefs_manager != NULL, NULL); + g_return_val_if_fail (gedit_prefs_manager->mateconf_client != NULL, NULL); + + plugins = mateconf_client_get_list (gedit_prefs_manager->mateconf_client, + GPM_ACTIVE_PLUGINS, + MATECONF_VALUE_STRING, + NULL); + + return plugins; +} + +void +gedit_prefs_manager_set_active_plugins (const GSList *plugins) +{ + g_return_if_fail (gedit_prefs_manager != NULL); + g_return_if_fail (gedit_prefs_manager->mateconf_client != NULL); + g_return_if_fail (gedit_prefs_manager_active_plugins_can_set ()); + + mateconf_client_set_list (gedit_prefs_manager->mateconf_client, + GPM_ACTIVE_PLUGINS, + MATECONF_VALUE_STRING, + (GSList *) plugins, + NULL); +} + +gboolean +gedit_prefs_manager_active_plugins_can_set (void) +{ + gedit_debug (DEBUG_PREFS); + + return gedit_prefs_manager_key_is_writable (GPM_ACTIVE_PLUGINS); +} + +/* Global Lockdown */ + +GeditLockdownMask +gedit_prefs_manager_get_lockdown (void) +{ + guint lockdown = 0; + + if (gedit_prefs_manager_get_bool (GPM_LOCKDOWN_COMMAND_LINE, FALSE)) + lockdown |= GEDIT_LOCKDOWN_COMMAND_LINE; + + if (gedit_prefs_manager_get_bool (GPM_LOCKDOWN_PRINTING, FALSE)) + lockdown |= GEDIT_LOCKDOWN_PRINTING; + + if (gedit_prefs_manager_get_bool (GPM_LOCKDOWN_PRINT_SETUP, FALSE)) + lockdown |= GEDIT_LOCKDOWN_PRINT_SETUP; + + if (gedit_prefs_manager_get_bool (GPM_LOCKDOWN_SAVE_TO_DISK, FALSE)) + lockdown |= GEDIT_LOCKDOWN_SAVE_TO_DISK; + + return lockdown; +} + +/* The following functions are taken from mateconf-client.c + * and partially modified. + * The licensing terms on these is: + * + * + * MateConf + * Copyright (C) 1999, 2000, 2000 Red Hat Inc. + * + * 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, + * Boston, MA 02111-1307, USA. + */ + + +static const gchar* +mateconf_value_type_to_string(MateConfValueType type) +{ + switch (type) + { + case MATECONF_VALUE_INT: + return "int"; + break; + case MATECONF_VALUE_STRING: + return "string"; + break; + case MATECONF_VALUE_FLOAT: + return "float"; + break; + case MATECONF_VALUE_BOOL: + return "bool"; + break; + case MATECONF_VALUE_SCHEMA: + return "schema"; + break; + case MATECONF_VALUE_LIST: + return "list"; + break; + case MATECONF_VALUE_PAIR: + return "pair"; + break; + case MATECONF_VALUE_INVALID: + return "*invalid*"; + break; + default: + g_return_val_if_reached (NULL); + break; + } +} + +/* Emit the proper signals for the error, and fill in err */ +static gboolean +handle_error (MateConfClient* client, GError* error, GError** err) +{ + if (error != NULL) + { + mateconf_client_error(client, error); + + if (err == NULL) + { + mateconf_client_unreturned_error(client, error); + + g_error_free(error); + } + else + *err = error; + + return TRUE; + } + else + return FALSE; +} + +static gboolean +check_type (const gchar* key, MateConfValue* val, MateConfValueType t, GError** err) +{ + if (val->type != t) + { + /* + mateconf_set_error(err, MATECONF_ERROR_TYPE_MISMATCH, + _("Expected `%s' got, `%s' for key %s"), + mateconf_value_type_to_string(t), + mateconf_value_type_to_string(val->type), + key); + */ + g_set_error (err, MATECONF_ERROR, MATECONF_ERROR_TYPE_MISMATCH, + _("Expected `%s', got `%s' for key %s"), + mateconf_value_type_to_string(t), + mateconf_value_type_to_string(val->type), + key); + + return FALSE; + } + else + return TRUE; +} + +static gboolean +mateconf_client_get_bool_with_default (MateConfClient* client, const gchar* key, + gboolean def, GError** err) +{ + GError* error = NULL; + MateConfValue* val; + + g_return_val_if_fail (err == NULL || *err == NULL, def); + + val = mateconf_client_get (client, key, &error); + + if (val != NULL) + { + gboolean retval = def; + + g_return_val_if_fail (error == NULL, retval); + + if (check_type (key, val, MATECONF_VALUE_BOOL, &error)) + retval = mateconf_value_get_bool (val); + else + handle_error (client, error, err); + + mateconf_value_free (val); + + return retval; + } + else + { + if (error != NULL) + handle_error (client, error, err); + return def; + } +} + +static gchar* +mateconf_client_get_string_with_default (MateConfClient* client, const gchar* key, + const gchar* def, GError** err) +{ + GError* error = NULL; + gchar* val; + + g_return_val_if_fail (err == NULL || *err == NULL, def ? g_strdup (def) : NULL); + + val = mateconf_client_get_string (client, key, &error); + + if (val != NULL) + { + g_return_val_if_fail (error == NULL, def ? g_strdup (def) : NULL); + + return val; + } + else + { + if (error != NULL) + handle_error (client, error, err); + return def ? g_strdup (def) : NULL; + } +} + +static gint +mateconf_client_get_int_with_default (MateConfClient* client, const gchar* key, + gint def, GError** err) +{ + GError* error = NULL; + MateConfValue* val; + + g_return_val_if_fail (err == NULL || *err == NULL, def); + + val = mateconf_client_get (client, key, &error); + + if (val != NULL) + { + gint retval = def; + + g_return_val_if_fail (error == NULL, def); + + if (check_type (key, val, MATECONF_VALUE_INT, &error)) + retval = mateconf_value_get_int(val); + else + handle_error (client, error, err); + + mateconf_value_free (val); + + return retval; + } + else + { + if (error != NULL) + handle_error (client, error, err); + return def; + } +} + diff --git a/gedit/gedit-prefs-manager.h b/gedit/gedit-prefs-manager.h new file mode 100755 index 00000000..82041617 --- /dev/null +++ b/gedit/gedit-prefs-manager.h @@ -0,0 +1,423 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-prefs-manager.h + * This file is part of gedit + * + * Copyright (C) 2002 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __GEDIT_PREFS_MANAGER_H__ +#define __GEDIT_PREFS_MANAGER_H__ + +#include +#include +#include +#include "gedit-app.h" + +#define GEDIT_BASE_KEY "/apps/gedit-2" + +#define GPM_PREFS_DIR GEDIT_BASE_KEY "/preferences" + +/* Editor */ +#define GPM_FONT_DIR GPM_PREFS_DIR "/editor/font" +#define GPM_USE_DEFAULT_FONT GPM_FONT_DIR "/use_default_font" +#define GPM_EDITOR_FONT GPM_FONT_DIR "/editor_font" +#define GPM_SYSTEM_FONT "/desktop/mate/interface/monospace_font_name" + +#define GPM_SAVE_DIR GPM_PREFS_DIR "/editor/save" +#define GPM_CREATE_BACKUP_COPY GPM_SAVE_DIR "/create_backup_copy" + +#define GPM_AUTO_SAVE GPM_SAVE_DIR "/auto_save" +#define GPM_AUTO_SAVE_INTERVAL GPM_SAVE_DIR "/auto_save_interval" + +#define GPM_UNDO_DIR GPM_PREFS_DIR "/editor/undo" +#define GPM_UNDO_ACTIONS_LIMIT GPM_UNDO_DIR "/max_undo_actions" + +#define GPM_WRAP_MODE_DIR GPM_PREFS_DIR "/editor/wrap_mode" +#define GPM_WRAP_MODE GPM_WRAP_MODE_DIR "/wrap_mode" + +#define GPM_TABS_DIR GPM_PREFS_DIR "/editor/tabs" +#define GPM_TABS_SIZE GPM_TABS_DIR "/tabs_size" +#define GPM_INSERT_SPACES GPM_TABS_DIR "/insert_spaces" + +#define GPM_AUTO_INDENT_DIR GPM_PREFS_DIR "/editor/auto_indent" +#define GPM_AUTO_INDENT GPM_AUTO_INDENT_DIR "/auto_indent" + +#define GPM_LINE_NUMBERS_DIR GPM_PREFS_DIR "/editor/line_numbers" +#define GPM_DISPLAY_LINE_NUMBERS GPM_LINE_NUMBERS_DIR "/display_line_numbers" + +#define GPM_CURRENT_LINE_DIR GPM_PREFS_DIR "/editor/current_line" +#define GPM_HIGHLIGHT_CURRENT_LINE GPM_CURRENT_LINE_DIR "/highlight_current_line" + +#define GPM_BRACKET_MATCHING_DIR GPM_PREFS_DIR "/editor/bracket_matching" +#define GPM_BRACKET_MATCHING GPM_BRACKET_MATCHING_DIR "/bracket_matching" + +#define GPM_RIGHT_MARGIN_DIR GPM_PREFS_DIR "/editor/right_margin" +#define GPM_DISPLAY_RIGHT_MARGIN GPM_RIGHT_MARGIN_DIR "/display_right_margin" +#define GPM_RIGHT_MARGIN_POSITION GPM_RIGHT_MARGIN_DIR "/right_margin_position" + +#define GPM_SMART_HOME_END_DIR GPM_PREFS_DIR "/editor/smart_home_end" +#define GPM_SMART_HOME_END GPM_SMART_HOME_END_DIR "/smart_home_end" + +#define GPM_CURSOR_POSITION_DIR GPM_PREFS_DIR "/editor/cursor_position" +#define GPM_RESTORE_CURSOR_POSITION GPM_CURSOR_POSITION_DIR "/restore_cursor_position" + +#define GPM_SEARCH_HIGHLIGHTING_DIR GPM_PREFS_DIR "/editor/search_highlighting" +#define GPM_SEARCH_HIGHLIGHTING_ENABLE GPM_SEARCH_HIGHLIGHTING_DIR "/enable" + +#define GPM_SOURCE_STYLE_DIR GPM_PREFS_DIR "/editor/colors" +#define GPM_SOURCE_STYLE_SCHEME GPM_SOURCE_STYLE_DIR "/scheme" + +/* UI */ +#define GPM_TOOLBAR_DIR GPM_PREFS_DIR "/ui/toolbar" +#define GPM_TOOLBAR_VISIBLE GPM_TOOLBAR_DIR "/toolbar_visible" +#define GPM_TOOLBAR_BUTTONS_STYLE GPM_TOOLBAR_DIR "/toolbar_buttons_style" + +#define GPM_STATUSBAR_DIR GPM_PREFS_DIR "/ui/statusbar" +#define GPM_STATUSBAR_VISIBLE GPM_STATUSBAR_DIR "/statusbar_visible" + +#define GPM_SIDE_PANE_DIR GPM_PREFS_DIR "/ui/side_pane" +#define GPM_SIDE_PANE_VISIBLE GPM_SIDE_PANE_DIR "/side_pane_visible" + +#define GPM_BOTTOM_PANEL_DIR GPM_PREFS_DIR "/ui/bottom_panel" +#define GPM_BOTTOM_PANEL_VISIBLE GPM_BOTTOM_PANEL_DIR "/bottom_panel_visible" + +#define GPM_RECENTS_DIR GPM_PREFS_DIR "/ui/recents" +#define GPM_MAX_RECENTS GPM_RECENTS_DIR "/max_recents" + +/* Print */ +#define GPM_PRINT_PAGE_DIR GPM_PREFS_DIR "/print/page" +#define GPM_PRINT_SYNTAX GPM_PRINT_PAGE_DIR "/print_syntax_highlighting" +#define GPM_PRINT_HEADER GPM_PRINT_PAGE_DIR "/print_header" +#define GPM_PRINT_WRAP_MODE GPM_PRINT_PAGE_DIR "/print_wrap_mode" +#define GPM_PRINT_LINE_NUMBERS GPM_PRINT_PAGE_DIR "/print_line_numbers" + +#define GPM_PRINT_FONT_DIR GPM_PREFS_DIR "/print/fonts" +#define GPM_PRINT_FONT_BODY GPM_PRINT_FONT_DIR "/print_font_body_pango" +#define GPM_PRINT_FONT_HEADER GPM_PRINT_FONT_DIR "/print_font_header_pango" +#define GPM_PRINT_FONT_NUMBERS GPM_PRINT_FONT_DIR "/print_font_numbers_pango" + +/* Encodings */ +#define GPM_ENCODINGS_DIR GPM_PREFS_DIR "/encodings" +#define GPM_AUTO_DETECTED_ENCODINGS GPM_ENCODINGS_DIR "/auto_detected" +#define GPM_SHOWN_IN_MENU_ENCODINGS GPM_ENCODINGS_DIR "/shown_in_menu" + +/* Syntax highlighting */ +#define GPM_SYNTAX_HL_DIR GPM_PREFS_DIR "/syntax_highlighting" +#define GPM_SYNTAX_HL_ENABLE GPM_SYNTAX_HL_DIR "/enable" + +/* White list of writable mate-vfs methods */ +#define GPM_WRITABLE_VFS_SCHEMES GPM_SAVE_DIR "/writable_vfs_schemes" + +/* Plugins */ +#define GPM_PLUGINS_DIR GEDIT_BASE_KEY "/plugins" +#define GPM_ACTIVE_PLUGINS GPM_PLUGINS_DIR "/active-plugins" + +/* Global Lockdown keys */ +#define GPM_LOCKDOWN_DIR "/desktop/mate/lockdown" +#define GPM_LOCKDOWN_COMMAND_LINE GPM_LOCKDOWN_DIR "/disable_command_line" +#define GPM_LOCKDOWN_PRINTING GPM_LOCKDOWN_DIR "/disable_printing" +#define GPM_LOCKDOWN_PRINT_SETUP GPM_LOCKDOWN_DIR "/disable_print_setup" +#define GPM_LOCKDOWN_SAVE_TO_DISK GPM_LOCKDOWN_DIR "/disable_save_to_disk" + +/* Fallback default values. Keep in sync with gedit.schemas */ + +#define GPM_DEFAULT_USE_DEFAULT_FONT 1 /* TRUE */ + +#ifndef PLATFORM_OSX +#define GPM_DEFAULT_EDITOR_FONT (const gchar*) "Monospace 12" +#define GPM_DEFAULT_SYSTEM_FONT (const gchar*) "Monospace 10" +#else +#define GPM_DEFAULT_EDITOR_FONT (const gchar*) "Monaco 12" +#define GPM_DEFAULT_SYSTEM_FONT (const gchar*) "Monaco 12" +#endif + +#define GPM_DEFAULT_CREATE_BACKUP_COPY 0 /* FALSE */ + +#define GPM_DEFAULT_AUTO_SAVE 0 /* FALSE */ +#define GPM_DEFAULT_AUTO_SAVE_INTERVAL 10 /* minutes */ + +#define GPM_DEFAULT_UNDO_ACTIONS_LIMIT 2000 /* actions */ + +#define GPM_DEFAULT_WRAP_MODE "GTK_WRAP_WORD" + +#define GPM_DEFAULT_TABS_SIZE 8 +#define GPM_DEFAULT_INSERT_SPACES 0 /* FALSE */ + +#define GPM_DEFAULT_AUTO_INDENT 0 /* FALSE */ + +#define GPM_DEFAULT_DISPLAY_LINE_NUMBERS 0 /* FALSE */ + +#define GPM_DEFAULT_AUTO_DETECTED_ENCODINGS {"UTF-8", "CURRENT", "ISO-8859-15", NULL} + +#define GPM_DEFAULT_TOOLBAR_VISIBLE 1 /* TRUE */ +#define GPM_DEFAULT_TOOLBAR_BUTTONS_STYLE "GEDIT_TOOLBAR_SYSTEM" +#define GPM_DEFAULT_TOOLBAR_SHOW_TOOLTIPS 1 /* TRUE */ + +#define GPM_DEFAULT_STATUSBAR_VISIBLE 1 /* TRUE */ +#define GPM_DEFAULT_SIDE_PANE_VISIBLE 0 /* FALSE */ +#define GPM_DEFAULT_BOTTOM_PANEL_VISIBLE 0 /* FALSE */ + +#define GPM_DEFAULT_PRINT_SYNTAX 1 /* TRUE */ +#define GPM_DEFAULT_PRINT_HEADER 1 /* TRUE */ +#define GPM_DEFAULT_PRINT_WRAP_MODE "GTK_WRAP_WORD" +#define GPM_DEFAULT_PRINT_LINE_NUMBERS 0 /* No numbers */ + +#ifndef PLATFORM_OSX +#define GPM_DEFAULT_PRINT_FONT_BODY (const gchar*) "Monospace 9" +#else +#define GPM_DEFAULT_PRINT_FONT_BODY (const gchar*) "Monaco 10" +#endif + +#define GPM_DEFAULT_PRINT_FONT_HEADER (const gchar*) "Sans 11" +#define GPM_DEFAULT_PRINT_FONT_NUMBERS (const gchar*) "Sans 8" + +#define GPM_DEFAULT_MAX_RECENTS 5 + +#define GPM_DEFAULT_HIGHLIGHT_CURRENT_LINE 1 /* TRUE */ + +#define GPM_DEFAULT_BRACKET_MATCHING 0 /* FALSE */ + +#define GPM_DEFAULT_DISPLAY_RIGHT_MARGIN 0 /* FALSE */ +#define GPM_DEFAULT_RIGHT_MARGIN_POSITION 80 + +#define GPM_DEFAULT_SMART_HOME_END "AFTER" + +#define GPM_DEFAULT_SYNTAX_HL_ENABLE 1 /* TRUE */ + +#define GPM_DEFAULT_WRITABLE_VFS_SCHEMES {"ssh", "sftp", "smb", "dav", "davs", NULL} + +#define GPM_DEFAULT_RESTORE_CURSOR_POSITION 1 /* TRUE */ + +#define GPM_DEFAULT_SEARCH_HIGHLIGHTING_ENABLE 1 /* TRUE */ + +#define GPM_DEFAULT_SOURCE_STYLE_SCHEME "classic" + +typedef enum { + GEDIT_TOOLBAR_SYSTEM = 0, + GEDIT_TOOLBAR_ICONS, + GEDIT_TOOLBAR_ICONS_AND_TEXT, + GEDIT_TOOLBAR_ICONS_BOTH_HORIZ +} GeditToolbarSetting; + +/** LIFE CYCLE MANAGEMENT FUNCTIONS **/ + +gboolean gedit_prefs_manager_init (void); + +/* This function must be called before exiting gedit */ +void gedit_prefs_manager_shutdown (void); + + +/** PREFS MANAGEMENT FUNCTIONS **/ + +/* Use default font */ +gboolean gedit_prefs_manager_get_use_default_font (void); +void gedit_prefs_manager_set_use_default_font (gboolean udf); +gboolean gedit_prefs_manager_use_default_font_can_set (void); + +/* Editor font */ +gchar *gedit_prefs_manager_get_editor_font (void); +void gedit_prefs_manager_set_editor_font (const gchar *font); +gboolean gedit_prefs_manager_editor_font_can_set (void); + +/* System font */ +gchar *gedit_prefs_manager_get_system_font (void); + +/* Create backup copy */ +gboolean gedit_prefs_manager_get_create_backup_copy (void); +void gedit_prefs_manager_set_create_backup_copy (gboolean cbc); +gboolean gedit_prefs_manager_create_backup_copy_can_set (void); + +/* Auto save */ +gboolean gedit_prefs_manager_get_auto_save (void); +void gedit_prefs_manager_set_auto_save (gboolean as); +gboolean gedit_prefs_manager_auto_save_can_set (void); + +/* Auto save interval */ +gint gedit_prefs_manager_get_auto_save_interval (void); +void gedit_prefs_manager_set_auto_save_interval (gint asi); +gboolean gedit_prefs_manager_auto_save_interval_can_set (void); + +/* Undo actions limit: if < 1 then no limits */ +gint gedit_prefs_manager_get_undo_actions_limit (void); +void gedit_prefs_manager_set_undo_actions_limit (gint ual); +gboolean gedit_prefs_manager_undo_actions_limit_can_set (void); + +/* Wrap mode */ +GtkWrapMode gedit_prefs_manager_get_wrap_mode (void); +void gedit_prefs_manager_set_wrap_mode (GtkWrapMode wp); +gboolean gedit_prefs_manager_wrap_mode_can_set (void); + +/* Tabs size */ +gint gedit_prefs_manager_get_tabs_size (void); +void gedit_prefs_manager_set_tabs_size (gint ts); +gboolean gedit_prefs_manager_tabs_size_can_set (void); + +/* Insert spaces */ +gboolean gedit_prefs_manager_get_insert_spaces (void); +void gedit_prefs_manager_set_insert_spaces (gboolean ai); +gboolean gedit_prefs_manager_insert_spaces_can_set (void); + +/* Auto indent */ +gboolean gedit_prefs_manager_get_auto_indent (void); +void gedit_prefs_manager_set_auto_indent (gboolean ai); +gboolean gedit_prefs_manager_auto_indent_can_set (void); + +/* Display line numbers */ +gboolean gedit_prefs_manager_get_display_line_numbers (void); +void gedit_prefs_manager_set_display_line_numbers (gboolean dln); +gboolean gedit_prefs_manager_display_line_numbers_can_set (void); + +/* Toolbar visible */ +gboolean gedit_prefs_manager_get_toolbar_visible (void); +void gedit_prefs_manager_set_toolbar_visible (gboolean tv); +gboolean gedit_prefs_manager_toolbar_visible_can_set (void); + +/* Toolbar buttons style */ +GeditToolbarSetting gedit_prefs_manager_get_toolbar_buttons_style (void); +void gedit_prefs_manager_set_toolbar_buttons_style (GeditToolbarSetting tbs); +gboolean gedit_prefs_manager_toolbar_buttons_style_can_set (void); + +/* Statusbar visible */ +gboolean gedit_prefs_manager_get_statusbar_visible (void); +void gedit_prefs_manager_set_statusbar_visible (gboolean sv); +gboolean gedit_prefs_manager_statusbar_visible_can_set (void); + +/* Side pane visible */ +gboolean gedit_prefs_manager_get_side_pane_visible (void); +void gedit_prefs_manager_set_side_pane_visible (gboolean tv); +gboolean gedit_prefs_manager_side_pane_visible_can_set (void); + +/* Bottom panel visible */ +gboolean gedit_prefs_manager_get_bottom_panel_visible (void); +void gedit_prefs_manager_set_bottom_panel_visible (gboolean tv); +gboolean gedit_prefs_manager_bottom_panel_visible_can_set(void); +/* Print syntax highlighting */ +gboolean gedit_prefs_manager_get_print_syntax_hl (void); +void gedit_prefs_manager_set_print_syntax_hl (gboolean ps); +gboolean gedit_prefs_manager_print_syntax_hl_can_set (void); + +/* Print header */ +gboolean gedit_prefs_manager_get_print_header (void); +void gedit_prefs_manager_set_print_header (gboolean ph); +gboolean gedit_prefs_manager_print_header_can_set (void); + +/* Wrap mode while printing */ +GtkWrapMode gedit_prefs_manager_get_print_wrap_mode (void); +void gedit_prefs_manager_set_print_wrap_mode (GtkWrapMode pwm); +gboolean gedit_prefs_manager_print_wrap_mode_can_set (void); + +/* Print line numbers */ +gint gedit_prefs_manager_get_print_line_numbers (void); +void gedit_prefs_manager_set_print_line_numbers (gint pln); +gboolean gedit_prefs_manager_print_line_numbers_can_set (void); + +/* Font used to print the body of documents */ +gchar *gedit_prefs_manager_get_print_font_body (void); +void gedit_prefs_manager_set_print_font_body (const gchar *font); +gboolean gedit_prefs_manager_print_font_body_can_set (void); +const gchar *gedit_prefs_manager_get_default_print_font_body (void); + +/* Font used to print headers */ +gchar *gedit_prefs_manager_get_print_font_header (void); +void gedit_prefs_manager_set_print_font_header (const gchar *font); +gboolean gedit_prefs_manager_print_font_header_can_set (void); +const gchar *gedit_prefs_manager_get_default_print_font_header (void); + +/* Font used to print line numbers */ +gchar *gedit_prefs_manager_get_print_font_numbers (void); +void gedit_prefs_manager_set_print_font_numbers (const gchar *font); +gboolean gedit_prefs_manager_print_font_numbers_can_set (void); +const gchar *gedit_prefs_manager_get_default_print_font_numbers (void); + +/* Max number of files in "Recent Files" menu. + * This is configurable only using mateconftool or mateconf-editor + */ +gint gedit_prefs_manager_get_max_recents (void); + +/* Encodings */ +GSList *gedit_prefs_manager_get_auto_detected_encodings (void); + +GSList *gedit_prefs_manager_get_shown_in_menu_encodings (void); +void gedit_prefs_manager_set_shown_in_menu_encodings (const GSList *encs); +gboolean gedit_prefs_manager_shown_in_menu_encodings_can_set (void); + +/* Highlight current line */ +gboolean gedit_prefs_manager_get_highlight_current_line (void); +void gedit_prefs_manager_set_highlight_current_line (gboolean hl); +gboolean gedit_prefs_manager_highlight_current_line_can_set (void); + +/* Highlight matching bracket */ +gboolean gedit_prefs_manager_get_bracket_matching (void); +void gedit_prefs_manager_set_bracket_matching (gboolean bm); +gboolean gedit_prefs_manager_bracket_matching_can_set (void); + +/* Display right margin */ +gboolean gedit_prefs_manager_get_display_right_margin (void); +void gedit_prefs_manager_set_display_right_margin (gboolean drm); +gboolean gedit_prefs_manager_display_right_margin_can_set (void); + +/* Right margin position */ +gint gedit_prefs_manager_get_right_margin_position (void); +void gedit_prefs_manager_set_right_margin_position (gint rmp); +gboolean gedit_prefs_manager_right_margin_position_can_set (void); + +/* Smart home end */ +GtkSourceSmartHomeEndType + gedit_prefs_manager_get_smart_home_end (void); +void gedit_prefs_manager_set_smart_home_end (GtkSourceSmartHomeEndType smart_he); +gboolean gedit_prefs_manager_smart_home_end_can_set (void); + +/* Enable syntax highlighting */ +gboolean gedit_prefs_manager_get_enable_syntax_highlighting (void); +void gedit_prefs_manager_set_enable_syntax_highlighting (gboolean esh); +gboolean gedit_prefs_manager_enable_syntax_highlighting_can_set (void); + +/* Writable VFS schemes */ +GSList *gedit_prefs_manager_get_writable_vfs_schemes (void); + +/* Restore cursor position */ +gboolean gedit_prefs_manager_get_restore_cursor_position (void); + +/* Enable search highlighting */ +gboolean gedit_prefs_manager_get_enable_search_highlighting (void); +void gedit_prefs_manager_set_enable_search_highlighting (gboolean esh); +gboolean gedit_prefs_manager_enable_search_highlighting_can_set (void); + +/* Style scheme */ +gchar *gedit_prefs_manager_get_source_style_scheme (void); +void gedit_prefs_manager_set_source_style_scheme (const gchar *scheme); +gboolean gedit_prefs_manager_source_style_scheme_can_set(void); + +/* Plugins */ +GSList *gedit_prefs_manager_get_active_plugins (void); +void gedit_prefs_manager_set_active_plugins (const GSList *plugins); +gboolean gedit_prefs_manager_active_plugins_can_set (void); + +/* Global lockdown */ +GeditLockdownMask gedit_prefs_manager_get_lockdown (void); + +#endif /* __GEDIT_PREFS_MANAGER_H__ */ + + diff --git a/gedit/gedit-print-job.c b/gedit/gedit-print-job.c new file mode 100755 index 00000000..00acba27 --- /dev/null +++ b/gedit/gedit-print-job.c @@ -0,0 +1,865 @@ +/* + * gedit-print.c + * This file is part of gedit + * + * Copyright (C) 2000-2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2008 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id: gedit-print.c 6022 2007-12-09 14:38:57Z pborelli $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "gedit-print-job.h" +#include "gedit-debug.h" +#include "gedit-prefs-manager.h" +#include "gedit-print-preview.h" +#include "gedit-marshal.h" +#include "gedit-utils.h" +#include "gedit-dirs.h" + + +#define GEDIT_PRINT_JOB_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_PRINT_JOB, \ + GeditPrintJobPrivate)) + +struct _GeditPrintJobPrivate +{ + GeditView *view; + GeditDocument *doc; + + GtkPrintOperation *operation; + GtkSourcePrintCompositor *compositor; + + GtkPrintSettings *settings; + + GtkWidget *preview; + + GeditPrintJobStatus status; + + gchar *status_string; + + gdouble progress; + + gboolean is_preview; + + /* widgets part of the custom print preferences widget. + * These pointers are valid just when the dialog is displayed */ + GtkWidget *syntax_checkbutton; + GtkWidget *page_header_checkbutton; + GtkWidget *line_numbers_checkbutton; + GtkWidget *line_numbers_hbox; + GtkWidget *line_numbers_spinbutton; + GtkWidget *text_wrapping_checkbutton; + GtkWidget *do_not_split_checkbutton; + GtkWidget *fonts_table; + GtkWidget *body_font_label; + GtkWidget *headers_font_label; + GtkWidget *numbers_font_label; + GtkWidget *body_fontbutton; + GtkWidget *headers_fontbutton; + GtkWidget *numbers_fontbutton; + GtkWidget *restore_button; +}; + +enum +{ + PROP_0, + PROP_VIEW +}; + +enum +{ + PRINTING, + SHOW_PREVIEW, + DONE, + LAST_SIGNAL +}; + +static guint print_job_signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE (GeditPrintJob, gedit_print_job, G_TYPE_OBJECT) + +static void +set_view (GeditPrintJob *job, GeditView *view) +{ + job->priv->view = view; + job->priv->doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); +} + +static void +gedit_print_job_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditPrintJob *job = GEDIT_PRINT_JOB (object); + + switch (prop_id) + { + case PROP_VIEW: + g_value_set_object (value, job->priv->view); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_print_job_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditPrintJob *job = GEDIT_PRINT_JOB (object); + + switch (prop_id) + { + case PROP_VIEW: + set_view (job, g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_print_job_finalize (GObject *object) +{ + GeditPrintJob *job = GEDIT_PRINT_JOB (object); + + g_free (job->priv->status_string); + + if (job->priv->compositor != NULL) + g_object_unref (job->priv->compositor); + + if (job->priv->operation != NULL) + g_object_unref (job->priv->operation); + + G_OBJECT_CLASS (gedit_print_job_parent_class)->finalize (object); +} + +static void +gedit_print_job_class_init (GeditPrintJobClass *klass) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (klass); + + object_class->get_property = gedit_print_job_get_property; + object_class->set_property = gedit_print_job_set_property; + object_class->finalize = gedit_print_job_finalize; + + g_object_class_install_property (object_class, + PROP_VIEW, + g_param_spec_object ("view", + "Gedit View", + "Gedit View to print", + GEDIT_TYPE_VIEW, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS | + G_PARAM_CONSTRUCT_ONLY)); + + print_job_signals[PRINTING] = + g_signal_new ("printing", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditPrintJobClass, printing), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, + 1, + G_TYPE_UINT); + + print_job_signals[SHOW_PREVIEW] = + g_signal_new ("show-preview", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditPrintJobClass, show_preview), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GTK_TYPE_WIDGET); + + print_job_signals[DONE] = + g_signal_new ("done", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditPrintJobClass, done), + NULL, NULL, + gedit_marshal_VOID__UINT_POINTER, + G_TYPE_NONE, + 2, + G_TYPE_UINT, + G_TYPE_POINTER); + + g_type_class_add_private (object_class, sizeof (GeditPrintJobPrivate)); +} + +static void +line_numbers_checkbutton_toggled (GtkToggleButton *button, + GeditPrintJob *job) +{ + if (gtk_toggle_button_get_active (button)) + { + gtk_widget_set_sensitive (job->priv->line_numbers_hbox, + gedit_prefs_manager_print_line_numbers_can_set ()); + } + else + { + gtk_widget_set_sensitive (job->priv->line_numbers_hbox, FALSE); + } +} + +static void +wrap_mode_checkbutton_toggled (GtkToggleButton *button, + GeditPrintJob *job) +{ + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->text_wrapping_checkbutton))) + { + gtk_widget_set_sensitive (job->priv->do_not_split_checkbutton, + FALSE); + gtk_toggle_button_set_inconsistent ( + GTK_TOGGLE_BUTTON (job->priv->do_not_split_checkbutton), + TRUE); + } + else + { + gtk_widget_set_sensitive (job->priv->do_not_split_checkbutton, + TRUE); + gtk_toggle_button_set_inconsistent ( + GTK_TOGGLE_BUTTON (job->priv->do_not_split_checkbutton), + FALSE); + } +} + +static void +restore_button_clicked (GtkButton *button, + GeditPrintJob *job) + +{ + if (gedit_prefs_manager_print_font_body_can_set ()) + { + const gchar *font; + + font = gedit_prefs_manager_get_default_print_font_body (); + + gtk_font_button_set_font_name ( + GTK_FONT_BUTTON (job->priv->body_fontbutton), + font); + } + + if (gedit_prefs_manager_print_font_header_can_set ()) + { + const gchar *font; + + font = gedit_prefs_manager_get_default_print_font_header (); + + gtk_font_button_set_font_name ( + GTK_FONT_BUTTON (job->priv->headers_fontbutton), + font); + } + + if (gedit_prefs_manager_print_font_numbers_can_set ()) + { + const gchar *font; + + font = gedit_prefs_manager_get_default_print_font_numbers (); + + gtk_font_button_set_font_name ( + GTK_FONT_BUTTON (job->priv->numbers_fontbutton), + font); + } +} + +static GObject * +create_custom_widget_cb (GtkPrintOperation *operation, + GeditPrintJob *job) +{ + gboolean ret; + GtkWidget *widget; + GtkWidget *error_widget; + gchar *font; + gint line_numbers; + gboolean can_set; + GtkWrapMode wrap_mode; + gchar *file; + gchar *root_objects[] = { + "adjustment1", + "contents", + NULL + }; + + file = gedit_dirs_get_ui_file ("gedit-print-preferences.ui"); + ret = gedit_utils_get_ui_objects (file, + root_objects, + &error_widget, + "contents", &widget, + "syntax_checkbutton", &job->priv->syntax_checkbutton, + "line_numbers_checkbutton", &job->priv->line_numbers_checkbutton, + "line_numbers_hbox", &job->priv->line_numbers_hbox, + "line_numbers_spinbutton", &job->priv->line_numbers_spinbutton, + "page_header_checkbutton", &job->priv->page_header_checkbutton, + "text_wrapping_checkbutton", &job->priv->text_wrapping_checkbutton, + "do_not_split_checkbutton", &job->priv->do_not_split_checkbutton, + "fonts_table", &job->priv->fonts_table, + "body_font_label", &job->priv->body_font_label, + "body_fontbutton", &job->priv->body_fontbutton, + "headers_font_label", &job->priv->headers_font_label, + "headers_fontbutton", &job->priv->headers_fontbutton, + "numbers_font_label", &job->priv->numbers_font_label, + "numbers_fontbutton", &job->priv->numbers_fontbutton, + "restore_button", &job->priv->restore_button, + NULL); + g_free (file); + + if (!ret) + { + return G_OBJECT (error_widget); + } + + /* Print syntax */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (job->priv->syntax_checkbutton), + gedit_prefs_manager_get_print_syntax_hl ()); + gtk_widget_set_sensitive (job->priv->syntax_checkbutton, + gedit_prefs_manager_print_syntax_hl_can_set ()); + + /* Print page headers */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (job->priv->page_header_checkbutton), + gedit_prefs_manager_get_print_header ()); + gtk_widget_set_sensitive (job->priv->page_header_checkbutton, + gedit_prefs_manager_print_header_can_set ()); + + /* Line numbers */ + line_numbers = gedit_prefs_manager_get_print_line_numbers (); + can_set = gedit_prefs_manager_print_line_numbers_can_set (); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (job->priv->line_numbers_checkbutton), + line_numbers > 0); + gtk_widget_set_sensitive (job->priv->line_numbers_checkbutton, can_set); + + if (line_numbers > 0) + { + gtk_spin_button_set_value (GTK_SPIN_BUTTON (job->priv->line_numbers_spinbutton), + (guint) line_numbers); + gtk_widget_set_sensitive (job->priv->line_numbers_hbox, can_set); + } + else + { + gtk_spin_button_set_value (GTK_SPIN_BUTTON (job->priv->line_numbers_spinbutton), + 1); + gtk_widget_set_sensitive (job->priv->line_numbers_hbox, FALSE); + } + + /* Text wrapping */ + wrap_mode = gedit_prefs_manager_get_print_wrap_mode (); + + switch (wrap_mode) + { + case GTK_WRAP_WORD: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (job->priv->text_wrapping_checkbutton), TRUE); + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (job->priv->do_not_split_checkbutton), TRUE); + break; + case GTK_WRAP_CHAR: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (job->priv->text_wrapping_checkbutton), TRUE); + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (job->priv->do_not_split_checkbutton), FALSE); + break; + default: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (job->priv->text_wrapping_checkbutton), FALSE); + gtk_toggle_button_set_inconsistent ( + GTK_TOGGLE_BUTTON (job->priv->do_not_split_checkbutton), TRUE); + } + + can_set = gedit_prefs_manager_print_wrap_mode_can_set (); + + gtk_widget_set_sensitive (job->priv->text_wrapping_checkbutton, can_set); + gtk_widget_set_sensitive (job->priv->do_not_split_checkbutton, + can_set && (wrap_mode != GTK_WRAP_NONE)); + + /* Set initial values */ + font = gedit_prefs_manager_get_print_font_body (); + gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->body_fontbutton), + font); + g_free (font); + + font = gedit_prefs_manager_get_print_font_header (); + gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->headers_fontbutton), + font); + g_free (font); + + font = gedit_prefs_manager_get_print_font_numbers (); + gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->numbers_fontbutton), + font); + g_free (font); + + can_set = gedit_prefs_manager_print_font_body_can_set (); + gtk_widget_set_sensitive (job->priv->body_fontbutton, can_set); + gtk_widget_set_sensitive (job->priv->body_font_label, can_set); + + can_set = gedit_prefs_manager_print_font_header_can_set (); + gtk_widget_set_sensitive (job->priv->headers_fontbutton, can_set); + gtk_widget_set_sensitive (job->priv->headers_font_label, can_set); + + can_set = gedit_prefs_manager_print_font_numbers_can_set (); + gtk_widget_set_sensitive (job->priv->numbers_fontbutton, can_set); + gtk_widget_set_sensitive (job->priv->numbers_font_label, can_set); + + g_signal_connect (job->priv->line_numbers_checkbutton, + "toggled", + G_CALLBACK (line_numbers_checkbutton_toggled), + job); + g_signal_connect (job->priv->text_wrapping_checkbutton, + "toggled", + G_CALLBACK (wrap_mode_checkbutton_toggled), + job); + g_signal_connect (job->priv->do_not_split_checkbutton, + "toggled", + G_CALLBACK (wrap_mode_checkbutton_toggled), + job); + g_signal_connect (job->priv->restore_button, + "clicked", + G_CALLBACK (restore_button_clicked), + job); + + return G_OBJECT (widget); +} + +static void +custom_widget_apply_cb (GtkPrintOperation *operation, + GtkWidget *widget, + GeditPrintJob *job) +{ + gedit_prefs_manager_set_print_syntax_hl (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->syntax_checkbutton))); + + gedit_prefs_manager_set_print_header (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->page_header_checkbutton))); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->line_numbers_checkbutton))) + { + gedit_prefs_manager_set_print_line_numbers ( + MAX (1, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (job->priv->line_numbers_spinbutton)))); + } + else + { + gedit_prefs_manager_set_print_line_numbers (0); + } + + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->text_wrapping_checkbutton))) + { + gedit_prefs_manager_set_print_wrap_mode (GTK_WRAP_NONE); + } + else + { + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->do_not_split_checkbutton))) + { + gedit_prefs_manager_set_print_wrap_mode (GTK_WRAP_WORD); + } + else + { + gedit_prefs_manager_set_print_wrap_mode (GTK_WRAP_CHAR); + } + } + + gedit_prefs_manager_set_print_font_body (gtk_font_button_get_font_name (GTK_FONT_BUTTON (job->priv->body_fontbutton))); + gedit_prefs_manager_set_print_font_header (gtk_font_button_get_font_name (GTK_FONT_BUTTON (job->priv->headers_fontbutton))); + gedit_prefs_manager_set_print_font_numbers (gtk_font_button_get_font_name (GTK_FONT_BUTTON (job->priv->numbers_fontbutton))); +} + +static void +create_compositor (GeditPrintJob *job) +{ + gchar *print_font_body; + gchar *print_font_header; + gchar *print_font_numbers; + + /* Create and initialize print compositor */ + print_font_body = gedit_prefs_manager_get_print_font_body (); + print_font_header = gedit_prefs_manager_get_print_font_header (); + print_font_numbers = gedit_prefs_manager_get_print_font_numbers (); + + job->priv->compositor = GTK_SOURCE_PRINT_COMPOSITOR ( + g_object_new (GTK_TYPE_SOURCE_PRINT_COMPOSITOR, + "buffer", GTK_SOURCE_BUFFER (job->priv->doc), + "tab-width", gtk_source_view_get_tab_width (GTK_SOURCE_VIEW (job->priv->view)), + "highlight-syntax", gtk_source_buffer_get_highlight_syntax (GTK_SOURCE_BUFFER (job->priv->doc)) && + gedit_prefs_manager_get_print_syntax_hl (), + "wrap-mode", gedit_prefs_manager_get_print_wrap_mode (), + "print-line-numbers", gedit_prefs_manager_get_print_line_numbers (), + "print-header", gedit_prefs_manager_get_print_header (), + "print-footer", FALSE, + "body-font-name", print_font_body, + "line-numbers-font-name", print_font_numbers, + "header-font-name", print_font_header, + NULL)); + + g_free (print_font_body); + g_free (print_font_header); + g_free (print_font_numbers); + + if (gedit_prefs_manager_get_print_header ()) + { + gchar *doc_name; + gchar *name_to_display; + gchar *left; + + doc_name = gedit_document_get_uri_for_display (job->priv->doc); + name_to_display = gedit_utils_str_middle_truncate (doc_name, 60); + + left = g_strdup_printf (_("File: %s"), name_to_display); + + /* Translators: %N is the current page number, %Q is the total + * number of pages (ex. Page 2 of 10) + */ + gtk_source_print_compositor_set_header_format (job->priv->compositor, + TRUE, + left, + NULL, + _("Page %N of %Q")); + + g_free (doc_name); + g_free (name_to_display); + g_free (left); + } +} + +static void +begin_print_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + GeditPrintJob *job) +{ + create_compositor (job); + + job->priv->status = GEDIT_PRINT_JOB_STATUS_PAGINATING; + + job->priv->progress = 0.0; + + g_signal_emit (job, print_job_signals[PRINTING], 0, job->priv->status); +} + +static void +preview_ready (GtkPrintOperationPreview *gtk_preview, + GtkPrintContext *context, + GeditPrintJob *job) +{ + job->priv->is_preview = TRUE; + + g_signal_emit (job, print_job_signals[SHOW_PREVIEW], 0, job->priv->preview); +} + +static void +preview_destroyed (GtkWidget *preview, + GtkPrintOperationPreview *gtk_preview) +{ + gtk_print_operation_preview_end_preview (gtk_preview); +} + +static gboolean +preview_cb (GtkPrintOperation *op, + GtkPrintOperationPreview *gtk_preview, + GtkPrintContext *context, + GtkWindow *parent, + GeditPrintJob *job) +{ + job->priv->preview = gedit_print_preview_new (op, gtk_preview, context); + + g_signal_connect_after (gtk_preview, + "ready", + G_CALLBACK (preview_ready), + job); + + /* FIXME: should this go in the preview widget itself? */ + g_signal_connect (job->priv->preview, + "destroy", + G_CALLBACK (preview_destroyed), + gtk_preview); + + return TRUE; +} + +static gboolean +paginate_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + GeditPrintJob *job) +{ + gboolean res; + + job->priv->status = GEDIT_PRINT_JOB_STATUS_PAGINATING; + + res = gtk_source_print_compositor_paginate (job->priv->compositor, context); + + if (res) + { + gint n_pages; + + n_pages = gtk_source_print_compositor_get_n_pages (job->priv->compositor); + gtk_print_operation_set_n_pages (job->priv->operation, n_pages); + } + + job->priv->progress = gtk_source_print_compositor_get_pagination_progress (job->priv->compositor); + + /* When previewing, the progress is just for pagination, when printing + * it's split between pagination and rendering */ + if (!job->priv->is_preview) + job->priv->progress /= 2.0; + + g_signal_emit (job, print_job_signals[PRINTING], 0, job->priv->status); + + return res; +} + +static void +draw_page_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + gint page_nr, + GeditPrintJob *job) +{ + gint n_pages; + + /* In preview, pages are drawn on the fly, so rendering is + * not part of the progress */ + if (!job->priv->is_preview) + { + g_free (job->priv->status_string); + + n_pages = gtk_source_print_compositor_get_n_pages (job->priv->compositor); + + job->priv->status = GEDIT_PRINT_JOB_STATUS_DRAWING; + + job->priv->status_string = g_strdup_printf ("Rendering page %d of %d...", + page_nr + 1, + n_pages); + + job->priv->progress = page_nr / (2.0 * n_pages) + 0.5; + + g_signal_emit (job, print_job_signals[PRINTING], 0, job->priv->status); + } + + gtk_source_print_compositor_draw_page (job->priv->compositor, context, page_nr); +} + +static void +end_print_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + GeditPrintJob *job) +{ + g_object_unref (job->priv->compositor); + job->priv->compositor = NULL; +} + +static void +done_cb (GtkPrintOperation *operation, + GtkPrintOperationResult result, + GeditPrintJob *job) +{ + GError *error = NULL; + GeditPrintJobResult print_result; + + switch (result) + { + case GTK_PRINT_OPERATION_RESULT_CANCEL: + print_result = GEDIT_PRINT_JOB_RESULT_CANCEL; + break; + + case GTK_PRINT_OPERATION_RESULT_APPLY: + print_result = GEDIT_PRINT_JOB_RESULT_OK; + break; + + case GTK_PRINT_OPERATION_RESULT_ERROR: + print_result = GEDIT_PRINT_JOB_RESULT_ERROR; + gtk_print_operation_get_error (operation, &error); + break; + + default: + g_return_if_reached (); + } + + /* Avoid job is destroyed in the handler of the "done" message */ + g_object_ref (job); + + g_signal_emit (job, print_job_signals[DONE], 0, print_result, error); + + g_object_unref (operation); + job->priv->operation = NULL; + + g_object_unref (job); +} + +/* Note that gedit_print_job_print can can only be called once on a given GeditPrintJob */ +GtkPrintOperationResult +gedit_print_job_print (GeditPrintJob *job, + GtkPrintOperationAction action, + GtkPageSetup *page_setup, + GtkPrintSettings *settings, + GtkWindow *parent, + GError **error) +{ + GeditPrintJobPrivate *priv; + gchar *job_name; + + g_return_val_if_fail (job->priv->compositor == NULL, GTK_PRINT_OPERATION_RESULT_ERROR); + + priv = job->priv; + + /* Check if we are previewing */ + priv->is_preview = (action == GTK_PRINT_OPERATION_ACTION_PREVIEW); + + /* Create print operation */ + job->priv->operation = gtk_print_operation_new (); + + if (settings) + gtk_print_operation_set_print_settings (priv->operation, + settings); + + if (page_setup != NULL) + gtk_print_operation_set_default_page_setup (priv->operation, + page_setup); + + job_name = gedit_document_get_short_name_for_display (priv->doc); + gtk_print_operation_set_job_name (priv->operation, job_name); + g_free (job_name); + +#if GTK_CHECK_VERSION (2, 17, 4) + gtk_print_operation_set_embed_page_setup (priv->operation, TRUE); +#endif + + gtk_print_operation_set_custom_tab_label (priv->operation, + _("Text Editor")); + + gtk_print_operation_set_allow_async (priv->operation, TRUE); + + g_signal_connect (priv->operation, + "create-custom-widget", + G_CALLBACK (create_custom_widget_cb), + job); + g_signal_connect (priv->operation, + "custom-widget-apply", + G_CALLBACK (custom_widget_apply_cb), + job); + g_signal_connect (priv->operation, + "begin-print", + G_CALLBACK (begin_print_cb), + job); + g_signal_connect (priv->operation, + "preview", + G_CALLBACK (preview_cb), + job); + g_signal_connect (priv->operation, + "paginate", + G_CALLBACK (paginate_cb), + job); + g_signal_connect (priv->operation, + "draw-page", + G_CALLBACK (draw_page_cb), + job); + g_signal_connect (priv->operation, + "end-print", + G_CALLBACK (end_print_cb), + job); + g_signal_connect (priv->operation, + "done", + G_CALLBACK (done_cb), + job); + + return gtk_print_operation_run (priv->operation, + action, + parent, + error); +} + +static void +gedit_print_job_init (GeditPrintJob *job) +{ + job->priv = GEDIT_PRINT_JOB_GET_PRIVATE (job); + + job->priv->status = GEDIT_PRINT_JOB_STATUS_INIT; + + job->priv->status_string = g_strdup (_("Preparing...")); +} + +GeditPrintJob * +gedit_print_job_new (GeditView *view) +{ + GeditPrintJob *job; + + g_return_val_if_fail (GEDIT_IS_VIEW (view), NULL); + + job = GEDIT_PRINT_JOB (g_object_new (GEDIT_TYPE_PRINT_JOB, + "view", view, + NULL)); + + return job; +} + +void +gedit_print_job_cancel (GeditPrintJob *job) +{ + g_return_if_fail (GEDIT_IS_PRINT_JOB (job)); + + gtk_print_operation_cancel (job->priv->operation); +} + +const gchar * +gedit_print_job_get_status_string (GeditPrintJob *job) +{ + g_return_val_if_fail (GEDIT_IS_PRINT_JOB (job), NULL); + g_return_val_if_fail (job->priv->status_string != NULL, NULL); + + return job->priv->status_string; +} + +gdouble +gedit_print_job_get_progress (GeditPrintJob *job) +{ + g_return_val_if_fail (GEDIT_IS_PRINT_JOB (job), 0.0); + + return job->priv->progress; +} + +GtkPrintSettings * +gedit_print_job_get_print_settings (GeditPrintJob *job) +{ + g_return_val_if_fail (GEDIT_IS_PRINT_JOB (job), NULL); + + return gtk_print_operation_get_print_settings (job->priv->operation); +} + +GtkPageSetup * +gedit_print_job_get_page_setup (GeditPrintJob *job) +{ + g_return_val_if_fail (GEDIT_IS_PRINT_JOB (job), NULL); + + return gtk_print_operation_get_default_page_setup (job->priv->operation); +} diff --git a/gedit/gedit-print-job.h b/gedit/gedit-print-job.h new file mode 100755 index 00000000..956dc730 --- /dev/null +++ b/gedit/gedit-print-job.h @@ -0,0 +1,133 @@ +/* + * gedit-print-job.h + * This file is part of gedit + * + * Copyright (C) 2000-2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2008 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PRINT_JOB_H__ +#define __GEDIT_PRINT_JOB_H__ + +#include +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_PRINT_JOB (gedit_print_job_get_type()) +#define GEDIT_PRINT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PRINT_JOB, GeditPrintJob)) +#define GEDIT_PRINT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PRINT_JOB, GeditPrintJobClass)) +#define GEDIT_IS_PRINT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PRINT_JOB)) +#define GEDIT_IS_PRINT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PRINT_JOB)) +#define GEDIT_PRINT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PRINT_JOB, GeditPrintJobClass)) + + +typedef enum +{ + GEDIT_PRINT_JOB_STATUS_INIT, + GEDIT_PRINT_JOB_STATUS_PAGINATING, + GEDIT_PRINT_JOB_STATUS_DRAWING, + GEDIT_PRINT_JOB_STATUS_DONE +} GeditPrintJobStatus; + +typedef enum +{ + GEDIT_PRINT_JOB_RESULT_OK, + GEDIT_PRINT_JOB_RESULT_CANCEL, + GEDIT_PRINT_JOB_RESULT_ERROR +} GeditPrintJobResult; + +/* Private structure type */ +typedef struct _GeditPrintJobPrivate GeditPrintJobPrivate; + +/* + * Main object structure + */ +typedef struct _GeditPrintJob GeditPrintJob; + + +struct _GeditPrintJob +{ + GObject parent; + + /* */ + GeditPrintJobPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditPrintJobClass GeditPrintJobClass; + +struct _GeditPrintJobClass +{ + GObjectClass parent_class; + + /* Signals */ + void (* printing) (GeditPrintJob *job, + GeditPrintJobStatus status); + + void (* show_preview) (GeditPrintJob *job, + GtkWidget *preview); + + void (*done) (GeditPrintJob *job, + GeditPrintJobResult result, + const GError *error); +}; + +/* + * Public methods + */ +GType gedit_print_job_get_type (void) G_GNUC_CONST; + +GeditPrintJob *gedit_print_job_new (GeditView *view); + +void gedit_print_job_set_export_filename (GeditPrintJob *job, + const gchar *filename); + +GtkPrintOperationResult gedit_print_job_print (GeditPrintJob *job, + GtkPrintOperationAction action, + GtkPageSetup *page_setup, + GtkPrintSettings *settings, + GtkWindow *parent, + GError **error); + +void gedit_print_job_cancel (GeditPrintJob *job); + +const gchar *gedit_print_job_get_status_string (GeditPrintJob *job); + +gdouble gedit_print_job_get_progress (GeditPrintJob *job); + +GtkPrintSettings *gedit_print_job_get_print_settings (GeditPrintJob *job); + +GtkPageSetup *gedit_print_job_get_page_setup (GeditPrintJob *job); + +G_END_DECLS + +#endif /* __GEDIT_PRINT_JOB_H__ */ diff --git a/gedit/gedit-print-preferences.ui b/gedit/gedit-print-preferences.ui new file mode 100755 index 00000000..3917eeba --- /dev/null +++ b/gedit/gedit-print-preferences.ui @@ -0,0 +1,497 @@ + + + + + + 1 + 1 + 100 + 1 + 10 + + + True + window1 + + + True + 12 + 18 + + + True + vertical + 18 + + + True + vertical + 6 + + + True + 0 + Syntax Highlighting + + + + + + False + False + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + Print synta_x highlighting + True + True + False + True + True + + + + + 1 + + + + + False + 0 + + + + + True + vertical + 6 + + + True + 0 + Line Numbers + + + + + + False + False + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + True + vertical + 6 + + + Print line nu_mbers + True + True + False + True + True + + + False + False + 0 + + + + + True + 6 + + + True + 0.47999998927116394 + _Number every + True + line_numbers_spinbutton + + + False + False + 0 + + + + + True + True + adjustment1 + 1 + + + False + False + 1 + + + + + True + lines + + + False + False + 2 + + + + + False + False + 1 + + + + + + + 1 + + + + + False + 1 + + + + + True + vertical + 6 + + + True + 0 + Text Wrapping + + + + + + False + False + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + True + vertical + 6 + + + Enable text _wrapping + True + True + False + True + True + + + False + False + 0 + + + + + True + + + Do not _split words over two lines + True + True + False + True + True + + + False + False + 0 + + + + + 1 + + + + + + + 1 + + + + + False + False + 2 + + + + + True + vertical + 6 + + + True + 0 + Page header + + + + + + False + False + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + Print page _headers + True + True + False + True + True + + + + + False + 1 + + + + + 3 + + + + + False + 0 + + + + + True + vertical + 18 + + + True + vertical + 6 + + + True + 0 + Fonts + + + + + + False + False + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + True + vertical + 12 + + + True + 3 + 2 + 12 + 12 + + + True + 0 + _Body: + True + body_fontbutton + + + GTK_FILL + + + + + + True + 0 + _Line numbers: + True + numbers_fontbutton + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + He_aders and footers: + True + headers_fontbutton + + + 2 + 3 + GTK_FILL + + + + + + True + True + False + True + False + + + 1 + 2 + + + + + + True + True + False + True + False + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + + True + True + False + True + False + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + end + + + _Restore Default Fonts + True + True + False + True + + + False + False + 0 + + + + + 1 + + + + + + + False + 1 + + + + + 0 + + + + + False + False + 1 + + + + + + diff --git a/gedit/gedit-print-preview.c b/gedit/gedit-print-preview.c new file mode 100755 index 00000000..293a930b --- /dev/null +++ b/gedit/gedit-print-preview.c @@ -0,0 +1,1327 @@ +/* + * gedit-print-preview.c + * + * Copyright (C) 2008 Paolo Borelli + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id: gedit-commands-search.c 5931 2007-09-25 20:05:40Z pborelli $ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include + +#include "gedit-print-preview.h" + +#define PRINTER_DPI (72.) + +struct _GeditPrintPreviewPrivate +{ + GtkPrintOperation *operation; + GtkPrintContext *context; + GtkPrintOperationPreview *gtk_preview; + + GtkWidget *layout; + GtkWidget *scrolled_window; + + GtkToolItem *next; + GtkToolItem *prev; + GtkWidget *page_entry; + GtkWidget *last; + GtkToolItem *multi; + GtkToolItem *zoom_one; + GtkToolItem *zoom_fit; + GtkToolItem *zoom_in; + GtkToolItem *zoom_out; + + /* real size of the page in inches */ + double paper_w; + double paper_h; + double dpi; + + double scale; + + /* size of the tile of a page (including padding + * and drop shadow) in pixels */ + gint tile_w; + gint tile_h; + + GtkPageOrientation orientation; + + /* multipage support */ + gint rows; + gint cols; + + guint n_pages; + guint cur_page; +}; + +G_DEFINE_TYPE (GeditPrintPreview, gedit_print_preview, GTK_TYPE_VBOX) + +static void +gedit_print_preview_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + //GeditPrintPreview *preview = GEDIT_PRINT_PREVIEW (object); + + switch (prop_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_print_preview_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + //GeditPrintPreview *preview = GEDIT_PRINT_PREVIEW (object); + + switch (prop_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_print_preview_finalize (GObject *object) +{ + //GeditPrintPreview *preview = GEDIT_PRINT_PREVIEW (object); + + G_OBJECT_CLASS (gedit_print_preview_parent_class)->finalize (object); +} + +static void +gedit_print_preview_grab_focus (GtkWidget *widget) +{ + GeditPrintPreview *preview; + + preview = GEDIT_PRINT_PREVIEW (widget); + + gtk_widget_grab_focus (GTK_WIDGET (preview->priv->layout)); +} + +static void +gedit_print_preview_class_init (GeditPrintPreviewClass *klass) +{ + GObjectClass *object_class; + GtkWidgetClass *widget_class; + + object_class = G_OBJECT_CLASS (klass); + widget_class = GTK_WIDGET_CLASS (klass); + + object_class->get_property = gedit_print_preview_get_property; + object_class->set_property = gedit_print_preview_set_property; + object_class->finalize = gedit_print_preview_finalize; + + widget_class->grab_focus = gedit_print_preview_grab_focus; + + g_type_class_add_private (object_class, sizeof(GeditPrintPreviewPrivate)); +} + +static void +update_layout_size (GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + + priv = preview->priv; + + /* force size of the drawing area to make the scrolled window work */ + gtk_layout_set_size (GTK_LAYOUT (priv->layout), + priv->tile_w * priv->cols, + priv->tile_h * priv->rows); + + gtk_widget_queue_draw (preview->priv->layout); +} + +static void +set_rows_and_cols (GeditPrintPreview *preview, + gint rows, + gint cols) +{ + /* TODO: set the zoom appropriately */ + + preview->priv->rows = rows; + preview->priv->cols = cols; + update_layout_size (preview); +} + +/* get the paper size in points: these must be used only + * after the widget has been mapped and the dpi is known */ + +static double +get_paper_width (GeditPrintPreview *preview) +{ + return preview->priv->paper_w * preview->priv->dpi; +} + +static double +get_paper_height (GeditPrintPreview *preview) +{ + return preview->priv->paper_h * preview->priv->dpi; +} + +#define PAGE_PAD 12 +#define PAGE_SHADOW_OFFSET 5 + +/* The tile size is the size of the area where a page + * will be drawn including the padding and idependent + * of the orientation */ + +/* updates the tile size to the current zoom and page size */ +static void +update_tile_size (GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + gint w, h; + + priv = preview->priv; + + w = 2 * PAGE_PAD + floor (priv->scale * get_paper_width (preview) + 0.5); + h = 2 * PAGE_PAD + floor (priv->scale * get_paper_height (preview) + 0.5); + + if ((priv->orientation == GTK_PAGE_ORIENTATION_LANDSCAPE) || + (priv->orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE)) + { + priv->tile_w = h; + priv->tile_h = w; + } + else + { + priv->tile_w = w; + priv->tile_h = h; + } +} + +/* Zoom should always be set with one of these two function + * so that the tile size is properly updated */ + +static void +set_zoom_factor (GeditPrintPreview *preview, + double zoom) +{ + GeditPrintPreviewPrivate *priv; + + priv = preview->priv; + + priv->scale = zoom; + + update_tile_size (preview); + update_layout_size (preview); +} + +static void +set_zoom_fit_to_size (GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + double width, height; + double p_width, p_height; + double zoomx, zoomy; + + priv = preview->priv; + + g_object_get (gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)), + "page-size", &width, + NULL); + g_object_get (gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)), + "page-size", &height, + NULL); + + width /= priv->cols; + height /= priv->rows; + + if ((priv->orientation == GTK_PAGE_ORIENTATION_LANDSCAPE) || + (priv->orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE)) + { + p_width = get_paper_height (preview); + p_height = get_paper_width (preview); + } + else + { + p_width = get_paper_width (preview); + p_height = get_paper_height (preview); + } + + zoomx = MAX (1, width - 2 * PAGE_PAD) / p_width; + zoomy = MAX (1, height - 2 * PAGE_PAD) / p_height; + + if (zoomx <= zoomy) + { + priv->tile_w = width; + priv->tile_h = floor (0.5 + width * (p_height / p_width)); + priv->scale = zoomx; + } + else + { + priv->tile_w = floor (0.5 + height * (p_width / p_height)); + priv->tile_h = height; + priv->scale = zoomy; + } + + update_layout_size (preview); +} + +#define ZOOM_IN_FACTOR (1.2) +#define ZOOM_OUT_FACTOR (1.0 / ZOOM_IN_FACTOR) + +static void +zoom_in (GeditPrintPreview *preview) +{ + set_zoom_factor (preview, + preview->priv->scale * ZOOM_IN_FACTOR); +} + +static void +zoom_out (GeditPrintPreview *preview) +{ + set_zoom_factor (preview, + preview->priv->scale * ZOOM_OUT_FACTOR); +} + +static void +goto_page (GeditPrintPreview *preview, gint page) +{ + gchar c[32]; + + g_snprintf (c, 32, "%d", page + 1); + gtk_entry_set_text (GTK_ENTRY (preview->priv->page_entry), c); + + gtk_widget_set_sensitive (GTK_WIDGET (preview->priv->prev), + (page > 0) && (preview->priv->n_pages > 1)); + gtk_widget_set_sensitive (GTK_WIDGET (preview->priv->next), + (page != (preview->priv->n_pages - 1)) && + (preview->priv->n_pages > 1)); + + if (page != preview->priv->cur_page) + { + preview->priv->cur_page = page; + if (preview->priv->n_pages > 0) + gtk_widget_queue_draw (preview->priv->layout); + } +} + +static void +prev_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + GdkEvent *event; + gint page; + + event = gtk_get_current_event (); + + if (event->button.state & GDK_SHIFT_MASK) + page = 0; + else + page = preview->priv->cur_page - preview->priv->rows * preview->priv->cols; + + goto_page (preview, MAX (page, 0)); + + gdk_event_free (event); +} + +static void +next_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + GdkEvent *event; + gint page; + + event = gtk_get_current_event (); + + if (event->button.state & GDK_SHIFT_MASK) + page = preview->priv->n_pages - 1; + else + page = preview->priv->cur_page + preview->priv->rows * preview->priv->cols; + + goto_page (preview, MIN (page, preview->priv->n_pages - 1)); + + gdk_event_free (event); +} + +static void +page_entry_activated (GtkEntry *entry, + GeditPrintPreview *preview) +{ + const gchar *text; + gint page; + + text = gtk_entry_get_text (entry); + + page = CLAMP (atoi (text), 1, preview->priv->n_pages) - 1; + goto_page (preview, page); + + gtk_widget_grab_focus (GTK_WIDGET (preview->priv->layout)); +} + +static void +page_entry_insert_text (GtkEditable *editable, + const gchar *text, + gint length, + gint *position) +{ + gunichar c; + const gchar *p; + const gchar *end; + + p = text; + end = text + length; + + while (p != end) + { + const gchar *next; + next = g_utf8_next_char (p); + + c = g_utf8_get_char (p); + + if (!g_unichar_isdigit (c)) + { + g_signal_stop_emission_by_name (editable, "insert-text"); + break; + } + + p = next; + } +} + +static gboolean +page_entry_focus_out (GtkWidget *widget, + GdkEventFocus *event, + GeditPrintPreview *preview) +{ + const gchar *text; + gint page; + + text = gtk_entry_get_text (GTK_ENTRY (widget)); + page = atoi (text) - 1; + + /* Reset the page number only if really needed */ + if (page != preview->priv->cur_page) + { + gchar *str; + + str = g_strdup_printf ("%d", preview->priv->cur_page + 1); + gtk_entry_set_text (GTK_ENTRY (widget), str); + g_free (str); + } + + return FALSE; +} + +static void +on_1x1_clicked (GtkMenuItem *i, GeditPrintPreview *preview) +{ + set_rows_and_cols (preview, 1, 1); +} + +static void +on_1x2_clicked (GtkMenuItem *i, GeditPrintPreview *preview) +{ + set_rows_and_cols (preview, 1, 2); +} + +static void +on_2x1_clicked (GtkMenuItem *i, GeditPrintPreview *preview) +{ + set_rows_and_cols (preview, 2, 1); +} + +static void +on_2x2_clicked (GtkMenuItem *i, GeditPrintPreview *preview) +{ + set_rows_and_cols (preview, 2, 2); +} + +static void +multi_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + GtkWidget *m, *i; + + m = gtk_menu_new (); + gtk_widget_show (m); + g_signal_connect (m, + "selection_done", + G_CALLBACK (gtk_widget_destroy), + m); + + i = gtk_menu_item_new_with_label ("1x1"); + gtk_widget_show (i); + gtk_menu_attach (GTK_MENU (m), i, 0, 1, 0, 1); + g_signal_connect (i, "activate", G_CALLBACK (on_1x1_clicked), preview); + + i = gtk_menu_item_new_with_label ("2x1"); + gtk_widget_show (i); + gtk_menu_attach (GTK_MENU (m), i, 0, 1, 1, 2); + g_signal_connect (i, "activate", G_CALLBACK (on_2x1_clicked), preview); + + i = gtk_menu_item_new_with_label ("1x2"); + gtk_widget_show (i); + gtk_menu_attach (GTK_MENU (m), i, 1, 2, 0, 1); + g_signal_connect (i, "activate", G_CALLBACK (on_1x2_clicked), preview); + + i = gtk_menu_item_new_with_label ("2x2"); + gtk_widget_show (i); + gtk_menu_attach (GTK_MENU (m), i, 1, 2, 1, 2); + g_signal_connect (i, "activate", G_CALLBACK (on_2x2_clicked), preview); + + gtk_menu_popup (GTK_MENU (m), + NULL, NULL, NULL, preview, 0, + GDK_CURRENT_TIME); +} + +static void +zoom_one_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + set_zoom_factor (preview, 1); +} + +static void +zoom_fit_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + set_zoom_fit_to_size (preview); +} + +static void +zoom_in_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + zoom_in (preview); +} + +static void +zoom_out_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + zoom_out (preview); +} + +static void +close_button_clicked (GtkWidget *button, + GeditPrintPreview *preview) +{ + gtk_widget_destroy (GTK_WIDGET (preview)); +} + +static void +create_bar (GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + GtkWidget *toolbar; + GtkToolItem *i; + AtkObject *atko; + GtkWidget *status; + + priv = preview->priv; + + toolbar = gtk_toolbar_new (); + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_BOTH_HORIZ); + gtk_widget_show (toolbar); + gtk_box_pack_start (GTK_BOX (preview), + toolbar, + FALSE, FALSE, 0); + + priv->prev = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK); + gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->prev), + "P_revious Page"); + gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->prev), TRUE); + gtk_tool_item_set_tooltip_text (priv->prev, _("Show the previous page")); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->prev, -1); + g_signal_connect (priv->prev, + "clicked", + G_CALLBACK (prev_button_clicked), + preview); + gtk_widget_show (GTK_WIDGET (priv->prev)); + + priv->next = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD); + gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->next), + "_Next Page"); + gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->next), TRUE); + gtk_tool_item_set_tooltip_text (priv->next, _("Show the next page")); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->next, -1); + g_signal_connect (priv->next, + "clicked", + G_CALLBACK (next_button_clicked), + preview); + gtk_widget_show (GTK_WIDGET (priv->next)); + + i = gtk_separator_tool_item_new (); + gtk_widget_show (GTK_WIDGET (i)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); + + status = gtk_hbox_new (FALSE, 4); + priv->page_entry = gtk_entry_new (); + gtk_entry_set_width_chars (GTK_ENTRY (priv->page_entry), 3); + gtk_entry_set_max_length (GTK_ENTRY (priv->page_entry), 6); + gtk_widget_set_tooltip_text (priv->page_entry, _("Current page (Alt+P)")); + + g_signal_connect (priv->page_entry, + "activate", + G_CALLBACK (page_entry_activated), + preview); + g_signal_connect (priv->page_entry, + "insert-text", + G_CALLBACK (page_entry_insert_text), + NULL); + g_signal_connect (priv->page_entry, + "focus-out-event", + G_CALLBACK (page_entry_focus_out), + preview); + + gtk_box_pack_start (GTK_BOX (status), + priv->page_entry, + FALSE, FALSE, 0); + /* gtk_label_set_mnemonic_widget ((GtkLabel *) l, mp->priv->page_entry); */ + + /* We are displaying 'XXX of XXX'. */ + gtk_box_pack_start (GTK_BOX (status), + /* Translators: the "of" from "1 of 19" in print preview. */ + gtk_label_new (_("of")), + FALSE, FALSE, 0); + + priv->last = gtk_label_new (""); + gtk_box_pack_start (GTK_BOX (status), + priv->last, + FALSE, FALSE, 0); + atko = gtk_widget_get_accessible (priv->last); + atk_object_set_name (atko, _("Page total")); + atk_object_set_description (atko, _("The total number of pages in the document")); + + gtk_widget_show_all (status); + + i = gtk_tool_item_new (); + gtk_container_add (GTK_CONTAINER (i), status); + gtk_widget_show (GTK_WIDGET (i)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); + + i = gtk_separator_tool_item_new (); + gtk_widget_show (GTK_WIDGET (i)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); + + priv->multi = gtk_tool_button_new_from_stock (GTK_STOCK_DND_MULTIPLE); + gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->multi), + "_Show Multiple Pages"); + gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->multi), TRUE); + gtk_tool_item_set_tooltip_text (priv->multi, _("Show multiple pages")); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->multi, -1); + g_signal_connect (priv->multi, + "clicked", + G_CALLBACK (multi_button_clicked), + preview); + gtk_widget_show (GTK_WIDGET (priv->multi)); + + i = gtk_separator_tool_item_new (); + gtk_widget_show (GTK_WIDGET (i)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); + + priv->zoom_one = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_100); + gtk_tool_item_set_tooltip_text (priv->zoom_one, _("Zoom 1:1")); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_one, -1); + g_signal_connect (priv->zoom_one, + "clicked", + G_CALLBACK (zoom_one_button_clicked), + preview); + gtk_widget_show (GTK_WIDGET (priv->zoom_one)); + + priv->zoom_fit = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_FIT); + gtk_tool_item_set_tooltip_text (priv->zoom_fit, _("Zoom to fit the whole page")); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_fit, -1); + g_signal_connect (priv->zoom_fit, + "clicked", + G_CALLBACK (zoom_fit_button_clicked), + preview); + gtk_widget_show (GTK_WIDGET (priv->zoom_fit)); + + priv->zoom_in = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_IN); + gtk_tool_item_set_tooltip_text (priv->zoom_in, _("Zoom the page in")); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_in, -1); + g_signal_connect (priv->zoom_in, + "clicked", + G_CALLBACK (zoom_in_button_clicked), + preview); + gtk_widget_show (GTK_WIDGET (priv->zoom_in)); + + priv->zoom_out = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_OUT); + gtk_tool_item_set_tooltip_text (priv->zoom_out, _("Zoom the page out")); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_out, -1); + g_signal_connect (priv->zoom_out, + "clicked", + G_CALLBACK (zoom_out_button_clicked), + preview); + gtk_widget_show (GTK_WIDGET (priv->zoom_out)); + + i = gtk_separator_tool_item_new (); + gtk_widget_show (GTK_WIDGET (i)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); + + i = gtk_tool_button_new (NULL, _("_Close Preview")); + gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (i), TRUE); + gtk_tool_item_set_is_important (i, TRUE); + gtk_tool_item_set_tooltip_text (i, _("Close print preview")); + g_signal_connect (i, "clicked", + G_CALLBACK (close_button_clicked), preview); + gtk_widget_show (GTK_WIDGET (i)); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); +} + +static gint +get_first_page_displayed (GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + + priv = preview->priv; + + return priv->cur_page - priv->cur_page % (priv->cols * priv->rows); +} + +/* returns the page number (starting from 0) or -1 if no page */ +static gint +get_page_at_coords (GeditPrintPreview *preview, + gint x, + gint y) +{ + GeditPrintPreviewPrivate *priv; + GtkAdjustment *hadj, *vadj; + gint r, c, pg; + + priv = preview->priv; + + if (priv->tile_h <= 0 || priv->tile_h <= 0) + return -1; + + hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)); + vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)); + + x += gtk_adjustment_get_value (hadj); + y += gtk_adjustment_get_value (vadj); + + r = 1 + y / (priv->tile_h); + c = 1 + x / (priv->tile_w); + + if (c > priv->cols) + return -1; + + pg = get_first_page_displayed (preview) - 1; + pg += (r - 1) * priv->cols + c; + + if (pg >= priv->n_pages) + return -1; + + /* FIXME: we could try to be picky and check + * if we actually are inside the page */ + return pg; +} + +static gboolean +preview_layout_query_tooltip (GtkWidget *widget, + gint x, + gint y, + gboolean keyboard_tip, + GtkTooltip *tooltip, + GeditPrintPreview *preview) +{ + gint pg; + gchar *tip; + + pg = get_page_at_coords (preview, x, y); + if (pg < 0) + return FALSE; + + tip = g_strdup_printf (_("Page %d of %d"), pg + 1, preview->priv->n_pages); + gtk_tooltip_set_text (tooltip, tip); + g_free (tip); + + return TRUE; +} + +static gint +preview_layout_key_press (GtkWidget *widget, + GdkEventKey *event, + GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + GtkAdjustment *hadj, *vadj; + double x, y; + guint h, w; + double hlower, hupper, vlower, vupper; + double hpage, vpage; + double hstep, vstep; + gboolean domove = FALSE; + gboolean ret = TRUE; + + priv = preview->priv; + + hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)); + vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)); + + x = gtk_adjustment_get_value (hadj); + y = gtk_adjustment_get_value (vadj); + + g_object_get (hadj, + "lower", &hlower, + "upper", &hupper, + "page-size", &hpage, + NULL); + g_object_get (vadj, + "lower", &vlower, + "upper", &vupper, + "page-size", &vpage, + NULL); + + gtk_layout_get_size (GTK_LAYOUT (priv->layout), &w, &h); + + hstep = 10; + vstep = 10; + + switch (event->keyval) { + case '1': + set_zoom_fit_to_size (preview); + break; + case '+': + case '=': + case GDK_KP_Add: + zoom_in (preview); + break; + case '-': + case '_': + case GDK_KP_Subtract: + zoom_out (preview); + break; + case GDK_KP_Right: + case GDK_Right: + if (event->state & GDK_SHIFT_MASK) + x = hupper - hpage; + else + x = MIN (hupper - hpage, x + hstep); + domove = TRUE; + break; + case GDK_KP_Left: + case GDK_Left: + if (event->state & GDK_SHIFT_MASK) + x = hlower; + else + x = MAX (hlower, x - hstep); + domove = TRUE; + break; + case GDK_KP_Up: + case GDK_Up: + if (event->state & GDK_SHIFT_MASK) + goto page_up; + y = MAX (vlower, y - vstep); + domove = TRUE; + break; + case GDK_KP_Down: + case GDK_Down: + if (event->state & GDK_SHIFT_MASK) + goto page_down; + y = MIN (vupper - vpage, y + vstep); + domove = TRUE; + break; + case GDK_KP_Page_Up: + case GDK_Page_Up: + case GDK_Delete: + case GDK_KP_Delete: + case GDK_BackSpace: + page_up: + if (y <= vlower) + { + if (preview->priv->cur_page > 0) + { + goto_page (preview, preview->priv->cur_page - 1); + y = (vupper - vpage); + } + } + else + { + y = vlower; + } + domove = TRUE; + break; + case GDK_KP_Page_Down: + case GDK_Page_Down: + case ' ': + page_down: + if (y >= (vupper - vpage)) + { + if (preview->priv->cur_page < preview->priv->n_pages - 1) + { + goto_page (preview, preview->priv->cur_page + 1); + y = vlower; + } + } + else + { + y = (vupper - vpage); + } + domove = TRUE; + break; + case GDK_KP_Home: + case GDK_Home: + goto_page (preview, 0); + y = 0; + domove = TRUE; + break; + case GDK_KP_End: + case GDK_End: + goto_page (preview, preview->priv->n_pages - 1); + y = 0; + domove = TRUE; + break; + case GDK_Escape: + gtk_widget_destroy (GTK_WIDGET (preview)); + break; + case 'c': + if (event->state & GDK_MOD1_MASK) + { + gtk_widget_destroy (GTK_WIDGET (preview)); + } + break; + case 'p': + if (event->state & GDK_MOD1_MASK) + { + gtk_widget_grab_focus (preview->priv->page_entry); + } + break; + default: + /* by default do not stop the default handler */ + ret = FALSE; + } + + if (domove) + { + gtk_adjustment_set_value (hadj, x); + gtk_adjustment_set_value (vadj, y); + + gtk_adjustment_value_changed (hadj); + gtk_adjustment_value_changed (vadj); + } + + return ret; +} + +static void +create_preview_layout (GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + AtkObject *atko; + + priv = preview->priv; + + priv->layout = gtk_layout_new (NULL, NULL); +// gtk_widget_set_double_buffered (priv->layout, FALSE); + + atko = gtk_widget_get_accessible (GTK_WIDGET (priv->layout)); + atk_object_set_name (atko, _("Page Preview")); + atk_object_set_description (atko, _("The preview of a page in the document to be printed")); + + gtk_widget_add_events (priv->layout, + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_PRESS_MASK | + GDK_KEY_PRESS_MASK); + + GTK_WIDGET_SET_FLAGS (priv->layout, GTK_CAN_FOCUS); + + g_signal_connect (priv->layout, + "key-press-event", + G_CALLBACK (preview_layout_key_press), + preview); + + g_object_set (priv->layout, "has-tooltip", TRUE, NULL); + g_signal_connect (priv->layout, + "query-tooltip", + G_CALLBACK (preview_layout_query_tooltip), + preview); + + priv->scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + gtk_container_add (GTK_CONTAINER (priv->scrolled_window), priv->layout); + gtk_box_pack_end (GTK_BOX (preview), + priv->scrolled_window, + TRUE, TRUE, 0); + + gtk_widget_show_all (GTK_WIDGET (priv->scrolled_window)); + gtk_widget_grab_focus (GTK_WIDGET (priv->layout)); +} + +static void +gedit_print_preview_init (GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + + priv = G_TYPE_INSTANCE_GET_PRIVATE (preview, + GEDIT_TYPE_PRINT_PREVIEW, + GeditPrintPreviewPrivate); + + preview->priv = priv; + + priv->operation = NULL; + priv->context = NULL; + priv->gtk_preview = NULL; + + create_bar (preview); + create_preview_layout (preview); + + // FIXME + priv->cur_page = 0; + priv->paper_w = 0; + priv->paper_h = 0; + priv->dpi = PRINTER_DPI; + priv->scale = 1.0; + priv->rows = 1; + priv->cols = 1; +} + +static void +draw_page_content (cairo_t *cr, + gint page_number, + GeditPrintPreview *preview) +{ + /* scale to the desired size */ + cairo_scale (cr, preview->priv->scale, preview->priv->scale); + + /* rotate acording to page orientation if needed */ + if ((preview->priv->orientation == GTK_PAGE_ORIENTATION_LANDSCAPE) || + (preview->priv->orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE)) + { + cairo_matrix_t matrix; + + cairo_matrix_init (&matrix, + 0, -1, + 1, 0, + 0, get_paper_width (preview)); + cairo_transform (cr, &matrix); + } + + gtk_print_context_set_cairo_context (preview->priv->context, + cr, + preview->priv->dpi, + preview->priv->dpi); + + gtk_print_operation_preview_render_page (preview->priv->gtk_preview, + page_number); +} + +/* For the frame, we scale and rotate manually, since + * the line width should not depend on the zoom and + * the drop shadow should be on the bottom right no matter + * the orientation */ +static void +draw_page_frame (cairo_t *cr, + GeditPrintPreview *preview) +{ + double w, h; + + w = get_paper_width (preview); + h = get_paper_height (preview); + + if ((preview->priv->orientation == GTK_PAGE_ORIENTATION_LANDSCAPE) || + (preview->priv->orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE)) + { + double tmp; + + tmp = w; + w = h; + h = tmp; + } + + w *= preview->priv->scale; + h *= preview->priv->scale; + + /* drop shadow */ + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_rectangle (cr, + PAGE_SHADOW_OFFSET, PAGE_SHADOW_OFFSET, + w, h); + cairo_fill (cr); + + /* page frame */ + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_rectangle (cr, + 0, 0, + w, h); + cairo_fill_preserve (cr); + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_set_line_width (cr, 1); + cairo_stroke (cr); +} + +static void +draw_page (cairo_t *cr, + double x, + double y, + gint page_number, + GeditPrintPreview *preview) +{ + cairo_save (cr); + + /* move to the page top left corner */ + cairo_translate (cr, x + PAGE_PAD, y + PAGE_PAD); + + draw_page_frame (cr, preview); + draw_page_content (cr, page_number, preview); + + cairo_restore (cr); +} + +static gboolean +preview_expose (GtkWidget *widget, + GdkEventExpose *event, + GeditPrintPreview *preview) +{ + GeditPrintPreviewPrivate *priv; + GdkWindow *bin_window; + cairo_t *cr; + gint pg; + gint i, j; + + priv = preview->priv; + + bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (priv->layout)); + if (event->window != bin_window) + return FALSE; + + cr = gdk_cairo_create (bin_window); + + gdk_cairo_rectangle (cr, &event->area); + cairo_clip (cr); + + /* get the first page to display */ + pg = get_first_page_displayed (preview); + + for (i = 0; i < priv->cols; ++i) + { + for (j = 0; j < priv->rows; ++j) + { + if (!gtk_print_operation_preview_is_selected (priv->gtk_preview, + pg)) + { + continue; + } + + if (pg == priv->n_pages) + break; + + draw_page (cr, + j * priv->tile_w, + i * priv->tile_h, + pg, + preview); + + ++pg; + } + } + cairo_destroy (cr); + + return TRUE; +} + +static double +get_screen_dpi (GeditPrintPreview *preview) +{ + GdkScreen *screen; + double dpi; + + screen = gtk_widget_get_screen (GTK_WIDGET (preview)); + + dpi = gdk_screen_get_resolution (screen); + if (dpi < 30. || 600. < dpi) + { + g_warning ("Invalid the x-resolution for the screen, assuming 96dpi"); + dpi = 96.; + } + + return dpi; +} + +static void +set_n_pages (GeditPrintPreview *preview, + gint n_pages) +{ + gchar *str; + + preview->priv->n_pages = n_pages; + + // FIXME: count the visible pages + + str = g_strdup_printf ("%d", n_pages); + gtk_label_set_markup (GTK_LABEL (preview->priv->last), str); + g_free (str); +} + +static void +preview_ready (GtkPrintOperationPreview *gtk_preview, + GtkPrintContext *context, + GeditPrintPreview *preview) +{ + gint n_pages; + + g_object_get (preview->priv->operation, "n-pages", &n_pages, NULL); + set_n_pages (preview, n_pages); + goto_page (preview, 0); + + /* figure out the dpi */ + preview->priv->dpi = get_screen_dpi (preview); + + set_zoom_factor (preview, 1.0); + + /* let the default gtklayout handler clear the background */ + g_signal_connect_after (preview->priv->layout, + "expose-event", + G_CALLBACK (preview_expose), + preview); + + gtk_widget_queue_draw (preview->priv->layout); +} + +static void +update_paper_size (GeditPrintPreview *preview, + GtkPageSetup *page_setup) +{ + GtkPaperSize *paper_size; + + paper_size = gtk_page_setup_get_paper_size (page_setup); + + preview->priv->paper_w = gtk_paper_size_get_width (paper_size, GTK_UNIT_INCH); + preview->priv->paper_h = gtk_paper_size_get_height (paper_size, GTK_UNIT_INCH); + + preview->priv->orientation = gtk_page_setup_get_orientation (page_setup); +} + +static void +preview_got_page_size (GtkPrintOperationPreview *gtk_preview, + GtkPrintContext *context, + GtkPageSetup *page_setup, + GeditPrintPreview *preview) +{ + update_paper_size (preview, page_setup); +} + +/* HACK: we need a dummy surface to paginate... can we use something simpler? */ + +static cairo_status_t +dummy_write_func (G_GNUC_UNUSED gpointer closure, + G_GNUC_UNUSED const guchar *data, + G_GNUC_UNUSED guint length) +{ + return CAIRO_STATUS_SUCCESS; +} + +#define PRINTER_DPI (72.) + +static cairo_surface_t * +create_preview_surface_platform (GtkPaperSize *paper_size, + double *dpi_x, + double *dpi_y) +{ + double width, height; + cairo_surface_t *sf; + + width = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS); + height = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS); + + *dpi_x = *dpi_y = PRINTER_DPI; + + sf = cairo_pdf_surface_create_for_stream (dummy_write_func, NULL, + width, height); + return sf; +} + +static cairo_surface_t * +create_preview_surface (GeditPrintPreview *preview, + double *dpi_x, + double *dpi_y) +{ + GtkPageSetup *page_setup; + GtkPaperSize *paper_size; + + page_setup = gtk_print_context_get_page_setup (preview->priv->context); + /* gtk_page_setup_get_paper_size swaps width and height for landscape */ + paper_size = gtk_page_setup_get_paper_size (page_setup); + + return create_preview_surface_platform (paper_size, dpi_x, dpi_y); +} + +GtkWidget * +gedit_print_preview_new (GtkPrintOperation *op, + GtkPrintOperationPreview *gtk_preview, + GtkPrintContext *context) +{ + GeditPrintPreview *preview; + GtkPageSetup *page_setup; + cairo_surface_t *surface; + cairo_t *cr; + double dpi_x, dpi_y; + + g_return_val_if_fail (GTK_IS_PRINT_OPERATION (op), NULL); + g_return_val_if_fail (GTK_IS_PRINT_OPERATION_PREVIEW (gtk_preview), NULL); + + preview = g_object_new (GEDIT_TYPE_PRINT_PREVIEW, NULL); + + preview->priv->operation = g_object_ref (op); + preview->priv->gtk_preview = g_object_ref (gtk_preview); + preview->priv->context = g_object_ref (context); + + /* FIXME: is this legal?? */ + gtk_print_operation_set_unit (op, GTK_UNIT_POINTS); + + g_signal_connect (gtk_preview, "ready", + G_CALLBACK (preview_ready), preview); + g_signal_connect (gtk_preview, "got-page-size", + G_CALLBACK (preview_got_page_size), preview); + + page_setup = gtk_print_context_get_page_setup (preview->priv->context); + update_paper_size (preview, page_setup); + + /* FIXME: we need a cr to paginate... but we can't get the drawing + * area surface because it's not there yet... for now I create + * a dummy pdf surface */ + + surface = create_preview_surface (preview, &dpi_x, &dpi_y); + cr = cairo_create (surface); + gtk_print_context_set_cairo_context (context, cr, dpi_x, dpi_y); + cairo_destroy (cr); + cairo_surface_destroy (surface); + + return GTK_WIDGET (preview); +} + diff --git a/gedit/gedit-print-preview.h b/gedit/gedit-print-preview.h new file mode 100755 index 00000000..f86ef87a --- /dev/null +++ b/gedit/gedit-print-preview.h @@ -0,0 +1,71 @@ +/* + * gedit-print-preview.h + * + * Copyright (C) 2008 Paolo Borelli + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2006. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id: gedit-commands-search.c 5931 2007-09-25 20:05:40Z pborelli $ + */ + + +#ifndef __GEDIT_PRINT_PREVIEW_H__ +#define __GEDIT_PRINT_PREVIEW_H__ + +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_PRINT_PREVIEW (gedit_print_preview_get_type ()) +#define GEDIT_PRINT_PREVIEW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GEDIT_TYPE_PRINT_PREVIEW, GeditPrintPreview)) +#define GEDIT_PRINT_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_PRINT_PREVIEW, GeditPrintPreviewClass)) +#define GEDIT_IS_PRINT_PREVIEW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GEDIT_TYPE_PRINT_PREVIEW)) +#define GEDIT_IS_PRINT_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PRINT_PREVIEW)) +#define GEDIT_PRINT_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_PRINT_PREVIEW, GeditPrintPreviewClass)) + +typedef struct _GeditPrintPreview GeditPrintPreview; +typedef struct _GeditPrintPreviewPrivate GeditPrintPreviewPrivate; +typedef struct _GeditPrintPreviewClass GeditPrintPreviewClass; + +struct _GeditPrintPreview +{ + GtkVBox parent; + GeditPrintPreviewPrivate *priv; +}; + +struct _GeditPrintPreviewClass +{ + GtkVBoxClass parent_class; + + void (* close) (GeditPrintPreview *preview); +}; + + +GType gedit_print_preview_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_print_preview_new (GtkPrintOperation *op, + GtkPrintOperationPreview *gtk_preview, + GtkPrintContext *context); + +G_END_DECLS + +#endif /* __GEDIT_PRINT_PREVIEW_H__ */ diff --git a/gedit/gedit-progress-message-area.c b/gedit/gedit-progress-message-area.c new file mode 100755 index 00000000..d408baee --- /dev/null +++ b/gedit/gedit-progress-message-area.c @@ -0,0 +1,261 @@ +/* + * gedit-progress-message-area.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + + /* TODO: add properties */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "gedit-progress-message-area.h" + +enum { + PROP_0, + PROP_HAS_CANCEL_BUTTON +}; + + +#define GEDIT_PROGRESS_MESSAGE_AREA_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_PROGRESS_MESSAGE_AREA, GeditProgressMessageAreaPrivate)) + +struct _GeditProgressMessageAreaPrivate +{ + GtkWidget *image; + GtkWidget *label; + GtkWidget *progress; +}; + +#if !GTK_CHECK_VERSION (2, 17, 1) +G_DEFINE_TYPE(GeditProgressMessageArea, gedit_progress_message_area, GEDIT_TYPE_MESSAGE_AREA) +#else +G_DEFINE_TYPE(GeditProgressMessageArea, gedit_progress_message_area, GTK_TYPE_INFO_BAR) +#endif + +static void +gedit_progress_message_area_set_has_cancel_button (GeditProgressMessageArea *area, + gboolean has_button) +{ + if (has_button) +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (area), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); +#else + gtk_info_bar_add_button (GTK_INFO_BAR (area), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); +#endif + + g_object_notify (G_OBJECT (area), "has-cancel-button"); +} + +static void +gedit_progress_message_area_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditProgressMessageArea *area; + + area = GEDIT_PROGRESS_MESSAGE_AREA (object); + + switch (prop_id) + { + case PROP_HAS_CANCEL_BUTTON: + gedit_progress_message_area_set_has_cancel_button (area, + g_value_get_boolean (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_progress_message_area_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditProgressMessageArea *area; + + area = GEDIT_PROGRESS_MESSAGE_AREA (object); + + switch (prop_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_progress_message_area_class_init (GeditProgressMessageAreaClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = gedit_progress_message_area_set_property; + gobject_class->get_property = gedit_progress_message_area_get_property; + + g_object_class_install_property (gobject_class, + PROP_HAS_CANCEL_BUTTON, + g_param_spec_boolean ("has-cancel-button", + "Has Cancel Button", + "If the message area has a cancel button", + TRUE, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (gobject_class, sizeof(GeditProgressMessageAreaPrivate)); +} + +static void +gedit_progress_message_area_init (GeditProgressMessageArea *area) +{ + GtkWidget *vbox; + GtkWidget *hbox; + + area->priv = GEDIT_PROGRESS_MESSAGE_AREA_GET_PRIVATE (area); + + vbox = gtk_vbox_new (FALSE, 6); + gtk_widget_show (vbox); + + hbox = gtk_hbox_new (FALSE, 4); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + + area->priv->image = gtk_image_new_from_icon_name (GTK_STOCK_MISSING_IMAGE, + GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_show (area->priv->image); + gtk_misc_set_alignment (GTK_MISC (area->priv->image), 0.5, 0.5); + gtk_box_pack_start (GTK_BOX (hbox), area->priv->image, FALSE, FALSE, 4); + + area->priv->label = gtk_label_new (""); + gtk_widget_show (area->priv->label); + gtk_box_pack_start (GTK_BOX (hbox), area->priv->label, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (area->priv->label), TRUE); + gtk_misc_set_alignment (GTK_MISC (area->priv->label), 0, 0.5); + gtk_label_set_ellipsize (GTK_LABEL (area->priv->label), + PANGO_ELLIPSIZE_END); + + area->priv->progress = gtk_progress_bar_new (); + gtk_widget_show (area->priv->progress); + gtk_box_pack_start (GTK_BOX (vbox), area->priv->progress, TRUE, FALSE, 0); + gtk_widget_set_size_request (area->priv->progress, -1, 15); + +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_set_contents (GEDIT_MESSAGE_AREA (area), + vbox); +#else + GtkWidget *content; + + content = gtk_info_bar_get_content_area (GTK_INFO_BAR (area)); + gtk_container_add (GTK_CONTAINER (content), vbox); +#endif +} + +GtkWidget * +gedit_progress_message_area_new (const gchar *stock_id, + const gchar *markup, + gboolean has_cancel) +{ + GeditProgressMessageArea *area; + + g_return_val_if_fail (stock_id != NULL, NULL); + g_return_val_if_fail (markup != NULL, NULL); + + area = GEDIT_PROGRESS_MESSAGE_AREA (g_object_new (GEDIT_TYPE_PROGRESS_MESSAGE_AREA, + "has-cancel-button", has_cancel, + NULL)); + + gedit_progress_message_area_set_stock_image (area, + stock_id); + + gedit_progress_message_area_set_markup (area, + markup); + + return GTK_WIDGET (area); +} + +void +gedit_progress_message_area_set_stock_image (GeditProgressMessageArea *area, + const gchar *stock_id) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (area)); + g_return_if_fail (stock_id != NULL); + + gtk_image_set_from_stock (GTK_IMAGE (area->priv->image), + stock_id, + GTK_ICON_SIZE_SMALL_TOOLBAR); +} + +void +gedit_progress_message_area_set_markup (GeditProgressMessageArea *area, + const gchar *markup) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (area)); + g_return_if_fail (markup != NULL); + + gtk_label_set_markup (GTK_LABEL (area->priv->label), + markup); +} + +void +gedit_progress_message_area_set_text (GeditProgressMessageArea *area, + const gchar *text) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (area)); + g_return_if_fail (text != NULL); + + gtk_label_set_text (GTK_LABEL (area->priv->label), + text); +} + +void +gedit_progress_message_area_set_fraction (GeditProgressMessageArea *area, + gdouble fraction) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (area)); + + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (area->priv->progress), + fraction); +} + +void +gedit_progress_message_area_pulse (GeditProgressMessageArea *area) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (area)); + + gtk_progress_bar_pulse (GTK_PROGRESS_BAR (area->priv->progress)); +} diff --git a/gedit/gedit-progress-message-area.h b/gedit/gedit-progress-message-area.h new file mode 100755 index 00000000..ed5d8e32 --- /dev/null +++ b/gedit/gedit-progress-message-area.h @@ -0,0 +1,112 @@ +/* + * gedit-progress-message-area.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_PROGRESS_MESSAGE_AREA_H__ +#define __GEDIT_PROGRESS_MESSAGE_AREA_H__ + +#if !GTK_CHECK_VERSION (2, 17, 1) +#include +#else +#include +#endif + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_PROGRESS_MESSAGE_AREA (gedit_progress_message_area_get_type()) +#define GEDIT_PROGRESS_MESSAGE_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PROGRESS_MESSAGE_AREA, GeditProgressMessageArea)) +#define GEDIT_PROGRESS_MESSAGE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PROGRESS_MESSAGE_AREA, GeditProgressMessageAreaClass)) +#define GEDIT_IS_PROGRESS_MESSAGE_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PROGRESS_MESSAGE_AREA)) +#define GEDIT_IS_PROGRESS_MESSAGE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PROGRESS_MESSAGE_AREA)) +#define GEDIT_PROGRESS_MESSAGE_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PROGRESS_MESSAGE_AREA, GeditProgressMessageAreaClass)) + +/* Private structure type */ +typedef struct _GeditProgressMessageAreaPrivate GeditProgressMessageAreaPrivate; + +/* + * Main object structure + */ +typedef struct _GeditProgressMessageArea GeditProgressMessageArea; + +struct _GeditProgressMessageArea +{ +#if !GTK_CHECK_VERSION (2, 17, 1) + GeditMessageArea parent; +#else + GtkInfoBar parent; +#endif + + /*< private > */ + GeditProgressMessageAreaPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditProgressMessageAreaClass GeditProgressMessageAreaClass; + +struct _GeditProgressMessageAreaClass +{ +#if !GTK_CHECK_VERSION (2, 17, 1) + GeditMessageAreaClass parent_class; +#else + GtkInfoBarClass parent_class; +#endif +}; + +/* + * Public methods + */ +GType gedit_progress_message_area_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_progress_message_area_new (const gchar *stock_id, + const gchar *markup, + gboolean has_cancel); + +void gedit_progress_message_area_set_stock_image (GeditProgressMessageArea *area, + const gchar *stock_id); + +void gedit_progress_message_area_set_markup (GeditProgressMessageArea *area, + const gchar *markup); + +void gedit_progress_message_area_set_text (GeditProgressMessageArea *area, + const gchar *text); + +void gedit_progress_message_area_set_fraction (GeditProgressMessageArea *area, + gdouble fraction); + +void gedit_progress_message_area_pulse (GeditProgressMessageArea *area); + + +G_END_DECLS + +#endif /* __GEDIT_PROGRESS_MESSAGE_AREA_H__ */ diff --git a/gedit/gedit-session.c b/gedit/gedit-session.c new file mode 100755 index 00000000..3dc9f126 --- /dev/null +++ b/gedit/gedit-session.c @@ -0,0 +1,601 @@ +/* + * gedit-session.c - Basic session management for gedit + * This file is part of gedit + * + * Copyright (C) 2002 Ximian, Inc. + * Copyright (C) 2005 - Paolo Maggi + * + * Author: Federico Mena-Quintero + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include + +#include "gedit-session.h" + +#include "gedit-debug.h" +#include "gedit-plugins-engine.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-metadata-manager.h" +#include "gedit-window.h" +#include "gedit-app.h" +#include "gedit-commands.h" +#include "dialogs/gedit-close-confirmation-dialog.h" +#include "smclient/eggsmclient.h" + +/* The master client we use for SM */ +static EggSMClient *master_client = NULL; + +/* global var used during quit_requested */ +static GSList *window_dirty_list; + +static void ask_next_confirmation (void); + +#define GEDIT_SESSION_LIST_OF_DOCS_TO_SAVE "gedit-session-list-of-docs-to-save-key" + +static void +save_window_session (GKeyFile *state_file, + const gchar *group_name, + GeditWindow *window) +{ + const gchar *role; + int width, height; + GeditPanel *panel; + GList *docs, *l; + GPtrArray *doc_array; + GeditDocument *active_document; + gchar *uri; + + gedit_debug (DEBUG_SESSION); + + role = gtk_window_get_role (GTK_WINDOW (window)); + g_key_file_set_string (state_file, group_name, "role", role); + gtk_window_get_size (GTK_WINDOW (window), &width, &height); + g_key_file_set_integer (state_file, group_name, "width", width); + g_key_file_set_integer (state_file, group_name, "height", height); + + panel = gedit_window_get_side_panel (window); + g_key_file_set_boolean (state_file, group_name, "side-panel-visible", + GTK_WIDGET_VISIBLE (panel)); + + panel = gedit_window_get_bottom_panel (window); + g_key_file_set_boolean (state_file, group_name, "bottom-panel-visible", + GTK_WIDGET_VISIBLE (panel)); + + active_document = gedit_window_get_active_document (window); + if (active_document) + { + uri = gedit_document_get_uri (active_document); + g_key_file_set_string (state_file, group_name, + "active-document", uri); + } + + docs = gedit_window_get_documents (window); + + doc_array = g_ptr_array_new (); + for (l = docs; l != NULL; l = g_list_next (l)) + { + uri = gedit_document_get_uri (GEDIT_DOCUMENT (l->data)); + + if (uri != NULL) + g_ptr_array_add (doc_array, uri); + + } + g_list_free (docs); + + if (doc_array->len) + { + guint i; + + g_key_file_set_string_list (state_file, group_name, + "documents", + (const char **)doc_array->pdata, + doc_array->len); + for (i = 0; i < doc_array->len; i++) + g_free (doc_array->pdata[i]); + } + g_ptr_array_free (doc_array, TRUE); +} + +static void +client_save_state_cb (EggSMClient *client, + GKeyFile *state_file, + gpointer user_data) +{ + const GList *windows; + gchar *group_name; + int n; + + windows = gedit_app_get_windows (gedit_app_get_default ()); + n = 1; + + while (windows != NULL) + { + group_name = g_strdup_printf ("gedit window %d", n); + save_window_session (state_file, + group_name, + GEDIT_WINDOW (windows->data)); + g_free (group_name); + + windows = g_list_next (windows); + n++; + } +} + +static void +window_handled (GeditWindow *window) +{ + window_dirty_list = g_slist_remove (window_dirty_list, window); + + /* whee... we made it! */ + if (window_dirty_list == NULL) + egg_sm_client_will_quit (master_client, TRUE); + else + ask_next_confirmation (); +} + +static void +window_state_change (GeditWindow *window, + GParamSpec *pspec, + gpointer data) +{ + GeditWindowState state; + GList *unsaved_docs; + GList *docs_to_save; + GList *l; + gboolean done = TRUE; + + state = gedit_window_get_state (window); + + /* we are still saving */ + if (state & GEDIT_WINDOW_STATE_SAVING) + return; + + unsaved_docs = gedit_window_get_unsaved_documents (window); + + docs_to_save = g_object_get_data (G_OBJECT (window), + GEDIT_SESSION_LIST_OF_DOCS_TO_SAVE); + + + for (l = docs_to_save; l != NULL; l = l->next) + { + if (g_list_find (unsaved_docs, l->data)) + { + done = FALSE; + break; + } + } + + if (done) + { + g_signal_handlers_disconnect_by_func (window, window_state_change, data); + g_list_free (docs_to_save); + g_object_set_data (G_OBJECT (window), + GEDIT_SESSION_LIST_OF_DOCS_TO_SAVE, + NULL); + + window_handled (window); + } + + g_list_free (unsaved_docs); +} + +static void +close_confirmation_dialog_response_handler (GeditCloseConfirmationDialog *dlg, + gint response_id, + GeditWindow *window) +{ + GList *selected_documents; + GSList *l; + + gedit_debug (DEBUG_COMMANDS); + + switch (response_id) + { + case GTK_RESPONSE_YES: + /* save selected docs */ + + g_signal_connect (window, + "notify::state", + G_CALLBACK (window_state_change), + NULL); + + selected_documents = gedit_close_confirmation_dialog_get_selected_documents (dlg); + + g_return_if_fail (g_object_get_data (G_OBJECT (window), + GEDIT_SESSION_LIST_OF_DOCS_TO_SAVE) == NULL); + + g_object_set_data (G_OBJECT (window), + GEDIT_SESSION_LIST_OF_DOCS_TO_SAVE, + selected_documents); + + _gedit_cmd_file_save_documents_list (window, selected_documents); + + /* FIXME: also need to lock the window to prevent further changes... */ + + break; + + case GTK_RESPONSE_NO: + /* dont save */ + window_handled (window); + break; + + default: + /* disconnect window_state_changed where needed */ + for (l = window_dirty_list; l != NULL; l = l->next) + g_signal_handlers_disconnect_by_func (window, + window_state_change, NULL); + g_slist_free (window_dirty_list); + window_dirty_list = NULL; + + /* cancel shutdown */ + egg_sm_client_will_quit (master_client, FALSE); + + break; + } + + gtk_widget_destroy (GTK_WIDGET (dlg)); +} + +static void +show_confirmation_dialog (GeditWindow *window) +{ + GList *unsaved_docs; + GtkWidget *dlg; + + gedit_debug (DEBUG_SESSION); + + unsaved_docs = gedit_window_get_unsaved_documents (window); + + g_return_if_fail (unsaved_docs != NULL); + + if (unsaved_docs->next == NULL) + { + /* There is only one unsaved document */ + GeditTab *tab; + GeditDocument *doc; + + doc = GEDIT_DOCUMENT (unsaved_docs->data); + + tab = gedit_tab_get_from_document (doc); + g_return_if_fail (tab != NULL); + + gedit_window_set_active_tab (window, tab); + + dlg = gedit_close_confirmation_dialog_new_single ( + GTK_WINDOW (window), + doc, + TRUE); + } + else + { + dlg = gedit_close_confirmation_dialog_new (GTK_WINDOW (window), + unsaved_docs, + TRUE); + } + + g_list_free (unsaved_docs); + + g_signal_connect (dlg, + "response", + G_CALLBACK (close_confirmation_dialog_response_handler), + window); + + gtk_widget_show (dlg); +} + +static void +ask_next_confirmation (void) +{ + g_return_if_fail (window_dirty_list != NULL); + + /* pop up the confirmation dialog for the first window + * in the dirty list. The next confirmation is asked once + * this one has been handled. + */ + show_confirmation_dialog (GEDIT_WINDOW (window_dirty_list->data)); +} + +/* quit_requested handler for the master client */ +static void +client_quit_requested_cb (EggSMClient *client, gpointer data) +{ + GeditApp *app; + const GList *l; + + gedit_debug (DEBUG_SESSION); + + app = gedit_app_get_default (); + + if (window_dirty_list != NULL) + { + g_critical ("global variable window_dirty_list not NULL"); + window_dirty_list = NULL; + } + + for (l = gedit_app_get_windows (app); l != NULL; l = l->next) + { + if (gedit_window_get_unsaved_documents (GEDIT_WINDOW (l->data)) != NULL) + { + window_dirty_list = g_slist_prepend (window_dirty_list, l->data); + } + } + + /* no modified docs */ + if (window_dirty_list == NULL) + { + egg_sm_client_will_quit (client, TRUE); + + return; + } + + ask_next_confirmation (); + + gedit_debug_message (DEBUG_SESSION, "END"); +} + +/* quit handler for the master client */ +static void +client_quit_cb (EggSMClient *client, gpointer data) +{ +#if 0 + gedit_debug (DEBUG_SESSION); + + if (!client->save_yourself_emitted) + gedit_file_close_all (); + + gedit_debug_message (DEBUG_FILE, "All files closed."); + + matecomponent_mdi_destroy (MATECOMPONENT_MDI (gedit_mdi)); + + gedit_debug_message (DEBUG_FILE, "Unref gedit_mdi."); + + g_object_unref (G_OBJECT (gedit_mdi)); + + gedit_debug_message (DEBUG_FILE, "Unref gedit_mdi: DONE"); + + gedit_debug_message (DEBUG_FILE, "Unref gedit_app_server."); + + matecomponent_object_unref (gedit_app_server); + + gedit_debug_message (DEBUG_FILE, "Unref gedit_app_server: DONE"); +#endif + + gtk_main_quit (); +} + +/** + * gedit_session_init: + * + * Initializes session management support. This function should be called near + * the beginning of the program. + **/ +void +gedit_session_init (void) +{ + gedit_debug (DEBUG_SESSION); + + if (master_client) + return; + + master_client = egg_sm_client_get (); + g_signal_connect (master_client, + "save_state", + G_CALLBACK (client_save_state_cb), + NULL); + g_signal_connect (master_client, + "quit_requested", + G_CALLBACK (client_quit_requested_cb), + NULL); + g_signal_connect (master_client, + "quit", + G_CALLBACK (client_quit_cb), + NULL); +} + +/** + * gedit_session_is_restored: + * + * Returns whether this gedit is running from a restarted session. + * + * Return value: TRUE if the session manager restarted us, FALSE otherwise. + * This should be used to determine whether to pay attention to command line + * arguments in case the session was not restored. + **/ +gboolean +gedit_session_is_restored (void) +{ + gboolean restored; + + gedit_debug (DEBUG_SESSION); + + if (!master_client) + return FALSE; + + restored = egg_sm_client_is_resumed (master_client); + + gedit_debug_message (DEBUG_SESSION, restored ? "RESTORED" : "NOT RESTORED"); + + return restored; +} + +static void +parse_window (GKeyFile *state_file, const char *group_name) +{ + GeditWindow *window; + gchar *role, *active_document, **documents; + int width, height; + gboolean visible; + GeditPanel *panel; + GError *error = NULL; + + role = g_key_file_get_string (state_file, group_name, "role", NULL); + + gedit_debug_message (DEBUG_SESSION, "Window role: %s", role); + + window = _gedit_app_restore_window (gedit_app_get_default (), (gchar *) role); + g_free (role); + + if (window == NULL) + { + g_warning ("Couldn't restore window"); + return; + } + + width = g_key_file_get_integer (state_file, group_name, + "width", &error); + if (error) + { + g_clear_error (&error); + width = -1; + } + height = g_key_file_get_integer (state_file, group_name, + "height", &error); + if (error) + { + g_clear_error (&error); + height = -1; + } + gtk_window_set_default_size (GTK_WINDOW (window), width, height); + + + visible = g_key_file_get_boolean (state_file, group_name, + "side-panel-visible", &error); + if (error) + { + g_clear_error (&error); + visible = FALSE; + } + + panel = gedit_window_get_side_panel (window); + + if (visible) + { + gedit_debug_message (DEBUG_SESSION, "Side panel visible"); + gtk_widget_show (GTK_WIDGET (panel)); + } + else + { + gedit_debug_message (DEBUG_SESSION, "Side panel _NOT_ visible"); + gtk_widget_hide (GTK_WIDGET (panel)); + } + + visible = g_key_file_get_boolean (state_file, group_name, + "bottom-panel-visible", &error); + if (error) + { + g_clear_error (&error); + visible = FALSE; + } + + panel = gedit_window_get_bottom_panel (window); + if (visible) + { + gedit_debug_message (DEBUG_SESSION, "Bottom panel visible"); + gtk_widget_show (GTK_WIDGET (panel)); + } + else + { + gedit_debug_message (DEBUG_SESSION, "Bottom panel _NOT_ visible"); + gtk_widget_hide (GTK_WIDGET (panel)); + } + + active_document = g_key_file_get_string (state_file, group_name, + "active-document", NULL); + documents = g_key_file_get_string_list (state_file, group_name, + "documents", NULL, NULL); + if (documents) + { + int i; + gboolean jump_to = FALSE; + + for (i = 0; documents[i]; i++) + { + if (active_document != NULL) + jump_to = strcmp (active_document, + documents[i]) == 0; + + gedit_debug_message (DEBUG_SESSION, + "URI: %s (%s)", + documents[i], + jump_to ? "active" : "not active"); + gedit_window_create_tab_from_uri (window, + documents[i], + NULL, + 0, + FALSE, + jump_to); + } + g_strfreev (documents); + } + + g_free (active_document); + + gtk_widget_show (GTK_WIDGET (window)); +} + +/** + * gedit_session_load: + * + * Loads the session by fetching the necessary information from the session + * manager and opening files. + * + * Return value: TRUE if the session was loaded successfully, FALSE otherwise. + **/ +gboolean +gedit_session_load (void) +{ + GKeyFile *state_file; + gchar **groups; + int i; + + gedit_debug (DEBUG_SESSION); + + state_file = egg_sm_client_get_state_file (master_client); + if (state_file == NULL) + return FALSE; + + groups = g_key_file_get_groups (state_file, NULL); + + for (i = 0; groups[i] != NULL; i++) + { + if (g_str_has_prefix (groups[i], "gedit window ")) + parse_window (state_file, groups[i]); + } + + g_strfreev (groups); + g_key_file_free (state_file); + + return TRUE; +} diff --git a/gedit/gedit-session.h b/gedit/gedit-session.h new file mode 100755 index 00000000..ba59c131 --- /dev/null +++ b/gedit/gedit-session.h @@ -0,0 +1,47 @@ +/* + * gedit-session.h - Basic session management for gedit + * This file is part of gedit + * + * Copyright (C) 2002 Ximian, Inc. + * Copyright (C) 2005 - Paolo Maggi + * + * Author: Federico Mena-Quintero + * + * 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. + */ + +/* + * Modified by the gedit Team, 2002-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id + */ + +#ifndef __GEDIT_SESSION_H__ +#define __GEDIT_SESSION_H__ + +#include + +G_BEGIN_DECLS + +void gedit_session_init (void); +gboolean gedit_session_is_restored (void); +gboolean gedit_session_load (void); + +G_END_DECLS + +#endif /* __GEDIT_SESSION_H__ */ diff --git a/gedit/gedit-smart-charset-converter.c b/gedit/gedit-smart-charset-converter.c new file mode 100755 index 00000000..e32b0b17 --- /dev/null +++ b/gedit/gedit-smart-charset-converter.c @@ -0,0 +1,422 @@ +/* + * gedit-smart-charset-converter.c + * This file is part of gedit + * + * Copyright (C) 2009 - Ignacio Casal Quinteiro + * + * gedit 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. + * + * gedit 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 gedit; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#include "gedit-smart-charset-converter.h" +#include "gedit-debug.h" +#include "gedit-document.h" + +#include +#include + +#define GEDIT_SMART_CHARSET_CONVERTER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_SMART_CHARSET_CONVERTER, GeditSmartCharsetConverterPrivate)) + +struct _GeditSmartCharsetConverterPrivate +{ + GCharsetConverter *charset_conv; + + GSList *encodings; + GSList *current_encoding; + + guint is_utf8 : 1; + guint use_first : 1; +}; + +static void gedit_smart_charset_converter_iface_init (GConverterIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GeditSmartCharsetConverter, gedit_smart_charset_converter, + G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_CONVERTER, + gedit_smart_charset_converter_iface_init)) + +static void +gedit_smart_charset_converter_finalize (GObject *object) +{ + GeditSmartCharsetConverter *smart = GEDIT_SMART_CHARSET_CONVERTER (object); + + g_slist_free (smart->priv->encodings); + + gedit_debug_message (DEBUG_UTILS, "finalizing smart charset converter"); + + G_OBJECT_CLASS (gedit_smart_charset_converter_parent_class)->finalize (object); +} + +static void +gedit_smart_charset_converter_dispose (GObject *object) +{ + GeditSmartCharsetConverter *smart = GEDIT_SMART_CHARSET_CONVERTER (object); + + if (smart->priv->charset_conv != NULL) + { + g_object_unref (smart->priv->charset_conv); + smart->priv->charset_conv = NULL; + } + + gedit_debug_message (DEBUG_UTILS, "disposing smart charset converter"); + + G_OBJECT_CLASS (gedit_smart_charset_converter_parent_class)->dispose (object); +} + +static void +gedit_smart_charset_converter_class_init (GeditSmartCharsetConverterClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_smart_charset_converter_finalize; + object_class->dispose = gedit_smart_charset_converter_dispose; + + g_type_class_add_private (object_class, sizeof (GeditSmartCharsetConverterPrivate)); +} + +static void +gedit_smart_charset_converter_init (GeditSmartCharsetConverter *smart) +{ + smart->priv = GEDIT_SMART_CHARSET_CONVERTER_GET_PRIVATE (smart); + + smart->priv->charset_conv = NULL; + smart->priv->encodings = NULL; + smart->priv->current_encoding = NULL; + smart->priv->is_utf8 = FALSE; + smart->priv->use_first = FALSE; + + gedit_debug_message (DEBUG_UTILS, "initializing smart charset converter"); +} + +static const GeditEncoding * +get_encoding (GeditSmartCharsetConverter *smart) +{ + if (smart->priv->current_encoding == NULL) + { + smart->priv->current_encoding = smart->priv->encodings; + } + else + { + smart->priv->current_encoding = g_slist_next (smart->priv->current_encoding); + } + + if (smart->priv->current_encoding != NULL) + return (const GeditEncoding *)smart->priv->current_encoding->data; + +#if 0 + FIXME: uncomment this when using fallback + /* If we tried all encodings, we return the first encoding */ + smart->priv->use_first = TRUE; + smart->priv->current_encoding = smart->priv->encodings; + + return (const GeditEncoding *)smart->priv->current_encoding->data; +#endif + return NULL; +} + +static gboolean +try_convert (GCharsetConverter *converter, + const void *inbuf, + gsize inbuf_size) +{ + GError *err; + gsize bytes_read, nread; + gsize bytes_written, nwritten; + GConverterResult res; + gchar *out; + gboolean ret; + gsize out_size; + + if (inbuf == NULL || inbuf_size == 0) + { + return FALSE; + } + + err = NULL; + nread = 0; + nwritten = 0; + out_size = inbuf_size * 4; + out = g_malloc (out_size); + + do + { + res = g_converter_convert (G_CONVERTER (converter), + inbuf + nread, + inbuf_size - nread, + out + nwritten, + out_size - nwritten, + G_CONVERTER_INPUT_AT_END, + &bytes_read, + &bytes_written, + &err); + + nread += bytes_read; + nwritten += bytes_written; + } while (res != G_CONVERTER_FINISHED && res != G_CONVERTER_ERROR && err == NULL); + + if (err != NULL) + { + if (err->code == G_CONVERT_ERROR_PARTIAL_INPUT) + { + /* FIXME We can get partial input while guessing the + encoding because we just take some amount of text + to guess from. */ + ret = TRUE; + } + else + { + ret = FALSE; + } + + g_error_free (err); + } + else + { + ret = TRUE; + } + + /* FIXME: Check the remainder? */ + if (ret == TRUE && !g_utf8_validate (out, nwritten, NULL)) + { + ret = FALSE; + } + + g_free (out); + + return ret; +} + +static GCharsetConverter * +guess_encoding (GeditSmartCharsetConverter *smart, + const void *inbuf, + gsize inbuf_size) +{ + GCharsetConverter *conv = NULL; + + if (inbuf == NULL || inbuf_size == 0) + { + smart->priv->is_utf8 = TRUE; + return NULL; + } + + if (smart->priv->encodings != NULL && + smart->priv->encodings->next == NULL) + smart->priv->use_first = TRUE; + + /* We just check the first block */ + while (TRUE) + { + const GeditEncoding *enc; + + if (conv != NULL) + { + g_object_unref (conv); + conv = NULL; + } + + /* We get an encoding from the list */ + enc = get_encoding (smart); + + /* if it is NULL we didn't guess anything */ + if (enc == NULL) + { + break; + } + + gedit_debug_message (DEBUG_UTILS, "trying charset: %s", + gedit_encoding_get_charset (smart->priv->current_encoding->data)); + + if (enc == gedit_encoding_get_utf8 ()) + { + gsize remainder; + const gchar *end; + + if (g_utf8_validate (inbuf, inbuf_size, &end) || + smart->priv->use_first) + { + smart->priv->is_utf8 = TRUE; + break; + } + + /* Check if the end is less than one char */ + remainder = inbuf_size - (end - (gchar *)inbuf); + if (remainder < 6) + { + smart->priv->is_utf8 = TRUE; + break; + } + + continue; + } + + conv = g_charset_converter_new ("UTF-8", + gedit_encoding_get_charset (enc), + NULL); + + /* If we tried all encodings we use the first one */ + if (smart->priv->use_first) + { + break; + } + + /* Try to convert */ + if (try_convert (conv, inbuf, inbuf_size)) + { + break; + } + } + + if (conv != NULL) + { + g_converter_reset (G_CONVERTER (conv)); + + /* FIXME: uncomment this when we want to use the fallback + g_charset_converter_set_use_fallback (conv, TRUE);*/ + } + + return conv; +} + +static GConverterResult +gedit_smart_charset_converter_convert (GConverter *converter, + const void *inbuf, + gsize inbuf_size, + void *outbuf, + gsize outbuf_size, + GConverterFlags flags, + gsize *bytes_read, + gsize *bytes_written, + GError **error) +{ + GeditSmartCharsetConverter *smart = GEDIT_SMART_CHARSET_CONVERTER (converter); + + /* Guess the encoding if we didn't make it yet */ + if (smart->priv->charset_conv == NULL && + !smart->priv->is_utf8) + { + smart->priv->charset_conv = guess_encoding (smart, inbuf, inbuf_size); + + /* If we still have the previous case is that we didn't guess + anything */ + if (smart->priv->charset_conv == NULL && + !smart->priv->is_utf8) + { + /* FIXME: Add a different domain when we kill gedit_convert */ + g_set_error_literal (error, GEDIT_DOCUMENT_ERROR, + GEDIT_DOCUMENT_ERROR_ENCODING_AUTO_DETECTION_FAILED, + _("It is not possible to detect the encoding automatically")); + return G_CONVERTER_ERROR; + } + } + + /* Now if the encoding is utf8 just redirect the input to the output */ + if (smart->priv->is_utf8) + { + gsize size; + GConverterResult ret; + + size = MIN (inbuf_size, outbuf_size); + + memcpy (outbuf, inbuf, size); + *bytes_read = size; + *bytes_written = size; + + ret = G_CONVERTER_CONVERTED; + + if (flags & G_CONVERTER_INPUT_AT_END) + ret = G_CONVERTER_FINISHED; + else if (flags & G_CONVERTER_FLUSH) + ret = G_CONVERTER_FLUSHED; + + return ret; + } + + /* If we reached here is because we need to convert the text so, we + convert it with the charset converter */ + return g_converter_convert (G_CONVERTER (smart->priv->charset_conv), + inbuf, + inbuf_size, + outbuf, + outbuf_size, + flags, + bytes_read, + bytes_written, + error); +} + +static void +gedit_smart_charset_converter_reset (GConverter *converter) +{ + GeditSmartCharsetConverter *smart = GEDIT_SMART_CHARSET_CONVERTER (converter); + + smart->priv->current_encoding = NULL; + smart->priv->is_utf8 = FALSE; + + if (smart->priv->charset_conv != NULL) + { + g_object_unref (smart->priv->charset_conv); + smart->priv->charset_conv = NULL; + } +} + +static void +gedit_smart_charset_converter_iface_init (GConverterIface *iface) +{ + iface->convert = gedit_smart_charset_converter_convert; + iface->reset = gedit_smart_charset_converter_reset; +} + +GeditSmartCharsetConverter * +gedit_smart_charset_converter_new (GSList *candidate_encodings) +{ + GeditSmartCharsetConverter *smart; + + g_return_val_if_fail (candidate_encodings != NULL, NULL); + + smart = g_object_new (GEDIT_TYPE_SMART_CHARSET_CONVERTER, NULL); + + smart->priv->encodings = g_slist_copy (candidate_encodings); + + return smart; +} + +const GeditEncoding * +gedit_smart_charset_converter_get_guessed (GeditSmartCharsetConverter *smart) +{ + g_return_val_if_fail (GEDIT_IS_SMART_CHARSET_CONVERTER (smart), NULL); + + if (smart->priv->current_encoding != NULL) + { + return (const GeditEncoding *)smart->priv->current_encoding->data; + } + else if (smart->priv->is_utf8) + { + return gedit_encoding_get_utf8 (); + } + + return NULL; +} + +guint +gedit_smart_charset_converter_get_num_fallbacks (GeditSmartCharsetConverter *smart) +{ + g_return_val_if_fail (GEDIT_IS_SMART_CHARSET_CONVERTER (smart), FALSE); + + if (smart->priv->charset_conv == NULL) + return FALSE; + + return g_charset_converter_get_num_fallbacks (smart->priv->charset_conv) != 0; +} + diff --git a/gedit/gedit-smart-charset-converter.h b/gedit/gedit-smart-charset-converter.h new file mode 100755 index 00000000..803e07a5 --- /dev/null +++ b/gedit/gedit-smart-charset-converter.h @@ -0,0 +1,66 @@ +/* + * gedit-smart-charset-converter.h + * This file is part of gedit + * + * Copyright (C) 2009 - Ignacio Casal Quinteiro + * + * gedit 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. + * + * gedit 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 gedit; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#ifndef __GEDIT_SMART_CHARSET_CONVERTER_H__ +#define __GEDIT_SMART_CHARSET_CONVERTER_H__ + +#include + +#include "gedit-encodings.h" + +G_BEGIN_DECLS + +#define GEDIT_TYPE_SMART_CHARSET_CONVERTER (gedit_smart_charset_converter_get_type ()) +#define GEDIT_SMART_CHARSET_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_SMART_CHARSET_CONVERTER, GeditSmartCharsetConverter)) +#define GEDIT_SMART_CHARSET_CONVERTER_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_SMART_CHARSET_CONVERTER, GeditSmartCharsetConverter const)) +#define GEDIT_SMART_CHARSET_CONVERTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_SMART_CHARSET_CONVERTER, GeditSmartCharsetConverterClass)) +#define GEDIT_IS_SMART_CHARSET_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_SMART_CHARSET_CONVERTER)) +#define GEDIT_IS_SMART_CHARSET_CONVERTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_SMART_CHARSET_CONVERTER)) +#define GEDIT_SMART_CHARSET_CONVERTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_SMART_CHARSET_CONVERTER, GeditSmartCharsetConverterClass)) + +typedef struct _GeditSmartCharsetConverter GeditSmartCharsetConverter; +typedef struct _GeditSmartCharsetConverterClass GeditSmartCharsetConverterClass; +typedef struct _GeditSmartCharsetConverterPrivate GeditSmartCharsetConverterPrivate; + +struct _GeditSmartCharsetConverter +{ + GObject parent; + + GeditSmartCharsetConverterPrivate *priv; +}; + +struct _GeditSmartCharsetConverterClass +{ + GObjectClass parent_class; +}; + +GType gedit_smart_charset_converter_get_type (void) G_GNUC_CONST; + +GeditSmartCharsetConverter *gedit_smart_charset_converter_new (GSList *candidate_encodings); + +const GeditEncoding *gedit_smart_charset_converter_get_guessed (GeditSmartCharsetConverter *smart); + +guint gedit_smart_charset_converter_get_num_fallbacks(GeditSmartCharsetConverter *smart); + +G_END_DECLS + +#endif /* __GEDIT_SMART_CHARSET_CONVERTER_H__ */ diff --git a/gedit/gedit-spinner.c b/gedit/gedit-spinner.c new file mode 100755 index 00000000..5cb74587 --- /dev/null +++ b/gedit/gedit-spinner.c @@ -0,0 +1,989 @@ +/* + * gedit-spinner.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2002-2004 Marco Pesenti Gritti + * Copyright (C) 2004 Christian Persch + * Copyright (C) 2000 - Eazel, Inc. + * + * 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. + */ + +/* + * This widget was originally written by Andy Hertzfeld for + * Caja. It was then modified by Marco Pesenti Gritti and Christian Persch + * for Epiphany. + * + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "gedit-spinner.h" + +#include +#include + +/* Spinner cache implementation */ + +#define GEDIT_TYPE_SPINNER_CACHE (gedit_spinner_cache_get_type()) +#define GEDIT_SPINNER_CACHE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), GEDIT_TYPE_SPINNER_CACHE, GeditSpinnerCache)) +#define GEDIT_SPINNER_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_SPINNER_CACHE, GeditSpinnerCacheClass)) +#define GEDIT_IS_SPINNER_CACHE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), GEDIT_TYPE_SPINNER_CACHE)) +#define GEDIT_IS_SPINNER_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GEDIT_TYPE_SPINNER_CACHE)) +#define GEDIT_SPINNER_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_SPINNER_CACHE, GeditSpinnerCacheClass)) + +typedef struct _GeditSpinnerCache GeditSpinnerCache; +typedef struct _GeditSpinnerCacheClass GeditSpinnerCacheClass; +typedef struct _GeditSpinnerCachePrivate GeditSpinnerCachePrivate; + +struct _GeditSpinnerCacheClass +{ + GObjectClass parent_class; +}; + +struct _GeditSpinnerCache +{ + GObject parent_object; + + /*< private >*/ + GeditSpinnerCachePrivate *priv; +}; + +#define GEDIT_SPINNER_CACHE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_SPINNER_CACHE, GeditSpinnerCachePrivate)) + +struct _GeditSpinnerCachePrivate +{ + /* Hash table of GdkScreen -> GeditSpinnerCacheData */ + GHashTable *hash; +}; + +typedef struct +{ + guint ref_count; + GtkIconSize size; + gint width; + gint height; + GdkPixbuf **animation_pixbufs; + guint n_animation_pixbufs; +} GeditSpinnerImages; + +#define LAST_ICON_SIZE GTK_ICON_SIZE_DIALOG + 1 +#define SPINNER_ICON_NAME "process-working" +#define SPINNER_FALLBACK_ICON_NAME "mate-spinner" +#define GEDIT_SPINNER_IMAGES_INVALID ((GeditSpinnerImages *) 0x1) + +typedef struct +{ + GdkScreen *screen; + GtkIconTheme *icon_theme; + GeditSpinnerImages *images[LAST_ICON_SIZE]; +} GeditSpinnerCacheData; + +static void gedit_spinner_cache_class_init (GeditSpinnerCacheClass *klass); +static void gedit_spinner_cache_init (GeditSpinnerCache *cache); + +static GObjectClass *gedit_spinner_cache_parent_class; + +static GType +gedit_spinner_cache_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) + { + const GTypeInfo our_info = + { + sizeof (GeditSpinnerCacheClass), + NULL, + NULL, + (GClassInitFunc) gedit_spinner_cache_class_init, + NULL, + NULL, + sizeof (GeditSpinnerCache), + 0, + (GInstanceInitFunc) gedit_spinner_cache_init + }; + + type = g_type_register_static (G_TYPE_OBJECT, + "GeditSpinnerCache", + &our_info, 0); + } + + return type; +} + +static GeditSpinnerImages * +gedit_spinner_images_ref (GeditSpinnerImages *images) +{ + g_return_val_if_fail (images != NULL, NULL); + + images->ref_count++; + + return images; +} + +static void +gedit_spinner_images_unref (GeditSpinnerImages *images) +{ + g_return_if_fail (images != NULL); + + images->ref_count--; + if (images->ref_count == 0) + { + guint i; + + /* LOG ("Freeing spinner images %p for size %d", images, images->size); */ + + for (i = 0; i < images->n_animation_pixbufs; ++i) + { + g_object_unref (images->animation_pixbufs[i]); + } + g_free (images->animation_pixbufs); + + g_free (images); + } +} + +static void +gedit_spinner_cache_data_unload (GeditSpinnerCacheData *data) +{ + GtkIconSize size; + GeditSpinnerImages *images; + + g_return_if_fail (data != NULL); + + /* LOG ("GeditSpinnerDataCache unload for screen %p", data->screen); */ + + for (size = GTK_ICON_SIZE_INVALID; size < LAST_ICON_SIZE; ++size) + { + images = data->images[size]; + data->images[size] = NULL; + + if (images != NULL && images != GEDIT_SPINNER_IMAGES_INVALID) + { + gedit_spinner_images_unref (images); + } + } +} + +static GdkPixbuf * +extract_frame (GdkPixbuf *grid_pixbuf, + int x, + int y, + int size) +{ + GdkPixbuf *pixbuf; + + if (x + size > gdk_pixbuf_get_width (grid_pixbuf) || + y + size > gdk_pixbuf_get_height (grid_pixbuf)) + { + return NULL; + } + + pixbuf = gdk_pixbuf_new_subpixbuf (grid_pixbuf, + x, y, + size, size); + g_return_val_if_fail (pixbuf != NULL, NULL); + + return pixbuf; +} + +static GdkPixbuf * +scale_to_size (GdkPixbuf *pixbuf, + int dw, + int dh) +{ + GdkPixbuf *result; + int pw, ph; + + g_return_val_if_fail (pixbuf != NULL, NULL); + + pw = gdk_pixbuf_get_width (pixbuf); + ph = gdk_pixbuf_get_height (pixbuf); + + if (pw != dw || ph != dh) + { + result = gdk_pixbuf_scale_simple (pixbuf, dw, dh, + GDK_INTERP_BILINEAR); + g_object_unref (pixbuf); + return result; + } + + return pixbuf; +} + +static GeditSpinnerImages * +gedit_spinner_images_load (GdkScreen *screen, + GtkIconTheme *icon_theme, + GtkIconSize icon_size) +{ + GeditSpinnerImages *images; + GdkPixbuf *icon_pixbuf, *pixbuf; + GtkIconInfo *icon_info = NULL; + int grid_width, grid_height, x, y, requested_size, size, isw, ish, n; + const char *icon; + GSList *list = NULL, *l; + + /* LOG ("GeditSpinnerCacheData loading for screen %p at size %d", screen, icon_size); */ + + /* START_PROFILER ("loading spinner animation") */ + + if (!gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen), + icon_size, &isw, &ish)) + goto loser; + + requested_size = MAX (ish, isw); + + /* Load the animation. The 'rest icon' is the 0th frame */ + icon_info = gtk_icon_theme_lookup_icon (icon_theme, + SPINNER_ICON_NAME, + requested_size, 0); + if (icon_info == NULL) + { + g_warning ("Throbber animation not found"); + + /* If the icon naming spec compliant name wasn't found, try the old name */ + icon_info = gtk_icon_theme_lookup_icon (icon_theme, + SPINNER_FALLBACK_ICON_NAME, + requested_size, 0); + if (icon_info == NULL) + { + g_warning ("Throbber fallback animation not found either"); + goto loser; + } + } + + g_assert (icon_info != NULL); + + size = gtk_icon_info_get_base_size (icon_info); + icon = gtk_icon_info_get_filename (icon_info); + + if (icon == NULL) + goto loser; + + icon_pixbuf = gdk_pixbuf_new_from_file (icon, NULL); + gtk_icon_info_free (icon_info); + icon_info = NULL; + + if (icon_pixbuf == NULL) + { + g_warning ("Could not load the spinner file"); + goto loser; + } + + grid_width = gdk_pixbuf_get_width (icon_pixbuf); + grid_height = gdk_pixbuf_get_height (icon_pixbuf); + + n = 0; + for (y = 0; y < grid_height; y += size) + { + for (x = 0; x < grid_width ; x += size) + { + pixbuf = extract_frame (icon_pixbuf, x, y, size); + + if (pixbuf) + { + list = g_slist_prepend (list, pixbuf); + ++n; + } + else + { + g_warning ("Cannot extract frame (%d, %d) from the grid\n", x, y); + } + } + } + + g_object_unref (icon_pixbuf); + + if (list == NULL) + goto loser; + + /* g_assert (n > 0); */ + + if (size > requested_size) + { + for (l = list; l != NULL; l = l->next) + { + l->data = scale_to_size (l->data, isw, ish); + } + } + + /* Now we've successfully got all the data */ + images = g_new (GeditSpinnerImages, 1); + images->ref_count = 1; + + images->size = icon_size; + images->width = images->height = requested_size; + + images->n_animation_pixbufs = n; + images->animation_pixbufs = g_new (GdkPixbuf *, n); + + for (l = list; l != NULL; l = l->next) + { + g_assert (l->data != NULL); + images->animation_pixbufs[--n] = l->data; + } + g_assert (n == 0); + + g_slist_free (list); + + /* STOP_PROFILER ("loading spinner animation") */ + return images; + +loser: + if (icon_info) + { + gtk_icon_info_free (icon_info); + } + + g_slist_foreach (list, (GFunc) g_object_unref, NULL); + + /* STOP_PROFILER ("loading spinner animation") */ + + return NULL; +} + +static GeditSpinnerCacheData * +gedit_spinner_cache_data_new (GdkScreen *screen) +{ + GeditSpinnerCacheData *data; + + data = g_new0 (GeditSpinnerCacheData, 1); + + data->screen = screen; + data->icon_theme = gtk_icon_theme_get_for_screen (screen); + g_signal_connect_swapped (data->icon_theme, + "changed", + G_CALLBACK (gedit_spinner_cache_data_unload), + data); + + return data; +} + +static void +gedit_spinner_cache_data_free (GeditSpinnerCacheData *data) +{ + g_return_if_fail (data != NULL); + g_return_if_fail (data->icon_theme != NULL); + + g_signal_handlers_disconnect_by_func (data->icon_theme, + G_CALLBACK (gedit_spinner_cache_data_unload), + data); + + gedit_spinner_cache_data_unload (data); + + g_free (data); +} + +static GeditSpinnerImages * +gedit_spinner_cache_get_images (GeditSpinnerCache *cache, + GdkScreen *screen, + GtkIconSize icon_size) +{ + GeditSpinnerCachePrivate *priv = cache->priv; + GeditSpinnerCacheData *data; + GeditSpinnerImages *images; + + /* LOG ("Getting animation images for screen %p at size %d", screen, icon_size); */ + + g_return_val_if_fail (icon_size >= 0 && icon_size < LAST_ICON_SIZE, NULL); + + /* Backward compat: "invalid" meant "native" size which doesn't exist anymore */ + if (icon_size == GTK_ICON_SIZE_INVALID) + { + icon_size = GTK_ICON_SIZE_DIALOG; + } + + data = g_hash_table_lookup (priv->hash, screen); + if (data == NULL) + { + data = gedit_spinner_cache_data_new (screen); + /* FIXME: think about what happens when the screen's display is closed later on */ + g_hash_table_insert (priv->hash, screen, data); + } + + images = data->images[icon_size]; + if (images == GEDIT_SPINNER_IMAGES_INVALID) + { + /* Load failed, but don't try endlessly again! */ + return NULL; + } + + if (images != NULL) + { + /* Return cached data */ + return gedit_spinner_images_ref (images); + } + + images = gedit_spinner_images_load (screen, data->icon_theme, icon_size); + + if (images == NULL) + { + /* Mark as failed-to-load */ + data->images[icon_size] = GEDIT_SPINNER_IMAGES_INVALID; + + return NULL; + } + + data->images[icon_size] = images; + + return gedit_spinner_images_ref (images); +} + +static void +gedit_spinner_cache_init (GeditSpinnerCache *cache) +{ + GeditSpinnerCachePrivate *priv; + + priv = cache->priv = GEDIT_SPINNER_CACHE_GET_PRIVATE (cache); + + /* LOG ("GeditSpinnerCache initialising"); */ + + priv->hash = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + NULL, + (GDestroyNotify) gedit_spinner_cache_data_free); +} + +static void +gedit_spinner_cache_finalize (GObject *object) +{ + GeditSpinnerCache *cache = GEDIT_SPINNER_CACHE (object); + GeditSpinnerCachePrivate *priv = cache->priv; + + g_hash_table_destroy (priv->hash); + + /* LOG ("GeditSpinnerCache finalised"); */ + + G_OBJECT_CLASS (gedit_spinner_cache_parent_class)->finalize (object); +} + +static void +gedit_spinner_cache_class_init (GeditSpinnerCacheClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + gedit_spinner_cache_parent_class = g_type_class_peek_parent (klass); + + object_class->finalize = gedit_spinner_cache_finalize; + + g_type_class_add_private (object_class, sizeof (GeditSpinnerCachePrivate)); +} + +static GeditSpinnerCache *spinner_cache = NULL; + +static GeditSpinnerCache * +gedit_spinner_cache_ref (void) +{ + if (spinner_cache == NULL) + { + GeditSpinnerCache **cache_ptr; + + spinner_cache = g_object_new (GEDIT_TYPE_SPINNER_CACHE, NULL); + cache_ptr = &spinner_cache; + g_object_add_weak_pointer (G_OBJECT (spinner_cache), + (gpointer *) cache_ptr); + + return spinner_cache; + } + + return g_object_ref (spinner_cache); +} + +/* Spinner implementation */ + +#define SPINNER_TIMEOUT 125 /* ms */ + +#define GEDIT_SPINNER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_SPINNER, GeditSpinnerPrivate)) + +struct _GeditSpinnerPrivate +{ + GtkIconTheme *icon_theme; + GeditSpinnerCache *cache; + GtkIconSize size; + GeditSpinnerImages *images; + guint current_image; + guint timeout; + guint timer_task; + guint spinning : 1; + guint need_load : 1; +}; + +static void gedit_spinner_class_init (GeditSpinnerClass *class); +static void gedit_spinner_init (GeditSpinner *spinner); + +static GObjectClass *parent_class; + +GType +gedit_spinner_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) + { + const GTypeInfo our_info = + { + sizeof (GeditSpinnerClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gedit_spinner_class_init, + NULL, + NULL, /* class_data */ + sizeof (GeditSpinner), + 0, /* n_preallocs */ + (GInstanceInitFunc) gedit_spinner_init + }; + + type = g_type_register_static (GTK_TYPE_WIDGET, + "GeditSpinner", + &our_info, 0); + } + + return type; +} + +static gboolean +gedit_spinner_load_images (GeditSpinner *spinner) +{ + GeditSpinnerPrivate *priv = spinner->priv; + + if (priv->need_load) + { + /* START_PROFILER ("gedit_spinner_load_images") */ + + priv->images = + gedit_spinner_cache_get_images (priv->cache, + gtk_widget_get_screen (GTK_WIDGET (spinner)), + priv->size); + + /* STOP_PROFILER ("gedit_spinner_load_images") */ + + priv->current_image = 0; /* 'rest' icon */ + priv->need_load = FALSE; + } + + return priv->images != NULL; +} + +static void +gedit_spinner_unload_images (GeditSpinner *spinner) +{ + GeditSpinnerPrivate *priv = spinner->priv; + + if (priv->images != NULL) + { + gedit_spinner_images_unref (priv->images); + priv->images = NULL; + } + + priv->current_image = 0; + priv->need_load = TRUE; +} + +static void +icon_theme_changed_cb (GtkIconTheme *icon_theme, + GeditSpinner *spinner) +{ + gedit_spinner_unload_images (spinner); + gtk_widget_queue_resize (GTK_WIDGET (spinner)); +} + +static void +gedit_spinner_init (GeditSpinner *spinner) +{ + GeditSpinnerPrivate *priv; + + priv = spinner->priv = GEDIT_SPINNER_GET_PRIVATE (spinner); + + GTK_WIDGET_SET_FLAGS (GTK_WIDGET (spinner), GTK_NO_WINDOW); + + priv->cache = gedit_spinner_cache_ref (); + priv->size = GTK_ICON_SIZE_DIALOG; + priv->spinning = FALSE; + priv->timeout = SPINNER_TIMEOUT; + priv->need_load = TRUE; +} + +static int +gedit_spinner_expose (GtkWidget *widget, + GdkEventExpose *event) +{ + GeditSpinner *spinner = GEDIT_SPINNER (widget); + GeditSpinnerPrivate *priv = spinner->priv; + GeditSpinnerImages *images; + GdkPixbuf *pixbuf; + GdkGC *gc; + int x_offset, y_offset, width, height; + GdkRectangle pix_area, dest; + + if (!GTK_WIDGET_DRAWABLE (spinner)) + { + return FALSE; + } + + if (priv->need_load && + !gedit_spinner_load_images (spinner)) + { + return FALSE; + } + + images = priv->images; + if (images == NULL) + { + return FALSE; + } + + /* Otherwise |images| will be NULL anyway */ + g_assert (images->n_animation_pixbufs > 0); + + g_assert (priv->current_image >= 0 && + priv->current_image < images->n_animation_pixbufs); + + pixbuf = images->animation_pixbufs[priv->current_image]; + + g_assert (pixbuf != NULL); + + width = gdk_pixbuf_get_width (pixbuf); + height = gdk_pixbuf_get_height (pixbuf); + + /* Compute the offsets for the image centered on our allocation */ + x_offset = (widget->allocation.width - width) / 2; + y_offset = (widget->allocation.height - height) / 2; + + pix_area.x = x_offset + widget->allocation.x; + pix_area.y = y_offset + widget->allocation.y; + pix_area.width = width; + pix_area.height = height; + + if (!gdk_rectangle_intersect (&event->area, &pix_area, &dest)) + { + return FALSE; + } + + gc = gdk_gc_new (widget->window); + gdk_draw_pixbuf (widget->window, gc, pixbuf, + dest.x - x_offset - widget->allocation.x, + dest.y - y_offset - widget->allocation.y, + dest.x, dest.y, + dest.width, dest.height, + GDK_RGB_DITHER_MAX, 0, 0); + g_object_unref (gc); + + return FALSE; +} + +static gboolean +bump_spinner_frame_cb (GeditSpinner *spinner) +{ + GeditSpinnerPrivate *priv = spinner->priv; + + /* This can happen when we've unloaded the images on a theme + * change, but haven't been in the queued size request yet. + * Just skip this update. + */ + if (priv->images == NULL) + return TRUE; + + priv->current_image++; + if (priv->current_image >= priv->images->n_animation_pixbufs) + { + /* the 0th frame is the 'rest' icon */ + priv->current_image = MIN (1, priv->images->n_animation_pixbufs); + } + + gtk_widget_queue_draw (GTK_WIDGET (spinner)); + + /* run again */ + return TRUE; +} + +/** + * gedit_spinner_start: + * @spinner: a #GeditSpinner + * + * Start the spinner animation. + **/ +void +gedit_spinner_start (GeditSpinner *spinner) +{ + GeditSpinnerPrivate *priv = spinner->priv; + + priv->spinning = TRUE; + + if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)) && + priv->timer_task == 0 && + gedit_spinner_load_images (spinner)) + { + /* the 0th frame is the 'rest' icon */ + priv->current_image = MIN (1, priv->images->n_animation_pixbufs); + + priv->timer_task = g_timeout_add_full (G_PRIORITY_LOW, + priv->timeout, + (GSourceFunc) bump_spinner_frame_cb, + spinner, + NULL); + } +} + +static void +gedit_spinner_remove_update_callback (GeditSpinner *spinner) +{ + GeditSpinnerPrivate *priv = spinner->priv; + + if (priv->timer_task != 0) + { + g_source_remove (priv->timer_task); + priv->timer_task = 0; + } +} + +/** + * gedit_spinner_stop: + * @spinner: a #GeditSpinner + * + * Stop the spinner animation. + **/ +void +gedit_spinner_stop (GeditSpinner *spinner) +{ + GeditSpinnerPrivate *priv = spinner->priv; + + priv->spinning = FALSE; + priv->current_image = 0; + + if (priv->timer_task != 0) + { + gedit_spinner_remove_update_callback (spinner); + + if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner))) + gtk_widget_queue_draw (GTK_WIDGET (spinner)); + } +} + +/* + * gedit_spinner_set_size: + * @spinner: a #GeditSpinner + * @size: the size of type %GtkIconSize + * + * Set the size of the spinner. + **/ +void +gedit_spinner_set_size (GeditSpinner *spinner, + GtkIconSize size) +{ + if (size == GTK_ICON_SIZE_INVALID) + { + size = GTK_ICON_SIZE_DIALOG; + } + + if (size != spinner->priv->size) + { + gedit_spinner_unload_images (spinner); + + spinner->priv->size = size; + + gtk_widget_queue_resize (GTK_WIDGET (spinner)); + } +} + +#if 0 +/* +* gedit_spinner_set_timeout: +* @spinner: a #GeditSpinner +* @timeout: time delay between updates to the spinner. +* +* Sets the timeout delay for spinner updates. +**/ +void +gedit_spinner_set_timeout (GeditSpinner *spinner, + guint timeout) +{ + GeditSpinnerPrivate *priv = spinner->priv; + + if (timeout != priv->timeout) + { + gedit_spinner_stop (spinner); + + priv->timeout = timeout; + + if (priv->spinning) + { + gedit_spinner_start (spinner); + } + } +} +#endif + +static void +gedit_spinner_size_request (GtkWidget *widget, + GtkRequisition *requisition) +{ + GeditSpinner *spinner = GEDIT_SPINNER (widget); + GeditSpinnerPrivate *priv = spinner->priv; + + if ((priv->need_load && + !gedit_spinner_load_images (spinner)) || + priv->images == NULL) + { + requisition->width = requisition->height = 0; + gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (widget), + priv->size, + &requisition->width, + &requisition->height); + return; + } + + requisition->width = priv->images->width; + requisition->height = priv->images->height; + + /* FIXME fix this hack */ + /* allocate some extra margin so we don't butt up against toolbar edges */ + if (priv->size != GTK_ICON_SIZE_MENU) + { + requisition->width += 2; + requisition->height += 2; + } +} + +static void +gedit_spinner_map (GtkWidget *widget) +{ + GeditSpinner *spinner = GEDIT_SPINNER (widget); + GeditSpinnerPrivate *priv = spinner->priv; + + GTK_WIDGET_CLASS (parent_class)->map (widget); + + if (priv->spinning) + { + gedit_spinner_start (spinner); + } +} + +static void +gedit_spinner_unmap (GtkWidget *widget) +{ + GeditSpinner *spinner = GEDIT_SPINNER (widget); + + gedit_spinner_remove_update_callback (spinner); + + GTK_WIDGET_CLASS (parent_class)->unmap (widget); +} + +static void +gedit_spinner_dispose (GObject *object) +{ + GeditSpinner *spinner = GEDIT_SPINNER (object); + + g_signal_handlers_disconnect_by_func + (spinner->priv->icon_theme, + G_CALLBACK (icon_theme_changed_cb), spinner); + + G_OBJECT_CLASS (parent_class)->dispose (object); +} + +static void +gedit_spinner_finalize (GObject *object) +{ + GeditSpinner *spinner = GEDIT_SPINNER (object); + + gedit_spinner_remove_update_callback (spinner); + gedit_spinner_unload_images (spinner); + + g_object_unref (spinner->priv->cache); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +gedit_spinner_screen_changed (GtkWidget *widget, + GdkScreen *old_screen) +{ + GeditSpinner *spinner = GEDIT_SPINNER (widget); + GeditSpinnerPrivate *priv = spinner->priv; + GdkScreen *screen; + + if (GTK_WIDGET_CLASS (parent_class)->screen_changed) + { + GTK_WIDGET_CLASS (parent_class)->screen_changed (widget, old_screen); + } + + screen = gtk_widget_get_screen (widget); + + /* FIXME: this seems to be happening when then spinner is destroyed!? */ + if (old_screen == screen) + return; + + /* We'll get mapped again on the new screen, but not unmapped from + * the old screen, so remove timeout here. + */ + gedit_spinner_remove_update_callback (spinner); + + gedit_spinner_unload_images (spinner); + + if (old_screen != NULL) + { + g_signal_handlers_disconnect_by_func + (gtk_icon_theme_get_for_screen (old_screen), + G_CALLBACK (icon_theme_changed_cb), spinner); + } + + priv->icon_theme = gtk_icon_theme_get_for_screen (screen); + g_signal_connect (priv->icon_theme, "changed", + G_CALLBACK (icon_theme_changed_cb), spinner); +} + +static void +gedit_spinner_class_init (GeditSpinnerClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); + + parent_class = g_type_class_peek_parent (class); + + object_class->dispose = gedit_spinner_dispose; + object_class->finalize = gedit_spinner_finalize; + + widget_class->expose_event = gedit_spinner_expose; + widget_class->size_request = gedit_spinner_size_request; + widget_class->map = gedit_spinner_map; + widget_class->unmap = gedit_spinner_unmap; + widget_class->screen_changed = gedit_spinner_screen_changed; + + g_type_class_add_private (object_class, sizeof (GeditSpinnerPrivate)); +} + +/* + * gedit_spinner_new: + * + * Create a new #GeditSpinner. The spinner is a widget + * that gives the user feedback about network status with + * an animated image. + * + * Return Value: the spinner #GtkWidget + **/ +GtkWidget * +gedit_spinner_new (void) +{ + return GTK_WIDGET (g_object_new (GEDIT_TYPE_SPINNER, NULL)); +} diff --git a/gedit/gedit-spinner.h b/gedit/gedit-spinner.h new file mode 100755 index 00000000..807ba7c3 --- /dev/null +++ b/gedit/gedit-spinner.h @@ -0,0 +1,95 @@ +/* + * gedit-spinner.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * Copyright (C) 2000 - Eazel, Inc. + * + * 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. + */ + +/* + * This widget was originally written by Andy Hertzfeld for + * Caja. + * + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_SPINNER_H__ +#define __GEDIT_SPINNER_H__ + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_SPINNER (gedit_spinner_get_type ()) +#define GEDIT_SPINNER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_SPINNER, GeditSpinner)) +#define GEDIT_SPINNER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_SPINNER, GeditSpinnerClass)) +#define GEDIT_IS_SPINNER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_SPINNER)) +#define GEDIT_IS_SPINNER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_SPINNER)) +#define GEDIT_SPINNER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_SPINNER, GeditSpinnerClass)) + + +/* Private structure type */ +typedef struct _GeditSpinnerPrivate GeditSpinnerPrivate; + +/* + * Main object structure + */ +typedef struct _GeditSpinner GeditSpinner; + +struct _GeditSpinner +{ + GtkWidget parent; + + /*< private >*/ + GeditSpinnerPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditSpinnerClass GeditSpinnerClass; + +struct _GeditSpinnerClass +{ + GtkWidgetClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_spinner_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_spinner_new (void); + +void gedit_spinner_start (GeditSpinner *throbber); + +void gedit_spinner_stop (GeditSpinner *throbber); + +void gedit_spinner_set_size (GeditSpinner *spinner, + GtkIconSize size); + +G_END_DECLS + +#endif /* __GEDIT_SPINNER_H__ */ diff --git a/gedit/gedit-status-combo-box.c b/gedit/gedit-status-combo-box.c new file mode 100755 index 00000000..71ea8c9f --- /dev/null +++ b/gedit/gedit-status-combo-box.c @@ -0,0 +1,418 @@ +/* + * gedit-status-combo-box.c + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +#include "gedit-status-combo-box.h" + +#define COMBO_BOX_TEXT_DATA "GeditStatusComboBoxTextData" + +#define GEDIT_STATUS_COMBO_BOX_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_STATUS_COMBO_BOX, GeditStatusComboBoxPrivate)) + +struct _GeditStatusComboBoxPrivate +{ + GtkWidget *frame; + GtkWidget *button; + GtkWidget *hbox; + GtkWidget *label; + GtkWidget *item; + GtkWidget *arrow; + + GtkWidget *menu; + GtkWidget *current_item; +}; + +/* Signals */ +enum +{ + CHANGED, + NUM_SIGNALS +}; + +/* Properties */ +enum +{ + PROP_0, + + PROP_LABEL +}; + +static guint signals[NUM_SIGNALS] = { 0 }; + +G_DEFINE_TYPE(GeditStatusComboBox, gedit_status_combo_box, GTK_TYPE_EVENT_BOX) + +static void +gedit_status_combo_box_finalize (GObject *object) +{ + G_OBJECT_CLASS (gedit_status_combo_box_parent_class)->finalize (object); +} + +static void +gedit_status_combo_box_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditStatusComboBox *obj = GEDIT_STATUS_COMBO_BOX (object); + + switch (prop_id) + { + case PROP_LABEL: + g_value_set_string (value, gedit_status_combo_box_get_label (obj)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_status_combo_box_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditStatusComboBox *obj = GEDIT_STATUS_COMBO_BOX (object); + + switch (prop_id) + { + case PROP_LABEL: + gedit_status_combo_box_set_label (obj, g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_status_combo_box_changed (GeditStatusComboBox *combo, + GtkMenuItem *item) +{ + const gchar *text; + + text = g_object_get_data (G_OBJECT (item), COMBO_BOX_TEXT_DATA); + + if (text != NULL) + { + gtk_label_set_markup (GTK_LABEL (combo->priv->item), text); + combo->priv->current_item = GTK_WIDGET (item); + } +} + +static void +gedit_status_combo_box_class_init (GeditStatusComboBoxClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_status_combo_box_finalize; + object_class->get_property = gedit_status_combo_box_get_property; + object_class->set_property = gedit_status_combo_box_set_property; + + klass->changed = gedit_status_combo_box_changed; + + signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditStatusComboBoxClass, + changed), NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, + GTK_TYPE_MENU_ITEM); + + g_object_class_install_property (object_class, PROP_LABEL, + g_param_spec_string ("label", + "LABEL", + "The label", + NULL, + G_PARAM_READWRITE)); + + /* Set up a style for the button to decrease spacing. */ + gtk_rc_parse_string ( + "style \"gedit-status-combo-button-style\"\n" + "{\n" + " GtkWidget::focus-padding = 0\n" + " GtkWidget::focus-line-width = 0\n" + " xthickness = 0\n" + " ythickness = 0\n" + "}\n" + "widget \"*.gedit-status-combo-button\" style \"gedit-status-combo-button-style\""); + + g_type_class_add_private (object_class, sizeof(GeditStatusComboBoxPrivate)); +} + +static void +menu_deactivate (GtkMenu *menu, + GeditStatusComboBox *combo) +{ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo->priv->button), FALSE); +} + +static void +menu_position_func (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + GeditStatusComboBox *combo) +{ + GtkRequisition request; + + *push_in = FALSE; + + gtk_widget_size_request (gtk_widget_get_toplevel (GTK_WIDGET (menu)), &request); + + /* get the origin... */ + gdk_window_get_origin (GTK_WIDGET (combo)->window, x, y); + + /* make the menu as wide as the widget */ + if (request.width < GTK_WIDGET (combo)->allocation.width) + { + gtk_widget_set_size_request (GTK_WIDGET (menu), GTK_WIDGET (combo)->allocation.width, -1); + } + + /* position it above the widget */ + *y -= request.height; +} + +static void +button_press_event (GtkWidget *widget, + GdkEventButton *event, + GeditStatusComboBox *combo) +{ + GtkRequisition request; + gint max_height; + + gtk_widget_size_request (combo->priv->menu, &request); + + /* do something relative to our own height here, maybe we can do better */ + max_height = GTK_WIDGET (combo)->allocation.height * 20; + + if (request.height > max_height) + { + gtk_widget_set_size_request (combo->priv->menu, -1, max_height); + gtk_widget_set_size_request (gtk_widget_get_toplevel (combo->priv->menu), -1, max_height); + } + + gtk_menu_popup (GTK_MENU (combo->priv->menu), + NULL, + NULL, + (GtkMenuPositionFunc)menu_position_func, + combo, + event->button, + event->time); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo->priv->button), TRUE); + + if (combo->priv->current_item) + { + gtk_menu_shell_select_item (GTK_MENU_SHELL (combo->priv->menu), + combo->priv->current_item); + } +} + +static void +set_shadow_type (GeditStatusComboBox *combo) +{ + GtkShadowType shadow_type; + GtkWidget *statusbar; + + /* This is a hack needed to use the shadow type of a statusbar */ + statusbar = gtk_statusbar_new (); + gtk_widget_ensure_style (statusbar); + + gtk_widget_style_get (statusbar, "shadow-type", &shadow_type, NULL); + gtk_frame_set_shadow_type (GTK_FRAME (combo->priv->frame), shadow_type); + + gtk_widget_destroy (statusbar); +} + +static void +gedit_status_combo_box_init (GeditStatusComboBox *self) +{ + self->priv = GEDIT_STATUS_COMBO_BOX_GET_PRIVATE (self); + + gtk_event_box_set_visible_window (GTK_EVENT_BOX (self), TRUE); + + self->priv->frame = gtk_frame_new (NULL); + gtk_widget_show (self->priv->frame); + + self->priv->button = gtk_toggle_button_new (); + gtk_widget_set_name (self->priv->button, "gedit-status-combo-button"); + gtk_button_set_relief (GTK_BUTTON (self->priv->button), GTK_RELIEF_NONE); + gtk_widget_show (self->priv->button); + + set_shadow_type (self); + + self->priv->hbox = gtk_hbox_new (FALSE, 3); + gtk_widget_show (self->priv->hbox); + + gtk_container_add (GTK_CONTAINER (self), self->priv->frame); + gtk_container_add (GTK_CONTAINER (self->priv->frame), self->priv->button); + gtk_container_add (GTK_CONTAINER (self->priv->button), self->priv->hbox); + + self->priv->label = gtk_label_new (""); + gtk_widget_show (self->priv->label); + + gtk_label_set_single_line_mode (GTK_LABEL (self->priv->label), TRUE); + gtk_misc_set_alignment (GTK_MISC (self->priv->label), 0.0, 0.5); + + gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->label, FALSE, TRUE, 0); + + self->priv->item = gtk_label_new (""); + gtk_widget_show (self->priv->item); + + gtk_label_set_single_line_mode (GTK_LABEL (self->priv->item), TRUE); + gtk_misc_set_alignment (GTK_MISC (self->priv->item), 0, 0.5); + + gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->item, TRUE, TRUE, 0); + + self->priv->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); + gtk_widget_show (self->priv->arrow); + gtk_misc_set_alignment (GTK_MISC (self->priv->arrow), 0.5, 0.5); + + gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->arrow, FALSE, TRUE, 0); + + self->priv->menu = gtk_menu_new (); + g_object_ref_sink (self->priv->menu); + + g_signal_connect (self->priv->button, + "button-press-event", + G_CALLBACK (button_press_event), + self); + g_signal_connect (self->priv->menu, + "deactivate", + G_CALLBACK (menu_deactivate), + self); +} + +/* public functions */ +GtkWidget * +gedit_status_combo_box_new (const gchar *label) +{ + return g_object_new (GEDIT_TYPE_STATUS_COMBO_BOX, "label", label, NULL); +} + +void +gedit_status_combo_box_set_label (GeditStatusComboBox *combo, + const gchar *label) +{ + gchar *text; + + g_return_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo)); + + text = g_strconcat (" ", label, ": ", NULL); + gtk_label_set_markup (GTK_LABEL (combo->priv->label), text); + g_free (text); +} + +const gchar * +gedit_status_combo_box_get_label (GeditStatusComboBox *combo) +{ + g_return_val_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo), NULL); + + return gtk_label_get_label (GTK_LABEL (combo->priv->label)); +} + +static void +item_activated (GtkMenuItem *item, + GeditStatusComboBox *combo) +{ + gedit_status_combo_box_set_item (combo, item); +} + +void +gedit_status_combo_box_add_item (GeditStatusComboBox *combo, + GtkMenuItem *item, + const gchar *text) +{ + g_return_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo)); + g_return_if_fail (GTK_IS_MENU_ITEM (item)); + + gtk_menu_shell_append (GTK_MENU_SHELL (combo->priv->menu), GTK_WIDGET (item)); + + gedit_status_combo_box_set_item_text (combo, item, text); + g_signal_connect (item, "activate", G_CALLBACK (item_activated), combo); +} + +void +gedit_status_combo_box_remove_item (GeditStatusComboBox *combo, + GtkMenuItem *item) +{ + g_return_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo)); + g_return_if_fail (GTK_IS_MENU_ITEM (item)); + + gtk_container_remove (GTK_CONTAINER (combo->priv->menu), + GTK_WIDGET (item)); +} + +GList * +gedit_status_combo_box_get_items (GeditStatusComboBox *combo) +{ + g_return_val_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo), NULL); + + return gtk_container_get_children (GTK_CONTAINER (combo->priv->menu)); +} + +const gchar * +gedit_status_combo_box_get_item_text (GeditStatusComboBox *combo, + GtkMenuItem *item) +{ + const gchar *ret = NULL; + + g_return_val_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo), NULL); + g_return_val_if_fail (GTK_IS_MENU_ITEM (item), NULL); + + ret = g_object_get_data (G_OBJECT (item), COMBO_BOX_TEXT_DATA); + + return ret; +} + +void +gedit_status_combo_box_set_item_text (GeditStatusComboBox *combo, + GtkMenuItem *item, + const gchar *text) +{ + g_return_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo)); + g_return_if_fail (GTK_IS_MENU_ITEM (item)); + + g_object_set_data_full (G_OBJECT (item), + COMBO_BOX_TEXT_DATA, + g_strdup (text), + (GDestroyNotify)g_free); +} + +void +gedit_status_combo_box_set_item (GeditStatusComboBox *combo, + GtkMenuItem *item) +{ + g_return_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo)); + g_return_if_fail (GTK_IS_MENU_ITEM (item)); + + g_signal_emit (combo, signals[CHANGED], 0, item, NULL); +} + +GtkLabel * +gedit_status_combo_box_get_item_label (GeditStatusComboBox *combo) +{ + g_return_val_if_fail (GEDIT_IS_STATUS_COMBO_BOX (combo), NULL); + + return GTK_LABEL (combo->priv->item); +} + diff --git a/gedit/gedit-status-combo-box.h b/gedit/gedit-status-combo-box.h new file mode 100755 index 00000000..e3593a8a --- /dev/null +++ b/gedit/gedit-status-combo-box.h @@ -0,0 +1,82 @@ +/* + * gedit-status-combo-box.h + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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 __GEDIT_STATUS_COMBO_BOX_H__ +#define __GEDIT_STATUS_COMBO_BOX_H__ + +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_STATUS_COMBO_BOX (gedit_status_combo_box_get_type ()) +#define GEDIT_STATUS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_STATUS_COMBO_BOX, GeditStatusComboBox)) +#define GEDIT_STATUS_COMBO_BOX_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_STATUS_COMBO_BOX, GeditStatusComboBox const)) +#define GEDIT_STATUS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_STATUS_COMBO_BOX, GeditStatusComboBoxClass)) +#define GEDIT_IS_STATUS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_STATUS_COMBO_BOX)) +#define GEDIT_IS_STATUS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_STATUS_COMBO_BOX)) +#define GEDIT_STATUS_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_STATUS_COMBO_BOX, GeditStatusComboBoxClass)) + +typedef struct _GeditStatusComboBox GeditStatusComboBox; +typedef struct _GeditStatusComboBoxClass GeditStatusComboBoxClass; +typedef struct _GeditStatusComboBoxPrivate GeditStatusComboBoxPrivate; + +struct _GeditStatusComboBox { + GtkEventBox parent; + + GeditStatusComboBoxPrivate *priv; +}; + +struct _GeditStatusComboBoxClass { + GtkEventBoxClass parent_class; + + void (*changed) (GeditStatusComboBox *combo, + GtkMenuItem *item); +}; + +GType gedit_status_combo_box_get_type (void) G_GNUC_CONST; +GtkWidget *gedit_status_combo_box_new (const gchar *label); + +const gchar *gedit_status_combo_box_get_label (GeditStatusComboBox *combo); +void gedit_status_combo_box_set_label (GeditStatusComboBox *combo, + const gchar *label); + +void gedit_status_combo_box_add_item (GeditStatusComboBox *combo, + GtkMenuItem *item, + const gchar *text); +void gedit_status_combo_box_remove_item (GeditStatusComboBox *combo, + GtkMenuItem *item); + +GList *gedit_status_combo_box_get_items (GeditStatusComboBox *combo); +const gchar *gedit_status_combo_box_get_item_text (GeditStatusComboBox *combo, + GtkMenuItem *item); +void gedit_status_combo_box_set_item_text (GeditStatusComboBox *combo, + GtkMenuItem *item, + const gchar *text); + +void gedit_status_combo_box_set_item (GeditStatusComboBox *combo, + GtkMenuItem *item); + +GtkLabel *gedit_status_combo_box_get_item_label (GeditStatusComboBox *combo); + +G_END_DECLS + +#endif /* __GEDIT_STATUS_COMBO_BOX_H__ */ diff --git a/gedit/gedit-statusbar.c b/gedit/gedit-statusbar.c new file mode 100755 index 00000000..178147c8 --- /dev/null +++ b/gedit/gedit-statusbar.c @@ -0,0 +1,448 @@ +/* + * gedit-statusbar.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Borelli + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "gedit-statusbar.h" + +#define GEDIT_STATUSBAR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),\ + GEDIT_TYPE_STATUSBAR,\ + GeditStatusbarPrivate)) + +struct _GeditStatusbarPrivate +{ + GtkWidget *overwrite_mode_statusbar; + GtkWidget *cursor_position_statusbar; + + GtkWidget *state_frame; + GtkWidget *load_image; + GtkWidget *save_image; + GtkWidget *print_image; + + GtkWidget *error_frame; + GtkWidget *error_event_box; + + /* tmp flash timeout data */ + guint flash_timeout; + guint flash_context_id; + guint flash_message_id; +}; + +G_DEFINE_TYPE(GeditStatusbar, gedit_statusbar, GTK_TYPE_STATUSBAR) + + +static gchar * +get_overwrite_mode_string (gboolean overwrite) +{ + return g_strconcat (" ", overwrite ? _("OVR") : _("INS"), NULL); +} + +static gint +get_overwrite_mode_length (void) +{ + return 2 + MAX (g_utf8_strlen (_("OVR"), -1), g_utf8_strlen (_("INS"), -1)); +} + +static void +gedit_statusbar_notify (GObject *object, + GParamSpec *pspec) +{ + /* don't allow gtk_statusbar_set_has_resize_grip to mess with us. + * See _gedit_statusbar_set_has_resize_grip for an explanation. + */ + if (strcmp (g_param_spec_get_name (pspec), "has-resize-grip") == 0) + { + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (object), FALSE); + return; + } + + if (G_OBJECT_CLASS (gedit_statusbar_parent_class)->notify) + G_OBJECT_CLASS (gedit_statusbar_parent_class)->notify (object, pspec); +} + +static void +gedit_statusbar_finalize (GObject *object) +{ + GeditStatusbar *statusbar = GEDIT_STATUSBAR (object); + + if (statusbar->priv->flash_timeout > 0) + g_source_remove (statusbar->priv->flash_timeout); + + G_OBJECT_CLASS (gedit_statusbar_parent_class)->finalize (object); +} + +static void +gedit_statusbar_class_init (GeditStatusbarClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->notify = gedit_statusbar_notify; + object_class->finalize = gedit_statusbar_finalize; + + g_type_class_add_private (object_class, sizeof (GeditStatusbarPrivate)); +} + +#define RESIZE_GRIP_EXTRA_WIDTH 30 + +static void +set_statusbar_width_chars (GtkWidget *statusbar, + gint n_chars, + gboolean has_resize_grip) +{ + PangoContext *context; + PangoFontMetrics *metrics; + gint char_width, digit_width, width; + GtkStyle *style; + + context = gtk_widget_get_pango_context (statusbar); + style = gtk_widget_get_style (GTK_WIDGET (statusbar)); + metrics = pango_context_get_metrics (context, + style->font_desc, + pango_context_get_language (context)); + + char_width = pango_font_metrics_get_approximate_digit_width (metrics); + digit_width = pango_font_metrics_get_approximate_char_width (metrics); + + width = PANGO_PIXELS (MAX (char_width, digit_width) * n_chars); + + pango_font_metrics_unref (metrics); + + /* If there is a resize grip, allocate some extra width. + * It would be nice to calculate the exact size programmatically + * but I could not find out how to do it */ + if (has_resize_grip) + width += RESIZE_GRIP_EXTRA_WIDTH; + + gtk_widget_set_size_request (statusbar, width, -1); +} + +static void +gedit_statusbar_init (GeditStatusbar *statusbar) +{ + GtkWidget *hbox; + GtkWidget *error_image; + + statusbar->priv = GEDIT_STATUSBAR_GET_PRIVATE (statusbar); + + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), FALSE); + + statusbar->priv->overwrite_mode_statusbar = gtk_statusbar_new (); + gtk_widget_show (statusbar->priv->overwrite_mode_statusbar); + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar->priv->overwrite_mode_statusbar), + TRUE); + set_statusbar_width_chars (statusbar->priv->overwrite_mode_statusbar, + get_overwrite_mode_length (), + TRUE); + gtk_box_pack_end (GTK_BOX (statusbar), + statusbar->priv->overwrite_mode_statusbar, + FALSE, TRUE, 0); + + statusbar->priv->cursor_position_statusbar = gtk_statusbar_new (); + gtk_widget_show (statusbar->priv->cursor_position_statusbar); + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar->priv->cursor_position_statusbar), + FALSE); + set_statusbar_width_chars (statusbar->priv->cursor_position_statusbar, 18, FALSE); + gtk_box_pack_end (GTK_BOX (statusbar), + statusbar->priv->cursor_position_statusbar, + FALSE, TRUE, 0); + + statusbar->priv->state_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (statusbar->priv->state_frame), GTK_SHADOW_IN); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (statusbar->priv->state_frame), hbox); + + statusbar->priv->load_image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); + statusbar->priv->save_image = gtk_image_new_from_stock (GTK_STOCK_SAVE, GTK_ICON_SIZE_MENU); + statusbar->priv->print_image = gtk_image_new_from_stock (GTK_STOCK_PRINT, GTK_ICON_SIZE_MENU); + + gtk_widget_show (hbox); + + gtk_box_pack_start (GTK_BOX (hbox), + statusbar->priv->load_image, + FALSE, TRUE, 4); + gtk_box_pack_start (GTK_BOX (hbox), + statusbar->priv->save_image, + FALSE, TRUE, 4); + gtk_box_pack_start (GTK_BOX (hbox), + statusbar->priv->print_image, + FALSE, TRUE, 4); + + gtk_box_pack_start (GTK_BOX (statusbar), + statusbar->priv->state_frame, + FALSE, TRUE, 0); + + statusbar->priv->error_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (statusbar->priv->error_frame), GTK_SHADOW_IN); + + error_image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_MENU); + gtk_misc_set_padding (GTK_MISC (error_image), 4, 0); + gtk_widget_show (error_image); + + statusbar->priv->error_event_box = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (statusbar->priv->error_event_box), + FALSE); + gtk_widget_show (statusbar->priv->error_event_box); + + gtk_container_add (GTK_CONTAINER (statusbar->priv->error_frame), + statusbar->priv->error_event_box); + gtk_container_add (GTK_CONTAINER (statusbar->priv->error_event_box), + error_image); + + gtk_box_pack_start (GTK_BOX (statusbar), + statusbar->priv->error_frame, + FALSE, TRUE, 0); + + gtk_box_reorder_child (GTK_BOX (statusbar), + statusbar->priv->error_frame, + 0); +} + +/** + * gedit_statusbar_new: + * + * Creates a new #GeditStatusbar. + * + * Return value: the new #GeditStatusbar object + **/ +GtkWidget * +gedit_statusbar_new (void) +{ + return GTK_WIDGET (g_object_new (GEDIT_TYPE_STATUSBAR, NULL)); +} + +/** + * gedit_set_has_resize_grip: + * @statusbar: a #GeditStatusbar + * @show: if the resize grip is shown + * + * Sets if a resize grip showld be shown. + * + **/ + /* + * I don't like this much, in a perfect world it would have been + * possible to override the parent property and use + * gtk_statusbar_set_has_resize_grip. Unfortunately this is not + * possible and it's not even possible to intercept the notify signal + * since the parent property should always be set to false thus when + * using set_resize_grip (FALSE) the property doesn't change and the + * notification is not emitted. + * For now just add this private method; if needed we can turn it into + * a property. + */ +void +_gedit_statusbar_set_has_resize_grip (GeditStatusbar *bar, + gboolean show) +{ + g_return_if_fail (GEDIT_IS_STATUSBAR (bar)); + + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (bar->priv->overwrite_mode_statusbar), + show); +} + +/** + * gedit_statusbar_set_overwrite: + * @statusbar: a #GeditStatusbar + * @overwrite: if the overwrite mode is set + * + * Sets the overwrite mode on the statusbar. + **/ +void +gedit_statusbar_set_overwrite (GeditStatusbar *statusbar, + gboolean overwrite) +{ + gchar *msg; + + g_return_if_fail (GEDIT_IS_STATUSBAR (statusbar)); + + gtk_statusbar_pop (GTK_STATUSBAR (statusbar->priv->overwrite_mode_statusbar), 0); + + msg = get_overwrite_mode_string (overwrite); + + gtk_statusbar_push (GTK_STATUSBAR (statusbar->priv->overwrite_mode_statusbar), 0, msg); + + g_free (msg); +} + +void +gedit_statusbar_clear_overwrite (GeditStatusbar *statusbar) +{ + g_return_if_fail (GEDIT_IS_STATUSBAR (statusbar)); + + gtk_statusbar_pop (GTK_STATUSBAR (statusbar->priv->overwrite_mode_statusbar), 0); +} + +/** + * gedit_statusbar_cursor_position: + * @statusbar: an #GeditStatusbar + * @line: line position + * @col: column position + * + * Sets the cursor position on the statusbar. + **/ +void +gedit_statusbar_set_cursor_position (GeditStatusbar *statusbar, + gint line, + gint col) +{ + gchar *msg; + + g_return_if_fail (GEDIT_IS_STATUSBAR (statusbar)); + + gtk_statusbar_pop (GTK_STATUSBAR (statusbar->priv->cursor_position_statusbar), 0); + + if ((line == -1) && (col == -1)) + return; + + /* Translators: "Ln" is an abbreviation for "Line", Col is an abbreviation for "Column". Please, + use abbreviations if possible to avoid space problems. */ + msg = g_strdup_printf (_(" Ln %d, Col %d"), line, col); + + gtk_statusbar_push (GTK_STATUSBAR (statusbar->priv->cursor_position_statusbar), 0, msg); + + g_free (msg); +} + +static gboolean +remove_message_timeout (GeditStatusbar *statusbar) +{ + gtk_statusbar_remove (GTK_STATUSBAR (statusbar), + statusbar->priv->flash_context_id, + statusbar->priv->flash_message_id); + + /* remove the timeout */ + statusbar->priv->flash_timeout = 0; + return FALSE; +} + +/** + * gedit_statusbar_flash_message: + * @statusbar: a #GeditStatusbar + * @context_id: message context_id + * @format: message to flash on the statusbar + * + * Flash a temporary message on the statusbar. + */ +void +gedit_statusbar_flash_message (GeditStatusbar *statusbar, + guint context_id, + const gchar *format, ...) +{ + const guint32 flash_length = 3000; /* three seconds */ + va_list args; + gchar *msg; + + g_return_if_fail (GEDIT_IS_STATUSBAR (statusbar)); + g_return_if_fail (format != NULL); + + va_start (args, format); + msg = g_strdup_vprintf (format, args); + va_end (args); + + /* remove a currently ongoing flash message */ + if (statusbar->priv->flash_timeout > 0) + { + g_source_remove (statusbar->priv->flash_timeout); + statusbar->priv->flash_timeout = 0; + + gtk_statusbar_remove (GTK_STATUSBAR (statusbar), + statusbar->priv->flash_context_id, + statusbar->priv->flash_message_id); + } + + statusbar->priv->flash_context_id = context_id; + statusbar->priv->flash_message_id = gtk_statusbar_push (GTK_STATUSBAR (statusbar), + context_id, + msg); + + statusbar->priv->flash_timeout = g_timeout_add (flash_length, + (GtkFunction) remove_message_timeout, + statusbar); + + g_free (msg); +} + +void +gedit_statusbar_set_window_state (GeditStatusbar *statusbar, + GeditWindowState state, + gint num_of_errors) +{ + g_return_if_fail (GEDIT_IS_STATUSBAR (statusbar)); + + gtk_widget_hide (statusbar->priv->state_frame); + gtk_widget_hide (statusbar->priv->save_image); + gtk_widget_hide (statusbar->priv->load_image); + gtk_widget_hide (statusbar->priv->print_image); + + if (state & GEDIT_WINDOW_STATE_SAVING) + { + gtk_widget_show (statusbar->priv->state_frame); + gtk_widget_show (statusbar->priv->save_image); + } + if (state & GEDIT_WINDOW_STATE_LOADING) + { + gtk_widget_show (statusbar->priv->state_frame); + gtk_widget_show (statusbar->priv->load_image); + } + + if (state & GEDIT_WINDOW_STATE_PRINTING) + { + gtk_widget_show (statusbar->priv->state_frame); + gtk_widget_show (statusbar->priv->print_image); + } + + if (state & GEDIT_WINDOW_STATE_ERROR) + { + gchar *tip; + + tip = g_strdup_printf (ngettext("There is a tab with errors", + "There are %d tabs with errors", + num_of_errors), + num_of_errors); + + gtk_widget_set_tooltip_text (statusbar->priv->error_event_box, + tip); + g_free (tip); + + gtk_widget_show (statusbar->priv->error_frame); + } + else + { + gtk_widget_hide (statusbar->priv->error_frame); + } +} + + diff --git a/gedit/gedit-statusbar.h b/gedit/gedit-statusbar.h new file mode 100755 index 00000000..b98790b7 --- /dev/null +++ b/gedit/gedit-statusbar.h @@ -0,0 +1,99 @@ +/* + * gedit-statusbar.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Borelli + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef GEDIT_STATUSBAR_H +#define GEDIT_STATUSBAR_H + +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_STATUSBAR (gedit_statusbar_get_type ()) +#define GEDIT_STATUSBAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_STATUSBAR, GeditStatusbar)) +#define GEDIT_STATUSBAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_STATUSBAR, GeditStatusbarClass)) +#define GEDIT_IS_STATUSBAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_STATUSBAR)) +#define GEDIT_IS_STATUSBAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_STATUSBAR)) +#define GEDIT_STATUSBAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_STATUSBAR, GeditStatusbarClass)) + +typedef struct _GeditStatusbar GeditStatusbar; +typedef struct _GeditStatusbarPrivate GeditStatusbarPrivate; +typedef struct _GeditStatusbarClass GeditStatusbarClass; + +struct _GeditStatusbar +{ + GtkStatusbar parent; + + /* */ + GeditStatusbarPrivate *priv; +}; + +struct _GeditStatusbarClass +{ + GtkStatusbarClass parent_class; +}; + +GType gedit_statusbar_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_statusbar_new (void); + +/* FIXME: status is not defined in any .h */ +#define GeditStatus gint +void gedit_statusbar_set_window_state (GeditStatusbar *statusbar, + GeditWindowState state, + gint num_of_errors); + +void gedit_statusbar_set_overwrite (GeditStatusbar *statusbar, + gboolean overwrite); + +void gedit_statusbar_set_cursor_position (GeditStatusbar *statusbar, + gint line, + gint col); + +void gedit_statusbar_clear_overwrite (GeditStatusbar *statusbar); + +void gedit_statusbar_flash_message (GeditStatusbar *statusbar, + guint context_id, + const gchar *format, + ...) G_GNUC_PRINTF(3, 4); +/* FIXME: these would be nice for plugins... +void gedit_statusbar_add_widget (GeditStatusbar *statusbar, + GtkWidget *widget); +void gedit_statusbar_remove_widget (GeditStatusbar *statusbar, + GtkWidget *widget); +*/ + +/* + * Non exported functions + */ +void _gedit_statusbar_set_has_resize_grip (GeditStatusbar *statusbar, + gboolean show); + +G_END_DECLS + +#endif diff --git a/gedit/gedit-style-scheme-manager.c b/gedit/gedit-style-scheme-manager.c new file mode 100755 index 00000000..a65fedd7 --- /dev/null +++ b/gedit/gedit-style-scheme-manager.c @@ -0,0 +1,364 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-source-style-manager.c + * + * Copyright (C) 2007 - Paolo Borelli and Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2007. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#include +#include + +#include +#include + +#include "gedit-style-scheme-manager.h" +#include "gedit-prefs-manager.h" +#include "gedit-dirs.h" + +static GtkSourceStyleSchemeManager *style_scheme_manager = NULL; + +static gchar * +get_gedit_styles_path (void) +{ + gchar *config_dir; + gchar *dir = NULL; + + config_dir = gedit_dirs_get_user_config_dir (); + + if (config_dir != NULL) + { + dir = g_build_filename (config_dir, + "styles", + NULL); + g_free (config_dir); + } + + return dir; +} + +static void +add_gedit_styles_path (GtkSourceStyleSchemeManager *mgr) +{ + gchar *dir; + + dir = get_gedit_styles_path(); + + if (dir != NULL) + { + gtk_source_style_scheme_manager_append_search_path (mgr, dir); + g_free (dir); + } +} + +GtkSourceStyleSchemeManager * +gedit_get_style_scheme_manager (void) +{ + if (style_scheme_manager == NULL) + { + style_scheme_manager = gtk_source_style_scheme_manager_new (); + add_gedit_styles_path (style_scheme_manager); + } + + return style_scheme_manager; +} + +static gint +schemes_compare (gconstpointer a, gconstpointer b) +{ + GtkSourceStyleScheme *scheme_a = (GtkSourceStyleScheme *)a; + GtkSourceStyleScheme *scheme_b = (GtkSourceStyleScheme *)b; + + const gchar *name_a = gtk_source_style_scheme_get_name (scheme_a); + const gchar *name_b = gtk_source_style_scheme_get_name (scheme_b); + + return g_utf8_collate (name_a, name_b); +} + +GSList * +gedit_style_scheme_manager_list_schemes_sorted (GtkSourceStyleSchemeManager *manager) +{ + const gchar * const * scheme_ids; + GSList *schemes = NULL; + + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); + + scheme_ids = gtk_source_style_scheme_manager_get_scheme_ids (manager); + + while (*scheme_ids != NULL) + { + GtkSourceStyleScheme *scheme; + + scheme = gtk_source_style_scheme_manager_get_scheme (manager, + *scheme_ids); + + schemes = g_slist_prepend (schemes, scheme); + + ++scheme_ids; + } + + if (schemes != NULL) + schemes = g_slist_sort (schemes, (GCompareFunc)schemes_compare); + + return schemes; +} + +gboolean +_gedit_style_scheme_manager_scheme_is_gedit_user_scheme (GtkSourceStyleSchemeManager *manager, + const gchar *scheme_id) +{ + GtkSourceStyleScheme *scheme; + const gchar *filename; + gchar *dir; + gboolean res = FALSE; + + scheme = gtk_source_style_scheme_manager_get_scheme (manager, scheme_id); + if (scheme == NULL) + return FALSE; + + filename = gtk_source_style_scheme_get_filename (scheme); + if (filename == NULL) + return FALSE; + + dir = get_gedit_styles_path (); + + res = g_str_has_prefix (filename, dir); + + g_free (dir); + + return res; +} + +/** + * file_copy: + * @name: a pointer to a %NULL-terminated string, that names + * the file to be copied, in the GLib file name encoding + * @dest_name: a pointer to a %NULL-terminated string, that is the + * name for the destination file, in the GLib file name encoding + * @error: return location for a #GError, or %NULL + * + * Copies file @name to @dest_name. + * + * If the call was successful, it returns %TRUE. If the call was not + * successful, it returns %FALSE and sets @error. The error domain + * is #G_FILE_ERROR. Possible error + * codes are those in the #GFileError enumeration. + * + * Return value: %TRUE on success, %FALSE otherwise. + */ +static gboolean +file_copy (const gchar *name, + const gchar *dest_name, + GError **error) +{ + gchar *contents; + gsize length; + gchar *dest_dir; + + /* FIXME - Paolo (Aug. 13, 2007): + * Since the style scheme files are relatively small, we can implement + * file copy getting all the content of the source file in a buffer and + * then write the content to the destination file. In this way we + * can use the g_file_get_contents and g_file_set_contents and avoid to + * write custom code to copy the file (with sane error management). + * If needed we can improve this code later. */ + + g_return_val_if_fail (name != NULL, FALSE); + g_return_val_if_fail (dest_name != NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + /* Note: we allow to copy a file to itself since this is not a problem + * in our use case */ + + /* Ensure the destination directory exists */ + dest_dir = g_path_get_dirname (dest_name); + + errno = 0; + if (g_mkdir_with_parents (dest_dir, 0755) != 0) + { + gint save_errno = errno; + gchar *display_filename = g_filename_display_name (dest_dir); + + g_set_error (error, + G_FILE_ERROR, + g_file_error_from_errno (save_errno), + _("Directory '%s' could not be created: g_mkdir_with_parents() failed: %s"), + display_filename, + g_strerror (save_errno)); + + g_free (dest_dir); + g_free (display_filename); + + return FALSE; + } + + g_free (dest_dir); + + if (!g_file_get_contents (name, &contents, &length, error)) + return FALSE; + + if (!g_file_set_contents (dest_name, contents, length, error)) + return FALSE; + + g_free (contents); + + return TRUE; +} + +/** + * _gedit_style_scheme_manager_install_scheme: + * @manager: a #GtkSourceStyleSchemeManager + * @fname: the file name of the style scheme to be installed + * + * Install a new user scheme. + * This function copies @fname in #GEDIT_STYLES_DIR and ask the style manager to + * recompute the list of available style schemes. It then checks if a style + * scheme with the right file name exists. + * + * If the call was succesful, it returns the id of the installed scheme + * otherwise %NULL. + * + * Return value: the id of the installed scheme, %NULL otherwise. + */ +const gchar * +_gedit_style_scheme_manager_install_scheme (GtkSourceStyleSchemeManager *manager, + const gchar *fname) +{ + gchar *new_file_name = NULL; + gchar *dirname; + gchar *styles_dir; + GError *error = NULL; + gboolean copied = FALSE; + + const gchar* const *ids; + + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); + g_return_val_if_fail (fname != NULL, NULL); + + dirname = g_path_get_dirname (fname); + styles_dir = get_gedit_styles_path(); + + if (strcmp (dirname, styles_dir) != 0) + { + gchar *basename; + + basename = g_path_get_basename (fname); + new_file_name = g_build_filename (styles_dir, basename, NULL); + g_free (basename); + + /* Copy the style scheme file into GEDIT_STYLES_DIR */ + if (!file_copy (fname, new_file_name, &error)) + { + g_free (new_file_name); + + g_message ("Cannot install style scheme:\n%s", + error->message); + + return NULL; + } + + copied = TRUE; + } + else + { + new_file_name = g_strdup (fname); + } + + g_free (dirname); + g_free (styles_dir); + + /* Reload the available style schemes */ + gtk_source_style_scheme_manager_force_rescan (manager); + + /* Check the new style scheme has been actually installed */ + ids = gtk_source_style_scheme_manager_get_scheme_ids (manager); + + while (*ids != NULL) + { + GtkSourceStyleScheme *scheme; + const gchar *filename; + + scheme = gtk_source_style_scheme_manager_get_scheme ( + gedit_get_style_scheme_manager (), *ids); + + filename = gtk_source_style_scheme_get_filename (scheme); + + if (filename && (strcmp (filename, new_file_name) == 0)) + { + /* The style scheme has been correctly installed */ + g_free (new_file_name); + + return gtk_source_style_scheme_get_id (scheme); + } + ++ids; + } + + /* The style scheme has not been correctly installed */ + if (copied) + g_unlink (new_file_name); + + g_free (new_file_name); + + return NULL; +} + +/** + * _gedit_style_scheme_manager_uninstall_scheme: + * @manager: a #GtkSourceStyleSchemeManager + * @id: the id of the style scheme to be uninstalled + * + * Uninstall a user scheme. + * + * If the call was succesful, it returns %TRUE + * otherwise %FALSE. + * + * Return value: %TRUE on success, %FALSE otherwise. + */ +gboolean +_gedit_style_scheme_manager_uninstall_scheme (GtkSourceStyleSchemeManager *manager, + const gchar *id) +{ + GtkSourceStyleScheme *scheme; + const gchar *filename; + + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), FALSE); + g_return_val_if_fail (id != NULL, FALSE); + + scheme = gtk_source_style_scheme_manager_get_scheme (manager, id); + if (scheme == NULL) + return FALSE; + + filename = gtk_source_style_scheme_get_filename (scheme); + if (filename == NULL) + return FALSE; + + if (g_unlink (filename) == -1) + return FALSE; + + /* Reload the available style schemes */ + gtk_source_style_scheme_manager_force_rescan (manager); + + return TRUE; +} diff --git a/gedit/gedit-style-scheme-manager.h b/gedit/gedit-style-scheme-manager.h new file mode 100755 index 00000000..406719ae --- /dev/null +++ b/gedit/gedit-style-scheme-manager.h @@ -0,0 +1,56 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * gedit-style-scheme-manager.h + * + * Copyright (C) 2007 - Paolo Borelli + * + * 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. + * + * $Id: gedit-source-style-manager.h 5598 2007-04-15 13:16:24Z pborelli $ + */ + +#ifndef __GEDIT_STYLE_SCHEME_MANAGER_H__ +#define __GEDIT_STYLE_SCHEME_MANAGER_H__ + +#include + +G_BEGIN_DECLS + +GtkSourceStyleSchemeManager * + gedit_get_style_scheme_manager (void); + +/* Returns a sorted list of style schemes */ +GSList *gedit_style_scheme_manager_list_schemes_sorted + (GtkSourceStyleSchemeManager *manager); + +/* + * Non exported functions + */ +gboolean _gedit_style_scheme_manager_scheme_is_gedit_user_scheme + (GtkSourceStyleSchemeManager *manager, + const gchar *scheme_id); + +const gchar *_gedit_style_scheme_manager_install_scheme + (GtkSourceStyleSchemeManager *manager, + const gchar *fname); + +gboolean _gedit_style_scheme_manager_uninstall_scheme + (GtkSourceStyleSchemeManager *manager, + const gchar *id); + +G_END_DECLS + +#endif /* __GEDIT_STYLE_SCHEME_MANAGER_H__ */ diff --git a/gedit/gedit-tab-label.c b/gedit/gedit-tab-label.c new file mode 100755 index 00000000..a358ae94 --- /dev/null +++ b/gedit/gedit-tab-label.c @@ -0,0 +1,371 @@ +/* + * gedit-tab-label.c + * This file is part of gedit + * + * Copyright (C) 2010 - Paolo Borelli + * + * 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 +#endif + +#include +#include +#include "gedit-tab-label.h" +#include "gedit-close-button.h" + +#ifdef BUILD_SPINNER +#include "gedit-spinner.h" +#endif + +#define GEDIT_TAB_LABEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_TAB_LABEL, GeditTabLabelPrivate)) + +/* Signals */ +enum +{ + CLOSE_CLICKED, + LAST_SIGNAL +}; + +enum +{ + PROP_0, + PROP_TAB +}; + +struct _GeditTabLabelPrivate +{ + GeditTab *tab; + + GtkWidget *ebox; + GtkWidget *close_button; + GtkWidget *spinner; + GtkWidget *icon; + GtkWidget *label; + + gboolean close_button_sensitive; +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE (GeditTabLabel, gedit_tab_label, GTK_TYPE_HBOX) + +static void +gedit_tab_label_finalize (GObject *object) +{ + G_OBJECT_CLASS (gedit_tab_label_parent_class)->finalize (object); +} + +static void +gedit_tab_label_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditTabLabel *tab_label = GEDIT_TAB_LABEL (object); + + switch (prop_id) + { + case PROP_TAB: + tab_label->priv->tab = GEDIT_TAB (g_value_get_object (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_tab_label_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditTabLabel *tab_label = GEDIT_TAB_LABEL (object); + + switch (prop_id) + { + case PROP_TAB: + g_value_set_object (value, tab_label->priv->tab); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +close_button_clicked_cb (GtkWidget *widget, + GeditTabLabel *tab_label) +{ + g_signal_emit (tab_label, signals[CLOSE_CLICKED], 0, NULL); +} + +static void +sync_tip (GeditTab *tab, GeditTabLabel *tab_label) +{ + gchar *str; + + str = _gedit_tab_get_tooltips (tab); + g_return_if_fail (str != NULL); + + gtk_widget_set_tooltip_markup (tab_label->priv->ebox, str); + g_free (str); +} + +static void +sync_name (GeditTab *tab, GParamSpec *pspec, GeditTabLabel *tab_label) +{ + gchar *str; + + g_return_if_fail (tab == tab_label->priv->tab); + + str = _gedit_tab_get_name (tab); + g_return_if_fail (str != NULL); + + gtk_label_set_text (GTK_LABEL (tab_label->priv->label), str); + g_free (str); + + sync_tip (tab, tab_label); +} + +static void +sync_state (GeditTab *tab, GParamSpec *pspec, GeditTabLabel *tab_label) +{ + GeditTabState state; + + g_return_if_fail (tab == tab_label->priv->tab); + + state = gedit_tab_get_state (tab); + + gtk_widget_set_sensitive (tab_label->priv->close_button, + tab_label->priv->close_button_sensitive && + (state != GEDIT_TAB_STATE_CLOSING) && + (state != GEDIT_TAB_STATE_SAVING) && + (state != GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) && + (state != GEDIT_TAB_STATE_SAVING_ERROR)); + + if ((state == GEDIT_TAB_STATE_LOADING) || + (state == GEDIT_TAB_STATE_SAVING) || + (state == GEDIT_TAB_STATE_REVERTING)) + { + gtk_widget_hide (tab_label->priv->icon); + + gtk_widget_show (tab_label->priv->spinner); +#ifdef BUILD_SPINNER + gedit_spinner_start (GEDIT_SPINNER (tab_label->priv->spinner)); +#else + gtk_spinner_start (GTK_SPINNER (tab_label->priv->spinner)); +#endif + } + else + { + GdkPixbuf *pixbuf; + + pixbuf = _gedit_tab_get_icon (tab); + gtk_image_set_from_pixbuf (GTK_IMAGE (tab_label->priv->icon), pixbuf); + + if (pixbuf != NULL) + g_object_unref (pixbuf); + + gtk_widget_show (tab_label->priv->icon); + + gtk_widget_hide (tab_label->priv->spinner); +#ifdef BUILD_SPINNER + gedit_spinner_stop (GEDIT_SPINNER (tab_label->priv->spinner)); +#else + gtk_spinner_stop (GTK_SPINNER (tab_label->priv->spinner)); +#endif + } + + /* sync tip since encoding is known only after load/save end */ + sync_tip (tab, tab_label); +} + +static void +gedit_tab_label_constructed (GObject *object) +{ + GeditTabLabel *tab_label = GEDIT_TAB_LABEL (object); + + if (!tab_label->priv->tab) + { + g_critical ("The tab label was not properly constructed"); + return; + } + + sync_name (tab_label->priv->tab, NULL, tab_label); + sync_state (tab_label->priv->tab, NULL, tab_label); + + g_signal_connect_object (tab_label->priv->tab, + "notify::name", + G_CALLBACK (sync_name), + tab_label, + 0); + + g_signal_connect_object (tab_label->priv->tab, + "notify::state", + G_CALLBACK (sync_state), + tab_label, + 0); +} + +static void +gedit_tab_label_class_init (GeditTabLabelClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_tab_label_finalize; + object_class->set_property = gedit_tab_label_set_property; + object_class->get_property = gedit_tab_label_get_property; + object_class->constructed = gedit_tab_label_constructed; + + signals[CLOSE_CLICKED] = + g_signal_new ("close-clicked", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditTabLabelClass, close_clicked), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_object_class_install_property (object_class, + PROP_TAB, + g_param_spec_object ("tab", + "Tab", + "The GeditTab", + GEDIT_TYPE_TAB, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_type_class_add_private (object_class, sizeof(GeditTabLabelPrivate)); +} + +static void +gedit_tab_label_init (GeditTabLabel *tab_label) +{ + GtkWidget *ebox; + GtkWidget *hbox; + GtkWidget *close_button; + GtkWidget *spinner; + GtkWidget *icon; + GtkWidget *label; + GtkWidget *dummy_label; + + tab_label->priv = GEDIT_TAB_LABEL_GET_PRIVATE (tab_label); + + tab_label->priv->close_button_sensitive = TRUE; + + ebox = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE); + gtk_box_pack_start (GTK_BOX (tab_label), ebox, TRUE, TRUE, 0); + tab_label->priv->ebox = ebox; + + hbox = gtk_hbox_new (FALSE, 4); + gtk_container_add (GTK_CONTAINER (ebox), hbox); + + close_button = gedit_close_button_new (); + gtk_widget_set_tooltip_text (close_button, _("Close document")); + gtk_box_pack_start (GTK_BOX (tab_label), close_button, FALSE, FALSE, 0); + tab_label->priv->close_button = close_button; + + g_signal_connect (close_button, + "clicked", + G_CALLBACK (close_button_clicked_cb), + tab_label); + +#ifdef BUILD_SPINNER + spinner = gedit_spinner_new (); + gedit_spinner_set_size (GEDIT_SPINNER (spinner), GTK_ICON_SIZE_MENU); +#else + spinner = gtk_spinner_new (); +#endif + gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0); + tab_label->priv->spinner = spinner; + + /* setup icon, empty by default */ + icon = gtk_image_new (); + gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0); + tab_label->priv->icon = icon; + + label = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 0, 0); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + tab_label->priv->label = label; + + dummy_label = gtk_label_new (""); + gtk_box_pack_start (GTK_BOX (hbox), dummy_label, TRUE, TRUE, 0); + + gtk_widget_show (ebox); + gtk_widget_show (hbox); + gtk_widget_show (close_button); + gtk_widget_show (icon); + gtk_widget_show (label); + gtk_widget_show (dummy_label); +} + +void +gedit_tab_label_set_close_button_sensitive (GeditTabLabel *tab_label, + gboolean sensitive) +{ + GeditTabState state; + + g_return_if_fail (GEDIT_IS_TAB_LABEL (tab_label)); + + sensitive = (sensitive != FALSE); + + if (sensitive == tab_label->priv->close_button_sensitive) + return; + + tab_label->priv->close_button_sensitive = sensitive; + + state = gedit_tab_get_state (tab_label->priv->tab); + + gtk_widget_set_sensitive (tab_label->priv->close_button, + tab_label->priv->close_button_sensitive && + (state != GEDIT_TAB_STATE_CLOSING) && + (state != GEDIT_TAB_STATE_SAVING) && + (state != GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) && + (state != GEDIT_TAB_STATE_PRINTING) && + (state != GEDIT_TAB_STATE_PRINT_PREVIEWING) && + (state != GEDIT_TAB_STATE_SAVING_ERROR)); +} + +GeditTab * +gedit_tab_label_get_tab (GeditTabLabel *tab_label) +{ + g_return_val_if_fail (GEDIT_IS_TAB_LABEL (tab_label), NULL); + + return tab_label->priv->tab; +} + +GtkWidget * +gedit_tab_label_new (GeditTab *tab) +{ + GeditTabLabel *tab_label; + + tab_label = g_object_new (GEDIT_TYPE_TAB_LABEL, + "homogeneous", FALSE, + "tab", tab, + NULL); + + return GTK_WIDGET (tab_label); +} diff --git a/gedit/gedit-tab-label.h b/gedit/gedit-tab-label.h new file mode 100755 index 00000000..4b0360ad --- /dev/null +++ b/gedit/gedit-tab-label.h @@ -0,0 +1,66 @@ +/* + * gedit-tab-label.h + * This file is part of gedit + * + * Copyright (C) 2010 - Paolo Borelli + * + * 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 __GEDIT_TAB_LABEL_H__ +#define __GEDIT_TAB_LABEL_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_TAB_LABEL (gedit_tab_label_get_type ()) +#define GEDIT_TAB_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_TAB_LABEL, GeditTabLabel)) +#define GEDIT_TAB_LABEL_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_TAB_LABEL, GeditTabLabel const)) +#define GEDIT_TAB_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_TAB_LABEL, GeditTabLabelClass)) +#define GEDIT_IS_TAB_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_TAB_LABEL)) +#define GEDIT_IS_TAB_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_TAB_LABEL)) +#define GEDIT_TAB_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_TAB_LABEL, GeditTabLabelClass)) + +typedef struct _GeditTabLabel GeditTabLabel; +typedef struct _GeditTabLabelClass GeditTabLabelClass; +typedef struct _GeditTabLabelPrivate GeditTabLabelPrivate; + +struct _GeditTabLabel { + GtkHBox parent; + + GeditTabLabelPrivate *priv; +}; + +struct _GeditTabLabelClass { + GtkHBoxClass parent_class; + + void (* close_clicked) (GeditTabLabel *tab_label); +}; + +GType gedit_tab_label_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_tab_label_new (GeditTab *tab); + +GeditTab *gedit_tab_label_get_tab (GeditTabLabel *tab_label); + +void gedit_tab_label_set_close_button_sensitive (GeditTabLabel *tab_label, + gboolean sensitive); + +G_END_DECLS + +#endif /* __GEDIT_TAB_LABEL_H__ */ diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c new file mode 100755 index 00000000..9f26c692 --- /dev/null +++ b/gedit/gedit-tab.c @@ -0,0 +1,2832 @@ +/* + * gedit-tab.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "gedit-app.h" +#include "gedit-notebook.h" +#include "gedit-tab.h" +#include "gedit-utils.h" +#include "gedit-io-error-message-area.h" +#include "gedit-print-job.h" +#include "gedit-print-preview.h" +#include "gedit-progress-message-area.h" +#include "gedit-debug.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-enum-types.h" + +#if !GTK_CHECK_VERSION (2, 17, 1) +#include "gedit-message-area.h" +#endif + +#define GEDIT_TAB_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_TAB, GeditTabPrivate)) + +#define GEDIT_TAB_KEY "GEDIT_TAB_KEY" + +struct _GeditTabPrivate +{ + GeditTabState state; + + GtkWidget *view; + GtkWidget *view_scrolled_window; + + GtkWidget *message_area; + GtkWidget *print_preview; + + GeditPrintJob *print_job; + + /* tmp data for saving */ + gchar *tmp_save_uri; + + /* tmp data for loading */ + gint tmp_line_pos; + const GeditEncoding *tmp_encoding; + + GTimer *timer; + guint times_called; + + GeditDocumentSaveFlags save_flags; + + gint auto_save_interval; + guint auto_save_timeout; + + gint not_editable : 1; + gint auto_save : 1; + + gint ask_if_externally_modified : 1; +}; + +G_DEFINE_TYPE(GeditTab, gedit_tab, GTK_TYPE_VBOX) + +enum +{ + PROP_0, + PROP_NAME, + PROP_STATE, + PROP_AUTO_SAVE, + PROP_AUTO_SAVE_INTERVAL +}; + +static gboolean gedit_tab_auto_save (GeditTab *tab); + +static void +install_auto_save_timeout (GeditTab *tab) +{ + gint timeout; + + gedit_debug (DEBUG_TAB); + + g_return_if_fail (tab->priv->auto_save_timeout <= 0); + g_return_if_fail (tab->priv->auto_save); + g_return_if_fail (tab->priv->auto_save_interval > 0); + + g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_LOADING); + g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_SAVING); + g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_REVERTING); + g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_LOADING_ERROR); + g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_SAVING_ERROR); + g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_SAVING_ERROR); + g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_REVERTING_ERROR); + + /* Add a new timeout */ + timeout = g_timeout_add_seconds (tab->priv->auto_save_interval * 60, + (GSourceFunc) gedit_tab_auto_save, + tab); + + tab->priv->auto_save_timeout = timeout; +} + +static gboolean +install_auto_save_timeout_if_needed (GeditTab *tab) +{ + GeditDocument *doc; + + gedit_debug (DEBUG_TAB); + + g_return_val_if_fail (tab->priv->auto_save_timeout <= 0, FALSE); + g_return_val_if_fail ((tab->priv->state == GEDIT_TAB_STATE_NORMAL) || + (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) || + (tab->priv->state == GEDIT_TAB_STATE_CLOSING), FALSE); + + if (tab->priv->state == GEDIT_TAB_STATE_CLOSING) + return FALSE; + + doc = gedit_tab_get_document (tab); + + if (tab->priv->auto_save && + !gedit_document_is_untitled (doc) && + !gedit_document_get_readonly (doc)) + { + install_auto_save_timeout (tab); + + return TRUE; + } + + return FALSE; +} + +static void +remove_auto_save_timeout (GeditTab *tab) +{ + gedit_debug (DEBUG_TAB); + + /* FIXME: check sugli stati */ + + g_return_if_fail (tab->priv->auto_save_timeout > 0); + + g_source_remove (tab->priv->auto_save_timeout); + tab->priv->auto_save_timeout = 0; +} + +static void +gedit_tab_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditTab *tab = GEDIT_TAB (object); + + switch (prop_id) + { + case PROP_NAME: + g_value_take_string (value, + _gedit_tab_get_name (tab)); + break; + case PROP_STATE: + g_value_set_enum (value, + gedit_tab_get_state (tab)); + break; + case PROP_AUTO_SAVE: + g_value_set_boolean (value, + gedit_tab_get_auto_save_enabled (tab)); + break; + case PROP_AUTO_SAVE_INTERVAL: + g_value_set_int (value, + gedit_tab_get_auto_save_interval (tab)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_tab_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditTab *tab = GEDIT_TAB (object); + + switch (prop_id) + { + case PROP_AUTO_SAVE: + gedit_tab_set_auto_save_enabled (tab, + g_value_get_boolean (value)); + break; + case PROP_AUTO_SAVE_INTERVAL: + gedit_tab_set_auto_save_interval (tab, + g_value_get_int (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_tab_finalize (GObject *object) +{ + GeditTab *tab = GEDIT_TAB (object); + + if (tab->priv->timer != NULL) + g_timer_destroy (tab->priv->timer); + + g_free (tab->priv->tmp_save_uri); + + if (tab->priv->auto_save_timeout > 0) + remove_auto_save_timeout (tab); + + G_OBJECT_CLASS (gedit_tab_parent_class)->finalize (object); +} + +static void +gedit_tab_class_init (GeditTabClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_tab_finalize; + object_class->get_property = gedit_tab_get_property; + object_class->set_property = gedit_tab_set_property; + + g_object_class_install_property (object_class, + PROP_NAME, + g_param_spec_string ("name", + "Name", + "The tab's name", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_STATE, + g_param_spec_enum ("state", + "State", + "The tab's state", + GEDIT_TYPE_TAB_STATE, + GEDIT_TAB_STATE_NORMAL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_AUTO_SAVE, + g_param_spec_boolean ("autosave", + "Autosave", + "Autosave feature", + TRUE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, + PROP_AUTO_SAVE_INTERVAL, + g_param_spec_int ("autosave-interval", + "AutosaveInterval", + "Time between two autosaves", + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof (GeditTabPrivate)); +} + +/** + * gedit_tab_get_state: + * @tab: a #GeditTab + * + * Gets the #GeditTabState of @tab. + * + * Returns: the #GeditTabState of @tab + */ +GeditTabState +gedit_tab_get_state (GeditTab *tab) +{ + g_return_val_if_fail (GEDIT_IS_TAB (tab), GEDIT_TAB_STATE_NORMAL); + + return tab->priv->state; +} + +static void +set_cursor_according_to_state (GtkTextView *view, + GeditTabState state) +{ + GdkCursor *cursor; + GdkWindow *text_window; + GdkWindow *left_window; + + text_window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_TEXT); + left_window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_LEFT); + + if ((state == GEDIT_TAB_STATE_LOADING) || + (state == GEDIT_TAB_STATE_REVERTING) || + (state == GEDIT_TAB_STATE_SAVING) || + (state == GEDIT_TAB_STATE_PRINTING) || + (state == GEDIT_TAB_STATE_PRINT_PREVIEWING) || + (state == GEDIT_TAB_STATE_CLOSING)) + { + cursor = gdk_cursor_new_for_display ( + gtk_widget_get_display (GTK_WIDGET (view)), + GDK_WATCH); + + if (text_window != NULL) + gdk_window_set_cursor (text_window, cursor); + if (left_window != NULL) + gdk_window_set_cursor (left_window, cursor); + + gdk_cursor_unref (cursor); + } + else + { + cursor = gdk_cursor_new_for_display ( + gtk_widget_get_display (GTK_WIDGET (view)), + GDK_XTERM); + + if (text_window != NULL) + gdk_window_set_cursor (text_window, cursor); + if (left_window != NULL) + gdk_window_set_cursor (left_window, NULL); + + gdk_cursor_unref (cursor); + } +} + +static void +view_realized (GtkTextView *view, + GeditTab *tab) +{ + set_cursor_according_to_state (view, tab->priv->state); +} + +static void +set_view_properties_according_to_state (GeditTab *tab, + GeditTabState state) +{ + gboolean val; + + val = ((state == GEDIT_TAB_STATE_NORMAL) && + (tab->priv->print_preview == NULL) && + !tab->priv->not_editable); + gtk_text_view_set_editable (GTK_TEXT_VIEW (tab->priv->view), val); + + val = ((state != GEDIT_TAB_STATE_LOADING) && + (state != GEDIT_TAB_STATE_CLOSING)); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (tab->priv->view), val); + + val = ((state != GEDIT_TAB_STATE_LOADING) && + (state != GEDIT_TAB_STATE_CLOSING) && + (gedit_prefs_manager_get_highlight_current_line ())); + gtk_source_view_set_highlight_current_line (GTK_SOURCE_VIEW (tab->priv->view), val); +} + +static void +gedit_tab_set_state (GeditTab *tab, + GeditTabState state) +{ + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail ((state >= 0) && (state < GEDIT_TAB_NUM_OF_STATES)); + + if (tab->priv->state == state) + return; + + tab->priv->state = state; + + set_view_properties_according_to_state (tab, state); + + if ((state == GEDIT_TAB_STATE_LOADING_ERROR) || /* FIXME: add other states if needed */ + (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)) + { + gtk_widget_hide (tab->priv->view_scrolled_window); + } + else + { + if (tab->priv->print_preview == NULL) + gtk_widget_show (tab->priv->view_scrolled_window); + } + + set_cursor_according_to_state (GTK_TEXT_VIEW (tab->priv->view), + state); + + g_object_notify (G_OBJECT (tab), "state"); +} + +static void +document_uri_notify_handler (GeditDocument *document, + GParamSpec *pspec, + GeditTab *tab) +{ + gedit_debug (DEBUG_TAB); + + /* Notify the change in the URI */ + g_object_notify (G_OBJECT (tab), "name"); +} + +static void +document_shortname_notify_handler (GeditDocument *document, + GParamSpec *pspec, + GeditTab *tab) +{ + gedit_debug (DEBUG_TAB); + + /* Notify the change in the shortname */ + g_object_notify (G_OBJECT (tab), "name"); +} + +static void +document_modified_changed (GtkTextBuffer *document, + GeditTab *tab) +{ + g_object_notify (G_OBJECT (tab), "name"); +} + +static void +set_message_area (GeditTab *tab, + GtkWidget *message_area) +{ + if (tab->priv->message_area == message_area) + return; + + if (tab->priv->message_area != NULL) + gtk_widget_destroy (tab->priv->message_area); + + tab->priv->message_area = message_area; + + if (message_area == NULL) + return; + + gtk_box_pack_start (GTK_BOX (tab), + tab->priv->message_area, + FALSE, + FALSE, + 0); + + g_object_add_weak_pointer (G_OBJECT (tab->priv->message_area), + (gpointer *)&tab->priv->message_area); +} + +static void +remove_tab (GeditTab *tab) +{ + GeditNotebook *notebook; + + notebook = GEDIT_NOTEBOOK (gtk_widget_get_parent (GTK_WIDGET (tab))); + + gedit_notebook_remove_tab (notebook, tab); +} + +static void +io_loading_error_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + GeditDocument *doc; + GeditView *view; + gchar *uri; + const GeditEncoding *encoding; + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + view = gedit_tab_get_view (tab); + g_return_if_fail (GEDIT_IS_VIEW (view)); + + uri = gedit_document_get_uri (doc); + g_return_if_fail (uri != NULL); + + switch (response_id) + { + case GTK_RESPONSE_OK: + encoding = gedit_conversion_error_message_area_get_encoding ( + GTK_WIDGET (message_area)); + + if (encoding != NULL) + { + tab->priv->tmp_encoding = encoding; + } + + set_message_area (tab, NULL); + gedit_tab_set_state (tab, GEDIT_TAB_STATE_LOADING); + + g_return_if_fail (tab->priv->auto_save_timeout <= 0); + + gedit_document_load (doc, + uri, + tab->priv->tmp_encoding, + tab->priv->tmp_line_pos, + FALSE); + break; + case GTK_RESPONSE_YES: + /* This means that we want to edit the document anyway */ + set_message_area (tab, NULL); + _gedit_document_set_readonly (doc, FALSE); + break; + case GTK_RESPONSE_NO: + /* We don't want to edit the document just show it */ + set_message_area (tab, NULL); + break; + default: + _gedit_recent_remove (GEDIT_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))), uri); + + remove_tab (tab); + break; + } + + g_free (uri); +} + +static void +file_already_open_warning_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + GeditView *view; + + view = gedit_tab_get_view (tab); + + if (response_id == GTK_RESPONSE_YES) + { + tab->priv->not_editable = FALSE; + + gtk_text_view_set_editable (GTK_TEXT_VIEW (view), + TRUE); + } + + gtk_widget_destroy (message_area); + + gtk_widget_grab_focus (GTK_WIDGET (view)); +} + +static void +load_cancelled (GtkWidget *area, + gint response_id, + GeditTab *tab) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (tab->priv->message_area)); + + g_object_ref (tab); + gedit_document_load_cancel (gedit_tab_get_document (tab)); + g_object_unref (tab); +} + +static void +unrecoverable_reverting_error_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + GeditView *view; + + gedit_tab_set_state (tab, + GEDIT_TAB_STATE_NORMAL); + + set_message_area (tab, NULL); + + view = gedit_tab_get_view (tab); + + gtk_widget_grab_focus (GTK_WIDGET (view)); + + install_auto_save_timeout_if_needed (tab); +} + +#define MAX_MSG_LENGTH 100 + +static void +show_loading_message_area (GeditTab *tab) +{ + GtkWidget *area; + GeditDocument *doc = NULL; + gchar *name; + gchar *dirname = NULL; + gchar *msg = NULL; + gchar *name_markup; + gchar *dirname_markup; + gint len; + + if (tab->priv->message_area != NULL) + return; + + gedit_debug (DEBUG_TAB); + + doc = gedit_tab_get_document (tab); + g_return_if_fail (doc != NULL); + + name = gedit_document_get_short_name_for_display (doc); + len = g_utf8_strlen (name, -1); + + /* if the name is awfully long, truncate it and be done with it, + * otherwise also show the directory (ellipsized if needed) + */ + if (len > MAX_MSG_LENGTH) + { + gchar *str; + + str = gedit_utils_str_middle_truncate (name, MAX_MSG_LENGTH); + g_free (name); + name = str; + } + else + { + GFile *file; + + file = gedit_document_get_location (doc); + if (file != NULL) + { + gchar *str; + + str = gedit_utils_location_get_dirname_for_display (file); + g_object_unref (file); + + /* use the remaining space for the dir, but use a min of 20 chars + * so that we do not end up with a dirname like "(a...b)". + * This means that in the worst case when the filename is long 99 + * we have a title long 99 + 20, but I think it's a rare enough + * case to be acceptable. It's justa darn title afterall :) + */ + dirname = gedit_utils_str_middle_truncate (str, + MAX (20, MAX_MSG_LENGTH - len)); + g_free (str); + } + } + + name_markup = g_markup_printf_escaped ("%s", name); + + if (tab->priv->state == GEDIT_TAB_STATE_REVERTING) + { + if (dirname != NULL) + { + dirname_markup = g_markup_printf_escaped ("%s", dirname); + + /* Translators: the first %s is a file name (e.g. test.txt) the second one + is a directory (e.g. ssh://master.mate.org/home/users/paolo) */ + msg = g_strdup_printf (_("Reverting %s from %s"), + name_markup, + dirname_markup); + g_free (dirname_markup); + } + else + { + msg = g_strdup_printf (_("Reverting %s"), + name_markup); + } + + area = gedit_progress_message_area_new (GTK_STOCK_REVERT_TO_SAVED, + msg, + TRUE); + } + else + { + if (dirname != NULL) + { + dirname_markup = g_markup_printf_escaped ("%s", dirname); + + /* Translators: the first %s is a file name (e.g. test.txt) the second one + is a directory (e.g. ssh://master.mate.org/home/users/paolo) */ + msg = g_strdup_printf (_("Loading %s from %s"), + name_markup, + dirname_markup); + g_free (dirname_markup); + } + else + { + msg = g_strdup_printf (_("Loading %s"), + name_markup); + } + + area = gedit_progress_message_area_new (GTK_STOCK_OPEN, + msg, + TRUE); + } + + g_signal_connect (area, + "response", + G_CALLBACK (load_cancelled), + tab); + + gtk_widget_show (area); + + set_message_area (tab, area); + + g_free (msg); + g_free (name); + g_free (name_markup); + g_free (dirname); +} + +static void +show_saving_message_area (GeditTab *tab) +{ + GtkWidget *area; + GeditDocument *doc = NULL; + gchar *short_name; + gchar *from; + gchar *to = NULL; + gchar *from_markup; + gchar *to_markup; + gchar *msg = NULL; + gint len; + + g_return_if_fail (tab->priv->tmp_save_uri != NULL); + + if (tab->priv->message_area != NULL) + return; + + gedit_debug (DEBUG_TAB); + + doc = gedit_tab_get_document (tab); + g_return_if_fail (doc != NULL); + + short_name = gedit_document_get_short_name_for_display (doc); + + len = g_utf8_strlen (short_name, -1); + + /* if the name is awfully long, truncate it and be done with it, + * otherwise also show the directory (ellipsized if needed) + */ + if (len > MAX_MSG_LENGTH) + { + from = gedit_utils_str_middle_truncate (short_name, + MAX_MSG_LENGTH); + g_free (short_name); + } + else + { + gchar *str; + + from = short_name; + + to = gedit_utils_uri_for_display (tab->priv->tmp_save_uri); + + str = gedit_utils_str_middle_truncate (to, + MAX (20, MAX_MSG_LENGTH - len)); + g_free (to); + + to = str; + } + + from_markup = g_markup_printf_escaped ("%s", from); + + if (to != NULL) + { + to_markup = g_markup_printf_escaped ("%s", to); + + /* Translators: the first %s is a file name (e.g. test.txt) the second one + is a directory (e.g. ssh://master.mate.org/home/users/paolo) */ + msg = g_strdup_printf (_("Saving %s to %s"), + from_markup, + to_markup); + g_free (to_markup); + } + else + { + msg = g_strdup_printf (_("Saving %s"), from_markup); + } + + area = gedit_progress_message_area_new (GTK_STOCK_SAVE, + msg, + FALSE); + + gtk_widget_show (area); + + set_message_area (tab, area); + + g_free (msg); + g_free (to); + g_free (from); + g_free (from_markup); +} + +static void +message_area_set_progress (GeditTab *tab, + goffset size, + goffset total_size) +{ + if (tab->priv->message_area == NULL) + return; + + gedit_debug_message (DEBUG_TAB, "%" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT, size, total_size); + + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (tab->priv->message_area)); + + if (total_size == 0) + { + if (size != 0) + gedit_progress_message_area_pulse ( + GEDIT_PROGRESS_MESSAGE_AREA (tab->priv->message_area)); + else + gedit_progress_message_area_set_fraction ( + GEDIT_PROGRESS_MESSAGE_AREA (tab->priv->message_area), + 0); + } + else + { + gdouble frac; + + frac = (gdouble)size / (gdouble)total_size; + + gedit_progress_message_area_set_fraction ( + GEDIT_PROGRESS_MESSAGE_AREA (tab->priv->message_area), + frac); + } +} + +static void +document_loading (GeditDocument *document, + goffset size, + goffset total_size, + GeditTab *tab) +{ + gdouble et; + gdouble total_time; + + g_return_if_fail ((tab->priv->state == GEDIT_TAB_STATE_LOADING) || + (tab->priv->state == GEDIT_TAB_STATE_REVERTING)); + + gedit_debug_message (DEBUG_TAB, "%" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT, size, total_size); + + if (tab->priv->timer == NULL) + { + g_return_if_fail (tab->priv->times_called == 0); + tab->priv->timer = g_timer_new (); + } + + et = g_timer_elapsed (tab->priv->timer, NULL); + + /* et : total_time = size : total_size */ + total_time = (et * total_size) / size; + + if ((total_time - et) > 3.0) + { + show_loading_message_area (tab); + } + + message_area_set_progress (tab, size, total_size); +} + +static gboolean +remove_tab_idle (GeditTab *tab) +{ + remove_tab (tab); + + return FALSE; +} + +static void +document_loaded (GeditDocument *document, + const GError *error, + GeditTab *tab) +{ + GtkWidget *emsg; + GFile *location; + gchar *uri; + const GeditEncoding *encoding; + + g_return_if_fail ((tab->priv->state == GEDIT_TAB_STATE_LOADING) || + (tab->priv->state == GEDIT_TAB_STATE_REVERTING)); + g_return_if_fail (tab->priv->auto_save_timeout <= 0); + + if (tab->priv->timer != NULL) + { + g_timer_destroy (tab->priv->timer); + tab->priv->timer = NULL; + } + tab->priv->times_called = 0; + + set_message_area (tab, NULL); + + location = gedit_document_get_location (document); + uri = gedit_document_get_uri (document); + + /* if the error is CONVERSION FALLBACK don't treat it as a normal error */ + if (error != NULL && + (error->domain != GEDIT_DOCUMENT_ERROR || error->code != GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK)) + { + if (tab->priv->state == GEDIT_TAB_STATE_LOADING) + gedit_tab_set_state (tab, GEDIT_TAB_STATE_LOADING_ERROR); + else + gedit_tab_set_state (tab, GEDIT_TAB_STATE_REVERTING_ERROR); + + encoding = gedit_document_get_encoding (document); + + if (error->domain == G_IO_ERROR && + error->code == G_IO_ERROR_CANCELLED) + { + /* remove the tab, but in an idle handler, since + * we are in the handler of doc loaded and we + * don't want doc and tab to be finalized now. + */ + g_idle_add ((GSourceFunc) remove_tab_idle, tab); + + goto end; + } + else + { + _gedit_recent_remove (GEDIT_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))), uri); + + if (tab->priv->state == GEDIT_TAB_STATE_LOADING_ERROR) + { + emsg = gedit_io_loading_error_message_area_new (uri, + tab->priv->tmp_encoding, + error); + g_signal_connect (emsg, + "response", + G_CALLBACK (io_loading_error_message_area_response), + tab); + } + else + { + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_REVERTING_ERROR); + + emsg = gedit_unrecoverable_reverting_error_message_area_new (uri, + error); + + g_signal_connect (emsg, + "response", + G_CALLBACK (unrecoverable_reverting_error_message_area_response), + tab); + } + + set_message_area (tab, emsg); + } + +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_set_default_response (GEDIT_MESSAGE_AREA (emsg), + GTK_RESPONSE_CANCEL); +#else + gtk_info_bar_set_default_response (GTK_INFO_BAR (emsg), + GTK_RESPONSE_CANCEL); +#endif + + gtk_widget_show (emsg); + + g_object_unref (location); + g_free (uri); + + return; + } + else + { + gchar *mime; + GList *all_documents; + GList *l; + + g_return_if_fail (uri != NULL); + + mime = gedit_document_get_mime_type (document); + _gedit_recent_add (GEDIT_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))), + uri, + mime); + g_free (mime); + + if (error && + error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_CONVERSION_FALLBACK) + { + GtkWidget *emsg; + + _gedit_document_set_readonly (document, TRUE); + + emsg = gedit_io_loading_error_message_area_new (uri, + tab->priv->tmp_encoding, + error); + + set_message_area (tab, emsg); + + g_signal_connect (emsg, + "response", + G_CALLBACK (io_loading_error_message_area_response), + tab); + +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_set_default_response (GEDIT_MESSAGE_AREA (emsg), + GTK_RESPONSE_CANCEL); +#else + gtk_info_bar_set_default_response (GTK_INFO_BAR (emsg), + GTK_RESPONSE_CANCEL); +#endif + + gtk_widget_show (emsg); + } + + /* Scroll to the cursor when the document is loaded */ + gedit_view_scroll_to_cursor (GEDIT_VIEW (tab->priv->view)); + + all_documents = gedit_app_get_documents (gedit_app_get_default ()); + + for (l = all_documents; l != NULL; l = g_list_next (l)) + { + GeditDocument *d = GEDIT_DOCUMENT (l->data); + + if (d != document) + { + GFile *loc; + + loc = gedit_document_get_location (d); + + if ((loc != NULL) && + g_file_equal (location, loc)) + { + GtkWidget *w; + GeditView *view; + + view = gedit_tab_get_view (tab); + + tab->priv->not_editable = TRUE; + + w = gedit_file_already_open_warning_message_area_new (uri); + + set_message_area (tab, w); + +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_set_default_response (GEDIT_MESSAGE_AREA (w), + GTK_RESPONSE_CANCEL); +#else + gtk_info_bar_set_default_response (GTK_INFO_BAR (w), + GTK_RESPONSE_CANCEL); +#endif + + gtk_widget_show (w); + + g_signal_connect (w, + "response", + G_CALLBACK (file_already_open_warning_message_area_response), + tab); + + g_object_unref (loc); + break; + } + + if (loc != NULL) + g_object_unref (loc); + } + } + + g_list_free (all_documents); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_NORMAL); + + install_auto_save_timeout_if_needed (tab); + + tab->priv->ask_if_externally_modified = TRUE; + } + + end: + g_object_unref (location); + g_free (uri); + + tab->priv->tmp_line_pos = 0; + tab->priv->tmp_encoding = NULL; +} + +static void +document_saving (GeditDocument *document, + goffset size, + goffset total_size, + GeditTab *tab) +{ + gdouble et; + gdouble total_time; + + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_SAVING); + + gedit_debug_message (DEBUG_TAB, "%" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT, size, total_size); + + + if (tab->priv->timer == NULL) + { + g_return_if_fail (tab->priv->times_called == 0); + tab->priv->timer = g_timer_new (); + } + + et = g_timer_elapsed (tab->priv->timer, NULL); + + /* et : total_time = size : total_size */ + total_time = (et * total_size)/size; + + if ((total_time - et) > 3.0) + { + show_saving_message_area (tab); + } + + message_area_set_progress (tab, size, total_size); + + tab->priv->times_called++; +} + +static void +end_saving (GeditTab *tab) +{ + /* Reset tmp data for saving */ + g_free (tab->priv->tmp_save_uri); + tab->priv->tmp_save_uri = NULL; + tab->priv->tmp_encoding = NULL; + + install_auto_save_timeout_if_needed (tab); +} + +static void +unrecoverable_saving_error_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + GeditView *view; + + if (tab->priv->print_preview != NULL) + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW); + else + gedit_tab_set_state (tab, GEDIT_TAB_STATE_NORMAL); + + end_saving (tab); + + set_message_area (tab, NULL); + + view = gedit_tab_get_view (tab); + + gtk_widget_grab_focus (GTK_WIDGET (view)); +} + +static void +no_backup_error_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + if (response_id == GTK_RESPONSE_YES) + { + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + set_message_area (tab, NULL); + + g_return_if_fail (tab->priv->tmp_save_uri != NULL); + g_return_if_fail (tab->priv->tmp_encoding != NULL); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SAVING); + + /* don't bug the user again with this... */ + tab->priv->save_flags |= GEDIT_DOCUMENT_SAVE_IGNORE_BACKUP; + + g_return_if_fail (tab->priv->auto_save_timeout <= 0); + + /* Force saving */ + gedit_document_save (doc, tab->priv->save_flags); + } + else + { + unrecoverable_saving_error_message_area_response (message_area, + response_id, + tab); + } +} + +static void +externally_modified_error_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + if (response_id == GTK_RESPONSE_YES) + { + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + set_message_area (tab, NULL); + + g_return_if_fail (tab->priv->tmp_save_uri != NULL); + g_return_if_fail (tab->priv->tmp_encoding != NULL); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SAVING); + + g_return_if_fail (tab->priv->auto_save_timeout <= 0); + + /* ignore mtime should not be persisted in save flags across saves */ + + /* Force saving */ + gedit_document_save (doc, tab->priv->save_flags | GEDIT_DOCUMENT_SAVE_IGNORE_MTIME); + } + else + { + unrecoverable_saving_error_message_area_response (message_area, + response_id, + tab); + } +} + +static void +recoverable_saving_error_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + if (response_id == GTK_RESPONSE_OK) + { + const GeditEncoding *encoding; + + encoding = gedit_conversion_error_message_area_get_encoding ( + GTK_WIDGET (message_area)); + + g_return_if_fail (encoding != NULL); + + set_message_area (tab, NULL); + + g_return_if_fail (tab->priv->tmp_save_uri != NULL); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SAVING); + + tab->priv->tmp_encoding = encoding; + + gedit_debug_message (DEBUG_TAB, "Force saving with URI '%s'", tab->priv->tmp_save_uri); + + g_return_if_fail (tab->priv->auto_save_timeout <= 0); + + gedit_document_save_as (doc, + tab->priv->tmp_save_uri, + tab->priv->tmp_encoding, + tab->priv->save_flags); + } + else + { + unrecoverable_saving_error_message_area_response (message_area, + response_id, + tab); + } +} + +static void +document_saved (GeditDocument *document, + const GError *error, + GeditTab *tab) +{ + GtkWidget *emsg; + + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_SAVING); + + g_return_if_fail (tab->priv->tmp_save_uri != NULL); + g_return_if_fail (tab->priv->tmp_encoding != NULL); + g_return_if_fail (tab->priv->auto_save_timeout <= 0); + + g_timer_destroy (tab->priv->timer); + tab->priv->timer = NULL; + tab->priv->times_called = 0; + + set_message_area (tab, NULL); + + if (error != NULL) + { + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SAVING_ERROR); + + if (error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_EXTERNALLY_MODIFIED) + { + /* This error is recoverable */ + emsg = gedit_externally_modified_saving_error_message_area_new ( + tab->priv->tmp_save_uri, + error); + g_return_if_fail (emsg != NULL); + + set_message_area (tab, emsg); + + g_signal_connect (emsg, + "response", + G_CALLBACK (externally_modified_error_message_area_response), + tab); + } + else if ((error->domain == GEDIT_DOCUMENT_ERROR && + error->code == GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP) || + (error->domain == G_IO_ERROR && + error->code == G_IO_ERROR_CANT_CREATE_BACKUP)) + { + /* This error is recoverable */ + emsg = gedit_no_backup_saving_error_message_area_new ( + tab->priv->tmp_save_uri, + error); + g_return_if_fail (emsg != NULL); + + set_message_area (tab, emsg); + + g_signal_connect (emsg, + "response", + G_CALLBACK (no_backup_error_message_area_response), + tab); + } + else if (error->domain == GEDIT_DOCUMENT_ERROR || + (error->domain == G_IO_ERROR && + error->code != G_IO_ERROR_INVALID_DATA && + error->code != G_IO_ERROR_PARTIAL_INPUT)) + { + /* These errors are _NOT_ recoverable */ + _gedit_recent_remove (GEDIT_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))), + tab->priv->tmp_save_uri); + + emsg = gedit_unrecoverable_saving_error_message_area_new (tab->priv->tmp_save_uri, + error); + g_return_if_fail (emsg != NULL); + + set_message_area (tab, emsg); + + g_signal_connect (emsg, + "response", + G_CALLBACK (unrecoverable_saving_error_message_area_response), + tab); + } + else + { + /* This error is recoverable */ + g_return_if_fail (error->domain == G_CONVERT_ERROR || + error->domain == G_IO_ERROR); + + emsg = gedit_conversion_error_while_saving_message_area_new ( + tab->priv->tmp_save_uri, + tab->priv->tmp_encoding, + error); + + set_message_area (tab, emsg); + + g_signal_connect (emsg, + "response", + G_CALLBACK (recoverable_saving_error_message_area_response), + tab); + } + +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_set_default_response (GEDIT_MESSAGE_AREA (emsg), + GTK_RESPONSE_CANCEL); +#else + gtk_info_bar_set_default_response (GTK_INFO_BAR (emsg), + GTK_RESPONSE_CANCEL); +#endif + + gtk_widget_show (emsg); + } + else + { + gchar *mime = gedit_document_get_mime_type (document); + + _gedit_recent_add (GEDIT_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))), + tab->priv->tmp_save_uri, + mime); + g_free (mime); + + if (tab->priv->print_preview != NULL) + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW); + else + gedit_tab_set_state (tab, GEDIT_TAB_STATE_NORMAL); + + tab->priv->ask_if_externally_modified = TRUE; + + end_saving (tab); + } +} + +static void +externally_modified_notification_message_area_response (GtkWidget *message_area, + gint response_id, + GeditTab *tab) +{ + GeditView *view; + + set_message_area (tab, NULL); + view = gedit_tab_get_view (tab); + + if (response_id == GTK_RESPONSE_OK) + { + _gedit_tab_revert (tab); + } + else + { + tab->priv->ask_if_externally_modified = FALSE; + + /* go back to normal state */ + gedit_tab_set_state (tab, GEDIT_TAB_STATE_NORMAL); + } + + gtk_widget_grab_focus (GTK_WIDGET (view)); +} + +static void +display_externally_modified_notification (GeditTab *tab) +{ + GtkWidget *message_area; + GeditDocument *doc; + gchar *uri; + gboolean document_modified; + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + /* uri cannot be NULL, we're here because + * the file we're editing changed on disk */ + uri = gedit_document_get_uri (doc); + g_return_if_fail (uri != NULL); + + document_modified = gtk_text_buffer_get_modified (GTK_TEXT_BUFFER(doc)); + message_area = gedit_externally_modified_message_area_new (uri, document_modified); + g_free (uri); + + tab->priv->message_area = NULL; + set_message_area (tab, message_area); + gtk_widget_show (message_area); + + g_signal_connect (message_area, + "response", + G_CALLBACK (externally_modified_notification_message_area_response), + tab); +} + +static gboolean +view_focused_in (GtkWidget *widget, + GdkEventFocus *event, + GeditTab *tab) +{ + GeditDocument *doc; + + g_return_val_if_fail (GEDIT_IS_TAB (tab), FALSE); + + /* we try to detect file changes only in the normal state */ + if (tab->priv->state != GEDIT_TAB_STATE_NORMAL) + { + return FALSE; + } + + /* we already asked, don't bug the user again */ + if (!tab->priv->ask_if_externally_modified) + { + return FALSE; + } + + doc = gedit_tab_get_document (tab); + + /* If file was never saved or is remote we do not check */ + if (!gedit_document_is_local (doc)) + { + return FALSE; + } + + if (_gedit_document_check_externally_modified (doc)) + { + gedit_tab_set_state (tab, GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION); + + display_externally_modified_notification (tab); + + return FALSE; + } + + return FALSE; +} + +static GMountOperation * +tab_mount_operation_factory (GeditDocument *doc, + gpointer userdata) +{ + GeditTab *tab = GEDIT_TAB (userdata); + GtkWidget *window; + + window = gtk_widget_get_toplevel (GTK_WIDGET (tab)); + return gtk_mount_operation_new (GTK_WINDOW (window)); +} + +static void +gedit_tab_init (GeditTab *tab) +{ + GtkWidget *sw; + GeditDocument *doc; + GeditLockdownMask lockdown; + + tab->priv = GEDIT_TAB_GET_PRIVATE (tab); + + tab->priv->state = GEDIT_TAB_STATE_NORMAL; + + tab->priv->not_editable = FALSE; + + tab->priv->save_flags = 0; + + tab->priv->ask_if_externally_modified = TRUE; + + /* Create the scrolled window */ + sw = gtk_scrolled_window_new (NULL, NULL); + tab->priv->view_scrolled_window = sw; + + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + /* Manage auto save data */ + lockdown = gedit_app_get_lockdown (gedit_app_get_default ()); + tab->priv->auto_save = gedit_prefs_manager_get_auto_save () && + !(lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK); + tab->priv->auto_save = (tab->priv->auto_save != FALSE); + + tab->priv->auto_save_interval = gedit_prefs_manager_get_auto_save_interval (); + if (tab->priv->auto_save_interval <= 0) + tab->priv->auto_save_interval = GPM_DEFAULT_AUTO_SAVE_INTERVAL; + + /* Create the view */ + doc = gedit_document_new (); + g_object_set_data (G_OBJECT (doc), GEDIT_TAB_KEY, tab); + + _gedit_document_set_mount_operation_factory (doc, + tab_mount_operation_factory, + tab); + + tab->priv->view = gedit_view_new (doc); + g_object_unref (doc); + gtk_widget_show (tab->priv->view); + g_object_set_data (G_OBJECT (tab->priv->view), GEDIT_TAB_KEY, tab); + + gtk_box_pack_end (GTK_BOX (tab), sw, TRUE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (sw), tab->priv->view); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_IN); + gtk_widget_show (sw); + + g_signal_connect (doc, + "notify::uri", + G_CALLBACK (document_uri_notify_handler), + tab); + g_signal_connect (doc, + "notify::shortname", + G_CALLBACK (document_shortname_notify_handler), + tab); + g_signal_connect (doc, + "modified_changed", + G_CALLBACK (document_modified_changed), + tab); + g_signal_connect (doc, + "loading", + G_CALLBACK (document_loading), + tab); + g_signal_connect (doc, + "loaded", + G_CALLBACK (document_loaded), + tab); + g_signal_connect (doc, + "saving", + G_CALLBACK (document_saving), + tab); + g_signal_connect (doc, + "saved", + G_CALLBACK (document_saved), + tab); + + g_signal_connect_after (tab->priv->view, + "focus-in-event", + G_CALLBACK (view_focused_in), + tab); + + g_signal_connect_after (tab->priv->view, + "realize", + G_CALLBACK (view_realized), + tab); +} + +GtkWidget * +_gedit_tab_new (void) +{ + return GTK_WIDGET (g_object_new (GEDIT_TYPE_TAB, NULL)); +} + +/* Whether create is TRUE, creates a new empty document if location does + not refer to an existing file */ +GtkWidget * +_gedit_tab_new_from_uri (const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create) +{ + GeditTab *tab; + + g_return_val_if_fail (uri != NULL, NULL); + + tab = GEDIT_TAB (_gedit_tab_new ()); + + _gedit_tab_load (tab, + uri, + encoding, + line_pos, + create); + + return GTK_WIDGET (tab); +} + +/** + * gedit_tab_get_view: + * @tab: a #GeditTab + * + * Gets the #GeditView inside @tab. + * + * Returns: the #GeditView inside @tab + */ +GeditView * +gedit_tab_get_view (GeditTab *tab) +{ + return GEDIT_VIEW (tab->priv->view); +} + +/** + * gedit_tab_get_document: + * @tab: a #GeditTab + * + * Gets the #GeditDocument associated to @tab. + * + * Returns: the #GeditDocument associated to @tab + */ +GeditDocument * +gedit_tab_get_document (GeditTab *tab) +{ + return GEDIT_DOCUMENT (gtk_text_view_get_buffer ( + GTK_TEXT_VIEW (tab->priv->view))); +} + +#define MAX_DOC_NAME_LENGTH 40 + +gchar * +_gedit_tab_get_name (GeditTab *tab) +{ + GeditDocument *doc; + gchar *name; + gchar *docname; + gchar *tab_name; + + g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL); + + doc = gedit_tab_get_document (tab); + + name = gedit_document_get_short_name_for_display (doc); + + /* Truncate the name so it doesn't get insanely wide. */ + docname = gedit_utils_str_middle_truncate (name, MAX_DOC_NAME_LENGTH); + + if (gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc))) + { + tab_name = g_strdup_printf ("*%s", docname); + } + else + { + #if 0 + if (gedit_document_get_readonly (doc)) + { + tab_name = g_strdup_printf ("%s [%s]", docname, + /*Read only*/ _("RO")); + } + else + { + tab_name = g_strdup_printf ("%s", docname); + } +#endif + tab_name = g_strdup (docname); + } + + g_free (docname); + g_free (name); + + return tab_name; +} + +gchar * +_gedit_tab_get_tooltips (GeditTab *tab) +{ + GeditDocument *doc; + gchar *tip; + gchar *uri; + gchar *ruri; + gchar *ruri_markup; + + g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL); + + doc = gedit_tab_get_document (tab); + + uri = gedit_document_get_uri_for_display (doc); + g_return_val_if_fail (uri != NULL, NULL); + + ruri = gedit_utils_replace_home_dir_with_tilde (uri); + g_free (uri); + + ruri_markup = g_markup_printf_escaped ("%s", ruri); + + switch (tab->priv->state) + { + gchar *content_type; + gchar *mime_type; + gchar *content_description; + gchar *content_full_description; + gchar *encoding; + const GeditEncoding *enc; + + case GEDIT_TAB_STATE_LOADING_ERROR: + tip = g_strdup_printf (_("Error opening file %s"), + ruri_markup); + break; + + case GEDIT_TAB_STATE_REVERTING_ERROR: + tip = g_strdup_printf (_("Error reverting file %s"), + ruri_markup); + break; + + case GEDIT_TAB_STATE_SAVING_ERROR: + tip = g_strdup_printf (_("Error saving file %s"), + ruri_markup); + break; + default: + content_type = gedit_document_get_content_type (doc); + mime_type = gedit_document_get_mime_type (doc); + content_description = g_content_type_get_description (content_type); + + if (content_description == NULL) + content_full_description = g_strdup (mime_type); + else + content_full_description = g_strdup_printf ("%s (%s)", + content_description, mime_type); + + g_free (content_type); + g_free (mime_type); + g_free (content_description); + + enc = gedit_document_get_encoding (doc); + + if (enc == NULL) + encoding = g_strdup (_("Unicode (UTF-8)")); + else + encoding = gedit_encoding_to_string (enc); + + tip = g_markup_printf_escaped ("%s %s\n\n" + "%s %s\n" + "%s %s", + _("Name:"), ruri, + _("MIME Type:"), content_full_description, + _("Encoding:"), encoding); + + g_free (encoding); + g_free (content_full_description); + + break; + } + + g_free (ruri); + g_free (ruri_markup); + + return tip; +} + +static GdkPixbuf * +resize_icon (GdkPixbuf *pixbuf, + gint size) +{ + gint width, height; + + width = gdk_pixbuf_get_width (pixbuf); + height = gdk_pixbuf_get_height (pixbuf); + + /* if the icon is larger than the nominal size, scale down */ + if (MAX (width, height) > size) + { + GdkPixbuf *scaled_pixbuf; + + if (width > height) + { + height = height * size / width; + width = size; + } + else + { + width = width * size / height; + height = size; + } + + scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, + width, + height, + GDK_INTERP_BILINEAR); + g_object_unref (pixbuf); + pixbuf = scaled_pixbuf; + } + + return pixbuf; +} + +static GdkPixbuf * +get_stock_icon (GtkIconTheme *theme, + const gchar *stock, + gint size) +{ + GdkPixbuf *pixbuf; + + pixbuf = gtk_icon_theme_load_icon (theme, stock, size, 0, NULL); + if (pixbuf == NULL) + return NULL; + + return resize_icon (pixbuf, size); +} + +static GdkPixbuf * +get_icon (GtkIconTheme *theme, + GFile *location, + gint size) +{ + GdkPixbuf *pixbuf; + GtkIconInfo *icon_info; + GFileInfo *info; + GIcon *gicon; + + if (location == NULL) + return get_stock_icon (theme, GTK_STOCK_FILE, size); + + /* FIXME: Doing a sync stat is bad, this should be fixed */ + info = g_file_query_info (location, + G_FILE_ATTRIBUTE_STANDARD_ICON, + G_FILE_QUERY_INFO_NONE, + NULL, + NULL); + if (info == NULL) + return get_stock_icon (theme, GTK_STOCK_FILE, size); + + gicon = g_file_info_get_icon (info); + + if (gicon == NULL) + { + g_object_unref (info); + return get_stock_icon (theme, GTK_STOCK_FILE, size); + } + + icon_info = gtk_icon_theme_lookup_by_gicon (theme, gicon, size, 0); + g_object_unref (info); + + if (icon_info == NULL) + return get_stock_icon (theme, GTK_STOCK_FILE, size); + + pixbuf = gtk_icon_info_load_icon (icon_info, NULL); + gtk_icon_info_free (icon_info); + + if (pixbuf == NULL) + return get_stock_icon (theme, GTK_STOCK_FILE, size); + + return resize_icon (pixbuf, size); +} + +/* FIXME: add support for theme changed. I think it should be as easy as + call g_object_notify (tab, "name") when the icon theme changes */ +GdkPixbuf * +_gedit_tab_get_icon (GeditTab *tab) +{ + GdkPixbuf *pixbuf; + GtkIconTheme *theme; + GdkScreen *screen; + gint icon_size; + + g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL); + + screen = gtk_widget_get_screen (GTK_WIDGET (tab)); + + theme = gtk_icon_theme_get_for_screen (screen); + g_return_val_if_fail (theme != NULL, NULL); + + gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (GTK_WIDGET (tab)), + GTK_ICON_SIZE_MENU, + NULL, + &icon_size); + + switch (tab->priv->state) + { + case GEDIT_TAB_STATE_LOADING: + pixbuf = get_stock_icon (theme, + GTK_STOCK_OPEN, + icon_size); + break; + + case GEDIT_TAB_STATE_REVERTING: + pixbuf = get_stock_icon (theme, + GTK_STOCK_REVERT_TO_SAVED, + icon_size); + break; + + case GEDIT_TAB_STATE_SAVING: + pixbuf = get_stock_icon (theme, + GTK_STOCK_SAVE, + icon_size); + break; + + case GEDIT_TAB_STATE_PRINTING: + pixbuf = get_stock_icon (theme, + GTK_STOCK_PRINT, + icon_size); + break; + + case GEDIT_TAB_STATE_PRINT_PREVIEWING: + case GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW: + pixbuf = get_stock_icon (theme, + GTK_STOCK_PRINT_PREVIEW, + icon_size); + break; + + case GEDIT_TAB_STATE_LOADING_ERROR: + case GEDIT_TAB_STATE_REVERTING_ERROR: + case GEDIT_TAB_STATE_SAVING_ERROR: + case GEDIT_TAB_STATE_GENERIC_ERROR: + pixbuf = get_stock_icon (theme, + GTK_STOCK_DIALOG_ERROR, + icon_size); + break; + + case GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION: + pixbuf = get_stock_icon (theme, + GTK_STOCK_DIALOG_WARNING, + icon_size); + break; + + default: + { + GFile *location; + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + + location = gedit_document_get_location (doc); + pixbuf = get_icon (theme, location, icon_size); + + if (location) + g_object_unref (location); + } + } + + return pixbuf; +} + +/** + * gedit_tab_get_from_document: + * @doc: a #GeditDocument + * + * Gets the #GeditTab associated with @doc. + * + * Returns: the #GeditTab associated with @doc + */ +GeditTab * +gedit_tab_get_from_document (GeditDocument *doc) +{ + gpointer res; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + res = g_object_get_data (G_OBJECT (doc), GEDIT_TAB_KEY); + + return (res != NULL) ? GEDIT_TAB (res) : NULL; +} + +void +_gedit_tab_load (GeditTab *tab, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create) +{ + GeditDocument *doc; + + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_NORMAL); + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_LOADING); + + tab->priv->tmp_line_pos = line_pos; + tab->priv->tmp_encoding = encoding; + + if (tab->priv->auto_save_timeout > 0) + remove_auto_save_timeout (tab); + + gedit_document_load (doc, + uri, + encoding, + line_pos, + create); +} + +void +_gedit_tab_revert (GeditTab *tab) +{ + GeditDocument *doc; + gchar *uri; + + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail ((tab->priv->state == GEDIT_TAB_STATE_NORMAL) || + (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION)); + + if (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) + { + set_message_area (tab, NULL); + } + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_REVERTING); + + uri = gedit_document_get_uri (doc); + g_return_if_fail (uri != NULL); + + tab->priv->tmp_line_pos = 0; + tab->priv->tmp_encoding = gedit_document_get_encoding (doc); + + if (tab->priv->auto_save_timeout > 0) + remove_auto_save_timeout (tab); + + gedit_document_load (doc, + uri, + tab->priv->tmp_encoding, + 0, + FALSE); + + g_free (uri); +} + +void +_gedit_tab_save (GeditTab *tab) +{ + GeditDocument *doc; + GeditDocumentSaveFlags save_flags; + + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail ((tab->priv->state == GEDIT_TAB_STATE_NORMAL) || + (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) || + (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)); + g_return_if_fail (tab->priv->tmp_save_uri == NULL); + g_return_if_fail (tab->priv->tmp_encoding == NULL); + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (!gedit_document_is_untitled (doc)); + + if (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) + { + /* We already told the user about the external + * modification: hide the message area and set + * the save flag. + */ + + set_message_area (tab, NULL); + save_flags = tab->priv->save_flags | GEDIT_DOCUMENT_SAVE_IGNORE_MTIME; + } + else + { + save_flags = tab->priv->save_flags; + } + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SAVING); + + /* uri used in error messages, will be freed in document_saved */ + tab->priv->tmp_save_uri = gedit_document_get_uri (doc); + tab->priv->tmp_encoding = gedit_document_get_encoding (doc); + + if (tab->priv->auto_save_timeout > 0) + remove_auto_save_timeout (tab); + + gedit_document_save (doc, save_flags); +} + +static gboolean +gedit_tab_auto_save (GeditTab *tab) +{ + GeditDocument *doc; + + gedit_debug (DEBUG_TAB); + + g_return_val_if_fail (tab->priv->tmp_save_uri == NULL, FALSE); + g_return_val_if_fail (tab->priv->tmp_encoding == NULL, FALSE); + + doc = gedit_tab_get_document (tab); + + g_return_val_if_fail (!gedit_document_is_untitled (doc), FALSE); + g_return_val_if_fail (!gedit_document_get_readonly (doc), FALSE); + + g_return_val_if_fail (tab->priv->auto_save_timeout > 0, FALSE); + g_return_val_if_fail (tab->priv->auto_save, FALSE); + g_return_val_if_fail (tab->priv->auto_save_interval > 0, FALSE); + + if (!gtk_text_buffer_get_modified (GTK_TEXT_BUFFER(doc))) + { + gedit_debug_message (DEBUG_TAB, "Document not modified"); + + return TRUE; + } + + if ((tab->priv->state != GEDIT_TAB_STATE_NORMAL) && + (tab->priv->state != GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)) + { + /* Retry after 30 seconds */ + guint timeout; + + gedit_debug_message (DEBUG_TAB, "Retry after 30 seconds"); + + /* Add a new timeout */ + timeout = g_timeout_add_seconds (30, + (GSourceFunc) gedit_tab_auto_save, + tab); + + tab->priv->auto_save_timeout = timeout; + + /* Returns FALSE so the old timeout is "destroyed" */ + return FALSE; + } + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SAVING); + + /* uri used in error messages, will be freed in document_saved */ + tab->priv->tmp_save_uri = gedit_document_get_uri (doc); + tab->priv->tmp_encoding = gedit_document_get_encoding (doc); + + /* Set auto_save_timeout to 0 since the timeout is going to be destroyed */ + tab->priv->auto_save_timeout = 0; + + /* Since we are autosaving, we need to preserve the backup that was produced + the last time the user "manually" saved the file. In the case a recoverable + error happens while saving, the last backup is not preserved since the user + expressed his willing of saving the file */ + gedit_document_save (doc, tab->priv->save_flags | GEDIT_DOCUMENT_SAVE_PRESERVE_BACKUP); + + gedit_debug_message (DEBUG_TAB, "Done"); + + /* Returns FALSE so the old timeout is "destroyed" */ + return FALSE; +} + +void +_gedit_tab_save_as (GeditTab *tab, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentNewlineType newline_type) +{ + GeditDocument *doc; + GeditDocumentSaveFlags save_flags; + + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail ((tab->priv->state == GEDIT_TAB_STATE_NORMAL) || + (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) || + (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)); + g_return_if_fail (encoding != NULL); + + g_return_if_fail (tab->priv->tmp_save_uri == NULL); + g_return_if_fail (tab->priv->tmp_encoding == NULL); + + doc = gedit_tab_get_document (tab); + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + + /* reset the save flags, when saving as */ + tab->priv->save_flags = 0; + + if (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) + { + /* We already told the user about the external + * modification: hide the message area and set + * the save flag. + */ + + set_message_area (tab, NULL); + save_flags = tab->priv->save_flags | GEDIT_DOCUMENT_SAVE_IGNORE_MTIME; + } + else + { + save_flags = tab->priv->save_flags; + } + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SAVING); + + /* uri used in error messages... strdup because errors are async + * and the string can go away, will be freed in document_saved */ + tab->priv->tmp_save_uri = g_strdup (uri); + tab->priv->tmp_encoding = encoding; + + if (tab->priv->auto_save_timeout > 0) + remove_auto_save_timeout (tab); + + /* FIXME: this should behave the same as encoding, setting it here + makes it persistent (if save fails, it's remembered). It's not + a very big deal, but would be nice to have them follow the + same pattern. This can be changed once we break API for 3.0 */ + gedit_document_set_newline_type (doc, newline_type); + gedit_document_save_as (doc, uri, encoding, tab->priv->save_flags); +} + +#define GEDIT_PAGE_SETUP_KEY "gedit-page-setup-key" +#define GEDIT_PRINT_SETTINGS_KEY "gedit-print-settings-key" + +static GtkPageSetup * +get_page_setup (GeditTab *tab) +{ + gpointer data; + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + + data = g_object_get_data (G_OBJECT (doc), + GEDIT_PAGE_SETUP_KEY); + + if (data == NULL) + { + return _gedit_app_get_default_page_setup (gedit_app_get_default()); + } + else + { + return gtk_page_setup_copy (GTK_PAGE_SETUP (data)); + } +} + +static GtkPrintSettings * +get_print_settings (GeditTab *tab) +{ + gpointer data; + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + + data = g_object_get_data (G_OBJECT (doc), + GEDIT_PRINT_SETTINGS_KEY); + + if (data == NULL) + { + return _gedit_app_get_default_print_settings (gedit_app_get_default()); + } + else + { + return gtk_print_settings_copy (GTK_PRINT_SETTINGS (data)); + } +} + +/* FIXME: show the message area only if the operation will be "long" */ +static void +printing_cb (GeditPrintJob *job, + GeditPrintJobStatus status, + GeditTab *tab) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (tab->priv->message_area)); + + gtk_widget_show (tab->priv->message_area); + + gedit_progress_message_area_set_text (GEDIT_PROGRESS_MESSAGE_AREA (tab->priv->message_area), + gedit_print_job_get_status_string (job)); + + gedit_progress_message_area_set_fraction (GEDIT_PROGRESS_MESSAGE_AREA (tab->priv->message_area), + gedit_print_job_get_progress (job)); +} + +static void +store_print_settings (GeditTab *tab, + GeditPrintJob *job) +{ + GeditDocument *doc; + GtkPrintSettings *settings; + GtkPageSetup *page_setup; + + doc = gedit_tab_get_document (tab); + + settings = gedit_print_job_get_print_settings (job); + + /* clear n-copies settings since we do not want to + * persist that one */ + gtk_print_settings_unset (settings, + GTK_PRINT_SETTINGS_N_COPIES); + + /* remember settings for this document */ + g_object_set_data_full (G_OBJECT (doc), + GEDIT_PRINT_SETTINGS_KEY, + g_object_ref (settings), + (GDestroyNotify)g_object_unref); + + /* make them the default */ + _gedit_app_set_default_print_settings (gedit_app_get_default (), + settings); + + page_setup = gedit_print_job_get_page_setup (job); + + /* remember page setup for this document */ + g_object_set_data_full (G_OBJECT (doc), + GEDIT_PAGE_SETUP_KEY, + g_object_ref (page_setup), + (GDestroyNotify)g_object_unref); + + /* make it the default */ + _gedit_app_set_default_page_setup (gedit_app_get_default (), + page_setup); +} + +static void +done_printing_cb (GeditPrintJob *job, + GeditPrintJobResult result, + const GError *error, + GeditTab *tab) +{ + GeditView *view; + + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_PRINT_PREVIEWING || + tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW || + tab->priv->state == GEDIT_TAB_STATE_PRINTING); + + if (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) + { + /* print preview has been destroyed... */ + tab->priv->print_preview = NULL; + } + else + { + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (tab->priv->message_area)); + + set_message_area (tab, NULL); /* destroy the message area */ + } + + // TODO: check status and error + + if (result == GEDIT_PRINT_JOB_RESULT_OK) + { + store_print_settings (tab, job); + } + +#if 0 + if (tab->priv->print_preview != NULL) + { + /* If we were printing while showing the print preview, + see bug #352658 */ + gtk_widget_destroy (tab->priv->print_preview); + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_PRINTING); + } +#endif + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_NORMAL); + + view = gedit_tab_get_view (tab); + gtk_widget_grab_focus (GTK_WIDGET (view)); + + g_object_unref (tab->priv->print_job); + tab->priv->print_job = NULL; +} + +#if 0 +static void +print_preview_destroyed (GtkWidget *preview, + GeditTab *tab) +{ + tab->priv->print_preview = NULL; + + if (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) + { + GeditView *view; + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_NORMAL); + + view = gedit_tab_get_view (tab); + gtk_widget_grab_focus (GTK_WIDGET (view)); + } + else + { + /* This should happen only when printing while showing the print + * preview. In this case let us continue whithout changing + * the state and show the document. See bug #352658 */ + gtk_widget_show (tab->priv->view_scrolled_window); + + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_PRINTING); + } +} +#endif + +static void +show_preview_cb (GeditPrintJob *job, + GeditPrintPreview *preview, + GeditTab *tab) +{ +// g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_PRINT_PREVIEWING); + g_return_if_fail (tab->priv->print_preview == NULL); + + set_message_area (tab, NULL); /* destroy the message area */ + + tab->priv->print_preview = GTK_WIDGET (preview); + gtk_box_pack_end (GTK_BOX (tab), + tab->priv->print_preview, + TRUE, + TRUE, + 0); + gtk_widget_show (tab->priv->print_preview); + gtk_widget_grab_focus (tab->priv->print_preview); + +/* when the preview gets destroyed we get "done" signal + g_signal_connect (tab->priv->print_preview, + "destroy", + G_CALLBACK (print_preview_destroyed), + tab); +*/ + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW); +} + +#if 0 + +static void +set_print_preview (GeditTab *tab, + GtkWidget *print_preview) +{ + if (tab->priv->print_preview == print_preview) + return; + + if (tab->priv->print_preview != NULL) + gtk_widget_destroy (tab->priv->print_preview); + + tab->priv->print_preview = print_preview; + + gtk_box_pack_end (GTK_BOX (tab), + tab->priv->print_preview, + TRUE, + TRUE, + 0); + + gtk_widget_grab_focus (tab->priv->print_preview); + + g_signal_connect (tab->priv->print_preview, + "destroy", + G_CALLBACK (print_preview_destroyed), + tab); +} + +static void +preview_finished_cb (GtkSourcePrintJob *pjob, GeditTab *tab) +{ + MatePrintJob *gjob; + GtkWidget *preview = NULL; + + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (tab->priv->message_area)); + set_message_area (tab, NULL); /* destroy the message area */ + + gjob = gtk_source_print_job_get_print_job (pjob); + + preview = gedit_print_job_preview_new (gjob); + g_object_unref (gjob); + + set_print_preview (tab, preview); + + gtk_widget_show (preview); + g_object_unref (pjob); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW); +} + + +#endif + +static void +print_cancelled (GtkWidget *area, + gint response_id, + GeditTab *tab) +{ + g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (tab->priv->message_area)); + + gedit_print_job_cancel (tab->priv->print_job); + + g_debug ("print_cancelled"); +} + +static void +show_printing_message_area (GeditTab *tab, gboolean preview) +{ + GtkWidget *area; + + if (preview) + area = gedit_progress_message_area_new (GTK_STOCK_PRINT_PREVIEW, + "", + TRUE); + else + area = gedit_progress_message_area_new (GTK_STOCK_PRINT, + "", + TRUE); + + g_signal_connect (area, + "response", + G_CALLBACK (print_cancelled), + tab); + + set_message_area (tab, area); +} + +#if !GTK_CHECK_VERSION (2, 17, 4) + +static void +page_setup_done_cb (GtkPageSetup *setup, + GeditTab *tab) +{ + if (setup != NULL) + { + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + + /* remember it for this document */ + g_object_set_data_full (G_OBJECT (doc), + GEDIT_PAGE_SETUP_KEY, + g_object_ref (setup), + (GDestroyNotify)g_object_unref); + + /* make it the default */ + _gedit_app_set_default_page_setup (gedit_app_get_default(), + setup); + } +} + +void +_gedit_tab_page_setup (GeditTab *tab) +{ + GtkPageSetup *setup; + GtkPrintSettings *settings; + + g_return_if_fail (GEDIT_IS_TAB (tab)); + + setup = get_page_setup (tab); + settings = get_print_settings (tab); + + gtk_print_run_page_setup_dialog_async (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))), + setup, + settings, + (GtkPageSetupDoneFunc) page_setup_done_cb, + tab); + + /* CHECK: should we unref setup and settings? */ +} + +#endif + +static void +gedit_tab_print_or_print_preview (GeditTab *tab, + GtkPrintOperationAction print_action) +{ + GeditView *view; + gboolean is_preview; + GtkPageSetup *setup; + GtkPrintSettings *settings; + GtkPrintOperationResult res; + GError *error = NULL; + + g_return_if_fail (tab->priv->print_job == NULL); + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_NORMAL); + + view = gedit_tab_get_view (tab); + + is_preview = (print_action == GTK_PRINT_OPERATION_ACTION_PREVIEW); + + tab->priv->print_job = gedit_print_job_new (view); + g_object_add_weak_pointer (G_OBJECT (tab->priv->print_job), + (gpointer *) &tab->priv->print_job); + + show_printing_message_area (tab, is_preview); + + g_signal_connect (tab->priv->print_job, + "printing", + G_CALLBACK (printing_cb), + tab); + g_signal_connect (tab->priv->print_job, + "show-preview", + G_CALLBACK (show_preview_cb), + tab); + g_signal_connect (tab->priv->print_job, + "done", + G_CALLBACK (done_printing_cb), + tab); + + if (is_preview) + gedit_tab_set_state (tab, GEDIT_TAB_STATE_PRINT_PREVIEWING); + else + gedit_tab_set_state (tab, GEDIT_TAB_STATE_PRINTING); + + setup = get_page_setup (tab); + settings = get_print_settings (tab); + + res = gedit_print_job_print (tab->priv->print_job, + print_action, + setup, + settings, + GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))), + &error); + + // TODO: manage res in the correct way + if (res == GTK_PRINT_OPERATION_RESULT_ERROR) + { + /* FIXME: go in error state */ + gedit_tab_set_state (tab, GEDIT_TAB_STATE_NORMAL); + g_warning ("Async print preview failed (%s)", error->message); + g_object_unref (tab->priv->print_job); + g_error_free (error); + } +} + +void +_gedit_tab_print (GeditTab *tab) +{ + g_return_if_fail (GEDIT_IS_TAB (tab)); + + /* FIXME: currently we can have just one printoperation going on + * at a given time, so before starting the print we close the preview. + * Would be nice to handle it properly though */ + if (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) + { + gtk_widget_destroy (tab->priv->print_preview); + } + + gedit_tab_print_or_print_preview (tab, + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); +} + +void +_gedit_tab_print_preview (GeditTab *tab) +{ + g_return_if_fail (GEDIT_IS_TAB (tab)); + + gedit_tab_print_or_print_preview (tab, + GTK_PRINT_OPERATION_ACTION_PREVIEW); +} + +void +_gedit_tab_mark_for_closing (GeditTab *tab) +{ + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail (tab->priv->state == GEDIT_TAB_STATE_NORMAL); + + gedit_tab_set_state (tab, GEDIT_TAB_STATE_CLOSING); +} + +gboolean +_gedit_tab_can_close (GeditTab *tab) +{ + GeditDocument *doc; + GeditTabState ts; + + g_return_val_if_fail (GEDIT_IS_TAB (tab), FALSE); + + ts = gedit_tab_get_state (tab); + + /* if we are loading or reverting, the tab can be closed */ + if ((ts == GEDIT_TAB_STATE_LOADING) || + (ts == GEDIT_TAB_STATE_LOADING_ERROR) || + (ts == GEDIT_TAB_STATE_REVERTING) || + (ts == GEDIT_TAB_STATE_REVERTING_ERROR)) /* CHECK: I'm not sure this is the right behavior for REVERTING ERROR */ + return TRUE; + + /* Do not close tab with saving errors */ + if (ts == GEDIT_TAB_STATE_SAVING_ERROR) + return FALSE; + + doc = gedit_tab_get_document (tab); + + /* TODO: we need to save the file also if it has been externally + modified - Paolo (Oct 10, 2005) */ + + return (!gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc)) && + !gedit_document_get_deleted (doc)); +} + +/** + * gedit_tab_get_auto_save_enabled: + * @tab: a #GeditTab + * + * Gets the current state for the autosave feature + * + * Return value: %TRUE if the autosave is enabled, else %FALSE + **/ +gboolean +gedit_tab_get_auto_save_enabled (GeditTab *tab) +{ + gedit_debug (DEBUG_TAB); + + g_return_val_if_fail (GEDIT_IS_TAB (tab), FALSE); + + return tab->priv->auto_save; +} + +/** + * gedit_tab_set_auto_save_enabled: + * @tab: a #GeditTab + * @enable: enable (%TRUE) or disable (%FALSE) auto save + * + * Enables or disables the autosave feature. It does not install an + * autosave timeout if the document is new or is read-only + **/ +void +gedit_tab_set_auto_save_enabled (GeditTab *tab, + gboolean enable) +{ + GeditDocument *doc = NULL; + GeditLockdownMask lockdown; + + gedit_debug (DEBUG_TAB); + + g_return_if_fail (GEDIT_IS_TAB (tab)); + + /* Force disabling when lockdown is active */ + lockdown = gedit_app_get_lockdown (gedit_app_get_default()); + if (lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK) + enable = FALSE; + + doc = gedit_tab_get_document (tab); + + if (tab->priv->auto_save == enable) + return; + + tab->priv->auto_save = enable; + + if (enable && + (tab->priv->auto_save_timeout <=0) && + !gedit_document_is_untitled (doc) && + !gedit_document_get_readonly (doc)) + { + if ((tab->priv->state != GEDIT_TAB_STATE_LOADING) && + (tab->priv->state != GEDIT_TAB_STATE_SAVING) && + (tab->priv->state != GEDIT_TAB_STATE_REVERTING) && + (tab->priv->state != GEDIT_TAB_STATE_LOADING_ERROR) && + (tab->priv->state != GEDIT_TAB_STATE_SAVING_ERROR) && + (tab->priv->state != GEDIT_TAB_STATE_REVERTING_ERROR)) + { + install_auto_save_timeout (tab); + } + /* else: the timeout will be installed when loading/saving/reverting + will terminate */ + + return; + } + + if (!enable && (tab->priv->auto_save_timeout > 0)) + { + remove_auto_save_timeout (tab); + + return; + } + + g_return_if_fail ((!enable && (tab->priv->auto_save_timeout <= 0)) || + gedit_document_is_untitled (doc) || gedit_document_get_readonly (doc)); +} + +/** + * gedit_tab_get_auto_save_interval: + * @tab: a #GeditTab + * + * Gets the current interval for the autosaves + * + * Return value: the value of the autosave + **/ +gint +gedit_tab_get_auto_save_interval (GeditTab *tab) +{ + gedit_debug (DEBUG_TAB); + + g_return_val_if_fail (GEDIT_IS_TAB (tab), 0); + + return tab->priv->auto_save_interval; +} + +/** + * gedit_tab_set_auto_save_interval: + * @tab: a #GeditTab + * @interval: the new interval + * + * Sets the interval for the autosave feature. It does nothing if the + * interval is the same as the one already present. It removes the old + * interval timeout and adds a new one with the autosave passed as + * argument. + **/ +void +gedit_tab_set_auto_save_interval (GeditTab *tab, + gint interval) +{ + GeditDocument *doc = NULL; + + gedit_debug (DEBUG_TAB); + + g_return_if_fail (GEDIT_IS_TAB (tab)); + + doc = gedit_tab_get_document(tab); + + g_return_if_fail (GEDIT_IS_DOCUMENT (doc)); + g_return_if_fail (interval > 0); + + if (tab->priv->auto_save_interval == interval) + return; + + tab->priv->auto_save_interval = interval; + + if (!tab->priv->auto_save) + return; + + if (tab->priv->auto_save_timeout > 0) + { + g_return_if_fail (!gedit_document_is_untitled (doc)); + g_return_if_fail (!gedit_document_get_readonly (doc)); + + remove_auto_save_timeout (tab); + + install_auto_save_timeout (tab); + } +} + +void +gedit_tab_set_info_bar (GeditTab *tab, + GtkWidget *info_bar) +{ + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail (info_bar == NULL || GTK_IS_WIDGET (info_bar)); + + /* FIXME: this can cause problems with the tab state machine */ + set_message_area (tab, info_bar); +} diff --git a/gedit/gedit-tab.h b/gedit/gedit-tab.h new file mode 100755 index 00000000..68262083 --- /dev/null +++ b/gedit/gedit-tab.h @@ -0,0 +1,165 @@ +/* + * gedit-tab.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_TAB_H__ +#define __GEDIT_TAB_H__ + +#include + +#include +#include + +G_BEGIN_DECLS + +typedef enum +{ + GEDIT_TAB_STATE_NORMAL = 0, + GEDIT_TAB_STATE_LOADING, + GEDIT_TAB_STATE_REVERTING, + GEDIT_TAB_STATE_SAVING, + GEDIT_TAB_STATE_PRINTING, + GEDIT_TAB_STATE_PRINT_PREVIEWING, + GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW, + GEDIT_TAB_STATE_GENERIC_NOT_EDITABLE, + GEDIT_TAB_STATE_LOADING_ERROR, + GEDIT_TAB_STATE_REVERTING_ERROR, + GEDIT_TAB_STATE_SAVING_ERROR, + GEDIT_TAB_STATE_GENERIC_ERROR, + GEDIT_TAB_STATE_CLOSING, + GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION, + GEDIT_TAB_NUM_OF_STATES /* This is not a valid state */ +} GeditTabState; + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_TAB (gedit_tab_get_type()) +#define GEDIT_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_TAB, GeditTab)) +#define GEDIT_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_TAB, GeditTabClass)) +#define GEDIT_IS_TAB(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_TAB)) +#define GEDIT_IS_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_TAB)) +#define GEDIT_TAB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_TAB, GeditTabClass)) + +/* Private structure type */ +typedef struct _GeditTabPrivate GeditTabPrivate; + +/* + * Main object structure + */ +typedef struct _GeditTab GeditTab; + +struct _GeditTab +{ + GtkVBox vbox; + + /*< private > */ + GeditTabPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditTabClass GeditTabClass; + +struct _GeditTabClass +{ + GtkVBoxClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_tab_get_type (void) G_GNUC_CONST; + +GeditView *gedit_tab_get_view (GeditTab *tab); + +/* This is only an helper function */ +GeditDocument *gedit_tab_get_document (GeditTab *tab); + +GeditTab *gedit_tab_get_from_document (GeditDocument *doc); + +GeditTabState gedit_tab_get_state (GeditTab *tab); + +gboolean gedit_tab_get_auto_save_enabled + (GeditTab *tab); + +void gedit_tab_set_auto_save_enabled + (GeditTab *tab, + gboolean enable); + +gint gedit_tab_get_auto_save_interval + (GeditTab *tab); + +void gedit_tab_set_auto_save_interval + (GeditTab *tab, + gint interval); + +void gedit_tab_set_info_bar (GeditTab *tab, + GtkWidget *info_bar); +/* + * Non exported methods + */ +GtkWidget *_gedit_tab_new (void); + +/* Whether create is TRUE, creates a new empty document if location does + not refer to an existing file */ +GtkWidget *_gedit_tab_new_from_uri (const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create); +gchar *_gedit_tab_get_name (GeditTab *tab); +gchar *_gedit_tab_get_tooltips (GeditTab *tab); +GdkPixbuf *_gedit_tab_get_icon (GeditTab *tab); +void _gedit_tab_load (GeditTab *tab, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create); +void _gedit_tab_revert (GeditTab *tab); +void _gedit_tab_save (GeditTab *tab); +void _gedit_tab_save_as (GeditTab *tab, + const gchar *uri, + const GeditEncoding *encoding, + GeditDocumentNewlineType newline_type); + +void _gedit_tab_print (GeditTab *tab); +void _gedit_tab_print_preview (GeditTab *tab); + +void _gedit_tab_mark_for_closing (GeditTab *tab); + +gboolean _gedit_tab_can_close (GeditTab *tab); + +#if !GTK_CHECK_VERSION (2, 17, 4) +void _gedit_tab_page_setup (GeditTab *tab); +#endif + +G_END_DECLS + +#endif /* __GEDIT_TAB_H__ */ diff --git a/gedit/gedit-ui.h b/gedit/gedit-ui.h new file mode 100755 index 00000000..8a536251 --- /dev/null +++ b/gedit/gedit-ui.h @@ -0,0 +1,188 @@ +/* + * gedit-ui.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_UI_H__ +#define __GEDIT_UI_H__ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gedit-commands.h" + +G_BEGIN_DECLS + +static const GtkActionEntry gedit_always_sensitive_menu_entries[] = +{ + /* Toplevel */ + { "File", NULL, N_("_File") }, + { "Edit", NULL, N_("_Edit") }, + { "View", NULL, N_("_View") }, + { "Search", NULL, N_("_Search") }, + { "Tools", NULL, N_("_Tools") }, + { "Documents", NULL, N_("_Documents") }, + { "Help", NULL, N_("_Help") }, + + /* File menu */ + { "FileNew", GTK_STOCK_NEW, NULL, "N", + N_("Create a new document"), G_CALLBACK (_gedit_cmd_file_new) }, + { "FileOpen", GTK_STOCK_OPEN, N_("_Open..."), "O", + N_("Open a file"), G_CALLBACK (_gedit_cmd_file_open) }, + + /* Edit menu */ + { "EditPreferences", GTK_STOCK_PREFERENCES, N_("Pr_eferences"), NULL, + N_("Configure the application"), G_CALLBACK (_gedit_cmd_edit_preferences) }, + + /* Help menu */ + {"HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", + N_("Open the gedit manual"), G_CALLBACK (_gedit_cmd_help_contents) }, + { "HelpAbout", GTK_STOCK_ABOUT, NULL, NULL, + N_("About this application"), G_CALLBACK (_gedit_cmd_help_about) }, + + /* Fullscreen toolbar */ + { "LeaveFullscreen", GTK_STOCK_LEAVE_FULLSCREEN, NULL, + NULL, N_("Leave fullscreen mode"), + G_CALLBACK (_gedit_cmd_view_leave_fullscreen_mode) } +}; + +static const GtkActionEntry gedit_menu_entries[] = +{ + /* File menu */ + { "FileSave", GTK_STOCK_SAVE, NULL, "S", + N_("Save the current file"), G_CALLBACK (_gedit_cmd_file_save) }, + { "FileSaveAs", GTK_STOCK_SAVE_AS, N_("Save _As..."), "S", + N_("Save the current file with a different name"), G_CALLBACK (_gedit_cmd_file_save_as) }, + { "FileRevert", GTK_STOCK_REVERT_TO_SAVED, NULL, NULL, + N_("Revert to a saved version of the file"), G_CALLBACK (_gedit_cmd_file_revert) }, +#if !GTK_CHECK_VERSION (2, 17, 4) + { "FilePageSetup", GTK_STOCK_PAGE_SETUP, N_("Page Set_up..."), NULL, + N_("Set up the page settings"), G_CALLBACK (_gedit_cmd_file_page_setup) }, +#endif + { "FilePrintPreview", GTK_STOCK_PRINT_PREVIEW, N_("Print Previe_w"),"P", + N_("Print preview"), G_CALLBACK (_gedit_cmd_file_print_preview) }, + { "FilePrint", GTK_STOCK_PRINT, N_("_Print..."), "P", + N_("Print the current page"), G_CALLBACK (_gedit_cmd_file_print) }, + + /* Edit menu */ + { "EditUndo", GTK_STOCK_UNDO, NULL, "Z", + N_("Undo the last action"), G_CALLBACK (_gedit_cmd_edit_undo) }, + { "EditRedo", GTK_STOCK_REDO, NULL, "Z", + N_("Redo the last undone action"), G_CALLBACK (_gedit_cmd_edit_redo) }, + { "EditCut", GTK_STOCK_CUT, NULL, "X", + N_("Cut the selection"), G_CALLBACK (_gedit_cmd_edit_cut) }, + { "EditCopy", GTK_STOCK_COPY, NULL, "C", + N_("Copy the selection"), G_CALLBACK (_gedit_cmd_edit_copy) }, + { "EditPaste", GTK_STOCK_PASTE, NULL, "V", + N_("Paste the clipboard"), G_CALLBACK (_gedit_cmd_edit_paste) }, + { "EditDelete", GTK_STOCK_DELETE, NULL, NULL, + N_("Delete the selected text"), G_CALLBACK (_gedit_cmd_edit_delete) }, + { "EditSelectAll", GTK_STOCK_SELECT_ALL, N_("Select _All"), "A", + N_("Select the entire document"), G_CALLBACK (_gedit_cmd_edit_select_all) }, + + /* View menu */ + { "ViewHighlightMode", NULL, N_("_Highlight Mode") }, + + /* Search menu */ + { "SearchFind", GTK_STOCK_FIND, N_("_Find..."), "F", + N_("Search for text"), G_CALLBACK (_gedit_cmd_search_find) }, + { "SearchFindNext", NULL, N_("Find Ne_xt"), "G", + N_("Search forwards for the same text"), G_CALLBACK (_gedit_cmd_search_find_next) }, + { "SearchFindPrevious", NULL, N_("Find Pre_vious"), "G", + N_("Search backwards for the same text"), G_CALLBACK (_gedit_cmd_search_find_prev) }, +#ifndef OS_OSX + { "SearchReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace..."), "H", + N_("Search for and replace text"), G_CALLBACK (_gedit_cmd_search_replace) }, +#else + { "SearchReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace..."), "F", + N_("Search for and replace text"), G_CALLBACK (_gedit_cmd_search_replace) }, +#endif + { "SearchClearHighlight", NULL, N_("_Clear Highlight"), "K", + N_("Clear highlighting of search matches"), G_CALLBACK (_gedit_cmd_search_clear_highlight) }, + { "SearchGoToLine", GTK_STOCK_JUMP_TO, N_("Go to _Line..."), "I", + N_("Go to a specific line"), G_CALLBACK (_gedit_cmd_search_goto_line) }, + { "SearchIncrementalSearch", GTK_STOCK_FIND, N_("_Incremental Search..."), "K", + N_("Incrementally search for text"), G_CALLBACK (_gedit_cmd_search_incremental_search) }, + + /* Documents menu */ + { "FileSaveAll", GTK_STOCK_SAVE, N_("_Save All"), "L", + N_("Save all open files"), G_CALLBACK (_gedit_cmd_file_save_all) }, + { "FileCloseAll", GTK_STOCK_CLOSE, N_("_Close All"), "W", + N_("Close all open files"), G_CALLBACK (_gedit_cmd_file_close_all) }, + { "DocumentsPreviousDocument", NULL, N_("_Previous Document"), "Page_Up", + N_("Activate previous document"), G_CALLBACK (_gedit_cmd_documents_previous_document) }, + { "DocumentsNextDocument", NULL, N_("_Next Document"), "Page_Down", + N_("Activate next document"), G_CALLBACK (_gedit_cmd_documents_next_document) }, + { "DocumentsMoveToNewWindow", NULL, N_("_Move to New Window"), NULL, + N_("Move the current document to a new window"), G_CALLBACK (_gedit_cmd_documents_move_to_new_window) } +}; + +/* separate group, needs to be sensitive on OS X even when there are no tabs */ +static const GtkActionEntry gedit_close_menu_entries[] = +{ + { "FileClose", GTK_STOCK_CLOSE, NULL, "W", + N_("Close the current file"), G_CALLBACK (_gedit_cmd_file_close) } +}; + +/* separate group, should be sensitive even when there are no tabs */ +static const GtkActionEntry gedit_quit_menu_entries[] = +{ + { "FileQuit", GTK_STOCK_QUIT, NULL, "Q", + N_("Quit the program"), G_CALLBACK (_gedit_cmd_file_quit) } +}; + +static const GtkToggleActionEntry gedit_always_sensitive_toggle_menu_entries[] = +{ + { "ViewToolbar", NULL, N_("_Toolbar"), NULL, + N_("Show or hide the toolbar in the current window"), + G_CALLBACK (_gedit_cmd_view_show_toolbar), TRUE }, + { "ViewStatusbar", NULL, N_("_Statusbar"), NULL, + N_("Show or hide the statusbar in the current window"), + G_CALLBACK (_gedit_cmd_view_show_statusbar), TRUE }, + { "ViewFullscreen", GTK_STOCK_FULLSCREEN, NULL, "F11", + N_("Edit text in fullscreen"), + G_CALLBACK (_gedit_cmd_view_toggle_fullscreen_mode), FALSE } +}; + +/* separate group, should be always sensitive except when there are no panes */ +static const GtkToggleActionEntry gedit_panes_toggle_menu_entries[] = +{ + { "ViewSidePane", NULL, N_("Side _Pane"), "F9", + N_("Show or hide the side pane in the current window"), + G_CALLBACK (_gedit_cmd_view_show_side_pane), FALSE }, + { "ViewBottomPane", NULL, N_("_Bottom Pane"), "F9", + N_("Show or hide the bottom pane in the current window"), + G_CALLBACK (_gedit_cmd_view_show_bottom_pane), FALSE } +}; + +G_END_DECLS + +#endif /* __GEDIT_UI_H__ */ diff --git a/gedit/gedit-ui.xml b/gedit/gedit-ui.xml new file mode 100755 index 00000000..21c31a72 --- /dev/null +++ b/gedit/gedit-ui.xml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gedit/gedit-utils.c b/gedit/gedit-utils.c new file mode 100755 index 00000000..c34b746f --- /dev/null +++ b/gedit/gedit-utils.c @@ -0,0 +1,1546 @@ +/* + * gedit-utils.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2002 Chema Celorio, Paolo Maggi + * Copyright (C) 2003-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "gedit-utils.h" + +#include "gedit-document.h" +#include "gedit-prefs-manager.h" +#include "gedit-debug.h" + +/* For the workspace/viewport stuff */ +#ifdef GDK_WINDOWING_X11 +#include +#include +#include +#include +#endif + +#define STDIN_DELAY_MICROSECONDS 100000 + +/* Returns true if uri is a file: uri and is not a chained uri */ +gboolean +gedit_utils_uri_has_file_scheme (const gchar *uri) +{ + GFile *gfile; + gboolean res; + + gfile = g_file_new_for_uri (uri); + res = g_file_has_uri_scheme (gfile, "file"); + + g_object_unref (gfile); + return res; +} + +/* FIXME: we should check for chained URIs */ +gboolean +gedit_utils_uri_has_writable_scheme (const gchar *uri) +{ + GFile *gfile; + gchar *scheme; + GSList *writable_schemes; + gboolean res; + + gfile = g_file_new_for_uri (uri); + scheme = g_file_get_uri_scheme (gfile); + + g_return_val_if_fail (scheme != NULL, FALSE); + + g_object_unref (gfile); + + writable_schemes = gedit_prefs_manager_get_writable_vfs_schemes (); + + /* CHECK: should we use g_ascii_strcasecmp? - Paolo (Nov 6, 2005) */ + res = (g_slist_find_custom (writable_schemes, + scheme, + (GCompareFunc)strcmp) != NULL); + + g_slist_foreach (writable_schemes, (GFunc)g_free, NULL); + g_slist_free (writable_schemes); + + g_free (scheme); + + return res; +} + +static void +widget_get_origin (GtkWidget *widget, gint *x, gint *y) + +{ + GdkWindow *window; + + window = gtk_widget_get_window (widget); + gdk_window_get_origin (window, x, y); +} + +void +gedit_utils_menu_position_under_widget (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) +{ + GtkWidget *widget; + GtkRequisition requisition; + + widget = GTK_WIDGET (user_data); + widget_get_origin (widget, x, y); + + gtk_widget_size_request (GTK_WIDGET (menu), &requisition); + + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + { + *x += widget->allocation.x + widget->allocation.width - requisition.width; + } + else + { + *x += widget->allocation.x; + } + + *y += widget->allocation.y + widget->allocation.height; + + *push_in = TRUE; +} + +void +gedit_utils_menu_position_under_tree_view (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) +{ + GtkTreeView *tree = GTK_TREE_VIEW (user_data); + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (tree); + g_return_if_fail (model != NULL); + + selection = gtk_tree_view_get_selection (tree); + g_return_if_fail (selection != NULL); + + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) + { + GtkTreePath *path; + GdkRectangle rect; + + widget_get_origin (GTK_WIDGET (tree), x, y); + + path = gtk_tree_model_get_path (model, &iter); + gtk_tree_view_get_cell_area (tree, path, + gtk_tree_view_get_column (tree, 0), /* FIXME 0 for RTL ? */ + &rect); + gtk_tree_path_free (path); + + *x += rect.x; + *y += rect.y + rect.height; + + if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL) + { + GtkRequisition requisition; + gtk_widget_size_request (GTK_WIDGET (menu), &requisition); + *x += rect.width - requisition.width; + } + } + else + { + /* no selection -> regular "under widget" positioning */ + gedit_utils_menu_position_under_widget (menu, + x, y, push_in, + tree); + } +} + +/* FIXME: remove this with gtk 2.12, it has gdk_color_to_string */ +gchar * +gedit_gdk_color_to_string (GdkColor color) +{ + return g_strdup_printf ("#%04x%04x%04x", + color.red, + color.green, + color.blue); +} + +GtkWidget * +gedit_gtk_button_new_with_stock_icon (const gchar *label, + const gchar *stock_id) +{ + GtkWidget *button; + + button = gtk_button_new_with_mnemonic (label); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_stock (stock_id, + GTK_ICON_SIZE_BUTTON)); + + return button; +} + +GtkWidget * +gedit_dialog_add_button (GtkDialog *dialog, + const gchar *text, + const gchar *stock_id, + gint response_id) +{ + GtkWidget *button; + + g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL); + g_return_val_if_fail (text != NULL, NULL); + g_return_val_if_fail (stock_id != NULL, NULL); + + button = gedit_gtk_button_new_with_stock_icon (text, stock_id); + g_return_val_if_fail (button != NULL, NULL); + + GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); + + gtk_widget_show (button); + + gtk_dialog_add_action_widget (dialog, button, response_id); + + return button; +} + +/* + * n: len of the string in bytes + */ +gboolean +g_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; +} + +/** + * gedit_utils_set_atk_name_description + * @widget : The Gtk widget for which name/description to be set + * @name : Atk name string + * @description : Atk description string + * Description : This function sets up name and description + * for a specified gtk widget. + */ +void +gedit_utils_set_atk_name_description (GtkWidget *widget, + const gchar *name, + const gchar *description) +{ + AtkObject *aobj; + + aobj = gtk_widget_get_accessible (widget); + + if (!(GTK_IS_ACCESSIBLE (aobj))) + return; + + if(name) + atk_object_set_name (aobj, name); + + if(description) + atk_object_set_description (aobj, description); +} + +/** + * gedit_set_atk__relation + * @obj1,@obj2 : specified widgets. + * @rel_type : the type of relation to set up. + * Description : This function establishes atk relation + * between 2 specified widgets. + */ +void +gedit_utils_set_atk_relation (GtkWidget *obj1, + GtkWidget *obj2, + AtkRelationType rel_type ) +{ + AtkObject *atk_obj1, *atk_obj2; + AtkRelationSet *relation_set; + AtkObject *targets[1]; + AtkRelation *relation; + + atk_obj1 = gtk_widget_get_accessible (obj1); + atk_obj2 = gtk_widget_get_accessible (obj2); + + if (!(GTK_IS_ACCESSIBLE (atk_obj1)) || !(GTK_IS_ACCESSIBLE (atk_obj2))) + return; + + relation_set = atk_object_ref_relation_set (atk_obj1); + targets[0] = atk_obj2; + + relation = atk_relation_new (targets, 1, rel_type); + atk_relation_set_add (relation_set, relation); + + g_object_unref (G_OBJECT (relation)); +} + +gboolean +gedit_utils_uri_exists (const gchar* text_uri) +{ + GFile *gfile; + gboolean res; + + g_return_val_if_fail (text_uri != NULL, FALSE); + + gedit_debug_message (DEBUG_UTILS, "text_uri: %s", text_uri); + + gfile = g_file_new_for_uri (text_uri); + res = g_file_query_exists (gfile, NULL); + + g_object_unref (gfile); + + gedit_debug_message (DEBUG_UTILS, res ? "TRUE" : "FALSE"); + + return res; +} + +gchar * +gedit_utils_escape_search_text (const gchar* text) +{ + GString *str; + gint length; + const gchar *p; + const gchar *end; + + if (text == NULL) + return NULL; + + gedit_debug_message (DEBUG_SEARCH, "Text: %s", text); + + length = strlen (text); + + /* no escape when typing. + * The short circuit works only for ascii, but we only + * care about not escaping a single '\' */ + if (length == 1) + return g_strdup (text); + + str = g_string_new (""); + + p = text; + end = text + length; + + while (p != end) + { + const gchar *next; + next = g_utf8_next_char (p); + + switch (*p) + { + case '\n': + g_string_append (str, "\\n"); + break; + case '\r': + g_string_append (str, "\\r"); + break; + case '\t': + g_string_append (str, "\\t"); + break; + case '\\': + g_string_append (str, "\\\\"); + break; + default: + g_string_append_len (str, p, next - p); + break; + } + + p = next; + } + + return g_string_free (str, FALSE); +} + +gchar * +gedit_utils_unescape_search_text (const gchar *text) +{ + GString *str; + gint length; + gboolean drop_prev = FALSE; + const gchar *cur; + const gchar *end; + const gchar *prev; + + if (text == NULL) + return NULL; + + length = strlen (text); + + str = g_string_new (""); + + cur = text; + end = text + length; + prev = NULL; + + while (cur != end) + { + const gchar *next; + next = g_utf8_next_char (cur); + + if (prev && (*prev == '\\')) + { + switch (*cur) + { + case 'n': + str = g_string_append (str, "\n"); + break; + case 'r': + str = g_string_append (str, "\r"); + break; + case 't': + str = g_string_append (str, "\t"); + break; + case '\\': + str = g_string_append (str, "\\"); + drop_prev = TRUE; + break; + default: + str = g_string_append (str, "\\"); + str = g_string_append_len (str, cur, next - cur); + break; + } + } + else if (*cur != '\\') + { + str = g_string_append_len (str, cur, next - cur); + } + else if ((next == end) && (*cur == '\\')) + { + str = g_string_append (str, "\\"); + } + + if (!drop_prev) + { + prev = cur; + } + else + { + prev = NULL; + drop_prev = FALSE; + } + + cur = next; + } + + return g_string_free (str, FALSE); +} + +void +gedit_warning (GtkWindow *parent, const gchar *format, ...) +{ + va_list args; + gchar *str; + GtkWidget *dialog; + GtkWindowGroup *wg = NULL; + + g_return_if_fail (format != NULL); + + if (parent != NULL) + wg = gtk_window_get_group (parent); + + va_start (args, format); + str = g_strdup_vprintf (format, args); + va_end (args); + + dialog = gtk_message_dialog_new_with_markup ( + parent, + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", str); + + g_free (str); + + if (wg != NULL) + gtk_window_group_add_window (wg, GTK_WINDOW (dialog)); + + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + g_signal_connect (G_OBJECT (dialog), + "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + + gtk_widget_show (dialog); +} + +/* + * Doubles underscore to avoid spurious menu accels. + */ +gchar * +gedit_utils_escape_underscores (const gchar* text, + gssize length) +{ + GString *str; + const gchar *p; + const gchar *end; + + g_return_val_if_fail (text != NULL, NULL); + + if (length < 0) + length = strlen (text); + + str = g_string_sized_new (length); + + p = text; + end = text + length; + + while (p != end) + { + const gchar *next; + next = g_utf8_next_char (p); + + switch (*p) + { + case '_': + g_string_append (str, "__"); + break; + default: + g_string_append_len (str, p, next - p); + break; + } + + p = next; + } + + return g_string_free (str, FALSE); +} + +/* the following functions are taken from eel */ + +static gchar * +gedit_utils_str_truncate (const gchar *string, + guint truncate_length, + gboolean middle) +{ + GString *truncated; + guint length; + guint n_chars; + guint num_left_chars; + guint right_offset; + guint delimiter_length; + const gchar *delimiter = "\342\200\246"; + + g_return_val_if_fail (string != NULL, NULL); + + length = strlen (string); + + g_return_val_if_fail (g_utf8_validate (string, length, NULL), NULL); + + /* It doesnt make sense to truncate strings to less than + * the size of the delimiter plus 2 characters (one on each + * side) + */ + delimiter_length = g_utf8_strlen (delimiter, -1); + if (truncate_length < (delimiter_length + 2)) { + return g_strdup (string); + } + + n_chars = g_utf8_strlen (string, length); + + /* Make sure the string is not already small enough. */ + if (n_chars <= truncate_length) { + return g_strdup (string); + } + + /* Find the 'middle' where the truncation will occur. */ + if (middle) + { + num_left_chars = (truncate_length - delimiter_length) / 2; + right_offset = n_chars - truncate_length + num_left_chars + delimiter_length; + + truncated = g_string_new_len (string, + g_utf8_offset_to_pointer (string, num_left_chars) - string); + g_string_append (truncated, delimiter); + g_string_append (truncated, g_utf8_offset_to_pointer (string, right_offset)); + } + else + { + num_left_chars = truncate_length - delimiter_length; + truncated = g_string_new_len (string, + g_utf8_offset_to_pointer (string, num_left_chars) - string); + g_string_append (truncated, delimiter); + } + + return g_string_free (truncated, FALSE); +} + +gchar * +gedit_utils_str_middle_truncate (const gchar *string, + guint truncate_length) +{ + return gedit_utils_str_truncate (string, truncate_length, TRUE); +} + +gchar * +gedit_utils_str_end_truncate (const gchar *string, + guint truncate_length) +{ + return gedit_utils_str_truncate (string, truncate_length, FALSE); +} + +gchar * +gedit_utils_make_valid_utf8 (const char *name) +{ + GString *string; + const char *remainder, *invalid; + int remaining_bytes, valid_bytes; + + g_return_val_if_fail (name != NULL, NULL); + + string = NULL; + remainder = name; + remaining_bytes = strlen (name); + + while (remaining_bytes != 0) { + if (g_utf8_validate (remainder, remaining_bytes, &invalid)) { + break; + } + valid_bytes = invalid - remainder; + + if (string == NULL) { + string = g_string_sized_new (remaining_bytes); + } + g_string_append_len (string, remainder, valid_bytes); + /* append U+FFFD REPLACEMENT CHARACTER */ + g_string_append (string, "\357\277\275"); + + remaining_bytes -= valid_bytes + 1; + remainder = invalid + 1; + } + + if (string == NULL) { + return g_strdup (name); + } + + g_string_append (string, remainder); + + g_assert (g_utf8_validate (string->str, -1, NULL)); + + return g_string_free (string, FALSE); +} + +/* Note that this function replace home dir with ~ */ +gchar * +gedit_utils_uri_get_dirname (const gchar *uri) +{ + gchar *res; + gchar *str; + + g_return_val_if_fail (uri != NULL, NULL); + + /* CHECK: does it work with uri chaining? - Paolo */ + str = g_path_get_dirname (uri); + g_return_val_if_fail (str != NULL, g_strdup (".")); + + if ((strlen (str) == 1) && (*str == '.')) + { + g_free (str); + + return NULL; + } + + res = gedit_utils_replace_home_dir_with_tilde (str); + + g_free (str); + + return res; +} + +/** + * gedit_utils_location_get_dirname_for_display + * @file: the location + * + * Returns a string suitable to be displayed in the UI indicating + * the name of the directory where the file is located. + * For remote files it may also contain the hostname etc. + * For local files it tries to replace the home dir with ~. + * + * Returns: a string to display the dirname + */ +gchar * +gedit_utils_location_get_dirname_for_display (GFile *location) +{ + gchar *uri; + gchar *res; + GMount *mount; + + g_return_val_if_fail (location != NULL, NULL); + + /* we use the parse name, that is either the local path + * or an uri but which is utf8 safe */ + uri = g_file_get_parse_name (location); + + /* FIXME: this is sync... is it a problem? */ + mount = g_file_find_enclosing_mount (location, NULL, NULL); + if (mount != NULL) + { + gchar *mount_name; + gchar *path; + + mount_name = g_mount_get_name (mount); + g_object_unref (mount); + + /* obtain the "path" patrt of the uri */ + if (gedit_utils_decode_uri (uri, + NULL, NULL, + NULL, NULL, + &path)) + { + gchar *dirname; + + dirname = gedit_utils_uri_get_dirname (path); + res = g_strdup_printf ("%s %s", mount_name, dirname); + + g_free (path); + g_free (dirname); + g_free (mount_name); + } + else + { + res = mount_name; + } + } + else + { + /* fallback for local files or uris without mounts */ + res = gedit_utils_uri_get_dirname (uri); + } + + g_free (uri); + + return res; +} + +gchar * +gedit_utils_replace_home_dir_with_tilde (const gchar *uri) +{ + gchar *tmp; + gchar *home; + + g_return_val_if_fail (uri != NULL, NULL); + + /* Note that g_get_home_dir returns a const string */ + tmp = (gchar *)g_get_home_dir (); + + if (tmp == NULL) + return g_strdup (uri); + + home = g_filename_to_utf8 (tmp, -1, NULL, NULL, NULL); + if (home == NULL) + return g_strdup (uri); + + if (strcmp (uri, home) == 0) + { + g_free (home); + + return g_strdup ("~"); + } + + tmp = home; + home = g_strdup_printf ("%s/", tmp); + g_free (tmp); + + if (g_str_has_prefix (uri, home)) + { + gchar *res; + + res = g_strdup_printf ("~/%s", uri + strlen (home)); + + g_free (home); + + return res; + } + + g_free (home); + + return g_strdup (uri); +} + +/* the following two functions are courtesy of galeon */ + +/** + * gedit_utils_get_current_workspace: Get the current workspace + * + * Get the currently visible workspace for the #GdkScreen. + * + * If the X11 window property isn't found, 0 (the first workspace) + * is returned. + */ +guint +gedit_utils_get_current_workspace (GdkScreen *screen) +{ +#ifdef GDK_WINDOWING_X11 + GdkWindow *root_win; + GdkDisplay *display; + Atom type; + gint format; + gulong nitems; + gulong bytes_after; + guint *current_desktop; + gint err, result; + guint ret = 0; + + g_return_val_if_fail (GDK_IS_SCREEN (screen), 0); + + root_win = gdk_screen_get_root_window (screen); + display = gdk_screen_get_display (screen); + + gdk_error_trap_push (); + result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (root_win), + gdk_x11_get_xatom_by_name_for_display (display, "_NET_CURRENT_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, + &bytes_after, (gpointer) ¤t_desktop); + err = gdk_error_trap_pop (); + + if (err != Success || result != Success) + return ret; + + if (type == XA_CARDINAL && format == 32 && nitems > 0) + ret = current_desktop[0]; + + XFree (current_desktop); + return ret; +#else + /* FIXME: on mac etc proably there are native APIs + * to get the current workspace etc */ + return 0; +#endif +} + +/** + * gedit_utils_get_window_workspace: Get the workspace the window is on + * + * This function gets the workspace that the #GtkWindow is visible on, + * it returns GEDIT_ALL_WORKSPACES if the window is sticky, or if + * the window manager doesn support this function + */ +guint +gedit_utils_get_window_workspace (GtkWindow *gtkwindow) +{ +#ifdef GDK_WINDOWING_X11 + GdkWindow *window; + GdkDisplay *display; + Atom type; + gint format; + gulong nitems; + gulong bytes_after; + guint *workspace; + gint err, result; + guint ret = GEDIT_ALL_WORKSPACES; + + g_return_val_if_fail (GTK_IS_WINDOW (gtkwindow), 0); + g_return_val_if_fail (GTK_WIDGET_REALIZED (GTK_WIDGET (gtkwindow)), 0); + + window = gtk_widget_get_window (GTK_WIDGET (gtkwindow)); + display = gdk_drawable_get_display (window); + + gdk_error_trap_push (); + result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, + &bytes_after, (gpointer) &workspace); + err = gdk_error_trap_pop (); + + if (err != Success || result != Success) + return ret; + + if (type == XA_CARDINAL && format == 32 && nitems > 0) + ret = workspace[0]; + + XFree (workspace); + return ret; +#else + /* FIXME: on mac etc proably there are native APIs + * to get the current workspace etc */ + return 0; +#endif +} + +/** + * gedit_utils_get_current_viewport: Get the current viewport origin + * + * Get the currently visible viewport origin for the #GdkScreen. + * + * If the X11 window property isn't found, (0, 0) is returned. + */ +void +gedit_utils_get_current_viewport (GdkScreen *screen, + gint *x, + gint *y) +{ +#ifdef GDK_WINDOWING_X11 + GdkWindow *root_win; + GdkDisplay *display; + Atom type; + gint format; + gulong nitems; + gulong bytes_after; + gulong *coordinates; + gint err, result; + + g_return_if_fail (GDK_IS_SCREEN (screen)); + g_return_if_fail (x != NULL && y != NULL); + + /* Default values for the viewport origin */ + *x = 0; + *y = 0; + + root_win = gdk_screen_get_root_window (screen); + display = gdk_screen_get_display (screen); + + gdk_error_trap_push (); + result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (root_win), + gdk_x11_get_xatom_by_name_for_display (display, "_NET_DESKTOP_VIEWPORT"), + 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, + &bytes_after, (void*) &coordinates); + err = gdk_error_trap_pop (); + + if (err != Success || result != Success) + return; + + if (type != XA_CARDINAL || format != 32 || nitems < 2) + { + XFree (coordinates); + return; + } + + *x = coordinates[0]; + *y = coordinates[1]; + XFree (coordinates); +#else + /* FIXME: on mac etc proably there are native APIs + * to get the current workspace etc */ + *x = 0; + *y = 0; +#endif +} + +void +gedit_utils_activate_url (GtkAboutDialog *about, + const gchar *url, + gpointer data) +{ + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (about)), url, GDK_CURRENT_TIME, NULL); +} + +static gboolean +is_valid_scheme_character (gchar c) +{ + return g_ascii_isalnum (c) || c == '+' || c == '-' || c == '.'; +} + +static gboolean +has_valid_scheme (const gchar *uri) +{ + const gchar *p; + + p = uri; + + if (!is_valid_scheme_character (*p)) { + return FALSE; + } + + do { + p++; + } while (is_valid_scheme_character (*p)); + + return *p == ':'; +} + +gboolean +gedit_utils_is_valid_uri (const gchar *uri) +{ + const guchar *p; + + if (uri == NULL) + return FALSE; + + if (!has_valid_scheme (uri)) + return FALSE; + + /* We expect to have a fully valid set of characters */ + for (p = (const guchar *)uri; *p; p++) { + if (*p == '%') + { + ++p; + if (!g_ascii_isxdigit (*p)) + return FALSE; + + ++p; + if (!g_ascii_isxdigit (*p)) + return FALSE; + } + else + { + if (*p <= 32 || *p >= 128) + return FALSE; + } + } + + return TRUE; +} + +static GtkWidget * +handle_builder_error (const gchar *message, ...) +{ + GtkWidget *label; + gchar *msg; + gchar *msg_plain; + va_list args; + + va_start (args, message); + msg_plain = g_strdup_vprintf (message, args); + va_end (args); + + label = gtk_label_new (NULL); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + + msg = g_strconcat ("", + msg_plain, "\n\n", + _("Please check your installation."), + NULL); + + gtk_label_set_markup (GTK_LABEL (label), msg); + + g_free (msg_plain); + g_free (msg); + + gtk_misc_set_padding (GTK_MISC (label), 5, 5); + + return label; +} + +/** + * gedit_utils_get_ui_objects: + * @filename: the path to the gtk builder file + * @root_objects: a NULL terminated list of root objects to load or NULL to + * load all objects + * @error_widget: a pointer were a #GtkLabel + * @object_name: the name of the first object + * @...: a pointer were the first object is returned, followed by more + * name / object pairs and terminated by NULL. + * + * This function gets the requested objects from a GtkBuilder ui file. In case + * of error it returns FALSE and sets error_widget to a GtkLabel containing + * the error message to display. + * + * Returns FALSE if an error occurs, TRUE on success. + */ +gboolean +gedit_utils_get_ui_objects (const gchar *filename, + gchar **root_objects, + GtkWidget **error_widget, + const gchar *object_name, + ...) +{ + + GtkBuilder *builder; + va_list args; + const gchar *name; + GError *error = NULL; + gchar *filename_markup; + gboolean ret = TRUE; + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (error_widget != NULL, FALSE); + g_return_val_if_fail (object_name != NULL, FALSE); + + filename_markup = g_markup_printf_escaped ("%s", filename); + *error_widget = NULL; + + builder = gtk_builder_new (); + + if (root_objects != NULL) + { + gtk_builder_add_objects_from_file (builder, + filename, + root_objects, + &error); + } + else + { + gtk_builder_add_from_file (builder, + filename, + &error); + } + + if (error != NULL) + { + *error_widget = handle_builder_error (_("Unable to open UI file %s. Error: %s"), + filename_markup, + error->message); + g_error_free (error); + g_free (filename_markup); + g_object_unref (builder); + + return FALSE; + } + + va_start (args, object_name); + for (name = object_name; name; name = va_arg (args, const gchar *) ) + { + GObject **gobj; + + gobj = va_arg (args, GObject **); + *gobj = gtk_builder_get_object (builder, name); + + if (!*gobj) + { + *error_widget = handle_builder_error (_("Unable to find the object '%s' inside file %s."), + name, + filename_markup), + ret = FALSE; + break; + } + + /* we return a new ref for the root objects, + * the others are already reffed by their parent root object */ + if (root_objects != NULL) + { + gint i; + + for (i = 0; root_objects[i] != NULL; ++i) + { + if ((strcmp (name, root_objects[i]) == 0)) + { + g_object_ref (*gobj); + } + } + } + } + va_end (args); + + g_free (filename_markup); + g_object_unref (builder); + + return ret; +} + +gchar * +gedit_utils_make_canonical_uri_from_shell_arg (const gchar *str) +{ + GFile *gfile; + gchar *uri; + + g_return_val_if_fail (str != NULL, NULL); + g_return_val_if_fail (*str != '\0', NULL); + + /* Note for the future: + * FIXME: is still still relevant? + * + * paolo: and flame whoever tells + * you that file:///mate/test_files/hëllò + * doesn't work --- that's not a valid URI + * + * federico: well, another solution that + * does not requires patch to _from_shell_args + * is to check that the string returned by it + * contains only ASCII chars + * paolo: hmmmm, isn't there + * mate_vfs_is_uri_valid() or something? + * : I will use gedit_utils_is_valid_uri () + * + */ + + gfile = g_file_new_for_commandline_arg (str); + uri = g_file_get_uri (gfile); + g_object_unref (gfile); + + if (gedit_utils_is_valid_uri (uri)) + return uri; + + g_free (uri); + return NULL; +} + +/** + * gedit_utils_file_has_parent: + * @gfile: the GFile to check the parent for + * + * Return TRUE if the specified gfile has a parent (is not the root), FALSE + * otherwise + */ +gboolean +gedit_utils_file_has_parent (GFile *gfile) +{ + GFile *parent; + gboolean ret; + + parent = g_file_get_parent (gfile); + ret = parent != NULL; + + if (parent) + g_object_unref (parent); + + return ret; +} + +/** + * gedit_utils_basename_for_display: + * @uri: uri for which the basename should be displayed + * + * Return the basename of a file suitable for display to users. + */ +gchar * +gedit_utils_basename_for_display (gchar const *uri) +{ + gchar *name; + GFile *gfile; + gchar *hn; + + g_return_val_if_fail (uri != NULL, NULL); + + gfile = g_file_new_for_uri (uri); + + /* First, try to query the display name, but only on local files */ + if (g_file_has_uri_scheme (gfile, "file")) + { + GFileInfo *info; + info = g_file_query_info (gfile, + G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, + G_FILE_QUERY_INFO_NONE, + NULL, + NULL); + + if (info) + { + /* Simply get the display name to use as the basename */ + name = g_strdup (g_file_info_get_display_name (info)); + g_object_unref (info); + } + else + { + /* This is a local file, and therefore we will use + * g_filename_display_basename on the local path */ + gchar *local_path; + + local_path = g_file_get_path (gfile); + name = g_filename_display_basename (local_path); + g_free (local_path); + } + } + else if (gedit_utils_file_has_parent (gfile) || !gedit_utils_decode_uri (uri, NULL, NULL, &hn, NULL, NULL)) + { + /* For remote files with a parent (so not just http://foo.com) + or remote file for which the decoding of the host name fails, + use the _parse_name and take basename of that */ + gchar *parse_name; + gchar *base; + + parse_name = g_file_get_parse_name (gfile); + base = g_filename_display_basename (parse_name); + name = g_uri_unescape_string (base, NULL); + + g_free (base); + g_free (parse_name); + } + else + { + /* display '/ on ' using the decoded host */ + gchar *hn_utf8; + + if (hn != NULL) + hn_utf8 = gedit_utils_make_valid_utf8 (hn); + else + /* we should never get here */ + hn_utf8 = g_strdup ("?"); + + /* Translators: '/ on ' */ + name = g_strdup_printf (_("/ on %s"), hn_utf8); + + g_free (hn_utf8); + g_free (hn); + } + + g_object_unref (gfile); + + return name; +} + +/** + * gedit_utils_uri_for_display: + * @uri: uri to be displayed. + * + * Filter, modify, unescape and change @uri to make it appropriate + * for display to users. + * + * This function is a convenient wrapper for g_file_get_parse_name + * + * Return value: a string which represents @uri and can be displayed. + */ +gchar * +gedit_utils_uri_for_display (const gchar *uri) +{ + GFile *gfile; + gchar *parse_name; + + gfile = g_file_new_for_uri (uri); + parse_name = g_file_get_parse_name (gfile); + g_object_unref (gfile); + + return parse_name; +} + +/** + * gedit_utils_drop_get_uris: + * @selection_data: the #GtkSelectionData from drag_data_received + * @info: the info from drag_data_received + * + * Create a list of valid uri's from a uri-list drop. + * + * Return value: a string array which will hold the uris or NULL if there + * were no valid uris. g_strfreev should be used when the + * string array is no longer used + */ +gchar ** +gedit_utils_drop_get_uris (GtkSelectionData *selection_data) +{ + gchar **uris; + gint i; + gint p = 0; + gchar **uri_list; + + uris = g_uri_list_extract_uris ((gchar *) gtk_selection_data_get_data (selection_data)); + uri_list = g_new0(gchar *, g_strv_length (uris) + 1); + + for (i = 0; uris[i] != NULL; i++) + { + gchar *uri; + + uri = gedit_utils_make_canonical_uri_from_shell_arg (uris[i]); + + /* Silently ignore malformed URI/filename */ + if (uri != NULL) + uri_list[p++] = uri; + } + + if (*uri_list == NULL) + { + g_free(uri_list); + return NULL; + } + + return uri_list; +} + +static void +null_ptr (gchar **ptr) +{ + if (ptr) + *ptr = NULL; +} + +/** + * gedit_utils_decode_uri: + * @uri: the uri to decode + * @scheme: return value pointer for the uri's scheme (e.g. http, sftp, ...) + * @user: return value pointer for the uri user info + * @port: return value pointer for the uri port + * @host: return value pointer for the uri host + * @path: return value pointer for the uri path + * + * Parse and break an uri apart in its individual components like the uri + * scheme, user info, port, host and path. The return value pointer can be + * NULL to ignore certain parts of the uri. If the function returns TRUE, then + * all return value pointers should be freed using g_free + * + * Return value: TRUE if the uri could be properly decoded, FALSE otherwise. + */ +gboolean +gedit_utils_decode_uri (const gchar *uri, + gchar **scheme, + gchar **user, + gchar **host, + gchar **port, + gchar **path +) +{ + /* Largely copied from glib/gio/gdummyfile.c:_g_decode_uri. This + * functionality should be in glib/gio, but for now we implement it + * ourselves (see bug #546182) */ + + const char *p, *in, *hier_part_start, *hier_part_end; + char *out; + char c; + + /* From RFC 3986 Decodes: + * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] + */ + + p = uri; + + null_ptr (scheme); + null_ptr (user); + null_ptr (port); + null_ptr (host); + null_ptr (path); + + /* Decode scheme: + * scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + */ + + if (!g_ascii_isalpha (*p)) + return FALSE; + + while (1) + { + c = *p++; + + if (c == ':') + break; + + if (!(g_ascii_isalnum(c) || + c == '+' || + c == '-' || + c == '.')) + return FALSE; + } + + if (scheme) + { + *scheme = g_malloc (p - uri); + out = *scheme; + + for (in = uri; in < p - 1; in++) + *out++ = g_ascii_tolower (*in); + + *out = '\0'; + } + + hier_part_start = p; + hier_part_end = p + strlen (p); + + if (hier_part_start[0] == '/' && hier_part_start[1] == '/') + { + const char *authority_start, *authority_end; + const char *userinfo_start, *userinfo_end; + const char *host_start, *host_end; + const char *port_start; + + authority_start = hier_part_start + 2; + /* authority is always followed by / or nothing */ + authority_end = memchr (authority_start, '/', hier_part_end - authority_start); + + if (authority_end == NULL) + authority_end = hier_part_end; + + /* 3.2: + * authority = [ userinfo "@" ] host [ ":" port ] + */ + + userinfo_end = memchr (authority_start, '@', authority_end - authority_start); + + if (userinfo_end) + { + userinfo_start = authority_start; + + if (user) + *user = g_uri_unescape_segment (userinfo_start, userinfo_end, NULL); + + if (user && *user == NULL) + { + if (scheme) + g_free (*scheme); + + return FALSE; + } + + host_start = userinfo_end + 1; + } + else + host_start = authority_start; + + port_start = memchr (host_start, ':', authority_end - host_start); + + if (port_start) + { + host_end = port_start++; + + if (port) + *port = g_strndup (port_start, authority_end - port_start); + } + else + host_end = authority_end; + + if (host) + *host = g_strndup (host_start, host_end - host_start); + + hier_part_start = authority_end; + } + + if (path) + *path = g_uri_unescape_segment (hier_part_start, hier_part_end, "/"); + + return TRUE; +} diff --git a/gedit/gedit-utils.h b/gedit/gedit-utils.h new file mode 100755 index 00000000..ddf1d9c5 --- /dev/null +++ b/gedit/gedit-utils.h @@ -0,0 +1,162 @@ +/* + * gedit-utils.h + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002 - 2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_UTILS_H__ +#define __GEDIT_UTILS_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + +/* useful macro */ +#define GBOOLEAN_TO_POINTER(i) (GINT_TO_POINTER ((i) ? 2 : 1)) +#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT(i) == 2) ? TRUE : FALSE)) + +#define IS_VALID_BOOLEAN(v) (((v == TRUE) || (v == FALSE)) ? TRUE : FALSE) + +enum { GEDIT_ALL_WORKSPACES = 0xffffffff }; + +gboolean gedit_utils_uri_has_writable_scheme (const gchar *uri); +gboolean gedit_utils_uri_has_file_scheme (const gchar *uri); + +void gedit_utils_menu_position_under_widget (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data); + +void gedit_utils_menu_position_under_tree_view + (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data); + +gchar *gedit_gdk_color_to_string (GdkColor color); + +GtkWidget *gedit_gtk_button_new_with_stock_icon (const gchar *label, + const gchar *stock_id); + +GtkWidget *gedit_dialog_add_button (GtkDialog *dialog, + const gchar *text, + const gchar *stock_id, + gint response_id); + +gchar *gedit_utils_escape_underscores (const gchar *text, + gssize length); + +gchar *gedit_utils_str_middle_truncate (const gchar *string, + guint truncate_length); + +gchar *gedit_utils_str_end_truncate (const gchar *string, + guint truncate_length); + +gboolean g_utf8_caselessnmatch (const char *s1, + const char *s2, + gssize n1, + gssize n2); + +void gedit_utils_set_atk_name_description (GtkWidget *widget, + const gchar *name, + const gchar *description); + +void gedit_utils_set_atk_relation (GtkWidget *obj1, + GtkWidget *obj2, + AtkRelationType rel_type); + +gboolean gedit_utils_uri_exists (const gchar* text_uri); + +gchar *gedit_utils_escape_search_text (const gchar *text); + +gchar *gedit_utils_unescape_search_text (const gchar *text); + +void gedit_warning (GtkWindow *parent, + const gchar *format, + ...) G_GNUC_PRINTF(2, 3); + +gchar *gedit_utils_make_valid_utf8 (const char *name); + +/* Note that this function replace home dir with ~ */ +gchar *gedit_utils_uri_get_dirname (const char *uri); + +gchar *gedit_utils_location_get_dirname_for_display + (GFile *location); + +gchar *gedit_utils_replace_home_dir_with_tilde (const gchar *uri); + +guint gedit_utils_get_current_workspace (GdkScreen *screen); + +guint gedit_utils_get_window_workspace (GtkWindow *gtkwindow); + +void gedit_utils_get_current_viewport (GdkScreen *screen, + gint *x, + gint *y); + +void gedit_utils_activate_url (GtkAboutDialog *about, + const gchar *url, + gpointer data); + +gboolean gedit_utils_is_valid_uri (const gchar *uri); + +gboolean gedit_utils_get_ui_objects (const gchar *filename, + gchar **root_objects, + GtkWidget **error_widget, + const gchar *object_name, + ...) G_GNUC_NULL_TERMINATED; + +gboolean gedit_utils_file_has_parent (GFile *gfile); + +/* Return NULL if str is not a valid URI and/or filename */ +gchar *gedit_utils_make_canonical_uri_from_shell_arg + (const gchar *str); + +gchar *gedit_utils_uri_for_display (const gchar *uri); +gchar *gedit_utils_basename_for_display (const gchar *uri); +gboolean gedit_utils_decode_uri (const gchar *uri, + gchar **scheme, + gchar **user, + gchar **port, + gchar **host, + gchar **path); + + +/* Turns data from a drop into a list of well formatted uris */ +gchar **gedit_utils_drop_get_uris (GtkSelectionData *selection_data); + +G_END_DECLS + +#endif /* __GEDIT_UTILS_H__ */ + + diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c new file mode 100755 index 00000000..b999d298 --- /dev/null +++ b/gedit/gedit-view.c @@ -0,0 +1,2181 @@ +/* + * gedit-view.c + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2002 Chema Celorio, Paolo Maggi + * Copyright (C) 2003-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#include + +#include "gedit-view.h" +#include "gedit-debug.h" +#include "gedit-prefs-manager.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-marshal.h" +#include "gedit-utils.h" + + +#define GEDIT_VIEW_SCROLL_MARGIN 0.02 +#define GEDIT_VIEW_SEARCH_DIALOG_TIMEOUT (30*1000) /* 30 seconds */ + +#define MIN_SEARCH_COMPLETION_KEY_LEN 3 + +#define GEDIT_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_VIEW, GeditViewPrivate)) + +typedef enum +{ + GOTO_LINE, + SEARCH +} SearchMode; + +enum +{ + TARGET_URI_LIST = 100 +}; + +struct _GeditViewPrivate +{ + SearchMode search_mode; + + GtkTextIter start_search_iter; + + /* used to restore the search state if an + * incremental search is cancelled + */ + gchar *old_search_text; + guint old_search_flags; + + /* used to remeber the state of the last + * incremental search (the document search + * state may be changed by the search dialog) + */ + guint search_flags; + gboolean wrap_around; + + GtkWidget *search_window; + GtkWidget *search_entry; + + guint typeselect_flush_timeout; + guint search_entry_changed_id; + + gboolean disable_popdown; + + GtkTextBuffer *current_buffer; +}; + +/* The search entry completion is shared among all the views */ +GtkListStore *search_completion_model = NULL; + +static void gedit_view_destroy (GtkObject *object); +static void gedit_view_finalize (GObject *object); +static gint gedit_view_focus_out (GtkWidget *widget, + GdkEventFocus *event); +static gboolean gedit_view_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint timestamp); +static void gedit_view_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint timestamp); +static gboolean gedit_view_drag_drop (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint timestamp); +static gboolean gedit_view_button_press_event (GtkWidget *widget, + GdkEventButton *event); + +static gboolean start_interactive_search (GeditView *view); +static gboolean start_interactive_goto_line (GeditView *view); +static gboolean reset_searched_text (GeditView *view); + +static void hide_search_window (GeditView *view, + gboolean cancel); + + +static gint gedit_view_expose (GtkWidget *widget, + GdkEventExpose *event); +static void search_highlight_updated_cb (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end, + GeditView *view); + +static void gedit_view_delete_from_cursor (GtkTextView *text_view, + GtkDeleteType type, + gint count); + +G_DEFINE_TYPE(GeditView, gedit_view, GTK_TYPE_SOURCE_VIEW) + +/* Signals */ +enum +{ + START_INTERACTIVE_SEARCH, + START_INTERACTIVE_GOTO_LINE, + RESET_SEARCHED_TEXT, + DROP_URIS, + LAST_SIGNAL +}; + +static guint view_signals [LAST_SIGNAL] = { 0 }; + +typedef enum +{ + GEDIT_SEARCH_ENTRY_NORMAL, + GEDIT_SEARCH_ENTRY_NOT_FOUND +} GeditSearchEntryBgColor; + +static void +document_read_only_notify_handler (GeditDocument *document, + GParamSpec *pspec, + GeditView *view) +{ + gedit_debug (DEBUG_VIEW); + + gtk_text_view_set_editable (GTK_TEXT_VIEW (view), + !gedit_document_get_readonly (document)); +} + +static void +gedit_view_class_init (GeditViewClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + GtkTextViewClass *text_view_class = GTK_TEXT_VIEW_CLASS (klass); + + GtkBindingSet *binding_set; + + gtkobject_class->destroy = gedit_view_destroy; + object_class->finalize = gedit_view_finalize; + + widget_class->focus_out_event = gedit_view_focus_out; + widget_class->expose_event = gedit_view_expose; + + /* + * Override the gtk_text_view_drag_motion and drag_drop + * functions to get URIs + * + * If the mime type is text/uri-list, then we will accept + * the potential drop, or request the data (depending on the + * function). + * + * If the drag context has any other mime type, then pass the + * information onto the GtkTextView's standard handlers. + * (widget_class->function_name). + * + * See bug #89881 for details + */ + widget_class->drag_motion = gedit_view_drag_motion; + widget_class->drag_data_received = gedit_view_drag_data_received; + widget_class->drag_drop = gedit_view_drag_drop; + widget_class->button_press_event = gedit_view_button_press_event; + klass->start_interactive_search = start_interactive_search; + klass->start_interactive_goto_line = start_interactive_goto_line; + klass->reset_searched_text = reset_searched_text; + + text_view_class->delete_from_cursor = gedit_view_delete_from_cursor; + + view_signals[START_INTERACTIVE_SEARCH] = + g_signal_new ("start_interactive_search", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditViewClass, start_interactive_search), + NULL, NULL, + gedit_marshal_BOOLEAN__NONE, + G_TYPE_BOOLEAN, 0); + + view_signals[START_INTERACTIVE_GOTO_LINE] = + g_signal_new ("start_interactive_goto_line", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditViewClass, start_interactive_goto_line), + NULL, NULL, + gedit_marshal_BOOLEAN__NONE, + G_TYPE_BOOLEAN, 0); + + view_signals[RESET_SEARCHED_TEXT] = + g_signal_new ("reset_searched_text", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditViewClass, reset_searched_text), + NULL, NULL, + gedit_marshal_BOOLEAN__NONE, + G_TYPE_BOOLEAN, 0); + + /* A new signal DROP_URIS has been added to allow plugins to intercept + * the default dnd behaviour of 'text/uri-list'. GeditView now handles + * dnd in the default handlers of drag_drop, drag_motion and + * drag_data_received. The view emits drop_uris from drag_data_received + * if valid uris have been dropped. Plugins should connect to + * drag_motion, drag_drop and drag_data_received to change this + * default behaviour. They should _NOT_ use this signal because this + * will not prevent gedit from loading the uri + */ + view_signals[DROP_URIS] = + g_signal_new ("drop_uris", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GeditViewClass, drop_uris), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, G_TYPE_STRV); + + g_type_class_add_private (klass, sizeof (GeditViewPrivate)); + + binding_set = gtk_binding_set_by_class (klass); + + gtk_binding_entry_add_signal (binding_set, + GDK_k, + GDK_CONTROL_MASK, + "start_interactive_search", 0); + + gtk_binding_entry_add_signal (binding_set, + GDK_i, + GDK_CONTROL_MASK, + "start_interactive_goto_line", 0); + + gtk_binding_entry_add_signal (binding_set, + GDK_k, + GDK_CONTROL_MASK | GDK_SHIFT_MASK, + "reset_searched_text", 0); + + gtk_binding_entry_add_signal (binding_set, + GDK_d, + GDK_CONTROL_MASK, + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_PARAGRAPHS, + G_TYPE_INT, 1); +} + +static void +current_buffer_removed (GeditView *view) +{ + if (view->priv->current_buffer) + { + g_signal_handlers_disconnect_by_func (view->priv->current_buffer, + document_read_only_notify_handler, + view); + g_signal_handlers_disconnect_by_func (view->priv->current_buffer, + search_highlight_updated_cb, + view); + + g_object_unref (view->priv->current_buffer); + view->priv->current_buffer = NULL; + } +} + +static void +on_notify_buffer_cb (GeditView *view, + GParamSpec *arg1, + gpointer userdata) +{ + GtkTextBuffer *buffer; + + current_buffer_removed (view); + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + + if (buffer == NULL || !GEDIT_IS_DOCUMENT (buffer)) + return; + + view->priv->current_buffer = g_object_ref (buffer); + g_signal_connect (buffer, + "notify::read-only", + G_CALLBACK (document_read_only_notify_handler), + view); + + gtk_text_view_set_editable (GTK_TEXT_VIEW (view), + !gedit_document_get_readonly (GEDIT_DOCUMENT (buffer))); + + g_signal_connect (buffer, + "search_highlight_updated", + G_CALLBACK (search_highlight_updated_cb), + view); +} + +static void +gedit_view_init (GeditView *view) +{ + GtkTargetList *tl; + + gedit_debug (DEBUG_VIEW); + + view->priv = GEDIT_VIEW_GET_PRIVATE (view); + + /* + * Set tab, fonts, wrap mode, colors, etc. according + * to preferences + */ + if (!gedit_prefs_manager_get_use_default_font ()) + { + gchar *editor_font; + + editor_font = gedit_prefs_manager_get_editor_font (); + + gedit_view_set_font (view, FALSE, editor_font); + + g_free (editor_font); + } + else + { + gedit_view_set_font (view, TRUE, NULL); + } + + g_object_set (G_OBJECT (view), + "wrap_mode", gedit_prefs_manager_get_wrap_mode (), + "show_line_numbers", gedit_prefs_manager_get_display_line_numbers (), + "auto_indent", gedit_prefs_manager_get_auto_indent (), + "tab_width", gedit_prefs_manager_get_tabs_size (), + "insert_spaces_instead_of_tabs", gedit_prefs_manager_get_insert_spaces (), + "show_right_margin", gedit_prefs_manager_get_display_right_margin (), + "right_margin_position", gedit_prefs_manager_get_right_margin_position (), + "highlight_current_line", gedit_prefs_manager_get_highlight_current_line (), + "smart_home_end", gedit_prefs_manager_get_smart_home_end (), + "indent_on_tab", TRUE, + NULL); + + view->priv->typeselect_flush_timeout = 0; + view->priv->wrap_around = TRUE; + + /* Drag and drop support */ + tl = gtk_drag_dest_get_target_list (GTK_WIDGET (view)); + + if (tl != NULL) + gtk_target_list_add_uri_targets (tl, TARGET_URI_LIST); + + /* Act on buffer change */ + g_signal_connect (view, + "notify::buffer", + G_CALLBACK (on_notify_buffer_cb), + NULL); +} + +static void +gedit_view_destroy (GtkObject *object) +{ + GeditView *view; + + view = GEDIT_VIEW (object); + + if (view->priv->search_window != NULL) + { + gtk_widget_destroy (view->priv->search_window); + view->priv->search_window = NULL; + view->priv->search_entry = NULL; + + if (view->priv->typeselect_flush_timeout != 0) + { + g_source_remove (view->priv->typeselect_flush_timeout); + view->priv->typeselect_flush_timeout = 0; + } + } + + /* Disconnect notify buffer because the destroy of the textview will + set the buffer to NULL, and we call get_buffer in the notify which + would reinstate a GtkTextBuffer which we don't want */ + current_buffer_removed (view); + g_signal_handlers_disconnect_by_func (view, on_notify_buffer_cb, NULL); + + (* GTK_OBJECT_CLASS (gedit_view_parent_class)->destroy) (object); +} + +static void +gedit_view_finalize (GObject *object) +{ + GeditView *view; + + view = GEDIT_VIEW (object); + + current_buffer_removed (view); + + g_free (view->priv->old_search_text); + + (* G_OBJECT_CLASS (gedit_view_parent_class)->finalize) (object); +} + +static gint +gedit_view_focus_out (GtkWidget *widget, GdkEventFocus *event) +{ + GeditView *view = GEDIT_VIEW (widget); + + gtk_widget_queue_draw (widget); + + /* hide interactive search dialog */ + if (view->priv->search_window != NULL) + hide_search_window (view, FALSE); + + (* GTK_WIDGET_CLASS (gedit_view_parent_class)->focus_out_event) (widget, event); + + return FALSE; +} + +/** + * gedit_view_new: + * @doc: a #GeditDocument + * + * Creates a new #GeditView object displaying the @doc document. + * @doc cannot be NULL. + * + * Return value: a new #GeditView + **/ +GtkWidget * +gedit_view_new (GeditDocument *doc) +{ + GtkWidget *view; + + gedit_debug_message (DEBUG_VIEW, "START"); + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL); + + view = GTK_WIDGET (g_object_new (GEDIT_TYPE_VIEW, "buffer", doc, NULL)); + + gedit_debug_message (DEBUG_VIEW, "END: %d", G_OBJECT (view)->ref_count); + + gtk_widget_show_all (view); + + return view; +} + +void +gedit_view_cut_clipboard (GeditView *view) +{ + GtkTextBuffer *buffer; + GtkClipboard *clipboard; + + gedit_debug (DEBUG_VIEW); + + g_return_if_fail (GEDIT_IS_VIEW (view)); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + g_return_if_fail (buffer != NULL); + + clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view), + GDK_SELECTION_CLIPBOARD); + + /* FIXME: what is default editability of a buffer? */ + gtk_text_buffer_cut_clipboard (buffer, + clipboard, + !gedit_document_get_readonly ( + GEDIT_DOCUMENT (buffer))); + + gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (view), + gtk_text_buffer_get_insert (buffer), + GEDIT_VIEW_SCROLL_MARGIN, + FALSE, + 0.0, + 0.0); +} + +void +gedit_view_copy_clipboard (GeditView *view) +{ + GtkTextBuffer *buffer; + GtkClipboard *clipboard; + + gedit_debug (DEBUG_VIEW); + + g_return_if_fail (GEDIT_IS_VIEW (view)); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + g_return_if_fail (buffer != NULL); + + clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view), + GDK_SELECTION_CLIPBOARD); + + gtk_text_buffer_copy_clipboard (buffer, clipboard); + + /* on copy do not scroll, we are already on screen */ +} + +void +gedit_view_paste_clipboard (GeditView *view) +{ + GtkTextBuffer *buffer; + GtkClipboard *clipboard; + + gedit_debug (DEBUG_VIEW); + + g_return_if_fail (GEDIT_IS_VIEW (view)); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + g_return_if_fail (buffer != NULL); + + clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view), + GDK_SELECTION_CLIPBOARD); + + /* FIXME: what is default editability of a buffer? */ + gtk_text_buffer_paste_clipboard (buffer, + clipboard, + NULL, + !gedit_document_get_readonly ( + GEDIT_DOCUMENT (buffer))); + + gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (view), + gtk_text_buffer_get_insert (buffer), + GEDIT_VIEW_SCROLL_MARGIN, + FALSE, + 0.0, + 0.0); +} + +/** + * gedit_view_delete_selection: + * @view: a #GeditView + * + * Deletes the text currently selected in the #GtkTextBuffer associated + * to the view and scroll to the cursor position. + **/ +void +gedit_view_delete_selection (GeditView *view) +{ + GtkTextBuffer *buffer = NULL; + + gedit_debug (DEBUG_VIEW); + + g_return_if_fail (GEDIT_IS_VIEW (view)); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + g_return_if_fail (buffer != NULL); + + /* FIXME: what is default editability of a buffer? */ + gtk_text_buffer_delete_selection (buffer, + TRUE, + !gedit_document_get_readonly ( + GEDIT_DOCUMENT (buffer))); + + gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (view), + gtk_text_buffer_get_insert (buffer), + GEDIT_VIEW_SCROLL_MARGIN, + FALSE, + 0.0, + 0.0); +} + +/** + * gedit_view_select_all: + * @view: a #GeditView + * + * Selects all the text displayed in the @view. + **/ +void +gedit_view_select_all (GeditView *view) +{ + GtkTextBuffer *buffer = NULL; + GtkTextIter start, end; + + gedit_debug (DEBUG_VIEW); + + g_return_if_fail (GEDIT_IS_VIEW (view)); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + g_return_if_fail (buffer != NULL); + + gtk_text_buffer_get_bounds (buffer, &start, &end); + gtk_text_buffer_select_range (buffer, &start, &end); +} + +/** + * gedit_view_scroll_to_cursor: + * @view: a #GeditView + * + * Scrolls the @view to the cursor position. + **/ +void +gedit_view_scroll_to_cursor (GeditView *view) +{ + GtkTextBuffer* buffer = NULL; + + gedit_debug (DEBUG_VIEW); + + g_return_if_fail (GEDIT_IS_VIEW (view)); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + g_return_if_fail (buffer != NULL); + + gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (view), + gtk_text_buffer_get_insert (buffer), + 0.25, + FALSE, + 0.0, + 0.0); +} + +/** + * gedit_view_set_font: + * @view: a #GeditView + * @def: whether to reset the default font + * @font_name: the name of the font to use + * + * If @def is #TRUE, resets the font of the @view to the default font + * otherwise sets it to @font_name. + **/ +void +gedit_view_set_font (GeditView *view, + gboolean def, + const gchar *font_name) +{ + PangoFontDescription *font_desc = NULL; + + gedit_debug (DEBUG_VIEW); + + g_return_if_fail (GEDIT_IS_VIEW (view)); + + if (def) + { + gchar *font; + + font = gedit_prefs_manager_get_system_font (); + font_desc = pango_font_description_from_string (font); + g_free (font); + } + else + { + g_return_if_fail (font_name != NULL); + + font_desc = pango_font_description_from_string (font_name); + } + + g_return_if_fail (font_desc != NULL); + + gtk_widget_modify_font (GTK_WIDGET (view), font_desc); + + pango_font_description_free (font_desc); +} + +static void +add_search_completion_entry (const gchar *str) +{ + gchar *text; + gboolean valid; + GtkTreeModel *model; + GtkTreeIter iter; + + if (str == NULL) + return; + + text = gedit_utils_unescape_search_text (str); + + if (g_utf8_strlen (text, -1) < MIN_SEARCH_COMPLETION_KEY_LEN) + { + g_free (text); + return; + } + + g_return_if_fail (GTK_IS_TREE_MODEL (search_completion_model)); + + model = GTK_TREE_MODEL (search_completion_model); + + /* Get the first iter in the list */ + valid = gtk_tree_model_get_iter_first (model, &iter); + + while (valid) + { + /* Walk through the list, reading each row */ + gchar *str_data; + + gtk_tree_model_get (model, + &iter, + 0, + &str_data, + -1); + + if (strcmp (text, str_data) == 0) + { + g_free (text); + g_free (str_data); + gtk_list_store_move_after (GTK_LIST_STORE (model), + &iter, + NULL); + + return; + } + + g_free (str_data); + + valid = gtk_tree_model_iter_next (model, &iter); + } + + gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), + &iter, + 0, + text, + -1); + + g_free (text); +} + +static void +set_entry_background (GtkWidget *entry, + GeditSearchEntryBgColor col) +{ + if (col == GEDIT_SEARCH_ENTRY_NOT_FOUND) + { + GdkColor red; + GdkColor white; + + /* FIXME: a11y and theme */ + + gdk_color_parse ("#FF6666", &red); + gdk_color_parse ("white", &white); + + gtk_widget_modify_base (entry, + GTK_STATE_NORMAL, + &red); + gtk_widget_modify_text (entry, + GTK_STATE_NORMAL, + &white); + } + else /* reset */ + { + gtk_widget_modify_base (entry, + GTK_STATE_NORMAL, + NULL); + gtk_widget_modify_text (entry, + GTK_STATE_NORMAL, + NULL); + } +} + +static gboolean +run_search (GeditView *view, + const gchar *entry_text, + gboolean search_backward, + gboolean wrap_around, + gboolean typing) +{ + GtkTextIter start_iter; + GtkTextIter match_start; + GtkTextIter match_end; + gboolean found = FALSE; + GeditDocument *doc; + + g_return_val_if_fail (view->priv->search_mode == SEARCH, FALSE); + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + + start_iter = view->priv->start_search_iter; + + if (*entry_text != '\0') + { + if (!search_backward) + { + if (!typing) + { + /* forward and _NOT_ typing */ + gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), + &start_iter, + &match_end); + + gtk_text_iter_order (&match_end, &start_iter); + } + + /* run search */ + found = gedit_document_search_forward (doc, + &start_iter, + NULL, + &match_start, + &match_end); + } + else if (!typing) + { + /* backward and not typing */ + gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), + &start_iter, + &match_end); + + /* run search */ + found = gedit_document_search_backward (doc, + NULL, + &start_iter, + &match_start, + &match_end); + } + else + { + /* backward (while typing) */ + g_return_val_if_reached (FALSE); + + } + + if (!found && wrap_around) + { + if (!search_backward) + found = gedit_document_search_forward (doc, + NULL, + NULL, /* FIXME: set the end_inter */ + &match_start, + &match_end); + else + found = gedit_document_search_backward (doc, + NULL, /* FIXME: set the start_inter */ + NULL, + &match_start, + &match_end); + } + } + else + { + gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), + &start_iter, + NULL); + } + + if (found) + { + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), + &match_start); + + gtk_text_buffer_move_mark_by_name (GTK_TEXT_BUFFER (doc), + "selection_bound", &match_end); + } + else + { + if (typing) + { + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), + &view->priv->start_search_iter); + } + } + + if (found || (*entry_text == '\0')) + { + gedit_view_scroll_to_cursor (view); + + set_entry_background (view->priv->search_entry, + GEDIT_SEARCH_ENTRY_NORMAL); + } + else + { + set_entry_background (view->priv->search_entry, + GEDIT_SEARCH_ENTRY_NOT_FOUND); + } + + return found; +} + +/* Cut and paste from gtkwindow.c */ +static void +send_focus_change (GtkWidget *widget, + gboolean in) +{ + GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE); + + g_object_ref (widget); + + if (in) + GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); + else + GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); + + fevent->focus_change.type = GDK_FOCUS_CHANGE; + fevent->focus_change.window = g_object_ref (widget->window); + fevent->focus_change.in = in; + + gtk_widget_event (widget, fevent); + + g_object_notify (G_OBJECT (widget), "has-focus"); + + g_object_unref (widget); + gdk_event_free (fevent); +} + +static void +hide_search_window (GeditView *view, gboolean cancel) +{ + if (view->priv->disable_popdown) + return; + + if (view->priv->search_entry_changed_id != 0) + { + g_signal_handler_disconnect (view->priv->search_entry, + view->priv->search_entry_changed_id); + view->priv->search_entry_changed_id = 0; + } + + if (view->priv->typeselect_flush_timeout != 0) + { + g_source_remove (view->priv->typeselect_flush_timeout); + view->priv->typeselect_flush_timeout = 0; + } + + /* send focus-in event */ + send_focus_change (GTK_WIDGET (view->priv->search_entry), FALSE); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), TRUE); + gtk_widget_hide (view->priv->search_window); + + if (cancel) + { + GtkTextBuffer *buffer; + + buffer = GTK_TEXT_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + gtk_text_buffer_place_cursor (buffer, &view->priv->start_search_iter); + + gedit_view_scroll_to_cursor (view); + } + + /* make sure a focus event is sent for the edit area */ + send_focus_change (GTK_WIDGET (view), TRUE); +} + +static gboolean +search_entry_flush_timeout (GeditView *view) +{ + GDK_THREADS_ENTER (); + + view->priv->typeselect_flush_timeout = 0; + hide_search_window (view, FALSE); + + GDK_THREADS_LEAVE (); + + return FALSE; +} + +static void +update_search_window_position (GeditView *view) +{ + gint x, y; + gint view_x, view_y; + GdkWindow *view_window = GTK_WIDGET (view)->window; + + gtk_widget_realize (view->priv->search_window); + + gdk_window_get_origin (view_window, &view_x, &view_y); + + x = MAX (12, view_x + 12); + y = MAX (12, view_y - 12); + + gtk_window_move (GTK_WINDOW (view->priv->search_window), x, y); +} + +static gboolean +search_window_delete_event (GtkWidget *widget, + GdkEventAny *event, + GeditView *view) +{ + hide_search_window (view, FALSE); + + return TRUE; +} + +static gboolean +search_window_button_press_event (GtkWidget *widget, + GdkEventButton *event, + GeditView *view) +{ + hide_search_window (view, FALSE); + + gtk_propagate_event (GTK_WIDGET (view), (GdkEvent *)event); + + return FALSE; +} + +static void +search_again (GeditView *view, + gboolean search_backward) +{ + const gchar *entry_text; + + g_return_if_fail (view->priv->search_mode == SEARCH); + + /* SEARCH mode */ + /* renew the flush timeout */ + if (view->priv->typeselect_flush_timeout != 0) + { + g_source_remove (view->priv->typeselect_flush_timeout); + view->priv->typeselect_flush_timeout = + g_timeout_add (GEDIT_VIEW_SEARCH_DIALOG_TIMEOUT, + (GSourceFunc)search_entry_flush_timeout, + view); + } + + entry_text = gtk_entry_get_text (GTK_ENTRY (view->priv->search_entry)); + + add_search_completion_entry (entry_text); + + run_search (view, + entry_text, + search_backward, + view->priv->wrap_around, + FALSE); +} + +static gboolean +search_window_scroll_event (GtkWidget *widget, + GdkEventScroll *event, + GeditView *view) +{ + gboolean retval = FALSE; + + if (view->priv->search_mode == GOTO_LINE) + return retval; + + /* SEARCH mode */ + if (event->direction == GDK_SCROLL_UP) + { + search_again (view, TRUE); + retval = TRUE; + } + else if (event->direction == GDK_SCROLL_DOWN) + { + search_again (view, FALSE); + retval = TRUE; + } + + return retval; +} + +static gboolean +search_window_key_press_event (GtkWidget *widget, + GdkEventKey *event, + GeditView *view) +{ + gboolean retval = FALSE; + guint modifiers; + + modifiers = gtk_accelerator_get_default_mod_mask (); + + /* Close window */ + if (event->keyval == GDK_Tab) + { + hide_search_window (view, FALSE); + retval = TRUE; + } + + /* Close window and cancel the search */ + if (event->keyval == GDK_Escape) + { + if (view->priv->search_mode == SEARCH) + { + GeditDocument *doc; + + /* restore document search so that Find Next does the right thing */ + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + gedit_document_set_search_text (doc, + view->priv->old_search_text, + view->priv->old_search_flags); + + } + + hide_search_window (view, TRUE); + retval = TRUE; + } + + if (view->priv->search_mode == GOTO_LINE) + return retval; + + /* SEARCH mode */ + + /* select previous matching iter */ + if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up) + { + search_again (view, TRUE); + retval = TRUE; + } + + if (((event->state & modifiers) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) && + (event->keyval == GDK_g || event->keyval == GDK_G)) + { + search_again (view, TRUE); + retval = TRUE; + } + + /* select next matching iter */ + if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down) + { + search_again (view, FALSE); + retval = TRUE; + } + + if (((event->state & modifiers) == GDK_CONTROL_MASK) && + (event->keyval == GDK_g || event->keyval == GDK_G)) + { + search_again (view, FALSE); + retval = TRUE; + } + + return retval; +} + +static void +search_entry_activate (GtkEntry *entry, + GeditView *view) +{ + hide_search_window (view, FALSE); +} + +static void +wrap_around_menu_item_toggled (GtkCheckMenuItem *checkmenuitem, + GeditView *view) +{ + view->priv->wrap_around = gtk_check_menu_item_get_active (checkmenuitem); +} + +static void +match_entire_word_menu_item_toggled (GtkCheckMenuItem *checkmenuitem, + GeditView *view) +{ + GEDIT_SEARCH_SET_ENTIRE_WORD (view->priv->search_flags, + gtk_check_menu_item_get_active (checkmenuitem)); +} + +static void +match_case_menu_item_toggled (GtkCheckMenuItem *checkmenuitem, + GeditView *view) +{ + GEDIT_SEARCH_SET_CASE_SENSITIVE (view->priv->search_flags, + gtk_check_menu_item_get_active (checkmenuitem)); +} + +static gboolean +real_search_enable_popdown (gpointer data) +{ + GeditView *view = (GeditView *)data; + + GDK_THREADS_ENTER (); + + view->priv->disable_popdown = FALSE; + + GDK_THREADS_LEAVE (); + + return FALSE; +} + +static void +search_enable_popdown (GtkWidget *widget, + GeditView *view) +{ + g_timeout_add (200, real_search_enable_popdown, view); + + /* renew the flush timeout */ + if (view->priv->typeselect_flush_timeout != 0) + g_source_remove (view->priv->typeselect_flush_timeout); + + view->priv->typeselect_flush_timeout = + g_timeout_add (GEDIT_VIEW_SEARCH_DIALOG_TIMEOUT, + (GSourceFunc)search_entry_flush_timeout, + view); +} + +static void +search_entry_populate_popup (GtkEntry *entry, + GtkMenu *menu, + GeditView *view) +{ + GtkWidget *menu_item; + + view->priv->disable_popdown = TRUE; + g_signal_connect (menu, "hide", + G_CALLBACK (search_enable_popdown), view); + + if (view->priv->search_mode == GOTO_LINE) + return; + + /* separator */ + menu_item = gtk_menu_item_new (); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + gtk_widget_show (menu_item); + + /* create "Wrap Around" menu item. */ + menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Wrap Around")); + g_signal_connect (G_OBJECT (menu_item), "toggled", + G_CALLBACK (wrap_around_menu_item_toggled), + view); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), + view->priv->wrap_around); + gtk_widget_show (menu_item); + + /* create "Match Entire Word Only" menu item. */ + menu_item = gtk_check_menu_item_new_with_mnemonic (_("Match _Entire Word Only")); + g_signal_connect (G_OBJECT (menu_item), "toggled", + G_CALLBACK (match_entire_word_menu_item_toggled), + view); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), + GEDIT_SEARCH_IS_ENTIRE_WORD (view->priv->search_flags)); + gtk_widget_show (menu_item); + + /* create "Match Case" menu item. */ + menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Match Case")); + g_signal_connect (G_OBJECT (menu_item), "toggled", + G_CALLBACK (match_case_menu_item_toggled), + view); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), + GEDIT_SEARCH_IS_CASE_SENSITIVE (view->priv->search_flags)); + gtk_widget_show (menu_item); +} + +static void +search_entry_insert_text (GtkEditable *editable, + const gchar *text, + gint length, + gint *position, + GeditView *view) +{ + if (view->priv->search_mode == GOTO_LINE) + { + gunichar c; + const gchar *p; + const gchar *end; + const gchar *next; + + p = text; + end = text + length; + + if (p == end) + return; + + c = g_utf8_get_char (p); + + if (((c == '-' || c == '+') && *position == 0) || + (c == ':' && *position != 0)) + { + gchar *s = NULL; + + if (c == ':') + { + s = gtk_editable_get_chars (editable, 0, -1); + s = g_utf8_strchr (s, -1, ':'); + } + + if (s == NULL || s == p) + { + next = g_utf8_next_char (p); + p = next; + } + + g_free (s); + } + + while (p != end) + { + next = g_utf8_next_char (p); + + c = g_utf8_get_char (p); + + if (!g_unichar_isdigit (c)) { + g_signal_stop_emission_by_name (editable, "insert_text"); + gtk_widget_error_bell (view->priv->search_entry); + break; + } + + p = next; + } + } + else + { + /* SEARCH mode */ + static gboolean insert_text = FALSE; + gchar *escaped_text; + gint new_len; + + gedit_debug_message (DEBUG_SEARCH, "Text: %s", text); + + /* To avoid recursive behavior */ + if (insert_text) + return; + + escaped_text = gedit_utils_escape_search_text (text); + + gedit_debug_message (DEBUG_SEARCH, "Escaped Text: %s", escaped_text); + + new_len = strlen (escaped_text); + + if (new_len == length) + { + g_free (escaped_text); + return; + } + + insert_text = TRUE; + + g_signal_stop_emission_by_name (editable, "insert_text"); + + gtk_editable_insert_text (editable, escaped_text, new_len, position); + + insert_text = FALSE; + + g_free (escaped_text); + } +} + +static void +customize_for_search_mode (GeditView *view) +{ + if (view->priv->search_mode == SEARCH) + { + gtk_entry_set_icon_from_stock (GTK_ENTRY (view->priv->search_entry), + GTK_ENTRY_ICON_PRIMARY, + GTK_STOCK_FIND); + + gtk_widget_set_tooltip_text (view->priv->search_entry, + _("String you want to search for")); + } + else + { + gtk_entry_set_icon_from_stock (GTK_ENTRY (view->priv->search_entry), + GTK_ENTRY_ICON_PRIMARY, + GTK_STOCK_JUMP_TO); + + gtk_widget_set_tooltip_text (view->priv->search_entry, + _("Line you want to move the cursor to")); + } +} + +static gboolean +completion_func (GtkEntryCompletion *completion, + const char *key, + GtkTreeIter *iter, + gpointer data) +{ + gchar *item = NULL; + gboolean ret = FALSE; + GtkTreeModel *model; + GeditViewPrivate *priv = (GeditViewPrivate *)data; + const gchar *real_key; + + if (priv->search_mode == GOTO_LINE) + return FALSE; + + real_key = gtk_entry_get_text (GTK_ENTRY (gtk_entry_completion_get_entry (completion))); + + if (g_utf8_strlen (real_key, -1) <= MIN_SEARCH_COMPLETION_KEY_LEN) + return FALSE; + + model = gtk_entry_completion_get_model (completion); + g_return_val_if_fail (gtk_tree_model_get_column_type (model, 0) == G_TYPE_STRING, + FALSE); + + gtk_tree_model_get (model, + iter, + 0, + &item, + -1); + + if (item == NULL) + return FALSE; + + if (GEDIT_SEARCH_IS_CASE_SENSITIVE (priv->search_flags)) + { + if (!strncmp (real_key, item, strlen (real_key))) + ret = TRUE; + } + else + { + gchar *normalized_string; + gchar *case_normalized_string; + + normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL); + case_normalized_string = g_utf8_casefold (normalized_string, -1); + + if (!strncmp (key, case_normalized_string, strlen (key))) + ret = TRUE; + + g_free (normalized_string); + g_free (case_normalized_string); + + } + + g_free (item); + + return ret; +} + +static void +ensure_search_window (GeditView *view) +{ + GtkWidget *frame; + GtkWidget *vbox; + GtkWidget *toplevel; + GtkEntryCompletion *completion; + + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view)); + + if (view->priv->search_window != NULL) + { + if (GTK_WINDOW (toplevel)->group) + gtk_window_group_add_window (GTK_WINDOW (toplevel)->group, + GTK_WINDOW (view->priv->search_window)); + else if (GTK_WINDOW (view->priv->search_window)->group) + gtk_window_group_remove_window (GTK_WINDOW (view->priv->search_window)->group, + GTK_WINDOW (view->priv->search_window)); + + customize_for_search_mode (view); + + return; + } + + view->priv->search_window = gtk_window_new (GTK_WINDOW_POPUP); + + if (GTK_WINDOW (toplevel)->group) + gtk_window_group_add_window (GTK_WINDOW (toplevel)->group, + GTK_WINDOW (view->priv->search_window)); + + gtk_window_set_modal (GTK_WINDOW (view->priv->search_window), TRUE); + + g_signal_connect (view->priv->search_window, "delete_event", + G_CALLBACK (search_window_delete_event), + view); + g_signal_connect (view->priv->search_window, "key_press_event", + G_CALLBACK (search_window_key_press_event), + view); + g_signal_connect (view->priv->search_window, "button_press_event", + G_CALLBACK (search_window_button_press_event), + view); + g_signal_connect (view->priv->search_window, "scroll_event", + G_CALLBACK (search_window_scroll_event), + view); + + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); + gtk_widget_show (frame); + gtk_container_add (GTK_CONTAINER (view->priv->search_window), frame); + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox); + gtk_container_add (GTK_CONTAINER (frame), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 3); + + /* add entry */ + view->priv->search_entry = gtk_entry_new (); + gtk_widget_show (view->priv->search_entry); + + g_signal_connect (view->priv->search_entry, "populate_popup", + G_CALLBACK (search_entry_populate_popup), + view); + g_signal_connect (view->priv->search_entry, "activate", + G_CALLBACK (search_entry_activate), + view); + /* CHECK: do we really need to connect to preedit too? -- Paolo + g_signal_connect (GTK_ENTRY (view->priv->search_entry)->im_context, "preedit-changed", + G_CALLBACK (gtk_view_search_preedit_changed), + view); + */ + g_signal_connect (view->priv->search_entry, + "insert_text", + G_CALLBACK (search_entry_insert_text), + view); + + gtk_container_add (GTK_CONTAINER (vbox), + view->priv->search_entry); + + if (search_completion_model == NULL) + { + /* Create a tree model and use it as the completion model */ + search_completion_model = gtk_list_store_new (1, G_TYPE_STRING); + } + + /* Create the completion object for the search entry */ + completion = gtk_entry_completion_new (); + gtk_entry_completion_set_model (completion, + GTK_TREE_MODEL (search_completion_model)); + + /* Use model column 0 as the text column */ + gtk_entry_completion_set_text_column (completion, 0); + + gtk_entry_completion_set_minimum_key_length (completion, + MIN_SEARCH_COMPLETION_KEY_LEN); + + gtk_entry_completion_set_popup_completion (completion, FALSE); + gtk_entry_completion_set_inline_completion (completion, TRUE); + + gtk_entry_completion_set_match_func (completion, + completion_func, + view->priv, + NULL); + + /* Assign the completion to the entry */ + gtk_entry_set_completion (GTK_ENTRY (view->priv->search_entry), + completion); + g_object_unref (completion); + + gtk_widget_realize (view->priv->search_entry); + + customize_for_search_mode (view); +} + +static gboolean +get_selected_text (GtkTextBuffer *doc, gchar **selected_text, gint *len) +{ + GtkTextIter start, end; + + g_return_val_if_fail (selected_text != NULL, FALSE); + g_return_val_if_fail (*selected_text == NULL, FALSE); + + if (!gtk_text_buffer_get_selection_bounds (doc, &start, &end)) + { + if (len != NULL) + len = 0; + + return FALSE; + } + + *selected_text = gtk_text_buffer_get_slice (doc, &start, &end, TRUE); + + if (len != NULL) + *len = g_utf8_strlen (*selected_text, -1); + + return TRUE; +} + +static void +init_search_entry (GeditView *view) +{ + GtkTextBuffer *buffer; + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + + if (view->priv->search_mode == GOTO_LINE) + { + gint line; + gchar *line_str; + + line = gtk_text_iter_get_line (&view->priv->start_search_iter); + + line_str = g_strdup_printf ("%d", line + 1); + + gtk_entry_set_text (GTK_ENTRY (view->priv->search_entry), + line_str); + + g_free (line_str); + + return; + } + else + { + /* SEARCH mode */ + gboolean selection_exists; + gchar *find_text = NULL; + gchar *old_find_text; + guint old_find_flags = 0; + gint sel_len = 0; + + g_free (view->priv->old_search_text); + + old_find_text = gedit_document_get_search_text (GEDIT_DOCUMENT (buffer), + &old_find_flags); + if (old_find_text != NULL) + { + view->priv->old_search_text = old_find_text; + add_search_completion_entry (old_find_text); + } + + if (old_find_flags != 0) + { + view->priv->old_search_flags = old_find_flags; + } + + selection_exists = get_selected_text (buffer, + &find_text, + &sel_len); + + if (selection_exists && (find_text != NULL) && (sel_len <= 160)) + { + gtk_entry_set_text (GTK_ENTRY (view->priv->search_entry), + find_text); + } + else + { + gtk_entry_set_text (GTK_ENTRY (view->priv->search_entry), + ""); + } + + g_free (find_text); + } +} + +static void +search_init (GtkWidget *entry, + GeditView *view) +{ + GeditDocument *doc; + const gchar *entry_text; + + /* renew the flush timeout */ + if (view->priv->typeselect_flush_timeout != 0) + { + g_source_remove (view->priv->typeselect_flush_timeout); + view->priv->typeselect_flush_timeout = + g_timeout_add (GEDIT_VIEW_SEARCH_DIALOG_TIMEOUT, + (GSourceFunc)search_entry_flush_timeout, + view); + } + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + + entry_text = gtk_entry_get_text (GTK_ENTRY (entry)); + + if (view->priv->search_mode == SEARCH) + { + gchar *search_text; + guint search_flags; + + search_text = gedit_document_get_search_text (doc, &search_flags); + + if ((search_text == NULL) || + (strcmp (search_text, entry_text) != 0) || + search_flags != view->priv->search_flags) + { + gedit_document_set_search_text (doc, + entry_text, + view->priv->search_flags); + } + + g_free (search_text); + + run_search (view, + entry_text, + FALSE, + view->priv->wrap_around, + TRUE); + } + else + { + if (*entry_text != '\0') + { + gboolean moved, moved_offset; + gint line; + gint offset_line = 0; + gint line_offset = 0; + gchar **split_text = NULL; + const gchar *text; + + split_text = g_strsplit (entry_text, ":", -1); + + if (g_strv_length (split_text) > 1) + { + text = split_text[0]; + } + else + { + text = entry_text; + } + + if (*text == '-') + { + gint cur_line = gtk_text_iter_get_line (&view->priv->start_search_iter); + + if (*(text + 1) != '\0') + offset_line = MAX (atoi (text + 1), 0); + + line = MAX (cur_line - offset_line, 0); + } + else if (*entry_text == '+') + { + gint cur_line = gtk_text_iter_get_line (&view->priv->start_search_iter); + + if (*(text + 1) != '\0') + offset_line = MAX (atoi (text + 1), 0); + + line = cur_line + offset_line; + } + else + { + line = MAX (atoi (text) - 1, 0); + } + + if (split_text[1] != NULL) + { + line_offset = atoi (split_text[1]); + } + + g_strfreev (split_text); + + moved = gedit_document_goto_line (doc, line); + moved_offset = gedit_document_goto_line_offset (doc, line, + line_offset); + + gedit_view_scroll_to_cursor (view); + + if (!moved || !moved_offset) + set_entry_background (view->priv->search_entry, + GEDIT_SEARCH_ENTRY_NOT_FOUND); + else + set_entry_background (view->priv->search_entry, + GEDIT_SEARCH_ENTRY_NORMAL); + } + } +} + +static gboolean +start_interactive_search_real (GeditView *view) +{ + GtkTextBuffer *buffer; + + if ((view->priv->search_window != NULL) && + GTK_WIDGET_VISIBLE (view->priv->search_window)) + return TRUE; + + if (!GTK_WIDGET_HAS_FOCUS (view)) + return FALSE; + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + + if (view->priv->search_mode == SEARCH) + gtk_text_buffer_get_selection_bounds (buffer, &view->priv->start_search_iter, NULL); + else + gtk_text_buffer_get_iter_at_mark (buffer, + &view->priv->start_search_iter, + gtk_text_buffer_get_insert (buffer)); + + ensure_search_window (view); + + /* done, show it */ + update_search_window_position (view); + gtk_widget_show (view->priv->search_window); + + if (view->priv->search_entry_changed_id == 0) + { + view->priv->search_entry_changed_id = + g_signal_connect (view->priv->search_entry, + "changed", + G_CALLBACK (search_init), + view); + } + + init_search_entry (view); + + view->priv->typeselect_flush_timeout = + g_timeout_add (GEDIT_VIEW_SEARCH_DIALOG_TIMEOUT, + (GSourceFunc) search_entry_flush_timeout, + view); + + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE); + gtk_widget_grab_focus (view->priv->search_entry); + + send_focus_change (view->priv->search_entry, TRUE); + + return TRUE; +} + +static gboolean +reset_searched_text (GeditView *view) +{ + GeditDocument *doc; + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + + gedit_document_set_search_text (doc, "", GEDIT_SEARCH_DONT_SET_FLAGS); + + return TRUE; +} + +static gboolean +start_interactive_search (GeditView *view) +{ + view->priv->search_mode = SEARCH; + + return start_interactive_search_real (view); +} + +static gboolean +start_interactive_goto_line (GeditView *view) +{ + view->priv->search_mode = GOTO_LINE; + + return start_interactive_search_real (view); +} + +static gint +gedit_view_expose (GtkWidget *widget, + GdkEventExpose *event) +{ + GtkTextView *text_view; + GeditDocument *doc; + + text_view = GTK_TEXT_VIEW (widget); + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (text_view)); + + if ((event->window == gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT)) && + gedit_document_get_enable_search_highlighting (doc)) + { + GdkRectangle visible_rect; + GtkTextIter iter1, iter2; + + gtk_text_view_get_visible_rect (text_view, &visible_rect); + gtk_text_view_get_line_at_y (text_view, &iter1, + visible_rect.y, NULL); + gtk_text_view_get_line_at_y (text_view, &iter2, + visible_rect.y + + visible_rect.height, NULL); + gtk_text_iter_forward_line (&iter2); + + _gedit_document_search_region (doc, + &iter1, + &iter2); + } + + return (* GTK_WIDGET_CLASS (gedit_view_parent_class)->expose_event)(widget, event); +} + +static GdkAtom +drag_get_uri_target (GtkWidget *widget, + GdkDragContext *context) +{ + GdkAtom target; + GtkTargetList *tl; + + tl = gtk_target_list_new (NULL, 0); + gtk_target_list_add_uri_targets (tl, 0); + + target = gtk_drag_dest_find_target (widget, context, tl); + gtk_target_list_unref (tl); + + return target; +} + +static gboolean +gedit_view_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint timestamp) +{ + gboolean result; + + /* Chain up to allow textview to scroll and position dnd mark, note + * that this needs to be checked if gtksourceview or gtktextview + * changes drag_motion behaviour */ + result = GTK_WIDGET_CLASS (gedit_view_parent_class)->drag_motion (widget, context, x, y, timestamp); + + /* If this is a URL, deal with it here */ + if (drag_get_uri_target (widget, context) != GDK_NONE) + { + gdk_drag_status (context, context->suggested_action, timestamp); + result = TRUE; + } + + return result; +} + +static void +gedit_view_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint timestamp) +{ + gchar **uri_list; + + /* If this is an URL emit DROP_URIS, otherwise chain up the signal */ + if (info == TARGET_URI_LIST) + { + uri_list = gedit_utils_drop_get_uris (selection_data); + + if (uri_list != NULL) + { + g_signal_emit (widget, view_signals[DROP_URIS], 0, uri_list); + g_strfreev (uri_list); + + gtk_drag_finish (context, TRUE, FALSE, timestamp); + } + } + else + { + GTK_WIDGET_CLASS (gedit_view_parent_class)->drag_data_received (widget, context, x, y, selection_data, info, timestamp); + } +} + +static gboolean +gedit_view_drag_drop (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint timestamp) +{ + gboolean result; + GdkAtom target; + + /* If this is a URL, just get the drag data */ + target = drag_get_uri_target (widget, context); + + if (target != GDK_NONE) + { + gtk_drag_get_data (widget, context, target, timestamp); + result = TRUE; + } + else + { + /* Chain up */ + result = GTK_WIDGET_CLASS (gedit_view_parent_class)->drag_drop (widget, context, x, y, timestamp); + } + + return result; +} + +static void +show_line_numbers_toggled (GtkMenu *menu, + GeditView *view) +{ + gboolean show; + + show = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menu)); + + gedit_prefs_manager_set_display_line_numbers (show); +} + +static GtkWidget * +create_line_numbers_menu (GtkWidget *view) +{ + GtkWidget *menu; + GtkWidget *item; + + menu = gtk_menu_new (); + + item = gtk_check_menu_item_new_with_mnemonic (_("_Display line numbers")); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), + gtk_source_view_get_show_line_numbers (GTK_SOURCE_VIEW (view))); + g_signal_connect (item, "toggled", + G_CALLBACK (show_line_numbers_toggled), view); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + gtk_widget_show_all (menu); + + return menu; +} + +static void +show_line_numbers_menu (GtkWidget *view, + GdkEventButton *event) +{ + GtkWidget *menu; + + menu = create_line_numbers_menu (view); + + gtk_menu_popup (GTK_MENU (menu), + NULL, + NULL, + NULL, + NULL, + event->button, + event->time); +} + +static gboolean +gedit_view_button_press_event (GtkWidget *widget, GdkEventButton *event) +{ + if ((event->type == GDK_BUTTON_PRESS) && + (event->button == 3) && + (event->window == gtk_text_view_get_window (GTK_TEXT_VIEW (widget), + GTK_TEXT_WINDOW_LEFT))) + { + show_line_numbers_menu (widget, event); + + return TRUE; + } + + return GTK_WIDGET_CLASS (gedit_view_parent_class)->button_press_event (widget, event); +} + +static void +search_highlight_updated_cb (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end, + GeditView *view) +{ + GdkRectangle visible_rect; + GdkRectangle updated_rect; + GdkRectangle redraw_rect; + gint y; + gint height; + GtkTextView *text_view; + + text_view = GTK_TEXT_VIEW (view); + + g_return_if_fail (gedit_document_get_enable_search_highlighting ( + GEDIT_DOCUMENT (gtk_text_view_get_buffer (text_view)))); + + /* get visible area */ + gtk_text_view_get_visible_rect (text_view, &visible_rect); + + /* get updated rectangle */ + gtk_text_view_get_line_yrange (text_view, start, &y, &height); + updated_rect.y = y; + gtk_text_view_get_line_yrange (text_view, end, &y, &height); + updated_rect.height = y + height - updated_rect.y; + updated_rect.x = visible_rect.x; + updated_rect.width = visible_rect.width; + + /* intersect both rectangles to see whether we need to queue a redraw */ + if (gdk_rectangle_intersect (&updated_rect, &visible_rect, &redraw_rect)) + { + GdkRectangle widget_rect; + + gtk_text_view_buffer_to_window_coords (text_view, + GTK_TEXT_WINDOW_WIDGET, + redraw_rect.x, + redraw_rect.y, + &widget_rect.x, + &widget_rect.y); + + widget_rect.width = redraw_rect.width; + widget_rect.height = redraw_rect.height; + + gtk_widget_queue_draw_area (GTK_WIDGET (text_view), + widget_rect.x, + widget_rect.y, + widget_rect.width, + widget_rect.height); + } +} + +/* There is no "official" way to reset the im context in GtkTextView */ +static void +reset_im_context (GtkTextView *text_view) +{ + if (text_view->need_im_reset) + { + text_view->need_im_reset = FALSE; + gtk_im_context_reset (text_view->im_context); + } +} + +static void +delete_line (GtkTextView *text_view, + gint count) +{ + GtkTextIter start; + GtkTextIter end; + GtkTextBuffer *buffer; + + buffer = gtk_text_view_get_buffer (text_view); + + reset_im_context (text_view); + + /* If there is a selection delete the selected lines and + * ignore count */ + if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end)) + { + gtk_text_iter_order (&start, &end); + + if (gtk_text_iter_starts_line (&end)) + { + /* Do no delete the line with the cursor if the cursor + * is at the beginning of the line */ + count = 0; + } + else + count = 1; + } + + gtk_text_iter_set_line_offset (&start, 0); + + if (count > 0) + { + gtk_text_iter_forward_lines (&end, count); + + if (gtk_text_iter_is_end (&end)) + { + if (gtk_text_iter_backward_line (&start) && !gtk_text_iter_ends_line (&start)) + gtk_text_iter_forward_to_line_end (&start); + } + } + else if (count < 0) + { + if (!gtk_text_iter_ends_line (&end)) + gtk_text_iter_forward_to_line_end (&end); + + while (count < 0) + { + if (!gtk_text_iter_backward_line (&start)) + break; + + ++count; + } + + if (count == 0) + { + if (!gtk_text_iter_ends_line (&start)) + gtk_text_iter_forward_to_line_end (&start); + } + else + gtk_text_iter_forward_line (&end); + } + + if (!gtk_text_iter_equal (&start, &end)) + { + GtkTextIter cur = start; + gtk_text_iter_set_line_offset (&cur, 0); + + gtk_text_buffer_begin_user_action (buffer); + + gtk_text_buffer_place_cursor (buffer, &cur); + + gtk_text_buffer_delete_interactive (buffer, + &start, + &end, + gtk_text_view_get_editable (text_view)); + + gtk_text_buffer_end_user_action (buffer); + + gtk_text_view_scroll_mark_onscreen (text_view, + gtk_text_buffer_get_insert (buffer)); + } + else + { + gtk_widget_error_bell (GTK_WIDGET (text_view)); + } +} + +static void +gedit_view_delete_from_cursor (GtkTextView *text_view, + GtkDeleteType type, + gint count) +{ + /* We override the standard handler for delete_from_cursor since + the GTK_DELETE_PARAGRAPHS case is not implemented as we like (i.e. it + does not remove the carriage return in the previous line) + */ + switch (type) + { + case GTK_DELETE_PARAGRAPHS: + delete_line (text_view, count); + break; + default: + GTK_TEXT_VIEW_CLASS (gedit_view_parent_class)->delete_from_cursor(text_view, type, count); + break; + } +} diff --git a/gedit/gedit-view.h b/gedit/gedit-view.h new file mode 100755 index 00000000..dc0096bc --- /dev/null +++ b/gedit/gedit-view.h @@ -0,0 +1,108 @@ +/* + * gedit-view.h + * This file is part of gedit + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 1998-2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + */ + +#ifndef __GEDIT_VIEW_H__ +#define __GEDIT_VIEW_H__ + +#include + +#include +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_VIEW (gedit_view_get_type ()) +#define GEDIT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_VIEW, GeditView)) +#define GEDIT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_VIEW, GeditViewClass)) +#define GEDIT_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_VIEW)) +#define GEDIT_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_VIEW)) +#define GEDIT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_VIEW, GeditViewClass)) + +/* Private structure type */ +typedef struct _GeditViewPrivate GeditViewPrivate; + +/* + * Main object structure + */ +typedef struct _GeditView GeditView; + +struct _GeditView +{ + GtkSourceView view; + + /*< private > */ + GeditViewPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditViewClass GeditViewClass; + +struct _GeditViewClass +{ + GtkSourceViewClass parent_class; + + /* FIXME: Do we need placeholders ? */ + + /* Key bindings */ + gboolean (* start_interactive_search) (GeditView *view); + gboolean (* start_interactive_goto_line)(GeditView *view); + gboolean (* reset_searched_text) (GeditView *view); + + void (* drop_uris) (GeditView *view, + gchar **uri_list); +}; + +/* + * Public methods + */ +GType gedit_view_get_type (void) G_GNUC_CONST; + +GtkWidget *gedit_view_new (GeditDocument *doc); + +void gedit_view_cut_clipboard (GeditView *view); +void gedit_view_copy_clipboard (GeditView *view); +void gedit_view_paste_clipboard (GeditView *view); +void gedit_view_delete_selection (GeditView *view); +void gedit_view_select_all (GeditView *view); + +void gedit_view_scroll_to_cursor (GeditView *view); + +void gedit_view_set_font (GeditView *view, + gboolean def, + const gchar *font_name); + +G_END_DECLS + +#endif /* __GEDIT_VIEW_H__ */ diff --git a/gedit/gedit-window-private.h b/gedit/gedit-window-private.h new file mode 100755 index 00000000..399433af --- /dev/null +++ b/gedit/gedit-window-private.h @@ -0,0 +1,124 @@ +/* + * gedit-window-private.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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 + * MERCHANWINDOWILITY 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_WINDOW_PRIVATE_H__ +#define __GEDIT_WINDOW_PRIVATE_H__ + +#include "gedit/gedit-window.h" +#include "gedit-prefs-manager.h" +#include "gedit-message-bus.h" + +#ifdef OS_OSX +#include +#endif + +G_BEGIN_DECLS + +/* WindowPrivate is in a separate .h so that we can access it from gedit-commands */ + +struct _GeditWindowPrivate +{ + GtkWidget *notebook; + + GtkWidget *side_panel; + GtkWidget *bottom_panel; + + GtkWidget *hpaned; + GtkWidget *vpaned; + + GtkWidget *tab_width_combo; + GtkWidget *language_combo; + + GeditMessageBus *message_bus; + + /* Widgets for fullscreen mode */ + GtkWidget *fullscreen_controls; + guint fullscreen_animation_timeout_id; + gboolean fullscreen_animation_enter; + + /* statusbar and context ids for statusbar messages */ + GtkWidget *statusbar; + guint generic_message_cid; + guint tip_message_cid; + guint tab_width_id; + guint spaces_instead_of_tabs_id; + guint language_changed_id; + + /* Menus & Toolbars */ + GtkUIManager *manager; + GtkActionGroup *action_group; + GtkActionGroup *always_sensitive_action_group; + GtkActionGroup *close_action_group; + GtkActionGroup *quit_action_group; + GtkActionGroup *panes_action_group; + GtkActionGroup *languages_action_group; + GtkActionGroup *documents_list_action_group; + guint documents_list_menu_ui_id; + GtkWidget *toolbar; + GtkWidget *toolbar_recent_menu; + GtkWidget *menubar; + GeditToolbarSetting toolbar_style; + + /* recent files */ + GtkActionGroup *recents_action_group; + guint recents_menu_ui_id; + gulong recents_handler_id; + + GeditTab *active_tab; + gint num_tabs; + + gint num_tabs_with_error; + + gint width; + gint height; + GdkWindowState window_state; + + gint side_panel_size; + gint bottom_panel_size; + + GeditWindowState state; + + gint bottom_panel_item_removed_handler_id; + + GtkWindowGroup *window_group; + + GFile *default_location; + +#ifdef OS_OSX + IgeMacMenuGroup *mac_menu_group; +#endif + + gboolean removing_tabs : 1; + gboolean dispose_has_run : 1; +}; + +G_END_DECLS + +#endif /* __GEDIT_WINDOW_PRIVATE_H__ */ diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c new file mode 100755 index 00000000..c4bf2403 --- /dev/null +++ b/gedit/gedit-window.c @@ -0,0 +1,4798 @@ +/* + * gedit-window.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include +#include + +#include "gedit-ui.h" +#include "gedit-window.h" +#include "gedit-window-private.h" +#include "gedit-app.h" +#include "gedit-notebook.h" +#include "gedit-statusbar.h" +#include "gedit-utils.h" +#include "gedit-commands.h" +#include "gedit-debug.h" +#include "gedit-language-manager.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-panel.h" +#include "gedit-documents-panel.h" +#include "gedit-plugins-engine.h" +#include "gedit-enum-types.h" +#include "gedit-dirs.h" +#include "gedit-status-combo-box.h" + +#ifdef OS_OSX +#include "osx/gedit-osx.h" +#endif + +#define LANGUAGE_NONE (const gchar *)"LangNone" +#define GEDIT_UIFILE "gedit-ui.xml" +#define TAB_WIDTH_DATA "GeditWindowTabWidthData" +#define LANGUAGE_DATA "GeditWindowLanguageData" +#define FULLSCREEN_ANIMATION_SPEED 4 + +#define GEDIT_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),\ + GEDIT_TYPE_WINDOW, \ + GeditWindowPrivate)) + +/* Signals */ +enum +{ + TAB_ADDED, + TAB_REMOVED, + TABS_REORDERED, + ACTIVE_TAB_CHANGED, + ACTIVE_TAB_STATE_CHANGED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum +{ + PROP_0, + PROP_STATE +}; + +enum +{ + TARGET_URI_LIST = 100 +}; + +G_DEFINE_TYPE(GeditWindow, gedit_window, GTK_TYPE_WINDOW) + +static void recent_manager_changed (GtkRecentManager *manager, + GeditWindow *window); + +static void +gedit_window_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditWindow *window = GEDIT_WINDOW (object); + + switch (prop_id) + { + case PROP_STATE: + g_value_set_enum (value, + gedit_window_get_state (window)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +save_panes_state (GeditWindow *window) +{ + gint pane_page; + + gedit_debug (DEBUG_WINDOW); + + if (gedit_prefs_manager_window_size_can_set ()) + gedit_prefs_manager_set_window_size (window->priv->width, + window->priv->height); + + if (gedit_prefs_manager_window_state_can_set ()) + gedit_prefs_manager_set_window_state (window->priv->window_state); + + if ((window->priv->side_panel_size > 0) && + gedit_prefs_manager_side_panel_size_can_set ()) + gedit_prefs_manager_set_side_panel_size ( + window->priv->side_panel_size); + + pane_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (window->priv->side_panel)); + if (pane_page != 0 && + gedit_prefs_manager_side_panel_active_page_can_set ()) + gedit_prefs_manager_set_side_panel_active_page (pane_page); + + if ((window->priv->bottom_panel_size > 0) && + gedit_prefs_manager_bottom_panel_size_can_set ()) + gedit_prefs_manager_set_bottom_panel_size ( + window->priv->bottom_panel_size); + + pane_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (window->priv->bottom_panel)); + if (pane_page != 0 && + gedit_prefs_manager_bottom_panel_active_page_can_set ()) + gedit_prefs_manager_set_bottom_panel_active_page (pane_page); +} + +#ifdef OS_OSX +static GtkMenuItem * +ui_manager_menu_item (GtkUIManager *uimanager, + const gchar *path) +{ + return GTK_MENU_ITEM (gtk_ui_manager_get_widget (uimanager, path)); +} + +static void +add_mac_root_menu (GeditWindow *window) +{ + if (window->priv->mac_menu_group != NULL) + { + return; + } + + window->priv->mac_menu_group = ige_mac_menu_add_app_menu_group (); + + ige_mac_menu_add_app_menu_item (window->priv->mac_menu_group, + ui_manager_menu_item (window->priv->manager, "/ui/MenuBar/HelpMenu/HelpAboutMenu"), + NULL); +} + +static void +remove_mac_root_menu (GeditWindow *window) +{ + if (window->priv->mac_menu_group == NULL) + { + return; + } + + ige_mac_menu_remove_app_menu_group (window->priv->mac_menu_group); + window->priv->mac_menu_group = NULL; +} + +static gboolean +gedit_window_focus_in_event (GtkWidget *widget, + GdkEventFocus *event) +{ + add_mac_root_menu (GEDIT_WINDOW (widget)); + return GTK_WIDGET_CLASS (gedit_window_parent_class)->focus_in_event (widget, event); +} + +static gboolean +gedit_window_focus_out_event (GtkWidget *widget, + GdkEventFocus *event) +{ + remove_mac_root_menu (GEDIT_WINDOW (widget)); + return GTK_WIDGET_CLASS (gedit_window_parent_class)->focus_out_event (widget, event); +} +#endif + +static void +gedit_window_dispose (GObject *object) +{ + GeditWindow *window; + + gedit_debug (DEBUG_WINDOW); + + window = GEDIT_WINDOW (object); + + /* Stop tracking removal of panes otherwise we always + * end up with thinking we had no pane active, since they + * should all be removed below */ + if (window->priv->bottom_panel_item_removed_handler_id != 0) + { + g_signal_handler_disconnect (window->priv->bottom_panel, + window->priv->bottom_panel_item_removed_handler_id); + window->priv->bottom_panel_item_removed_handler_id = 0; + } + + /* First of all, force collection so that plugins + * really drop some of the references. + */ + gedit_plugins_engine_garbage_collect (gedit_plugins_engine_get_default ()); + + /* save the panes position and make sure to deactivate plugins + * for this window, but only once */ + if (!window->priv->dispose_has_run) + { + save_panes_state (window); + + gedit_plugins_engine_deactivate_plugins (gedit_plugins_engine_get_default (), + window); + window->priv->dispose_has_run = TRUE; + } + + if (window->priv->fullscreen_animation_timeout_id != 0) + { + g_source_remove (window->priv->fullscreen_animation_timeout_id); + window->priv->fullscreen_animation_timeout_id = 0; + } + + if (window->priv->fullscreen_controls != NULL) + { + gtk_widget_destroy (window->priv->fullscreen_controls); + + window->priv->fullscreen_controls = NULL; + } + + if (window->priv->recents_handler_id != 0) + { + GtkRecentManager *recent_manager; + + recent_manager = gtk_recent_manager_get_default (); + g_signal_handler_disconnect (recent_manager, + window->priv->recents_handler_id); + window->priv->recents_handler_id = 0; + } + + if (window->priv->manager != NULL) + { + g_object_unref (window->priv->manager); + window->priv->manager = NULL; + } + + if (window->priv->message_bus != NULL) + { + g_object_unref (window->priv->message_bus); + window->priv->message_bus = NULL; + } + + if (window->priv->window_group != NULL) + { + g_object_unref (window->priv->window_group); + window->priv->window_group = NULL; + } + + /* Now that there have broken some reference loops, + * force collection again. + */ + gedit_plugins_engine_garbage_collect (gedit_plugins_engine_get_default ()); + +#ifdef OS_OSX + remove_mac_root_menu (window); +#endif + + G_OBJECT_CLASS (gedit_window_parent_class)->dispose (object); +} + +static void +gedit_window_finalize (GObject *object) +{ + GeditWindow *window; + + gedit_debug (DEBUG_WINDOW); + + window = GEDIT_WINDOW (object); + + if (window->priv->default_location != NULL) + g_object_unref (window->priv->default_location); + + G_OBJECT_CLASS (gedit_window_parent_class)->finalize (object); +} + +static gboolean +gedit_window_window_state_event (GtkWidget *widget, + GdkEventWindowState *event) +{ + GeditWindow *window = GEDIT_WINDOW (widget); + + window->priv->window_state = event->new_window_state; + + if (event->changed_mask & + (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) + { + gboolean show; + + show = !(event->new_window_state & + (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)); + + _gedit_statusbar_set_has_resize_grip (GEDIT_STATUSBAR (window->priv->statusbar), + show); + } + + return FALSE; +} + +static gboolean +gedit_window_configure_event (GtkWidget *widget, + GdkEventConfigure *event) +{ + GeditWindow *window = GEDIT_WINDOW (widget); + + window->priv->width = event->width; + window->priv->height = event->height; + + return GTK_WIDGET_CLASS (gedit_window_parent_class)->configure_event (widget, event); +} + +/* + * GtkWindow catches keybindings for the menu items _before_ passing them to + * the focused widget. This is unfortunate and means that pressing ctrl+V + * in an entry on a panel ends up pasting text in the TextView. + * Here we override GtkWindow's handler to do the same things that it + * does, but in the opposite order and then we chain up to the grand + * parent handler, skipping gtk_window_key_press_event. + */ +static gboolean +gedit_window_key_press_event (GtkWidget *widget, + GdkEventKey *event) +{ + static gpointer grand_parent_class = NULL; + GtkWindow *window = GTK_WINDOW (widget); + gboolean handled = FALSE; + + if (grand_parent_class == NULL) + grand_parent_class = g_type_class_peek_parent (gedit_window_parent_class); + + /* handle focus widget key events */ + if (!handled) + handled = gtk_window_propagate_key_event (window, event); + + /* handle mnemonics and accelerators */ + if (!handled) + handled = gtk_window_activate_key (window, event); + + /* Chain up, invokes binding set */ + if (!handled) + handled = GTK_WIDGET_CLASS (grand_parent_class)->key_press_event (widget, event); + + return handled; +} + +static void +gedit_window_tab_removed (GeditWindow *window, + GeditTab *tab) +{ + gedit_plugins_engine_garbage_collect (gedit_plugins_engine_get_default ()); +} + +static void +gedit_window_class_init (GeditWindowClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + klass->tab_removed = gedit_window_tab_removed; + + object_class->dispose = gedit_window_dispose; + object_class->finalize = gedit_window_finalize; + object_class->get_property = gedit_window_get_property; + + widget_class->window_state_event = gedit_window_window_state_event; + widget_class->configure_event = gedit_window_configure_event; + widget_class->key_press_event = gedit_window_key_press_event; + +#ifdef OS_OSX + widget_class->focus_in_event = gedit_window_focus_in_event; + widget_class->focus_out_event = gedit_window_focus_out_event; +#endif + + signals[TAB_ADDED] = + g_signal_new ("tab_added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditWindowClass, tab_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_TAB); + signals[TAB_REMOVED] = + g_signal_new ("tab_removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditWindowClass, tab_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_TAB); + signals[TABS_REORDERED] = + g_signal_new ("tabs_reordered", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditWindowClass, tabs_reordered), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[ACTIVE_TAB_CHANGED] = + g_signal_new ("active_tab_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditWindowClass, active_tab_changed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + GEDIT_TYPE_TAB); + signals[ACTIVE_TAB_STATE_CHANGED] = + g_signal_new ("active_tab_state_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GeditWindowClass, active_tab_state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + g_object_class_install_property (object_class, + PROP_STATE, + g_param_spec_flags ("state", + "State", + "The window's state", + GEDIT_TYPE_WINDOW_STATE, + GEDIT_WINDOW_STATE_NORMAL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof(GeditWindowPrivate)); +} + +static void +menu_item_select_cb (GtkMenuItem *proxy, + GeditWindow *window) +{ + GtkAction *action; + char *message; + + action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (proxy)); + g_return_if_fail (action != NULL); + + g_object_get (G_OBJECT (action), "tooltip", &message, NULL); + if (message) + { + gtk_statusbar_push (GTK_STATUSBAR (window->priv->statusbar), + window->priv->tip_message_cid, message); + g_free (message); + } +} + +static void +menu_item_deselect_cb (GtkMenuItem *proxy, + GeditWindow *window) +{ + gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar), + window->priv->tip_message_cid); +} + +static void +connect_proxy_cb (GtkUIManager *manager, + GtkAction *action, + GtkWidget *proxy, + GeditWindow *window) +{ + if (GTK_IS_MENU_ITEM (proxy)) + { + g_signal_connect (proxy, "select", + G_CALLBACK (menu_item_select_cb), window); + g_signal_connect (proxy, "deselect", + G_CALLBACK (menu_item_deselect_cb), window); + } +} + +static void +disconnect_proxy_cb (GtkUIManager *manager, + GtkAction *action, + GtkWidget *proxy, + GeditWindow *window) +{ + if (GTK_IS_MENU_ITEM (proxy)) + { + g_signal_handlers_disconnect_by_func + (proxy, G_CALLBACK (menu_item_select_cb), window); + g_signal_handlers_disconnect_by_func + (proxy, G_CALLBACK (menu_item_deselect_cb), window); + } +} + +static void +apply_toolbar_style (GeditWindow *window, + GtkWidget *toolbar) +{ + switch (window->priv->toolbar_style) + { + case GEDIT_TOOLBAR_SYSTEM: + gedit_debug_message (DEBUG_WINDOW, "GEDIT: SYSTEM"); + gtk_toolbar_unset_style ( + GTK_TOOLBAR (toolbar)); + break; + + case GEDIT_TOOLBAR_ICONS: + gedit_debug_message (DEBUG_WINDOW, "GEDIT: ICONS"); + gtk_toolbar_set_style ( + GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_ICONS); + break; + + case GEDIT_TOOLBAR_ICONS_AND_TEXT: + gedit_debug_message (DEBUG_WINDOW, "GEDIT: ICONS_AND_TEXT"); + gtk_toolbar_set_style ( + GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_BOTH); + break; + + case GEDIT_TOOLBAR_ICONS_BOTH_HORIZ: + gedit_debug_message (DEBUG_WINDOW, "GEDIT: ICONS_BOTH_HORIZ"); + gtk_toolbar_set_style ( + GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_BOTH_HORIZ); + break; + } +} + +/* Returns TRUE if toolbar is visible */ +static gboolean +set_toolbar_style (GeditWindow *window, + GeditWindow *origin) +{ + gboolean visible; + GeditToolbarSetting style; + GtkAction *action; + + if (origin == NULL) + visible = gedit_prefs_manager_get_toolbar_visible (); + else + visible = GTK_WIDGET_VISIBLE (origin->priv->toolbar); + + /* Set visibility */ + if (visible) + gtk_widget_show (window->priv->toolbar); + else + gtk_widget_hide (window->priv->toolbar); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "ViewToolbar"); + + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != visible) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible); + + /* Set style */ + if (origin == NULL) + style = gedit_prefs_manager_get_toolbar_buttons_style (); + else + style = origin->priv->toolbar_style; + + window->priv->toolbar_style = style; + + apply_toolbar_style (window, window->priv->toolbar); + + return visible; +} + +static void +update_next_prev_doc_sensitivity (GeditWindow *window, + GeditTab *tab) +{ + gint tab_number; + GtkNotebook *notebook; + GtkAction *action; + + gedit_debug (DEBUG_WINDOW); + + notebook = GTK_NOTEBOOK (_gedit_window_get_notebook (window)); + + tab_number = gtk_notebook_page_num (notebook, GTK_WIDGET (tab)); + g_return_if_fail (tab_number >= 0); + + action = gtk_action_group_get_action (window->priv->action_group, + "DocumentsPreviousDocument"); + gtk_action_set_sensitive (action, tab_number != 0); + + action = gtk_action_group_get_action (window->priv->action_group, + "DocumentsNextDocument"); + gtk_action_set_sensitive (action, + tab_number < gtk_notebook_get_n_pages (notebook) - 1); +} + +static void +update_next_prev_doc_sensitivity_per_window (GeditWindow *window) +{ + GeditTab *tab; + GtkAction *action; + + gedit_debug (DEBUG_WINDOW); + + tab = gedit_window_get_active_tab (window); + if (tab != NULL) + { + update_next_prev_doc_sensitivity (window, tab); + + return; + } + + action = gtk_action_group_get_action (window->priv->action_group, + "DocumentsPreviousDocument"); + gtk_action_set_sensitive (action, FALSE); + + action = gtk_action_group_get_action (window->priv->action_group, + "DocumentsNextDocument"); + gtk_action_set_sensitive (action, FALSE); + +} + +static void +received_clipboard_contents (GtkClipboard *clipboard, + GtkSelectionData *selection_data, + GeditWindow *window) +{ + gboolean sens; + GtkAction *action; + + /* getting clipboard contents is async, so we need to + * get the current tab and its state */ + + if (window->priv->active_tab != NULL) + { + GeditTabState state; + gboolean state_normal; + + state = gedit_tab_get_state (window->priv->active_tab); + state_normal = (state == GEDIT_TAB_STATE_NORMAL); + + sens = state_normal && + gtk_selection_data_targets_include_text (selection_data); + } + else + { + sens = FALSE; + } + + action = gtk_action_group_get_action (window->priv->action_group, + "EditPaste"); + + gtk_action_set_sensitive (action, sens); + + g_object_unref (window); +} + +static void +set_paste_sensitivity_according_to_clipboard (GeditWindow *window, + GtkClipboard *clipboard) +{ + GdkDisplay *display; + + display = gtk_clipboard_get_display (clipboard); + + if (gdk_display_supports_selection_notification (display)) + { + gtk_clipboard_request_contents (clipboard, + gdk_atom_intern_static_string ("TARGETS"), + (GtkClipboardReceivedFunc) received_clipboard_contents, + g_object_ref (window)); + } + else + { + GtkAction *action; + + action = gtk_action_group_get_action (window->priv->action_group, + "EditPaste"); + + /* XFIXES extension not availbale, make + * Paste always sensitive */ + gtk_action_set_sensitive (action, TRUE); + } +} + +static void +set_sensitivity_according_to_tab (GeditWindow *window, + GeditTab *tab) +{ + GeditDocument *doc; + GeditView *view; + GtkAction *action; + gboolean b; + gboolean state_normal; + gboolean editable; + GeditTabState state; + GtkClipboard *clipboard; + GeditLockdownMask lockdown; + + g_return_if_fail (GEDIT_TAB (tab)); + + gedit_debug (DEBUG_WINDOW); + + lockdown = gedit_app_get_lockdown (gedit_app_get_default ()); + + state = gedit_tab_get_state (tab); + state_normal = (state == GEDIT_TAB_STATE_NORMAL); + + view = gedit_tab_get_view (tab); + editable = gtk_text_view_get_editable (GTK_TEXT_VIEW (view)); + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + + clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), + GDK_SELECTION_CLIPBOARD); + + action = gtk_action_group_get_action (window->priv->action_group, + "FileSave"); + gtk_action_set_sensitive (action, + (state_normal || + (state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) || + (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)) && + !gedit_document_get_readonly (doc) && + !(lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK)); + + action = gtk_action_group_get_action (window->priv->action_group, + "FileSaveAs"); + gtk_action_set_sensitive (action, + (state_normal || + (state == GEDIT_TAB_STATE_SAVING_ERROR) || + (state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) || + (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)) && + !(lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK)); + + action = gtk_action_group_get_action (window->priv->action_group, + "FileRevert"); + gtk_action_set_sensitive (action, + (state_normal || + (state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION)) && + !gedit_document_is_untitled (doc)); + + action = gtk_action_group_get_action (window->priv->action_group, + "FilePrintPreview"); + gtk_action_set_sensitive (action, + state_normal && + !(lockdown & GEDIT_LOCKDOWN_PRINTING)); + + action = gtk_action_group_get_action (window->priv->action_group, + "FilePrint"); + gtk_action_set_sensitive (action, + (state_normal || + (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)) && + !(lockdown & GEDIT_LOCKDOWN_PRINTING)); + + action = gtk_action_group_get_action (window->priv->close_action_group, + "FileClose"); + + gtk_action_set_sensitive (action, + (state != GEDIT_TAB_STATE_CLOSING) && + (state != GEDIT_TAB_STATE_SAVING) && + (state != GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) && + (state != GEDIT_TAB_STATE_PRINTING) && + (state != GEDIT_TAB_STATE_PRINT_PREVIEWING) && + (state != GEDIT_TAB_STATE_SAVING_ERROR)); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditUndo"); + gtk_action_set_sensitive (action, + state_normal && + gtk_source_buffer_can_undo (GTK_SOURCE_BUFFER (doc))); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditRedo"); + gtk_action_set_sensitive (action, + state_normal && + gtk_source_buffer_can_redo (GTK_SOURCE_BUFFER (doc))); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditCut"); + gtk_action_set_sensitive (action, + state_normal && + editable && + gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc))); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditCopy"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) && + gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc))); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditPaste"); + if (state_normal && editable) + { + set_paste_sensitivity_according_to_clipboard (window, + clipboard); + } + else + { + gtk_action_set_sensitive (action, FALSE); + } + + action = gtk_action_group_get_action (window->priv->action_group, + "EditDelete"); + gtk_action_set_sensitive (action, + state_normal && + editable && + gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc))); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchFind"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION)); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchIncrementalSearch"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION)); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchReplace"); + gtk_action_set_sensitive (action, + state_normal && + editable); + + b = gedit_document_get_can_search_again (doc); + action = gtk_action_group_get_action (window->priv->action_group, + "SearchFindNext"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) && b); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchFindPrevious"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) && b); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchClearHighlight"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) && b); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchGoToLine"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION)); + + action = gtk_action_group_get_action (window->priv->action_group, + "ViewHighlightMode"); + gtk_action_set_sensitive (action, + (state != GEDIT_TAB_STATE_CLOSING) && + gedit_prefs_manager_get_enable_syntax_highlighting ()); + + update_next_prev_doc_sensitivity (window, tab); + + gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (), + window); +} + +static void +language_toggled (GtkToggleAction *action, + GeditWindow *window) +{ + GeditDocument *doc; + GtkSourceLanguage *lang; + const gchar *lang_id; + + if (gtk_toggle_action_get_active (action) == FALSE) + return; + + doc = gedit_window_get_active_document (window); + if (doc == NULL) + return; + + lang_id = gtk_action_get_name (GTK_ACTION (action)); + + if (strcmp (lang_id, LANGUAGE_NONE) == 0) + { + /* Normal (no highlighting) */ + lang = NULL; + } + else + { + lang = gtk_source_language_manager_get_language ( + gedit_get_language_manager (), + lang_id); + if (lang == NULL) + { + g_warning ("Could not get language %s\n", lang_id); + } + } + + gedit_document_set_language (doc, lang); +} + +static gchar * +escape_section_name (const gchar *name) +{ + gchar *ret; + + ret = g_markup_escape_text (name, -1); + + /* Replace '/' with '-' to avoid problems in xml paths */ + g_strdelimit (ret, "/", '-'); + + return ret; +} + +static void +create_language_menu_item (GtkSourceLanguage *lang, + gint index, + guint ui_id, + GeditWindow *window) +{ + GtkAction *section_action; + GtkRadioAction *action; + GtkAction *normal_action; + GSList *group; + const gchar *section; + gchar *escaped_section; + const gchar *lang_id; + const gchar *lang_name; + gchar *escaped_lang_name; + gchar *tip; + gchar *path; + + section = gtk_source_language_get_section (lang); + escaped_section = escape_section_name (section); + + /* check if the section submenu exists or create it */ + section_action = gtk_action_group_get_action (window->priv->languages_action_group, + escaped_section); + + if (section_action == NULL) + { + gchar *section_name; + + section_name = gedit_utils_escape_underscores (section, -1); + + section_action = gtk_action_new (escaped_section, + section_name, + NULL, + NULL); + + g_free (section_name); + + gtk_action_group_add_action (window->priv->languages_action_group, + section_action); + g_object_unref (section_action); + + gtk_ui_manager_add_ui (window->priv->manager, + ui_id, + "/MenuBar/ViewMenu/ViewHighlightModeMenu/LanguagesMenuPlaceholder", + escaped_section, + escaped_section, + GTK_UI_MANAGER_MENU, + FALSE); + } + + /* now add the language item to the section */ + lang_name = gtk_source_language_get_name (lang); + lang_id = gtk_source_language_get_id (lang); + + escaped_lang_name = gedit_utils_escape_underscores (lang_name, -1); + + tip = g_strdup_printf (_("Use %s highlight mode"), lang_name); + path = g_strdup_printf ("/MenuBar/ViewMenu/ViewHighlightModeMenu/LanguagesMenuPlaceholder/%s", + escaped_section); + + action = gtk_radio_action_new (lang_id, + escaped_lang_name, + tip, + NULL, + index); + + g_free (escaped_lang_name); + + /* Action is added with a NULL accel to make the accel overridable */ + gtk_action_group_add_action_with_accel (window->priv->languages_action_group, + GTK_ACTION (action), + NULL); + g_object_unref (action); + + /* add the action to the same radio group of the "Normal" action */ + normal_action = gtk_action_group_get_action (window->priv->languages_action_group, + LANGUAGE_NONE); + group = gtk_radio_action_get_group (GTK_RADIO_ACTION (normal_action)); + gtk_radio_action_set_group (action, group); + + g_signal_connect (action, + "activate", + G_CALLBACK (language_toggled), + window); + + gtk_ui_manager_add_ui (window->priv->manager, + ui_id, + path, + lang_id, + lang_id, + GTK_UI_MANAGER_MENUITEM, + FALSE); + + g_free (path); + g_free (tip); + g_free (escaped_section); +} + +static void +create_languages_menu (GeditWindow *window) +{ + GtkRadioAction *action_none; + GSList *languages; + GSList *l; + guint id; + gint i; + + gedit_debug (DEBUG_WINDOW); + + /* add the "Plain Text" item before all the others */ + + /* Translators: "Plain Text" means that no highlight mode is selected in the + * "View->Highlight Mode" submenu and so syntax highlighting is disabled */ + action_none = gtk_radio_action_new (LANGUAGE_NONE, _("Plain Text"), + _("Disable syntax highlighting"), + NULL, + -1); + + gtk_action_group_add_action (window->priv->languages_action_group, + GTK_ACTION (action_none)); + g_object_unref (action_none); + + g_signal_connect (action_none, + "activate", + G_CALLBACK (language_toggled), + window); + + id = gtk_ui_manager_new_merge_id (window->priv->manager); + + gtk_ui_manager_add_ui (window->priv->manager, + id, + "/MenuBar/ViewMenu/ViewHighlightModeMenu/LanguagesMenuPlaceholder", + LANGUAGE_NONE, + LANGUAGE_NONE, + GTK_UI_MANAGER_MENUITEM, + TRUE); + + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action_none), TRUE); + + /* now add all the known languages */ + languages = gedit_language_manager_list_languages_sorted ( + gedit_get_language_manager (), + FALSE); + + for (l = languages, i = 0; l != NULL; l = l->next, ++i) + { + create_language_menu_item (l->data, + i, + id, + window); + } + + g_slist_free (languages); +} + +static void +update_languages_menu (GeditWindow *window) +{ + GeditDocument *doc; + GList *actions; + GList *l; + GtkAction *action; + GtkSourceLanguage *lang; + const gchar *lang_id; + + doc = gedit_window_get_active_document (window); + if (doc == NULL) + return; + + lang = gedit_document_get_language (doc); + if (lang != NULL) + lang_id = gtk_source_language_get_id (lang); + else + lang_id = LANGUAGE_NONE; + + actions = gtk_action_group_list_actions (window->priv->languages_action_group); + + /* prevent recursion */ + for (l = actions; l != NULL; l = l->next) + { + g_signal_handlers_block_by_func (GTK_ACTION (l->data), + G_CALLBACK (language_toggled), + window); + } + + action = gtk_action_group_get_action (window->priv->languages_action_group, + lang_id); + + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); + + for (l = actions; l != NULL; l = l->next) + { + g_signal_handlers_unblock_by_func (GTK_ACTION (l->data), + G_CALLBACK (language_toggled), + window); + } + + g_list_free (actions); +} + +void +_gedit_recent_add (GeditWindow *window, + const gchar *uri, + const gchar *mime) +{ + GtkRecentManager *recent_manager; + GtkRecentData *recent_data; + + static gchar *groups[2] = { + "gedit", + NULL + }; + + recent_manager = gtk_recent_manager_get_default (); + + recent_data = g_slice_new (GtkRecentData); + + recent_data->display_name = NULL; + recent_data->description = NULL; + recent_data->mime_type = (gchar *) mime; + recent_data->app_name = (gchar *) g_get_application_name (); + recent_data->app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL); + recent_data->groups = groups; + recent_data->is_private = FALSE; + + gtk_recent_manager_add_full (recent_manager, + uri, + recent_data); + + g_free (recent_data->app_exec); + + g_slice_free (GtkRecentData, recent_data); +} + +void +_gedit_recent_remove (GeditWindow *window, + const gchar *uri) +{ + GtkRecentManager *recent_manager; + + recent_manager = gtk_recent_manager_get_default (); + + gtk_recent_manager_remove_item (recent_manager, uri, NULL); +} + +static void +open_recent_file (const gchar *uri, + GeditWindow *window) +{ + GSList *uris = NULL; + + uris = g_slist_prepend (uris, (gpointer) uri); + + if (gedit_commands_load_uris (window, uris, NULL, 0) != 1) + { + _gedit_recent_remove (window, uri); + } + + g_slist_free (uris); +} + +static void +recent_chooser_item_activated (GtkRecentChooser *chooser, + GeditWindow *window) +{ + gchar *uri; + + uri = gtk_recent_chooser_get_current_uri (chooser); + + open_recent_file (uri, window); + + g_free (uri); +} + +static void +recents_menu_activate (GtkAction *action, + GeditWindow *window) +{ + GtkRecentInfo *info; + const gchar *uri; + + info = g_object_get_data (G_OBJECT (action), "gtk-recent-info"); + g_return_if_fail (info != NULL); + + uri = gtk_recent_info_get_uri (info); + + open_recent_file (uri, window); +} + +static gint +sort_recents_mru (GtkRecentInfo *a, GtkRecentInfo *b) +{ + return (gtk_recent_info_get_modified (b) - gtk_recent_info_get_modified (a)); +} + +static void update_recent_files_menu (GeditWindow *window); + +static void +recent_manager_changed (GtkRecentManager *manager, + GeditWindow *window) +{ + /* regenerate the menu when the model changes */ + update_recent_files_menu (window); +} + +/* + * Manually construct the inline recents list in the File menu. + * Hopefully gtk 2.12 will add support for it. + */ +static void +update_recent_files_menu (GeditWindow *window) +{ + GeditWindowPrivate *p = window->priv; + GtkRecentManager *recent_manager; + gint max_recents; + GList *actions, *l, *items; + GList *filtered_items = NULL; + gint i; + + gedit_debug (DEBUG_WINDOW); + + max_recents = gedit_prefs_manager_get_max_recents (); + + g_return_if_fail (p->recents_action_group != NULL); + + if (p->recents_menu_ui_id != 0) + gtk_ui_manager_remove_ui (p->manager, + p->recents_menu_ui_id); + + actions = gtk_action_group_list_actions (p->recents_action_group); + for (l = actions; l != NULL; l = l->next) + { + g_signal_handlers_disconnect_by_func (GTK_ACTION (l->data), + G_CALLBACK (recents_menu_activate), + window); + gtk_action_group_remove_action (p->recents_action_group, + GTK_ACTION (l->data)); + } + g_list_free (actions); + + p->recents_menu_ui_id = gtk_ui_manager_new_merge_id (p->manager); + + recent_manager = gtk_recent_manager_get_default (); + items = gtk_recent_manager_get_items (recent_manager); + + /* filter */ + for (l = items; l != NULL; l = l->next) + { + GtkRecentInfo *info = l->data; + + if (!gtk_recent_info_has_group (info, "gedit")) + continue; + + filtered_items = g_list_prepend (filtered_items, info); + } + + /* sort */ + filtered_items = g_list_sort (filtered_items, + (GCompareFunc) sort_recents_mru); + + i = 0; + for (l = filtered_items; l != NULL; l = l->next) + { + gchar *action_name; + const gchar *display_name; + gchar *escaped; + gchar *label; + gchar *uri; + gchar *ruri; + gchar *tip; + GtkAction *action; + GtkRecentInfo *info = l->data; + + /* clamp */ + if (i >= max_recents) + break; + + i++; + + action_name = g_strdup_printf ("recent-info-%d", i); + + display_name = gtk_recent_info_get_display_name (info); + escaped = gedit_utils_escape_underscores (display_name, -1); + if (i >= 10) + label = g_strdup_printf ("%d. %s", + i, + escaped); + else + label = g_strdup_printf ("_%d. %s", + i, + escaped); + g_free (escaped); + + /* gtk_recent_info_get_uri_display (info) is buggy and + * works only for local files */ + uri = gedit_utils_uri_for_display (gtk_recent_info_get_uri (info)); + ruri = gedit_utils_replace_home_dir_with_tilde (uri); + g_free (uri); + + /* Translators: %s is a URI */ + tip = g_strdup_printf (_("Open '%s'"), ruri); + g_free (ruri); + + action = gtk_action_new (action_name, + label, + tip, + NULL); + + g_object_set_data_full (G_OBJECT (action), + "gtk-recent-info", + gtk_recent_info_ref (info), + (GDestroyNotify) gtk_recent_info_unref); + + g_signal_connect (action, + "activate", + G_CALLBACK (recents_menu_activate), + window); + + gtk_action_group_add_action (p->recents_action_group, + action); + g_object_unref (action); + + gtk_ui_manager_add_ui (p->manager, + p->recents_menu_ui_id, + "/MenuBar/FileMenu/FileRecentsPlaceholder", + action_name, + action_name, + GTK_UI_MANAGER_MENUITEM, + FALSE); + + g_free (action_name); + g_free (label); + g_free (tip); + } + + g_list_free (filtered_items); + + g_list_foreach (items, (GFunc) gtk_recent_info_unref, NULL); + g_list_free (items); +} + +static void +set_non_homogeneus (GtkWidget *widget, gpointer data) +{ + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (widget), FALSE); +} + +static void +toolbar_visibility_changed (GtkWidget *toolbar, + GeditWindow *window) +{ + gboolean visible; + GtkAction *action; + + visible = GTK_WIDGET_VISIBLE (toolbar); + + if (gedit_prefs_manager_toolbar_visible_can_set ()) + gedit_prefs_manager_set_toolbar_visible (visible); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "ViewToolbar"); + + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != visible) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible); +} + +static GtkWidget * +setup_toolbar_open_button (GeditWindow *window, + GtkWidget *toolbar) +{ + GtkRecentManager *recent_manager; + GtkRecentFilter *filter; + GtkWidget *toolbar_recent_menu; + GtkToolItem *open_button; + GtkAction *action; + + recent_manager = gtk_recent_manager_get_default (); + + /* recent files menu tool button */ + toolbar_recent_menu = gtk_recent_chooser_menu_new_for_manager (recent_manager); + + gtk_recent_chooser_set_local_only (GTK_RECENT_CHOOSER (toolbar_recent_menu), + FALSE); + gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (toolbar_recent_menu), + GTK_RECENT_SORT_MRU); + gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (toolbar_recent_menu), + gedit_prefs_manager_get_max_recents ()); + + filter = gtk_recent_filter_new (); + gtk_recent_filter_add_group (filter, "gedit"); + gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (toolbar_recent_menu), + filter); + + g_signal_connect (toolbar_recent_menu, + "item_activated", + G_CALLBACK (recent_chooser_item_activated), + window); + + /* add the custom Open button to the toolbar */ + open_button = gtk_menu_tool_button_new_from_stock (GTK_STOCK_OPEN); + gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (open_button), + toolbar_recent_menu); + + gtk_tool_item_set_tooltip_text (open_button, _("Open a file")); + gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (open_button), + _("Open a recently used file")); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "FileOpen"); + g_object_set (action, + "is_important", TRUE, + "short_label", _("Open"), + NULL); + gtk_activatable_set_related_action (GTK_ACTIVATABLE (open_button), + action); + + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), + open_button, + 1); + + return toolbar_recent_menu; +} + +static void +create_menu_bar_and_toolbar (GeditWindow *window, + GtkWidget *main_box) +{ + GtkActionGroup *action_group; + GtkAction *action; + GtkUIManager *manager; + GtkRecentManager *recent_manager; + GError *error = NULL; + gchar *ui_file; + + gedit_debug (DEBUG_WINDOW); + + manager = gtk_ui_manager_new (); + window->priv->manager = manager; + + gtk_window_add_accel_group (GTK_WINDOW (window), + gtk_ui_manager_get_accel_group (manager)); + + action_group = gtk_action_group_new ("GeditWindowAlwaysSensitiveActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + gedit_always_sensitive_menu_entries, + G_N_ELEMENTS (gedit_always_sensitive_menu_entries), + window); + gtk_action_group_add_toggle_actions (action_group, + gedit_always_sensitive_toggle_menu_entries, + G_N_ELEMENTS (gedit_always_sensitive_toggle_menu_entries), + window); + + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + window->priv->always_sensitive_action_group = action_group; + + action_group = gtk_action_group_new ("GeditWindowActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + gedit_menu_entries, + G_N_ELEMENTS (gedit_menu_entries), + window); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + window->priv->action_group = action_group; + + /* set short labels to use in the toolbar */ + action = gtk_action_group_get_action (action_group, "FileSave"); + g_object_set (action, "short_label", _("Save"), NULL); + action = gtk_action_group_get_action (action_group, "FilePrint"); + g_object_set (action, "short_label", _("Print"), NULL); + action = gtk_action_group_get_action (action_group, "SearchFind"); + g_object_set (action, "short_label", _("Find"), NULL); + action = gtk_action_group_get_action (action_group, "SearchReplace"); + g_object_set (action, "short_label", _("Replace"), NULL); + + /* set which actions should have priority on the toolbar */ + action = gtk_action_group_get_action (action_group, "FileSave"); + g_object_set (action, "is_important", TRUE, NULL); + action = gtk_action_group_get_action (action_group, "EditUndo"); + g_object_set (action, "is_important", TRUE, NULL); + + action_group = gtk_action_group_new ("GeditQuitWindowActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + gedit_quit_menu_entries, + G_N_ELEMENTS (gedit_quit_menu_entries), + window); + + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + window->priv->quit_action_group = action_group; + + action_group = gtk_action_group_new ("GeditCloseWindowActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + gedit_close_menu_entries, + G_N_ELEMENTS (gedit_close_menu_entries), + window); + + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + window->priv->close_action_group = action_group; + + action_group = gtk_action_group_new ("GeditWindowPanesActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_toggle_actions (action_group, + gedit_panes_toggle_menu_entries, + G_N_ELEMENTS (gedit_panes_toggle_menu_entries), + window); + + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + window->priv->panes_action_group = action_group; + + /* now load the UI definition */ + ui_file = gedit_dirs_get_ui_file (GEDIT_UIFILE); + gtk_ui_manager_add_ui_from_file (manager, ui_file, &error); + if (error != NULL) + { + g_warning ("Could not merge %s: %s", ui_file, error->message); + g_error_free (error); + } + g_free (ui_file); + +#if !GTK_CHECK_VERSION (2, 17, 4) + /* merge page setup menu manually since we cannot have conditional + * sections in gedit-ui.xml */ + { + guint merge_id; + GeditLockdownMask lockdown; + + merge_id = gtk_ui_manager_new_merge_id (manager); + gtk_ui_manager_add_ui (manager, + merge_id, + "/MenuBar/FileMenu/FileOps_5", + "FilePageSetupMenu", + "FilePageSetup", + GTK_UI_MANAGER_MENUITEM, + FALSE); + + lockdown = gedit_app_get_lockdown (gedit_app_get_default ()); + action = gtk_action_group_get_action (window->priv->action_group, + "FilePageSetup"); + gtk_action_set_sensitive (action, + !(lockdown & GEDIT_LOCKDOWN_PRINT_SETUP)); + } +#endif + + /* show tooltips in the statusbar */ + g_signal_connect (manager, + "connect_proxy", + G_CALLBACK (connect_proxy_cb), + window); + g_signal_connect (manager, + "disconnect_proxy", + G_CALLBACK (disconnect_proxy_cb), + window); + + /* recent files menu */ + action_group = gtk_action_group_new ("RecentFilesActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + window->priv->recents_action_group = action_group; + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + + recent_manager = gtk_recent_manager_get_default (); + window->priv->recents_handler_id = g_signal_connect (recent_manager, + "changed", + G_CALLBACK (recent_manager_changed), + window); + update_recent_files_menu (window); + + /* languages menu */ + action_group = gtk_action_group_new ("LanguagesActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + window->priv->languages_action_group = action_group; + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + create_languages_menu (window); + + /* list of open documents menu */ + action_group = gtk_action_group_new ("DocumentsListActions"); + gtk_action_group_set_translation_domain (action_group, NULL); + window->priv->documents_list_action_group = action_group; + gtk_ui_manager_insert_action_group (manager, action_group, 0); + g_object_unref (action_group); + + window->priv->menubar = gtk_ui_manager_get_widget (manager, "/MenuBar"); + gtk_box_pack_start (GTK_BOX (main_box), + window->priv->menubar, + FALSE, + FALSE, + 0); + + window->priv->toolbar = gtk_ui_manager_get_widget (manager, "/ToolBar"); + gtk_box_pack_start (GTK_BOX (main_box), + window->priv->toolbar, + FALSE, + FALSE, + 0); + + set_toolbar_style (window, NULL); + + window->priv->toolbar_recent_menu = setup_toolbar_open_button (window, + window->priv->toolbar); + + gtk_container_foreach (GTK_CONTAINER (window->priv->toolbar), + (GtkCallback)set_non_homogeneus, + NULL); + + g_signal_connect_after (G_OBJECT (window->priv->toolbar), + "show", + G_CALLBACK (toolbar_visibility_changed), + window); + g_signal_connect_after (G_OBJECT (window->priv->toolbar), + "hide", + G_CALLBACK (toolbar_visibility_changed), + window); +} + +static void +documents_list_menu_activate (GtkToggleAction *action, + GeditWindow *window) +{ + gint n; + + if (gtk_toggle_action_get_active (action) == FALSE) + return; + + n = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action)); + gtk_notebook_set_current_page (GTK_NOTEBOOK (window->priv->notebook), n); +} + +static gchar * +get_menu_tip_for_tab (GeditTab *tab) +{ + GeditDocument *doc; + gchar *uri; + gchar *ruri; + gchar *tip; + + doc = gedit_tab_get_document (tab); + + uri = gedit_document_get_uri_for_display (doc); + ruri = gedit_utils_replace_home_dir_with_tilde (uri); + g_free (uri); + + /* Translators: %s is a URI */ + tip = g_strdup_printf (_("Activate '%s'"), ruri); + g_free (ruri); + + return tip; +} + +static void +update_documents_list_menu (GeditWindow *window) +{ + GeditWindowPrivate *p = window->priv; + GList *actions, *l; + gint n, i; + guint id; + GSList *group = NULL; + + gedit_debug (DEBUG_WINDOW); + + g_return_if_fail (p->documents_list_action_group != NULL); + + if (p->documents_list_menu_ui_id != 0) + gtk_ui_manager_remove_ui (p->manager, + p->documents_list_menu_ui_id); + + actions = gtk_action_group_list_actions (p->documents_list_action_group); + for (l = actions; l != NULL; l = l->next) + { + g_signal_handlers_disconnect_by_func (GTK_ACTION (l->data), + G_CALLBACK (documents_list_menu_activate), + window); + gtk_action_group_remove_action (p->documents_list_action_group, + GTK_ACTION (l->data)); + } + g_list_free (actions); + + n = gtk_notebook_get_n_pages (GTK_NOTEBOOK (p->notebook)); + + id = (n > 0) ? gtk_ui_manager_new_merge_id (p->manager) : 0; + + for (i = 0; i < n; i++) + { + GtkWidget *tab; + GtkRadioAction *action; + gchar *action_name; + gchar *tab_name; + gchar *name; + gchar *tip; + gchar *accel; + + tab = gtk_notebook_get_nth_page (GTK_NOTEBOOK (p->notebook), i); + + /* NOTE: the action is associated to the position of the tab in + * the notebook not to the tab itself! This is needed to work + * around the gtk+ bug #170727: gtk leaves around the accels + * of the action. Since the accel depends on the tab position + * the problem is worked around, action with the same name always + * get the same accel. + */ + action_name = g_strdup_printf ("Tab_%d", i); + tab_name = _gedit_tab_get_name (GEDIT_TAB (tab)); + name = gedit_utils_escape_underscores (tab_name, -1); + tip = get_menu_tip_for_tab (GEDIT_TAB (tab)); + + /* alt + 1, 2, 3... 0 to switch to the first ten tabs */ + accel = (i < 10) ? g_strdup_printf ("%d", (i + 1) % 10) : NULL; + + action = gtk_radio_action_new (action_name, + name, + tip, + NULL, + i); + + if (group != NULL) + gtk_radio_action_set_group (action, group); + + /* note that group changes each time we add an action, so it must be updated */ + group = gtk_radio_action_get_group (action); + + gtk_action_group_add_action_with_accel (p->documents_list_action_group, + GTK_ACTION (action), + accel); + + g_signal_connect (action, + "activate", + G_CALLBACK (documents_list_menu_activate), + window); + + gtk_ui_manager_add_ui (p->manager, + id, + "/MenuBar/DocumentsMenu/DocumentsListPlaceholder", + action_name, action_name, + GTK_UI_MANAGER_MENUITEM, + FALSE); + + if (GEDIT_TAB (tab) == p->active_tab) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); + + g_object_unref (action); + + g_free (action_name); + g_free (tab_name); + g_free (name); + g_free (tip); + g_free (accel); + } + + p->documents_list_menu_ui_id = id; +} + +/* Returns TRUE if status bar is visible */ +static gboolean +set_statusbar_style (GeditWindow *window, + GeditWindow *origin) +{ + GtkAction *action; + + gboolean visible; + + if (origin == NULL) + visible = gedit_prefs_manager_get_statusbar_visible (); + else + visible = GTK_WIDGET_VISIBLE (origin->priv->statusbar); + + if (visible) + gtk_widget_show (window->priv->statusbar); + else + gtk_widget_hide (window->priv->statusbar); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "ViewStatusbar"); + + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != visible) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible); + + return visible; +} + +static void +statusbar_visibility_changed (GtkWidget *statusbar, + GeditWindow *window) +{ + gboolean visible; + GtkAction *action; + + visible = GTK_WIDGET_VISIBLE (statusbar); + + if (gedit_prefs_manager_statusbar_visible_can_set ()) + gedit_prefs_manager_set_statusbar_visible (visible); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "ViewStatusbar"); + + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != visible) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible); +} + +static void +tab_width_combo_changed (GeditStatusComboBox *combo, + GtkMenuItem *item, + GeditWindow *window) +{ + GeditView *view; + guint width_data = 0; + + view = gedit_window_get_active_view (window); + + if (!view) + return; + + width_data = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), TAB_WIDTH_DATA)); + + if (width_data == 0) + return; + + g_signal_handler_block (view, window->priv->tab_width_id); + gtk_source_view_set_tab_width (GTK_SOURCE_VIEW (view), width_data); + g_signal_handler_unblock (view, window->priv->tab_width_id); +} + +static void +use_spaces_toggled (GtkCheckMenuItem *item, + GeditWindow *window) +{ + GeditView *view; + + view = gedit_window_get_active_view (window); + + g_signal_handler_block (view, window->priv->spaces_instead_of_tabs_id); + gtk_source_view_set_insert_spaces_instead_of_tabs ( + GTK_SOURCE_VIEW (view), + gtk_check_menu_item_get_active (item)); + g_signal_handler_unblock (view, window->priv->spaces_instead_of_tabs_id); +} + +static void +language_combo_changed (GeditStatusComboBox *combo, + GtkMenuItem *item, + GeditWindow *window) +{ + GeditDocument *doc; + GtkSourceLanguage *language; + + doc = gedit_window_get_active_document (window); + + if (!doc) + return; + + language = GTK_SOURCE_LANGUAGE (g_object_get_data (G_OBJECT (item), LANGUAGE_DATA)); + + g_signal_handler_block (doc, window->priv->language_changed_id); + gedit_document_set_language (doc, language); + g_signal_handler_unblock (doc, window->priv->language_changed_id); +} + +typedef struct +{ + const gchar *label; + guint width; +} TabWidthDefinition; + +static void +fill_tab_width_combo (GeditWindow *window) +{ + static TabWidthDefinition defs[] = { + {"2", 2}, + {"4", 4}, + {"8", 8}, + {"", 0}, /* custom size */ + {NULL, 0} + }; + + GeditStatusComboBox *combo = GEDIT_STATUS_COMBO_BOX (window->priv->tab_width_combo); + guint i = 0; + GtkWidget *item; + + while (defs[i].label != NULL) + { + item = gtk_menu_item_new_with_label (defs[i].label); + g_object_set_data (G_OBJECT (item), TAB_WIDTH_DATA, GINT_TO_POINTER (defs[i].width)); + + gedit_status_combo_box_add_item (combo, + GTK_MENU_ITEM (item), + defs[i].label); + + if (defs[i].width != 0) + gtk_widget_show (item); + + ++i; + } + + item = gtk_separator_menu_item_new (); + gedit_status_combo_box_add_item (combo, GTK_MENU_ITEM (item), NULL); + gtk_widget_show (item); + + item = gtk_check_menu_item_new_with_label (_("Use Spaces")); + gedit_status_combo_box_add_item (combo, GTK_MENU_ITEM (item), NULL); + gtk_widget_show (item); + + g_signal_connect (item, + "toggled", + G_CALLBACK (use_spaces_toggled), + window); +} + +static void +fill_language_combo (GeditWindow *window) +{ + GtkSourceLanguageManager *manager; + GSList *languages; + GSList *item; + GtkWidget *menu_item; + const gchar *name; + + manager = gedit_get_language_manager (); + languages = gedit_language_manager_list_languages_sorted (manager, FALSE); + + name = _("Plain Text"); + menu_item = gtk_menu_item_new_with_label (name); + gtk_widget_show (menu_item); + + g_object_set_data (G_OBJECT (menu_item), LANGUAGE_DATA, NULL); + gedit_status_combo_box_add_item (GEDIT_STATUS_COMBO_BOX (window->priv->language_combo), + GTK_MENU_ITEM (menu_item), + name); + + for (item = languages; item; item = item->next) + { + GtkSourceLanguage *lang = GTK_SOURCE_LANGUAGE (item->data); + + name = gtk_source_language_get_name (lang); + menu_item = gtk_menu_item_new_with_label (name); + gtk_widget_show (menu_item); + + g_object_set_data_full (G_OBJECT (menu_item), + LANGUAGE_DATA, + g_object_ref (lang), + (GDestroyNotify)g_object_unref); + + gedit_status_combo_box_add_item (GEDIT_STATUS_COMBO_BOX (window->priv->language_combo), + GTK_MENU_ITEM (menu_item), + name); + } + + g_slist_free (languages); +} + +static void +create_statusbar (GeditWindow *window, + GtkWidget *main_box) +{ + gedit_debug (DEBUG_WINDOW); + + window->priv->statusbar = gedit_statusbar_new (); + + window->priv->generic_message_cid = gtk_statusbar_get_context_id + (GTK_STATUSBAR (window->priv->statusbar), "generic_message"); + window->priv->tip_message_cid = gtk_statusbar_get_context_id + (GTK_STATUSBAR (window->priv->statusbar), "tip_message"); + + gtk_box_pack_end (GTK_BOX (main_box), + window->priv->statusbar, + FALSE, + TRUE, + 0); + + window->priv->tab_width_combo = gedit_status_combo_box_new (_("Tab Width")); + gtk_widget_show (window->priv->tab_width_combo); + gtk_box_pack_end (GTK_BOX (window->priv->statusbar), + window->priv->tab_width_combo, + FALSE, + TRUE, + 0); + + fill_tab_width_combo (window); + + g_signal_connect (G_OBJECT (window->priv->tab_width_combo), + "changed", + G_CALLBACK (tab_width_combo_changed), + window); + + window->priv->language_combo = gedit_status_combo_box_new (NULL); + gtk_widget_show (window->priv->language_combo); + gtk_box_pack_end (GTK_BOX (window->priv->statusbar), + window->priv->language_combo, + FALSE, + TRUE, + 0); + + fill_language_combo (window); + + g_signal_connect (G_OBJECT (window->priv->language_combo), + "changed", + G_CALLBACK (language_combo_changed), + window); + + g_signal_connect_after (G_OBJECT (window->priv->statusbar), + "show", + G_CALLBACK (statusbar_visibility_changed), + window); + g_signal_connect_after (G_OBJECT (window->priv->statusbar), + "hide", + G_CALLBACK (statusbar_visibility_changed), + window); + + set_statusbar_style (window, NULL); +} + +static GeditWindow * +clone_window (GeditWindow *origin) +{ + GeditWindow *window; + GdkScreen *screen; + GeditApp *app; + gint panel_page; + + gedit_debug (DEBUG_WINDOW); + + app = gedit_app_get_default (); + + screen = gtk_window_get_screen (GTK_WINDOW (origin)); + window = gedit_app_create_window (app, screen); + + if ((origin->priv->window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0) + { + gint w, h; + + gedit_prefs_manager_get_default_window_size (&w, &h); + gtk_window_set_default_size (GTK_WINDOW (window), w, h); + gtk_window_maximize (GTK_WINDOW (window)); + } + else + { + gtk_window_set_default_size (GTK_WINDOW (window), + origin->priv->width, + origin->priv->height); + + gtk_window_unmaximize (GTK_WINDOW (window)); + } + + if ((origin->priv->window_state & GDK_WINDOW_STATE_STICKY ) != 0) + gtk_window_stick (GTK_WINDOW (window)); + else + gtk_window_unstick (GTK_WINDOW (window)); + + /* set the panes size, the paned position will be set when + * they are mapped */ + window->priv->side_panel_size = origin->priv->side_panel_size; + window->priv->bottom_panel_size = origin->priv->bottom_panel_size; + + panel_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (origin->priv->side_panel)); + _gedit_panel_set_active_item_by_id (GEDIT_PANEL (window->priv->side_panel), + panel_page); + + panel_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (origin->priv->bottom_panel)); + _gedit_panel_set_active_item_by_id (GEDIT_PANEL (window->priv->bottom_panel), + panel_page); + + if (GTK_WIDGET_VISIBLE (origin->priv->side_panel)) + gtk_widget_show (window->priv->side_panel); + else + gtk_widget_hide (window->priv->side_panel); + + if (GTK_WIDGET_VISIBLE (origin->priv->bottom_panel)) + gtk_widget_show (window->priv->bottom_panel); + else + gtk_widget_hide (window->priv->bottom_panel); + + set_statusbar_style (window, origin); + set_toolbar_style (window, origin); + + return window; +} + +static void +update_cursor_position_statusbar (GtkTextBuffer *buffer, + GeditWindow *window) +{ + gint row, col; + GtkTextIter iter; + GtkTextIter start; + guint tab_size; + GeditView *view; + + gedit_debug (DEBUG_WINDOW); + + if (buffer != GTK_TEXT_BUFFER (gedit_window_get_active_document (window))) + return; + + view = gedit_window_get_active_view (window); + + gtk_text_buffer_get_iter_at_mark (buffer, + &iter, + gtk_text_buffer_get_insert (buffer)); + + row = gtk_text_iter_get_line (&iter); + + start = iter; + gtk_text_iter_set_line_offset (&start, 0); + col = 0; + + tab_size = gtk_source_view_get_tab_width (GTK_SOURCE_VIEW (view)); + + while (!gtk_text_iter_equal (&start, &iter)) + { + /* FIXME: Are we Unicode compliant here? */ + if (gtk_text_iter_get_char (&start) == '\t') + + col += (tab_size - (col % tab_size)); + else + ++col; + + gtk_text_iter_forward_char (&start); + } + + gedit_statusbar_set_cursor_position ( + GEDIT_STATUSBAR (window->priv->statusbar), + row + 1, + col + 1); +} + +static void +update_overwrite_mode_statusbar (GtkTextView *view, + GeditWindow *window) +{ + if (view != GTK_TEXT_VIEW (gedit_window_get_active_view (window))) + return; + + /* Note that we have to use !gtk_text_view_get_overwrite since we + are in the in the signal handler of "toggle overwrite" that is + G_SIGNAL_RUN_LAST + */ + gedit_statusbar_set_overwrite ( + GEDIT_STATUSBAR (window->priv->statusbar), + !gtk_text_view_get_overwrite (view)); +} + +#define MAX_TITLE_LENGTH 100 + +static void +set_title (GeditWindow *window) +{ + GeditDocument *doc = NULL; + gchar *name; + gchar *dirname = NULL; + gchar *title = NULL; + gint len; + + if (window->priv->active_tab == NULL) + { +#ifdef OS_OSX + gedit_osx_set_window_title (window, "gedit", NULL); +#else + gtk_window_set_title (GTK_WINDOW (window), "gedit"); +#endif + return; + } + + doc = gedit_tab_get_document (window->priv->active_tab); + g_return_if_fail (doc != NULL); + + name = gedit_document_get_short_name_for_display (doc); + + len = g_utf8_strlen (name, -1); + + /* if the name is awfully long, truncate it and be done with it, + * otherwise also show the directory (ellipsized if needed) + */ + if (len > MAX_TITLE_LENGTH) + { + gchar *tmp; + + tmp = gedit_utils_str_middle_truncate (name, + MAX_TITLE_LENGTH); + g_free (name); + name = tmp; + } + else + { + GFile *file; + + file = gedit_document_get_location (doc); + if (file != NULL) + { + gchar *str; + + str = gedit_utils_location_get_dirname_for_display (file); + g_object_unref (file); + + /* use the remaining space for the dir, but use a min of 20 chars + * so that we do not end up with a dirname like "(a...b)". + * This means that in the worst case when the filename is long 99 + * we have a title long 99 + 20, but I think it's a rare enough + * case to be acceptable. It's justa darn title afterall :) + */ + dirname = gedit_utils_str_middle_truncate (str, + MAX (20, MAX_TITLE_LENGTH - len)); + g_free (str); + } + } + + if (gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc))) + { + gchar *tmp_name; + + tmp_name = g_strdup_printf ("*%s", name); + g_free (name); + + name = tmp_name; + } + + if (gedit_document_get_readonly (doc)) + { + if (dirname != NULL) + title = g_strdup_printf ("%s [%s] (%s) - gedit", + name, + _("Read-Only"), + dirname); + else + title = g_strdup_printf ("%s [%s] - gedit", + name, + _("Read-Only")); + } + else + { + if (dirname != NULL) + title = g_strdup_printf ("%s (%s) - gedit", + name, + dirname); + else + title = g_strdup_printf ("%s - gedit", + name); + } + +#ifdef OS_OSX + gedit_osx_set_window_title (window, title, doc); +#else + gtk_window_set_title (GTK_WINDOW (window), title); +#endif + + g_free (dirname); + g_free (name); + g_free (title); +} + +#undef MAX_TITLE_LENGTH + +static void +set_tab_width_item_blocked (GeditWindow *window, + GtkMenuItem *item) +{ + g_signal_handlers_block_by_func (window->priv->tab_width_combo, + tab_width_combo_changed, + window); + + gedit_status_combo_box_set_item (GEDIT_STATUS_COMBO_BOX (window->priv->tab_width_combo), + item); + + g_signal_handlers_unblock_by_func (window->priv->tab_width_combo, + tab_width_combo_changed, + window); +} + +static void +spaces_instead_of_tabs_changed (GObject *object, + GParamSpec *pspec, + GeditWindow *window) +{ + GeditView *view = GEDIT_VIEW (object); + gboolean active = gtk_source_view_get_insert_spaces_instead_of_tabs ( + GTK_SOURCE_VIEW (view)); + GList *children = gedit_status_combo_box_get_items ( + GEDIT_STATUS_COMBO_BOX (window->priv->tab_width_combo)); + GtkCheckMenuItem *item; + + item = GTK_CHECK_MENU_ITEM (g_list_last (children)->data); + + gtk_check_menu_item_set_active (item, active); + + g_list_free (children); +} + +static void +tab_width_changed (GObject *object, + GParamSpec *pspec, + GeditWindow *window) +{ + GList *items; + GList *item; + GeditStatusComboBox *combo = GEDIT_STATUS_COMBO_BOX (window->priv->tab_width_combo); + guint new_tab_width; + gboolean found = FALSE; + + items = gedit_status_combo_box_get_items (combo); + + new_tab_width = gtk_source_view_get_tab_width (GTK_SOURCE_VIEW (object)); + + for (item = items; item; item = item->next) + { + guint tab_width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item->data), TAB_WIDTH_DATA)); + + if (tab_width == new_tab_width) + { + set_tab_width_item_blocked (window, GTK_MENU_ITEM (item->data)); + found = TRUE; + } + + if (GTK_IS_SEPARATOR_MENU_ITEM (item->next->data)) + { + if (!found) + { + /* Set for the last item the custom thing */ + gchar *text; + + text = g_strdup_printf ("%u", new_tab_width); + gedit_status_combo_box_set_item_text (combo, + GTK_MENU_ITEM (item->data), + text); + + gtk_label_set_text (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item->data))), + text); + + set_tab_width_item_blocked (window, GTK_MENU_ITEM (item->data)); + gtk_widget_show (GTK_WIDGET (item->data)); + } + else + { + gtk_widget_hide (GTK_WIDGET (item->data)); + } + + break; + } + } + + g_list_free (items); +} + +static void +language_changed (GObject *object, + GParamSpec *pspec, + GeditWindow *window) +{ + GList *items; + GList *item; + GeditStatusComboBox *combo = GEDIT_STATUS_COMBO_BOX (window->priv->language_combo); + GtkSourceLanguage *new_language; + const gchar *new_id; + + items = gedit_status_combo_box_get_items (combo); + + new_language = gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (object)); + + if (new_language) + new_id = gtk_source_language_get_id (new_language); + else + new_id = NULL; + + for (item = items; item; item = item->next) + { + GtkSourceLanguage *lang = g_object_get_data (G_OBJECT (item->data), LANGUAGE_DATA); + + if ((new_id == NULL && lang == NULL) || + (new_id != NULL && lang != NULL && strcmp (gtk_source_language_get_id (lang), + new_id) == 0)) + { + g_signal_handlers_block_by_func (window->priv->language_combo, + language_combo_changed, + window); + + gedit_status_combo_box_set_item (GEDIT_STATUS_COMBO_BOX (window->priv->language_combo), + GTK_MENU_ITEM (item->data)); + + g_signal_handlers_unblock_by_func (window->priv->language_combo, + language_combo_changed, + window); + } + } + + g_list_free (items); +} + +static void +notebook_switch_page (GtkNotebook *book, + GtkNotebookPage *pg, + gint page_num, + GeditWindow *window) +{ + GeditView *view; + GeditTab *tab; + GtkAction *action; + gchar *action_name; + + /* CHECK: I don't know why but it seems notebook_switch_page is called + two times every time the user change the active tab */ + + tab = GEDIT_TAB (gtk_notebook_get_nth_page (book, page_num)); + if (tab == window->priv->active_tab) + return; + + if (window->priv->active_tab) + { + if (window->priv->tab_width_id) + { + g_signal_handler_disconnect (gedit_tab_get_view (window->priv->active_tab), + window->priv->tab_width_id); + + window->priv->tab_width_id = 0; + } + + if (window->priv->spaces_instead_of_tabs_id) + { + g_signal_handler_disconnect (gedit_tab_get_view (window->priv->active_tab), + window->priv->spaces_instead_of_tabs_id); + + window->priv->spaces_instead_of_tabs_id = 0; + } + } + + /* set the active tab */ + window->priv->active_tab = tab; + + set_title (window); + set_sensitivity_according_to_tab (window, tab); + + /* activate the right item in the documents menu */ + action_name = g_strdup_printf ("Tab_%d", page_num); + action = gtk_action_group_get_action (window->priv->documents_list_action_group, + action_name); + + /* sometimes the action doesn't exist yet, and the proper action + * is set active during the documents list menu creation + * CHECK: would it be nicer if active_tab was a property and we monitored the notify signal? + */ + if (action != NULL) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); + + g_free (action_name); + + /* update the syntax menu */ + update_languages_menu (window); + + view = gedit_tab_get_view (tab); + + /* sync the statusbar */ + update_cursor_position_statusbar (GTK_TEXT_BUFFER (gedit_tab_get_document (tab)), + window); + gedit_statusbar_set_overwrite (GEDIT_STATUSBAR (window->priv->statusbar), + gtk_text_view_get_overwrite (GTK_TEXT_VIEW (view))); + + gtk_widget_show (window->priv->tab_width_combo); + gtk_widget_show (window->priv->language_combo); + + window->priv->tab_width_id = g_signal_connect (view, + "notify::tab-width", + G_CALLBACK (tab_width_changed), + window); + window->priv->spaces_instead_of_tabs_id = g_signal_connect (view, + "notify::insert-spaces-instead-of-tabs", + G_CALLBACK (spaces_instead_of_tabs_changed), + window); + + window->priv->language_changed_id = g_signal_connect (gedit_tab_get_document (tab), + "notify::language", + G_CALLBACK (language_changed), + window); + + /* call it for the first time */ + tab_width_changed (G_OBJECT (view), NULL, window); + spaces_instead_of_tabs_changed (G_OBJECT (view), NULL, window); + language_changed (G_OBJECT (gedit_tab_get_document (tab)), NULL, window); + + g_signal_emit (G_OBJECT (window), + signals[ACTIVE_TAB_CHANGED], + 0, + window->priv->active_tab); +} + +static void +set_sensitivity_according_to_window_state (GeditWindow *window) +{ + GtkAction *action; + GeditLockdownMask lockdown; + + lockdown = gedit_app_get_lockdown (gedit_app_get_default ()); + + /* We disable File->Quit/SaveAll/CloseAll while printing to avoid to have two + operations (save and print/print preview) that uses the message area at + the same time (may be we can remove this limitation in the future) */ + /* We disable File->Quit/CloseAll if state is saving since saving cannot be + cancelled (may be we can remove this limitation in the future) */ + gtk_action_group_set_sensitive (window->priv->quit_action_group, + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING) && + !(window->priv->state & GEDIT_WINDOW_STATE_PRINTING)); + + action = gtk_action_group_get_action (window->priv->action_group, + "FileCloseAll"); + gtk_action_set_sensitive (action, + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING) && + !(window->priv->state & GEDIT_WINDOW_STATE_PRINTING)); + + action = gtk_action_group_get_action (window->priv->action_group, + "FileSaveAll"); + gtk_action_set_sensitive (action, + !(window->priv->state & GEDIT_WINDOW_STATE_PRINTING) && + !(lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK)); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "FileNew"); + gtk_action_set_sensitive (action, + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION)); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "FileOpen"); + gtk_action_set_sensitive (action, + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION)); + + gtk_action_group_set_sensitive (window->priv->recents_action_group, + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION)); + + gedit_notebook_set_close_buttons_sensitive (GEDIT_NOTEBOOK (window->priv->notebook), + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION)); + + gedit_notebook_set_tab_drag_and_drop_enabled (GEDIT_NOTEBOOK (window->priv->notebook), + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION)); + + if ((window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION) != 0) + { + /* TODO: If we really care, Find could be active + * when in SAVING_SESSION state */ + + if (gtk_action_group_get_sensitive (window->priv->action_group)) + gtk_action_group_set_sensitive (window->priv->action_group, + FALSE); + if (gtk_action_group_get_sensitive (window->priv->quit_action_group)) + gtk_action_group_set_sensitive (window->priv->quit_action_group, + FALSE); + if (gtk_action_group_get_sensitive (window->priv->close_action_group)) + gtk_action_group_set_sensitive (window->priv->close_action_group, + FALSE); + } + else + { + if (!gtk_action_group_get_sensitive (window->priv->action_group)) + gtk_action_group_set_sensitive (window->priv->action_group, + window->priv->num_tabs > 0); + if (!gtk_action_group_get_sensitive (window->priv->quit_action_group)) + gtk_action_group_set_sensitive (window->priv->quit_action_group, + window->priv->num_tabs > 0); + if (!gtk_action_group_get_sensitive (window->priv->close_action_group)) + { +#ifdef OS_OSX + /* On OS X, File Close is always sensitive */ + gtk_action_group_set_sensitive (window->priv->close_action_group, + TRUE); +#else + gtk_action_group_set_sensitive (window->priv->close_action_group, + window->priv->num_tabs > 0); +#endif + } + } +} + +static void +update_tab_autosave (GtkWidget *widget, + gpointer data) +{ + GeditTab *tab = GEDIT_TAB (widget); + gboolean *enabled = (gboolean *) data; + + gedit_tab_set_auto_save_enabled (tab, *enabled); +} + +void +_gedit_window_set_lockdown (GeditWindow *window, + GeditLockdownMask lockdown) +{ + GeditTab *tab; + GtkAction *action; + gboolean autosave; + + /* start/stop autosave in each existing tab */ + autosave = gedit_prefs_manager_get_auto_save (); + gtk_container_foreach (GTK_CONTAINER (window->priv->notebook), + update_tab_autosave, + &autosave); + + /* update menues wrt the current active tab */ + tab = gedit_window_get_active_tab (window); + + set_sensitivity_according_to_tab (window, tab); + + action = gtk_action_group_get_action (window->priv->action_group, + "FileSaveAll"); + gtk_action_set_sensitive (action, + !(window->priv->state & GEDIT_WINDOW_STATE_PRINTING) && + !(lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK)); + +#if !GTK_CHECK_VERSION (2, 17, 4) + action = gtk_action_group_get_action (window->priv->action_group, + "FilePageSetup"); + gtk_action_set_sensitive (action, + !(lockdown & GEDIT_LOCKDOWN_PRINT_SETUP)); +#endif +} + +static void +analyze_tab_state (GeditTab *tab, + GeditWindow *window) +{ + GeditTabState ts; + + ts = gedit_tab_get_state (tab); + + switch (ts) + { + case GEDIT_TAB_STATE_LOADING: + case GEDIT_TAB_STATE_REVERTING: + window->priv->state |= GEDIT_WINDOW_STATE_LOADING; + break; + + case GEDIT_TAB_STATE_SAVING: + window->priv->state |= GEDIT_WINDOW_STATE_SAVING; + break; + + case GEDIT_TAB_STATE_PRINTING: + case GEDIT_TAB_STATE_PRINT_PREVIEWING: + window->priv->state |= GEDIT_WINDOW_STATE_PRINTING; + break; + + case GEDIT_TAB_STATE_LOADING_ERROR: + case GEDIT_TAB_STATE_REVERTING_ERROR: + case GEDIT_TAB_STATE_SAVING_ERROR: + case GEDIT_TAB_STATE_GENERIC_ERROR: + window->priv->state |= GEDIT_WINDOW_STATE_ERROR; + ++window->priv->num_tabs_with_error; + default: + /* NOP */ + break; + } +} + +static void +update_window_state (GeditWindow *window) +{ + GeditWindowState old_ws; + gint old_num_of_errors; + + gedit_debug_message (DEBUG_WINDOW, "Old state: %x", window->priv->state); + + old_ws = window->priv->state; + old_num_of_errors = window->priv->num_tabs_with_error; + + window->priv->state = old_ws & GEDIT_WINDOW_STATE_SAVING_SESSION; + + window->priv->num_tabs_with_error = 0; + + gtk_container_foreach (GTK_CONTAINER (window->priv->notebook), + (GtkCallback)analyze_tab_state, + window); + + gedit_debug_message (DEBUG_WINDOW, "New state: %x", window->priv->state); + + if (old_ws != window->priv->state) + { + set_sensitivity_according_to_window_state (window); + + gedit_statusbar_set_window_state (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->state, + window->priv->num_tabs_with_error); + + g_object_notify (G_OBJECT (window), "state"); + } + else if (old_num_of_errors != window->priv->num_tabs_with_error) + { + gedit_statusbar_set_window_state (GEDIT_STATUSBAR (window->priv->statusbar), + window->priv->state, + window->priv->num_tabs_with_error); + } +} + +static void +sync_state (GeditTab *tab, + GParamSpec *pspec, + GeditWindow *window) +{ + gedit_debug (DEBUG_WINDOW); + + update_window_state (window); + + if (tab != window->priv->active_tab) + return; + + set_sensitivity_according_to_tab (window, tab); + + g_signal_emit (G_OBJECT (window), signals[ACTIVE_TAB_STATE_CHANGED], 0); +} + +static void +sync_name (GeditTab *tab, + GParamSpec *pspec, + GeditWindow *window) +{ + GtkAction *action; + gchar *action_name; + gchar *tab_name; + gchar *escaped_name; + gchar *tip; + gint n; + GeditDocument *doc; + + if (tab == window->priv->active_tab) + { + set_title (window); + + doc = gedit_tab_get_document (tab); + action = gtk_action_group_get_action (window->priv->action_group, + "FileRevert"); + gtk_action_set_sensitive (action, + !gedit_document_is_untitled (doc)); + } + + /* sync the item in the documents list menu */ + n = gtk_notebook_page_num (GTK_NOTEBOOK (window->priv->notebook), + GTK_WIDGET (tab)); + action_name = g_strdup_printf ("Tab_%d", n); + action = gtk_action_group_get_action (window->priv->documents_list_action_group, + action_name); + g_return_if_fail (action != NULL); + + tab_name = _gedit_tab_get_name (tab); + escaped_name = gedit_utils_escape_underscores (tab_name, -1); + tip = get_menu_tip_for_tab (tab); + + g_object_set (action, "label", escaped_name, NULL); + g_object_set (action, "tooltip", tip, NULL); + + g_free (action_name); + g_free (tab_name); + g_free (escaped_name); + g_free (tip); + + gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (), + window); +} + +static GeditWindow * +get_drop_window (GtkWidget *widget) +{ + GtkWidget *target_window; + + target_window = gtk_widget_get_toplevel (widget); + g_return_val_if_fail (GEDIT_IS_WINDOW (target_window), NULL); + + if ((GEDIT_WINDOW(target_window)->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION) != 0) + return NULL; + + return GEDIT_WINDOW (target_window); +} + +static void +load_uris_from_drop (GeditWindow *window, + gchar **uri_list) +{ + GSList *uris = NULL; + gint i; + + if (uri_list == NULL) + return; + + for (i = 0; uri_list[i] != NULL; ++i) + { + uris = g_slist_prepend (uris, uri_list[i]); + } + + uris = g_slist_reverse (uris); + gedit_commands_load_uris (window, + uris, + NULL, + 0); + + g_slist_free (uris); +} + +/* Handle drops on the GeditWindow */ +static void +drag_data_received_cb (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint timestamp, + gpointer data) +{ + GeditWindow *window; + gchar **uri_list; + + window = get_drop_window (widget); + + if (window == NULL) + return; + + if (info == TARGET_URI_LIST) + { + uri_list = gedit_utils_drop_get_uris(selection_data); + load_uris_from_drop (window, uri_list); + g_strfreev (uri_list); + } +} + +/* Handle drops on the GeditView */ +static void +drop_uris_cb (GtkWidget *widget, + gchar **uri_list) +{ + GeditWindow *window; + + window = get_drop_window (widget); + + if (window == NULL) + return; + + load_uris_from_drop (window, uri_list); +} + +static void +fullscreen_controls_show (GeditWindow *window) +{ + GdkScreen *screen; + GdkRectangle fs_rect; + gint w, h; + + screen = gtk_window_get_screen (GTK_WINDOW (window)); + gdk_screen_get_monitor_geometry (screen, + gdk_screen_get_monitor_at_window (screen, + gtk_widget_get_window (GTK_WIDGET (window))), + &fs_rect); + + gtk_window_get_size (GTK_WINDOW (window->priv->fullscreen_controls), &w, &h); + + gtk_window_resize (GTK_WINDOW (window->priv->fullscreen_controls), + fs_rect.width, h); + + gtk_window_move (GTK_WINDOW (window->priv->fullscreen_controls), + fs_rect.x, fs_rect.y - h + 1); + + gtk_widget_show_all (window->priv->fullscreen_controls); +} + +static gboolean +run_fullscreen_animation (gpointer data) +{ + GeditWindow *window = GEDIT_WINDOW (data); + GdkScreen *screen; + GdkRectangle fs_rect; + gint x, y; + + screen = gtk_window_get_screen (GTK_WINDOW (window)); + gdk_screen_get_monitor_geometry (screen, + gdk_screen_get_monitor_at_window (screen, + gtk_widget_get_window (GTK_WIDGET (window))), + &fs_rect); + + gtk_window_get_position (GTK_WINDOW (window->priv->fullscreen_controls), + &x, &y); + + if (window->priv->fullscreen_animation_enter) + { + if (y == fs_rect.y) + { + window->priv->fullscreen_animation_timeout_id = 0; + return FALSE; + } + else + { + gtk_window_move (GTK_WINDOW (window->priv->fullscreen_controls), + x, y + 1); + return TRUE; + } + } + else + { + gint w, h; + + gtk_window_get_size (GTK_WINDOW (window->priv->fullscreen_controls), + &w, &h); + + if (y == fs_rect.y - h + 1) + { + window->priv->fullscreen_animation_timeout_id = 0; + return FALSE; + } + else + { + gtk_window_move (GTK_WINDOW (window->priv->fullscreen_controls), + x, y - 1); + return TRUE; + } + } +} + +static void +show_hide_fullscreen_toolbar (GeditWindow *window, + gboolean show, + gint height) +{ + GtkSettings *settings; + gboolean enable_animations; + + settings = gtk_widget_get_settings (GTK_WIDGET (window)); + g_object_get (G_OBJECT (settings), + "gtk-enable-animations", + &enable_animations, + NULL); + + if (enable_animations) + { + window->priv->fullscreen_animation_enter = show; + + if (window->priv->fullscreen_animation_timeout_id == 0) + { + window->priv->fullscreen_animation_timeout_id = + g_timeout_add (FULLSCREEN_ANIMATION_SPEED, + (GSourceFunc) run_fullscreen_animation, + window); + } + } + else + { + GdkRectangle fs_rect; + GdkScreen *screen; + + screen = gtk_window_get_screen (GTK_WINDOW (window)); + gdk_screen_get_monitor_geometry (screen, + gdk_screen_get_monitor_at_window (screen, + gtk_widget_get_window (GTK_WIDGET (window))), + &fs_rect); + + if (show) + gtk_window_move (GTK_WINDOW (window->priv->fullscreen_controls), + fs_rect.x, fs_rect.y); + else + gtk_window_move (GTK_WINDOW (window->priv->fullscreen_controls), + fs_rect.x, fs_rect.y - height + 1); + } + +} + +static gboolean +on_fullscreen_controls_enter_notify_event (GtkWidget *widget, + GdkEventCrossing *event, + GeditWindow *window) +{ + show_hide_fullscreen_toolbar (window, TRUE, 0); + + return FALSE; +} + +static gboolean +on_fullscreen_controls_leave_notify_event (GtkWidget *widget, + GdkEventCrossing *event, + GeditWindow *window) +{ + GdkDisplay *display; + GdkScreen *screen; + gint w, h; + gint x, y; + + display = gdk_display_get_default (); + screen = gtk_window_get_screen (GTK_WINDOW (window)); + + gtk_window_get_size (GTK_WINDOW (window->priv->fullscreen_controls), &w, &h); + gdk_display_get_pointer (display, &screen, &x, &y, NULL); + + /* gtk seems to emit leave notify when clicking on tool items, + * work around it by checking the coordinates + */ + if (y >= h) + { + show_hide_fullscreen_toolbar (window, FALSE, h); + } + + return FALSE; +} + +static void +fullscreen_controls_build (GeditWindow *window) +{ + GeditWindowPrivate *priv = window->priv; + GtkWidget *toolbar; + GtkWidget *toolbar_recent_menu; + GtkAction *action; + + if (priv->fullscreen_controls != NULL) + return; + + priv->fullscreen_controls = gtk_window_new (GTK_WINDOW_POPUP); + + gtk_window_set_transient_for (GTK_WINDOW (priv->fullscreen_controls), + &window->window); + + /* popup toolbar */ + toolbar = gtk_ui_manager_get_widget (priv->manager, "/FullscreenToolBar"); + gtk_container_add (GTK_CONTAINER (priv->fullscreen_controls), + toolbar); + + action = gtk_action_group_get_action (priv->always_sensitive_action_group, + "LeaveFullscreen"); + g_object_set (action, "is-important", TRUE, NULL); + + toolbar_recent_menu = setup_toolbar_open_button (window, toolbar); + + gtk_container_foreach (GTK_CONTAINER (toolbar), + (GtkCallback)set_non_homogeneus, + NULL); + + /* Set the toolbar style */ + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_BOTH_HORIZ); + + g_signal_connect (priv->fullscreen_controls, "enter-notify-event", + G_CALLBACK (on_fullscreen_controls_enter_notify_event), + window); + g_signal_connect (priv->fullscreen_controls, "leave-notify-event", + G_CALLBACK (on_fullscreen_controls_leave_notify_event), + window); +} + +static void +can_search_again (GeditDocument *doc, + GParamSpec *pspec, + GeditWindow *window) +{ + gboolean sensitive; + GtkAction *action; + + if (doc != gedit_window_get_active_document (window)) + return; + + sensitive = gedit_document_get_can_search_again (doc); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchFindNext"); + gtk_action_set_sensitive (action, sensitive); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchFindPrevious"); + gtk_action_set_sensitive (action, sensitive); + + action = gtk_action_group_get_action (window->priv->action_group, + "SearchClearHighlight"); + gtk_action_set_sensitive (action, sensitive); +} + +static void +can_undo (GeditDocument *doc, + GParamSpec *pspec, + GeditWindow *window) +{ + GtkAction *action; + gboolean sensitive; + + sensitive = gtk_source_buffer_can_undo (GTK_SOURCE_BUFFER (doc)); + + if (doc != gedit_window_get_active_document (window)) + return; + + action = gtk_action_group_get_action (window->priv->action_group, + "EditUndo"); + gtk_action_set_sensitive (action, sensitive); +} + +static void +can_redo (GeditDocument *doc, + GParamSpec *pspec, + GeditWindow *window) +{ + GtkAction *action; + gboolean sensitive; + + sensitive = gtk_source_buffer_can_redo (GTK_SOURCE_BUFFER (doc)); + + if (doc != gedit_window_get_active_document (window)) + return; + + action = gtk_action_group_get_action (window->priv->action_group, + "EditRedo"); + gtk_action_set_sensitive (action, sensitive); +} + +static void +selection_changed (GeditDocument *doc, + GParamSpec *pspec, + GeditWindow *window) +{ + GeditTab *tab; + GeditView *view; + GtkAction *action; + GeditTabState state; + gboolean state_normal; + gboolean editable; + + gedit_debug (DEBUG_WINDOW); + + if (doc != gedit_window_get_active_document (window)) + return; + + tab = gedit_tab_get_from_document (doc); + state = gedit_tab_get_state (tab); + state_normal = (state == GEDIT_TAB_STATE_NORMAL); + + view = gedit_tab_get_view (tab); + editable = gtk_text_view_get_editable (GTK_TEXT_VIEW (view)); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditCut"); + gtk_action_set_sensitive (action, + state_normal && + editable && + gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc))); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditCopy"); + gtk_action_set_sensitive (action, + (state_normal || + state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) && + gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc))); + + action = gtk_action_group_get_action (window->priv->action_group, + "EditDelete"); + gtk_action_set_sensitive (action, + state_normal && + editable && + gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc))); + + gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (), + window); +} + +static void +sync_languages_menu (GeditDocument *doc, + GParamSpec *pspec, + GeditWindow *window) +{ + update_languages_menu (window); + gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (), + window); +} + +static void +readonly_changed (GeditDocument *doc, + GParamSpec *pspec, + GeditWindow *window) +{ + set_sensitivity_according_to_tab (window, window->priv->active_tab); + + sync_name (window->priv->active_tab, NULL, window); + + gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (), + window); +} + +static void +editable_changed (GeditView *view, + GParamSpec *arg1, + GeditWindow *window) +{ + gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (), + window); +} + +static void +update_sensitivity_according_to_open_tabs (GeditWindow *window) +{ + GtkAction *action; + + /* Set sensitivity */ + gtk_action_group_set_sensitive (window->priv->action_group, + window->priv->num_tabs != 0); + + action = gtk_action_group_get_action (window->priv->action_group, + "DocumentsMoveToNewWindow"); + gtk_action_set_sensitive (action, + window->priv->num_tabs > 1); + + /* Do not set close action insensitive on OS X */ +#ifndef OS_OSX + gtk_action_group_set_sensitive (window->priv->close_action_group, + window->priv->num_tabs != 0); +#endif +} + +static void +notebook_tab_added (GeditNotebook *notebook, + GeditTab *tab, + GeditWindow *window) +{ + GeditView *view; + GeditDocument *doc; + + gedit_debug (DEBUG_WINDOW); + + g_return_if_fail ((window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION) == 0); + + ++window->priv->num_tabs; + + update_sensitivity_according_to_open_tabs (window); + + view = gedit_tab_get_view (tab); + doc = gedit_tab_get_document (tab); + + /* IMPORTANT: remember to disconnect the signal in notebook_tab_removed + * if a new signal is connected here */ + + g_signal_connect (tab, + "notify::name", + G_CALLBACK (sync_name), + window); + g_signal_connect (tab, + "notify::state", + G_CALLBACK (sync_state), + window); + + g_signal_connect (doc, + "cursor-moved", + G_CALLBACK (update_cursor_position_statusbar), + window); + g_signal_connect (doc, + "notify::can-search-again", + G_CALLBACK (can_search_again), + window); + g_signal_connect (doc, + "notify::can-undo", + G_CALLBACK (can_undo), + window); + g_signal_connect (doc, + "notify::can-redo", + G_CALLBACK (can_redo), + window); + g_signal_connect (doc, + "notify::has-selection", + G_CALLBACK (selection_changed), + window); + g_signal_connect (doc, + "notify::language", + G_CALLBACK (sync_languages_menu), + window); + g_signal_connect (doc, + "notify::read-only", + G_CALLBACK (readonly_changed), + window); + g_signal_connect (view, + "toggle_overwrite", + G_CALLBACK (update_overwrite_mode_statusbar), + window); + g_signal_connect (view, + "notify::editable", + G_CALLBACK (editable_changed), + window); + + update_documents_list_menu (window); + + g_signal_connect (view, + "drop_uris", + G_CALLBACK (drop_uris_cb), + NULL); + + update_window_state (window); + + g_signal_emit (G_OBJECT (window), signals[TAB_ADDED], 0, tab); +} + +static void +notebook_tab_removed (GeditNotebook *notebook, + GeditTab *tab, + GeditWindow *window) +{ + GeditView *view; + GeditDocument *doc; + + gedit_debug (DEBUG_WINDOW); + + g_return_if_fail ((window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION) == 0); + + --window->priv->num_tabs; + + view = gedit_tab_get_view (tab); + doc = gedit_tab_get_document (tab); + + g_signal_handlers_disconnect_by_func (tab, + G_CALLBACK (sync_name), + window); + g_signal_handlers_disconnect_by_func (tab, + G_CALLBACK (sync_state), + window); + g_signal_handlers_disconnect_by_func (doc, + G_CALLBACK (update_cursor_position_statusbar), + window); + g_signal_handlers_disconnect_by_func (doc, + G_CALLBACK (can_search_again), + window); + g_signal_handlers_disconnect_by_func (doc, + G_CALLBACK (can_undo), + window); + g_signal_handlers_disconnect_by_func (doc, + G_CALLBACK (can_redo), + window); + g_signal_handlers_disconnect_by_func (doc, + G_CALLBACK (selection_changed), + window); + g_signal_handlers_disconnect_by_func (doc, + G_CALLBACK (sync_languages_menu), + window); + g_signal_handlers_disconnect_by_func (doc, + G_CALLBACK (readonly_changed), + window); + g_signal_handlers_disconnect_by_func (view, + G_CALLBACK (update_overwrite_mode_statusbar), + window); + g_signal_handlers_disconnect_by_func (view, + G_CALLBACK (editable_changed), + window); + g_signal_handlers_disconnect_by_func (view, + G_CALLBACK (drop_uris_cb), + NULL); + + if (window->priv->tab_width_id && tab == gedit_window_get_active_tab (window)) + { + g_signal_handler_disconnect (view, window->priv->tab_width_id); + window->priv->tab_width_id = 0; + } + + if (window->priv->spaces_instead_of_tabs_id && tab == gedit_window_get_active_tab (window)) + { + g_signal_handler_disconnect (view, window->priv->spaces_instead_of_tabs_id); + window->priv->spaces_instead_of_tabs_id = 0; + } + + if (window->priv->language_changed_id && tab == gedit_window_get_active_tab (window)) + { + g_signal_handler_disconnect (doc, window->priv->language_changed_id); + window->priv->language_changed_id = 0; + } + + g_return_if_fail (window->priv->num_tabs >= 0); + if (window->priv->num_tabs == 0) + { + window->priv->active_tab = NULL; + + set_title (window); + + /* Remove line and col info */ + gedit_statusbar_set_cursor_position ( + GEDIT_STATUSBAR (window->priv->statusbar), + -1, + -1); + + gedit_statusbar_clear_overwrite ( + GEDIT_STATUSBAR (window->priv->statusbar)); + + /* hide the combos */ + gtk_widget_hide (window->priv->tab_width_combo); + gtk_widget_hide (window->priv->language_combo); + } + + if (!window->priv->removing_tabs) + { + update_documents_list_menu (window); + update_next_prev_doc_sensitivity_per_window (window); + } + else + { + if (window->priv->num_tabs == 0) + { + update_documents_list_menu (window); + update_next_prev_doc_sensitivity_per_window (window); + } + } + + update_sensitivity_according_to_open_tabs (window); + + if (window->priv->num_tabs == 0) + { + gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (), + window); + } + + update_window_state (window); + + g_signal_emit (G_OBJECT (window), signals[TAB_REMOVED], 0, tab); +} + +static void +notebook_tabs_reordered (GeditNotebook *notebook, + GeditWindow *window) +{ + update_documents_list_menu (window); + update_next_prev_doc_sensitivity_per_window (window); + + g_signal_emit (G_OBJECT (window), signals[TABS_REORDERED], 0); +} + +static void +notebook_tab_detached (GeditNotebook *notebook, + GeditTab *tab, + GeditWindow *window) +{ + GeditWindow *new_window; + + new_window = clone_window (window); + + gedit_notebook_move_tab (notebook, + GEDIT_NOTEBOOK (_gedit_window_get_notebook (new_window)), + tab, 0); + + gtk_window_set_position (GTK_WINDOW (new_window), + GTK_WIN_POS_MOUSE); + + gtk_widget_show (GTK_WIDGET (new_window)); +} + +static void +notebook_tab_close_request (GeditNotebook *notebook, + GeditTab *tab, + GtkWindow *window) +{ + /* Note: we are destroying the tab before the default handler + * seems to be ok, but we need to keep an eye on this. */ + _gedit_cmd_file_close_tab (tab, GEDIT_WINDOW (window)); +} + +static gboolean +show_notebook_popup_menu (GtkNotebook *notebook, + GeditWindow *window, + GdkEventButton *event) +{ + GtkWidget *menu; +// GtkAction *action; + + menu = gtk_ui_manager_get_widget (window->priv->manager, "/NotebookPopup"); + g_return_val_if_fail (menu != NULL, FALSE); + +// CHECK do we need this? +#if 0 + /* allow extensions to sync when showing the popup */ + action = gtk_action_group_get_action (window->priv->action_group, + "NotebookPopupAction"); + g_return_val_if_fail (action != NULL, FALSE); + gtk_action_activate (action); +#endif + if (event != NULL) + { + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, + NULL, NULL, + event->button, event->time); + } + else + { + GtkWidget *tab; + GtkWidget *tab_label; + + tab = GTK_WIDGET (gedit_window_get_active_tab (window)); + g_return_val_if_fail (tab != NULL, FALSE); + + tab_label = gtk_notebook_get_tab_label (notebook, tab); + + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, + gedit_utils_menu_position_under_widget, tab_label, + 0, gtk_get_current_event_time ()); + + gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE); + } + + return TRUE; +} + +static gboolean +notebook_button_press_event (GtkNotebook *notebook, + GdkEventButton *event, + GeditWindow *window) +{ + if (GDK_BUTTON_PRESS == event->type && 3 == event->button) + { + return show_notebook_popup_menu (notebook, window, event); + } + + return FALSE; +} + +static gboolean +notebook_popup_menu (GtkNotebook *notebook, + GeditWindow *window) +{ + /* Only respond if the notebook is the actual focus */ + if (GEDIT_IS_NOTEBOOK (gtk_window_get_focus (GTK_WINDOW (window)))) + { + return show_notebook_popup_menu (notebook, window, NULL); + } + + return FALSE; +} + +static void +side_panel_size_allocate (GtkWidget *widget, + GtkAllocation *allocation, + GeditWindow *window) +{ + window->priv->side_panel_size = allocation->width; +} + +static void +bottom_panel_size_allocate (GtkWidget *widget, + GtkAllocation *allocation, + GeditWindow *window) +{ + window->priv->bottom_panel_size = allocation->height; +} + +static void +hpaned_restore_position (GtkWidget *widget, + GeditWindow *window) +{ + gint pos; + + gedit_debug_message (DEBUG_WINDOW, + "Restoring hpaned position: side panel size %d", + window->priv->side_panel_size); + + pos = MAX (100, window->priv->side_panel_size); + gtk_paned_set_position (GTK_PANED (window->priv->hpaned), pos); + + /* start monitoring the size */ + g_signal_connect (window->priv->side_panel, + "size-allocate", + G_CALLBACK (side_panel_size_allocate), + window); + + /* run this only once */ + g_signal_handlers_disconnect_by_func (widget, hpaned_restore_position, window); +} + +static void +vpaned_restore_position (GtkWidget *widget, + GeditWindow *window) +{ + gint pos; + + gedit_debug_message (DEBUG_WINDOW, + "Restoring vpaned position: bottom panel size %d", + window->priv->bottom_panel_size); + + pos = widget->allocation.height - + MAX (50, window->priv->bottom_panel_size); + gtk_paned_set_position (GTK_PANED (window->priv->vpaned), pos); + + /* start monitoring the size */ + g_signal_connect (window->priv->bottom_panel, + "size-allocate", + G_CALLBACK (bottom_panel_size_allocate), + window); + + /* run this only once */ + g_signal_handlers_disconnect_by_func (widget, vpaned_restore_position, window); +} + +static void +side_panel_visibility_changed (GtkWidget *side_panel, + GeditWindow *window) +{ + gboolean visible; + GtkAction *action; + + visible = GTK_WIDGET_VISIBLE (side_panel); + + if (gedit_prefs_manager_side_pane_visible_can_set ()) + gedit_prefs_manager_set_side_pane_visible (visible); + + action = gtk_action_group_get_action (window->priv->panes_action_group, + "ViewSidePane"); + + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != visible) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible); + + /* focus the document */ + if (!visible && window->priv->active_tab != NULL) + gtk_widget_grab_focus (GTK_WIDGET ( + gedit_tab_get_view (GEDIT_TAB (window->priv->active_tab)))); +} + +static void +create_side_panel (GeditWindow *window) +{ + GtkWidget *documents_panel; + + gedit_debug (DEBUG_WINDOW); + + window->priv->side_panel = gedit_panel_new (GTK_ORIENTATION_VERTICAL); + + gtk_paned_pack1 (GTK_PANED (window->priv->hpaned), + window->priv->side_panel, + FALSE, + FALSE); + + g_signal_connect_after (window->priv->side_panel, + "show", + G_CALLBACK (side_panel_visibility_changed), + window); + g_signal_connect_after (window->priv->side_panel, + "hide", + G_CALLBACK (side_panel_visibility_changed), + window); + + documents_panel = gedit_documents_panel_new (window); + gedit_panel_add_item_with_stock_icon (GEDIT_PANEL (window->priv->side_panel), + documents_panel, + _("Documents"), + GTK_STOCK_FILE); +} + +static void +bottom_panel_visibility_changed (GeditPanel *bottom_panel, + GeditWindow *window) +{ + gboolean visible; + GtkAction *action; + + visible = GTK_WIDGET_VISIBLE (bottom_panel); + + if (gedit_prefs_manager_bottom_panel_visible_can_set ()) + gedit_prefs_manager_set_bottom_panel_visible (visible); + + action = gtk_action_group_get_action (window->priv->panes_action_group, + "ViewBottomPane"); + + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != visible) + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible); + + /* focus the document */ + if (!visible && window->priv->active_tab != NULL) + gtk_widget_grab_focus (GTK_WIDGET ( + gedit_tab_get_view (GEDIT_TAB (window->priv->active_tab)))); +} + +static void +bottom_panel_item_removed (GeditPanel *panel, + GtkWidget *item, + GeditWindow *window) +{ + if (gedit_panel_get_n_items (panel) == 0) + { + GtkAction *action; + + gtk_widget_hide (GTK_WIDGET (panel)); + + action = gtk_action_group_get_action (window->priv->panes_action_group, + "ViewBottomPane"); + gtk_action_set_sensitive (action, FALSE); + } +} + +static void +bottom_panel_item_added (GeditPanel *panel, + GtkWidget *item, + GeditWindow *window) +{ + /* if it's the first item added, set the menu item + * sensitive and if needed show the panel */ + if (gedit_panel_get_n_items (panel) == 1) + { + GtkAction *action; + gboolean show; + + action = gtk_action_group_get_action (window->priv->panes_action_group, + "ViewBottomPane"); + gtk_action_set_sensitive (action, TRUE); + + show = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + if (show) + gtk_widget_show (GTK_WIDGET (panel)); + } +} + +static void +create_bottom_panel (GeditWindow *window) +{ + gedit_debug (DEBUG_WINDOW); + + window->priv->bottom_panel = gedit_panel_new (GTK_ORIENTATION_HORIZONTAL); + + gtk_paned_pack2 (GTK_PANED (window->priv->vpaned), + window->priv->bottom_panel, + FALSE, + FALSE); + + g_signal_connect_after (window->priv->bottom_panel, + "show", + G_CALLBACK (bottom_panel_visibility_changed), + window); + g_signal_connect_after (window->priv->bottom_panel, + "hide", + G_CALLBACK (bottom_panel_visibility_changed), + window); +} + +static void +init_panels_visibility (GeditWindow *window) +{ + gint active_page; + + gedit_debug (DEBUG_WINDOW); + + /* side pane */ + active_page = gedit_prefs_manager_get_side_panel_active_page (); + _gedit_panel_set_active_item_by_id (GEDIT_PANEL (window->priv->side_panel), + active_page); + + if (gedit_prefs_manager_get_side_pane_visible ()) + { + gtk_widget_show (window->priv->side_panel); + } + + /* bottom pane, it can be empty */ + if (gedit_panel_get_n_items (GEDIT_PANEL (window->priv->bottom_panel)) > 0) + { + active_page = gedit_prefs_manager_get_bottom_panel_active_page (); + _gedit_panel_set_active_item_by_id (GEDIT_PANEL (window->priv->bottom_panel), + active_page); + + if (gedit_prefs_manager_get_bottom_panel_visible ()) + { + gtk_widget_show (window->priv->bottom_panel); + } + } + else + { + GtkAction *action; + action = gtk_action_group_get_action (window->priv->panes_action_group, + "ViewBottomPane"); + gtk_action_set_sensitive (action, FALSE); + } + + /* start track sensitivity after the initial state is set */ + window->priv->bottom_panel_item_removed_handler_id = + g_signal_connect (window->priv->bottom_panel, + "item_removed", + G_CALLBACK (bottom_panel_item_removed), + window); + + g_signal_connect (window->priv->bottom_panel, + "item_added", + G_CALLBACK (bottom_panel_item_added), + window); +} + +static void +clipboard_owner_change (GtkClipboard *clipboard, + GdkEventOwnerChange *event, + GeditWindow *window) +{ + set_paste_sensitivity_according_to_clipboard (window, + clipboard); +} + +static void +window_realized (GtkWidget *window, + gpointer *data) +{ + GtkClipboard *clipboard; + + clipboard = gtk_widget_get_clipboard (window, + GDK_SELECTION_CLIPBOARD); + + g_signal_connect (clipboard, + "owner_change", + G_CALLBACK (clipboard_owner_change), + window); +} + +static void +window_unrealized (GtkWidget *window, + gpointer *data) +{ + GtkClipboard *clipboard; + + clipboard = gtk_widget_get_clipboard (window, + GDK_SELECTION_CLIPBOARD); + + g_signal_handlers_disconnect_by_func (clipboard, + G_CALLBACK (clipboard_owner_change), + window); +} + +static void +check_window_is_active (GeditWindow *window, + GParamSpec *property, + gpointer useless) +{ + if (window->priv->window_state & GDK_WINDOW_STATE_FULLSCREEN) + { + if (gtk_window_is_active (GTK_WINDOW (window))) + { + gtk_widget_show (window->priv->fullscreen_controls); + } + else + { + gtk_widget_hide (window->priv->fullscreen_controls); + } + } +} + +#ifdef OS_OSX +static void +setup_mac_menu (GeditWindow *window) +{ + GtkAction *action; + + gtk_widget_hide (window->priv->menubar); + action = gtk_ui_manager_get_action (window->priv->manager, "/ui/MenuBar/HelpMenu/HelpAboutMenu"); + + gtk_action_set_label (action, _("About gedit")); + + ige_mac_menu_set_menu_bar (GTK_MENU_SHELL (window->priv->menubar)); + ige_mac_menu_set_quit_menu_item (ui_manager_menu_item (window->priv->manager, "/ui/MenuBar/FileMenu/FileQuitMenu")); + + ige_mac_menu_set_preferences_menu_item (ui_manager_menu_item (window->priv->manager, "/ui/MenuBar/EditMenu/EditPreferencesMenu")); + + add_mac_root_menu (window); + ige_mac_menu_connect_window_key_handler (GTK_WINDOW (window)); +} +#endif + +static void +connect_notebook_signals (GeditWindow *window, + GtkWidget *notebook) +{ + g_signal_connect (notebook, + "switch-page", + G_CALLBACK (notebook_switch_page), + window); + g_signal_connect (notebook, + "tab-added", + G_CALLBACK (notebook_tab_added), + window); + g_signal_connect (notebook, + "tab-removed", + G_CALLBACK (notebook_tab_removed), + window); + g_signal_connect (notebook, + "tabs-reordered", + G_CALLBACK (notebook_tabs_reordered), + window); + g_signal_connect (notebook, + "tab-detached", + G_CALLBACK (notebook_tab_detached), + window); + g_signal_connect (notebook, + "tab-close-request", + G_CALLBACK (notebook_tab_close_request), + window); + g_signal_connect (notebook, + "button-press-event", + G_CALLBACK (notebook_button_press_event), + window); + g_signal_connect (notebook, + "popup-menu", + G_CALLBACK (notebook_popup_menu), + window); +} + +static void +add_notebook (GeditWindow *window, + GtkWidget *notebook) +{ + gtk_paned_pack1 (GTK_PANED (window->priv->vpaned), + notebook, + TRUE, + TRUE); + + gtk_widget_show (notebook); + + connect_notebook_signals (window, notebook); +} + +static void +gedit_window_init (GeditWindow *window) +{ + GtkWidget *main_box; + GtkTargetList *tl; + + gedit_debug (DEBUG_WINDOW); + + window->priv = GEDIT_WINDOW_GET_PRIVATE (window); + window->priv->active_tab = NULL; + window->priv->num_tabs = 0; + window->priv->removing_tabs = FALSE; + window->priv->state = GEDIT_WINDOW_STATE_NORMAL; + window->priv->dispose_has_run = FALSE; + window->priv->fullscreen_controls = NULL; + window->priv->fullscreen_animation_timeout_id = 0; + + window->priv->message_bus = gedit_message_bus_new (); + + window->priv->window_group = gtk_window_group_new (); + gtk_window_group_add_window (window->priv->window_group, GTK_WINDOW (window)); + + main_box = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (window), main_box); + gtk_widget_show (main_box); + + /* Add menu bar and toolbar bar */ + create_menu_bar_and_toolbar (window, main_box); + + /* Add status bar */ + create_statusbar (window, main_box); + + /* Add the main area */ + gedit_debug_message (DEBUG_WINDOW, "Add main area"); + window->priv->hpaned = gtk_hpaned_new (); + gtk_box_pack_start (GTK_BOX (main_box), + window->priv->hpaned, + TRUE, + TRUE, + 0); + + window->priv->vpaned = gtk_vpaned_new (); + gtk_paned_pack2 (GTK_PANED (window->priv->hpaned), + window->priv->vpaned, + TRUE, + FALSE); + + gedit_debug_message (DEBUG_WINDOW, "Create gedit notebook"); + window->priv->notebook = gedit_notebook_new (); + add_notebook (window, window->priv->notebook); + + /* side and bottom panels */ + create_side_panel (window); + create_bottom_panel (window); + + /* panes' state must be restored after panels have been mapped, + * since the bottom pane position depends on the size of the vpaned. */ + window->priv->side_panel_size = gedit_prefs_manager_get_side_panel_size (); + window->priv->bottom_panel_size = gedit_prefs_manager_get_bottom_panel_size (); + + g_signal_connect_after (window->priv->hpaned, + "map", + G_CALLBACK (hpaned_restore_position), + window); + g_signal_connect_after (window->priv->vpaned, + "map", + G_CALLBACK (vpaned_restore_position), + window); + + gtk_widget_show (window->priv->hpaned); + gtk_widget_show (window->priv->vpaned); + + /* Drag and drop support, set targets to NULL because we add the + default uri_targets below */ + gtk_drag_dest_set (GTK_WIDGET (window), + GTK_DEST_DEFAULT_MOTION | + GTK_DEST_DEFAULT_HIGHLIGHT | + GTK_DEST_DEFAULT_DROP, + NULL, + 0, + GDK_ACTION_COPY); + + /* Add uri targets */ + tl = gtk_drag_dest_get_target_list (GTK_WIDGET (window)); + + if (tl == NULL) + { + tl = gtk_target_list_new (NULL, 0); + gtk_drag_dest_set_target_list (GTK_WIDGET (window), tl); + gtk_target_list_unref (tl); + } + + gtk_target_list_add_uri_targets (tl, TARGET_URI_LIST); + + /* connect instead of override, so that we can + * share the cb code with the view */ + g_signal_connect (window, + "drag_data_received", + G_CALLBACK (drag_data_received_cb), + NULL); + + /* we can get the clipboard only after the widget + * is realized */ + g_signal_connect (window, + "realize", + G_CALLBACK (window_realized), + NULL); + g_signal_connect (window, + "unrealize", + G_CALLBACK (window_unrealized), + NULL); + + /* Check if the window is active for fullscreen */ + g_signal_connect (window, + "notify::is-active", + G_CALLBACK (check_window_is_active), + NULL); + + gedit_debug_message (DEBUG_WINDOW, "Update plugins ui"); + + gedit_plugins_engine_activate_plugins (gedit_plugins_engine_get_default (), + window); + + /* set visibility of panes. + * This needs to be done after plugins activatation */ + init_panels_visibility (window); + + update_sensitivity_according_to_open_tabs (window); + +#ifdef OS_OSX + setup_mac_menu (window); +#endif + + gedit_debug_message (DEBUG_WINDOW, "END"); +} + +/** + * gedit_window_get_active_view: + * @window: a #GeditWindow + * + * Gets the active #GeditView. + * + * Returns: the active #GeditView + */ +GeditView * +gedit_window_get_active_view (GeditWindow *window) +{ + GeditView *view; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + if (window->priv->active_tab == NULL) + return NULL; + + view = gedit_tab_get_view (GEDIT_TAB (window->priv->active_tab)); + + return view; +} + +/** + * gedit_window_get_active_document: + * @window: a #GeditWindow + * + * Gets the active #GeditDocument. + * + * Returns: the active #GeditDocument + */ +GeditDocument * +gedit_window_get_active_document (GeditWindow *window) +{ + GeditView *view; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + view = gedit_window_get_active_view (window); + if (view == NULL) + return NULL; + + return GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); +} + +GtkWidget * +_gedit_window_get_notebook (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return window->priv->notebook; +} + +/** + * gedit_window_create_tab: + * @window: a #GeditWindow + * @jump_to: %TRUE to set the new #GeditTab as active + * + * Creates a new #GeditTab and adds the new tab to the #GeditNotebook. + * In case @jump_to is %TRUE the #GeditNotebook switches to that new #GeditTab. + * + * Returns: a new #GeditTab + */ +GeditTab * +gedit_window_create_tab (GeditWindow *window, + gboolean jump_to) +{ + GeditTab *tab; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + tab = GEDIT_TAB (_gedit_tab_new ()); + gtk_widget_show (GTK_WIDGET (tab)); + + gedit_notebook_add_tab (GEDIT_NOTEBOOK (window->priv->notebook), + tab, + -1, + jump_to); + + if (!GTK_WIDGET_VISIBLE (window)) + { + gtk_window_present (GTK_WINDOW (window)); + } + + return tab; +} + +/** + * gedit_window_create_tab_from_uri: + * @window: a #GeditWindow + * @uri: the uri of the document + * @encoding: a #GeditEncoding + * @line_pos: the line position to visualize + * @create: %TRUE to create a new document in case @uri does exist + * @jump_to: %TRUE to set the new #GeditTab as active + * + * Creates a new #GeditTab loading the document specified by @uri. + * In case @jump_to is %TRUE the #GeditNotebook swithes to that new #GeditTab. + * Whether @create is %TRUE, creates a new empty document if location does + * not refer to an existing file + * + * Returns: a new #GeditTab + */ +GeditTab * +gedit_window_create_tab_from_uri (GeditWindow *window, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create, + gboolean jump_to) +{ + GtkWidget *tab; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + g_return_val_if_fail (uri != NULL, NULL); + + tab = _gedit_tab_new_from_uri (uri, + encoding, + line_pos, + create); + if (tab == NULL) + return NULL; + + gtk_widget_show (tab); + + gedit_notebook_add_tab (GEDIT_NOTEBOOK (window->priv->notebook), + GEDIT_TAB (tab), + -1, + jump_to); + + + if (!GTK_WIDGET_VISIBLE (window)) + { + gtk_window_present (GTK_WINDOW (window)); + } + + return GEDIT_TAB (tab); +} + +/** + * gedit_window_get_active_tab: + * @window: a GeditWindow + * + * Gets the active #GeditTab in the @window. + * + * Returns: the active #GeditTab in the @window. + */ +GeditTab * +gedit_window_get_active_tab (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return (window->priv->active_tab == NULL) ? + NULL : GEDIT_TAB (window->priv->active_tab); +} + +static void +add_document (GeditTab *tab, GList **res) +{ + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + + *res = g_list_prepend (*res, doc); +} + +/** + * gedit_window_get_documents: + * @window: a #GeditWindow + * + * Gets a newly allocated list with all the documents in the window. + * This list must be freed. + * + * Returns: a newly allocated list with all the documents in the window + */ +GList * +gedit_window_get_documents (GeditWindow *window) +{ + GList *res = NULL; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + gtk_container_foreach (GTK_CONTAINER (window->priv->notebook), + (GtkCallback)add_document, + &res); + + res = g_list_reverse (res); + + return res; +} + +static void +add_view (GeditTab *tab, GList **res) +{ + GeditView *view; + + view = gedit_tab_get_view (tab); + + *res = g_list_prepend (*res, view); +} + +/** + * gedit_window_get_views: + * @window: a #GeditWindow + * + * Gets a list with all the views in the window. This list must be freed. + * + * Returns: a newly allocated list with all the views in the window + */ +GList * +gedit_window_get_views (GeditWindow *window) +{ + GList *res = NULL; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + gtk_container_foreach (GTK_CONTAINER (window->priv->notebook), + (GtkCallback)add_view, + &res); + + res = g_list_reverse (res); + + return res; +} + +/** + * gedit_window_close_tab: + * @window: a #GeditWindow + * @tab: the #GeditTab to close + * + * Closes the @tab. + */ +void +gedit_window_close_tab (GeditWindow *window, + GeditTab *tab) +{ + g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (GEDIT_IS_TAB (tab)); + g_return_if_fail ((gedit_tab_get_state (tab) != GEDIT_TAB_STATE_SAVING) && + (gedit_tab_get_state (tab) != GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)); + + gedit_notebook_remove_tab (GEDIT_NOTEBOOK (window->priv->notebook), + tab); +} + +/** + * gedit_window_close_all_tabs: + * @window: a #GeditWindow + * + * Closes all opened tabs. + */ +void +gedit_window_close_all_tabs (GeditWindow *window) +{ + g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (!(window->priv->state & GEDIT_WINDOW_STATE_SAVING) && + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION)); + + window->priv->removing_tabs = TRUE; + + gedit_notebook_remove_all_tabs (GEDIT_NOTEBOOK (window->priv->notebook)); + + window->priv->removing_tabs = FALSE; +} + +/** + * gedit_window_close_tabs: + * @window: a #GeditWindow + * @tabs: a list of #GeditTab + * + * Closes all tabs specified by @tabs. + */ +void +gedit_window_close_tabs (GeditWindow *window, + const GList *tabs) +{ + g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (!(window->priv->state & GEDIT_WINDOW_STATE_SAVING) && + !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION)); + + if (tabs == NULL) + return; + + window->priv->removing_tabs = TRUE; + + while (tabs != NULL) + { + if (tabs->next == NULL) + window->priv->removing_tabs = FALSE; + + gedit_notebook_remove_tab (GEDIT_NOTEBOOK (window->priv->notebook), + GEDIT_TAB (tabs->data)); + + tabs = g_list_next (tabs); + } + + g_return_if_fail (window->priv->removing_tabs == FALSE); +} + +GeditWindow * +_gedit_window_move_tab_to_new_window (GeditWindow *window, + GeditTab *tab) +{ + GeditWindow *new_window; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + g_return_val_if_fail (GEDIT_IS_TAB (tab), NULL); + g_return_val_if_fail (gtk_notebook_get_n_pages ( + GTK_NOTEBOOK (window->priv->notebook)) > 1, + NULL); + + new_window = clone_window (window); + + gedit_notebook_move_tab (GEDIT_NOTEBOOK (window->priv->notebook), + GEDIT_NOTEBOOK (new_window->priv->notebook), + tab, + -1); + + gtk_widget_show (GTK_WIDGET (new_window)); + + return new_window; +} + +/** + * gedit_window_set_active_tab: + * @window: a #GeditWindow + * @tab: a #GeditTab + * + * Switches to the tab that matches with @tab. + */ +void +gedit_window_set_active_tab (GeditWindow *window, + GeditTab *tab) +{ + gint page_num; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (GEDIT_IS_TAB (tab)); + + page_num = gtk_notebook_page_num (GTK_NOTEBOOK (window->priv->notebook), + GTK_WIDGET (tab)); + g_return_if_fail (page_num != -1); + + gtk_notebook_set_current_page (GTK_NOTEBOOK (window->priv->notebook), + page_num); +} + +/** + * gedit_window_get_group: + * @window: a #GeditWindow + * + * Gets the #GtkWindowGroup in which @window resides. + * + * Returns: the #GtkWindowGroup + */ +GtkWindowGroup * +gedit_window_get_group (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return window->priv->window_group; +} + +gboolean +_gedit_window_is_removing_tabs (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), FALSE); + + return window->priv->removing_tabs; +} + +/** + * gedit_window_get_ui_manager: + * @window: a #GeditWindow + * + * Gets the #GtkUIManager associated with the @window. + * + * Returns: the #GtkUIManager of the @window. + */ +GtkUIManager * +gedit_window_get_ui_manager (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return window->priv->manager; +} + +/** + * gedit_window_get_side_panel: + * @window: a #GeditWindow + * + * Gets the side #GeditPanel of the @window. + * + * Returns: the side #GeditPanel. + */ +GeditPanel * +gedit_window_get_side_panel (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return GEDIT_PANEL (window->priv->side_panel); +} + +/** + * gedit_window_get_bottom_panel: + * @window: a #GeditWindow + * + * Gets the bottom #GeditPanel of the @window. + * + * Returns: the bottom #GeditPanel. + */ +GeditPanel * +gedit_window_get_bottom_panel (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return GEDIT_PANEL (window->priv->bottom_panel); +} + +/** + * gedit_window_get_statusbar: + * @window: a #GeditWindow + * + * Gets the #GeditStatusbar of the @window. + * + * Returns: the #GeditStatusbar of the @window. + */ +GtkWidget * +gedit_window_get_statusbar (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), 0); + + return window->priv->statusbar; +} + +/** + * gedit_window_get_state: + * @window: a #GeditWindow + * + * Retrieves the state of the @window. + * + * Returns: the current #GeditWindowState of the @window. + */ +GeditWindowState +gedit_window_get_state (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), GEDIT_WINDOW_STATE_NORMAL); + + return window->priv->state; +} + +GFile * +_gedit_window_get_default_location (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return window->priv->default_location != NULL ? + g_object_ref (window->priv->default_location) : NULL; +} + +void +_gedit_window_set_default_location (GeditWindow *window, + GFile *location) +{ + GFile *dir; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + g_return_if_fail (G_IS_FILE (location)); + + dir = g_file_get_parent (location); + g_return_if_fail (dir != NULL); + + if (window->priv->default_location != NULL) + g_object_unref (window->priv->default_location); + + window->priv->default_location = dir; +} + +/** + * gedit_window_get_unsaved_documents: + * @window: a #GeditWindow + * + * Gets the list of documents that need to be saved before closing the window. + * + * Returns: a list of #GeditDocument that need to be saved before closing the window + */ +GList * +gedit_window_get_unsaved_documents (GeditWindow *window) +{ + GList *unsaved_docs = NULL; + GList *tabs; + GList *l; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + tabs = gtk_container_get_children (GTK_CONTAINER (window->priv->notebook)); + + l = tabs; + while (l != NULL) + { + GeditTab *tab; + + tab = GEDIT_TAB (l->data); + + if (!_gedit_tab_can_close (tab)) + { + GeditDocument *doc; + + doc = gedit_tab_get_document (tab); + unsaved_docs = g_list_prepend (unsaved_docs, doc); + } + + l = g_list_next (l); + } + + g_list_free (tabs); + + return g_list_reverse (unsaved_docs); +} + +void +_gedit_window_set_saving_session_state (GeditWindow *window, + gboolean saving_session) +{ + GeditWindowState old_state; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + old_state = window->priv->state; + + if (saving_session) + window->priv->state |= GEDIT_WINDOW_STATE_SAVING_SESSION; + else + window->priv->state &= ~GEDIT_WINDOW_STATE_SAVING_SESSION; + + if (old_state != window->priv->state) + { + set_sensitivity_according_to_window_state (window); + + g_object_notify (G_OBJECT (window), "state"); + } +} + +static void +hide_notebook_tabs_on_fullscreen (GtkNotebook *notebook, + GParamSpec *pspec, + GeditWindow *window) +{ + gtk_notebook_set_show_tabs (notebook, FALSE); +} + +void +_gedit_window_fullscreen (GeditWindow *window) +{ + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + if (_gedit_window_is_fullscreen (window)) + return; + + /* Go to fullscreen mode and hide bars */ + gtk_window_fullscreen (&window->window); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->priv->notebook), FALSE); + g_signal_connect (window->priv->notebook, "notify::show-tabs", + G_CALLBACK (hide_notebook_tabs_on_fullscreen), window); + + gtk_widget_hide (window->priv->menubar); + + g_signal_handlers_block_by_func (window->priv->toolbar, + toolbar_visibility_changed, + window); + gtk_widget_hide (window->priv->toolbar); + + g_signal_handlers_block_by_func (window->priv->statusbar, + statusbar_visibility_changed, + window); + gtk_widget_hide (window->priv->statusbar); + + fullscreen_controls_build (window); + fullscreen_controls_show (window); +} + +void +_gedit_window_unfullscreen (GeditWindow *window) +{ + gboolean visible; + GtkAction *action; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + if (!_gedit_window_is_fullscreen (window)) + return; + + /* Unfullscreen and show bars */ + gtk_window_unfullscreen (&window->window); + g_signal_handlers_disconnect_by_func (window->priv->notebook, + hide_notebook_tabs_on_fullscreen, + window); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->priv->notebook), TRUE); + gtk_widget_show (window->priv->menubar); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "ViewToolbar"); + visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + if (visible) + gtk_widget_show (window->priv->toolbar); + g_signal_handlers_unblock_by_func (window->priv->toolbar, + toolbar_visibility_changed, + window); + + action = gtk_action_group_get_action (window->priv->always_sensitive_action_group, + "ViewStatusbar"); + visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + if (visible) + gtk_widget_show (window->priv->statusbar); + g_signal_handlers_unblock_by_func (window->priv->statusbar, + statusbar_visibility_changed, + window); + + gtk_widget_hide (window->priv->fullscreen_controls); +} + +gboolean +_gedit_window_is_fullscreen (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), FALSE); + + return window->priv->window_state & GDK_WINDOW_STATE_FULLSCREEN; +} + +/** + * gedit_window_get_tab_from_location: + * @window: a #GeditWindow + * @location: a #GFile + * + * Gets the #GeditTab that matches with the given @location. + * + * Returns: the #GeditTab that matches with the given @location. + */ +GeditTab * +gedit_window_get_tab_from_location (GeditWindow *window, + GFile *location) +{ + GList *tabs; + GList *l; + GeditTab *ret = NULL; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + g_return_val_if_fail (G_IS_FILE (location), NULL); + + tabs = gtk_container_get_children (GTK_CONTAINER (window->priv->notebook)); + + for (l = tabs; l != NULL; l = g_list_next (l)) + { + GeditDocument *d; + GeditTab *t; + GFile *f; + + t = GEDIT_TAB (l->data); + d = gedit_tab_get_document (t); + + f = gedit_document_get_location (d); + + if ((f != NULL)) + { + gboolean found = g_file_equal (location, f); + + g_object_unref (f); + + if (found) + { + ret = t; + break; + } + } + } + + g_list_free (tabs); + + return ret; +} + +/** + * gedit_window_get_message_bus: + * @window: a #GeditWindow + * + * Gets the #GeditMessageBus associated with @window. The returned reference + * is owned by the window and should not be unreffed. + * + * Return value: the #GeditMessageBus associated with @window + */ +GeditMessageBus * +gedit_window_get_message_bus (GeditWindow *window) +{ + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + + return window->priv->message_bus; +} + +/** + * gedit_window_get_tab_from_uri: + * @window: a #GeditWindow + * @uri: the uri to get the #GeditTab + * + * Gets the #GeditTab that matches @uri. + * + * Returns: the #GeditTab associated with @uri. + * + * Deprecated: 2.24: Use gedit_window_get_tab_from_location() instead. + */ +GeditTab * +gedit_window_get_tab_from_uri (GeditWindow *window, + const gchar *uri) +{ + GFile *f; + GeditTab *tab; + + g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL); + g_return_val_if_fail (uri != NULL, NULL); + + f = g_file_new_for_uri (uri); + tab = gedit_window_get_tab_from_location (window, f); + g_object_unref (f); + + return tab; +} diff --git a/gedit/gedit-window.h b/gedit/gedit-window.h new file mode 100755 index 00000000..e8c7eef3 --- /dev/null +++ b/gedit/gedit-window.h @@ -0,0 +1,195 @@ +/* + * gedit-window.h + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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 + * MERCHANWINDOWILITY 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifndef __GEDIT_WINDOW_H__ +#define __GEDIT_WINDOW_H__ + +#include +#include + +#include +#include +#include + +G_BEGIN_DECLS + +typedef enum +{ + GEDIT_WINDOW_STATE_NORMAL = 0, + GEDIT_WINDOW_STATE_SAVING = 1 << 1, + GEDIT_WINDOW_STATE_PRINTING = 1 << 2, + GEDIT_WINDOW_STATE_LOADING = 1 << 3, + GEDIT_WINDOW_STATE_ERROR = 1 << 4, + GEDIT_WINDOW_STATE_SAVING_SESSION = 1 << 5 +} GeditWindowState; + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_WINDOW (gedit_window_get_type()) +#define GEDIT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_WINDOW, GeditWindow)) +#define GEDIT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_WINDOW, GeditWindowClass)) +#define GEDIT_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_WINDOW)) +#define GEDIT_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_WINDOW)) +#define GEDIT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_WINDOW, GeditWindowClass)) + +/* Private structure type */ +typedef struct _GeditWindowPrivate GeditWindowPrivate; + +/* + * Main object structure + */ +typedef struct _GeditWindow GeditWindow; + +struct _GeditWindow +{ + GtkWindow window; + + /*< private > */ + GeditWindowPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditWindowClass GeditWindowClass; + +struct _GeditWindowClass +{ + GtkWindowClass parent_class; + + /* Signals */ + void (* tab_added) (GeditWindow *window, + GeditTab *tab); + void (* tab_removed) (GeditWindow *window, + GeditTab *tab); + void (* tabs_reordered) (GeditWindow *window); + void (* active_tab_changed) (GeditWindow *window, + GeditTab *tab); + void (* active_tab_state_changed) + (GeditWindow *window); +}; + +/* + * Public methods + */ +GType gedit_window_get_type (void) G_GNUC_CONST; + +GeditTab *gedit_window_create_tab (GeditWindow *window, + gboolean jump_to); + +GeditTab *gedit_window_create_tab_from_uri (GeditWindow *window, + const gchar *uri, + const GeditEncoding *encoding, + gint line_pos, + gboolean create, + gboolean jump_to); + +void gedit_window_close_tab (GeditWindow *window, + GeditTab *tab); + +void gedit_window_close_all_tabs (GeditWindow *window); + +void gedit_window_close_tabs (GeditWindow *window, + const GList *tabs); + +GeditTab *gedit_window_get_active_tab (GeditWindow *window); + +void gedit_window_set_active_tab (GeditWindow *window, + GeditTab *tab); + +/* Helper functions */ +GeditView *gedit_window_get_active_view (GeditWindow *window); +GeditDocument *gedit_window_get_active_document (GeditWindow *window); + +/* Returns a newly allocated list with all the documents in the window */ +GList *gedit_window_get_documents (GeditWindow *window); + +/* Returns a newly allocated list with all the documents that need to be + saved before closing the window */ +GList *gedit_window_get_unsaved_documents (GeditWindow *window); + +/* Returns a newly allocated list with all the views in the window */ +GList *gedit_window_get_views (GeditWindow *window); + +GtkWindowGroup *gedit_window_get_group (GeditWindow *window); + +GeditPanel *gedit_window_get_side_panel (GeditWindow *window); + +GeditPanel *gedit_window_get_bottom_panel (GeditWindow *window); + +GtkWidget *gedit_window_get_statusbar (GeditWindow *window); + +GtkUIManager *gedit_window_get_ui_manager (GeditWindow *window); + +GeditWindowState gedit_window_get_state (GeditWindow *window); + +GeditTab *gedit_window_get_tab_from_location (GeditWindow *window, + GFile *location); + +GeditTab *gedit_window_get_tab_from_uri (GeditWindow *window, + const gchar *uri); + +/* Message bus */ +GeditMessageBus *gedit_window_get_message_bus (GeditWindow *window); + +/* + * Non exported functions + */ +GtkWidget *_gedit_window_get_notebook (GeditWindow *window); + +GeditWindow *_gedit_window_move_tab_to_new_window (GeditWindow *window, + GeditTab *tab); +gboolean _gedit_window_is_removing_tabs (GeditWindow *window); + +GFile *_gedit_window_get_default_location (GeditWindow *window); + +void _gedit_window_set_default_location (GeditWindow *window, + GFile *location); + +void _gedit_window_set_saving_session_state (GeditWindow *window, + gboolean saving_session); + +void _gedit_window_fullscreen (GeditWindow *window); + +void _gedit_window_unfullscreen (GeditWindow *window); + +gboolean _gedit_window_is_fullscreen (GeditWindow *window); + +/* these are in gedit-window because of screen safety */ +void _gedit_recent_add (GeditWindow *window, + const gchar *uri, + const gchar *mime); +void _gedit_recent_remove (GeditWindow *window, + const gchar *uri); + +G_END_DECLS + +#endif /* __GEDIT_WINDOW_H__ */ diff --git a/gedit/gedit.c b/gedit/gedit.c new file mode 100755 index 00000000..fa53b407 --- /dev/null +++ b/gedit/gedit.c @@ -0,0 +1,766 @@ +/* + * gedit.c + * This file is part of gedit + * + * Copyright (C) 2005 - Paolo Maggi + * + * 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. + */ + +/* + * Modified by the gedit Team, 2005. See the AUTHORS file for a + * list of people on the gedit Team. + * See the ChangeLog files for a list of changes. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include +#include +#include + +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "gedit-app.h" +#include "gedit-commands.h" +#include "gedit-debug.h" +#include "gedit-dirs.h" +#include "gedit-encodings.h" +#include "gedit-plugins-engine.h" +#include "gedit-prefs-manager-app.h" +#include "gedit-session.h" +#include "gedit-utils.h" +#include "gedit-window.h" + +#include "eggsmclient.h" +#include "eggdesktopfile.h" + +#ifdef G_OS_WIN32 +#define SAVE_DATADIR DATADIR +#undef DATADIR +#include +#include +#define _WIN32_WINNT 0x0500 +#include +#define DATADIR SAVE_DATADIR +#undef SAVE_DATADIR +#endif + +#ifdef OS_OSX +#include +#include +#include "osx/gedit-osx.h" +#endif + +#ifndef ENABLE_GVFS_METADATA +#include "gedit-metadata-manager.h" +#endif + +static guint32 startup_timestamp = 0; + +#ifndef G_OS_WIN32 +#include "bacon-message-connection.h" + +static BaconMessageConnection *connection; +#endif + +/* command line */ +static gint line_position = 0; +static gchar *encoding_charset = NULL; +static gboolean new_window_option = FALSE; +static gboolean new_document_option = FALSE; +static gchar **remaining_args = NULL; +static GSList *file_list = NULL; + +static void +show_version_and_quit (void) +{ + g_print ("%s - Version %s\n", g_get_application_name (), VERSION); + + exit (0); +} + +static void +list_encodings_and_quit (void) +{ + gint i = 0; + const GeditEncoding *enc; + + while ((enc = gedit_encoding_get_from_index (i)) != NULL) + { + g_print ("%s\n", gedit_encoding_get_charset (enc)); + + ++i; + } + + exit (0); +} + +static const GOptionEntry options [] = +{ + { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + show_version_and_quit, N_("Show the application's version"), NULL }, + + { "encoding", '\0', 0, G_OPTION_ARG_STRING, &encoding_charset, + N_("Set the character encoding to be used to open the files listed on the command line"), N_("ENCODING")}, + + { "list-encodings", '\0', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + list_encodings_and_quit, N_("Display list of possible values for the encoding option"), NULL}, + + { "new-window", '\0', 0, G_OPTION_ARG_NONE, &new_window_option, + N_("Create a new top-level window in an existing instance of gedit"), NULL }, + + { "new-document", '\0', 0, G_OPTION_ARG_NONE, &new_document_option, + N_("Create a new document in an existing instance of gedit"), NULL }, + + { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &remaining_args, + NULL, N_("[FILE...]") }, /* collects file arguments */ + + {NULL} +}; + +static void +free_command_line_data (void) +{ + g_slist_foreach (file_list, (GFunc) g_object_unref, NULL); + g_slist_free (file_list); + file_list = NULL; + + g_strfreev (remaining_args); + remaining_args = NULL; + + g_free (encoding_charset); + encoding_charset = NULL; + + new_window_option = FALSE; + new_document_option = FALSE; + line_position = 0; +} + +static void +gedit_get_command_line_data (void) +{ + if (remaining_args) + { + gint i; + + for (i = 0; remaining_args[i]; i++) + { + if (*remaining_args[i] == '+') + { + if (*(remaining_args[i] + 1) == '\0') + /* goto the last line of the document */ + line_position = G_MAXINT; + else + line_position = atoi (remaining_args[i] + 1); + } + else + { + GFile *file; + + file = g_file_new_for_commandline_arg (remaining_args[i]); + file_list = g_slist_prepend (file_list, file); + } + } + + file_list = g_slist_reverse (file_list); + } + + if (encoding_charset && + (gedit_encoding_get_from_charset (encoding_charset) == NULL)) + { + g_print (_("%s: invalid encoding.\n"), + encoding_charset); + } +} + +static guint32 +get_startup_timestamp (void) +{ + const gchar *startup_id_env; + gchar *startup_id = NULL; + gchar *time_str; + gchar *end; + gulong retval = 0; + + /* we don't unset the env, since startup-notification + * may still need it */ + startup_id_env = g_getenv ("DESKTOP_STARTUP_ID"); + if (startup_id_env == NULL) + goto out; + + startup_id = g_strdup (startup_id_env); + + time_str = g_strrstr (startup_id, "_TIME"); + if (time_str == NULL) + goto out; + + errno = 0; + + /* Skip past the "_TIME" part */ + time_str += 5; + + retval = strtoul (time_str, &end, 0); + if (end == time_str || errno != 0) + retval = 0; + + out: + g_free (startup_id); + + return (retval > 0) ? retval : 0; +} + +#ifndef G_OS_WIN32 +static GdkDisplay * +display_open_if_needed (const gchar *name) +{ + GSList *displays; + GSList *l; + GdkDisplay *display = NULL; + + displays = gdk_display_manager_list_displays (gdk_display_manager_get ()); + + for (l = displays; l != NULL; l = l->next) + { + if (strcmp (gdk_display_get_name ((GdkDisplay *) l->data), name) == 0) + { + display = l->data; + break; + } + } + + g_slist_free (displays); + + return display != NULL ? display : gdk_display_open (name); +} + +/* serverside */ +static void +on_message_received (const char *message, + gpointer data) +{ + const GeditEncoding *encoding = NULL; + gchar **commands; + gchar **params; + gint workspace; + gint viewport_x; + gint viewport_y; + gchar *display_name; + gint screen_number; + gint i; + GeditApp *app; + GeditWindow *window; + GdkDisplay *display; + GdkScreen *screen; + + g_return_if_fail (message != NULL); + + gedit_debug_message (DEBUG_APP, "Received message:\n%s\n", message); + + commands = g_strsplit (message, "\v", -1); + + /* header */ + params = g_strsplit (commands[0], "\t", 6); + startup_timestamp = atoi (params[0]); + display_name = params[1]; + screen_number = atoi (params[2]); + workspace = atoi (params[3]); + viewport_x = atoi (params[4]); + viewport_y = atoi (params[5]); + + display = display_open_if_needed (display_name); + if (display == NULL) + { + g_warning ("Could not open display %s\n", display_name); + g_strfreev (params); + goto out; + } + + screen = gdk_display_get_screen (display, screen_number); + + g_strfreev (params); + + /* body */ + for (i = 1; commands[i] != NULL; i++) + { + params = g_strsplit (commands[i], "\t", -1); + + if (strcmp (params[0], "NEW-WINDOW") == 0) + { + new_window_option = TRUE; + } + else if (strcmp (params[0], "NEW-DOCUMENT") == 0) + { + new_document_option = TRUE; + } + else if (strcmp (params[0], "OPEN-URIS") == 0) + { + gint n_uris, j; + gchar **uris; + + line_position = atoi (params[1]); + + if (params[2] != '\0') + encoding = gedit_encoding_get_from_charset (params[2]); + + n_uris = atoi (params[3]); + uris = g_strsplit (params[4], " ", n_uris); + + for (j = 0; j < n_uris; j++) + { + GFile *file; + + file = g_file_new_for_uri (uris[j]); + file_list = g_slist_prepend (file_list, file); + } + + file_list = g_slist_reverse (file_list); + + /* the list takes ownerhip of the strings, + * only free the array */ + g_free (uris); + } + else + { + g_warning ("Unexpected bacon command"); + } + + g_strfreev (params); + } + + /* execute the commands */ + + app = gedit_app_get_default (); + + if (new_window_option) + { + window = gedit_app_create_window (app, screen); + } + else + { + /* get a window in the current workspace (if exists) and raise it */ + window = _gedit_app_get_window_in_viewport (app, + screen, + workspace, + viewport_x, + viewport_y); + } + + if (file_list != NULL) + { + _gedit_cmd_load_files_from_prompt (window, + file_list, + encoding, + line_position); + + if (new_document_option) + gedit_window_create_tab (window, TRUE); + } + else + { + GeditDocument *doc; + doc = gedit_window_get_active_document (window); + + if (doc == NULL || + !gedit_document_is_untouched (doc) || + new_document_option) + gedit_window_create_tab (window, TRUE); + } + + /* set the proper interaction time on the window. + * Fall back to roundtripping to the X server when we + * don't have the timestamp, e.g. when launched from + * terminal. We also need to make sure that the window + * has been realized otherwise it will not work. lame. + */ + if (!GTK_WIDGET_REALIZED (window)) + gtk_widget_realize (GTK_WIDGET (window)); + +#ifdef GDK_WINDOWING_X11 + if (startup_timestamp <= 0) + startup_timestamp = gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (window))); + + gdk_x11_window_set_user_time (gtk_widget_get_window (GTK_WIDGET (window)), + startup_timestamp); +#endif + + gtk_window_present (GTK_WINDOW (window)); + + out: + g_strfreev (commands); + + free_command_line_data (); +} + +/* clientside */ +static void +send_bacon_message (void) +{ + GdkScreen *screen; + GdkDisplay *display; + const gchar *display_name; + gint screen_number; + gint ws; + gint viewport_x; + gint viewport_y; + GString *command; + + /* the messages have the following format: + * <--- header ---> <---- body -----> + * timestamp \t display_name \t screen_number \t workspace \t viewport_x \t viewport_y \v OP1 \t arg \t arg \v OP2 \t arg \t arg|... + * + * when the arg is a list of uri, they are separated by a space. + * So the delimiters are \v for the commands, \t for the tokens in + * a command and ' ' for the uris: note that such delimiters cannot + * be part of an uri, this way parsing is easier. + */ + + gedit_debug (DEBUG_APP); + + screen = gdk_screen_get_default (); + display = gdk_screen_get_display (screen); + + display_name = gdk_display_get_name (display); + screen_number = gdk_screen_get_number (screen); + + gedit_debug_message (DEBUG_APP, "Display: %s", display_name); + gedit_debug_message (DEBUG_APP, "Screen: %d", screen_number); + + ws = gedit_utils_get_current_workspace (screen); + gedit_utils_get_current_viewport (screen, &viewport_x, &viewport_y); + + command = g_string_new (NULL); + + /* header */ + g_string_append_printf (command, + "%" G_GUINT32_FORMAT "\t%s\t%d\t%d\t%d\t%d", + startup_timestamp, + display_name, + screen_number, + ws, + viewport_x, + viewport_y); + + /* NEW-WINDOW command */ + if (new_window_option) + { + command = g_string_append_c (command, '\v'); + command = g_string_append (command, "NEW-WINDOW"); + } + + /* NEW-DOCUMENT command */ + if (new_document_option) + { + command = g_string_append_c (command, '\v'); + command = g_string_append (command, "NEW-DOCUMENT"); + } + + /* OPEN_URIS command, optionally specify line_num and encoding */ + if (file_list) + { + GSList *l; + + command = g_string_append_c (command, '\v'); + command = g_string_append (command, "OPEN-URIS"); + + g_string_append_printf (command, + "\t%d\t%s\t%u\t", + line_position, + encoding_charset ? encoding_charset : "", + g_slist_length (file_list)); + + for (l = file_list; l != NULL; l = l->next) + { + gchar *uri; + + uri = g_file_get_uri (G_FILE (l->data)); + command = g_string_append (command, uri); + if (l->next != NULL) + command = g_string_append_c (command, ' '); + + g_free (uri); + } + } + + gedit_debug_message (DEBUG_APP, "Bacon Message: %s", command->str); + + bacon_message_connection_send (connection, + command->str); + + g_string_free (command, TRUE); +} +#endif /* G_OS_WIN32 */ + +#ifdef G_OS_WIN32 +static void +setup_path (void) +{ + gchar *path; + gchar *installdir; + gchar *bin; + + installdir = g_win32_get_package_installation_directory_of_module (NULL); + + bin = g_build_filename (installdir, + "bin", NULL); + g_free (installdir); + + /* Set PATH to include the gedit executable's folder */ + path = g_build_path (";", + bin, + g_getenv ("PATH"), + NULL); + g_free (bin); + + if (!g_setenv ("PATH", path, TRUE)) + g_warning ("Could not set PATH for gedit"); + + g_free (path); +} +#endif + +int +main (int argc, char *argv[]) +{ + GOptionContext *context; + GeditPluginsEngine *engine; + GeditWindow *window; + GeditApp *app; + gboolean restored = FALSE; + GError *error = NULL; + gchar *dir; + gchar *icon_dir; + + /* Init type system as soon as possible */ + g_type_init (); + + /* Init glib threads asap */ + g_thread_init (NULL); + + /* Setup debugging */ + gedit_debug_init (); + gedit_debug_message (DEBUG_APP, "Startup"); + + setlocale (LC_ALL, ""); + + dir = gedit_dirs_get_gedit_locale_dir (); + bindtextdomain (GETTEXT_PACKAGE, dir); + g_free (dir); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + startup_timestamp = get_startup_timestamp(); + + /* Setup command line options */ + context = g_option_context_new (_("- Edit text files")); + g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); + g_option_context_add_group (context, gtk_get_option_group (FALSE)); + g_option_context_add_group (context, egg_sm_client_get_option_group ()); + +#ifdef G_OS_WIN32 + setup_path (); + + /* If we open gedit from a console get the stdout printing */ + if (fileno (stdout) != -1 && + _get_osfhandle (fileno (stdout)) != -1) + { + /* stdout is fine, presumably redirected to a file or pipe */ + } + else + { + typedef BOOL (* WINAPI AttachConsole_t) (DWORD); + + AttachConsole_t p_AttachConsole = + (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), + "AttachConsole"); + + if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS)) + { + freopen ("CONOUT$", "w", stdout); + dup2 (fileno (stdout), 1); + freopen ("CONOUT$", "w", stderr); + dup2 (fileno (stderr), 2); + } + } +#endif + + gtk_init (&argc, &argv); + + if (!g_option_context_parse (context, &argc, &argv, &error)) + { + g_print(_("%s\nRun '%s --help' to see a full list of available command line options.\n"), + error->message, argv[0]); + g_error_free (error); + return 1; + } + + g_option_context_free (context); + +#ifndef G_OS_WIN32 + gedit_debug_message (DEBUG_APP, "Create bacon connection"); + + connection = bacon_message_connection_new ("gedit"); + + if (connection != NULL) + { + if (!bacon_message_connection_get_is_server (connection)) + { + gedit_debug_message (DEBUG_APP, "I'm a client"); + + gedit_get_command_line_data (); + + send_bacon_message (); + + free_command_line_data (); + + /* we never popup a window... tell startup-notification + * that we are done. + */ + gdk_notify_startup_complete (); + + bacon_message_connection_free (connection); + + exit (0); + } + else + { + gedit_debug_message (DEBUG_APP, "I'm a server"); + + bacon_message_connection_set_callback (connection, + on_message_received, + NULL); + } + } + else + { + g_warning ("Cannot create the 'gedit' connection."); + } +#endif + + gedit_debug_message (DEBUG_APP, "Set icon"); + + dir = gedit_dirs_get_gedit_data_dir (); + icon_dir = g_build_filename (dir, + "icons", + NULL); + g_free (dir); + + gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), + icon_dir); + g_free (icon_dir); + +#ifdef GDK_WINDOWING_X11 + /* Set the associated .desktop file */ + egg_set_desktop_file (DATADIR "/applications/gedit.desktop"); +#else + /* manually set name and icon */ + g_set_application_name("gedit"); + gtk_window_set_default_icon_name ("accessories-text-editor"); +#endif + + /* Load user preferences */ + gedit_debug_message (DEBUG_APP, "Init prefs manager"); + gedit_prefs_manager_app_init (); + + /* Init plugins engine */ + gedit_debug_message (DEBUG_APP, "Init plugins"); + engine = gedit_plugins_engine_get_default (); + + #if !GTK_CHECK_VERSION(3, 0, 0) + gtk_about_dialog_set_url_hook(gedit_utils_activate_url, NULL, NULL); + #endif + /* Initialize session management */ + gedit_debug_message (DEBUG_APP, "Init session manager"); + gedit_session_init (); + +#ifdef OS_OSX + ige_mac_menu_set_global_key_handler_enabled (FALSE); +#endif + + if (gedit_session_is_restored ()) + restored = gedit_session_load (); + + if (!restored) + { + gedit_debug_message (DEBUG_APP, "Analyze command line data"); + gedit_get_command_line_data (); + + gedit_debug_message (DEBUG_APP, "Get default app"); + app = gedit_app_get_default (); + + gedit_debug_message (DEBUG_APP, "Create main window"); + window = gedit_app_create_window (app, NULL); + + if (file_list != NULL) + { + const GeditEncoding *encoding = NULL; + + if (encoding_charset) + encoding = gedit_encoding_get_from_charset (encoding_charset); + + gedit_debug_message (DEBUG_APP, "Load files"); + _gedit_cmd_load_files_from_prompt (window, + file_list, + encoding, + line_position); + } + else + { + gedit_debug_message (DEBUG_APP, "Create tab"); + gedit_window_create_tab (window, TRUE); + } + + gedit_debug_message (DEBUG_APP, "Show window"); + gtk_widget_show (GTK_WIDGET (window)); + + free_command_line_data (); + } + + gedit_debug_message (DEBUG_APP, "Start gtk-main"); + +#ifdef OS_OSX + gedit_osx_init(gedit_app_get_default ()); +#endif + gtk_main(); + +#ifndef G_OS_WIN32 + bacon_message_connection_free (connection); +#endif + + /* We kept the original engine reference here. So let's unref it to + * finalize it properly. + */ + g_object_unref (engine); + gedit_prefs_manager_app_shutdown (); + +#ifndef ENABLE_GVFS_METADATA + gedit_metadata_manager_shutdown (); +#endif + + return 0; +} + diff --git a/gedit/gedit.rc b/gedit/gedit.rc new file mode 100755 index 00000000..17d8eb13 --- /dev/null +++ b/gedit/gedit.rc @@ -0,0 +1 @@ +A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "../pixmaps/gedit.ico" diff --git a/gedit/gedittextregion.c b/gedit/gedittextregion.c new file mode 100755 index 00000000..f6790489 --- /dev/null +++ b/gedit/gedittextregion.c @@ -0,0 +1,647 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * gedittextregion.h - GtkTextMark based region utility functions + * + * This file is part of the GtkSourceView widget + * + * Copyright (C) 2002 Gustavo Girldez + * + * 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 +#endif + +#include + +#include "gedittextregion.h" + + +#undef ENABLE_DEBUG +/* +#define ENABLE_DEBUG +*/ + +#ifdef ENABLE_DEBUG +#define DEBUG(x) (x) +#else +#define DEBUG(x) +#endif + +typedef struct _Subregion { + GtkTextMark *start; + GtkTextMark *end; +} Subregion; + +struct _GeditTextRegion { + GtkTextBuffer *buffer; + GList *subregions; + guint32 time_stamp; +}; + +typedef struct _GeditTextRegionIteratorReal GeditTextRegionIteratorReal; + +struct _GeditTextRegionIteratorReal { + GeditTextRegion *region; + guint32 region_time_stamp; + + GList *subregions; +}; + + +/* ---------------------------------------------------------------------- + Private interface + ---------------------------------------------------------------------- */ + +/* Find and return a subregion node which contains the given text + iter. If left_side is TRUE, return the subregion which contains + the text iter or which is the leftmost; else return the rightmost + subregion */ +static GList * +find_nearest_subregion (GeditTextRegion *region, + const GtkTextIter *iter, + GList *begin, + gboolean leftmost, + gboolean include_edges) +{ + GList *l, *retval; + + g_return_val_if_fail (region != NULL && iter != NULL, NULL); + + if (!begin) + begin = region->subregions; + + if (begin) + retval = begin->prev; + else + retval = NULL; + + for (l = begin; l; l = l->next) { + GtkTextIter sr_iter; + Subregion *sr = l->data; + gint cmp; + + if (!leftmost) { + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_iter, sr->end); + cmp = gtk_text_iter_compare (iter, &sr_iter); + if (cmp < 0 || (cmp == 0 && include_edges)) { + retval = l; + break; + } + + } else { + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_iter, sr->start); + cmp = gtk_text_iter_compare (iter, &sr_iter); + if (cmp > 0 || (cmp == 0 && include_edges)) + retval = l; + else + break; + } + } + return retval; +} + +/* ---------------------------------------------------------------------- + Public interface + ---------------------------------------------------------------------- */ + +GeditTextRegion * +gedit_text_region_new (GtkTextBuffer *buffer) +{ + GeditTextRegion *region; + + g_return_val_if_fail (buffer != NULL, NULL); + + region = g_new (GeditTextRegion, 1); + region->buffer = buffer; + region->subregions = NULL; + region->time_stamp = 0; + + return region; +} + +void +gedit_text_region_destroy (GeditTextRegion *region, gboolean delete_marks) +{ + g_return_if_fail (region != NULL); + + while (region->subregions) { + Subregion *sr = region->subregions->data; + if (delete_marks) { + gtk_text_buffer_delete_mark (region->buffer, sr->start); + gtk_text_buffer_delete_mark (region->buffer, sr->end); + } + g_free (sr); + region->subregions = g_list_delete_link (region->subregions, + region->subregions); + } + region->buffer = NULL; + region->time_stamp = 0; + + g_free (region); +} + +GtkTextBuffer * +gedit_text_region_get_buffer (GeditTextRegion *region) +{ + g_return_val_if_fail (region != NULL, NULL); + + return region->buffer; +} + +static void +gedit_text_region_clear_zero_length_subregions (GeditTextRegion *region) +{ + GtkTextIter start, end; + GList *node; + + g_return_if_fail (region != NULL); + + for (node = region->subregions; node; ) { + Subregion *sr = node->data; + gtk_text_buffer_get_iter_at_mark (region->buffer, &start, sr->start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &end, sr->end); + if (gtk_text_iter_equal (&start, &end)) { + gtk_text_buffer_delete_mark (region->buffer, sr->start); + gtk_text_buffer_delete_mark (region->buffer, sr->end); + g_free (sr); + if (node == region->subregions) + region->subregions = node = g_list_delete_link (node, node); + else + node = g_list_delete_link (node, node); + + ++region->time_stamp; + + } else { + node = node->next; + } + } +} + +void +gedit_text_region_add (GeditTextRegion *region, + const GtkTextIter *_start, + const GtkTextIter *_end) +{ + GList *start_node, *end_node; + GtkTextIter start, end; + + g_return_if_fail (region != NULL && _start != NULL && _end != NULL); + + start = *_start; + end = *_end; + + DEBUG (g_print ("---\n")); + DEBUG (gedit_text_region_debug_print (region)); + DEBUG (g_message ("region_add (%d, %d)", + gtk_text_iter_get_offset (&start), + gtk_text_iter_get_offset (&end))); + + gtk_text_iter_order (&start, &end); + + /* don't add zero-length regions */ + if (gtk_text_iter_equal (&start, &end)) + return; + + /* find bounding subregions */ + start_node = find_nearest_subregion (region, &start, NULL, FALSE, TRUE); + end_node = find_nearest_subregion (region, &end, start_node, TRUE, TRUE); + + if (start_node == NULL || end_node == NULL || end_node == start_node->prev) { + /* create the new subregion */ + Subregion *sr = g_new0 (Subregion, 1); + sr->start = gtk_text_buffer_create_mark (region->buffer, NULL, &start, TRUE); + sr->end = gtk_text_buffer_create_mark (region->buffer, NULL, &end, FALSE); + + if (start_node == NULL) { + /* append the new region */ + region->subregions = g_list_append (region->subregions, sr); + + } else if (end_node == NULL) { + /* prepend the new region */ + region->subregions = g_list_prepend (region->subregions, sr); + + } else { + /* we are in the middle of two subregions */ + region->subregions = g_list_insert_before (region->subregions, + start_node, sr); + } + } + else { + GtkTextIter iter; + Subregion *sr = start_node->data; + if (start_node != end_node) { + /* we need to merge some subregions */ + GList *l = start_node->next; + Subregion *q; + + gtk_text_buffer_delete_mark (region->buffer, sr->end); + while (l != end_node) { + q = l->data; + gtk_text_buffer_delete_mark (region->buffer, q->start); + gtk_text_buffer_delete_mark (region->buffer, q->end); + g_free (q); + l = g_list_delete_link (l, l); + } + q = l->data; + gtk_text_buffer_delete_mark (region->buffer, q->start); + sr->end = q->end; + g_free (q); + l = g_list_delete_link (l, l); + } + /* now move marks if that action expands the region */ + gtk_text_buffer_get_iter_at_mark (region->buffer, &iter, sr->start); + if (gtk_text_iter_compare (&iter, &start) > 0) + gtk_text_buffer_move_mark (region->buffer, sr->start, &start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &iter, sr->end); + if (gtk_text_iter_compare (&iter, &end) < 0) + gtk_text_buffer_move_mark (region->buffer, sr->end, &end); + } + + ++region->time_stamp; + + DEBUG (gedit_text_region_debug_print (region)); +} + +void +gedit_text_region_subtract (GeditTextRegion *region, + const GtkTextIter *_start, + const GtkTextIter *_end) +{ + GList *start_node, *end_node, *node; + GtkTextIter sr_start_iter, sr_end_iter; + gboolean done; + gboolean start_is_outside, end_is_outside; + Subregion *sr; + GtkTextIter start, end; + + g_return_if_fail (region != NULL && _start != NULL && _end != NULL); + + start = *_start; + end = *_end; + + DEBUG (g_print ("---\n")); + DEBUG (gedit_text_region_debug_print (region)); + DEBUG (g_message ("region_substract (%d, %d)", + gtk_text_iter_get_offset (&start), + gtk_text_iter_get_offset (&end))); + + gtk_text_iter_order (&start, &end); + + /* find bounding subregions */ + start_node = find_nearest_subregion (region, &start, NULL, FALSE, FALSE); + end_node = find_nearest_subregion (region, &end, start_node, TRUE, FALSE); + + /* easy case first */ + if (start_node == NULL || end_node == NULL || end_node == start_node->prev) + return; + + /* deal with the start point */ + start_is_outside = end_is_outside = FALSE; + + sr = start_node->data; + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_start_iter, sr->start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_end_iter, sr->end); + + if (gtk_text_iter_in_range (&start, &sr_start_iter, &sr_end_iter) && + !gtk_text_iter_equal (&start, &sr_start_iter)) { + /* the starting point is inside the first subregion */ + if (gtk_text_iter_in_range (&end, &sr_start_iter, &sr_end_iter) && + !gtk_text_iter_equal (&end, &sr_end_iter)) { + /* the ending point is also inside the first + subregion: we need to split */ + Subregion *new_sr = g_new0 (Subregion, 1); + new_sr->end = sr->end; + new_sr->start = gtk_text_buffer_create_mark (region->buffer, + NULL, &end, TRUE); + start_node = g_list_insert_before (start_node, start_node->next, new_sr); + + sr->end = gtk_text_buffer_create_mark (region->buffer, + NULL, &start, FALSE); + + /* no further processing needed */ + DEBUG (g_message ("subregion splitted")); + + return; + } else { + /* the ending point is outside, so just move + the end of the subregion to the starting point */ + gtk_text_buffer_move_mark (region->buffer, sr->end, &start); + } + } else { + /* the starting point is outside (and so to the left) + of the first subregion */ + DEBUG (g_message ("start is outside")); + + start_is_outside = TRUE; + } + + /* deal with the end point */ + if (start_node != end_node) { + sr = end_node->data; + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_start_iter, sr->start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_end_iter, sr->end); + } + + if (gtk_text_iter_in_range (&end, &sr_start_iter, &sr_end_iter) && + !gtk_text_iter_equal (&end, &sr_end_iter)) { + /* ending point is inside, move the start mark */ + gtk_text_buffer_move_mark (region->buffer, sr->start, &end); + } else { + end_is_outside = TRUE; + DEBUG (g_message ("end is outside")); + + } + + /* finally remove any intermediate subregions */ + done = FALSE; + node = start_node; + + while (!done) { + if (node == end_node) + /* we are done, exit in the next iteration */ + done = TRUE; + + if ((node == start_node && !start_is_outside) || + (node == end_node && !end_is_outside)) { + /* skip starting or ending node */ + node = node->next; + } else { + GList *l = node->next; + sr = node->data; + gtk_text_buffer_delete_mark (region->buffer, sr->start); + gtk_text_buffer_delete_mark (region->buffer, sr->end); + g_free (sr); + region->subregions = g_list_delete_link (region->subregions, + node); + node = l; + } + } + + ++region->time_stamp; + + DEBUG (gedit_text_region_debug_print (region)); + + /* now get rid of empty subregions */ + gedit_text_region_clear_zero_length_subregions (region); + + DEBUG (gedit_text_region_debug_print (region)); +} + +gint +gedit_text_region_subregions (GeditTextRegion *region) +{ + g_return_val_if_fail (region != NULL, 0); + + return g_list_length (region->subregions); +} + +gboolean +gedit_text_region_nth_subregion (GeditTextRegion *region, + guint subregion, + GtkTextIter *start, + GtkTextIter *end) +{ + Subregion *sr; + + g_return_val_if_fail (region != NULL, FALSE); + + sr = g_list_nth_data (region->subregions, subregion); + if (sr == NULL) + return FALSE; + + if (start) + gtk_text_buffer_get_iter_at_mark (region->buffer, start, sr->start); + if (end) + gtk_text_buffer_get_iter_at_mark (region->buffer, end, sr->end); + + return TRUE; +} + +GeditTextRegion * +gedit_text_region_intersect (GeditTextRegion *region, + const GtkTextIter *_start, + const GtkTextIter *_end) +{ + GList *start_node, *end_node, *node; + GtkTextIter sr_start_iter, sr_end_iter; + Subregion *sr, *new_sr; + gboolean done; + GeditTextRegion *new_region; + GtkTextIter start, end; + + g_return_val_if_fail (region != NULL && _start != NULL && _end != NULL, NULL); + + start = *_start; + end = *_end; + + gtk_text_iter_order (&start, &end); + + /* find bounding subregions */ + start_node = find_nearest_subregion (region, &start, NULL, FALSE, FALSE); + end_node = find_nearest_subregion (region, &end, start_node, TRUE, FALSE); + + /* easy case first */ + if (start_node == NULL || end_node == NULL || end_node == start_node->prev) + return NULL; + + new_region = gedit_text_region_new (region->buffer); + done = FALSE; + + sr = start_node->data; + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_start_iter, sr->start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_end_iter, sr->end); + + /* starting node */ + if (gtk_text_iter_in_range (&start, &sr_start_iter, &sr_end_iter)) { + new_sr = g_new0 (Subregion, 1); + new_region->subregions = g_list_prepend (new_region->subregions, new_sr); + + new_sr->start = gtk_text_buffer_create_mark (new_region->buffer, NULL, + &start, TRUE); + if (start_node == end_node) { + /* things will finish shortly */ + done = TRUE; + if (gtk_text_iter_in_range (&end, &sr_start_iter, &sr_end_iter)) + new_sr->end = gtk_text_buffer_create_mark (new_region->buffer, + NULL, &end, FALSE); + else + new_sr->end = gtk_text_buffer_create_mark (new_region->buffer, + NULL, &sr_end_iter, + FALSE); + } else { + new_sr->end = gtk_text_buffer_create_mark (new_region->buffer, NULL, + &sr_end_iter, FALSE); + } + node = start_node->next; + } else { + /* start should be the same as the subregion, so copy it in the loop */ + node = start_node; + } + + if (!done) { + while (node != end_node) { + /* copy intermediate subregions verbatim */ + sr = node->data; + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_start_iter, + sr->start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_end_iter, sr->end); + + new_sr = g_new0 (Subregion, 1); + new_region->subregions = g_list_prepend (new_region->subregions, new_sr); + new_sr->start = gtk_text_buffer_create_mark (new_region->buffer, NULL, + &sr_start_iter, TRUE); + new_sr->end = gtk_text_buffer_create_mark (new_region->buffer, NULL, + &sr_end_iter, FALSE); + /* next node */ + node = node->next; + } + + /* ending node */ + sr = node->data; + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_start_iter, sr->start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &sr_end_iter, sr->end); + + new_sr = g_new0 (Subregion, 1); + new_region->subregions = g_list_prepend (new_region->subregions, new_sr); + + new_sr->start = gtk_text_buffer_create_mark (new_region->buffer, NULL, + &sr_start_iter, TRUE); + + if (gtk_text_iter_in_range (&end, &sr_start_iter, &sr_end_iter)) + new_sr->end = gtk_text_buffer_create_mark (new_region->buffer, NULL, + &end, FALSE); + else + new_sr->end = gtk_text_buffer_create_mark (new_region->buffer, NULL, + &sr_end_iter, FALSE); + } + + new_region->subregions = g_list_reverse (new_region->subregions); + return new_region; +} + +static gboolean +check_iterator (GeditTextRegionIteratorReal *real) +{ + if ((real->region == NULL) || + (real->region_time_stamp != real->region->time_stamp)) + { + g_warning("Invalid iterator: either the iterator " + "is uninitialized, or the region " + "has been modified since the iterator " + "was created."); + + return FALSE; + } + + return TRUE; +} + +void +gedit_text_region_get_iterator (GeditTextRegion *region, + GeditTextRegionIterator *iter, + guint start) +{ + GeditTextRegionIteratorReal *real; + + g_return_if_fail (region != NULL); + g_return_if_fail (iter != NULL); + + real = (GeditTextRegionIteratorReal *)iter; + + /* region->subregions may be NULL, -> end iter */ + + real->region = region; + real->subregions = g_list_nth (region->subregions, start); + real->region_time_stamp = region->time_stamp; +} + +gboolean +gedit_text_region_iterator_is_end (GeditTextRegionIterator *iter) +{ + GeditTextRegionIteratorReal *real; + + g_return_val_if_fail (iter != NULL, FALSE); + + real = (GeditTextRegionIteratorReal *)iter; + g_return_val_if_fail (check_iterator (real), FALSE); + + return (real->subregions == NULL); +} + +gboolean +gedit_text_region_iterator_next (GeditTextRegionIterator *iter) +{ + GeditTextRegionIteratorReal *real; + + g_return_val_if_fail (iter != NULL, FALSE); + + real = (GeditTextRegionIteratorReal *)iter; + g_return_val_if_fail (check_iterator (real), FALSE); + + if (real->subregions != NULL) { + real->subregions = g_list_next (real->subregions); + return TRUE; + } + else + return FALSE; +} + +void +gedit_text_region_iterator_get_subregion (GeditTextRegionIterator *iter, + GtkTextIter *start, + GtkTextIter *end) +{ + GeditTextRegionIteratorReal *real; + Subregion *sr; + + g_return_if_fail (iter != NULL); + + real = (GeditTextRegionIteratorReal *)iter; + g_return_if_fail (check_iterator (real)); + g_return_if_fail (real->subregions != NULL); + + sr = (Subregion*)real->subregions->data; + g_return_if_fail (sr != NULL); + + if (start) + gtk_text_buffer_get_iter_at_mark (real->region->buffer, start, sr->start); + if (end) + gtk_text_buffer_get_iter_at_mark (real->region->buffer, end, sr->end); +} + +void +gedit_text_region_debug_print (GeditTextRegion *region) +{ + GList *l; + + g_return_if_fail (region != NULL); + + g_print ("Subregions: "); + l = region->subregions; + while (l) { + Subregion *sr = l->data; + GtkTextIter iter1, iter2; + gtk_text_buffer_get_iter_at_mark (region->buffer, &iter1, sr->start); + gtk_text_buffer_get_iter_at_mark (region->buffer, &iter2, sr->end); + g_print ("%d-%d ", gtk_text_iter_get_offset (&iter1), + gtk_text_iter_get_offset (&iter2)); + l = l->next; + } + g_print ("\n"); +} + diff --git a/gedit/gedittextregion.h b/gedit/gedittextregion.h new file mode 100755 index 00000000..594a4950 --- /dev/null +++ b/gedit/gedittextregion.h @@ -0,0 +1,88 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * gedittextregion.h - GtkTextMark based region utility functions + * + * This file is part of the GtkSourceView widget + * + * Copyright (C) 2002 Gustavo Girldez + * + * 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 __GEDIT_TEXT_REGION_H__ +#define __GEDIT_TEXT_REGION_H__ + +#include + +G_BEGIN_DECLS + +typedef struct _GeditTextRegion GeditTextRegion; +typedef struct _GeditTextRegionIterator GeditTextRegionIterator; + +struct _GeditTextRegionIterator { + /* GeditTextRegionIterator is an opaque datatype; ignore all these fields. + * Initialize the iter with gedit_text_region_get_iterator + * function + */ + /*< private >*/ + gpointer dummy1; + guint32 dummy2; + gpointer dummy3; +}; + +GeditTextRegion *gedit_text_region_new (GtkTextBuffer *buffer); +void gedit_text_region_destroy (GeditTextRegion *region, + gboolean delete_marks); + +GtkTextBuffer *gedit_text_region_get_buffer (GeditTextRegion *region); + +void gedit_text_region_add (GeditTextRegion *region, + const GtkTextIter *_start, + const GtkTextIter *_end); + +void gedit_text_region_subtract (GeditTextRegion *region, + const GtkTextIter *_start, + const GtkTextIter *_end); + +gint gedit_text_region_subregions (GeditTextRegion *region); + +gboolean gedit_text_region_nth_subregion (GeditTextRegion *region, + guint subregion, + GtkTextIter *start, + GtkTextIter *end); + +GeditTextRegion *gedit_text_region_intersect (GeditTextRegion *region, + const GtkTextIter *_start, + const GtkTextIter *_end); + +void gedit_text_region_get_iterator (GeditTextRegion *region, + GeditTextRegionIterator *iter, + guint start); + +gboolean gedit_text_region_iterator_is_end (GeditTextRegionIterator *iter); + +/* Returns FALSE if iterator is the end iterator */ +gboolean gedit_text_region_iterator_next (GeditTextRegionIterator *iter); + +void gedit_text_region_iterator_get_subregion (GeditTextRegionIterator *iter, + GtkTextIter *start, + GtkTextIter *end); + +void gedit_text_region_debug_print (GeditTextRegion *region); + +G_END_DECLS + +#endif /* __GEDIT_TEXT_REGION_H__ */ diff --git a/gedit/osx/Makefile.am b/gedit/osx/Makefile.am new file mode 100755 index 00000000..4d734169 --- /dev/null +++ b/gedit/osx/Makefile.am @@ -0,0 +1,23 @@ +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/gedit \ + -I$(top_builddir)/gedit \ + $(GEDIT_CFLAGS) \ + $(IGE_MAC_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) + +noinst_LTLIBRARIES = libosx.la + +libosx_la_LDFLAGS = -framework Carbon -framework ApplicationServices -framework Cocoa +libosx_la_LIBADD = -lobjc +libosx_la_CFLAGS = -xobjective-c + +libosx_la_SOURCES = \ + gedit-osx.c \ + gedit-osx.h \ + gedit-osx-delegate.m \ + gedit-osx-delegate.h + +-include $(top_srcdir)/git.mk diff --git a/gedit/osx/gedit-osx-delegate.h b/gedit/osx/gedit-osx-delegate.h new file mode 100755 index 00000000..0b4411e8 --- /dev/null +++ b/gedit/osx/gedit-osx-delegate.h @@ -0,0 +1,16 @@ +#ifndef GEDIT_OSX_DELEGATE_H_ +#define GEDIT_OSX_DELEGATE_H_ + +#import + +@interface GeditOSXDelegate : NSObject +{ +} + +-(id) init; +-(void) openFiles:(NSAppleEventDescriptor*)event + withReply:(NSAppleEventDescriptor*)reply; + +@end + +#endif /* GEDIT_OSX_DELEGATE_H_ */ diff --git a/gedit/osx/gedit-osx-delegate.m b/gedit/osx/gedit-osx-delegate.m new file mode 100755 index 00000000..41b0b262 --- /dev/null +++ b/gedit/osx/gedit-osx-delegate.m @@ -0,0 +1,84 @@ +#import "gedit-osx-delegate.h" +#import +#import +#import +#include +#include +#include + +@implementation GeditOSXDelegate +-(id)init +{ + if ((self = [super init])) + { + NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager]; + + [em setEventHandler:self + andSelector:@selector(openFiles:withReply:) + forEventClass:kCoreEventClass + andEventID:kAEOpenDocuments]; + } + + return self; +} + +static GeditWindow * +get_window(NSAppleEventDescriptor *event) +{ + GeditApp *app = gedit_app_get_default (); + return gedit_app_get_active_window (app); +} + +- (void)openFiles:(NSAppleEventDescriptor*)event + withReply:(NSAppleEventDescriptor*)reply +{ + NSAppleEventDescriptor *fileList = [event paramDescriptorForKeyword:keyDirectObject]; + NSInteger i; + GSList *uris = NULL; + + if (!fileList) + { + return; + } + + for (i = 1; i <= [fileList numberOfItems]; ++i) + { + NSAppleEventDescriptor *fileAliasDesc = [fileList descriptorAtIndex:i]; + NSAppleEventDescriptor *fileURLDesc; + NSData *fileURLData; + gchar *url; + + if (!fileAliasDesc) + { + continue; + } + + fileURLDesc = [fileAliasDesc coerceToDescriptorType:typeFileURL]; + + if (!fileURLDesc) + { + continue; + } + + fileURLData = [fileURLDesc data]; + + if (!fileURLData) + { + continue; + } + + url = g_strndup([fileURLData bytes], [fileURLData length]); + uris = g_slist_prepend (uris, url); + } + + if (uris != NULL) + { + GeditWindow *window = get_window (event); + gedit_commands_load_uris (window, uris, NULL, 0); + + g_slist_foreach (uris, (GFunc)g_free, NULL); + g_slist_free (uris); + } +} + +@end \ No newline at end of file diff --git a/gedit/osx/gedit-osx.c b/gedit/osx/gedit-osx.c new file mode 100755 index 00000000..e7a18d42 --- /dev/null +++ b/gedit/osx/gedit-osx.c @@ -0,0 +1,94 @@ +#include "gedit-osx.h" +#include +#include + +#import "gedit-osx-delegate.h" + +void +gedit_osx_set_window_title (GeditWindow *window, + gchar const *title, + GeditDocument *document) +{ + NSWindow *native; + + g_return_if_fail (GEDIT_IS_WINDOW (window)); + + if (GTK_WIDGET (window)->window == NULL) + { + return; + } + + native = gdk_quartz_window_get_nswindow (GTK_WIDGET (window)->window); + + if (document) + { + bool ismodified; + + if (gedit_document_is_untitled (document)) + { + [native setRepresentedURL:nil]; + } + else + { + const gchar *uri = gedit_document_get_uri (document); + NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:uri]]; + + [native setRepresentedURL:nsurl]; + } + + ismodified = !gedit_document_is_untouched (document); + [native setDocumentEdited:ismodified]; + } + else + { + [native setRepresentedURL:nil]; + [native setDocumentEdited:false]; + } + + gtk_window_set_title (GTK_WINDOW (window), title); +} + +gboolean +gedit_osx_show_url (const gchar *url) +{ + return [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url]]]; +} + +gboolean +gedit_osx_show_help (const gchar *link_id) +{ + gchar *link; + gboolean ret; + + if (link_id) + { + link = g_strdup_printf ("http://library.mate.org/users/gedit/stable/%s", + link_id); + } + else + { + link = g_strdup ("http://library.mate.org/users/gedit/stable/"); + } + + ret = gedit_osx_show_url (link); + g_free (link); + + return ret; +} + +static void +destroy_delegate (GeditOSXDelegate *delegate) +{ + [delegate dealloc]; +} + +void +gedit_osx_init(GeditApp *app) +{ + GeditOSXDelegate *delegate = [[GeditOSXDelegate alloc] init]; + + g_object_set_data_full (G_OBJECT (app), + "GeditOSXDelegate", + delegate, + (GDestroyNotify)destroy_delegate); +} \ No newline at end of file diff --git a/gedit/osx/gedit-osx.h b/gedit/osx/gedit-osx.h new file mode 100755 index 00000000..82f0120b --- /dev/null +++ b/gedit/osx/gedit-osx.h @@ -0,0 +1,17 @@ +#ifndef __GEDIT_OSX_H__ +#define __GEDIT_OSX_H__ + +#include +#include +#include + +void gedit_osx_init (GeditApp *app); + +void gedit_osx_set_window_title (GeditWindow *window, + gchar const *title, + GeditDocument *document); + +gboolean gedit_osx_show_url (const gchar *url); +gboolean gedit_osx_show_help (const gchar *link_id); + +#endif /* __GEDIT_OSX_H__ */ diff --git a/gedit/smclient/Makefile.am b/gedit/smclient/Makefile.am new file mode 100755 index 00000000..8ec0ef71 --- /dev/null +++ b/gedit/smclient/Makefile.am @@ -0,0 +1,52 @@ +if OS_WIN32 +platform_sources = eggsmclient-win32.c +platform_logout_test_ldflags = -mwindows +else +if OS_OSX +platform_defines = -xobjective-c +platform_ldflags = -framework Carbon +platform_sources = eggsmclient-osx.c +else +platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP +platform_libs = libeggdesktopfile.la +platform_ltlibraries = libeggdesktopfile.la +platform_sources = eggsmclient-xsmp.c +endif +endif + +INCLUDES = \ + -DG_LOG_DOMAIN=\""EggSMClient"\" \ + $(GEDIT_CFLAGS) \ + $(platform_defines) \ + $(EGG_SMCLIENT_CFLAGS) + +noinst_LTLIBRARIES = \ + libeggsmclient.la \ + $(platform_ltlibraries) + +libeggsmclient_la_LIBADD = \ + $(EGG_SMCLIENT_LIBS) \ + $(platform_libs) + +libeggsmclient_la_LDFLAGS = \ + $(platform_ldflags) + +libeggsmclient_la_SOURCES = \ + eggsmclient.c \ + eggsmclient.h \ + eggsmclient-private.h \ + $(platform_sources) + +libeggdesktopfile_la_LIBADD = \ + $(EGG_LIBS) + +libeggdesktopfile_la_SOURCES = \ + eggdesktopfile.c \ + eggdesktopfile.h + +EXTRA_DIST = \ + eggsmclient-osx.c \ + eggsmclient-win32.c \ + eggsmclient-xsmp.c + +-include $(top_srcdir)/git.mk diff --git a/gedit/smclient/eggdesktopfile.c b/gedit/smclient/eggdesktopfile.c new file mode 100755 index 00000000..5ac79507 --- /dev/null +++ b/gedit/smclient/eggdesktopfile.c @@ -0,0 +1,1510 @@ +/* eggdesktopfile.c - Freedesktop.Org Desktop Files + * Copyright (C) 2007 Novell, Inc. + * + * Based on mate-desktop-item.c + * Copyright (C) 1999, 2000 Red Hat Inc. + * Copyright (C) 2001 George Lebl + * + * This library 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 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; see the file COPYING.LIB. 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 "eggdesktopfile.h" + +#include +#include + +#include +#include +#include + +struct EggDesktopFile { + GKeyFile *key_file; + char *source; + + char *name, *icon; + EggDesktopFileType type; + char document_code; +}; + +/** + * egg_desktop_file_new: + * @desktop_file_path: path to a Freedesktop-style Desktop file + * @error: error pointer + * + * Creates a new #EggDesktopFile for @desktop_file. + * + * Return value: the new #EggDesktopFile, or %NULL on error. + **/ +EggDesktopFile * +egg_desktop_file_new (const char *desktop_file_path, GError **error) +{ + GKeyFile *key_file; + + key_file = g_key_file_new (); + if (!g_key_file_load_from_file (key_file, desktop_file_path, 0, error)) + { + g_key_file_free (key_file); + return NULL; + } + + return egg_desktop_file_new_from_key_file (key_file, desktop_file_path, + error); +} + +/** + * egg_desktop_file_new_from_data_dirs: + * @desktop_file_path: relative path to a Freedesktop-style Desktop file + * @error: error pointer + * + * Looks for @desktop_file_path in the paths returned from + * g_get_user_data_dir() and g_get_system_data_dirs(), and creates + * a new #EggDesktopFile from it. + * + * Return value: the new #EggDesktopFile, or %NULL on error. + **/ +EggDesktopFile * +egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, + GError **error) +{ + EggDesktopFile *desktop_file; + GKeyFile *key_file; + char *full_path; + + key_file = g_key_file_new (); + if (!g_key_file_load_from_data_dirs (key_file, desktop_file_path, + &full_path, 0, error)) + { + g_key_file_free (key_file); + return NULL; + } + + desktop_file = egg_desktop_file_new_from_key_file (key_file, + full_path, + error); + g_free (full_path); + return desktop_file; +} + +/** + * egg_desktop_file_new_from_dirs: + * @desktop_file_path: relative path to a Freedesktop-style Desktop file + * @search_dirs: NULL-terminated array of directories to search + * @error: error pointer + * + * Looks for @desktop_file_path in the paths returned from + * g_get_user_data_dir() and g_get_system_data_dirs(), and creates + * a new #EggDesktopFile from it. + * + * Return value: the new #EggDesktopFile, or %NULL on error. + **/ +EggDesktopFile * +egg_desktop_file_new_from_dirs (const char *desktop_file_path, + const char **search_dirs, + GError **error) +{ + EggDesktopFile *desktop_file; + GKeyFile *key_file; + char *full_path; + + key_file = g_key_file_new (); + if (!g_key_file_load_from_dirs (key_file, desktop_file_path, search_dirs, + &full_path, 0, error)) + { + g_key_file_free (key_file); + return NULL; + } + + desktop_file = egg_desktop_file_new_from_key_file (key_file, + full_path, + error); + g_free (full_path); + return desktop_file; +} + +/** + * egg_desktop_file_new_from_key_file: + * @key_file: a #GKeyFile representing a desktop file + * @source: the path or URI that @key_file was loaded from, or %NULL + * @error: error pointer + * + * Creates a new #EggDesktopFile for @key_file. Assumes ownership of + * @key_file (on success or failure); you should consider @key_file to + * be freed after calling this function. + * + * Return value: the new #EggDesktopFile, or %NULL on error. + **/ +EggDesktopFile * +egg_desktop_file_new_from_key_file (GKeyFile *key_file, + const char *source, + GError **error) +{ + EggDesktopFile *desktop_file; + char *version, *type; + + if (!g_key_file_has_group (key_file, EGG_DESKTOP_FILE_GROUP)) + { + g_set_error (error, EGG_DESKTOP_FILE_ERROR, + EGG_DESKTOP_FILE_ERROR_INVALID, + _("File is not a valid .desktop file")); + g_key_file_free (key_file); + return NULL; + } + + version = g_key_file_get_value (key_file, EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_VERSION, + NULL); + if (version) + { + double version_num; + char *end; + + version_num = g_ascii_strtod (version, &end); + if (*end) + { + g_warning ("Invalid Version string '%s' in %s", + version, source ? source : "(unknown)"); + } + else if (version_num > 1.0) + { + g_set_error (error, EGG_DESKTOP_FILE_ERROR, + EGG_DESKTOP_FILE_ERROR_INVALID, + _("Unrecognized desktop file Version '%s'"), version); + g_free (version); + g_key_file_free (key_file); + return NULL; + } + g_free (version); + } + + desktop_file = g_new0 (EggDesktopFile, 1); + desktop_file->key_file = key_file; + + if (g_path_is_absolute (source)) + desktop_file->source = g_filename_to_uri (source, NULL, NULL); + else + desktop_file->source = g_strdup (source); + + desktop_file->name = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_NAME, error); + if (!desktop_file->name) + { + egg_desktop_file_free (desktop_file); + return NULL; + } + + type = g_key_file_get_string (key_file, EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_TYPE, error); + if (!type) + { + egg_desktop_file_free (desktop_file); + return NULL; + } + + if (!strcmp (type, "Application")) + { + char *exec, *p; + + desktop_file->type = EGG_DESKTOP_FILE_TYPE_APPLICATION; + + exec = g_key_file_get_string (key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_EXEC, + error); + if (!exec) + { + egg_desktop_file_free (desktop_file); + g_free (type); + return NULL; + } + + /* See if it takes paths or URIs or neither */ + for (p = exec; *p; p++) + { + if (*p == '%') + { + if (p[1] == '\0' || strchr ("FfUu", p[1])) + { + desktop_file->document_code = p[1]; + break; + } + p++; + } + } + + g_free (exec); + } + else if (!strcmp (type, "Link")) + { + char *url; + + desktop_file->type = EGG_DESKTOP_FILE_TYPE_LINK; + + url = g_key_file_get_string (key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_URL, + error); + if (!url) + { + egg_desktop_file_free (desktop_file); + g_free (type); + return NULL; + } + g_free (url); + } + else if (!strcmp (type, "Directory")) + desktop_file->type = EGG_DESKTOP_FILE_TYPE_DIRECTORY; + else + desktop_file->type = EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED; + + g_free (type); + + /* Check the Icon key */ + desktop_file->icon = g_key_file_get_string (key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_ICON, + NULL); + if (desktop_file->icon && !g_path_is_absolute (desktop_file->icon)) + { + char *ext; + + /* Lots of .desktop files still get this wrong */ + ext = strrchr (desktop_file->icon, '.'); + if (ext && (!strcmp (ext, ".png") || + !strcmp (ext, ".xpm") || + !strcmp (ext, ".svg"))) + { + g_warning ("Desktop file '%s' has malformed Icon key '%s'" + "(should not include extension)", + source ? source : "(unknown)", + desktop_file->icon); + *ext = '\0'; + } + } + + return desktop_file; +} + +/** + * egg_desktop_file_free: + * @desktop_file: an #EggDesktopFile + * + * Frees @desktop_file. + **/ +void +egg_desktop_file_free (EggDesktopFile *desktop_file) +{ + g_key_file_free (desktop_file->key_file); + g_free (desktop_file->source); + g_free (desktop_file->name); + g_free (desktop_file->icon); + g_free (desktop_file); +} + +/** + * egg_desktop_file_get_source: + * @desktop_file: an #EggDesktopFile + * + * Gets the URI that @desktop_file was loaded from. + * + * Return value: @desktop_file's source URI + **/ +const char * +egg_desktop_file_get_source (EggDesktopFile *desktop_file) +{ + return desktop_file->source; +} + +/** + * egg_desktop_file_get_desktop_file_type: + * @desktop_file: an #EggDesktopFile + * + * Gets the desktop file type of @desktop_file. + * + * Return value: @desktop_file's type + **/ +EggDesktopFileType +egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file) +{ + return desktop_file->type; +} + +/** + * egg_desktop_file_get_name: + * @desktop_file: an #EggDesktopFile + * + * Gets the (localized) value of @desktop_file's "Name" key. + * + * Return value: the application/link name + **/ +const char * +egg_desktop_file_get_name (EggDesktopFile *desktop_file) +{ + return desktop_file->name; +} + +/** + * egg_desktop_file_get_icon: + * @desktop_file: an #EggDesktopFile + * + * Gets the value of @desktop_file's "Icon" key. + * + * If the icon string is a full path (that is, if g_path_is_absolute() + * returns %TRUE when called on it), it points to a file containing an + * unthemed icon. If the icon string is not a full path, it is the + * name of a themed icon, which can be looked up with %GtkIconTheme, + * or passed directly to a theme-aware widget like %GtkImage or + * %GtkCellRendererPixbuf. + * + * Return value: the icon path or name + **/ +const char * +egg_desktop_file_get_icon (EggDesktopFile *desktop_file) +{ + return desktop_file->icon; +} + +gboolean +egg_desktop_file_has_key (EggDesktopFile *desktop_file, + const char *key, + GError **error) +{ + return g_key_file_has_key (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, key, + error); +} + +char * +egg_desktop_file_get_string (EggDesktopFile *desktop_file, + const char *key, + GError **error) +{ + return g_key_file_get_string (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, key, + error); +} + +char * +egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, + const char *key, + const char *locale, + GError **error) +{ + return g_key_file_get_locale_string (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, key, locale, + error); +} + +gboolean +egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, + const char *key, + GError **error) +{ + return g_key_file_get_boolean (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, key, + error); +} + +double +egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, + const char *key, + GError **error) +{ + return g_key_file_get_double (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, key, + error); +} + +char ** +egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, + const char *key, + gsize *length, + GError **error) +{ + return g_key_file_get_string_list (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, key, length, + error); +} + +char ** +egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, + const char *key, + const char *locale, + gsize *length, + GError **error) +{ + return g_key_file_get_locale_string_list (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, key, + locale, length, + error); +} + +/** + * egg_desktop_file_can_launch: + * @desktop_file: an #EggDesktopFile + * @desktop_environment: the name of the running desktop environment, + * or %NULL + * + * Tests if @desktop_file can/should be launched in the current + * environment. If @desktop_environment is non-%NULL, @desktop_file's + * "OnlyShowIn" and "NotShowIn" keys are checked to make sure that + * this desktop_file is appropriate for the named environment. + * + * Furthermore, if @desktop_file has type + * %EGG_DESKTOP_FILE_TYPE_APPLICATION, its "TryExec" key (if any) is + * also checked, to make sure the binary it points to exists. + * + * egg_desktop_file_can_launch() does NOT check the value of the + * "Hidden" key. + * + * Return value: %TRUE if @desktop_file can be launched + **/ +gboolean +egg_desktop_file_can_launch (EggDesktopFile *desktop_file, + const char *desktop_environment) +{ + char *try_exec, *found_program; + char **only_show_in, **not_show_in; + gboolean found; + int i; + + if (desktop_file->type != EGG_DESKTOP_FILE_TYPE_APPLICATION && + desktop_file->type != EGG_DESKTOP_FILE_TYPE_LINK) + return FALSE; + + if (desktop_environment) + { + only_show_in = g_key_file_get_string_list (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN, + NULL, NULL); + if (only_show_in) + { + for (i = 0, found = FALSE; only_show_in[i] && !found; i++) + { + if (!strcmp (only_show_in[i], desktop_environment)) + found = TRUE; + } + + g_strfreev (only_show_in); + + if (!found) + return FALSE; + } + + not_show_in = g_key_file_get_string_list (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN, + NULL, NULL); + if (not_show_in) + { + for (i = 0, found = FALSE; not_show_in[i] && !found; i++) + { + if (!strcmp (not_show_in[i], desktop_environment)) + found = TRUE; + } + + g_strfreev (not_show_in); + + if (found) + return FALSE; + } + } + + if (desktop_file->type == EGG_DESKTOP_FILE_TYPE_APPLICATION) + { + try_exec = g_key_file_get_string (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_TRY_EXEC, + NULL); + if (try_exec) + { + found_program = g_find_program_in_path (try_exec); + g_free (try_exec); + + if (!found_program) + return FALSE; + g_free (found_program); + } + } + + return TRUE; +} + +/** + * egg_desktop_file_accepts_documents: + * @desktop_file: an #EggDesktopFile + * + * Tests if @desktop_file represents an application that can accept + * documents on the command line. + * + * Return value: %TRUE or %FALSE + **/ +gboolean +egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file) +{ + return desktop_file->document_code != 0; +} + +/** + * egg_desktop_file_accepts_multiple: + * @desktop_file: an #EggDesktopFile + * + * Tests if @desktop_file can accept multiple documents at once. + * + * If this returns %FALSE, you can still pass multiple documents to + * egg_desktop_file_launch(), but that will result in multiple copies + * of the application being launched. See egg_desktop_file_launch() + * for more details. + * + * Return value: %TRUE or %FALSE + **/ +gboolean +egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file) +{ + return (desktop_file->document_code == 'F' || + desktop_file->document_code == 'U'); +} + +/** + * egg_desktop_file_accepts_uris: + * @desktop_file: an #EggDesktopFile + * + * Tests if @desktop_file can accept (non-"file:") URIs as documents to + * open. + * + * Return value: %TRUE or %FALSE + **/ +gboolean +egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file) +{ + return (desktop_file->document_code == 'U' || + desktop_file->document_code == 'u'); +} + +static void +append_quoted_word (GString *str, + const char *s, + gboolean in_single_quotes, + gboolean in_double_quotes) +{ + const char *p; + + if (!in_single_quotes && !in_double_quotes) + g_string_append_c (str, '\''); + else if (!in_single_quotes && in_double_quotes) + g_string_append (str, "\"'"); + + if (!strchr (s, '\'')) + g_string_append (str, s); + else + { + for (p = s; *p != '\0'; p++) + { + if (*p == '\'') + g_string_append (str, "'\\''"); + else + g_string_append_c (str, *p); + } + } + + if (!in_single_quotes && !in_double_quotes) + g_string_append_c (str, '\''); + else if (!in_single_quotes && in_double_quotes) + g_string_append (str, "'\""); +} + +static void +do_percent_subst (EggDesktopFile *desktop_file, + char code, + GString *str, + GSList **documents, + gboolean in_single_quotes, + gboolean in_double_quotes) +{ + GSList *d; + char *doc; + + switch (code) + { + case '%': + g_string_append_c (str, '%'); + break; + + case 'F': + case 'U': + for (d = *documents; d; d = d->next) + { + doc = d->data; + g_string_append (str, " "); + append_quoted_word (str, doc, in_single_quotes, in_double_quotes); + } + *documents = NULL; + break; + + case 'f': + case 'u': + if (*documents) + { + doc = (*documents)->data; + g_string_append (str, " "); + append_quoted_word (str, doc, in_single_quotes, in_double_quotes); + *documents = (*documents)->next; + } + break; + + case 'i': + if (desktop_file->icon) + { + g_string_append (str, "--icon "); + append_quoted_word (str, desktop_file->icon, + in_single_quotes, in_double_quotes); + } + break; + + case 'c': + if (desktop_file->name) + { + append_quoted_word (str, desktop_file->name, + in_single_quotes, in_double_quotes); + } + break; + + case 'k': + if (desktop_file->source) + { + append_quoted_word (str, desktop_file->source, + in_single_quotes, in_double_quotes); + } + break; + + case 'D': + case 'N': + case 'd': + case 'n': + case 'v': + case 'm': + /* Deprecated; skip */ + break; + + default: + g_warning ("Unrecognized %%-code '%%%c' in Exec", code); + break; + } +} + +static char * +parse_exec (EggDesktopFile *desktop_file, + GSList **documents, + GError **error) +{ + char *exec, *p, *command; + gboolean escape, single_quot, double_quot; + GString *gs; + + exec = g_key_file_get_string (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_EXEC, + error); + if (!exec) + return NULL; + + /* Build the command */ + gs = g_string_new (NULL); + escape = single_quot = double_quot = FALSE; + + for (p = exec; *p != '\0'; p++) + { + if (escape) + { + escape = FALSE; + g_string_append_c (gs, *p); + } + else if (*p == '\\') + { + if (!single_quot) + escape = TRUE; + g_string_append_c (gs, *p); + } + else if (*p == '\'') + { + g_string_append_c (gs, *p); + if (!single_quot && !double_quot) + single_quot = TRUE; + else if (single_quot) + single_quot = FALSE; + } + else if (*p == '"') + { + g_string_append_c (gs, *p); + if (!single_quot && !double_quot) + double_quot = TRUE; + else if (double_quot) + double_quot = FALSE; + } + else if (*p == '%' && p[1]) + { + do_percent_subst (desktop_file, p[1], gs, documents, + single_quot, double_quot); + p++; + } + else + g_string_append_c (gs, *p); + } + + g_free (exec); + command = g_string_free (gs, FALSE); + + /* Prepend "xdg-terminal " if needed (FIXME: use gvfs) */ + if (g_key_file_has_key (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_TERMINAL, + NULL)) + { + GError *terminal_error = NULL; + gboolean use_terminal = + g_key_file_get_boolean (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_TERMINAL, + &terminal_error); + if (terminal_error) + { + g_free (command); + g_propagate_error (error, terminal_error); + return NULL; + } + + if (use_terminal) + { + gs = g_string_new ("xdg-terminal "); + append_quoted_word (gs, command, FALSE, FALSE); + g_free (command); + command = g_string_free (gs, FALSE); + } + } + + return command; +} + +static GSList * +translate_document_list (EggDesktopFile *desktop_file, GSList *documents) +{ + gboolean accepts_uris = egg_desktop_file_accepts_uris (desktop_file); + GSList *ret, *d; + + for (d = documents, ret = NULL; d; d = d->next) + { + const char *document = d->data; + gboolean is_uri = !g_path_is_absolute (document); + char *translated; + + if (accepts_uris) + { + if (is_uri) + translated = g_strdup (document); + else + translated = g_filename_to_uri (document, NULL, NULL); + } + else + { + if (is_uri) + translated = g_filename_from_uri (document, NULL, NULL); + else + translated = g_strdup (document); + } + + if (translated) + ret = g_slist_prepend (ret, translated); + } + + return g_slist_reverse (ret); +} + +static void +free_document_list (GSList *documents) +{ + GSList *d; + + for (d = documents; d; d = d->next) + g_free (d->data); + g_slist_free (documents); +} + +/** + * egg_desktop_file_parse_exec: + * @desktop_file: a #EggDesktopFile + * @documents: a list of document paths or URIs + * @error: error pointer + * + * Parses @desktop_file's Exec key, inserting @documents into it, and + * returns the result. + * + * If @documents contains non-file: URIs and @desktop_file does not + * accept URIs, those URIs will be ignored. Likewise, if @documents + * contains more elements than @desktop_file accepts, the extra + * documents will be ignored. + * + * Return value: the parsed Exec string + **/ +char * +egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, + GSList *documents, + GError **error) +{ + GSList *translated, *docs; + char *command; + + docs = translated = translate_document_list (desktop_file, documents); + command = parse_exec (desktop_file, &docs, error); + free_document_list (translated); + + return command; +} + +static gboolean +parse_link (EggDesktopFile *desktop_file, + EggDesktopFile **app_desktop_file, + GSList **documents, + GError **error) +{ + char *url; + GKeyFile *key_file; + + url = g_key_file_get_string (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_URL, + error); + if (!url) + return FALSE; + *documents = g_slist_prepend (NULL, url); + + /* FIXME: use gvfs */ + key_file = g_key_file_new (); + g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_NAME, + "xdg-open"); + g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_TYPE, + "Application"); + g_key_file_set_string (key_file, EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_EXEC, + "xdg-open %u"); + *app_desktop_file = egg_desktop_file_new_from_key_file (key_file, NULL, NULL); + return TRUE; +} + +#if GTK_CHECK_VERSION (2, 12, 0) +static char * +start_startup_notification (GdkDisplay *display, + EggDesktopFile *desktop_file, + const char *argv0, + int screen, + int workspace, + guint32 launch_time) +{ + static int sequence = 0; + char *startup_id; + char *description, *wmclass; + char *screen_str, *workspace_str; + + if (g_key_file_has_key (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, + NULL)) + { + if (!g_key_file_get_boolean (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY, + NULL)) + return NULL; + wmclass = NULL; + } + else + { + wmclass = g_key_file_get_string (desktop_file->key_file, + EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS, + NULL); + if (!wmclass) + return NULL; + } + + if (launch_time == (guint32)-1) + launch_time = gdk_x11_display_get_user_time (display); + startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu", + g_get_prgname (), + (unsigned long)getpid (), + g_get_host_name (), + argv0, + sequence++, + (unsigned long)launch_time); + + description = g_strdup_printf (_("Starting %s"), desktop_file->name); + screen_str = g_strdup_printf ("%d", screen); + workspace_str = workspace == -1 ? NULL : g_strdup_printf ("%d", workspace); + + gdk_x11_display_broadcast_startup_message (display, "new", + "ID", startup_id, + "NAME", desktop_file->name, + "SCREEN", screen_str, + "BIN", argv0, + "ICON", desktop_file->icon, + "DESKTOP", workspace_str, + "DESCRIPTION", description, + "WMCLASS", wmclass, + NULL); + + g_free (description); + g_free (wmclass); + g_free (screen_str); + g_free (workspace_str); + + return startup_id; +} + +static void +end_startup_notification (GdkDisplay *display, + const char *startup_id) +{ + gdk_x11_display_broadcast_startup_message (display, "remove", + "ID", startup_id, + NULL); +} + +#define EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH (30 /* seconds */) + +typedef struct { + GdkDisplay *display; + char *startup_id; +} StartupNotificationData; + +static gboolean +startup_notification_timeout (gpointer data) +{ + StartupNotificationData *sn_data = data; + + end_startup_notification (sn_data->display, sn_data->startup_id); + g_object_unref (sn_data->display); + g_free (sn_data->startup_id); + g_free (sn_data); + + return FALSE; +} + +static void +set_startup_notification_timeout (GdkDisplay *display, + const char *startup_id) +{ + StartupNotificationData *sn_data; + + sn_data = g_new (StartupNotificationData, 1); + sn_data->display = g_object_ref (display); + sn_data->startup_id = g_strdup (startup_id); + + g_timeout_add_seconds (EGG_DESKTOP_FILE_SN_TIMEOUT_LENGTH, + startup_notification_timeout, sn_data); +} +#endif /* GTK 2.12 */ + +static GPtrArray * +array_putenv (GPtrArray *env, char *variable) +{ + guint i, keylen; + + if (!env) + { + char **envp; + + env = g_ptr_array_new (); + + envp = g_listenv (); + for (i = 0; envp[i]; i++) + { + const char *value; + + value = g_getenv (envp[i]); + g_ptr_array_add (env, g_strdup_printf ("%s=%s", envp[i], + value ? value : "")); + } + g_strfreev (envp); + } + + keylen = strcspn (variable, "="); + + /* Remove old value of key */ + for (i = 0; i < env->len; i++) + { + char *envvar = env->pdata[i]; + + if (!strncmp (envvar, variable, keylen) && envvar[keylen] == '=') + { + g_free (envvar); + g_ptr_array_remove_index_fast (env, i); + break; + } + } + + /* Add new value */ + g_ptr_array_add (env, g_strdup (variable)); + + return env; +} + +static gboolean +egg_desktop_file_launchv (EggDesktopFile *desktop_file, + GSList *documents, va_list args, + GError **error) +{ + EggDesktopFileLaunchOption option; + GSList *translated_documents = NULL, *docs = NULL; + char *command, **argv; + int argc, i, screen_num; + gboolean success, current_success; + GdkDisplay *display; + char *startup_id; + + GPtrArray *env = NULL; + char **variables = NULL; + GdkScreen *screen = NULL; + int workspace = -1; + const char *directory = NULL; + guint32 launch_time = (guint32)-1; + GSpawnFlags flags = G_SPAWN_SEARCH_PATH; + GSpawnChildSetupFunc setup_func = NULL; + gpointer setup_data = NULL; + + GPid *ret_pid = NULL; + int *ret_stdin = NULL, *ret_stdout = NULL, *ret_stderr = NULL; + char **ret_startup_id = NULL; + + if (documents && desktop_file->document_code == 0) + { + g_set_error (error, EGG_DESKTOP_FILE_ERROR, + EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, + _("Application does not accept documents on command line")); + return FALSE; + } + + /* Read the options: technically it's incorrect for the caller to + * NULL-terminate the list of options (rather than 0-terminating + * it), but NULL-terminating lets us use G_GNUC_NULL_TERMINATED, + * it's more consistent with other glib/gtk methods, and it will + * work as long as sizeof (int) <= sizeof (NULL), and NULL is + * represented as 0. (Which is true everywhere we care about.) + */ + while ((option = va_arg (args, EggDesktopFileLaunchOption))) + { + switch (option) + { + case EGG_DESKTOP_FILE_LAUNCH_CLEARENV: + if (env) + g_ptr_array_free (env, TRUE); + env = g_ptr_array_new (); + break; + case EGG_DESKTOP_FILE_LAUNCH_PUTENV: + variables = va_arg (args, char **); + for (i = 0; variables[i]; i++) + env = array_putenv (env, variables[i]); + break; + + case EGG_DESKTOP_FILE_LAUNCH_SCREEN: + screen = va_arg (args, GdkScreen *); + break; + case EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: + workspace = va_arg (args, int); + break; + + case EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: + directory = va_arg (args, const char *); + break; + case EGG_DESKTOP_FILE_LAUNCH_TIME: + launch_time = va_arg (args, guint32); + break; + case EGG_DESKTOP_FILE_LAUNCH_FLAGS: + flags |= va_arg (args, GSpawnFlags); + /* Make sure they didn't set any flags that don't make sense. */ + flags &= ~G_SPAWN_FILE_AND_ARGV_ZERO; + break; + case EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC: + setup_func = va_arg (args, GSpawnChildSetupFunc); + setup_data = va_arg (args, gpointer); + break; + + case EGG_DESKTOP_FILE_LAUNCH_RETURN_PID: + ret_pid = va_arg (args, GPid *); + break; + case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE: + ret_stdin = va_arg (args, int *); + break; + case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE: + ret_stdout = va_arg (args, int *); + break; + case EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE: + ret_stderr = va_arg (args, int *); + break; + case EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID: + ret_startup_id = va_arg (args, char **); + break; + + default: + g_set_error (error, EGG_DESKTOP_FILE_ERROR, + EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION, + _("Unrecognized launch option: %d"), + GPOINTER_TO_INT (option)); + success = FALSE; + goto out; + } + } + + if (screen) + { + char *display_name = gdk_screen_make_display_name (screen); + char *display_env = g_strdup_printf ("DISPLAY=%s", display_name); + env = array_putenv (env, display_env); + g_free (display_name); + g_free (display_env); + + display = gdk_screen_get_display (screen); + } + else + { + display = gdk_display_get_default (); + screen = gdk_display_get_default_screen (display); + } + screen_num = gdk_screen_get_number (screen); + + translated_documents = translate_document_list (desktop_file, documents); + docs = translated_documents; + + success = FALSE; + + do + { + command = parse_exec (desktop_file, &docs, error); + if (!command) + goto out; + + if (!g_shell_parse_argv (command, &argc, &argv, error)) + { + g_free (command); + goto out; + } + g_free (command); + +#if GTK_CHECK_VERSION (2, 12, 0) + startup_id = start_startup_notification (display, desktop_file, + argv[0], screen_num, + workspace, launch_time); + if (startup_id) + { + char *startup_id_env = g_strdup_printf ("DESKTOP_STARTUP_ID=%s", + startup_id); + env = array_putenv (env, startup_id_env); + g_free (startup_id_env); + } +#else + startup_id = NULL; +#endif /* GTK 2.12 */ + + if (env != NULL) + g_ptr_array_add (env, NULL); + + current_success = + g_spawn_async_with_pipes (directory, + argv, + env ? (char **)(env->pdata) : NULL, + flags, + setup_func, setup_data, + ret_pid, + ret_stdin, ret_stdout, ret_stderr, + error); + g_strfreev (argv); + + if (startup_id) + { +#if GTK_CHECK_VERSION (2, 12, 0) + if (current_success) + { + set_startup_notification_timeout (display, startup_id); + + if (ret_startup_id) + *ret_startup_id = startup_id; + else + g_free (startup_id); + } + else +#endif /* GTK 2.12 */ + g_free (startup_id); + } + else if (ret_startup_id) + *ret_startup_id = NULL; + + if (current_success) + { + /* If we successfully launch any instances of the app, make + * sure we return TRUE and don't set @error. + */ + success = TRUE; + error = NULL; + + /* Also, only set the output params on the first one */ + ret_pid = NULL; + ret_stdin = ret_stdout = ret_stderr = NULL; + ret_startup_id = NULL; + } + } + while (docs && current_success); + + out: + if (env) + { + g_ptr_array_foreach (env, (GFunc)g_free, NULL); + g_ptr_array_free (env, TRUE); + } + free_document_list (translated_documents); + + return success; +} + +/** + * egg_desktop_file_launch: + * @desktop_file: an #EggDesktopFile + * @documents: a list of URIs or paths to documents to open + * @error: error pointer + * @...: additional options + * + * Launches @desktop_file with the given arguments. Additional options + * can be specified as follows: + * + * %EGG_DESKTOP_FILE_LAUNCH_CLEARENV: (no arguments) + * clears the environment in the child process + * %EGG_DESKTOP_FILE_LAUNCH_PUTENV: (char **variables) + * adds the NAME=VALUE strings in the given %NULL-terminated + * array to the child process's environment + * %EGG_DESKTOP_FILE_LAUNCH_SCREEN: (GdkScreen *screen) + * causes the application to be launched on the given screen + * %EGG_DESKTOP_FILE_LAUNCH_WORKSPACE: (int workspace) + * causes the application to be launched on the given workspace + * %EGG_DESKTOP_FILE_LAUNCH_DIRECTORY: (char *dir) + * causes the application to be launched in the given directory + * %EGG_DESKTOP_FILE_LAUNCH_TIME: (guint32 launch_time) + * sets the "launch time" for the application. If the user + * interacts with another window after @launch_time but before + * the launched application creates its first window, the window + * manager may choose to not give focus to the new application. + * Passing 0 for @launch_time will explicitly request that the + * application not receive focus. + * %EGG_DESKTOP_FILE_LAUNCH_FLAGS (GSpawnFlags flags) + * Sets additional #GSpawnFlags to use. See g_spawn_async() for + * more details. + * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC (GSpawnChildSetupFunc, gpointer) + * Sets the child setup callback and the data to pass to it. + * (See g_spawn_async() for more details.) + * + * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID (GPid **pid) + * On a successful launch, sets *@pid to the PID of the launched + * application. + * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID (char **startup_id) + * On a successful launch, sets *@startup_id to the Startup + * Notification "startup id" of the launched application. + * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE (int *fd) + * On a successful launch, sets *@fd to the file descriptor of + * a pipe connected to the application's stdin. + * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE (int *fd) + * On a successful launch, sets *@fd to the file descriptor of + * a pipe connected to the application's stdout. + * %EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE (int *fd) + * On a successful launch, sets *@fd to the file descriptor of + * a pipe connected to the application's stderr. + * + * The options should be terminated with a single %NULL. + * + * If @documents contains multiple documents, but + * egg_desktop_file_accepts_multiple() returns %FALSE for + * @desktop_file, then egg_desktop_file_launch() will actually launch + * multiple instances of the application. In that case, the return + * value (as well as any values passed via + * %EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, etc) will only reflect the + * first instance of the application that was launched (but the + * %EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC will be called for each + * instance). + * + * Return value: %TRUE if the application was successfully launched. + **/ +gboolean +egg_desktop_file_launch (EggDesktopFile *desktop_file, + GSList *documents, GError **error, + ...) +{ + va_list args; + gboolean success; + EggDesktopFile *app_desktop_file; + + switch (desktop_file->type) + { + case EGG_DESKTOP_FILE_TYPE_APPLICATION: + va_start (args, error); + success = egg_desktop_file_launchv (desktop_file, documents, + args, error); + va_end (args); + break; + + case EGG_DESKTOP_FILE_TYPE_LINK: + if (documents) + { + g_set_error (error, EGG_DESKTOP_FILE_ERROR, + EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, + _("Can't pass document URIs to a 'Type=Link' desktop entry")); + return FALSE; + } + + if (!parse_link (desktop_file, &app_desktop_file, &documents, error)) + return FALSE; + + va_start (args, error); + success = egg_desktop_file_launchv (app_desktop_file, documents, + args, error); + va_end (args); + + egg_desktop_file_free (app_desktop_file); + free_document_list (documents); + break; + + case EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED: + case EGG_DESKTOP_FILE_TYPE_DIRECTORY: + default: + g_set_error (error, EGG_DESKTOP_FILE_ERROR, + EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, + _("Not a launchable item")); + success = FALSE; + break; + } + + return success; +} + + +GQuark +egg_desktop_file_error_quark (void) +{ + return g_quark_from_static_string ("egg-desktop_file-error-quark"); +} + + +G_LOCK_DEFINE_STATIC (egg_desktop_file); +static EggDesktopFile *egg_desktop_file; + +static void +egg_set_desktop_file_internal (const char *desktop_file_path, + gboolean set_defaults) +{ + GError *error = NULL; + + G_LOCK (egg_desktop_file); + if (egg_desktop_file) + egg_desktop_file_free (egg_desktop_file); + + egg_desktop_file = egg_desktop_file_new (desktop_file_path, &error); + if (error) + { + g_warning ("Could not load desktop file '%s': %s", + desktop_file_path, error->message); + g_error_free (error); + } + + if (set_defaults && egg_desktop_file != NULL) { + /* Set localized application name and default window icon */ + if (egg_desktop_file->name) + g_set_application_name (egg_desktop_file->name); + if (egg_desktop_file->icon) + { + if (g_path_is_absolute (egg_desktop_file->icon)) + gtk_window_set_default_icon_from_file (egg_desktop_file->icon, NULL); + else + gtk_window_set_default_icon_name (egg_desktop_file->icon); + } + } + + G_UNLOCK (egg_desktop_file); +} + +/** + * egg_set_desktop_file: + * @desktop_file_path: path to the application's desktop file + * + * Creates an #EggDesktopFile for the application from the data at + * @desktop_file_path. This will also call g_set_application_name() + * with the localized application name from the desktop file, and + * gtk_window_set_default_icon_name() or + * gtk_window_set_default_icon_from_file() with the application's + * icon. Other code may use additional information from the desktop + * file. + * See egg_set_desktop_file_without_defaults() for a variant of this + * function that does not set the application name and default window + * icon. + * + * Note that for thread safety reasons, this function can only + * be called once, and is mutually exclusive with calling + * egg_set_desktop_file_without_defaults(). + **/ +void +egg_set_desktop_file (const char *desktop_file_path) +{ + egg_set_desktop_file_internal (desktop_file_path, TRUE); +} + +/** + * egg_set_desktop_file_without_defaults: + * @desktop_file_path: path to the application's desktop file + * + * Creates an #EggDesktopFile for the application from the data at + * @desktop_file_path. + * See egg_set_desktop_file() for a variant of this function that + * sets the application name and default window icon from the information + * in the desktop file. + * + * Note that for thread safety reasons, this function can only + * be called once, and is mutually exclusive with calling + * egg_set_desktop_file(). + **/ +void +egg_set_desktop_file_without_defaults (const char *desktop_file_path) +{ + egg_set_desktop_file_internal (desktop_file_path, FALSE); +} + +/** + * egg_get_desktop_file: + * + * Gets the application's #EggDesktopFile, as set by + * egg_set_desktop_file(). + * + * Return value: the #EggDesktopFile, or %NULL if it hasn't been set. + **/ +EggDesktopFile * +egg_get_desktop_file (void) +{ + EggDesktopFile *retval; + + G_LOCK (egg_desktop_file); + retval = egg_desktop_file; + G_UNLOCK (egg_desktop_file); + + return retval; +} diff --git a/gedit/smclient/eggdesktopfile.h b/gedit/smclient/eggdesktopfile.h new file mode 100755 index 00000000..18fe4631 --- /dev/null +++ b/gedit/smclient/eggdesktopfile.h @@ -0,0 +1,160 @@ +/* eggdesktopfile.h - Freedesktop.Org Desktop Files + * Copyright (C) 2007 Novell, Inc. + * + * This library 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 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 59 Temple Place - + * Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __EGG_DESKTOP_FILE_H__ +#define __EGG_DESKTOP_FILE_H__ + +#include + +G_BEGIN_DECLS + +typedef struct EggDesktopFile EggDesktopFile; + +typedef enum { + EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED, + + EGG_DESKTOP_FILE_TYPE_APPLICATION, + EGG_DESKTOP_FILE_TYPE_LINK, + EGG_DESKTOP_FILE_TYPE_DIRECTORY +} EggDesktopFileType; + +EggDesktopFile *egg_desktop_file_new (const char *desktop_file_path, + GError **error); + +EggDesktopFile *egg_desktop_file_new_from_data_dirs (const char *desktop_file_path, + GError **error); +EggDesktopFile *egg_desktop_file_new_from_dirs (const char *desktop_file_path, + const char **search_dirs, + GError **error); +EggDesktopFile *egg_desktop_file_new_from_key_file (GKeyFile *key_file, + const char *source, + GError **error); + +void egg_desktop_file_free (EggDesktopFile *desktop_file); + +const char *egg_desktop_file_get_source (EggDesktopFile *desktop_file); + +EggDesktopFileType egg_desktop_file_get_desktop_file_type (EggDesktopFile *desktop_file); + +const char *egg_desktop_file_get_name (EggDesktopFile *desktop_file); +const char *egg_desktop_file_get_icon (EggDesktopFile *desktop_file); + +gboolean egg_desktop_file_can_launch (EggDesktopFile *desktop_file, + const char *desktop_environment); + +gboolean egg_desktop_file_accepts_documents (EggDesktopFile *desktop_file); +gboolean egg_desktop_file_accepts_multiple (EggDesktopFile *desktop_file); +gboolean egg_desktop_file_accepts_uris (EggDesktopFile *desktop_file); + +char *egg_desktop_file_parse_exec (EggDesktopFile *desktop_file, + GSList *documents, + GError **error); + +gboolean egg_desktop_file_launch (EggDesktopFile *desktop_file, + GSList *documents, + GError **error, + ...) G_GNUC_NULL_TERMINATED; + +typedef enum { + EGG_DESKTOP_FILE_LAUNCH_CLEARENV = 1, + EGG_DESKTOP_FILE_LAUNCH_PUTENV, + EGG_DESKTOP_FILE_LAUNCH_SCREEN, + EGG_DESKTOP_FILE_LAUNCH_WORKSPACE, + EGG_DESKTOP_FILE_LAUNCH_DIRECTORY, + EGG_DESKTOP_FILE_LAUNCH_TIME, + EGG_DESKTOP_FILE_LAUNCH_FLAGS, + EGG_DESKTOP_FILE_LAUNCH_SETUP_FUNC, + EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, + EGG_DESKTOP_FILE_LAUNCH_RETURN_STDIN_PIPE, + EGG_DESKTOP_FILE_LAUNCH_RETURN_STDOUT_PIPE, + EGG_DESKTOP_FILE_LAUNCH_RETURN_STDERR_PIPE, + EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID +} EggDesktopFileLaunchOption; + +/* Standard Keys */ +#define EGG_DESKTOP_FILE_GROUP "Desktop Entry" + +#define EGG_DESKTOP_FILE_KEY_TYPE "Type" +#define EGG_DESKTOP_FILE_KEY_VERSION "Version" +#define EGG_DESKTOP_FILE_KEY_NAME "Name" +#define EGG_DESKTOP_FILE_KEY_GENERIC_NAME "GenericName" +#define EGG_DESKTOP_FILE_KEY_NO_DISPLAY "NoDisplay" +#define EGG_DESKTOP_FILE_KEY_COMMENT "Comment" +#define EGG_DESKTOP_FILE_KEY_ICON "Icon" +#define EGG_DESKTOP_FILE_KEY_HIDDEN "Hidden" +#define EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN "OnlyShowIn" +#define EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN "NotShowIn" +#define EGG_DESKTOP_FILE_KEY_TRY_EXEC "TryExec" +#define EGG_DESKTOP_FILE_KEY_EXEC "Exec" +#define EGG_DESKTOP_FILE_KEY_PATH "Path" +#define EGG_DESKTOP_FILE_KEY_TERMINAL "Terminal" +#define EGG_DESKTOP_FILE_KEY_MIME_TYPE "MimeType" +#define EGG_DESKTOP_FILE_KEY_CATEGORIES "Categories" +#define EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY "StartupNotify" +#define EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS "StartupWMClass" +#define EGG_DESKTOP_FILE_KEY_URL "URL" + +/* Accessors */ +gboolean egg_desktop_file_has_key (EggDesktopFile *desktop_file, + const char *key, + GError **error); +char *egg_desktop_file_get_string (EggDesktopFile *desktop_file, + const char *key, + GError **error) G_GNUC_MALLOC; +char *egg_desktop_file_get_locale_string (EggDesktopFile *desktop_file, + const char *key, + const char *locale, + GError **error) G_GNUC_MALLOC; +gboolean egg_desktop_file_get_boolean (EggDesktopFile *desktop_file, + const char *key, + GError **error); +double egg_desktop_file_get_numeric (EggDesktopFile *desktop_file, + const char *key, + GError **error); +char **egg_desktop_file_get_string_list (EggDesktopFile *desktop_file, + const char *key, + gsize *length, + GError **error) G_GNUC_MALLOC; +char **egg_desktop_file_get_locale_string_list (EggDesktopFile *desktop_file, + const char *key, + const char *locale, + gsize *length, + GError **error) G_GNUC_MALLOC; + + +/* Errors */ +#define EGG_DESKTOP_FILE_ERROR egg_desktop_file_error_quark() + +GQuark egg_desktop_file_error_quark (void); + +typedef enum { + EGG_DESKTOP_FILE_ERROR_INVALID, + EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE, + EGG_DESKTOP_FILE_ERROR_UNRECOGNIZED_OPTION +} EggDesktopFileError; + +/* Global application desktop file */ +void egg_set_desktop_file (const char *desktop_file_path); +void egg_set_desktop_file_without_defaults (const char *desktop_file_path); +EggDesktopFile *egg_get_desktop_file (void); + + +G_END_DECLS + +#endif /* __EGG_DESKTOP_FILE_H__ */ diff --git a/gedit/smclient/eggsmclient-osx.c b/gedit/smclient/eggsmclient-osx.c new file mode 100755 index 00000000..7d3ff4b6 --- /dev/null +++ b/gedit/smclient/eggsmclient-osx.c @@ -0,0 +1,235 @@ +/* + * Copyright (C) 2007 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + * + * 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, + * Boston, MA 02111-1307, USA. + */ + +/* EggSMClientOSX + * + * For details on the OS X logout process, see: + * http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/BootProcess.html#//apple_ref/doc/uid/20002130-114618 + * + * EggSMClientOSX registers for the kAEQuitApplication AppleEvent; the + * handler we register (quit_requested()) will be invoked from inside + * the quartz event-handling code (specifically, from inside + * [NSApplication nextEventMatchingMask]) when an AppleEvent arrives. + * We use AESuspendTheCurrentEvent() and AEResumeTheCurrentEvent() to + * allow asynchronous / non-main-loop-reentering processing of the + * quit request. (These are part of the Carbon framework; it doesn't + * seem to be possible to handle AppleEvents asynchronously from + * Cocoa.) + */ + +#include "config.h" + +#include "eggsmclient-private.h" +#include +#include +#include + +#define EGG_TYPE_SM_CLIENT_OSX (egg_sm_client_osx_get_type ()) +#define EGG_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSX)) +#define EGG_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass)) +#define EGG_IS_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_OSX)) +#define EGG_IS_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_OSX)) +#define EGG_SM_CLIENT_OSX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass)) + +typedef struct _EggSMClientOSX EggSMClientOSX; +typedef struct _EggSMClientOSXClass EggSMClientOSXClass; + +struct _EggSMClientOSX { + EggSMClient parent; + + AppleEvent quit_event, quit_reply; + gboolean quit_requested, quitting; +}; + +struct _EggSMClientOSXClass +{ + EggSMClientClass parent_class; + +}; + +static void sm_client_osx_startup (EggSMClient *client, + const char *client_id); +static void sm_client_osx_will_quit (EggSMClient *client, + gboolean will_quit); +static gboolean sm_client_osx_end_session (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation); + +static pascal OSErr quit_requested (const AppleEvent *, AppleEvent *, long); + +G_DEFINE_TYPE (EggSMClientOSX, egg_sm_client_osx, EGG_TYPE_SM_CLIENT) + +static void +egg_sm_client_osx_init (EggSMClientOSX *osx) +{ + ; +} + +static void +egg_sm_client_osx_class_init (EggSMClientOSXClass *klass) +{ + EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass); + + sm_client_class->startup = sm_client_osx_startup; + sm_client_class->will_quit = sm_client_osx_will_quit; + sm_client_class->end_session = sm_client_osx_end_session; +} + +EggSMClient * +egg_sm_client_osx_new (void) +{ + return g_object_new (EGG_TYPE_SM_CLIENT_OSX, NULL); +} + +static void +sm_client_osx_startup (EggSMClient *client, + const char *client_id) +{ + AEInstallEventHandler (kCoreEventClass, kAEQuitApplication, + NewAEEventHandlerUPP (quit_requested), + (long)GPOINTER_TO_SIZE (client), false); +} + +static gboolean +idle_quit_requested (gpointer client) +{ + egg_sm_client_quit_requested (client); + return FALSE; +} + +static pascal OSErr +quit_requested (const AppleEvent *aevt, AppleEvent *reply, long refcon) +{ + EggSMClient *client = GSIZE_TO_POINTER ((gsize)refcon); + EggSMClientOSX *osx = GSIZE_TO_POINTER ((gsize)refcon); + + g_return_val_if_fail (!osx->quit_requested, userCanceledErr); + + /* FIXME AEInteractWithUser? */ + + osx->quit_requested = TRUE; + AEDuplicateDesc (aevt, &osx->quit_event); + AEDuplicateDesc (reply, &osx->quit_reply); + AESuspendTheCurrentEvent (aevt); + + /* Don't emit the "quit_requested" signal immediately, since we're + * called from a weird point in the guts of gdkeventloop-quartz.c + */ + g_idle_add (idle_quit_requested, client); + return noErr; +} + +static pascal OSErr +quit_requested_resumed (const AppleEvent *aevt, AppleEvent *reply, long refcon) +{ + EggSMClientOSX *osx = GSIZE_TO_POINTER ((gsize)refcon); + + osx->quit_requested = FALSE; + return osx->quitting ? noErr : userCanceledErr; +} + +static gboolean +idle_will_quit (gpointer client) +{ + EggSMClientOSX *osx = (EggSMClientOSX *)client; + + /* Resume the event with a new handler that will return a value to + * the system. + */ + AEResumeTheCurrentEvent (&osx->quit_event, &osx->quit_reply, + NewAEEventHandlerUPP (quit_requested_resumed), + (long)GPOINTER_TO_SIZE (client)); + AEDisposeDesc (&osx->quit_event); + AEDisposeDesc (&osx->quit_reply); + + if (osx->quitting) + egg_sm_client_quit (client); + return FALSE; +} + +static void +sm_client_osx_will_quit (EggSMClient *client, + gboolean will_quit) +{ + EggSMClientOSX *osx = (EggSMClientOSX *)client; + + g_return_if_fail (osx->quit_requested); + + osx->quitting = will_quit; + + /* Finish in an idle handler since the caller might have called + * egg_sm_client_will_quit() from inside the "quit_requested" signal + * handler, but may not expect the "quit" signal to arrive during + * the _will_quit() call. + */ + g_idle_add (idle_will_quit, client); +} + +static gboolean +sm_client_osx_end_session (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation) +{ + static const ProcessSerialNumber loginwindow_psn = { 0, kSystemProcess }; + AppleEvent event = { typeNull, NULL }, reply = { typeNull, NULL }; + AEAddressDesc target; + AEEventID id; + OSErr err; + + switch (style) + { + case EGG_SM_CLIENT_END_SESSION_DEFAULT: + case EGG_SM_CLIENT_LOGOUT: + id = request_confirmation ? kAELogOut : kAEReallyLogOut; + break; + case EGG_SM_CLIENT_REBOOT: + id = request_confirmation ? kAEShowRestartDialog : kAERestart; + break; + case EGG_SM_CLIENT_SHUTDOWN: + id = request_confirmation ? kAEShowShutdownDialog : kAEShutDown; + break; + } + + err = AECreateDesc (typeProcessSerialNumber, &loginwindow_psn, + sizeof (loginwindow_psn), &target); + if (err != noErr) + { + g_warning ("Could not create descriptor for loginwindow: %d", err); + return FALSE; + } + + err = AECreateAppleEvent (kCoreEventClass, id, &target, + kAutoGenerateReturnID, kAnyTransactionID, + &event); + AEDisposeDesc (&target); + if (err != noErr) + { + g_warning ("Could not create logout AppleEvent: %d", err); + return FALSE; + } + + err = AESend (&event, &reply, kAENoReply, kAENormalPriority, + kAEDefaultTimeout, NULL, NULL); + AEDisposeDesc (&event); + if (err == noErr) + AEDisposeDesc (&reply); + + return err == noErr; +} diff --git a/gedit/smclient/eggsmclient-private.h b/gedit/smclient/eggsmclient-private.h new file mode 100755 index 00000000..ccb10bfc --- /dev/null +++ b/gedit/smclient/eggsmclient-private.h @@ -0,0 +1,53 @@ +/* eggsmclient-private.h + * Copyright (C) 2007 Novell, Inc. + * + * This library 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 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __EGG_SM_CLIENT_PRIVATE_H__ +#define __EGG_SM_CLIENT_PRIVATE_H__ + +#include +#include "eggsmclient.h" + +G_BEGIN_DECLS + +GKeyFile *egg_sm_client_save_state (EggSMClient *client); +void egg_sm_client_quit_requested (EggSMClient *client); +void egg_sm_client_quit_cancelled (EggSMClient *client); +void egg_sm_client_quit (EggSMClient *client); + +#if defined (GDK_WINDOWING_X11) +# ifdef EGG_SM_CLIENT_BACKEND_XSMP +GType egg_sm_client_xsmp_get_type (void); +EggSMClient *egg_sm_client_xsmp_new (void); +# endif +# ifdef EGG_SM_CLIENT_BACKEND_DBUS +GType egg_sm_client_dbus_get_type (void); +EggSMClient *egg_sm_client_dbus_new (void); +# endif +#elif defined (GDK_WINDOWING_WIN32) +GType egg_sm_client_win32_get_type (void); +EggSMClient *egg_sm_client_win32_new (void); +#elif defined (GDK_WINDOWING_QUARTZ) +GType egg_sm_client_osx_get_type (void); +EggSMClient *egg_sm_client_osx_new (void); +#endif + +G_END_DECLS + + +#endif /* __EGG_SM_CLIENT_PRIVATE_H__ */ diff --git a/gedit/smclient/eggsmclient-win32.c b/gedit/smclient/eggsmclient-win32.c new file mode 100755 index 00000000..91a25715 --- /dev/null +++ b/gedit/smclient/eggsmclient-win32.c @@ -0,0 +1,353 @@ +/* + * Copyright (C) 2007 Novell, Inc. + * + * 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, + * Boston, MA 02111-1307, USA. + */ + +/* EggSMClientWin32 + * + * For details on the Windows XP logout process, see: + * http://msdn.microsoft.com/en-us/library/aa376876.aspx. + * + * Vista adds some new APIs which EggSMClient does not make use of; see + * http://msdn.microsoft.com/en-us/library/ms700677(VS.85).aspx + * + * When shutting down, Windows sends every top-level window a + * WM_QUERYENDSESSION event, which the application must respond to + * synchronously, saying whether or not it will quit. To avoid main + * loop re-entrancy problems (and to avoid having to muck about too + * much with the guts of the gdk-win32 main loop), we watch for this + * event in a separate thread, which then signals the main thread and + * waits for the main thread to handle the event. Since we don't want + * to require g_thread_init() to be called, we do this all using + * Windows-specific thread methods. + * + * After the application handles the WM_QUERYENDSESSION event, + * Windows then sends it a WM_ENDSESSION event with a TRUE or FALSE + * parameter indicating whether the session is or is not actually + * going to end now. We handle this from the other thread as well. + * + * As mentioned above, Vista introduces several additional new APIs + * that don't fit into the (current) EggSMClient API. Windows also has + * an entirely separate shutdown-notification scheme for non-GUI apps, + * which we also don't handle here. + */ + +#include "config.h" + +#include "eggsmclient-private.h" +#include + +#define WIN32_LEAN_AND_MEAN +#define UNICODE +#include +#include + +#define EGG_TYPE_SM_CLIENT_WIN32 (egg_sm_client_win32_get_type ()) +#define EGG_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32)) +#define EGG_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class)) +#define EGG_IS_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_WIN32)) +#define EGG_IS_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_WIN32)) +#define EGG_SM_CLIENT_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class)) + +typedef struct _EggSMClientWin32 EggSMClientWin32; +typedef struct _EggSMClientWin32Class EggSMClientWin32Class; + +struct _EggSMClientWin32 { + EggSMClient parent; + + HANDLE message_event, response_event; + + volatile GSourceFunc event; + volatile gboolean will_quit; +}; + +struct _EggSMClientWin32Class +{ + EggSMClientClass parent_class; + +}; + +static void sm_client_win32_startup (EggSMClient *client, + const char *client_id); +static void sm_client_win32_will_quit (EggSMClient *client, + gboolean will_quit); +static gboolean sm_client_win32_end_session (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation); + +static GSource *g_win32_handle_source_add (HANDLE handle, GSourceFunc callback, + gpointer user_data); +static gboolean got_message (gpointer user_data); +static void sm_client_thread (gpointer data); + +G_DEFINE_TYPE (EggSMClientWin32, egg_sm_client_win32, EGG_TYPE_SM_CLIENT) + +static void +egg_sm_client_win32_init (EggSMClientWin32 *win32) +{ + ; +} + +static void +egg_sm_client_win32_class_init (EggSMClientWin32Class *klass) +{ + EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass); + + sm_client_class->startup = sm_client_win32_startup; + sm_client_class->will_quit = sm_client_win32_will_quit; + sm_client_class->end_session = sm_client_win32_end_session; +} + +EggSMClient * +egg_sm_client_win32_new (void) +{ + return g_object_new (EGG_TYPE_SM_CLIENT_WIN32, NULL); +} + +static void +sm_client_win32_startup (EggSMClient *client, + const char *client_id) +{ + EggSMClientWin32 *win32 = (EggSMClientWin32 *)client; + + win32->message_event = CreateEvent (NULL, FALSE, FALSE, NULL); + win32->response_event = CreateEvent (NULL, FALSE, FALSE, NULL); + g_win32_handle_source_add (win32->message_event, got_message, win32); + _beginthread (sm_client_thread, 0, client); +} + +static void +sm_client_win32_will_quit (EggSMClient *client, + gboolean will_quit) +{ + EggSMClientWin32 *win32 = (EggSMClientWin32 *)client; + + win32->will_quit = will_quit; + SetEvent (win32->response_event); +} + +static gboolean +sm_client_win32_end_session (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation) +{ + UINT uFlags = EWX_LOGOFF; + + switch (style) + { + case EGG_SM_CLIENT_END_SESSION_DEFAULT: + case EGG_SM_CLIENT_LOGOUT: + uFlags = EWX_LOGOFF; + break; + case EGG_SM_CLIENT_REBOOT: + uFlags = EWX_REBOOT; + break; + case EGG_SM_CLIENT_SHUTDOWN: + uFlags = EWX_POWEROFF; + break; + } + + /* There's no way to make ExitWindowsEx() show a logout dialog, so + * we ignore @request_confirmation. + */ + +#ifdef SHTDN_REASON_FLAG_PLANNED + ExitWindowsEx (uFlags, SHTDN_REASON_FLAG_PLANNED); +#else + ExitWindowsEx (uFlags, 0); +#endif + + return TRUE; +} + + +/* callbacks from logout-listener thread */ + +static gboolean +emit_quit_requested (gpointer smclient) +{ + gdk_threads_enter (); + egg_sm_client_quit_requested (smclient); + gdk_threads_leave (); + + return FALSE; +} + +static gboolean +emit_quit (gpointer smclient) +{ + EggSMClientWin32 *win32 = smclient; + + gdk_threads_enter (); + egg_sm_client_quit (smclient); + gdk_threads_leave (); + + SetEvent (win32->response_event); + return FALSE; +} + +static gboolean +emit_quit_cancelled (gpointer smclient) +{ + EggSMClientWin32 *win32 = smclient; + + gdk_threads_enter (); + egg_sm_client_quit_cancelled (smclient); + gdk_threads_leave (); + + SetEvent (win32->response_event); + return FALSE; +} + +static gboolean +got_message (gpointer smclient) +{ + EggSMClientWin32 *win32 = smclient; + + win32->event (win32); + return TRUE; +} + +/* Windows HANDLE GSource */ + +typedef struct { + GSource source; + GPollFD pollfd; +} GWin32HandleSource; + +static gboolean +g_win32_handle_source_prepare (GSource *source, gint *timeout) +{ + *timeout = -1; + return FALSE; +} + +static gboolean +g_win32_handle_source_check (GSource *source) +{ + GWin32HandleSource *hsource = (GWin32HandleSource *)source; + + return hsource->pollfd.revents; +} + +static gboolean +g_win32_handle_source_dispatch (GSource *source, GSourceFunc callback, gpointer user_data) +{ + return (*callback) (user_data); +} + +static void +g_win32_handle_source_finalize (GSource *source) +{ + ; +} + +GSourceFuncs g_win32_handle_source_funcs = { + g_win32_handle_source_prepare, + g_win32_handle_source_check, + g_win32_handle_source_dispatch, + g_win32_handle_source_finalize +}; + +static GSource * +g_win32_handle_source_add (HANDLE handle, GSourceFunc callback, gpointer user_data) +{ + GWin32HandleSource *hsource; + GSource *source; + + source = g_source_new (&g_win32_handle_source_funcs, sizeof (GWin32HandleSource)); + hsource = (GWin32HandleSource *)source; + hsource->pollfd.fd = (int)handle; + hsource->pollfd.events = G_IO_IN; + hsource->pollfd.revents = 0; + g_source_add_poll (source, &hsource->pollfd); + + g_source_set_callback (source, callback, user_data, NULL); + g_source_attach (source, NULL); + return source; +} + +/* logout-listener thread */ + +LRESULT CALLBACK +sm_client_win32_window_procedure (HWND hwnd, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + EggSMClientWin32 *win32 = + (EggSMClientWin32 *)GetWindowLongPtr (hwnd, GWLP_USERDATA); + + switch (message) + { + case WM_QUERYENDSESSION: + win32->event = emit_quit_requested; + SetEvent (win32->message_event); + + WaitForSingleObject (win32->response_event, INFINITE); + return win32->will_quit; + + case WM_ENDSESSION: + if (wParam) + { + /* The session is ending */ + win32->event = emit_quit; + } + else + { + /* Nope, the session *isn't* ending */ + win32->event = emit_quit_cancelled; + } + + SetEvent (win32->message_event); + WaitForSingleObject (win32->response_event, INFINITE); + + return 0; + + default: + return DefWindowProc (hwnd, message, wParam, lParam); + } +} + +static void +sm_client_thread (gpointer smclient) +{ + HINSTANCE instance; + WNDCLASSEXW wcl; + ATOM klass; + HWND window; + MSG msg; + + instance = GetModuleHandle (NULL); + + memset (&wcl, 0, sizeof (WNDCLASSEX)); + wcl.cbSize = sizeof (WNDCLASSEX); + wcl.lpfnWndProc = sm_client_win32_window_procedure; + wcl.hInstance = instance; + wcl.lpszClassName = L"EggSmClientWindow"; + klass = RegisterClassEx (&wcl); + + window = CreateWindowEx (0, MAKEINTRESOURCE (klass), + L"EggSmClientWindow", 0, + 10, 10, 50, 50, GetDesktopWindow (), + NULL, instance, NULL); + SetWindowLongPtr (window, GWLP_USERDATA, (LONG_PTR)smclient); + + /* main loop */ + while (GetMessage (&msg, NULL, 0, 0)) + DispatchMessage (&msg); +} diff --git a/gedit/smclient/eggsmclient-xsmp.c b/gedit/smclient/eggsmclient-xsmp.c new file mode 100755 index 00000000..a6d3f11f --- /dev/null +++ b/gedit/smclient/eggsmclient-xsmp.c @@ -0,0 +1,1370 @@ +/* + * Copyright (C) 2007 Novell, Inc. + * + * Inspired by various other pieces of code including GsmClient (C) + * 2001 Havoc Pennington, MateClient (C) 1998 Carsten Schaar, and twm + * session code (C) 1998 The Open Group. + * + * 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, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "eggsmclient.h" +#include "eggsmclient-private.h" + +#include "eggdesktopfile.h" + +#include +#include +#include +#include +#include +#include + +#include + +#define EGG_TYPE_SM_CLIENT_XSMP (egg_sm_client_xsmp_get_type ()) +#define EGG_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMP)) +#define EGG_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) +#define EGG_IS_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_XSMP)) +#define EGG_IS_SM_CLIENT_XSMP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_XSMP)) +#define EGG_SM_CLIENT_XSMP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMPClass)) + +typedef struct _EggSMClientXSMP EggSMClientXSMP; +typedef struct _EggSMClientXSMPClass EggSMClientXSMPClass; + +/* These mostly correspond to the similarly-named states in section + * 9.1 of the XSMP spec. Some of the states there aren't represented + * here, because we don't need them. SHUTDOWN_CANCELLED is slightly + * different from the spec; we use it when the client is IDLE after a + * ShutdownCancelled message, but the application is still interacting + * and doesn't know the shutdown has been cancelled yet. + */ +typedef enum +{ + XSMP_STATE_IDLE, + XSMP_STATE_SAVE_YOURSELF, + XSMP_STATE_INTERACT_REQUEST, + XSMP_STATE_INTERACT, + XSMP_STATE_SAVE_YOURSELF_DONE, + XSMP_STATE_SHUTDOWN_CANCELLED, + XSMP_STATE_CONNECTION_CLOSED +} EggSMClientXSMPState; + +static const char *state_names[] = { + "idle", + "save-yourself", + "interact-request", + "interact", + "save-yourself-done", + "shutdown-cancelled", + "connection-closed" +}; + +#define EGG_SM_CLIENT_XSMP_STATE(xsmp) (state_names[(xsmp)->state]) + +struct _EggSMClientXSMP +{ + EggSMClient parent; + + SmcConn connection; + char *client_id; + + EggSMClientXSMPState state; + char **restart_command; + gboolean set_restart_command; + int restart_style; + + guint idle; + + /* Current SaveYourself state */ + guint expecting_initial_save_yourself : 1; + guint need_save_state : 1; + guint need_quit_requested : 1; + guint interact_errors : 1; + guint shutting_down : 1; + + /* Todo list */ + guint waiting_to_set_initial_properties : 1; + guint waiting_to_emit_quit : 1; + guint waiting_to_emit_quit_cancelled : 1; + guint waiting_to_save_myself : 1; + +}; + +struct _EggSMClientXSMPClass +{ + EggSMClientClass parent_class; + +}; + +static void sm_client_xsmp_startup (EggSMClient *client, + const char *client_id); +static void sm_client_xsmp_set_restart_command (EggSMClient *client, + int argc, + const char **argv); +static void sm_client_xsmp_will_quit (EggSMClient *client, + gboolean will_quit); +static gboolean sm_client_xsmp_end_session (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation); + +static void xsmp_save_yourself (SmcConn smc_conn, + SmPointer client_data, + int save_style, + Bool shutdown, + int interact_style, + Bool fast); +static void xsmp_die (SmcConn smc_conn, + SmPointer client_data); +static void xsmp_save_complete (SmcConn smc_conn, + SmPointer client_data); +static void xsmp_shutdown_cancelled (SmcConn smc_conn, + SmPointer client_data); +static void xsmp_interact (SmcConn smc_conn, + SmPointer client_data); + +static SmProp *array_prop (const char *name, + ...); +static SmProp *ptrarray_prop (const char *name, + GPtrArray *values); +static SmProp *string_prop (const char *name, + const char *value); +static SmProp *card8_prop (const char *name, + unsigned char value); + +static void set_properties (EggSMClientXSMP *xsmp, ...); +static void delete_properties (EggSMClientXSMP *xsmp, ...); + +static GPtrArray *generate_command (char **restart_command, + const char *client_id, + const char *state_file); + +static void save_state (EggSMClientXSMP *xsmp); +static void do_save_yourself (EggSMClientXSMP *xsmp); +static void update_pending_events (EggSMClientXSMP *xsmp); + +static void ice_init (void); +static gboolean process_ice_messages (IceConn ice_conn); +static void smc_error_handler (SmcConn smc_conn, + Bool swap, + int offending_minor_opcode, + unsigned long offending_sequence, + int error_class, + int severity, + SmPointer values); + +G_DEFINE_TYPE (EggSMClientXSMP, egg_sm_client_xsmp, EGG_TYPE_SM_CLIENT) + +static void +egg_sm_client_xsmp_init (EggSMClientXSMP *xsmp) +{ + xsmp->state = XSMP_STATE_CONNECTION_CLOSED; + xsmp->connection = NULL; + xsmp->restart_style = SmRestartIfRunning; +} + +static void +egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass) +{ + EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass); + + sm_client_class->startup = sm_client_xsmp_startup; + sm_client_class->set_restart_command = sm_client_xsmp_set_restart_command; + sm_client_class->will_quit = sm_client_xsmp_will_quit; + sm_client_class->end_session = sm_client_xsmp_end_session; +} + +EggSMClient * +egg_sm_client_xsmp_new (void) +{ + if (!g_getenv ("SESSION_MANAGER")) + return NULL; + + return g_object_new (EGG_TYPE_SM_CLIENT_XSMP, NULL); +} + +static gboolean +sm_client_xsmp_set_initial_properties (gpointer user_data) +{ + EggSMClientXSMP *xsmp = user_data; + EggDesktopFile *desktop_file; + GPtrArray *clone, *restart; + char pid_str[64]; + + if (xsmp->idle) + { + g_source_remove (xsmp->idle); + xsmp->idle = 0; + } + xsmp->waiting_to_set_initial_properties = FALSE; + + if (egg_sm_client_get_mode () == EGG_SM_CLIENT_MODE_NO_RESTART) + xsmp->restart_style = SmRestartNever; + + /* Parse info out of desktop file */ + desktop_file = egg_get_desktop_file (); + if (desktop_file) + { + GError *err = NULL; + char *cmdline, **argv; + int argc; + + if (xsmp->restart_style == SmRestartIfRunning) + { + if (egg_desktop_file_get_boolean (desktop_file, + "X-MATE-AutoRestart", NULL)) + xsmp->restart_style = SmRestartImmediately; + } + + if (!xsmp->set_restart_command) + { + cmdline = egg_desktop_file_parse_exec (desktop_file, NULL, &err); + if (cmdline && g_shell_parse_argv (cmdline, &argc, &argv, &err)) + { + egg_sm_client_set_restart_command (EGG_SM_CLIENT (xsmp), + argc, (const char **)argv); + g_strfreev (argv); + } + else + { + g_warning ("Could not parse Exec line in desktop file: %s", + err->message); + g_error_free (err); + } + g_free (cmdline); + } + } + + if (!xsmp->set_restart_command) + xsmp->restart_command = g_strsplit (g_get_prgname (), " ", -1); + + clone = generate_command (xsmp->restart_command, NULL, NULL); + restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); + + g_debug ("Setting initial properties"); + + /* Program, CloneCommand, RestartCommand, and UserID are required. + * ProcessID isn't required, but the SM may be able to do something + * useful with it. + */ + g_snprintf (pid_str, sizeof (pid_str), "%lu", (gulong) getpid ()); + set_properties (xsmp, + string_prop (SmProgram, g_get_prgname ()), + ptrarray_prop (SmCloneCommand, clone), + ptrarray_prop (SmRestartCommand, restart), + string_prop (SmUserID, g_get_user_name ()), + string_prop (SmProcessID, pid_str), + card8_prop (SmRestartStyleHint, xsmp->restart_style), + NULL); + g_ptr_array_free (clone, TRUE); + g_ptr_array_free (restart, TRUE); + + if (desktop_file) + { + set_properties (xsmp, + string_prop ("_GSM_DesktopFile", egg_desktop_file_get_source (desktop_file)), + NULL); + } + + update_pending_events (xsmp); + return FALSE; +} + +/* This gets called from two different places: xsmp_die() (when the + * server asks us to disconnect) and process_ice_messages() (when the + * server disconnects unexpectedly). + */ +static void +sm_client_xsmp_disconnect (EggSMClientXSMP *xsmp) +{ + SmcConn connection; + + if (!xsmp->connection) + return; + + g_debug ("Disconnecting"); + + connection = xsmp->connection; + xsmp->connection = NULL; + SmcCloseConnection (connection, 0, NULL); + xsmp->state = XSMP_STATE_CONNECTION_CLOSED; + + xsmp->waiting_to_save_myself = FALSE; + update_pending_events (xsmp); +} + +static void +sm_client_xsmp_startup (EggSMClient *client, + const char *client_id) +{ + EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; + SmcCallbacks callbacks; + char *ret_client_id; + char error_string_ret[256]; + + xsmp->client_id = g_strdup (client_id); + + ice_init (); + SmcSetErrorHandler (smc_error_handler); + + callbacks.save_yourself.callback = xsmp_save_yourself; + callbacks.die.callback = xsmp_die; + callbacks.save_complete.callback = xsmp_save_complete; + callbacks.shutdown_cancelled.callback = xsmp_shutdown_cancelled; + + callbacks.save_yourself.client_data = xsmp; + callbacks.die.client_data = xsmp; + callbacks.save_complete.client_data = xsmp; + callbacks.shutdown_cancelled.client_data = xsmp; + + client_id = NULL; + error_string_ret[0] = '\0'; + xsmp->connection = + SmcOpenConnection (NULL, xsmp, SmProtoMajor, SmProtoMinor, + SmcSaveYourselfProcMask | SmcDieProcMask | + SmcSaveCompleteProcMask | + SmcShutdownCancelledProcMask, + &callbacks, + xsmp->client_id, &ret_client_id, + sizeof (error_string_ret), error_string_ret); + + if (!xsmp->connection) + { + g_warning ("Failed to connect to the session manager: %s\n", + error_string_ret[0] ? + error_string_ret : "no error message given"); + xsmp->state = XSMP_STATE_CONNECTION_CLOSED; + return; + } + + /* We expect a pointless initial SaveYourself if either (a) we + * didn't have an initial client ID, or (b) we DID have an initial + * client ID, but the server rejected it and gave us a new one. + */ + if (!xsmp->client_id || + (ret_client_id && strcmp (xsmp->client_id, ret_client_id) != 0)) + xsmp->expecting_initial_save_yourself = TRUE; + + if (ret_client_id) + { + g_free (xsmp->client_id); + xsmp->client_id = g_strdup (ret_client_id); + free (ret_client_id); + + gdk_threads_enter (); + gdk_set_sm_client_id (xsmp->client_id); + gdk_threads_leave (); + + g_debug ("Got client ID \"%s\"", xsmp->client_id); + } + + xsmp->state = XSMP_STATE_IDLE; + + /* Do not set the initial properties until we reach the main loop, + * so that the application has a chance to call + * egg_set_desktop_file(). (This may also help the session manager + * have a better idea of when the application is fully up and + * running.) + */ + xsmp->waiting_to_set_initial_properties = TRUE; + xsmp->idle = g_idle_add (sm_client_xsmp_set_initial_properties, client); +} + +static void +sm_client_xsmp_set_restart_command (EggSMClient *client, + int argc, + const char **argv) +{ + EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; + int i; + + g_strfreev (xsmp->restart_command); + + xsmp->restart_command = g_new (char *, argc + 1); + for (i = 0; i < argc; i++) + xsmp->restart_command[i] = g_strdup (argv[i]); + xsmp->restart_command[i] = NULL; + + xsmp->set_restart_command = TRUE; +} + +static void +sm_client_xsmp_will_quit (EggSMClient *client, + gboolean will_quit) +{ + EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; + + if (xsmp->state == XSMP_STATE_CONNECTION_CLOSED) + { + /* The session manager has already exited! Schedule a quit + * signal. + */ + xsmp->waiting_to_emit_quit = TRUE; + update_pending_events (xsmp); + return; + } + else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) + { + /* We received a ShutdownCancelled message while the application + * was interacting; Schedule a quit_cancelled signal. + */ + xsmp->waiting_to_emit_quit_cancelled = TRUE; + update_pending_events (xsmp); + return; + } + + g_return_if_fail (xsmp->state == XSMP_STATE_INTERACT); + + g_debug ("Sending InteractDone(%s)", will_quit ? "False" : "True"); + SmcInteractDone (xsmp->connection, !will_quit); + + if (will_quit && xsmp->need_save_state) + save_state (xsmp); + + g_debug ("Sending SaveYourselfDone(%s)", will_quit ? "True" : "False"); + SmcSaveYourselfDone (xsmp->connection, will_quit); + xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; +} + +static gboolean +sm_client_xsmp_end_session (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation) +{ + EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client; + int save_type; + + /* To end the session via XSMP, we have to send a + * SaveYourselfRequest. We aren't allowed to do that if anything + * else is going on, but we don't want to expose this fact to the + * application. So we do our best to patch things up here... + * + * In the worst case, this method might block for some length of + * time in process_ice_messages, but the only time that code path is + * honestly likely to get hit is if the application tries to end the + * session as the very first thing it does, in which case it + * probably won't actually block anyway. It's not worth gunking up + * the API to try to deal nicely with the other 0.01% of cases where + * this happens. + */ + + while (xsmp->state != XSMP_STATE_IDLE || + xsmp->expecting_initial_save_yourself) + { + /* If we're already shutting down, we don't need to do anything. */ + if (xsmp->shutting_down) + return TRUE; + + switch (xsmp->state) + { + case XSMP_STATE_CONNECTION_CLOSED: + return FALSE; + + case XSMP_STATE_SAVE_YOURSELF: + /* Trying to log out from the save_state callback? Whatever. + * Abort the save_state. + */ + SmcSaveYourselfDone (xsmp->connection, FALSE); + xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; + break; + + case XSMP_STATE_INTERACT_REQUEST: + case XSMP_STATE_INTERACT: + case XSMP_STATE_SHUTDOWN_CANCELLED: + /* Already in a shutdown-related state, just ignore + * the new shutdown request... + */ + return TRUE; + + case XSMP_STATE_IDLE: + if (xsmp->waiting_to_set_initial_properties) + sm_client_xsmp_set_initial_properties (xsmp); + + if (!xsmp->expecting_initial_save_yourself) + break; + /* else fall through */ + + case XSMP_STATE_SAVE_YOURSELF_DONE: + /* We need to wait for some response from the server.*/ + process_ice_messages (SmcGetIceConnection (xsmp->connection)); + break; + + default: + /* Hm... shouldn't happen */ + return FALSE; + } + } + + /* xfce4-session will do the wrong thing if we pass SmSaveGlobal and + * the user chooses to save the session. But mate-session will do + * the wrong thing if we pass SmSaveBoth and the user chooses NOT to + * save the session... Sigh. + */ + if (!strcmp (SmcVendor (xsmp->connection), "xfce4-session")) + save_type = SmSaveBoth; + else + save_type = SmSaveGlobal; + + g_debug ("Sending SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)", request_confirmation ? "!" : ""); + SmcRequestSaveYourself (xsmp->connection, + save_type, + True, /* shutdown */ + SmInteractStyleAny, + !request_confirmation, /* fast */ + True /* global */); + return TRUE; +} + +static gboolean +idle_do_pending_events (gpointer data) +{ + EggSMClientXSMP *xsmp = data; + EggSMClient *client = data; + + gdk_threads_enter (); + + xsmp->idle = 0; + + if (xsmp->waiting_to_emit_quit) + { + xsmp->waiting_to_emit_quit = FALSE; + egg_sm_client_quit (client); + goto out; + } + + if (xsmp->waiting_to_emit_quit_cancelled) + { + xsmp->waiting_to_emit_quit_cancelled = FALSE; + egg_sm_client_quit_cancelled (client); + xsmp->state = XSMP_STATE_IDLE; + } + + if (xsmp->waiting_to_save_myself) + { + xsmp->waiting_to_save_myself = FALSE; + do_save_yourself (xsmp); + } + + out: + gdk_threads_leave (); + return FALSE; +} + +static void +update_pending_events (EggSMClientXSMP *xsmp) +{ + gboolean want_idle = + xsmp->waiting_to_emit_quit || + xsmp->waiting_to_emit_quit_cancelled || + xsmp->waiting_to_save_myself; + + if (want_idle) + { + if (xsmp->idle == 0) + xsmp->idle = g_idle_add (idle_do_pending_events, xsmp); + } + else + { + if (xsmp->idle != 0) + g_source_remove (xsmp->idle); + xsmp->idle = 0; + } +} + +static void +fix_broken_state (EggSMClientXSMP *xsmp, const char *message, + gboolean send_interact_done, + gboolean send_save_yourself_done) +{ + g_warning ("Received XSMP %s message in state %s: client or server error", + message, EGG_SM_CLIENT_XSMP_STATE (xsmp)); + + /* Forget any pending SaveYourself plans we had */ + xsmp->waiting_to_save_myself = FALSE; + update_pending_events (xsmp); + + if (send_interact_done) + SmcInteractDone (xsmp->connection, False); + if (send_save_yourself_done) + SmcSaveYourselfDone (xsmp->connection, True); + + xsmp->state = send_save_yourself_done ? XSMP_STATE_SAVE_YOURSELF_DONE : XSMP_STATE_IDLE; +} + +/* SM callbacks */ + +static void +xsmp_save_yourself (SmcConn smc_conn, + SmPointer client_data, + int save_type, + Bool shutdown, + int interact_style, + Bool fast) +{ + EggSMClientXSMP *xsmp = client_data; + gboolean wants_quit_requested; + + g_debug ("Received SaveYourself(%s, %s, %s, %s) in state %s", + save_type == SmSaveLocal ? "SmSaveLocal" : + save_type == SmSaveGlobal ? "SmSaveGlobal" : "SmSaveBoth", + shutdown ? "Shutdown" : "!Shutdown", + interact_style == SmInteractStyleAny ? "SmInteractStyleAny" : + interact_style == SmInteractStyleErrors ? "SmInteractStyleErrors" : + "SmInteractStyleNone", fast ? "Fast" : "!Fast", + EGG_SM_CLIENT_XSMP_STATE (xsmp)); + + if (xsmp->state != XSMP_STATE_IDLE && + xsmp->state != XSMP_STATE_SHUTDOWN_CANCELLED) + { + fix_broken_state (xsmp, "SaveYourself", FALSE, TRUE); + return; + } + + if (xsmp->waiting_to_set_initial_properties) + sm_client_xsmp_set_initial_properties (xsmp); + + /* If this is the initial SaveYourself, ignore it; we've already set + * properties and there's no reason to actually save state too. + */ + if (xsmp->expecting_initial_save_yourself) + { + xsmp->expecting_initial_save_yourself = FALSE; + + if (save_type == SmSaveLocal && + interact_style == SmInteractStyleNone && + !shutdown && !fast) + { + g_debug ("Sending SaveYourselfDone(True) for initial SaveYourself"); + SmcSaveYourselfDone (xsmp->connection, True); + /* As explained in the comment at the end of + * do_save_yourself(), SAVE_YOURSELF_DONE is the correct + * state here, not IDLE. + */ + xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; + return; + } + else + g_warning ("First SaveYourself was not the expected one!"); + } + + /* Even ignoring the "fast" flag completely, there are still 18 + * different combinations of save_type, shutdown and interact_style. + * We interpret them as follows: + * + * Type Shutdown Interact Interpretation + * G F A/E/N do nothing (1) + * G T N do nothing (1)* + * G T A/E quit_requested (2) + * L/B F A/E/N save_state (3) + * L/B T N save_state (3)* + * L/B T A/E quit_requested, then save_state (4) + * + * 1. Do nothing, because the SM asked us to do something + * uninteresting (save open files, but then don't quit + * afterward) or rude (save open files without asking the user + * for confirmation). + * + * 2. Request interaction and then emit ::quit_requested. This + * perhaps isn't quite correct for the SmInteractStyleErrors + * case, but we don't care. + * + * 3. Emit ::save_state. The SmSaveBoth SaveYourselfs in these + * rows essentially get demoted to SmSaveLocal, because their + * Global halves correspond to "do nothing". + * + * 4. Request interaction, emit ::quit_requested, and then emit + * ::save_state after interacting. This is the SmSaveBoth + * equivalent of #2, but we also promote SmSaveLocal shutdown + * SaveYourselfs to SmSaveBoth here, because we want to give + * the user a chance to save open files before quitting. + * + * (* It would be nice if we could do something useful when the + * session manager sends a SaveYourself with shutdown True and + * SmInteractStyleNone. But we can't, so we just pretend it didn't + * even tell us it was shutting down. The docs for ::quit mention + * that it might not always be preceded by ::quit_requested.) + */ + + /* As an optimization, we don't actually request interaction and + * emit ::quit_requested if the application isn't listening to the + * signal. + */ + wants_quit_requested = g_signal_has_handler_pending (xsmp, g_signal_lookup ("quit_requested", EGG_TYPE_SM_CLIENT), 0, FALSE); + + xsmp->need_save_state = (save_type != SmSaveGlobal); + xsmp->need_quit_requested = (shutdown && wants_quit_requested && + interact_style != SmInteractStyleNone); + xsmp->interact_errors = (interact_style == SmInteractStyleErrors); + + xsmp->shutting_down = shutdown; + + do_save_yourself (xsmp); +} + +static void +do_save_yourself (EggSMClientXSMP *xsmp) +{ + if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) + { + /* The SM cancelled a previous SaveYourself, but we haven't yet + * had a chance to tell the application, so we can't start + * processing this SaveYourself yet. + */ + xsmp->waiting_to_save_myself = TRUE; + update_pending_events (xsmp); + return; + } + + if (xsmp->need_quit_requested) + { + xsmp->state = XSMP_STATE_INTERACT_REQUEST; + + g_debug ("Sending InteractRequest(%s)", + xsmp->interact_errors ? "Error" : "Normal"); + SmcInteractRequest (xsmp->connection, + xsmp->interact_errors ? SmDialogError : SmDialogNormal, + xsmp_interact, + xsmp); + return; + } + + if (xsmp->need_save_state) + { + save_state (xsmp); + + /* Though unlikely, the client could have been disconnected + * while the application was saving its state. + */ + if (!xsmp->connection) + return; + } + + g_debug ("Sending SaveYourselfDone(True)"); + SmcSaveYourselfDone (xsmp->connection, True); + + /* The client state diagram in the XSMP spec says that after a + * non-shutdown SaveYourself, we go directly back to "idle". But + * everything else in both the XSMP spec and the libSM docs + * disagrees. + */ + xsmp->state = XSMP_STATE_SAVE_YOURSELF_DONE; +} + +static void +save_state (EggSMClientXSMP *xsmp) +{ + GKeyFile *state_file; + char *state_file_path, *data; + EggDesktopFile *desktop_file; + GPtrArray *restart; + int offset, fd; + + /* We set xsmp->state before emitting save_state, but our caller is + * responsible for setting it back afterward. + */ + xsmp->state = XSMP_STATE_SAVE_YOURSELF; + + state_file = egg_sm_client_save_state ((EggSMClient *)xsmp); + if (!state_file) + { + restart = generate_command (xsmp->restart_command, xsmp->client_id, NULL); + set_properties (xsmp, + ptrarray_prop (SmRestartCommand, restart), + NULL); + g_ptr_array_free (restart, TRUE); + delete_properties (xsmp, SmDiscardCommand, NULL); + return; + } + + desktop_file = egg_get_desktop_file (); + if (desktop_file) + { + GKeyFile *merged_file; + char *desktop_file_path; + + merged_file = g_key_file_new (); + desktop_file_path = + g_filename_from_uri (egg_desktop_file_get_source (desktop_file), + NULL, NULL); + if (desktop_file_path && + g_key_file_load_from_file (merged_file, desktop_file_path, + G_KEY_FILE_KEEP_COMMENTS | + G_KEY_FILE_KEEP_TRANSLATIONS, NULL)) + { + guint g, k, i; + char **groups, **keys, *value, *exec; + + groups = g_key_file_get_groups (state_file, NULL); + for (g = 0; groups[g]; g++) + { + keys = g_key_file_get_keys (state_file, groups[g], NULL, NULL); + for (k = 0; keys[k]; k++) + { + value = g_key_file_get_value (state_file, groups[g], + keys[k], NULL); + if (value) + { + g_key_file_set_value (merged_file, groups[g], + keys[k], value); + g_free (value); + } + } + g_strfreev (keys); + } + g_strfreev (groups); + + g_key_file_free (state_file); + state_file = merged_file; + + /* Update Exec key using "--sm-client-state-file %k" */ + restart = generate_command (xsmp->restart_command, + NULL, "%k"); + for (i = 0; i < restart->len; i++) + restart->pdata[i] = g_shell_quote (restart->pdata[i]); + g_ptr_array_add (restart, NULL); + exec = g_strjoinv (" ", (char **)restart->pdata); + g_strfreev ((char **)restart->pdata); + g_ptr_array_free (restart, FALSE); + + g_key_file_set_string (state_file, EGG_DESKTOP_FILE_GROUP, + EGG_DESKTOP_FILE_KEY_EXEC, + exec); + g_free (exec); + } + else + desktop_file = NULL; + + g_free (desktop_file_path); + } + + /* Now write state_file to disk. (We can't use mktemp(), because + * that requires the filename to end with "XXXXXX", and we want + * it to end with ".desktop".) + */ + + data = g_key_file_to_data (state_file, NULL, NULL); + g_key_file_free (state_file); + + offset = 0; + while (1) + { + state_file_path = g_strdup_printf ("%s%csession-state%c%s-%ld.%s", + g_get_user_config_dir (), + G_DIR_SEPARATOR, G_DIR_SEPARATOR, + g_get_prgname (), + (long)time (NULL) + offset, + desktop_file ? "desktop" : "state"); + + fd = open (state_file_path, O_WRONLY | O_CREAT | O_EXCL, 0644); + if (fd == -1) + { + if (errno == EEXIST) + { + offset++; + g_free (state_file_path); + continue; + } + else if (errno == ENOTDIR || errno == ENOENT) + { + char *sep = strrchr (state_file_path, G_DIR_SEPARATOR); + + *sep = '\0'; + if (g_mkdir_with_parents (state_file_path, 0755) != 0) + { + g_warning ("Could not create directory '%s'", + state_file_path); + g_free (state_file_path); + state_file_path = NULL; + break; + } + + continue; + } + + g_warning ("Could not create file '%s': %s", + state_file_path, g_strerror (errno)); + g_free (state_file_path); + state_file_path = NULL; + break; + } + + close (fd); + g_file_set_contents (state_file_path, data, -1, NULL); + break; + } + g_free (data); + + restart = generate_command (xsmp->restart_command, xsmp->client_id, + state_file_path); + set_properties (xsmp, + ptrarray_prop (SmRestartCommand, restart), + NULL); + g_ptr_array_free (restart, TRUE); + + if (state_file_path) + { + set_properties (xsmp, + array_prop (SmDiscardCommand, + "/bin/rm", "-rf", state_file_path, + NULL), + NULL); + g_free (state_file_path); + } +} + +static void +xsmp_interact (SmcConn smc_conn, + SmPointer client_data) +{ + EggSMClientXSMP *xsmp = client_data; + EggSMClient *client = client_data; + + g_debug ("Received Interact message in state %s", + EGG_SM_CLIENT_XSMP_STATE (xsmp)); + + if (xsmp->state != XSMP_STATE_INTERACT_REQUEST) + { + fix_broken_state (xsmp, "Interact", TRUE, TRUE); + return; + } + + xsmp->state = XSMP_STATE_INTERACT; + egg_sm_client_quit_requested (client); +} + +static void +xsmp_die (SmcConn smc_conn, + SmPointer client_data) +{ + EggSMClientXSMP *xsmp = client_data; + EggSMClient *client = client_data; + + g_debug ("Received Die message in state %s", + EGG_SM_CLIENT_XSMP_STATE (xsmp)); + + sm_client_xsmp_disconnect (xsmp); + egg_sm_client_quit (client); +} + +static void +xsmp_save_complete (SmcConn smc_conn, + SmPointer client_data) +{ + EggSMClientXSMP *xsmp = client_data; + + g_debug ("Received SaveComplete message in state %s", + EGG_SM_CLIENT_XSMP_STATE (xsmp)); + + if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) + xsmp->state = XSMP_STATE_IDLE; + else + fix_broken_state (xsmp, "SaveComplete", FALSE, FALSE); +} + +static void +xsmp_shutdown_cancelled (SmcConn smc_conn, + SmPointer client_data) +{ + EggSMClientXSMP *xsmp = client_data; + EggSMClient *client = client_data; + + g_debug ("Received ShutdownCancelled message in state %s", + EGG_SM_CLIENT_XSMP_STATE (xsmp)); + + xsmp->shutting_down = FALSE; + + if (xsmp->state == XSMP_STATE_SAVE_YOURSELF_DONE) + { + /* We've finished interacting and now the SM has agreed to + * cancel the shutdown. + */ + xsmp->state = XSMP_STATE_IDLE; + egg_sm_client_quit_cancelled (client); + } + else if (xsmp->state == XSMP_STATE_SHUTDOWN_CANCELLED) + { + /* Hm... ok, so we got a shutdown SaveYourself, which got + * cancelled, but the application was still interacting, so we + * didn't tell it yet, and then *another* SaveYourself arrived, + * which we must still be waiting to tell the app about, except + * that now that SaveYourself has been cancelled too! Dizzy yet? + */ + xsmp->waiting_to_save_myself = FALSE; + update_pending_events (xsmp); + } + else + { + g_debug ("Sending SaveYourselfDone(False)"); + SmcSaveYourselfDone (xsmp->connection, False); + + if (xsmp->state == XSMP_STATE_INTERACT) + { + /* The application is currently interacting, so we can't + * tell it about the cancellation yet; we will wait until + * after it calls egg_sm_client_will_quit(). + */ + xsmp->state = XSMP_STATE_SHUTDOWN_CANCELLED; + } + else + { + /* The shutdown was cancelled before the application got a + * chance to interact. + */ + xsmp->state = XSMP_STATE_IDLE; + } + } +} + +/* Utilities */ + +/* Create a restart/clone/Exec command based on @restart_command. + * If @client_id is non-%NULL, add "--sm-client-id @client_id". + * If @state_file is non-%NULL, add "--sm-client-state-file @state_file". + * + * None of the input strings are g_strdup()ed; the caller must keep + * them around until it is done with the returned GPtrArray, and must + * then free the array, but not its contents. + */ +static GPtrArray * +generate_command (char **restart_command, const char *client_id, + const char *state_file) +{ + GPtrArray *cmd; + int i; + + cmd = g_ptr_array_new (); + g_ptr_array_add (cmd, restart_command[0]); + + if (client_id) + { + g_ptr_array_add (cmd, (char *)"--sm-client-id"); + g_ptr_array_add (cmd, (char *)client_id); + } + + if (state_file) + { + g_ptr_array_add (cmd, (char *)"--sm-client-state-file"); + g_ptr_array_add (cmd, (char *)state_file); + } + + for (i = 1; restart_command[i]; i++) + g_ptr_array_add (cmd, restart_command[i]); + + return cmd; +} + +/* Takes a NULL-terminated list of SmProp * values, created by + * array_prop, ptrarray_prop, string_prop, card8_prop, sets them, and + * frees them. + */ +static void +set_properties (EggSMClientXSMP *xsmp, ...) +{ + GPtrArray *props; + SmProp *prop; + va_list ap; + guint i; + + props = g_ptr_array_new (); + + va_start (ap, xsmp); + while ((prop = va_arg (ap, SmProp *))) + g_ptr_array_add (props, prop); + va_end (ap); + + if (xsmp->connection) + { + SmcSetProperties (xsmp->connection, props->len, + (SmProp **)props->pdata); + } + + for (i = 0; i < props->len; i++) + { + prop = props->pdata[i]; + g_free (prop->vals); + g_free (prop); + } + g_ptr_array_free (props, TRUE); +} + +/* Takes a NULL-terminated list of property names and deletes them. */ +static void +delete_properties (EggSMClientXSMP *xsmp, ...) +{ + GPtrArray *props; + char *prop; + va_list ap; + + if (!xsmp->connection) + return; + + props = g_ptr_array_new (); + + va_start (ap, xsmp); + while ((prop = va_arg (ap, char *))) + g_ptr_array_add (props, prop); + va_end (ap); + + SmcDeleteProperties (xsmp->connection, props->len, + (char **)props->pdata); + + g_ptr_array_free (props, TRUE); +} + +/* Takes an array of strings and creates a LISTofARRAY8 property. The + * strings are neither dupped nor freed; they need to remain valid + * until you're done with the SmProp. + */ +static SmProp * +array_prop (const char *name, ...) +{ + SmProp *prop; + SmPropValue pv; + GArray *vals; + char *value; + va_list ap; + + prop = g_new (SmProp, 1); + prop->name = (char *)name; + prop->type = (char *)SmLISTofARRAY8; + + vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); + + va_start (ap, name); + while ((value = va_arg (ap, char *))) + { + pv.length = strlen (value); + pv.value = value; + g_array_append_val (vals, pv); + } + + prop->num_vals = vals->len; + prop->vals = (SmPropValue *)vals->data; + + g_array_free (vals, FALSE); + + return prop; +} + +/* Takes a GPtrArray of strings and creates a LISTofARRAY8 property. + * The array contents are neither dupped nor freed; they need to + * remain valid until you're done with the SmProp. + */ +static SmProp * +ptrarray_prop (const char *name, GPtrArray *values) +{ + SmProp *prop; + SmPropValue pv; + GArray *vals; + guint i; + + prop = g_new (SmProp, 1); + prop->name = (char *)name; + prop->type = (char *)SmLISTofARRAY8; + + vals = g_array_new (FALSE, FALSE, sizeof (SmPropValue)); + + for (i = 0; i < values->len; i++) + { + pv.length = strlen (values->pdata[i]); + pv.value = values->pdata[i]; + g_array_append_val (vals, pv); + } + + prop->num_vals = vals->len; + prop->vals = (SmPropValue *)vals->data; + + g_array_free (vals, FALSE); + + return prop; +} + +/* Takes a string and creates an ARRAY8 property. The string is + * neither dupped nor freed; it needs to remain valid until you're + * done with the SmProp. + */ +static SmProp * +string_prop (const char *name, const char *value) +{ + SmProp *prop; + + prop = g_new (SmProp, 1); + prop->name = (char *)name; + prop->type = (char *)SmARRAY8; + + prop->num_vals = 1; + prop->vals = g_new (SmPropValue, 1); + + prop->vals[0].length = strlen (value); + prop->vals[0].value = (char *)value; + + return prop; +} + +/* Takes a char and creates a CARD8 property. */ +static SmProp * +card8_prop (const char *name, unsigned char value) +{ + SmProp *prop; + char *card8val; + + /* To avoid having to allocate and free prop->vals[0], we cheat and + * make vals a 2-element-long array and then use the second element + * to store value. + */ + + prop = g_new (SmProp, 1); + prop->name = (char *)name; + prop->type = (char *)SmCARD8; + + prop->num_vals = 1; + prop->vals = g_new (SmPropValue, 2); + card8val = (char *)(&prop->vals[1]); + card8val[0] = value; + + prop->vals[0].length = 1; + prop->vals[0].value = card8val; + + return prop; +} + +/* ICE code. This makes no effort to play nice with anyone else trying + * to use libICE. Fortunately, no one uses libICE for anything other + * than SM. (DCOP uses ICE, but it has its own private copy of + * libICE.) + * + * When this moves to gtk, it will need to be cleverer, to avoid + * tripping over old apps that use MateClient or that use libSM + * directly. + */ + +#include +#include + +static void ice_error_handler (IceConn ice_conn, + Bool swap, + int offending_minor_opcode, + unsigned long offending_sequence, + int error_class, + int severity, + IcePointer values); +static void ice_io_error_handler (IceConn ice_conn); +static void ice_connection_watch (IceConn ice_conn, + IcePointer client_data, + Bool opening, + IcePointer *watch_data); + +static void +ice_init (void) +{ + IceSetIOErrorHandler (ice_io_error_handler); + IceSetErrorHandler (ice_error_handler); + IceAddConnectionWatch (ice_connection_watch, NULL); +} + +static gboolean +process_ice_messages (IceConn ice_conn) +{ + IceProcessMessagesStatus status; + + gdk_threads_enter (); + status = IceProcessMessages (ice_conn, NULL, NULL); + gdk_threads_leave (); + + switch (status) + { + case IceProcessMessagesSuccess: + return TRUE; + + case IceProcessMessagesIOError: + sm_client_xsmp_disconnect (IceGetConnectionContext (ice_conn)); + return FALSE; + + case IceProcessMessagesConnectionClosed: + return FALSE; + + default: + g_assert_not_reached (); + } +} + +static gboolean +ice_iochannel_watch (GIOChannel *channel, + GIOCondition condition, + gpointer client_data) +{ + return process_ice_messages (client_data); +} + +static void +ice_connection_watch (IceConn ice_conn, + IcePointer client_data, + Bool opening, + IcePointer *watch_data) +{ + guint watch_id; + + if (opening) + { + GIOChannel *channel; + int fd = IceConnectionNumber (ice_conn); + + fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC); + channel = g_io_channel_unix_new (fd); + watch_id = g_io_add_watch (channel, G_IO_IN | G_IO_ERR, + ice_iochannel_watch, ice_conn); + g_io_channel_unref (channel); + + *watch_data = GUINT_TO_POINTER (watch_id); + } + else + { + watch_id = GPOINTER_TO_UINT (*watch_data); + g_source_remove (watch_id); + } +} + +static void +ice_error_handler (IceConn ice_conn, + Bool swap, + int offending_minor_opcode, + unsigned long offending_sequence, + int error_class, + int severity, + IcePointer values) +{ + /* Do nothing */ +} + +static void +ice_io_error_handler (IceConn ice_conn) +{ + /* Do nothing */ +} + +static void +smc_error_handler (SmcConn smc_conn, + Bool swap, + int offending_minor_opcode, + unsigned long offending_sequence, + int error_class, + int severity, + SmPointer values) +{ + /* Do nothing */ +} diff --git a/gedit/smclient/eggsmclient.c b/gedit/smclient/eggsmclient.c new file mode 100755 index 00000000..4b65f283 --- /dev/null +++ b/gedit/smclient/eggsmclient.c @@ -0,0 +1,589 @@ +/* + * Copyright (C) 2007 Novell, Inc. + * + * 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, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include + +#include "eggsmclient.h" +#include "eggsmclient-private.h" + +static void egg_sm_client_debug_handler (const char *log_domain, + GLogLevelFlags log_level, + const char *message, + gpointer user_data); + +enum { + SAVE_STATE, + QUIT_REQUESTED, + QUIT_CANCELLED, + QUIT, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL]; + +struct _EggSMClientPrivate { + GKeyFile *state_file; +}; + +#define EGG_SM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_SM_CLIENT, EggSMClientPrivate)) + +G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT) + +static EggSMClient *global_client; +static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL; + +static void +egg_sm_client_init (EggSMClient *client) +{ + ; +} + +static void +egg_sm_client_class_init (EggSMClientClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (EggSMClientPrivate)); + + /** + * EggSMClient::save_state: + * @client: the client + * @state_file: a #GKeyFile to save state information into + * + * Emitted when the session manager has requested that the + * application save information about its current state. The + * application should save its state into @state_file, and then the + * session manager may then restart the application in a future + * session and tell it to initialize itself from that state. + * + * You should not save any data into @state_file's "start group" + * (ie, the %NULL group). Instead, applications should save their + * data into groups with names that start with the application name, + * and libraries that connect to this signal should save their data + * into groups with names that start with the library name. + * + * Alternatively, rather than (or in addition to) using @state_file, + * the application can save its state by calling + * egg_sm_client_set_restart_command() during the processing of this + * signal (eg, to include a list of files to open). + **/ + signals[SAVE_STATE] = + g_signal_new ("save_state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EggSMClientClass, save_state), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, G_TYPE_POINTER); + + /** + * EggSMClient::quit_requested: + * @client: the client + * + * Emitted when the session manager requests that the application + * exit (generally because the user is logging out). The application + * should decide whether or not it is willing to quit (perhaps after + * asking the user what to do with documents that have unsaved + * changes) and then call egg_sm_client_will_quit(), passing %TRUE + * or %FALSE to give its answer to the session manager. (It does not + * need to give an answer before returning from the signal handler; + * it can interact with the user asynchronously and then give its + * answer later on.) If the application does not connect to this + * signal, then #EggSMClient will automatically return %TRUE on its + * behalf. + * + * The application should not save its session state as part of + * handling this signal; if the user has requested that the session + * be saved when logging out, then ::save_state will be emitted + * separately. + * + * If the application agrees to quit, it should then wait for either + * the ::quit_cancelled or ::quit signals to be emitted. + **/ + signals[QUIT_REQUESTED] = + g_signal_new ("quit_requested", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EggSMClientClass, quit_requested), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + /** + * EggSMClient::quit_cancelled: + * @client: the client + * + * Emitted when the session manager decides to cancel a logout after + * the application has already agreed to quit. After receiving this + * signal, the application can go back to what it was doing before + * receiving the ::quit_requested signal. + **/ + signals[QUIT_CANCELLED] = + g_signal_new ("quit_cancelled", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EggSMClientClass, quit_cancelled), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + /** + * EggSMClient::quit: + * @client: the client + * + * Emitted when the session manager wants the application to quit + * (generally because the user is logging out). The application + * should exit as soon as possible after receiving this signal; if + * it does not, the session manager may choose to forcibly kill it. + * + * Normally a GUI application would only be sent a ::quit if it + * agreed to quit in response to a ::quit_requested signal. However, + * this is not guaranteed; in some situations the session manager + * may decide to end the session without giving applications a + * chance to object. + **/ + signals[QUIT] = + g_signal_new ("quit", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EggSMClientClass, quit), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); +} + +static gboolean sm_client_disable = FALSE; +static char *sm_client_state_file = NULL; +static char *sm_client_id = NULL; +static char *sm_config_prefix = NULL; + +static gboolean +sm_client_post_parse_func (GOptionContext *context, + GOptionGroup *group, + gpointer data, + GError **error) +{ + EggSMClient *client = egg_sm_client_get (); + + if (sm_client_id == NULL) + { + const gchar *desktop_autostart_id; + + desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); + + if (desktop_autostart_id != NULL) + sm_client_id = g_strdup (desktop_autostart_id); + } + + /* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to + * use the same client id. */ + g_unsetenv ("DESKTOP_AUTOSTART_ID"); + + if (EGG_SM_CLIENT_GET_CLASS (client)->startup) + EGG_SM_CLIENT_GET_CLASS (client)->startup (client, sm_client_id); + return TRUE; +} + +/** + * egg_sm_client_get_option_group: + * + * Creates a %GOptionGroup containing the session-management-related + * options. You should add this group to the application's + * %GOptionContext if you want to use #EggSMClient. + * + * Return value: the %GOptionGroup + **/ +GOptionGroup * +egg_sm_client_get_option_group (void) +{ + const GOptionEntry entries[] = { + { "sm-client-disable", 0, 0, + G_OPTION_ARG_NONE, &sm_client_disable, + N_("Disable connection to session manager"), NULL }, + { "sm-client-state-file", 0, 0, + G_OPTION_ARG_FILENAME, &sm_client_state_file, + N_("Specify file containing saved configuration"), N_("FILE") }, + { "sm-client-id", 0, 0, + G_OPTION_ARG_STRING, &sm_client_id, + N_("Specify session management ID"), N_("ID") }, + /* MateClient compatibility option */ + { "sm-disable", 0, G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_NONE, &sm_client_disable, + NULL, NULL }, + /* MateClient compatibility option. This is a dummy option that only + * exists so that sessions saved by apps with MateClient can be restored + * later when they've switched to EggSMClient. See bug #575308. + */ + { "sm-config-prefix", 0, G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_STRING, &sm_config_prefix, + NULL, NULL }, + { NULL } + }; + GOptionGroup *group; + + /* Use our own debug handler for the "EggSMClient" domain. */ + g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, + egg_sm_client_debug_handler, NULL); + + group = g_option_group_new ("sm-client", + _("Session management options:"), + _("Show session management options"), + NULL, NULL); + g_option_group_add_entries (group, entries); + g_option_group_set_parse_hooks (group, NULL, sm_client_post_parse_func); + + return group; +} + +/** + * egg_sm_client_set_mode: + * @mode: an #EggSMClient mode + * + * Sets the "mode" of #EggSMClient as follows: + * + * %EGG_SM_CLIENT_MODE_DISABLED: Session management is completely + * disabled. The application will not even connect to the session + * manager. (egg_sm_client_get() will still return an #EggSMClient, + * but it will just be a dummy object.) + * + * %EGG_SM_CLIENT_MODE_NO_RESTART: The application will connect to + * the session manager (and thus will receive notification when the + * user is logging out, etc), but will request to not be + * automatically restarted with saved state in future sessions. + * + * %EGG_SM_CLIENT_MODE_NORMAL: The default. #EggSMCLient will + * function normally. + * + * This must be called before the application's main loop begins. + **/ +void +egg_sm_client_set_mode (EggSMClientMode mode) +{ + global_client_mode = mode; +} + +/** + * egg_sm_client_get_mode: + * + * Gets the global #EggSMClientMode. See egg_sm_client_set_mode() + * for details. + * + * Return value: the global #EggSMClientMode + **/ +EggSMClientMode +egg_sm_client_get_mode (void) +{ + return global_client_mode; +} + +/** + * egg_sm_client_get: + * + * Returns the master #EggSMClient for the application. + * + * On platforms that support saved sessions (ie, POSIX/X11), the + * application will only request to be restarted by the session + * manager if you call egg_set_desktop_file() to set an application + * desktop file. In particular, if the desktop file contains the key + * "X + * + * Return value: the master #EggSMClient. + **/ +EggSMClient * +egg_sm_client_get (void) +{ + if (!global_client) + { + if (global_client_mode != EGG_SM_CLIENT_MODE_DISABLED && + !sm_client_disable) + { +#if defined (GDK_WINDOWING_WIN32) + global_client = egg_sm_client_win32_new (); +#elif defined (GDK_WINDOWING_QUARTZ) + global_client = egg_sm_client_osx_new (); +#else + /* If both D-Bus and XSMP are compiled in, try XSMP first + * (since it supports state saving) and fall back to D-Bus + * if XSMP isn't available. + */ +# ifdef EGG_SM_CLIENT_BACKEND_XSMP + global_client = egg_sm_client_xsmp_new (); +# endif +# ifdef EGG_SM_CLIENT_BACKEND_DBUS + if (!global_client) + global_client = egg_sm_client_dbus_new (); +# endif +#endif + } + + /* Fallback: create a dummy client, so that callers don't have + * to worry about a %NULL return value. + */ + if (!global_client) + global_client = g_object_new (EGG_TYPE_SM_CLIENT, NULL); + } + + return global_client; +} + +/** + * egg_sm_client_is_resumed: + * @client: the client + * + * Checks whether or not the current session has been resumed from + * a previous saved session. If so, the application should call + * egg_sm_client_get_state_file() and restore its state from the + * returned #GKeyFile. + * + * Return value: %TRUE if the session has been resumed + **/ +gboolean +egg_sm_client_is_resumed (EggSMClient *client) +{ + g_return_val_if_fail (client == global_client, FALSE); + + return sm_client_state_file != NULL; +} + +/** + * egg_sm_client_get_state_file: + * @client: the client + * + * If the application was resumed by the session manager, this will + * return the #GKeyFile containing its state from the previous + * session. + * + * Note that other libraries and #EggSMClient itself may also store + * state in the key file, so if you call egg_sm_client_get_groups(), + * on it, the return value will likely include groups that you did not + * put there yourself. (It is also not guaranteed that the first + * group created by the application will still be the "start group" + * when it is resumed.) + * + * Return value: the #GKeyFile containing the application's earlier + * state, or %NULL on error. You should not free this key file; it + * is owned by @client. + **/ +GKeyFile * +egg_sm_client_get_state_file (EggSMClient *client) +{ + EggSMClientPrivate *priv = EGG_SM_CLIENT_GET_PRIVATE (client); + char *state_file_path; + GError *err = NULL; + + g_return_val_if_fail (client == global_client, NULL); + + if (!sm_client_state_file) + return NULL; + if (priv->state_file) + return priv->state_file; + + if (!strncmp (sm_client_state_file, "file://", 7)) + state_file_path = g_filename_from_uri (sm_client_state_file, NULL, NULL); + else + state_file_path = g_strdup (sm_client_state_file); + + priv->state_file = g_key_file_new (); + if (!g_key_file_load_from_file (priv->state_file, state_file_path, 0, &err)) + { + g_warning ("Could not load SM state file '%s': %s", + sm_client_state_file, err->message); + g_clear_error (&err); + g_key_file_free (priv->state_file); + priv->state_file = NULL; + } + + g_free (state_file_path); + return priv->state_file; +} + +/** + * egg_sm_client_set_restart_command: + * @client: the client + * @argc: the length of @argv + * @argv: argument vector + * + * Sets the command used to restart @client if it does not have a + * .desktop file that can be used to find its restart command. + * + * This can also be used when handling the ::save_state signal, to + * save the current state via an updated command line. (Eg, providing + * a list of filenames to open when the application is resumed.) + **/ +void +egg_sm_client_set_restart_command (EggSMClient *client, + int argc, + const char **argv) +{ + g_return_if_fail (EGG_IS_SM_CLIENT (client)); + + if (EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command) + EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command (client, argc, argv); +} + +/** + * egg_sm_client_will_quit: + * @client: the client + * @will_quit: whether or not the application is willing to quit + * + * This MUST be called in response to the ::quit_requested signal, to + * indicate whether or not the application is willing to quit. The + * application may call it either directly from the signal handler, or + * at some later point (eg, after asynchronously interacting with the + * user). + * + * If the application does not connect to ::quit_requested, + * #EggSMClient will call this method on its behalf (passing %TRUE + * for @will_quit). + * + * After calling this method, the application should wait to receive + * either ::quit_cancelled or ::quit. + **/ +void +egg_sm_client_will_quit (EggSMClient *client, + gboolean will_quit) +{ + g_return_if_fail (EGG_IS_SM_CLIENT (client)); + + if (EGG_SM_CLIENT_GET_CLASS (client)->will_quit) + EGG_SM_CLIENT_GET_CLASS (client)->will_quit (client, will_quit); +} + +/** + * egg_sm_client_end_session: + * @style: a hint at how to end the session + * @request_confirmation: whether or not the user should get a chance + * to confirm the action + * + * Requests that the session manager end the current session. @style + * indicates how the session should be ended, and + * @request_confirmation indicates whether or not the user should be + * given a chance to confirm the logout/reboot/shutdown. Both of these + * flags are merely hints though; the session manager may choose to + * ignore them. + * + * Return value: %TRUE if the request was sent; %FALSE if it could not + * be (eg, because it could not connect to the session manager). + **/ +gboolean +egg_sm_client_end_session (EggSMClientEndStyle style, + gboolean request_confirmation) +{ + EggSMClient *client = egg_sm_client_get (); + + g_return_val_if_fail (EGG_IS_SM_CLIENT (client), FALSE); + + if (EGG_SM_CLIENT_GET_CLASS (client)->end_session) + { + return EGG_SM_CLIENT_GET_CLASS (client)->end_session (client, style, + request_confirmation); + } + else + return FALSE; +} + +/* Signal-emitting callbacks from platform-specific code */ + +GKeyFile * +egg_sm_client_save_state (EggSMClient *client) +{ + GKeyFile *state_file; + char *group; + + g_return_val_if_fail (client == global_client, NULL); + + state_file = g_key_file_new (); + + g_debug ("Emitting save_state"); + g_signal_emit (client, signals[SAVE_STATE], 0, state_file); + g_debug ("Done emitting save_state"); + + group = g_key_file_get_start_group (state_file); + if (group) + { + g_free (group); + return state_file; + } + else + { + g_key_file_free (state_file); + return NULL; + } +} + +void +egg_sm_client_quit_requested (EggSMClient *client) +{ + g_return_if_fail (client == global_client); + + if (!g_signal_has_handler_pending (client, signals[QUIT_REQUESTED], 0, FALSE)) + { + g_debug ("Not emitting quit_requested because no one is listening"); + egg_sm_client_will_quit (client, TRUE); + return; + } + + g_debug ("Emitting quit_requested"); + g_signal_emit (client, signals[QUIT_REQUESTED], 0); + g_debug ("Done emitting quit_requested"); +} + +void +egg_sm_client_quit_cancelled (EggSMClient *client) +{ + g_return_if_fail (client == global_client); + + g_debug ("Emitting quit_cancelled"); + g_signal_emit (client, signals[QUIT_CANCELLED], 0); + g_debug ("Done emitting quit_cancelled"); +} + +void +egg_sm_client_quit (EggSMClient *client) +{ + g_return_if_fail (client == global_client); + + g_debug ("Emitting quit"); + g_signal_emit (client, signals[QUIT], 0); + g_debug ("Done emitting quit"); + + /* FIXME: should we just call gtk_main_quit() here? */ +} + +static void +egg_sm_client_debug_handler (const char *log_domain, + GLogLevelFlags log_level, + const char *message, + gpointer user_data) +{ + static int debug = -1; + + if (debug < 0) + debug = (g_getenv ("EGG_SM_CLIENT_DEBUG") != NULL); + + if (debug) + g_log_default_handler (log_domain, log_level, message, NULL); +} diff --git a/gedit/smclient/eggsmclient.h b/gedit/smclient/eggsmclient.h new file mode 100755 index 00000000..e620b754 --- /dev/null +++ b/gedit/smclient/eggsmclient.h @@ -0,0 +1,117 @@ +/* eggsmclient.h + * Copyright (C) 2007 Novell, Inc. + * + * This library 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 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __EGG_SM_CLIENT_H__ +#define __EGG_SM_CLIENT_H__ + +#include + +G_BEGIN_DECLS + +#define EGG_TYPE_SM_CLIENT (egg_sm_client_get_type ()) +#define EGG_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT, EggSMClient)) +#define EGG_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT, EggSMClientClass)) +#define EGG_IS_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT)) +#define EGG_IS_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT)) +#define EGG_SM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT, EggSMClientClass)) + +typedef struct _EggSMClient EggSMClient; +typedef struct _EggSMClientClass EggSMClientClass; +typedef struct _EggSMClientPrivate EggSMClientPrivate; + +typedef enum { + EGG_SM_CLIENT_END_SESSION_DEFAULT, + EGG_SM_CLIENT_LOGOUT, + EGG_SM_CLIENT_REBOOT, + EGG_SM_CLIENT_SHUTDOWN +} EggSMClientEndStyle; + +typedef enum { + EGG_SM_CLIENT_MODE_DISABLED, + EGG_SM_CLIENT_MODE_NO_RESTART, + EGG_SM_CLIENT_MODE_NORMAL +} EggSMClientMode; + +struct _EggSMClient +{ + GObject parent; + +}; + +struct _EggSMClientClass +{ + GObjectClass parent_class; + + /* signals */ + void (*save_state) (EggSMClient *client, + GKeyFile *state_file); + + void (*quit_requested) (EggSMClient *client); + void (*quit_cancelled) (EggSMClient *client); + void (*quit) (EggSMClient *client); + + /* virtual methods */ + void (*startup) (EggSMClient *client, + const char *client_id); + void (*set_restart_command) (EggSMClient *client, + int argc, + const char **argv); + void (*will_quit) (EggSMClient *client, + gboolean will_quit); + gboolean (*end_session) (EggSMClient *client, + EggSMClientEndStyle style, + gboolean request_confirmation); + + /* Padding for future expansion */ + void (*_egg_reserved1) (void); + void (*_egg_reserved2) (void); + void (*_egg_reserved3) (void); + void (*_egg_reserved4) (void); +}; + +GType egg_sm_client_get_type (void) G_GNUC_CONST; + +GOptionGroup *egg_sm_client_get_option_group (void); + +/* Initialization */ +void egg_sm_client_set_mode (EggSMClientMode mode); +EggSMClientMode egg_sm_client_get_mode (void); +EggSMClient *egg_sm_client_get (void); + +/* Resuming a saved session */ +gboolean egg_sm_client_is_resumed (EggSMClient *client); +GKeyFile *egg_sm_client_get_state_file (EggSMClient *client); + +/* Alternate means of saving state */ +void egg_sm_client_set_restart_command (EggSMClient *client, + int argc, + const char **argv); + +/* Handling "quit_requested" signal */ +void egg_sm_client_will_quit (EggSMClient *client, + gboolean will_quit); + +/* Initiate a logout/reboot/shutdown */ +gboolean egg_sm_client_end_session (EggSMClientEndStyle style, + gboolean request_confirmation); + +G_END_DECLS + + +#endif /* __EGG_SM_CLIENT_H__ */ diff --git a/help/C/figures/gedit_format_bold.png b/help/C/figures/gedit_format_bold.png new file mode 100755 index 00000000..05be0606 Binary files /dev/null and b/help/C/figures/gedit_format_bold.png differ diff --git a/help/C/figures/gedit_format_italic.png b/help/C/figures/gedit_format_italic.png new file mode 100755 index 00000000..235528aa Binary files /dev/null and b/help/C/figures/gedit_format_italic.png differ diff --git a/help/C/figures/gedit_format_strikethrough.png b/help/C/figures/gedit_format_strikethrough.png new file mode 100755 index 00000000..40f41e47 Binary files /dev/null and b/help/C/figures/gedit_format_strikethrough.png differ diff --git a/help/C/figures/gedit_format_underline.png b/help/C/figures/gedit_format_underline.png new file mode 100755 index 00000000..5345d1aa Binary files /dev/null and b/help/C/figures/gedit_format_underline.png differ diff --git a/help/C/figures/gedit_recent_files_menu_icon.png b/help/C/figures/gedit_recent_files_menu_icon.png new file mode 100755 index 00000000..322e5c4b Binary files /dev/null and b/help/C/figures/gedit_recent_files_menu_icon.png differ diff --git a/help/C/figures/gedit_window.png b/help/C/figures/gedit_window.png new file mode 100755 index 00000000..ba9b50a8 Binary files /dev/null and b/help/C/figures/gedit_window.png differ diff --git a/help/C/gedit.xml b/help/C/gedit.xml new file mode 100755 index 00000000..453e61bc --- /dev/null +++ b/help/C/gedit.xml @@ -0,0 +1,1986 @@ + + + + + +]> + + + +
+ + + + Gedit Manual<!-- not using app entity because of lowercase ugliness --> + + 2007 + MATE Documentation Project + + 2002 + 2003 + 2004 + Sun Microsystems + + 2000 + Eric Baudais + + + + MATE Documentation Project + + + + + + + Joachim + Noreiko + + + MATE Documentation Project + + + MATE + + + + Hal + Canary + Added the Shortcut Keys Table + + + Sun Java Desktop System Documentation Team + + + Sun Microsystems +
gdocteam@sun.com
+
+
+ + Eric + Baudais + + MATE Documentation Project +
baudais@okstate.edu
+
+
+ + Baris + Cicek provided information from earlier revisions of the gedit application. + Acknowledgements + + + Ajit + George provided information about plugins. + Acknowledgements + + + + +
+ + + + + + + gedit V1.0 + 2000 + + Eric Baudais baudais@okstate.edu + + MATE Documentation Project + + + + gedit Manual V2.0 + March 2002 + + Sun MATE Documentation Team + MATE Documentation Project + + + + gedit Manual V2.1 + June 2002 + + Sun MATE Documentation Team + MATE Documentation Project + + + + gedit Manual V2.2 + August 2002 + + Sun MATE Documentation Team + MATE Documentation Project + + + + gedit Manual V2.3 + September 2002 + + Sun MATE Documentation Team + MATE Documentation Project + + + + gedit Manual V2.4 + January 2003 + + Sun MATE Documentation Team + MATE Documentation Project + + + + gedit Manual V2.5 + March 2003 + + Sun MATE Documentation Team + MATE Documentation Project + + + + gedit Manual V2.6 + September 2003 + + Sun MATE Documentation Team + MATE Documentation Project + + + + gedit Manual V2.7 + March 2004 + + Sun MATE Documentation Team + MATE Documentation Project + + + + &app; Manual V2.8 + &date; + + Sun Java Desktop System Documentation Team + MATE Documentation Project + + + + &app; Manual V&manrevision; + &date; + + MATE Documentation Team + MATE Documentation Project + + + + This manual describes version &appversion; of &app;. + + + Feedback + To report a bug or make a suggestion regarding the &app; application or this manual, follow the directions in the MATE Feedback Page. + + + + + &app; is a text editor for the MATE Desktop featuring basic yet + robust capabilities such as printing, spell checking, find and replace, + and syntax highlighting. More advanced features are available as plugins. + +
+ gedit + text editor + + + + + Introduction + + + + + The &app; application enables you to create and edit text files. + + The aim of &app; is to be a simple and easy to use text editor. More powerful features can be enabled with different plugins, allowing a variety of tasks related to text-editing. + + + + Getting Started + + + + Starting &app; + You can start &app; in the following ways: + + + Applications menu + + Choose AccessoriesText Editor. + + + + Command line + + Execute the following command: gedit + + + + By default, when you open a text document in the file manager, gedit will start, and display the document. + + + + + The &app; Window + When you start &app;, the following window is displayed: + +
+ &app; Window + + + + + + Shows gedit main window. + + + +
+ + The &app; window contains the following + elements: + + Menubar + + The menus on the menubar contain all of the commands you need to work with files in &app;. + + + Toolbar + + The toolbar contains a subset of the commands that you can access from the menubar. + + + Display area + + The display area contains the text of the file that you are editing. + + + Statusbar + + The statusbar displays information about current &app; activity and contextual information about the menu items. The statusbar also displays the following information: + + + Cursor position: the line number and column number where the cursor is located. + + + Edit mode: If the editor is in insert mode, the statusbar contains the text INS. If the editor is in overwrite mode, the statusbar contains the text OVR. Press the Insert key to change edit mode. + + + + + Side Pane + + The side pane displays a list of open documents, and other information depending on which plugins are enabled. + By default the side pane is not shown. To show it, choose ViewSide Pane. + + + Bottom Pane + + The bottom pane is used by programming tools such as the Python Console plugin to display output. + By default the bottom pane is not shown. To show it, choose ViewBottom Pane. + + + + When you right-click in the &app; window, the application displays a popup menu. The popup menu contains the most common text editing commands. + + Like other MATE applications, actions in &app; can be performed in several ways: with the menu, with the toolbar, or with shortcut keys. Shortcuts keys common to all applications are listed in the User Guide. +
+ + + + Running &app; from a Command Line + You can run &app; from a command line and open a single file or multiple files. To open multiple files from a command line, type the following command, then press Return: + gedit file1.txt file2.txt file3.txt + Alternatively, you can specify a URI instead of a filename. + For more information on how to run &app; from a command line, see the unix manual page for &app;, &app;1. + +
+ + + Working with Files + + + + Creating a New Document + To create a new document, choose FileNew. The application displays a new blank document in the &app; window. + + + + + Opening a File + To open a file, choose FileOpen to display the Open File dialog. Select the file that you want to open, then click Open. The file is displayed in the &app; window. + + The application records the paths and filenames of the five most recent files that you edited and displays the files as menu items on the File menu. You can also click on the Shows Recent Files menu icon. icon on the toolbar to display the list of recent files. + + You can open multiple files in &app;. The application adds a tab for each open file to the window. For more on this see . + + + + + + Saving a File + You can save files in the following ways: + + To save changes to an existing file, choose FileSave. + + To save a new file or to save an existing file under a new filename, choose File Save As . Enter a name for the file in the Save As dialog, then click Save. + + To save all of the files that are currently open in &app;, choose Documents Save All . + + + To close all of the files that are currently open in &app;, choose Documents Close All . + + + + + Opening a File from a URI + To open a file from a Uniform Resource Identifier (URI), perform the following steps: + + + Choose File Open Location to display the Open Location dialog. + + + Enter the URI of the file that you want to open. + + + Use the Character coding drop-down list to select the appropriate character coding. + + + Click Open. + + + Valid types of URI include http:, ftp:, file:, and all of the methods supported by mate-vfs. + Files from some types of URI are opened as read-only, and any changes you make must be saved to a different location. HTTP only allows files to be read. Files opened from FTP are read-only because because not all FTP servers may correctly work with saving remote files. + Saving to FTP servers can be enabled with Configuration Editor, setting the key /apps/gedit-2/preferences/editor/save/writable_vfs_schemes, but this may cause errors. + + + + + Working With Tabs + + When more than one file is open, &app; shows a tab for each document above the display area. To switch to another document, click on its tab. + To move a document to another &app; window, drag the tab corresponding to the file to the window you want to move it to. + To move a document to a new &app; window, either drag its tab to the desktop, or choose Documents Move to New Window . + + + + + + Working with Text + + + + Editing Text + You can edit the text of a file in the following ways: + + Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the arrow keys on the keyboard or click with the mouse. + + To copy the selected text to the clipboard, choose Edit Copy . + + To delete the selected text from the file and move the selected text to the clipboard, choose Edit Cut . + + To permanently delete the selected text from the file, choose Edit Delete . + + To insert the contents of the clipboard at the cursor position, choose Edit Paste . You must cut or copy text before you can paste text into the file, either from &app; or another application. + + To select all of the text in a file, choose Edit Select All . + + + + + + Undoing and Redoing Changes + To undo a change you have made, choose Edit Undo . To reverse this action, choose Edit Redo . + + + + + Finding and Replacing + + In &app;, there are two ways of searching for text. You can use the Find dialog to search for a specific piece of text, or Incremental Search to highlight matching text as you type it. + + + + + Finding Text + To search a file for a string of text, perform the following steps: + + Choose Search Find to display the Find dialog. + + Type the string that you want to find in the Search for field. You can include special characters such as a new line or tab: see . + + Click Find to search the file for the first occurrence of the string after your current cursor position. If &app; finds the string, the application selects first occurrence of the string. Other occurrences of the string are highlighted. + + To find the next occurrence of the string, click Find or choose Search Find Next . To find the previous occurrence of the text, choose Search Find Previous . + + + After you have closed the Find dialog, you can still move the selection to other occurrences of the text by choosing Search Find Next and Search Find Previous . + To remove the highlighting from the text, choose Search Clear Highlight . + + + + Incremental Search + + Incremental search highlights matching text in the document as you type it letter by letter. (This is similar to the search feature in several web browsers.) + To start an incremental search, choose Search Incremental Search . The search box appears at the top of the display area. + Begin typing, and text that matches will be highlighted in the document. The first instance after the cursor position is also selected. + To advance the selection to the next match while keeping the incremental search box open, press CtrlG. Press CtrlShiftG to go back to the previous match. + You can also use the up and down arrow keys or the mouse wheel to move the selection between matches. + + + + + Replacing Text + + To search a file for a string, and replace the string with an alternative string, perform the following steps: + + Choose Search Replace to display the Replace dialog. + + Type the string that you want to find, in the Search for field. You can include special characters such as a new line or tab: see . + Type the string that you want to use to replace the string that you find, in the Replace with field. + + + + To examine each occurrence of the string before replacing it, click Find. If &app; finds the string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the next occurrence of the string, click Find again. + To replace all occurrences of the string throughout the document, click Replace All. + + + + + Find and Replace Options + The Find dialog and the Replace dialog both have the following options: + + Select the Match case option to only find occurrences of the string that match the case of the text that you type. For example, with Match case selected, "TEXT" will not match "text". + + Select the Match entire word only option to only find occurrences of the string that match the entire words of the text that you type. For example, with Match entire word only selected, "text" will not match "texture". + + Select the Search backwards option to search backwards towards the beginning of the document. + + Select the Wrap around option to search to one end of the document and then continue the search from the other end of the file. + + + + + + + Special Characters + You can include the following escape sequences in the text to find or replace to represent special characters: + + + \n + + Specifies a new line. + + + + \t + + Specifies a tab character. + + + + \r + + Specifies a carriage return. + + + + \\ + + The backslash character itself must be escaped if it is being searched for. + For example, if you are looking for the "\n" literal, you will + have to type "\\n" in the Search for field. Or if you are + looking for a sequence of backslashes, you will have to double the number of + searched backslashes. + + + + + + + + Positioning the Cursor on a Specific Line + + To position the cursor on a specific line in the current file, choose Search Go to Line . The line number box appears at the top of the display area. + Begin typing the number of the line that you want to move the cursor to and the document will scroll to the specified line. + To dismiss the box and move the cursor to the specified line, press Return. + + + + + + Printing + + + + Setting the Page Options + + To set the page options, choose File Page Setup to display the Page Setup dialog. + + The Page Setup dialog enables you to specify the following print options: + + + General Tabbed Section + + Print syntax highlighting + + Select this option to print syntax highlighting. For more information about syntax highlighting, see . + + + Print page headers + + Select this option to include a header on each page that you print. You cannot configure the header. + + + Line Numbers + + + Select the Print line numbers option to include line numbers when you print a file. + Use the Number every ... lines spin box to specify how often to print the line numbers, for example every 5 lines, every 10 lines, and so on. + + + Text Wrapping + + Select the Enable text wrapping option to wrap text onto the next line, at a character level, when you print a file. The application counts wrapped lines as one line for line numbering purposes. + + Select the Do not split words over two lines option to wrap text onto the next line, at a word level, when you print a file. + + + + + + + + Fonts + + Body + + Click on this button to select the font to use to print the body text of a file. + + + Line numbers + + + Click on this button to select the font to use to print line numbers. + + + Headers and footers + + Click on this button to select the font to use to print the headers and footers in a file. + + + + To reset the fonts to the default fonts for printing a file from &app;, click Restore Default Fonts. + + + + + + + Printing a Document + You can use &app; to perform the following print operations: + + Print a document to a printer. + + Print the output of the print command to a file. + + + If you print to a file, &app; sends the output of the file to a pre-press format file. The most common pre-press formats are PostScript and Portable Document Format (PDF). + + To preview the pages that you want to print, choose File Print Preview . + + To print the current file to a printer or a file, choose File Print to display the Print dialog. + + The Print dialog enables you to specify the following print options: + + + Job Tabbed Section + + Print range + + Select one of the following options to determine how many pages to print: + + + All + Select this option to print all of the pages in the file. + + + Lines + Select this option to print the specified lines only. Use the From and To spin boxes to specify the line range. + + + Selection + Select this option to print the selected text only. This option is only available if you select text. + + + + + + Copies + + Use the Number of copies spin box to specify the number of copies of the file that you want to print. + If you print multiple copies of the file, select the Collate option to collate the printed copies. + + + + + + + Printer Tabbed Section + + Printer + + Use this drop-down list to select the printer to which you want to print the file. + + + Settings + + Use this drop-down list to select the printer settings. + + To configure the printer, click Configure. For example, you can enable or disable duplex printing, or schedule delayed printing, if this functionality is supported by the printer. + + + + Location + + + Use this drop-down list to select one of the following print destinations: + + + + CUPS + + + Print the file to a CUPS printer. + + + + If the selected printer is a CUPS printer, CUPS is the only entry in this drop-down list. + + + + + + lpr + + + Print the file to a printer. + + + + + File + + + Print the file to a PostScript file. + + + Click Save As to display a dialog where you specify the name and location of the PostScript file. + + + + + Custom + + + Use the specified command to print the file. + + + Type the name of the command in the text box. Include all command-line arguments. + + + + + + + State + + This functionality is not supported in this version of &app;. + + + + Type + + This functionality is not supported in this version of &app;. + + + + Comment + + This functionality is not supported in this version of &app;. + + + + + + + + Paper Tabbed Section + + Paper size + + Use this drop-down list to select the size of the paper to which you want to print the file. + + + Width + + Use this spin box to specify the width of the paper. Use the adjacent drop-down list to change the measurement unit. + + + Height + + Use this spin box to specify the height of the paper. + + + Feed orientation + + Use this drop-down list to select the orientation of the paper in the printer. + + + Page orientation + + Use this drop-down list to select the page orientation. + + + Layout + + Use this drop-down list to select the page layout. A preview of each layout that you select is displayed in the Preview area. + + + Paper tray + + Use this drop-down list to select the paper tray. + + + + + + + + + + + Programming Features + + Several of &app;'s features for programming are provided with plugins. For example, the Tag List plugin provides a list of commonly-used tags for different markup languages: see . + + + + Syntax Highlighting + Syntax highlighting makes source code easier to read by showing different parts of the text in different colors. + + &app; chooses an appropriate syntax highlighting mode based on a document's type. To override the syntax highlighting mode, choose View Highlight Mode , then choose one of the following menu items: + + + Normal + + Do not display any syntax highlighting. + + + + Sources + + Display syntax highlighting to edit source code. Use the Sources submenu to select the source code type. + + + + Markup + + Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type. + + + + Scripts + + Display syntax highlighting to edit script code. Use the Scripts submenu to select the script code type. + + + + Others + + Display syntax highlighting to edit other types of code. Use the Others submenu to select the code type. + + + + + + + + Piping the Output of a Command to a File + You can use &app; to pipe the output of a command to a text file. For example, to pipe the output of an ls command to a text file, type ls | gedit, then press Return. + The output of the ls command is displayed in a new text file in the &app; window. + Alternatively, you can use the External tools plugin to pipe command output to the current file. + + + + + + Shortcut Keys + Use shortcut keys to perform common tasks more quickly than with the mouse and menus. The following tables list all of &app;'s shortcut keys. + For more on shortcut keys, see the Desktop User Guide. + + + Tabs + Shortcuts for tabs: + + + + + + + + Shortcut Key + + Command + + + + + Ctrl + Alt + PageUp + Switches to the next tab to the left. + + + Ctrl + Alt + PageDown + Switches to the next tab to the right. + + + Ctrl + W + Close tab. + + + Ctrl + Shift + L + Save all tabs. + + + Ctrl + Shift + W + Close all tabs. + + + Alt + n + Jump to nth tab. + + + + + + + Files + Shortcuts for working with files: + + + + + + + + Shortcut Key + + Command + + + + + Ctrl + N + Create a new document. + + + Ctrl + O + Open a document. + + + Ctrl + L + Open a location. + + + Ctrl + S + Save the current document to disk. + + + Ctrl + Shift + S + Save the current document with a new filename. + + + Ctrl + P + Print the current document. + + + Ctrl + Shift + P + Print preview. + + + Ctrl + W + Close the current document. + + + Ctrl + Q + Quit Gedit. + + + + + + + Edit + Shortcuts for editing documents: + + + + + + + + Shortcut Key + + Command + + + + + Ctrl + Z + Undo the last action. + + + Ctrl + Shift + Z + Redo the last undone action . + + + Ctrl + X + Cut the selected text or region and place it on the clipboard. + + + Ctrl + C + Copy the selected text or region onto the clipboard. + + + Ctrl + V + Paste the contents of the clipboard. + + + Ctrl + A + Select all. + + + Ctrl + D + Delete current line. + + + Alt + Up + Move the selected line up one line. + + + Alt + Down + Move the selected line down one line. + + + + + + + Panes + Shortcuts for showing and hiding panes: + + + + + + + + Shortcut Key + + Command + + + + + F9 + Show/hide the side pane. + + + Ctrl + F9 + Show/hide the bottom pane. + + + + + + + Search + Shortcuts for searching: + + + + + + + + Shortcut Key + + Command + + + + + Ctrl + F + Find a string. + + + Ctrl + G + Find the next instance of the string. + + + Ctrl + Shift + G + Find the previous instance of the string. + + + Ctrl + K + Interactive search. + + + Ctrl + H + Search and replace. + + + Ctrl + Shift + K + Clear highlight. + + + Ctrl + I + Goto line. + + + + + + Tools + Shortcuts for tools: + + + + + + + + Shortcut Key + + Command + + + + + Shift + F7 + Check spelling (with plugin). + + + Alt + F12 + Remove trailing spaces (with plugin). + + + Ctrl + T + Indent (with plugin). + + + Ctrl + Shift + T + Remove Indent (with plugin). + + + F8 + Run "make" in current directory (with plugin). + + + Ctrl + Shift + D + Directory listing (with plugin). + + + + + + Help + Shortcuts for help: + + + + + + + + Shortcut Key + + Command + + + + + F1 + Open &app;'s user manual. + + + + + + + + + + + + Preferences + + To configure &app;, choose Edit Preferences . The Preferences dialog contains the following categories: + + + + + + + + + View Preferences + + + Text Wrapping + + Select the Enable text wrapping option to have long lines of text flow into paragraphs instead of running off the edge of the text window. This avoids having to scroll horizontally + Select the Do not split words over two lines option to have the text wrapping option preserve whole words when flowing text to the next line. This makes text easier to read. + + + + Line Numbers + + Select the Display line numbers option to display line numbers on the left side of the &app; window. + + + + Current Line + + Select the Highlight current line option to highlight the line where the cursor is placed. + + + + Right Margin + + Select the Display right margin option to display a vertical line that indicates the right margin. + Use the Right margin at column spin box to specify the location of the vertical line. + + + + Bracket Matching + + Select the Highlight matching bracket option to highlight the corresponding bracket when the cursor is positioned on a bracket character. + + + + + + + + Editor Preferences + + + Tabs + + Use the Tab width spin box to specify the width of the space that &app; inserts when you press the Tab key. + Select the Insert spaces instead of tabs option to specify that &app; inserts spaces instead of a tab character when you press the Tab key. + + + + Auto Indentation + + Select the Enable auto indentation option to specify that the next line starts at the indentation level of the current line. + + + + File Saving + + Select the Create a backup copy of files before saving option to create a backup copy of a file each time you save the file. The backup copy of the file contains a ~ at the end of the filename. + Select the Autosave files every ... minutes option to automatically save the current file at regular intervals. Use the spin box to specify how often you want to save the file. + + + + + + + Font & Colors Preferences + + + Font + + Select the Use default theme font option to use the default system font for the text in the &app; text window. + The Editor font field displays the font that &app; uses to display text. Click on the button to specify the font type, style, and size to use for text. + + + + Color Scheme + + You can choose a color scheme from the list of color schemes. By default, the following color schemes are installed: + + + Classic + + Classic color scheme based on the gvim color scheme. + + + + Cobalt + + Blue based color scheme. + + + + Kate + + Color scheme used in the Kate text editor. + + + + Oblivion + + Dark color scheme using the Tango color palette. + + + + Tango + + Color scheme using the Tango color scheme. + + + + You can add a new color scheme by clicking on Add..., and selecting a color scheme file + You can remove the selected color scheme by clicking on Remove + + + + + + + Plugins Preferences + Plugins add extra features to &app;. For more information on plugins and how to use the built-in plugins, see . + + + + Enabling a Plugin + To enable a &app; plugin, perform the following steps: + + + Choose Edit Preferences . + + + Select the Plugins tab. + + + Select the check box next to the name of the plugin that you want to enable. + + + Click Close to close the Preferences dialog. + + + + + + + Disabling a Plugin + A plugin remains enabled when you quit &app;. + To disable a &app; plugin, perform the following steps: + + + Choose Edit Preferences . + + + Select the Plugins tab. + + + Deselect the check box next to the name of the plugin that you want to disable. + + + Click Close to close the Preferences dialog. + + + + + + + + + Plugins + + Working with Plugins + You can add extra features to &app; by enabling plugins. A plugin is a supplementary program that enhances the functionality of an application. Plugins add new items to the &app; menus for the new features they provide. + + Several plugins come built-in with &app;, and you can install more. The gedit website lists third-party plugins. + To enable and disable plugins, or see which plugins are currently enabled, use the Plugins Preferences. + The following plugins come built-in with &app;: + + + + Change Case allows you to change the case of the selected text. + + + Document Statistics shows the number of lines, words, and characters in the document. + + + External Tools allows you to execute external commands from &app;. + + + File Browser allows you to browse your files and folders in the side pane. + + + Indent Lines adds or removes indentation from the selected lines. + + + Insert Date/Time adds the current date and time into a document. + + + Modelines allows you to set editing preferences for individual documents, and supports Emacs, Kate and Vim-style modelines. + + + Python Console allows you to run commands in the python programming language. + + + Snippets allows you to store frequently-used pieces of text and insert them quickly into a document. + + + Sort arranges selected lines of text into alphabetical order. + + + Spell Checker corrects the spelling in the selected text, or marks errors automatically in the document. + + + Tag List lets you insert commonly-used tags for HTML and other languages from a list in the side pane. + + + + For more information on creating plugins, see the &app; website. + + + +Change Case Plugin + The Change Case plugin changes the case of the selected text. + The following items are added to the Edit menu when the Change Case plugin is enabled: + + + + + + + + + + Menu Item + + Action + + Example + + + + + Edit +Change CaseAll Upper Case + Change each character to uppercase. + This text becomes THIS TEXT + + + Edit +Change CaseAll Lower Case + Change each character to lowercase. + This Text becomes this text + + + Edit +Change CaseInvert Case + Change each lowercase character to uppercase, and change each uppercase character to lowercase. + This Text becomes tHIS tEXT + + + Edit +Change CaseTitle Case + Change the first character of each word to uppercase. + this text becomes This Text + + + + + + + + +Document Statistics Plugin + The Document Statistics plugin counts the number of lines, words, characters with spaces, characters without spaces, and bytes in the current file. The plugin displays the results in a Document Statistics dialog. To use the Document Statistics plugin, perform the following steps: + + Choose Tools Document Statistics to display the Document Statistics dialog. The Document Statistics dialog displays the following information about the file: + + + Number of lines in the current document. + + + Number of words in the current document. + + + Number of characters, including spaces, in the current document. + + + Number of characters, not including spaces, in the current document. + + + Number of bytes in the current document. + + + + + You can continue to update the &app; file while the Document Statistics dialog is open. To refresh the contents of the Document Statistics dialog, click Update. + + + + + + + External Tools Plugin + The External Tools plugin allows you to execute external commands from &app;. You can pipe some content into a command and exploit its output (for example, sed), or launch a predefined command (for example, make). + Use the External Tools Manager to create and edit commands. To run an external command, choose it from the Tools menu. + + + Built-in Commands + The following commands are provided with the External Tools plugin: + + Build + + Runs make in the current document's directory. + + + Directory Listing + + Lists the contents of the current document's directory in a new document. + + + Environment Variables + + Displays the environment variables list in the bottom pane. + + + Grep + + Searches for a term in all files in the current document directory, using pattern matching. Results are shown in the bottom pane. + + + Remove Trailing Spaces + + Removes all spaces from the end of lines in the document. + + + + + + + Defining a Command + To add an external command, choose ToolsExternal Tools. + In the External Tools Manager window, click New. You can speficy the following details for the new command: + + Description + + This description is shown in the statusbar when the menu command is chosen. + + + Accelerator + + Enter a keyboard shortcut for the command. + + + Commands + + The actual commands to be run. Several &app; environment variables can be used to pass content to these commands: see . + + + Input + + The content to give to the commands (as stdin): the entire text of the current document, the current selection, line, or word. + + + Output + + What to do with the output of the commands: display in the bottom pane, put in a new document, or place in the current document, at the end, at the cursor position, or replacing the selection or the entire document. + + + Applicability + + Determines which sort of documents can be affected by the command, for example whether saved or not, and local or remote. + + + + + + + + Editing and Removing Tools + To edit a tool, select it in the list and make changes to its properties. + To rename a tool, click it again in the list. + To restore a built-in tool that you have changed, press Revert. + To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created yourself. + + + + Variables + You can use the following variables in the Commands field of the command definition: + + + GEDIT_CURRENT_DOCUMENT_URI + + + GEDIT_CURRENT_DOCUMENT_NAME + + + GEDIT_CURRENT_DOCUMENT_SCHEME + + + GEDIT_CURRENT_DOCUMENT_PATH + + + GEDIT_CURRENT_DOCUMENT_DIR + + + GEDIT_DOCUMENTS_URI + + + GEDIT_DOCUMENTS_PATH + + + + + + + File Browser Plugin + The File Browser Plugin shows your files and folders in the side pane, allowing you to quickly open files. + To view the File Browser, choose View Side Pane and then click on the tab showing the File Browser icon at the bottom of the side pane. + + Browsing your Files + The File Browser tab initially shows your file manager bookmarks. To browse the contents of any item, double-click it. + To show a parent folder, choose from the drop-down list, or press the up arrow on the File Browser's toolbar. + To show the folder that contains the document you are currently working on, right-click in the file list and choose Set root to active document. + + + Opening a File + To open a file in &app;, double-click it in the file list. + + + Creating Files and Folders + To create a new, empty text file in the current folder shown in the browser, right-click in the file list and choose New File. + To create a new folder in the current folder shown in the browser, right-click in the file list and choose New Folder. + + + + +Indent Lines Plugin + The Indent Lines plugin adds or removes space from the beginning of lines of text. + To indent or unindent text, perform the following steps: + + Select the lines that you want to indent. To indent or unindent a single line, place the cursor anywhere on that line. + + + + + To indent the text, choose Edit Indent . + + + To remove the indentation, choose Edit Unindent . + + + + + The amount of space used, and whether tab character or space characters are used, depends on the Tab Stops settings in the Editor Preferences: see . + + + + +Insert Date/Time Plugin + The Insert Date/Time plugin inserts the current date and time into a document. To use the Insert Date/Time plugin, perform the following steps: + + Choose Edit Insert Date and Time . + If you have not configured the Insert Date/Time plugin to automatically insert the date/time without prompting you for the format, &app; displays the Insert Date and Time dialog. Select the appropriate date/time format from the list. Click Insert to close the Insert Date and Time dialog. &app; inserts the date/time at the cursor position in the current file. + If you have configured &app; to use one particular date/time format, the Insert Date and Time dialog is not displayed. The date/time is automatically entered at the cursor position in the current file. + + + + +Configuring the Insert Date/Time Plugin +To configure the Insert Date/Time plugin, perform the following steps: + + Choose Edit Preferences . + + + Select the Plugins tab. + + + Select the Insert Date/Time plugin. + + + Click Configure Plugin to display the Configure insert date/time plugin dialog. + + + Select one of the options, as follows: + + To specify the date/time format each time you insert the date/time, select the Prompt for a format option. + + + To use the same &app;-provided date/time format each time you insert the date/time, select the Use the selected format option, then select the appropriate format from the list. When you select this option, &app; does not prompt you for the date/time format when you choose Edit Insert Date and Time . + + + To use the same customized date/time format each time you insert the date/time, select the Use custom format option, then enter the appropriate format in the text box. For more information about how to specify a custom format, see strftime3. When you select this option, &app; does not prompt you for the date/time format when you choose Edit Insert Date and Time . + + + + + Click OK to close the Configure insert date/time plugin dialog. + + + To close the Preferences dialog, click Close. + + + + + + + Modelines Plugin + The Modelines plugin allows you to set preferences for individual documents. A modeline is a line of text at the start or end of the document with settings that &app; recognises. + Preferences set using modelines take precedence over the ones specified in the preference dialog. + You can set the following preferences with modelines: + + + Tab width + + + Indent width + + + Insert spaces instead of tabs + + + Text Wrapping + + + Right margin width + + + + The Modelines plugin supports a subset of the options used by other text editors Emacs, Kate and Vim. + + + Emacs Modelines + The first two lines of a document are scanned for Emacs modelines. + The Emacs options for tab-width, indent-offset, indent-tabs-mode and autowrap are supported. For more information, see the GNU Emacs Manual. + + + Kate Modelines + The first and last ten lines a document are scanned for Kate modelines. + The Kate options for tab-width, indent-width, space-indent, word-wrap and word-wrap-column are supported. For more information, see the Kate website. + + + Vim Modelines + The first and last three lines a document are scanned for Vim modelines. + The Vim options for et, expandtab, ts, tabstop, sw, shiftwidth, wrap, and textwidth are supported. For more information, see the Vim website. + + + + + Python Console Plugin + The Python Console Plugin allows you to run commands in the python programming language from &app;. Enabling the plugin adds a tab to the bottom pane. This shows recent output and a command prompt field. + Commands entered into the python console are not checked before they are run. It is therefore possible to hang &app;, for example by entering an infinite loop. + + + +Snippets Plugin + The Snippets plugin allows you to store frequently-used pieces of text, called snippets, and insert them quickly into a document. + Snippets are specific to the language syntax of the current document. For example, when you are working with an HTML document, you can choose from a list of snippets that are useful for HTML. In addition, some snippets are global, and are available in all documents. + A number of built-in snippets are installed with &app;, which can be modified. + + + Inserting Snippets + To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is usually the first few letters of the snippet, or something else that is short and easy to remember. + Alternatively, press CtrlSpace to see a list of snippets you can insert. + + + + Adding Snippets + To create a new snippet, do the following: + + + Choose ToolsManage Snippets. The Snippets Manager window opens. + + + The list of snippets is grouped by language. Select the language you want to add a snippet to, or a snippet in that language group. To add a snippet for all languages, choose Global at the top of the list. The syntax of the document you are currently working with is shown by default. + + + Click New. A new snippet appears in the list. + + + Enter the following information for the new snippet: + + Name + + Enter a name for the snippet in the text field within the snippet list. The name of a snippet serves only as a reminder of its purpose. You can change name of a snippet you create by clicking on it in the list. + + + Snippet text + + Enter the text of the snippet in the Edit snippet text box. For special codes you can use, see . + You can switch back to the document window to copy text without closing the Snippets Manager window. + + + Tab Trigger + + Enter the tab trigger for the snippet. This is the text that you type before pressing Tab to insert the snippet. + The tag must be either a single word comprising only letters, or any single character. The Tab trigger will highlight in red if an invalid tab trigger is entered. + + + Shortcut key + + Type a shortcut key to use for inserting the snippet. + + + + + + + + + Editing and Removing Snippets + To edit a snippet, select it in the list and make changes to its text and activation properties. + To rename a snippet, click it again in the list. + To restore a built-in snippet that you have changed, press Revert. + To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have created yourself. + + + + Snippet Substitutions + In addition to inserting stored text, a snippet can include customizable text, or mark spaces where you can add text once the snippet is inserted in your document. + + + + You can use the following placeholder codes in snippet text: + + Tab placeholders + + $n defines a tab placeholder, where n is any number from 1 upwards. + ${n:default} defines a tab placeholder with a default value. + A tab placeholder marks a place in the snippet text where you can add extra text after the snippet is inserted. + To use tab placeholders, insert the snippet as normal. The cursor is placed at the first tab placeholder. Type text, and press Tab to advance to the next tab placeholder. The number in the placeholder code defines the order in which tab advances to each place in the text. + Press ShiftTab to return to the previous tab placeholder. Pressing Tab when there are no more tab placeholders moves the cursor to the end of the snippet text, or to the end placeholder if it exists. + + + Mirror placeholders + + A repeated tab placeholder will mirror the placeholder already defined. This allows you to type in text only once that you want to appear several times in the snippet. + + + End placeholder + + $0 defines the end placeholder. This allows you to finish working with the snippet with the cursor at a point other than the end of the snippet text. + + + Environmental variables + + Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific to &app; can also be used: + + $GEDIT_SELECTED_TEXT + + The currently selected text. + + + $GEDIT_FILENAME + + The full filename of the document, or an empty string if the document isn't saved yet. + + + $GEDIT_BASENAME + + The basename of the filename of the document, or an empty string if the document isn't saved yet. + + + $GEDIT_CURRENT_WORD + + The word at the cursor's location in the document. When this variable is used, the current word will be replaced by the snippet text. + + + + + + + + Shell placeholders + + $(cmd) is replaced by the result of executing cmd in a shell. + $(n:cmd) allows you to give this placeholder a reference, where n is any number from 1 upwards. Use $n to use the output from one shell placeholder as input in another. + + + Python placeholders + + $<cmd> is replaced by the result of evaluating cmd in the python interpreter. + $<a:cmd> specifies another python placeholder as a dependency, where a gives its order in the snippet. This allows you to use python functions defined in another snippet. To specify several dependencies, separate the numbers with commas thus: $<a,b:cmd> + To use a variable in all other python snippets, declare it as global. + + + + + + + + +Sort Plugin + The Sort plugin arranges selected lines of text into alphabetical order. + You cannot undo the Sort operation, so you should save the file before performing the sort. To revert to the saved version of the file after the sort operation, choose File Revert . + + + To use the Sort plugin, perform the following steps: + + + Select the lines of text you want to sort. + + Choose Edit Sort . The Sort dialog opens. + + + Choose the options you want for the sort: + + + To arrange the text in reverse order, select Reverse order. + + + To delete duplicate lines, select Remove duplicates. + + + To ignore case sensitivity, select Ignore case. + + + To have the sort ignore the characters at the start of the lines, set the first character that should be used for sorting in the Start at column spin box. + + + + + To perform the sort operation, click Sort. + + + + + + +Spell Checker Plugin + The Spell Checker plugin checks the spelling in the selected text. You can configure &app; to check the spelling automatically, or you can check the spelling manually, in the specified language. The language setting, and the autocheck spelling properties, apply per document. To use the Spell checker plugin, perform the following steps: + + Choose Tools Set Language to display the Set language dialog. Select the appropriate language from the list. Click OK to close the Set language dialog. + + + To check the spelling automatically, choose Tools Autocheck Spelling . To unset the automatic spell check, choose Tools Autocheck Spelling again. When automatic spell checking is set, an icon is displayed beside the Autocheck Spelling menu item. Automatic spell checking is unset by default, each time &app; starts. + Unknown spellings are displayed in a different color, and underlined. Right-click on an unknown spelling, then select Spelling Suggestions from the popup menu: + + + To replace the unknown spelling with another spelling in the list, select the replacement spelling from the Spelling Suggestions popup menu. + + + To add the unknown spelling to your personal dictionary, select Spelling Suggestions Add . + + + To ignore all occurrences of the unknown spelling, so that they are no longer flagged as unknown but are not added to your personal dictionary, select Spelling Suggestions Ignore All . The unknown word is ignored in the current &app; session only. + + + + + To check the spelling manually, choose Tools Check Spelling . + + If there are no spelling errors, an Information dialog displays a message stating that the document does not contain misspelled words. Click OK to close the Information dialog. + + If there are spelling errors, the Check Spelling dialog is displayed: + + + The Misspelled word is displayed at the top of the dialog. + + + A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by selecting a spelling from the Suggestions list, or you can enter text directly into the Change to text box. + + + To check the spelling of the text in the Change to text box, click Check Word. If this is a known word, the Suggestions list is replaced with the text (correct spelling). If the word is not known, new entries appear in the Suggestions list. + + + To ignore the current occurrence of the unknown word, click Ignore. To ignore all occurrences of the unknown word, click Ignore All. The unknown word is ignored in the current &app; session only. + + + To change the current occurrence of the unknown word to the text in the Change to text box, click Change. To change all occurrences of the unknown word to the text in the Change to text box, click Change All. + + + To add the unknown word to your personal dictionary, click Add word. + + + To close the Check Spelling dialog, click Close. + + + + + + + + +Tag List Plugin + The Tag List plugin allows you to insert common tags from a list in the side pane. + To use the Tag List plugin, perform the following steps: + + Choose View Side Pane . + + + + By default, the side pane shows a tab containing a list of open documents. Click on the tab showing a + icon at the bottom of the side pane to show the tag list tab. + + Select the appropriate tag category from the drop-down list. For example, HTML - Tags. + + + Scroll through the tag list to find the required tag. + + + To insert a tag at the cursor position in the current file, double-click on the tag in the tag list. You can also insert a tag as follows: + + To insert a tag in the current file and change the focus from the side pane to the display area, press Return. + + + To insert a tag in the current file and maintain the focus on the Tag list plugin window, press ShiftReturn. + + + + + + + + + +
diff --git a/help/C/legal.xml b/help/C/legal.xml new file mode 100755 index 00000000..0203b9d4 --- /dev/null +++ b/help/C/legal.xml @@ -0,0 +1,73 @@ + + + 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 link or in the file COPYING-DOCS + distributed with this manual. + + 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. + + + + 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. + + + + DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED + UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE + WITH THE FURTHER UNDERSTANDING THAT: + + + + 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 + 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. + + + + + + diff --git a/help/Makefile.am b/help/Makefile.am new file mode 100755 index 00000000..3ce92d91 --- /dev/null +++ b/help/Makefile.am @@ -0,0 +1,18 @@ +include $(top_srcdir)/mate-doc-utils.make +dist-hook: doc-dist-hook + +DOC_MODULE = gedit +DOC_ENTITIES = +DOC_INCLUDES = legal.xml +DOC_FIGURES = \ + figures/gedit_format_bold.png \ + figures/gedit_format_italic.png \ + figures/gedit_format_strikethrough.png \ + figures/gedit_format_underline.png \ + figures/gedit_recent_files_menu_icon.png \ + figures/gedit_window.png + +DOC_LINGUAS = ar bg ca cs da de el es fi fr hu it ja ko oc pt_BR ru sv th uk zh_CN zh_HK zh_TW + + +-include $(top_srcdir)/git.mk diff --git a/help/ar/ar.po b/help/ar/ar.po new file mode 100755 index 00000000..f8ea1df7 --- /dev/null +++ b/help/ar/ar.po @@ -0,0 +1,4057 @@ +# translation of help (gedit).HEAD.po to Arabic +# Osama Khalid , 2008, 2009. +# Khaled Hosny , 2009 +msgid "" +msgstr "" +"Project-Id-Version: help (gedit).HEAD\n" +"POT-Creation-Date: 2009-04-18 16:48+0200\n" +"PO-Revision-Date: 2009-04-18 16:54+0300\n" +"Last-Translator: Khaled Hosny \n" +"Language-Team: Arabic \n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n>=3 && " +"n<=10 ? 3 : n>=11 && n<=99 ? 4 : 5;\n" +"X-Generator: Virtaal 0.3.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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "دليل محرر النصوص" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "مشروع توثيق جنوم" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "صن ميكروسِستمز" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "إرِك بيديس" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "جوكيم" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "نوريكو" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "جنوم" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "هال" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "كانري" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "أضيف جدول مفاتيح الاختصار" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "فريق توثيق نظام سطح مكتب صن جافا" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "إرِك" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "بيديس" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "باريس" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "سيسك قدم معلومات من المراجعات الأولى لتطبيق محرر النصوص." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "إشادات" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "أجيت" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "جورج قدم معلومات عن الملحقات." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "محرر النصوص الإصدار 1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "إرِك بيديس baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "دليل محرر النصوص الإصدار 2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "مارس 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "فريق توثيق صن جنوم" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "دليل محرر النصوص الإصدار 2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "يونيو 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "دليل محرر النصوص الإصدار 2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "أغسطس 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "دليل محرر النصوص الإصدار 2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "سبتمبر 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "دليل محرر النصوص الإصدار 2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "يناير 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "دليل محرر النصوص الإصدار 2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "مارس 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "دليل محرر النصوص الإصدار 2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "سبتمبر 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "دليل محرر النصوص الإصدار 2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "مارس 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "دليل محرر النصوص الإصدار 2.8" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "دليل محرر النصوص الإصدار 2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "فريق توثيق جنوم" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "هذا الدليل يشرح الإصدار 2.16 من محرر النصوص." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "التعليقات" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"للإبلاغ عن العلل أو الاقتراحات بخصوص برنامج gedit " +"أو هذا الدليل، اتبع التعليمات في ulink url=\"ghelp:user-guide?feedback-bugs\" " +"type=\"help\">صفحة تعليقات جنوم." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"محرر النصوص هو محرر نصوص لسطح مكتب جنو يتميز بالقابلية القوية الأساسية مثل " +"الطباعة، والتدقيق الإملائي، والإيجاد والاستبدال، وإبراز الصيغ. المزيد من " +"المزايا متوفرة كملحقات." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "محرر النصوص" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "محرر نصوص" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "مقدمة" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"التطبيق gedit يتيح لك إنشاء وتحرير الملفات النصية." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"غاية محرر النصوص أن يكون محرر نصوص بسيط وسهل. " +"مزايا أقوى يمكن أن تُفعّل مع ملحقات، تسمح بمزايا عديدة " +"لمهام متعلقة بتحرير النص." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "البدء" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "بدء محرر النصوص" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "تستطيع بدء محرر النصوص بالطريق التالية:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "قائمة التطبيقات" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"اختر الملحقاتمحرر النصوص." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "سطر الأوامر" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "شغّل السطر التالي: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"مبدئيا، عند فتح مستند نصي في مدير الملفات، سوف يبدأ محرر النصوص، ويعرض " +"المستند." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "نافذة محرر النصوص." + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "عند بدء محرر النصوص، النافذة التالية تُعرض:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "نافذة محرر النصوص." + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "تعرض نافذة محرر النصوص الرئيسية." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "نافذة gedit تحتوي العناصر التالية:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "شريط القوائم" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"القوائم على شريط القوائم تحتوي كل الأوامر التي تحتاجها للعمل مع الملفات في " +"gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "شريط الأدوات " + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"شريط الأدوات يحتوي رصّة فرعية من الأوامر التي تستطيع الوصول إليها من شريط " +"الأدوات." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "منطقة العرض" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "تحتوي منطقة العرض نص الملف الذي تحرّره." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "شريط الحالة " + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"شريط الحالة يعرض معلومات حول نشاط gedit الحالي " +"ومعلومات مُتسقة حول عناصر القائمة. شريط الحال يعرض أيضا المعلومات التالية:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "موضع المؤشر: رقم السطر ورقم العمود حيث يقع المؤشر." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"نمط التحرير: إذا كان المحرر في وضع الإدراج، شريط الحالي يحتوي النص " +"إضافة. إذا كان المحرر في وضع الكتابة الفوقية، شريط " +"الحالي يحتوي استبدال. اضغط مفتاح Insert لتغيير نمط التحرير." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "اللوحة الجانبية" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"تعرض اللوحة الجانبية قائمة المستندات المفتوحة، ومعلومات أخرى مبنية على " +"الملحقات المُفعّلة." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"ابتدائيا ليست معروضة، لعرضها، اختر عرضاللوحة الجانبية." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "اللوحة السفلية" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"اللوحة السفلية مُستخدمة بواسطة أدوات البرمجة مثل ملحق كونسول " +"بايثون لعرض المُخرج." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"ابتدائيا اللوحة السفلية ليست معروضة. لعرضها، اختر عرضاللوحة السفلية." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"عندما تنقر يمينا في نافذة محرر النصوص، يعرض " +"التطبيق قائمة منبثقة. القائمة المنبثقة تحتوي معظم أوامر تحرير النصوص الشائعة." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"مثل تطبيقات جنوم الأخرى، الإجراءات في محرر النصوص " +"يمكن أن تُؤدى بطرق مختلفة، من القائمة، أو من شريط الأدوات، أو من مفاتيح " +"الاختصار. مفاتيح الاختصار الشائعة لكل التطبيقات مُدرجة في دليل المستخدم." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "تشغيل محرر النصوص من سطر الأوامر." + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"تستطيع تشغيل محرر النصوص من سطر الأوامر وفتح ملف " +"وحيد أو ملفات متعددة. لفتح ملفات متعددة من سطر الأوامر، اطبع الأمر التالي، " +"ثم انقر إدخال:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "ملف1.txt ملف2.txt ملف3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "بدلا من ذلك، تستطيع تحديد مسار بدلا من اسم ملف." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"لمزيد من المعلومات عن كيفية تشغيل محرر النصوص من " +"سطر الأوامر، راجع صفحة دليل يونكس لمحرر النصوص، محرر النصوص1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "العمل مع الملفات" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "إنشاء مستند جديد " + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"لإنشاء مستند جديد، اختر ملفجديد. التطبيق يعرض مستند فارغ في نافذة " +"محرر النصوص." + +#: C/gedit.xml:346(title) C/gedit.xml:1591(title) +msgid "Opening a File" +msgstr "فتح ملف" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"لفتح ملف، اختر ملفافتح لعرض حوار فتح ملف. انتقِ الملف " +"الذي تريد فتحه، ثم انقر افتح. الملف يُعرض في نافذة " +"محرر النصوص." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "يعرض أيقونة قائمة أحدث الملفات." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"التطبيق يسجل المسارات وأسماء الملفات لأحدث خمس ملفات حرّرتها ويعرض الملفات " +"كعناصر قائمة في قائمة ملف. " +"تستطيع أيضا النقر على أيقونة على شريط الأدوات لعرض قائمة " +"بأحدث الملفات." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"تستطيع فتح ملفات متعددة في محرر النصوص. يضيف " +"التطبيق لسان لكل فتح ملف إلى النافذة. للمزيد عن هذا راجع ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "حفظ ملف" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "تستطيع حفظ ملفات بالطرق التالية:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"لحفظ التغييرات لملف موجود، اختر ملفاحفظ." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"لحفظ ملف جديد أو لحفظ ملف موجود تحت اسم ملف جديد، اختر " +"ملفاحفظ كـ." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"لحفظ كل الملفات المفتوحة حاليا في محرر النصوص، " +"اختر مستنداتاحفظ الكل." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"لإغلاق كل الملفات المفتوحة حاليا محرر النصوص، " +"اختر مستنداتأغلق الكّل." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "فتح ملف من مسار" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "لفتح ملف من معرّف نظامي لمورد (مسار)، أدِ الخطوات التالية:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"اختر ملفافتح موقعا لعرض حوار فتح موقع." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "أدخل مسار الملف الذي تريد فتحه." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"استخدم قائمة ترميز المحارف المنسدلة لانتقاء ترميز محارف " +"ملائم." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "انقر افتح." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"الأنواع الصالحة للمسار تتضمن http:، ftp:، file:، وكل الوسائل " +"المدعومة من mate-vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"الملفات من بعض أنواع المسارات تُفتح كللقراءة فقط، وأي تغييرات تجريها يجب أن " +"تُحفظ إلى موقع آخر. إتش​تي​تي​بي فقط يسمح للملفات أن تُقرأ. " +"الملفات المفتوحة من إف​تي​بي للقراءة فقط لأن ليس كل خوادم " +"إف​تي​بي تتدعم بشكل صحيح العمل مع حفظ الملفات البعيدة." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"الحفظ إلى خوادم إف​تي​بي يمكن أن يُفعل من محرر التشكيل، " +"ضبط المفتاح /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes، لكن هذا قد يسبب أخطاءً." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "العمل مع الألسنة" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"عندما يفتح أكثر من ملف، يعرض محرر النصوص " +"لسان لكل مستند أعلى منطقة العرض. للتبديل إلى مستند " +"آخر، انقر لسانها." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"لنقل مستند إلى نافذة محرر النصوص أخرى، ألقِ اللسان " +"الملائم للملف إلى النافذة التي تريدها لنقله." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"لنقل مستند إلى نافذة محرر النصوص، إما أن تلقي " +"لسانه إلى سطح المكتب، أو اختر مستنداتانقل إلى نافذة جديدة." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "العمل مع النص" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "تحرير النص" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "تستطيع تعديل نص ملف بالطرق التالية:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"اطبع النص الجديد من لوحة المفاتيح. مؤشر الإدخال " +"النابض يعلّم النقطة حيث يضاف النص. لتغيير هذا، استخدام مفاتيح الأسهم على لوحة " +"المفاتيح أو انقر بالفأرة." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"لنسخ النص المُنتقى إلى الحافظة، اختر تحريرانسخ." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"لحذف النص المنتقى من الملف ونقل النص المنتقى إلى الحافظة، اختر " +"تحريرقص." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"لحذف النص المنتقى بشكل دائم من الملف، اختر تحريراحذف." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"لإدراج محتويات الحافظة في موضع المؤشر، اختر تحريرالصق. يجب أن تقص أو تنسخ نصا " +"قبل أن تتمكن من لصق النص إلى الملف، سواءً من محرر النصوص أو تطبيق آخر." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"لانتقاء كل النص في ملف، اختر تحريرانتقِ الكل." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "استرجاع وإعادة التغييرات" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"للتراجع عن تعديل قمت به، اختر تحريرتراجع. لعكس الإجراء، اختر " +"تحريرأعِد." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "الإيجاد والاستبدال" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"في محرر النصوص، يوجد طريقتين للبحث عن نص. تستطيع " +"استخدام حوار إيجاد للبحث عن جزء محدد من النص، أو " +"بحث تزايدي لإبراز نص يطابق الذي تكتبه." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "إيجاد النص" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "للبحث في ملف عن مقطع من نص، أدِ الخطوات التالية:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"اختر بحثجِد لعرض حوار إيجاد." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"اطبع المقطع الذي تريد إيجاده في حقل ابحث عن. تستطيع " +"تضمين محارف خاصة مثل سطر جديد أو Tab: راجع ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"انقر جِد للبحث في الملف عن أول مصادفة للمقطع بعد موضع " +"المؤشر الحالي. إذا وجد محرر النصوص المقطع، ينتقي " +"التطبيق أول مصادفة للمقطع. المصادفات الآخرى للمقطع سوف تُبرز." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"لإيجاد المصادفة التالي للمقطع، انقر جٍد أو اختر " +"بحثجد التالي. لإيجاد المصادفة السابقة للنص، اختر بحثجد السابق." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"بعد إغلاقك لحوار إيجاد، مازال يمكنك نقل التحديد " +"لمصادفات أخرى للنص عن طريق اختيار بحثجد التالي أو " +"بحثجد السابق." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"لإزالة الإبراز من النص، اختر بحثامسح الإبراز." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "البحث التزايدي" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"البحث التزايدي يعلم النص المطابق في المستند كما تكتبه حرفا حرفا. (هذا شبيه " +"بميزة البحث في متصفحات وب عديدة.)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"لبدء بحث تزايدي، اختر بحثبحث " +"تزايدي." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"اكتب، وسيُبرز النص الذي يطابق في المستند. أول مثال بعد موضع المؤشر سوف يُنتقى " +"أيضا." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"لتقديم الانتقاء إلى التطابق التالي أثناء فتح الصندوق التزايدي، انقر " +"CtrlG. انقر " +"CtrlShiftG للرجوع إلى التطابق السابق." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"تستطيع أيضا استخدام مفتاحي السهمين أعلى وأسفل أو عجلة الفأرة لنقل التحديد " +"بين التطابقات." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "استبدال نص" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "للبحث في ملف عن نص، واستبدال النص بنص بديل، أدِ الخطوات التالية:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"اختر بحثاستبدل لعرض حوار استبدال." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"اطبع النص الذي تريد إيجاده، في حقل ابحث عن. تستطيع " +"تضمين محارف خاصة مثل سطر جديد أو اللسان: راجع ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"اطبع النص الذي تريد استخدامه لاستبدال النص الذي وجدته، في حقل " +"استبدل بـ:" + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"لتفحص كل مصادفة للنص قبل استبداله، انقر جِد. إذا وجد " +"محرر النصوص النص، سوف ينتقي التطبيق النص. انقر " +"استبدل لاستبدال المصادفة المنتقاة للنص. لإيجاد " +"المصادفة التالية، انقر جِد مجددا." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"لاستبدال كل مصادفات النص على طول المستند، انقر استبدل الكل." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "خيارات البحث والاستبدال" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"حوار إيجاد وحوار استبدال كلاهما " +"لهما الخيارات التالية:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"انتقِ الخيار طابق الحالة لإيجاد أي حالات للنص تطابق حالة " +"النص الذي طبعته. على سبيل المثال، مع انتقاء طابق الحالة، \"TEXT\" لن تطابق \"text\"." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"انتقِ الخيار طابق كامل الكلمة فقط لإيجاد فقط مصادفات " +"النص التي تطابق كلمات النص الكاملة التي طبعتها. على سبيل المثال، مع انتقاء " +"طابق كامل الكلمة فقط، \"نص\" لن تطابق \"نصي\"." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"انتقِ الخيار ابحث إلى الخلف للبحث إلى الخلف إلى بداية " +"المستند." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"انتقِ خيار لف حول للبحث إلى نهاية المستند ثم استمرار " +"البحث من النهاية الأخرى للملف." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "المحارف الخاصة" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"يمكنك تضمين التسلسلات الهاربة التالية في النص للإيجاد أو الاستبدال إلى " +"المحارف الممثلة التالية:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "يحدد سطرا جديدا." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "يحدد محرّف اللسان." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "يحدد عودة ناقل." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"محرّف الخط المائل العكسي ذاته يجب أن يهرب إذا بُحث عنه. على سبيل المثال، إذا " +"كنت تبحث عن \"\\n\" حرفيا، عليك طباعة \"\\\\n\" في حقل " +"ابحث عن. أو إذا كنت تبحث عن تسلسل خطوط مائلة عكسية، " +"عليك مضاعفة عدد الحطوط المائلة المعكوسة المبحوث عنها." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "وضع المؤشر على سطر محدد" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"لوضع المؤشر على سطر معين في الملف الحالي، اختر بحثاذهب إلى السطر. صندوق رقم " +"السطر يظهر في أعلى منطقة العرض." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"عندما تطبع رقم السطر الذي تريد نقل المؤشر إليه، سوف يلف المستند إلى السطر " +"المحدد." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"لإيقاف الصندوق وتحريك المؤشر إلى السطر المحدد، اضغط إدخال." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "الطباعة" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "ضبط خيارات الصفحة" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"لضبط خيارات الصفحة، اختر ملفإعداد الصفحة لعرض حوار " +"إعداد الصفحة." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"حوار إعداد الصفحة يتيح لك تحديد خيارات الطباعة التالية:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "القسم العام المؤلسن" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "طباعة إبراز الصياغة" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"انتقِ هذا الخيار لطباعة تعليم الصياغة. لمزيد من المعلومات حول إبراز الصياغة، " +"راجع ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "طباعة ترويسات الصفحة" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "انتقِ هذا الخيار لتضمين ترويسة لكل صفحة تطبعها. لا يمكنك ضبط الترويسة." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "أرقام السطور" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"انتقِ خيار طباعة أرقام السطور لتضمين أرقام السطور عندما " +"تطبع ملفا." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"استخدم صندوق رقّم كل ... سطر لتحديد مرات طباعة أرقام " +"الأسطر، على سبيل المثال، كل 5 أسطر، وكل 10 أسطر، وهكذا." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1168(guilabel) C/gedit.xml:1687(para) +msgid "Text Wrapping" +msgstr "لف النص" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"انتقِ خيار فعّل لف النص للف النص إلى السطر التالي، على " +"مستوى المحرف، عندما تطبع ملفا. يعد التطبيق الأسطر الملفوفة كسطر واحد لعملية " +"ترقيم السطر." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"انتقِ خيار لا تشقّ الكلمات على سطرين للف النص إلى السطر " +"التالي، على مستوة الكلمة، عندما تطبع ملفا." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "الخطوط" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "الجسم" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "انقر على هذا الزر لانتقاء الخط لاستخدامه لطباعة جسم نص ملف." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "رقم السطور" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "انقر على هذا الزر لانتقاء الخط لاسخدامه لطباعة أرقام السطور." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "الترويسات والتذييلات" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"انقر على هذا الزر لانتقاء الخط لاسخدامه لطباعة الترويسات والهوامش في ملف." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"لإعادة ضبط الخطوط إلى الخطوط المبدئية لطباعة ملف من محرر " +"النصوص، انقر استرجع الخطوط المبدئية." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "طباعة مستند" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"تستطيع استخدام محرر النصوص لتأدية عمليات الطباعة " +"التالية:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "طباعة مستند إلى طابعة." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "طباعة مخرج أمر الطباعة لملف." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"إذا كنت تطبع ملفا، يرسل محرر النصوص مخرج الملف " +"إلى ملف قبل الضغط. أكثر أوامر قبل الضغط شيوعا هي بوست​سكربت ونسق " +"المستند المحمول (بي​دي​إف)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"لمعاينة الصفحات التي تريد طباعتها، اختر ملفمعاينة الطباعة." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"لطباعة الملف الحالي إلى طباعة، اختر ملفاطبع لعرض حوار " +"طباعة." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "حوار طباعة يتيح لك تحديد خيارات الطباعة التالية:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "قسم الشغل المؤلسن" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "مدى الطباعة" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "انتقِ واحد من الخيارات التالية لتقرير عدد الصفحات لطبعها:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "كل" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "انتقِ هذا الخيار لطباعة كل الصفحات في الملف." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "سطور" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"انتقِ هذا الخيار لطباعة الأسطر المُحددة فقط. استخدم الصندوقين من و إلى لتحديد مدى السطر." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "انتقاء" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"انتقِ هذا الخيار لطباعة النص المُنتقى فقط. هذا الخيار متاح فقط إذا انتقيت نصا." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "نُسخ" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"استخدم صندوق عدد النسخ لتحديد عدد النسخ التي تريد " +"طباعتها." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"إذا طبعت نسخ متعددة لملف، انتقِ خيار رزم لجمع النسخ " +"المطبوعة." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "قسم الطابعة المؤلسن" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "الطابعة" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "استخدم القائمة المنسدلة لانتقاء الطابعة التي تريد طباعة الملف إليها." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "الإعدادات" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "استخدم هذه القائمة المنسدلة لانتقاء خيارات الطابعة." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"لضبط الطابعة، انقر اضبط. على سبيل المثال، إذا استطعت " +"تفعيل أو تعطيل الطباعة المزدوجة، أو جدولة الطباعة المتأخرة، إذا كانت هذه " +"المهام مدعومة من الطابعة." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "الموقع" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "استخدم هذه القائمة المنسدلة لانتقاء واحدة من مقاصد الطباعة التالية:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "سي​يوبي​إس" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "طباعة الملف إلى طابعة سي​يوبي​إس." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"إذا كانت الطابعة المنتقاة طباعة سي​يوبي​إس، سي​" +"يوبي​إس هي المدخلة الوحيدة في هذه القائمة المنسدلة." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "إل​بي​آر" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "طباعة الملف إلى طباعة." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "ملف" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "طباعة الملف إلى ملف بوست​سكربت" + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"انقر احفظ ك لعرض حوار أين تحديد اسم وموقع ملف " +"بوست​سكربت." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "مخصص" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "استخدم الأمر المحدد لطباعة الملف." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "اطبع اسم الأمر في مربع النص. تضمن كل مدخلات سطر الأوامر." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "الحالة" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "هذه الخاصية غير مدعومة في إصدار محرر النصوص هذا." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "النوع" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "التعليق" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "قسم الورقة المؤلسن" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "خحم الورقة" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"استخدم القائمة المنسدلة لانتقاء حجم الورقة التي تريد طباعة الملف عليها." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "العرض" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"استخدم هذا الصندوق لتحديد عرض الورقة. استخدم القائمة المنسدلة المجاورة " +"لتعديل وحدة القياس." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "الطول" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "استخدم هذا الصندوق لتحديد طول الورقة." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "توجه التغذية" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "استخدم هذه القائمة المنسدلة لانتقاء توجه الورقة في الطابعة." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "توجه الصفحة" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "استخدم هذه القائمة المنسدلة لانتقاء توجه الصفحة." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "تخطيط" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"استخدم هذه القائمة المنسدلة لانتقاء تخطيط الصفحة. معيانة لكل تخطيط تنتقيه " +"تُعرض في منطقة معاينة." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "صينية الورق" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "استخدم هذه القائمة المنسدلة لانتقاء صينية الورق." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "مزايا البرمجة" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"العديد من مزايا محرر النصوص للبرمجية مقدمة " +"بملحقات. على سبيل المثلل، ملحق قائممة الوسمتقدم قائمة للوسوم المستخدمة بشكل " +"شائع لمختلف لغات الترقيم: راجع . " + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "إبراز الصياغة" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"يجعل ابراز صياغة الكود المصدري أسهل للقراءة بعرض الأجزاء المختلفة من النص " +"بألوان مختلفة." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"يختار محرر النصوص نمط إبراز الصيغة المناسب بناءً " +"على نوع المستند. لتجاوز نمط إبراز الصيغة، اختر عرضنمط الإبراز، ثم اختر واحدا " +"من عناصر القائمة التالية:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "عادي" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "لا تعرض أي إبراز صياغة." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "المصادر" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"عرض إبراز الصياغة لتحرير الكود المصدري. استخدم قائمة مصادر الفرعية لانتقاء نوع الشيفرة المصدرية." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "ترميز" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"عرض إبراز الصياغة لتحرير كود ترميز. استخدم قائمة ترميز الفرعية لانتقاء نوع شيفرة الترميز." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "سكربتات" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"عرض إبراز الصياغة لتحرير كود سكربت. استخدك قائمة مخطوطات الرغية لانتقاء نوع شيفرة المخطوط." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "أخريات" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"عرض إبراز الصياغة لتحرير أنواع أخرى من الأكواد، استخدم قائمة " +"أخريات الفرعية لانتقاء نوع الشيفرة." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "توريد مخرج أمر إلى ملف" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"تستطيع استخدام محرر النصوص لتوريد مخرج أمر إلى " +"ملف نصي. على سبيل المثال، لتوريد مخرج أمر ls إلى ملف نصي، " +"اطبع ls | gedit، ثم انقر إدخال." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"مخرج أمر ls يُعرض في ملف نصي جديد في نافذة " +"محرر النصوص." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"بدلا من ذلك، تستطيع استخدام ملحق الأدوات الخارجية " +"لتوريد مخرج أمر إلى الملف الحالي." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "مفاتيح الاختصار" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"استخدم مفاتيح الاختصار لتأدية المهام الشائعة أسرع من الفأرة والقوائم. " +"الجداول التالية تضع كل مفاتيح اختصار محرر النصوص " +"في قائمة." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"للمزيد من مفاتيح الاختصار، راجع دليل مستخدم سطح المكتب." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "ألسنة" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "اختصارات الألسنة:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1016(para) C/gedit.xml:1044(para) C/gedit.xml:1091(para) +#: C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "مفتاح الاختصار" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) C/gedit.xml:1046(para) C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Command" +msgstr "الأمر" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "يحوّل إلى اللسان التالي إلى اليسار." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "يحوّل إلى اللسان التالي إلى اليمين." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "أغلق اللسان." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "احفظ كل الألسنة." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "أغلق كل الألسنة." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "يقفز إلى اللسان الأعلى." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "ملفات" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "اختصارات العمل مع الملفات:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "أنشئ مستندا جديدا." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "افتح مستندا." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "افتح موقعا." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "احفظ المستند الحالي إلى القرص." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "احفظ المستند الحالي باسم ملف جديد." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "اطبع المستند الحالي." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "عينة الطباعة." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "أغلق المستند الحالي." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "يخرج محرر النصوص." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1408(guimenu) +#: C/gedit.xml:1414(guimenu) C/gedit.xml:1420(guimenu) +#: C/gedit.xml:1426(guimenu) +msgid "Edit" +msgstr "تحرير" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "اختصارات تحرير المستندات:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "استرجاع آخر إجراء." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "إعادة آخر إجراء مُسترجع." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "قص النص أو المنطقة المنقاة ووضعها في الحافظة." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "نسخ النص أو المنقطة المنقاة إلى الحافظة." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "لصق محتويات الحافظة." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "انتقِ الكل." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "احذف السطر الحالي" + +#. ============= Panes ======================= +#: C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "الألواح" + +#: C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "اختصارات عرض وإخفاء اللوحات:" + +#: C/gedit.xml:1023(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "إظهار/إخفاء اللوحة الجانبية." + +#: C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "إظهار/إخفاء اللوحة السفلية." + +#. ============= Search ======================= +#: C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "البحث" + +#: C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "اختصارات البحث:" + +#: C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "Ctrl + D" + +#: C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "جِد نصا." + +#: C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "جِد المماثل التالي للنص." + +#: C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "جِد المماثل السابق للنص." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "بحث تفاعلي." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "ابحث واستبدل." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "نظّف الإبراز." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "اذهب إلى سطر." + +#. ============= Tools ======================= +#: C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "أدوات" + +#: C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "اختصارات الأدوات:" + +#: C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "دقق الإملاء (بملحق)" + +#: C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "أزل المسافات المفرطة (بملحق)." + +#: C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "أزح (بملحق)." + +#: C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "احذف الإزاحة (بملحق)." + +#: C/gedit.xml:1114(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "شغلّ \"make\" في الدليل الحالي (بملحق)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "سرد الدليل (بملحق)." + +#. ============= Help ======================= +#: C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "مساعدة" + +#: C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "اختصارات المساعدة:" + +#: C/gedit.xml:1141(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "افتح دليل مستخدم محرر النصوص." + +#: C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "التفضيلات" + +#: C/gedit.xml:1156(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"لتهيئة gedit، اختر تحريرالتفضيلات. حوار " +"التفضيلات يحتوي التصانيف التالية:" + +#: C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "تفضيلات العرض" + +#: C/gedit.xml:1170(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"انتقِ خيار فعّل لف النص لتحول أسطر النص الطويلة إلى فقرات " +"بدلا من تخطي حافة نافذة النص. هذا يتخطى الاضطرار للف أفقيا." + +#: C/gedit.xml:1171(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"انتقِ خيار لا تشقّ الكلمات على سطرين لتحصل على خيار لف " +"النص يحفظ الكلمات الكاملة عندما يكون النص في السطر التالي. هذا يجعل التص " +"أسهل للقراءة." + +#: C/gedit.xml:1177(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"انتقِ خيار عرض أرقام السطور لعرض أرقام الأسطر على الجانب " +"الأيسر من نافذة محرر النصوص." + +#: C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "السطر الحالي" + +#: C/gedit.xml:1183(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"انتقِ خيار أبرز السطر الحالي لإبراز السطر حيث وُضع المؤشر." + +#: C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "الحاشية اليمنى" + +#: C/gedit.xml:1189(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"انتقِ خيار اعرض الحاشية اليمنى لعرض سطر عامودي يشير إلى " +"الحاشية السفلية." + +#: C/gedit.xml:1190(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"استخدم صندوق الحاشية اليمنى ابتداء من العمود لتحديد " +"موقع السطر العامدوي." + +#: C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "تطابق القوس" + +#: C/gedit.xml:1196(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"انتقِ خيار أبرز القوس المطابق لإبراز القوس المطابق عندما " +"يوضع المؤشر على محرف قوس." + +#: C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "تفضيلات المحرر" + +#: C/gedit.xml:1209(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"استخدم صندوق عرض اللسان لتحديد عرض المساحة التي يدرجها " +"محرر النصوص عندما تضغط مفتاح Tab." + +#: C/gedit.xml:1210(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"انتقِ خيار إدراج مسافات عوض الألسنة لتخصيص " +"محرر النصوص لإدراج مسافات بدلا من محرف اللسان عند " +"ضغط مفتاح Tab." + +#: C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "إزاحة آلية" + +#: C/gedit.xml:1216(para) +#, fuzzy +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "انتقِ الخيار " + +#: C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "حفظ ملف" + +#: C/gedit.xml:1222(para) +#, fuzzy +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "انتقِ الخيار " + +#: C/gedit.xml:1223(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"انتقِ الخيار احفظ الملفات آليّا كل ... دقيقة لحفظ الملف " +"الحالي تلقائيا كل عدد اعتيادي. استخدم الصندوق لتحديد تكرار رغبتك في حفظ " +"الملف." + +#: C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "تفضيلات الخط والألوان" + +#: C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "الخط" + +#: C/gedit.xml:1235(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"انتقِ خيار استخدم سمة خط السمة المبدئي لاستخدام خط " +"النظام المبدئي للنص في نافذة نص محرر النصوص." + +#: C/gedit.xml:1236(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"حقل خط المحرر يعرض الخط الذي يستخدمه محرر " +"النصوص لعرض النص. انقر على الزر لتحديد نوع الخط، وأسلوبه، " +"وحجمه لاستخدامه للنص." + +#: C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "" + +#: C/gedit.xml:1242(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" + +#: C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "" + +#: C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "" + +#: C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "" + +#: C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "" + +#: C/gedit.xml:1257(guilabel) +#, fuzzy +msgid "Kate" +msgstr "الحالة" + +#: C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "" + +#: C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "" + +#: C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "" + +#: C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "" + +#: C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "" + +#: C/gedit.xml:1275(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" + +#: C/gedit.xml:1276(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" + +#: C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "تفضيلات الملحقات" + +#: C/gedit.xml:1284(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"تضيف الملحقات مزايا إضافية إلى محرر النصوص. لمزيد " +"من المعلومات حول الملحقات وكيفية استخدام الملحقات المضمّنة، راجع ." + +#: C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "تفعيل ملحق" + +#: C/gedit.xml:1289(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"لتفعيل ملحق محرر النصوص، أدِ الخطوات التالية:" + +#: C/gedit.xml:1292(para) C/gedit.xml:1313(para) C/gedit.xml:1637(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"اختر تحريرالتفضيلات." + +#: C/gedit.xml:1295(para) C/gedit.xml:1316(para) C/gedit.xml:1640(para) +msgid "Select the Plugins tab." +msgstr "انتق اللسان الملحقات." + +#: C/gedit.xml:1298(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "انتقِ صندوق التأشير التالي لاسم الملحق الذي تريد تفعليه." + +#: C/gedit.xml:1301(para) C/gedit.xml:1322(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"انقر أغلق لإغلاق حوار التفضيلات." + +#: C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "تعطيل ملحق" + +#: C/gedit.xml:1309(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "يظل الملحق مفعلا عند مغادرتك محرر النصوص." + +#: C/gedit.xml:1310(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"لتعطيل ملحق محرر النصوص، أدِ الخطوات التالية:" + +#: C/gedit.xml:1319(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "ألغِ انتقاء صندوق التأشير التاليلاسم الملحق الذي تريد تعطيله." + +#: C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "الملحقات" + +#: C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "العمل مع الملحقات" + +#: C/gedit.xml:1334(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"يمكنك إضافة مزايا إضافية إلى محرر النصوص بتفعيل " +"الملحقات. الملحق هو برنامج متمم يعزز أداء وظائف " +"التطبيق. الملحقات تضيف عناصر جديدة إلى قوائم محرر النصوص للمزايا الجديدة التي تقدمها." + +#: C/gedit.xml:1336(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"عدة ملحقات تأتي مبنية مع محرر النصوص، وتستطيع " +"تثبيت المزيد. يسرد موقع محرر النصوص ملحقات الطرف الثالث." + +#: C/gedit.xml:1337(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"لتفعيل وتعطيل الملحقات، أو رؤية أي الملحقات مفعلة حاليا، استخدم تفضيلات الملحقات." + +#: C/gedit.xml:1338(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "الملحقات التالية تأتي مُضمّنة مع محرر النصوص:" + +#: C/gedit.xml:1344(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"تغيير الحالةيسمح لك بتغيير حالة نص منتقى." + +#: C/gedit.xml:1347(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"احصاءات " +"المستند يعرض رقم الأسطر، والكلمات، والمحارف في مستند." + +#: C/gedit.xml:1350(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"الأدوات الخارجية يسمح لك بتشغيل أوامر خارجية من محرر النصوص." + +#: C/gedit.xml:1353(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"متصفح الملفات يسمح لك بتصفح ملفاتك ومجلداتك في " +"اللوحة الجانبية." + +#: C/gedit.xml:1356(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"إزاحة الأسطر يضيف أو يزيل الإزاحة من الأسطر المنتقاة." + +#: C/gedit.xml:1359(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"إدراج التاريخ/" +"الوقت يضيف التاريخ والوقت الحاليين إلى مستند." + +#: C/gedit.xml:1362(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"الأسطر النمطية يسمح لك بضبط تفضيلات التحرير للملفات المفردة، ودعم أساليب أسطر " +"Emacs، و Kate، و " +"Vim النمطية" + +#: C/gedit.xml:1365(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"كونسول بايثون يسمح لك بتشغيل الأوامر بلغة البرمجة بايثون." + +#: C/gedit.xml:1368(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"مقاطع يسمح لك بتخزين أجزاء النص المستخدمة بشكل متكرر وتدرجهم بسرعة " +"إلى النص." + +#: C/gedit.xml:1371(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"ترتيب " +"يرتب أسطر منتقاء من النص إلى الترتيب الأبجدي." + +#: C/gedit.xml:1374(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"مدقق الإملاء يصحح إملاء النص المنتقى، أو يعلّم الأخطاء تلقائيا في " +"المستند." + +#: C/gedit.xml:1377(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"قائمة الوسم يدعك تدرج أوسمة إنش​تي​إم​إل واللغات الأخرى " +"الأكثر شيوعا من قائمة في اللوحة الجانبية." + +#: C/gedit.xml:1380(para) +msgid "" +"User Name inserts the username of the current user into the document." +msgstr "" +"اسم المستخدم يدرج اسم المستخدم للمستخدم الحالي إلى المستند." + +#: C/gedit.xml:1387(title) +msgid "Change Case Plugin" +msgstr "ملحق تغيير الحالة" + +#: C/gedit.xml:1388(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "ملحق تغيير الحالة يغير حالة النص المنتقى." + +#: C/gedit.xml:1389(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"العناصر التالية تُضاف إلى قائمة تحرير عندما يُفعل ملحق " +"تغيير الحالة:" + +#: C/gedit.xml:1399(para) +msgid "Menu Item" +msgstr "عنصر القائمة" + +#: C/gedit.xml:1401(para) +msgid "Action" +msgstr "الإجراء" + +#: C/gedit.xml:1403(para) +msgid "Example" +msgstr "مثال" + +#: C/gedit.xml:1409(guisubmenu) C/gedit.xml:1415(guisubmenu) +#: C/gedit.xml:1421(guisubmenu) C/gedit.xml:1427(guisubmenu) +msgid "Change Case" +msgstr "غيّر الحالة" + +#: C/gedit.xml:1409(guimenuitem) +msgid "All Upper Case" +msgstr "كل الأحرف علوية" + +#: C/gedit.xml:1410(para) +msgid "Change each character to uppercase." +msgstr "تغيير كل محرف إلى الحالة العلوية." + +#: C/gedit.xml:1411(para) +msgid "This text becomes THIS TEXT" +msgstr "This text تصبح THIS TEXT" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Lower Case" +msgstr "كل الأحرف سفلية" + +#: C/gedit.xml:1416(para) +msgid "Change each character to lowercase." +msgstr "تغيير كل محرف إلى الحالة السفلية." + +#: C/gedit.xml:1417(para) +msgid "This Text becomes this text" +msgstr "This Text تصبح this text" + +#: C/gedit.xml:1421(guimenuitem) +msgid "Invert Case" +msgstr "اعكس الحالة" + +#: C/gedit.xml:1422(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "تغيير حالة سفلية إلى حالة علوية، وتغيير كل حالة علوية إلى حالة سفلية." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes tHIS tEXT" +msgstr "This Text تصبح tHIS tEXT" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Title Case" +msgstr "حالة العنوان" + +#: C/gedit.xml:1428(para) +msgid "Change the first character of each word to uppercase." +msgstr "تغيير أول محرف من كل كلمة إلى الحالة العلوية." + +#: C/gedit.xml:1429(para) +msgid "this text becomes This Text" +msgstr "this text تصبح This Text" + +#: C/gedit.xml:1438(title) +msgid "Document Statistics Plugin" +msgstr "ملحق إحصاءات المستند" + +#: C/gedit.xml:1439(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"الملحق إحصاءات المستند يعد عدد الأسطر، والحروف، " +"والمحارف مع الماسفات، والمحارف بدون المسافات، والبايتات في الملف الحالي. " +"الملحق يعرض النتائج في حوار إحصاءات المستند. لاستخدام " +"احصاءات المستند، أدِ الخطوات التالية:" + +#: C/gedit.xml:1441(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"اختر أدواتإحصاءات المستند لعرض الحوار إحصاءات المستند. " +"الحوار إحصاءات المستند يعرض المعلومات التالية حول الملف:" + +#: C/gedit.xml:1444(para) +msgid "Number of lines in the current document." +msgstr "عدد الأسطر في المستند الحالي." + +#: C/gedit.xml:1447(para) +msgid "Number of words in the current document." +msgstr "عدد الكلمات في المستند الحالي." + +#: C/gedit.xml:1450(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "عدد المحارف -بما في ذلك المسافات- في المستند الحالي." + +#: C/gedit.xml:1453(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "عدد المسافات -لا تتضمن المسافات- في المستند الحالي." + +#: C/gedit.xml:1456(para) +msgid "Number of bytes in the current document." +msgstr "عدد البايتات في المستند الحالي." + +#: C/gedit.xml:1461(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"بإمكانك الاستمرار في تحديث ملف محرر النصوص أثناء " +"فتح حوار إحصاءات المستند. لإنعاش محتويات حوار " +"إحصاءات المستند، انقر حدّث." + +#: C/gedit.xml:1468(title) +msgid "External Tools Plugin" +msgstr "ملحق الأدوات الخارجية" + +#: C/gedit.xml:1469(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"ملحق الأدوات الخارجية يسمح لك بتشغيل أوامر خارجية " +"من محرر النصوص. بإمكانك توريد بعض المحتويات إلى " +"أمر واستغلال مخرجاته ( على سبيل المثال، sed)، أو " +"تشغيل أمر معرف مسبقا (على سبيل المثال، make)." + +#: C/gedit.xml:1470(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" + +#: C/gedit.xml:1473(title) +msgid "Built-in Commands" +msgstr "الأوامر المضمّنة" + +#: C/gedit.xml:1474(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" + +#: C/gedit.xml:1476(term) +msgid "Build" +msgstr "" + +#: C/gedit.xml:1478(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" + +#: C/gedit.xml:1481(term) +msgid "Directory Listing" +msgstr "" + +#: C/gedit.xml:1483(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "" + +#: C/gedit.xml:1486(term) +msgid "Environment Variables" +msgstr "" + +#: C/gedit.xml:1488(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "" + +#: C/gedit.xml:1491(term) +msgid "Grep" +msgstr "" + +#: C/gedit.xml:1493(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" + +#: C/gedit.xml:1496(term) +msgid "Remove Trailing Spaces" +msgstr "" + +#: C/gedit.xml:1498(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "" + +#: C/gedit.xml:1505(title) +msgid "Defining a Command" +msgstr "تعريف أمر" + +#: C/gedit.xml:1506(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" + +#: C/gedit.xml:1507(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" + +#: C/gedit.xml:1509(term) +msgid "Description" +msgstr "الوصف" + +#: C/gedit.xml:1511(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" + +#: C/gedit.xml:1514(term) +msgid "Accelerator" +msgstr "" + +#: C/gedit.xml:1516(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "أدخل اختصار لوحة مفاتيح للأمر." + +#: C/gedit.xml:1519(term) +msgid "Commands" +msgstr "الأوامر" + +#: C/gedit.xml:1521(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" + +#: C/gedit.xml:1524(term) +msgid "Input" +msgstr "" + +#: C/gedit.xml:1526(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" + +#: C/gedit.xml:1529(term) +msgid "Output" +msgstr "المُخرج" + +#: C/gedit.xml:1531(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" + +#: C/gedit.xml:1534(term) +msgid "Applicability" +msgstr "" + +#: C/gedit.xml:1536(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" + +#: C/gedit.xml:1544(title) +msgid "Editing and Removing Tools" +msgstr "" + +#: C/gedit.xml:1545(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" + +#: C/gedit.xml:1546(para) +msgid "To rename a tool, click it again in the list." +msgstr "" + +#: C/gedit.xml:1547(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" + +#: C/gedit.xml:1548(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" + +#: C/gedit.xml:1552(title) +msgid "Variables" +msgstr "" + +#: C/gedit.xml:1553(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" + +#: C/gedit.xml:1556(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1559(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1581(title) +msgid "File Browser Plugin" +msgstr "ملحق متصفح الملفات" + +#: C/gedit.xml:1582(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" + +#: C/gedit.xml:1583(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" + +#: C/gedit.xml:1585(title) +msgid "Browsing your Files" +msgstr "تصفح ملفاتك" + +#: C/gedit.xml:1586(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" + +#: C/gedit.xml:1587(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" + +#: C/gedit.xml:1588(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" + +#: C/gedit.xml:1592(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" + +#: C/gedit.xml:1595(title) +msgid "Creating Files and Folders" +msgstr "إنشاء ملفات ومجلدات جديدة" + +#: C/gedit.xml:1596(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" + +#: C/gedit.xml:1597(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" + +#: C/gedit.xml:1602(title) +msgid "Indent Lines Plugin" +msgstr "" + +#: C/gedit.xml:1603(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" + +#: C/gedit.xml:1604(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" + +#: C/gedit.xml:1606(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" + +#: C/gedit.xml:1611(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" + +#: C/gedit.xml:1614(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" + +#: C/gedit.xml:1619(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" + +#: C/gedit.xml:1624(title) +msgid "Insert Date/Time Plugin" +msgstr "ملحق إدراج التاريخ/الوقت" + +#: C/gedit.xml:1625(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" + +#: C/gedit.xml:1627(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"اختر تحريرأدرج التاريخ والوقت." + +#: C/gedit.xml:1628(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" + +#: C/gedit.xml:1629(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" + +#: C/gedit.xml:1634(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "اضبط الملحق إدراج التاريخ/الوقت" + +#: C/gedit.xml:1635(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "لضبط الملحق إدراج التاريخ/الوقت، شكّل الخطوات التالية:" + +#: C/gedit.xml:1643(para) +msgid "Select the Insert Date/Time plugin." +msgstr "انتقِ الملحق إدراج التاريخ/الوقت." + +#: C/gedit.xml:1646(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" + +#: C/gedit.xml:1649(para) +msgid "Select one of the options, as follows:" +msgstr "انتقِ واحد من الخيارات، كالتالي:" + +#: C/gedit.xml:1651(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" + +#: C/gedit.xml:1654(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" + +#: C/gedit.xml:1657(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" + +#: C/gedit.xml:1662(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" + +#: C/gedit.xml:1665(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"لإغلاق حوار التفضيلات، انقر أغلق." + +#: C/gedit.xml:1672(title) +msgid "Modelines Plugin" +msgstr "" + +#: C/gedit.xml:1673(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" + +#: C/gedit.xml:1674(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" + +#: C/gedit.xml:1675(para) +msgid "You can set the following preferences with modelines:" +msgstr "تستطيع ضبط التفضيلات التالية" + +#: C/gedit.xml:1678(para) +msgid "Tab width" +msgstr "عرض اللسان" + +#: C/gedit.xml:1681(para) +msgid "Indent width" +msgstr "" + +#: C/gedit.xml:1684(para) +msgid "Insert spaces instead of tabs" +msgstr "" + +#: C/gedit.xml:1690(para) +msgid "Right margin width" +msgstr "" + +#: C/gedit.xml:1694(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" + +#: C/gedit.xml:1697(title) +msgid "Emacs Modelines" +msgstr "" + +#: C/gedit.xml:1698(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" + +#: C/gedit.xml:1699(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" + +#: C/gedit.xml:1702(title) +msgid "Kate Modelines" +msgstr "" + +#: C/gedit.xml:1703(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" + +#: C/gedit.xml:1704(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" + +#: C/gedit.xml:1707(title) +msgid "Vim Modelines" +msgstr "" + +#: C/gedit.xml:1708(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" + +#: C/gedit.xml:1709(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" + +#: C/gedit.xml:1714(title) +msgid "Python Console Plugin" +msgstr "ملحق بايثون كونسول" + +#: C/gedit.xml:1715(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"الملحق بايثون كونسول يسمح لك بتشغيل أوامر بلغة " +"برمجة بايثون من محرر النصوص. تفعيل هذه الخاصية " +"يضيف لسان إلى اللوحة السفلية. هذا يظهر المخرجات الحديثة وحقل محث أوامر." + +#: C/gedit.xml:1716(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" + +#: C/gedit.xml:1720(title) +msgid "Snippets Plugin" +msgstr "أيقونة المقاطع" + +#: C/gedit.xml:1721(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" + +#: C/gedit.xml:1722(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" + +#: C/gedit.xml:1723(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"عدد من المقاطع المبنية داخليا مُثتبة مع محرر النصوص، والتي يمكن تعديلها." + +#: C/gedit.xml:1726(title) +msgid "Inserting Snippets" +msgstr "إدراج مقاطع" + +#: C/gedit.xml:1727(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" + +#: C/gedit.xml:1728(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"بدلا من ذلك، اضغط CtrlSpace لمراجهة قائمة المقاطع التي تستطيع إدراجها." + +#: C/gedit.xml:1732(title) +msgid "Adding Snippets" +msgstr "إضافة مقاطع" + +#: C/gedit.xml:1733(para) +msgid "To create a new snippet, do the following:" +msgstr "لإنشاء مقطع جديد، افعل التالي:" + +#: C/gedit.xml:1736(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"اختر أدواتأدر المقاطع. نافذة مدير المقاطع تفتح." + +#: C/gedit.xml:1739(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" + +#: C/gedit.xml:1742(para) +msgid "Click New. A new snippet appears in the list." +msgstr "انقر جديد. مقطع جديد يضاف في القائمة." + +#: C/gedit.xml:1745(para) +msgid "Enter the following information for the new snippet:" +msgstr "أدخل المعلومات التالية للمقاطع الجديدة:" + +#: C/gedit.xml:1747(term) +msgid "Name" +msgstr "الاسم" + +#: C/gedit.xml:1749(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" + +#: C/gedit.xml:1752(term) +msgid "Snippet text" +msgstr "نص المقطع" + +#: C/gedit.xml:1754(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" + +#: C/gedit.xml:1755(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" + +#: C/gedit.xml:1758(term) +msgid "Tab Trigger" +msgstr "" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" + +#: C/gedit.xml:1761(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" + +#: C/gedit.xml:1764(term) +msgid "Shortcut key" +msgstr "مفتاح الاختصار" + +#: C/gedit.xml:1766(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "" + +#: C/gedit.xml:1775(title) +msgid "Editing and Removing Snippets" +msgstr "تحرير وحذف المقاطع" + +#: C/gedit.xml:1776(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" + +#: C/gedit.xml:1777(para) +msgid "To rename a snippet, click it again in the list." +msgstr "لإعادة تسمية مقطع، انقر مجددا على القائمة." + +#: C/gedit.xml:1778(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" + +#: C/gedit.xml:1779(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" + +#: C/gedit.xml:1783(title) +msgid "Snippet Substitutions" +msgstr "" + +#: C/gedit.xml:1784(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" + +#: C/gedit.xml:1788(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" + +#: C/gedit.xml:1790(term) +msgid "Tab placeholders" +msgstr "" + +#: C/gedit.xml:1792(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" + +#: C/gedit.xml:1793(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" + +#: C/gedit.xml:1794(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" + +#: C/gedit.xml:1795(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" + +#: C/gedit.xml:1796(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" + +#: C/gedit.xml:1799(term) +msgid "Mirror placeholders" +msgstr "" + +#: C/gedit.xml:1801(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" + +#: C/gedit.xml:1804(term) +msgid "End placeholder" +msgstr "" + +#: C/gedit.xml:1806(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" + +#: C/gedit.xml:1809(term) +msgid "Environmental variables" +msgstr "" + +#: C/gedit.xml:1811(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" + +#: C/gedit.xml:1813(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1815(para) +msgid "The currently selected text." +msgstr "النص المنتقى حاليا." + +#: C/gedit.xml:1818(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1820(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" + +#: C/gedit.xml:1823(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1825(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" + +#: C/gedit.xml:1828(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1830(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" + +#: C/gedit.xml:1838(term) +msgid "Shell placeholders" +msgstr "" + +#: C/gedit.xml:1840(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" + +#: C/gedit.xml:1841(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" + +#: C/gedit.xml:1844(term) +msgid "Python placeholders" +msgstr "" + +#: C/gedit.xml:1846(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" + +#: C/gedit.xml:1847(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" + +#: C/gedit.xml:1848(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" + +#: C/gedit.xml:1857(title) +msgid "Sort Plugin" +msgstr "ملحق الترتيب" + +#: C/gedit.xml:1858(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" + +#: C/gedit.xml:1859(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" + +#: C/gedit.xml:1862(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "لاستخدام ملحق الترتيب، أدِ الاعدادات التالية:" + +#: C/gedit.xml:1865(para) +msgid "Select the lines of text you want to sort." +msgstr "انتقِ سطور النص التي تريد ترتيبها." + +#: C/gedit.xml:1867(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"اختر تحريررتّب. يفتح الحوار ترتيب." + +#: C/gedit.xml:1870(para) +msgid "Choose the options you want for the sort:" +msgstr "اختر الخيارات التي تريدها للترتيب:" + +#: C/gedit.xml:1873(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" + +#: C/gedit.xml:1876(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "لحذف السطور المتكررة، انتقِ إزالة التكرار." + +#: C/gedit.xml:1879(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "لتجاهل حساسية الحالة، انتقِِ تجاهل الحالة." + +#: C/gedit.xml:1882(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" + +#: C/gedit.xml:1887(para) +msgid "To perform the sort operation, click Sort." +msgstr "" + +#: C/gedit.xml:1894(title) +msgid "Spell Checker Plugin" +msgstr "ملحق المدقق الإملائي" + +#: C/gedit.xml:1895(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" + +#: C/gedit.xml:1897(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" + +#: C/gedit.xml:1900(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" + +#: C/gedit.xml:1901(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" + +#: C/gedit.xml:1904(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" + +#: C/gedit.xml:1907(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" + +#: C/gedit.xml:1910(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" + +#: C/gedit.xml:1915(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" + +#: C/gedit.xml:1917(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" + +#: C/gedit.xml:1919(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" + +#: C/gedit.xml:1922(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" + +#: C/gedit.xml:1925(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" + +#: C/gedit.xml:1928(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" + +#: C/gedit.xml:1931(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" + +#: C/gedit.xml:1934(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" + +#: C/gedit.xml:1937(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" + +#: C/gedit.xml:1940(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" + +#: C/gedit.xml:1949(title) +msgid "Tag List Plugin" +msgstr "ملحق وسم القائمة" + +#: C/gedit.xml:1950(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" + +#: C/gedit.xml:1951(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "" + +#: C/gedit.xml:1953(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" + +#: C/gedit.xml:1957(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" + +#: C/gedit.xml:1959(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" + +#: C/gedit.xml:1962(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "" + +#: C/gedit.xml:1965(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" + +#: C/gedit.xml:1967(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" + +#: C/gedit.xml:1970(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" + +#: C/gedit.xml:1979(title) +msgid "User Name Plugin" +msgstr "ملحق اسم المستخدم" + +#: C/gedit.xml:1980(para) +msgid "" +"The User name plugin inserts the username of the " +"current user into the document." +msgstr "" +"الملحق اسم المستخدم يدرج اسم المستخدم للمستخدم " +"الحالي إلى المستند." + +#: C/gedit.xml:1981(para) +msgid "" +"To insert your username at the cursor position, choose " +"EditInsert User Name." +msgstr "" +"لإدراج اسم المستخدم عند موقع المؤشر، اختر تحريرأدرج اسم المستخدم." + +#: C/gedit.xml:1983(para) +msgid "" +"This plugin is mostly provided as an example of how to create your own " +"plugins. For more information on creating plugins, see the gedit website." +msgstr "" + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"فريق عربآيز :\n" +"أسامة خالد " + +#~ msgid "July 2006" +#~ msgstr "يوليو 2006" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "للمزيد من المعلومات حول كيفية ضبط تعليم الصياغة، راجع ." + +#~ msgid "Colors" +#~ msgstr "الألوان" + +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "انتقِ الخيار استخدم ألوان السمة المبدئية لاستخدام " +#~ "ألوان السمة المبدئية في نافذة نص محرر النصوص." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "انقر على نافذة نص زر اللون لون النص العاديلعرض " +#~ "حوار منتقي اللون. انتقِ لونا لاستخدامه لعرض النص العادي في نافذة نص " +#~ "محرر النصوص." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "انقر على زر اللون لون الخلفية لعرض حوار منتقي " +#~ "اللون. انتقِ لون خلفية لنافذة نص محرر النصوص." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "انقر على زر اللون لون النص المنتقى لعرض حوار منتقي " +#~ "اللون. انتقِ لونا لاستخدامه لعرض النص المنتقى." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "انقر على زر اللون لون التحديد لعرض حوار منتقي " +#~ "اللون. انتقِ لون خلفية لاستخدامه لإبراز نص منتقى." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "تفضيلات إبراز الصياغة" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "فعّل إبراز الصياغة" + +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "انتقِ هذا الخيار لإبراز الصياغة للنص الذي تحرره." + +#~ msgid "Highlight mode" +#~ msgstr "وضع الإبراز" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "استخدم هذه القائمة المنسدلة لانتقاء وضع إبراز لضبطه." + +#~ msgid "Elements" +#~ msgstr "العناصر" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "استخدم صندوق القائمة هذا لانتقاء عنصر صياغة لضبطه." + +#~ msgid "Format buttons" +#~ msgstr "أزرار التنسيق" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "استخدم الأزرار التالية لتغيير نص عنصر الصياغة المنتقى:" + +#~ msgid "Button" +#~ msgstr "زر" + +#~ msgid "Format" +#~ msgstr "تنسيق" + +#~ msgid "Shows icon for bold format." +#~ msgstr "يظهر أيقونة التنسيق العريض." + +#~ msgid "Bold" +#~ msgstr "عريض" + +#~ msgid "Shows icon for italic format." +#~ msgstr "يظهر أيقونة التنسيق المائل." + +#~ msgid "Italic" +#~ msgstr "مائل" + +#~ msgid "Shows icon for underline." +#~ msgstr "يظهر أيقونة التسطير." + +#~ msgid "Underline" +#~ msgstr "مسطر" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "يظهر أيقونة الشطب." + +#~ msgid "Strikethrough" +#~ msgstr "شطب" + +#~ msgid "Foreground" +#~ msgstr "المقدمة" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "انتقِ هذا الخيار لتغيير لون خط عنصر الصياغة المنتقى. انقر على زر اللون " +#~ "لعرض حوار منتقي اللون، ثم انتقِ لون الخط." + +#~ msgid "Background" +#~ msgstr "الخلفية" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "انتقِ هذا الخيار لتغيير لون خلفية عنصر الصياغة المنتقى. انقر على زر اللون " +#~ "لعرض حوار منتقي اللون، ثم انتقِ لون الخط." + +#~ msgid "Reset to Default" +#~ msgstr "أعد الضبط إلى المبدئي" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "انقر على هذا الزر لإعادة ضبط لون المقدمة والخلفية لعنصر الصياغة المنتقى " +#~ "إلى القيم المبدئية." diff --git a/help/bg/bg.po b/help/bg/bg.po new file mode 100755 index 00000000..b3f8cdb0 --- /dev/null +++ b/help/bg/bg.po @@ -0,0 +1,3332 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: gedit manual\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-03-01 07:43+0200\n" +"PO-Revision-Date: 2006-03-01 08:08+0200\n" +"Last-Translator: Rostislav \"zbrox\" Raykov \n" +"Language-Team: Bulgarian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: 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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Предоставя се разрешение за копиране, разпространение и/" +"или промяна на този документ, съгласно условията на " +"„Лиценза за свободна документация на GNU“," +" версия 1.1 или всяка следваща версия, издадена от Фондация " +"„Свободен софтуер“; без „Непроменливи раздели“, " +"„Текстове на предната корица“, както и „Текстове на задната корица“." +" Копие на лиценза може да бъде намерено тук или във файла COPYING-DOCS," +" разпространяван с това ръководство." + +#: 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 "" +"Това ръководство е част от колекция ръководства за MATE," +" разпространявани под GFDL." +" Ако искате да разпространявате това ръководство отделно," +" можете да го направите, като включите копие на лиценза към ръководството," +" както е описано в раздел 6 от лиценза." + +#: 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 "" +"Много от имената, използвани от компании," +" за да отличават собствените си продукти и услуги," +" са регистрирани търговски марки." +" Когато такива имена присъстват в която и да е документация за MATE и членовете на проекта за документация на MATE са осведомени за съответните търговски марки," +" тогава имената са с главни букви или начални главни букви." + +#: 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 " +"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 "ДОКУМЕНТЪТ СЕ ПРЕДОСТАВЯ НА БАЗА „КАКТО Е“, БЕЗ КАКВАТО И ДА Е ГАРАНЦИЯ, ПРЯКА ИЛИ КОСВЕНА, ВКЛЮЧИТЕЛНО БЕЗ ОГРАНИЧЕНИЯ И ГАРАНЦИИ, ЧЕ ДОКУМЕНТЪТ ИЛИ ПРОМЕНЕНАТА МУ ВЕРСИЯ СА БЕЗ ДЕФЕКТИ, ГОДНИ ЗА КОНКРЕТНА УПОТРЕБА ИЛИ НЕНАРУШАВАЩИ. ЦЕЛИЯТ РИСК ОТНОСНО КАЧЕСТВОТО, ТОЧНОСТТА И ХАРАКТЕРИСТИКИТЕ НА ДОКУМЕНТА ИЛИ ПРОМЕНЕНАТА МУ ВЕРСИЯ Е ЗА ВАША СМЕТКА. АКО НЯКОЙ ДОКУМЕНТ ИЛИ ПРОМЕНЕНАТА МУ ВЕРСИЯ СЕ ОКАЖЕ ДЕФЕКТЕН В КАКВОТО И ДА Е ОТНОШЕНИЕ, ВИЕ (НЕ ПЪРВОНАЧАЛНИЯ АВТОР ИЛИ КОЙТО И ДА Е ДОПРИНЕСЪЛ ЗА РАЗРАБОТКАТА) ПОЕМАТЕ РАЗХОДИТЕ ЗА ВСЯКАКВО НЕОБХОДИМО ОБСЛУЖВАНЕ, ПОПРАВКА ИЛИ КОРЕКЦИИ. ТОВА ОТКАЗВАНЕ ОТ ГАРАНЦИЯТА ПРЕДСТАВЛЯВА СЪЩЕСТВЕНА ЧАСТ ОТ ТОЗИ ЛИЦЕНЗ. НЕ Е РАЗРЕШЕНА УПОТРЕБАТА НА КОЙТО И ДА Е ДОКУМЕНТ ИЛИ ПРОМЕНЕНАТА ВЕРСИЯ НА ДОКУМЕНТА, ОСВЕН ПРИ СПАЗВАНЕ НА ТОЗИ ОТКАЗ ОТ ГАРАНЦИЯ; И ПРИ НИКАКВИ ОБСТОЯТЕЛСТВА И ПОД НИКАКВА ЮРИДИЧЕСКА ОСНОВА, НЕЗАВИСИМО ДАЛИ Е В НАРУШЕНИЕ (ВКЛЮЧИТЕЛНО ПРИЧИНЕНО ОТ НЕБРЕЖНОСТ), ДОГОВОР ИЛИ ДРУГО, АВТОРЪТ, ПЪРВОНАЧАЛНИЯТ АВТОР ИЛИ КОЙТО И ДА Е ДОПРИНЕСЪЛ ЗА РАЗРАБОТКАТА, ИЛИ КОЙТО И ДА Е ДИСТРИБУТОР НА ДОКУМЕНТА ИЛИ ПРОМЕНЕНАТА МУ ВЕРСИЯ, ИЛИ КОЙТО И ДА Е ДОСТАВЧИК НА КОЯТО И ДА Е ОТ ИЗБРОЕНИТЕ СТРАНИ, НЯМА ДА БЪДЕ ОТГОВОРЕН ПРЕД НИКОГО ЗА ВСИЧКИ ПРЕКИ, КОСВЕНИ, СПЕЦИАЛНИ, СЛУЧАЙНИ ИЛИ ПОСЛЕДСТВЕНИ ЩЕТИ ОТ КАКЪВТО И ДА Е ХАРАКТЕР, ВКЛЮЧИТЕЛНО, БЕЗ ОГРАНИЧЕНИЯ, ЩЕТИ ЗА ЗАГУБА НА ДОБРОЖЕЛАТЕЛНОСТ, СПИРАНЕ НА РАБОТАТА, КОМПЮТЪРНА ПОВРЕДА ИЛИ НЕИЗПРАВНОСТ, ИЛИ ВСЯКАКВИ ДРУГИ ЩЕТИ ИЛИ ЗАГУБИ, ВЪЗНИКНАЛИ ИЛИ СВЪРЗАНИ С УПОТРЕБАТА НА ДОКУМЕНТА ИЛИ ПРОМЕНЕНИТЕ МУ ВЕРСИИ, ДОРИ И КОГАТО ТАЗИ СТРАНА Е БИЛА ИНФОРМИРАНА ЗА ВЪЗМОЖНОСТТА ОТ ТАКИВА ЩЕТИ." + +#: 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: " +"" +msgstr "ДОКУМЕНТЪТ И МОДИФИЦИРАНИТЕ МУ ВЕРСИИ СЕ ПРЕДОСТАВЯТ ПОД УСЛОВИЯТА НА ЛИЦЕНЗА ЗА СВОБОДНА ДОКУМЕНТАЦИЯ НА GNU с допълнителното условие: " + +#. 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. +#: gedit.xml:231(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=65ef55fb44c43c883a271cf28b6c5a0e" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=65ef55fb44c43c883a271cf28b6c5a0e" + +#. 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. +#: gedit.xml:330(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#. 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. +#: gedit.xml:953(None) +msgid "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" +msgstr "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" + +#. 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. +#: gedit.xml:972(None) +msgid "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" +msgstr "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" + +#. 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. +#: gedit.xml:990(None) +msgid "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" +msgstr "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#. 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. +#: gedit.xml:1008(None) +msgid "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" +msgstr "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" + +#: gedit.xml:22(title) gedit.xml:168(revnumber) gedit-C.omf:10(title) +msgid "gedit Manual V2.8" +msgstr "Ръководство за GEdit, версия 2.8" + +#: gedit.xml:24(year) +msgid "2002" +msgstr "2002" + +#: gedit.xml:25(year) +msgid "2003" +msgstr "2003" + +#: gedit.xml:26(year) +msgid "2004" +msgstr "2004" + +#: gedit.xml:27(holder) gedit.xml:51(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: gedit.xml:29(year) gedit.xml:96(date) +msgid "2000" +msgstr "2000" + +#: gedit.xml:30(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: gedit.xml:41(publishername) gedit.xml:59(orgname) gedit.xml:100(para) +#: gedit.xml:108(para) gedit.xml:116(para) gedit.xml:124(para) +#: gedit.xml:132(para) gedit.xml:140(para) gedit.xml:148(para) +#: gedit.xml:156(para) gedit.xml:164(para) gedit.xml:172(para) +msgid "MATE Documentation Project" +msgstr "Проектът за превод на документацията на MATE" + +#: gedit.xml:48(firstname) gedit.xml:171(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Екипът за документацията на Java Desktop System" + +#: gedit.xml:52(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: gedit.xml:56(firstname) +msgid "Eric" +msgstr "Eric" + +#: gedit.xml:57(surname) +msgid "Baudais" +msgstr "Baudais" + +#: gedit.xml:60(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: gedit.xml:64(firstname) +msgid "Baris" +msgstr "Baris" + +#: gedit.xml:65(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek предостави информация от ранни редакции на GEdit." + +#: gedit.xml:66(contrib) gedit.xml:71(contrib) +msgid "Acknowledgements" +msgstr "Благодарности" + +#: gedit.xml:69(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: gedit.xml:70(surname) +msgid "George provided information about plugins." +msgstr "George предостави информация относно приставките." + +#: gedit.xml:95(revnumber) +msgid "gedit V1.0" +msgstr "Gedit, версия 1.0" + +#: gedit.xml:98(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: gedit.xml:104(revnumber) +msgid "gedit Manual V2.0" +msgstr "Ръководство за GEdit, версия 2.0" + +#: gedit.xml:105(date) +msgid "March 2002" +msgstr "Март 2002" + +#: gedit.xml:107(para) gedit.xml:115(para) gedit.xml:123(para) +#: gedit.xml:131(para) gedit.xml:139(para) gedit.xml:147(para) +#: gedit.xml:155(para) gedit.xml:163(para) +msgid "Sun MATE Documentation Team" +msgstr "Екипът по документация на MATE на Sun" + +#: gedit.xml:112(revnumber) +msgid "gedit Manual V2.1" +msgstr "Ръководство за GEdit, версия 2.1" + +#: gedit.xml:113(date) +msgid "June 2002" +msgstr "Юни 2002" + +#: gedit.xml:120(revnumber) +msgid "gedit Manual V2.2" +msgstr "Ръководство за GEdit, версия 2.2" + +#: gedit.xml:121(date) +msgid "August 2002" +msgstr "Август 2002" + +#: gedit.xml:128(revnumber) +msgid "gedit Manual V2.3" +msgstr "Ръководство за GEdit, версия 2.3" + +#: gedit.xml:129(date) +msgid "September 2002" +msgstr "Септември 2003" + +#: gedit.xml:136(revnumber) +msgid "gedit Manual V2.4" +msgstr "Ръководство за GEdit, версия 2.4" + +#: gedit.xml:137(date) +msgid "January 2003" +msgstr "Януари 2003" + +#: gedit.xml:144(revnumber) +msgid "gedit Manual V2.5" +msgstr "Ръководство за GEdit, версия 2.5" + +#: gedit.xml:145(date) +msgid "March 2003" +msgstr "Март 2003" + +#: gedit.xml:152(revnumber) +msgid "gedit Manual V2.6" +msgstr "Ръководство за GEdit, версия 2.6" + +#: gedit.xml:153(date) +msgid "September 2003" +msgstr "Септември 2003" + +#: gedit.xml:160(revnumber) +msgid "gedit Manual V2.7" +msgstr "Ръководство за GEdit, версия 2.7" + +#: gedit.xml:161(date) +msgid "March 2004" +msgstr "Март 2004" + +#: gedit.xml:176(releaseinfo) +msgid "This manual describes version 2.7.91 of gedit." +msgstr "Това ръководство описва GEdit, версия 2.7.91" + +#: gedit.xml:179(title) +msgid "Feedback" +msgstr "Обратна връзка" + +#: gedit.xml:180(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"За да докладвате за грешка или да направите предложение относно програмата " +"за преглед на документи Evince или това ръководство, следвайте указанията, " +"описани в Страницата за " +"обратна връзка на MATE." + +#: gedit.xml:185(para) gedit-C.omf:18(description) +msgid "User manual for the gedit text editor." +msgstr "Потребителско ръководство на текстовия редактор gedit." + +#: gedit.xml:188(primary) +msgid "gedit" +msgstr "gedit" + +#: gedit.xml:189(primary) +msgid "text editor" +msgstr "текстов редактор" + +#: gedit.xml:194(title) +msgid "Introduction" +msgstr "Въведение" + +#: gedit.xml:195(para) +msgid "" +"The gedit application enables you to create and " +"edit text files. You can use gedit plugins to " +"perform a variety of tasks related to text-editing from within the " +"gedit window." +msgstr "" +"Програмата gedit Ви позволява да създавате и " +"редактирате текстови файлове. Може да използвате приставки към " +"gedit, които да извършват най-раазлични задачи " +"свързани с редактиране на текст." + +#: gedit.xml:199(title) +msgid "Getting Started" +msgstr "Първи стъпки" + +#: gedit.xml:203(title) +msgid "To Start gedit" +msgstr "Стартиране на GEdit" + +#: gedit.xml:204(para) +msgid "You can start gedit in the following ways:" +msgstr "Може да стартиратеgedit по следните начини:" + +#: gedit.xml:207(term) +msgid "Applications menu" +msgstr "От менюто Програми" + +#: gedit.xml:209(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Изберете Помощни програмиТекстов редактор." + +#: gedit.xml:213(term) +msgid "Command line" +msgstr "От командния ред" + +#: gedit.xml:215(para) +msgid "Execute the following command: gedit" +msgstr "Изпълнете следната команда: gedit" + +#: gedit.xml:223(title) +msgid "When You Start gedit" +msgstr "Когато стартирате GEdit" + +#: gedit.xml:224(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Когато стартирате gedit се появява следният " +"прозорец:" + +#: gedit.xml:227(title) +msgid "gedit Window" +msgstr "Прозорец на GEdit" + +#: gedit.xml:233(phrase) +msgid "Shows gedit main window." +msgstr "Показва главния прозорец на gedit." + +#: gedit.xml:239(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"Прозорецът на gedit съдържа следните елементи:" + +#: gedit.xml:242(term) gedit.xml:298(para) +msgid "Menubar" +msgstr "Лента с менюта" + +#: gedit.xml:244(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Менютата на лентата с менюта съдържат всички, команди, от които може да " +"избирате при работа с файлове в gedit." + +#: gedit.xml:247(term) gedit.xml:304(para) +msgid "Toolbar" +msgstr "Лента с инструменти" + +#: gedit.xml:249(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"Лентата с инструменти съдържа набор от команди, които са налични и в " +"менютата." + +#: gedit.xml:252(term) +msgid "Display area" +msgstr "Район на преглед" + +#: gedit.xml:254(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "Района на преглед съдържа текста на файла, който редактирате." + +#: gedit.xml:257(term) +msgid "Output window" +msgstr "Изходен прозорец" + +#: gedit.xml:259(para) +msgid "" +"The output window displays the output returned by the Shell command plugin." +msgstr "" +"Изходният прозорец показва изходните съобщения върнати от приставката за " +"командния ред." + +#: gedit.xml:262(term) +msgid "Statusbar" +msgstr "Лента за състоянието" + +#: gedit.xml:264(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"Лентата за състоянието показва информация относно текущата активност на " +"gedit и контекстуална информация относно " +"елементите в менютата. Лентата за състоянието също така показва и следната " +"информация:" + +#: gedit.xml:267(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Позиция на курсора: номер на реда и позицията, където се намира в момента " +"курсора." + +#: gedit.xml:270(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Режим на редактиране: Ако редакторът е в режим вмъкване, лентата за " +"състоянието съдържа текста INS. Ако редакторът е в " +"режим на презаписване, лентата за състоянието съдържа текста OVR. Натиснете клавиша Insert, за да променяте режима." + +#: gedit.xml:276(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Когато натиснете с дясното копче в прозореца на gedit, програмата показва меню. Това меню съдържа най-често " +"използваните команди при работа с текст." + +#: gedit.xml:287(para) +msgid "UI Component" +msgstr "Компонент" + +#: gedit.xml:289(para) gedit.xml:1264(para) +msgid "Action" +msgstr "Действие" + +#: gedit.xml:294(para) +msgid "Window" +msgstr "Прозорец" + +#: gedit.xml:295(para) +msgid "" +"Drag a file into the gedit window from another " +"application such as a file manager." +msgstr "" +"Изтеглете файл в прозореца на gedit от друга " +"програма, като например файлов мениджър." + +#: gedit.xml:299(para) +msgid "" +"Choose FileOpen." +msgstr "" +"Изберете ФайлОтваряне." + +#: gedit.xml:300(para) +msgid "" +"If you have recently opened the file, choose FileOpen Recent." +msgstr "" +"Ако наскоро сте отворили файла, изберете ФайлОтваряне на скорошни." + +#: gedit.xml:305(para) +msgid "Click on the Open toolbar button." +msgstr "" +"Натиснете на бутона Отваряне в лентата с инструменти." + +#: gedit.xml:308(para) +msgid "Right-click popup menu" +msgstr "От менюто при натисканте с дясното копче" + +#: gedit.xml:309(para) +msgid "" +"Right-click on the file in a file manager window, then choose Open " +"With from the popup menu." +msgstr "" +"Натиснете с дясното копче на мишката върху файл във файловия мениджър и " +"после изберете Отваряне с от появилото се меню." + +#: gedit.xml:312(para) +msgid "Shortcut keys" +msgstr "Бързи клавиши" + +#: gedit.xml:313(para) +msgid "Press CtrlO." +msgstr "" +"Натиснете CtrlO." + +#: gedit.xml:278(para) +msgid "" +"In gedit, you can perform the same action in " +"several ways. For example, you can open a file in the following ways: " +"" +msgstr "" +"В gedit може да извършвате едно действие по " +"няколко различни начина. Например, може да отворите файл по следните начини: " +"" + +#: gedit.xml:319(para) +msgid "This manual documents functionality from the menubar." +msgstr "Това ръководство документира функционалността през менютата." + +#: gedit.xml:325(title) +msgid "To Open a File" +msgstr "Отваряне на файл" + +#: gedit.xml:326(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"За да отворите файл, изберете ФайлОтваряне, за да се покаже " +"прозорецът Отваряне на файл. Изберете файла, който " +"искате да отворите и после натиснете Отваряне. Файлът " +"се показва в прозореца на gedit." + +#: gedit.xml:327(para) +msgid "" +"You can open multiple files in gedit. The " +"application displays one file at a time in the application window. The " +"application adds a tab for each open file to the window. To display another " +"open file, click on the tab that corresponds to the file. To create a new " +" gedit window for each file that is open, drag " +"the tab corresponding to each file to the desktop background." +msgstr "" +"Може да отворите множество файлове в gedit. " +"Програмата показва един файл наведнъж в прозорец. Добавя се подпрозорец за " +"всеки отворен файл. За да се покаже друг файл, просто изберете неговия " +"подпрозорец. За да се създаде нов прозорец на gedit за всеки отворен файл, изтеглете съответния подпрозорец към " +"фона на работния плот." + +#: gedit.xml:328(para) +msgid "" +"You can also use the Documents menu to move between the " +"open files. You can choose DocumentsMove to New Window to move a " +"document to a new gedit window." +msgstr "" +"Може също да използвате менюто Документи, за да се " +"придвижвате между отворените файлове. Може да изберете " +"ДокументиПреместване в нов " +"прозорец, за да преместите документ към нов " +"прозорец на gedit." + +#: gedit.xml:330(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Показва иконата в менюто за скорошните файлове" + +#: gedit.xml:330(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Програмата записва местоположението на последните пет редактирани файла и " +"показва файловете като елементи от менюто Файл. Може да натиснете иконата от лентата " +"с инструменти, за да видите списъка с последните файлове." + +#: gedit.xml:334(title) +msgid "To Open Multiple Files from a Command Line" +msgstr "Отваряне на множество файлове от командния ред" + +#: gedit.xml:335(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Може да стартирате gedit от командния ред и да " +"отворите един или много файлове. За да отворите много файлове от командния " +"ред, въведете следната команда и после натиснете Enter:" + +#: gedit.xml:336(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: gedit.xml:336(command) +msgid "gedit " +msgstr "gedit " + +#: gedit.xml:337(para) +msgid "" +"When the application starts, the files that you specify are displayed in the " +"gedit window." +msgstr "" +"Когато програмата се стартира, файловете, които сте определили се появяват в " +"прозореца на gedit." + +#: gedit.xml:338(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see gedit1." +msgstr "" +"За повече информация относно как да стартирате gedit от командния ред, вижте gedit1." + +#: gedit.xml:343(title) +msgid "Usage" +msgstr "Употреба" + +#: gedit.xml:347(title) +msgid "To Create a New File" +msgstr "Създаване на нов текстов файл" + +#: gedit.xml:348(para) +msgid "" +"To create a new file, choose FileNew. The application " +"displays a new file in the gedit window." +msgstr "" +"За да създадете нов файл, изберете ФайлНов. Програмата показва нов " +"файл в прозореца си." + +#: gedit.xml:352(title) +msgid "To Save a File" +msgstr "Запазване на файл" + +#: gedit.xml:353(para) +msgid "You can save files in the following ways:" +msgstr "Може да запазвате файлове по следните начини:" + +#: gedit.xml:355(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"За да запазите промените по съществуващ файл, изберете " +"ФайлЗапазване." + +#: gedit.xml:357(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"За да запазите нов файл или да запазите съществуващ файл под друго име, " +"изберете ФайлЗапазване като. Въведете име за файла в прозореца " +"Запазване като и после натиснете Запазване." + +#: gedit.xml:359(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"За да запазите всички файлове, които са отворени в gedit, изберете ДокументиЗапазване на всички." + +#: gedit.xml:362(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"За да затворите всички файлове, които са отворени в gedit, изберете ДокументиЗатваряне на всички." + +#: gedit.xml:366(title) +msgid "To Edit Text" +msgstr "Редактиране на текст" + +#: gedit.xml:367(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Може да редактирате текста във файл по следните начини:" + +#: gedit.xml:369(para) +msgid "Type new text from the keyboard." +msgstr "Въведете нов текст чрез клавиатурата." + +#: gedit.xml:371(para) +msgid "" +"To copy the selected text to a buffer, choose EditCopy." +msgstr "" +"За да копирате избрания текст във временната памет, изберете " +"РедактиранеКопиране." + +#: gedit.xml:373(para) +msgid "" +"To delete the selected text from the file and move the selected text to a " +"buffer, choose EditCut." +msgstr "" +"За да изтриете избрания текст от файла и същевременно да го преместите във " +"временната памет, изберете РедактиранеИзрязване." + +#: gedit.xml:375(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"За да изтриете за постоянно избрания текст от файла, изберете " +"РедактиранеИзтриване." + +#: gedit.xml:377(para) +msgid "" +"To insert the contents of the buffer at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file." +msgstr "" +"За да вмъкнете съдържанието на временната памет при позицията на курсора, " +"изберете РедактиранеПостаряне. Трябва да изрежете или копирате текст, преди да " +"може да го поставяте в някъде." + +#: gedit.xml:379(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"За да изберете целия текст във файл, изберете " +"РедактиранеИзбор на всичко." + +#: gedit.xml:385(title) +msgid "To Undo or Redo Edits" +msgstr "Отмяна и повтаряне на редакции" + +#: gedit.xml:386(para) +msgid "" +"To undo an edit, choose EditUndo. To redo an edit, " +"choose EditRedo. The number of previous edits that you can undo is determined by " +"the Undo limit setting in the tabbed section of the Preferences " +"dialog." +msgstr "" +"За да отмените редакция, изберете РедактиранеОтмяна. За да върнете " +"редакция, изберете РедактиранеПовтаряне. Броят на " +"предишните редакции, които може да отмените се определя от ограниченията за " +"Отмяна настроени в раздела на настройките." + +#: gedit.xml:390(title) +msgid "To Find Text" +msgstr "Търсене на текст" + +#: gedit.xml:391(para) +msgid "To search a file for a string, perform the following steps:" +msgstr "За да търсите низ във файл, следвайте следните стъпки:" + +#: gedit.xml:393(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Изберете ТърсенеТърсене, за да се появи прозорецът за Търсене." + +#: gedit.xml:395(para) gedit.xml:435(para) +msgid "" +"Type the string that you want to find, in the Search for field." +msgstr "" +"Въведете низа, който искате да откриете в полето Търсене за." + +#: gedit.xml:396(para) gedit.xml:436(para) +msgid "You can include the following escape sequences:" +msgstr "Може да включите следните изходни последователности:" + +#: gedit.xml:399(literal) gedit.xml:439(literal) +msgid "\\n" +msgstr "\\n" + +#: gedit.xml:400(para) gedit.xml:440(para) +msgid "Use this escape sequence to specify a new line." +msgstr "Определя нов ред." + +#: gedit.xml:403(literal) gedit.xml:443(literal) +msgid "\\t" +msgstr "\\t" + +#: gedit.xml:404(para) gedit.xml:444(para) +msgid "Use this escape sequence to specify a tab character." +msgstr "Определя табулация." + +#: gedit.xml:407(literal) gedit.xml:447(literal) +msgid "\\r" +msgstr "\\r" + +#: gedit.xml:408(para) gedit.xml:448(para) +msgid "Use this escape sequence to specify a carriage return." +msgstr "" +"Използване на тази екранираща последователност за въвеждане на знак за нов " +"ред (carriage return)." + +#: gedit.xml:412(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type." +msgstr "" +"Изберете опцията Зачитане на малки/големиMatch entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type." +msgstr "" +"Изберете опцията Ако съвпада само с цяла дума, за да се " +"откриват съвпадение на низа, които са цели думи в текста." + +#: gedit.xml:416(para) gedit.xml:458(para) +msgid "" +"Select the Search backwards option to search backwards " +"to the beginning of the file." +msgstr "" +"Изберете опцията Търсене на обратно, за да търсите " +"назад към началото на файла." + +#: gedit.xml:418(para) gedit.xml:460(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the file and then continue the search from the other end of the file." +msgstr "" +"Изберете опцията Режим с пренасяне, за да търсите до " +"единия край на файла и после да се продължава търсенето от другия край на " +"файла." + +#: gedit.xml:420(para) gedit.xml:462(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string. If gedit finds the " +"string, the application moves the cursor to the string, and selects the " +"string." +msgstr "" +"Натиснете Търсене, за да претърсите файла за първото " +"срещане на низа. Ако gedit намери низа, " +"програмата премества курсора към него и го избира." + +#: gedit.xml:422(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the string, " +"choose SearchFind Previous." +msgstr "" +"За да откриете къде се среща даден низ, натиснете Търсене или изберете ТърсенеНамиране на следващ. За да " +"откриете предишният път, когато се среща даден низ, изберете " +"ТърсенеНамиране на предишен." + +#: gedit.xml:424(para) gedit.xml:468(para) +msgid "To finish the search, click Close." +msgstr "" +"За да приключите търсенето, натиснете Затваряне." + +#: gedit.xml:430(title) +msgid "To Find and Replace Text" +msgstr "Търсене и замяна на текст" + +#: gedit.xml:431(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"За да претърсите файл за даден низ и да замените низа с друг низ, следвайте " +"следните стъпки:" + +#: gedit.xml:433(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Изберете ТърсенеЗамяна, за да се появи прозорецът Замяна." + +#: gedit.xml:452(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Въведете низа, който искате да използвате да замени низа, който търсите, в " +"полето Замяна с." + +#: gedit.xml:454(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you enter." +msgstr "" +"Изберете опцията Зачитане на малки/големиReplace to replace the occurrence of the string " +"with the text in the Replace with field. Click " +"Replace All to replace all occurrences of the string." +msgstr "" +"Натиснете Замяна, за да замените съвпаденията с низа " +"от полето Замяна с. Натиснете Замяна на " +"всички, за да замените всички съвпадения с въведения низ." + +#: gedit.xml:466(para) +msgid "" +"To find the next occurrence of the string, click Find." +msgstr "" +"За да откриете следващото срещане на низа, натиснете Търсене." + +#: gedit.xml:474(title) +msgid "To Open a File from a URI" +msgstr "Отваряне на файл от адрес (URI)" + +#: gedit.xml:475(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"За да отворите файл през Uniform Resource Identifier (URI), следвайте " +"следните стъпки:" + +#: gedit.xml:478(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Изберете ФайлОтваряне на " +"местоположение, за да се появи прозорецът за " +"Отваряне на местоположение." + +#: gedit.xml:481(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Въведете адреса на файла, който искате да отворите." + +#: gedit.xml:484(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Използвайте падащото меню Кодиране на символите, за да " +"изберете подходящата кодова таблица." + +#: gedit.xml:487(para) +msgid "Click Open." +msgstr "Натиснете Отваряне." + +#: gedit.xml:490(para) +msgid "" +"Alternatively, type gedit URI " +"at a command line, where URI is the URI of the " +"file that you want to open, then press Return. Valid types " +"of URI include http:, " +"ftp:, file:, and all of the methods " +"supported by mate-vfs." +msgstr "" +"Или просто въведете в командния ред gedit URI, където URI е адресът на " +"файла, който искате да отворите. После натиснете Enter. " +"Валидни видове URI са http:, " +"ftp:, file: и всички методи поддържани " +"от mate-vfs." + +#: gedit.xml:491(para) +msgid "The application opens the file located at the URI in read-only mode." +msgstr "" +"Програмата отваря файла, който се намира на адреса, в режим само за четене." + +#: gedit.xml:495(title) +msgid "To Pipe the Output of a Command to a File" +msgstr "Извеждане на изходните съобщения на команда към файл" + +#: gedit.xml:496(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Може да използвате gedit, за да пренасочите " +"изходните съобщения на команда към текстов файл. Например, за да запишете " +"изхода на командата ls в текстов файл, изпълнете " +"командата ls | gedit." + +#: gedit.xml:497(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Изходните съобщения на командата ls се появяват в нов " +"текстов файл в прозореца на gedit." + +#: gedit.xml:498(para) +msgid "" +"Alternatively, you can use the Shell command plugin to pipe command output " +"to the current file. For information about how to use the Shell command " +"plugin, see ." +msgstr "" +"Можете също да използвате приставката за командната обвивка, за да " +"пренасочвате изходни съобщения към текущия файл. За информация относно как " +"да използвате тази приставка, вижте ." + +#: gedit.xml:502(title) +msgid "To Position the Cursor on a Specific Line" +msgstr "Поставяне на курсора на определен ред" + +#: gedit.xml:503(para) +msgid "" +"To position the cursor on a specific line in the current file, perform the " +"following steps:" +msgstr "" +"За да поставите курсора на определен ред в текущия файл, извършете следните " +"действия:" + +#: gedit.xml:505(para) +msgid "" +"Choose SearchGo to Line to display the Go to Line " +"dialog." +msgstr "" +"Изберете ТърсенеОтиване на ред, за да се покаже прозореца Отиване на " +"ред." + +#: gedit.xml:507(para) +msgid "" +"Type the number of the line that you want to move the cursor to in the " +"Line number field." +msgstr "" +"Въведете номера на реда, където искате да преместите курсора, в полето " +"Номер на ред." + +#: gedit.xml:509(para) +msgid "" +"Click Go to Line. The application moves the cursor to " +"the line number that you specify." +msgstr "" +"Натиснете Отиване на ред. Програмата премества " +"курсора към реда с дадения номер." + +#: gedit.xml:511(para) +msgid "" +"To close the Go to Line dialog, click Close." +msgstr "" +"За да затворите прозореца Отиване на ред, натиснете " +"Затваряне." + +#: gedit.xml:517(title) +msgid "To Set the Page Options" +msgstr "Настройване на страницата" + +#: gedit.xml:519(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"За да настроите страницата, изберете ФайлНастройки на страницата, за " +"да се появи прозорецът за Настройки на страницата." + +#: gedit.xml:521(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"Прозорецът Настройки на страницата Ви позволява да " +"определите следните опции за разпечатването:" + +#: gedit.xml:524(title) +msgid "General Tabbed Section" +msgstr "Раздел \"Главни\"" + +#: gedit.xml:526(guilabel) +msgid "Print syntax highlighting" +msgstr "Печатане на синтактично оцветен текст" + +#: gedit.xml:528(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Изберете тази опция, за да се разпечатва осветяването на синтаксиса. За " +"повече информация относно осветяването на синтаксиса, вижте ." + +#: gedit.xml:531(guilabel) +msgid "Print page headers" +msgstr "Печатане на колонтитулите" + +#: gedit.xml:533(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Изберете тази опция, за да включите колонтитули във всички страници, които " +"разпечатвате. Не може да настроите колонтитула." + +#: gedit.xml:536(guilabel) gedit.xml:877(guilabel) +msgid "Line Numbers" +msgstr "Номера на редове" + +#: gedit.xml:539(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Изберете опцията Печатане на номера на редове, за да " +"включите номерата на редовете, когато разпечатвате файл." + +#: gedit.xml:540(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Използвайте полето Номериране на всеки ... реда, за да " +"определите колко често да се разпечатва номерацията, например на всеки пети " +"ред." + +#: gedit.xml:543(guilabel) gedit.xml:870(guilabel) +msgid "Text Wrapping" +msgstr "Режим с пренасяне" + +#: gedit.xml:545(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Изберете опцията Разрешаване на режим с пренасяне, за " +"да се пренася текста на нов ред, на ниво символ, когато разпечатвате файл. " +"Програмата брои пренесения ред като един ред, за целите на номерирането на " +"страницата." + +#: gedit.xml:547(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Изберете опцията Без разделяне на думите на два реда, " +"за да пренасяте текст само на ниво думи, при разпечатването на файл." + +#: gedit.xml:555(title) +msgid "Fonts" +msgstr "Шрифтове" + +#: gedit.xml:557(guilabel) +msgid "Body" +msgstr "Тяло" + +#: gedit.xml:559(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Натиснете този бутон, за да изберете шрифта, който да се използва за " +"разпечатване тялото на текстовия файл." + +#: gedit.xml:562(guilabel) +msgid "Line numbers" +msgstr "Номера на редове" + +#: gedit.xml:565(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Натиснете този бутон, за да изберете шрифта, който да се използва за " +"разпечатване на номерата на редовете." + +#: gedit.xml:568(guilabel) +msgid "Headers and footers" +msgstr "Горен и долен колонтитул" + +#: gedit.xml:570(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Натиснете този бутон, за да изберете шрифта, който да се използва за " +"разпечатване на горния и долен колонтитул." + +#: gedit.xml:574(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"За върнете шрифтовете към стандартните за разпечатването на файл през " +"gedit, натиснете Възстановяване на " +"шрифтовете по подразбиране." + +#: gedit.xml:581(title) +msgid "To Print a File" +msgstr "Разпечатване на файл" + +#: gedit.xml:582(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Може да използвате gedit, за да извършвате " +"следните операции по разпечатване:" + +#: gedit.xml:584(para) +msgid "Print a file to a printer." +msgstr "Разпечатване на файл към принтер" + +#: gedit.xml:586(para) +msgid "Print the output of the print command to a file." +msgstr "Разпечатване на изходните съобщения на командата print в ред." + +#: gedit.xml:589(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Ако разпечатвате към файл, gedit изпраща " +"изходните съобщения за файла към предпечатен файлов формат. Най-често " +"срещаните такива формати са PostScript и Portable Document Format (PDF)." + +#: gedit.xml:591(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"За да прегледате страниците, които искате да разпечатате, изберете " +"ФайлПреглед на документ." + +#: gedit.xml:593(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"За да разпечатате текущия файл на принтер или във файл, изберете " +"ФайлПечат. Ще се покаже прозорецът Печат." + +#: gedit.xml:595(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"Прозорецът Печат Ви позволява да определяте следните " +"опции за печат:" + +#: gedit.xml:598(title) +msgid "Job Tabbed Section" +msgstr "Раздел \"Задача\"" + +#: gedit.xml:600(guilabel) +msgid "Print range" +msgstr "Обхват на печата" + +#: gedit.xml:602(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Изберете една от следните опции, за да определите колко страници да се " +"разпечатат:" + +#: gedit.xml:605(guilabel) +msgid "All" +msgstr "Всичко" + +#: gedit.xml:606(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Изберете тази опция, за да разпечатате всички страници на файла." + +#: gedit.xml:609(guilabel) +msgid "Lines" +msgstr "Редове" + +#: gedit.xml:610(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Изберете тази опция, за се разпечатат само определени редове. Използвайте " +"полетата От и До, за да определите " +"обхвата." + +#: gedit.xml:613(guilabel) +msgid "Selection" +msgstr "Избраното" + +#: gedit.xml:614(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Изберете тази опция, за да разпечатате само избрания текст. Тази опция е " +"налична само, ако сте избрали текст." + +#: gedit.xml:620(guilabel) +msgid "Copies" +msgstr "Копия" + +#: gedit.xml:622(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Използвайте полето Брой разпечатки, за да определите " +"броя на копията на файла, които искате да разпечатате." + +#: gedit.xml:623(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Ако печатате множество копия на файла, изберете опцията Подредба, за да подредите разпечатаните копия." + +#: gedit.xml:630(title) +msgid "Printer Tabbed Section" +msgstr "Раздел \"Принтер\"" + +#: gedit.xml:632(guilabel) +msgid "Printer" +msgstr "Принтер" + +#: gedit.xml:634(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Използвайте падащия списък, за да изберете с кой принтер да се разпечата " +"файла." + +#: gedit.xml:637(guilabel) +msgid "Settings" +msgstr "Настройки" + +#: gedit.xml:639(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Използвайте падащия списък, за да изберете настройките на принтера." + +#: gedit.xml:641(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"За да настроите принтер, натиснете Настройки. " +"Например, може да включите или изключите двустранно разпечатване или да " +"насрочите разпечатване, ако тази функционалност е поддържана от принтера." + +#: gedit.xml:645(guilabel) +msgid "Location" +msgstr "Местоположение" + +#: gedit.xml:647(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Използвайте падащия списък, за да изберете едно от следните местоположения " +"за разпечатване:" + +#: gedit.xml:652(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: gedit.xml:654(para) +msgid "Print the file to a CUPS printer." +msgstr "Разпечатва файла към CUPS принтер." + +#: gedit.xml:658(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Ако избраният принтер е принтер на CUPS, CUPS e " +"единствения запис в този списък." + +#: gedit.xml:665(guilabel) +msgid "lpr" +msgstr "lpr" + +#: gedit.xml:667(para) +msgid "Print the file to a printer." +msgstr "Разпечатване на файл към принтер." + +#: gedit.xml:673(guilabel) +msgid "File" +msgstr "Файл" + +#: gedit.xml:675(para) +msgid "Print the file to a PostScript file." +msgstr "Разпечатва файла в PostScript файл." + +#: gedit.xml:678(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Натиснете Запазване като, за да се появи прозорецът, " +"където определяте името и местоположението на PostScript файла." + +#: gedit.xml:684(guilabel) +msgid "Custom" +msgstr "Личен" + +#: gedit.xml:686(para) +msgid "Use the specified command to print the file." +msgstr "Използва определената команда, за да разпечата файла." + +#: gedit.xml:689(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Въведете името на командата в текстовото поле. Включете всички командни " +"аргументи." + +#: gedit.xml:697(guilabel) +msgid "State" +msgstr "Състояние" + +#: gedit.xml:699(para) gedit.xml:705(para) gedit.xml:711(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Тази функционалност не се поддържа в тази версия на gedit." + +#: gedit.xml:703(guilabel) +msgid "Type" +msgstr "Вид" + +#: gedit.xml:709(guilabel) +msgid "Comment" +msgstr "Коментар" + +#: gedit.xml:719(title) +msgid "Paper Tabbed Section" +msgstr "Раздел \"Хартия\"" + +#: gedit.xml:721(guilabel) +msgid "Paper size" +msgstr "Размер на хартията" + +#: gedit.xml:723(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Използвайте този падащ списък, за да изберете размера на хартията, на която " +"искате да разпечате файла." + +#: gedit.xml:726(guilabel) +msgid "Width" +msgstr "Ширина" + +#: gedit.xml:728(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Използвайте това поле, за да определите ширината на хартията. Използвайте " +"близките падащи списъци, за да промените мерната единица." + +#: gedit.xml:731(guilabel) +msgid "Height" +msgstr "Височина" + +#: gedit.xml:733(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Използвайте това поле, за да определите височината на хартията." + +#: gedit.xml:736(guilabel) +msgid "Feed orientation" +msgstr "Ориентация на листоподаването" + +#: gedit.xml:738(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"Използвайте това поле, за да изберете ориентацията на хартията в принтера." + +#: gedit.xml:741(guilabel) +msgid "Page orientation" +msgstr "Ориентация на страницата" + +#: gedit.xml:743(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "" +"Използвайте този падащ списък, за да изберете ориентация на страницата." + +#: gedit.xml:746(guilabel) +msgid "Layout" +msgstr "Оформление" + +#: gedit.xml:748(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Използвайте този падащ списък за изберете подредба на страницата. В района " +"на преглед се показва преглед на всяка подредба, която бъде избрана." + +#: gedit.xml:751(guilabel) +msgid "Paper tray" +msgstr "Контейнер за хартията" + +#: gedit.xml:753(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Използвайте този падащ списък, за да изберете контейнера за хартия." + +#: gedit.xml:762(title) +msgid "To Customize the Toolbar" +msgstr "Персонализиране на лентата с инструменти" + +#: gedit.xml:763(para) +msgid "" +"To display or hide the toolbar, choose ViewToolbar. To customize how " +"gedit displays the toolbar, choose " +"ViewCustomize Toolbar, then select one of the following menu items:" +msgstr "" +"За да се показва и скрива лентата с инструменти, изберете " +"ИзгледЛента с инструменти. За да персонализирате как gedit показва лентата с инструменти, изберете " +"ИзгледНастройки не лентата с " +"инструменти и после изберете един от следните " +"елементи за менюто:" + +#: gedit.xml:766(guimenuitem) +msgid "Desktop Default" +msgstr "По подразбиране за работната среда" + +#: gedit.xml:767(para) +msgid "Display the default toolbar." +msgstr "Показване на стандартната лента с инструменти" + +#: gedit.xml:770(guimenuitem) +msgid "Icons Only" +msgstr "Само икони" + +#: gedit.xml:771(para) +msgid "Display icons only." +msgstr "Показва само икони." + +#: gedit.xml:774(guimenuitem) +msgid "Text for All Icons" +msgstr "Текст за всички икони" + +#: gedit.xml:775(para) +msgid "Display icons, and display text for all icons." +msgstr "Показва икони ипоказва текста за всички икони." + +#: gedit.xml:778(guimenuitem) +msgid "Text for Important Icons" +msgstr "Текст за важни икони" + +#: gedit.xml:779(para) +msgid "Display icons, and display text for the important icons." +msgstr "Показва икони и показва текст за важните икони." + +#: gedit.xml:782(para) +msgid "" +"To display or hide the output window, choose ViewOutput Window." +msgstr "" +"За да покажете или скриете изходния прозорец, изберете " +"ИзгледИзходни съобщения." + +#: gedit.xml:787(title) +msgid "To Set the Syntax Highlighting Mode" +msgstr "Настройване на режима с осветяване" + +#: gedit.xml:788(para) +msgid "" +"To set the syntax highlighting mode, choose ViewHighlight Mode, then select " +"one of the following menu items:" +msgstr "" +"За да настроите осветения синтаксис, изберете ИзгледРежим на осветяване и после " +"изберете едно от следните:" + +#: gedit.xml:791(guimenuitem) +msgid "Normal" +msgstr "Нормален" + +#: gedit.xml:793(para) +msgid "Do not display any syntax highlighting." +msgstr "Да не се показва синтактично осветяване" + +#: gedit.xml:797(guisubmenu) +msgid "Sources" +msgstr "Източници" + +#: gedit.xml:799(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Показва осветяване на синтаксис за редактиране на изходен код. Използвайте " +"подменюто Източници, за да изберете вида изходен " +"код." + +#: gedit.xml:803(guisubmenu) +msgid "Markup" +msgstr "Маркиране" + +#: gedit.xml:805(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Показване на синтактичното осветяване, така че да се редактира маркиращ код. " +"Използвайте подменюто Маркиране, за да изберете " +"вида на кода." + +#: gedit.xml:809(guisubmenu) +msgid "Scripts" +msgstr "Скриптове" + +#: gedit.xml:811(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Показване на синтактичното осветяване, така че да се редактира код за " +"скриптове. Използвайте подменюто Скриптове, за да " +"изберете вида на кода." + +#: gedit.xml:815(guisubmenu) +msgid "Others" +msgstr "Други" + +#: gedit.xml:817(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Показване на синтактичното осветяване, така че да се редактира друг вид код. " +"Използвайте подменюто Други, за да изберете вида на " +"кода." + +#: gedit.xml:821(para) +msgid "" +"For more information about how to configure syntax highlighting, see ." +msgstr "" +"За повече информация относно как да конфигурирате осветяването на " +"синтаксиса, вижте ." + +#: gedit.xml:828(title) +msgid "Preferences" +msgstr "Настройки" + +#: gedit.xml:830(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"За да настроите gedit, изберете " +"РедактиранеНастройки. Прозорецът Настройки съдържа " +"следните категории:" + +#: gedit.xml:840(title) +msgid "Editor" +msgstr "Редактор" + +#: gedit.xml:842(guilabel) +msgid "Tabs" +msgstr "Табулация" + +#: gedit.xml:844(para) +msgid "" +"Use the Tabs width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Използвайте полето за полето за Ширина на табулацията, " +"за да определите ширината на празното пространство, което " +"gedit вмъква, когато натиснете клавиша " +"Tab." + +#: gedit.xml:845(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Изберете опцията Вмъкване на интервали вместо табулации, за да определите gedit да вмъква " +"интервали, вместо символ за табулации, при натискане на клавиша Tab." + +#: gedit.xml:848(guilabel) +msgid "Auto Indentation" +msgstr "Автоматичен отстъп" + +#: gedit.xml:849(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Изберете опцията Enable auto indentation, за да " +"определите, че следващият ред започва на същото вдадено ниво, както и " +"текущия ред." + +#: gedit.xml:852(guilabel) +msgid "File Saving" +msgstr "Запазване на файлове" + +#: gedit.xml:854(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Изберете опцията Създаване на резервно копие на файловете преди " +"запазване, за да се създава резервно копие на файла всеки път, " +"когато той се запазва. Резервното копие на файла има файлово име, завършващо " +"с \"~\"." + +#: gedit.xml:855(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Изберете опцията Автоматично запазване на файловете на всеки ..." +" минути, за да се запазва текущия файл на равни интервали. " +"Използвайте полето, за да определите колко често да се запазва файла." + +#: gedit.xml:858(guilabel) +msgid "Undo" +msgstr "Отмяна" + +#: gedit.xml:860(para) +msgid "" +"Select the Limit to ... actions option to set a limit " +"on the number of editing actions that you can undo. Use the spin box to " +"specify the maximum number of actions that you can undo." +msgstr "" +"Изберете опцията Ограничаване до ... действия, за да " +"настроите броя на действия, които можете да отменяте. Използвайте полето, за " +"да определите колко да е максималния брой действия, които да се пазят." + +#: gedit.xml:861(para) +msgid "" +"Select the Unlimited undo option to set no limit on the " +"number of editing actions that you can undo." +msgstr "" +"Изберете опцията Неограничени връщания назад, за да " +"махнете ограничението на броя отмени, които може да правите по редакциите." + +#: gedit.xml:868(title) gedit.xml:1195(guimenu) +msgid "View" +msgstr "Изглед" + +#: gedit.xml:872(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you reach the text window " +"boundary." +msgstr "" +"Изберете опцията Разрешаване на режима с пренасяне, за " +"да пренасяте текста на следващия ред, на ниво символ, когато се достигне " +"текстовата граница на прозореца." + +#: gedit.xml:873(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you reach the text " +"window boundary." +msgstr "" +"Изберете опцията Без разделяне на думите на два реда, " +"за да се пренася текста на следващия ред, на ниво дума, когато се достигне " +"текстовата граница на прозореца." + +#: gedit.xml:879(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Изберете опцията Показване на номера на редовете, за да " +"се покажат номерата на редовете в лявата част на прозореца на " +"gedit." + +#: gedit.xml:883(guilabel) +msgid "Right Margin" +msgstr "Дясна граница" + +#: gedit.xml:885(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Изберете опцията Показване на дясна граница, за да се " +"показва вертикална линия, която да показва дясната граница." + +#: gedit.xml:886(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Използвайте полето Дясна граница за колона, за да " +"определите местоположението на вертикалната линия." + +#: gedit.xml:893(title) +msgid "Font & Colors" +msgstr "Шрифт и цветове" + +#: gedit.xml:895(guilabel) +msgid "Font" +msgstr "Шрифт" + +#: gedit.xml:897(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Изберете опцията Използване на шрифта на темата по подразбиране, за се използва системния шрифт за текста в прозореца на " +"gedit." + +#: gedit.xml:898(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"Полето Шрифт на редактора показва шрифта, който се " +"използва от gedit, за да се показва текст. " +"Натиснете бутона, за да определите вида на шрифта, стила и размера му." + +#: gedit.xml:901(guilabel) +msgid "Colors" +msgstr "Цветове" + +#: gedit.xml:903(para) +msgid "" +"Select the Use default theme colors option to use the " +"default theme colors in the gedit text window." +msgstr "" +"Изберете опцията зползване на цветови теми по подразбиране, за да се използват стандартните цветове на темата в прозореца на " +"gedit." + +#: gedit.xml:904(para) +msgid "" +"Click on the Normal text color color button to " +"display the color selector dialog. Select a color to use to display normal " +"text in the gedit text window." +msgstr "" +"Натиснете бутона Нормален цвят на текста, за да се " +"покаже прозореца за избор на цвят. Изберете цвета, с който да се показва " +"нормалния текст в прозореца на gedit." + +#: gedit.xml:905(para) +msgid "" +"Click on the Background color color button to display " +"the color selector dialog. Select a background color for the " +"gedit text window." +msgstr "" +"Натиснете бутона Фонов цвят, за да се покаже " +"прозореца за избор на цвят. Изберете фоновия цвят за текстовия прозорец на " +"gedit." + +#: gedit.xml:906(para) +msgid "" +"Click on the Selected text color color button to " +"display the color selector dialog. Select a color to use to display selected " +"text." +msgstr "" +"Натиснете бутона Цвят на избрания текст, за да се " +"покаже прозореца за избор на цвят. Изберете цвят, който да се използва за " +"избрания текст." + +#: gedit.xml:908(para) +msgid "" +"Click on the Selection color color button to display " +"the color selector dialog. Select a background color to use to highlight a " +"text selection." +msgstr "" +"Натиснете бутона Цвят на избраното, за да се покаже " +"прозореца за избор на цвят. Изберете фоновия цвят, който да се използва при " +"маркирането на текст." + +#: gedit.xml:915(title) +msgid "Syntax Highlighting" +msgstr "Отбелязване на синтаксиса" + +#: gedit.xml:917(guilabel) +msgid "Enable syntax highlighting" +msgstr "Включване на отбелязването на синтаксиса" + +#: gedit.xml:919(para) +msgid "Select this option to highlight the syntax of the text that you edit." +msgstr "" +"Изберете тази опция, за се осветява синтаксиса на текста, който редактирате." + +#: gedit.xml:922(guilabel) +msgid "Highlight mode" +msgstr "Режим на отбелязване" + +#: gedit.xml:924(para) +msgid "Use this drop-down list to select a syntax mode to configure." +msgstr "" +"Използвайте падащия списък, за да изберете режим на синтаксиса, който да " +"настроите." + +#: gedit.xml:927(guilabel) +msgid "Elements" +msgstr "Елементи" + +#: gedit.xml:929(para) +msgid "Use this list box to select a syntax element to configure." +msgstr "" +"Използвайте този списък, за да изберете синтаксисните елементи, които да " +"настроите." + +#: gedit.xml:932(term) +msgid "Format buttons" +msgstr "Бутони на форматирането" + +#: gedit.xml:934(para) +msgid "" +"Use the following buttons to change the format of the selected syntax " +"element:" +msgstr "" +"Използвайте следните бутони, за да променяте формата на избраните " +"синтаксисни елементи:" + +#: gedit.xml:942(para) +msgid "Button" +msgstr "Бутон" + +#: gedit.xml:944(para) +msgid "Format" +msgstr "Формат" + +#: gedit.xml:956(phrase) +msgid "Shows icon for bold format." +msgstr "Показва иконата за удебелен текст." + +#: gedit.xml:962(para) +msgid "Bold" +msgstr "Удебелен" + +#: gedit.xml:974(phrase) +msgid "Shows icon for italic format." +msgstr "Показва иконата за наклонен текст." + +#: gedit.xml:980(para) +msgid "Italic" +msgstr "Наклонен" + +#: gedit.xml:992(phrase) +msgid "Shows icon for underline." +msgstr "Показва иконата за подчертан текст." + +#: gedit.xml:998(para) +msgid "Underline" +msgstr "Подчертан" + +#: gedit.xml:1010(phrase) +msgid "Shows icon for strikethrough." +msgstr "Показва иконата за зачеркнат текст." + +#: gedit.xml:1016(para) +msgid "Strikethrough" +msgstr "Зачеркнат" + +#: gedit.xml:1026(guilabel) +msgid "Foreground" +msgstr "Текст" + +#: gedit.xml:1028(para) +msgid "" +"Select this option to change the font color of the selected syntax element. " +"Click on the color button to display the color selector dialog, then select " +"the font color." +msgstr "" +"Изберете тази опция, за да промените цвета на шрифта, за избрания " +"синтаксисен елемент. Натиснете бутона за цвета, за да се появи прозорец за " +"избор на цвят и после изберете цвета на шрифта." + +#: gedit.xml:1031(guilabel) +msgid "Background" +msgstr "Фон" + +#: gedit.xml:1033(para) +msgid "" +"Select this option to change the background color of the selected syntax " +"element. Click on the color button to display the color selector dialog, " +"then select the background color." +msgstr "" +"Изберете тази опция, за да промените фоновия цвят за избрания синтаксисен " +"елемент. Натиснете бутона за цвят, за да се появи прозореца за избор на цвят " +"и после от него изберете цвета на фона." + +#: gedit.xml:1036(guibutton) +msgid "Reset to Default" +msgstr "Връщане на стандартни настройки" + +#: gedit.xml:1038(para) +msgid "" +"Click on this button to reset the foreground color and background color of " +"the selected syntax element to the default values." +msgstr "" +"Натиснете този бутон, за да се занулят цветовете за текста и за фона на " +"избраните синтаксисни елементи, към стандартните стойности." + +#: gedit.xml:1045(title) +msgid "Plugins" +msgstr "Приставки" + +#: gedit.xml:1046(para) +msgid "" +"For information about how to use the Plugins category " +"of the Preferences dialog, see ." +msgstr "" +"За информация относно как да се използва категорията Приставки от прозореца Настройки, вижте ." + +#: gedit.xml:1052(title) +msgid "Working with Plugins" +msgstr "Работа с приставки" + +#: gedit.xml:1053(para) +msgid "" +"A plugin is a supplementary program that enhances the functionality of an " +"application. The gedit plugins enable you to " +"perform a variety of functions related to text editing from within the " +" gedit window. The following table lists the " +" gedit plugins." +msgstr "" +"Приставката е допълнителна програма, която подобрява функционалността на " +"дадена програма. Приставките за gedit Ви " +"позволяват да извършвате множество функции свързани с редактирането на текст " +"през gedit. Следната таблица изброява приставките " +"за gedit." + +#: gedit.xml:1060(para) gedit.xml:1135(para) +msgid "Plugin Name" +msgstr "Име на приставка" + +#: gedit.xml:1061(para) +msgid "Purpose" +msgstr "Цел" + +#: gedit.xml:1066(para) gedit.xml:1141(para) +msgid "ChangeCase" +msgstr "Промяна на регистъра" + +#: gedit.xml:1067(para) +msgid "Changes the case of the selected text." +msgstr "Променя регистъра (малки/големи букви) на избрания текст." + +#: gedit.xml:1070(para) gedit.xml:1156(para) gedit.xml:1158(guimenuitem) +msgid "Document Statistics" +msgstr "Статистика за документа" + +#: gedit.xml:1071(para) +msgid "" +"Counts the number of lines, words, characters with spaces, characters " +"without spaces, and bytes in the current file. The plugin displays the " +"results in a Document Statistics dialog." +msgstr "" +"Брои броят редове, думи, символи с интервалите, символи без интервалите и " +"байтове в текущия файл. Приставката показва резултатите в прозорец за " +"Статистика за документа." + +#: gedit.xml:1074(para) gedit.xml:1161(para) +msgid "Indent lines" +msgstr "Отстъп надясно на редовете" + +#: gedit.xml:1075(para) +msgid "" +"Indents the selected lines, or removes the indentation from the selected " +"lines." +msgstr "" +"Прави отстъп на избраните редове или премахва отстъпа от избраните редове." + +#: gedit.xml:1078(para) gedit.xml:1168(para) +msgid "Insert Date/Time" +msgstr "Вмъкване на дата/време" + +#: gedit.xml:1079(para) +msgid "Inserts the current date and time into a file." +msgstr "Вмъква текущата дата и време във файла." + +#: gedit.xml:1082(para) gedit.xml:1173(para) +msgid "Shell command" +msgstr "Команда от шел" + +#: gedit.xml:1083(para) +msgid "Displays the text output of a shell command in the output window." +msgstr "" +"Показва текстовите изходни съобщения на команден ред в изходния прозорец." + +#: gedit.xml:1086(para) gedit.xml:1178(para) gedit.xml:1180(guimenuitem) +msgid "Sort" +msgstr "Подреждане" + +#: gedit.xml:1087(para) +msgid "Sorts the selected text." +msgstr "Сортира избрания текст." + +#: gedit.xml:1090(para) gedit.xml:1183(para) +msgid "Spell checker" +msgstr "Проверка на правописа" + +#: gedit.xml:1091(para) +msgid "" +"Checks the spelling in the selected text. You can configure " +"gedit to check the spelling automatically, or you " +"can check the spelling manually, in the specified language." +msgstr "" +"Проверява правописа на избрания текст. Може да настроите gedit да проверява правописа автоматично или може да го проверявате " +"ръчно." + +#: gedit.xml:1095(para) gedit.xml:1194(para) +msgid "Tag list" +msgstr "Списък с етикети" + +#: gedit.xml:1096(para) +msgid "" +"Displays a window that contains a list of common tags. You can use the " +"window to insert a tag into a file." +msgstr "" +"Показва прозорец, който съдържа списък с често срещани етикети. Може да " +"използвате прозореца, за да вмъквате етикети във файла." + +#: gedit.xml:1099(para) gedit.xml:1199(para) +msgid "User name" +msgstr "Име на потребител" + +#: gedit.xml:1100(para) +msgid "Inserts the username of the current user into the file." +msgstr "Вмъква потребителското име на текущия потребтел във файла." + +#: gedit.xml:1105(para) +msgid "" +"When you choose EditPreferences, the Plugins tabbed section " +"displays the following information:" +msgstr "" +"Когато изберете РедактиранеНастройки, раздела " +"Приставки показва следната информация." + +#: gedit.xml:1107(para) +msgid "A table that contains two columns:" +msgstr "Таблица, която съдържа две колони:" + +#: gedit.xml:1110(guilabel) +msgid "Enabled" +msgstr "Активен" + +#: gedit.xml:1112(para) +msgid "Displays check boxes that you select to load the plugins." +msgstr "" +"Показва полета за отметки, които може да включвате, за да зареждате " +"приставки." + +#: gedit.xml:1116(guilabel) +msgid "Plugin" +msgstr "Приставка" + +#: gedit.xml:1118(para) +msgid "" +"Displays a list of the plugins that you can use with gedit." +msgstr "" +"Показва списък с приставките, които може да използвате с gedit." + +#: gedit.xml:1123(para) +msgid "" +"An About Plugin button: use this button to display a " +"brief description of the selected plugin, including details about the author " +"of the plugin." +msgstr "" +"Бутон Относно приставката: използвайте този бутон, за " +"да се показва кратко описание на избраната приставка, включително информация " +"относно автора й." + +#: gedit.xml:1125(para) +msgid "" +"A Configure Plugin button: use this button to open a " +"configuration dialog for the selected plugin, if that plugin is " +"configurable. For example, see ." +msgstr "" +"Бутон Настройки на приставката: използвайте този " +"бутон, за да се отвори прозорец за настройките на избраната приставка, ако " +"тя може да се настройва. Например, вижте ." + +#: gedit.xml:1128(para) +msgid "" +"When you load a plugin, gedit adds the plugin to " +"the appropriate gedit menu, as described in the " +"following table." +msgstr "" +"Когато заредите приставка, gedit я добавя към " +"съответното меню, както е описано в следната таблица." + +#: gedit.xml:1136(para) +msgid "Added to Menu" +msgstr "Добавена в меню" + +#: gedit.xml:1142(guimenu) gedit.xml:1145(guimenu) gedit.xml:1148(guimenu) +#: gedit.xml:1151(guimenu) gedit.xml:1162(guimenu) gedit.xml:1164(guimenu) +#: gedit.xml:1169(guimenu) gedit.xml:1179(guimenu) gedit.xml:1200(guimenu) +#: gedit.xml:1271(guimenu) gedit.xml:1277(guimenu) gedit.xml:1283(guimenu) +#: gedit.xml:1289(guimenu) +msgid "Edit" +msgstr "Редактиране" + +#: gedit.xml:1143(guisubmenu) gedit.xml:1146(guisubmenu) +#: gedit.xml:1149(guisubmenu) gedit.xml:1152(guisubmenu) +#: gedit.xml:1272(guisubmenu) gedit.xml:1278(guisubmenu) +#: gedit.xml:1284(guisubmenu) gedit.xml:1290(guisubmenu) +msgid "Change Case" +msgstr "Смяна на регистъра" + +#: gedit.xml:1144(guimenuitem) gedit.xml:1272(guimenuitem) +msgid "All Upper Case" +msgstr "Само големи букви" + +#: gedit.xml:1147(guimenuitem) gedit.xml:1278(guimenuitem) +msgid "All Lower Case" +msgstr "Само малки букви" + +#: gedit.xml:1150(guimenuitem) gedit.xml:1284(guimenuitem) +msgid "Invert Case" +msgstr "Обръщане на регистъра" + +#: gedit.xml:1153(guimenuitem) gedit.xml:1290(guimenuitem) +msgid "Title Case" +msgstr "Капитализация като заглавие" + +#: gedit.xml:1157(guimenu) gedit.xml:1174(guimenu) gedit.xml:1185(guimenu) +#: gedit.xml:1187(guimenu) gedit.xml:1189(guimenu) +msgid "Tools" +msgstr "Инструменти" + +#: gedit.xml:1163(guimenuitem) +msgid "Indent" +msgstr "Отстъп надясно" + +#: gedit.xml:1165(guimenuitem) +msgid "Unindent" +msgstr "Отстъп наляво" + +#: gedit.xml:1170(guimenuitem) +msgid "Insert Date and Time" +msgstr "Вмъкване на дата и време" + +#: gedit.xml:1175(guimenuitem) +msgid "Run Command" +msgstr "Изпълняване на команда" + +#: gedit.xml:1186(guimenuitem) +msgid "Check Spelling" +msgstr "Проверка на правописа" + +#: gedit.xml:1188(guimenuitem) +msgid "Autocheck Spelling" +msgstr "Автоматична проверка на правописа" + +#: gedit.xml:1190(guimenuitem) +msgid "Set Language" +msgstr "Избор на език" + +#: gedit.xml:1196(guimenuitem) +msgid "Tag List" +msgstr "Списък с етикети" + +#: gedit.xml:1201(guimenuitem) +msgid "Insert User Name" +msgstr "Вмъкване на име на потребител" + +#: gedit.xml:1208(title) +msgid "To Load a gedit Plugin" +msgstr "Зареждане на приставка за gedit" + +#: gedit.xml:1209(para) +msgid "" +"To load a gedit plugin, perform the following " +"steps:" +msgstr "" +"За да заредите приставка на gedit, следвайте " +"следните стъпки:" + +#: gedit.xml:1212(para) gedit.xml:1233(para) gedit.xml:1370(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Изберете РедактиранеНастройки." + +#: gedit.xml:1215(para) gedit.xml:1236(para) gedit.xml:1373(para) +msgid "Select the Plugins tab." +msgstr "Изберете раздела Приставки." + +#: gedit.xml:1218(para) +msgid "" +"Select the check box next to the name of the plugin that you want to load." +msgstr "" +"Изберете полето за отметка до името на приставката, която искате да заредите." + +#: gedit.xml:1221(para) gedit.xml:1242(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Натиснете Затваряне, за да затворите прозореца " +"Настройки." + +#: gedit.xml:1228(title) +msgid "To Remove a gedit Plugin" +msgstr "Премахване на приставка за gedit" + +#: gedit.xml:1229(para) +msgid "A plugin remains loaded when you quit gedit." +msgstr "" +"Приставката остава заредена, когато затворите gedit." + +#: gedit.xml:1230(para) +msgid "" +"To remove a gedit plugin, perform the following " +"steps:" +msgstr "" +"За да премахнете приставка на gedit, следвайте " +"следните стъпки:" + +#: gedit.xml:1239(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"remove." +msgstr "" +"Махнете избора от полето за отметка до името на приставката, която искате да " +"премахнете." + +#: gedit.xml:1248(title) +msgid "To Use the ChangeCase Plugin" +msgstr "Използване на приставката за промяна на регистъра" + +#: gedit.xml:1249(para) +msgid "" +"The ChangeCase plugin changes the case of the selected text. To use the " +"ChangeCase plugin, perform the following steps:" +msgstr "" +"Приставката за смяна на регистъра на избрания текст, сменя регистъра на " +"избрания текст. За да я използвате, следвайте следните стъпки:" + +#: gedit.xml:1251(para) +msgid "Load the ChangeCase plugin." +msgstr "Зареждане на приставката за смяна на регистъра" + +#: gedit.xml:1253(para) +msgid "Choose one of the following menu items:" +msgstr "Изберете един от следните елементи на меню:" + +#: gedit.xml:1262(para) +msgid "Menu Item" +msgstr "Елемент от меню" + +#: gedit.xml:1266(para) +msgid "Example" +msgstr "Пример" + +#: gedit.xml:1273(para) +msgid "Change each character to uppercase." +msgstr "Променяне на всеки символ към горен регистър." + +#: gedit.xml:1274(para) +msgid "This text becomes THIS TEXT" +msgstr "Този текст става ТОЗИ ТЕКСТ." + +#: gedit.xml:1279(para) +msgid "Change each character to lowercase." +msgstr "Променяне на всички символи към долен регистър." + +#: gedit.xml:1280(para) +msgid "This Text becomes this text" +msgstr "Този Текст става този текст." + +#: gedit.xml:1285(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" +"Променя всеки символ в долен регистър към горен и променя всеки символ в " +"горен регистър към долен." + +#: gedit.xml:1286(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" +"Този Текст се превръща в тОЗИ тЕКСТ." + +#: gedit.xml:1291(para) +msgid "Change the first character of each word to uppercase." +msgstr "Променя първия символ на всяка дума да бъде в горен регистър." + +#: gedit.xml:1292(para) +msgid "this text becomes This Text" +msgstr "този текст става Този Текст." + +#: gedit.xml:1302(title) +msgid "To Use the Document Statistics Plugin" +msgstr "Използване на приставката за статистика за документа" + +#: gedit.xml:1303(para) +msgid "" +"The Document Statistics plugin counts the number of lines, words, characters " +"with spaces, characters without spaces, and bytes in the current file. The " +"plugin displays the results in a Document Statistics " +"dialog. To use the Document Statistics plugin, perform the following steps:" +msgstr "" +"Приставката за статистика за документа брои броя редове, думи, символи " +"заедно с интервалите, символи без интервалите и байтове в текущия файл. " +"Приставката показва резултатите в прозореца Статистика за " +"документа. За да използвате тази приставка, следвайте следните " +"стъпки:" + +#: gedit.xml:1305(para) +msgid "Load the Document Statistics plugin." +msgstr "Зареждане на приставката за статистика за документ" + +#: gedit.xml:1307(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Изберете ИнструментиСтатистика " +"за документа, за да се появи прозореца на " +"приставката. Той показва следната информация за файла:" + +#: gedit.xml:1310(para) +msgid "Number of lines in the current document." +msgstr "Брой редове в текущия документ" + +#: gedit.xml:1313(para) +msgid "Number of words in the current document." +msgstr "Брой думи в текущия документ" + +#: gedit.xml:1316(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Брой символи, включително интервали, в текущия документ" + +#: gedit.xml:1319(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Брой символи, без интервалите, в текущия документ" + +#: gedit.xml:1322(para) +msgid "Number of bytes in the current document." +msgstr "Брой байта в текущия документ" + +#: gedit.xml:1327(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Може да продължите да обновявате файла на gedit, " +"докато прозореца на Статистика за документа е отворен. " +"За да обновите съдържанието на прозореца, натиснете Подновяване." + +#: gedit.xml:1330(para) +msgid "" +"To close the Document Statistics dialog, click " +"Close." +msgstr "" +"За да затворите прозореца Статистика за документа, " +"натиснете бутона Затваряне." + +#: gedit.xml:1337(title) +msgid "To Use the Indent Lines Plugin" +msgstr "Използване на приставката за отстъп" + +#: gedit.xml:1338(para) +msgid "" +"The Indent lines plugin indents the selected lines, or removes the " +"indentation from the selected lines. To use the Indent lines plugin, perform " +"the following steps:" +msgstr "" +"Приставката за отстъпи, прави отстъпите на избраните редове или премахва " +"отстъпите от избраните редове. За да използвате тази приставка, следвайте " +"следните стъпки:" + +#: gedit.xml:1340(para) +msgid "Load the Indent lines plugin." +msgstr "Зареждане на приставката за отстъп" + +#: gedit.xml:1342(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Изберете редовете, които искате да имат отстъп. За да изберете един ред, " +"поставете курсора където и да е на този ред." + +#: gedit.xml:1345(para) +msgid "" +"Choose EditIndent." +msgstr "" +"Изберете РедактиранеОтстъп " +"надясно." + +#: gedit.xml:1347(para) +msgid "" +"To remove the indentation, select the lines and choose " +"EditUnindent." +msgstr "" +"За да премахнете отстъпа, изберете редовете и след това Изберете " +"РедактиранеОтстъп наляво." + +#: gedit.xml:1354(title) +msgid "To Use the Insert Date/Time Plugin" +msgstr "Използване на приставката за вмъкване на дата/време" + +#: gedit.xml:1355(para) +msgid "" +"The Insert Date/Time plugin inserts the current date and time into a file. " +"To use the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"Приставката за вмъкване на дата/време вмъква датата и времето във файл. За " +"да използвате тази приставка, следвайте следните действия:" + +#: gedit.xml:1357(para) +msgid "Load the Insert Date/Time plugin." +msgstr "Зареждане на приставката за вмъкване на дата/време" + +#: gedit.xml:1359(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Изберете РедактиранеВмъкване на " +"дата и време." + +#: gedit.xml:1360(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Ако не сте настроили приставката за вмъкване на дата и време автоматично да " +"вмъква датата ивремето без да ви пита за формата, gedit показва прозореца за Вмъкване на дата и време. Изберете подходящия формат на датата/времето. Натиснете " +"Вмъкване, за да затворите прозореца. " +"gedit вмъква датата и времето при позицията на " +"курсора в текущия файл." + +#: gedit.xml:1361(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Ако сте настроили gedit да използва един формат " +"за дата и време, прозорецът не се показва. Датата и времето се вмъкват " +"автоматично при позицията на курсора в текущия файл." + +#: gedit.xml:1362(para) +msgid "" +"See for information about how " +"to configure the Insert Date/Time plugin." +msgstr "" +"Вижте за информация относно " +"как да се настрои приставката за вмъкване на датата и времето." + +#: gedit.xml:1367(title) +msgid "To Configure the Insert Date/Time Plugin" +msgstr "Настройване на приставката за вмъкване на дата/време" + +#: gedit.xml:1368(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"За да настроите приставката за вмъкване на датата/времето, следвайте " +"следните стъпки:" + +#: gedit.xml:1376(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Изберете приставката Вмъкване на дата/време" + +#: gedit.xml:1379(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Натиснете бутона Настройки на приставка, за да се " +"появи прозореца за настройване на приставката за вмъкване на дата/време." + +#: gedit.xml:1382(para) +msgid "Select one of the options, as follows:" +msgstr "Изберете една от следните опции:" + +#: gedit.xml:1384(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"За да се определя формата на датата/времето всеки път, когато се вмъква, " +"изберете опцията Посочване на формат." + +#: gedit.xml:1387(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"За да се използва същия предоставен от gedit " +"формат всеки път, когато се вмъква дата/време, изберете опцията " +"Използване на избрания формат. После изберете подходящи " +"формат от списъка. Когато изберете тази опция, gedit не Ви пита за формата, когато изберете " +"РедактиранеВмъкване на дата/" +"време." + +#: gedit.xml:1390(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"За да използвате все същия личен формат на датата/времето, всеки път, когато " +"вмъквате дата/време, изберете опцията Use custom format " +"и после въведете подходящия формат в полето. За повече информация относно " +"как се определея личен формат, вижте strftime3. Когато изберете тази опция, " +"gedit няма да Ви пита за формат, всеки път, " +"когато избирате РедактиранеВмъкване на дата/време." + +#: gedit.xml:1395(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Натиснете Добре, за да затворите прозореца за " +"Настройване на приставката за вмъкване на дата и време." + +#: gedit.xml:1398(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"За да затворите прозореца Настройки, натиснете " +"Затваряне." + +#: gedit.xml:1405(title) +msgid "To Use the Shell Command Plugin" +msgstr "Използване на приставката за команди за шел" + +#: gedit.xml:1407(para) +msgid "" +"The Shell Command plugin enables you to capture the output from a shell " +"command in gedit, by displaying the text output " +"of the shell command in the output window. To use the Shell command plugin, " +"perform the following steps:" +msgstr "" +"Приставката за команден ред (shell) Ви позволява да прихващате изхода от " +"терминална програма в gedit, като показва " +"изходните съобщения от командния ред в изходния прозорец. За да използвате " +"приставката, следвайте следните стъпки:" + +#: gedit.xml:1409(para) +msgid "Load the Shell command plugin." +msgstr "Зареждане на приставката за шел команда" + +#: gedit.xml:1412(para) +msgid "" +"Choose ToolsRun Command to display the Run Command " +"dialog." +msgstr "" +"Изберете ИнструментиИзпълняване " +"на команда, за да се появи прозорецът " +"Изпълняване на команда." + +#: gedit.xml:1415(para) +msgid "" +"Type the shell command that you want to execute in the Command field." +msgstr "" +"Въведете командата, която искате да изпълните, в полето Команда." + +#: gedit.xml:1416(para) +msgid "You can include the following special characters:" +msgstr "Може да включите следните специални символи:" + +#: gedit.xml:1419(literal) +msgid "%f" +msgstr "%f" + +#: gedit.xml:1420(para) +msgid "" +"Use these special characters to specify the filename of the current active " +"document, including the path." +msgstr "" +"Използвайте тези специални символи, за да определите файловото име на " +"текущия активен документ, включително пътя." + +#: gedit.xml:1423(literal) +msgid "%n" +msgstr "%n" + +#: gedit.xml:1424(para) +msgid "" +"Use these special characters to specify the filename of the current active " +"document, without the path. In this case, gedit " +"looks for the file in the Working directory." +msgstr "" +"Използвайте тези специални символи, за да определите файловото име на " +"текущия активен документ, без пътя. В този случай, gedit търси за файла в текущата работна папка." + +#: gedit.xml:1428(para) +msgid "" +"Edit the Working directory field if necessary. By " +"default, the Shell command plugin executes the command you specify in the " +"current directory." +msgstr "" +"Редактирайте, ако е нужно полето Работна папка. По " +"подразбиране, приставката изпълнява командата, която въведете, в текущата " +"папка." + +#: gedit.xml:1430(para) +msgid "" +"Select the Show results in Output Window option to " +"display the results of the command in the output window. If you do not " +"select this option, gedit discards the results of " +"the command." +msgstr "" +"Изберете опцията Показване на изходните резултати в прозорец, за да се покажат изходните ъобщения от командата в изходния " +"прозорец. Ако не изберете тази опция, gedit не " +"показва резултатите от командата." + +#: gedit.xml:1433(para) +msgid "" +"Click Run. The Shell command plugin executes the " +"command and inserts the text output into the output window." +msgstr "" +"Натиснете Стартиране. Приставката изпълнява командата " +"и вмъква изходните съобщения в изходния прозорец." + +#: gedit.xml:1436(para) +msgid "" +"Use the Shift key to select the text in the output window." +msgstr "" +"Използвайте клавиша Shift, за да изберете текста в изходния " +"прозорец." + +#: gedit.xml:1438(para) +msgid "" +"Click Copy selected lines to copy the selected text " +"into the buffer." +msgstr "" +"Натиснете Копиране на избраните редове, за да " +"копирате избрания текст във временната памет." + +#: gedit.xml:1441(para) +msgid "" +"Choose EditPaste to paste the selected text into the file." +msgstr "" +"Изберете РедактиранеПоставяне, за да поставите избрания текст във файла." + +#: gedit.xml:1444(para) +msgid "" +"Click Close the output window to close the output " +"window." +msgstr "" +"Натиснете Затваряне на изходния прозорец, за да " +"затворите изходния прозорец." + +#: gedit.xml:1451(title) +msgid "To Use the Sort Plugin" +msgstr "Използване на приставката за сортиране" + +#: gedit.xml:1452(para) +msgid "The Sort plugin sorts the selected text." +msgstr "Приставката за сортиране подрежда избрания текст." + +#: gedit.xml:1453(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Не може да върнете действието от операцията по сортиране, така че трябва да " +"запазите файла преди да извършвате сортиране. За да върнете запазената " +"версия на файла, след такава операция, изберете ФайлВъзстановяване." + +#: gedit.xml:1456(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "" +"За да използвате приставката за сортиране, следвайте следните действия:" + +#: gedit.xml:1458(para) +msgid "Load the Sort plugin." +msgstr "Заредете приставката за сортиране." + +#: gedit.xml:1460(para) +msgid "" +"Choose EditSort to display the Sort dialog." +msgstr "" +"Изберете РедактиранеПодреждане, за да се покаже прозорецът за " +"Подреждане." + +#: gedit.xml:1463(para) +msgid "" +"To arrange the text in reverse sort order, select the Reverse " +"order option." +msgstr "" +"За да подредите текста в обратен ред, изберете опцията Обратен " +"ред." + +#: gedit.xml:1466(para) +msgid "" +"To delete duplicate lines, select the Remove duplicates " +"option." +msgstr "" +"За да премахнете дублиращите се редове, изберете опцията guilabel>Премахване " +"на повтарящите се." + +#: gedit.xml:1469(para) +msgid "" +"To ignore case sensitivity, select the Ignore case " +"option." +msgstr "" +"За да не се взима предвид регистъра на текста, изберете опцията " +"Игнориране на малки/големи." + +#: gedit.xml:1472(para) +msgid "" +"To specify the start position of the sort, use the Start at " +"column spin box." +msgstr "" +"За да определите стартовата позиция на подреждането, използвайте полето " +"Започване от колона." + +#: gedit.xml:1475(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"За да се извърши операцията по сортирането, натиснете Подреждане." + +#: gedit.xml:1482(title) +msgid "To Use the Spell Checker Plugin" +msgstr "Използване на приставката за проверка на правописа" + +#: gedit.xml:1483(para) +msgid "" +"The Spell checker plugin checks the spelling in the selected text. You can " +"configure gedit to check the spelling " +"automatically, or you can check the spelling manually, in the specified " +"language. The language setting, and the autocheck spelling properties, apply " +"per document. To use the Spell checker plugin, perform the following steps:" +msgstr "" +"Приставката за проверка на правописа, проверява правописа на избрания текст. " +"Може да настроите gedit автоматично да проверява " +"правописа или Вие да го правите ръчно. Настройката на езика и на " +"автоматичната проверка се прилагат само за отделния документ. За да " +"използвате тази приставка, следвайте следните действия:" + +#: gedit.xml:1485(para) +msgid "Load the Spell checker plugin." +msgstr "Заредете приставката за проверка на правописа." + +#: gedit.xml:1487(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Изберете ИнструментиИзбор на " +"език, за да се появи прозорецът за " +"Избор на език. Изберете подходящия език от списъка. " +"Натиснете Добре, за да затворите прозореца." + +#: gedit.xml:1490(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"За да проверявате правописа автоматично, изберете " +"ИнструментиАвтоматична проверка " +"на правописа. За да махнете автоматичната " +"проверка, изберете отново същото меню. Когато автоматичната проверка е " +"включена, до този елемент в менюто се появява икона. Автоматичната проверка " +"на правописа не е включена по подразбиране, всеки път, когато " +"gedit се стартира." + +#: gedit.xml:1491(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Непознатия правопис се показва в различен цвят и е подчертан. Натиснете с " +"дясното копче върху такава дума и после изберете от появилото се меню " +"Предложения за правопис:" + +#: gedit.xml:1494(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"За да замените непознатия правопис с друг от списъка го изберете от списъка " +"на изскачащото меню за предложения." + +#: gedit.xml:1497(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"За да добавите непознат правопис към личния си речник, изберете " +"Предложения за правописДобавяне." + +#: gedit.xml:1500(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"За да игнорирате всички съвпадения на даден непознат правопис, така че вече " +"да не бъде маркиран като непознат, но и да не бъде добавян в личния речник, " +"изберете Предложения за правописИгнориране ан всички. " +"Непознатата дума се игнорира само за текущата сесия на gedit." + +#: gedit.xml:1505(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"За да проверявате ръчно правописа, избирайте " +"ИнструментиПроверка на " +"правописа." + +#: gedit.xml:1507(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Ако няма грешки в правописа, се появява информационен прозорец, който " +"показва съобщение относнотова, че документа не съдържа сгрешени думи. " +"Натиснете Добре, за да затворите този прозорец." + +#: gedit.xml:1509(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Ако има грешки в правописа, се появява прозорецът за Проверка на " +"правописа:" + +#: gedit.xml:1512(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "Сгрешената дума се показва най-горе в прозореца." + +#: gedit.xml:1515(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Показва се и предложение за познат правопис в полето Замяна с. Може да замените това с друг познат правопис, като изберете " +"правопис от списъка с Предложения или можете да " +"въведете директно текст в полето Замяна с." + +#: gedit.xml:1518(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"За да проверите правописа на текста в полето Замяна с, " +"натиснете Проверка на дума. Ако това е позната дума, " +"списъкът с Предложения се заменя с текста " +"(няма правописни грешки). Ако думата е непозната се появяват нови " +"записи в списъка за Предложения." + +#: gedit.xml:1521(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"За да игнорирате текущата непозната дума, натиснете Игнориране. За да игнорирате всички нейни съвпадения, натиснете " +"Игнориране на всички. Непозната дума се игнорира за " +"текущата сесия на gedit." + +#: gedit.xml:1524(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"За да промените срещането на непознатата дума в текста с полето " +"Замяна с, натиснете Заменяне. За " +"да промените всички повторения на непозната дума в текста, натиснете " +"Замяна на всички." + +#: gedit.xml:1527(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"За да добавите непознатата дума към личния си речник, натиснете " +"Добавяне на дума." + +#: gedit.xml:1530(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"За да затворите прозореца Проверка на правописа, " +"натиснете Затваряне." + +#: gedit.xml:1539(title) +msgid "To Use the Tag List Plugin" +msgstr "Използване на приставката за списък с етикети" + +#: gedit.xml:1540(para) +msgid "" +"The Tag List plugin displays a window that contains a list of common tags. " +"You can use the window to insert a tag into a file. To use the Tag List " +"plugin, perform the following steps:" +msgstr "" +"Приставката за списък с етикети показа прозорец, който съдържа списък с " +"често срещани етикети. Може да използвате прозореца да вмъквате етикети във " +"файл. За да използвате тази приставка, следвайте следните стъпки:" + +#: gedit.xml:1542(para) +msgid "Load the Tag List plugin." +msgstr "Заредете приставката за списък с етикети." + +#: gedit.xml:1544(para) +msgid "" +"Choose ViewTag List to display the Tag list plugin window." +msgstr "" +"Изберете ИзгледСписък с етикети, за да се появи прозоецът на приставката." + +#: gedit.xml:1547(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Изберете правилната категория от падащия списък. Например HTML - " +"Тагове." + +#: gedit.xml:1550(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Прелистете през списъка с сетикети, за да откриете търсения от Вас." + +#: gedit.xml:1553(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"За да вмъкнете етикет при позицията на курсора в текущия файл, натиснете два " +"пъти върху етикета в списъка. Може също така да вмъквате етикети по следния " +"начин:" + +#: gedit.xml:1555(para) +msgid "" +"To insert a tag in the current file and change the focus from the " +"Tag list plugin window to the editor window, press " +"Return." +msgstr "" +"За да вмъкнете етикет в текущия файл и да промените фокуса от " +"Приставката списък с етикети към редактора, натиснете " +"Enter." + +#: gedit.xml:1558(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"За да вмъкнете етикет в текущия файл и да поддържате фокуса върху прозореца " +"на приставката, натиснете ShiftEnter." + +#: gedit.xml:1563(para) +msgid "" +"To close the Tag list plugin window, click on the " +"Close Window button in the window frame. " +"Alternatively, press CtrlW when the focus is on the Tag list plugin " +"window." +msgstr "" +"За да затворите прозореца на списъка с етикети, натиснете бутона за " +"Затваряне на прозорец на рамката на прозореца. Също " +"така можете и да натиснете CtrlW, когато прозорецът на приставката е фокусиран." + +#: gedit.xml:1570(title) +msgid "To Use the User Name Plugin" +msgstr "Използвате на приставката за име на потребител" + +#: gedit.xml:1571(para) +msgid "" +"The User name plugin inserts the username of the current user into the file. " +"To use the User name plugin, perform the following steps:" +msgstr "" +"Приставката за потребителско име вмъква името на потребителя на текущия " +"потребител в текстовия файл. За да използвате приставката, следвайте " +"следните стъпки:" + +#: gedit.xml:1573(para) +msgid "Load the User name plugin." +msgstr "Заредете приставката за име на потребител." + +#: gedit.xml:1575(para) +msgid "" +"Choose EditInsert User Name to insert your username at the cursor position in " +"the current file." +msgstr "" +"Изберете РедактиранеВмъкване на " +"потребителско име, за да поставите Вашето " +"потребителско име при позицията на курсора във файла." + +#: gedit-C.omf:4(creator) gedit-C.omf:7(maintainer) +msgid "gdocteam@sun.com (Sun Java Desktop System Documentation Team)" +msgstr "gdocteam@sun.com (Екипът за документацията на Java Desktop System)" + +#: gedit-C.omf:13(date) +msgid "2004-08-24" +msgstr "2004-08-24" + +#: gedit-C.omf:21(type) +msgid "user's guide" +msgstr "потребителско ръководство" + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: gedit-C.omf:0(None) +msgid "translator-credits" +msgstr "Ростислав \"zbrox\" Райков , 2005" diff --git a/help/bg/figures/gedit_window.png b/help/bg/figures/gedit_window.png new file mode 100755 index 00000000..98b96c75 Binary files /dev/null and b/help/bg/figures/gedit_window.png differ diff --git a/help/ca/ca.po b/help/ca/ca.po new file mode 100755 index 00000000..6fb518ae --- /dev/null +++ b/help/ca/ca.po @@ -0,0 +1,4698 @@ +# Traducció del gedit de l'equip de Softcatalà. +# Copyright © 2009 Free Software Foundation, Inc. +# Joan Duran , 2009. +# +# Carles Ferrando Garcia , 2010. +msgid "" +msgstr "" +"Project-Id-Version: gedit\n" +"POT-Creation-Date: 2010-06-20 20:10+0000\n" +"PO-Revision-Date: 2010-04-22 16:14+0200\n" +"Last-Translator: Carles Ferrando Garcia \n" +"Language-Team: catalan \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 link 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 enllaç o en el fitxer COPYING-DOCS distribuït " +"amb aquest 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 "" +"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/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 "" +"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/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 " +"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 "" +"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 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/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: " +"" +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: " +"" + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Manual del gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Projecte de documentació del MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "S'ha afegit la taula de dreceres de teclat" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Equip de documentació de Sun Java Desktop System" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "" +"En Cicek ha proporcionat informació de les primeres revisions de l'aplicació " +"gedit." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Reconeixements" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "En George ha proporcionat informació sobre els connectors." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "Gedit v1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Manual del gedit v2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Març de 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Equip de documentació del MATE de Sun" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Manual del gedit v2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Juny de 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Manual del gedit v2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Agost de 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Manual del gedit v2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Setembre de 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Manual del gedit v2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Gener de 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Manual del gedit v2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Març de 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Manual del gedit v2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Setembre de 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Manual del gedit v2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Març de 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Manual del gedit v2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Juliol de 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Manual del gedit v2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "Projecte de documentació del MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Aquest manual descriu la versió 2.16 del gedit." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Comentaris" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Per a informar d'un error o fer algun suggeriment sobre l'aplicació " +"gedit o aquest manual, seguiu les indicacions a " +"la pàgina de " +"comentaris del MATE." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"El gedit és un editor de text per a l'escriptori del MATE amb " +"característiques bàsiques però robustes com ara la impressió, la comprovació " +"ortogràfica, la cerca i reemplaçament, i el ressaltat sintàctic. També hi ha " +"disponibles funcions més avançades en forma de connectors." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "editor de text" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Introducció" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"L'aplicació gedit us permet crear i editar " +"fitxers de text." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"L'objectiu del gedit és ser un editor text " +"senzill i fàcil d'utilitzar. Les funcions més potents es poden habilitar amb " +"diferents connectors, permetent una varietat de " +"tasques relacionades amb l'edició de text." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Primers passos" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Com iniciar el gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"Podeu iniciar el gedit de les maneres següents:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Menú Aplicacions" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Trieu AccessorisEditor de " +"text." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Línia d'ordres" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Executeu l'ordre següent: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Per defecte, quan obriu un document de text amb el gestor de fitxers, el " +"gedit s'iniciarà i mostrarà el document." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "La finestra del gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Quan inicieu el gedit, es mostrarà la finestra " +"següent:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Finestra del gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Mostra la finestra principal del gedit." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"La finestra del gedit conté els elements següents:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Barra de menú" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Els menús a la barra de menú contenen totes les ordres que necessiteu per a " +"treballar amb fitxers al gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Barra d'eines" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"La barra d'eines conté un subconjunt d'ordres a les quals podeu accedir des " +"de la barra de menú." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Àrea de visualització" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "L'àrea de visualització conté el text del fitxer que esteu editant." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Barra d'estat" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"La barra d'estat mostra la informació sobre l'activitat actual del " +"gedit i la informació contextual sobre els " +"elements del menú. La barra d'estat també mostra la informació següent:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Posició del cursor: el número de línia i el número de columna on està ubicat " +"el cursor." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Mode d'edició: si l'editor està en mode d'inserció, la barra d'estat conté " +"el text INSER. Si l'editor està en mode de " +"sobreescriptura, la barra d'estat conté el text SOBR. " +"Premeu la tecla d'Inserció per a canviar el mode d'edició." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Subfinestra lateral" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"La subfinestra lateral mostra una llista dels documents oberts i altra " +"informació depenent de quins connectors s'hagin habilitat." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Per defecte la subfinestra lateral no es mostra. Per a mostrar-la, trieu " +"VisualitzaSubfinestra lateral." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Subfinestra inferior" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"La subfinestra inferior s'utilitza per a eines de programació com ara el " +"connector Consola Python per a mostrar missatges." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Per defecte la subfinestra inferior no es mostra. Per a mostrar-la, trieu " +"VisualitzaSubfinestra inferior." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Quan feu clic amb el botó secundari a la finestra del gedit, l'aplicació mostrarà un menú emergent. El menú emergent conté " +"les ordres d'edició més habituals." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"De la mateixa manera que en altres aplicacions del MATE, les accions del " +"gedit es poden realitzar de diferents maneres: " +"amb el menú, amb la barra d'eines o amb les dreceres de teclat. Les dreceres " +"de teclat habituals a totes les aplicacions són llistades a la Guia d'usuari." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Com executar el gedit des d'una línia d'ordres" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Podeu executar el gedit des d'una línia d'ordres " +"i obrir un fitxer o diversos fitxers. Per a obrir diversos fitxers des d'una " +"línia d'ordres, introduïu l'ordre següent i premeu Retorn:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "fitxer1.txt fitxer2.txt fitxer3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Alternativament, podeu especificar un URI enlloc d'un nom de fitxer." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Per a obtenir més informació sobre com executar el gedit des d'una línia d'ordres, vegeu la pàgina del manual UNIX del " +"gedit, gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Com treballar amb fitxers" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Com crear un document nou" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Per a crear un document nou, trieu FitxerNou. L'aplicació mostrarà un " +"document en blanc nou a la finestra del gedit." + +#: C/gedit.xml:346(title) C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "Com obrir un fitxer" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Per a obrir un fitxer, trieu FitxerObre per a mostrar el diàleg " +"Obertura de fitxers. Seleccioneu el fitxer que voleu " +"obrir i feu clic a Obre. El fitxer es mostrarà a la " +"finestra del gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Mostra la icona del menú dels fitxers recents." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"L'aplicació enregistra els camins i noms de fitxer dels cinc fitxers més " +"recents que heu editat i mostra els fitxers com a elements del menú al menú " +"Fitxer. També podeu fer clic a " +"la icona a la barra d'eines per a mostrar la llista de " +"fitxers recents." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"Podeu obrir múltiples fitxers al gedit. " +"L'aplicació afegeix una pestanya a la finestra per a cada fitxer obert. Per " +"a obtenir més informació vegeu la ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Com desar un fitxer" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Podeu desar fitxers de les maneres següents:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Per a desar els canvis d'un fitxer existent, trieu " +"FitxerDesa." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Per a desar un fitxer nou o per a desar un fitxer existent sota un nom de " +"fitxer nou, trieu FitxerAnomena " +"i desa. Introduïu un nom per al fitxer al diàleg " +"Anomena i desa i feu clic a Desa." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Per a desar tots els fitxers que hi ha actualment oberts al " +"gedit, trieu DocumentsDesa-ho tot." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Per a tancar tots els fitxers que hi ha actualment oberts al " +"gedit, trieu DocumentsTanca-ho tot." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Com obrir un fitxer des d'un URI" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Per a obrir un fitxer des d'un identificador de recursos uniforme (URI), " +"realitzeu els passos següents:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Trieu FitxerObre una ubicació per a mostrar el diàleg Obre la " +"ubicació." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Introduïu l'URI del fitxer que voleu obrir." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Utilitzeu la llista desplegable Codificació de caràcters per a seleccionar la codificació de caràcters apropiada." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Feu clic a Obre." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Els tipus d'URI vàlids inclouen http:, ftp:, file: i tots els " +"mètodes admesos pel mate-vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Els fitxers d'alguns tipus d'URI s'obren com a només lectura i els canvis " +"que realitzeu s'han de desar a una ubicació diferent. L'HTTP només permet la " +"lectura dels fitxers. Els fitxers oberts des d'un FTP són de només lectura " +"perquè no tots els servidors FTP treballen correctament amb el desament " +"remot de fitxers." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Es pot habilitar el desament a servidors FTP amb l'editor de configuració, en establir la clau /apps/gedit-2/preferences/editor/" +"save/writable_vfs_schemes, però això pot causar errors." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Com treballar amb pestanyes" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Quan s'ha obert més d'un fitxer, el gedit mostra " +"una pestanya per a cada document sobre l'àrea de " +"visualització. Per a canviar a un altre document, feu clic a la seva " +"pestanya." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Per a moure un document a una altra finestra del gedit, arrossegueu la pestanya corresponent a la finestra on voleu " +"moure'l." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Per a moure un document a una finestra nova del gedit, podeu arrossegar la pestanya a l'escriptori o triar " +"DocumentsMou a una nova " +"finestra." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Com treballar amb text" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Com editar un text" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Podeu editar el text d'un fitxer de les maneres següents:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Introduïu el text nou des del teclat. El cursor d'inserció parpellejant marca el punt on apareix el text nou. Per a canviar-" +"ho, utilitzeu les tecles de cursor del teclat o feu clic amb el ratolí." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Per a copiar el text seleccionat al porta-retalls, trieu " +"EditaCopia." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Per a suprimir el text seleccionat del fitxer i moure el text seleccionat al " +"porta-retalls, trieu EditaRetalla." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Per a suprimir permanentment el text seleccionat del fitxer, trieu " +"EditaSuprimeix." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Per a inserir els continguts del porta-retalls a la posició del cursor, " +"trieu EditaEnganxa. Heu de retallar o copiar text abans de poder " +"enganxar-lo al fitxer, ja sigui des del gedit o una altra aplicació." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Per a seleccionar tot el text d'un fitxer, trieu EditaSelecciona-ho tot." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Com desfer i refer els canvis" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Per a desfer un canvi que heu fet, trieu EditaDesfés. Per a refer aquesta " +"acció, trieu EditaRefés." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Com cercar i reemplaçar" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"Al gedit hi ha dues maneres de cercar text. Podeu " +"utilitzar el diàleg Cerca per a cercar un fragment " +"específic de text o la Cerca incremental per a " +"ressaltar el text coincident mentre l'introduïu." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Com trobar un text" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "" +"Per a cercar una cadena de text d'un fitxer, realitzeu els passos següents:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Trieu CercaCerca per a mostrar el diàleg de Cerca." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Introduïu la cadena que voleu trobar al camp Cerca. " +"Podeu incloure caràcters especials com ara una línia nova o una tabulació. " +"Vegeu la ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Feu clic a Cerca per a cercar la primera ocurrència " +"de la cadena en el fitxer després de la posició actual del cursor. Si el " +"gedit troba la cadena, l'aplicació en " +"seleccionarà la primera ocurrència. Les altres ocurrències de la cadena es " +"ressaltaran." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Per a trobar l'ocurrència següent de la cadena, feu clic a Cerca o trieu CercaCerca el " +"següent. Per a trobar l'ocurrència anterior del " +"text, trieu CercaCerca " +"l'anterior." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Després que hàgiu tancat el diàleg Cerca, encara podeu " +"moure la selecció a altres ocurrències de text en seleccionar " +"CercaCerca el següent i CercaCerca l'anterior." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Per a suprimir el ressaltat del text, trieu CercaNeteja el ressaltat." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Cerca incremental" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"La cerca incremental ressalta el text coincident al document mentre " +"l'escriviu lletra per lletra (això és semblant a la funció de cerca de " +"diversos navegadors web)." + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Per a iniciar la cerca incremental, trieu CercaCerca incremental. El quadre " +"de cerca apareixerà a la part superior de l'àrea de visualització." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Comenceu a escriure i el text que coincideixi es ressaltarà al document. La " +"primera instància després de la posició del cursor se seleccionarà." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Per a avançar la selecció a la coincidència següent mentre manteniu el " +"quadre de cerca incremental obert, premeu CtrlG. Premeu CtrlMajG per a tornar a la " +"coincidència anterior." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"També podeu utilitzar les tecles de cursor amunt i avall o la roda del " +"ratolí per a moure la selecció entre coincidències." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Com reemplaçar un text" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Per a cercar una cadena a un fitxer i reemplaçar la cadena amb una cadena " +"alternativa, realitzeu els passos següents:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Trieu CercaReemplaça per a mostrar el diàleg Reemplaça." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Introduïu la cadena que voleu trobar al camp Cerca. " +"Podeu incloure caràcters especials com ara una línia nova o una tabulació. " +"Vegeu la ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Introduïu al camp Reemplaça per la cadena que vulgueu " +"utilitzar per a reemplaçar la cadena cercada." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Per a examinar cada ocurrència de la cadena abans de reemplaçar-la, feu clic " +"a Cerca. Si el gedit troba " +"la cadena, l'aplicació la seleccionarà. Feu clic a Reemplaça per a reemplaçar l'ocurrència de la cadena seleccionada. Per a " +"trobar l'ocurrència següent de la cadena, feu clic un altre cop a " +"Cerca." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Per a reemplaçar totes les ocurrències de la cadena del document, feu clic a " +"Reemplaça-ho tot." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Opcions de cerca i reemplaçament" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"El diàleg de Cerca i el diàleg Reemplaça tenen les opcions següents:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Seleccioneu l'opció Coincidència de majúscules i minúscules per a només trobar ocurrències de la cadena que coincideixen en " +"majúscules i minúscules amb el text que heu introduït. Per exemple, amb " +"Coincidència de majúscules i minúscules seleccionat, " +"«TEXT» no coincideix amb «text»." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Seleccioneu l'opció Només coincideix la paraula sencera " +"per a només trobar ocurrències de la cadena que coincideixen amb tota la " +"paraula del text que heu introduït. Per exemple, amb Només " +"coincideix la paraula sencera seleccionat, «text» no coincideix " +"amb «textura»." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Seleccioneu l'opció Cerca cap enrere per a cercar " +"enrere cap a l'inici del document." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Seleccioneu l'opció Continua des de l'inici per a " +"cercar fins al final del document i llavors continuar la cerca des de " +"l'inici del document." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Caràcters especials" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"Podeu incloure les seqüències d'escapada següents al text per a representar " +"caràcters especials per a cercar o reemplaçar:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Especifica una línia nova." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Especifica un caràcter de tabulació." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Especifica un caràcter de retorn." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"El caràcter de barra inversa s'ha d'escapar si s'està cercant. Per exemple, " +"si esteu cercant el literal «\\n», heu d'introduir «\\\\n» " +"al camp Cerca. O si esteu cercant una seqüència de " +"barres inverses, heu de doblar el nombre de barres inverses que cerqueu." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Com posicionar el cursor a una línia específica" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Per a posicionar del cursor a una línia específica al fitxer actual, trieu " +"CercaVés a la línia. Apareixerà el quadre de número de línia a la part " +"superior de l'àrea de visualització." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Comenceu a introduir el número de línia on voleu moure el cursor i el " +"document es desplaçarà a la línia especificada." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Per a tancar el quadre i moure el cursor a la línia especificada, premeu " +"Retorn." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Impressió" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Com establir les opcions de la pàgina" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Per a establir les opcions de la pàgina, trieu FitxerConfiguració de la pàgina " +"per a mostrar el diàleg Configuració de la pàgina." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"El diàleg Configuració de la pàgina us permet " +"especificar les opcions d'impressió següents:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Pestanya general" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Imprimeix el ressaltat de la sintaxi" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Seleccioneu aquesta opció per a imprimir el ressaltat de la sintaxi. Per a " +"obtenir més informació sobre el ressaltat de la sintaxi, vegeu la ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Imprimeix les capçaleres de la pàgina" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Seleccioneu aquesta opció per a incloure una capçalera a cada pàgina que " +"imprimiu. No podeu configurar la capçalera." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "Números de línia" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Seleccioneu l'opció Imprimeix els números de línia per " +"a incloure els números de línia quan imprimiu un fitxer." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Utilitzeu el quadre de selecció de valors Número cada ... línies per a especificar cada quan s'ha d'imprimir el número de línia. " +"Per exemple cada 5 línies, cada 10 línies, etc." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1176(guilabel) C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "Ajustament de línia" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Seleccioneu l'opció Habilita l'ajustament de text per a " +"ajustar el text a la línia següent quan s'arriba a un número de caràcters, " +"quan imprimiu un fitxer. L'aplicació compta les línies ajustades com a una " +"sola línia per a la numeració." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Seleccioneu l'opció No separis les paraules en dues línies per a ajustar el text a la línia següent, a nivell de paraula, " +"quan imprimiu un fitxer." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Tipus de lletres" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Cos" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Feu clic a aquest botó per a seleccionar el tipus de lletra a utilitzar per " +"a imprimir el text del cos d'un fitxer." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Números de línia" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Feu clic a aquest botó per a seleccionar el tipus de lletra a utilitzar per " +"a imprimir els números de línia." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Capçaleres i peus de pàgina" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Feu clic a aquest botó per a seleccionar el tipus de lletra a utilitzar per " +"a imprimir les capçaleres i peus de pàgina d'un fitxer." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Per a reiniciar els tipus de lletra als tipus de lletra predeterminats per a " +"imprimir un fitxer del gedit, feu clic a " +"Restaura els tipus de lletra predeterminats." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Impressió d'un document" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Podeu utilitzar el gedit per a realitzar les " +"operacions d'impressió següents:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Imprimir un document a una impressora." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Imprimir la sortida de l'ordre d'imprimir a un fitxer." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Si imprimiu a un fitxer, el gedit envia la " +"sortida del fitxer a un fitxer de format de preimpressió. Els formats de " +"preimpressió més habituals són el PostScript i el Portable Document Format " +"(PDF)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Per a previsualitzar les pàgines que voleu imprimir, trieu " +"FitxerPrevisualitza la " +"impressió." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Per a imprimir el fitxer actual a una impressora o fitxer, trieu " +"FitxerImprimeix per a mostrar el diàleg Imprimeix." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"El diàleg Imprimeix us permet especificar les opcions " +"d'impressió següents:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Pestanya de tasca" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Rang d'impressió" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Seleccioneu una de les opcions següents per a determinar quantes pàgines " +"imprimir:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Tot" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Seleccioneu aquesta opció per a imprimir totes les pàgines del fitxer." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Línies" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Seleccioneu aquesta opció per a imprimir només les línies especificades. " +"Utilitzeu els quadres de selecció de valors Des de i " +"A per a especificar el rang de línies." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Selecció" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Seleccioneu aquesta opció per a imprimir només el text seleccionat. Aquesta " +"opció només està disponible si seleccioneu text." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Còpies" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Utilitzeu el quadre de selecció de valors Número de còpies per a especificar el número de còpies que voleu imprimir del " +"fitxer." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Si imprimiu diverses còpies del fitxer, seleccioneu l'opció " +"Compagina per a compaginar les còpies impreses." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Pestanya d'impressora" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Impressora" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar la impressora on " +"voleu per a imprimir el fitxer." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Paràmetres" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar els paràmetres de la " +"impressora." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Per a configurar la impressora, feu clic a Configura. " +"Per exemple, podeu habilitar o inhabilitar la impressió doble o la impressió " +"retardada, si la impressora admet aquesta funcionalitat." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Ubicació" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar un dels destins " +"d'impressió següents:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Imprimeix el fitxer a una impressora CUPS." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Si la impressora seleccionada és una impressora CUPS, el CUPS és l'única entrada d'aquesta llista desplegable." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Imprimeix el fitxer a una impressora." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Fitxer" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Imprimeix el fitxer a un fitxer PostScript." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Feu clic a Anomena i desa per a mostrar un diàleg on " +"podeu especificar el nom i la ubicació del fitxer PostScript." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Personalitzat" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Utilitzeu l'ordre especificada per a imprimir el fitxer." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Introduïu el nom de l'ordre al quadre de text. Incloent tots els arguments " +"de la línia d'ordres." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Estat" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "" +"Aquesta funcionalitat no està implementada en aquesta versió del gedit." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Tipus" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Comentari" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Pestanya del paper" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Mida del paper" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar la mida del paper on " +"voleu imprimir el fitxer." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Amplada" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Utilitzeu aquest quadre de selecció de valors per a especificar l'amplada " +"del paper. Utilitzeu la llista desplegable adjacent per a canviar la unitat " +"de mesura." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Alçada" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "" +"Utilitzeu aquest quadre de selecció de valors per a especificar l'alçada del " +"paper." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Orientació de l'alimentació" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar l'orientació del " +"paper a l'impressora." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Orientació de la pàgina" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar l'orientació de la " +"pàgina." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Disposició" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar la disposició de la " +"pàgina. Es mostrarà una previsualització de cada disposició que seleccioneu " +"a l'àrea de Previsualització." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Safata de paper" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "" +"Utilitzeu aquesta llista desplegable per a seleccionar la safata de paper." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Funcions de programació" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Diverses de les funcions per a programar del gedit les proporcionen els connectors. Per exemple, el connector " +"«Llistat de marcadors» proporciona una llista dels marcadors utilitzats " +"normalment per a marcar llenguatges. Vegeu la ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Ressaltat de la sintaxi" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"El ressaltat de la sintaxi fa el codi font més fàcil llegir en mostrar les " +"diferents parts del text en diferents colors." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"El gedit tria un mode apropiat de ressaltat de la " +"sintaxi basat en el tipus de document. Per a reemplaçar el mode de ressaltat " +"de la sintaxi, trieu VisualitzaMode de ressaltat i trieu un " +"dels elements de menú següents:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Normal" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "No mostris cap ressaltat de la sintaxi." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Codis font" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Mostra el ressaltat de la sintaxi per a editar codi font. Utilitzeu el " +"submenú Codis font per a seleccionar el tipus de " +"codi font." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Marcatge" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Mostra el ressaltat de la sintaxi per a editar codi de marcatge. Utilitzeu " +"el submenú Marcatge per a seleccionar el tipus de " +"codi de marcatge." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Scripts" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Mostra el ressaltat de la sintaxi per a editar codi d'script. Utilitzeu el " +"submenú Scripts per a seleccionar el tipus de codi " +"d'script." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Altres" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Mostra el ressaltat de la sintaxi per a editar altres tipus de codi. " +"Utilitzeu el submenú Altres per a seleccionar el " +"tipus de codi." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Condueix la sortida d'una ordre a un fitxer" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Podeu utilitzar el gedit per a conduir la sortida " +"d'una ordre a un fitxer de text. Per exemple, per a conduir la sortida d'una " +"ordre ls a un fitxer de text, escriviu ls | " +"gedit i premeu Retorn." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"La sortida de l'ordre ls es mostrarà a un fitxer de text " +"nou a la finestra del gedit." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Alternativament, podeu utilitzar el connector Eines externes per a conduir la sortida d'una ordre al fitxer actual." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Dreceres de teclat" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Utilitzeu les dreceres de teclat per a realitzar tasques més ràpidament que " +"amb el ratolí i els menús. Les taules següents llisten totes les dreceres de " +"teclat del gedit." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Per a obtenir més informació sobre les dreceres de teclat, vegeu la Guia d'usuari de " +"l'escriptori." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "Pestanyes" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Dreceres per a les pestanyes:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) C/gedit.xml:1052(para) C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "Tecla de drecera" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) C/gedit.xml:1054(para) C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "Ordre" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + RePàg" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Commuta a la pestanya següent a l'esquerra." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + AvPàg" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Commuta a la pestanya següent a la dreta." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Tanca la pestanya." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Maj + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Desa totes les pestanyes." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Maj + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Tanca totes les pestanyes." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Salta a l'enèsima pestanya." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Fitxers" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Dreceres per a treballar amb fitxers:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Crea un document nou." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Obre un document." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Obre una ubicació." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Desa el document actual al disc." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Maj + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Desa el document actual amb un nom de fitxer nou." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Imprimeix el document actual." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Maj + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Previsualitza la impressió." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Tanca el document actual." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Surt del gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "Edita" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Dreceres per a editar documents:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Desfés l'última acció." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Maj + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Refés l'última acció desfeta." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Retalla el text o regió seleccionat i el col·loca al porta-retalls." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Copia el text o regió seleccionat al porta-retalls." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Enganxa el contingut del porta-retalls." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Selecciona-ho tot." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Suprimeix la línia actual." + +#: C/gedit.xml:1003(para) +#, fuzzy +#| msgid "Alt + n" +msgid "Alt + Up" +msgstr "Alt + n" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "" + +#: C/gedit.xml:1007(para) +#, fuzzy +#| msgid "Alt + n" +msgid "Alt + Down" +msgstr "Alt + n" + +#: C/gedit.xml:1008(para) +#, fuzzy +#| msgid "Copy the selected text or region onto the clipboard." +msgid "Move the selected line down one line." +msgstr "Copia el text o regió seleccionat al porta-retalls." + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "Subfinestres" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Dreceres per a mostrar i amagar les subfinestres:" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "Mostra/amaga la subfinestra lateral." + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "Mostra/amaga la subfinestra inferior." + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "Cerca" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "Dreceres per a cercar:" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "Cerca una cadena." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "Cerca la instància següent de la cadena." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Maj + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "Cerca la instància anterior de la cadena." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "Cerca interactiva." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "Cerca i reemplaça." + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Maj + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "Neteja el ressaltat." + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "Ves a la línia." + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "Eines" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "Dreceres per a les eines:" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Maj + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "Comprova l'ortografia (amb connector)." + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Suprimeix els espais al final de les línies (amb connector)." + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "Sagna (amb connector)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Maj + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "Suprimeix el sagnat (amb connector)." + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Executa el «make» al directori actual (amb connector)." + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Maj + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "Llistat del directori (amb connector)." + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "Ajuda" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "Dreceres per a l'ajuda:" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "Obre el manual d'usuari del gedit." + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "Preferències" + +#: C/gedit.xml:1164(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Per a configurar el gedit, trieu " +"EditaPreferències. El diàleg Preferències conté les " +"categories següents:" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "Visualitza les preferències" + +#: C/gedit.xml:1178(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Seleccioneu l'opció Habilita l'ajustament de text per a " +"fer que les línies llargues de text es converteixin en paràgrafs enlloc de " +"continuar pel final de la finestra de text. Això evita haver de desplaçar-se " +"horitzontalment." + +#: C/gedit.xml:1179(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Seleccioneu l'opció No separis les paraules en dues línies per a fer que l'opció d'ajustament del text conservi la paraula " +"sencera quan el text salti a la línia següent. Això fa el text més fàcil de " +"llegir." + +#: C/gedit.xml:1185(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Seleccioneu l'opció Mostra els números de línia per a " +"mostrar els números de línia a la banda esquerra de la finestra del " +"gedit." + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "Línia actual" + +#: C/gedit.xml:1191(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Seleccioneu l'opció Ressalta la línia actual per a " +"ressaltar la línia on està ubicat el cursor." + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "Marge dret" + +#: C/gedit.xml:1197(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Seleccioneu l'opció Mostra el marge dret per a mostrar " +"una línia vertical que indica el marge dret." + +#: C/gedit.xml:1198(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Utilitzeu el quadre de selecció de valors Marge dret a la columna per a especificar la ubicació de la línia vertical." + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "Coincidència de claudàtors" + +#: C/gedit.xml:1204(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Seleccioneu l'opció Ressalta el claudàtor concordant " +"per a ressaltar el claudàtor corresponent quan el cursor està ubicat en un " +"caràcter de claudàtor." + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "Preferències de l'editor" + +#: C/gedit.xml:1217(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Utilitzeu el quadre de selecció de valors Amplada de la tabulació per a especificar l'amplada de l'espai que el gedit insereix quan premeu la tecla Tab." + +#: C/gedit.xml:1218(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Seleccioneu l'opció Insereix espais en comptes de tabulacions per a especificar que el gedit " +"insereixi espais enlloc d'un caràcter de tabulació quan premeu la tecla " +"Tab." + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "Sagnat automàtic" + +#: C/gedit.xml:1224(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Seleccioneu l'opció Habilita el sagnat automàtic per a " +"especificar que la línia següent inicia el nivell de sagnat a la línia " +"actual." + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "Desament de fitxers" + +#: C/gedit.xml:1230(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Seleccioneu l'opció Crea una còpia de seguretat dels fitxers abans " +"de desar-los per a crear una còpia de seguretat d'un fitxer cada " +"cop que deseu el fitxer. La còpia de seguretat del fitxer conté un ~ al " +"final del nom de fitxer." + +#: C/gedit.xml:1231(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Seleccioneu l'opció Desa els fitxers automàticament cada ... " +"minuts per a desar automàticament el fitxer actual a intervals " +"regulars. Utilitzeu el quadre de selecció de valors per a especificar " +"l'interval per a desar el fitxer." + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "Preferències de tipus de lletra i colors" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "Tipus de lletra" + +#: C/gedit.xml:1243(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Seleccioneu l'opció Utilitza el tipus de lletra del tema " +"predeterminat per a utilitzar el tipus de lletra del sistema " +"predeterminat per al text a la finestra de text del gedit." + +#: C/gedit.xml:1244(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"El camp Tipus de lletra de l'editor mostra el tipus de " +"lletra que el gedit utilitza per a mostrar el " +"text. Feu clic al botó per a especificar el tipus de lletra, l'estil i la " +"mida a utilitzar per al text." + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "Esquema de colors" + +#: C/gedit.xml:1250(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"Podeu triar un esquema de color des de la llista d'esquemes de colors. Per " +"defecte, els esquemes de color següents estan instal·lats:" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "Clàssic" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Esquema de color clàssic basat en l'esquema de color del gvim." + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Cobalt" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "Esquema de color basat en el blau." + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Esquema de color que s'utilitza en l'editor de text Kate." + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Esquema de color fosc que utilitza la paleta de colors del Tango." + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Esquema de color que utilitza la paleta de colors del Tango." + +#: C/gedit.xml:1283(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Podeu afegir un esquema de color nou fent clic a Afegeix... i seleccionant el fitxer d'esquema de color." + +#: C/gedit.xml:1284(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Podeu suprimir l'esquema de color seleccionat fent clic a " +"Suprimeix" + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "Preferències dels connectors" + +#: C/gedit.xml:1292(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Els connectors afegeixen funcions extres al gedit. Per a obtenir més informació sobre els connectors i com " +"utilitzar connectors integrats, vegeu la ." + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "Com habilitar un connector" + +#: C/gedit.xml:1297(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Per a habilitar un connector del gedit, realitzeu " +"els passos següents:" + +#: C/gedit.xml:1300(para) C/gedit.xml:1321(para) C/gedit.xml:1643(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Trieu EditaPreferències." + +#: C/gedit.xml:1303(para) C/gedit.xml:1324(para) C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "Seleccioneu la pestanya Connectors." + +#: C/gedit.xml:1306(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"Seleccioneu la casella de selecció al costat del nom del connector que voleu " +"habilitar." + +#: C/gedit.xml:1309(para) C/gedit.xml:1330(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Feu clic a Tanca per a tancar el diàleg " +"Preferències." + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "Com inhabilitar un connector" + +#: C/gedit.xml:1317(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Un connector continuarà habilitat quan sortiu del gedit." + +#: C/gedit.xml:1318(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Per a inhabilitar un connector del gedit, " +"realitzeu els passos següents:" + +#: C/gedit.xml:1327(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Desseleccioneu la casella de selecció al costat del nom del connector que " +"voleu inhabilitar." + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "Connectors" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "Treball amb connectors" + +#: C/gedit.xml:1342(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Podeu afegir funcions addicionals al gedit en " +"habilitar connectors. Un connector és un programa " +"addicional que millora la funcionalitat d'una aplicació. Els connectors " +"afegeixen elements nous als menús del gedit per a " +"les funcions noves que proporcionen." + +#: C/gedit.xml:1344(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Diversos connectors ja venen integrats amb el gedit i en podeu instal·lar més. El lloc web del gedit llista connectors " +"de tercers." + +#: C/gedit.xml:1345(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Per a habilitar i inhabilitar connectors o veure quins connectors estan " +"habilitats actualment, vegeu les Preferències dels connectors." + +#: C/gedit.xml:1346(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"Els connectors següents venen integrats amb el gedit:" + +#: C/gedit.xml:1352(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Canvia les " +"majúscules/minúscules us permet canviar les majúscules/" +"minúscules del text seleccionat." + +#: C/gedit.xml:1355(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Estadístiques del document mostra el número de " +"línies, paraules i caràcters al document." + +#: C/gedit.xml:1358(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Eines externes us permet executar ordres externes des del " +"gedit." + +#: C/gedit.xml:1361(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Navegador de fitxers us permet navegar pels " +"fitxers i carpetes a la subfinestra lateral." + +#: C/gedit.xml:1364(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Sagna les línies afegeix i suprimeix el sagnat a les línies seleccionades." + +#: C/gedit.xml:1367(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Insereix la " +"data/hora afegeix la data i hora actuals a un document." + +#: C/gedit.xml:1370(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Modes de línia us permet establir preferències d'edició per a documents " +"individuals i admet estils de modes de línia de l'Emacs, el Kate i el Vim." + +#: C/gedit.xml:1373(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Consola Python us permet executar ordres en el llenguatge de " +"programació Python." + +#: C/gedit.xml:1376(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Fragments us permet emmagatzemar fragments de text utilitzats " +"freqüentment i inserir-los ràpidament a un document." + +#: C/gedit.xml:1379(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Ordena " +"ordena les línies de text seleccionades en ordre alfabètic." + +#: C/gedit.xml:1382(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Comprovador " +"d'ortografia corregeix l'ortografia del text " +"seleccionat o marca automàticament els errors al document." + +#: C/gedit.xml:1385(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Llistat de marcadors us permet inserir marcadors utilitzats freqüentment per " +"a HTML i altres llenguatges des d'una llista a la subfinestra lateral." + +#: C/gedit.xml:1389(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"Per a obtenir més informació sobre com crear connectors, vegeu el lloc web del " +"gedit." + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "Connector de canvi de les majúscules/minúscules" + +#: C/gedit.xml:1394(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"El connector Canvia les majúscules/minúscules " +"canvia les majúscules/minúscules del text seleccionat." + +#: C/gedit.xml:1395(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Els elements següents s'afegeixen al menú Edita quan " +"s'habilita el connector Canvia les majúscules/minúscules." + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "Element del menú" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "Acció" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "Exemple" + +#: C/gedit.xml:1415(guisubmenu) C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "Canvia les majúscules/minúscules" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "Tot en majúscules" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "Canvia cada caràcter a majúscules" + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "Aquest text es torna AQUEST TEXT" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "Tot en minúscules" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "Canvia cada caràcter a minúscules." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "Aquest text es torna aquest text" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "Inverteix les majúscules/minúscules" + +#: C/gedit.xml:1428(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" +"Canvia cada caràcter en minúscules a majúscules i canvia cada caràcter en " +"majúscules a minúscules." + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Aquest Text es torna aQUEST tEXT" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "Majúscules/minúscules del títol" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "Canvia els primer caràcter de cada paraula a majúscules." + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "aquest text es torna Aquest Text" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "Connector d'estadístiques del document" + +#: C/gedit.xml:1445(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"El connector Estadístiques del document compta el " +"número de línies, paraules, caràcters amb espais, caràcters sense espais i " +"bytes del fitxer actual. El connector mostra els resultats al diàleg " +"Estadístiques del document. Per a utilitzar el " +"connector Estadístiques del document, realitzeu els passos següents:" + +#: C/gedit.xml:1447(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Trieu EinesEstadístiques del " +"document per a mostrar el diàleg " +"Estadístiques del document. El diàleg " +"Estadístiques del document mostra la informació següent " +"sobre el fitxer:" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "Número de línies al document actual." + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "Número de paraules al document actual." + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Número de caràcters, incloent-hi els espais, al document actual." + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Número de caràcters, sense incloure-hi el espais, al document actual." + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "Número de bytes al document actual." + +#: C/gedit.xml:1467(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Podeu seguir actualitzant el fitxer del gedit " +"mentre el diàleg Estadístiques del document està obert. " +"Per a refrescar els continguts del diàleg Estadístiques del " +"document, feu clic a Actualitza." + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "Connector d'eines externes" + +#: C/gedit.xml:1475(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"El connector Eines externes us permet executar " +"ordres externes des del gedit. Podeu conduir " +"contingut a una ordre i explotar la seva sortida (per exemple el " +"sed) o executar una ordre predefinida (per " +"exemple el make)." + +#: C/gedit.xml:1476(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Utilitzeu el Gestor d'eines externes per a crear i " +"editar ordres. Per a executar una ordre externa, trieu-la des del menú " +"Eines." + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "Ordres integrades" + +#: C/gedit.xml:1480(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"El connector Eines externes proporciona les " +"ordres següents:" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Munta" + +#: C/gedit.xml:1484(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Executa el make al directori actual del document." + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "Llistat del directori" + +#: C/gedit.xml:1489(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "" +"Llista els continguts del directori actual del document en un document nou." + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "Variables d'entorn" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Mostra la llista de variables d'entorn a la subfinestra inferior." + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Cerca un terme a tots els fitxers del directori actual del document, " +"utilitzant un patró de coincidència. Els resultats es mostren a la " +"subfinestra inferior." + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "Suprimeix espais al final de les línies" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Suprimeix tots els espais al final de les línies del document." + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "Com definir una ordre" + +#: C/gedit.xml:1512(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Per a afegir una ordre externa, trieu EinesEines externes." + +#: C/gedit.xml:1513(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"A la finestra Gestor d'eines externes, feu clic a " +"Nou. Podeu especificar els detalls següents per a una " +"ordre nova:" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "Descripció" + +#: C/gedit.xml:1517(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"Aquesta descripció es mostra a la barra d'estat quan es tria l'ordre del " +"menú." + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "Accelerador" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Introduïu una drecera de teclat per a l'ordre." + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "Ordres" + +#: C/gedit.xml:1527(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Les ordres actuals a executar. Es poden utilitzar diverses variables " +"d'entorn del gedit per a passar contingut a " +"aquestes ordres. Vegeu la ." + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "Entrada" + +#: C/gedit.xml:1532(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"El contingut a donar a les ordres (com ara stdin): " +"el text sencer del document actual o la selecció, línia o paraula actual." + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "Sortida" + +#: C/gedit.xml:1537(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Què fer amb la sortida de les ordres: mostrar a la subfinestra inferior, " +"col·locar a un document nou o col·locar al document actual al final, a la " +"posició del cursor o reemplaçant la selecció o tot el document." + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "Aplicabilitat" + +#: C/gedit.xml:1542(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Determina quins tipus de documents poden ser afectats per l'ordre, per " +"exemple si s'han desat o no i si són locals o remots." + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "Com editar i suprimir eines" + +#: C/gedit.xml:1551(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Per a editar una eina, seleccioneu-la a la llista i realitzeu canvis a les " +"seves propietats." + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "Per a canviar el nom d'una eina, feu clic un altre cop a la llista." + +#: C/gedit.xml:1553(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Per a restaurar una eina integrada que heu canviat, premeu " +"Recupera." + +#: C/gedit.xml:1554(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Per a suprimir una eina, seleccioneu-la a la llista i premeu " +"Suprimeix. No podeu suprimir eines integrades, només " +"aquelles que heu creat." + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "Variables" + +#: C/gedit.xml:1559(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"Podeu utilitzar les variables següents al camp Ordres " +"de la definició de l'ordre:" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "Connector de navegador de fitxers" + +#: C/gedit.xml:1588(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"El connector Navegador de fitxers mostra el " +"vostres fitxers i carpetes a la subfinestra lateral, permetent-vos obrir " +"ràpidament els fitxers." + +#: C/gedit.xml:1589(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Per a visualitzar el navegador de fitxers, trieu " +"VisualitzaSubfinestra lateral i feu clic a la pestanya que mostra la icona del " +"navegador de fitxers a la part inferior de la subfinestra lateral." + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "Com navegar pels vostres fitxers" + +#: C/gedit.xml:1592(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"La pestanya del navegador de fitxers inicialment mostra les adreces " +"d'interes del vostre gestor de fitxers. Per a navegar pels continguts de " +"qualsevol element, feu-hi doble clic." + +#: C/gedit.xml:1593(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Per a mostrar una carpeta pare, trieu-la a la llista desplegable o premeu la " +"fletxa amunt a la barra d'eines del navegador de fitxers." + +#: C/gedit.xml:1594(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Per a mostrar la carpeta que conté el document en què esteu treballant " +"actualment, feu clic amb el botó secundari a la llista de fitxers i trieu " +"Establiu l'arrel del document actiu." + +#: C/gedit.xml:1598(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Per a obrir un fitxer al gedit, feu-hi doble clic " +"a la llista de fitxers." + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "Com crear fitxers i carpetes" + +#: C/gedit.xml:1602(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Per a crear un fitxer de text nou i buit a la carpeta actual que es mostra " +"al navegador, feu clic amb el botó secundari a la llista de fitxers i trieu " +"Fitxer nou." + +#: C/gedit.xml:1603(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Per a crear una carpeta nova a la carpeta actual que es mostra al navegador, " +"feu clic amb el botó secundari a la llista de fitxers i trieu " +"Carpeta nova." + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "Connector de sagnat de línies" + +#: C/gedit.xml:1609(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"El connector Sagna les línies afegeix o suprimeix " +"espai a l'inici de les línies de text." + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" +"Per a sagnar o desfer el sagnat del text, realitzeu els passos següents:" + +#: C/gedit.xml:1612(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Seleccioneu les línies que voleu sagnar. Per a sagnar o desfer el sagnat " +"d'una sola línia, col·loqueu el cursor a qualsevol lloc d'aquesta línia." + +#: C/gedit.xml:1617(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Per a sagnar el text, trieu EditaSagna." + +#: C/gedit.xml:1620(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Per a suprimir el sagnat, trieu EditaDesagna." + +#: C/gedit.xml:1625(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"La quantitat d'espai utilitzat i si s'ha d'utilitzar el caràcter de " +"tabulació o caràcters d'espai; depèn dels paràmetres Tabulacions a l'editor de preferències. Vegeu la ." + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "Connector d'inserció de la la data/hora" + +#: C/gedit.xml:1631(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"El connector Insereix la data/hora insereix la " +"data i hora actual a un document. Per a utilitzar el connector d'inserir la " +"data/hora, realitzeu els passos següents:" + +#: C/gedit.xml:1633(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Trieu EditaInsereix la data i " +"hora." + +#: C/gedit.xml:1634(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Si no teniu configurat el connector d'inserció de la la data/hora per a " +"inserir automàticament la data/hora sense sol·licitar-vos-en el format, el " +"gedit mostrarà el diàleg Insereix la " +"data i hora. Seleccioneu el format apropiat de data/hora de la " +"llista. Feu clic a Insereix per a tancar el diàleg " +"Insereix la data i hora. El gedit inserirà la data/hora a la posició del cursor a la fila actual." + +#: C/gedit.xml:1635(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Si heu configurat el gedit per a utilitzar un " +"format particular de data/hora, no es mostrarà el diàleg Insereix " +"la data i hora. La data/hora s'inserirà automàticament a la " +"posició del cursor a la fila actual." + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Configuració del connector d'inserir la data/hora" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"Per a configurar el connector d'inserir la data/hora, realitzeu els passos " +"següents:" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Seleccioneu el connector Insereix la data/hora." + +#: C/gedit.xml:1652(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Feu clic a Configura el connector per a mostrar el " +"diàleg Configura el connector per inserir la data/hora." + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "Seleccioneu una de les opcions, tal com es mostra:" + +#: C/gedit.xml:1657(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Per a especificar el format de data/hora cada cop que inseriu la data/hora, " +"seleccioneu l'opció Pregunta per un format." + +#: C/gedit.xml:1660(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Per a utilitzar el mateix format proporcionat pel gedit cada cop que inseriu la data/hora, seleccioneu l'opció " +"Utilitza el format seleccionat, llavors seleccioneu el " +"format apropiat de la llista. Quan seleccioneu aquesta opció, el " +"gedit no us sol·licitarà el format de la data/" +"hora quan trieu EditaInsereix la " +"data i hora." + +#: C/gedit.xml:1663(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Per a utilitzar el mateix format personalitzat cada cop que inseriu la data/" +"hora, seleccioneu l'opció Utilitza un format personalitzat, llavors introduïu el format apropiat al quadre de text. Per a " +"obtenir més informació sobre com especificar un format personalitzat, vegeu " +"el strftime3. Quan seleccioneu aquesta opció, el " +"gedit no us sol·licitarà el format de la data/" +"hora quan trieu EditaInsereix la " +"data i hora." + +#: C/gedit.xml:1668(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Feu clic a D'acord per a tancar el diàleg " +"Configura el connector per inserir la data/hora." + +#: C/gedit.xml:1671(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Per a tancar el diàleg Preferències, feu clic a " +"Tanca." + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Connector de modes de línia" + +#: C/gedit.xml:1679(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"El connector Modes de línia us permet establir " +"les preferències per a documents individuals. Un mode de línia és una línia de text a l'inici o final del document amb " +"paràmetres que el gedit reconeix." + +#: C/gedit.xml:1680(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Les preferències establertes utilitzant els modes de línia tenen preferència " +"sobre les especificades al diàleg de preferències." + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "Podeu establir les preferències següents amb els modes de línia:" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Amplada de la tabulació" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "Amplada del sagnat" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "Inserir espais en comptes de tabuladors" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "Amplada del marge dret" + +#: C/gedit.xml:1700(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"El connector Modes de línia admet un subconjunt " +"de les opcions que utilitzen altres editors de text com " +"l'Emacs, el Kate i el " +"Vim." + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Modes de línia de l'Emacs" + +#: C/gedit.xml:1704(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"Les primeres dues línies d'un document s'analitzen cercant modes de línia de " +"l'Emacs." + +#: C/gedit.xml:1705(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"S'admeten les opcions de l'Emacs per a tab-width, " +"indent-offset, indent-tabs-mode i autowrap. Per a obtenir més informació, " +"vegeu el Manual del GNU Emacs." + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Modes de línia del Kate" + +#: C/gedit.xml:1709(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"Les primeres i últimes deu línies d'un document s'analitzen cercant modes de " +"línia del Kate." + +#: C/gedit.xml:1710(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"S'admeten les opcions del Kate per a tab-width, " +"indent-width, space-indent, word-wrap i word-wrap-colum. Per a obtenir més " +"informació, vegeu el lloc web del Kate." + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Modes de línia del Vim" + +#: C/gedit.xml:1714(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"Les primeres i últimes tres línies d'un document s'analitzen cercant modes " +"de línia del Vim." + +#: C/gedit.xml:1715(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"S'admeten les opcions del Vim per a et, " +"expandtab, ts, tabstop, sw, shiftwidth, wrap i textwidth. Per a obtenir més " +"informació, vegeu el lloc web del Vim." + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Connector de consola Python" + +#: C/gedit.xml:1721(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"El connector Consola Python us permet executar " +"ordres en el llenguatge de programació Python des del gedit. En habilitar el connector s'afegirà una pestanya a la " +"subfinestra inferior. Aquest mostra l'última sortida i un camp d'entrada " +"d'ordres." + +#: C/gedit.xml:1722(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Les ordres introduïdes a la consola Python no es comproven abans d'executar-" +"les. Per tant és possible penjar el gedit, per " +"exemple en introduir un bucle infinit." + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "Connector de fragments" + +#: C/gedit.xml:1727(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"El connector Fragments us permet emmagatzemar " +"fragments de text utilitzats normalment, anomenats fragments, i inserir-los ràpidament a un document." + +#: C/gedit.xml:1728(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Els fragments són específics a la sintaxi del llenguatge del document " +"actual. Per exemple, quan esteu treballant amb un document HTML, podeu triar " +"des d'una llista de fragments que són útils per a l'HTML. A més, alguns " +"fragments són globals i estan disponibles a tots els documents." + +#: C/gedit.xml:1729(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Un número de fragments integrats s'instal·len amb el gedit, els quals poden ser modificats." + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "Com inserir fragments" + +#: C/gedit.xml:1733(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Per a inserir un fragment a un document, teclegeu el seu " +"disparador de tabulador i premeu Tab. Normalment el disparador de tabulador d'un fragment són les " +"primeres lletres del fragment o alguna altra cosa que sigui curta i fàcil de " +"recordar." + +#: C/gedit.xml:1734(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Alternativament, premeu CtrlEspai per a veure una llista dels fragments que podeu inserir." + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "Com afegir fragments" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "Per a crear un fragment nou, feu el següent:" + +#: C/gedit.xml:1742(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Trieu EinesGestiona fragments. S'obrirà la finestra Gestor de " +"fragments." + +#: C/gedit.xml:1745(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"La llista dels fragments està agrupada per llenguatge. Seleccioneu el " +"llenguatge on voleu afegir un fragment, o bé un fragment en aquell grup de " +"llenguatge. Per a afegir un fragment a tots els llenguatges, trieu Global a " +"la part superior de la llista. Per defecte es mostrarà la sintaxi del " +"document en el qual esteu treballant actualment." + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Feu clic a Nou. Apareixerà un fragment nou a la " +"llista." + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "Introduïu la informació següent per al fragment nou:" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "Nom" + +#: C/gedit.xml:1755(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Introduïu un nom per al fragment al camp de text a la llista de fragments. " +"El nom d'un fragment només serveix com a recordatori del seu propòsit. Podeu " +"canviar el nom d'un fragment que heu creat en fer-hi clic a la llista." + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "Text del fragment" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Introduïu el text del fragment al quadre de text Edita el " +"fragment. Per a saber els codis especials que podeu utilitzar, " +"vegeu la ." + +#: C/gedit.xml:1761(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Podeu tornar a la finestra del document per a copiar text sense tancar la " +"finestra del Gestor de fragments." + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Disparador de tabulador" + +#: C/gedit.xml:1766(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Introduïu el disparador de tabulador per al fragment. Aquest és el text que " +"heu d'escriure abans de prémer Tab per a inserir el " +"fragment." + +#: C/gedit.xml:1767(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"L'etiqueta ha de ser una sola paraula amb només lletres o un sol caràcter. " +"El Disparador de tabulador es ressaltarà en vermell si " +"s'ha introduït un disparador de tabulador no vàlid." + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "Tecla de drecera" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Introduïu una tecla de drecera a utilitzar per a inserir el fragment." + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "Com editar i suprimir fragments" + +#: C/gedit.xml:1782(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Per a editar un fragment, seleccioneu-lo a la llista i realitzeu els canvis " +"a les seves propietats d'activació i text." + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "" +"Per a canviar el nom d'un fragment, feu-hi clic un altre cop a la llista." + +#: C/gedit.xml:1784(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Per a restaurar un fragment integrat que heu modificat, premeu " +"Recupera." + +#: C/gedit.xml:1785(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Per a suprimir un fragment, seleccioneu-lo a la llista i premeu " +"Suprimeix. No podeu suprimir fragments integrats, " +"només aquells que heu creat." + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "Substitució de fragments" + +#: C/gedit.xml:1790(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"A més d'inserir un text emmagatzemat, un fragment pot incloure text " +"personalitzat o marcar els espais on podeu afegir text un cop s'hagi inserit " +"el fragment al document." + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" +"Podeu utilitzar els codis de text variable següents al text del fragment:" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Texts variables per a tabuladors" + +#: C/gedit.xml:1798(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n defineix un text variable " +"per a tabulador, on n és qualsevol número des d'un en " +"amunt." + +#: C/gedit.xml:1799(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} defineix un text variable per a tabulador amb un valor " +"predeterminat." + +#: C/gedit.xml:1800(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Un text variable per a tabulador marca un espai al text del fragment on " +"podeu afegir text addicional després d'inserir el fragment." + +#: C/gedit.xml:1801(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Per a utilitzar els texts variables per a tabuladors, inseriu un fragment de " +"forma normal. El cursor s'ubicarà al primer text variable per a tabulador. " +"Escriviu el text i premeu Tab per a anar al següent text " +"variable per a tabulador. El número al codi del text variable defineix " +"l'ordre en què avançarà la tabulació a cada ubicació del text." + +#: C/gedit.xml:1802(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Premeu MajTab per a " +"tornar al text variable per a tabulador anterior. En prémer Tab quan no hi ha més texts variables per a tabulador es mourà el cursor " +"al final del text del fragment o al final del text variable si existeix." + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Rèpliques de texts variables" + +#: C/gedit.xml:1807(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Un text variable per a tabulador repetit replicarà el text variable ja " +"definit. Això us permet escriure un sol cop el text que voleu que aparegui " +"diverses vegades al fragment." + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "Text variable de final" + +#: C/gedit.xml:1812(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 defineix el text variable de final. Aquest us permet " +"de finalitzar de treballar amb el fragment amb el cursor a un punt diferent " +"que el final del fragment de text." + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "Variables d'entorn" + +#: C/gedit.xml:1817(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Les variables d'entorn com ara $PATH i $HOME són substituïdes al fragment de text. També es poden utilitzar les " +"variables d'entorn següents específiques del gedit." + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "El text seleccionat actualment." + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"El nom de fitxer complet del document o una cadena buida si el document " +"encara no s'ha desat." + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"El nom base del nom de fitxer del document o una cadena buida si el document " +"encara no s'ha desat." + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"La paraula a la ubicació del cursor al document. Quan s'utilitza aquesta " +"variable, la paraula actual serà reemplaçada pel fragment de text." + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Texts variables de l'interpret d'ordres" + +#: C/gedit.xml:1846(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) és reemplaçat pel " +"resultat d'executar cmd a l'interpret d'ordres." + +#: C/gedit.xml:1847(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) us permet donar una referència a aquest text variable, on " +"n és qualsevol número de 1 en amunt. Utilitzeu " +"$n per a utilitzar la sortida " +"d'un text variable de l'interpret d'ordres com a entrada d'una altre." + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Texts variables de Python" + +#: C/gedit.xml:1852(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> és reemplaçat pel " +"resultat d'avaluar cmd a l'interpretador Python." + +#: C/gedit.xml:1853(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" especifica un altre text variable Python com a dependència, on " +"a proporciona el seu ordre al fragment. Això us " +"permet utilitzar funcions Python definides a un altre fragment. Per a " +"especificar diverses dependències, separeu els números amb comes com " +"aquestes: $<a,b:cmd>" + +#: C/gedit.xml:1854(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Per a utilitzar una variable a tots els altres fragments Python, declareu-la " +"com a global." + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "Connector d'ordenació" + +#: C/gedit.xml:1864(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"El connector Ordena col·loca les línies " +"seleccionades de text en ordre alfabètic." + +#: C/gedit.xml:1865(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"No podeu desfer l'operació d'ordenació, de manera que hauríeu de desar el " +"fitxer abans de realitzar l'ordenació. Per a restaurar la versió desada del " +"fitxer després de l'operació d'ordenar, trieu FitxerRestaura." + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "" +"Per a utilitzar el connector d'ordenació, realitzeu els passos següents:" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "Seleccioneu les línies de text que voleu ordenar." + +#: C/gedit.xml:1873(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Trieu EditaOrdena. S'obrirà el diàleg Ordena." + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "Trieu les opcions que voleu per a l'ordenació:" + +#: C/gedit.xml:1879(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Per a ordenar el text en ordre invers, seleccioneu Inverteix " +"l'ordre." + +#: C/gedit.xml:1882(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Per a suprimir les línies duplicades, seleccioneu Suprimeix els " +"duplicats." + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Per a ignorar les diferències de majúscules i minúscules, seleccioneu " +"Ignora diferències de majúscules i minúscules." + +#: C/gedit.xml:1888(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Per a fer que l'ordenació ignori els caràcters a l'inici de les línies, " +"establiu el primer caràcter que s'hauria d'utilitzar per a ordenar al quadre " +"de selecció de valors Comença per la columna." + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"Per a realitzar l'operació d'ordenació, feu clic a Ordena." + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "Connector de comprovació d'ortografia" + +#: C/gedit.xml:1901(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"El connector Comprovador d'ortografia comprova " +"l'ortografia del text seleccionat. Podeu configurar el gedit per a comprovar l'ortografia automàticament o podeu comprovar " +"l'ortografia manualment, en l'idioma especificat. L'idioma i la comprovació " +"automàtica d'ortografia s'apliquen per a cada document. Per a utilitzar el " +"connector de comprovació d'ortografia, realitzeu els passos següents:" + +#: C/gedit.xml:1903(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Trieu EinesEspecifica l'idioma per a mostrar el diàleg Especifica " +"l'idioma. Seleccioneu l'idioma apropiat de la llista. Feu clic a " +"D'acord per a tancar el diàleg Especifica " +"l'idioma." + +#: C/gedit.xml:1906(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Per a comprovar l'ortografia automàticament, trieu " +"EinesComprova l'ortografia " +"automàticament. Per a desseleccionar la " +"comprovació d'ortografia automàtica, trieu un altre cop " +"EinesComprova l'ortografia " +"automàticament. Quan s'activa la comprovació " +"d'ortografia automàtica es mostra una icona al costat de l'element del menú " +"Comprova l'ortografia automàticament. La " +"comprovació d'ortografia automàtica està desactivada per defecte, cada cop " +"que s'inicia el gedit." + +#: C/gedit.xml:1907(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Les paraules desconegudes es mostren d'un color diferent i subratllades. Feu " +"clic amb el botó secundari a una paraula desconeguda i seleccioneu " +"Suggeriments d'ortografia des del menú emergent:" + +#: C/gedit.xml:1910(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Per a substituir la paraula desconeguda amb una altra paraula de la llista, " +"seleccioneu la paraula substituta des del menú emergent " +"Suggeriments d'ortografia." + +#: C/gedit.xml:1913(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Per a afegir la paraula desconeguda al vostre diccionari personal, " +"seleccioneu Suggeriments d'ortografiaAfegeix." + +#: C/gedit.xml:1916(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Per a ignorar totes les ocurrències de la paraula desconeguda, de manera que " +"no es marcaran més com a desconegudes però no s'afegiran al vostre " +"diccionari personal, seleccioneu Suggeriments " +"d'ortografiaIgnora-ho tot. " +"La paraula desconeguda només s'ignorarà a la sessió actual del " +"gedit." + +#: C/gedit.xml:1921(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Per a comprovar l'ortografia manualment, trieu EinesComprova l'ortografia." + +#: C/gedit.xml:1923(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Si no hi ha errors d'ortografia, un diàleg d'Informació " +"mostrarà un missatge indicant que aquest document no conté paraules mal " +"escrites. Feu clic a D'acord per a tancar el diàleg " +"Informació." + +#: C/gedit.xml:1925(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Si hi ha errors ortogràfics, es mostrarà el diàleg Comprova " +"l'ortografia:" + +#: C/gedit.xml:1928(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"La Paraula mal escrita es mostrarà a la part superior " +"del diàleg." + +#: C/gedit.xml:1931(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Es mostrarà un suggeriment ortogràfic conegut al quadre de text " +"Canvia a. Podeu substituir-lo amb una altra paraula " +"coneguda en seleccionar una paraula de la llista Suggeriments o podeu introduir directament el text al quadre de text " +"Canvia a." + +#: C/gedit.xml:1934(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Per a comprovar l'ortografia del text al quadre de text Canvia a, feu clic a Comprova la paraula. Si aquesta " +"és una paraula coneguda, la llista Suggeriments serà " +"substituïda amb el text (ortografia correcta). Si la " +"paraula no és coneguda, apareixeran entrades noves a la llista " +"Suggeriments." + +#: C/gedit.xml:1937(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Per a ignorar l'ocurrència actual de la paraula desconeguda, feu clic a " +"Ignora. Per a ignorar totes les ocurrències de la " +"paraula desconeguda, feu clic a Ignora-ho tot. La " +"paraula desconeguda només s'ignorarà a la sessió actual del " +"gedit." + +#: C/gedit.xml:1940(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Per a canviar l'ocurrència actual de la paraula desconeguda al text del " +"quadre de text Canvia a, feu clic a Canvia. Per a canviar totes les ocurrències de la paraula desconeguda al " +"text al quadre de text Canvia a, feu clic a " +"Canvia-ho tot." + +#: C/gedit.xml:1943(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Per a afegir la paraula desconeguda al vostre diccionari personal, feu clic " +"a Afegeix una paraula." + +#: C/gedit.xml:1946(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Per a tancar el diàleg Comprova l'ortografia, feu clic " +"a Tanca." + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "Connector del llistat de marcadors" + +#: C/gedit.xml:1956(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"El connector Llistat de marcadors us permet " +"inserir marcadors habituals des d'una llista a la subfinestra lateral." + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "" +"Per a utilitzar el connector del llistat de marcadors, realitzeu els passos " +"següents:" + +#: C/gedit.xml:1959(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Trieu VisualitzaSubfinestra " +"lateral." + +#: C/gedit.xml:1963(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Per defecte, la subfinestra lateral mostra una pestanya que conté una llista " +"de documents oberts. Feu clic a la pestanya que mostra la icona + a la part " +"inferior de la subfinestra lateral per a mostrar la pestanya del llistat de " +"marcadors." + +#: C/gedit.xml:1965(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Seleccioneu la categoria de marcadors apropiada des de la llista " +"desplegable. Per exemple HTML - Marcadors." + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "" +"Desplaceu-vos pel llistat de marcadors per a trobar el marcador necessari." + +#: C/gedit.xml:1971(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Per a inserir un marcador a la posició del cursor al fitxer actual, feu " +"doble clic al marcador al llistat de marcadors. També podeu inserir un " +"marcador com segueix:" + +#: C/gedit.xml:1973(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Per a inserir un marcador al fitxer actual i canviar el focus des de la " +"subfinestra lateral a l'àrea de visualització, premeu Retorn." + +#: C/gedit.xml:1976(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Per a inserir un marcador al fitxer actual i mantenir el focus a la finestra " +"Connector del llistat de marcadors, premeu " +"MajRetorn." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Joan Duran , 2009" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Nom d'usuari insereix el nom d'usuari de l'usuari actual al " +#~ "document." + +#~ msgid "User Name Plugin" +#~ msgstr "Connector de nom d'usuari" + +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "El connector Nom d'usuari insereix el nom " +#~ "d'usuari de l'usuari actual al document." + +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "Per a inserir el vostre nom d'usuari a la posició actual, trieu " +#~ "EditaInsereix el nom " +#~ "d'usuari." + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "Per a obtenir més informació sobre com configurar el ressaltat de la " +#~ "sintaxi, vegeu la ." + +#~ msgid "Colors" +#~ msgstr "Colors" + +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Seleccioneu l'opció Utilitza els colors del tema predeterminat per a utilitzar el tema de colors predeterminat a la finestra " +#~ "de text del gedit." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Feu clic al botó de color Color del text normal " +#~ "per a mostrar el diàleg del selector de color. Seleccioneu un color a " +#~ "utilitzar per a mostrar el text normal a la finestra de text del " +#~ "gedit." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Feu clic al botó de color Color de fons per a " +#~ "mostrar el diàleg del selector de color. Seleccioneu un color de fons per " +#~ "a la finestra de text del gedit." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Feu clic al botó de color Color del text seleccionat per a mostrar el diàleg del selector de color. Seleccioneu un " +#~ "color a utilitzar per a mostrar el text seleccionat." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Feu clic al botó de color Color de la selecció per " +#~ "a mostrar el diàleg del selector de color. Seleccioneu un color de fons a " +#~ "utilitzar per a ressaltar un text seleccionat." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Preferències del ressaltat de la sintaxi" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "Habilita el ressaltat de la sintaxi" + +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "" +#~ "Seleccioneu aquesta opció per a ressaltar la sintaxi del text que editeu." + +#~ msgid "Highlight mode" +#~ msgstr "Mode de ressaltat" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Utilitzeu aquesta llista desplegable per a seleccionar un mode de sintaxi " +#~ "a configurar." + +#~ msgid "Elements" +#~ msgstr "Elements" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "" +#~ "Utilitzeu aquest quadre de llista per a seleccionar un element de sintaxi " +#~ "a configurar." + +#~ msgid "Format buttons" +#~ msgstr "Botons de format" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Utilitzeu els botons següents per a canviar el format de l'element de " +#~ "sintaxi seleccionat:" + +#~ msgid "Button" +#~ msgstr "Botó" + +#~ msgid "Format" +#~ msgstr "Format" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Mostra la icona de format negreta." + +#~ msgid "Bold" +#~ msgstr "Negreta" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Mostra la icona de format cursiva." + +#~ msgid "Italic" +#~ msgstr "Cursiva" + +#~ msgid "Shows icon for underline." +#~ msgstr "Mostra la icona de format subratllat." + +#~ msgid "Underline" +#~ msgstr "Subratllat" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Mostra la icona de format barrat." + +#~ msgid "Strikethrough" +#~ msgstr "Barrat" + +#~ msgid "Foreground" +#~ msgstr "Primer pla" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Seleccioneu aquesta opció per a canviar el color de la lletra de " +#~ "l'element de sintaxi seleccionat. Feu clic al botó de color per a mostrar " +#~ "del diàleg del selector de color i seleccioneu el color de la lletra." + +#~ msgid "Background" +#~ msgstr "Fons" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Seleccioneu aquesta opció per a canviar el color de fons de l'element de " +#~ "sintaxi seleccionat. Feu clic al botó de color per a mostrar del diàleg " +#~ "del selector de color i seleccioneu el color de fons." + +#~ msgid "Reset to Default" +#~ msgstr "Reinicia als valors predeterminats" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Feu clic a aquest botó per a reiniciar el color de primer pla i el color " +#~ "de fons de l'element de sintaxi seleccionat als valors predeterminats." diff --git a/help/ca/figures/gedit_window.png b/help/ca/figures/gedit_window.png new file mode 100755 index 00000000..221090eb Binary files /dev/null and b/help/ca/figures/gedit_window.png differ diff --git a/help/cs/cs.po b/help/cs/cs.po new file mode 100755 index 00000000..345fba21 --- /dev/null +++ b/help/cs/cs.po @@ -0,0 +1,4386 @@ +# Czech translation of gedit help. +# Copyright (C) 2009 the author(s) of gedit. +# This file is distributed under the same license as the gedit help. +# +# Lucas Lommer , 2009. +# Marek Černocký , 2009, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit mate-2-32\n" +"POT-Creation-Date: 2010-09-23 21:10+0000\n" +"PO-Revision-Date: 2010-09-25 08:31+0200\n" +"Last-Translator: Marek Černocký \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: cs\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" + +#: 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 link 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 GNU Free Documentation " +"License nebo v souboru COPYING-DOCS dodávaném s touto příručkou." + +#: 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 "" +"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/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 "" +"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/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 " +"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 "" +"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 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/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: " +"" +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: " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=736c106606da05187d3c1d14c5c6de29" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Příručka k aplikaci Gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Dokumentační projekt MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Přidána tabulka klávesových zkratek" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Dokumentační tým Sun Java Desktop System" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek poskytl informace z dřívějších revizích aplikace gedit." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Poděkování" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George poskytl informace o zásuvných modulech." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Příručka aplikace gedit, verze 2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Březen 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Dokumentační tým MATE společnosti Sun" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Příručka aplikace gedit, verze 2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Červen 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Příručka aplikace gedit, verze 2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Srpen 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Příručka aplikace gedit, verze 2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Září 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Příručka aplikace gedit, verze 2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Leden 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Příručka aplikace gedit, verze 2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Březen 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Příručka aplikace gedit, verze 2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Září 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Příručka aplikace gedit, verze 2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Březen 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Příručka aplikace gedit, verze 2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Červenec 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Příručka aplikace gedit, verze 2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "Dokumentační tým MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Tato příručka popisuje gedit ve verzi 2.16." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Ohlasy" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Pokud chcete oznámit chybu nebo navrhnout vylepšení vztahující se k aplikaci " +"gedit nebo této příručce, postupujte dle " +"instrukcí na stránce Stránka s ohlasy na MATE." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit je textový editor pro pracovní prostředí MATE poskytujíc základní, " +"nicméně robustní schopnosti, jako je tisk, kontrola pravopisu, hledání a " +"nahrazování a zvýrazňování syntaxe. Další pokročilé funkce jsou k dispozici " +"v podobě zásuvných modulů." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "textový editor" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Úvod" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"Pomocí aplikace gedit můžete vytvářet a upravovat " +"textové soubory." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"Aplikace gedit se snaží být jednoduchým a snadno " +"použitelným textovým editorem. Složitější funkce lze doplnit různými " +"zásuvnými moduly, což umožňuje provádět rozmanité " +"činnosti související s úpravou textu." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Jak začít" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Spuštění gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "gedit můžete spustit následujícími způsoby:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Nabídka Aplikace" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Zvolte PříslušenstvíTextový editor." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Příkazový řádek" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Spusťte následující příkaz: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Standardně, pokud otevřete textový dokument ve správci souborů, tak se " +"spustí gedit a zobrazí dotyčný dokument." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "Okno aplikace gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Když spustíte gedit, objeví se následující okno:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Okno aplikace gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Zobrazuje hlavní okno aplikace gedit." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"Okno aplikace gedit obsahuje následující části:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Panel nabídek" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Nabídky v panelu nabídek obsahují všechny příkazy, které jsou zapotřebí pro " +"práci v gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Panel nástrojů" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"Panel nástrojů obsahuje část nejpoužívanějších příkazů ze celého panelu " +"nabídek." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Zobrazovací plocha" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "Zobrazovací plocha obsahuje text ze soubory, který upravujete." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Stavový řádek" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"Stavový řádek zobrazuje informace o současných činnostech " +"gedit a kontextové informace položkám nabídek. " +"Stavový řádek rovněž obsahuje následující informace:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "Umístění kurzoru: číslo řádku a sloupce, kde se kurzor nachází." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Režim psaní: Když je editor v režimu vkládání, tak stavový řádek obsahuje " +"text VLO. Když je editor v režimu přepisování, tak " +"stavový řádek obsahuje text PŘE. Režim můžete přepnout " +"klávesou Insert." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Postranní panel" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"Postranní panel obsahuje seznam otevřených dokumentů a další informace " +"závislé na tom, které zásuvné moduly jsou povolené." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Ve výchozím stavu není postranní panel zobrazený. Pokud jej chcete zobrazit, " +"zvolte ZobrazitPostranní panel." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Spodní panel" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Spodní panel využívají programátorské nástroje, jako je zásuvný modul " +"Konzola Pythonu k zobrazení výstupu." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Ve výchozím stavu není spodní panel zobrazený. Pokud jej chcete zobrazit, " +"zvolte ZobrazitSpodní panel." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Pokud kliknete pravým tlačítkem v okně gedit, tak " +"aplikace zobrazí vyskakovací nabídku. Vyskakovací nabídka obsahuje " +"nejběžnější příkazy pro úpravu textu." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Podobně jako v jiných aplikacích MATE, můžete v gedit provádět činnosti několika způsoby: s pomocí nabídek, s pomocí " +"panelu nástrojů a nebo s pomocí klávesových zkratek. Klávesové zkratky " +"obecné pro všechny aplikace jsou uvedené v Uživatelské přiručce." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Spouštění gedit z příkazového řádku" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"gedit můžete spustit z příkazového řádku a přitom " +"otevřít jeden nebo i více souborů. Pokud chcete otevřít z příkazové řádky " +"více souborů, napište příkaz podobně jako v následujícím příkladu a " +"stiskněte Return:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "soubor1.txt soubor2.txt soubor3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Případně můžete místo názvu souboru zadat URI." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Více informací o tom, jak spustit gedit z " +"příkazové řádky najdete v unixových manuálových stránkách gedit gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Práce se soubory" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Vytváření nového dokumentu" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Nový dokument vytvoříte volbou SouborNový. Aplikace " +"gedit zobrazí v okně nový prázdný dokument." + +#: C/gedit.xml:346(title) C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "Otevírání souboru" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Pokud chcete otevřít soubor, zvolte SouborOtevřít a objeví se dialog " +"Otevřít soubory. Zvolte soubor, který chcete otevřít a " +"klikněte na Otevřít. Soubor se zobrazí v okně " +"gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Zobrazuje ikonu nabídky Nedávné soubory. " + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Aplikace si pamatuje cesty a názvy souborů několika posledních dokumentů, " +"které jste upravovali, a přidává je jako položky do nabídky " +"Soubor. Můžete je také zobrazit " +"kliknutím na ikonu na panelu nástrojů." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"V gedit můžete otevřít více souborů naráz. " +"Aplikace pro každý otevřený soubor přidá do okna další kartu. Více se o tom " +"dozvíte v ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Ukládání souboru" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Ukládat můžete soubory následujícími způsoby:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Pokud chcete uložit existující soubor, zvolte SouborUložit." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Pokud chcete uložit nový soubor nebo existující soubor pod novým názvem, " +"zvolte SouborUložit jako. V dialogu Uložit jako " +"zadejte název souboru a klikněte na Uložit." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Pokud chcete uložit všechny soubory současně otevřené v gedit, zvolte DokumentyUložit vše." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Pro zavření všech souborů, které jsou současně v gedit otevřené, zvolte DokumentyZavřít vše." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Otevírání souboru z URI" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Pokud chcete otevřít soubor z Uniform Resource Identifier (URI), proveďte " +"následující kroky:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Zvolte SouborOtevřít umístění a zobrazí se dialog Otevřít umístění." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Zadejte URI souboru, který chcete otevřít." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Použijte vyskakovací seznam Kódování znaků k zadání " +"správného kódování znaků." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Klikněte na Otevřít." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Platné typy URI zahrnují http:, ftp:, file: a všechny další " +"metody podporované mate-vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Soubory z některých typů URI se otevírají v pouze pro čtení a pokud chcete " +"uložit změny, musíte tak provést na jiné místo. Konkrétně HTTP umožňuje " +"soubory pouze číst. Soubory otevřené z FTP jsou pouze pro čtení, protože ne " +"všechny FTP servery pracují korektně s ukládáním vzdálených souborů." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Ukládání na FTP servery můžete povolit v Editoru nastavení " +"nastavením klíče /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, ale může to způsobovat chyby." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Práce s kartami." + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Pokud je otevřený víc než jeden soubor, gedit " +"vytvoří v zobrazovací oblasti pro každý dokument kartu. Mezi dokumenty se přepíná kliknutím na kartu." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Dokumenty můžete přesouvat mezi okny gedit, stačí " +"jednoduše přetáhnout příslušnou kartu myší do kterého okna chcete." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Pokud chcete dokument přesunout do nového okna gedit, tak přesuňte příslušnou kartu myší na plochu a nebo zvolte " +"DokumentyPřesunout do nového " +"okna." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Práce s textem" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Úprava textu" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Text souboru můžete upravovat následujícími postupy:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Psát na klávesnici nový text. Psát se bude v místě, kde bliká " +"vkládací kurzor. Jeho pozici můžete měnit kurzorovými " +"klávesami nebo kliknutím myší." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Vybraný text zkopírujete do schránky volbou UpravitKopírovat." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Vymazat vybraný text ze souboru a zároveň ho přesunout do schránky lze " +"volbou UpravitVyjmout." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Trvale vymazat vybraný text ze souboru můžete pomocí " +"UpravitVymazat." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Obsah schránky vložíte na aktuální pozici kurzoru pomocí " +"UpravitVložit. Než můžete text vložit, musíte jej nejdříve nakopírovat nebo " +"vyjmout do schránky, ať už v gedit nebo jiné aplikaci." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Všechen text v souboru označíte volbou UpravitVybrat vše." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Vracení a opětovné provádění změn" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Pokud chcete vrátit zpět změny, které jste provedli, tak zvolte " +"UpravitZpět. Opakem k této funkci je UpravitZnovu." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Vyhledávání a nahrazování" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"V programu gedit jsou dva způsoby, jak vyhledat " +"text. Můžete použít dialog Hledat k hledání zadané " +"části textu nebo Inkrementální hledání ke zvýraznění " +"textu ve shodně s textem jak jej píšete." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Vyhledávání textu" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "" +"Pokud chcete v souboru vyhledat textový řetězec, postupujte podle " +"následujících kroků:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Zvolte HledatHledat a objeví se dialog Hledat." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Do pole Hledat zadejte řetězec, který chcete najít. " +"Můžete zadat i různé speciální znaky, jako je třeba zalomení řádku nebo " +"tabelátor, jak je uvádí ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Klikněte na Hledat a soubor se začne od současné " +"pozice kurzoru prohledávat na výskyt zadaného řetězce. Jakmile " +"gedit najde první výskyt, tak nalezený řetězec " +"vybere. Ostatní výskyty se zvýrazní." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Další výskyty najdete opětovným kliknutím na Hledat " +"nebo přes HledatHledat " +"následující. Předchozí výskyt řetězce se hledá " +"volbou HledatHledat předchozí." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Hledat výskyty řetězce funkcemi HledatHledat následující a " +"HledatHledat předchozí můžete i po zavření dialogu Hledat." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Pokud už nechcete mít v textu zvýrazněné výskyty hledaného řetězce, musíte " +"použít HledatZrušit " +"zvýrazňování." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Inkrementální vyhledávání" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"Inkrementální vyhledávání zvýrazňuje shodný text v dokumentu tak, jak jej " +"píšete písmenko po písmenku. (Funguje to podobně jako vyhledávání v " +"některých webových prohlížečích.)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Inkrementální vyhledávání začnete pomocí HledatInkrementální hledání. V " +"horní části zobrazovací plochy se objeví vyhledávací políčko." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Stačí začít psát a v textu se budou zvýrazňovat shody. První výskyt od " +"pozice kurzoru se navíc i vybere." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Pokud chcete výběr posunout na následující shodný text a přitom nechat " +"zobrazené políčko inkrementálního vyhledávání, tak stiskněte " +"CtrlG. Zpět na " +"předchozí výskyt přesunete výběr stiskem CtrlShiftG." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Pro pohyb mezi nalezenými výskyty řetězce můžete použít i klávesové šipky " +"nahoru a dolů nebo kolečko myši." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Nahrazování textu" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Pokud chcete v souboru řetězec najít a nahradit jej jiným řetězcem, " +"postupujte následovně:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Zvolte HledatNahradit a zobrazí se dialog Nahradit." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Do pole Hledat zadejte řetězec, který chcete najít. " +"Můžete zadat i různé speciální znaky, jako je třeba zalomení řádku nebo " +"tabelátor, jak je uvádí ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Řetězec, kterým chcete nahrazovat nalezený řetězec, zadejte do pole " +"Nahradit za." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Pokud chcete každý nalezený výskyt řetězce před jeho nahrazení zkontrolovat, " +"klikněte na Hledat. Pokud gedit řetězec nalezne, tak jej vybere. Vy potom kliknete na " +"Nahradit a vybraný řetězec se nahradí. Pro " +"pokračování na další výskyt řetězce klikněte znovu na Hledat." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Jestliže chcete nahradit úplně všechny výskyty řetězce v celém dokumenty, " +"tak klikněte na Nahradit vše." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Volby vyhledávání a nahrazování" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Oba dialog Hledat i Nahradit mají " +"následující volby:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Volbu Rozlišovat velikost písmen vyberte jen v případě, " +"že chcete hledat výskyt řetězců, které se shodují i velikostí písmen. " +"Například s touto zapnutou volbou slovo „TEXT“ neodpovídá slovu „text“." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Volbu Hledat pouze celá slova vyberte jen v případě, že " +"chcete hledat výskyty, které odpovídají hledanému textu jako samostatné " +"slovo. Například se zapnutou touto volbou slovo „text“ neodpovídá slovu " +"„textura“." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Volba Hledat pozpátku způsobí, že se bude hledat od " +"pozice kurzoru směrem k začátku dokumentu." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Volba Přecházet přes okraj způsobí, že po dosažení " +"konce dokumentu bude hledání pokračovat od opačného konce dokumentu." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Speciální znaky" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"Pro vyhledávání nebo nahrazování speciálních znaků můžete zadávat " +"následující escape sekvence:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Představuje znak NL (nový řádek)." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Představuje znak tabelátor." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Představuje znak CR (na začátek řádku)" + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"Znak zpětné lomítko musí být ošetřený jako escape sekvence. Pokud chcete " +"například najít řetězec „\\n“, musíte do pole " +"Hledat zadat „\\\\n“. Jednoduše řečeno, každé zpětné " +"lomítko, které hledáte, musíte zadat zdvojeně." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Umístění kurzoru na zadaný řádek" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Pokud hodláte přesunout kurzor na určitý řádek v aktuálním souboru, použijte " +"HledatPřejít na řádek. V horní části zobrazovací plochy se objeví " +"políčka na zadání čísla řádku." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Jakmile začnete psát číslo řádku, na který chcete kurzor přesunout, začne se " +"dokument posouvat na zadaný řádek." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Zadání dokončíte stiskem Return. Poličko zmizí a kurzor se " +"přesune na zadaný řádek." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Tisk" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Nastavení voleb stránky" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Pro nastavení voleb stránky vyberte SouborNastavení stránky a objeví " +"se dialog Nastavení stránky." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"V dialogu Nastavení stránky můžete upravovat " +"následující volby pro stránku:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Karta Všeobecné" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Tisk zvýrazňování syntaxe" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Zvolte tuto možnost, pokud chcete tisknout zvýrazněnou syntaxi. Více " +"informací o zvýrazňování syntaxe podává ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Tisk záhlaví stránky" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Touto volbou zajistíte tisk záhlaví na každé vyjeté stránce. Vzhled záhlaví " +"nelze nastavit." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "Čísla řádků" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Zvolte Tisknout čísla řádků, aby se při tisku souboru " +"před každý řádek umístilo jeho číslo." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Použijte číselné pole Číslo každých ... řádků k určení, " +"jak často se mají čísla řádků tisknout. Například na každém 5 řádku, každém " +"10 řádku atd." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1176(guilabel) C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "Zalamování textu" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Zvolte Povolit zalamování textu, aby se při tisku " +"souboru text zalamoval na úrovni znaků na nové řádky. Zalamování nemá vliv " +"na číslování řádků, zlámaný řádek se počítá jako jeden." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Zvolte Nerozdělovat slova na dva řádky, aby se text při " +"tisku souboru zalamoval na další řádek na úrovni slov." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Písma" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Tělo" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Klikněte na toto tlačítko, abyste mohli vybrat písmo použité pro tisk těla " +"textu." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Čísla řádků" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Klikněte na toto tlačítko, abyste mohli vybrat písmo použité pro tisk čísel " +"řádků." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Záhlaví a zápatí" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Klikněte na toto tlačítko, abyste mohli vybrat písmo použité pro tisk " +"záhlaví a zápatí." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Výchozí písma pro tisk souborů z gedit nastavíte " +"zpátky kliknutím na Obnovit výchozí písma." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Tisk dokumentu" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"V gedit můžete provádět následující tiskové " +"operace:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Tisk dokumentu na tiskárnu" + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Tisk výstupu zpracování tisku do souboru" + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Pokud tisknete do souboru, gedit posílá výstup " +"do souboru v předtiskovém formátu. Nejběžnější předtiskové formáty jsou " +"PostScript a Portable Document Format (PDF)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Náhled stránek, které chcete tisknout, můžete zobrazit pomocí " +"SouborNáhled před tiskem." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Tisk současného souboru na tiskárnu nebo do souboru začnete volbou " +"SouborTisk, která vám zobrazí dialog Tisk." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"Dialog Tisk vám dovoluje přizpůsobit následující " +"nastavení:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Karta Úloha" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Rozsah tisku" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Zvolte jednu z následujících možností pro určení, které stránky vytisknout:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Vše" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Tato volba způsobí vytisknutí všech stránek souboru." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Řádky" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Touto volbou vytisknete jen určené řádky. V polích Od a " +"do zadejte rozsah stránek." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Výběr" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Tato volba způsobí, že se vytiskne jen vybraný text. Dostupná je ale jen v " +"případě, že nějaký text vybraný je." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Kopie" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"V poli Kopie můžete zadat kolik kopií souboru chcete " +"vytisknout." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Pokud tisknete více kopií souboru, můžete volbou Setřídit zajistit, že se stránky správně seřadí." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Karta Tiskárna" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Tiskárna" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Použijte tento vyskakovací seznam k výběru tiskárny, na kterou chcete soubor " +"vytisknout." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Nastavení" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "V seznamu si zvolte nastavení tiskárny." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Pokud chcete nastavení tiskárny upravit, klikněte na Nastavit. Můžete například povolit nebo zakázat oboustranný tisk nebo " +"naplánovat zpožděný tisk, pokud tiskárna tyto věci podporuje." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Místo" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"V tomto seznamu vyberte z následujících možností, kam se má tisk provést:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Tisknout soubor na tiskárnu CUPS." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Pokud je vybraná tiskárna tiskárnou CUPS, pak je CUPS " +"jedinou nabízenou volbou v tomto seznamu." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Tisknout soubor na tiskárnu." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Soubor" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Tisknut soubor do souboru formátu PostScript." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Kliknutím na Uložit jako se zobrazí dialog, ve kterém " +"můžete zadat název a umístění souboru formátu PostScript." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Uživatelský" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Použít zadaný příkaz pro tisk do souboru." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Do textového pole zadejte název příkazu. Včetně všech voleb příkazového " +"řádku." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Stav" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Tato funkcionalita není v této verzi gedit podporovaná." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Typ" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Komentář" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Karta Papír" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Velikost papíru" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"V tomto vyskakovacím seznamu si zvolte velikost papíru, na který hodláte " +"tisknout." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Šířka" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"V tomto poli můžete zadat šířku papíru. V přiléhajícím seznamu můžete zvolit " +"jednotky, v kterých budete rozměry zadávat." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Šířka" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "V tomto poli můžete zadat výšku papíru." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Orientace podavače" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"V tomto vyskakovacím seznamu zadejte, jak je natočený papír v podavači." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Orientace papíru" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "" +"V tomto vyskakovacím seznamu zvolte, jaká má být orientace papíru pro tisk." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Rozvržení" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Použijte tento vyskakovací seznam k volbě rozvržení stránky. V " +"Náhledu se vám ukazuje, jak zvolené rozvržení vypadá." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Zdroj papíru" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "" +"V tomto vyskakovacím seznamu můžete zvolit, ze kterého podavače bude " +"tiskárna brát papír." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Programátorské funkce" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Několik programátorských funkcí je v gedit " +"nabízeno v podobě zásuvných modulů. Například zásuvný modul Seznam tagů " +"poskytuje seznam nejpoužívanějších tagů pro různé značkovací jazyky: viz " +"." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Zvýrazňování syntaxe" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"Zvýrazňování syntaxe usnadňuje čtení zdrojového kódu díky různobarevnému " +"rozlišení částí textu." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit zvolí příslušné zvýrazňování syntaxe na " +"základě typu dokumentu. Režim můžete ručně přenastavit volbou " +"ZobrazitRežim zvýrazňování a následným výběrem z nabídek:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Prostý text" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Nezobrazuje žádné zvýraznění syntaxe." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Zdrojové kódy" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Zobrazuje zvýraznění syntaxe pro zdrojové kódy. V podnabídce " +"Zdrojové kódy zvolte typ zdrojového kódu." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Značky" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Zobrazuje zvýraznění syntaxe pro značkovací jazyky. V podnabídce " +"Značky zvolte typ značkovacího jazyka." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Skripty" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Zobrazuje zvýraznění syntaxe pro skriptovací jazyky. V podnabídce " +"Skripty zvolte typ skriptovacího jazyka." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Jiné" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Zobrazuje zvýraznění syntaxe pro ostatní kód. V podnabídce Jiné zvolte typ kódu." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Propojení výstupu příkazu do souboru" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Můžete gedit použít k propojení výstupu příkazu " +"do textového souboru. Například chcete dostat do textového souboru výstup " +"příkazu ls, tak stačí napsat ls | gedit a stisknout Return." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Výstup příkazu ls se zobrazí jako nový textový soubor v " +"okně gedit." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Případně lze použít i zásuvný modul Externí nástroje, který propojí výstup příkazu do současného souboru." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Klávesové zkratky" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Používejte klávesové zkratky pro provádění běžných úkonů rychleji než " +"kdybyste pracovali s myší a nabídkami. Následující tabulky uvádějí klávesové " +"zkratky aplikace gedit." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Více o klávesových zkratkách viz Uživatelská příručka k pracovnímu prostředí." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "Tabelátory" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Klávesové zkratky pro karty:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) C/gedit.xml:1052(para) C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "Klávesová zkratka" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) C/gedit.xml:1054(para) C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "Příkaz" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Přepnout na následující kartu vlevo." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Přepnout na následující kartu vpravo." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Zavřít kartu." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Uložit všechny karty." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Zavřít všechny karty." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Přepnout na n-tou kartu." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Soubory" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Klávesové zkratky pro práci se soubory:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Vytvořit nový dokument." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Otevřít dokument." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Otevřít umístění." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Uložit současný dokument na disk." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Uložit současný dokument pod novým názvem." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Vytisknout současný dokument." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Zobrazit náhled před tiskem." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Zavřít současný dokument." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Ukončit Gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "Úprava" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Klávesové zkratky pro úpravu dokumentu:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Vrátit zpět poslední provedený úkon." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Znovu provést naposledy zpět vrácený úkon." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Vyjmout vybraný text nebo oblast a vložit ji do schránky." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Zkopírovat vybraný text nebo oblast do schránky." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Vložit obsah ze schránky." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Vybrat vše." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Odstranit aktuální řádek." + +#: C/gedit.xml:1003(para) +msgid "Alt + Up" +msgstr "Alt + Up" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "Přesune vybraný řádek o řádek nahoru." + +#: C/gedit.xml:1007(para) +msgid "Alt + Down" +msgstr "Alt + Down" + +#: C/gedit.xml:1008(para) +msgid "Move the selected line down one line." +msgstr "Přesune vybraný řádek o řádek dolů." + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "Panely" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Klávesové zkratky pro zobrazování a skrývání panelů:" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "Zobrazit/skrýt postranní panel." + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "Zobrazit/skrýt spodní panel." + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "Vyhledávání" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "Klávesové zkratky pro vyhledávání:" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "Hledat řetězec." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "Hledat následující výskyt téhož řetězce." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "Hledat předchozí výskyt téhož řetězce." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "Interaktivní inkrementální vyhledávání." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "Vyhledat a nahradit." + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "Zrušit zvýrazňování." + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "Přejít na řádek." + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "Nástroje" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "Klávesové zkratky pro nástroje:" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "Zkontrolovat pravopis (se zásuvným modulem)" + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Odstranit koncové mezery (se zásuvným modulem)" + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "Odsadit (se zásuvným modulem)" + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "Zrušit odsazení (se zásuvným modulem)" + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Spustit „make“ v aktuální složce (se zásuvným modulem)" + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "Výpis složky (se zásuvným modulem)" + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "Nápověda" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "Klávesové zkratky pro nápovědu:" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "" +"Otevřít uživatelskou příručku k aplikaci gedit" + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "Volby" + +#: C/gedit.xml:1164(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Pokud si potřebujete gedit nastavit, zvolte " +"UpravitVolby. Dialog Volby aplikace gedit obsahuje " +"následující karty:" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "Volby na kartě Zobrazit" + +#: C/gedit.xml:1178(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Zvolte Povolit zalamování textu, pokud chcete, aby se " +"příliš dlouhé řádky textu zalomily do odstavce místo toho, aby přetékaly za " +"okraj okna. Díky tomu nemusíte používat vodorovný posuvník." + +#: C/gedit.xml:1179(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Zvolte Nerozdělovat slova na dva řádky, pokud chcete " +"zabránit rozdělení celého slova na dva řádky v případě dlouhých řádků. Díky " +"tomu je text lépe čitelný." + +#: C/gedit.xml:1185(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Zvolte Zobrazovat čísla řádků, pokud chcete na levé " +"straně okna vypisovat čísla řádků." + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "Aktuální řádek" + +#: C/gedit.xml:1191(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Zvolte Zvýrazňovat aktuální řádek, pokud chcete " +"zvýraznit řádek, na kterém se nachází kurzor." + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "Pravý okraj" + +#: C/gedit.xml:1197(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Zvolte Zobrazovat pravý okraj, pokud chcete vykreslovat " +"svislou čáru naznačující pravý okraj." + +#: C/gedit.xml:1198(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"V poli Pravý okraj ve sloupci můžete určit umístění " +"čáry označující pravý okraj." + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "Odpovídající závorky" + +#: C/gedit.xml:1204(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Zvolte Zvýrazňovat odpovídající závorku, pokud chcete " +"zvýraznit odpovídající závorku do páru v situaci, kdy se kurzor nachází na " +"znaku závorky." + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "Volby na kartě Editor" + +#: C/gedit.xml:1217(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Použijte pole Šířka tabelátorů k určení šířky místa, " +"které gedit vloží, pokud stisknete klávesu " +"Tab." + +#: C/gedit.xml:1218(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Zvolte Vkládat mezery místo tabelátorů, pokud chcete, " +"aby gedit vkládal mezery místo znaku tab, ve " +"chvíli, kdy stisknete klávesu Tab." + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "Automatické odsazování" + +#: C/gedit.xml:1224(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Zvolte Povolit automatické odsazování, pokud chcete, " +"aby se po přechodu na nový řádek nastavilo stejné odsazení jako u aktuálního." + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "Ukládání souborů" + +#: C/gedit.xml:1230(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Zvolte Vytvářet záložní kopii souborů před uložením, " +"pokud chcete vytvářet záložní kopii souboru pokaždé, když soubor uložíte. " +"Záložní kopie souboru obsahuje na konci názvu znak ~." + +#: C/gedit.xml:1231(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Zvolte Automaticky ukládat soubory každých ... minut, " +"pokud chcete aby se aktuální soubory ukládaly v pravidelných intervalech. Do " +"číselného pole zadejte, jak často se má ukládání provádět." + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "Volby na kartě Písma a barvy" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "Písmo" + +#: C/gedit.xml:1243(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Zvolte Použít systémové písmo s pevnou šířkou, pokud " +"chcete použít výchozí systémový font s pevnou šířkou pro text v okně " +"gedit." + +#: C/gedit.xml:1244(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"Písmo editoru vám umožňuje vybrat písmo textu, pokud " +"nepoužíváte systémové. Kliknutím na tlačítko můžete vybrat typ písma a jeho " +"styl a velikost." + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "Schéma barev" + +#: C/gedit.xml:1250(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"Můžete si vybrat barevné schéma ze seznamu barevných schémat. Standardně " +"jsou nainstalovaná následující barevná schémata:" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "Classic" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Klasické barevné schéma založené na barevném schématu gvim." + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Cobalt" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "Barevné schéma do modra." + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Barevné schéma používané v editoru Kate." + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Tmavé barevné schéma dle barevné palety Tango." + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Barevné schéma využívající barevnou paletu Tango." + +#: C/gedit.xml:1283(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Můžete i přidat nové barevné schéma kliknutím na Přidat " +"a výběrem souboru s barevným schématem." + +#: C/gedit.xml:1284(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Odstranit vybrané barevné schéma lze kliknutím na Odebrat." + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "Volby na kartě Zásuvné moduly" + +#: C/gedit.xml:1292(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Zásuvné moduly přidávají do aplikace gedit " +"dodatečnou funkcionalitu. Více informací o zásuvných modulech a o tom, jak " +"používat zabudované zásuvné moduly, podává ." + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "Povolení zásuvného modulu" + +#: C/gedit.xml:1297(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Zásuvný modul gedit povolíte následujícím " +"postupem:" + +#: C/gedit.xml:1300(para) C/gedit.xml:1321(para) C/gedit.xml:1643(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Zvolte UpravitVolby." + +#: C/gedit.xml:1303(para) C/gedit.xml:1324(para) C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "Přejděte na kartu Zásuvné moduly" + +#: C/gedit.xml:1306(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "Zaškrtněte pole vedle názvu zásuvného modulu, který chcete povolit." + +#: C/gedit.xml:1309(para) C/gedit.xml:1330(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Kliknutím na Zavřít dialog Volby aplikace " +"gedit uzavřete." + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "Zakázání zásuvného modulu" + +#: C/gedit.xml:1317(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Zásuvný modul zůstane povolený i když gedit " +"ukončíte." + +#: C/gedit.xml:1318(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Zásuvný modul gedit zakážete následujícím " +"postupem:" + +#: C/gedit.xml:1327(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Zrušte zaškrtnutí pole vedle názvu zásuvného modulu, který chcete zakázat." + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "Zásuvné moduly" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "Práce se zásuvnými moduly" + +#: C/gedit.xml:1342(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Do gedit můžete další funkce doplnit povolením " +"zásuvných modulů. Zásuvný modul je přídavný program, " +"který rozšiřuje funkčnost aplikace. Zásuvné moduly přidávají do nabídek " +"gedit nové položky pro nové funkce, které " +"poskytují." + +#: C/gedit.xml:1344(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Několik zásuvných modulů je přímo součástí gedit, " +"další si můžete doinstalovat. Na webu gedit je uvedený seznam zásuvných " +"modulů třetích stran." + +#: C/gedit.xml:1345(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"K povolení a zakázání nebo jen zjištění, které zásuvné moduly jsou " +"momentálně povolené, použijte Volby " +"zásuvných modulů." + +#: C/gedit.xml:1346(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"Následující zásuvné moduly vám přináší gedit jako " +"standardní součást:" + +#: C/gedit.xml:1352(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Změnit velikost " +"písmen umožňuje změnit velikost písmen vybraného textu." + +#: C/gedit.xml:1355(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Statistika " +"dokumentu ukazuje počet řádků, slov a znaků v dokumentu." + +#: C/gedit.xml:1358(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Externí nástroje umožňuje spustit z gedit " +"externí příkaz." + +#: C/gedit.xml:1361(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Panel prohlížeče souboru vám umožní procházet své " +"soubory a složky v postranním panelu." + +#: C/gedit.xml:1364(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Odsadit řádky přidává nebo ruší odsazení u vybraných řádků." + +#: C/gedit.xml:1367(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Vložit datum/" +"čas přidá aktuální datum a čas do dokumentu." + +#: C/gedit.xml:1370(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Řádky s režimem vám umožní nastavit editační volby zvlášť pro jednotlivé " +"dokumenty a podporuje režimy ve stylu Emacs, " +"Kate a Vim." + +#: C/gedit.xml:1373(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Konzola Pythonu umožňuje spustit příkazy programovacího jazyka Python." + +#: C/gedit.xml:1376(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Úryvky vám umožní zapamatovat si často používané části textu a rychle " +"je do dokumentu vkládat." + +#: C/gedit.xml:1379(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Řadit " +"uspořádává vybrané řádky textu v abecedním pořadí." + +#: C/gedit.xml:1382(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Kontrola " +"pravopisu opravuje překlepy ve vybraném textu nebo " +"chyby v dokumentu automaticky označuje." + +#: C/gedit.xml:1385(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Seznam tagů vám usnadňuje vkládání běžně používaných tagů pro HTML a další " +"jazyky ze seznamu v postranním panelu." + +#: C/gedit.xml:1389(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"Více informací o tom, jak vytvářet zásuvné moduly, najdete na webu aplikace " +"gedit." + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "Zásuvný modul Změnit velikost písmen" + +#: C/gedit.xml:1394(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"Zásuvný modul Změnit velikost písmen mění " +"velikost písmen ve vybraném textu." + +#: C/gedit.xml:1395(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Pokud je zásuvný modul Změnit velikost písmen " +"povolený, přidají se do nabídky Upravit následující " +"položky." + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "Položka nabídky" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "Činnost" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "Příklad" + +#: C/gedit.xml:1415(guisubmenu) C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "Změnit velikost písmen" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "Vše velkými písmeny" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "Každé písmeno změní na velké." + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "" +"Tento text se změní na TENTO TEXT" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "Vše malými písmeny" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "Každé písmeno změní na malé." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "" +"Tento Text se změní na tento text" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "Invertovat velikost písmen" + +#: C/gedit.xml:1428(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "Každé malé písmeno změní na velké a každé velké písmeno na malé." + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" +"Tento Text se změní na tENTO tEXT" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "Začátky slov velkými písmeny" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "První písmeno každého slova změní na velké, ostatní na malé." + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "" +"tento text se změní na Tento Text" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "Zásuvný modul Statistika dokumentu" + +#: C/gedit.xml:1445(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"Zásuvný modul Statistika dokumentu počítá řádky, " +"slova, znaky včetně mezer, znaky vyjma mezer a bajty v aktuálním souboru. " +"Výsledky zásuvný modul zobrazuje v dialogu Statistika dokumentu. Pokud chcete využít tento zásuvný modul, postupujte následovně:" + +#: C/gedit.xml:1447(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Zvolte NástrojeStatistika " +"dokumentu a zobrazí se dialog " +"Statistika dokumentu. Dialog obsahuje o souboru " +"následující informace:" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "Počet řádků v současném dokumentu." + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "Počet slov v současném dokumentu." + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Počet znaků v současném dokumentu, včetně mezer." + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Počet znaků v současném dokumentu, mimo mezer." + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "Počet bajtů v současném dokumentu." + +#: C/gedit.xml:1467(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Můžete v gedit pokračovat v další práci se " +"souborem a dialog Statistika dokumentu přitom nechat " +"otevřený. Obsah dialogu občerstvíte kliknutím na tlačítko " +"Aktualizovat." + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "Zásuvný modul Externí nástroje" + +#: C/gedit.xml:1475(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"Zásuvný modul Externí nástroje slouží ke " +"spouštění externích příkazů z aplikace gedit. " +"Příkazu můžete předat nějaký obsah a využít jeho výstup (např. " +"sed) nebo spustit předefinovaný příkaz (např. " +"make)." + +#: C/gedit.xml:1476(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Pro vytváření a úpravu příkazů použijte Správce externích " +"nástrojů. Spustit externí příkazy můžete z nabídky " +"Nástroje" + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "Zabudované příkazy" + +#: C/gedit.xml:1480(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"Se zásuvným modulem Externí nástroje jsou " +"dodávané následující příkazy:" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Sestavit" + +#: C/gedit.xml:1484(para) +msgid "" +"Runs make in the current document's directory." +msgstr "Spustí make ve složce současného souboru." + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "Výpis složky" + +#: C/gedit.xml:1489(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "Vypíše do nového dokumentu obsah složky současného dokumentu." + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "Proměnné prostředí" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Zobrazí ve spodním panelu seznam proměnných prostředí." + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Vyhledá termín pomocí srovnání vzorků ve všech souborech nacházejících se ve " +"složce současného dokumentu. Výsledek se zobrazí ve spodním panelu." + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "Odstranit koncové mezery" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Odstraní v dokumentu všechny mezery z konců řádků." + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "Definování příkazu" + +#: C/gedit.xml:1512(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Přidat lze externí příkazy volbou NástrojeExterní nástroje." + +#: C/gedit.xml:1513(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"V okně Správce externích nástrojů klikněte na " +"Nový. U nového příkazu můžete zadat následující údaje:" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "Popis" + +#: C/gedit.xml:1517(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"Popis se ukáže ve stavovém řádku ve chvíli, kdy příkaz vyberete v nabídce." + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "Klávesová zkratka" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Zadejte klávesovou zkratku pro příkaz." + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "Příkazy" + +#: C/gedit.xml:1527(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Vlastní příkaz, který se má spouštět. Pokud potřebujete příkazu předat " +"údaje, můžete použít několik proměnných prostředí definovaných programem " +"gedit: viz ." + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "Vstup" + +#: C/gedit.xml:1532(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Obsah, který lze předat příkazu (přes standardní vstup stdin): celý text současného dokumentu, současný výběr, řádek nebo " +"slovo." + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "Výstup" + +#: C/gedit.xml:1537(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Co lze udělat s výstupem příkazu: zobrazit ve spodním panelu, vložit do " +"nového dokumentu nebo vložit do současného dokumentu na konec, na aktuální " +"pozici nebo nahradit výběr nebo celý dokument." + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "Použitelnost" + +#: C/gedit.xml:1542(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Určuje, jakou kategorie dokumentů může příkaz zpracovávat, např. zda jsou " +"uložené nebo ne, místní nebo vzdálené apod." + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "Úprava a odstraňování nástrojů" + +#: C/gedit.xml:1551(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Pokud chcete nástroj upravit, zvolte jej v seznamu a změňte jeho vlastnosti." + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "" +"Pokud chcete nástroj přejmenovat, klikněte na něj v seznamu ještě jednou." + +#: C/gedit.xml:1553(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Pokud chcete zabudovaný nástroj vrátit do původního stavu, klikněte na " +"Vrátit." + +#: C/gedit.xml:1554(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Pokud chcete nástroj odstranit, vyberte jej v seznamu a stiskněte " +"Odstranit. Zabudované nástroje odstranit nelze, pouze " +"ty, které jste vytvořili." + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "Proměnné" + +#: C/gedit.xml:1559(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"V definici příkazu v poli Příkazy můžete použít " +"následující proměnné:" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "Zásuvný modul Panel prohlížeče souborů" + +#: C/gedit.xml:1588(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Zásuvný modul Panel prohlížeče souborů zobrazuje " +"vaše soubory a složky v postranním panelu, což vám umožňuje rychle otevírat " +"soubory." + +#: C/gedit.xml:1589(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Prohlížeč souborů zobrazíte volbou ZobrazitPostranní panel a následným " +"kliknutím na kartu s ikonou Prohlížeče souborů dole na postranním panelu." + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "Procházení vašich souborů" + +#: C/gedit.xml:1592(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"Na kartě prohlížeče souborů jsou v počátečním stavu zobrazené záložky ze " +"správce souborů. Obsah kterékoliv z nich zobrazíte dvojitým kliknutím na ní." + +#: C/gedit.xml:1593(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Rodičovskou složku zobrazíte buď výběrem s vyskakovacího seznamu nebo " +"zmáčknutím šipky nahoru na panelu nástrojů prohlížeče souborů." + +#: C/gedit.xml:1594(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Složku, která obsahuje dokument, na kterém právě pracujete, zobrazíte " +"kliknutím pravým tlačítkem v seznamu souborů a následnou volbou " +"Nastavit kořen podle aktivního dokumentu." + +#: C/gedit.xml:1598(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Pro otevření souboru v gedit postačí dvojitě " +"kliknout na soubor v seznamu." + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "Vytváření souborů a složek" + +#: C/gedit.xml:1602(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Pokud chcete vytvořit nový prázdný textový soubor v aktuální složce " +"zobrazené v prohlížeči, klikněte pravým tlačítkem v seznamu souborů a zvolte " +"Nový soubor." + +#: C/gedit.xml:1603(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Pokud chcete vytvořit novou složku v aktuální složce zobrazené v prohlížeči, " +"klikněte pravým tlačítkem v seznamu souborů a zvolte Nová " +"složka." + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "Zásuvný modul Odsadit řádky" + +#: C/gedit.xml:1609(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"Zásuvný modul Odsadit řádky přidá nebo odstraní " +"mezery ze začátku textového řádku." + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Pro odsazení nebo přiražení textu proveďte následující kroky:" + +#: C/gedit.xml:1612(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Vyberte řádky, který chcete odsadit. Pokud chcete odsadit nebo přirazit jen " +"jeden řádek, stačí na něj umístit textový kurzor." + +#: C/gedit.xml:1617(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Text odsadíte pomocí UpravitOdsadit." + +#: C/gedit.xml:1620(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Odsazení zrušíte pomocí UpravitZrušit odsazení." + +#: C/gedit.xml:1625(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"Počet mezer a zda se mají použít mezery nebo tabelátor, je závislé na " +"nastavení Tabelátory ve volbách editoru: viz ." + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "Zásuvný modul Vložit datum/čas" + +#: C/gedit.xml:1631(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Zásuvný modul Vložit datum/čas vkládá současné " +"datum a čas do dokumentu. Tento zásuvný modul se používá následovně:" + +#: C/gedit.xml:1633(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Zvolte UpravitVložit datum a " +"čas." + +#: C/gedit.xml:1634(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Pokud nemáte zásuvný modul Vložit datum/čas nastavený tak, aby vkládal datum/" +"čas automaticky bez ptaní na formát, gedit " +"zobrazí dialog Vložit datum a čas. Ze seznamu si " +"vyberte požadovaný formát data/času. Klikněte na Vložit, dialog se zavře a gedit vloží datum/" +"čas do aktuálního souboru na pozici kurzoru." + +#: C/gedit.xml:1635(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Pokud máte gedit nastavený tak, aby používal " +"konkrétní formát data/času, dialog Vložit datum a čas " +"se nezobrazí. Datum/čas se automaticky vloží na pozici kurzoru v aktuálním " +"souboru." + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Nastavení zásuvného modulu Vložit datum/čas" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Nastavení zásuvného modulu Vložit datum/čas provedete následovně:" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Zvolte zásuvný modul Vložit datum/čas." + +#: C/gedit.xml:1652(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Klikněte na Nastavit zásuvný modul pro zobrazení " +"dialogu Nastavit zásuvný modul pro vložení data a času." + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "Vyberte jednu z následujících možností:" + +#: C/gedit.xml:1657(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Pokud chcete při každém vkládání data/času určovat jeho formát, zvolte si " +"Zeptat se na formát" + +#: C/gedit.xml:1660(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Pokud chcete při každém vkládání data/času použít stejný v " +"gedit předdefinovaný formát, zvolte " +"Použít vybraný formát a vyberte jeden z formátů v " +"seznamu. Při této volbě se vás gedit nebude při " +"vkládání dat/času na nic dotazovat." + +#: C/gedit.xml:1663(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Pokud chcete při každém vkládání data/času použít stejný uživatelský formát, " +"zvolte Použít vlastní formát a do textového pole " +"zadejte požadovaný formát. Pro více informací, jak formát definovat se " +"podívejte na strftime3. Při této volbě se vás gedit nebude při vkládání dat/času na nic dotazovat." + +#: C/gedit.xml:1668(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Kliknutím na OK dialog Nastavit zásuvný " +"modul pro vložení data a času zavřete." + +#: C/gedit.xml:1671(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Dialog Volby zavřete kliknutím na Zavřít." + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Zásuvný modul Řádky s režimem" + +#: C/gedit.xml:1679(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Zásuvný modul Řádky s režimem vám umožní nastavit " +"volby pro jednotlivé dokumenty. Řádka s režimem je " +"řádek textu na začátku nebo konci dokumentu obsahující nastavení, která " +"gedit rozpoznává." + +#: C/gedit.xml:1680(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Volby nastavené s použitím řádků s režimem mají přednost před stejnými " +"volbami zadanými v dialogu Volby." + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "V řádcích s režimem můžete nastavit následující volby:" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Šířka tabelátoru" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "Šířka odsazení" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "Vkládání mezer místo tabelátorů" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "Šířka pravého okraje" + +#: C/gedit.xml:1700(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Zásuvný modul Řádky s režimem podporuje " +"podmnožinu voleb používaných ostatními textovými editory Emacs, Kate a Vim." + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Řádky s režimem ve stylu Emacs" + +#: C/gedit.xml:1704(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"První dva řádky dokumentu se zkoumají na řádky s režimem Emacs." + +#: C/gedit.xml:1705(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Z Emacs jsou podporované volby tab-width, indent-" +"offset, indent-tabs-mode a autowrap. Více informací je v GNU Emacs " +"Manual." + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Řádky s režimem ve stylu Kate" + +#: C/gedit.xml:1709(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"První dva řádky dokumentu se zkoumají na řádky s režimem Kate." + +#: C/gedit.xml:1710(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Z Kate jsou podporované volby tab-width, indent-" +"width, space-indent, word-wrap and word-wrap-column. Více informací je na " +"webu Kate." + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Řádky s režimem ve stylu Vim" + +#: C/gedit.xml:1714(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"První dva řádky dokumentu se zkoumají na řádky s režimem Vim." + +#: C/gedit.xml:1715(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Z Vim jsou podporované volby et, expandtab, ts, " +"tabstop, sw, shiftwidth, wrap, and textwidth. Více informací je na webu Vim." + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Zásuvný modul Konzola Pythonu" + +#: C/gedit.xml:1721(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Zásuvný modul Konzola Pythonu vám umožňuje " +"spouštět příkazy programovacího jazyka Python z prostředí " +"gedit. Po povolení tohoto zásuvného modulu se " +"přidá karta do spodního panelu. Na ní se zobrazují poslední výstupy a a " +"výzva k příkazu." + +#: C/gedit.xml:1722(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Příkazy zadané do konzoly Pythonu se před spuštěním nekontrolují. Proto " +"mohou způsobit zatuhnutí celé aplikace gedit, " +"například když zadáte nekonečnou smyčku." + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "Zásuvný modul Úryvky" + +#: C/gedit.xml:1727(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"Zásuvný modul Úryvky vám umožňuje uložit si často " +"používané části textu nazývané úryvky a rychle je " +"vkládat do dokumentu." + +#: C/gedit.xml:1728(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Úryvky závisí na jazykové syntaxi aktuálního dokumentu. Například, pokud " +"pracujete v HTML dokumentu, můžete vybírat z úryvků použitelných pro HTML. " +"Některé úryvky jsou ale globální a lze je použít ve všech dokumentech." + +#: C/gedit.xml:1729(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Množství zabudovaných úryvků se nainstaluje spolu s aplikací " +"gedit, ale můžete si je upravovat." + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "Vložení úryvku" + +#: C/gedit.xml:1733(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Úryvek do dokumentu vložíte tak, že napíšete jeho spouštěč " +"tabelátoru a zmáčknete Tab. Spouštěčem " +"tabelátoru je obvykle pár prvních písmen z úryvku nebo jiný krátký a snadno " +"zapamatovatelný text." + +#: C/gedit.xml:1734(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Respektive můžete zmáčknout CtrlSpace pro zobrazení seznamu úryvků, které můžete vložit." + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "Přidání úryvku" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "Nový úryvek vytvoříte následovně:" + +#: C/gedit.xml:1742(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Zvolte NástrojeSpravovat úryvky. Otevře se okno Správce úryvků." + +#: C/gedit.xml:1745(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"Seznam úryvků je seskupený podle jazyků. Zvolte jazyk, do kterého chcete " +"úryvek přidat, nebo nějaký úryvek náležející do onoho jazyka. Pokud chcete " +"přidat úryvek pro všechny jazyky, musíte použít skupinu Globální na začátku " +"seznamu. Skupina odpovídající syntaxi dokumentu, který právě upravujete, se " +"na začátku přímo nabídne." + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Klikněte na Nový. Nový úryvek se objeví v seznamu." + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "U nového úryvku zadejte následující informace:" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "Název" + +#: C/gedit.xml:1755(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Zadejte název úryvku v textovém poli v seznamu úryvků. Název úryvku slouží " +"pouze k označení jeho účelu. Název vytvořeného úryvku můžete změnit " +"kliknutím na vybraný název v seznamu." + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "Text úryvku" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Do textového pole Upravit zadejte text úryvku. Můžete " +"použít speciální kódy, jak je uvádí ." + +#: C/gedit.xml:1761(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Můžete se přepnout zpátky do okna s dokumentem, abyste si zkopírovali text, " +"i bez zavření Správce úryvků." + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Spouštěč tabelátoru" + +#: C/gedit.xml:1766(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Zadejte spouštěč tabelátoru pro úryvek. Jedná se o text, který musíte zadat, " +"než můžete zmáčknout Tab pro vložení úryvku." + +#: C/gedit.xml:1767(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Značka musí být samostatné slovo skládající se pouze z písmen nebo " +"samostatný znak. V případě, že zadáte neplatný Spouštěč " +"tabelátoru, tak zčervená." + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "Klávesová zkratka" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Zapište klávesovou zkratku použitelnou pro vložení úryvku." + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "Úprava a odstranění úryvků" + +#: C/gedit.xml:1782(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Upravit úryvek můžete tak, že jej vyberete v seznamu a změníte jeho text a " +"spouštěcí vlastnosti." + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "" +"Pokud chcete vybraný úryvek přejmenovat, tak na něj ještě jednou klikněte." + +#: C/gedit.xml:1784(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Jestliže jste zabudovaný úryvek změnili a chcete jej vrátit do původního " +"stavu, zmáčkněte Vrátit." + +#: C/gedit.xml:1785(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Když chcete úryvek odstranit, tak jej vyberte v seznamu a zmáčkněte " +"Odstranit. Nelze odstranit zabudované úryvky, pouze " +"ty, které jste vytvořili." + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "Náhrady v úryvcích" + +#: C/gedit.xml:1790(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Mimo vkládání uloženého textu mohou úryvky obsahovat přizpůsobitelný text " +"nebo rezervované místo, na které doplníte text až po vložení úryvku do " +"dokumentu." + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "V úryvcích můžete použít následující zástupné kódy:" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Tabelátorový zástupce" + +#: C/gedit.xml:1798(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n definuje tabelátorového " +"zástupce, kde n je číslo větší než 1." + +#: C/gedit.xml:1799(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} definuje tabelátorového zástupce s výchozí hodnotou." + +#: C/gedit.xml:1800(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Tabelátorový zástupce označuje v textu úryvku místo, na které můžete po " +"vložení úryvku doplnit dodatečný text." + +#: C/gedit.xml:1801(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Tabelátorového zástupce použijete tak, že úryvek normálně vložíte. Kurzor se " +"umístí na pozici prvního tabelátorového zástupce. Vepište případný text a " +"stiskem Tab se přesunete na dalšího tabelátorového " +"zástupce. Číslo tabelátorového zástupce určuje pořadí, v jakém se budete po " +"tabelátorových zástupcích pohybovat." + +#: C/gedit.xml:1802(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Stisknutím ShiftTab " +"se vrátíte na předchozího tabelátorového zástupce. Pokud stisknete " +"Tab, když už není k dispozici žádný další tabelátorový " +"zástupce, kurzor se přesune na konec úryvku nebo na koncového zástupce, " +"pokud existuje." + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Zrcadlený zástupce" + +#: C/gedit.xml:1807(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Opakování stejného tabelátorového zástupce bude zrcadlem již definovaného " +"zástupce. Potom stačí zadat text jen jednou a objeví se v úryvku vícekrát." + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "Koncový zástupce" + +#: C/gedit.xml:1812(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 definuje koncového zástupce. Ten umožňuje dokončit " +"práci s úryvkem s kurzorem na jiné pozici, než je konec textu úryvku." + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "Proměnné prostředí" + +#: C/gedit.xml:1817(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Proměnné prostředí, jako je $PATH a $HOME, se v úryvku příslušně nahradí jejich hodnotou. Navíc můžete použít " +"následující proměnné specifické pro gedit:" + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "Aktuálně vybraný text." + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Plný název souboru s dokumentem nebo prázdný řetězec v případě, že dokument " +"není doposud uložený." + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"Samotný název souboru s dokumentem bez cesty nebo prázdný řetězec v případě, " +"že dokument není doposud uložený." + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"Slovo nacházející se na pozici kurzoru v dokumentu. Pokud se použije tato " +"proměnná, tak se současné slovo nahradí textem úryvku." + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Zástupce Shell" + +#: C/gedit.xml:1846(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) se nahradí výsledkem " +"spuštění cmd v shellu." + +#: C/gedit.xml:1847(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) vám umožní se na tohoto zástupce odkazovat. n je číslo větší než 1. Použitím $n můžete zadat výstup jednoho zástupce jako vstup " +"jiného." + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Zástupce Python" + +#: C/gedit.xml:1852(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> se nahradí " +"výsledkem vyhodnocení cmd v interpretru Pythonu." + +#: C/gedit.xml:1853(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" deklaruje jiného zástupce Python jako závislost, kde " +"a určuje jeho pořadí v úryvku. To vám umožňuje " +"použít funkci Pythonu definovanou v jiném úryvku. Více závislostí zadáte " +"jako čísla oddělená čárkami takto: $<a,b:cmd>" +"" + +#: C/gedit.xml:1854(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Aby šly proměnné použít ve všech dalších úryvcích, musíte je deklarovat jako " +"global." + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "Zásuvný modul Řadit" + +#: C/gedit.xml:1864(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Zásuvný modul Řadit uspořádává vybrané řádky " +"textu v abecedním pořadí." + +#: C/gedit.xml:1865(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Operaci řadit nelze vrátit zpět, takže byste měli před provedením řazení " +"soubor uložit. K uložené verzi se můžete po seřazení vrátit pomocí " +"SouborVrátit." + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Zásuvný modul Řadit se používá následovně:" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "Vyberte řádky s textem, které chcete seřadit." + +#: C/gedit.xml:1873(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Zvolte UpravitSeřadit. Otevře se dialog Řadit." + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "Nastavte volby, jak chcete řadit:" + +#: C/gedit.xml:1879(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Aby se text uspořádal v opačném pořadí, zvolte Obrácené peřadí." + +#: C/gedit.xml:1882(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Aby se vymazaly duplicitní řádky, zvolte Odstranit duplikáty." + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Aby se ignorovala velikost písmen, zvolte Ignorovat velikost " +"písmen." + +#: C/gedit.xml:1888(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Aby se při řazení ignorovaly znaky na začátku řádku, nastavte první znak, " +"který se použije pro řazení, v poli Začít ve sloupci." + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "Operaci seřazení spustíte kliknutím na Seřadit." + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "Zásuvný modul Kontrola pravopisu" + +#: C/gedit.xml:1901(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Zásuvný modul Kontrola pravopisu kontroluje " +"překlepy ve vybraném textu. Můžete si gedit " +"nastavit tak, aby překlepy kontroloval průběžně automaticky a nebo si " +"kontrolu spouštět ručně, oboje v zadaném jazyce. Nastavený jazyk a " +"automatická kontrola se vztahují na jednotlivé dokumenty. Modul " +"Kontrola pravopisu se používá následovně:" + +#: C/gedit.xml:1903(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Zvolte NástrojeNastavit jazyk a objeví se dialog Nastavit jazyk. Vyberte si požadovaný jazyk v seznamu. Kliknutím na " +"OK dialog uzavřete." + +#: C/gedit.xml:1906(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Pokud chcete kontrolu provádět automaticky, zvolte " +"NástrojeAutomaticky kontrolovat " +"pravopis. Opětovným zvolením " +"NástrojeAutomaticky kontrolovat " +"pravopis automatickou kontrolu vypnete. Zda je " +"automatická kontrola zapnutá poznáte podle zaškrtnutí položky " +"Automaticky kontrolovat pravopis v nabídce. Po " +"každém spuštění gedit je automatická kontrola " +"standardně vypnutá." + +#: C/gedit.xml:1907(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Neznámá slova se zobrazují barevně podtržená. Můžete na ně kliknout pravým " +"tlačítkem a ve vyskakovací nabídce Návrhy pravopisu " +"provést:" + +#: C/gedit.xml:1910(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Nahrazení neznámého slova jiným slovem ze seznamu volbou navrženého slova ve " +"vyskakovací nabídce Návrhy pravopisu." + +#: C/gedit.xml:1913(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Přidání neznámého slova do osobního slovníku volbou " +"Návrhy pravopisuPřidat." + +#: C/gedit.xml:1916(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Ignorování všech výskytu tohoto neznámého slova volbou " +"Návrhy pravopisuIgnorovat vše, Slovo se potom již nebude označovat jako neznámé, " +"ale do osobního slovníku se nepřidá. Ignorování tohoto neznámého slova bude " +"platit jen pro současné sezení gedit." + +#: C/gedit.xml:1921(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Ručně kontrolu pravopisu spustíte NástrojeZkontrolovat pravopis." + +#: C/gedit.xml:1923(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Pokud v dokumentu žádná pravopisná chyba není, tak se zobrazí dialog " +"Informace se zprávou, že dokument neobsahuje žádná " +"slova s překlepy. Kliknutím na OK dialog " +"guilabel>Informace zavřete." + +#: C/gedit.xml:1925(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Pokud v dokumentu pravopisné chyby jsou, tak se zobrazí dialog " +"Kontrolovat pravopis:" + +#: C/gedit.xml:1928(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "Chybné slovo je uvedené v horní části dialogu." + +#: C/gedit.xml:1931(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Navržená správná varianta slova je zobrazená v textovém poli " +"Změnit na. Můžete ji nahradit jiným návrhem správného " +"tvaru buď výběrem ze seznamu Návrhy nebo ručním zadáním " +"slov přímo do pole Změnit na." + +#: C/gedit.xml:1934(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Překlepy textu v poli Změnit na můžete zkontrolovat " +"kliknutím na Zkontrolovat slovo. Pokud je zadané " +"slovo známé, tak se seznam Návrhů nahradí textem " +"(správný tvar). Pokud je slovo neznámé, objeví se v " +"seznamu Návrhy nové položky." + +#: C/gedit.xml:1937(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Aktuální výskyt neznámého slova můžete ignorovat kliknutím na " +"Ignorovat. Pokud chcete ignorovat veškeré výskyty " +"toho neznámého slova, tak klikněte na Ignorovat vše. " +"Neznáme slovo se bude ignorovat pouze v tomto sezení gedit." + +#: C/gedit.xml:1940(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Nahrazení výskytu neznámého slova textem v poli Změnit na provedete kliknutím na Změnit. Všechny " +"výskyty tohoto neznámého slova nahradíte textem v poli Změnit na kliknutím na Změnit vše." + +#: C/gedit.xml:1943(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Do osobního slovníku neznámé slovo přidáte kliknutím na Přidat " +"slovo." + +#: C/gedit.xml:1946(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Dialog Kontrolovat pravopis zavřete kliknutím na " +"Zavřít." + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "Zásuvný modul Seznam tagů" + +#: C/gedit.xml:1956(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Zásuvný modul Seznam tagů vám usnadní vkládání " +"běžných tagů ze seznamu v postranním panelu." + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Zásuvný modul Seznam tagů se používá následujícím způsobem:" + +#: C/gedit.xml:1959(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Zvolte ZobrazitPostranní panel." + +#: C/gedit.xml:1963(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Ve výchozím stavu postranní panel zobrazuje kartu obsahující seznam " +"otevřených dokumentů. Klikněte na kartu s ikonou „+“ v dolní části, aby se " +"zobrazil seznam tagů." + +#: C/gedit.xml:1965(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Ve vyskakovacím seznamu si vyberte správnou kategorii, např. HTML " +"- Tagy." + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Najděte si v seznamu požadovaný tag." + +#: C/gedit.xml:1971(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Tag do aktuálního souboru na pozici kurzoru vložíte dvojitým kliknutím na " +"tag v seznamu. A nebo můžete použít následující postupy:" + +#: C/gedit.xml:1973(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Vložit tag do aktuálního souboru a přepnout zaměření z postranního panelu do " +"zobrazovací oblasti stiskem Return." + +#: C/gedit.xml:1976(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Vložit tag do aktuálního souboru a zaměření ponechat v Seznamu " +"tagů stiskem ShiftReturn." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Marek Černocký , 2009.\n" +"Lucas Lommer , 2009." + diff --git a/help/cs/figures/gedit_window.png b/help/cs/figures/gedit_window.png new file mode 100755 index 00000000..12d046a9 Binary files /dev/null and b/help/cs/figures/gedit_window.png differ diff --git a/help/da/da.po b/help/da/da.po new file mode 100755 index 00000000..e42ce1a1 --- /dev/null +++ b/help/da/da.po @@ -0,0 +1,4673 @@ +# Danish translation of gedit Manual +# +# M.P. Rommedahl , 2008 +# Ask Hjorth Larsen , 2008, 09 +# +# Konventioner: +# +# display area -> visningsområde +# +# Husk at tilføje dig i credit-listen +# (besked id "translator-credits") +# +# NB. Farveskemaer som henvises til nedenfor kommer fra gtksourceview +msgid "" +msgstr "" +"Project-Id-Version: gedit Manual V.2.16\n" +"POT-Creation-Date: 2010-03-28 23:52+0200\n" +"PO-Revision-Date: 2010-03-28 19:08+0200\n" +"Last-Translator: Ask Hjorth Larsen \n" +"Language-Team: dansk-gruppen \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Danish\n" +"X-Poedit-Country: DENMARK\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Der gives tilladelse til at kopiere, distribuere og/eller ændre dette " +"dokument under betingelserne for GNU Free Documentation License (GFDL), " +"version1.1 eller enhver nyere version udgivet af Free Software Foundation " +"uden invariante afsnit, uden forsidetekster, og uden bagsidetekster. Du kan " +"findeen kopi af GFDL'en her: link, eller i filen COPYING-DOCS der distribueres 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 MATE-manualsamlingen distribueret under GFDL'en. " +"Hvis du vil distribuere denne manual separat fra denne samling, kan du gøre " +"det ved at tilføje en kopi af licensen til manualen, som beskrevet i sektion " +"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 "" +"Mange af navnene brugt af firmaer til at skelne deres produkter og tjenester " +"er betegnet som mærkevarer. Der hvor de navne optræder i en MATE-" +"dokumentation, og medlemmerne af MATE-dokumantationsprojektet er blevet " +"gjort opmærksomme på disse varemærker, så er navnene skrevet med store " +"bogstaver eller store forbogstaver." + +#: ../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 " +"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 "" +"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 " +"FORBEHOLDSERKLÆRING; OG UNDER INGEN OMSTÆNDIGHEDER OG UNDER INGEN JURIDISK " +"TEORI, UANSET OM DET ER EN BEVIDSTE SKADENDE HANDLING (INKLUSIV " +"UFORSVARLIGHED) ELLER PÅ HVILKEN SOM HELST ANDEN MÅDE, KAN FORFATTEREN, " +"SKRIBENT, BIDRAGYDERE, DISTRIBUTØRER ELLER FORSYNER 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 " +"INKLUSIV, UDEN BEGRÆNSNING, SKADE SOM FØLGE AF TAB AF RYGTE, ARBEJDSSTOP, " +"COMPUTER-FEJL 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: " +"" +msgstr "" +"DETTE DOKUMENT OG MODIFICEREDE VERSIONER GØRES TILGÆNGELIGT UNDER " +"BETINGELSERNE I GNU FREE DOKUMENTATION LICENS UNDER DEN FORUDSÆTNING AT: " +"" + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "Intet skærmbillede" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "Intet skærmbillede" + +#: ../C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Manual til gedit" + +#: ../C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: ../C/gedit.xml:26(holder) ../C/gedit.xml:45(publishername) +#: ../C/gedit.xml:56(firstname) ../C/gedit.xml:79(orgname) +#: ../C/gedit.xml:120(para) ../C/gedit.xml:128(para) ../C/gedit.xml:136(para) +#: ../C/gedit.xml:144(para) ../C/gedit.xml:152(para) ../C/gedit.xml:160(para) +#: ../C/gedit.xml:168(para) ../C/gedit.xml:176(para) ../C/gedit.xml:184(para) +#: ../C/gedit.xml:192(para) ../C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "MATE-dokumentationsprojektet" + +#: ../C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: ../C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: ../C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: ../C/gedit.xml:31(holder) ../C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: ../C/gedit.xml:33(year) ../C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: ../C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: ../C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: ../C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: ../C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: ../C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: ../C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: ../C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Tilføjede tastaturgenvej-skemaet" + +#: ../C/gedit.xml:68(firstname) ../C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java skrivebordssystems-dokumentationsholdet" + +#: ../C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: ../C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: ../C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: ../C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: ../C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: ../C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "" +"Cicek bidrog med information fra tidligere versioner af programmet gedit." + +#: ../C/gedit.xml:86(contrib) ../C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Anerkendelser" + +#: ../C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: ../C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George bidrog med information om udvidelsesmoduler." + +#: ../C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit v. 1.0" + +#: ../C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: ../C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Manual til gedit v. 2.0" + +#: ../C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Marts 2002" + +#: ../C/gedit.xml:127(para) ../C/gedit.xml:135(para) ../C/gedit.xml:143(para) +#: ../C/gedit.xml:151(para) ../C/gedit.xml:159(para) ../C/gedit.xml:167(para) +#: ../C/gedit.xml:175(para) ../C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE-dokumentationsholdet" + +#: ../C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Manual til gedit v. 2.1" + +#: ../C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Juni 2002" + +#: ../C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Manual til gedit v. 2.2" + +#: ../C/gedit.xml:141(date) +msgid "August 2002" +msgstr "August 2002" + +#: ../C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Manual til gedit v. 2.3" + +#: ../C/gedit.xml:149(date) +msgid "September 2002" +msgstr "September 2002" + +#: ../C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Manual til gedit v. 2.4" + +#: ../C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Januar 2003" + +#: ../C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Manual til gedit v. 2.5" + +#: ../C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Marts 2003" + +#: ../C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Manual til gedit v. 2.6" + +#: ../C/gedit.xml:173(date) +msgid "September 2003" +msgstr "September 2003" + +#: ../C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Manual til gedit v. 2.7" + +#: ../C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Marts 2004" + +#: ../C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Manual til gedit v. 2.8" + +#: ../C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Manual til gedit v. 2.9" + +#: ../C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "MATE-dokumentationsholdet" + +#: ../C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Denne manual beskriver version 2.16 af gedit." + +#: ../C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Feedback" + +#: ../C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"For at rapportere fejl eller foreslå forbedringer vedrørende programmet " +"gedit eller denne manual, bør du følge " +"instruktionerne på MATE-Feedbacksiden." + +#: ../C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit er et tekstredigeringsprogram for MATE-skrivebordet med basal men " +"robust funktionalitet såsom udskrivning, stavekontrol, søg og erstat og " +"synteksfremhævning. Mere avanceret funktionalitet er tilgængelig i form af " +"udvidelsesmoduler." + +#: ../C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: ../C/gedit.xml:219(primary) +msgid "text editor" +msgstr "teksredigeringsprogram" + +#: ../C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Introduktion" + +#: ../C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"Programmet gedit gør dig i stand til at oprette " +"og redigere i tekstfiler." + +#: ../C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"Målet med gedit er, at det skal være et simpelt " +"tekstredigeringsprogram, som er let at bruge. Mere avancerede funktioner kan " +"aktiveres ved hjælp af diverse udvidelsesmoduler, som " +"kan give programmet mange nye tekstredigeringsrelaterede funktioner." + +#: ../C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Kom godt i gang" + +#: ../C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Opstart af gedit" + +#: ../C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "Du kan starte gedit på følgende måder:" + +#: ../C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Menuen Programmer" + +#: ../C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Vælg TilbehørTekstredigering." + +#: ../C/gedit.xml:249(term) +msgid "Command line" +msgstr "Kommandolinje" + +#: ../C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Udfør den følgende kommando: gedit" + +#: ../C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Som standard, når du åbner et tekstdokument, vil gedit starte op og vise " +"dokumentets indhold." + +#: ../C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "gedit-vinduet" + +#: ../C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Når du starter gedit, vil det følgende vindue " +"blive vist:" + +#: ../C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "gedit-vindue" + +#: ../C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Viser gedits hovedvindue." + +#: ../C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"gedit-vinduet indeholder følgende elementer:" + +#: ../C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Menulinje" + +#: ../C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Menuerne på menulinjen indeholder alle de kommandoer du behøver for at kunne " +"arbejde med filer i gedit." + +#: ../C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Værktøjslinje" + +#: ../C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"Værktøjslinjen indeholder et udvalg af de kommandoer du kan finde i " +"menulinjen." + +#: ../C/gedit.xml:289(term) +msgid "Display area" +msgstr "Visningsområde" + +#: ../C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "Visningsområdet indeholder teksten fra den fil, som du redigerer." + +#: ../C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Statuslinje" + +#: ../C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"Statuslinjen viser information om nuværende aktivitet i gedit samt kontekstuel information om menuobjekterne. Statuslinjen " +"viser også den følgende information:" + +#: ../C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Markørplacering: linje- og kolonnenummeret hvor markøren i øjeblikket " +"befinder sig." + +# Indsatte paranteser for at lette forståelsen. "Indsæt-tilstand" og "Overskriv-tilstand" siger jo i sig selv ikke særlig meget... +#: ../C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Redigeringstilstand: Hvis programmet er i indsæt-tilstand (skubber bogstaver " +"til højre for markøren hvis du indtaster nye bogstaver), indeholder " +"statuslinjen teksten INS. Hvis programmet er i " +"overskriv-tilstand (overskriver bogstaver til højre for markøren hvis du " +"indtaster nye bogstaver), indeholder statuslinjen teksten OVR. Tryk på Insert på dit tastatur for at ændre " +"redigeringstilstand." + +#: ../C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Sidepanel" + +#: ../C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"Sidepanelet viser en liste over åbne dokumenter samt anden information " +"afhængigt af hvilke udvidelsesmoduler der er aktiveret." + +#: ../C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Sidepanelet vises ikke som standard. For at vise det skal du vælge " +"VisSidepanel." + +#: ../C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Bundpanel" + +# Og lad nu for h*** være med at ændre dette til "uddata", tak +#: ../C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Bundpanelet bruges af programmeringsværktøjer, som f.eks. udvidelsesmodulet " +"Python-konsol til at vise output." + +#: ../C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Bundpanelet vises ikke som standard. For at vise det skal du vælge " +"VisBundpanel." + +#: ../C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Når du højreklikker i gedit-vinduet, viser " +"programmet en popup-menu. Popup-menuen indeholder de oftest brugte " +"tekstredigeringskommandoer." + +#: ../C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Ligesom i andre MATE-programmer kan handlinger i gedit udføres på flere forskellige måder: med menuen, med " +"værktøjslinjen eller med genvejstasterne. Genvejstaster, som er generelle " +"for alle programmer, er vist i brugervejledningen." + +#: ../C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Opstart af gedit fra en kommandolinje" + +# Er lidt usikker på hvad tasten officielt hedder på dansk, men jeg og alle jeg kender har altid brugt "Enter" +#: ../C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Du kan køre gedit fra en kommandolinje og åbne en " +"enkelt eller flere filer. For at åbne flere filer fra en kommandolinje skal " +"du skrive den følgende kommando og afslutte med et tryk på Enter:" + +#: ../C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "fil1.txt fil2.txt fil3.txt" + +# Kommando, bør næppe oversættes +#: ../C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: ../C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Alternativt kan du angive en URI i stedet for et filnavn." + +#: ../C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"For yderligere information om hvordan du kører gedit fra en kommandolinje, se programmets unix-manual, gedit1." + +#: ../C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Arbejde med filer" + +#: ../C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Opret et nyt dokument" + +#: ../C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"For at oprette et nyt dokument skal du vælge FilNy. Programmet viser et nyt, " +"tomt dokument i gedit-vinduet." + +#: ../C/gedit.xml:346(title) ../C/gedit.xml:1589(title) +msgid "Opening a File" +msgstr "Åbn en fil" + +#: ../C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Hvis du vil åbne en eksisterende fil skal du vælge FilÅbn... for at vise dialogen " +"Åbn filer. Vælg den fil som du ønsker at åbne og klik " +"derefter på Åbn. Filen vises herefter i " +"gedit-vinduet." + +#: ../C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Viser menuikonet for Senest benyttede filer." + +#: ../C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Programmet lagrer stier og filnavne for de fem seneste filer, som du har " +"redigeret, og viser filerne som menuobjekter i menuen " +"Fil. Du kan også klikke på " +"ikonet på værktøjslinjen for at få vist listen over senest " +"benyttede filer." + +#: ../C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"Du kan åbne flere filer i gedit. Programmet " +"tilføjer et ekstra faneblad i vinduet for hver åben fil. Se for yderligere information." + +#: ../C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Gem en fil" + +#: ../C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Du kan gemme filer på følgende måder:" + +#: ../C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"For at gemme ændringer i en eksisterende fil skal du vælge " +"FilGem." + +#: ../C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"For at gemme en ny fil, eller gemme en eksisterende fil under et nyt navn, " +"skal du vælge FilGem som.... Indtast et navn til filen i dialogen " +"Gem som... og afslut med et klik på Gem." + +#: ../C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Hvis du ønsker at gemme alle de filer, som du i øjeblikket har åbne i " +"gedit, skal du vælge " +"DokumenterGem alle." + +#: ../C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"For at lukke alle de filer, som du i øjeblikket har åbne i " +"gedit, skal du vælge " +"DokumenterLuk alle." + +#: ../C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Åbn en fil fra en URI" + +#: ../C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"For at åbne en fil fra en Uniform Resource Identifier (URI) skal du gøre " +"følgende:" + +#: ../C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Vælg FilÅbn sted... for at få vist dialogen Åbn sted...." + +#: ../C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Skriv URI'en på den fil som du vil åbne." + +#: ../C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Brug rullemenuen Tegnkodning til at vælge den korrekte " +"tegnkodning." + +#: ../C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Klik Åbn." + +#: ../C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Gyldige typer af URI omfatter http:, ftp:, file:, samt alle " +"metoder som understøttes af mate-vfs." + +#: ../C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Filer fra visse typer af URI åbnes som skrivebeskyttede, og alle ændringer " +"du foretager skal gemmes i en anden placering. HTTP tillader dig kun at læse " +"filer. Filer åbnet fra FTP kan også kun læses, fordi ikke alle FTP-servere " +"kan gemme fjernfiler." + +#: ../C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"At gemme til FTP-servere kan aktiveres med Konfigurationsredigering " +"ved at sætte nøglen /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, men dette kan give fejlmeddelelser." + +#: ../C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Arbejde med faneblade" + +#: ../C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Når du har mere end en fil åben, viser gedit et " +"faneblad for hvert dokument over visningsområdet. For " +"at skifte til et andet dokument skal du blot klikke på dets faneblad." + +#: ../C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"For at flytte et dokument til et andet gedit-" +"vindue skal du trække filens faneblad til det vindue du vil flytte den til." + +#: ../C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"For at flytte et dokument til et nyt gedit-vindue " +"kan du enten trække dets faneblad ud på skrivebordet eller vælge " +"DokumenterFlyt til nyt vindue." + +#: ../C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Arbejd med tekst" + +#: ../C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Redigér i tekst" + +#: ../C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Du kan redigere teksten i en fil på følgende måder:" + +# "indsætningsmarkør" er et gæt +#: ../C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Skriv ny tekst fra tastaturet. Den blinkende indsætningsmarkør markerer det punkt hvor den nye tekst vil fremkomme. Brug " +"piletasterne på tastaturet, eller klik med musen, for at ændre dette." + +#: ../C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"For at kopiere den valgte tekst til udklipsholderen skal du vælge " +"RedigérKopiér." + +#: ../C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"For at slette den valgte tekst fra filen, og flytte den valgte tekst til " +"udklipsholderen skal du vælge RedigérKlip." + +#: ../C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"For at slette den valgte tekst permanent fra filen skal du vælge " +"RedigérSlet." + +#: ../C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"For at indsætte indholdet af udklipsholderen på det punkt, hvor markøren er " +"placeret, skal du vælge RedigérIndsæt. Du skal klippe eller " +"kopiere teksten du vil indsætte, enten fra gedit eller fra et andet program, " +"før du kan indsætte den i filen." + +#: ../C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"For at markere al tekst i en fil skal du vælge RedigérMarkér alt." + +#: ../C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Fortryd og gentag ændringer" + +#: ../C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"For at fortryde en ændring, som du har foretaget, skal du vælge " +"RedigérFortryd. For at vende denne handling om, og fortryde din fortrydelse, " +"skal du vælge RedigérGentag." + +#: ../C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Find og erstat" + +#: ../C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"I gedit er der to måder at kunne søge efter tekst " +"på. Du kan bruge dialogen Find til at søge efter et " +"specifikt stykke tekst, eller Løbende søgning... til at " +"fremhæve matchende tekst efterhånden som du skriver den." + +#: ../C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Find specifik tekst" + +#: ../C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "" +"For at søge i en fil efter et specifikt stykke tekst skal du gøre følgende:" + +#: ../C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Vælg SøgFind... for at vise dialogen Find." + +#: ../C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Skriv det tekststykke, som du ønsker at finde, i Søg efter-feltet. Din søgning kan godt indeholde specielle tegn såsom en ny " +"linje eller indryk: se ." + +#: ../C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Klik Find for at søge i filen efter første sted efter " +"den nuværende markørposition hvor den ønskede tekst figurerer. Hvis " +"gedit finder teksten, vælger programmet det " +"første sted hvor teksten forekommer. Andre forekomster af teksten fremhæves." + +#: ../C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"For at finde den næste forekomst af teksten skal du klikke på " +"Find eller vælge SøgFind næste. For at finde en " +"tidligere forekomst af teksten skal du vælge SøgFind forrige." + +#: ../C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Efter du har lukket Find-dialogen, kan du stadig flytte " +"markeringen til andre forekomster af teksten ved at vælge " +"SøgFind næste og SøgFind forrige." + +#: ../C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"For at fjerne fremhævningen af teksten skal du vælge " +"SøgRyd fremhævning." + +#: ../C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Løbende søgning" + +#: ../C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"Løbende søgning fremhæver løbende matchende tekst i dokumentet samtidigt med " +"at du skriver teksten ind bogstav for bogstav. (Dette ligner meget " +"søgefunktionen i flere webbrowsere.)" + +#: ../C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"For at starte en løbende søgning skal du vælge SøgLøbende søgning. Søgeboksen " +"kommer frem i toppen af visningsområdet." + +#: ../C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Begynd at skrive, og teksten som matcher vil blive fremhævet i dokumentet. " +"Den første forekomst efter markørens placering markeres også." + +#: ../C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"For at lade markeringen gå videre til næste match, samtidig med at du holder " +"søgeboksen åben, skal du trykke CtrlG. Tryk CtrlShiftG for at gå tilbage til den forrige match." + +#: ../C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Du kan også bruge piletasterne op og ned, eller musehjulet, til at flytte " +"markeringen mellem fundne tekststrenge der matcher." + +#: ../C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Erstat tekst" + +#: ../C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"For at søge i en fil efter en tekststreng, og erstatte denne streng med en " +"alternativ streng, skal du gøre følgende:" + +#: ../C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Vælg SøgErstat... for at vise dialogen Erstat." + +#: ../C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Indtast den tekststreng, som du ønsker at finde, i Søg efter-feltet. Du kan godt bruge specielle tegn såsom ny linje eller " +"indryk: se ." + +#: ../C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Skriv den tekststreng, som du ønsker at erstatte den gamle tekststreng med, " +"i Erstat med-feltet." + +#: ../C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"For at undersøge hver enkelt forekomst af tekststrengen før du erstatter den " +"skal du klikke på Find. Hvis gedit finder teksten markerer programmet den automatisk. Klik på " +"Erstat for at erstatte den markerede forekomst af " +"tekststrengen. For at finde den næste forekomst klikker du blot " +"Find igen." + +#: ../C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Hvis du vil erstatte alle forekomster af tekststrengen i hele dokumentet, " +"skal du klikke på Erstat alle." + +#: ../C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Indstillinger for Find og Erstat" + +#: ../C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Dialogen Find og dialogen Erstat " +"har begge følgende indstillingsmuligheder:" + +#: ../C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Vælg Forskel på små/store bogstaver for kun at finde " +"forekomster af tekststrengen, som har de korrekte små/store bogstaver. For " +"eksempel vil \"TEKST\" ikke være det samme som \"tekst\", hvis du har valgt " +"Forskel på små/store bogstaver." + +#: ../C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Vælg Søg kun efter hele ord for kun at finde " +"forekomster af strengen, som passer til de fuldstændige ord i den tekst du " +"skriver. For eksempel vil \"tekst\" ikke matche \"tekstiler\" hvis du har " +"valgt Søg kun efter hele ord." + +#: ../C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Vælg Søg bagud for at søge baglæns mod begyndelsen af " +"dokumentet." + +#: ../C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Vælg Begynd forfra ved slut for at søge frem til " +"slutningen af dokumentet, og derefter fortsætte søgningen fra den anden ende " +"af filen." + +#: ../C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Specielle tegn" + +#: ../C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"Du kan inkludere de følgende sekvenser i teksten, der skal findes eller " +"erstattes, til at repræsentere specielle tegn:" + +#: ../C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: ../C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Indikerer en ny linje (line feed)." + +#: ../C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: ../C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Indikerer et indtryk." + +#: ../C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: ../C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Indikerer en ny linje (carriage return)." + +#: ../C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: ../C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"Tegnet omvendt skråstreg skal anvendes i sammenhæng med en undvigesekvens, " +"hvis der skal søges efter det. Hvis du for eksempel søger efter strengen " +"\"\\n\", skal du skrive \"\\\\n\" i Søg efter-feltet. Hvis du søger efter en følge af omvendte skråstreger, skal " +"antallet af disse fordobles i søgestrengen." + +#: ../C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Placering af markøren på en bestemt linje" + +#: ../C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"For at placere markøren på en bestemt linje i den valgte fil, skal du vælge " +"SøgGå til linje.... Linjenummerboksen vises i toppen af " +"visningsområdet." + +#: ../C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Begynd at skrive nummeret på den linje som du ønsker at flytte markøren til, " +"og dokumentet vil rulle op/ned til den angivne linje." + +#: ../C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"For at fjerne boksen og flytte markøren til den angivne linje, skal du " +"trykke på Enter." + +#: ../C/gedit.xml:548(title) +msgid "Printing" +msgstr "Udskrivning" + +#: ../C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Indstilling af sideopsætning" + +#: ../C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"For at indstille sideopsætningen skal du vælge FilSideopsætning... for at vise " +"dialogen Sideopsætning." + +#: ../C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"Dialogen Sideopsætning giver dig mulighed for at angive " +"de følgende udskriftsindstillinger:" + +#: ../C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Fanebladet Generelt" + +#: ../C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Udskriv syntaksfremhævning" + +#: ../C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Vælg denne mulighed for at udskrive syntaksfremhævning. Se for yderligere information." + +#: ../C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Udskriv sidehoveder" + +#: ../C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Vælg denne mulighed for at inkludere et sidehoved på hver side, som du " +"udskriver. Du kan ikke konfigurere sidehovedet." + +#: ../C/gedit.xml:571(guilabel) ../C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "Linjenummerering" + +#: ../C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Vælg Udskriv linjenumre for at inkludere linjenumre når " +"du udskriver en fil." + +#: ../C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Brug Nummerér hver ... linjer -boksen til at angive " +"hvor ofte linjenumrene skal udskrives, for eksempel hver 5. linje, hver 10. " +"linje osv." + +#: ../C/gedit.xml:578(guilabel) ../C/gedit.xml:1168(guilabel) +#: ../C/gedit.xml:1685(para) +msgid "Text Wrapping" +msgstr "Tekstombrydning" + +# Ekstra, kunstig forklaring tilføjet for at redde en ellers kryptisk oversættelse. +#: ../C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Vælg Aktivér tekstombrydning for at ombryde tekst til " +"næste linje, bogstav-for-bogstav, når du udskriver en fil. Hvis dette er " +"aktiveret vil ord, når de ikke kan være på en linje, blive delt mellem " +"linjen og den næste linje. Programmet opfatter ombrudte linjer som en linje " +"i forbindelse med linjenummerering." + +# Ekstra, kunstig forklaring tilføjet for at redde en ellers kryptisk oversættelse. +#: ../C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Vælg Del ikke ord over to linjer for at ombryde tekst " +"mellem linjer ord-for-ord, når du udskriver en fil. Hvis dette er aktiveret, " +"vil et ord ikke blive delt mellem to linjer - i stedet vil hele ordet blive " +"flyttet til den næste linje." + +#: ../C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Skrifttyper" + +#: ../C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Brødtekst" + +#: ../C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Klik på denne knap for at vælge skrifttype til udskrift af brødteksten i en " +"fil." + +#: ../C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Linjenumre" + +#: ../C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "Klik på denne knap for at vælge skrifttype til udskrift af linjenumre." + +#: ../C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Sidehoveder og -fødder" + +#: ../C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Klik på denne knap for at vælge skrifttype til udskrift af sidehoveder og " +"sidefødder i en fil." + +#: ../C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"For at gendanne standardskrifttyperne for udskrifter i gedit skal du klikke på Gendan standardskrifttyper." + +#: ../C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Udskriv et dokument" + +#: ../C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Du kan bruge gedit til at udføre følgende " +"udskrivningsfunktioner:" + +#: ../C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Udskriv et dokument til en printer." + +#: ../C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Udskriv output fra udskrivningskommandoen til en fil." + +#: ../C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Hvis du udskriver til en fil vil gedit sende " +"filens output til en præ-pres-formatfil. De mest brugte præ-pres-formater er " +"PostScript og Portable Document Format (PDF)." + +#: ../C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"For at forhåndsvise siderne, som du ønsker at udskrive, skal du vælge " +"FilVis udskrift." + +#: ../C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"For at udskrive den aktuelle fil til en printer eller en fil, skal du vælge " +"FilUdskriv... for at vise dialogen Udskriv." + +#: ../C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"Dialogen Udskriv gør dig i stand til at angive følgende " +"udskrivningsindstillinger:" + +#: ../C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Fanebladet Job" + +#: ../C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Udskriftsområde" + +#: ../C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Vælg en af de følgende muligheder for at bestemme, hvor mange sider der skal " +"udskrives:" + +#: ../C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Alle" + +#: ../C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Vælg denne mulighed for at udskrive alle filens sider." + +#: ../C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Linjer" + +#: ../C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Vælg denne mulighed for kun at udskrive de angivne linjer. Brug " +"rulleknapperne Fra og Til for at " +"angive, hvilket område der skal udskrives." + +#: ../C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Markerede" + +#: ../C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Vælg denne mulighed for kun at udskrive den markerede tekst. Denne mulighed " +"er kun tilgængelig hvis du har markeret tekst." + +#: ../C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Kopier" + +#: ../C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Brug rulleknappen Antal kopier til at angive antallet " +"af kopier du ønsker af udskriften af filen." + +# Ændres nok snart +#: ../C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Hvis du udskriver flere kopier af filen, kan du vælge Ordn for at ordne de udskrevne kopier." + +#: ../C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Fanebladet Printer" + +#: ../C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Printer" + +#: ../C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Brug denne rullegardinsliste til at vælge den printer, som du ønsker skal " +"udskrive filen." + +#: ../C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Indstillinger" + +#: ../C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Brug denne rullegardinsliste til at vælge printerindstillinger." + +#: ../C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"For at konfigurere printeren skal du klikke på Konfigurér. For eksempel kan du aktivere eller deaktivere duplex-udskrift, " +"eller planlægge forsinket udskrift, hvis denne funktionalitet understøttes " +"af printeren." + +#: ../C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Placering" + +#: ../C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Brug denne rullegardinsliste til at vælge en af de følgende " +"udskrivningsdestinationer:" + +#: ../C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: ../C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Udskriv filen til en CUPS-printer." + +#: ../C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Hvis den valgte printer er en CUPS-printer, er CUPS den " +"eneste mulighed i denne rullegardinsliste." + +#: ../C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: ../C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Udskriv filen til en printer." + +#: ../C/gedit.xml:708(guilabel) +msgid "File" +msgstr "File" + +#: ../C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Udskriv filen til en PostScript-fil." + +#: ../C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Klik på Gem som for at vise en dialog, hvor du " +"angiver navn og placering til PostScript-filen." + +#: ../C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Custom" + +#: ../C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Brug den angivne kommando til at udskrive filen." + +#: ../C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Indtast navnet på kommandoen i tekstboksen. Inkludér alle " +"kommandolinjeargumenter." + +#: ../C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Tilstand" + +#: ../C/gedit.xml:734(para) ../C/gedit.xml:740(para) ../C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Denne funktionalitet understøttes ikke i denne version af gedit." + +#: ../C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Type" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Kommentér" + +#: ../C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Fanebladet Papir" + +#: ../C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Papirstørrelse" + +#: ../C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Brug denne rullegardinsliste til at vælge størrelse på det papir, som du " +"ønsker filen udskrevet på." + +#: ../C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Bredde" + +#: ../C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Brug denne rulleknap til at angive papirbredden. Brug rullegardinslisten ved " +"siden af til at ændre måleenhed." + +#: ../C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Højde" + +#: ../C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Brug denne rulleknap til at angive papirhøjden." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Feedorientering" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"Brug denne rullegardinsmenu til at vælge orienteringen af det papir som er i " +"printeren." + +#: ../C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Sideorientering" + +#: ../C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Brug denne rullegardinsliste til at vælge sideorientering." + +#: ../C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Layout" + +#: ../C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Brug denne rullegardinsliste til at vælge sidelayout. En forhåndsvisning af " +"hvert layout, du vælger, vises i Eksempel-området." + +#: ../C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Papirbakke" + +#: ../C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Brug denne rullegardinsliste til at vælge papirbakken." + +#: ../C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Programmeringsfaciliteter" + +#: ../C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Flere af gedits programmeringsfaciliteter ydes " +"via udvidelsesmoduler. For eksempel giver Mærkeliste-modulet en liste over " +"de oftest brugte mærker for diverse opmærkningssprog: se ." + +#: ../C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Syntaksfremhævning" + +#: ../C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"Syntaksfremhævning gør kildekode nemmere at læse ved at vise forskellige " +"dele af teksten i forskellige farver." + +#: ../C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit vælger en passende syntaksfremhævning " +"baseret på et dokuments type. For at tvinge en bestemt syntaksfremhævning " +"igennem skal du vælge VisFremhævningstilstand, og " +"vælg derefter en af de følgende:" + +#: ../C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Normal" + +#: ../C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Vis ikke syntaksfremhævning." + +#: ../C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Kilder" + +#: ../C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Vis syntaksfremhævning til at redigere kildekode. Brug undermenuen " +"Kilder til at vælge kildekodetype." + +#: ../C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Opmærkning" + +#: ../C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Vis syntaksfremhævning til at redigere opmærkningskode. Brug undermenuen " +"Markup til at vælge markupkode-type." + +#: ../C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Scripts" + +#: ../C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Vis syntaksfremhævning til at redigere scriptkode. Brug undermenuen " +"Scripts til at vælge scriptkode-type." + +#: ../C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Andre" + +#: ../C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Vis syntaksfremhævning til at redigere andre kodetyper. Brug undermenuen " +"Andre til at vælge kodetype." + +#: ../C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Videreled et kommandooutput til en fil" + +#: ../C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Du kan bruge gedit til at viderelede en kommandos " +"output til en tekstfil. Hvis du for eksempel vil viderelede output af en " +"ls-kommando til en tekstfil skal du skrive ls | " +"gedit, og derefter trykke Enter." + +#: ../C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Output af kommandoen ls vises i en ny tekstfil i " +"gedit-vinduet." + +#: ../C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Alternativt kan du bruge udvidelsesmodulet Eksterne værktøjer til at viderelede kommandooutput til den nuværende fil." + +#: ../C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Genvejstaster" + +#: ../C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Brug genvejstaster til at udføre almindelige opgaver hurtigere end med musen " +"og menuerne. De følgende tabeller viser alle tastekombinationerne i " +"gedit." + +#: ../C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Se Desktop-" +"brugervejledningen for yderligere info om genvejstaster." + +#. ============= Tabs ======================== +#: ../C/gedit.xml:859(bridgehead) ../C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "Faneblade" + +#: ../C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Genveje til faneblade:" + +#: ../C/gedit.xml:868(para) ../C/gedit.xml:912(para) ../C/gedit.xml:968(para) +#: ../C/gedit.xml:1016(para) ../C/gedit.xml:1044(para) +#: ../C/gedit.xml:1091(para) ../C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "Genvejstast" + +#: ../C/gedit.xml:870(para) ../C/gedit.xml:914(para) ../C/gedit.xml:970(para) +#: ../C/gedit.xml:1018(para) ../C/gedit.xml:1046(para) +#: ../C/gedit.xml:1093(para) ../C/gedit.xml:1136(para) +msgid "Command" +msgstr "Kommando" + +#: ../C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: ../C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Skifter til det næste faneblad til venstre." + +#: ../C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: ../C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Skifter til det næste faneblad til højre." + +#: ../C/gedit.xml:883(para) ../C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: ../C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Luk faneblad." + +#: ../C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: ../C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Gem alle faneblade." + +#: ../C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: ../C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Luk alle faneblade." + +#: ../C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: ../C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Spring til n. tab." + +#. ============= Files ======================== +#: ../C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Filer" + +#: ../C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Genveje til arbejde med filer:" + +#: ../C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: ../C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Opret et nyt dokument." + +#: ../C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: ../C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Åbn et dokument." + +#: ../C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: ../C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Åbn en placering." + +#: ../C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: ../C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Gem det nuværende dokument til disken." + +#: ../C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: ../C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Gem det nuværende dokument med et nyt filnavn." + +#: ../C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: ../C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Udskriv det nuværende dokument." + +#: ../C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: ../C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Vis udskrift." + +#: ../C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Luk det nuværende dokument." + +#: ../C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: ../C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Luk gedit." + +#. ============= Edit ======================= +#: ../C/gedit.xml:959(bridgehead) ../C/gedit.xml:1406(guimenu) +#: ../C/gedit.xml:1412(guimenu) ../C/gedit.xml:1418(guimenu) +#: ../C/gedit.xml:1424(guimenu) +msgid "Edit" +msgstr "Redigér" + +#: ../C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Genveje til at redigere i dokumenter:" + +#: ../C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: ../C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Fortryd den seneste handling." + +#: ../C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: ../C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Omgør den senest fortrudte handling." + +#: ../C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: ../C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Klip den valgte tekst og placer den i udklipsholderen." + +#: ../C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: ../C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Kopier den valgte tekst til udklipsholderen." + +#: ../C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: ../C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Indsæt indholdet af udklipsholderen." + +#: ../C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: ../C/gedit.xml:996(para) +msgid "Select all." +msgstr "Markér alt." + +#: ../C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: ../C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Fjern aktuelle linje." + +#. ============= Panes ======================= +#: ../C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "Paneler" + +#: ../C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Genveje til at vise og skjule paneler:" + +#: ../C/gedit.xml:1023(para) +msgid "F9" +msgstr "F9" + +#: ../C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "Vis/skjul sidepanelet." + +#: ../C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: ../C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "Vis/skjul bundpanelet." + +#. ============= Search ======================= +#: ../C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "Søg" + +#: ../C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "Genveje til søgning:" + +#: ../C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: ../C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "Find en streng." + +#: ../C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: ../C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "Find den næste forekomst af strengen." + +#: ../C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: ../C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "Find den forrige forekomst af strengen." + +#: ../C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: ../C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "Interaktiv søgning." + +#: ../C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: ../C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "Søg og erstat." + +#: ../C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: ../C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "Ryd fremhævning." + +#: ../C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: ../C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "Gå til linje." + +#. ============= Tools ======================= +#: ../C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "Værktøjer" + +#: ../C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "Genveje til værktøjer:" + +#: ../C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: ../C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "Tjek stavning (med udvidelsesmodul)." + +#: ../C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: ../C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Fjern efterfølgende mellemrum (med udvidelsesmodul)." + +#: ../C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: ../C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "Ryk ind (med udvidelsesmodul)." + +#: ../C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: ../C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "Fjern indryk (med udvidelsesmodul)." + +#: ../C/gedit.xml:1114(para) +msgid "F8" +msgstr "F8" + +#: ../C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Kør \"make\" i det nuværende katalog (med udvidelsesmodul)." + +#: ../C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: ../C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "Vis katalogliste (med udvidelsesmodul)." + +#. ============= Help ======================= +#: ../C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "Hjælp" + +#: ../C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "Genveje til hjælp:" + +#: ../C/gedit.xml:1141(para) +msgid "F1" +msgstr "F1" + +#: ../C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "Åbn gedits brugermanual." + +#: ../C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "Indstillinger" + +#: ../C/gedit.xml:1156(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"For at konfigurere gedit skal du vælge " +"RedigérIndstillinger. Dialogen Indstillinger " +"indeholder de følgende kategorier:" + +# (+indstillinger) +#: ../C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "Visning" + +#: ../C/gedit.xml:1170(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Vælg Aktivér tekstombrydning for at få lange linjer til " +"at glide ned i afsnit i stedet for at de fortsætter ud af vinduet. Dette gør " +"at du ikke behøver rulle horisontalt gennem vinduet" + +#: ../C/gedit.xml:1171(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Vælg Del ikke ord over to linjer for at få " +"tekstombrydningen til at bevare hele ord når teksten ombrydes over flere " +"linjer. Dette gør teksten nemmere at læse." + +#: ../C/gedit.xml:1177(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Vælg Vis linjenumre for at få vist linjenumre i venstre " +"side af gedit-vinduet." + +#: ../C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "Aktuel linje" + +#: ../C/gedit.xml:1183(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Vælg Fremhæv aktuel linje for at fremhæve den linje " +"hvor markøren er placeret." + +#: ../C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "Højre margen" + +#: ../C/gedit.xml:1189(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Vælg Vis højre margen for at få vist en lodret linje, " +"som indikerer den højre margen." + +#: ../C/gedit.xml:1190(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Brug rulleboksen Højre margen ved kolonne til at angive " +"placeringen af den lodrette linje." + +#: ../C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "Parantesfremhævning" + +#: ../C/gedit.xml:1196(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Vælg Fremhæv modsvarende parantes til at fremhæve den " +"modsvarende parantes når markøren er placeret på en parantes." + +# (+sindstillinger) +#: ../C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "Redigering" + +#: ../C/gedit.xml:1209(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Brug rulleboksen Tabulatorbredde til at angive bredde " +"på det mellemrum, som gedit indsætter når du " +"trykker på Tab-tasten." + +#: ../C/gedit.xml:1210(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Vælg Indsæt mellemrum i stedet for tabulatorer for at " +"angive at gedit skal indsætte mellemrumstegn i " +"stedet for et enkelt tabulatortegn når du trykker på Tab-" +"knappen." + +#: ../C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "Automatisk indrykning" + +#: ../C/gedit.xml:1216(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Vælg Aktivér automatisk indrykning for at angive at den " +"næste linje starter på samme indrykningsniveau som den nuværende linje." + +#: ../C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "Filgemning" + +#: ../C/gedit.xml:1222(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Vælg Opret en sikkerhedskopi af filer før gemning for " +"at oprette en sikkerhedskopi af en fil hver gang du gemmer filen. " +"Sikkerhedskopien indeholder et ~ i slutningen af filnavnet." + +#: ../C/gedit.xml:1223(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Vælg Gem automatisk filer hver ... minutter for " +"automatisk at gemme den aktuelle fil med regelmæssige intervaller. Brug " +"rulleboksen til at angive hvor ofte du vil gemme filen." + +#: ../C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "Skrifttyper og farver" + +#: ../C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "Skrifttype" + +# Den engelske streng er forældet!! Bruger bedste gæt (som svarer til en streng i gedits po-fil) +#: ../C/gedit.xml:1235(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Vælg Benyt standardskrifttype for at bruge systemets " +"standardskrifttype til teksten i gedits " +"tekstvindue." + +#: ../C/gedit.xml:1236(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"Feltet Skrifttype for tekst viser den skrifttype som " +"gedit bruger til at vise tekst. Klik på knappen " +"for at angive skrifttype, stil og størrelse til brug på tekst." + +#: ../C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "Farveskema" + +#: ../C/gedit.xml:1242(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"Du kan vælge et farveskema fra listen af farveskemaer: Som standard vil " +"følgende farveskemaer være installeret:" + +#: ../C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "Klassisk" + +#: ../C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Klassisk farveskema baseret på gvim-farveskemaet." + +#: ../C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "Cobalt" + +#: ../C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "Blåligt farveskema." + +#: ../C/gedit.xml:1257(guilabel) +msgid "Kate" +msgstr "Kate" + +#: ../C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Farveskemaet, der bruges i tekstredigeringsprogrammet Kate." + +#: ../C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: ../C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Mørkt farveskema der bruger Tango-farvepaletten." + +#: ../C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "Tango" + +#: ../C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Farveskema der bruger Tango-farvepaletten." + +#: ../C/gedit.xml:1275(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Du kan tilføje et nyt farveskema ved at klikke på Tilføj..., og vælge en farveskemafil" + +#: ../C/gedit.xml:1276(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Du kan fjerne det valgte farveskema ved at klikke på Fjern" + +# (+indstillinger) +#: ../C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "Udvidelsesmoduler" + +#: ../C/gedit.xml:1284(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Udvidelsesmoduler tilføjer ekstra funktioner til gedit. For yderligere information om udvidelsesmoduler og hvordan man " +"bruger de indbyggede udvidelsesmoduler kan du læse ." + +#: ../C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "Aktivér et udvidelsesmodul" + +#: ../C/gedit.xml:1289(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"For at aktivere et udvidelsesmodul til gedit skal " +"du gøre følgende:" + +#: ../C/gedit.xml:1292(para) ../C/gedit.xml:1313(para) +#: ../C/gedit.xml:1635(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Vælg RedigérIndstillinger." + +#: ../C/gedit.xml:1295(para) ../C/gedit.xml:1316(para) +#: ../C/gedit.xml:1638(para) +msgid "Select the Plugins tab." +msgstr "Vælg fanebladet Udvidelsesmoduler." + +#: ../C/gedit.xml:1298(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"Sæt flueben i feltet ved siden af navnet på det udvidelsesmodul som du " +"ønsker at aktivere." + +#: ../C/gedit.xml:1301(para) ../C/gedit.xml:1322(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Klik Luk for at lukke dialogen " +"Indstillinger." + +#: ../C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "Deaktivér et udvidelsesmodul" + +#: ../C/gedit.xml:1309(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Et udvidelsesmodul forbliver aktiveret når du lukker gedit." + +#: ../C/gedit.xml:1310(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"For at deaktivere et udvidelsesmodul til gedit " +"skal du gøre følgende:" + +#: ../C/gedit.xml:1319(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Fjern flueben i feltet ved siden af navnet på det udvidelsesmodul som du " +"ønsker at deaktivere." + +#: ../C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "Udvidelsesmoduler" + +#: ../C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "Arbejde med udvidelsesmoduler" + +#: ../C/gedit.xml:1334(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Du kan tilføje ekstra funktioner til gedit ved at " +"aktivere udvidelsesmoduler. Et udvidelsesmodul kan " +"ses som et supplementprogram som forbedrer et programs funktionalitet. " +"Udvidelsesmoduler tilføjer nye elementer til menuerne i gedit for de nye funktioner som de yder." + +#: ../C/gedit.xml:1336(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Flere udvidelsesmoduler kommer indbygget i gedit, " +"og du kan installere flere. gedits hjemmeside har en liste over " +"udvidelsesmoduler fra tredjepart." + +#: ../C/gedit.xml:1337(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"For at aktivere og deaktivere udvidelsesmoduler, eller se hvilke " +"udvidelsesmoduler der aktuelt er aktiverede, kan du bruge indstillingerne for udvidelsesmoduler." + +#: ../C/gedit.xml:1338(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"De følgende udvidelsesmoduler er indbygget i gedit:" + +#: ../C/gedit.xml:1344(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Skift bogstaver lader dig skifte mellem store/små bogstaver i den " +"markerede tekst." + +#: ../C/gedit.xml:1347(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Dokumentstatistik viser antallet af linjer, ord og " +"tegn i dokumentet." + +#: ../C/gedit.xml:1350(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Eksterne " +"værktøjer lader dig udføre eksterne kommandoer fra " +"gedit." + +#: ../C/gedit.xml:1353(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Filvælger-panel lader dig gennemse dine filer og " +"kataloger i sidepanelet." + +#: ../C/gedit.xml:1356(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Indryk linjer tilføjer eller fjerner indrykning af markerede linjer." + +#: ../C/gedit.xml:1359(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Indsæt dato/" +"tid tilføjer den aktuelle dato og tid til et dokument." + +#: ../C/gedit.xml:1362(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Tilstandslinjer lader dig sætte redigeringsindstillinger for " +"individuelle dokumenter, og understøtter tilstandslinjer i stil med " +"Emacs, Kate og " +"Vim." + +#: ../C/gedit.xml:1365(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Python-konsol lader dig køre kommandoer i programmeringssproget python." + +#: ../C/gedit.xml:1368(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Tekststumper lader dig opbevare ofte-brugte stykker af tekst og indsætte dem " +"nemt og hurtigt i et dokument." + +#: ../C/gedit.xml:1371(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Sortér " +"arrangerer markerede tekstlinjer i alfabetisk orden." + +#: ../C/gedit.xml:1374(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Stavekontrol retter stavningen i den markerede tekst, eller markerer " +"automatisk fejl i dokumentet." + +#: ../C/gedit.xml:1377(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Mærkeliste lader dig indsætte ofte-brugte mærker for HTML og andre sprog " +"fra en liste i sidepanelet." + +#: ../C/gedit.xml:1381(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"Mere information om oprettelse af udvidelsesmoduler kan findes på hjemmesiden for " +"gedit." + +#: ../C/gedit.xml:1385(title) +msgid "Change Case Plugin" +msgstr "Udvidelsesmodulet Skift bogstaver" + +#: ../C/gedit.xml:1386(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"Udvidelsesmodulet Skift bogstaver skifter mellem " +"store/små bogstaver i den markerede tekst." + +#: ../C/gedit.xml:1387(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"De følgende elementer føjes til menuen Redigér når " +"udvidelsesmodulet Skift bogstaver er aktiveret:" + +#: ../C/gedit.xml:1397(para) +msgid "Menu Item" +msgstr "Menuelement" + +#: ../C/gedit.xml:1399(para) +msgid "Action" +msgstr "Handling" + +#: ../C/gedit.xml:1401(para) +msgid "Example" +msgstr "Eksempel" + +#: ../C/gedit.xml:1407(guisubmenu) ../C/gedit.xml:1413(guisubmenu) +#: ../C/gedit.xml:1419(guisubmenu) ../C/gedit.xml:1425(guisubmenu) +msgid "Change Case" +msgstr "Skift bogstaver" + +#: ../C/gedit.xml:1407(guimenuitem) +msgid "All Upper Case" +msgstr "Alle bogstaver store" + +#: ../C/gedit.xml:1408(para) +msgid "Change each character to uppercase." +msgstr "Skifter alle bogstaver til store bogstaver." + +#: ../C/gedit.xml:1409(para) +msgid "This text becomes THIS TEXT" +msgstr "" +"Denne tekst bliver til DENNE TEKST" + +#: ../C/gedit.xml:1413(guimenuitem) +msgid "All Lower Case" +msgstr "Alle bogstaver små" + +#: ../C/gedit.xml:1414(para) +msgid "Change each character to lowercase." +msgstr "Skifter alle bogstaver til små bogstaver." + +#: ../C/gedit.xml:1415(para) +msgid "This Text becomes this text" +msgstr "" +"Denne Tekst bliver til denne tekst" + +#: ../C/gedit.xml:1419(guimenuitem) +msgid "Invert Case" +msgstr "Invertér bogstavstørrelse" + +#: ../C/gedit.xml:1420(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "Skifter alle små bogstaver til store, og alle store bogstaver til små." + +#: ../C/gedit.xml:1421(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" +"Denne Tekst bliver til dENNE tEKST" + +#: ../C/gedit.xml:1425(guimenuitem) +msgid "Title Case" +msgstr "Første bogstav med stort" + +#: ../C/gedit.xml:1426(para) +msgid "Change the first character of each word to uppercase." +msgstr "Ændrer det første bogstav i hvert ord til store bogstaver." + +#: ../C/gedit.xml:1427(para) +msgid "this text becomes This Text" +msgstr "" +"denne tekst bliver til Denne Tekst" + +#: ../C/gedit.xml:1436(title) +msgid "Document Statistics Plugin" +msgstr "Udvidelsesmodulet Dokumentstatistik" + +#: ../C/gedit.xml:1437(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"Udvidelsesmodulet Dokumentstatistik optæller " +"antallet af linjer, ord, tegn med mellemrum, tegn uden mellemrum og bytes i " +"den aktuelle fil. Udvidelsesmodulet viser resultatet i en " +"Dokumentstatistik-dialog. For at bruge " +"udvidelsesmodulet Dokumentstatistik skal du gøre følgende:" + +#: ../C/gedit.xml:1439(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Vælg VærktøjerDokumentstatistik for at få vist dialogen " +"Dokumentstatistik. Denne dialog viser den følgende " +"information om filen:" + +#: ../C/gedit.xml:1442(para) +msgid "Number of lines in the current document." +msgstr "Antal linjer i det aktuelle dokument." + +#: ../C/gedit.xml:1445(para) +msgid "Number of words in the current document." +msgstr "Antal ord i det aktuelle dokument." + +#: ../C/gedit.xml:1448(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Antal tegn, inklusive mellemrum, i det aktuelle dokument." + +#: ../C/gedit.xml:1451(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Antal tegn, ikke medregnende mellemrum, i det aktuelle dokument." + +#: ../C/gedit.xml:1454(para) +msgid "Number of bytes in the current document." +msgstr "Antal bytes i det aktuelle dokument." + +#: ../C/gedit.xml:1459(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Du kan fortsætte med at opdatere den aktuelle tekstfil i gedit samtidig med at dialogen Dokumentstatistik " +"er åben. For at opdatere indholdet i dialogen Dokumentstatistik skal du klikke påOpdatér." + +#: ../C/gedit.xml:1466(title) +msgid "External Tools Plugin" +msgstr "Udvidelsesmodulet Eksterne værktøjer" + +#: ../C/gedit.xml:1467(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"Udvidelsesmodulet Eksterne værktøjer lader dig " +"køre eksterne kommandoer fra gedit. Du kan " +"viderelede noget indhold i en kommando og benytte dig af dens output (for " +"eksempel, sed), eller køre en foruddefineret " +"kommando (for eksempel, make)." + +#: ../C/gedit.xml:1468(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Brug Eksterne værktøjer til at oprette og redigere i " +"kommandoer. For at køre en ekstern kommando skal du vælge den fra menuen " +"Værktøjer." + +#: ../C/gedit.xml:1471(title) +msgid "Built-in Commands" +msgstr "Indbyggede kommandoer" + +#: ../C/gedit.xml:1472(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"De følgende kommandoer følger i forvejen med udvidelsesmodulet " +"Eksterne værktøjer:" + +#: ../C/gedit.xml:1474(term) +msgid "Build" +msgstr "Byg" + +#: ../C/gedit.xml:1476(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Kører make i det aktuelle dokuments katalog." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:1479(term) +msgid "Directory Listing" +msgstr "Mappeoversigt" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:1481(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "Viser indholdet af det aktuelle dokuments mappe i et nyt dokument." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:1484(term) +msgid "Environment Variables" +msgstr "Miljøvariable" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:1486(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Viser listen over miljøvariable i bundpanelet." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:1489(term) +msgid "Grep" +msgstr "Grep" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#: ../C/gedit.xml:1491(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Søger efter en streng i alle filer i den aktuelle dokumentmappe ved hjælp af " +"mønstersammenligning. Resultater vises i bundpanelet." + +#: ../C/gedit.xml:1494(term) +msgid "Remove Trailing Spaces" +msgstr "Fjern efterfølgende mellemrum" + +#: ../C/gedit.xml:1496(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Fjerner alle mellemrum fra linjeslutningerne i dokumentet." + +#: ../C/gedit.xml:1503(title) +msgid "Defining a Command" +msgstr "Definér en kommando" + +#: ../C/gedit.xml:1504(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"For at tilføje en ekstern kommando skal du vælge " +"VærktøjerEksterne værktøjer...." + +#: ../C/gedit.xml:1505(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"I vinduet Eksterne værktøjer skal du klikke på " +"Ny. Du kan angive de følgende detaljer for den nye " +"kommando:" + +#: ../C/gedit.xml:1507(term) +msgid "Description" +msgstr "Beskrivelse" + +#: ../C/gedit.xml:1509(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"Denne beskrivelse bliver vist i statuslinjen når kommandoen vælges i menuen." + +#: ../C/gedit.xml:1512(term) +msgid "Accelerator" +msgstr "Genvejstast" + +#: ../C/gedit.xml:1514(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Vælg en tastaturgenvej til kommandoen." + +#: ../C/gedit.xml:1517(term) +msgid "Commands" +msgstr "Kommandoer" + +#: ../C/gedit.xml:1519(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"De faktiske kommandoer som skal køres. Flere miljøvariabler i " +"gedit kan bruges til at videresende data til " +"disse kommandoer: se ." + +# Ja, jeg ved godt at der står "Inddata", men jeg satser på at vi skrotter den inden længe! +#: ../C/gedit.xml:1522(term) +msgid "Input" +msgstr "Input" + +#: ../C/gedit.xml:1524(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Data som skal gives til kommandoerne (som stdin): " +"hele teksten i det aktuelle dokument, den aktuelle markering, linje eller " +"ord." + +# Ja, jeg ved godt at der står "Uddata", men jeg satser på at vi skrotter den inden længe! +#: ../C/gedit.xml:1527(term) +msgid "Output" +msgstr "Output" + +#: ../C/gedit.xml:1529(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Hvad der skal gøres med output fra kommandoerne: vis det i bundpanelet, læg " +"det i et nyt dokument eller placer det i det aktuelle dokument, i bunden, " +"ved markørens placering eller som erstatning for den aktuelle markering " +"eller hele dokumentet." + +#: ../C/gedit.xml:1532(term) +msgid "Applicability" +msgstr "Anvendelsesområde" + +#: ../C/gedit.xml:1534(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Afgør hvilken slags dokumenter der kan berøres af kommandoen, for eksempel " +"om filen skal være gemt eller ej, og om den skal være lokal eller ekstern." + +#: ../C/gedit.xml:1542(title) +msgid "Editing and Removing Tools" +msgstr "Redigér og fjern værktøjer" + +#: ../C/gedit.xml:1543(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"For at redigere et værktøj skal du vælge det i listen og ændre dets " +"egenskaber." + +#: ../C/gedit.xml:1544(para) +msgid "To rename a tool, click it again in the list." +msgstr "For at omdøbe et værktøj skal du klikke på det igen i listen." + +#: ../C/gedit.xml:1545(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"For at gendanne et indbygget værktøj som du har ændret skal du trykke på " +"Forkast." + +#: ../C/gedit.xml:1546(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"For at fjerne et værktøj skal du vælge det i listen og trykke på " +"Fjern. Du kan ikke fjerne indbyggede værktøjer, kun " +"de som du selv har oprettet." + +#: ../C/gedit.xml:1550(title) +msgid "Variables" +msgstr "Variabler" + +#: ../C/gedit.xml:1551(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"Du kan bruge følgende variabler i Kommando-feltet i " +"definitionen af kommandoen:" + +#: ../C/gedit.xml:1554(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: ../C/gedit.xml:1557(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: ../C/gedit.xml:1560(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: ../C/gedit.xml:1563(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: ../C/gedit.xml:1566(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: ../C/gedit.xml:1569(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: ../C/gedit.xml:1572(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: ../C/gedit.xml:1579(title) +msgid "File Browser Plugin" +msgstr "Udvidelsesmodulet Filvælger" + +#: ../C/gedit.xml:1580(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Udvidelsesmodulet Filvælger viser dine filer og " +"mapper i sidepanelet, hvilket gør at du hurtigt og nemt kan åbne filer." + +#: ../C/gedit.xml:1581(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"For at få vist filvælgeren skal du vælge VisSidepanel og derefter klikke " +"på fanebladet der viser Filvælger-ikonet i bunden af sidepanelet." + +#: ../C/gedit.xml:1583(title) +msgid "Browsing your Files" +msgstr "Gennemse dine filer" + +#: ../C/gedit.xml:1584(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"Filvælger-fanebladet viser dine bogmærker fra filhåndtering. For at gennemse " +"indholdet af et element skal du dobbeltklikke på det." + +#: ../C/gedit.xml:1585(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"For at få vist en forældermappe skal du vælge fra rullegardinslisten eller " +"trykke på op-pilen i filvælgerens værktøjslinje." + +#: ../C/gedit.xml:1586(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"For at få vist mappen som indeholder det dokument som du aktuelt arbejder " +"på, skal du højreklikke på filen i listen og vælge Sæt rod til " +"aktive dokument." + +#: ../C/gedit.xml:1590(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"For at åbne en fil i gedit skal du dobbeltklikke " +"på den i fillisten." + +#: ../C/gedit.xml:1593(title) +msgid "Creating Files and Folders" +msgstr "Opret filer og mapper" + +#: ../C/gedit.xml:1594(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"For at oprette en ny, tom tekstfil i den aktuelle mappe vist i filvælgeren " +"skal du højreklikke i fillisten og vælge Ny fil." + +#: ../C/gedit.xml:1595(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"For at oprette en ny mappe i den aktuelle mappe vist i filvælgeren skal du " +"højreklikke i fillisten og vælge Ny mappe." + +#: ../C/gedit.xml:1600(title) +msgid "Indent Lines Plugin" +msgstr "Udvidelsesmodulet Indryk linjer" + +#: ../C/gedit.xml:1601(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"Udvidelsesmodulet Indryk linjer tilføjer eller " +"fjerner mellemrum fra begyndelsen af tekstens linjer." + +#: ../C/gedit.xml:1602(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" +"Udfør følgende skridt for at indrykke eller fjerne indrykning af tekst:" + +#: ../C/gedit.xml:1604(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Vælg linjerne som du ønsker at indrykke. Ønsker du kun at indrykke eller " +"fjerne indrykning for en enkelt linje, kan du placere markøren et sted på " +"denne linje." + +#: ../C/gedit.xml:1609(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Vælg RedigérIndryk for at indrykke teksten." + +#: ../C/gedit.xml:1612(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Vælg RedigérFjern indrykning for at fjerne indrykning." + +#: ../C/gedit.xml:1617(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"Mængden af mellemrum der bruges, og hvorvidt der anvendes tabulatortegn " +"eller mellemrumstegn, afhænger af indstillingerne Tabulatorstop i indstillingerne: se ." + +#: ../C/gedit.xml:1622(title) +msgid "Insert Date/Time Plugin" +msgstr "Udvidelsesmodulet Indsæt dato/tid" + +#: ../C/gedit.xml:1623(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Udvidelsesmodulet Indsæt dato/tid indsætter den " +"nuværende dato og tidspunkt i et dokument. For at bruge udvidelsesmodulet " +"Indsæt dato/tid skal du gøre følgende:" + +# Kommandoen hedder det inklusive kommaer i gedit +#: ../C/gedit.xml:1625(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Vælg RedigérIndsæt dato og tid..." +"." + +#: ../C/gedit.xml:1626(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Hvis du ikke har konfigureret Indsæt dato/tid til automatisk at indsætte " +"dato/tid uden at spørge dig om format, vil gedit " +"vise dialogen Indsæt dato og tid. Vælg det passende " +"dato/tid-format fra listen. Klik på Indsæt for at " +"lukke dialogen Indsæt dato og tid. gedit indsætter dato/tid ved markørens placering i den aktuelle fil." + +#: ../C/gedit.xml:1627(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Hvis du har konfigureret gedit til at bruge et " +"bestemt dato/tid-format, vises dialogen Indsæt dato og tid ikke. Dato/tid indsættes automatisk ved markørens placering i den " +"aktuelle fil." + +#: ../C/gedit.xml:1632(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Konfiguration af udvidelsesmodulet Indsæt dato/tid" + +#: ../C/gedit.xml:1633(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"For at konfigurere udvidelsesmodulet Indsæt dato/tid skal du gøre følgende:" + +#: ../C/gedit.xml:1641(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Vælg udvidelsesmodulet Indsæt dato/tid." + +#: ../C/gedit.xml:1644(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Klik på Konfigurér udvidelsesmodul for at få vist " +"dialogen Konfigurér indsætning af dato/tid." + +#: ../C/gedit.xml:1647(para) +msgid "Select one of the options, as follows:" +msgstr "Vælg en af følgende muligheder:" + +#: ../C/gedit.xml:1649(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"For at angive dato/tid-formatet hver gang du indsætter dato/tid skal du " +"vælge Spørg efter et format." + +#: ../C/gedit.xml:1652(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"For at bruge det samme gedit-leverede dato/tid-" +"format hver gang du indsætter dato/tid, skal du vælge Benyt det " +"valgte format og derefter vælge det ønskede format fra listen. " +"Når du benytter dig af denne mulighed vil gedit " +"ikke spørge efter dato/tid-format når du vælger " +"RedigérIndsæt dato og tid...." + +#: ../C/gedit.xml:1655(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"For at bruge det samme tilpassede dato/tid-format hver gang du indsætter " +"dato/tid, skal du vælge Benyt brugerdefineret format og " +"derefter indtaste det ønskede format i tekstboksen. For yderligere " +"information om hvordan man angiver et tilpasset format kan du se strftime3. Når du vælger " +"denne mulighed vil gedit ikke spørge om dato/tid-" +"format når du vælger RedigérIndsæt dato og tid...." + +#: ../C/gedit.xml:1660(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Klik O.k. for at lukke dialogen Konfigurér " +"indsætning af dato/tid." + +#: ../C/gedit.xml:1663(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"For at lukke dialogen Indstillinger for gedit skal du " +"klikke på Luk." + +#: ../C/gedit.xml:1670(title) +msgid "Modelines Plugin" +msgstr "Udvidelsesmodulet Tilstandslinjer" + +#: ../C/gedit.xml:1671(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Udvidelsesmodulet Tilstandslinjer lader dig " +"redigere indstillinger for enkelte dokumenter. En tilstandslinje er en linje af tekst i begyndelsen af dokumentet med " +"indstillinger, som gedit genkender." + +#: ../C/gedit.xml:1672(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Indstillinger, der angives ved hjælp af tilstandslinjer, har præcedens over " +"dem, der angives i indstillingsdialogen." + +#: ../C/gedit.xml:1673(para) +msgid "You can set the following preferences with modelines:" +msgstr "Du kan angive følgende indstillinger med tilstandslinjer:" + +#: ../C/gedit.xml:1676(para) +msgid "Tab width" +msgstr "Tabulatorbredde" + +#: ../C/gedit.xml:1679(para) +msgid "Indent width" +msgstr "Indrykningsbredde" + +#: ../C/gedit.xml:1682(para) +msgid "Insert spaces instead of tabs" +msgstr "Indsæt mellemrumstegn frem for tabulartortegn" + +#: ../C/gedit.xml:1688(para) +msgid "Right margin width" +msgstr "Bredde af højre margen" + +#: ../C/gedit.xml:1692(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Udvidelsesmodulet Tilstandslinjer understøtter en " +"delmængde af de indstillinger, der bruges af tekstredigeringsprogrammerne " +"Emacs, Kate og " +"Vim." + +#: ../C/gedit.xml:1695(title) +msgid "Emacs Modelines" +msgstr "Emacs-tilstandslinjer" + +#: ../C/gedit.xml:1696(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"De første to linjer af et dokument undersøges for Emacs-tilstandslinjer." + +#: ../C/gedit.xml:1697(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Emacs-indstillingerne for tabulatorbredde (tab-" +"width), indrykningsafstand (indent-offset), tabulatorindrykningstilstand " +"(indent-tabs-mode) og autoombrydning (autowrap) understøttes. Mere " +"information findes i manualen til GNU Emacs." + +#: ../C/gedit.xml:1700(title) +msgid "Kate Modelines" +msgstr "Kate-tilstandslinjer" + +#: ../C/gedit.xml:1701(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"De første og sidste to linjer i et dokument undersøges efter " +"Kate-tilstandslinjer." + +#: ../C/gedit.xml:1702(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Kate-indstillingerne for tabulatorbredde (tab-" +"width), indrykningsbredde (indent-width), mellemrumsindrykning (space-" +"indent), ordombrydning (word-wrap) og ordombrydning ved kolonner (word-wrap-" +"column) understøttes. Mere information findes på websiden for " +"Kate." + +#: ../C/gedit.xml:1705(title) +msgid "Vim Modelines" +msgstr "Vim-tilstandslinjer" + +#: ../C/gedit.xml:1706(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"De første og sidste tre linjer af et dokument undersøges for " +"Vim-tilstandslinjer." + +#: ../C/gedit.xml:1707(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Vim-indstillingerne for et, expandtab, ts, " +"tabstop, sw, shiftwidth, wrap, and textwidth understøttes. Yderligere " +"information kan findes på websiden for Vim." + +#: ../C/gedit.xml:1712(title) +msgid "Python Console Plugin" +msgstr "Udvidelsesmodulet Python-konsol" + +#: ../C/gedit.xml:1713(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Udvidelsesmodulet Python-konsol lader dig køre " +"kommandoer i programmeringssproget Python fra gedit. Når dette udvidelsesmodul aktiveres, føjes et faneblad til " +"bundpanelet. Dette viser den seneste udskrift og et kommandoindtastningsfelt." + +#: ../C/gedit.xml:1714(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Kommandoer som indtastes i Python-konsollen kontrolleres ikke før de køres. " +"Det er derfor muligt at få gedit til at gå i stå " +"ved, for eksempel, at indtaste en uendelig løkke." + +#: ../C/gedit.xml:1718(title) +msgid "Snippets Plugin" +msgstr "Udvidelsesmodulet Tekststumper" + +#: ../C/gedit.xml:1719(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"Udvidelsesmodulet Tekststumper lader dig lagre " +"ofte brugte bidder af tekst, kaldet tekststumper, og " +"indsætte dem hurtigt i et dokument." + +#: ../C/gedit.xml:1720(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Tekststumper er specifikke for det aktuelle dokuments sprogsyntaks. Hvis du " +"for eksempel arbejder med et HTML-dokument, kan du vælge fra en liste af " +"tekststumper, som er nyttige til HTML. Ydermere er visse tekststumper " +"globale, således at de er tilgængelige i alle dokumenter." + +#: ../C/gedit.xml:1721(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"En samling af indbyggede tekststumper installeres sammen med " +"gedit, og kan redigeres." + +#: ../C/gedit.xml:1724(title) +msgid "Inserting Snippets" +msgstr "Indsættelse af tekststumper" + +#: ../C/gedit.xml:1725(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"For at indsætte en tekststump i et dokument, skal du skrive dens " +"tabulator-udløser og trykke på Tabulatortast. En tekststumps tabulator-udløser består sædvanligvis af de første " +"bogstaver i tekststumpen, eller noget tilsvarende som er kort og nemt at " +"huske." + +#: ../C/gedit.xml:1726(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Alternativt kan du trykke CtrlMellemrumstast for at se en liste af " +"tekststumper, som kan indsættes." + +#: ../C/gedit.xml:1730(title) +msgid "Adding Snippets" +msgstr "Tilføjelse af tekststumper" + +#: ../C/gedit.xml:1731(para) +msgid "To create a new snippet, do the following:" +msgstr "Gør følgende for at oprette en ny tekststump:" + +#: ../C/gedit.xml:1734(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Vælg VærktøjerKonfigurér " +"tekststumper. Vinduet Tekststumper åbnes." + +#: ../C/gedit.xml:1737(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"Listen af tekststumper er grupperet efter sprog. Vælg det sprog, du vil " +"tilføje en tekststump for, eller en tekststump i denne sproggruppe. Vil du " +"tilføje en tekststump for alle sprog, så vælg Global øverst på listen. " +"Syntaksen for dokumentet, du i øjeblikket arbejder med, vises som standard." + +#: ../C/gedit.xml:1740(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Klik på Ny. En ny tekststump vil dukke op i listen." + +#: ../C/gedit.xml:1743(para) +msgid "Enter the following information for the new snippet:" +msgstr "Indtast følgende information for den nye tekststump:" + +#: ../C/gedit.xml:1745(term) +msgid "Name" +msgstr "Navn" + +#: ../C/gedit.xml:1747(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Indtast et navn for tekststumpen i tekstfeltet inden i listen over " +"tekststumper. Navnet på en tekststump tjener kun som påmindelse for stumpens " +"formål. Du kan ændre navnet på en tekststump som du opretter, ved at klikke " +"på det i listen." + +#: ../C/gedit.xml:1750(term) +msgid "Snippet text" +msgstr "Tekststump" + +# Der er ingen komponent med teksten Edit snippet, men Redigér henviser til teksten for en streng i gedit som henvises fra en kildefil snippets-mappen +#: ../C/gedit.xml:1752(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Indtast selve stumpen af tekst i Redigér-tekstfeltet. " +"Du kan her anvende specielle koder - se ." + +#: ../C/gedit.xml:1753(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Du kan skifte tilbage til dokumentvinduet og kopiere teksten uden at lukke " +"Tekststumper-vinduet." + +#: ../C/gedit.xml:1756(term) +msgid "Tab Trigger" +msgstr "Tabulator-udløser" + +#: ../C/gedit.xml:1758(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Indtast tabulator-udløseren for tekststumpen. Dette er teksten som du skal " +"skrive før du trykker Tabulatortest for at indsætte " +"tekststumpen." + +#: ../C/gedit.xml:1759(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Mærket skal være enten et enkelt ord bestående kun af bogstaver, eller et " +"enkelt tegn. Tabulator-udløser vil blive fremhævet med " +"rødt hvis en ugyldig tabulator-udløser anføres." + +#: ../C/gedit.xml:1762(term) +msgid "Shortcut key" +msgstr "Genvejstast" + +#: ../C/gedit.xml:1764(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Tryk på en genvejstast der skal bruges til at indsætte tekststumpen." + +#: ../C/gedit.xml:1773(title) +msgid "Editing and Removing Snippets" +msgstr "Redigér og fjern tekststumper" + +#: ../C/gedit.xml:1774(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Ønsker du at redigere en tekststump, så vælg den i listen og foretag " +"ændringer i dens tekst og aktiveringsegenskaber." + +#: ../C/gedit.xml:1775(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Klik på tekststumpen igen i listen for at omdøbe den." + +# Engelske tekst findes ikke i po-filen, har valgt mest sandsynlige oversættelse +#: ../C/gedit.xml:1776(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Du kan trykke Gendan den markerede tekststump for at " +"gendanne en indbygget tekststump, du har redigeret." + +#: ../C/gedit.xml:1777(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Vil du fjerne en tekststump, så vælg den i listen og tryk Fjern. Du kan ikke fjerne indbyggede tekststumper, men kun dem som du " +"selv har oprettet." + +#: ../C/gedit.xml:1781(title) +msgid "Snippet Substitutions" +msgstr "Substitution i tekststumper" + +#: ../C/gedit.xml:1782(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Ud over at indsætte forhåndslagret tekst, kan en tekstbid inkludere dynamisk " +"redigerbar tekst, eller markere steder hvor du kan tilføje tekst når først " +"tekstbidden er indsat i dit dokument." + +#: ../C/gedit.xml:1786(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "Du kan anvende følgende substitutionskoder i tekststumpen:" + +#: ../C/gedit.xml:1788(term) +msgid "Tab placeholders" +msgstr "Tabulatorsubstitutioner" + +#: ../C/gedit.xml:1790(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n definerer en " +"tabulatorsubstitution, hvor n er et tal større end eller " +"lig med 1." + +#: ../C/gedit.xml:1791(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:standardværdi} definerer en tabulatorsubstitution med en " +"standardværdi." + +#: ../C/gedit.xml:1792(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"En tabulatorsubstitution markerer et sted i tekststumpen hvor du kan tilføje " +"ekstra tekst efter at stumpen er indsat." + +#: ../C/gedit.xml:1793(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"For at bruge tabulatorsubstitutioner, skal du indsætte tekststumpen som " +"normalt. Markøren vil så blive placeret ved første tabulatorsubstitution. " +"Tallet i substitutionskoden angiver rækkefølgen hvori der med tabulatortast " +"navigeres mellem hver af substitutionsstederne i teksten." + +#: ../C/gedit.xml:1794(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Tryk SkiftTabulatortast for at vende tilbage til forrige substitutionssted. Trykker du " +"Tabulatortast når der ikke er flere substitutionssteder, " +"flyttes markøren til slutningen af tekststumpen, eller til sidste " +"substitutionssted, hvis det findes." + +#: ../C/gedit.xml:1797(term) +msgid "Mirror placeholders" +msgstr "Klonsubstitutioner" + +#: ../C/gedit.xml:1799(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"En gentagen tabulatorsubstitution vil klone substitutionen der allerede er " +"defineret. Dette tillader dig, kun at skrive et stykke tekst en enkelt gang, " +"selvom du vil have den inkluderet flere gange i tekststumpen." + +#: ../C/gedit.xml:1802(term) +msgid "End placeholder" +msgstr "Slutsubstitution" + +#: ../C/gedit.xml:1804(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 definerer en slutsubstitution. Dette tillader dig at " +"afslutte behandlingen af en tekststump således at markøren vil være på et " +"andet punkt end slutningen af tekststumpen." + +#: ../C/gedit.xml:1807(term) +msgid "Environmental variables" +msgstr "Miljøvariable" + +#: ../C/gedit.xml:1809(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Miljøvariable såsom $PATH og $HOME " +"substitueres i tekststumpen. Specielt kan der i gedit også anvendes følgende variable:" + +#: ../C/gedit.xml:1811(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: ../C/gedit.xml:1813(para) +msgid "The currently selected text." +msgstr "Den aktuelt markerede tekst." + +#: ../C/gedit.xml:1816(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: ../C/gedit.xml:1818(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Det fulde filnavn på dokumentet, eller en tom streng hvis dokumentet endnu " +"ikke er blevet gemt." + +#: ../C/gedit.xml:1821(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: ../C/gedit.xml:1823(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"Filnavnets basenavn, eller en tom streng hvis dokumentet endnu ikke blevet " +"gemt." + +#: ../C/gedit.xml:1826(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +# Mystisk, dette lyder lidt omvendt +#: ../C/gedit.xml:1828(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"Ordet ved markørens placering i dokumentet. Når denne variabel bruges, " +"erstattes det aktuelle ord med tekststumpen." + +#: ../C/gedit.xml:1836(term) +msgid "Shell placeholders" +msgstr "Skalsubstitutioner" + +#: ../C/gedit.xml:1838(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(kmd) erstattes med " +"resultatet af udførelsen af kommandoen kmd i en " +"skal." + +#: ../C/gedit.xml:1839(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:kmd) tillader dig at give denne substitution en reference, hvor " +"n er et tal større end eller lig med 1. Brug " +"$n for at anvende uddata fra " +"en skalsubstitution som inddata til en anden." + +#: ../C/gedit.xml:1842(term) +msgid "Python placeholders" +msgstr "Pythonsubstitutioner" + +#: ../C/gedit.xml:1844(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> bliver erstattet " +"af resultatet af evaluering af cmd i python-" +"fortolkeren." + +#: ../C/gedit.xml:1845(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:kmd>" +" angiver en anden Python-substitution som afhængighed, hvor " +"a angiver dens orden i tekststumpen. Dette lader " +"dig bruge Python-funktioner defineret i en anden tekststump. Du kan angive " +"flere afhængigheder ved at adskille numrene med kommaer således: " +"$<a,b:" +"kmd>" + +#: ../C/gedit.xml:1846(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Erklær en variabel som global for at bruge den i alle " +"andre Python-tekststumper." + +#: ../C/gedit.xml:1855(title) +msgid "Sort Plugin" +msgstr "Udvidelsesmodulet Sortering" + +#: ../C/gedit.xml:1856(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Udvidelsesmodulet Sortering sorterer markerede " +"linjer af tekst i alfabetisk orden." + +#: ../C/gedit.xml:1857(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Du kan ikke omgøre sorteringsoperationen, så du bør gemme filen før du " +"udfører sortering. For at gendanne den gemte version af filen efter en " +"sorteringsoperation, kan du vælge FilForkast." + +#: ../C/gedit.xml:1860(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Udfør følgende trin for at anvende udvidelsesmodulet Sortering:" + +#: ../C/gedit.xml:1863(para) +msgid "Select the lines of text you want to sort." +msgstr "Vælg linjerne som du ønsker at sortere." + +#: ../C/gedit.xml:1865(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Vælg RedigérSortér. Sortér-dialogen vil blive " +"åbnet." + +#: ../C/gedit.xml:1868(para) +msgid "Choose the options you want for the sort:" +msgstr "Vælg indstillinger for sorteringen:" + +#: ../C/gedit.xml:1871(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Vælg Omvendt orden for at sortere teksten i omvendt " +"rækkefølge." + +#: ../C/gedit.xml:1874(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Vælg Fjern dupletter for at fjerne linjer, der " +"forekommer mere end en gang." + +#: ../C/gedit.xml:1877(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Du kan eventuelt vælge Ignorér store/små bogstaver." + +#: ../C/gedit.xml:1880(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Du kan få sorteringen til at ignorere de indledende tegn i hver linje. Dette " +"gøres ved at angive kolonnenummeret på det første tegn der skal indgå i " +"sorteringen i Begynd ved kolonne-rulleknappen." + +#: ../C/gedit.xml:1885(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"Klik på Sortér for at udføre sorteringsoperationen." + +#: ../C/gedit.xml:1892(title) +msgid "Spell Checker Plugin" +msgstr "Udvidelsesmodulet Stavekontrol" + +#: ../C/gedit.xml:1893(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Udvidelsesmodulet Stavekontrol kontrollerer " +"stavningen i den valgte tekst. Du kan konfigurere gedit til at kontrollere stavningen automatisk, eller du kan køre " +"stavekontrol manuelt på det angivne sprog. Sprogindstillingen og " +"autokontrolegenskaberne gælder dokumentvis. For at bruge udvidelsesmodulet " +"Stavekontrol, skal du gøre følgende:" + +#: ../C/gedit.xml:1895(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Vælg VærktøjerVælg sprog for at vise dialogen Vælg sprog. Vælg så det ønskede sprog fra listen. Klik på O.k. for at lukke dialogen igen." + +#: ../C/gedit.xml:1898(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Hvis du vil anvende automatisk stavekontrol, så vælg " +"VærktøjerKontrollér stavning " +"automatisk. Dette kan deaktiveres ved at vælge " +"VærktøjerKontrollér automatisk " +"stavning igen. Når automatisk stavekontrol er " +"slået til, vil et ikon vises ved siden af menuelementet " +"Kontrollér automatisk stavning. Automatisk " +"stavekontrol er som standard slået fra når gedit " +"startes." + +#: ../C/gedit.xml:1899(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Ukendte stavemåder vises i en anden farve og understreges. Højreklik på en " +"ukendt stavemåde, og vælg så Stavningsforslag fra popup-" +"menuen:" + +#: ../C/gedit.xml:1902(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"For at erstatte den ukendte stavemåde med en anden stavemåde i listen, skal " +"du vælge stavemåden i popup-menuen Stavningsforslag." + +#: ../C/gedit.xml:1905(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Vælg StavningsforslagTilføj for at tilføje den ukendte stavemåde til din " +"personlige ordbog." + +#: ../C/gedit.xml:1908(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Hvis du vil ignorere alle forekomster af den ukendte stavemåde, således at " +"de ikke længere bliver markeret som ukendt, men heller ikke føjes til din " +"personlige ordbog, så vælg StavningsforslagIgnorér alle. Det ukendte " +"ord vil så kun blive ignoreret i den aktuelle gedit-session." + +#: ../C/gedit.xml:1913(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Vælg VærktøjerKontrollér " +"stavning for at kontrollere stavningen manuelt." + +#: ../C/gedit.xml:1915(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Hvis der ikke er nogen stavefejl, vil dialogen Information vise en meddelelse om at dokumentet ikke indeholder nogen forkert " +"stavede ord. Klik O.k. for at lukke " +"Information-dialogen." + +#: ../C/gedit.xml:1917(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Hvis der er stavefejl, vil dialogen Kontrollér stavning " +"blive vist:" + +#: ../C/gedit.xml:1920(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "Forkert stavet ord vises øverst i dialogen." + +#: ../C/gedit.xml:1923(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Et forslag til en kendt stavemåde vises i Ret til-" +"tekstfeltet. Du kan erstatte dette med en anden kendt stavemåde ved at vælge " +"stavemåden fra listen Forslag, eller du kan indtaste " +"teksten direkte i Ret til-tekstfeltet." + +#: ../C/gedit.xml:1926(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Klik på Kontrollér ord for at kontrollere stavemåden " +"af teksten i Ret til-tekstfeltet. Hvis dette ord " +"kendes, vil Forslag-listen blive erstattet med teksten " +"(korrekt stavning). Hvis ordet ikke kendes, vil nye ord " +"dukke op i Forslag-listen." + +#: ../C/gedit.xml:1929(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Klik på Ignorér for at ignorere den aktuelle " +"forekomst af det ukendte ord. Klik på Ignorér alle " +"for at ignorere alle forekomster af det ukendte ord. Det ukendte ord vil så " +"blive ignoreret i den aktuelle gedit-session." + +#: ../C/gedit.xml:1932(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Klik på Ret for at ændre den aktuelle forekomst af " +"det ukendte ord til teksten i Ret til-tekstfeltet. Klik " +"på Ret alle for at ændre alle forekomster af det " +"ukendte ord til teksten i Ret til-tekstfeltet." + +#: ../C/gedit.xml:1935(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Klik på Tilføj ord for at føje det ukendte ord til " +"din personlige ordbog." + +#: ../C/gedit.xml:1938(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Klik på Luk for at lukke dialogen " +"Kontrollér stavning." + +#: ../C/gedit.xml:1947(title) +msgid "Tag List Plugin" +msgstr "Udvidelsesmodulet Mærkelister" + +#: ../C/gedit.xml:1948(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Udvidelsesmodulet Mærkeliste lader dig indsætte " +"almindelige mærker fra en liste i sidepanelet." + +#: ../C/gedit.xml:1949(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "For at bruge udvidelsesmodulet Mærkeliste, skal du gøre som følger:" + +#: ../C/gedit.xml:1951(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Vælg VisSidepanel." + +#: ../C/gedit.xml:1955(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"I standardkonfigurationen viser sidepanelet et faneblade med en liste af " +"åbne dokumenter. Klik på fanebladet, der viser symbolet + i bunden af " +"sidepanelet for at vise fanebladet for mærkelister." + +#: ../C/gedit.xml:1957(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Vælg den relevante mærkekategori fra rullegardinslisten, for eksempel " +"HTML - mærker." + +#: ../C/gedit.xml:1960(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Rul gennem mærkelisten for at finde det påkrævede mærke." + +#: ../C/gedit.xml:1963(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Dobbeltklik på mærket i mærkelisten for at indsætte et mærke ved " +"markørpositionen i den aktuelle fil. Du kan også indsætte et mærke som " +"følger:" + +# Jeg er ikke sikker på "visningsområdet", der synes ikke at være nogen streng i UI kaldet display area +#: ../C/gedit.xml:1965(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Tryk Retur for at indsætte et mærke i den aktuelle fil og " +"ændre fokus fra sidepanelet til visningsområdet." + +# Jeg tror ikke den engelske titel på vinduet er helt rigtig, så oversættelsen er gjort mest muligt generisk +#: ../C/gedit.xml:1968(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Tryk SkiftRetur for " +"at indsætte et mærke i den aktuelle fil og vedligeholde fokus på " +"mærkelistevinduet." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: ../C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"M.P. Rommedahl , 2008.\n" +"Ask Hjorth Larsen , 2008.\n" +"\n" +"\"Dansk-gruppen \"\n" +"\"\"Mere info: http://www.dansk-gruppen.dk\"" + +#~ msgid "July 2006" +#~ msgstr "Juli 2006" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Brugernavn indsætter den aktuelle brugers brugernavn i dokumentet." + +#~ msgid "User Name Plugin" +#~ msgstr "Udvidelsesmodulet Brugernavn" + +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "Udvidelsesmodulet Brugernavn indsætter " +#~ "brugernavnet for den aktuelle bruger i dokumentet." + +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "Du kan indsætte dit brugernavn ved markørpositionen ved at vælge " +#~ "RedigérIndsæt brugernavn." + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "Intet skærmbillede" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "Intet skærmbillede" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "Intet skærmbillede" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "Intet skærmbillede" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "For yderligere information om hvordan du konfigurerer syntaksfremhævning, " +#~ "se ." + +#~ msgid "Colors" +#~ msgstr "Farveskema" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Vælg Brug farver fra standardtema for at bruge " +#~ "farverne fra tekstvinduet i gedit." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Klik på Normal tekstfarve for at få vist " +#~ "farvevælger-dialogen. Vælg en farve at bruge til at få fremvist normal " +#~ "tekst i tekstvinduet i gedit." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Klik på Baggrundsfarve for at få vist " +#~ "farvevælgerdialogen. Vælg en baggrundsfarve til brug i tekstvinduet i " +#~ "gedit." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Klik på Farve til markeret tekst for at få vist " +#~ "farvevælger-dialogen. Vælg en farve til brug ved visning af markeret " +#~ "tekst." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Klik på Markeringsfarve for at få vist farvevælger-" +#~ "dialogen. Vælg en baggrundsfarve som skal bruges til at fremhæve en " +#~ "tekstmarkering." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Syntaksfremhævningsindstillinger" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "Enable syntax highlighting" +#~ msgstr "Aktivér syntaksfremhævning" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "" +#~ "Vælg denne mulighed for at fremhæve syntaksen i den tekst, som du " +#~ "redigerer." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "Highlight mode" +#~ msgstr "Fremhævningstilstand" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Brug denne rullegardinsmenu til at vælge en syntakstilstand at " +#~ "konfigurere." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "Elements" +#~ msgstr "Elementer" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "Brug denne listeboks til at vælge et syntakselement at konfigurere." + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "Format buttons" +#~ msgstr "Formatknapper" + +# Denne funktion lader til at være udgået i den seneste version af gedit... +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Brug de følgende knapper til at ændre det valgte syntakselements format:" + +#~ msgid "Button" +#~ msgstr "Knap" + +#~ msgid "Format" +#~ msgstr "Format" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Viser ikonet for fedformatering." + +#~ msgid "Bold" +#~ msgstr "Fed" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Viser ikonet for kursivformatering." + +#~ msgid "Italic" +#~ msgstr "Kursiv" + +#~ msgid "Shows icon for underline." +#~ msgstr "Viser ikonet for understregningsformatering." + +#~ msgid "Underline" +#~ msgstr "Understregning" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Viser ikonet for gennemstregning." + +#~ msgid "Strikethrough" +#~ msgstr "Gennemstregning" + +#~ msgid "Foreground" +#~ msgstr "Forgrund" + +# Dette er rent gæt, da funktionen lader til at være udgået i den nyeste version af gedit... +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Vælg denne mulighed for at ændre skriftfarven på det valgte " +#~ "syntakselement. Klik på farveknappen for at få vist farvevalgsdialogen, " +#~ "og vælg derefter skriftfarve." + +#~ msgid "Background" +#~ msgstr "Baggrund" + +# Dette er rent gæt, da funktionen lader til at være udgået i den nyeste version af gedit... +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Vælg denne mulighed for at ændre baggrundsfarven på det valgte " +#~ "syntakselement. Klik på farveknappen for at få vist farvevalgsdialogen, " +#~ "og vælg derefter baggrundsfarve." + +# Dette er rent gæt, da funktionen lader til at være udgået i den nyeste version af gedit... +#~ msgid "Reset to Default" +#~ msgstr "Gendan til standard" + +# Dette er rent gæt, da funktionen lader til at være udgået i den nyeste version af gedit... +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Klik på denne knap for at gendanne for- og baggrundsfarven på det valgte " +#~ "syntakselement til standardværdierne." diff --git a/help/de/de.po b/help/de/de.po new file mode 100755 index 00000000..72db195e --- /dev/null +++ b/help/de/de.po @@ -0,0 +1,4715 @@ +# German translation of the gedit documentation +# Jan Arne Petersen , 2007. +# Mario Blättermann , 2008-2010. +# Andre Klapper , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit help\n" +"POT-Creation-Date: 2010-07-28 06:52+0000\n" +"PO-Revision-Date: 2010-08-08 15:32+0100\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \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" + +#: 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 link 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 " +"Link oder in der mit diesem " +"Handbuch gelieferten Datei COPYING-DOCS." + +#: 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 "" +"Das vorliegende Handbuch ist Teil einer Reihe von MATE-Handbüchern, die " +"unter der GFDL verteilt werden. Wenn Sie dieses Handbuch separat verteilen " +"möchten, können Sie dies tun, indem Sie dem Handbuch eine Kopie der Lizenz, " +"wie in Abschnitt 6 der Lizenz beschrieben, hinzufügen." + +#: 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 "" +"Bei vielen der von Firmen zur Unterscheidung ihrer Produkte und " +"Dienstleistungen verwendeten Namen handelt es sich um Marken. An den Stellen, " +"an denen derartige Namen in einer MATE-Dokumentation vorkommen und wenn die " +"Mitglieder des MATE-Dokumentationsprojekts über diese Marken informiert " +"wurden, sind die Namen in Großbuchstaben oder mit großen Anfangsbuchstaben " +"geschrieben." + +#: 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 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 "" +"DAS DOKUMENT WIRD »WIE VORLIEGEND« GELIEFERT, OHNE JEGLICHE GEWÄHRLEISTUNG, " +"WEDER AUSDRÜCKLICH NOCH STILLSCHWEIGEND, EINSCHLIESSLICH, ABER NICHT " +"BESCHRÄNKT AUF, GEWÄHRLEISTUNGEN, DASS DAS DOKUMENT ODER EINE MODIFIZIERTE " +"VERSION DES DOKUMENTS FREI VON HANDELSÜBLICHEN FEHLERN UND FÜR EINEN " +"BESTIMMTEN ZWECK GEEIGNET IST UND KEINE RECHTE DRITTER VERLETZT. JEGLICHES " +"RISIKO IN BEZUG AUF DIE QUALITÄT, GENAUIGKEIT UND LEISTUNG DES DOKUMENTS ODER " +"EINER MODIFIZIERTEN VERSION DES DOKUMENTS TRAGEN SIE. SOLLTE SICH EIN " +"DOKUMENT ODER EINE MODIFIZIERTE VERSION DAVON IN IRGENDEINER WEISE ALS " +"FEHLERHAFT ERWEISEN, TRAGEN SIE (NICHT DER URSPRÜNGLICHE VERFASSER, AUTOR " +"ODER EIN MITWIRKENDER) DIE KOSTEN FÜR JEGLICHE ERFORDERLICHE SERVICE-, " +"REPARATUR- UND KORREKTURMASSNAHMEN: DIESE BESCHRÄNKUNG DER GEWÄHRLEISTUNG IST " +"WESENTLICHER BESTANDTEIL DIESER LIZENZ. JEDE VERWENDUNG EINES DOKUMENTS ODER " +"EINER MODIFIZIERTEN VERSION DES DOKUMENTS UNTERLIEGT DIESER BESCHRÄNKUNG; UND " +"UNTER KEINEN UMSTÄNDEN UND GEMÄSS KEINER RECHTSLEHRE, WEDER AUFGRUND VON " +"UNERLAUBTEN HANDLUNGEN (EINSCHLIESSLICH FAHRLÄSSIGKEIT), VERTRÄGEN ODER " +"SONSTIGEM, KANN DER AUTOR, DER URSPRÜNGLICHE VERFASSER, EIN MITWIRKENDER ODER " +"EIN VERTEILER DES DOKUMENTS ODER EINER MODIFIZIERTEN VERSION DES DOKUMENTS " +"ODER EIN LIEFERANT EINER DIESER PARTEIEN VON EINER PERSON FÜR DIREKTE, " +"INDIREKTE, BESONDERE, ZUFÄLLIGE ODER ALS FOLGE AUFGETRETENE SCHÄDEN " +"IRGENDEINER ART, EINSCHLIESSLICH, ABER NICHT BESCHRÄNKT AUF, SCHÄDEN DURCH " +"GESCHÄFTSWERTVERLUSTE, ARBEITSAUSFÄLLE, COMPUTERAUSFÄLLE ODER -" +"FUNKTIONSSTÖRUNGEN ODER JEGLICHE ANDERE SCHÄDEN ODER VERLUSTE, DIE DURCH ODER " +"IM ZUSAMMENHANG MIT DER VERWENDUNG DES DOKUMENTS ODER EINER MODIFIZIERTEN " +"VERSION DES DOKUMENTS ENTSTANDEN SIND, SELBST WENN DIESE PARTEI ÜBER MÖGLICHE " +"SCHÄDEN INFORMIERT WORDEN SEIN SOLLTE, HAFTBAR GEMACHT WERDEN." + +#: 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: " +"" +msgstr "" +"DAS DOKUMENT UND MODIFIZIERTE VERSIONEN DES DOKUMENTS WERDEN GEMÄSS DER " +"BEDINGUNGEN DER GNU FREE DOCUMENTATION LICENSE MIT DER FOLGENDEN VEREINBARUNG " +"BEREITGESTELLT: " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "translated" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Gedit-Handbuch" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "MATE-Dokumentationsprojekt" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Fügte die Tabelle der Tastenkombinationen hinzu" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java-Desktop-System-Dokumentationsteam" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek hat Informationen aus früheren Revisionen von gedit beigetragen." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Danksagungen" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George für Informationen zu Plugins." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit-Handbuch V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "März 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE Dokumentationsteam" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit-Handbuch V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Juni 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit-Handbuch V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "August 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit-Handbuch V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "September 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit-Handbuch V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Januar 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit-Handbuch V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "März 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "gedit-Handbuch V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "September 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "gedit-Handbuch V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "März 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "gedit-Handbuch V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Juli 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "gedit-Handbuch V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "MATE-Dokumentationsteam" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "In diesem Handbuch wird Version 2.16 von gedit beschrieben." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Rückmeldungen" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Wenn Sie Fehler finden oder Vorschläge zur Anwendung gedit oder diesem Handbuch haben, folgen Sie den Anweisungen auf der " +"MATE-Seite für " +"Rückmeldungen." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"Gedit ist der Texteditor für den MATE-Desktop, der über grundlegende und " +"robuste Funktionen wie Drucken, Rechtschreibprüfung, Suchen und Ersetzen, und " +"Syntax-Hervorhebung verfügt. Anspruchsvollere Funktionen sind als Plugins " +"verfügbar." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "Texteditor" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Einführung" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"Die Anwendung gedit erlaubt Ihnen, Textdateien zu " +"erstellen und zu bearbeiten." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to use " +"text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"Die Absicht von gedit ist es, ein schlichter und " +"einfach zu verwendender Texteditor zu sein. Leistungsfähigere Funktionen, die " +"eine Vielzahl von Aufgaben im Zusammenhang mit Textbearbeitung erfüllen, " +"können durch verschiedene Plugins aktiviert werden." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Erste Schritte" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Gedit starten" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"Sie können gedit auf eine der folgenden Weisen " +"starten:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Anwendungen-Menü" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Wählen Sie WerkzeugeTexteditor." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Befehlszeile" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Führen Sie den folgenden Befehl aus: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Wenn Sie ein Textdokument im Dateimanager öffnen, wird standardmäßig gedit " +"gestartet und das Dokument angezeigt." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "Das gedit-Fenster" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Wenn Sie gedit starten, wird folgendes Fenster " +"angezeigt:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "gedit-Fenster" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Zeigt das gedit-Hauptfenster an." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "Das gedit-Fenster enthält folgende Elemente:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Menüleiste" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Die Menüs in der Menüleiste enthalten alle Befehle, die Sie zum Arbeiten mit " +"Dateien in gedit benötigen." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Werkzeugleiste" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"Die Werkzeugleiste enthält einen Teil der Befehle, die Sie über die " +"Menüleiste aufrufen können." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Anzeigebereich" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "Der Anzeigebereich enthält den Text der Datei, die Sie bearbeiten." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Statusleiste" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"In der Statusleiste werden Informationen über die aktuelle " +"gedit-Aktivität und Kontextinformationen über die " +"Menüpunkte angezeigt. Die Statusleiste zeigt auch folgende Informationen an:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Position des Cursors: Die Nummer der Zeile und Spalte, in der sich der Cursor " +"befindet." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert " +"key to change edit mode." +msgstr "" +"Bearbeitungsmodus: Wenn der Einfügemodus aktiviert ist, wird in der " +"Statusleiste EIN angezeigt. Ist der Überschreibmodus " +"aktiviert, wird in der Statusleiste ÜBS angezeigt. " +"Drücken Sie die Einfg-Taste, um den Bearbeitungsmodus zu " +"ändern." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Seitenleiste" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"In der Seitenleiste wird eine Liste von offenen Dokumenten und, abhängig von " +"den aktiven Plugins, andere Informationen angezeigt." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Standardmäßig wird die Seitenleiste nicht angezeigt. Wählen Sie " +"AnsichtSeitenleiste um sie anzuzeigen." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Fußleiste" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Die Fußleiste wird von Programmierwerkzeugen, wie dem Python-" +"Konsole-Plugin, verwendet um Ausgaben anzuzeigen." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Standardmäßig wird die Fußleiste nicht angezeigt. Wählen Sie " +"AnsichtFußleiste um sie anzuzeigen." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Wenn Sie mit der rechten Maustaste auf das gedit-" +"Fenster klicken, wird ein Kontextmenü angezeigt. Das Kontextmenü enthält die " +"gängigsten Textbearbeitungsbefehle." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Wie in anderen MATE-Anwendungen auch, können Sie Befehle in " +"gedit in unterschiedlicher Weise ausführen: mit " +"dem Menü, mit der Werkzeugleiste oder mit Tastenkombinationen. Von allen " +"Anwendungen verwendete Tastenkombinationen sind im Benutzerhandbuch aufgeführt." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Gedit aus der Befehlszeile ausführen" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Sie können gedit über eine Befehlszeile ausführen " +"und eine oder mehrere Dateien öffnen. Zum Öffnen mehrerer Dateien über eine " +"Befehlszeile geben Sie den folgenden Befehl ein und drücken anschließend die " +"Eingabetaste:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "Datei1.txt Datei2.txt Datei3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Alternativ können Sie einen URI anstelle eines Dateinamens verwenden." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Weitere Informationen zur Ausführung von gedit aus " +"der Befehlszeile finden Sie in der Unix-Handbuchseite zu gedit: gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Mit Dateien arbeiten" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Eine neue Datei anlegen" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application displays " +"a new blank document in the gedit window." +msgstr "" +"Um eine neue Datei anzulegen, wählen Sie DateiNeu. Eine neue Datei wird im " +"gedit-Fenster angezeigt." + +#: C/gedit.xml:346(title) C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "Eine Datei öffnen" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Wenn Sie eine Datei öffnen möchten, wählen Sie DateiÖffnen, um das Dialogfeld " +"Datei öffnen anzuzeigen. Wählen Sie die zu öffnende " +"Datei aus, und klicken Sie auf Öffnen. Die Datei wird " +"im gedit-Fenster angezeigt." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Zuletzt geöffnete Dateien anzeigen (Menüsymbol)" + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent files " +"that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Die Anwendung zeichnet die Pfade und Dateinamen der fünf zuletzt bearbeiteten " +"Dateien auf und zeigt die Dateien als Menüpunkte im Menü " +"Datei an. Alternativ können Sie " +"auch auf den Knopf in der Werkzeugleiste klicken, um die " +"Liste der zuletzt geöffneten Dateien anzuzeigen." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this see " +"." +msgstr "" +"Sie können mehrere Dateien in gedit öffnen. Für " +"jede geöffnete Datei wird ein Reiter in das Fenster eingefügt. Weitere " +"Informationen dazu finden Sie unter ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Eine Datei speichern" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Sie können Dateien in einer der folgenden Weisen speichern:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Um Änderungen einer vorhandenen Datei zu speichern, wählen Sie " +"DateiSpeichern." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Um eine neue Datei zu speichern oder eine vorhandene Datei unter einem neuen " +"Dateinamen zu speichern, wählen Sie DateiSpeichern unter. Geben Sie im " +"Dialogfeld Speichern unter einen Namen für die Datei " +"ein, und klicken Sie auf Speichern." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Wenn Sie alle Dateien speichern möchten, die gerade in gedit geöffnet sind, wählen Sie DokumenteAlle speichern." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Wenn Sie alle Dateien schließen möchten, die gerade in gedit geöffnet sind, wählen Sie DokumenteAlle schließen." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Eine Datei über einen URI öffnen" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Führen Sie zum Öffnen einer Datei über einen URI (Uniform Resource " +"Identifier) die folgenden Schritte aus:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Wählen Sie DateiOrt öffnen, um das Dialogfeld Ort öffnen " +"anzuzeigen." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Geben Sie den URI der Datei ein, die Sie öffnen möchten." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Verwenden Sie die Zeichenkodierung-Einblendliste, um die " +"passende Zeichenkodierung auszuwählen." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Klicken Sie auf Öffnen." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Zu den zulässigen Typen für URI gehören " +"http:, ftp:, file: " +"sowie alle anderen von mate-vfs unterstützten Methoden." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP servers " +"may correctly work with saving remote files." +msgstr "" +"Dateien mancher URI-Typen werden nur als lesbar geöffnet, so dass jegliche " +"von Ihnen ausgeführte Änderungen an einem anderen Ort gespeichert werden " +"müssen. HTTP ermöglicht nur das Lesen von Dateien. Auf einem FTP-Server " +"liegende Dateien werden auch als nur lesbar geöffnet, weil nicht alle FTP-" +"Server entfernte Dateien korrekt speichern können." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Das Speichern auf FTP-Servern kann mit Hilfe des Konfigurationsditors ermöglicht werden. Aktivieren Sie den Schlüssel /apps/" +"gedit-2/preferences/editor/save/writable_vfs_schemes, aber " +"bedenken Sie, dass dies Fehler zur Folge haben kann." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Mit Reitern arbeiten" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Wenn mehr als eine Datei geöffnet wird, zeigt gedit einen Reiter für jedes Dokument über dem " +"Anzeigebereich. Klicken Sie auf den entsprechenden Reiter, um zu einem " +"anderen Dokument zu wechseln." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Um ein Dokument in ein anderes gedit-Fenster zu " +"bewegen, ziehen sie den zur Datei gehörenden Reiter in das Fenster, in " +"welches Sie die Datei verschieben möchten." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Um ein Dokument in ein neues gedit-Fenster zu " +"verschieben, können Sie entweder dessen Reiter auf den Desktop ziehen, oder " +"Sie wählen DokumenteIn neues " +"Fenster verschieben." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Mit Text arbeiten" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Text bearbeiten" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "" +"Sie können den Text einer Datei auf eine der folgenden Weisen bearbeiten:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Geben Sie neuen Text mit der Tastatur ein. Der blinkende " +"Eingabecursor markiert den Punkt, an welchem der neue " +"Text erscheint. Um diesen Punkt zu ändern, verwenden Sie die Pfeiltasten oder " +"klicken Sie mit der Maus." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose EditCopy." +msgstr "" +"Um den ausgewählten Text in die Zwischenablage zu kopieren, wählen Sie " +"BearbeitenKopieren." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Wenn Sie den markierten Text aus der Datei löschen und in die Zwischenablage " +"verschieben möchten, wählen Sie BearbeitenAusschneiden." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Um den markierten Text dauerhaft aus der Datei zu löschen, wählen Sie " +"BearbeitenLöschen." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Um den Inhalt der Zwischenablage an der Cursorposition einzufügen, wählen Sie " +"BearbeitenEinfügen. Sie müssen zunächst Text aus gedit oder einer anderen Anwendung " +"kopieren oder ausschneiden, bevor Sie ihn aus dem Puffer in die Datei " +"einfügen können." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Um den gesamten Text einer Datei zu markieren, wählen Sie " +"BearbeitenAlles markieren." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Änderungen rückgängig machen oder wiederholen" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this action, " +"choose EditRedo." +msgstr "" +"Um eine vorgenommene Änderung rückgängig zu machen, wählen Sie " +"BearbeitenRückgängig. Um diesen Vorgang wider umzukehren, wählen Sie " +"BearbeitenWiederholen." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Suchen und Ersetzen" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"In gedit gibt es zwei Möglichkeiten der Textsuche. " +"Zum einen können Sie den Suchen-Dialog verwenden, um " +"nach einem bestimmten Text zu suchen, oder die Inkrementelle Suche, um den gefundenen Text bereits hervorzuheben, währen Sie ihn " +"eingeben." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Nach Text suchen" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "" +"Führen Sie zum Durchsuchen einer Datei nach einem Text folgende Schritte aus:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Wählen Sie SuchenSuchen, um das Dialogfeld Suchen " +"anzuzeigen." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Geben Sie den Text, nach dem Sie suchen möchten, in das Feld Suchen " +"nach ein. Sie können auch Sonderzeichen wie »Neue Zeile« oder " +"»Tabulator« eingeben. Information dazu finden Sie unter ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first occurrence " +"of the string after your current cursor position. If gedit finds the string, the application selects first occurrence of " +"the string. Other occurrences of the string are highlighted." +msgstr "" +"Klicken Sie auf Suchen, um nach dem ersten Auftreten " +"des Textes nach der aktuellen Cursor-Postion zu suchen. Wenn " +"gedit den Text findet, wird der Text markiert. " +"Andere Vorkommen des Textes werden hervorgehoben." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Um nach dem nächsten Vorkommen der Zeichenkette zu suchen, klicken Sie auf " +"Suchen oder wählen Sie SuchenWeitersuchen. Um nach dem " +"vorherigen Vorkommen der Zeichenkette zu suchen, wählen Sie " +"SuchenRückwärts suchen." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Nachdem Sie den Dialog Suchen geschlossen haben, können " +"Sie die Auswahl immer noch zu anderen Vorkommen des Texts verschieben. Wählen " +"Sie hierzu SuchenWeitersuchen und SuchenRückwärts suchen." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose SearchClear Highlight." +msgstr "" +"Um die Syntax-Hervorhebung aus dem Text zu entfernen, wählen Sie " +"SuchenHervorhebung zurücksetzen." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Inkrementelle Suche" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"Die inkrementelle Suche hebt den zu findenden Text im Dokument hervor, so wie " +"Sie ihn Buchstabe für Buchstabe eingeben. Dieses Verhalten ähnelt der " +"Suchfunktion in verschiedenen Webbrowsern." + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Um eine inkrementelle Suche zu starten, wählen Sie " +"SuchenInkrementelle Suche. Das Suchfeld erscheint am oberen Rand des " +"Anzeigebereichs." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Beginnen Sie mit der Eingabe, und der dazu passende Text wird unmittelbar im " +"Dokument hervorgehoben. Das erste Vorkommen nach der Position des Cursors " +"wird auch markiert." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Um die Textmarkierung zum nächsten passenden Text vorzurücken, während das " +"Eingabefeld der inkrementellen Suche geöffnet bleibt, drücken Sie " +"StrgG. Um zum " +"vorhergehenden passenden Text zurückzukehren, drücken Sie " +"StrgUmschaltG." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Sie können ebenfalls mit den Pfeiltasten nach oben/nach unten oder mit dem " +"Mausrad die Markierung zwischen den gefundenen passenden Texten verschieben." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Ersetzen von Text" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Wenn Sie nach einer Zeichenkette suchen und diese durch eine andere " +"Zeichenkette ersetzen möchten, gehen Sie folgendermaßen vor:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Wählen Sie SuchenErsetzen, um das Dialogfeld Ersetzen " +"anzuzeigen." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Geben Sie die Zeichenkette, nach der Sie suchen möchten, in das Feld " +"Suchen nach ein. Sie können auch Sonderzeichen wie »Neue " +"Zeile« oder »Tabulator« eingeben: Information dazu finden Sie in ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Geben Sie die Zeichenkette, durch die die gefundene Zeichenkette ersetzt " +"werden soll, in das Feld Ersetzen durch ein." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the next " +"occurrence of the string, click Find again." +msgstr "" +"Um jedes Vorkommen einer Zeichenkette vor dem Ersetzen zu prüfen, klicken Sie " +"auf Suchen. Falls gedit die " +"Zeichenkette findet, wird sie markiert. Klicken Sie auf Ersetzen, um das markierte Vorkommen der Zeichenkette zu ersetzen. Um nach " +"dem nächsten Vorkommen der Zeichenkette zu suchen, klicken Sie wieder auf " +"Suchen." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Um jedes Auftreten der Zeichenkette im Dokument zu ersetzen, klicken Sie auf " +"Alle ersetzen." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Optionen zum Suchen und Ersetzen" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Sowohl im Dialogfeld Suchen als auch im Dialogfeld " +"Ersetzen können Sie die folgenden Optionen festlegen:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences of " +"the string that match the case of the text that you type. For example, with " +"Match case selected, \"TEXT\" will not match \"text\"." +msgstr "" +"Wählen Sie die Option Groß-/Kleinschreibung berücksichtigen, um nur nach Text zu suchen, der in Groß- und Kleinschreibung mit " +"dem eingegebenen Text übereinstimmt. Zum Beispiel wird mit aktivierten " +"Groß-/Kleinschreibung berücksichtigen »TEXT« nicht in " +"»text« gefunden." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only selected, " +"\"text\" will not match \"texture\"." +msgstr "" +"Wählen Sie die Option Nur vollständige Wörter berücksichtigen, um nur nach Wörtern zu suchen, die den eingegebenen Text in Form " +"vollständiger Wörter enthalten. Zum Beispiel wird mit aktivierten " +"Nur vollständige Wörter berücksichtigen »Text« nicht in " +"»Textur« gefunden." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Wählen Sie die Option Rückwärts suchen, um Rückwärts in " +"Richtung des Dokumentanfangs zu suchen." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Wählen Sie die Option Suchen beim Erreichen des Endes am Anfang " +"fortsetzen, um die Suche am anderen Ende des Dokuments " +"fortzusetzen, wenn bei der Suche das Dokumentende oder der Dokumentanfang " +"erreicht wird." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Sonderzeichen" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or replace " +"to represent special characters:" +msgstr "" +"Sie können folgende Escape-Sequenzen in den zu suchenden oder zu ersetzenden " +"Text einfügen, um folgende Sonderzeichen zu verwenden:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Steht für einen Zeilenumbruch." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Steht für einen Tabulator." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Steht für einen Wagenrücklauf." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for field. " +"Or if you are looking for a sequence of backslashes, you will have to double " +"the number of searched backslashes." +msgstr "" +"Das Backslash-Zeichen selbst muss maskiert werden, falls danach gesucht " +"werden soll. Wenn Sie beispielsweise nach »\\n« suchen " +"wollen, müssen Sie »\\\\n« in das Feld Suchen nach " +"eingeben. Falls Sie nach mehreren aufeinanderfolgenden Backslash-Zeichen " +"suchen wollen, müssen Sie deren Anzahl in der Suche verdoppeln." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Den Cursor in eine bestimmte Zeile setzen" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Um den Cursor in eine bestimmten Zeile in der aktuellen Datei zu setzen, " +"wählen Sie SuchenGehe zu Zeile. Das Zeilennummerfeld erscheint oberhalb des " +"Anzeigebereichs." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Sobald Sie die Nummer der Zeile eingeben, in die der Cursor verschoben werden " +"soll wird die entsprechende Zeile des Dokuments angezeigt." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Um das Feld zu schließen und den Cursor in die eingegebene Zeile zu setzen, " +"drücken Sie die Eingabetaste." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Drucken" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Optionen der Seiteneinstellungen" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Um die Seiteneinstellungen festzulegen, wählen Sie " +"DateiSeite einrichten, um den Dialog Seite einrichten anzuzeigen." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"Im Dialogfeld Seite einrichten können Sie die folgenden " +"Druckoptionen festlegen:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Reiter »Allgemein«" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Im Hervorhebungsmodus drucken" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Wählen Sie diese Option, um den Text im Hervorhebungsmodus zu drucken. " +"Weitere Informationen über Hervorhebungen finden Sie in ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Seitenkopfzeilen drucken" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Wählen Sie diese Option, um auf jeder gedruckten Seite eine Kopfzeile " +"einzufügen. Die Kopfzeile kann nicht konfiguriert werden." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "Zeilennummern" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Wählen Sie die Option Zeilennummern drucken, um die " +"Zeilennummern beim Drucken mit einzuschließen." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Wählen Sie in der Auswahlliste Alle ... Zeilen nummerieren, wie oft die Zeilennummern gedruckt werden sollen, z. B. alle 5 " +"Zeilen, alle 10 Zeilen usw." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1176(guilabel) C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "Textumbruch" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text onto " +"the next line, at a character level, when you print a file. The application " +"counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Wählen Sie die Option Zeilenumbruch aktivieren, um den " +"Text beim Drucken einer Datei automatisch auf Wortebene umzubrechen. " +"Umbrochene Zeilen werden aus Gründen der Zeilennummerierung als eine Zeile " +"gezählt." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Mit der Option Nur am Wortende umbrechen wird Text am " +"Rand des Textfensters auf Wortebene in die nächste Zeile umgebrochen (d. h. " +"es werden nur vollständige Wörter umgebrochen)." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Schrift" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Rumpf" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Klicken Sie auf diesen Knopf, um die Schriftart für den Fließtext einer Datei " +"auszuwählen." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Zeilennummern" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Klicken Sie auf diesen Knopf, um die Schriftart für den Fließtext einer Datei " +"auszuwählen." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Kopf- und Fußzeilen" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Klicken Sie auf diesen Knopf, um die Schriftart zum Drucken der Kopfzeilen " +"und Fußzeilen in einer Datei auszuwählen." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Um die Standardschriftart einzustellen, die in gedit zum Drucken einer Datei verwendet wird, klicken Sie auf den " +"Knopf Auf Vorgabeschriften zurücksetzen." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Drucken eines Dokumentes" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Mit gedit können Sie die folgenden Druckvorgänge " +"ausführen:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "das Dokument auf einem Drucker ausgeben." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "die Ausgabe des Druckbefehls in einer Datei speichern." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Wenn Sie in eine Datei drucken, sendet gedit die " +"Ausgabe der Datei in eine Datei mit Druckvorstufenformat. Die am meisten " +"verbreiteten Formate der Druckvorstufe sind PostScript und PDF (Portable " +"Document Format)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Um eine Vorschau der auszudruckenden Seiten zu erhalten, wählen Sie " +"DateiDruckvorschau." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Wenn Sie die aktuelle Datei auf einen Drucker oder in eine Datei ausgeben " +"möchten, wählen Sie DateiDrucken, um das Dialogfeld Drucken zu " +"öffnen." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"Im Dialogfeld Drucken können Sie die folgenden " +"Druckoptionen festlegen:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Reiter »Drucker«" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Druckbereich" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Wählen Sie eine der folgenden Optionen, um die Anzahl der zu druckenden " +"Seiten festzulegen:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Alle" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Wählen Sie diese Option, um sämtliche Seiten der Datei zu drucken." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Zeilen" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the From and To spin boxes to specify the line range." +msgstr "" +"Wählen Sie diese Option, um nur die angegebenen Zeilen zu drucken. Benutzen " +"Sie die Einstellfelder von und bis, " +"um den zu druckenden Zeilenbereich festzulegen." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Markierung" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Wählen Sie diese Option, um nur den markierten Text auszudrucken. Diese " +"Option ist nur verfügbar, wenn Sie Text markiert haben." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Kopien" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Geben Sie im Einstellfeld Anzahl der Kopien die Anzahl " +"der Kopien an, die von dieser Datei gedruckt werden sollen." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Wenn Sie mehrere Kopien der Datei drucken, wählen Sie die Option " +"Sortieren, um die gedruckten Kopien zu sortieren." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Reiter »Drucker«" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Drucker" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Verwenden Sie die Auswahlliste, um den Drucker auszuwählen, auf welchem Sie " +"das Dokument ausgeben wollen." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Einstellungen" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Verwenden Sie die Auswahlliste, um die Druckeinstellungen zu ändern." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Um den Drucker zu konfigurieren, klicken Sie auf Konfigurieren. Beispielsweise können Sie den beidseitigen Druck ein- und " +"ausschalten, oder den Druck zu einem späteren Zeitpunkt definieren, sofern " +"Ihr Drucker dies unterstützt." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Ort" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "Wählen Sie mithilfe dieses Einstellfeldes die folgenden Druckziele aus:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Gibt die Datei auf einem CUPS-Drucker aus." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Wenn der ausgewählte Drucker ein CUPS-Drucker ist, dann ist CUPS der einzige Eintrag in dieser Auswahlliste." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Gibt die Datei auf einem Drucker aus." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Datei" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Druckt das Dokument in eine PostScript-Datei." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Klicken Sie auf Speichern unter, um einen Dialog zur " +"Auswahl des Namens und des Speicherorts der PostScript-Datei anzuzeigen." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Benutzerdefiniert" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Verwendet einen spezifischen Befehl zum Drucken des Dokuments." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Geben Sie den Namen des Befehls in das Eingabefeld ein, einschliesslich aller " +"Befehlszeilenargumente." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Status" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "" +"Diese Funktionalität wird in der vorliegenden Version von Gedit nicht " +"unterstützt." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Typ" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Kommentar" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Reiter »Papier«" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Papierformat" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Legen Sie mit dieser Einblendliste das Format des Papiers fest, auf dem die " +"Datei gedruckt werden soll." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Breite" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Legen Sie mittels des Eingabefeldes die Papierbreite fest. Über die daneben " +"stehende Einblendliste können Sie die Maßeinheit einstellen." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Höhe" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Legen Sie mittels dieses Eingabefeldes die Höhe des Papiers fest." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Einzugsausrichtung" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the printer." +msgstr "" +"Mit dieser Einblendliste geben Sie an, wie das Papier im Drucker ausgerichtet " +"ist." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Papierausrichtung" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Wählen Sie mithilfe dieser Einblendliste die Papierausrichtung aus." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Layout" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Wählen Sie mithilfe dieser Einblendliste das Seitenlayout aus. Eine Vorschau " +"des gerade ausgewählten Layouts wird im Bereich Vorschau " +"angezeigt." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Papiereinzug" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Wählen Sie mithilfe dieser Einblendliste den Papiereinzug aus." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Programmierfunktionen" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Verschiedene von gedit für Programmierzwecke " +"bestimmten Funktionsmerkmale werden durch Plugins realisiert. Beispielsweise " +"stellt das Taglisten-Plugin häufig benutzte Tags für verschiedene " +"Beschreibungssprachen bereit. Weitere Informationen hierzu finden Sie in " +"." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Hervorhebung" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"Die Hervorhebung macht Quellcode leichte lesbar, indem Teile des Textes in " +"verschiedenen Farben dargestellt werden." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit verwendet einen passenden " +"Hervorhebungsmodus, passend zum Typ des Dokuments. Um den Hervorhebungsmodus " +"selbst zu bestimmen, wählen Sie AnsichtHervorhebungsmodus. Dann " +"können Sie aus den folgenden Menüeinträgen wählen:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Keine" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Zeigt keine Hervorhebungen an." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Quellcode" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the Sources submenu to select the source code type." +msgstr "" +"Zeigt die Hervorhebungsmodi für die Bearbeitung von Quellcode. Verwenden Sie " +"das Untermenü Quellcode, um den Typ des Quellcodes " +"auszuwählen." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Auszeichnung" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Zeigt die Hervorhebungsmodi für die Bearbeitung von Auszeichnungs-Code. " +"Verwenden Sie das Untermenü Auszeichnung, um den Typ " +"des Auszeichnungs-Codes auszuwählen." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Skripte" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the Scripts submenu to select the script code type." +msgstr "" +"Zeigt die Hervorhebungsmodi für die Bearbeitung von Skriptsprachen-Code. " +"Verwenden Sie das Untermenü Skripte, um den Typ des " +"Skriptsprachen-Codes auszuwählen." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Sonstige" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Zeigt die Hervorhebungsmodi für die Bearbeitung anderer Code-Typen an. " +"Verwenden Sie das Untermenü Andere, um den Code-Typ " +"auszuwählen." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Die Ausgabe eines Befehls in eine Datei umleiten" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Mit gedit können Sie die Ausgabe eines Befehls in " +"eine Textdatei leiten. Wenn Sie z. B. die Ausgabe eines ls-" +"Befehls in eine Textdatei umleiten möchten, geben Sie ls | gedit ein, und drücken Sie die Eingabetaste." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Die Ausgabe des Befehls ls wird im gedit-Fenster in einer neuen Textdatei angezeigt." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Alternativ können Sie das Plugin Externe Werkzeuge " +"verwenden, um die Ausgabe des Befehls in die aktuelle Datei umzuleiten." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Tastenkombinationen" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Verwenden Sie Tastenkürzel, um häufig vorkommende Aufgaben schneller als mit " +"der Maus oder über die Menüs auszuführen. In den folgenden Tabellen werden " +"alle Tastenkürzel von gedit aufgelistet." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Weitere Informationen über Tastenkürzel finden Sie im Desktop-Benutzerhandbuch." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "Reiter" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Tastenkombinationen für Reiter:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) C/gedit.xml:1052(para) C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "Tastenkombination" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) C/gedit.xml:1054(para) C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "Befehl" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Strg+Alt+Bild auf" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Aktiviert den vorherigen Reiter." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Strg + Alt + Bild_Ab" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Aktiviert den nächsten Reiter." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Strg + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Schließt den Reiter." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Umschalt + Strg + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Alle Reiter speichern." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Umschalt + Strg + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Alle Reiter schließen." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Den n-ten Reiter aktivieren." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Dateien" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Tastenkombinationen zum Arbeiten mit Dateien:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Strg + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Eine neues Dokument anlegen." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Strg + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Ein Dokument öffnen." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Strg + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Einen Ort öffnen." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Strg + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Das aktuelle Dokument auf die Festplatte speichern." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Umschalt + Strg + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Das aktuelle Dokument unter einem anderen Dateinamen speichern." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Strg + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Das aktuelle Dokument drucken." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Umschalt + Strg + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Druckvorschau." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Das aktuelle Dokument schließen." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Strg + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Gedit beenden." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "Bearbeiten" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Tastenkombinationen zum Bearbeiten von Dokumenten:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Strg + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Letzten Vorgang rückgängig machen." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Umschalt + Strg + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Den rückgängig gemachten Vorgang wiederholen." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Strg + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "" +"Den markierten Text oder die markierte Region ausschneiden und in die " +"Zwischenablage verschieben." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Strg + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "" +"Den markierten Text oder den markierten Bereich in die Zwischenablage " +"kopieren." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Strg + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Den Inhalt der Zwischenablage einfügen." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Strg + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Alles markieren." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Strg + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Die aktuelle Zeile löschen." + +#: C/gedit.xml:1003(para) +msgid "Alt + Up" +msgstr "Alt + Pfeiltaste hoch" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "Die markierte Zeile um eine Position nach oben verschieben." + +#: C/gedit.xml:1007(para) +msgid "Alt + Down" +msgstr "Alt + Pfeiltaste runter" + +#: C/gedit.xml:1008(para) +msgid "Move the selected line down one line." +msgstr "Die markierte Zeile um eine Position nach unten verschieben." + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "Leisten" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Tastenkombinationen zum Anzeigen und Verbergen von Leisten:" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "Die Seitenleiste anzeigen/verbergen." + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Strg + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "Die Fußleiste anzeigen/verbergen." + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "Suchen" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "Tastenkombinationen zum Suchen:" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Strg + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "Einen Text suchen." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Strg + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "Das nächste Vorkommen des gleichen Textes suchen." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Umschalt + Strg + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "Das vorherige Vorkommen des gleichen Textes suchen." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Strg + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "Inkrementelle Suche." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Strg + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "Suchen und ersetzen." + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Umschalt + Strg + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "Hervorhebung zurücksetzen." + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Strg + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "Zu einer bestimmten Zeile gehen." + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "Werkzeuge" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "Tastenkombinationen für Werkzeuge:" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Umschalt + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "Rechtschreibprüfung (mit Plugin)." + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Unnötige Leerzeichen am Zeilenende entfernen (mit Plugin)." + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Strg + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "Einzug erhöhen (mit Plugin)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Umschalt + Strg + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "Einzug vermindern (mit Plugin)." + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "»make« im aktuellen Ordner ausführen (mit Plugin)." + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Umschalt + Strg + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "Ordnerinhalt anzeigen (mit Plugin)." + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "Hilfe" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "Tastenkombinationen für Hilfe:" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "Das gedit-Handbuch öffnen." + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "Einstellungen" + +#: C/gedit.xml:1164(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Um gedit zu konfigurieren, wählen Sie " +"BearbeitenEinstellungen. Das Dialogfeld Einstellungen " +"enthält die folgenden Kategorien:" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "Ansicht-Einstellungen" + +#: C/gedit.xml:1178(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Wählen Sie die Option Zeilenumbruch aktivieren, um lange " +"Zeilen umzubrechen, anstatt Sie über den Rand des Textfensters hinauslaufen " +"zu lassen. Dadurch lässt sich horizontales Scrollen vermeiden." + +#: C/gedit.xml:1179(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Wählen Sie die Option Nur am Wortende umbrechen, damit " +"Wörter nicht getrennt werden, wenn der Text in die nächste Zeile umgebrochen " +"wird. Dies verbessert die Lesbarkeit des Textes." + +#: C/gedit.xml:1185(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Wählen Sie die Option Zeilennummern anzeigen, um links " +"im gedit-Fenster Zeilennummern anzuzeigen." + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "Aktuelle Zeile" + +#: C/gedit.xml:1191(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Wählen Sie die Option Aktuelle Zeile hervorheben, um " +"jene Zeile hervorzuheben, in der sich der Cursor befindet." + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "Rechter Rand" + +#: C/gedit.xml:1197(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Aktivieren Sie das Kontrollkästchen Rechten Rand anzeigen, um eine senkrechte Linie zur Markierung des rechten Randes " +"anzuzeigen." + +#: C/gedit.xml:1198(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Verwenden Sie das Einstellfeld Rechter Rand in Spalte, " +"um die Position der senkrechten Linie anzugeben." + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "Klammerübereinstimmung" + +#: C/gedit.xml:1204(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Aktivieren Sie das Kontrollkästchen Übereinstimmende Klammern " +"hervorheben, um die korrespondierende Klammer hervorzuheben, wenn " +"sich der Cursor über einer Klammer befindet." + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "Einstellungen des Editors" + +#: C/gedit.xml:1217(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Legen Sie im Einstellfeld Tabulatorbreite fest, wie viel " +"Platz von gedit eingefügt wird, wenn Sie die " +"Tabulatortaste drücken." + +#: C/gedit.xml:1218(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Mit der Option An Stelle von Tabulatoren Leerzeichen einfügen können Sie festlegen, dass gedit beim " +"Drücken der Tabulatortaste statt eines Tabulatorzeichens " +"eine entsprechende Anzahl von Leerzeichen einfügen soll." + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "Auto-Einzug" + +#: C/gedit.xml:1224(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Wenn die Option Automatischen Einzug aktivieren " +"aktiviert ist, werden neue Zeilen automatisch so weit wie die jeweils " +"vorhergehende Zeile eingerückt." + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "Speichern von Dateien" + +#: C/gedit.xml:1230(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Wählen Sie die Option Vor dem Speichern von Dateien eine " +"Sicherheitskopie anlegen, um bei jedem Speichern von Dateien eine " +"Sicherungskopie erstellen zu lassen. An den Dateinamen der Sicherungskopie " +"wird eine Tilde (~) angefügt." + +#: C/gedit.xml:1231(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box to " +"specify how often you want to save the file." +msgstr "" +"Wählen Sie die Option Auto-Speichern von Dateien alle ... Minuten, um die aktuelle Datei in regelmäßigen Abständen zu speichern. " +"Legen Sie im Einstellfeld das Intervall fest, in dem die Datei gespeichert " +"werden soll." + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "Schriftarten und Farben" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "Schrift" + +#: C/gedit.xml:1243(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit text " +"window." +msgstr "" +"Wählen Sie die Option Dicktengleiche Schrift des Systems benutzen, um die Standard-Systemschrift für den Text im Textfenster " +"gedit zu verwenden." + +#: C/gedit.xml:1244(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button to " +"specify the font type, style, and size to use for text." +msgstr "" +"In diesem Feld wird die Schriftart angezeigt, in der in gedit Text angezeigt wird. Klicken Sie auf den Knopf, um Schriftart, -" +"stil und -größe für den Text festzulegen." + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "Farbschema" + +#: C/gedit.xml:1250(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, the " +"following color schemes are installed:" +msgstr "" +"Sie können ein Farbschema aus der Liste der Farbschemata wählen. " +"Standardmäßig sind die folgenden Farbschemata installiert:" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "Classic" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "" +"Klassisches Farbschema, basierend auf dem Schema von gvim." + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Kobalt" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "Auf Blau basierendes Farbschema." + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "" +"Das im Texteditor Kate verwendete Farbschema." + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Dunkles Farbschema, welches die Tango-Farbpalette verwendet." + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Farbschema, welches das Tango-Farbschema verwendet." + +#: C/gedit.xml:1283(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Sie können ein neues Farbschema hinzufügen, indem Sie auf " +"Hinzufügen … klicken und eine Farbschema-Datei auswählen." + +#: C/gedit.xml:1284(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Sie können das ausgewählte Farbschema entfernen, indem Sie auf " +"Entfernen klicken." + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "Plugin-Einstellungen" + +#: C/gedit.xml:1292(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Plugins fügen weitere Funktionsmerkmale zu gedit " +"hinzu. Weitere Informationen zu Plugins sowie über die Benutzung der " +"eingebauten Plugins finden Sie in ." + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "Aktivieren eines Plugins" + +#: C/gedit.xml:1297(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Um ein gedit-Plugin zu aktivieren, führen Sie die " +"folgenden Schritte aus:" + +#: C/gedit.xml:1300(para) C/gedit.xml:1321(para) C/gedit.xml:1643(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Wählen Sie BearbeitenEinstellungen." + +#: C/gedit.xml:1303(para) C/gedit.xml:1324(para) C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "Wählen Sie den Reiter Plugins aus." + +#: C/gedit.xml:1306(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"Aktivieren Sie das Kontrollkästchen neben dem Plugin, welches Sie aktivieren " +"wollen." + +#: C/gedit.xml:1309(para) C/gedit.xml:1330(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Klicken Sie auf Schließen, um den Dialog " +"Einstellungen zu schließen." + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "Deaktivieren eines Plugins" + +#: C/gedit.xml:1317(para) +msgid "A plugin remains enabled when you quit gedit." +msgstr "" +"Plugins bleiben auch nach dem Beenden von gedit " +"noch geladen." + +#: C/gedit.xml:1318(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Um ein gedit-Plugin zu deaktivieren, führen sie " +"die folgenden Schritte aus:" + +#: C/gedit.xml:1327(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Deaktivieren Sie das Kontrollkästchen neben dem Plugin, welches Sie " +"deaktivieren wollen." + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "Plugins" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "Arbeiten mit Plugins" + +#: C/gedit.xml:1342(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Sie können zu gedit weitere Funktionsmerkmale " +"hinzufügen, indem Sie plugins aktivieren. Ein Plugin " +"ist ein ergänzendes Programm, das die Funktionalität einer Anwendung " +"erweitert. Plugins fügen für die angebotenen Funktionen zu " +"gedit neue Menüeinträge hinzu." + +#: C/gedit.xml:1344(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Verschiedene Plugins sind bereits in gedit " +"eingebaut, weitere können zusätzlich installiert werden. Die Gedit-Website " +"listet Plugins von Drittanbietern auf." + +#: C/gedit.xml:1345(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Um Plugins zu aktivieren oder zu deaktivieren, oder um zu sehen, welche " +"Plugins gegenwärtig aktiviert sind, verwenden Sie die Plugin-Einstellungen." + +#: C/gedit.xml:1346(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"Die folgenden Plugins liefert gedit bereits mit:" + +#: C/gedit.xml:1352(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Groß-/Kleinschreibung " +"verändern ermöglicht Ihnen die Groß- oder " +"Kleinschreibung des ausgewählten Texts zu ändern." + +#: C/gedit.xml:1355(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Die Statistik " +"zum Dokument zeigt die Anzahl der Zeilen, Wörter und " +"Zeichen im Dokument an." + +#: C/gedit.xml:1358(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Externe Werkzeuge ermöglicht Ihnen die Ausführung externer Befehle in " +"gedit." + +#: C/gedit.xml:1361(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Die Dateiverwaltungsleiste ermöglicht Ihnen das " +"Durchsuchen Ihrer Dateien und Ordner in der Seitenleiste." + +#: C/gedit.xml:1364(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Zeileneinzug verändert die Einzugsbreite der ausgewählten Zeilen." + +#: C/gedit.xml:1367(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Datum/Uhrzeit " +"einfügen fügt die aktuelle Zeit und das aktuelle Datum " +"in ein Dokument ein." + +#: C/gedit.xml:1370(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Modelines ermöglichen die Bearbeitung von Einstellungen für spezielle " +"Dokumente. Dabei werden auf Emacs, " +"Kate und Vim basierende " +"Modelines unterstützt." + +#: C/gedit.xml:1373(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Die Python-" +"Konsole ermöglicht die Ausführung von Befehlen in der " +"Programmiersprache Python." + +#: C/gedit.xml:1376(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"In Schnipseln können Sie oft genutzte Textpassagen speichern und diese auf " +"einfache Weise in ein Dokument einfügen." + +#: C/gedit.xml:1379(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Sortieren ordnet gewählte Textzeilen in alphabetischer Reihenfolge an." + +#: C/gedit.xml:1382(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Die Rechtschreibprüfung korrigiert die Rechtschreibung im " +"ausgewählten Text oder markiert Rechtschreibfehler im Dokument automatisch." + +#: C/gedit.xml:1385(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Die Tag-Liste stellt häufig verwendete Tags für HTML und andere Sprachen in " +"einer Liste in der Seitenleiste bereit." + +#: C/gedit.xml:1389(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"Weitere Informationen über die Erstellung von Plugins finden Sie auf der " +"Webseite von " +"gedit." + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "Groß-/Kleinschreibung ändern" + +#: C/gedit.xml:1394(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"Das Plugin Groß-/Kleinschreibung ändern ändert die " +"Groß- oder Kleinschreibung des ausgewählten Texts." + +#: C/gedit.xml:1395(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Die folgenden Einträge werden zum Menü Bearbeiten " +"hinzugefügt, wenn das Plugin Groß-/Kleinschreibung verändern aktiviert ist:" + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "Menüeintrag" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "Aktion" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "Beispiel" + +#: C/gedit.xml:1415(guisubmenu) C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "Groß-/Kleinschreibung verändern" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "Alles in Großschreibung" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "Wechselt für jedes Zeichen die Schreibweise zu Großschreibung." + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "Dieser Text wird zu DIESER TEXT" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "Alles in Kleinschreibung" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "Wechselt für jedes Zeichen die Schreibweise zu Kleinschreibung." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "Dieser Text wird zu dieser text" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "Groß-/Kleinschreibung umkehren" + +#: C/gedit.xml:1428(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" +"Kehrt die Groß- und Kleinschreibung um. Jeder Kleinbuchstabe wird zu einem " +"Großbuchstaben, jeder Großbuchstabe zu einem Kleinbuchstaben." + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Dieser Text wird zu dIESER tEXT" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "Anfangsbuchstaben in Großschreibung" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "Ändert den ersten Buchstaben jedes Wortes in einen Großbuchstaben." + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "dieser text wird zu Dieser Text" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "Plugin »Statistik zum Dokument«" + +#: C/gedit.xml:1445(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and bytes " +"in the current file. The plugin displays the results in a Document " +"Statistics dialog. To use the Document Statistics plugin, perform " +"the following steps:" +msgstr "" +"Das Plugin Statistik zum Dokument gibt die Anzahl " +"der Zeilen, Wörter, Zeichen und Bytes in der aktuellen Datei an. Die " +"Ergebnisse werden in einem Dialog mit dem Titel Statistik zum " +"Dokument angezeigt. Die Arbeit mit dem Plugin »Statistik zum " +"Dokument« gestaltet sich wie folgt:" + +#: C/gedit.xml:1447(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Wählen Sie WerkzeugeStatistik zum " +"Dokument, um das Dialogfeld Statistik " +"zum Dokument anzuzeigen. Im Dialogfeld Statistik zum " +"Dokument werden die folgenden Informationen über die Datei " +"angezeigt:" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "Die Anzahl der Zeilen im aktuellen Dokument" + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "Die Anzahl der Wörter im aktuellen Dokument" + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "" +"Die Anzahl der Zeichen im aktuellen Dokument (einschließlich Leerzeichen)" + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Die Anzahl der Zeichen im aktuellen Dokument (ohne Leerzeichen)" + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "Die Anzahl der Bytes im aktuellen Dokument" + +#: C/gedit.xml:1467(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Sie können weiter an der gedit-Datei arbeiten, " +"während das Dialogfeld Statistik zum Dokument geöffnet " +"bleibt. Um den Inhalt des Dialogfelds Statistik zum Dokument zu aktualisieren, klicken Sie auf den Knopf " +"Aktualisieren." + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "Verwaltung externer Werkzeuge" + +#: C/gedit.xml:1475(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, sed), or launch a predefined command (for example, " +"make)." +msgstr "" +"Das Plugin Externe Werkzeuge ermöglicht Ihnen die " +"Ausführung interner Befehle in gedit. Sie können " +"Inhalte an einen Befehl weiterleiten und dessen Ausgabe verwerten (z.B. " +"sed) oder einen voreingestellten Befehl starten (z." +"B. make)." + +#: C/gedit.xml:1476(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Verwenden Sie die Verwaltung externer Werkzeuge, um " +"Befehle zu erstellen und zu bearbeiten. Um einen externen Befehl auszuführen, " +"wählen Sie ihn im Menü Werkzeuge aus." + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "Eingebaute Befehle" + +#: C/gedit.xml:1480(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"Die folgenden Befehle werden durch das Plugin Externe Werkzeuge bereitgestellt:" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Alles kompilieren" + +#: C/gedit.xml:1484(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Führt den Befehl make im aktuellen Ordner aus, in " +"welchem sich das Dokument befindet." + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "Ordnerliste" + +#: C/gedit.xml:1489(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "" +"Listet den Inhalt des aktuellen, das Dokument enthaltenden Ordners in einem " +"neuen Dokument auf." + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "Umgebungsvariablen" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Zeigt die Liste der Umgebungsvariablen in der Fußleiste an." + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Sucht anhand der Übereinstimmung mit einem Muster nach einem Begriff in allen " +"Dateien im gegenwärtigen Dokumentenordner. Die Ergebnisse werden in der " +"Fußleiste angezeigt." + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "Leerzeichen am Ende entfernen" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Enfernt im gesamten Dokument Leerzeichen am Zeilenende." + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "Definieren eines Befehls" + +#: C/gedit.xml:1512(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Um einen externen Befehl hinzuzufügen, wählen Sie " +"WerkzeugeExterne Werkzeuge." + +#: C/gedit.xml:1513(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the new " +"command:" +msgstr "" +"Im Fenster Verwaltung externer Werkzeuge klicken Sie auf " +"Neu. Sie können für den neuen Befehl folgende " +"Einzelheiten festlegen:" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "Beschreibung" + +#: C/gedit.xml:1517(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"Diese Beschreibung wird in der Statuszeile angezeigt, wenn der Menübefehl " +"ausgewählt ist." + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "Tastaturkürzel" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Geben Sie ein Tastenkürzel für den Befehl ein." + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "Befehle" + +#: C/gedit.xml:1527(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Der gegenwärtig auszuführende Befehl. Verschiedene Umgebungsvariablen in " +"gedit können dazu benutzt werden, um Inhalte an " +"diese Befehle weiterzuleiten. Weitere Informationen hierzu finden Sie in " +"." + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "Eingabe" + +#: C/gedit.xml:1532(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Der an die Befehle weiterzuleitende Inhalt (wie stdin): der gesamte Text des gegenwärtigen Dokuments, die gegenwärtige " +"Auswahl, Zeile oder Wort." + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "Ausgabe" + +#: C/gedit.xml:1537(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Hier können Sie wählen, wie mit der Ausgabe des Befehls zu verfahren ist: " +"Anzeigen in der Fußleiste, Einfügen in ein neues Dokument, am Ende, an der " +"Cursorposition, oder Ersetzen der Auswahl oder des gesamten Dokuments." + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "Anwendbarkeit" + +#: C/gedit.xml:1542(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Hierdurch wird bestimmt, welche Dokumente durch den Befehl beeinflusst " +"werden, beispielsweise gespeichert oder nicht, oder lokal oder entfernt." + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "Werkzeuge zum Bearbeiten und Entfernen" + +#: C/gedit.xml:1551(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Um eines der Werkzeuge zu bearbeiten, wählen Sie es in der Liste aus und " +"ändern Sie dessen Eigenschaften." + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "Um ein Werkzeug umzubenennen, klicken Sie es erneut in der Liste an." + +#: C/gedit.xml:1553(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Um eines der eingebauten Werkzeuge wiederherzustellen, nachdem Sie es " +"verändert haben, klicken Sie auf Zurücksetzen." + +#: C/gedit.xml:1554(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Um eines der Werkzeuge zu löschen, wählen Sie es in der Liste aus und klicken " +"Sie auf Entfernen. Beachten Sie, dass Sie nur selbst " +"erstellte Werkzeuge löschen können, nicht jedoch die in gedit eingebauten Werkzeuge." + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "Variablen" + +#: C/gedit.xml:1559(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"Sie können im Feld Befehle der Befehlsdefinition die " +"folgenden Variablen verwenden:" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "Dateiverwaltungs-Plugin" + +#: C/gedit.xml:1588(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Das Plugin Dateiverwaltungsleiste zeigt Ihre " +"Dateien und Ordner in der Seitenleiste an und ermöglicht das schnelle Öffnen " +"von Dateien." + +#: C/gedit.xml:1589(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Um die Dateiverwaltungsleiste anzuzeigen, wählen Sie " +"AnsichtSeitenleiste. Dann klicken Sie an der Unterseite der " +"Seitenleiste auf den Reiter mit dem Dateiverwaltungssymbol." + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "Durchsuchen Ihrer Dateien" + +#: C/gedit.xml:1592(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"Der Dateiverwaltungs-Reiter zeigt zunächst die Lesezeichen des Dateimanagers " +"an. Um den Inhalt eines der Objekte zu durchsuchen, doppelklicken Sie darauf." + +#: C/gedit.xml:1593(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Um einen Eltern-Ordner anzuzeigen, wählen Sie ihn in der Auswahlliste aus, " +"oder klicken Sie auf den nach oben zeigenden Pfeil in der Werkzeugleiste der " +"Dateiverwaltung." + +#: C/gedit.xml:1594(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Um den Ordner zu betrachten, der das gegenwärtig bearbeitete Dokument " +"enthält, klicken Sie mit der rechten Maustaste in die Dateiliste und wählen " +"Das aktive Dokument als Wurzel festlegen." + +#: C/gedit.xml:1598(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Um eine Datei in gedit zu öffnen, doppelklicken " +"Sie darauf in der Dateiliste." + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "Erstellen von Dateien und Ordnern" + +#: C/gedit.xml:1602(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Um eine neue, leere Textdatei im gegenwärtig im Browser angezeigten Ordner " +"anzulegen, klicken Sie mit der rechten Maustaste in die Dateiliste und wählen " +"Sie Neue Datei." + +#: C/gedit.xml:1603(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Um einen neuen Ordner innerhalb des aktuellen Ordners anzulegen, klicken Sie " +"mit der rechten Maustaste in die Dateiliste und wählen Sie Neuer " +"Ordner." + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "Plugin »Einzugsbreite«" + +#: C/gedit.xml:1609(para) +msgid "" +"The Indent Lines plugin adds or removes space from " +"the beginning of lines of text." +msgstr "" +"Das Plugin Einzugsbreite fügt am Anfang von " +"Textzeilen Leerzeichen hinzu oder entfernt diese." + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" +"Um den Einzug eines Textes zu erhöhen oder zu verringern, führen Sie die " +"folgenden Schritte aus:" + +#: C/gedit.xml:1612(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Wählen Sie die Zeilen aus, deren Einzug Sie ändern möchten. Um den Einzug " +"einer einzelnen Zeile zu ändern, setzen Sie den Cursor einfach an eine " +"beliebige Stelle in dieser Zeile." + +#: C/gedit.xml:1617(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Wählen Sie BearbeitenEinzug " +"erhöhen." + +#: C/gedit.xml:1620(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Um den Einzug zu verringern, wählen Sie stattdessen " +"BearbeitenEinzug verringern." + +#: C/gedit.xml:1625(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"Ob hierbei Tabulatoren oder Leerzeichen verwendet werden und um wieviele " +"Zeichen der Einzug verändert wird, hängt von den Einstellungen in " +"Tabulatoren in den Editor-Einstellungen ab. Weitere " +"Informationen hierzu finden Sie in ." + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "Plugin »Datum/Uhrzeit einfügen«" + +#: C/gedit.xml:1631(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Das Plugin »Datum/Uhrzeit einfügen« fügt das aktuelle Datum sowie die Uhrzeit " +"in eine Datei ein. Um das Plugin »Datum/Uhrzeit einfügen« zu verwenden, " +"führen Sie die folgenden Schritte aus:" + +#: C/gedit.xml:1633(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Wählen Sie BearbeitenDatum/" +"Uhrzeit einfügen." + +#: C/gedit.xml:1634(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and Time dialog. Select the appropriate date/time format from the list. " +"Click Insert to close the Insert Date and " +"Time dialog. gedit inserts the date/" +"time at the cursor position in the current file." +msgstr "" +"gedit zeigt nun das Dialogfeld Datum und " +"Uhrzeit einfügen an, es sei denn, Sie haben das Plugin »Datum/" +"Uhrzeit einfügen« so konfiguriert, dass es ohne weitere Formatabfrage direkt " +"Datum und Uhrzeit einfügt. Wählen Sie das gewünschte Format für Datum und " +"Uhrzeit aus der Liste aus. Klicken Sie auf Einfügen, " +"um das Dialogfeld Datum und Uhrzeit einfügen zu " +"schließen.gedit fügt nun an der Cursorposition das " +"Datum und die Uhrzeit in die aktuelle Datei ein." + +#: C/gedit.xml:1635(para) +msgid "" +"If you have configured gedit to use one particular " +"date/time format, the Insert Date and Time dialog is not " +"displayed. The date/time is automatically entered at the cursor position in " +"the current file." +msgstr "" +"Falls Sie gedit so konfiguriert haben, dass " +"automatisch ein bestimmtes Format für Datum und Uhrzeit verwendet wird, so " +"erscheint das Dialogfeld Datum und Uhrzeit einfügen " +"nicht. Datum und Uhrzeit werden in diesem Fall automatisch ohne weitere " +"Abfrage an der Position des Cursors in die aktuelle Datei eingefügt." + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Konfigurieren des Plugins »Datum/Uhrzeit einfügen«" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"Um das Plugin »Datum/Uhrzeit einfügen« zu konfigurieren, gehen Sie wie folgt " +"vor:" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Wählen Sie das Plugin Datum/Uhrzeit einfügen." + +#: C/gedit.xml:1652(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Klicken Sie auf Plugin konfigurieren, um das " +"Dialogfeld Plugin »Datum/Uhrzeit einfügen« konfigurieren " +"anzuzeigen." + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "Wählen Sie eine der folgenden Optionen aus:" + +#: C/gedit.xml:1657(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Wenn Sie beim Einfügen von Datum und Uhrzeit jedes Mal nach dem gewünschten " +"Format gefragt werden möchten, wählen Sie die Option Nach dem " +"Format fragen." + +#: C/gedit.xml:1660(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not prompt " +"you for the date/time format when you choose EditInsert Date and Time." +msgstr "" +"Wenn Sie hingegen möchten, dass gedit bei jedem " +"Einfügen automatisch ein bestimmtes Format für Datum und Uhrzeit verwendet, " +"so aktivieren Sie die Option Folgendes Format verwenden " +"und wählen anschließend das gewünschte Format aus der Liste aus. Ist diese " +"Option aktiviert, so fragt Sie gedit nicht mehr " +"nach dem Format, wenn Sie den Menübefehl BearbeitenDatum und Uhrzeit einfügen " +"wählen." + +#: C/gedit.xml:1663(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time format " +"when you choose EditInsert Date " +"and Time." +msgstr "" +"Sie können auch ein benutzerdefiniertes Format für Datum und Uhrzeit " +"festlegen, das bei allen folgenden Einfügevorgängen verwendet wird. Aktiveren " +"Sie hierzu die Option Benutzerdefiniertes Format verwenden und geben Sie das gewünschte Format im entsprechenden Textfeld ein. " +"Weiterführende Informationen zum Einstellen eines benutzerdefinierten Formats " +"finden Sie unter strftime3. Ist diese Option aktiviert, so fragt Sie " +"gedit nicht mehr nach dem Format, wenn Sie den " +"Menübefehl BearbeitenDatum und " +"Uhrzeit einfügen wählen." + +#: C/gedit.xml:1668(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Klicken Sie auf OK, um das Dialogfeld Plugin " +"'Datum/Uhrzeit einfügen' konfigurieren zu schließen." + +#: C/gedit.xml:1671(para) +msgid "" +"To close the Preferences dialog, click Close." +msgstr "" +"Um das Dialogfeld Einstellungen zu schließen, klicken " +"Sie auf Schließen." + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Modelines-Plugin" + +#: C/gedit.xml:1679(para) +msgid "" +"The Modelines plugin allows you to set preferences " +"for individual documents. A modeline is a line of text " +"at the start or end of the document with settings that gedit recognises." +msgstr "" +"Das Modelines-Plugin ermöglicht Ihnen die " +"Festlegung von Einstellungen für individuelle Dokumente. Eine " +"modeline ist eine Textzeile am Beginn oder Ende eines " +"Dokuments, deren spezielle Inhalte gedit " +"berücksichtigt." + +#: C/gedit.xml:1680(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Die mithilfe von Modelines vorgenommenen Einstellungen haben Vorrang " +"gegenüber den Festlegungen im Einstellungsdialog." + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "Sie können die folgenden Einstellungen für Modelines vornehmen:" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Tablulatorbreite" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "Einrückbreite" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "Leerzeichen an Stelle von Tabulatoren einfügen" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "Breite des rechten Rands" + +#: C/gedit.xml:1700(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Das Plugin Modelines unterstützt einen Teil der " +"von anderen Texteditoren wie Emacs, " +"Kate und Vim " +"verwendeten Optionen." + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Emacs-Modelines" + +#: C/gedit.xml:1704(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"Die ersten zwei Zeilen eines Dokuments werden für Emacs-Modelines eingelesen." + +#: C/gedit.xml:1705(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Die Optionen von Emacs für Tabulatorbreite, " +"Einzug, Tabulatoreinzug und automatischen Umbruch werden unterstützt. Weitere " +"Informationen hierzu finden Sie im GNU-Emacs-Handbuch." + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Kate-Modelines" + +#: C/gedit.xml:1709(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"Die ersten und die letzten jeweils zehn Zeilen werden für Kate-Modelines eingelesen." + +#: C/gedit.xml:1710(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Die Optionen von Kate für tab-width, indent-width, " +"space-indent, word-wrap und word-wrap-column werden unterstützt. Weitere " +"Informationen hierzu finden Sie auf der Kate-Website." + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Vim-Modelines" + +#: C/gedit.xml:1714(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"Die ersten und die letzten jeweils drei Zeilen eines Dokuments werden für " +"Vim-Modelines eingelesen." + +#: C/gedit.xml:1715(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Die Optionen von Vim für et, expandtab, ts, " +"tabstop, sw, shiftwidth, wrap, und textwidth werden unterstützt. Weitere " +"Informationen hierzu finden Sie auf der Vim-Website." + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Python-Konsole" + +#: C/gedit.xml:1721(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Das Plugin Python-Konsole ermöglicht Ihnen die " +"Ausführung von in der Programmiersprache Python geschriebenen Befehlen in " +"gedit. Die Aktivierung dieses Plugins fügt einen " +"Reiter zur Fußleiste hinzu. Dieser zeigt die gegenwärtige Ausgabe und ein " +"Eingabefeld für den Befehl an." + +#: C/gedit.xml:1722(para) +msgid "" +"Commands entered into the python console are not checked before they are run. " +"It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Die in der Python-Konsole eingegebenen Befehle werden vor der Ausführung " +"nicht überprüft. Daher kann es passieren, dass sich gedit aufhängt, beispielsweise durch die Erzeugung einer " +"Endlosschleife." + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "Plugin »Schnipsel«" + +#: C/gedit.xml:1727(para) +msgid "" +"The Snippets plugin allows you to store frequently-" +"used pieces of text, called snippets, and insert them " +"quickly into a document." +msgstr "" +"Das Schnipsel-Plugin ermöglicht Ihnen die " +"Speicherung häufig verwendeter Textbausteine, genannt Schnipsel, welche Sie dann schnell in ein Dokument einfügen können." + +#: C/gedit.xml:1728(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Schnipsel beziehen sich auf die jeweilige Syntax des gegenwärtigen Dokuments. " +"Wenn Sie beispielsweise ein HTML-Dokument bearbeiten, können sie aus einer " +"Liste von Schnipseln wählen, die für HTML geeignet sind. Zusätzlich sind " +"einige Schnipsel global und somit in allen Dokumenten verfügbar." + +#: C/gedit.xml:1729(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Eine Reihe von Schnipseln, welche auch anpassbar sind, werden mit " +"gedit bereits installiert." + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "Einfügen von Textschnipseln" + +#: C/gedit.xml:1733(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is usually " +"the first few letters of the snippet, or something else that is short and " +"easy to remember." +msgstr "" +"Um einen Schnipsel in ein Dokument einzufügen, geben Sie dessen " +"Tabulatorauslösung ein und drücken Sie die " +"Tabulatortaste. Die Tabulatorauslösung eines Schnipsels " +"besteht üblicherweise aus dessen ersten Buchstaben, oder etwas anderem, was " +"kurz und leicht zu merken ist." + +#: C/gedit.xml:1734(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Alternativ drücken Sie StrgLeertaste, um eine Liste der Schnipsel anzuzeigen, die Sie einfügen " +"können." + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "Hinzufügen von Textschnipseln" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "Einen neuen Textschnipsel können Sie auf die folgende Weise erstellen:" + +#: C/gedit.xml:1742(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Wählen Sie WerkzeugeSchnipsel " +"verwalten, um das Fenster " +"Schnipselverwaltung zu öffnen." + +#: C/gedit.xml:1745(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"Die Liste der Schnipsel ist nach Sprachen gruppiert. Wählen Sie die Sprache " +"aus, der Sie den Schnipsel zuordnen wollen, oder einen Schnipsel dieser " +"Sprachgruppe. Um einen Schnipsel für alle Sprachen verfügbar zu machen, " +"wählen Sie Global im Kopf der Liste." + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Klicken Sie auf Neu. Ein neuer Textschnipsel erscheint " +"in der Liste." + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "Geben Sie die folgenden Informationen für den neuen Textschnipsel ein:" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "Name" + +#: C/gedit.xml:1755(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Geben Sie einen Namen für den Schnipsel in das Eingabefeld innerhalb der " +"Schnipselliste ein. Der Name des Schnipsels dient nur als Gedächtnisstütze. " +"Sie können den Namen eines von Ihnen erstellten Schnipsel ändern, indem Sie " +"ihn in der Liste anklicken." + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "Textschnipsel" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Geben Sie den gewünschten Text für den Schnipsel in das Eingabefeld " +"Bearbeiten ein. Für spezielle Codes, die Sie verwenden " +"können, finden Sie weitere Informationen in ." + +#: C/gedit.xml:1761(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Sie können zum Kopieren des Texts in die Dokumentenansicht zurückschalten, " +"ohne das Fenster der Schnipselverwaltung zu schließen." + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Tabulatorauslösung" + +#: C/gedit.xml:1766(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Geben Sie die Tabulatorauslösung für den Schnipsel ein. Dies ist der Text, " +"den Sie eingeben, bevor Sie die Tabulatortaste zum Einfügen " +"des Schnipsels drücken." + +#: C/gedit.xml:1767(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Die Markierung muss entweder ein einzelnes Wort sein, das nur aus Buchstaben " +"besteht, oder ein einzelnes Zeichen. Die Tabulatorauslösung wird bei einer ungültigen Eingabe in roter Farbe hervorgehoben." + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "Tastenkombination" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "" +"Geben Sie ein Tastenkürzel ein, welches Sie für das Einfügen des Schnipsels " +"benutzen wollen." + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "Bearbeiten und Entfernen von Schnipseln" + +#: C/gedit.xml:1782(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Um einen Schnipsel zu bearbeiten, wählen sie ihn in der Liste aus und ändern " +"Sie dessen Text sowie die Aktivierungseigenschaften." + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "" +"Um einen Schnipsel umzubenennen, klicken Sie ihn erneut in der Liste an." + +#: C/gedit.xml:1784(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Falls Sie einen der eingebauten Schnipsel in seiner ursprünglichen Form " +"wiederherstellen wollen, wenn Sie ihn geändert haben, klicken Sie auf " +"Zurücksetzen." + +#: C/gedit.xml:1785(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have created " +"yourself." +msgstr "" +"Um einen Schnipsel zu entfernen, wählen Sie ihn in der Liste aus und klicken " +"dann auf Entfernen. Sie können die bereits " +"mitgelieferten Schnipsel nicht entfernen, sondern nur jene, die Sie selbst " +"erstellt haben." + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "Ersetzungen in Textschnipseln" + +#: C/gedit.xml:1790(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Zusätzlich zum Einfügen gespeicherten Texts kann ein Schnipsel auch " +"veränderbaren Text oder markierte Bereiche enthalten. Sobald der Schnipsel in " +"ein Dokument eingefügt wurde, können Sie hier weiteren Text hinzufügen." + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" +"Sie können die folgenden Platzhalter-Codes in den Textschnipseln verwenden:" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Tabulator-Platzhalter" + +#: C/gedit.xml:1798(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n definiert einen Tabulator-" +"Platzhalter, wobei n eine Zahl größer oder gleich 1 sein " +"muss." + +#: C/gedit.xml:1799(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} definiert einen Tabulator-Platzhalter mit einem Standardwert." + +#: C/gedit.xml:1800(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Ein Tabulator-Platzhalter markiert eine Stelle in einem Textschnipsel, an der " +"Sie nach dem Einfügen des Schnipsels zusätzlichen Text hinzufügen können." + +#: C/gedit.xml:1801(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Um Tabulator-Platzhalter zu verwenden, fügen Sie den Schnipsel wie gewohnt " +"ein. Der Cursor wird auf den ersten Tabulator-Platzhalter gesetzt. Geben sie " +"Text ein, und drücken Sie die Tabulatortaste, um zum " +"nächsten Tabulator-Platzhalter zu springen. Die Zahl im Platzhalter-Code " +"definiert den Tabulatorabstand zum nächsten auf diese Weise zu erreichenden " +"Zeichen im Text." + +#: C/gedit.xml:1802(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the snippet " +"text, or to the end placeholder if it exists." +msgstr "" +"Drücken Sie UmschalttasteTabulatortaste, um zum vorherigen Tabulator-Platzhalter zurückzukehren. " +"Wenn keine weiteren Tabulator-Platzhalter vorhanden sind,verschiebt ein Druck " +"auf die Tabulatortaste den Cursor an das Ende des " +"Textschnipsels oder an das Ende des Platzhalters, falls dieser existiert." + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Spiegel-Platzhalter" + +#: C/gedit.xml:1807(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times in " +"the snippet." +msgstr "" +"Ein sich wiederholender Tabulator-Platzhalter, der den bereits definierten " +"Platzhalter spiegelt. Auf diese Weise müssen Sie Text, der mehrmals im " +"Schnipsel erscheinen soll, nur einmalig eingeben." + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "Ende-Platzhalter" + +#: C/gedit.xml:1812(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of the " +"snippet text." +msgstr "" +"$0 definiert den Ende-Platzhalter. Dadurch wird der " +"Vorgang des Einfügens und Bearbeitens des Schnipsels beendet, auch wenn sich " +"der Cursor an einer anderen Stelle als dem Ende des Schnipsels befindet." + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "Umgebungsvariablen" + +#: C/gedit.xml:1817(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific to " +"gedit can also be used:" +msgstr "" +"Umgebungsvariablen wie $PATH und $HOME " +"werden in den Textschnipseln ersetzt. Die folgenden gedit-spezifischen Variablen können ebenfalls verwendet werden:" + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "Der gegenwärtig ausgewählte Text." + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Der komplette Name der Dokumentdatei (mit Dateinamenerweiterung), oder eine " +"leere Zeichenkette, falls das Dokument noch nicht gespeichert wurde." + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"Der Basisname der Dokumentdatei (ohne Dateinamenerweiterung), oder eine leere " +"Zeichenkette, falls das Dokument noch nicht gespeichert wurde." + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"Das Wort an der Position des Cursors im Dokument. Wird diese Variable " +"verwendet, wird das gegenwärtige Wort durch den Schnipsel ersetzt. " + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Shell-Platzhalter" + +#: C/gedit.xml:1846(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) wird durch das Ergebnis " +"der Ausführung von cmd in einer Shell ersetzt." + +#: C/gedit.xml:1847(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) ermöglicht die Definition dieses Platzhalters als Referenz, wobei " +"n eine beliebige Zahl größer oder gleich 1 ist. " +"Benutzen Sie $n, um die Ausgabe " +"eines Shell-Platzhalters als Eingabe für einen anderen Platzhalter zu " +"verwenden." + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Python-Platzhalter" + +#: C/gedit.xml:1852(para) +msgid "" +"$<cmd> is replaced by the " +"result of evaluating cmd in the python interpreter." +msgstr "" +"$<cmd> wird durch das " +"Ergebnis der Ausführung von cmd im Python-" +"Interpreter ersetzt." + +#: C/gedit.xml:1853(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" legt einen weiteren Python-Platzhalter als Abhängigkeit fest, " +"wobei a die Anordnung innerhalb des Schnipsels " +"festlegt. Dies erlaubt Ihnen, Python-Funktionen aus anderen Schnipseln zu " +"verwenden. Um weitere Abhängigkeiten festzulegen, trennen Sie die Zahlen " +"durch Kommas voneinander: $<a," +"b:cmd>" + +#: C/gedit.xml:1854(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Um eine Variablem in allen anderen Python-Schnipseln zu verwenden, " +"deklarieren Sie sie als global." + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "Plugin »Sortieren«" + +#: C/gedit.xml:1864(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Das Plugin Sortieren sortiert ausgewählte " +"Textzeilen in alphabetischer Reihenfolge." + +#: C/gedit.xml:1865(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Der Sortiervorgang kann nicht rückgängig gemacht werden; es empfiehlt sich " +"daher, die Datei vor dem Sortieren zu speichern. Um nach dem Sortiervorgang " +"ggf. die zuletzt gespeicherte Version der Datei wiederherzustellen, wählen " +"Sie DateiZurücksetzen." + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Die Arbeit mit dem Plugin »Sortieren« gestaltet sich wie folgt:" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "Geben Sie die Zeilen des Texts an, die Sie sortieren wollen." + +#: C/gedit.xml:1873(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Wählen Sie BearbeitenSortieren, um das Dialogfeld Sortieren " +"zu öffnen." + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "Wählen Sie aus folgenden Optionen für die Sortierung:" + +#: C/gedit.xml:1879(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Um den Text in umgekehrter Reihenfolge zu sortieren, aktivieren Sie die " +"Option Reihenfolge umkehren." + +#: C/gedit.xml:1882(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Um doppelt vorhandene Zeilen zu löschen, aktivieren Sie die Option " +"Duplikate entfernen." + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Wenn nicht nach Groß- und Kleinschreibung unterschieden werden soll, " +"aktivieren Sie die Option Groß-/Kleinschreibung nicht " +"berücksichtigen." + +#: C/gedit.xml:1888(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Damit die Sortierung die Zeichen am Beginn der Zeile unberücksichtigt lässt, " +"legen Sie das erste für die Sortierung zu verwendende Zeichen im Einstellfeld " +"Beginnen bei Spalte: fest." + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"Starten Sie den Sortiervorgang anschließend, indem Sie auf den Knopf " +"Sortieren klicken." + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "Plugin »Rechtschreibprüfung«" + +#: C/gedit.xml:1901(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Das Plugin Rechtschreibprüfung überprüft die " +"Rechtschreibung im ausgewählten Text. Sie können gedit so konfigurieren, dass die Rechtschreibung automatisch geprüft " +"wird, oder Sie nehmen die Rechtschreibprüfung in einer gewählten Sprache " +"manuell vor. Die Spracheinstellungen sowie die Einstellungen für die " +"automatische Rechschreibprüfung werden für jedes Dokument individuell " +"festgelegt. Um das Rechschreibprüfungs-Plugin zu verwenden, führen Sie die " +"folgenden Schritte aus:" + +#: C/gedit.xml:1903(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Wählen Sie WerkzeugeSprache " +"festlegen, um den Dialog Sprache " +"festlegen anzuzeigen. Wählen Sie die gewünschte Sprache in der " +"Liste aus. Klicken Sie auf OK, um den Dialog " +"Sprache festlegen zu schließen." + +#: C/gedit.xml:1906(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Um die Rechtschreibung automatisch zu prüfen, wählen Sie " +"WerkzeugeAutomatische " +"Rechtschreibprüfung. Um die automatische " +"Rechtschreibprüfung zurückzusetzen, wählen Sie " +"WerkzeugeAutomatische " +"Rechtschreibprüfung erneut. Wenn die automatische " +"Rechtschreibprüfung eiungeschaltet ist, wird ein Symbol neben dem Menüeintrag " +"Automatische Rechtschreibprüfung angezeigt. Die " +"automatische Rechtschreibprüfung ist bei jedem Start von gedit per Vorgabe ausgeschaltet." + +#: C/gedit.xml:1907(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Unbekannte Schreibweisen werden in einer anderen Farbe und unterstrichen " +"dargestellt. Klicken Sie mit der rechten Maustaste auf eine der unbekannten " +"Schreibweisen, und wählen Sie dann Rechtschreibvorschläge " +"aus dem Kontextmenü:" + +#: C/gedit.xml:1910(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select the " +"replacement spelling from the Spelling Suggestions popup " +"menu." +msgstr "" +"Um die unbekannte Schreibweise durch eine alternative Schreibweise in der " +"Liste zu ersetzen, wählen Sie Ersetzung im Aufklappmenü " +"Rechtschreibvorschläge aus." + +#: C/gedit.xml:1913(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Um die unbekannte Schreibweise zu Ihrem persönlichen Wörterbuch hinzuzufügen, " +"wählen Sie RechtschreibvorschlägeHinzufügen." + +#: C/gedit.xml:1916(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no longer " +"flagged as unknown but are not added to your personal dictionary, select " +"Spelling SuggestionsIgnore All. The unknown word is ignored in the current " +"gedit session only." +msgstr "" +"Um jedes Vorkommen der unbekannten Schreibweise zu ignorieren, so dass es " +"sowohl nicht mehr als unbekannt markiert wird, aber auch nicht zum " +"persönlichen Wörterbuch hinzugefügt wird, wählen Sie " +"RechtschreibvorschlägeAlle " +"ignorieren. Das unbekannte Wort wird nur in der " +"gegenwärtigen Sitzung von gedit ignoriert." + +#: C/gedit.xml:1921(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Um die Rechtschreibung manuell zu prüfen, wählen Sie " +"WerkzeugeRechtschreibprüfung." + +#: C/gedit.xml:1923(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Falls es keine Rechtschreibfehler gibt, zeigt ein " +"Informationsdialog eine Stausmeldung an, dass das " +"Dokument keine falsch geschriebenen Wörter enthält. Klicken Sie auf " +"OK, um den Informationsdialog zu " +"schließen." + +#: C/gedit.xml:1925(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Falls es Rechtschreibfehler gibt, wird der Dialog " +"Rechtschreibprüfung angezeigt:" + +#: C/gedit.xml:1928(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"Das falsch geschriebene Wort wird im Kopf des Dialogs " +"angezeigt." + +#: C/gedit.xml:1931(para) +msgid "" +"A suggested known spelling is displayed in the Change to " +"text box. You can replace this with another known spelling by selecting a " +"spelling from the Suggestions list, or you can enter " +"text directly into the Change to text box." +msgstr "" +"Eine Empfehlung einer bekannten Schreibweise wird im Textfeld " +"Ändern in angezeigt. Sie können dies durch eine andere " +"bekannte Schreibweise aus der Liste Vorschläge ersetzen, " +"oder Sie geben den Text direkt in das Textfeld Ändern in " +"ein." + +#: C/gedit.xml:1934(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear in " +"the Suggestions list." +msgstr "" +"Um die Rechtschreibung des Textes im Textfeld Ändern in " +"zu prüfen, klicken Sie auf Wort prüfen. Falls es sich " +"um ein bekanntes Wort handelt, wird die Liste der Vorschläge durch den Text (Rechtschreibung korrigieren) " +"ersetzt. Falls das Wort unbekannt ist, erscheinen neue Einträge in der Liste " +"der Vorschläge." + +#: C/gedit.xml:1937(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown word, " +"click Ignore All. The unknown word is ignored in the " +"current gedit session only." +msgstr "" +"Um das aktuelle Vorkommen der unbekannten Schreibweise zu ignorieren, klicken " +"Sie auf Ignorieren. Das unbekannte Wort wird nur in " +"der gegenwärtigen Sitzung von gedit ignoriert." + +#: C/gedit.xml:1940(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. " +"To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Um das aktuelle Vorkommen der unbekannten Schreibweise im Textfeld " +"Ändern in zu ändern, klicken Sie auf Ändern. Um alle Vorkommen der unbekannten Schreibweise im Textfeld " +"Ändern in zu ändern, klicken Sie auf Alle " +"ändern. " + +#: C/gedit.xml:1943(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Um das unbekannte Wort zu Ihrem persönlichen Wörterbuch hinzuzufügen, klicken " +"Sie auf Wort hinzufügen." + +#: C/gedit.xml:1946(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Klicken Sie auf Schließen, um das Dialogfeld " +"Rechtschreibprüfung zu schließen." + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "Plugin »Tagliste«" + +#: C/gedit.xml:1956(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Das Taglisten-Plugin ermöglicht Ihnen das Einfügen " +"häufig benutzter Tags aus einer Liste in der Seitenleiste." + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "" +"Um das Taglisten-Plugin zu verwenden, führen Sie die folgenden Schritte aus:" + +#: C/gedit.xml:1959(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Wählen Sie AnsichtSeitenleiste." + +#: C/gedit.xml:1963(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Standardmäßig zeigt die Seitenleiste einen Reiter an, der eine Liste " +"geöffneter Dokumente enthält. Klicken sie auf den Reiter mit dem »+« am " +"unteren Rand der Seitenleiste, um den Taglisten-Reiter anzuzeigen." + +#: C/gedit.xml:1965(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Wählen Sie die gewünschte Kategorie aus der Auswahlliste, so z. B. " +"HTML - Tags." + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Blättern Sie in der Tagliste nach dem gewünschten Tag." + +#: C/gedit.xml:1971(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Um einen Tag an der Cursorposition in die aktuelle Datei einzufügen, " +"doppelklicken Sie in der Tagliste darauf. Sie können den Tag auch wie folgt " +"einfügen:" + +#: C/gedit.xml:1973(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Um den Tag in die aktuelle Datei einzufügen und den Fokus vom Fenster " +"Taglisten-Plugin auf das Editorfenster umzuschalten, " +"drücken Sie die Eingabetaste." + +#: C/gedit.xml:1976(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Um den Tag in die aktuelle Datei einzufügen und den Fokus auf dem Fenster " +"Taglisten-Plugin zu behalten, drücken Sie " +"UmschaltEingabetaste." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Jan Arne Petersen , 2007\n" +"Mario Blättermann , 2008-2010" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Benutzername fügt den Namen des aktuellen Benutzers in ein Dokument ein." + +#~ msgid "User Name Plugin" +#~ msgstr "Plugin »Benutzername«" + +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "Das Plugin »Benutzername« fügt den Benutzernamen des aktuellen Benutzers " +#~ "in das Dokument ein." + +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "Um Ihren Benutzernamen an der Position des Cursors einzufügen, wählen Sie " +#~ "BearbeitenBenutzername " +#~ "einfügen." + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "translated" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "translated" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "translated" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "translated" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see ." +#~ msgstr "" +#~ "Weitere Informationen darüber, wie Sie die Hervorhebung anpassen können, " +#~ "finden Sie in ." + +#~ msgid "Colors" +#~ msgstr "Farben" + +#~ msgid "" +#~ "Select the Use default theme colors option to use the " +#~ "default theme colors in the gedit text window." +#~ msgstr "" +#~ "Wählen Sie diese Option aus, um die Farben des Standardthemas im " +#~ "Textfenster von gedit festzulegen." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display normal " +#~ "text in the gedit text window." +#~ msgstr "" +#~ "Klicken Sie auf den Knopf Textfarbe, um das " +#~ "Dialogfeld zum Auswählen der Farbe zu öffnen. Wählen Sie eine Farbe aus, " +#~ "in der der Text im Textfenster von gedit " +#~ "dargestellt werden soll." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Klicken Sie auf den Knopf Hintergrundfarbe, um das " +#~ "Dialogfeld zum Auswählen der Farbe zu öffnen. Wählen Sie eine " +#~ "Hintergrundfarbe für das Textfenster von gedit." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Klicken Sie auf den Knopf Farbe für markierten Text, um das Dialogfeld zum Auswählen der Farbe zu öffnen. Wählen " +#~ "Sie eine Farbe aus, in der markierter Text angezeigt werden soll." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Klicken Sie auf den Knopf Markierungsfarbe, um das " +#~ "Dialogfeld zum Auswählen der Farbe zu öffnen. Wählen Sie eine " +#~ "Hintergrundfarbe, in der eine Textauswahl markiert werden soll." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Einstellungen für die Syntaxhervorhebung" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "Syntax hervorheben" + +#~ msgid "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "" +#~ "Wählen Sie diese Option, um die Syntax des Textes hervorzuheben, den Sie " +#~ "bearbeiten." + +#~ msgid "Highlight mode" +#~ msgstr "Hervorhebungsmodus" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Wählen Sie mithilfe dieser Aufklappliste den Hervorhebungsmodus aus, " +#~ "dessen Einstellungen Sie ändern wollen." + +#~ msgid "Elements" +#~ msgstr "Elemente" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "" +#~ "Verwenden Sie dieses Listenfeld, um ein Syntax-Element auszuwählen, " +#~ "welches Sie konfigurieren wollen. " + +#~ msgid "Format buttons" +#~ msgstr "Formatierungs-Knöpfe" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Verwenden Sie die folgenden Knöpfe, um die Formatierung des gewählten " +#~ "Syntax-Elements zu ändern:" + +#~ msgid "Button" +#~ msgstr "Knopf" + +#~ msgid "Format" +#~ msgstr "Format" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Zeigt das Symbol für fette Formatierung." + +#~ msgid "Bold" +#~ msgstr "Fett" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Zeigt das Symbol für kursive Formatierung." + +#~ msgid "Italic" +#~ msgstr "Kursiv" + +#~ msgid "Shows icon for underline." +#~ msgstr "Zeigt das Symbol für Unterstreichungen." + +#~ msgid "Underline" +#~ msgstr "Unterstrichen" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Zeigt das Symbol für Durchstreichungen." + +#~ msgid "Strikethrough" +#~ msgstr "Durchgestrichen" + +#~ msgid "Foreground" +#~ msgstr "Vordergrund" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Wählen Sie diese Option, um die Schriftfarbe des ausgewählten Syntax-" +#~ "Elements zu ändern. Klicken Sie auf den Farbknopf, um den Farbwählerdialog " +#~ "anzuzeigen, dann wählen Sie die Schriftfarbe aus." + +#~ msgid "Background" +#~ msgstr "Hintergrund" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Wählen Sie diese Option, um die Hintergrundfarbe des ausgewählten Syntax-" +#~ "Elements zu ändern. Klicken Sie auf den Farbknopf, um den Farbwählerdialog " +#~ "anzuzeigen, dann wählen Sie die Hintergrundfarbe aus." + +#~ msgid "Reset to Default" +#~ msgstr "Auf Vorgabe zurücksetzen" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color of " +#~ "the selected syntax element to the default values." +#~ msgstr "" +#~ "Klicken Sie auf diesen Knopf, um die Vordergrund- und Hintergrundfarbe des " +#~ "ausgewählten Syntax-Elements auf die voreingestellten Werte zurückzusetzen." diff --git a/help/de/figures/gedit_window.png b/help/de/figures/gedit_window.png new file mode 100755 index 00000000..915ac7a1 Binary files /dev/null and b/help/de/figures/gedit_window.png differ diff --git a/help/el/el.po b/help/el/el.po new file mode 100755 index 00000000..947c160f --- /dev/null +++ b/help/el/el.po @@ -0,0 +1,2824 @@ +# Greek translation of Gedit Documentation +# Copyright (C) 2009, Free Software Foundation, Inc. +# Μάριος Ζηντίλης , 2009. +msgid "" +msgstr "" +"Project-Id-Version: el\n" +"POT-Creation-Date: 2010-06-20 20:10+0000\n" +"PO-Revision-Date: 2010-08-31 22:05+0200\n" +"Last-Translator: Michael Kotsarinis \n" +"Language-Team: Greek \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" +"X-Poedit-Language: Greek\n" +"X-Poedit-Country: GREECE\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 link or in the file COPYING-DOCS distributed with this manual." +msgstr "Επιτρέπεται η αντιγραφή, αναδιανομή και/ή η τροποποίηση αυτού του εγγράφου υπό τους όρους της Ελεύθερης Άδειας Τεκμηρίωσης GNU (GFDL), έκδοση 1.1 ή νεότερη που εκδόθηκε από το Ίδρυμα Ελεύθερου Λογισμικού χωρίς Αμετάβλητα Τμήματα, χωρίς Κείμενο Εξωφύλλου, και χωρίς Κείμενο Οπισθοφύλλου. Μπορείτε να βρείτε ένα αντίγραφο της GFDL σ' αυτό το σύνδεσμο ή στο αρχείο COPYING-DOCS που διανέμεται με αυτό το εγχειρίδιο." + +#: 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 "Αυτό το εγχειρίδιο είναι μέρος μιας συλλογής από εγχειρίδια του MATE που διανέμονται υπό την GFDL. Αν θέλετε να διανείμετε αυτό το εγχειρίδιο ξεχωριστά από τη συλλογή, μπορείτε να το κάνετε προσθέτοντας σ' αυτό ένα αντίγραφο της άδειας, όπως περιγράφεται στο τμήμα 6 της άδειας." + +#: 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 "Πολλά από τα ονόματα που χρησιμοποιούνται από εταιρείες για να διακρίνουν τα προϊόντα και τις υπηρεσίες τους είναι κατατεθέντα σήματα. Όπου εμφανίζονται τέτοια ονόματα σε οποιαδήποτε τεκμηρίωση του MATE. και τα μέλη του Έργου Τεκμηρίωσης του MATE το γνωρίζουν, τότε αυτά τα ονόματα γράφονται με κεφαλαία γράμματα ή ξεκινούν με κεφαλαίο γράμμα." + +#: 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 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/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: " +msgstr "TΟ ΕΓΓΡΑΦΟ ΚΑΙ ΟΙ ΤΡΟΠΟΙΗΜΕΝΕΣ ΕΚΔΟΣΕΙΣ ΤΟΥ ΠΑΡΕΧΟΝΤΑΙ ΥΠΟ ΤΟΥΣ ΟΡΟΥΣ ΤΗΣ ΕΛΕΥΘΕΡΗΣ ΑΔΕΙΑΣ ΤΕΚΜΗΡΙΩΣΗΣ GNU ΜΕ ΤΙΣ ΕΠΙΠΛΕΟΝ ΓΝΩΣΤΟΠΟΙΗΣΕΙΣ: " + +#. 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/gedit.xml:268(None) +msgid "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "@@image: 'figures/gedit_recent_files_menu_icon.png'; md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "@@image: 'figures/gedit_recent_files_menu_icon.png'; md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Εγχειρίδιο του Gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) +#: C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) +#: C/gedit.xml:79(orgname) +#: C/gedit.xml:120(para) +#: C/gedit.xml:128(para) +#: C/gedit.xml:136(para) +#: C/gedit.xml:144(para) +#: C/gedit.xml:152(para) +#: C/gedit.xml:160(para) +#: C/gedit.xml:168(para) +#: C/gedit.xml:176(para) +#: C/gedit.xml:184(para) +#: C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Έργο τεκμηρίωσης του MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) +#: C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) +#: C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Προσθήκη του πίνακα συντομεύσεων πληκτρολογίου" + +#: C/gedit.xml:68(firstname) +#: C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Ομάδα τεκμηρίωσης του συστήματος επιφάνειας εργασίας της Sun Java" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "Cicek provided information from earlier revisions of the gedit application." +msgstr "O Cicek έδωσε τις πληροφορίες για τις προηγούμενες αναθεωρήσεις της εφαρμογής Gedit." + +#: C/gedit.xml:86(contrib) +#: C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Γνωστοποιήσεις" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "Ο George έδωσε τις πληροφορίες για τις πρόσθετες λειτουργίες." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "Έκδοση 1.0 του Gedit" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Μάρτιος 2002" + +#: C/gedit.xml:127(para) +#: C/gedit.xml:135(para) +#: C/gedit.xml:143(para) +#: C/gedit.xml:151(para) +#: C/gedit.xml:159(para) +#: C/gedit.xml:167(para) +#: C/gedit.xml:175(para) +#: C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Ομάδα της Sun για την τεκμηρίωση του MATE" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Ιούνιος 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Αύγουστος 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Σεπτέμβριος 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Ιανουάριος 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Μάρτιος 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Σεπτέμβριος 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Μάρτιος 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.8" + +#: C/gedit.xml:189(date) +#: C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Ιούλιος 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Εγχειρίδιο του Gedit, Έκδοση 2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "Ομάδα τεκμηρίωσης του MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Αυτό το εγχειρίδιο περιγράφει την έκδοση 2.16 του Gedit." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Ανάδραση" + +#: C/gedit.xml:208(para) +msgid "To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "Για να αναφέρετε ένα σφάλμα ή να κάνετε μια εισήγηση σχετικά με την εφαρμογή gedit ή με αυτό το έγγραφο, ακολουθήστε τις οδηγίες στη Σελίδα ανάδρασης του MATE." + +#: C/gedit.xml:213(para) +msgid "gedit is a text editor for the MATE Desktop featuring basic yet robust capabilities such as printing, spell checking, find and replace, and syntax highlighting. More advanced features are available as plugins." +msgstr "Το gedit είναι ένα επεξεργαστής κειμένου για την επιφάνεια εργασίας του MATE που το χαρακτηρίζουν βασικές αλλά ισχυρές δυνατότητες όπως εκτύπωση, ορθογραφικός έλεγχος, εύρεση και αντικατάσταση, και επισήμανση σύνταξης. Πιο προχωρημένα χαρακτηριστικά είναι διαθέσιμα ως πρόσθετες λειτουργίες." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "επεξεργαστής κειμένου" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Εισαγωγή" + +#: C/gedit.xml:229(para) +msgid "The gedit application enables you to create and edit text files." +msgstr "Η εφαρμογή gedit σας επιτρέπει να δημιουργείτε και να επεξεργάζεστε αρχεία κειμένου." + +#: C/gedit.xml:231(para) +msgid "The aim of gedit is to be a simple and easy to use text editor. More powerful features can be enabled with different plugins, allowing a variety of tasks related to text-editing." +msgstr "Το gedit στοχεύει να είναι ένας απλός επεξεργαστής κειμένου. Πιο ισχυρές δυνατότητες μπορούν να ενεργοποιηθούν με διάφορες πρόσθετες λειτουργίες, που επιτρέπουν μια ποικιλία από εργασίες σχετικές με την επεξεργασία κειμένου." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Ξεκινώντας" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Εκκινώντας το Gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "Μπορείτε να εκκινήσετε το gedit με τους εξής τρόπους:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Μενού Εφαρμογές" + +#: C/gedit.xml:245(para) +msgid "Choose AccessoriesText Editor." +msgstr "Επιλέξτε το ΒοηθήματαΕπεξεργαστής κειμένου." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Γραμμή εντολών" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Εκτελέστε την ακόλουθη εντολή: gedit" + +#: C/gedit.xml:255(para) +msgid "By default, when you open a text document in the file manager, gedit will start, and display the document." +msgstr "Εξ ορισμού, όταν ανοίγετε ένα αρχείο κειμένου από τον περιηγητή αρχείων, θα ξεκινήσει το gedit και θα εμφανίσει το κείμενο." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "Το παράθυρο του gedit" + +#: C/gedit.xml:261(para) +msgid "When you start gedit, the following window is displayed:" +msgstr "Όταν ξεκινάτε το gedit εμφανίζεται το ακόλουθο παράθυρο:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Το παράθυρο του gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Δείχνει το κεντρικό παράθυρο του gedit." + +#: C/gedit.xml:276(para) +msgid "The gedit window contains the following elements:" +msgstr "Το παράθυρο του gedit περιέχει τα εξής στοιχεία:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Γραμμή μενού" + +#: C/gedit.xml:281(para) +msgid "The menus on the menubar contain all of the commands you need to work with files in gedit." +msgstr "Τα μενού στη γραμμή μενού περιέχουν όλες τις εντολές που θα χρειαστείτε για να δουλέψετε με αρχείο στο gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Γραμμή εργαλείων" + +#: C/gedit.xml:286(para) +msgid "The toolbar contains a subset of the commands that you can access from the menubar." +msgstr "Η γραμμή εργαλείων περιέχει μερικές από τις εντολές στις οποίες έχετε πρόσβαση από τη μπάρα μενού." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Περιοχή προβολής" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "Η περιοχή προβολής περιλαμβάνει το κείμενο που επεξεργάζεστε." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Γραμμή κατάστασης" + +#: C/gedit.xml:296(para) +msgid "The statusbar displays information about current gedit activity and contextual information about the menu items. The statusbar also displays the following information:" +msgstr "Η γραμμή κατάστασης εμφανίζει πληροφορίες για την τρέχουσα δραστηριότητα του gedit και πληροφορίες του περιεχομένου των αντικειμένων του μενού. Η γραμμή κατάστασης εμφανίζει επίσης τις εξής πληροφορίες:" + +#: C/gedit.xml:299(para) +msgid "Cursor position: the line number and column number where the cursor is located." +msgstr "Θέση δρομέα: ο αριθμός της γραμμής και της στήλης στη θέση του δρομέα." + +#: C/gedit.xml:302(para) +msgid "Edit mode: If the editor is in insert mode, the statusbar contains the text INS. If the editor is in overwrite mode, the statusbar contains the text OVR. Press the Insert key to change edit mode." +msgstr "Μορφή επεξεργασίας: αν ο επεξεργαστής είναι σε λειτουργία εισαγωγής τότε η μπάρα κατάστασης περιέχει το κείμενο ΕΙΣ. Αν ο επεξεργαστής είναι σε λειτουργία αντικατάστασης, τότε η μπάρα κατάστασης περιέχει το κείμενο ΑΝΤ. Πατήστε το πλήκτρο Insert για να αλλάξετε τη λειτουργία." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Πλευρική εργαλειοθήκη" + +#: C/gedit.xml:309(para) +msgid "The side pane displays a list of open documents, and other information depending on which plugins are enabled." +msgstr "Η πλευρική εργαλειοθήκη εμφανίζει μια λίστα από ανοικτά έγγραφα, και άλλες πληροφορίες ανάλογα με τις ενεργοποιημένες πρόσθετες λειτουργίες." + +#: C/gedit.xml:310(para) +msgid "By default the side pane is not shown. To show it, choose ViewSide Pane." +msgstr "Εξ ορισμού η πλευρική εργαλειοθήκη δεν εμφανίζεται. Για να την εμφανίσετε, επιλέξτε ΠροβολήΠλευρική εργαλειοθήκη." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Κάτω εργαλειοθήκη" + +#: C/gedit.xml:315(para) +msgid "The bottom pane is used by programming tools such as the Python Console plugin to display output." +msgstr "Η κάτω εργαλειοθήκη χρησιμοποιείται από προγραμματιστικά εργαλεία όπως η πρόσθετη λειτουργία Κονσόλα Python για να εμφανίζουν την έξοδο του προγράμματος." + +#: C/gedit.xml:316(para) +msgid "By default the bottom pane is not shown. To show it, choose ViewBottom Pane." +msgstr "Εξ ορισμού η κάτω εργαλειοθήκη δεν εμφανίζεται. Για να την εμφανίσετε, επιλέξτε ΠροβολήΚάτω εργαλειοθήκη." + +#: C/gedit.xml:320(para) +msgid "When you right-click in the gedit window, the application displays a popup menu. The popup menu contains the most common text editing commands." +msgstr "Όταν κάνετε δεξί κλικ μέσα στο παράθυρο του gedit, η εφαρμογή εμφανίζει ένα αναδυόμενο μενού. Το αναδυόμενο μενού περιέχει τις πιο συνηθισμένες εντολές επεξεργασίας κειμένου." + +#: C/gedit.xml:322(para) +msgid "Like other MATE applications, actions in gedit can be performed in several ways: with the menu, with the toolbar, or with shortcut keys. Shortcuts keys common to all applications are listed in the User Guide." +msgstr "Όπως και στις άλλες εφαρμογές του MATE, οι ενέργειες στο gedit μπορούν να γίνουν με διάφορους τρόπους: με το μενού, με την εργαλειοθήκη ή με συντομεύσεις πληκτρολογίου. Οι συντομεύσεις που είναι κοινές σε όλες τις εφαρμογές βρίσκονται στον Οδηγό χρήσης." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Εκτέλεση του gedit από τη Γραμμή εντολών" + +#: C/gedit.xml:328(para) +msgid "You can run gedit from a command line and open a single file or multiple files. To open multiple files from a command line, type the following command, then press Return:" +msgstr "Μπορείτε να εκτελέσετε το gedit από μια γραμμή εντολών και να ανοίξετε ένα ή περισσότερα αρχεία. Για να ανοίξετε πολλά αρχεία από γραμμή εντολών, πληκτρολογήστε την ακόλουθη εντολή και πατήστε Return:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Εναλλακτικά, μπορείτε να καθορίσετε μια τοποθεσία (URI) αντί για ένα όνομα αρχείου." + +#: C/gedit.xml:331(para) +msgid "For more information on how to run gedit from a command line, see the unix manual page for gedit, gedit1." +msgstr "Για περισσότερες πληροφορίες για την εκτέλεση του gedit από μια γραμμή εντολών, δείτε τη σελίδα εγχειριδίου του Unix για το gedit, gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Δουλεύοντας με αρχεία" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Δημιουργία ενός νέου εγγράφου" + +#: C/gedit.xml:341(para) +msgid "To create a new document, choose FileNew. The application displays a new blank document in the gedit window." +msgstr "Για να δημιουργήσετε ένα νέο έγγραφο, επιλέξτε ΑρχείοΝέο. Η εφαρμογή εμφανίζει ένα νέο άδειο έγγραφο στο παράθυρο του gedit." + +#: C/gedit.xml:346(title) +#: C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "Άνοιγμα ενός αρχείου" + +#: C/gedit.xml:347(para) +msgid "To open a file, choose FileOpen to display the Open File dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit window." +msgstr "Για να ανοίξετε ένα αρχείο, επιλέξτε ΑρχείοΆνοιγμα για να εμφανίσετε το διάλογο Άνοιγμα αρχείων. Επιλέξτε το αρχείο που θέλετε να ανοίξετε και πατήστε Άνοιγμα. Το αρχείο εμφανίζεται στο παράθυρο του gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Εμφάνιση του εικονιδίου Πρόσφατα αρχεία στο μενού." + +#: C/gedit.xml:349(para) +msgid "The application records the paths and filenames of the five most recent files that you edited and displays the files as menu items on the File menu. You can also click on the icon on the toolbar to display the list of recent files." +msgstr "Η εφαρμογή καταγράφει τις διαδρομές και τα ονόματα των πέντε αρχείων που επεξεργαστήκατε πιο πρόσφατα και τα εμφανίζει ως αντικείμενα στο μενού Αρχείο. Μπορείτε επίσης να πατήσετε στο εικονίδιο για να εμφανίσετε τη λίστα με τα πιο πρόσφατα αρχεία." + +#: C/gedit.xml:351(para) +msgid "You can open multiple files in gedit. The application adds a tab for each open file to the window. For more on this see ." +msgstr "Μπορείτε να ανοίξετε πολλαπλά αρχεία στο gedit. Η εφαρμογή προσθέτει μια καρτέλα στο παράθυρο για κάθε ανοικτό αρχείο. Για περισσότερες πληροφορίες δείτε ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Αποθήκευση αρχείου" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Μπορείτε να αποθηκεύετε αρχεία με τους εξής τρόπους:" + +#: C/gedit.xml:360(para) +msgid "To save changes to an existing file, choose FileSave." +msgstr "Για να αποθηκεύσετε αλλαγές σε υφιστάμενο αρχείο, επιλέξτε ΑρχείοΑποθήκευση." + +#: C/gedit.xml:362(para) +msgid "To save a new file or to save an existing file under a new filename, choose FileSave As. Enter a name for the file in the Save As dialog, then click Save." +msgstr "Για να αποθηκεύσετε ένα νέο αρχείο ή να αποθηκεύσετε ένα υπάρχον αρχείο με νέο όνομα, επιλέξτε ΑρχείοΑποθήκευση ως.... Βάλτε ένα όνομα για το αρχείο στο διάλογο Αποθήκευση ως... και πατήστε Αποθήκευση." + +#: C/gedit.xml:364(para) +msgid "To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "Για να αποθηκεύσετε όλα τα αρχεία που είναι ανοικτά στο gedit, επιλέξτε ΈγγραφαΑποθήκευση όλων." + +#: C/gedit.xml:367(para) +msgid "To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "Για να κλείσετε όλα τα αρχεία που είναι ανοικτά στο gedit, επιλέξτε ΈγγραφαΚλείσιμο όλων." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Άνοιγμα ενός αρχείου από μια τοποθεσία (URI)" + +#: C/gedit.xml:373(para) +msgid "To open a file from a Uniform Resource Identifier (URI), perform the following steps:" +msgstr "Για να ανοίξετε ένα αρχείο από μια τοποθεσία URI, κάντε τα εξής βήματα:" + +#: C/gedit.xml:376(para) +msgid "Choose FileOpen Location to display the Open Location dialog." +msgstr "Επιλέξτε ΑρχείοΆνοιγμα τοποθεσίας για να εμφανίσετε το διάλογο Άνοιγμα τοποθεσίας." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Εισάγετε την τοποθεσία του αρχείου που θέλετε να ανοίξετε." + +#: C/gedit.xml:382(para) +msgid "Use the Character coding drop-down list to select the appropriate character coding." +msgstr "Χρησιμοποιήστε την αναδιπλούμενη λίστα Kωδικοποίηση χαρακτήρων για να διαλέξετε την κατάλληλη κωδικοποίηση." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Πατήστε το Άνοιγμα." + +#: C/gedit.xml:388(para) +msgid "Valid types of URI include http:, ftp:, file:, and all of the methods supported by mate-vfs." +msgstr "Τα http:, ftp:, file:, και όλες οι μέθοδοι που υποστηρίζονται από το mate-vfs είναι έγκυροι τύποι τοποθεσιών URI." + +#: C/gedit.xml:389(para) +msgid "Files from some types of URI are opened as read-only, and any changes you make must be saved to a different location. HTTP only allows files to be read. Files opened from FTP are read-only because because not all FTP servers may correctly work with saving remote files." +msgstr "Αρχεία από μερικούς τύπους URI ανοίγονται μόνο για ανάγνωση, και ό,τι αλλαγές κάνετε θα πρέπει να αποθηκευτούν σε μια διαφορετική τοποθεσία. Το HTTP επιτρέπει μόνο την ανάγνωση αρχείων. Αρχεία που ανοίγονται από FTP είναι μόνο για ανάγνωση γιατί δεν υποστηρίζουν όλοι οι εξυπηρετητές FTP την αποθήκευση απομακρυσμένων αρχείων." + +#: C/gedit.xml:390(para) +msgid "Saving to FTP servers can be enabled with Configuration Editor, setting the key /apps/gedit-2/preferences/editor/save/writable_vfs_schemes, but this may cause errors." +msgstr "Η αποθήκευση σε εξυπηρετητές FTP μπορεί να ενεργοποιηθεί από τον Configuration Editor, με την επιλογή του κλειδιού /apps/gedit-2/preferences/editor/save/writable_vfs_schemes, αλλά αυτό μπορεί να προκαλέσει σφάλματα." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Δουλεύοντας με τις καρτέλες" + +#: C/gedit.xml:397(para) +msgid "When more than one file is open, gedit shows a tab for each document above the display area. To switch to another document, click on its tab." +msgstr "Όταν είναι ανοικτά περισσότερα από ένα αρχεία, τότε το gedit εμφανίζει μια καρτέλα για κάθε έγγραφο στο πάνω μέρος της περιοχής προβολής. Για να περάσετε σε ένα άλλο έγγραφο, πατήστε στην καρτέλα του." + +#: C/gedit.xml:398(para) +msgid "To move a document to another gedit window, drag the tab corresponding to the file to the window you want to move it to." +msgstr "Για να μετακινήσετε ένα έγγραφο σε ένα άλλο παράθυρο του gedit, σύρετε την αντίστοιχη καρτέλα στο παράθυρο στο οποίο θέλετε να τη μετακινήσετε." + +#: C/gedit.xml:399(para) +msgid "To move a document to a new gedit window, either drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "Για να μετακινήσετε ένα έγγραφο σε ένα καινούριο παράθυρο του gedit, είτε σύρετε την καρτέλα του στην επιφάνεια εργασίας, είτε επιλέξτε ΈγγραφαΜετακίνηση σε νέο παράθυρο." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Δουλεύοντας με κείμενο" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Επεξεργασία κειμένου" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Μπορείτε να επεξεργαστείτε το κείμενο σε ένα αρχείο με τους ακόλουθους τρόπους:" + +#: C/gedit.xml:412(para) +msgid "Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the arrow keys on the keyboard or click with the mouse." +msgstr "Πληκτρολογήστε νέο κείμενο από το πληκτρολόγιο. Ο δρομέας εισαγωγής, που αναβοσβήνει, υποδεικνύει το σημείο στο οποίο θα εμφανίζεται το νέο κείμενο. Για να το αλλάξετε αυτό, χρησιμοποιήστε τα βελάκια ή πατήστε με το ποντίκι." + +#: C/gedit.xml:414(para) +msgid "To copy the selected text to the clipboard, choose EditCopy." +msgstr "Για να αντιγράψετε το επιλεγμένο κείμενο στο πρόχειρο, επιλέξτε ΕπεξεργασίαΑντιγραφή." + +#: C/gedit.xml:416(para) +msgid "To delete the selected text from the file and move the selected text to the clipboard, choose EditCut." +msgstr "Για να σβήσετε το επιλεγμένο κείμενο από το αρχείο και να το μετακινήσετε στο πρόχειρο, επιλέξτε ΕπεξεργασίαΑποκοπή." + +#: C/gedit.xml:418(para) +msgid "To permanently delete the selected text from the file, choose EditDelete." +msgstr "Για να σβήσετε μόνιμα το επιλεγμένο κείμενο από το αρχείο, επιλέξτε ΕπεξεργασίαΔιαγραφή." + +#: C/gedit.xml:420(para) +msgid "To insert the contents of the clipboard at the cursor position, choose EditPaste. You must cut or copy text before you can paste text into the file, either from gedit or another application." +msgstr "Για να εισάγετε τα περιεχόμενα του πρόχειρου στη θέση του δρομέα, επιλέξτε ΕπεξεργασίαΕπικόλληση. Θα πρέπει να έχετε προηγουμένως αντιγράψει ή αποκόψει κείμενο προτού το επικολλήσετε στο αρχείο, είτε από το gedit είτε από άλλη εφαρμογή." + +#: C/gedit.xml:422(para) +msgid "To select all of the text in a file, choose EditSelect All." +msgstr "Για να επιλέξετε ολόκληρο το κείμενο ενός αρχείου, επιλέξτε ΕπεξεργασίαΕπιλογή όλων." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Αναίρεση αλλαγών και ακύρωση αναίρεσης" + +#: C/gedit.xml:429(para) +msgid "To undo a change you have made, choose EditUndo. To reverse this action, choose EditRedo." +msgstr "Για να αναιρέσετε μια αλλαγή που κάνατε, επιλέξτε ΕπεξεργασίαΑναίρεση. Για να αντιστρέψετε αυτή την ενέργεια, επιλέξτε ΕπεξεργασίαΑκύρωση αναίρεσης." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Εύρεση και αντικατάσταση" + +#: C/gedit.xml:436(para) +msgid "In gedit, there are two ways of searching for text. You can use the Find dialog to search for a specific piece of text, or Incremental Search to highlight matching text as you type it." +msgstr "Στο gedit υπάρχουν δύο τρόποι αναζήτησης κειμένου. Μπορείτε να χρησιμοποιήσετε το διάλογο Εύρεση για να ψάξετε για ένα συγκεκριμένο κομμάτι κειμένου, ή την Αυξητική αναζήτηση για να φωτίσετε το κείμενο που ταιριάζει καθώς πληκτρολογείτε." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Εύρεση κειμένου" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Για να αναζητήσετε μια σειρά κειμένου, ακολουθήστε τα εξής βήματα:" + +#: C/gedit.xml:444(para) +msgid "Choose SearchFind to display the Find dialog." +msgstr "Επιλέξτε ΑναζήτησηΕύρεση για να εμφανίσετε το διάλογο Εύρεση." + +#: C/gedit.xml:446(para) +msgid "Type the string that you want to find in the Search for field. You can include special characters such as a new line or tab: see ." +msgstr "Πληκρολογήστε την αλληλουχία που θέλετε να αναζητήσετε στο πεδίο Αναζήτηση για. Μπορείτε να συμπεριλάβετε ειδικούς χαρακτήρες όπως νέα γραμμή και στηλοθέτης: δείτε το ." + +#: C/gedit.xml:448(para) +msgid "Click Find to search the file for the first occurrence of the string after your current cursor position. If gedit finds the string, the application selects first occurrence of the string. Other occurrences of the string are highlighted." +msgstr "Κάντε κλικ στο Εύρεση για να κάνετε αναζήτηση στο αρχείο για την πρώτη εμφάνιση της αλληλουχίας μετά την τρέχουσα θέση του δρομέα. Αν το gedit βρει την αλληλουχία, θα επιλέξει την πρώτη εμφάνισή της. Άλλες περιπτώσεις της αλληλουχίας στο κείμενο θα επισημανθούν." + +#: C/gedit.xml:450(para) +msgid "To find the next occurrence of the string, click Find or choose SearchFind Next. To find the previous occurrence of the text, choose SearchFind Previous." +msgstr "Για να βρείτε την επόμενη εμφάνιση της αλληλουχίας, κάντε κλικ στο Εύρεση ή επιλέξτε ΑναζήτησηΕύρεση επομένου." + +#: C/gedit.xml:453(para) +msgid "After you have closed the Find dialog, you can still move the selection to other occurrences of the text by choosing SearchFind Next and SearchFind Previous." +msgstr "Αφού κλείσετε το παράθυρο διαλόγου Εύρεση, μπορείτε ακόμα να μετακινήσετε την επιλογή σε άλλες εμφανίσεις του κειμένου, επιλέγοντας ΑναζήτησηΕύρεση επομένου και ΑναζήτησηΕύρεση προηγουμένου." + +#: C/gedit.xml:454(para) +msgid "To remove the highlighting from the text, choose SearchClear Highlight." +msgstr "Για να αφαιρέσετε την επισήμανση από το κείμενο, επιλέξτε ΑναζήτησηΕκκαθάριση επισήμανσης." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Αυξητική αναζήτηση" + +#: C/gedit.xml:460(para) +msgid "Incremental search highlights matching text in the document as you type it letter by letter. (This is similar to the search feature in several web browsers.)" +msgstr "Η αυξητική αναζήτηση επισημαίνει το κείμενο που ταιριάζει με αυτό της αναζήτησης καθώς το πληκτρολογείτε γράμμα γράμμα. (Παρόμοιο με το χαρακτηριστικό αναζήτησης σε πολλούς περιηγητές ιστοσελίδων)." + +#: C/gedit.xml:461(para) +msgid "To start an incremental search, choose SearchIncremental Search. The search box appears at the top of the display area." +msgstr "Για να αρχίσετε μια αυξητική αναζήτηση, επιλέξτε ΑναζήτησηΑυξητική αναζήτηση. Το πεδίο αναζήτησης εμφανίζεται στην κορυφή της περιοχής απεικόνισης." + +#: C/gedit.xml:462(para) +msgid "Begin typing, and text that matches will be highlighted in the document. The first instance after the cursor position is also selected." +msgstr "Ξεκινήστε την πληκτρολόγηση και το κείμενο που ταιριάζει θα επισημανθεί στο έγγραφο. Επίσης, η πρώτη περίπτωση εμφάνισης μετά τη θέση του δρομέα θα επιλεγεί." + +#: C/gedit.xml:463(para) +msgid "To advance the selection to the next match while keeping the incremental search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "Για να προχωρήσετε την επιλογή στην επόμενη σύμπτωση ενώ κρατάτε το πεδίο της αυξητικής αναζήτησης ανοιχτό, πατήστε CtrlG. Πατήστε CtrlShiftG για να πάτε στην προηγούμενη σύμπτωση." + +#: C/gedit.xml:464(para) +msgid "You can also use the up and down arrow keys or the mouse wheel to move the selection between matches." +msgstr "Μπορείτε επίσης να χρησιμοποιήσετε τα άνω και κάτω βελάκια ή τη ροδέλα του ποντικιού για να μετακινήσετε την επιλογή μεταξύ των συμπτώσεων." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Αντικατάσταση κειμένου" + +#: C/gedit.xml:471(para) +msgid "To search a file for a string, and replace the string with an alternative string, perform the following steps:" +msgstr "Για να κάνετε αναζήτηση για μια αλληλουχία χαρακτήρων σε ένα αρχείο και να την αντικαταστήσετε με μια εναλλακτική, κάντε τα ακόλουθα:" + +#: C/gedit.xml:473(para) +msgid "Choose SearchReplace to display the Replace dialog." +msgstr "Επιλέξτε ΑναζήτησηΑντικατάσταση για να εμφανίσετε το παράθυρο διαλόγου Αντικατάσταση." + +#: C/gedit.xml:475(para) +msgid "Type the string that you want to find, in the Search for field. You can include special characters such as a new line or tab: see ." +msgstr "Πληκτρολογήστε την αλληλουχία που θέλετε να βρείτε, στο πεδίο Αναζήτηση για. Μπορείτε να περιλάβατε ειδικούς χαρακτήρες όπως νέα γραμμή ή στηλοθέτη: δείτε το ." + +#: C/gedit.xml:476(para) +msgid "Type the string that you want to use to replace the string that you find, in the Replace with field." +msgstr "Πληκτρολογήστε την αλληλουχία που θέλετε να χρησιμοποιήσετε για να αντικαταστήσετε την αναζητούμενη αλληλουχία στο πεδίο Αντικατάσταση με." + +#: C/gedit.xml:480(para) +msgid "To examine each occurrence of the string before replacing it, click Find. If gedit finds the string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the next occurrence of the string, click Find again." +msgstr "Για να εξετάσετε κάθε εμφάνιση της αλληλουχίας χαρακτήρων πριν την αντικαταστήσετε, πατήστε το Εύρεση. Αν το gedit βρει την αλληλουχία, την επιλέγει. Κάντε κλικ στο Αντικατάσταση για να αντικαταστήσετε την επιλεγμένη εμφάνιση της αλληλουχίας. Για να βρείτε την επόμενη εμφάνιση της αλληλουχίας κάντε ξανά κλικ στο Εύρεση." + +#: C/gedit.xml:481(para) +msgid "To replace all occurrences of the string throughout the document, click Replace All." +msgstr "Για να αντικαταστήσετε όλες τις περιπτώσεις εμφάνισης της αλληλουχίας σε όλο το έγγραφο, κάντε κλικ στο Αντικατάσταση όλων." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Επιλογές εύρεσης και αντικατάστασης" + +#: C/gedit.xml:487(para) +msgid "The Find dialog and the Replace dialog both have the following options:" +msgstr "Τα παράθυρα διαλόγου Εύρεση και Αντικατάσταση έχουν και τα δύο τις ακόλουθες επιλογές:" + +#: C/gedit.xml:489(para) +msgid "Select the Match case option to only find occurrences of the string that match the case of the text that you type. For example, with Match case selected, \"TEXT\" will not match \"text\"." +msgstr "Επιλέξτε το Διάκριση πεζών από κεφαλαία για να βρείτε εμφανίσεις της αλληλουχίας που ταιριάζουν και ως προς αυτό με το κείμενο που πληκτρολογείτε. Π.χ. έχοντας επιλέξει το Διάκριση πεζών από κεφαλαία το \"ΚΕΙΜΕΝΟ\" δεν θα βρεί το \"κείμενο\"." + +#: C/gedit.xml:491(para) +msgid "Select the Match entire word only option to only find occurrences of the string that match the entire words of the text that you type. For example, with Match entire word only selected, \"text\" will not match \"texture\"." +msgstr "Επιλέξτε το Ταίριασμα ολόκληρης λέξης μόνο για να βρείτε εμφανίσεις της αλληλουχίας όπου ταιριάζει με ολόκληρες τις λέξεις του κειμένου που πληκτρολογείτε. Π.χ. έχοντας επιλέξει το Ταίριασμα ολόκληρης λέξης μόνο, το \"κείμενο\" δεν θα βρει το \"υπερκείμενο\"." + +#: C/gedit.xml:493(para) +msgid "Select the Search backwards option to search backwards towards the beginning of the document." +msgstr "Επιλέξτε το Αναζήτηση προς τα πίσω για να γίνει η αναζήτηση προς τα πίσω, δηλ. προς την αρχή του εγγράφου." + +#: C/gedit.xml:495(para) +msgid "Select the Wrap around option to search to one end of the document and then continue the search from the other end of the file." +msgstr "Επιλέξτε το Αναδίπλωση γύρω για να αναζητήσετε μέχρι το τέλος του εγγράφου και μετά να συνεχίσετε την αναζήτηση από την άλλη άκρη του εγγράφου." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Ειδικοί χαρακτήρες" + +#: C/gedit.xml:503(para) +msgid "You can include the following escape sequences in the text to find or replace to represent special characters:" +msgstr "Μπορείτε να συμπεριλάβετε τις ακόλουθες αλληλουχίες διαφυγής στο κείμενο προς εύρεση ή αντικατάσταση για να αναπαραστήσετε ειδικούς χαρακτήρες:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Καθορίζει μια καινούρια γραμμή." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Καθορίζει στηλοθέτη." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Καθορίζει επιστροφή γραμμής." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. For example, if you are looking for the \"\\n" +"\" literal, you will have to type \"\\\\n" +"\" in the Search for field. Or if you are looking for a sequence of backslashes, you will have to double the number of searched backslashes." +msgstr "" +"Η ανάστροφη κάθετος πρέπει να αντικατασταθεί αν την αναζητείτε. Π.χ. αν ψάχνετε για το \"\\n" +"\" ως έχει, θα πρέπει να πληκτρολογήσετε \"\\\\n" +"\" στο πεδίο Αναζήτηση για. Ή αν ψάχνετε για μια αλληλουχία ανάστροφων καθέτων, θα πρέπει να διπλασιάσετε τον αριθμό τους στο πεδίο." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Τοποθέτηση του δρομέα σε συγκεκριμένη γραμμή" + +#: C/gedit.xml:540(para) +msgid "To position the cursor on a specific line in the current file, choose SearchGo to Line. The line number box appears at the top of the display area." +msgstr "Για να τοποθετήσετε το δρομέα σε μια συγκεκριμένη γραμμή στο τρέχον αρχείο, επιλέξτε ΑναζήτησηΜετάβαση στη γραμμή. Το πεδίο αριθμού γραμμής εμφανίζεται στην κορυφή της περιοχής απεικόνισης." + +#: C/gedit.xml:541(para) +msgid "Begin typing the number of the line that you want to move the cursor to and the document will scroll to the specified line." +msgstr "Ξεκινήστε να πληκτρολογείτε τον αριθμό της γραμμής στην οποία θέλετε να μετακινήσετε το δρομέα και το έγγραφο θα κυλήσει στην καθορισμένη γραμμή." + +#: C/gedit.xml:542(para) +msgid "To dismiss the box and move the cursor to the specified line, press Return." +msgstr "Για να απομακρύνετε το πεδίο και να μετακινήσετε το δρομέα στην καθορισμένη γραμμή, πατήστε Return." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Εκτύπωση" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Ορισμός επιλογών σελίδας" + +#: C/gedit.xml:554(para) +msgid "To set the page options, choose FilePage Setup to display the Page Setup dialog." +msgstr "Για να ορίσετε τις επιλογές σελίδας, επιλέξτε ΑρχείοΔιαμόρφωση σελίδας για να εμφανίσετε το παράθυρο διαλόγου Διαμόρφωση σελίδας." + +#: C/gedit.xml:556(para) +msgid "The Page Setup dialog enables you to specify the following print options:" +msgstr "Το παράθυρο διαλόγου Διαμόρφωση σελίδας σας επιτρέπει να καθορίσετε τις ακόλουθες επιλογές εκτύπωσης:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Καρτέλα Γενικά" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Εκτύπωση επισήμανσης σύνταξης" + +#: C/gedit.xml:563(para) +msgid "Select this option to print syntax highlighting. For more information about syntax highlighting, see ." +msgstr "Επιλέξτε το για να εκτυπώσετε την επισήμανση σύνταξης. Για περισσότερες πληροφορίες σχετικά με την επισήμανση σύνταξης, δείτε το ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Εκτύπωση κεφαλίδων σελίδας" + +#: C/gedit.xml:568(para) +msgid "Select this option to include a header on each page that you print. You cannot configure the header." +msgstr "Επιλέξτε το για να περιλάβετε μια κεφαλίδα σε κάθε σελίδα που εκτυπώνετε. Δεν μπορείτε να διαμορφώσετε την κεφαλίδα." + +#: C/gedit.xml:571(guilabel) +#: C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "Αριθμοί γραμμής" + +#: C/gedit.xml:574(para) +msgid "Select the Print line numbers option to include line numbers when you print a file." +msgstr "Επιλέξτε το Εκτύπωση αριθμών γραμμής για να συμπεριλάβετε τους αριθμούς γραμμής στην εκτύπωση ενός αρχείου." + +#: C/gedit.xml:575(para) +msgid "Use the Number every ... lines spin box to specify how often to print the line numbers, for example every 5 lines, every 10 lines, and so on." +msgstr "Χρησιμοποιήστε το πεδίο αριθμών Αριθμός γραμμής κάθε ... γραμμές για να καθορίσετε πόσο συχνά θα εκτυπώνονται οι αριθμοί γραμμής, π.χ. κάθε 5 γραμμές, κάθε 10 γραμμές κ.ο.κ." + +#: C/gedit.xml:578(guilabel) +#: C/gedit.xml:1176(guilabel) +#: C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "Αναδίπλωση κειμένου" + +#: C/gedit.xml:580(para) +msgid "Select the Enable text wrapping option to wrap text onto the next line, at a character level, when you print a file. The application counts wrapped lines as one line for line numbering purposes." +msgstr "Επιλέξτε το Ενεργοποίηση αναδίπλωσης κειμένου για να αναδιπλώσετε κείμενο στην επόμενη γραμμή, σε επίπεδο χαρακτήρα, όταν εκτυπώνετε ένα αρχείο. Η εφαρμογή υπολογίζει κάθε αναδιπλωμένη γραμμή ως μία γραμμή για τους σκοπούς της αρίθμησης." + +#: C/gedit.xml:582(para) +msgid "Select the Do not split words over two lines option to wrap text onto the next line, at a word level, when you print a file." +msgstr "Επιλέξτε το Να μην χωρίζονται λέξεις σε δύο γραμμές για να αναδιπλώσετε το κείμενο στην επόμενη γραμμή, σε επίπεδο λέξης, όταν εκτυπώνετε ένα αρχείο." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Γραμματοσειρές" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Σώμα κειμένου" + +#: C/gedit.xml:594(para) +msgid "Click on this button to select the font to use to print the body text of a file." +msgstr "Κάντε κλικ σε αυτό το κουμπί για να επιλέξετε τη γραμματοσειρά στην οποία θα εκτυπωθεί το σώμα του κειμένου ενός αρχείου." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Αριθμοί γραμμής" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "Κάντε κλικ σε αυτό το κουμπί για να επιλέξετε τη γραμματοσειρά στην οποία θα εκτυπωθούν οι αριθμοί γραμμών." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Κεφαλίδες και υποσέλιδα" + +#: C/gedit.xml:605(para) +msgid "Click on this button to select the font to use to print the headers and footers in a file." +msgstr "Κάντε κλικ σε αυτό το κουμπί για να επιλέξτε τη γραμματοσειρά στην οποία θα εκτυπωθούν οι κεφαλίδες και τα υποσέλιδα ενός αρχείου." + +#: C/gedit.xml:609(para) +msgid "To reset the fonts to the default fonts for printing a file from gedit, click Restore Default Fonts." +msgstr "Για να επαναφέρετε τις γραμματοσειρές στις προεπιλεγμένες για την εκτύπωση ενός αρχείου από το gedit, κάντε κλικ στο κουμπί Επαναφορά προεπιλεγμένων γραμματοσειρών." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Εκτύπωση εγγράφου" + +#: C/gedit.xml:617(para) +msgid "You can use gedit to perform the following print operations:" +msgstr "Μπορείτε να χρησιμοποιήσετε το gedit για να εκτελέσετε τις ακόλουθες εργασίες εκτύπωσης:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Εκτύπωση εγγράφου σε εκτυπωτή." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Εκτύπωση του αποτελέσματος της εντολής εκτύπωσης σε ένα αρχείο." + +#: C/gedit.xml:624(para) +msgid "If you print to a file, gedit sends the output of the file to a pre-press format file. The most common pre-press formats are PostScript and Portable Document Format (PDF)." +msgstr "Αν εκτυπώσετε σε αρχείο, το gedit στέλνει το αποτέλεσμα σε ένα αρχείο προ-εκτύπωσης. ΟΙ πιο κοινές μορφές αρχείων προ-εκτύπωσης είναι το PostScript και το Portable Document Format (PDF)." + +#: C/gedit.xml:626(para) +msgid "To preview the pages that you want to print, choose FilePrint Preview." +msgstr "Για να προεπισκοπήσετε τις σελίδες που θέλετε να εκτυπώσετε, επιλέξτε ΑρχείοΠροεπισκόπηση εκτύπωσης." + +#: C/gedit.xml:628(para) +msgid "To print the current file to a printer or a file, choose FilePrint to display the Print dialog." +msgstr "Για να εκτυπώσετε το τρέχον αρχείο σε έναν εκτυπωτή ή αρχείο, επιλέξτε ΑρχείοΕκτύπωση για να εμφανίσετε το παράθυρο διαλόγου Εκτύπωση." + +#: C/gedit.xml:630(para) +msgid "The Print dialog enables you to specify the following print options:" +msgstr "Το παράθυρο διαλόγου Εκτύπωση σας επιτρέπει να ορίσετε τις ακόλουθες επιλογές εκτύπωσης:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Καρτέλα εργασία" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Εύρος εκτύπωσης" + +#: C/gedit.xml:637(para) +msgid "Select one of the following options to determine how many pages to print:" +msgstr "Επιλέξτε μία από τις ακόλουθες επιλογές για να καθορίσετε πόσες σελίδες θα εκτυπωθούν:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Όλες οι σελίδες" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Επιλέξτε αυτή την επιλογή για να εκτυπώσετε όλες τις σελίδες του αρχείου." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Γραμμές" + +#: C/gedit.xml:645(para) +msgid "Select this option to print the specified lines only. Use the From and To spin boxes to specify the line range." +msgstr "Επιλέξτε αυτή την επιλογή για εκτυπώσετε μόνο τις καθορισμένες γραμμές. Χρησιμοποιήστε τα αριθμητικά πεδία Από και Έως για να καθορίσετε τις γραμμές." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Επιλογή" + +#: C/gedit.xml:649(para) +msgid "Select this option to print the selected text only. This option is only available if you select text." +msgstr "Επιλέξτε αυτή την επιλογή για να εκτυπώσετε μόνο το επιλεγμένο κείμενο. Αυτή η επιλογή είναι διαθέσιμη μόνο αν επιλέξετε κείμενο." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Αντίγραφα" + +#: C/gedit.xml:657(para) +msgid "Use the Number of copies spin box to specify the number of copies of the file that you want to print." +msgstr "Χρησιμοπιήστε το αριθμητικό πεδίο Αριθμός αντιγράφων για να καθορίσετε τον αριθμό των αντιγράφων για το αρχείο που θέελτε να εκτυπώσετε." + +#: C/gedit.xml:658(para) +msgid "If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "Αν εκτυπώσετε πολλαπλά αντίγραφα του αρχείου, επιλέξτε το Συρραφή για να συρράψετε τα αντίγραφα που θα εκτυπωθούν." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Καρτέλα Εκτυπωτής" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Εκτυπωτής" + +#: C/gedit.xml:669(para) +msgid "Use this drop-down list to select the printer to which you want to print the file." +msgstr "Χρησιμοποιήστε την αναδυόμενη λίστα για να επιλέξετε τον εκτυπωτή στον οποίο θέλετε να εκτυπωθεί το αρχείο." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Ρυθμίσεις" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Χρησιμοποιήστε αυτή τη λίστα για να επιλέξετε τις ρυθμίσεις εκτυπωτή." + +#: C/gedit.xml:676(para) +msgid "To configure the printer, click Configure. For example, you can enable or disable duplex printing, or schedule delayed printing, if this functionality is supported by the printer." +msgstr "Για να διαμορφώσετε τον εκτυπωτή, κάντε κλικ στο Διαμόρφωση. Π.χ., μπορείτε να ενεργοποιήσετε ή απενεργοποιήσετε την εκτύπωση διπλής όψης, αν αυτή η λειτουργία υποστηρίζεται από τον εκτυπωτή σας." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Τοποθεσία" + +#: C/gedit.xml:682(para) +msgid "Use this drop-down list to select one of the following print destinations:" +msgstr "Χρησιμοποιήστε αυτή τη λίστα για να επιλέξετε έναν από τους ακόλουθους προορισμούς εκτύπωσης:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Εκτύπωση του αρχείου σε εκτυπωτή του CUPS." + +#: C/gedit.xml:693(para) +msgid "If the selected printer is a CUPS printer, CUPS is the only entry in this drop-down list." +msgstr "Αν ο επιλεγμένος εκτυπωτής είναι CUPS, το CUPS είναι η μόνη καταχώρηση σε αυτή τη λίστα." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Εκτύπωση του αρχείου σε εκτυπωτή." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Αρχείο" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Εκτύπωση του αρχείου σε αρχείο PostScript." + +#: C/gedit.xml:713(para) +msgid "Click Save As to display a dialog where you specify the name and location of the PostScript file." +msgstr "Κάντε κλικ στο Αποθήκευση ως για να εμφανίσετε ένα παράθυρο διαλόγου όπου καθορίζετε το όνομα και την τοποθεσία του αρχείου PostScript." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Προσαρμοσμένο" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Χρησιμοποιήστε την καθορισμένη εντολή για να εκτυπώσετε το αρχείο." + +#: C/gedit.xml:724(para) +msgid "Type the name of the command in the text box. Include all command-line arguments." +msgstr "Πληκτρολογήστε το όνομα της εντολής στο πεδίο κειμένου. Συμπεριλάβετε όλα τα ορίσματα της γραμμής εντολών." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Κατάσταση" + +#: C/gedit.xml:734(para) +#: C/gedit.xml:740(para) +#: C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Αυτή η λειτουργία δεν υποστηρίζεται σε αυτή την έκδοση του gedit." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Τύπος" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Σχόλιο" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Καρτέλα Χαρτί" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Μέγεθος χαρτιού" + +#: C/gedit.xml:758(para) +msgid "Use this drop-down list to select the size of the paper to which you want to print the file." +msgstr "Χρησιμοποιήστε αυτή τη λίστα για να επιλέξετε το μέγεθος του χαρτιού στο οποίο θέλετε να εκτυπώσετε το αρχείο." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Πλάτος" + +#: C/gedit.xml:763(para) +msgid "Use this spin box to specify the width of the paper. Use the adjacent drop-down list to change the measurement unit." +msgstr "Χρησιμοποιήστε αυτό το αριθμητικό πεδίο για να καθορίσετε το πλάτος του χαρτιού. Χρησιμοποιήστε τη διπλανή λίστα για αλλάξετε τη μονάδα μέτρησης." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Ύψος" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Χρησιμοποιήστε αυτό το αριθμητικό πεδίο για να ορίσετε το ύψος του χαρτιού." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Προσανατολισμός τροφοδοσίας" + +#: C/gedit.xml:773(para) +msgid "Use this drop-down list to select the orientation of the paper in the printer." +msgstr "Χρησιμοποιήστε αυτή τη λίστα για να επιλέξετε τον προσανατολισμό του χαρτιού στον εκτυπωτή." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Προσανατολισμός σελίδας" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Χρησιμοποιήστε αυτή τη λίστα για να επιλέξετε τον προσανατολισμό της σελίδας." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Διάταξη" + +#: C/gedit.xml:783(para) +msgid "Use this drop-down list to select the page layout. A preview of each layout that you select is displayed in the Preview area." +msgstr "Χρησιμοποιήστε αυτή τη λίστα για επιλέξετε τη διάταξη σελίδας. Μια προεπισκόπηση κάθε διάταξης που επιλέγετε εμφανίζεται στην περιοχή Προεπισκόπηση." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Τροφοδότης χαρτιού" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Χρησιμοποιήστε αυτή τη λίστα για να επιλέξετε τροφοδότη χαρτιού." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Προγραμματιστικά χαρακτηριστικά" + +#: C/gedit.xml:801(para) +msgid "Several of gedit's features for programming are provided with plugins. For example, the Tag List plugin provides a list of commonly-used tags for different markup languages: see ." +msgstr "Πολλές λειτουργίες προγραμματισμού του gedit παρέχονται με πρόσθετα. Π.χ., το πρόσθετο Λίστα Ετικετών παρέχει μια λίστα των συνηθέστερων ετικετών για διαφορετικές γλώσσες ιστοσελίδων: δείτε το ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Επισήμανση σύνταξης" + +#: C/gedit.xml:806(para) +msgid "Syntax highlighting makes source code easier to read by showing different parts of the text in different colors." +msgstr "Η επισήμανση σύνταξης καθιστά ευκολότερη την ανάγνωση πηγαίου κώδικα, απεικονίζοντας διαφορετικά μέρη του με διαφορετικά χρώματα." + +#: C/gedit.xml:808(para) +msgid "gedit chooses an appropriate syntax highlighting mode based on a document's type. To override the syntax highlighting mode, choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "Το gedit επιλέγει ένα κατάλληλο τρόπο επισήμανσης σύνταξης βασιζόμενο στον τύπο του εγγράφου. Για να παρακάμψετε αυτή την κατάσταση λειτουργίας, επιλέξτε ΠροβολήΛειτουργία επισήμανσης, μετά επιλέξτε ένα από τα ακόλουθα αντικείμενα του μενού:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Απλό κείμενο" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Καμμία επισήμανση σύνταξης." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Κώδικας" + +#: C/gedit.xml:819(para) +msgid "Display syntax highlighting to edit source code. Use the Sources submenu to select the source code type." +msgstr "Εμφάνιση επισήμανσης για επεξεργασία πηγαίου κώδικα. Χρησιμοποιήστε το υπομενού Κώδικας για να επιλέξετε τον τύπο του πηγαίου κώδικα." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Σήμανση (Markup)" + +#: C/gedit.xml:825(para) +msgid "Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "Εμφάνιση επισήμανσης σύνταξης για επεξεργασία κώδικα σήμανσης. Χρησιμοποιήστε το υπομενού Markup για να επιλέξετε τον τύπο του κώδικα σήμανσης." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Σενάρια ενεργειών (scripts)" + +#: C/gedit.xml:831(para) +msgid "Display syntax highlighting to edit script code. Use the Scripts submenu to select the script code type." +msgstr "Εμφανίστε τη λειτουργία επισήμανσης κώδικα για επεξεργασθείτε κώδικα σεναρίων ενεργειών. Χρησιμοποιήστε το υπομενού Σενάρια ενεργειών για να επιλέξετε τον τύπο του κώδικα." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Άλλα" + +#: C/gedit.xml:837(para) +msgid "Display syntax highlighting to edit other types of code. Use the Others submenu to select the code type." +msgstr "Εμφάνιση επισήμανσης σύνταξης για επεξεργασία άλλων τύπων κώδικα. Χρησιμοποιήστε το υπομενού Άλλα για να επιλέξετε τον τύπο του κώδικα." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Διοχέτευση της εξόδου μιας εντολής σε ένα αρχείο." + +#: C/gedit.xml:846(para) +msgid "You can use gedit to pipe the output of a command to a text file. For example, to pipe the output of an ls command to a text file, type ls | gedit, then press Return." +msgstr "Μπορείτε να χρησιμοποιήσετε το gedit για να διοχετεύσετε την έξοδο μιας εντολής σε ένα αρχείο κειμένου. Π.χ., για να διοχετεύσετε το αποτέλεσμα μιας εντολής ls σε ένα αρχείο, πληκτρολογήστε ls | gedit και πατήστε Return." + +#: C/gedit.xml:847(para) +msgid "The output of the ls command is displayed in a new text file in the gedit window." +msgstr "Η έξοδος της εντολής ls εμφανίζεται σε ένα καινούριο αρχείο κειμένου στο παράθυρο του gedit." + +#: C/gedit.xml:848(para) +msgid "Alternatively, you can use the External tools plugin to pipe command output to the current file." +msgstr "Εναλλακτικά μπορείτε να χρησιμοποιήσετε το πρόσθετο External tools για να διοχετεύσετε την έξοδο της εντολής στο τρέχον αρχείο." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Πλήκτρα συντόμευσης" + +#: C/gedit.xml:855(para) +msgid "Use shortcut keys to perform common tasks more quickly than with the mouse and menus. The following tables list all of gedit's shortcut keys." +msgstr "Χρησιμοποιήστε πλήκτρα συντόμευσης για να πραγματοποιήσετε συνήθεις εργασίες πιο γρήγορα σε σχέση με το ποντίκι και τα μενού. Οι ακόλουθοι πίνακες απαριθμούν όλες τις συντομεύσεις πληκτρολογίου του gedit." + +#: C/gedit.xml:856(para) +msgid "For more on shortcut keys, see the Desktop User Guide." +msgstr "Για περισσότερα σχετικά με τις συντομεύσεις πληκτρολογίου, δείτε τον Desktop User Guide." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) +#: C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "Καρτέλες" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Συντομεύσεις για τις καρτέλες:" + +#: C/gedit.xml:868(para) +#: C/gedit.xml:912(para) +#: C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) +#: C/gedit.xml:1052(para) +#: C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "Πλήκτρα συντόμευσης" + +#: C/gedit.xml:870(para) +#: C/gedit.xml:914(para) +#: C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) +#: C/gedit.xml:1054(para) +#: C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "Εντολή" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Μετάβαση στην επόμενη προς τα αριστερά καρτέλα." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Μετάβαση στην επόμενη προς τα δεξιά καρτέλα." + +#: C/gedit.xml:883(para) +#: C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Κλείσιμο καρτέλας." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Αποθήκευση όλων των καρτελών." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Κλείσιμο όλων των καρτελών." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + αριθμός" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Μετάβαση στην καρτέλα με τον αντίστοιχο αριθμό (μπορεί να μη λειτουργεί με το αριθμητικό πληκτρολόγιο)" + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Αρχεία" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Συντομεύσεις για εργασία με αρχεία:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Δημιουργία νέου εγγράφου" + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Άνοιγμα εγγράφου." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Άνοιγμα τοποθεσίας." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Αποθήκευση του τρέχοντος εγγράφου στο δίσκο." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Αποθήκευση του τρέχοντος εγγράφου με νέο όνομα αρχείου." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Εκτύπωση του τρέχοντος εγγράφου." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Προεπισκόπηση εκτύπωσης" + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Κλείσιμο του τρέχοντος εγγράφου." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Έξοδος από το Gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) +#: C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) +#: C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "Επεξεργασία" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Συντομεύσεις για επεξεργασία εγγράφων:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Αναίρεση της τελευταίας ενέργειας." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Επανάληψη της τελευταίας ενέργειας." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Αποκοπή του επιλεγμένου κειμένου ή περιοχής και τοποθέτηση στο πρόχειρο." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Αντιγραφή του επιλεγμένου κειμένου ή περιοχή στο πρόχειρο." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Επικόλληση των περιεχομένων του πρόχειρου." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Επιλογή όλων." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Διαγραφή τρέχουσας γραμμής." + +#: C/gedit.xml:1003(para) +#| msgid "Alt + n" +msgid "Alt + Up" +msgstr "Alt + πάνω" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "Μετακίνηση της επιλεγμένης γραμμής μια γραμμή επάνω." + +#: C/gedit.xml:1007(para) +#| msgid "Alt + n" +msgid "Alt + Down" +msgstr "Alt + κάτω" + +#: C/gedit.xml:1008(para) +#| msgid "Copy the selected text or region onto the clipboard." +msgid "Move the selected line down one line." +msgstr "Μετακίνηση της επιλεγμένης γραμμής μια γραμμή κάτω." + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "Εργαλειοθήκες" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Συντομεύσεις για εμφάνιση και απόκρυψη εργαλειοθηκών:" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "Εμφάνιση / απόκρυψη της πλευρικής εργαλειοθήκης." + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "Εμφάνιση / απόκρυψη της κάτω εργαλειοθήκης." + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "Αναζήτηση" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "Συντομεύσεις για αναζήτηση:" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "Εύρεση αλληλουχίας." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "Εύρεση της επόμενης εμφάνισης της αλληλουχίας." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "Εύρεση της προηγούμενης εμφάνισης της αλληλουχίας." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "Διαδραστική αναζήτηση." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "Αναζήτηση και αντικατάσταση." + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "Καθαρισμός επισήμανσης." + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "Μετάβαση στη γραμμή." + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "Εργαλεία" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "Συντομεύσεις για τα εργαλεία:" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "Έλεγχος ορθογραφίας (με πρόσθετο)." + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Αφαίρεαση πλεοναζόντων κενών (με πρόσθετο)." + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "Εσοχή (με πρόσθετο)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "Αφαίρεση εσοχής (με πρόσθετο)." + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Εκτέλεση της εντολής \"make\" στον τρέχοντα κατάλογο (με πρόσθετο)." + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "Λίστα καταλόγου (με πρόσθετο)." + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "Βοήθεια" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "Συντομεύσεις για τη βοήθεια:" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "Άνοιγμα του οδηγού χρήστη του gedit." + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "Προτιμήσεις" + +#: C/gedit.xml:1164(para) +msgid "To configure gedit, choose EditPreferences. The Preferences dialog contains the following categories:" +msgstr "Για να διαμορφώσετε το gedit, επιλέξτε ΕπεξεργασίαΠροτιμήσεις. Το παράθυρο διαλόγου Προτιμήσεις περιέχει τις ακόλουθες κατηγορίες:" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "Προβολή" + +#: C/gedit.xml:1178(para) +msgid "Select the Enable text wrapping option to have long lines of text flow into paragraphs instead of running off the edge of the text window. This avoids having to scroll horizontally" +msgstr "Επιλέξτε την επιλογή Ενεργοποίηση αναδίπλωσης κειμένου για να οργανώνονται σε παραγράφους οι μακρές γραμμές κειμένου αντί να συνεχίζονται πέραν της άκρης του παραθύρου κειμένου. Έτσι αποφεύγετε την οριζόντια κύλιση." + +#: C/gedit.xml:1179(para) +msgid "Select the Do not split words over two lines option to have the text wrapping option preserve whole words when flowing text to the next line. This makes text easier to read." +msgstr "Επιλέξτε το Να μη χωρίζονται οι λέξεις σε δύο γραμμές για να διατηρούνται ολόκληρες οι λέξεις κατά την αναδίπλωση κειμένου. Έτσι γίνεται ευκολότερη η ανάγνωση." + +#: C/gedit.xml:1185(para) +msgid "Select the Display line numbers option to display line numbers on the left side of the gedit window." +msgstr "Επιλέξτε το Προβολή αριθμών γραμμής για εμφανίζονται οι αριθμοί γραμμής στην αριστερή πλευρά του παραθύρου του gedit." + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "Τρέχουσα γραμμή" + +#: C/gedit.xml:1191(para) +msgid "Select the Highlight current line option to highlight the line where the cursor is placed." +msgstr "Επιλέξτε το Επισήμανση τρέχουσας γραμμής για να επισημάνετε τη γραμμή όπου βρίσκεται ο δρομέας." + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "Δεξί περιθώριο" + +#: C/gedit.xml:1197(para) +msgid "Select the Display right margin option to display a vertical line that indicates the right margin." +msgstr "Επιλέξτε το Προβολή δεξιού περιθωρίου για να εμφανίσετε μια κάθετη γραμμή που υποδεικνύει τη θέση του δεξιού περιθωρίου." + +#: C/gedit.xml:1198(para) +msgid "Use the Right margin at column spin box to specify the location of the vertical line." +msgstr "Χρησιμοποιήστε το αριθμητικό πεδίο Δεξί περιθώριο στη στήλη για να καθορίσετε τη θέση της κάθετης γραμμής." + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "Ταίριασμα αγκυλών" + +#: C/gedit.xml:1204(para) +msgid "Select the Highlight matching bracket option to highlight the corresponding bracket when the cursor is positioned on a bracket character." +msgstr "Επιλέξτε το Επισήμανση παρένθεσης που ταιριάζει για να επισημαίνετε την αντίστοιχη παρένθεση όταν ο δρομέας τοποθετηθεί σε ένα χαρακτήρα παρένθεσης." + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "Επεξεργαστής" + +#: C/gedit.xml:1217(para) +msgid "Use the Tab width spin box to specify the width of the space that gedit inserts when you press the Tab key." +msgstr "Χρησιμοποιήστε το αριθμητικό πεδίο Πλάτος στηλοθέτη για να ορίσετε το πλάτος του διαστήματος που θα εισάγει το gedit όταν πιέζετε το πλήκτρο Tab." + +#: C/gedit.xml:1218(para) +msgid "Select the Insert spaces instead of tabs option to specify that gedit inserts spaces instead of a tab character when you press the Tab key." +msgstr "Επιλέξτε το Εισαγωγή διαστημάτων αντί για στηλοθέτες για να ορίσετε ότι το gedit θα εισάγει διαστήματα αντί για χαρακτήρα στηλοθέτη όταν πατάτε το Tab." + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "Αυτόματη εσοχή" + +#: C/gedit.xml:1224(para) +msgid "Select the Enable auto indentation option to specify that the next line starts at the indentation level of the current line." +msgstr "Επιλέξτε το Ενεργοποίηση αυτόματης εσοχής για να ορίσετε ότι η επόμενη γραμμή θα ξεκινά με την ίδια εσοχή με την τρέχουσα γραμμή." + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "Αποθήκευση αρχείου" + +#: C/gedit.xml:1230(para) +msgid "Select the Create a backup copy of files before saving option to create a backup copy of a file each time you save the file. The backup copy of the file contains a ~ at the end of the filename." +msgstr "Επιλέξτε Δημιουργία αντιγράφου ασφαλείας πριν την αποθήκευση για να δημιουργείται ένα αντίγραφο του αρχείου κάθε φορά που το αποθηκεύετε. Το αντίγραφο του αρχείου περιέχει μια ~ στο τέλος του ονόματος του αρχείου." + +#: C/gedit.xml:1231(para) +msgid "Select the Autosave files every ... minutes option to automatically save the current file at regular intervals. Use the spin box to specify how often you want to save the file." +msgstr "Επιλέξτε το Αυτόματη αποθήκευση αρχείων κάθε ... λεπτά για να αποθηκεύετε το τρέχον αρχείο σε τακτά διαστήματα. Χρησιμοποιήστε το αριθμητικό πεδίο για να ορίσετε πόσο συχνά θέλετε να αποθηκεύεται το αρχείο." + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "Γραμματοσειρές & Χρώματα" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "Γραμματοσειρά" + +#: C/gedit.xml:1243(para) +msgid "Select the Use default theme font option to use the default system font for the text in the gedit text window." +msgstr "Επιλέξτε το Χρήση προκαθορισμένης σταθερού πλάτους γραμματοσειράς συστήματος για να χρησιμοποιήσετε την προεπιλεγμένη γραμματοσειρά του συστήματος στο παράθυρο κειμένου του gedit." + +#: C/gedit.xml:1244(para) +msgid "The Editor font field displays the font that gedit uses to display text. Click on the button to specify the font type, style, and size to use for text." +msgstr "Το πεδίο Γραμματοσειρά επεξεργαστή απεικονίζει τη γραμματοσειρά που χρησιμοποιεί το gedit για να εμφανίσει το κείμενο. Κάντε κλικ στο κουμπί για να καθορίσετε τον τύπο, μορφή και μέγεθος της γραμματοσειράς που θα χρησιμοποιηθεί για το κείμενο." + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "Συνδυασμοί χρωμάτων" + +#: C/gedit.xml:1250(para) +msgid "You can choose a color scheme from the list of color schemes. By default, the following color schemes are installed:" +msgstr "Μπορείτε να επιλέξετε ένα συνδυασμό χρωμάτων από τη λίστα των συνδυασμών χρωμάτων. Ως προεπιλογή, οι ακόλουθοι συνδυασμοί είναι εγκατεστημένοι:" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "Κλασσικός" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Κλασσικός συνδυασμός χρωμάτων που βασίζεται σε αυτόν του gvim." + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Κοβαλτίου" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "Συνδυασμός χρωμάτων βασισμένος στο μπλε." + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Συνδυασμός χρωμάτων στο επεξεργαστή κειμένου Kate." + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Σκοτεινός συνδυασμός χρωμάτων που χρησιμοποιεί τη χρωματική παλέττα του Tango." + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Συνδυασμός χρωμάτων που χρησιμοποιεί αυτόν του Tango." + +#: C/gedit.xml:1283(para) +msgid "You can add a new color scheme by clicking on Add..., and selecting a color scheme file" +msgstr "Μπορείτε να προσθέσετε ένα νέο συνδυασμό χρωμάτων κάνοντας κλικ στο Προσθήκη... και επιλέγοντας αρχείο χρωματικού συνδυασμού." + +#: C/gedit.xml:1284(para) +msgid "You can remove the selected color scheme by clicking on Remove" +msgstr "Μπορείτε να αφαιρέσετε τον επιλεγμένο συνδυασμό χρωμάτων κάνοντας κλικ στο Αφαίρεση" + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "Προτιμήσεις Πρόσθετων Λειτουργιών" + +#: C/gedit.xml:1292(para) +msgid "Plugins add extra features to gedit. For more information on plugins and how to use the built-in plugins, see ." +msgstr "Τα πρόσθετα δίνουν επιπλέον χαρακτηριστικά στο gedit. Για περισσότερες πληροφορίες για τα πρόσθετα και τη χρήση των ενσωματωμένων προσθέτων, δείτε το ." + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "Ενεργοποίηση προσθέτων" + +#: C/gedit.xml:1297(para) +msgid "To enable a gedit plugin, perform the following steps:" +msgstr "Για να ενεργοποιήσετε ένα πρόσθετο του gedit, κάντε τα ακόλουθα βήματα:" + +#: C/gedit.xml:1300(para) +#: C/gedit.xml:1321(para) +#: C/gedit.xml:1643(para) +msgid "Choose EditPreferences." +msgstr "Επιλέξτε ΕπεξεργασίαΠροτιμήσεις." + +#: C/gedit.xml:1303(para) +#: C/gedit.xml:1324(para) +#: C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "Επιλέξτε την καρτέλα Πρόσθετες λειτουργίες." + +#: C/gedit.xml:1306(para) +msgid "Select the check box next to the name of the plugin that you want to enable." +msgstr "Επιλέξτε το κουτάκι δίπλα στο όνομα του προσθέτου που θέλετε να ενεργοποιήσετε." + +#: C/gedit.xml:1309(para) +#: C/gedit.xml:1330(para) +msgid "Click Close to close the Preferences dialog." +msgstr "Κάντε κλικ στο Κλείσιμο για να κλείσετε το παράθυρο διαλόγου Προτιμήσεις." + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "Απενεργοποίηση πρόσθετου" + +#: C/gedit.xml:1317(para) +msgid "A plugin remains enabled when you quit gedit." +msgstr "Τα πρόσθετα παραμένουν ενεργοποιημένα και αφού εγκαταλείψετε το gedit." + +#: C/gedit.xml:1318(para) +msgid "To disable a gedit plugin, perform the following steps:" +msgstr "Για να απενεργοποιήσετε ένα πρόσθετο του gedit, ακολουθήστε τα εξής βήματα:" + +#: C/gedit.xml:1327(para) +msgid "Deselect the check box next to the name of the plugin that you want to disable." +msgstr "Απο-επιλέξτε το κουτάκι δίπλα στο όνομα του πρόσθετου που θέλετε να απενεργοποιήσετε." + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "Πρόσθετα" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "Εργασία με πρόσθετα" + +#: C/gedit.xml:1342(para) +msgid "You can add extra features to gedit by enabling plugins. A plugin is a supplementary program that enhances the functionality of an application. Plugins add new items to the gedit menus for the new features they provide." +msgstr "Μπορείτε να προσθέσετε επιπλέον χαρακτηριστικά στο gedit ενεργοποιώντας τα plugins. Το πρόσθετο είναι ένα συμπληρωματικό πρόγραμμα που αυξάνει τη λειτουργικότητα μιας εφαρμογής. Τα πρόσθετα προσθέτουν νέα αντικείμενα στα μενού του gedit για τα νέα χαρακτηριστικά που παρέχουν." + +#: C/gedit.xml:1344(para) +msgid "Several plugins come built-in with gedit, and you can install more. The gedit website lists third-party plugins." +msgstr "Πολλά πρόσθετα έρχονται ενσωματωμένα στο gedit και μπορείτε να εγκαταστήσετε περισσότερα. Στο gedit website απαριθμούνται πρόσθετα από τρίτους." + +#: C/gedit.xml:1345(para) +msgid "To enable and disable plugins, or see which plugins are currently enabled, use the Plugins Preferences." +msgstr "Για να ενεργοποιήσετε και να απενεργοποιήσετε πρόσθετα ή να δείτε ποια πρόσθετα είναι ενεργοποιημένα, χρησιμοποιήστε το Προτιμήσεις προσθέτων." + +#: C/gedit.xml:1346(para) +msgid "The following plugins come built-in with gedit:" +msgstr "Τα ακόλουθα πρόσθετα είναι ενσωματωμένα στο gedit:" + +#: C/gedit.xml:1352(para) +msgid "Change Case allows you to change the case of the selected text." +msgstr "Αλλαγή πεζών κεφαλαίων, σας επιτρέπει να αλλάξετε μεταξύ πεζών και κεφαλαίων στο επιλεγμένο κείμενο." + +#: C/gedit.xml:1355(para) +msgid "Document Statistics shows the number of lines, words, and characters in the document." +msgstr "Στατιστικά εγγράφου, δείχνει τον αριθμό γραμμών, λέξεων και χαρακτήρων του εγγράφου." + +#: C/gedit.xml:1358(para) +msgid "External Tools allows you to execute external commands from gedit." +msgstr "Εξωτερικά εργαλεία, σας επιτρέπει να εκτελέσετε εξωτερικές εντολές από το gedit." + +#: C/gedit.xml:1361(para) +msgid "File Browser allows you to browse your files and folders in the side pane." +msgstr "Περιηγητής αρχείων, σας επιτρέπει να περιηγηθείτε στα αρχεία και τους φακέλους σας στο πλευρικό πλαίσιο." + +#: C/gedit.xml:1364(para) +msgid "Indent Lines adds or removes indentation from the selected lines." +msgstr "Εσοχή γραμμών, προσθέτει ή αφαιρεί την εσοχή στις επιλεγμένες γραμμές." + +#: C/gedit.xml:1367(para) +msgid "Insert Date/Time adds the current date and time into a document." +msgstr "Εισαγωγή Ημερομηνίας/Ώρας, προσθέτει την τρέχουσα ημερομηνία και ώρα σε ένα έγγραφο." + +#: C/gedit.xml:1370(para) +msgid "Modelines allows you to set editing preferences for individual documents, and supports Emacs, Kate and Vim-style modelines." +msgstr "Modelines, σας επιτρέπει να ορίσετε τις προτιμήσεις επεξεργασίας ξεχωριστά για κάθε έγγραφο, και υποστηρίζει modelines τύπου Emacs, Kate και Vim." + +#: C/gedit.xml:1373(para) +msgid "Python Console allows you to run commands in the python programming language." +msgstr "Κοσνόλα Python, σας επιτρέπει να εκτελείτε εντολές της γλώσσας προγραμματισμού python." + +#: C/gedit.xml:1376(para) +msgid "Snippets allows you to store frequently-used pieces of text and insert them quickly into a document." +msgstr "Snippets, σας επιτρέπει να αποθηκεύσετε συχνά χρησιμοποιούμενα τμήματα κειμένου και να τα εισάγετε γρήγορα σε ένα έγγραφο." + +#: C/gedit.xml:1379(para) +msgid "Sort arranges selected lines of text into alphabetical order." +msgstr "Ταξινόμηση, ταξινομεί τις επιλεγμένες γραμμές κειμένου σε αλφαβητική σειρά." + +#: C/gedit.xml:1382(para) +msgid "Spell Checker corrects the spelling in the selected text, or marks errors automatically in the document." +msgstr "Έλεγχος ορθογραφίας, διορθώνει τα ορθογραφικά λάθη στο επιλεγμένο κείμενο ή σημειώνει αυτόματα τα λάθη στο έγγραφο." + +#: C/gedit.xml:1385(para) +msgid "Tag List lets you insert commonly-used tags for HTML and other languages from a list in the side pane." +msgstr "Λίστα ετικετών, σας επιτρέπει να εισάγετε συνήθεις ετικέτες για την HTML και άλλες γλώσσες από μια λίστα στο πλευρικό πλαίσιο." + +#: C/gedit.xml:1389(para) +msgid "For more information on creating plugins, see the gedit website." +msgstr "Για περισσότερες πληροφορίες σχετικά με τη δημιουργία προσθέτων, δείτε τον ιστότοπο τουgedit." + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "Πρόσθετο Αλλαγή πεζών κεφαλαίων" + +#: C/gedit.xml:1394(para) +msgid "The Change Case plugin changes the case of the selected text." +msgstr "Το πρόσθετο Αλλαγή πεζών κεφαλαίων αλλάζει τα γράμματα (πεζά - κεφαλαία) του επιλεγμένου κειμένου." + +#: C/gedit.xml:1395(para) +msgid "The following items are added to the Edit menu when the Change Case plugin is enabled:" +msgstr "Τα ακόλουθα αντικείμενα προστίθενται στο μενού Επεξεργασία όταν είναι ενεργό το πρόσθετο Αλλαγή πεζών κεφαλαίων:" + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "Αντικείμενο μενού" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "Ενέργεια" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "Παράδειγμα" + +#: C/gedit.xml:1415(guisubmenu) +#: C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) +#: C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "Αλλαγή πεζών - κεφαλαίων" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "Όλα κεφαλαία" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "Αλλάζει κάθε χαρακτήρα σε κεφαλαίο." + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "Αυτό το κείμενο γίνεται ΑΥΤΟ ΤΟ ΚΕΙΜΕΝΟ" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "Όλα πεζά" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "Αλλάζει κάθε χαρακτήρα σε πεζό." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "Αυτό το κείμενο γίνεται αυτό το κείμενο" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "Αντιστροφή πεζών - κεφαλαίων" + +#: C/gedit.xml:1428(para) +msgid "Change each lowercase character to uppercase, and change each uppercase character to lowercase." +msgstr "Αλλάζει κάθε πεζό χαρακτήρα σε κεφαλαίο και αντίστροφα." + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Αυτό Το Κείμενο γίνεται αΥΤΟ τΟ κΕΙΜΕΝΟ" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "Αρχικά κεφαλαία" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "Αλλάζει τον πρώτο χαρακτήρα κάθε λέξης σε κεφαλαίο." + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "αυτό το κείμενο γίνεται Αυτό Το Κείμενο" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "Πρόσθετο στατιστικών εγγράφου" + +#: C/gedit.xml:1445(para) +msgid "The Document Statistics plugin counts the number of lines, words, characters with spaces, characters without spaces, and bytes in the current file. The plugin displays the results in a Document Statistics dialog. To use the Document Statistics plugin, perform the following steps:" +msgstr "Το πρόσθετο Στατιστικά εγγράφου καταμετρά τον αριθμό γραμμών, λέξεων, χαρακτήρων με τα διαστήματα, χαρακτήρων χωρίς τα διαστήματα, και τα bytes του τρέχοντος αρχείου. Το πρόσθετο απεικονίζει τα αποτελέσματα σε ένα παράθυρο διαλόγου Στατιστικά εγγράφου. Για να χρησιμοποιήσετε το πρόσθετο Στατιστικά εγγράφου, κάντε τα ακόλουθα βήματα:" + +#: C/gedit.xml:1447(para) +msgid "Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog displays the following information about the file:" +msgstr "Επιλέξτε ΕργαλείαΣτατιστικά εγγράφου για να εμφανίσετε το παράθυρο διαλόγου Στατιστικά εγγράφου. Τα παράθυρο διαλόγου εμφανίζει τις ακόλουθες πληροφορίες σχετικά με το αρχείο:" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "Αριθμός γραμμών στο τρέχον έγγραφο." + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "Αριθμός λέξεων στο τρέχον έγγραφο." + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Αριθμός χαρακτήρων, συμπεριλαμβανομένων των διαστημάτων, στο τρέχον έγγραφο." + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Αριθμός χαρακτήρων, μη συμπεριλαμβανομένων των διαστημάτων, στο τρέχον έγγραφο." + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "Αριθμός bytes στο τρέχον έγγραφο." + +#: C/gedit.xml:1467(para) +msgid "You can continue to update the gedit file while the Document Statistics dialog is open. To refresh the contents of the Document Statistics dialog, click Update." +msgstr "Μπορείτε να συνεχίσετε να ενημερώνετε το αρχείο του gedit ενώ το παράθυρο διαλόγου Στατιστικά εγγράφου είναι ανοιχτό. Για να ανανεώσετε τα περιεχόμενα του παραθύρου διαλόγου Στατιστικά εγγράφου, κάντε κλικ στο Ενημέρωση." + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "Πρόσθετο εξωτερικά εργαλεία" + +#: C/gedit.xml:1475(para) +msgid "The External Tools plugin allows you to execute external commands from gedit. You can pipe some content into a command and exploit its output (for example, sed), or launch a predefined command (for example, make)." +msgstr "Το πρόσθετο Εξωτερικά εργαλεία σας επιτρέπει να εκτελέσετε εξωτερικές εντολές από το gedit. Μπορείτε να διοχετεύσετε κάποιο περιεχόμενο σε μια εντολή και να εκμεταλλευθείτε το αποτέλεσμά της (π.χ., sed) ή να εκκινήσετε μια προκαθορισμένη εντολή (π.χ., make)." + +#: C/gedit.xml:1476(para) +msgid "Use the External Tools Manager to create and edit commands. To run an external command, choose it from the Tools menu." +msgstr "Χρησιμοποιήστε τη Διαχείριση εξωτερικών εργαλείων για να δημιουργήσετε και επεξεργασθείτε εντολές. Για να εκτελέσετε μια εξωτερική εντολή, επιλέξτε τη από το μενού Εργαλεία." + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "Ενσωματωμένες εντολές" + +#: C/gedit.xml:1480(para) +msgid "The following commands are provided with the External Tools plugin:" +msgstr "Οι ακόλουθες εντολές παρέχονται με το πρόσθετο Εξωτερικά εργαλεία:" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Κατασκευή (Build)" + +#: C/gedit.xml:1484(para) +msgid "Runs make in the current document's directory." +msgstr "Εκτελεί τη make στον κατάλογο του τρέχοντος εγγράφου." + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "Περιεχόμενα καταλόγου" + +#: C/gedit.xml:1489(para) +msgid "Lists the contents of the current document's directory in a new document." +msgstr "Εμφανίζει τα περιεχόμενα του καταλόγου του τρέχοντος εγγράφου σε ένα νέο έγγραφο." + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "Μεταβλητές περιβάλλοντος" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Εμφανίζει τις μεταβλητές περιβάλλοντος στο κάτω πλαίσιο." + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "Searches for a term in all files in the current document directory, using pattern matching. Results are shown in the bottom pane." +msgstr "Αναζητά για έναν όρο σε όλα τα αρχεία του καταλόγου του τρέχοντος εγγράφου, χρησιμοποιώντας ταίριασμα μορφής. Τα αποτελέσματα εμφανίζονται στο κάτω πλαίσιο." + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "Αφαίρεση τελικών διαστημάτων" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Αφαιρεί όλα τα διαστήματα από το τέλος των γραμμών στο έγγραφο." + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "Ορισμός εντολής" + +#: C/gedit.xml:1512(para) +msgid "To add an external command, choose ToolsExternal Tools." +msgstr "Για να προσθέσετε μια εξωτερική , επιλέξτε ΕργαλείαΕξωτερικά εργαλεία." + +#: C/gedit.xml:1513(para) +msgid "In the External Tools Manager window, click New. You can speficy the following details for the new command:" +msgstr "Στο παράθυρο της Διαχείρισης εξωτερικών εργαλείων, κάντε κλικ στο Νέο. Μπορείτε να καθορίσετε τις ακόλουθες λεπτομέρειες για τη νέα εντολή:" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "Περιγραφή" + +#: C/gedit.xml:1517(para) +msgid "This description is shown in the statusbar when the menu command is chosen." +msgstr "Αυτή η περιγραφή εμφανίζεται στη γραμμή κατάστασης όταν έχει επιλεγεί η εντολή μενού." + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "Επιταχυντής" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Εισάγετε μια συντόμευση πληκτρολογίου για την εντολή." + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "Εντολές" + +#: C/gedit.xml:1527(para) +msgid "The actual commands to be run. Several gedit environment variables can be used to pass content to these commands: see ." +msgstr "Οι εντολές που θα εκτελεστούν. Πολλές μεταβλητές περιβάλλοντος του gedit μπορούν να χρησιμοποιηθούν για να περάσει περιεχόμενο σε αυτές τις εντολές: δείτε το ." + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "Είσοδος" + +#: C/gedit.xml:1532(para) +msgid "The content to give to the commands (as stdin): the entire text of the current document, the current selection, line, or word." +msgstr "Το περιεχόμενο που θα δοθεί στις εντολές (όπως stdin): ολόκληρο το κείμενο του τρέχοντος εγγράφου, η τρέχουσα επιλογή, γραμμή ή λέξη." + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "Έξοδος" + +#: C/gedit.xml:1537(para) +msgid "What to do with the output of the commands: display in the bottom pane, put in a new document, or place in the current document, at the end, at the cursor position, or replacing the selection or the entire document." +msgstr "Τι θα γίνει το αποτέλεσμα των εντολών: εμφάνιση στο κάτω πλαίσιο, τοποθέτηση σε νέο έγγραφο ή στο τρέχον έγγραφο, στο τέλος, στη θέση του δρομέα ή αντικατάσταση της επιλογής ή ολόκληρου του εγγράφου." + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "Πεδίο εφαρμογής" + +#: C/gedit.xml:1542(para) +msgid "Determines which sort of documents can be affected by the command, for example whether saved or not, and local or remote." +msgstr "Καθορίζει τι είδους έγγραφα μπορούν να επηρεαστούν από την εντολή, π.χ. αν θα είναι αποθηκευμένα ή όχι, τοπικά ή απομακρυσμένα." + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "Επεξεργασία και αφαίρεση εργαλείων" + +#: C/gedit.xml:1551(para) +msgid "To edit a tool, select it in the list and make changes to its properties." +msgstr "Για να επεξεργασθείτε ένα εργαλείο, επιλέξτε το από τη λίστα και αλλάξτε τις ιδιότητές του." + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "Για να μετονομάσετε ένα εργαλείο, κάντε του ξανά κλικ στη λίστα." + +#: C/gedit.xml:1553(para) +msgid "To restore a built-in tool that you have changed, press Revert." +msgstr "Για να επαναφέρετε ένα ενσωματωμένο εργαλείο που έχετε αλλάξει, πατήστε Επαναφορά." + +#: C/gedit.xml:1554(para) +msgid "To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created yourself." +msgstr "Για να αφαιρέσετε ένα εργαλείο, επιλέξτε το στη λίστα και πατήστε Αφαίρεση. Δεν μπορείτε να αφαιρέσετε ενσωματωμένα εργαλεία, μόνο αυτά που έχετε δημιουργήσει μόνοι σας." + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "Μεταβλητές" + +#: C/gedit.xml:1559(para) +msgid "You can use the following variables in the Commands field of the command definition:" +msgstr "Μπορείτε να χρησιμοποιήσετε τις ακόλουθες μεταβλητές στο πεδίο Εντολές στον ορισμό εντολών:" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "Πρόσθετο περιηγητή αρχείων" + +#: C/gedit.xml:1588(para) +msgid "The File Browser Plugin shows your files and folders in the side pane, allowing you to quickly open files." +msgstr "Το πρόσθετο Πειρηγητής αρχείων σας δείχνει τα αρχεία και τους φακέλους σε ένα πλευρικό πλαίσιο, επιτρέποντάς σας να ανοίξετε γρήγορα αρχεία." + +#: C/gedit.xml:1589(para) +msgid "To view the File Browser, choose ViewSide Pane and then click on the tab showing the File Browser icon at the bottom of the side pane." +msgstr "Για να προβάλετε τον περιηγητή αρχείων, επιλέξτε ΠροβολήΠλευρικό πλαίσιο και μετά κάντε κλικ στην καρτέλα που δείχνει το εικονίδιο του περιηγητή αρχείων στο πλευρικό πλαίσιο." + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "Περιήγηση στα αρχεία σας" + +#: C/gedit.xml:1592(para) +msgid "The File Browser tab initially shows your file manager bookmarks. To browse the contents of any item, double-click it." +msgstr "Η καρτέλα του περιηγητή αρχείων αρχικά δείχνει τους σελιδοδείκτες του διαχειριστή αρχείων σας. Για να περιηγηθείτε στα περιεχόμενα οποιουδήποτε αντικειμένου κάντε διπλό κλικ σε αυτό." + +#: C/gedit.xml:1593(para) +msgid "To show a parent folder, choose from the drop-down list, or press the up arrow on the File Browser's toolbar." +msgstr "Για να εμφανίσετε ένα γονικό φάκελο, επιλέξτε από τη λίστα ή πατήστε το πάνω βέλος στη γραμμή εργαλείων του περιηγητή αρχείων." + +#: C/gedit.xml:1594(para) +msgid "To show the folder that contains the document you are currently working on, right-click in the file list and choose Set root to active document." +msgstr "Για να εμφανίσετε το φάκελο που περιέχει το έγγραφο στο οποίο ήδη εργάζεστε, κάντε δεξί κλικ στη λίστα αρχείων και επιλέξτε Ορισμός του ριζικού στο ενεργό έγγραφο." + +#: C/gedit.xml:1598(para) +msgid "To open a file in gedit, double-click it in the file list." +msgstr "Για να ανοίξετε ένα αρχείο στο gedit, κάντε διπλό κλικ σε αυτό στη λίστα." + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "Δημιουργία αρχείων και φακέλων" + +#: C/gedit.xml:1602(para) +msgid "To create a new, empty text file in the current folder shown in the browser, right-click in the file list and choose New File." +msgstr "Για να δημιουργήσετε ένα νέο, κενό αρχείο κειμένου στον τρέχοντα φάκελο που φαίνεται στον περιηγητή, κάντε δεξί κλικ στη λίστα αρχείων και επιλέξτε Νέο αρχείο." + +#: C/gedit.xml:1603(para) +msgid "To create a new folder in the current folder shown in the browser, right-click in the file list and choose New Folder." +msgstr "Για να δημιουργήσετε ένα νέο φάκελο μέσα στον τρέχοντα φάκελο που φαίνεται στον περιηγητή, κάντε δεξί κλικ στη λίστα αρχείων και επιλέξτε Νέος φάκελος." + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "Πρόσθετο εσοχής γραμμών" + +#: C/gedit.xml:1609(para) +msgid "The Indent Lines plugin adds or removes space from the beginning of lines of text." +msgstr "Το πρόσθετο Εσοχή γραμμών προσθέτει ή αφαιρεί διάστημα από την αρχή των γραμμών κειμένου." + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Για να προσθέσετε ή να αφαιρέσετε εσοχή σε κείμενο, ακολουθήστε τα εξής βήματα:" + +#: C/gedit.xml:1612(para) +msgid "Select the lines that you want to indent. To indent or unindent a single line, place the cursor anywhere on that line." +msgstr "Επιλέξτε τις γραμμές που θέλετε να εργασθείτε. Για να προσθέσετε ή να αφαιρέσετε την εσοχή από μία μόνο γραμμή, τοποθετήστε το δρομέα σε αυτή τη γραμμή." + +#: C/gedit.xml:1617(para) +msgid "To indent the text, choose EditIndent." +msgstr "Για να προσθέσετε εσοχή στο κείμενο, επιλέξτε επεξεργασίαΕσοχή." + +#: C/gedit.xml:1620(para) +msgid "To remove the indentation, choose EditUnindent." +msgstr "Για να αφαιρέσετε την εσοχή από το κείμενο, επιλέξτε επεξεργασίαΑφαίρεση Εσοχής." + +#: C/gedit.xml:1625(para) +msgid "The amount of space used, and whether tab character or space characters are used, depends on the Tab Stops settings in the Editor Preferences: see ." +msgstr "Το μέγεθος του διαστήματος που θα χρησιμοποιηθεί καθώς και αν θα χρησιμοποιηθούν χαρακτήρες στηλοθέτη ή χαρακτήρες κενού διαστήματος, εξαρτάται από την επιλογή Στηλοθέτες στις ρυθμίσεις των Προτιμήσεων επεξεργαστή: δείτε το ." + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "Πρόσθετο εισαγωγής ημερομηνίας/ώρας" + +#: C/gedit.xml:1631(para) +msgid "The Insert Date/Time plugin inserts the current date and time into a document. To use the Insert Date/Time plugin, perform the following steps:" +msgstr "Το πρόσθετο Εισαγωγή ημερομηνίας/ώρας εισάγει την τρέχουσα ημερομηνία και ώρα σε ένα έγγραφο. Για να κάνετε χρήση του προσθέτου ακολουθήστε τα εξής βήματα:" + +#: C/gedit.xml:1633(para) +msgid "Choose EditInsert Date and Time." +msgstr "Επιλέξτε ΕπεξεργασίαΕισαγωγή ημερομηνίας και ώρας." + +#: C/gedit.xml:1634(para) +msgid "If you have not configured the Insert Date/Time plugin to automatically insert the date/time without prompting you for the format, gedit displays the Insert Date and Time dialog. Select the appropriate date/time format from the list. Click Insert to close the Insert Date and Time dialog. gedit inserts the date/time at the cursor position in the current file." +msgstr "Αν δεν έχετε ρυθμίσει το πρόσθετο Εισαγωγή ημερομηνίας/ώρας να εισάγει αυτόματα την ημερομηνία/ώρα χωρίς να σας ρωτά για τη μορφή, το gedit εμφανίζει το παράθυρο διαλόγου Εισαγωγή ημερομηνίας και ώρας. Επιλέξτε την κατάλληλη μορφοποίηση ημερομηνίας/ώρας από τη λίστα. Κάντε κλικ στο κουμπί Εισαγωγή για κλείσετε το παράθυρο διαλόγου Εισαγωγή ημερομηνίας και ώρας. Το gedit εισάγει την ημερομηνία/ώρα στη θέση του δρομέα στο τρέχον αρχείο." + +#: C/gedit.xml:1635(para) +msgid "If you have configured gedit to use one particular date/time format, the Insert Date and Time dialog is not displayed. The date/time is automatically entered at the cursor position in the current file." +msgstr "Αν έχετε ρυθμίσει το gedit να χρησιμοποιεί μια συγκεκριμένη μορφοποίηση ημερομηνίας/ώρας, το παράθυρο διαλόγου Εισαγωγή ημερομηνίας και ώρας δεν εμφανίζεται. Το gedit εισάγει αυτόματα την ημερομηνία/ώρα στη θέση του δρομέα στο τρέχον αρχείο." + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Ρύθμιση του πρόσθετου Εισαγωγή ημερομηνίας/ώρας" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Για να ρυθμίσετε το πρόσθετο Εισαγωγή ημερομηνίας/ώρας, κάντε τα ακόλουθα:" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Επιλέξτε το πρόσθετο Εισαγωγή ημερομηνίας/ώρας." + +#: C/gedit.xml:1652(para) +msgid "Click Configure Plugin to display the Configure insert date/time plugin dialog." +msgstr "Κάντε κλικ στο Προσαρμογή προσθέτου για να εμφανίσετε το παράθυρο διαλόγου Ρύθμιση προσθέτου Εισαγωγή ημερομηνίας/ώρας." + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "Επιλέξτε ένα από τα ακόλουθα:" + +#: C/gedit.xml:1657(para) +msgid "To specify the date/time format each time you insert the date/time, select the Prompt for a format option." +msgstr "Για να ορίσετε τη μορφή ημερομηνίας/ώρας κάθε φορά που εισάγετε την ημερομηνία/ώρα, επιλέξτε το Ερώτημα για μορφή." + +#: C/gedit.xml:1660(para) +msgid "To use the same gedit-provided date/time format each time you insert the date/time, select the Use the selected format option, then select the appropriate format from the list. When you select this option, gedit does not prompt you for the date/time format when you choose EditInsert Date and Time." +msgstr "Για να χρησιμοποιήσετε την ίδια μορφή ημερομηνίας/ώρας όπως παρέχεται από το gedit, κάθε φορά που τις εισάγετε, επιλέξτε το Χρήση της επιλεγμένης μορφοποίησης και μετά επιλέξτε την κατάλληλη μορφοποίηση από τη λίστα. Όταν κάνετε αυτή την επιλογή, το gedit δεν σας ερωτά για τη μορφή ημερομηνίας/ώρας όταν επιλέγετε ΕπεξεργασίαΕισαγωγή ημερομηνίας και ώρας." + +#: C/gedit.xml:1663(para) +msgid "To use the same customized date/time format each time you insert the date/time, select the Use custom format option, then enter the appropriate format in the text box. For more information about how to specify a custom format, see strftime3. When you select this option, gedit does not prompt you for the date/time format when you choose EditInsert Date and Time." +msgstr "Για να χρησιμοποιήσετε την ίδια προσαρμοσμένη μορφή ημερομηνίας/ώρας κάθε φορά που την εισάγετε, επιλέξτε το Χρήση προσαρμοσμένης μορφής και μετά εισάγετε την επιθυμητή μορφή στο πεδίο κειμένου. Για περισσότερες πληροφορίες σχετικά με τον ορισμό μιας προσαρμοσμένης μορφοποίησης δείτε το strftime3. Όταν κάνετε αυτή την επιλογή, το gedit δεν σας ρωτάει για τη μορφή της ημερομηνίας/ώρας όταν επιλέγετε ΕπεξεργασίαΕισαγωγή ημερομηνίας και ώρας." + +#: C/gedit.xml:1668(para) +msgid "Click OK to close the Configure insert date/time plugin dialog." +msgstr "Πατήστε OK για να κλείσετε το παράθυρο διαλόγου Προσαρμογή προσθέτου Εισαγωγή ημερομηνίας/ώρας." + +#: C/gedit.xml:1671(para) +msgid "To close the Preferences dialog, click Close." +msgstr "Για να κλείσετε το παράθυρο διαλόγου Προτιμήσεις, κάντε κλικ στο Κλείσιμο." + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Πρόσθετο Modelines" + +#: C/gedit.xml:1679(para) +msgid "The Modelines plugin allows you to set preferences for individual documents. A modeline is a line of text at the start or end of the document with settings that gedit recognises." +msgstr "Το πρόσθετο Modelines σας επιτρέπει να ορίσετε προτιμήσεις για συγκεκριμένα έγγραφα. Μια modeline είναι μια γραμμή κειμένου στην αρχή ή το τέλος του εγγράφου με ρυθμίσεις που αναγνωρίζει το gedit." + +#: C/gedit.xml:1680(para) +msgid "Preferences set using modelines take precedence over the ones specified in the preference dialog." +msgstr "Οι προτιμήσεις που ορίζονται με τις modelines υπερισχύουν αυτών που καθορίζονται στο παράθυρο διαλόγου προτιμήσεις." + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "Μπορείτε να ορίσετε τις ακόλουθες προτιμήσεις με modelines:" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Πλάτος στηλοθέτη" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "Πλάτος εσοχής" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "Εισαγωγή κενών διαστημάτων αντί στηλοθετών" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "Πλάτος δεξιού περιθωρίου" + +#: C/gedit.xml:1700(para) +msgid "The Modelines plugin supports a subset of the options used by other text editors Emacs, Kate and Vim." +msgstr "Το πρόσθετο Modelines υποστηρίζει ένα υποσύνολο των επιλογών που χρησιμοποιούνται από άλλους επεξεργαστές κειμένου, τους Emacs, Kate και Vim." + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Emacs Modelines" + +#: C/gedit.xml:1704(para) +msgid "The first two lines of a document are scanned for Emacs modelines." +msgstr "Οι πρώτες δύο γραμμές ενός κειμένου σαρώνονται για Emacs modelines." + +#: C/gedit.xml:1705(para) +msgid "The Emacs options for tab-width, indent-offset, indent-tabs-mode and autowrap are supported. For more information, see the GNU Emacs Manual." +msgstr "Υποστηρίζονται οι επιλογές του Emacs για πλάτος στηλοθέτη, εσοχή, εσοχή στηλοθετών και αυτόματη αναδίπλωση. Για περισσότερες πληροφορίες δείτε το GNU Emacs Manual." + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Kate Modelines" + +#: C/gedit.xml:1709(para) +msgid "The first and last ten lines a document are scanned for Kate modelines." +msgstr "Η πρώτη και οι τελευταίες δέκα γραμμές ενός κειμένου σαρώνονται για Kate modelines." + +#: C/gedit.xml:1710(para) +msgid "The Kate options for tab-width, indent-width, space-indent, word-wrap and word-wrap-column are supported. For more information, see the Kate website." +msgstr "Υποστηρίζονται οι επιλογές του Kate για πλάτος στηλοθέτη, εσοχή με διαστήματα, αναδίπλωση λέξης και αναδίπλωση λέξης σε στήλη. Για περισσότερες πληροφορίες δείτε το Kate website." + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Vim Modelines" + +#: C/gedit.xml:1714(para) +msgid "The first and last three lines a document are scanned for Vim modelines." +msgstr "Η πρώτη και οι τελευταίες τρεις γραμμές ενός κειμένου σαρώνονται για Vim modelines." + +#: C/gedit.xml:1715(para) +msgid "The Vim options for et, expandtab, ts, tabstop, sw, shiftwidth, wrap, and textwidth are supported. For more information, see the Vim website." +msgstr "Υποστηρίζονται οι επιλογές του vim για et, expandtab, ts, tabstop, sw, shiftwidth, wrap, και textwidth. Για περισσότερες πληροφορίες δείτε το Vim website." + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Πρόσθετο κονσόλας Python" + +#: C/gedit.xml:1721(para) +msgid "The Python Console Plugin allows you to run commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows recent output and a command prompt field." +msgstr "Το πρόσθετο Κονσόλα Python σας επιτρέπει να εκτελείτε εντολές της γλώσσας προγραμματισμού Python από το gedit. Η ενεργοποίηση του προσθέτου προσθέτει μια καρτέλα στο κάτω πλαίσιο. Αυτή δείχνει τα πρόσφατα αποτελέσματα και ένα πεδίο γραμμής εντολών." + +#: C/gedit.xml:1722(para) +msgid "Commands entered into the python console are not checked before they are run. It is therefore possible to hang gedit, for example by entering an infinite loop." +msgstr "Οι εντολές που εισάγονται στην κονσόλα της python δεν ελέγχονται πριν εκτελεσθούν. Επομένως, είναι δυνατόν να \"κρεμάσει\" το gedit, π.χ. εισάγοντας έναν ατέρμονα βρόγχο." + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "Πρόσθετο αποσπασμάτων κειμένου (snippets)" + +#: C/gedit.xml:1727(para) +msgid "The Snippets plugin allows you to store frequently-used pieces of text, called snippets, and insert them quickly into a document." +msgstr "Το πρόσθετο Snippets σας επιτρέπει να αποθηκεύσετε συχνά χρησιμοποιούμενα τμήματα κειμένου, αποκαλούμενα αποσπάσματα (snippets) και να εισάγετε γρήγορα σε ένα έγγραφο." + +#: C/gedit.xml:1728(para) +msgid "Snippets are specific to the language syntax of the current document. For example, when you are working with an HTML document, you can choose from a list of snippets that are useful for HTML. In addition, some snippets are global, and are available in all documents." +msgstr "Τα αποσπάσματα (snippets) είναι εξειδικευμένα για το συντακτικό της γλώσσας του τρέχοντος εγγράφου. Π.χ. όταν εργάζεσται με ένα έγγραφο σε HTML μπορείτε να επιλέξετε από μια λίστα snippets που χρησιμοποιούνται στην HTML. Επιπλέον, μερικά αποσπάσματα έχουν καθολική ισχύ και είναι διαθέσιμα σε όλα τα έγγραφα." + +#: C/gedit.xml:1729(para) +msgid "A number of built-in snippets are installed with gedit, which can be modified." +msgstr "Με το gedit, εγκαθιστάται και ένας αριθμός ενσωματωμένων αποσπασμάτων, τα οποία μπορούν να τροποποιηθούν." + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "Εισαγωγή Αποσπασμάτων (Snippets)" + +#: C/gedit.xml:1733(para) +msgid "To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is usually the first few letters of the snippet, or something else that is short and easy to remember." +msgstr "Για να εισάγετε ένα απόσπασμα (snippet) σε ένα έγγραφο, πληκτρολογείστε το έναυσμα tab του και πατήστε Tab. Συνήθως αυτό είναι τα πρώτα γράμματα του αποσπάσματος ή κάτι άλλο σύντομο και εύκολο στην απομνημόνευση." + +#: C/gedit.xml:1734(para) +msgid "Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "Εναλλακτικά, πατήστε CtrlSpace για δείτε μια λίστα αποσπασμάτων που μπορείτε να εισάγετε." + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "Προσθήκη αποσπασμάτων" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "Για να δημιουργήσετε ένα καινούριο απόσπασμα, κάντε τα ακόλουθα:" + +#: C/gedit.xml:1742(para) +msgid "Choose ToolsManage Snippets. The Snippets Manager window opens." +msgstr "Επιλέξτε ΕργαλείαΔιαχείριση Αποσπασμάτων." + +#: C/gedit.xml:1745(para) +msgid "The list of snippets is grouped by language. Select the language you want to add a snippet to, or a snippet in that language group. To add a snippet for all languages, choose Global at the top of the list. The syntax of the document you are currently working with is shown by default." +msgstr "Η λίστα αποσπασμάτων είναι ομαδοποιημένη κατά γλώσσα. Επιλέξτε τη γλώσσα στην οποία επιθυμείτε να προσθέσετε ένα απόσπασμα ή ένα απόσπασμα σε αυτή την ομάδα. Για να προσθέσετε ένα απόσπασμα σε όλες τις γλώσσες, επιλέξτε Καθολικό στην κορυφή της λίστας. Η σύνταξη του εγγράφου στο οποίο εργάζεστε εμφανίζεται από προεπιλογή." + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "Κάντε κλικ στο Νέο. Ένα νέο απόσπασμα εμφανίζεται στη λίστα." + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "Εισάγετε τις ακόλουθες πληροφορίες για το νέο απόσπασμα:" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "Όνομα" + +#: C/gedit.xml:1755(para) +msgid "Enter a name for the snippet in the text field within the snippet list. The name of a snippet serves only as a reminder of its purpose. You can change name of a snippet you create by clicking on it in the list." +msgstr "Εισάγετε ένα όνομα για το απόσπασμα στο πεδίο κειμένου εντός της λίστας. Το όνομα του αποσπάσματος εξυπηρετεί μόνο ως υπενθύμιση του σκοπού του. Μπορείτε να αλλάξετε το όνομα ενός αποσπάσματος που δημιουργήσατε κάνοντας κλικ σε αυτό στη λίστα." + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "Κείμενο αποσπάσματος" + +#: C/gedit.xml:1760(para) +msgid "Enter the text of the snippet in the Edit snippet text box. For special codes you can use, see ." +msgstr "Εισάγετε το κείμενο του αποσπάσματος στο πεδίο κειμένου Επεξεργασία αποσπάσματος. Για ειδικούς κώδικες που μπορείτε να χρησιμοποιήσετε, δείτε το ." + +#: C/gedit.xml:1761(para) +msgid "You can switch back to the document window to copy text without closing the Snippets Manager window." +msgstr "Μπορείτε να επιστρέψετε στο παράθυρο του εγγράφου για να αντιγράψετε κείμενο χωρίς να κλείσετε το παράθυρο της Διαχείρισης αποσπασμάτων." + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Έναυσμα Tab (Tab Trigger)" + +#: C/gedit.xml:1766(para) +msgid "Enter the tab trigger for the snippet. This is the text that you type before pressing Tab to insert the snippet." +msgstr "Εισάγετε το έναυσμα για το πλήκτρο tab του αποσπάσματος. Αυτό είναι το κείμενο που πληκτρολογείτε πριν πατήσετε το πλήκτρο Tab για να εισάγετε το απόσπασμα." + +#: C/gedit.xml:1767(para) +msgid "The tag must be either a single word comprising only letters, or any single character. The Tab trigger will highlight in red if an invalid tab trigger is entered." +msgstr "Η ετικέτα πρέπει να είναι είτε μία μόνο λέξη αποτελούμενη μόνο από γράμματα ή οποιοσδήποτε ένας χαρακτήρας. Το Έναυσμα Tab θα επισημανθεί με κόκκινο αν εισαχθεί μη επιτρεπόμενο έναυσμα." + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "Πλήκτρο συντόμευσης" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Δώστε ένα πλήκτρο συντόμευσης για την εισαγωγή του αποσπάσματος." + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "Επεξεργασία και αφαίρεση αποσπασμάτων" + +#: C/gedit.xml:1782(para) +msgid "To edit a snippet, select it in the list and make changes to its text and activation properties." +msgstr "Για να επεξεργασθείτε ένα απόσπασμα, επιλέξτε το στη λίστα και κάντε αλλαγές στο κείμενό του και στις ιδιότητες ενεργοποίησής του." + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Για να μετονομάσετε ένα απόσπασμα, κάντε ξανά κλικ σε αυτό στη λίστα." + +#: C/gedit.xml:1784(para) +msgid "To restore a built-in snippet that you have changed, press Revert." +msgstr "Για να αποκαταστήσετε ένα ενσωματωμένο απόσπασμα στο οποίο έχετε κάνει αλλαγές, πατήστε Επαναφορά." + +#: C/gedit.xml:1785(para) +msgid "To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have created yourself." +msgstr "Για να αφαιρέσετε ένα απόσπασμα, επιλέξτε το από τη λίστα και πατήστε Αφαίρεση. Δεν μπορείτε να αφαιρέσετε τα ενσωματωμένα αποσπάσματα, μόνο αυτά που έχετε δημιουργήσει οι ίδιοι." + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "Υποκαταστάσεις αποσπασμάτων" + +#: C/gedit.xml:1790(para) +msgid "In addition to inserting stored text, a snippet can include customizable text, or mark spaces where you can add text once the snippet is inserted in your document." +msgstr "Επιπλέον της εισαγωγής αποθηκευμένου κειμένου, ένα απόσπασμα μπορεί να περιέχει προσαρμόσιμο κείμενο ή σημειωμένα διαστήματα όπου μπορείτε να προσθέσετε κείμενο μόλις το απόσπασμα εισαχθεί στο έγγραφό σας." + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "Μπορείτε να χρησιμοποιήσετε τους ακόλουθες κώδικες κράτησης θέσης στο κείμενο των αποσπασμάτων σας:" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Θέσεις στηλοθέτη (Tab)" + +#: C/gedit.xml:1798(para) +msgid "$n defines a tab placeholder, where n is any number from 1 upwards." +msgstr "$n, καθορίζει μια θέση στηλοθέτη, όπου n οποιοσδήποτε αριθμός από το 1 και άνω." + +#: C/gedit.xml:1799(para) +msgid "${n:default} defines a tab placeholder with a default value." +msgstr "${n:default}, καθορίζει μια θέση στηλοθέτη με προκαθορισμένη τιμή." + +#: C/gedit.xml:1800(para) +msgid "A tab placeholder marks a place in the snippet text where you can add extra text after the snippet is inserted." +msgstr "Μια θέση κράτησης στηλοθέτη υποδεικνύει ένα σημείο στο κείμενο του αποσπάσματος όπου μπορείτε να εισάγετε επιπλέον κείμενο μετά την εισαγωγή του αποσπάσματος." + +#: C/gedit.xml:1801(para) +msgid "To use tab placeholders, insert the snippet as normal. The cursor is placed at the first tab placeholder. Type text, and press Tab to advance to the next tab placeholder. The number in the placeholder code defines the order in which tab advances to each place in the text." +msgstr "Για να χρησιμοποιήσετε θέσεις κράτησης στηλοθετών, εισάγετε το απόσπασμα κανονικά. Πληκτρολογήστε το κείμενο και πατήστε το Tab για να μεταβείτε στην επόμενη θέση στηλοθέτη. Ο αριθμός στον κώδικα του στηλοθέτη καθορίζει τη σειρά μετάβασης σε κάθε θέση στο κείμενο." + +#: C/gedit.xml:1802(para) +msgid "Press ShiftTab to return to the previous tab placeholder. Pressing Tab when there are no more tab placeholders moves the cursor to the end of the snippet text, or to the end placeholder if it exists." +msgstr "Πατήστε ShiftTab για να επιστρέψετε στην προηγούμενη θέση. Το πάτημα του Tab όταν δεν υπάρχουν άλλες θέσεις μετακινεί το δρομέα στο τέλος του κειμένου του αποσπάσματος ή στη θέση τέλους αν υπάρχει." + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Επαναλαμβανόμενες θέσεις κράτησης" + +#: C/gedit.xml:1807(para) +msgid "A repeated tab placeholder will mirror the placeholder already defined. This allows you to type in text only once that you want to appear several times in the snippet." +msgstr "Μια επαναλαμβανόμενη κράτηση στηλοθέτη θα αντικατοπτρίζει τη θέση που έχει ήδη καθοριστεί. Αυτό σας επιτρέπει να πληκτρολογείτε μόνο μια φορά κείμενο που επιθυμείτε να εμφανίζεται πολλές φορές στο απόσπασμα." + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "Θέση κράτησης τέλους" + +#: C/gedit.xml:1812(para) +msgid "$0 defines the end placeholder. This allows you to finish working with the snippet with the cursor at a point other than the end of the snippet text." +msgstr "$0, καθορίζει τη θέση κράτησης τέλους. Αυτό σας επιτρέπει να τελειώνετε την εργασία σας με το απόσπασμα με το δρομέα σε σημείο άλλο από το τέλος του κειμένου του αποσπάσματος." + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "Μεταβλητές περιβάλλοντος" + +#: C/gedit.xml:1817(para) +msgid "Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific to gedit can also be used:" +msgstr "Μεταβλητές περιβάλλοντος όπως $PATH και $HOME αντικαθίστανται στο κείμενο του αποσπάσματος. Οι ακόλουθες μεταβλητές, ειδικές για το gedit, μπορούν επίσης να χρησιμοποιηθούν:" + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "Η τρέχουσα επιλογή κειμένου." + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "The full filename of the document, or an empty string if the document isn't saved yet." +msgstr "Το πλήρες όνομα αρχείου του εγγράφου ή μια κενή αλληλουχία αν το έγγραφο δεν έχει αποθηκευθεί ακόμα." + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "The basename of the filename of the document, or an empty string if the document isn't saved yet." +msgstr "Το βασικό όνομα του ονόματος αρχείου του εγγράφου ή μια κενή αλληλουχία αν το έγγραφο δεν έχει αποθηκευθεί ακόμα." + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "The word at the cursor's location in the document. When this variable is used, the current word will be replaced by the snippet text." +msgstr "Η λέξη στη θέση του δρομέα στο έγγραφο. Όταν αυτή η μεταβλητή χρησιμοποιηθεί, η τρέχουσα λέξη θα αντικατασταθεί από το κείμενο του αποσπάσματος (snippet)." + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Θέσης κράτησης κελύφους" + +#: C/gedit.xml:1846(para) +msgid "$(cmd) is replaced by the result of executing cmd in a shell." +msgstr "$(cmd), αντικαθίσταται από το αποτέλεσμα της εκτέλεσης της cmd σε ένα κέλυφος." + +#: C/gedit.xml:1847(para) +msgid "$(n:cmd) allows you to give this placeholder a reference, where n is any number from 1 upwards. Use $n to use the output from one shell placeholder as input in another." +msgstr "$(n:cmd), σας επιτρέπει να δώσετε σε αυτή τη θέση κράτησης μια αναφορά, όπου το n είναι οποιοσδήποτε αριθμός από το 1 και άνω. Χρησιμοποιήστε το $n για να χρησιμοποιήσετε το αποτέλεσμα από μια θέση κράτησης κελύφους ως είσοδο σε μια άλλη." + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Θέσεις κράτησης της Python" + +#: C/gedit.xml:1852(para) +msgid "$<cmd> is replaced by the result of evaluating cmd in the python interpreter." +msgstr "$<cmd>, αντικαθίσταται από το αποτέλεσμα της αξιολόγησης της cmd στο μεταφραστή της python." + +#: C/gedit.xml:1853(para) +msgid "$<a:cmd> specifies another python placeholder as a dependency, where a gives its order in the snippet. This allows you to use python functions defined in another snippet. To specify several dependencies, separate the numbers with commas thus: $<a,b:cmd>" +msgstr "$<a:cmd>, καθορίζει μια άλλη θέση κράτησης της python ως εξάρτηση, όπου το a ορίζει τη σειρά του στο απόσπασμα. Αυτό σας επιτρέπει να χρησιμοποιείτε λειτουργίες της python που ορίζονται σε άλλο απόσπασμα. Για να ορίσετε πολλές εξαρτήσεις, χωρίστε τους αριθμούς με κόμματα, όπως: $<a,b:cmd>" + +#: C/gedit.xml:1854(para) +msgid "To use a variable in all other python snippets, declare it as global." +msgstr "Για να χρησιμοποιήσετε μια μεταβλητή σε όλα τα άλλα αποσπάσματα της python, δηλώστε τη ως καθολική." + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "Πρόσθετο Ταξινόμηση" + +#: C/gedit.xml:1864(para) +msgid "The Sort plugin arranges selected lines of text into alphabetical order." +msgstr "Το πρόσθετο Ταξινόμηση διευθετεί τις επιλεγμένες γραμμές κειμένου σε αλφαβητική σειρά." + +#: C/gedit.xml:1865(para) +msgid "You cannot undo the Sort operation, so you should save the file before performing the sort. To revert to the saved version of the file after the sort operation, choose FileRevert." +msgstr "Δεν μπορείτε να αναιρέσετε την Ταξινόμηση, έτσι θα πρέπει να αποθηκεύετε το αρχείο πριν κάνετε την ταξινόμηση. Για να επαναφέρετε την αποθηκευμένη έκδοση του αρχείου μετά την ταξινόμηση, επιλέξτε ΑρχείοΕπαναφορά." + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Για να χρησιμοποιήσετε το πρόσθετο Ταξινόμηση, κάντε τα ακόλουθα:" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "Επιλέξτε τις γραμμές κειμένου που θέλετε να ταξινομήσετε." + +#: C/gedit.xml:1873(para) +msgid "Choose EditSort. The Sort dialog opens." +msgstr "Επιλέξτε ΕπεξεργασίαΤαξινόμηση. Ανοίγει το παράθυρο διαλόγου Ταξινόμηση." + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "Επιλέξτε τους ακόλουθους τρόπους ταξινόμησης:" + +#: C/gedit.xml:1879(para) +msgid "To arrange the text in reverse order, select Reverse order." +msgstr "Για να ταξινομήσετε το κείμενο με ανάστροφη σειρά, επιλέξτε Ανάστροφη σειρά." + +#: C/gedit.xml:1882(para) +msgid "To delete duplicate lines, select Remove duplicates." +msgstr "Για να διαγράψετε διπλές γραμμές, επιλέξτε Αφαίρεση διπλών γραμμών." + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "Για αγνοήσετε τα πεζά - κεφαλαία, επιλέξτε Να αγνοούνται πεζά - κεφαλαία." + +#: C/gedit.xml:1888(para) +msgid "To have the sort ignore the characters at the start of the lines, set the first character that should be used for sorting in the Start at column spin box." +msgstr "Για να αγνοεί η ταξινόμηση τον πρώτο χαρακτήρα στην αρχή των γραμμών, ορίστε τον πρώτο χαρακτήρα που θα χρησιμοποιηθεί για την ταξινόμηση στο αριθμητικό πεδίο Έναρξη στη στήλη." + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "Για να εκτελεστεί η ταξινόμηση, κάντε κλικ στο Ταξινόμηση." + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "Πρόσθετο ελέγχου ορθογραφίας" + +#: C/gedit.xml:1901(para) +msgid "The Spell Checker plugin checks the spelling in the selected text. You can configure gedit to check the spelling automatically, or you can check the spelling manually, in the specified language. The language setting, and the autocheck spelling properties, apply per document. To use the Spell checker plugin, perform the following steps:" +msgstr "Το πρόσθετο Έλεγχος ορθογραφίας ελέγχει την ορθογραφία στο επιλεγμένο κείμενο. Μπορείτε να διαμορφώσετε το gedit να ελέγχει αυτόματα την ορθογραφία ή μπορείτε να ελέγξετε την ορθογραφία χειροκίνητα, στην επιλεγμένη γλώσσα. Η ρύθμιση γλώσσας και οι ιδιότητες του αυτόματου ορθογραφικού ελέγχου ισχύουν σε έγγραφο ξεχωριστά. Για να χρησιμοποιήσετε το πρόσθετο Ορθογραφικός έλεγχος, κάντε τα ακόλουθα:" + +#: C/gedit.xml:1903(para) +msgid "Choose ToolsSet Language to display the Set language dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "Επιλέξτε ΕργαλείαΡύθμιση γλώσσας για να εμφανίσετε το παράθυρο διαλόγου Ρύθμιση γλώσσας. Επιλέξτε την κατάλληλη γλώσσα από τη λίστα. Κάντε κλικ στο OK για να κλείσετε το παράθυρο διαλόγου Ρύθμιση γλώσσας." + +#: C/gedit.xml:1906(para) +msgid "To check the spelling automatically, choose ToolsAutocheck Spelling. To unset the automatic spell check, choose ToolsAutocheck Spelling again. When automatic spell checking is set, an icon is displayed beside the Autocheck Spelling menu item. Automatic spell checking is unset by default, each time gedit starts." +msgstr "Για να γίνεται αυτόματος ορθογραφικός έλεγχος, επιλέξτε ΕργαλείαΑυτόματος ορθογραφικός έλεγχος. Για να αναιρέσετε τον αυτόματο ορθογραφικό έλεγχο, επιλέξτε ξανά ΕργαλείαΑυτόματος ορθογραφικός έλεγχος. Όταν έχει ορισθεί αυτόματος ορθογραφικός έλεγχος, εμφανίζεται ένα εικονίδιο δίπλα στην καταχώρηση μενού Αυτόματος ορθογραφικός έλεγχος. Ο αυτόματος ορθογραφικός έλεγχος δεν είναι ενεργοποιημένος ως προεπιλογή κατά την εκκίνηση του gedit." + +#: C/gedit.xml:1907(para) +msgid "Unknown spellings are displayed in a different color, and underlined. Right-click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "Πιθανά ορθογραφικά λάθη επισημαίνονται με διαφορετικό χρώμα και υπογραμμίζονται. Κάντε δεξί κλικ σε ένα πιθανό ορθογραφικό λάθος και επιλέξτε Προτάσεις ορθογραφίας από το αναδυόμενο μενού:" + +#: C/gedit.xml:1910(para) +msgid "To replace the unknown spelling with another spelling in the list, select the replacement spelling from the Spelling Suggestions popup menu." +msgstr "Για να αντικαταστήσετε το πιθανό λάθος με μια λέξη της λίστας, επιλέξτε την από το αναδυόμενο μενού." + +#: C/gedit.xml:1913(para) +msgid "To add the unknown spelling to your personal dictionary, select Spelling SuggestionsAdd." +msgstr "Για να προσθέσετε την επισημασμένη λέξη ως ορθή στο προσωπικό σας λεξικό, επιλέξτε Προτάσεις ορθογραφίαςΠροσθήκη." + +#: C/gedit.xml:1916(para) +msgid "To ignore all occurrences of the unknown spelling, so that they are no longer flagged as unknown but are not added to your personal dictionary, select Spelling SuggestionsIgnore All. The unknown word is ignored in the current gedit session only." +msgstr "Για να αγνοήσετε όλες τις περιπτώσεις εμφάνισης της πιθανά λανθασμένης λέξης, ώστε να μην επισημαίνονται αλλά να μην προστεθεί στο προσωπικό σας λεξικό, επιλέξτε Προτάσεις ορθογραφίαςΠαράβλεψη όλων. Η λέξη παραβλέπεται στην τρέχουσα μόνο συνεδρία του gedit." + +#: C/gedit.xml:1921(para) +msgid "To check the spelling manually, choose ToolsCheck Spelling." +msgstr "Για να ελέγξετε την ορθογραφία χειροκίνητα, επιλέξτε ΕργαλείαΈλεγχος ορθογραφίας." + +#: C/gedit.xml:1923(para) +msgid "If there are no spelling errors, an Information dialog displays a message stating that the document does not contain misspelled words. Click OK to close the Information dialog." +msgstr "Αν δεν υπάρχουν ορθογραφικά λάθη ένα παράθυρο διαλόγου Πληροφορίες εμφανίζει ένα μήνυμα που δηλώνει ότι το έγγραφο δεν περιέχει λέξεις με λάθη. Κάντε κλικ στο OK για να κλείσετε το παράθυρο διαλόγου Πληροφορίες." + +#: C/gedit.xml:1925(para) +msgid "If there are spelling errors, the Check Spelling dialog is displayed:" +msgstr "Αν υπάρχουν ορθογραφικά λάθη, εμφανίζεται το παράθυρο διαλόγου Έλεγχος ορθογραφίας:" + +#: C/gedit.xml:1928(para) +msgid "The Misspelled word is displayed at the top of the dialog." +msgstr "Στην κορυφή του παραθύρου διαλόγου εμφανίζεται το Ορθογραφικό λάθος." + +#: C/gedit.xml:1931(para) +msgid "A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by selecting a spelling from the Suggestions list, or you can enter text directly into the Change to text box." +msgstr "Μια προτεινόμενη ορθογραφία εμφανίζεται στο πεδίο κειμένου Αλλαγή σε. Μπορείτε να αντικαταστήσετε αυτή με μια άλλη γνωστή ορθογραφία επιλέγοντας από τη λίστα Προτάσεις ή μπορείτε να εισάγετε κείμενο απευθείας στο πεδίο κειμένου Αλλαγή σε." + +#: C/gedit.xml:1934(para) +msgid "To check the spelling of the text in the Change to text box, click Check Word. If this is a known word, the Suggestions list is replaced with the text (correct spelling). If the word is not known, new entries appear in the Suggestions list." +msgstr "Για να ελέγξετε την ορθογραφία του κειμένου στο πεδίο κειμένου Αλλαγή σε, κάντε κλικ στο Έλεγχος λέξης. Αν η λέξη είναι γνωστή, η λίστα Προτάσεις αντικαθίσταται με το κείμενο (σωστή ορθογραφία). Αν η λέξη είναι άγνωστη εμφανίζονται νέες καταχωρήσεις στη λίστα Προτάσεις." + +#: C/gedit.xml:1937(para) +msgid "To ignore the current occurrence of the unknown word, click Ignore. To ignore all occurrences of the unknown word, click Ignore All. The unknown word is ignored in the current gedit session only." +msgstr "Για να μη ληφθεί υπόψη η τρέχουσα περίπτωση εμφάνισης της άγνωστης λέξης, κάντε κλικ στο Παράβλεψη. Για να παραβλεφθούν όλες οι περιπτώσεις εμφάνισης της άγνωστης λέξης, κάντε κλικ στο Παράβλεψη όλων. Η άγνωστη λέξη παραβλέπεται για την τρέχουσα μόνο συνεδρία του gedit." + +#: C/gedit.xml:1940(para) +msgid "To change the current occurrence of the unknown word to the text in the Change to text box, click Change. To change all occurrences of the unknown word to the text in the Change to text box, click Change All." +msgstr "Για να αλλάξετε την τρέχουσα περίπτωση εμφάνιση της άγνωστης λέξης στο κείμενο στο πεδίο κειμένου Αλλαγή σε, κάντε κλικ στο Αλλαγή. Για να αλλάξετε όλες τις περιπτώσεις εμφάνισης της άγνωστης λέξης στο κείμενο στο πεδίο κειμένου Αλλαγή σε, κάντε κλικ στο Αλλαγή όλων." + +#: C/gedit.xml:1943(para) +msgid "To add the unknown word to your personal dictionary, click Add word." +msgstr "Για να προσθέσετε την άγνωστη λέξη στο προσωπικό σας λεξικό, κάντε κλικ στο Προσθήκη λέξης." + +#: C/gedit.xml:1946(para) +msgid "To close the Check Spelling dialog, click Close." +msgstr "Για να κλείσετε το παράθυρο διαλόγου Έλεγχος ορθογραφίας, κάντε κλικ στο Κλείσιμο." + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "Πρόσθετο Λίστα ετικετών (Tags)" + +#: C/gedit.xml:1956(para) +msgid "The Tag List plugin allows you to insert common tags from a list in the side pane." +msgstr "Το πρόσθετο Λίστα ετικετών σας επιτρέπει να εισάγετε κοινές ετικέτες από μια λίστα στο πλευρικό πλαίσιο." + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Για να χρησιμοποιήσετε το πρόσθετο Λίστα ετικετών, κάντε τα ακόλουθα:" + +#: C/gedit.xml:1959(para) +msgid "Choose ViewSide Pane." +msgstr "Επιλέξτε ΠροβολήΠλευρική εργαλειοθήκη." + +#: C/gedit.xml:1963(para) +msgid "By default, the side pane shows a tab containing a list of open documents. Click on the tab showing a + icon at the bottom of the side pane to show the tag list tab." +msgstr "Ως προεπιλογή, η πλευρική εργαλειοθήκη εμφανίζει μια καρτέλα που περιέχει μια λίστα των ανοιχτών εγγράφων. Κάντε κλικ στην καρτέλα που εμφανίζει ένα + στο τέλος της πλευρικής εργαλειοθήκης για εμφανίσετε την καρτέλα με τη λίστα ετικετών." + +#: C/gedit.xml:1965(para) +msgid "Select the appropriate tag category from the drop-down list. For example, HTML - Tags." +msgstr "Επιλέξτε την κατάλληλη κατηγορία ετικετών από την αναδυόμενη λίστα. Π.χ. Ετικέτες HTML." + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Κυλίστε τη λίστα ετικετών μέχρι να βρείτε την απαιτούμενη ετικέτα." + +#: C/gedit.xml:1971(para) +msgid "To insert a tag at the cursor position in the current file, double-click on the tag in the tag list. You can also insert a tag as follows:" +msgstr "Για εισάγετε μια ετικέτα στη θέση του δρομέα στο τρέχον αρχείο, κάντε διπλό κλικ στην ετικέτα στη λίστα ετικετών. Μπορείτε επίσης να εισάγετε μια ετικέτα ως εξής:" + +#: C/gedit.xml:1973(para) +msgid "To insert a tag in the current file and change the focus from the side pane to the display area, press Return." +msgstr "Για να εισάγετε μια ετικέτα στο τρέχον αρχείο και να αλλάξετε την εστίαση από την πλευρική εργαλειοθήκη στην περιοχή απεικόνισης, πατήστε Return." + +#: C/gedit.xml:1976(para) +msgid "To insert a tag in the current file and maintain the focus on the Tag list plugin window, press ShiftReturn." +msgstr "Για να εισάγετε μια ετικέτα στο τρέχον αρχείο και να παραμείνετε στο παράθυρο Πρόσθετο Λίστα ετικετών, πατήστε ShiftReturn." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Ελληνική μεταφραστική ομάδα MATE\n" +"Μάριος Ζηντίλης , 2009\n" +"Μιχαήλ Κοτσαρίνης, 2009 \n" +"Για περισσότερα δείτε http://www.mate.gr/" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Όνομα χρήστη, εισάγει το όνομα χρήστη του τρέχοντα χρήστη στο " +#~ "έγγραφο." +#~ msgid "User Name Plugin" +#~ msgstr "Πρόσθετο Όνομα χρήστη" +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "Το πρόσθετο Όνομα χρήστη εισάγει το όνομα " +#~ "χρήστη του τρέχοντα χρήστη στο έγγραφο." +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "Για να εισάγετε το όνομα χρήστη σας στη θέση του δρομέα, επιλέξτε " +#~ "ΕπεξεργασίαΕισαγωγή ονόματος " +#~ "χρήστη." + diff --git a/help/el/figures/gedit_window.png b/help/el/figures/gedit_window.png new file mode 100755 index 00000000..c82e067d Binary files /dev/null and b/help/el/figures/gedit_window.png differ diff --git a/help/es/es.po b/help/es/es.po new file mode 100755 index 00000000..f0501c24 --- /dev/null +++ b/help/es/es.po @@ -0,0 +1,4690 @@ +# translation of gedit.help.HEAD.po to Español +# translation of gedit manual to Spanish +# +# Francisco Javier F. Serrador , 2006. +# María Majadas , 2005. +# Jorge González , 2006, 2007, 2009, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit.help.HEAD\n" +"POT-Creation-Date: 2010-06-26 10:26+0000\n" +"PO-Revision-Date: 2010-06-28 20:51+0200\n" +"Last-Translator: Jorge González \n" +"Language-Team: Español \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" +"X-Generator: KBabel 1.11.4\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Se concede permiso para copiar, distribuir o modificar este documento según " +"las condiciones de la GNU Free Documentation License (GFDL), versión 1.1 o " +"cualquier versión posterior publicada por la Free Software Foundation, sin " +"Secciones invariantes, Textos de portada y Textos de contraportada. " +"Encontrará una copia de la GFDL en este enlace o en el archivo COPYING-DOCS distribuido con este 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 "" +"Este manual forma parte de una colección de documentos de MATE distribuidos " +"según la GFDL. Si desea distribuir este manual de forma independiente de la " +"colección, puede hacerlo agregando una copia de la licencia al documento, " +"según se describe en la sección 6 de la misma." + +#: 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 "" +"Muchos de los nombres utilizados por las empresas para distinguir sus " +"productos y servicios se consideran marcas comerciales. Cuando estos nombres " +"aparezcan en la documentación de MATE, y siempre que se haya informado a " +"los miembros del Proyecto de documentación de MATE de dichas marcas " +"comerciales, los nombres aparecerán en mayúsculas o con las iniciales en " +"mayúsculas." + +#: 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 " +"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 "" +"EL DOCUMENTO SE OFRECE «TAL CUAL», SIN GARANTÍA DE NINGÚN TIPO, EXPRESA O " +"IMPLÍCITA, INCLUYENDO, PERO SIN LIMITARSE A ELLA, LA GARANTÍA DE QUE EL " +"DOCUMENTO O LA VERSIÓN MODIFICADA DEL MISMO ESTÉ LIBRE DE DEFECTOS, GARANTÍA " +"DE COMERCIALIZACIÓN, APTITUD PARA UN USO EN PARTICULAR O INCUMPLIMIENTO. " +"TODOS LOS RIESGOS RELATIVOS A LA CALIDAD, EXACTITUD O RENDIMIENTO DEL " +"DOCUMENTO O LA VERSIÓN MODIFICADA DEL MISMO SON ASUMIDOS POR VD. EN CASO DE " +"QUE EL DOCUMENTO O LA VERSIÓN MODIFICADA SEAN DEFECTUOSOS, VD. (NO EL " +"ESCRITOR ORIGINAL NI EL AUTOR NI NINGUNO DE LOS COLABORADORES) ASUMIRÁ EL " +"COSTE DE CUALQUIER MANTENIMIENTO, REPARACIÓN O CORRECCIÓN QUE SEAN " +"NECESARIOS. ESTA RENUNCIA DE GARANTÍA CONSTITUYE UNA PARTE ESENCIAL DE ESTA " +"LICENCIA NO SE AUTORIZA EL USO DE NINGÚN DOCUMENTO NI VERSIÓN MODIFICADA DEL " +"MISMO, SALVO EN LAS CONDICIONES ESPECIFICADAS EN ESTA RENUNCIA; Y BAJO " +"NINGUNA CIRCUNSTANCIA NI SUPUESTO LEGAL, YA SEA POR AGRAVIO (INCLUIDA LA " +"NEGLIGENCIA), CONTRATO U OTROS CASOS, SERÁN RESPONSABLES EL AUTOR, EL " +"ESCRITOR ORIGINAL, CUALQUIERA DE LOS COLABORADORES O DISTRIBUIDORES DEL " +"DOCUMENTO O UNA VERSIÓN MODIFICADA DEL MISMO NI CUALQUIER PROVEEDOR DE TALES " +"PARTES ANTE UN TERCERO, POR CUALQUIER PERJUICIO DIRECTO, INDIRECTO, " +"ESPECIAL, ACCIDENTAL O CONSECUTIVO DE CUALQUIER TIPO, INCLUYENDO SIN " +"LIMITACIÓN LOS DAÑOS POR PÉRDIDA DE CLIENTES, INTERRUPCIONES DEL TRABAJO, " +"FALLO DE SISTEMAS O MALFUNCIONAMIENTO, O CUALQUIER OTRO DAÑO O PÉRDIDA " +"CAUSADA O RELACIONADA CON EL USO DEL DOCUMENTO Y LAS VERSIONES MODIFICADAS " +"DEL MISMO, AUN CUANDO SE HAYA INFORMADO DE LA POSIBILIDAD DE DICHOS DAÑOS." + +#: 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: " +"" +msgstr "" +"ESTE DOCUMENTO Y LAS VERSIONES MODIFICADAS DEL MISMO SE OFRECEN SEGÚN LAS " +"CONDICIONES ESTABLECIDAS EN LA LICENCIA DE DOCUMENTACIÓN LIBRE DE GNU (GFDL) " +"Y TENIENDO EN CUENTA QUE: " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "@@image: 'figures/_gedit.png'; md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Manual de Gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Proyecto de documentación de MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Añadida la tabla de teclas rápidas" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Equipo de documentación de Sun Java Desktop System" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "" +"Cicek proporcionó información sobre las revisiones anteriores de la " +"aplicación gedit." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Reconocimientos" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George ha ofrecido información acerca de los complementos." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Manual de gedit V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Marzo 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Equipo de documentación de Sun MATE" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Manual de gedit V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Junio 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Manual de gedit V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Agosto 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Manual de gedit V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Septiembre 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Manual de gedit V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Enero 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Manual de gedit V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Marzo 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Manual de gedit V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Septiembre 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Manual de gedit V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Marzo 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Manual de gedit V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Junio de 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Manual de gedit V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "Equipo de documentación de MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Este manual describe la versión 2.16 de gedit." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Comentarios" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Para informar de un error o hacer alguna sugerencia sobre la aplicación " +"gedit o el presente manual, siga las " +"instrucciones que aparecen en la Página de comentarios de MATE." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit es un editor de textos para el Escritorio MATE con características " +"básicas pero robustas, tales como impresión, corrección ortográfica, " +"busqueda y reemplazo y resaltado de sintaxis. Existen características más " +"avanzadas como complementos." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "editor de textos" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Introducción" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"La aplicación gedit le permite crear y editar " +"archivos de texto." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"El objetivo de gedit es ser un editor de texto " +"simple y fácil de usar. Se pueden activar características mas potentes con " +"diferentes complementos, permitiendo una variedad de " +"tareas relativas a la edición de texto." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Procedimientos iniciales" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Para iniciar gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"Para iniciar la aplicación gedit, siga estos " +"pasos:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Aplicaciones menú" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Seleccione AccesoriosEditor de " +"texto." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Línea de comandos" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Ejecute el comando siguiente: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Por omisión, cuando abra un documento de texto en el gestor de archivos, " +"gedit arrancará, y mostrará el documento." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "La ventana de gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Cuando inicia gedit, aparece la ventana siguiente:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Ventana de gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Muestra la ventana principal de gedit." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"La ventana de gedit contiene los elementos " +"siguientes:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Barra de menús" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Los menús de esta barra contienen todos los comandos necesarios para " +"trabajar con archivos de gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Barra de herramientas" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"La barra de herramientas contiene un subconjunto de comandos a los que puede " +"acceder desde la barra de menús." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Área de visualización" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "" +"El área de visualización contiene el texto del archivo que se está editando." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Barra de estado" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"La barra de estado muestra información sobre la actividad actual de " +"gedit e información contextual sobre los " +"elementos de menú:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "Muestra el número de línea y columna en que se encuentra el cursor." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Muestra la modalidad de edición. Si el editor está en modalidad de " +"inserción, la barra de estado contiene la palabra INS. " +"Si el editor está en modalidad de sobreescritura, la barra de estado " +"contiene la palabra SOB. Pulse la tecla Insert para cambiar el modo de edición." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Panel lateral" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"El panel lateral muestra una lista de los documentos abiertos y otra " +"información dependiendo de los complementos que estén activados." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Por omisión el panel lateral no se muestra. Para mostrarlo, " +"elijaVerPanel lateral." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Panel inferior" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"El panel inferior lo usan las herramientas de programación tales como el " +"complemento de Consola Python para mostrar la " +"salida. Por omisión no se muestra." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"De forma predeterminada no se muestra el panel inferior. Para mostrarlo, " +"elija VerPanel inferior." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Cuando se pulsa el botón derecho del ratón en la ventana de " +"gedit, la aplicación muestra un menú emergente. " +"El menú emergente contiene los comandos de edición de texto más habituales." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Como en otras aplicaciones de MATE, las acciones en gedit pueden realizarse de varios modos: con el menú, con la barra de " +"herramientas, o con combinaciones de teclas. Las combinaciones de teclas " +"comunes a todas las aplicaciones están en la Guía de usuario." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Para abrir gedit desde una línea de comandos" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Puede ejecutar gedit desde una línea de comandos " +"y abrir uno o varios archivos. Para abrir varios archivos desde una línea de " +"comandos, escriba este comando y pulse la tecla Intro:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "archivo1.txt archivo2.txt archivo3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "" +"Alternativamente, puede especificar un URI en vez de un nombre de archivo." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Para obtener más información acerca de la ejecución de gedit desde una línea de comandos, consulte la página del manual de " +"unix para gedit gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Trabajar con archivos" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Creación de un documento" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Para crear un documento nuevo, seleccione ArchivoNuevo. La aplicación " +"mostrará un documento nuevo en blanco en la ventana gedit." + +#: C/gedit.xml:346(title) C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "Apertura de un archivo" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Para abrir un archivo, seleccione ArchivoAbrir para que se muestre el " +"cuadro de diálogo Abrir archivo. Seleccione el archivo " +"que desee abrir y después pulse Aceptar. El archivo " +"se muestra en la ventana gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Icono del menú «Mostrar archivos recientes»." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"La aplicación registra las rutas de acceso y los nombres de los últimos " +"cinco archivos que se han editado y los muestra como elementos de menú en el " +"menú Archivo. También puede " +"pulsar en el icono de la barra de herramientas para mostrar " +"la lista de archivos recientes." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"Puede abrir múltiples archivos en gedit. La " +"aplicación añade a la ventana una solapa para cada archivo abierto. Para más " +"sobre ello vea la ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Guardado de un archivo" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Puede guardar archivos de cualquiera de estas maneras:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Para guardar los cambios a un archivo existente, elija " +"ArchivoGuardar." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Para guardar un archivo nuevo o para guardar un archivo existente con un " +"nombre nuevo, seleccione ArchivoGuardar como. Escriba un " +"nombre para el archivo en el cuadro de diálogo Guardar como y después pulse en Guardar." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Para guardar todos los archivos que estén abiertos en este momento en " +"gedit, seleccione " +"DocumentosGuardar todo." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Para cerrar todos los archivos que estén abiertos en ese momento en " +"gedit, seleccione " +"DocumentosCerrar todo." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Abrir un archivo desde una URI" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Para abrir un archivo desde un identificador de recursos uniforme (URI), " +"lleve a cabo los siguientes pasos:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Seleccione ArchivoAbrir lugar para mostrar el diálogo Abrir lugar." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Introduzca la URI del archivo que quiere abrir." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Use la lista desplegable Codificación de caracteres " +"para seleccionar la codificación de caracteres apropiada." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Pulse Abrir." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Los tipos de URI válidos incluyen http:, ftp:, file: y todos los " +"métodos admitidos por mate-vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Archivos desde algunos tipos de URI se abren como sólo lectura, y cualquier " +"cambio que realice deberá guardarlo en una ubicación diferente. HTTP sólo " +"permite lectura de archivos. Los archivos abiertos desde FTP son de sólo " +"lectura porque no todos los servidores FTP trabajan correctamente con " +"guardado remoto de archivos." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Guardar a servidores FTP puede activarse con el Editor de configuración, estableciendo la clave /apps/gedit-2/preferences/editor/" +"save/writable_vfs_schemes, pero puede causar errores." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Trabajar con solapas" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Cuando se abre más de un archivo, gedit muestra " +"una solapa para cada documento en la parte superior " +"del área de visualización. Para cambiar a otro documento, pulse en su solapa." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Para mover un documento a otra ventana de gedit, " +"arrastre la solapa correspondiente al archivo a la ventana a la que la " +"quiere mover." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Para mover un documento a una ventana nueva de gedit, arrastre la solapa al escritorio, o elija " +"DocumentosMover a una ventana " +"nueva." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Trabajar con el texto" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Editar texto" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "El texto de un archivo se puede editar de las siguientes maneras:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Escriba el texto nuevo desde el teclado. El cursor de inserción parpadeante marca donde aparece el texto. Para cambiar ésto, use " +"las teclas de flechas del teclado o pulse con el ratón." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Para copiar el texto seleccionado en un portapapeles, seleccione " +"EditarCopiar." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Para borrar el texto seleccionado del archivo y trasladarlo al portapapeles, " +"seleccione EditarCortar." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Para eliminar el texto seleccionado del archivo de forma permanente, " +"seleccione EditarBorrar." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Para insertar el contenido del portapapeles en la posición del cursor, " +"seleccione EditarPegar. Debe cortar o copiar antes de pegar el texto en " +"el archivo, desde gedit u otra aplicación." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Para seleccionar todo el texto de un archivo, seleccione " +"EditarSeleccionar todo." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Deshacer y rehacer cambios" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Para deshacer un cambio que haya realizado, elija " +"EditarDeshacer. Para deshacer esta acción, elija EditarRehacer." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Búsqueda y reemplazo" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"En gedit, hay dos modos de buscar un texto. Puede " +"usar el diálogo Buscar para buscar un fragmento " +"específico del texto, o Búsqueda incremental para " +"resaltar el texto coincidente a medida que lo teclea." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Búsqueda de texto" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Para buscar en un archivo una cadena de texto, realice estos pasos:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Seleccione BuscarBuscar para que se muestre el cuadro de diálogo " +"Buscar." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Escriba la cadena que desea buscar en el campo Buscar. " +"Puede incluir caracteres especiales como línea nueva o tabulador: vea la " +"." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Pulse Buscar para buscar el archivo por la primera " +"aparición de la cadena después de la posición actual del cursor. Si " +"gedit encuentra la cadena, la aplicación " +"selecciona la primera aparición de la cadena. Otras apariciones de la cadena " +"se resaltan." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Para encontrar la siguiente aparición de la cadena, pulse Buscar o elija BuscarBuscar " +"siguiente. Para encontrar la aparición anterior " +"del texto, elija BuscarBuscar " +"anterior." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Después de haber cerrado el diálogo Buscar, aún podrá " +"mover la selección a otras apariciones en el texto seleccionando " +"BuscarBuscar siguiente y BuscarBuscar anterior." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Para quitar el resaltado del texto, elija BuscarQuitar resaltado." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Búsqueda incremental " + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"La búsqueda incremental resalta el texto que coincide en el documento a " +"medida que lo teclea letra a letra. (Esto es similar a la función de " +"búsqueda en muchos navegadores web.)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Para empezar un búsqueda incremental, elija BuscarBúsqueda incremental. La " +"caja de búsqueda aparece en parte de arriba del área de visualización." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Empiece a teclear, y el texto que coincida será resaltado en el documento. " +"La primera instancia después la posición del cursor también se selecciona." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Para avanzar la selección a la siguiente coincidencia mientras mantiene la " +"casilla de búsqueda incremental abierta, pulse CtrlG. Pulse CtrlMayúsG para volver a la " +"coincidencia anterior." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"También puede usar las teclas de flechas arriba y abajo o la rueda del ratón " +"para mover la selección entre coincidencias." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Reemplazar texto" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Para buscar en un archivo una cadena y sustituirla por por otra, lleve a " +"cabo los pasos siguientes:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Seleccione BuscarReemplazar para que se muestre el cuadro de diálogo " +"Reemplazar." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Teclee la cadena que desea buscar, en el campo Buscar. " +"Puede incluir caracteres especiales como linea nueva o tabulador: vea la " +"." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Escriba la cadena que desea usar para reemplazar a la que se ha encontrado " +"en el campo Reemplazar por." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Para examinar cada aparición de la cadena antes de sustituirla, pulse " +"Buscar. Si gedit encuentra " +"la cadena, la aplicación la selecciona. Pulse Sustituir para sustituir la aparición de la cadena seleccionada. Para " +"encontrar la siguiente aparición de la cadena, pulse otra vez " +"Buscar." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Para reemplazar todas apariciones de la cadena en el documento, pulse " +"Reemplazar todo." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Opciones buscar y reemplazar" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"El diálogo Buscar y el diálogo Reemplazar tienen las siguientes opciones:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Seleccione la opción Coincidir con capitalización para " +"encontrar solamente los casos en que la cadena coincida con la " +"capitalización del texto que ha escrito. Por ejemplo, seleccionando " +"Coincidir con capitalización , \"TEXTO\" no coincidirá " +"con \"texto\"." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Seleccione la opción Coincidir sólo con la palabra completa para encontrar solamente los casos en que el texto coincida " +"exactamente con las palabras completas que se hayan escrito. Por ejemplo, " +"seleccionando Coincidir sólo con la palabra completa," +"\"texto\" no coincidirá con \"textura\"." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Seleccione la opción Buscar atrás para buscar hacia " +"atrás hasta el principio del documento." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Seleccione la opción Continuar desde el principio para " +"buscar hasta el final del documento y entonces continuar la búsqueda desde " +"el principio del documento." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Caracteres especiales" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"Puede incluir las siguientes secuencias de escape en el texto para buscar o " +"reemplazar para representar caracteres especiales:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Especifica una línea nueva." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Especifica un carácter tabulador." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Especifica un retorno de carro." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"El carácter barra invertida debe escaparse si es lo que se está buscando. " +"Por ejemplo, si está buscando «\\n» literalmente, deberá " +"escribir «\\\\n» en el campo Buscar:. O si está buscando " +"una secuencia de barras invertidas, deberá duplicar el número de barras " +"invertidas buscadas." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Situar el cursor en una línea específica" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Para posicionar el cursor en una línea específica del archivo actual, elija " +"BuscarIr a la línea. La caja de número de línea aparece en parte de " +"arriba del área de visualización." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Escriba el número de la línea a la que desea desplazar el cursor y el " +"documento se deslizará hasta la línea especificada." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Para quitar la caja y mover el cursor a la línea especificada, pulse " +"Intro." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Impresión" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Establecimiento de opciones de página" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Para establecer las opciones de página, seleccione " +"ArchivoConfiguración de página para mostrar el diálogo Configuración de " +"página." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"El cuadro de diálogo Configuración de página le permite " +"especificar las opciones de impresión siguientes:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Solapa General" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Imprimir con sintaxis resaltada" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Seleccione esta opción para imprimir con sintaxis resaltada. Para más " +"información sobre el resaltado de sintaxis, vea la ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Imprimir cabeceras de página" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Seleccione esta opción para que se incluya una cabecera en todas las páginas " +"que se impriman. La cabecera no se puede configurar." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "Números de línea" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Seleccione la opción Impresión de números de línea para " +"incluir los números de línea cuando imprime un archivo." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Use el marcador incrementable Número cada … líneas para " +"especificar la frecuencia con la que desea que se impriman los números de " +"línea, por ejemplo cada 5 líneas, cada 10 líneas, etc." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1176(guilabel) C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "Ajuste de texto" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Seleccione la opción Activar ajuste de texto para " +"desplazar el resto del texto a la siguiente línea, cuando se llega a un " +"número de carácter determinado, al imprimir un archivo. La aplicación cuenta " +"las líneas desplazadas como si fueran una sola en lo que respecta a la " +"numeración." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Seleccione la opción No partir palabras en dos líneas " +"para ajustar texto a la línea siguiente, en el nivel de palabra, cuando " +"imprime un archivo." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Tipografía" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Cuerpo" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Pulse en este botón con el fin de seleccionar la tipografía que desea usar " +"para imprimir el cuerpo del texto de un archivo." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Números de línea" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Pulse en este botón para seleccionar la tipografía que desea usar para " +"imprimir los números de línea." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Encabezamientos y pies de página" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Pulse en este botón con el fin de seleccionar la tipografía que desea usar " +"para imprimir las cabeceras en un archivo." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Para restablecer las tipografías a los valores predeterminados para imprimir " +"un archivo desde gedit pulse en el botón " +"Restablecer las tipografía predeterminada." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Impresión de un documento" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"La aplicación gedit se puede utilizar para " +"realizar las operaciones de impresión siguientes:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Imprimir un documento en una impresora." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Imprimir la salida del comando de impresión en un archivo." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Si imprime en un archivo, gedit envía la salida a " +"un archivo de formato de preimpresión. Los formatos de preimpresión más " +"comunes son PostScript y Portable Document Format (PDF)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Para ver una vista preliminar de las páginas que desea imprimir " +"seleccioneArchivoVista " +"preliminar de impresión." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Para imprimir el archivo actual en una impresora o archivo, seleccione " +"ArchivoImprimir para mostrar el cuadro de diálogo Imprimir." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"El cuadro de diálogo Imprimir permite especificar las " +"opciones de impresión siguientes:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Solapa tarea de impresión" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Rango de impresión" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Seleccione una de las opciones siguientes para determinar cuántas páginas " +"quiere imprimir:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Todo" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Seleccione esta opción para imprimir todas las páginas del archivo." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Líneas" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Seleccione esta opción para imprimir sólo las líneas especificadas. Use los " +"marcadores incrementables Desde y A para especificar el rango de líneas." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Selección" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Seleccione esta opción para imprimir sólo el texto seleccionado. Esta opción " +"sólo está disponible si previamente se ha seleccionado texto." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Copias" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Use el marcador incrementable Número de copias para " +"especificar el número de copias del archivo que desea imprimir." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Si va a imprimir varias copias del archivo, seleccione la opción " +"Intercalar para intercalar las copias impresas." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Solapa impresora" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Impresora" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Use esta lista desplegable para seleccionar la impresora en la que quiera " +"imprimir el archivo." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Configuración" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "" +"Use esta lista desplegable para seleccionar la configuración de la impresora." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Para configurar la impresora, pulse Configurar. Por " +"ejemplo, puede permitir o no la impresión dúplex, o programar una impresión " +"para más tarde, si ésta función está soportada en la impresora." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Ubicación" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Use esta lista desplegable para seleccionar uno de las siguientes destinos " +"de impresión:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Imprime el archivo a una impresora CUPS." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Si la impresora seleccionada es una impresora CUPS, CUPS es la única entrada en esta lista desplegable." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Imprime el archivo en una impresora." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Archivo" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Imprime el archivo en un archivo PostScript." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Pulse Guardar como para mostrar un diálogo cuando " +"especifique el nombre y ubicación del archivo PostScript." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Personalizado" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Use el comando especificado para imprimir el archivo." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Teclee el nombre del comando en la caja de texto. Incluya todos los " +"argumentos de línea de comandos." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Estado" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Esta funcionalidad no está soportada en esta versión de gedit." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Tipo" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Comentario" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Solapa papel" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Tamaño del papel" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Use esta lista desplegable para seleccionar el tamaño del papel en el que " +"desea imprimir el archivo." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Anchura" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Use este marcador incrementable para especificar la anchura del papel. Use " +"la lista desplegable contigua para cambiar la unidad de medida." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Altura" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Use este marcador incrementable para especificar la altura del papel." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Orientación del alimentador" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"Utilice esta lista desplegable para seleccionar la orientación del papel en " +"la impresora." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Orientación de la página" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "" +"Use esta lista desplegable para seleccionar la orientación de la página." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Disposición" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Use esta lista desplegable para determinar la disposición de la página. En " +"el área de Previsualización se muestra una vista previa " +"de la disposición de las páginas que haya seleccionado." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Bandeja de papel" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Use esta lista desplegable para seleccionar la bandeja de papel." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Características de programación" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Varias de las características para programación de gedit las proporcionan complementos. Por ejemplo, el complemento " +"Lista de etiquetas proporciona una lista de etiquetas comúnmente usadas para " +"diferentes lenguajes de marcado: vea ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Resaltado de sintaxis" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"El resaltado de sintaxis hace el código fuente más legible mostrando " +"diferentes partes del texto en diferentes colores." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit elije un modo de resaltado de sintaxis " +"apropiado según el tipo de documento. Para reemplazar el modo de resaltado " +"de sintaxis, elija VerModo de " +"resaltado, después seleccione uno de los " +"siguientes elementos de menú:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Normal" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "No mostrar ningún resaltado de sintaxis." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Fuentes" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Muestra el resaltado de sintaxis para editar código fuente. Use el submenú " +"Fuentes para seleccionar el tipo de código fuente." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Marcado" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Muestra resaltado de sintaxis para editar código marcado. Use el submenú " +"Marcado para seleccionar el tipo de marcado de " +"código." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Scripts" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Muestra resaltado de sintaxis para editar código de scripts. Use el submenú " +"Scripts para seleccionar el tipo de código de " +"script." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Otros" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Muestra el marcado de sintaxis para editar otros tipos de código. Use el " +"submenú Otros para seleccionar el tipo de código." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Redirección la salida de un comando a un archivo" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"La aplicación gedit se puede usar para redirigir " +"la salida de un comando a un archivo de texto. Por ejemplo, para redirigir " +"la salida del comando ls a un archivo de texto, escriba " +"ls | gedit y a continuación pulse Intro." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"La salida del comando ls se muestra en un archivo de " +"texto nuevo de la ventana gedit." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Alternativamente, puede usar el complemento Herramientas " +"externas para conducir la salida de un comando al archivo " +"actual." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Teclas rápidas" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Use las teclas rápidas para realizar tareas comunes más rápidamente que con " +"el ratón y los menús. Las siguientes tablas listan todas las teclas rápidas " +"de gedit." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Para obtener más información sobre las teclas rápidas, vea la Guía del usuario del " +"escritorio." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "Solapas" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Teclas rápidas para las solapas:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) C/gedit.xml:1052(para) C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "Tecla rápida" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) C/gedit.xml:1054(para) C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "Comando" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + RePág" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Cambia a la siguiente solapa a la izquierda." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + AvPág" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Cambia a la siguiente solapa a la derecha." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Cerrar la solapa." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Mayús. + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Guardar todas las solapas." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Mayús. + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Cerrar todas las solapas." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Saltar a la enésima solapa." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Archivos" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Teclas rápidas para trabajar con archivos:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Crear un nuevo documento." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Abrir un documento." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Abrir un lugar." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Guardar el documento actual al disco." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Mayús. + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Guardar el documento actual con un nuevo nombre de archivo." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Imprimir el documento actual." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Mayús. + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Vista preliminar de impresión." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Cerrar el documento actual." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Salir de Gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "Editar" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Teclas rápidas para editar documentos:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Deshacer la última acción." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Mayús. + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Rehacer la última acción deshecha." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Copiar el texto o región seleccionado y ubicarlo en el portapapeles." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Copiar el texto o región seleccionado al portapapeles." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Pegar el contenido del portapapeles." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Seleccionar todo." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Borrar la línea actual." + +#: C/gedit.xml:1003(para) +#| msgid "Alt + n" +msgid "Alt + Up" +msgstr "Alt + Arriba" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "Mover la línea seleccionada una línea arriba." + +#: C/gedit.xml:1007(para) +#| msgid "Alt + n" +msgid "Alt + Down" +msgstr "Alt + Abajo" + +#: C/gedit.xml:1008(para) +#| msgid "Copy the selected text or region onto the clipboard." +msgid "Move the selected line down one line." +msgstr "Mover la línea seleccionada una línea abajo." + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "Paneles" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Teclas rápidas para mostrar y ocultar los paneles:" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "Mostrar/ocultar el panel lateral." + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "Mostrar/ocultar el panel inferior." + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "Buscar" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "Teclas rápidas para búsquedas:" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "Buscar una cadena." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "Buscar la siguiente instancia de una cadena." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Mayús. + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "Buscar la instancia anterior de una cadena." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "Búsqueda interactiva." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "Buscar y reemplazar." + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Mayús. + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "Limpiar el resaltado." + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "Ir a la línea." + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "Herramientas" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "Teclas rápidas para las herramientas:" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Mayús. + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "Comprobar ortografía (con complemento)." + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Eliminar espacios finales (con complemento)." + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "Sangría (con complemento)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Mayús. + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "Quitar sangría (con complemento)." + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Ejecutar «make» en el directorio actual (con complemento)." + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Mayús. + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "Listado de directorio (con complemento)." + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "Ayuda" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "Teclas rápidas para la ayuda:" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "Abra el manual del usuario de gedit." + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "Preferencias" + +#: C/gedit.xml:1164(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Para configurar gedit, seleccione " +"EditarPreferencias. El cuadro de diálogo Preferencias contiene las categorías siguientes:" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "Preferencias de visualización" + +#: C/gedit.xml:1178(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Seleccione la opción Activar ajuste de texto para hacer " +"que las líneas largas que se conviertan en párrafos en lugar de perderse por " +"el borde de la ventana de texto. Esto evita tener que desplazarse " +"horizontalmente" + +#: C/gedit.xml:1179(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Seleccione la opción No partir palabras en dos líneas " +"para que la opción de ajustar el texto conserve las palabras enteras cuando " +"el texto salte a la siguiente línea. Esto hace el texto más fácil de leer." + +#: C/gedit.xml:1185(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Seleccione esta opción para que se muestren números de línea en la parte " +"izquierda de la ventana de gedit." + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "Línea actual" + +#: C/gedit.xml:1191(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Seleccione la opción Resaltar la línea actual para " +"resaltar la línea donde se ubica el cursor." + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "Margen derecho" + +#: C/gedit.xml:1197(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Seleccionar Visualizar margen derecho opción para " +"visualizar la linea vertical que indica el margen derecho." + +#: C/gedit.xml:1198(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"El cuadro de diálogo Imprimir permite especificar las " +"opciones de impresión siguientes." + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "Coincidencia de corchetes" + +#: C/gedit.xml:1204(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Seleccione la opción Resaltar coincidencia de corchetes " +"para resaltar el corchete correspondiente cuando el cursor está posicionado " +"en un carácter corchete." + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "Preferencias del Editor" + +#: C/gedit.xml:1217(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Use el marcador incrementable Ancho de tabulador para " +"especificar la anchura de espacio que gedit " +"inserta cuando se pulsa la tecla Tabulador." + +#: C/gedit.xml:1218(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Seleccione la opción Insertar espacios en lugar de tabuladores para especificar que gedit inserte " +"espacios en lugar de caracteres de tabulador al pulsar la tecla " +"Tabulador." + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "Sangría automática" + +#: C/gedit.xml:1224(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Seleccione la opción Activar sangría automática para " +"especificar que la línea siguiente empiece con el nivel de sangrado de la " +"línea actual." + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "Guardado de archivos" + +#: C/gedit.xml:1230(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Seleccione la opción Crear una copia de respaldo de los archivos " +"antes de guardar para crear una copia de seguridad de los " +"archivos cada vez que se procede a guardarlos. La copia de seguridad de un " +"archivo contiene una tilde (~) al final del nombre de archivo." + +#: C/gedit.xml:1231(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Seleccione la opción Autoguardar archivos cada … minutos para guardar automáticamente el archivo actual a intervalos " +"regulares. Use el marcador incrementable para especificar el intervalo para " +"guardar el archivo." + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "Preferencias de Tipografías y colores" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "Fuentes" + +#: C/gedit.xml:1243(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Seleccione esta opción para usar la fuente de sistema predeterminada para el " +"texto de la ventana de gedit." + +#: C/gedit.xml:1244(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"Este campo muestra la fuente que gedit usa para " +"mostrar texto. Pulse en el botón para especificar el tipo, estilo y tamaño " +"de fuente que desea usar para el texto." + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "Esquema de color" + +#: C/gedit.xml:1250(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"Puede elegir un esquema de color de la lista de esquemas de colores. Los " +"siguientes esquemas de color están instalados de forma predeterminada:" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "Clásico" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Esquema de color clásico basado en el esquema de color de gvim." + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Cobalto" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "Esquema de color basado en el azul" + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Esquema de color usado en el editor de textos Kate." + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Esquema de color oscuro usando la paleta de color Tango." + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Esquema de color usando el esquema de color Tango." + +#: C/gedit.xml:1283(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Puede añadir un esquema de color nuevo pulsando en Añadir... y seleccionando un archivo de esquema de color." + +#: C/gedit.xml:1284(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Puede quitar el esquema de color seleccionar pulsando en Quitar" + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "Preferencias de Complementos" + +#: C/gedit.xml:1292(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Los complementos añaden características extras a gedit. Para más información acerca de los complementos y cómo usar " +"los complementos integrados, vea la ." + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "Activación de un complemento" + +#: C/gedit.xml:1297(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Para activar un complemento de gedit, realice los " +"siguientes pasos:" + +#: C/gedit.xml:1300(para) C/gedit.xml:1321(para) C/gedit.xml:1643(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Seleccione Editar Preferencias." + +#: C/gedit.xml:1303(para) C/gedit.xml:1324(para) C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "Seleccione la solapa Complementos." + +#: C/gedit.xml:1306(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"Seleccione la casilla junto al nombre del complemento que desea activar." + +#: C/gedit.xml:1309(para) C/gedit.xml:1330(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Pulse en Cerrar para cerrar el cuadro de diálogo " +"Preferencias." + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "Desactivación de un complemento" + +#: C/gedit.xml:1317(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Un complemento permanece activado cuando sale de gedit." + +#: C/gedit.xml:1318(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Para desactivar un complemento de gedit, realice " +"los siguientes pasos:" + +#: C/gedit.xml:1327(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Deseleccione la casilla junto al nombre del complemento que desea desactivar." + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "Complementos" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "Trabajar con complementos" + +#: C/gedit.xml:1342(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Puede añadir características extras a gedit " +"añadiendo complementos. Un complemento es un programa " +"suplementario que aumenta la funcionalidad de una aplicación. Los " +"complementos añaden elementos nuevos a los menús de gedit para las características nuevas que proporcionan." + +#: C/gedit.xml:1344(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Varios complementos vienen integrados con gedit, " +"y puede instalar más. El sitio web de gedit lista complementos de terceros." + +#: C/gedit.xml:1345(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Para activar o desactivar complementos, o ver qué complementos están " +"activados use las Preferencias de " +"complementos." + +#: C/gedit.xml:1346(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"Los siguientes complementos vienen integrados con gedit:" + +#: C/gedit.xml:1352(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Cambio de " +"capitalización le permite cambiar la capitalización del " +"texto seleccionado." + +#: C/gedit.xml:1355(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Estadísticas " +"del documento muestra el número de líneas, palabras, y " +"caracteres en el documento." + +#: C/gedit.xml:1358(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Herramientas " +"externas le permite ejecutar comandos externos desde " +"gedit." + +#: C/gedit.xml:1361(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Examinador de archivos le permite examinar sus " +"archivos y carpetas en los paneles laterales." + +#: C/gedit.xml:1364(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Sangría de líneas añade o elimina la sangría de las líneas seleccionadas." + +#: C/gedit.xml:1367(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Insertar fecha/" +"hora añade la fecha actual y la hora a un documento." + +#: C/gedit.xml:1370(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Líneas de modo le permite establecer preferencias de edición para documentos " +"individuales, soportando estilos de líneas de modo de Emacs, Kate y Vim." + +#: C/gedit.xml:1373(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Consola Python le permite ejecutar comandos en el lenguaje de " +"programación python." + +#: C/gedit.xml:1376(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"El complemento Recortes le permite almacenar trozos de texto usados " +"frecuentemente, llamados recortes, e insertarlos " +"rápidamente en un documento." + +#: C/gedit.xml:1379(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Ordenar ordena las líneas seleccionadas de texto en orden alfabético." + +#: C/gedit.xml:1382(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Ortografía corrige la ortografía en el texto seleccionado, o marca errores " +"automáticamente en el documento." + +#: C/gedit.xml:1385(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Lista de etiquetas le permite insertar etiquetas usadas comúnmente para " +"HTML y otros lenguajes de una lista en el panel lateral." + +#: C/gedit.xml:1389(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"Para obtener más información acerca de cómo crear complementos, consulte el " +"sitio web " +"de gedit." + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "Complemento Cambiar capitalización" + +#: C/gedit.xml:1394(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"El complemento Cambiar capitalización le permite " +"cambiar la capitalización del texto seleccionado." + +#: C/gedit.xml:1395(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Los siguientes elementos se añaden al menú Editar cuando " +"está activado el complemento Cambiar capitalización:" + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "Elemento del menú" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "Acción" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "Ejemplo" + +#: C/gedit.xml:1415(guisubmenu) C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "Cambiar capitalización" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "Todo en mayúscula" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "Cambiar cada carácter a mayúsculas." + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "" +"Este texto se convierte ESTE TEXTO" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "Todo en minúscula" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "Cambia cada carácter a minúsculas." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "" +"Este Texto se convierte en este texto" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "Capitalización invertida" + +#: C/gedit.xml:1428(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "Cambiar cada carácter de minúscula a mayúscula y viceversa." + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" +"Este Texto se convierte en eSTE tEXTO" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "Capitalización de título" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "Cambiar el primer carácter de cada palabra a mayúscula." + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "" +"este texto se convierte en Este Texto" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "Complemento Estadísticas del documento" + +#: C/gedit.xml:1445(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"El complemento Estadísticas del documento cuenta " +"el número de líneas, palabras, caracteres con espacios, caracteres sin " +"espacios y bytes del archivo actual. El complemento muestra el resultado en " +"un diálogo Estadísticas del documento. Para utilizar el " +"complemento Estadísticas del documento, siga estos pasos:" + +#: C/gedit.xml:1447(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Seleccione HerramientasEstadísticas del documento " +"para abrir el diálogo Estadísticas del documento. El " +"diálogo Estadísticas del documento muestra la " +"información siguiente acerca del archivo:" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "Número de líneas del documento actual." + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "Número de palabras del documento actual." + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Número de caracteres, espacios incluidos, del documento actual." + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Número de caracteres, espacios excluidos, del documento actual." + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "Número de bytes del documento actual." + +#: C/gedit.xml:1467(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Puede seguir actualizando el archivo de gedit " +"mientras el diálogo Estadísticas del documento esté " +"abierto. Para actualizar el contenido del cuadro de diálogo " +"Estadísticas del documento, pulse en el botón " +"Actualizar." + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "Complemento de herramientas externas" + +#: C/gedit.xml:1475(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"El complemento Herramientas externas permite " +"ejecutar comandos externos desde gedit. Puede " +"encauzar contenido a un comando y explotar su salida (por ejemplo, " +"sed), o lanzar un comando predefinido (por " +"ejemplo, make)." + +#: C/gedit.xml:1476(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Use el Gestor de herramientas externas para crear y " +"editar comandos. Para ejecutar un comando externo, elíjalo de entre el menú " +"Herramientas." + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "Comandos integrados" + +#: C/gedit.xml:1480(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"Los siguientes comandos se proporcionan con el complemento " +"Herramientas externas:" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Construir" + +#: C/gedit.xml:1484(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Ejecuta la aplicación make en el directorio del " +"documento actual." + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "Listado de directorio" + +#: C/gedit.xml:1489(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "" +"Lista el contenido del directorio del documento actual en un nuevo documento." + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "Variables de entorno" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Muestra la lista de variables de entorno en el panel inferior." + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Busca un término en todos los archivos en el directorio actual del " +"documento, usando coincidencia de patrones. El resultado se muestra en el " +"panel inferior." + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "Eliminar espacios finales" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Quita todos los espacios del final de las líneas en el documento." + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "Definir un comando" + +#: C/gedit.xml:1512(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Para añadir un comando externo, elija HerramientasHerramientas externas." + +#: C/gedit.xml:1513(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"En la ventana del Gestor de herramientas externas, " +"pulse Nuevo. Puede especificar los siguientes " +"detalles para el comando nuevo:" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "Descripción" + +#: C/gedit.xml:1517(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"Esta descripción se muestra en la barra de estado cuando se elije el comando " +"de menú." + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "Acelerador" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Introduzca un atajo de teclado para el comando." + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "Comandos" + +#: C/gedit.xml:1527(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Los comandos actuales para ejecutar. Se pueden usar varias variables de " +"entorno de gedit para pasar contenido a estos " +"comandos: vea ." + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "Entrada" + +#: C/gedit.xml:1532(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"El contenido para dar a los comandos (como stdin): " +"el texto entero del documento actual, la selección, la línea o palabra " +"actual." + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "Salida" + +#: C/gedit.xml:1537(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Qué hacer con la salida de los comandos: mostrarla en el panel inferior, " +"ponerla en un documento nuevo, colocarla en el documento actual, al final, " +"en la posición del cursor, o reemplazar la selección del documento entero." + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "Aplicabilidad" + +#: C/gedit.xml:1542(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Determina qué clase de documentos pueden verse afectados por el comando, por " +"ejemplo si están guardados o no, los locales o los remotos." + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "Editar y quitar herramientas" + +#: C/gedit.xml:1551(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Para editar una herramienta, selecciónela en la lista y haga cambios a sus " +"propiedades." + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "Para renombrar una herramienta, pulse otra vez en la lista." + +#: C/gedit.xml:1553(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Para restaurar una herramienta integrada que haya modificado, pulse " +"Revertir." + +#: C/gedit.xml:1554(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Para quitar una herramienta, selecciónela en la lista y pulse " +"Quitar. No puede quitar los herramientas integradas, " +"sólo aquellas que haya creado." + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "Variables" + +#: C/gedit.xml:1559(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"Puede usar las siguientes variables en el campo Comandos de la definición del comando:" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "Complemento del examinador de archivos" + +#: C/gedit.xml:1588(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"El complemento del Examinador de archivos muestra " +"sus archivos y carpetas en el panel lateral, permitiéndole abrir rápidamente " +"archivos." + +#: C/gedit.xml:1589(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Para ver el examinador de archivos, elija VerPanel lateral y después " +"pulse en la solapa que muestra el icono del examinador de archivos en la " +"parte inferior del panel lateral." + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "Examinar sus archivos" + +#: C/gedit.xml:1592(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"La solapa del visor de archivos muestra inicialmente sus marcadores del " +"gestor de archivos. Para examinar el contenido de cualquier elemento, pulse " +"dos veces en él." + +#: C/gedit.xml:1593(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Para mostrar una carpeta madre, elija de la lista desplegable, o pulse la " +"flecha arriba en la barra de herramientas del gestor de archivos." + +#: C/gedit.xml:1594(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Para mostrar la carpeta que contiene el documento en el que está trabajando " +"actualmente, pulse dos veces en la lista del archivo y elija " +"Establecer raíz al documento activo." + +#: C/gedit.xml:1598(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Para abrir un archivo en gedit, pulse dos veces " +"en él en la lista de archivos." + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "Crear archivos y carpetas" + +#: C/gedit.xml:1602(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Para crear un archivo de texto nuevo vacío en la carpeta actual mostrada en " +"el examinador, pulse con el botón derecho en la lista de archivos y elija " +"Archivo nuevo." + +#: C/gedit.xml:1603(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Para crear una carpeta nueva en la carpeta actual mostrada en el examinador, " +"pulse con el botón derecho en la lista de archivos y elija " +"Nueva carpeta." + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "Complemento Sangrar líneas" + +#: C/gedit.xml:1609(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"El complemento de Sangrar líneas añade o quita " +"espacio del principio de las líneas de texto." + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" +"Para sangrar o quitar la sangría del texto, realice los siguientes pasos:" + +#: C/gedit.xml:1612(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Seleccione las líneas que desea sangrar. Para sangrar o anular el sangrado " +"de una única línea, sitúe el cursor en cualquier posición dentro de la línea." + +#: C/gedit.xml:1617(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Para sangrar el texto, elija EditarSangrar." + +#: C/gedit.xml:1620(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Para anular la sangría, seleccione elija EditarQuitar sangría." + +#: C/gedit.xml:1625(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"La cantidad de espacio usado, y dependiendo de si se usan caracteres de " +"tabulación o caracteres de espacio, depende de los ajustes de " +"Puntos de tabulación en las preferencias del Editor: " +"vea ." + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "Complemento Insertar fecha/hora" + +#: C/gedit.xml:1631(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"El complemento Insertar fecha/hora inserta la " +"fecha y la hora actuales en un documento. Para utilizar el complemento " +"Insertar fecha/hora, realice los siguientes pasos:" + +#: C/gedit.xml:1633(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Seleccione EditarInsertar fecha " +"y hora." + +#: C/gedit.xml:1634(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Si no ha configurado el complemento Insertar fecha/hora para insertar " +"automáticamente la fecha y la hora sin solicitar el formato, " +"gedit mostrará el diálogo Insertar " +"fecha y hora. Seleccione el formato de fecha/hora apropiado en la " +"lista. Pulse en el botón Insertar para cerrar el " +"diálogo Insertar fecha y hora;gedit insertará la fecha y la hora en el archivo actual, en la " +"posición del cursor." + +#: C/gedit.xml:1635(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Si ha configurado gedit para que utilice un " +"formato de fecha/hora especifico, no se mostrará el diálogo " +"Insertar fecha y hora; la fecha y la hora se insertarán " +"automáticamente en el archivo actual, en la posición del cursor." + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Para configurar el complemento Insertar fecha/hora" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"Para configurar el complemento Insertar fecha/hora, realice los siguientes " +"pasos:" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Seleccione el complemento Insertar fecha/hora." + +#: C/gedit.xml:1652(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Pulse en Configurar el complemento para abrir el " +"cuadro de diálogo Configurar el complemento Insertar fecha/hora." + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "Seleccione una de las siguientes opciones:" + +#: C/gedit.xml:1657(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Para especificar el formato de fecha/hora cada vez que inserte este dato, " +"seleccione la opción Preguntar por un formato." + +#: C/gedit.xml:1660(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Para utilizar el mismo formato, proporcionado por la aplicación " +"gedit, cada vez que se inserte la fecha o la " +"hora, seleccione la opción Usar el formato seleccionado " +"y elija el formato apropiado en la lista. Si se selecciona esta opción, " +"gedit no solicita el formato de fecha/hora cuando " +"se elige EditarInsertar fecha/" +"hora." + +#: C/gedit.xml:1663(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Para utilizar el mismo formato personalizado cada vez que se inserte la " +"fecha o la hora, seleccione la opción Usar el formato " +"personalizado y escriba el formato apropiado en el cuadro de " +"texto. Para obtener más información acerca de cómo especificar un formato " +"personalizado, consulte strftime3. Si se selecciona esta opción, " +"gedit no solicita el formato de fecha/hora cuando " +"se elige EditarInsertar fecha/" +"hora." + +#: C/gedit.xml:1668(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Pulse en Aceptar para cerrar el cuadro de diálogo " +"Configurar el complemento Insertar fecha/hora." + +#: C/gedit.xml:1671(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Para cerrar el cuadro de diálogo Preferencias, pulse " +"Cerrar." + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Complemento líneas de modo" + +#: C/gedit.xml:1679(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"El complemento Líneas de modo le permite " +"establecer preferencias para documentos individuales. Una línea " +"de modo es una línea de texto al principio o final del documento " +"con ajustes que gedit reconoce." + +#: C/gedit.xml:1680(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Las preferencias establecidas para usar líneas de modo tienen preferencia " +"sobre las especificadas en el diálogo de preferencias." + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "Puede establecer las siguientes preferencias con líneas de modos:" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Ancho de tabulación" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "Anchura de la sangría" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "Insertar espacios en lugar de tabuladores" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "Anchura del margen derecho" + +#: C/gedit.xml:1700(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"El complemento Líneas de Modos soporta un " +"subconjunto de las opciones usadas por los otros editores de texto " +"Emacs, Kate y " +"Vim." + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Líneas de modo Emacs" + +#: C/gedit.xml:1704(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"Las primeras dos líneas de un documento se analizan buscando líneas de modos " +"Emacs." + +#: C/gedit.xml:1705(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Se soportan las opciones Emacs para tab-width, " +"indent-offset, indent-tabs-mode y autowrap. Para obtener más información, " +"consulte el manual de GNU Emacs." + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Líneas de modo Kate" + +#: C/gedit.xml:1709(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"La primera y las últimas diez líneas de un documento se analizan buscando " +"líneas de modo Kate." + +#: C/gedit.xml:1710(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Se soportan las opciones Kate para tab-width, " +"indent-width, space-indent, word-wrap and word-wrap-column. Para más " +"información, vea el sitio web de Kate." + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Líneas de modo Vim" + +#: C/gedit.xml:1714(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"La primera y las últimas tres líneas de un documento se escanean buscando " +"líneas de modo Vim." + +#: C/gedit.xml:1715(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Se soportan las opciones Vim para et, expandtab, " +"ts, tabstop, sw, shiftwidth, wrap, y textwidth. Para obtener más " +"información, consulte la \">página web de Vim." + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Complemento consola Python" + +#: C/gedit.xml:1721(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"El complemento Consola Python le permite ejecutar " +"comandoes en el lenguaje de programación Python desde gedit. Activando el complemento se añade una solapa al panel " +"inferior. Esta muestra su salida reciente y un campo de entrada de comandos." + +#: C/gedit.xml:1722(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Los comandos introducidos en la consola de python no se comprueban antes de " +"ejecutarlos. Es posible entonces colgar gedit, " +"por ejemplo entrando un bucle infinito." + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "Complemento Recortes" + +#: C/gedit.xml:1727(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"El complemento Recortes le permite almacenar " +"trozos de texto usados frecuentemente, llamados recortes, e insertarlos rápidamente en un documento." + +#: C/gedit.xml:1728(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Los recortes son específicos a la sintaxis del lenguaje del documento " +"actual. Por ejemplo, cuando esta trabajando en un documento HTML, puede " +"elegir de una lista de recortes que son útiles para HTML. Además, algunos " +"recortes son globales, y están disponibles para todos los documentos." + +#: C/gedit.xml:1729(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Junto con gedit, se instalan varios recortes, que " +"pueden modificarse." + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "Inserción de recortes" + +#: C/gedit.xml:1733(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Para insertar un recorte en un documento, teclee su disparador y pulse Tab. El disparador de un recorte es " +"usualmente las primeras pocas letras del recorte, o algo parecido que sea " +"corto y fácil de recordar." + +#: C/gedit.xml:1734(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Alternativamente, pulse CtrlEspacio para ver una lista de recortes que puede insertar." + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "Adición de recortes" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "Puede crear un recorte nuevo, haga lo siguiente:" + +#: C/gedit.xml:1742(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Seleccione HerramientasGestión " +"de Recortes. La ventana del Gestor de " +"Recortes se abre." + +#: C/gedit.xml:1745(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"La lista de recortes esta agrupada por lenguajes. Seleccione el lenguaje con " +"el que quiere añadir el recorte, o un recorte en ese grupo de lenguajes. " +"Para añadir un recorte para todos los lenguajes, elija Global en la parte " +"superior de la lista. La sintaxis del documento con el que esta trabajando " +"actualmente se muestra por omisión." + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Pulse Nuevo. Aparece un recorte nuevo en la lista." + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "Introduzca la siguiente información para el recorte nuevo:" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "Nombre" + +#: C/gedit.xml:1755(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Introduzca un nombre para el recorte en el campo de texto dentro de la lista " +"de recortes. El nombre de un recorte sirve sólo como recordatorio de su " +"propósito. Puede cambiar el nombre de un recorte que cree para pulsar en él " +"en la lista." + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "Texto del recorte" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Introduzca el texto del recorte en la caja de texto Editar " +"recorte. Para códigos especiales, que pueda usar, vea ." + +#: C/gedit.xml:1761(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Puede volver a la ventana del documento para copiar texto sin cerrar la " +"ventana del Gestor de recortes." + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Disparador de tabulador" + +#: C/gedit.xml:1766(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Introduzca el disparado para el recorte. Este es el texto que teclea antes " +"de pulsar la tecla Tab para insertar el recorte." + +#: C/gedit.xml:1767(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"La etiqueta debe ser o una sola palabra comprendiendo sólo letras, o " +"cualquier carácter en solitario. El disparador se " +"resaltará en rojo si se introduce un disparador inválido." + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "Tecla rápida" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "" +"Teclee una tecla de acceso rápido para usarla para insertar el recorte." + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "Editar y quitar recortes" + +#: C/gedit.xml:1782(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Para editar un recorte, selecciónelo en la lista y haga cambios a sus " +"propiedades de activación de texto." + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Para renombrar un recorte, pulse otra vez en la lista." + +#: C/gedit.xml:1784(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Para restaurar un recorte integrado que haya modificado, pulse " +"Revertir." + +#: C/gedit.xml:1785(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Para quitar un disparador, selecciónelo en la lista y pulse " +"Quitar. No puede quitar los recortes integrados, sólo " +"aquellos que usted haya creado." + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "Sustituciones de recortes" + +#: C/gedit.xml:1790(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Además de insertar texto almacenado, un recorte puede incluir texto " +"personalizado, o marcar espacios donde puede añadir texto una vez que el " +"recorte se ha insertado en su documento." + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" +"Puede usar los siguientes códigos de reserva de espacio en el texto del " +"recorte:" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Reservas de espacio para tabuladores" + +#: C/gedit.xml:1798(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n define un lugar de reserva " +"de tabulador donde n es cualquier número desde 1 en " +"adelante." + +#: C/gedit.xml:1799(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} define una reserva de espacio de tabulación con un valor diferente." + +#: C/gedit.xml:1800(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Una reserva de espacio de tabulación marca un lugar en el texto de un " +"recorte donde puede añadir texto adicional después de insertar el recorte." + +#: C/gedit.xml:1801(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Para usar las reservas de espacio, inserte el recorte de forma normal. El " +"cursor se coloca en la primera reserva de espacio. Teclee el texto, pulse la " +"tecla Tab para avanzar a la siguiente reserva de espacio. " +"El número en el código de la reserva de espacio define el orden en que cada " +"tabulación avanza a cada lugar del texto." + +#: C/gedit.xml:1802(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Pulse MayúsTab para " +"volver al anterior reserva de espacio para tabulador. Pulsando Tab cuando no hay más reservas de espacio de tabulador mueve el cursor " +"al final del recorte de texto, o a la reserva de espacio al final si existe." + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Replicar reservas de espacio" + +#: C/gedit.xml:1807(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Una reserva de espacio repetida replicará la reserva de espacio ya definida. " +"Esto permite teclear texto sólo una vez cuando quiere que aparezca varias " +"veces en el recorte." + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "Terminar reserva de espacio" + +#: C/gedit.xml:1812(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 define el final de la reserva de espacio. Esto le " +"permite terminar de trabajar con el recorte con el cursor en un punto " +"distinto que el final del texto recortado." + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "Variables de entorno" + +#: C/gedit.xml:1817(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Las variables de entorno como $PATH y $HOME se sustituyen en el texto del recorte. Las siguientes variables " +"específicas de gedit se pueden usar también:" + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "El texto actualmente seleccionado." + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"El nombre completo del documento, o una cadena vacía si el documento no está " +"guardado aún." + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"El nombre base del nombre de archivo del documento, o una cadena vacía si el " +"documento aún no se ha guardado." + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"La palabra en al lugar del cursor en el documento. Cuando esta variable se " +"esté usando, la palabra actual se reemplazará con el texto del recorte." + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Reservas de espacio de shell" + +#: C/gedit.xml:1846(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) se reemplaza por el " +"resultado de ejecutar cmd en una shell." + +#: C/gedit.xml:1847(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) le permite dar esta reserva de espacio una referencia, donde " +"n es cualquier número desde 1 hacia adelante. Use " +"$n para usar la salida desde " +"una reserva de espacio de shell como entrada en otra." + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Reservas de espacio de Python" + +#: C/gedit.xml:1852(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> se reemplaza por " +"el resultado de evaluar cmd en el intérprete de " +"python." + +#: C/gedit.xml:1853(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" especifica otra reserva de espacio python como una dependencia, " +"donde a da su orden en el recorte. Esto le " +"permite usar funciones python definidas en otro recorte. Para especificar " +"varias dependencias, separe los números con comas así: $<" +"a,b:cmd>" + +#: C/gedit.xml:1854(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Para usar una variable en todos los otros recortes de python, declárela como " +"global." + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "Complemento Ordenar" + +#: C/gedit.xml:1864(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"El complemento Ordenar coloca las líneas " +"seleccionadas en orden alfabético." + +#: C/gedit.xml:1865(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"La operación de Ordenar no se puede deshacer, por lo que es recomendable " +"guardar el archivo antes de llevarla a cabo. Para volver a la versión " +"guardada del archivo después de efectuar la operación de ordenar, seleccione " +"ArchivoRevertir." + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Para utilizar el complemento Ordenar, realice los siguientes pasos:" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "Seleccione las líneas de texto que quiere ordenar." + +#: C/gedit.xml:1873(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Seleccione EditarOrdenar. El diálogo Ordenar se abre." + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "Elija las opciones que quiera para la ordenación:" + +#: C/gedit.xml:1879(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Para ordenar el texto en orden inverso, seleccione la opción Orden " +"inverso." + +#: C/gedit.xml:1882(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Para borrar las líneas duplicadas, seleccione la opción Eliminar " +"duplicados." + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Para no distinguir entre mayúsculas y minúsculas, seleccione la opción " +"Ignorar capitalización." + +#: C/gedit.xml:1888(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Para que la ordenación ignore los caracteres al principio de las líneas, " +"establezca el primer carácter que debería usarse para ordenar en el marcador " +"incrementable Empezar en la columna." + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"Para efectuar la ordenación, pulse el botón Ordenar." + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "Complemento Corrector ortográfico" + +#: C/gedit.xml:1901(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"El complemento Corrector ortográfico revisa la ortografía del texto " +"seleccionado. Puede configurar gedit para revisar " +"la ortografía automáticamente, o puede revisar la ortografía manualmente, en " +"el idioma especificado. El idioma y las propiedades del revisor de " +"ortografía, se aplican por cada documento. Para usar el complemento " +"Corrector ortográfico, realice los siguientes pasos:" + +#: C/gedit.xml:1903(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Para abrir un archivo, seleccione HerramientasEstablecer idioma… para que " +"se muestre el cuadro de diálogo Establecer idioma…. " +"Seleccione el idioma apropiado de la lista. Pulse Aceptar para cerrar el cuadro de diálogo Establecer idioma…." + +#: C/gedit.xml:1906(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Para revisar la ortografía automáticamente, seleccione " +"HerramientasRevisar Ortografía " +"Automáticamente. Para quitar el revisor de " +"ortografía automático, seleccione HerramientasRevisar ortografía automáticamente otra vez. Cuando el revisor de ortografía automático es " +"seleccionado, un icono se visualiza al lado de Revisar " +"Ortografía Automáticamente artículo de menú. El revisor de " +"ortografía automático está sin seleccionar por omisión, cada vez que " +"gedit comienza." + +#: C/gedit.xml:1907(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Las ortografías desconocidas se muestran en un color diferente, y subrayado. " +"Pulse en el botón derecho en una ortografía desconocida, después seleccione " +"Sugerencias de ortografía del menú emergente:" + +#: C/gedit.xml:1910(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Para sustituir la ortografía desconocida por otra ortografía en la lista, " +"seleccione sustituir ortografía desde Sugerencias de ortografía del menú emergente." + +#: C/gedit.xml:1913(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Para anular la sangría, seleccione las líneas y elija " +"EditarAnular sangría." + +#: C/gedit.xml:1916(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Para ignorar todas las palabras de ortografía desconocida, así que no se " +"volverán a ver como desconocidas pero no serán añadidas a su diccionario " +"personal, seleccione Sugerencias de ortografíaIgnorar todo. La palabra " +"desconocida es ignorada sólo en la actual sesión de gedit." + +#: C/gedit.xml:1921(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Para seleccionar todo el texto de un archivo, seleccione " +"EditarSeleccionar todo." + +#: C/gedit.xml:1923(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Si no hay errores de ortografía, un diálogo de Información visualiza un mensaje expone que el documento no contiene palabras " +"mal escritas. Pulse Aceptar para cerrar el diálogo de " +"Información." + +#: C/gedit.xml:1925(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Si hay errores de ortografía, el Revisor de Ortografía " +"diálogo se visualiza:" + +#: C/gedit.xml:1928(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"La Palabra mal escrita se visualiza en la parte de " +"arriba del diálogo." + +#: C/gedit.xml:1931(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Una sugerencia de ortografía conocida es visualizada en la casilla de " +"textoCambiar a. Puede sustituirse ésta con otra palabra " +"conocida seleccionado una ortografía de la lista de Sugerencias, o puede introducir el texto directamente en la casilla de texto " +"de Cambiar a." + +#: C/gedit.xml:1934(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Para revisar la ortografía del texto en la casilla de texto de " +"Cambiar por, pulse Comprobar palabra. Si ésta es una palabra conocida, la lista Sugerenciasserá sustituida con el texto (ortografía correcta). Si la palabra es desconocida, aparecerán nuevas entradas en la " +"lista de Sugerencias." + +#: C/gedit.xml:1937(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Para ignorar en ese momento la palabra desconocida señalada, pulse " +"Ignorar. Para ignorar todas las palabras " +"desconocidas, pulse Ignorar todo. La palabra " +"desconocida es ignorada sólo en la sesión actual de gedit." + +#: C/gedit.xml:1940(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Para cambiar la palabra desconocida señalada al texto en la casilla de texto " +"Cambiar a, pulse Cambiar. Para " +"cambiar todas las palabras desconocidas al texto en la casilla de texto " +"Cambiar por, pulse Cambiar todo." + +#: C/gedit.xml:1943(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Para añadir la palabra desconocida a su diccionario personal, pulse el botón " +"Añadir palabra." + +#: C/gedit.xml:1946(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Para cerrar el cuadro de diálogo Ir a la línea, pulse " +"en el botón Cerrar." + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "Complemento Lista de etiquetas" + +#: C/gedit.xml:1956(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"La aplicación Lista de etiquetas le permite " +"insertar etiquetas comunes de una lista en el panel lateral." + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "" +"Para utilizar el complemento Lista de etiquetas, realice los siguientes " +"pasos:" + +#: C/gedit.xml:1959(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Elija EditarPanel lateral." + +#: C/gedit.xml:1963(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Por omisión, el panel lateral muestra una solapa conteniendo una lista de " +"documentos abiertos. pulse en la solapa mostrando un icono + en la parte de " +"abajo del panel lateral para mostrar la solapa de listas de etiquetas." + +#: C/gedit.xml:1965(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Seleccione la categoría de etiquetas apropiada en la lista desplegable; por " +"ejemplo, Etiquetas HTML." + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Desplácese en la lista hasta encontrar la etiqueta deseada." + +#: C/gedit.xml:1971(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Para insertar una etiqueta en la posición del cursor del archivo actual, " +"pulse dos veces sobre la etiqueta en la lista. También puede emplear este " +"procedimiento:" + +#: C/gedit.xml:1973(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Para insertar una etiqueta en el archivo actual y cambiar el foco desde el " +"panel lateral al área de visualización, pulse Intro." + +#: C/gedit.xml:1976(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Para insertar una etiqueta en el archivo actual y mantener el foco en la " +"ventana del complemento Lista de etiquetas, pulse " +"MayúsIntro." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Jorge González , 2006-2009\n" +"María Majadas , 2005" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Nombre de usuario inserta el nombre de usuario del usuario actual en el " +#~ "documento." + +#~ msgid "User Name Plugin" +#~ msgstr "Complemento Nombre de usuario" + +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "El complemento Nombre de usuario inserta el " +#~ "nombre del usuario actual en el documento." + +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "Para insertar su nombre de usuario en la posición del cursor, elija " +#~ "EditarInsertar nombre de " +#~ "usuario." + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "@@image: 'figures/_gedit.png'; md5=cf962f5d9df721c1f4f4cef2780915ed" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "Para más información sobre cómo configurar el resaltado de sintaxis, vea " +#~ "la ." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Preferencias de Resaltado de Sintaxis" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "Permitir subrayado de sintaxis" + +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "" +#~ "Seleccione esta opción para resaltar la sintaxis del texto que está " +#~ "editando." + +#~ msgid "Highlight mode" +#~ msgstr "Modo de resaltado" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Use esta lista desplegable para seleccionar un modo de sintaxis que " +#~ "configurar." + +#~ msgid "Elements" +#~ msgstr "Elementos" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "" +#~ "Use esta lista desplegable para seleccionar un elemento de sintaxis para " +#~ "configurar." + +#~ msgid "Format buttons" +#~ msgstr "Botones de formato" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Use los siguientes botones para cambiar el formato de la sintaxis " +#~ "seleccionada:" + +#~ msgid "Button" +#~ msgstr "Botón" + +#~ msgid "Format" +#~ msgstr "Formato" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Mostrar icono para formato negrita." + +#~ msgid "Bold" +#~ msgstr "Cuerpo" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Mostrar icono para formato cursiva." + +#~ msgid "Italic" +#~ msgstr "Cursiva" + +#~ msgid "Shows icon for underline." +#~ msgstr "Mostrar icono para subrayar." + +#~ msgid "Underline" +#~ msgstr "Sangrar líneas" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Mostrar icono para tachar." + +#~ msgid "Strikethrough" +#~ msgstr "Tachar" + +#~ msgid "Foreground" +#~ msgstr "Primer plano" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Seleccione ésta opción para cambiar la fuente de color del elemento de " +#~ "sintaxis seleccionado. Pulse en el botón de color para visualizar el " +#~ "diálogo de selección de color, entonces seleccione la fuente de color." + +#~ msgid "Background" +#~ msgstr "Color del fondo" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Seleccione ésta opción para cambiar el color de fondo del elemento de " +#~ "sintaxis seleccionado. Pulse en el botón de color para visualizar el " +#~ "diálogo de selección de color, entonces seleccione el color de fondo." + +#~ msgid "Reset to Default" +#~ msgstr "Escritorio predeterminado" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Pulse en éste botón para reiniciar los valores por omisión del color de " +#~ "primer plano y el color de fondo del elemento de sintaxis seleccionado." + +#~ msgid "Colors" +#~ msgstr "Colores" + +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Seleccione esta opción para usar los colores predeterminados del tema en " +#~ "la ventana de texto de gedit." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Pulse en el botón Color del texto para que se " +#~ "muestre el cuadro de diálogo del selector de colores. Seleccione el color " +#~ "que desea usar para la visualización del texto en la ventana de " +#~ "gedit." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Pulse en el botón Color del fondo para que se " +#~ "muestre el cuadro de diálogo del selector de colores. Seleccione un color " +#~ "de fondo para la ventana de texto de gedit." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Pulse en el botón Color de texto seleccionado para " +#~ "que se muestre el cuadro de diálogo del selector de colores. Seleccione " +#~ "el color que desee usar en la visualización del texto seleccionado." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Pulse en el botón Color de selección para que se " +#~ "muestre el cuadro de diálogo del selector de colores. Seleccione el color " +#~ "de fondo que desee usar para resaltar una selección de texto." diff --git a/help/es/figures/gedit_window.png b/help/es/figures/gedit_window.png new file mode 100755 index 00000000..f04de297 Binary files /dev/null and b/help/es/figures/gedit_window.png differ diff --git a/help/fi/fi.po b/help/fi/fi.po new file mode 100755 index 00000000..41d63f74 --- /dev/null +++ b/help/fi/fi.po @@ -0,0 +1,4545 @@ +# gedit finnish help +# Copyright (C) 2008 Valto Wirkola. +# +# Valto Wirkola , 2008. +# Timo Jyrinki , 2008. +# Harri Pitkänen , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit\n" +"POT-Creation-Date: 2009-05-17 18:37+0000\n" +"PO-Revision-Date: 2009-09-12 19:31+0300\n" +"Last-Translator: Tommi Vainikainen \n" +"Language-Team: Finnish \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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Oikeudet tämän tiedoston kopioinnin, julkaisun ja/tai muokkauksen GNU Free " +"Documentation License GFDL) Version 1.1 tai minkä tahansa Free Software " +"Foundation julkaiseman uudemman käyttöoikeuslisenssin version ehtojen " +"mukaisesti ilman välilukuja, kansi- tai lopputekstejä. Löydät GFDL-" +"lisenssistä kopion tästä linkistä tai tiedostosta COPYING-DOCS, joka jaettiin tämän käyttöoppaan kanssa." + +#: 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 "" +"Tämä käyttöopas on osa MATE:n GFDL-lisenssin alla julkaisemaa " +"käyttöopaskokoelmaa. Jos haluat jakaa tätä manuaalia erillään kokoelmasta, " +"voit tehdä niin lisäämällä kopion lisenssistä käyttöoppaaseen, kuten " +"lisenssin luvussa 6 kerrotaan." + +#: 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 "" +"Monet yritysten käyttämät tuotteiden ja palveluiden nimet ovat omistettuja " +"tavaramerkkejä. Kun näitä nimiä näkyy MATE:n dokumentaatiossa ja MATE " +"Documentation Project:in jäsenet ovat korostaneet näitä tavaramerkkejä, " +"nimet on kirjoitettu isolla alkukirjaimella tai kokonaan isoilla kirjaimilla." + +#: 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 " +"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 "ASIAKIRJA TARJOTAAN \"SELLAISENAAN\", ILMAN MINKÄÄN LAISTA TAKUUTA, NIIN ILMAISTUA KUIN IMPLISIITTISTÄ, SISÄLTÄEN ILMAN RAJOITUKSIA TAKUUTA SIITÄ, ETTÄ ASIAKIRJA TAI SEN MUOKATTU VERSIO OLISI ILMAN VIRHEITÄ, MYYNTIKELPOINEN, SOVELTUVAT JOHONKIN TARKOITUKSEEN TAI EI-LOUKKAAVA. TÄYSI RISKI ASIAKIRJAN TAI SEN MUOKATUN VERSION LAADUSTA, TARKKUUDESTA TAI HYÖDYLLISYYDESTÄ ON SINULLA. MIKÄLI ASIAKIRJA TAI SEN MUOKATTU VERSIO OSOITTAUTUU VIALLISEKSI MISSÄÄN MIELESSÄ, SINÄ (EI ALKUPERÄINEN KIRJOITTAJA, TEKIJÄ TAI MUU MYÖTÄVAIKUTTAJA) VASTAAT KAIKKIEN TARPEELLISTEN PALVELUIDEN, KORJAUSTEN TAI OIKAISUJEN KULUISTA. TÄMÄ VASTUUVAPAUSLAUSEKE MUODOSTAA OLEELLISEN OSAN TÄSTÄ LISENSSISTÄ. MIHINKÄÄN ASIAKIRJAN TAI SEN MUOKATUN VERSION KÄYTTÖÖN EI OLE MYÖNNETTY LUPAA TÄSSÄ PAITSI TÄMÄN VASTUUVAPAUSLAUSEKKEEN MUKAISESTI; JA EI MISSÄÄN OLOSUHTEISSA TAI MINKÄÄN LAKITEORIAN ALAISUUDESSA, OIKEUDENLOUKKAUKSEN (SISÄLTÄEN HUOLIMATTOMUUDEN), SOPIMUKSEN TAI MUUTOIN, ASIAKIRJAN TAI SEN MUOKATUN VERSION ALKUPERÄISTÄ KIRJOITTAJAA, KETÄÄN MYÖTÄVAIKUTTAJAA TAI KETÄÄN JAKELIJAA, TAI KETÄÄN MINKÄÄN NÄISTÄ OSAPUOLISTA TOIMITTAJAA, OLE VASTUUSSA KENELLEKÄÄN HENKILÖLLE MISTÄÄN SUORASTA, EPÄSUORASTA, ERITYISESTÄ, VÄLITTÖMISTÄ TAI VÄLILLISISTÄ MINKÄÄN SORTIN VAHINGOISTA SISÄLTÄEN ILMAN RAJOITUSTA VAHINGOT MAINEEN MENETYKSESTÄ, TYÖN SEISAUKSISTA, TIETOKONEVAHINGOISTA TAI -VIRHEISTÄ, TAI MISTÄÄN MUUSTAKAAN VAHINGOSTA TAI TAPPIOISTA, JOTKA LIITTYVÄT ASIAKIRJAN JA SEN MUOKATTUJEN VERSIOIDEN KÄYTTÖÖN, EI EDES SILLOIN KUN OSAPUOLELLE ON KERROTTU TÄLLAISTEN VAHINKOJEN MAHDOLLISUUDESTA." + +#: 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: " +"" +msgstr "ASIAKIRJA JA SEN MUOKATUT VERSIOT TARJOTAAN GNU FREE DOCUMENTATION LICENSEN EHTOJEN MUKAISESTI YMMÄRTÄEN ETTÄ: " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Gedit-käyttöohje" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "MATE:n ohjeistusprojekti" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Ganary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Lisätty näppäinyhdistelmätauluun" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java Desktop System Documentation Team" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek tarjoaa tietoa aikaisemmista gedit-sovelluksen uudistuksista." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Tietolähteet" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George tarjoaa tietoa liitännäisistä." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit-opas V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Maaliskuu 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE Documentation Team" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit-käyttöopas V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Kesäkuu 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit-käyttöopas V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Elokuu 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit-käyttöopas V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Syyskuu 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit-käyttöopas V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Tammikuu 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit-käyttöopas V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Maaliskuu 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "gedit-käyttöopas V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Syyskuu 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "gedit-käyttöopas V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Maaliskuu 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "gedit-käyttöopas V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Heinäkuu 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "gedit-käyttöopas V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "MATE:n dokumentointitiimi" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Tämä käyttöopas kertoo gedit:in versiosta 2.16" + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Palaute" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "Ilmoittaaksesi viasta tai ehdottaaksesi jotakin gedit-sovellukseen tai tähän käyttöoppaaseen, seuraa opasteita MATE:n palautesivulle." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit on tekstinmuokkain MATE-työpöydälle. Se tarjoaa toistaiseksi helppoja " +"runkotoimintoja, kuten tulostuksen, oikeinkirjoituksen tarkistuksen, etsi ja " +"korvaa-toiminnon ja syntaksikorostimen. Lisää kehittyneitä toimintoja on " +"saatavilla liitännäisinä." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "tekstinmuokkain" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Johdanto" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"gedit-sovellus tarjoaa sinulle mahdollisuuden " +"luoda ja muokata tekstitiedostoja." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"gedit:in tarkoitus on olla yksinkertainen ja " +"helppokäyttöinen tekstinmuokkain. Lisää tehokkaita toimintoja saadaan " +"erilaisilla liitännäisillä, mahdollistaen erilaisten " +"asioiden tekemisen liittyen tekstin muokkaukseen." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Aluksi" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Gedit:in käynnistys" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"Voit käynnistää gedit:in seuraavilla tavoilla:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Sovellukset-valikosta" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Valitse ApuohjelmatTekstinmuokkain." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Komentorivi" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Suorita seuraava komento: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Oletuksena, kun avaat tekstitiedoston tiedostohallinnassa, gedit käynnistyy " +"ja näyttää tiedoston." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "gedit-ikkuna" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Kun käynnistät geditin, seuraavanlainen ikkuna " +"näytetään:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "gedit-ikkuna" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Näyttää gedit:in pääikkunan" + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "gedit-ikkuna sisältää seuraavat osat:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Valikkopalkki" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Valikkopalkin valikot sisältävät kaikki komennot, joita tarvitset " +"tiedostoillesi gedit:ssä." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Työkalupalkki" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"Työkalupalkki sisältää pienen kokoelman komentoja, joihin pääset " +"valikkopalkista." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Näyttöalue" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "Näyttöalue sisältää muokkaamasi tiedoston tekstin." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Tilarivi" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"Tilarivi näyttää tietoa gedit:in tämänhetkisistä " +"tapahtumista ja lisätietoa valikkokohdista. Tilarivi näyttää myös seuraavat " +"tiedot:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Osoittimen sijainti: rivin ja sarakkeen numero, jossa osoitin sijaitsee." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Muokkaustila: Jos muokkain on syöttötilassa, tilarivi sisältää tekstin " +"INS. Paina Insert-painiketta " +"vaihtaaksesi muokkaustilaa." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Sivupaneeli" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"Sivupaneeli näyttää listan avoimista asiakirjoista ja muuta tietoa riippuen " +"käytössä olevista liitännäisistä." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Oletuksena sivupaneeli ei näy. Näyttääksesi sen, valitse " +"NäytäSivupaneeli." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Alapaneeli" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Alapaneelia käytetään ohjelmointityökalujen, kuten Python-" +"konsoliliitännäisen tulosteiden näyttöön." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Oletuksena alapalkki ei näy. Näyttääksesi sen, valitse " +"NäytäAlapaneeli" + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Kun klikkaat oikealla hiirenpainikkeella gedit-" +"ikkunaa, sovellus näyttää ponnahdusvalikon. Valikko sisältää yleisimmät " +"tekstinmuokkauskomennot." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Kuten muissakin MATE-sovelluksissa, toimintoja voidaan suorittaa " +"geditissäkin muutamin tavoin: valikosta, " +"työkalupalkista ja tai pikanäppäimistä. Yleiset pikanäppäinkomennot kaikille " +"sovelluksille löytyy listattuna Käyttäjän oppaasta." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Gedit:in ajaminen komentoriviltä" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Voit avata gedit:iä komentoriviltä ja avata " +"yksittäisiä tai useita tiedostoja. Avataksesi useita tiedostoja " +"komentoriviltä, kirjoita seuraava komento ja paina Enter:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "tiedosto1.txt tiedosto2.txt tiedosto3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Vaihtoehtoisesti, voit määrittää URI-osoitteen tiedostonimen sijaan." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Saadaksesi lisätietoa gedit:in ajamisesta " +"komentorivillä, katso unix-käyttöoppaan gedit1-sivu." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Tiedostojenkäsittely" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Uuden asiakirjan luonti" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Tehdäksesi uuden asiakirjan, valitse TiedostoUusi. Sovellus näyttää uuden " +"tyhjän asiakirjan gedit-ikkunassa." + +#: C/gedit.xml:346(title) C/gedit.xml:1589(title) +msgid "Opening a File" +msgstr "Tiedoston avaus" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Avataksesi tiedoston, valitse TiedostoAvaa, Avaa " +"tiedostoja-dialogin näyttämiseksi. Valitse tiedostot, jotka " +"haluat avata, napsauta sitten Avaa-painiketta. " +"Tiedosto näytetään gedit-ikkunassa." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Näytä viimeisimmät tiedostot valikkokuvakkeen." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Sovellus kirjaa viiden viimeisimmän muokkaamasi tiedoston hakemistopolut ja " +"tiedostonimet ja näyttää valikkovalintoina Tiedosto-valikossa. Voit myös napsauttaa -" +"kuvaketta työkalupalkissa nähdäksesi listan viimeisimmistä tiedostoista." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"Voit avata useita tiedostoja gedit:ssä. Sovellus " +"lisää välilehden jokaiselle avatulle ikkunalle. Lisätietoa: ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Tallenna tiedosto" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Voit tallentaa tiedostoja seuraavin tavoin:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Tallentaaksesi muutokset jo olemassa olevaan tiedostoon, valitse " +"TiedostoTallenna." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Tallentaaksesi uuden tiedoston tai tai olemassa olevan tiedoston uudella " +"nimellä, valitse TiedostoTallenna nimellä. Syötä nimi " +"tiedostolle Tallenna nimellä-dialogissa ja napsauta " +"Tallenna." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Tallentaaksesi kaikki gedit:issä avoinna olevat " +"tiedostot, valitse AsiakirjatTallenna kaikki." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Sulkeaksesi kaikki gedit:issä auki olevat " +"tiedostot, valitse AsiakirjatSulje kaikki." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Tiedoston avaus URI-osoitteesta." + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Avataksesi tiedoston Uniform Resource Identifier (URI) -osoitteesta, toimi " +"seuraavien vaiheiden kautta:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Valitse TiedostoAvaa sijainti näyttääksesi Avaa sijainti-" +"dialogin." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Syötä avattavan tiedoston URI-osoite." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Käytä Merkistön koodaustapa-pudotusvalikkoa " +"asianmukaisen merkistökoodauksen valitsemiseksi." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Napsauta Avaa." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Hyväksyttyjä URI-tyyppejä ovat http:, ftp:, file:, ja kaikki " +"mate-vfs:n tukemat muodot." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Osa URI-tyypeistä avataan \"vain-luku\"-tilassa, ja kaikki tekemäsi " +"muutokset täytyy tallentaa muualle. HTTP sallii vain tiedostojen lukemisen. " +"FTP:llä avatut tiedostot ovat \"vain-luku\"-tilassa, koska kaikki FTP-" +"palvelimet eivät pysty etätallentamaan tiedostoja oikein." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"FTP-palvelimille tallentaminen voidaan kytkeä päälle Asetusten muokkaimella asettamalla avain /apps/gedit-2/preferences/" +"editor/save/writable_vfs_schemes, mutta tämä voi tuottaa " +"virheitä." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Välilehtien käyttö" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Kun useita tiedostoja on auki, gedit näyttää " +"välilehden jokaiselle asiakirjalle näyttöalueen " +"yläosassa. Vaihtaaksesi toiseen asiakirjaan, napsauta sen välilehteä." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Siirtääksesi asiakirjan toiseen gedit-ikkunan, " +"vedä tiedoston välilehti ikkunaan, johon haluat sen siirtää." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Siirtääksesi asiakirjan uuteen gedit-ikkunaan, " +"vedä sen välilehti työpöydälle, tai valitse AsiakirjatSiirrä uuteen ikkunaan." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Tekstinkäsittely" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Tekstinmuokkaus" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Voit muokata tiedoston tekstiä seuraavin tavoin:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Kirjoita uuttaa tekstiä näppäimistöllä. Vilkkuva syöteosoitin näyttää paikan, johon uusi teksti ilmestyy. Muuttaaksesi tätä " +"paikkaa, käytä näppäimistö nuolinäppäimiä tai napsauta hiirellä." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Kopioidaksesi valitun tekstin leikepöydälle, valitse " +"MuokkaaKopioi." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Poistaaksesi valitun tekstin tiedostosta ja siirtääksesi sen leikepöydälle, " +"valitse MuokkaaLeikkaa." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Poistaaksesi valitun tekstin pysyvästi tiedostosta, valitse " +"MuokkaaPoista." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Lisätäksesi leikepöydän sisällön osoittimen osoittamalle paikalle, valitse " +"MuokkaaLiitä. Sinun täytyy leikata tai kopioida tekstiä, ennen kuin voit " +"liittää sitä tiedostoon, joko gedit:isä tai toisesta sovelluksesta." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Valitaksesi kaiken tekstitiedoston sisällön, valitse " +"MuokkaaValitse kaikki." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Muutosten kumoaminen ja uudelleentekeminen" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Kumotaksesi tekemäsi muutoksen, valitse MuokkaaKumoa. Kumotaksesi tämän " +"toiminnon, valitse MuokkaaTee " +"uudelleen." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Etsi ja korvaa" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"gedit:ssä, on kaksi tapaa etsiä tekstiä. Voit " +"käyttää Etsi-dialogia etsiäksesi tietyltä alueelta " +"tekstiä, tai Incremental Search korostaaksesi sopivan " +"tekstin kirjoittaessasi." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Tekstin etsiminen" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Etsiäksesi tiedostosta tekstijonoa, tee seuraavat vaiheet:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Valitse EtsiEtsi avataksesi Etsi-dialogin." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "Kirjoita merkkijono, jonka haluat etsiä Hakusana-kenttään. Voit sisällyttää erikoismerkkejä kuten rivinvaihdon tai sarkaimen: katso ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Napsauta Etsi etsiäksesi tiedostosta ensimmäistä " +"sopivaa merkkijonoa osoittimesi sijainnin jälkeen. Jos gedit löytää merkkijonon, sovellus valitsee ensimmäisen merkkijonon " +"sijainnin. Muut sijainnit korostetaan." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Löytääksesi merkkijonon seuraavan sijainnin, napsauta Etsi tai valitse EtsiEtsi " +"seuraava. Etsiäksesi edellisen sijainnin " +"tekstistä, valitse EtsiEtsi " +"edellinen." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Kun olet sulkenut Etsi-dialogin, voit silti vielä " +"siirtää valintaa muihin tekstiä vastaaviin merkkijono-osumiin valitsemalla " +"EtsiEtsi Seuraava ja EtsiEtsi " +"edellinen." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Poistaaksesi korostuksen tekstistä, valitse EtsiÄlä korosta osumia." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Tarkentava haku" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"Tarkentava haku korostaa asiakirjasta kaikki tekstinpätkät, jotka ovat " +"yhteneviä sillä hetkellä kirjoittamasi merkkijonon kanssa. (Tämä on " +"samanlainen hakutoiminto kuin muutamissa web-selaimissa.)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Aloittaaksesi tarkentavan haun, valitse EtsiTarkentava haku. " +"Hakukenttä ilmestyy näyttöalueen yläosaan." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Ala kirjoittaa ja kaikki osuvat merkkijonot korostetaan asiakirjasta. " +"Ensimmäinen osuma osoittimen jälkeen valitaan." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Siirtääksesi valinnan seuraavaan osumaan, paina CtrlG hakukentän ollessa auki. Paina " +"CtrlShiftG palataksesi takaisin edelliseen osumaan." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Voit myös käyttää ylös- ja alas-nuolinäppäimiä tai hiiren rullaa " +"liikuttaaksesi valintaa osumien välillä." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Tekstin korvaaminen" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Etsiäksesi merkkijonoa tiedostosta ja korvataksesi sen toisella " +"merkkijonolla, tee seuraavat vaiheet:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Valitse EtsiKorvaa avataksesi Korvaa-dialogin." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Kirjoita merkkijono, jonka haluat etsiä EtsiHakusana-kenttään. Voit sisällyttää erikoismerkkejä kuten rivinvaihdon tai " +"sarkaimen: katso ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Kirjoita merkkijono, jonka haluat korvata merkkijonolla, joka löytyy " +"Korvaava merkkijono-kentästä." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Tutkiaksesi jokaista merkkijono-osumaa ennen korvaamista, napsauta " +"Etsi. Jos gedit löytää " +"merkkijonon, sovellus valitsee tämän merkkijonon. Napsauta " +"Korvaa korvataksesi valitun merkkijono-osuman. " +"Etsiäksesi seuraava merkkijono-osuman, napsauta Etsi " +"uudelleen." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Korvataksesi kaikki merkkijono-osumat koko asiakirjassa, napsauta " +"Korvaa kaikki." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Etsi ja korvaa -asetukset" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Etsi-dialogi ja Korvaa-dialogi " +"sisältävät molemmat seuraavat asetukset:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Valitse Huomioi kirjainkoko -valinta etsiäksesi " +"ainoastaan osumia kirjoittamallasi kirjainkoolla. Esimerkiksi " +"Huomioi kirjainkoko -valinnan ollessa päällä " +"hakusanalla \"Kissa\" ei löydy sanaa \"kissa\" tai \"KISSA\"." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Valitse Etsi kokonaista sanaa -valinta etsiäksesi " +"hakusanoillasi ainoastaan kokonaisia sanoja. Esimerkiksi valinnan ollessa " +"valittuna, hakusanalla \"kirja\" ei löydy sanoja \"kirjailija\" tai " +"\"kirjahylly\"." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Valitse Etsi taaksepäin -valinta etsiäksesi hakusanaa " +"osoittimesta asiakirjan alkuun päin." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Valitse Jatka alusta -valinta etsiäksesi asiakirjan " +"loppuun, palataksesi alkuun ja etsiäksesi vielä alkupään." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Erikoismerkit" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"Voit sisällyttää seuraavia merkintöjä tekstiin etsiäksesi ja korvataksesi " +"erikoismerkkejä:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Määrittää rivinvaihdon." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Määrittää sarkainmerkin." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Määrittää alkuunkelauksen." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"Vasemmalle nojaava kenoviivamerkki täytyy kiertää, jos sitä etsitään. " +"Esimerkiksi, jos etsit \"\\n\"-merkintää, sinun täytyy " +"kirjoittaa \"\\\\n\" Hakusana-kenttään. Tai jos etsit " +"merkintää kenoviivasarjalle, sinun täytyy kertoa kahdella haettavien " +"kenoviivojen määrä." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Osoittimen asettaminen tietylle riville" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Asettaaksesi osoittimen haluamallesi riville auki olevassa tiedostossa, " +"valitse EtsiSiirry riville.... Rivinumerokenttä aukeaa näyttöalueen yläosaan." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Aloita kirjoittamaan rivinumeroa, jolle haluat siirtää osoittimen ja " +"asiakirjan vierii halutulle riville." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Sulkeaksesi kentän ja siirtääksesi osoittimen halutulle riville, paina " +"Return." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Tulostus" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Sivuasetusten asettaminen" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Asettaaksesi sivuasetukset, valitse TiedostoSivuasetukset... avataksesi " +"Sivuasetukset-dialogin." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"Sivuasetukset-dialogi päästää sinut määrittämään " +"seuraavia tulostusasetuksia:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Yleiset-välilehtiosio" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Tulosta syntaksiväritys" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Valitse tämä valinta tulostaaksesi syntaksivärityksen. Lisätietoja " +"syntaksivärityksestä: ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Tulosta sivujen otsakkeet" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Valitse tämä asetus sisällyttääksesi otsakkeen jokaiseen tulostettavaan " +"sivuun. Et voi säätää otsakkeita." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "Rivinumerot" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Valitse Tulosta rivinumerot -valitsin sisällyttääksesi " +"rivinumerot tulostettaviin tiedostoihin." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Käytä Numeroinnin rivitystiheys ... rivin välein " +"numerovalitsinta määrittääksesi, kuinka usein tulostetaan rivinumerot. " +"Esimerkiksi 5 rivin välein, 10 rivin välein jne." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1168(guilabel) C/gedit.xml:1685(para) +msgid "Text Wrapping" +msgstr "Tekstin rivitys" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Valitse Käytä rivitystä-valitsin rivittääksesi tekstiä " +"seuraavalle riville rivin tullessa täyteen katkaisten mahdolliset sanat " +"tulostaessasi tiedostoon. Sovellus laskee rivitetyt rivit yksittäisenä " +"rivinä rivinumeroinnissa." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Valitse Älä jaa sanoja yli kahdelle riville -valitsin " +"rivittääksesi tekstin seuraavalle riville, sanavälien kohdalta " +"tulostettaessa tiedostoon." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Kirjasimet" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Tekstiosa" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Napsauta tätä painiketta valitaksesi käytettävän kirjasimen tulostettaessa " +"tiedoston tekstiosaa." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Rivinumerot" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Napsauta tätä painiketta valitaksesi kirjasimen rivinumeroinnin tulostukseen." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Otsakkeet ja alatunnisteet" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Napsauta tätä painiketta valitaksesi kirjasimen otsakkeiden ja " +"alatunnisteiden tulostukseen." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Palauttaaksesi oletuskirjasinasetukset tiedoston tulostukseen " +"gedit:llä, napsauta Palauta " +"oletuskirjasimet." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Asiakirjan tulostus" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Voit käyttää gedit:iä seuraavien " +"tulostustehtävien suoritukseen." + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Tulosta asiakirja tulostimelle" + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Tulosta tiedostoon." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Jos tulostat tiedostoon, gedit lähettää tiedoston " +"tulosteen esimuotoiltuun tiedostoon. Yleisimmät esimuotoilutiedostomuodot " +"ovat PostScript ja Portable Document Format (PDF)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Esikatsellaksesi tiedostoja ennen tulostusta, valitse " +"TiedostoTulostuksen esikatselu." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Tulostaaksesi avoinna olevan tiedoston tulostimelle tai tiedostoon, valitse " +"TiedostoTulosta avataksesi Tulosta-dialogin." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"Tulosta-dialogi päästää sinut määrittämään seuraavat " +"tulostusasetukset:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Työ-välilehti" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Tulostusalue" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Valitse yksi seuraavista vaihtoehdoista ilmoittaaksesi, montako sivua haluat " +"tulostaa:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Kaikki" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Valitse tämän vaihtoehto tulostaaksesi tiedoston kaikki sivut." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Rivit" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Valitse tämä vaihtoehto tulostaaksesi vain määrittämäsi rivit. Käytä " +"Tulostusalueen alku ja Tulostusalueen loppu valintakenttiä määrittääksesi rivialueen." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Valinta" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Valitse tämä vaihtoehto tulostaaksesi vain valitun tekstin. Tämä vaihtoehto " +"on käytettävissä vain, jos olet valinnut tekstiä." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Kopiot" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Käytä Kopioita valintakenttää määrittääksesi haluamasi " +"määrän kopioita, jotka haluat tiedostosta tulostaa." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Jos tulostaa useita kopioita samasta tiedostosta, valitse Kerää-valinta lajitellaksesi tulostetut kopiot." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Tulostin-välilehti" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Tulostin" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "Käytä pudotusvalikkoa valitaksesi tulostimen, jota haluat käyttää." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Asetukset" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Käytä pudotusvalikkoa valitaksesi tulostimen asetukset." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Säätääksesi tulostinta, napsauta Aseta. Esimerkiksi, " +"voit kytkeä päälle tai pois päältä duplex-tulostuksen tai ajastetun " +"tulostuksen, jos tämä toiminto on tulostimen tukema." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Sijainti" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "Käytä pudotusvalikkolistaa valitaksesi yhden tulostussijainneista:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Tulosta tiedoston CUPS-tulostimella." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Jos valittu tulostin on CUPS-tulostin, CUPS on ainoa " +"valinta pudotusvalikossa." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Tulosta tiedosto tulostimelle." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Tiedosto" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Tulosta tiedosto PostScript-tiedostoon." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Napsauta Tallenna nimellä avataksesi dialogin, jossa " +"voit määrittää nimen ja sijainnin PostScript-tiedostolle." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Mukautettu" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Käytä määritettyä komentoa tiedoston tulostukseen." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Kirjoita komennon nimi tekstilaatikkoon. Sisällytä kaikki " +"komentorivimääritteet." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Tila." + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Tämä toiminto ei ole tuettu tässä gedit:in versiossa." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Tyyppi" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Kommentti" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Paperi-välilehti" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Paperin koko" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Käytä pudotusvalikkoa valitaksesi koon paperille, jota haluat käyttää " +"tiedoston tulostukseen." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Leveys" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Käytä tätä valintakenttää määrittääksesi paperin leveyden. Käytä " +"pudotusvalikkoa vaihtaaksesi mittayksikköä." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Korkeus" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Käytä valintalaatikkoa määrittääksesi paperin leveyden" + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Syöttötapa" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "Käytä pudotusvalikkoa valitaksesi paperinsyöttötavan tulostimelle." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Tulostustapa" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Käytä pudotusvalikkoa valitaksesi tulostustavan sivun tulostukselle." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Asettelu" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Käytä pudotusvalikkoa valitaksesi sivun asettelu. Jokaisen valitsemasi " +"asettelun esikatselu näkyy Esikatselu-alueella." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Paperilokero" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Käytä pudotusvalikkoa valitaksesi paperilokeron." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Ohjelmointiominaisuudet" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Muutamat gedit:in ohjelmointiominaisuudet " +"tarjotaan liitännäisinä. Esimerkiksi Tag List -liitännäinen tarjoaa listan " +"yleisimmin käytetyistä merkinnöistä eri merkintäkielissä: katso ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Syntaksiväritys" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"Syntaksiväritys parantaa koodin luettavuutta ja näyttää tekstin eri osat eri " +"väreillä." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit valitsee sopivan syntaksiväritystilan " +"asiakirjan tyypin mukaan. Muuttaaksesi syntaksiväritystilaa, valitse " +"NäytäVäritystila ja valitse yksi seuraavista valikkovalinnoista:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Normaali" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Älä näytä syntaksiväritystä." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Lähdekoodit" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Näyttää syntaksikorostuksen lähdekoodin muokkaukseen. Käytä " +"Lähdekoodit-alavalikkoa valitaksesi " +"lähdekoodityypin." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Merkintä" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Näyttää syntaksivärityksen merkintäkielen muokkaukseen. Käytä " +"Merkintä-alavalikkoa valitaksesi " +"merkintäkoodityypin." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Komentojonot" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Näyttää syntaksivärityksen komentojonokoodia muokattaessa. Käytä " +"Komentojonot-alavalikkoa valitaksesi " +"komentojonokoodityypin." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Muut" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Näyttää syntaksikorostuksen muokattaessa muita koodityyppejä. Käytä " +"Muut-alavalikkoa valitaksesi koodityypin." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Komennon tulosteen ohjaus tiedostoon" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Voit käyttää gedit:iä ohjataksesi komennon " +"tulosteen tiedostoon. Esimerkiksi, tulostaaksesi ls-" +"komennon tekstitiedostoon, kirjoita ls | gedit, ja paina " +"Return." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Komennon ls tuloste näytetään uudessa tekstitiedostossa " +"gedit-ikkunassa." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Vaihtoehtoisesti voit käyttää Ulkoiset työkalut-" +"liitännäistä ohjataksesi komennon auki olevaan tiedostoon." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Pikanäppäimet" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Käytä pikanäppäimiä yleisten tehtävien suorittamiseen nopeammin kuin " +"hiirellä ja valikoilla. Seuraavat taulukot luettelevat kaikki " +"geditin pikanäppäimet." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Lisätietoa pikanäppäimistä: Työpöytäkäyttäjän opas." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "Välilehdet" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Pikanäppäimet välilehdille:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1016(para) C/gedit.xml:1044(para) C/gedit.xml:1091(para) +#: C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "Pikanäppäin" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) C/gedit.xml:1046(para) C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Command" +msgstr "Komento" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Vaihtaa seuraavaan välilehteen vasemmalla." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Vaihtaa seuraavaan välilehteen oikealla." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Sulkee välilehden." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Vaihto + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Tallentaa kaikki välilehdet" + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Vaihto + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Sulkee kaikki välilehdet" + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Hyppää seuraavaan nth-välilehteen" + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Tiedostot" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Pikanäppäimet tiedostojen käsittelyyn:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Luo uuden asiakirjan" + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Avaa asiakirjan" + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Avaa sijainnin" + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Tallentaa auki olevan asiakirjan levylle." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Vaihto + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Tallentaa avoinna olevan asiakirjan uudella tiedostonimellä." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Tulostaa avoinna olevan asiakirjan" + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Vaihto + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Tulostuksen esikatselu." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Sulkee avoinna olevan asiakirjan." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Sulkee Gedit:in." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1406(guimenu) +#: C/gedit.xml:1412(guimenu) C/gedit.xml:1418(guimenu) +#: C/gedit.xml:1424(guimenu) +msgid "Edit" +msgstr "Muokkaa" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Pikanäppäimet asiakirjojen muokkaukseen:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Kumoaa viimeisen toiminnon." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Vaihto + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Palauta viimeinen kumottu toiminto." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Leikkaa valitun tekstin tai alueen ja siirtää sen leikepöydälle." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Kopioi valitun tekstin tai alueen leikepöydälle." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Liittää leikepöydän sisällön." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Valitsee kaiken." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Poistaa rivin, jolla olet." + +#. ============= Panes ======================= +#: C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "Paneelit" + +#: C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Pikanäppäimet paneelien näyttämiseen ja piilottamiseen:" + +#: C/gedit.xml:1023(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "Näytä/piilota tämä paneeli." + +#: C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "Näytä/Piilota alapaneeli." + +#. ============= Search ======================= +#: C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "Etsiminen" + +#: C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "Pikanäppäimet etsimiseen:" + +#: C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "Etsii merkkijonoa." + +#: C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "Etsii seuraavan osuman merkkijonolle." + +#: C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Vaihto + G" + +#: C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "Etsii edellinen osuma merkkijonolle." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "Vuorovaikutteinen etsimistoiminto." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "Etsii ja korvaa." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Vaihto + K" + +#: C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "Poistaa korostukset." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "Menee riville." + +#. ============= Tools ======================= +#: C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "Työkalut" + +#: C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "Pikanäppäimet työkaluille:" + +#: C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "Vaihto + F7" + +#: C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "Tarkistaa oikeinkirjoitus (liitännäisellä)." + +#: C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Poistaa ohjaavan tyhjämerkin (liitännäisellä)." + +#: C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "Sisentää (liitännäisellä)." + +#: C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Vaihto + T" + +#: C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "Poistaa sisennyksen (liitännäisellä)." + +#: C/gedit.xml:1114(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "" +"Suorittaa komennon \"make\" paikallisessa hakemistossa (liitännäisellä)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Vaihto + D" + +#: C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "Hakemistolistaus (liitännäisellä)." + +#. ============= Help ======================= +#: C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "Ohje" + +#: C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "Pikanäppäimet ohjeille:" + +#: C/gedit.xml:1141(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "Avaa gedit:in käyttöoppaan." + +#: C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "Asetukset" + +#: C/gedit.xml:1156(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Säätääksesi gedit:iä, valitse " +"MuokkaaAsetukset. Asetukset-dialogi sisältää seuraavat " +"alaluokat:" + +#: C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "Näytä-välilehti" + +#: C/gedit.xml:1170(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Valitse Käytä rivitystä -asetus saadaksesi pitkät rivit " +"tulvimaan kappaleiksi ikkunasta ulos menevän rivin sijaan. Tällä vältät " +"pitkittäisen kelauksen." + +#: C/gedit.xml:1171(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Valitse Älä jaa sanoja yli kahdelle riville -asetus " +"rivittääksesi tekstin katkaisematta kokonaisia sanoja rivitettäessä tekstiä " +"seuraavalle riville. Tämä helpoittaa tekstin luettavuutta." + +#: C/gedit.xml:1177(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Valitse Näytä rivinumerot -asetus näyttääksesi " +"rivinumerot gedit-ikkunan vasemmalla puolella." + +#: C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "Nykyinen rivi" + +#: C/gedit.xml:1183(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Valitse Korosta nykyinen rivi -asetus korostaaksesi " +"rivin, jolla osoitin on." + +#: C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "Oikea reunus" + +#: C/gedit.xml:1189(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Valitse Näytä oikea reunus-valitsin näyttääksesi " +"pystysuoran viivan, joka merkitsee oikeaa reunusta." + +#: C/gedit.xml:1190(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Käytä Oikea reunus sarakkeessa:-lukurullaa " +"määrittääksesi pystysuoran viivan sijainnin." + +#: C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "Hakasulkujen vastaavuus" + +#: C/gedit.xml:1196(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Valitse Korosta vastaava hakasulku -asetus " +"korostaakseesi vastaavan hakasulun, kun osoitin on asetettu " +"hakasulkumerkille." + +#: C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "Muokkain-välilehti" + +#: C/gedit.xml:1209(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Käytä Sarkainleveys-lukurullaa määrittääksesi " +"syötettävän välin leveyden painettaessa Sarkain-näppäintä " +"geditissä." + +#: C/gedit.xml:1210(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Valitse Lisää välilyöntejä sarkaimien sijaan-asetus " +"määrittääksesi geditin syöttämään tyhjämerkkejä " +"sarkainmerkin sijaan painettaessa Sarkain-näppäintä." + +#: C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "Automaattinen sisennys" + +#: C/gedit.xml:1216(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Valitse Käytä automaattisisennystä-asetusta " +"määrittääksesi seuraavan rivin sisennyksen suhteessa nykyiseen riviin." + +#: C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "Tallentaminen" + +#: C/gedit.xml:1222(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Valitse Luo tiedostoista varmuuskopio ennen tallentamista-asetus luodaksesi varmuuskopion tiedostosta, joka kerta " +"tallentaessasi sitä. Tiedoston varmuuskopion tiedostonimen perässä on ~-" +"merkki." + +#: C/gedit.xml:1223(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Valitse Tallenna tiedostot automaattisesti ... minuutin välein-asetus tallentaaksesi nykyisen tiedoston automaattisesti " +"säännöllisin väliajoin. Käytä lukurullaa määrittääksesi, kuinka usein haluat " +"tallentaa tiedoston." + +#: C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "Kirjaseimet & Värit-välilehti" + +#: C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "Kirjasin" + +#: C/gedit.xml:1235(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Valitse Käytä järjestelmän tasalevyistä kirjasinta-" +"asetus käyttääksesi järjestelmän oletuskirjasinta tekstissä " +"gedit-teksti-ikkunassa." + +#: C/gedit.xml:1236(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"Muokkaimen kirjasin-kenttä näyttää kirjasimen, jota " +"gedit käyttää tekstin näyttämiseen. Napsauta " +"painiketta määrittääksesi kirjasimen tyypin, tyylin ja koon käytettäväksi " +"tekstissä." + +#: C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "Värimalli" + +#: C/gedit.xml:1242(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "Voit valita värimallin värimallien luettelosta. Oletuksena on asennettu seuraavat värimallit:" + +#: C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "Perinteinen" + +#: C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Perinteinen värimalli, joka pohjautuu gvimin värimalliin." + +#: C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "Koboltti" + +#: C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "Siniseen perustuva värimalli." + +#: C/gedit.xml:1257(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Kate-tekstieditorin käyttämä värimalli." + +#: C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Tango-väripaletin käyttämä tumma värimalli." + +#: C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Tango-väripaletin käyttämä värimalli." + +#: C/gedit.xml:1275(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "Voit lisätä uuden värimallin napsauttamalla Lisää... ja valitsemalla värimallitiedoston" + +#: C/gedit.xml:1276(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "Voit poistaa valitun värimallin napsauttamalla Poista" + +#: C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "Liitännäisasetukset" + +#: C/gedit.xml:1284(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Liitännäiset lisäävät lisäominaisuuksia gedit:" +"iin. Lisätietoa liitännäisistä ja sisäänrakennettujen liitännäisten " +"käytöstä: ." + +#: C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "Liitännäisten kytkeminen päälle" + +#: C/gedit.xml:1289(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Kytkeäksesi gedit-liitännäisen päälle, toimi " +"seuraavien ohjeiden mukaisesti:" + +#: C/gedit.xml:1292(para) C/gedit.xml:1313(para) C/gedit.xml:1635(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Valitse MuokkaaAsetukset." + +#: C/gedit.xml:1295(para) C/gedit.xml:1316(para) C/gedit.xml:1638(para) +msgid "Select the Plugins tab." +msgstr "Valitse Liitännäiset-välilehti." + +#: C/gedit.xml:1298(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"Valitse liitännäisen vieressä oleva ruksilaatikko liitännäisistä, jotka " +"haluat kytkeä päälle." + +#: C/gedit.xml:1301(para) C/gedit.xml:1322(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Napsauta Sulje sulkeaksesi Asetukset-dialogin." + +#: C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "Liitännäisen kytkeminen pois päältä" + +#: C/gedit.xml:1309(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Liitännäinen pysyy kytkettynä, kun suljet gedit:" +"in." + +#: C/gedit.xml:1310(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Kytkeäksesi gedit-liitännäisen pois päältä, toimi " +"seuraavien ohjeiden mukaisesti:" + +#: C/gedit.xml:1319(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Poista valinta poistettavien liitännäisten nimien vieressä olevista " +"ruksilaatikoista." + +#: C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "Liitännäiset" + +#: C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "Liitännäisten kanssa toiminen" + +#: C/gedit.xml:1334(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Voit lisätä lisätoimintoja gedit:iin kytkemällä " +"liitännäisiä päälle. Liitännäinen on täydentävä " +"ohjelma, joka parantaa sovelluksen toiminnallisuutta. Liitännäiset lisäävät " +"uusia valintoja gedit:in uusille toiminnoilleen." + +#: C/gedit.xml:1336(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Muutamia liitännäisiä on gedit:ssä " +"sisäänrakennettuna ja voit asentaa niitä myös lisää. Gedit:in verkkosivustolta löydät listan 3. osapuolen tarjoamista liitännäisistä." + +#: C/gedit.xml:1337(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Kytkeäksesi liitännäisiä päälle tai pois, tai katsoaksesi, mitkä " +"liitännäiset ovat tällä hetkellä päällä, mene Liitännäisasetuksiin." + +#: C/gedit.xml:1338(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"Seuraavat liitännäiset ovat sisäänrakennettuina gedit:ssä:" + +#: C/gedit.xml:1344(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Muuta kirjainkokoa mahdollista kirjainkoon vaihtamisen tekstissä." + +#: C/gedit.xml:1347(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Asiakirjatilastot näyttää rivien, sanojen, ja " +"merkkien määrän asiakirjassa." + +#: C/gedit.xml:1350(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Ulkoiset " +"työkalut mahdollistaa lisäkomentojen suorittamisen " +"gedit:ssä." + +#: C/gedit.xml:1353(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Tiedostoselain mahdollistaa tiedostojen ja " +"kansioiden selailun sivupaneelissa." + +#: C/gedit.xml:1356(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Indent Lines adds or removes indentation from the selected lines." + +#: C/gedit.xml:1359(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Päiväys/Aika lisää aikaleiman asiakirjaan." + +#: C/gedit.xml:1362(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Tilarivit mahdollistaa muokkausasetusten asettamisen eri asiakirjoille, " +"ja se tukee Emacs, Kate ja Vim-tyylisiä tilarivejä." + +#: C/gedit.xml:1365(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Python-konsoli mahdollistaa python-ohjelmointikielen komentojen " +"ajamisen." + +#: C/gedit.xml:1368(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Tekstileikkeet mahdollistaa yleisten tekstinpätkien tallentamisen ja " +"syöttämisen nopeasti asiakirjaan." + +#: C/gedit.xml:1371(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Lajittelu järjestää valitut tekstirivit aakkosjärjestykseen." + +#: C/gedit.xml:1374(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Oikoluku korjaa kirjoitusvirheet valitussa tekstissä, tai merkitsee " +"virheet automaattisesti asiakirjaan." + +#: C/gedit.xml:1377(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Merkintälista mahdollistaa yleisten eri kielien (esim. HTML) merkintöjen " +"lisäämisen listasta sivupaneelista." + +#: C/gedit.xml:1381(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "Lisätietoa liitännäisten luomisesta, katso gedit:in web-sivusto." + +#: C/gedit.xml:1385(title) +msgid "Change Case Plugin" +msgstr "Vaihda kirjainkokoa -liitännäinen" + +#: C/gedit.xml:1386(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"The Vaihda kirjainkokoa -liitännäinen vaihtaa " +"valitun tekstin kirjainkokoa." + +#: C/gedit.xml:1387(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Seuraavat valinnat lisätään Muokkaa -valikkoon, kun " +"Vaihda kirjainkokoa -liitännäinen on kytketty:" + +#: C/gedit.xml:1397(para) +msgid "Menu Item" +msgstr "Valikkovalinta" + +#: C/gedit.xml:1399(para) +msgid "Action" +msgstr "Toiminto" + +#: C/gedit.xml:1401(para) +msgid "Example" +msgstr "Esimerkki" + +#: C/gedit.xml:1407(guisubmenu) C/gedit.xml:1413(guisubmenu) +#: C/gedit.xml:1419(guisubmenu) C/gedit.xml:1425(guisubmenu) +msgid "Change Case" +msgstr "Vaihda kirjainkokoa" + +#: C/gedit.xml:1407(guimenuitem) +msgid "All Upper Case" +msgstr "Kaikki isoja kirjaimia" + +#: C/gedit.xml:1408(para) +msgid "Change each character to uppercase." +msgstr "Muuttaa jokaisen kirjaimen isoksi." + +#: C/gedit.xml:1409(para) +msgid "This text becomes THIS TEXT" +msgstr "Esim. Kissa => KISSA" + +#: C/gedit.xml:1413(guimenuitem) +msgid "All Lower Case" +msgstr "Kaikki pieniä kirjaimia" + +#: C/gedit.xml:1414(para) +msgid "Change each character to lowercase." +msgstr "Muuttaa jokaisen kirjaimen pieneksi." + +#: C/gedit.xml:1415(para) +msgid "This Text becomes this text" +msgstr "Esim.Kissa => kissa" + +#: C/gedit.xml:1419(guimenuitem) +msgid "Invert Case" +msgstr "Käännä kirjainkoot päinvastaisiksi" + +#: C/gedit.xml:1420(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "Vaihtaa jokaisen ison kirjaimen pieneksi ja pienen kirjaimen isoksi." + +#: C/gedit.xml:1421(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Esim.Kissa => kISSA" + +#: C/gedit.xml:1425(guimenuitem) +msgid "Title Case" +msgstr "Iso alkukirjain" + +#: C/gedit.xml:1426(para) +msgid "Change the first character of each word to uppercase." +msgstr "Muuttaa jokaisen sanan ensimmäisen kirjaimen isoksi." + +#: C/gedit.xml:1427(para) +msgid "this text becomes This Text" +msgstr "" +"Esim.kissa juoksee => Kissa Juoksee" + +#: C/gedit.xml:1436(title) +msgid "Document Statistics Plugin" +msgstr "Asiakirjan tilastot -liitännäinen" + +#: C/gedit.xml:1437(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"Asiakirjan tilastot -liitännäinen laskee rivien, " +"sanojen, merkkien (ilman välilyöntejä tai niiden kanssa) ja tavujen määrän " +"asiakirjasta. Liitännäinen näyttää tulokset Asiakirjan tilastot -dialogissa. Käyttääksesi Asiakirjan tilastot -liitännäistä, toimi " +"seuraavien ohjeiden mukaisesti:" + +#: C/gedit.xml:1439(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Valitse TyökalutAsiakirjan " +"tilastot näyttääksesi Asiakirjan " +"tilastot-dialogin. Asiakirjan tilastot-" +"dialogi näyttää seuraavat tiedot tiedostosta:" + +#: C/gedit.xml:1442(para) +msgid "Number of lines in the current document." +msgstr "Rivien määrän asiakirjassa." + +#: C/gedit.xml:1445(para) +msgid "Number of words in the current document." +msgstr "Sanojen määrän asiakirjassa." + +#: C/gedit.xml:1448(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Merkkien määrän (mukaan lukien välilyöntimerkit) asiakirjassa." + +#: C/gedit.xml:1451(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Merkkien määrän (pois lukien välilyöntimerkit) asiakirjassa." + +#: C/gedit.xml:1454(para) +msgid "Number of bytes in the current document." +msgstr "Tavujen määrän asiakirjassa." + +#: C/gedit.xml:1459(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Voit jatkaa gedit-tiedoston päivittämistä " +"Asiakirjan tilastot-dialogin ollessa avoinna. " +"Päivittääksesi Asiakirjan tilastot-dialogin sisällön, " +"napsauta Päivitä." + +#: C/gedit.xml:1466(title) +msgid "External Tools Plugin" +msgstr "Ulkoiset työkalut -liitännäinen" + +#: C/gedit.xml:1467(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"Ulkoiset työkalut -liitännäinen sallii ulkoisten " +"komentojen suorittamisen gedit:stä. Voit ohjata " +"sisältöä komentoon ja lisätä sen tulostetta (esim. sed), tai käynnistää määritellyn komennon (esim, make)." + +#: C/gedit.xml:1468(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Käytä Ulkoisten työkalujen hallintaa luodaksesi ja " +"muokataksesi komentoja. Suorittaaksesi ulkoisen komennon, valitse se " +"Työkalut-valikosta." + +#: C/gedit.xml:1471(title) +msgid "Built-in Commands" +msgstr "Sisäänrakennetut komennot" + +#: C/gedit.xml:1472(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"Seuraavat komennot tarjotaan Ulkoiset työkalut-" +"liitännäisellä:" + +#: C/gedit.xml:1474(term) +msgid "Build" +msgstr "Paketoi" + +#: C/gedit.xml:1476(para) +msgid "" +"Runs make in the current document's directory." +msgstr "Suorittaa make valitussa hakemistossa." + +#: C/gedit.xml:1479(term) +msgid "Directory Listing" +msgstr "Hakemistolistaus" + +#: C/gedit.xml:1481(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "Listaa asiakirjan kansion sisällön uuteen asiakirjaan." + +#: C/gedit.xml:1484(term) +msgid "Environment Variables" +msgstr "Ympäristömuuttujat" + +#: C/gedit.xml:1486(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Näyttää ympäristömuuttujalistan alapaneelissa." + +#: C/gedit.xml:1489(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1491(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Etsii käsitettä kaikista tiedostoista asiakirjan kansiosta käyttäen " +"lauseketäsmäystä. Tulokset näkyvät alapaneelissa." + +#: C/gedit.xml:1494(term) +msgid "Remove Trailing Spaces" +msgstr "Poista ohjausvälit" + +#: C/gedit.xml:1496(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Poistaa kaikki välilyöntimerkit asiakirjan rivien lopuista." + +#: C/gedit.xml:1503(title) +msgid "Defining a Command" +msgstr "Komennon määritys." + +#: C/gedit.xml:1504(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Lisätäksesi ulkoisen komennon, valitse TyökalutUlkoiset työkalut." + +#: C/gedit.xml:1505(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"Ulkoisten työkalujen hallinta-ikkunassa, napsauta " +"Uusi. Voit määrittää seuraavat tiedot uudelle " +"komennolle:" + +#: C/gedit.xml:1507(term) +msgid "Description" +msgstr "Selostus" + +#: C/gedit.xml:1509(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "Selostus näytetään tilarivillä, kun valikkokomento valitaan." + +#: C/gedit.xml:1512(term) +msgid "Accelerator" +msgstr "Kiihdytin" + +#: C/gedit.xml:1514(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Syötä pikanäppäin komennolle." + +#: C/gedit.xml:1517(term) +msgid "Commands" +msgstr "Komennot" + +#: C/gedit.xml:1519(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Varsinaiset ajettavat komennot. Muutamia gedit:in " +"ympäristömuuttujia voidaan käyttää komentojen sisältönä. Lisätietoa: ." + +#: C/gedit.xml:1522(term) +msgid "Input" +msgstr "Syöte" + +#: C/gedit.xml:1524(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Annettava sisältö komennolle (esim. stdin): koko " +"teksti asiakirjasta, valittu alue, rivi tai sana." + +#: C/gedit.xml:1527(term) +msgid "Output" +msgstr "Tuloste" + +#: C/gedit.xml:1529(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Mitä komentojen tulosteella tehdään: Näytä alapaneelissa, syötä uuteen " +"asiakirjaan tai nykyiseen asiakirjaan, loppuun, osoittimen kohdalle tai " +"korvaamaan valinnan tai koko asiakirjan." + +#: C/gedit.xml:1532(term) +msgid "Applicability" +msgstr "Kohteet" + +#: C/gedit.xml:1534(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Määrää, minkä tyyppisiä asiakirjoja komennolla voidaan käsitellä, esim. " +"tallennettuja tai tallentamattomia, paikallisia tai etäisiä." + +#: C/gedit.xml:1542(title) +msgid "Editing and Removing Tools" +msgstr "Työkalujen muokkaus ja poistaminen" + +#: C/gedit.xml:1543(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Muokataksesi työkalua, valitse se listalta ja tee muutokset sen asetuksiin." + +#: C/gedit.xml:1544(para) +msgid "To rename a tool, click it again in the list." +msgstr "Nimetäksesi työkalun, napsauta sitä listalta uudelleen." + +#: C/gedit.xml:1545(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Palauttaaksesi sisäänrakennetun työkalun, jota olet muokannut, paina " +"Palauta." + +#: C/gedit.xml:1546(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Poistaaksesi työkalun, valitse se ja paina Poista. Et " +"voi poistaa sisäänrakennettua työkaluja, ainoastaan niitä, jotka olet luonut " +"itse." + +#: C/gedit.xml:1550(title) +msgid "Variables" +msgstr "Muuttujat" + +#: C/gedit.xml:1551(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"Voit käyttää seuraavia muuttujia Komennot-kentässä " +"komentomäärittelyssä:" + +#: C/gedit.xml:1554(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1557(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1560(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1563(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1566(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1569(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1572(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1579(title) +msgid "File Browser Plugin" +msgstr "Tiedostoselain -liitännäinen" + +#: C/gedit.xml:1580(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Tiedostoselain-liitännäinen näyttää tiedostosi ja " +"kansiosi sivupaneelissa mahdollistaen tiedostojen nopean avaamisen." + +#: C/gedit.xml:1581(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Näyttääksesi tiedostoselaimen, valitse NäytäSivupaneeli ja napsauta " +"sitten välilehteä, joka näyttää tiedostoselainkuvakkeen sivupaneelin " +"alaosassa." + +#: C/gedit.xml:1583(title) +msgid "Browsing your Files" +msgstr "Tiedostojen selaus" + +#: C/gedit.xml:1584(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"Tiedostoselain-välilehti näyttää aluksi tiedostonhallinnan kirjanmerkkejä. " +"Selataksesi kohteen sisältöä kaksoisnapsauta sitä." + +#: C/gedit.xml:1585(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Näyttääksesi ylähakemiston, valitse se pudotusvalikosta tai paina ylös " +"osoittavaa nuolta tiedostonhallinnan työkalupalkista." + +#: C/gedit.xml:1586(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Näyttääksesi kansion, joka sisältää asiakirjan, jota juuri käsittelet, " +"napsauta oikealla hiiren painikkeella tiedostolistaa ja valitse " +"Aseta juuri aktiiviseen asiakirjan sijaintiin." + +#: C/gedit.xml:1590(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Avataksesi tiedoston gedit:ssä, kaksoisnapsauta " +"sitä tiedostolistassa." + +#: C/gedit.xml:1593(title) +msgid "Creating Files and Folders" +msgstr "Tiedostojen ja kansioiden luonti" + +#: C/gedit.xml:1594(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Luodaksesi uuden tyhjän tiedoston nykyiseen selaimessa näkyvään hakemistoon, " +"napsauta oikealla hiiren painikkeella tiedostolistaa ja valitse " +"Uusi tiedosto." + +#: C/gedit.xml:1595(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Luodaksesi uuden kansion selaimessa näkyvään hakemistoon, napsauta oikealla " +"hiiren painikkeella tiedostolistassa ja valitse Uusi kansio." + +#: C/gedit.xml:1600(title) +msgid "Indent Lines Plugin" +msgstr "Sisennä rivit -liitännäinen" + +#: C/gedit.xml:1601(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"Sisennä rivit -liitännäinen lisää tai poistaa " +"välilyöntejä tekstirivien alkuun." + +#: C/gedit.xml:1602(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Sisentääksesi tai ulontaaksesi tekstiä, toimi seuraavasti:" + +#: C/gedit.xml:1604(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Valitse rivit, jotka haluat sisentää. Sisentääksesi tai ulontaaksesi " +"yksittäisen rivin, aseta osoitin tälle riville." + +#: C/gedit.xml:1609(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Sisentääksesi tekstin, valitse Muokkaa" +"Sisennä." + +#: C/gedit.xml:1612(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Poistaaksesi sisennyksen, valitse MuokkaaPoista sisennys." + +#: C/gedit.xml:1617(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"Käytettyjen välilyöntien määrää ja käytettävä merkki (sarkain tai " +"välilyönti) riippuvat Sarkaimet-asetuksista " +"muokkainasetuksista. Lisätietoa: ." + +#: C/gedit.xml:1622(title) +msgid "Insert Date/Time Plugin" +msgstr "Päiväys/aika -liitännäinen" + +#: C/gedit.xml:1623(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Päiväys/aika -liitännäinen syöttää nykyisen " +"päivämäärän ja kellonajan asiakirjaan. Käyttääksesi päiväys/aika -" +"liitännäistä, toimi seuraavasti:" + +#: C/gedit.xml:1625(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Valitse MuokkaaLisää päiväys/" +"aika." + +#: C/gedit.xml:1626(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Jos et ole asettanut päiväys/aika -liitännäistä syöttämään päiväystä/aikaa " +"automaattisesti kysymättä muotoa, gedit näyttää " +"Lisää päiväys/aika-dialogin. gedit syöttää päiväyksen/ajan sen hetkisen sijaintiin aktiivisessa " +"tiedostossa." + +#: C/gedit.xml:1627(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Jos olet asettanut gedit:in käyttämään " +"määritettyä päiväys/aika-muotoa, Lisää päiväys/aika-" +"dialogia ei näytetä. Päiväys/aika syötetään automaattisesti sen hetkiseen " +"sijaintiin aktiivisessa tiedostossa." + +#: C/gedit.xml:1632(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Säädetään päiväys/aika -liitännäistä" + +#: C/gedit.xml:1633(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Säätääksesi päiväys/aika -liitännäistä, toimi seuraavasti:" + +#: C/gedit.xml:1641(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Valitse Lisää päiväys/aika-liitännäinen." + +#: C/gedit.xml:1644(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Napsauta Muokkaa liitännäisen asetuksia näyttääksesi " +"Muokkaa liitännäisen asetuksia-dialogin." + +#: C/gedit.xml:1647(para) +msgid "Select one of the options, as follows:" +msgstr "Valitse yksi seuraavista asetuksista:" + +#: C/gedit.xml:1649(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Määrittääksesi päiväys/aika-muodon aina päiväys/aika-toimintoa käytettäessä, " +"valitse Kysy muotoilua-asetus." + +#: C/gedit.xml:1652(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Käyttääksesi aina samaa gedit:in valikoimasta " +"löytyvää päiväys/aika-muotoilua päiväystä/aikaa syötettäessä, valitse " +"Käytä valittua muotoilua-asetus ja valitse sitten " +"sopiva muotoilu listasta. Kun valitset tämän asetuksen,gedit ei kysy sinulta päiväys/aika-muotoilua, kun " +"valitsetMuokkaaLisää päiväys/" +"aika." + +#: C/gedit.xml:1655(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Käyttääksesi aina samaa itse muotoiltua päiväys/aika-muotoilua päiväystä/" +"aikaa lisättäessä, valitse Käytä mukautettua muotoilua-" +"asetusta ja syötä sopiva muotoilu tekstilaatikkoon. Lisätietoa mukautetusta " +"muotoilusta: strftime3. Kun valitset tämän asetuksen, " +"gedit ei kysy sinulta muotoilua valitessasi " +"MuokkaaLisää päiväys/aika." + +#: C/gedit.xml:1660(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Napsauta OK sulkeaksesi Muokkaa päiväys/" +"aika -liitännäisen asetuksia-dialogin." + +#: C/gedit.xml:1663(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Sulkeaksesi Asetukset-dialogin, napsauta " +"Sulje." + +#: C/gedit.xml:1670(title) +msgid "Modelines Plugin" +msgstr "Tilarivit -liitännäinen" + +#: C/gedit.xml:1671(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Tilarivit-liitännäinen mahdollistaa asetusten " +"asettamisen yksilöllisille asiakirjoille. Tilarivi on " +"rivi tekstiä asiakirjan alussa tai lopussa, jonka gedit tunnistaa." + +#: C/gedit.xml:1672(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "Tilarivien asettamat asetukset ohittavat asetusdialogin asetukset." + +#: C/gedit.xml:1673(para) +msgid "You can set the following preferences with modelines:" +msgstr "Voit asettaa seuraavat asetukset tilariveillä:" + +#: C/gedit.xml:1676(para) +msgid "Tab width" +msgstr "Sarkaimen leveys" + +#: C/gedit.xml:1679(para) +msgid "Indent width" +msgstr "Sisennyksen leveys" + +#: C/gedit.xml:1682(para) +msgid "Insert spaces instead of tabs" +msgstr "Välilyöntien syöttö sarkaimien sijaan" + +#: C/gedit.xml:1688(para) +msgid "Right margin width" +msgstr "Oikean kehyksen leveys" + +#: C/gedit.xml:1692(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Tilarivit -liitännäinen tukee osajoukkoa muissa " +"tekstimuokkaimissa (Emacs, Kate ja Vim) käytetyistä asetuksista." + +#: C/gedit.xml:1695(title) +msgid "Emacs Modelines" +msgstr "Emacs-tilarivit" + +#: C/gedit.xml:1696(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"Ensimmäisiltä kahdelta riviltä etsitään Emacs-" +"tilarivejä." + +#: C/gedit.xml:1697(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Emacs-asetukset tab-width, indent-offset, indent-" +"tabs-mode ja autowrap ovat tuettuja. Lisätietoa: GNU Emacs " +"Käyttöopas." + +#: C/gedit.xml:1700(title) +msgid "Kate Modelines" +msgstr "Kate-tilarivit" + +#: C/gedit.xml:1701(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"Ensimmäisiltä ja viimeisiltä kymmeneltä riviltä etsitään Kate-tilarivejä." + +#: C/gedit.xml:1702(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Kate-asetukset tab-width, indent-width space-" +"indent, word-wrap ja word-wrap-column ovat tuettuja. Lisätietoa: Kate:n web-sivusto." + +#: C/gedit.xml:1705(title) +msgid "Vim Modelines" +msgstr "Vim-tilarivit" + +#: C/gedit.xml:1706(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"Ensimmäisiltä ja viimeisiltä kolmelta riviltä etsitään Vim-tilarivejä." + +#: C/gedit.xml:1707(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Vim-asetukset et, expandtab, ts, tabstop, sw, " +"shiftwidth, wrap ja textwidth ovat tuettuja. Lisätietoa: Vim:" +"in web-sivusto." + +#: C/gedit.xml:1712(title) +msgid "Python Console Plugin" +msgstr "Python-konsoli -liitännäinen" + +#: C/gedit.xml:1713(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Python-konsoli-liitännäinen mahdollistaa " +"komentojen jaon Python-ohjelmointikielellä gedit:" +"stä. Liitännäisen kytkeminen lisää välilehden alapaneeliin. Se näyttää " +"viimeisimmän tulosteen ja komentorivikentän." + +#: C/gedit.xml:1714(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Python-konsoliin syötettäviä komentoja ei tarkisteta ennen ajamista. On " +"mahdollista, että gedit jumiutuu, esimerkiksi " +"loputtomasta silmukasta." + +#: C/gedit.xml:1718(title) +msgid "Snippets Plugin" +msgstr "Tekstileikkeet-liitännäinen" + +#: C/gedit.xml:1719(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"Tekstileikkeet-liitännäinen mahdollistaa usein " +"käytettyjen tekstinpätkien (tekstileikkeiden) " +"syöttämisen ja niiden nopean syöttämisen asiakirjaan." + +#: C/gedit.xml:1720(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Tekstileikkeet ovat erilaisia, riippuen asiakirjan syntaksista. Esimerkiksi, " +"kun käsittelet HTML-asiakirjaa, voit valita listasta tekstileikkeitä, jotka " +"ovat hyödyllisiä HTML:ssä. Lisäksi on tekstileikkeitä, jotka ovat saatavilla " +"kaikkialla, jokaisessa asiakirjassa." + +#: C/gedit.xml:1721(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Muutamia sisäänrakennettuja tekstileikkeitä asentuu gedit:in mukana. Niitä voi muokata." + +#: C/gedit.xml:1724(title) +msgid "Inserting Snippets" +msgstr "Tekstileikkeiden lisääminen" + +#: C/gedit.xml:1725(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Lisätäksesi tekstileikkeen asiakirjaan, kirjoita sen " +"sarkainlaukaisin ja paina Sarkain. " +"Leikkeen sarkainlaukaisin on tavallisesti muutama ensimmäistä kirjainta " +"tekstileikkeestä tai jotain muuta, joka ei ole helppoa muistaa." + +#: C/gedit.xml:1726(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Vaihtoehtoisesti, paina CtrlVälilyönti nähdäksesi listan leikkeistä, joita voit lisätä." + +#: C/gedit.xml:1730(title) +msgid "Adding Snippets" +msgstr "Tekstileikkeiden lisääminen valikoimaan." + +#: C/gedit.xml:1731(para) +msgid "To create a new snippet, do the following:" +msgstr "Luodaksesi uuden tekstileikkeen, toimi seuraavasti:" + +#: C/gedit.xml:1734(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Valitse TyökalutHallitse " +"tekstileikkeitä. Tekstileikkeiden " +"hallinta-ikkuna aukeaa." + +#: C/gedit.xml:1737(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"Tekstileikelista on ryhmitelty kielittäin. Valitse kieli tai kieliryhmä " +"johon haluat lisätä leikkeen. Lisätäksesi leikkeen kaikille kielille, " +"valitse Kaikkialla listan yläosassa. Käsittelemäsi asiakirjan syntaksi " +"näytetään oletuksena." + +#: C/gedit.xml:1740(para) +msgid "Click New. A new snippet appears in the list." +msgstr "Napsauta Uusi. Uusi leike ilmestyy listaan." + +#: C/gedit.xml:1743(para) +msgid "Enter the following information for the new snippet:" +msgstr "Syötä seuraavat tiedot uuteen leikkeeseen:" + +#: C/gedit.xml:1745(term) +msgid "Name" +msgstr "Nimi" + +#: C/gedit.xml:1747(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Syötä nimi leikkeen tekstikenttään leikelistaan. Leikkeen nimi toimii " +"ainoastaan muistutuksena sen käyttötarkoituksesta. Voit vaihtaa luomasi " +"tekemäsi leikkeen nimeä napsauttamalla sitä listassa." + +#: C/gedit.xml:1750(term) +msgid "Snippet text" +msgstr "Leiketeksti" + +#: C/gedit.xml:1752(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Syötä leikkeen teksti Muokkaa tekstileikettä-" +"tekstikenttään. Sallitut erikoismerkit: ." + +#: C/gedit.xml:1753(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Voit vaihtaa takaisin asiakirjaikkunaan kopioimaan tekstiä sulkematta " +"Tekstileikkeiden hallinta-ikkuna." + +#: C/gedit.xml:1756(term) +msgid "Tab Trigger" +msgstr "Sarkainlaukaisin" + +#: C/gedit.xml:1758(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Syötä sarkainlaukaisin tekstileikkeelle. Tämä on teksti, jonka kirjoitat " +"ennen kuin painat Sarkain lisätäksesi leikkeen." + +#: C/gedit.xml:1759(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Tagilistan täytyy olla joko sana, joka koostuu kirjaimista tai mikä tahansa " +"yksittäinen kirjain. Sarkainlaukaisin korostaa " +"punaisella, jos virheellinen sarkainlaukaisin kirjoitetaan." + +#: C/gedit.xml:1762(term) +msgid "Shortcut key" +msgstr "Pikanäppäin" + +#: C/gedit.xml:1764(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Kirjoita pikanäppäin käytettäväksi leikkeen lisäämiseen." + +#: C/gedit.xml:1773(title) +msgid "Editing and Removing Snippets" +msgstr "Tekstileikkeiden muokkaus ja poistaminen" + +#: C/gedit.xml:1774(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Muokataksesi leikettä, valitse se listasta ja tee muutokset sen tekstiin ja " +"aktivointiasetuksiin." + +#: C/gedit.xml:1775(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Poistaaksesi leikkeen, napsauta sitä uudestaan listasta." + +#: C/gedit.xml:1776(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Palauttaaksesi sisäänrakennetun leikkeen, jota olet muokannut, paina " +"Palauta." + +#: C/gedit.xml:1777(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Poistaaksesi leikkeen, valitse se listasta ja paina Poista. Et voi poistaa sisäänrakennettua tekstileikkettä, ainoastaan " +"itse tekemäsi leikkeet." + +#: C/gedit.xml:1781(title) +msgid "Snippet Substitutions" +msgstr "Tekstileikkeiden korvaaminen" + +#: C/gedit.xml:1782(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Tallennetun tekstin lisäämisen lisäksi, leike voi sisältää muutettavaa " +"tekstiä tai siihen voidaan merkitä välejä, joihin voit lisätä tekstiä, kun " +"leike on lisätty asiakirjaasi." + +#: C/gedit.xml:1786(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "Voit käyttää seuraavia paikanmerkintäkoodeja leiketekstissä:" + +#: C/gedit.xml:1788(term) +msgid "Tab placeholders" +msgstr "Sarkainpaikkamerkki" + +#: C/gedit.xml:1790(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n merkitsee " +"sarkainpaikkamerkin, jossa n on mikä tahansa numerosta 1 " +"ylöspäin." + +#: C/gedit.xml:1791(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:oletus} korvaa sarkainpaikkamerkinnän oletusarvolla." + +#: C/gedit.xml:1792(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Sarkainpaikkamerkintä merkitsee paikan leiketekstissä, johon voit lisätä " +"tekstiä leikkeen lisäyksen jälkeen." + +#: C/gedit.xml:1793(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Käyttääksesi paikkamerkkejä, lisää leike normaalisti. Osoitin kohdistetaan " +"ensimmäiseen välilehtipaikkamerkkiin. Kirjoita teksti ja paina " +"Sarkain edetäksesi seuraavaan sarkainpaikkamerkkiin. Numero " +"paikkamerkintäkoodissa määrittää järjestyksen, jossa sarkain etenee " +"tekstissä paikasta toiseen." + +#: C/gedit.xml:1794(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Paina VaihtoSarkain " +"palauttaaksesi edellisen sarkainpaikkamerkin. Painettaessa Sarkain, kun paikkamerkkejä ei ole enää jäljellä, osoitin siirtyy " +"leiketekstin loppuun tai lopetuspaikkamerkintään, jos sellainen löytyy." + +#: C/gedit.xml:1797(term) +msgid "Mirror placeholders" +msgstr "Peilipaikkamerkinnät" + +#: C/gedit.xml:1799(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Toistettu sarkainpaikkamerkki peilaa jo määritellyn paikkamerkin. Tämä " +"mahdollistaa tekstin syötön kerralla kaikkiin niihin paikkoihin leikkeessä, " +"jossa haluat sen näkyvän." + +#: C/gedit.xml:1802(term) +msgid "End placeholder" +msgstr "Lopetuspaikkamerkki." + +#: C/gedit.xml:1804(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 määrittää lopetuspaikkamerkin. Tämä mahdollistaa työn " +"lopettamisen leikkeessä, ettei osoitinta siirretä leikkeen loppuun." + +#: C/gedit.xml:1807(term) +msgid "Environmental variables" +msgstr "Ympäristömuuttujat" + +#: C/gedit.xml:1809(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Ympäristömuuttuja, kuten $PATH ja $HOME korvataan tekstileikkeissä. Seuraavia gedit-riippuvaisia muuttujia voidaan myös käyttää:" + +#: C/gedit.xml:1811(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1813(para) +msgid "The currently selected text." +msgstr "Valittuna oleva teksti" + +#: C/gedit.xml:1816(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1818(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Koko tiedostonimi asiakirjaan, tai tyhjä merkkijono, jos asiakirjaa ei ole " +"tallennettu." + +#: C/gedit.xml:1821(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1823(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"Asiakirjan tiedostonimi tai tyhjä merkkijono, jos asiakirjaa ei ole vielä " +"tallennettu." + +#: C/gedit.xml:1826(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1828(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"Osoittimen kohdalla oleva sana asiakirjassa. Kun muuttujaa käytetään, " +"nykyinen sana korvataan leiketekstillä." + +#: C/gedit.xml:1836(term) +msgid "Shell placeholders" +msgstr "Komentorivipaikkamerkki" + +#: C/gedit.xml:1838(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) korvataan " +"komentorivisuorituksen tulosteella cmd" + +#: C/gedit.xml:1839(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) mahdollistaa viitteen annon paikkamerkille, jossa n on mikä tahansa lukua 1 suurempi luku. Käytä " +"$n käyttääksesi komentorivitulostetta " +"yhdestä komentorivipaikkamerkistä syötteenä toiseen." + +#: C/gedit.xml:1842(term) +msgid "Python placeholders" +msgstr "Python-paikkamerkit" + +#: C/gedit.xml:1844(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> korvataan " +"cmd:n tulosteella python-tulkista." + +#: C/gedit.xml:1845(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" määrittää toisen python-paikkamerkin riippuvuutena, jolle " +"a antaa leikkeen järjestyksen. Tämä mahdollistaa " +"python-funktioiden määrityksen toiseen leikkeeseen. Määrittääksesi useampia " +"riippuvuuksia, erittele numerot pilkuilla: $<a,b:cmd>" +"" + +#: C/gedit.xml:1846(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Käyttääksesi muuttujaa kaikissa python-leikkeissä, määritä se näkymään " +"kaikkialla (global)." + +#: C/gedit.xml:1855(title) +msgid "Sort Plugin" +msgstr "Lajittelu-liitännäinen" + +#: C/gedit.xml:1856(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Lajittelu-liitännäinen järjestää valitut " +"tekstirivit aakkosjärjestykseen." + +#: C/gedit.xml:1857(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Et voi peruuttaa lajittelutoimintoa, joten sinun tulisi tallentaa tiedosto " +"ennen lajittelu suorittamista. Palataksesi tallennettuun versioon, valitse " +"TiedostoPalauta levyltä." + +#: C/gedit.xml:1860(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Käyttääksesi Lajittelu-liitännäistä, toimi seuraavasti:" + +#: C/gedit.xml:1863(para) +msgid "Select the lines of text you want to sort." +msgstr "Valitse tekstirivit, jotka haluat järjestää." + +#: C/gedit.xml:1865(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Valitse MuokkaaLajittele-dialogi aukeaa." + +#: C/gedit.xml:1868(para) +msgid "Choose the options you want for the sort:" +msgstr "Valitse asetukset lajitteluun:" + +#: C/gedit.xml:1871(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Järjestääksesi tekstin käänteiseen järjestykseen, valitse " +"Käänteinen järjestys." + +#: C/gedit.xml:1874(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Poistaaksesi samanlaiset rivit, valitse Poista kaksoiskappaleet." + +#: C/gedit.xml:1877(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Jättääksesi kirjainkoon huomiotta, valitseJätä kirjainkoko " +"huomiotta." + +#: C/gedit.xml:1880(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Jättääksesi huomiotta rivien ensimmäisiä kirjaimia lajiteltaessa, aseta " +"ensimmäinen kirjain, jota tulisi käyttää järjestettäessä Aloita " +"sarakkeesta: -lukurullaaan." + +#: C/gedit.xml:1885(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"Suorittaaksesi lajittelutehtävän, paina Lajittele." + +#: C/gedit.xml:1892(title) +msgid "Spell Checker Plugin" +msgstr "Oikoluku-liitännäinen" + +#: C/gedit.xml:1893(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Oikoluku-liitännäinen tarkistaa valitun tekstin " +"oikeinkirjoitus. Voit säätää gedit tarkistamaan " +"oikeinkirjoituksen automaattisesti tai voit tarkistaa sen itse, haluamallasi " +"kielellä. Kieliasetus ja automaattisen tarkistuksen asetukset ovat " +"asiakirjakohtaisia. Käyttääksesi Oikoluku-liitännäistä, toimi seuraavasti:" + +#: C/gedit.xml:1895(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Valitse TyökalutAseta kieli nähdäksesi Aseta kieli-" +"dialogin. Valitse sopiva kieli listasta. Napsauta OK " +"sulkeaksesi Aseta kieli-dialogi." + +#: C/gedit.xml:1898(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Tarkistaaksesi oikeinkirjoituksen automaattisesti, valitse " +"TyökalutAutomaattinen oikoluku. Poistaaksesi automaattisen oikoluvun, valitse " +"TyökalutAutomaattinen oikoluku uudestaan. Kun automaattinen oikoluku on valittu, " +"kuvake näytetään Automaattinen oikoluku-valikon " +"vieressä. Automaattinen oikoluku ei ole automaattisesti kytketty, kun " +"gedit käynnistyy." + +#: C/gedit.xml:1899(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Tunnistamattomat kirjoitusasut näytetään eri värillä ja alleviivattuna. " +"Napsauta oikealla hiirenpainikkeella tunnistamattoman sanan päällä ja " +"valitse sitten Kirjoitusehdotuksia ponnahdusvalikosta:" + +#: C/gedit.xml:1902(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Korvataksesi tuntemattoman kirjoitusasun listalta löytyvältä vaihtoehdolla, " +"valitse korvaava kirjoitusasu Kirjoitusehdotuksia-" +"pudotusvalikosta." + +#: C/gedit.xml:1905(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Lisätäksesi tuntemattoman kirjoitusasun henkilönkohtaiseen sanakirjaasi, " +"valitse KirjoitusehdotuksiaLisää." + +#: C/gedit.xml:1908(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Ohittaaksesi kaikki tuntemattomat kirjoitusasut, ettei niitä myöskään " +"myöhemmin merkitä tuntemattomiksi, mutta niitä ei myöskään lisätä " +"sanakirjaasi, valitse KirjoitusehdotuksiaOhita kaikki. Tuntematon " +"sana ohitetaan ainoastaan nykyisessä gedit-" +"istunnossa." + +#: C/gedit.xml:1913(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Tarkistaaksesi oikeinkirjoituksen itse, valitse " +"TyökalutTarkista " +"oikeinkirjoitus." + +#: C/gedit.xml:1915(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Jos oikeinkirjoitusvirheitä ei löydy, Tietoa-dialogi " +"näyttää viestin, joka ilmoittaa, ettei asiakirja sisällä väärin " +"kirjoitettuja sanoja. Napsauta OK sulkeaksesi " +"Tietoa-dialogin." + +#: C/gedit.xml:1917(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Jos kirjoitusvirheitä löytyy, Tarkista oikeinkirjoitus-" +"dialogi näytetään:" + +#: C/gedit.xml:1920(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"Väärinkirjoitettu sana näytetään dialogin yläosassa." + +#: C/gedit.xml:1923(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Suositeltu tunnettu kirjoitusasu näytetään Mihin muutetaan-tekstikentässä. Voit korvata tämän toisella tunnetulla " +"kirjoitusasulla valitsemalla sen Ehdotukset-listasta " +"tai voit kirjoittaa tekstiä suoraan Mihin muutetaan-" +"tekstikenttään." + +#: C/gedit.xml:1926(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Tarkistaaksesi tekstin kirjoitusasun Mihin muutetaan-" +"tekstilaatikossa, napsauta Tarkista sana. Jos se on " +"tunnettu sana Ehdotukset-listasta se korvataan " +"tekstillä (correct spelling). Jos sana ei ole tunnettu, " +"uudet merkinnät ilmestyvät Ehdotukset-listaan." + +#: C/gedit.xml:1929(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Ohittaaksesi nykyisen tuntemattoman sanan osuman, napsauta Ohita. Ohittaaksesi kaikki tuntemattoman sanan osumat, napsauta " +"Ohita kaikki. Tuntematon sana ohitetaan vain " +"nykyisessä gedit-istunnossa." + +#: C/gedit.xml:1932(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Muuttaaksesi nykyisen tuntemattoman sanan osuman Mihin muutetaan-kentän sanaksi, napsauta Muuta. " +"Muuttaaksesi kaikki tuntemattoman sanan osumat tekstissä Mihin " +"muutetaan-tekstikentän sanaksi, napsauta Muuta kaikki." + +#: C/gedit.xml:1935(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Lisää tuntematon sana henkilökohtaiseen sanakirjaasi, napsauta " +"Lisää sana." + +#: C/gedit.xml:1938(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Sulkeaksesi Tarkista oikeinkirjoitus-dialogin, napsauta " +"Sulje." + +#: C/gedit.xml:1947(title) +msgid "Tag List Plugin" +msgstr "Merkintälista-liitännäinen" + +#: C/gedit.xml:1948(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Merkintälista-liitännäinen mahdollista yleisten " +"merkintöjen lisäämisen sivupaneelista." + +#: C/gedit.xml:1949(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Käyttääksesi Merkintälista-liitännäistä, toimi seuraavasti:" + +#: C/gedit.xml:1951(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Valitse NäytäSivupaneeli." + +#: C/gedit.xml:1955(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Oletuksena, sivupaneelissa näkyy välilehti avoinna olevista asiakirjoista. " +"Napsauta välilehteä, jonka alaosassa on +-merkki sivupaneelissa näyttääksesi " +"merkintälistavälilehden." + +#: C/gedit.xml:1957(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Valitse sopiva merkintäkategoria pudotusvalikosta. Esimerkiksi " +"HTML - Merkinnät." + +#: C/gedit.xml:1960(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Kelaa merkintälistaa löytääksesi sopivan merkinnän." + +#: C/gedit.xml:1963(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Syöttääksesi merkinnän osoittimen kohdalle nykyiseen tiedostoon, " +"kaksoisnapsauta merkintä merkintälistassa. Voit liittää merkinnän myös " +"seuraavasti:" + +#: C/gedit.xml:1965(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Lisätäksesi merkinnän nykyiseen tiedostoon tai vaihtaaksesi huomion " +"sivupaneelista näyttöalueelle, paina Return." + +#: C/gedit.xml:1968(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Lisätäksesi merkinnän nykyiseen tiedostoon ja pitää huomion " +"Merkintälista-liitännäinen-ikkunassa, paina " +"VaihtoReturn." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Valto Wirkola , 2008" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" + +#~ msgid "" +#~ "Type the string that you want to find in the Hakusana field. You can include special characters such as a new line or " +#~ "tab: see ." +#~ msgstr "" +#~ "Kirjoita merkkijono, jota haluat etsiä Etsittävä merkkijono-kenttään. Voit lisätä erikoismerkkejä, kuten rivinvaihdon tai " +#~ "sarkaimen, katso ." + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "Lisätietoa syntaksiväritysasetuksista: ." + +#~ msgid "Colors" +#~ msgstr "Värimalli" + +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Käytä Käytä järjestelmän oletusvärimallia-asetusta " +#~ "käyttääksesi oletusvärimallia gedit-teksti-" +#~ "ikkunassa." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Napsauta Normaalin tekstin väri-väripainiketta " +#~ "nähdäksesi värinvalitsindialogin. Valitse väri, jolla haluat normaalin " +#~ "tekstin näkyvän gedit-teksti-ikkunassa." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Napsauta Taustaväri-väripainiketta nähdäksesi " +#~ "värinvalintadialogin, josta voit valita taustavärin gedit-teksti-ikkunalle." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Napsauta Valitun tekstin väri-väripainiketta " +#~ "nähdäksesi värinvalitsindialogin. Valitse väri, jota haluat käyttää " +#~ "valitussa tekstissä." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Napsauta Valintaväri-väripainiketta avataksesi " +#~ "värinvalintadialogin. Valitse taustaväri käytettäväksi tekstivalinnan " +#~ "korostukseen." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Syntaksivärityksen asetukset" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "Käytä syntaksiväritystä" + +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "Valitse tämä asetus värittääksesi muokkaamasi tekstin syntaksin." + +#~ msgid "Highlight mode" +#~ msgstr "Väritystila" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Käytä pudotusvalikkoa valitaksesi syntaksiväritystilan säätöä varten." + +#~ msgid "Elements" +#~ msgstr "Osat" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "Käytä tätä luettelokenttää valitaksesi syntaksiosat säätöä varten." + +#~ msgid "Format buttons" +#~ msgstr "Muotoilupainikkeet" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Käytä seuraavia painikkeita vaihtaaksesi muotoilun valittuun " +#~ "syntaksiosaan:" + +#~ msgid "Button" +#~ msgstr "Painike" + +#~ msgid "Format" +#~ msgstr "Muotoilu" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Näyttää kuvakkeen lihavointimuotoilulle." + +#~ msgid "Bold" +#~ msgstr "Lihavoitu" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Näyttää kuvakkeen kursivointimuotoilulle." + +#~ msgid "Italic" +#~ msgstr "Kursivoitu" + +#~ msgid "Shows icon for underline." +#~ msgstr "Näyttää kuvakkeen alleviivaukselle." + +#~ msgid "Underline" +#~ msgstr "Alleviivaus" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Näyttää kuvakkeen yliviivaukselle." + +#~ msgid "Strikethrough" +#~ msgstr "Yliviivaus" + +#~ msgid "Foreground" +#~ msgstr "Kirjasinväri" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Valitse tämä asetus vaihtaaksesi kirjasinvärin valittuun syntaksiosaan. " +#~ "Napsauta väripainiketta nähdäksesi värinvalintadialogin, valitse sitten " +#~ "kirjasinväri." + +#~ msgid "Background" +#~ msgstr "Taustaväri" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Valitse tämä valinta vaihtaaksesi taustavärin valittuun syntaksiosaan. " +#~ "Napsauta väripainiketta nähdäksesi värinvalintadialogin, valitse sitten " +#~ "taustaväri." + +#~ msgid "Reset to Default" +#~ msgstr "Palata oletukset" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Napsauta tätä painiketta palauttaaksesi kirjasinvärin ja taustavärin " +#~ "oletusarvot valittuun syntaksiosaan." + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Käyttäjänimi Lisää käyttäjänimen kohdistimen kohdalle." + +#~ msgid "User Name Plugin" +#~ msgstr "Käyttäjänimi-liitännäinen" + +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "Käyttäjänimi-liitännäinen lisää nykyisen " +#~ "käyttäjän käyttäjänimen asiakirjaan." + +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "Lisätäksesi käyttäjänimesi osoittimen kohdalle, valitse " +#~ "MuokkaaLisää käyttäjänimi." diff --git a/help/fi/figures/gedit_window.png b/help/fi/figures/gedit_window.png new file mode 100755 index 00000000..5ab890de Binary files /dev/null and b/help/fi/figures/gedit_window.png differ diff --git a/help/fr/figures/gedit_recent_files_menu_icon.png b/help/fr/figures/gedit_recent_files_menu_icon.png new file mode 100755 index 00000000..4b36c53a Binary files /dev/null and b/help/fr/figures/gedit_recent_files_menu_icon.png differ diff --git a/help/fr/figures/gedit_window.png b/help/fr/figures/gedit_window.png new file mode 100755 index 00000000..6c0b3bf5 Binary files /dev/null and b/help/fr/figures/gedit_window.png differ diff --git a/help/fr/fr.po b/help/fr/fr.po new file mode 100755 index 00000000..8eaddd79 --- /dev/null +++ b/help/fr/fr.po @@ -0,0 +1,4470 @@ +# French translation of gedit documentation. +# Copyright (C) 2006-2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the gedit documentation +# package. +# +# Vincent Untz , 2006. +# Jonathan Ernst , 2006. +# Philippe Lefevre , 2006. +# Christophe Bliard , 2006. +# Claude Paroz , 2007-2009. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit fr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-08-08 13:37+0000\n" +"PO-Revision-Date: 2009-04-11 17:33+0200\n" +"Last-Translator: Claude Paroz \n" +"Language-Team: MATE French Team \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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 link 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 lien ou dans le fichier " +"COPYING-DOCS fourni avec le présent manuel." + +#: 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 "" +"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/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 "" +"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/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 " +"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 "" +"LE PRÉSENT DOCUMENT EST FOURNI « TEL QUEL », SANS AUCUNE GARANTIE, EXPRESSE " +"OU IMPLICITE, Y COMPRIS, ET SANS LIMITATION, LES GARANTIES DE " +"MARCHANDABILITÉ, D'ADÉQUATION À UN OBJECTIF PARTICULIER OU DE NON INFRACTION " +"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É ; EN AUCUNE CIRCONSTANCE ET SOUS " +"AUCUNE INTERPRÉTATION DE LA LOI, QU'IL S'AGISSE D'UN DÉLIT CIVIL (Y COMPRIS " +"LA NÉGLIGENCE), CONTRACTUEL OU AUTRE, L'AUTEUR, LE RÉDACTEUR INITIAL, TOUT " +"PARTICIPANT OU TOUT DISTRIBUTEUR DE CE DOCUMENT OU DE SA VERSION MODIFIÉE, " +"OU TOUT FOURNISSEUR DE L'UNE DE CES PARTIES NE POURRA ÊTRE TENU RESPONSABLE " +"À 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, À UN ARRÊT DE TRAVAIL, À UNE DÉFAILLANCE OU UN MAUVAIS " +"FONCTIONNEMENT INFORMATIQUE, OU À TOUT AUTRE DOMMAGE OU PERTE LIÉE À " +"L'UTILISATION DU DOCUMENT ET DE SES VERSIONS MODIFIÉES, MÊME SI LADITE " +"PARTIE A ÉTÉ INFORMÉE DE L'ÉVENTUALITÉ DE TELS DOMMAGES." + +#: 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: " +"" +msgstr "" +"LE PRÉSENT DOCUMENT ET SES VERSIONS MODIFIÉES SONT FOURNIS SELON LES TERMES " +"DE LA LICENCE DE DOCUMENTATION LIBRE GNU SACHANT QUE : " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Manuel de gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Projet de documentation MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Ajout du tableau de raccourcis clavier" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Équipe de documentation Sun Java Desktop System" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "" +"Cicek a fourni des informations concernant les précédentes révisions de " +"l'application gedit." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Remerciements" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George a fourni des informations concernant les greffons." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Manuel de gedit V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Mars 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "L'équipe de documentation MATE de Sun" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Manuel de gedit V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Juin 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Manuel de gedit V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Août 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Manuel de gedit V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Septembre 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Manuel de gedit V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Janvier 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Manuel de gedit V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Mars 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Manuel de gedit V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Septembre 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Manuel de gedit V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Mars 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Manuel de gedit V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Juillet 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Manuel de gedit V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "L'équipe de documentation MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Ce manuel documente la version 2.16 de gedit." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Votre avis" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Pour rapporter une anomalie ou émettre une suggestion concernant " +"l'application gedit ou ce manuel, procédez comme " +"indiqué sur la page de réactions sur MATE." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit est un éditeur de texte pour le bureau MATE, contenant des " +"fonctionnalités basiques mais robustes telles que l'impression, la " +"vérification de l'orthographe, la recherche et le remplacement, et la " +"coloration syntaxique. Des fonctions plus avancées sont disponibles via des " +"greffons." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "éditeur de texte" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Introduction" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"L'application gedit permet de créer et d'éditer " +"des fichiers texte." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"Le but de gedit est d'être un éditeur de texte " +"simple et facile à utiliser. Des fonctionnalités plus puissantes peuvent " +"être activées avec différents greffons, offrant des " +"fonctions relatives à l'édition de texte." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Premiers pas" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Démarrage de gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"gedit peut être démarré de la façon suivante :" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Par le menu Applications" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Choisissez AccessoiresÉditeur de " +"texte." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "En ligne de commande" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Exécutez la commande : gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Par défaut, lorsque l'on ouvre un document de type texte dans le " +"gestionnaire de fichiers, gedit se lance et l'affiche." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "Fenêtre de gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Au démarrage de gedit, la fenêtre suivante " +"apparaît :" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Fenêtre de gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Affiche la fenêtre principale de gedit." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "Elle contient les éléments suivants :" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "La barre de menus" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"La barre de menu contient toutes les commandes nécessaires pour travailler " +"avec des fichiers dans gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "La barre d'outils" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"La barre d'outils contient un sous-ensemble des commandes accessibles depuis " +"la barre de menus." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "La zone d'affichage" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "La zone d'affichage contient le texte du document en cours d'édition." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "La barre d'état" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"La barre d'état contient des informations sur l'activité en cours dans " +"gedit ainsi que des informations contextuelles " +"sur les éléments de menu. Elle affiche également les informations suivantes :" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Position de curseur : numéros de ligne et de colonne où se trouve le curseur." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Mode d'édition : Si l'éditeur est en mode insertion, la barre d'état " +"contient le mot INS. S'il est en mode écrasement, la " +"barre d'état contient le mot ECR. Appuyez sur la touche " +"Inser pour changer de mode d'édition." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Le panneau latéral" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"Le panneau latéral affiche la liste des documents ouverts ainsi que des " +"informations sur les greffons actifs." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Par défaut, le panneau latéral n'est pas visible. Pour le faire apparaître, " +"choisissez AffichagePanneau " +"latéral." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Le panneau inférieur" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Le panneau inférieur est utilisé par des outils de programmation tels que le " +"greffon Console Python pour leur affichage." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Par défaut, le panneau inférieur n'est pas visible. Pour le faire " +"apparaître, choisissez AffichagePanneau inférieur." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Lorsque vous cliquez avec le bouton droit dans sa fenêtre, " +"gedit affiche un menu contextuel. Celui-ci " +"contient les commandes d'édition de texte les plus courantes." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Comme pour d'autres applications MATE, les actions dans gedit peuvent être réalisées de plusieurs façons : avec le menu, avec " +"la barre d'outils ou avec les raccourcis clavier. Les raccourcis communs à " +"toutes les applications sont décrites dans le Guide d'utilisation du bureau." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Lancement de gedit depuis la ligne de commande" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Il est possible de lancer gedit à partir de la " +"ligne de commande, et d'ouvrir un ou plusieurs documents. Pour cela, " +"saisissez la commande suivante et appuyez sur Entrée :" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "fichier1.txt fichier2.txt fichier3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Vous pouvez également indiquer un URI au lieu d'un nom de fichier." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Pour de plus amples informations sur l'exécution de gedit à partir de la ligne de commande, reportez-vous à gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Travailler avec des fichiers" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Création d'un nouveau document" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Pour créer un nouveau document, choisissez FichierNouveau. Un document vide " +"s'affiche alors dans la fenêtre de gedit." + +#: C/gedit.xml:346(title) C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "Ouverture d'un fichier" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Pour ouvrir un fichier, choisissez FichierOuvrir afin d'afficher la " +"boîte de dialogue Ouvrir des fichiers. Sélectionnez le " +"fichier à ouvrir, puis cliquez sur Ouvrir. Le fichier " +"est affiché dans la fenêtre de gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Montre l'icône du menu Documents récents." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"L'application enregistre les chemins d'accès et les noms des cinq derniers " +"fichiers ouverts et les affiche sous forme d'options de menu dans le menu " +"Fichier. Vous pouvez aussi " +"cliquer sur l'icône de la barre d'outils pour afficher " +"cette même liste." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"Comme il est possible d'ouvrir plusieurs documents dans gedit, l'application ajoute un onglet dans la fenêtre pour chaque " +"document ouvert. Pour plus d'informations à ce sujet, consultez ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Enregistrement d'un document" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Vous pouvez enregistrer vos documents de plusieurs façons :" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Pour enregistrer les changement d'un fichier existant, choisissez " +"FichierEnregistrer." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Pour enregistrer un nouveau fichier ou pour enregistrer un document existant " +"sous un nouveau nom, choisissez FichierEnregistrer sous. Nommez le " +"document dans la boîte de dialogue Enregistrer sous, " +"puis cliquez sur Enregistrer." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Pour enregistrer tous les documents ouverts dans gedit, choisissez DocumentsTout enregistrer." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Pour fermer tous les documents ouverts dans gedit, choisissez DocumentsTout fermer." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Ouverture d'un fichier depuis un emplacement" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Pour ouvrir un document depuis un emplacement (URI : Uniform Resource " +"Identifier), procédez comme suit :" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Choisissez FichierOuvrir un " +"emplacement pour afficher la boîte de dialogue " +"Ouvrir un emplacement." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Saisissez l'URI du fichier à ouvrir." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Choisissez l'encodage qui convient avec la liste déroulante Codage " +"des caractères." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Cliquez sur Ouvrir." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Voici quelques exemples d'URI pouvant être " +"utilisés : http:, ftp:, file:" +" ainsi que toutes les méthodes prises en charge par mate-" +"vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Les fichiers de certains types d'URI sont ouverts en lecture seule, et toute " +"modification d'un tel fichier doit être enregistrée à un autre emplacement. " +"HTTP ne permet que l'accès en lecture aux fichiers. Les fichiers ouverts par " +"FTP sont en lecture seule car certains serveurs FTP ne gèrent pas " +"correctement l'enregistrement de fichiers distants." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"L'enregistrement de fichiers sur les serveurs FTP peut être activé avec " +"l'Éditeur de " +"configuration, en paramétrant la clé /apps/" +"gedit-2/preferences/editor/save/writable_vfs_schemes, mais cela " +"peut provoquer des erreurs." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Utilisation des onglets" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Quand il y a plus d'un document ouvert, gedit " +"affiche un onglet au dessus de la zone d'affichage " +"pour chaque document. Pour passer d'un document à un autre, cliquez sur son " +"onglet." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Pour déplacer un document vers une autre fenêtre de gedit glissez son onglet jusqu'à la fenêtre où vous souhaitez le " +"déplacer." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Pour déplacer un document vers une nouvelle fenêtre de gedit, glissez son onglet sur le bureau, ou encore, choisissez " +"DocumentsDéplacer à la nouvelle " +"fenêtre." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Travailler avec du texte" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Édition" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Vous pouvez éditer le texte d'un document de plusieurs façons :" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Entrez le texte à partir du clavier. Le curseur d'insertion clignotant indique l'endroit où le texte frappé est inséré. Pour " +"modifier la position de ce curseur, utilisez les touches fléchées ou cliquez " +"avec la souris." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Pour copier le texte sélectionné vers le presse-papiers, choisissez " +"ÉditionCopier." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Pour supprimer du document le texte sélectionné et le déplacer vers le " +"presse-papiers, choisissez ÉditionCouper." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Pour supprimer définitivement le texte sélectionné du document, choisissez " +"ÉditionSupprimer." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Pour insérer le contenu du presse-papiers à l'endroit où est positionné le " +"curseur, choisissez ÉditionColler. Vous devez avoir " +"préalablement copié ou coupé du texte avant de pouvoir le coller dans le " +"document." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Pour sélectionner tout le texte d'un document, choisissez " +"ÉditionTout sélectionner." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Annulation et rétablissement des modifications" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Pour annuler une modification que vous avez faite, choisissez " +"ÉditionAnnuler. Pour restaurer une modification annulée, choisissez " +"ÉditionRétablir." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Recherche et remplacement de texte" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"Gedit fournit deux moyens pour faire des " +"recherches dans le texte. Utilisez Rechercher pour " +"trouver un morceau de texte particulier ou Recherche incrémentale pour mettre en surbrillance le texte au fur et à mesure que vous " +"le saisissez." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Recherche de texte" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "" +"Pour rechercher une chaîne de caractères dans un document, procédez comme " +"suit :" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Choisissez RechercherRechercher pour afficher la boîte de dialogue " +"Rechercher." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Saisissez la chaîne de caractères à rechercher dans le champ " +"Rechercher. Des caractères spéciaux comme le retour " +"chariot ou la tabulation peuvent être introduits. Voir : ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Cliquez sur Rechercher pour trouver la première " +"occurrence du texte après la position du curseur. Si gedit trouve le texte, l'application sélectionne la première " +"occurrence. Les autres occurrences sont mises en évidence." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Pour rechercher l'occurrence suivante ou précédente du texte, cliquez sur " +"Rechercher ou choisissez " +"RechercherRechercher le suivant ou Rechercher le " +"précédent." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Après avoir fermé la boîte de dialogue Rechercher, il " +"est toujours possible de rechercher les autres occurrences de la chaîne en " +"utilisant RechercherRechercher " +"le suivant ou Rechercher " +"le précédent." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Pour supprimer la surbrillance des parties de texte, choisissez " +"RechercherSupprimer la " +"coloration." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Recherche incrémentale" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"La recherche incrémentale place le texte recherché en surbrillance au fur et " +"à mesure qu'il est saisi. (Ce fonctionnement est similaire à celui utilisé " +"dans certains navigateurs web)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Pour l'utiliser, choisissez RechercherRecherche incrémentale. Une " +"boîte de recherche apparaît alors en haut de la zone d'affichage." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Commencez la saisie pour que le texte correspondant se mette en surbrillance " +"dans le document. De plus, la première occurrence trouvée après la position " +"du curseur est sélectionnée." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Pour sélectionner la prochaine occurrence tout en gardant la boîte de " +"recherche incrémentale ouverte, appuyez sur CtrlG. Appuyez sur CtrlMajusculeG pour revenir " +"à l'occurrence précédente." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Vous pouvez également utiliser les touches fléchées haut et bas ou la " +"molette de la souris pour vous déplacer parmi les occurrences trouvées." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Remplacement de texte" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Pour rechercher une chaîne de caractères dans un document et la remplacer, " +"procédez comme suit :" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Choisissez RechercheRemplacer pour afficher la boîte de dialogue " +"Remplacer." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Saisissez la chaîne de caractères à rechercher dans le champ " +"Rechercher. Il est possible d'y inclure des caractères " +"spéciaux tels que le retour chariot ou la tabulation. Voir : ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Indiquez dans le champ Remplacer par, la chaîne de " +"caractères devant remplacer la chaîne de caractère recherchée." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Pour examiner chaque occurrence du texte cherché avant de le remplacer, " +"cliquez sur Rechercher. Lorsqu'il est trouvé " +"gedit le sélectionne. Cliquez sur " +"Remplacer pour effectuer le remplacement. Cliquez à " +"nouveau sur Rechercher pour passer à l'occurrence " +"suivante." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Pour remplacer toutes les occurrences de la chaîne de caractères dans " +"l'ensemble du document, cliquez sur le bouton Remplacer tout." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Options de recherche et de remplacement." + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Les fenêtres de dialogue Rechercher et " +"Remplacer offrent les options suivantes :" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Cochez Respecter la casse pour ne rechercher que les " +"occurrences respectant la casse du texte saisi. Dans ce cas, par exemple, " +"les mots \"TEXTE\" et \"texte\" ne sont pas équivalents." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Cochez Mots entiers seulement pour ne rechercher que " +"les occurrences correspondant exactement au texte entré. Par exemple, avec " +"cette option, les mots \"texte\" et \"contexte\" ne correspondent pas." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Cochez Rechercher en arrière pour que la recherche se " +"fasse de la position du curseur vers le début du document." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Cochez Recherche circulaire pour que lorsqu'une " +"recherche atteint une extrémité du document, elle se poursuive en reprenant " +"à partir de l'autre extrémité." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Caractères spéciaux" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"Dans le texte à chercher ou à remplacer, il est possible d'inclure les " +"séquences d'échappement suivantes :" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Indique une nouvelle ligne." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Indique une tabulation." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Indique un retour chariot." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"La barre oblique inverse elle-même doit être échappée si elle est " +"recherchée. Par exemple, si vous recherchez le terme « \\n », vous devrez saisir « \\\\n » dans le champ Rechercher. Ou si vous recherchez une suite de barres obliques inverses, vous " +"devrez en doubler le nombre." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Positionnement du curseur sur une ligne particulière" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Pour placer le curseur à une ligne précise du fichier actuel, choisissez " +"RechercherAller à la ligne. La boîte de numéro de ligne apparaît alors en " +"haut de la zone d'affichage." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Saisissez le numéro de la ligne où vous souhaitez placer le curseur, et le " +"contenu du document défile jusqu'à la ligne indiquée." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Pour faire disparaître la boîte et placer le curseur à la ligne indiquée, " +"appuyez sur Entrée." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Impression" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Mise en page" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Pour configurer la mise en page, choisissez FichierMise en page pour afficher " +"la boîte de dialogue Mise en page." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"Cette boîte de dialogue permet d'indiquer les options d'impression " +"suivantes :" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Onglet Général" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Imprimer la coloration syntaxique" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Cochez cette option pour imprimer le texte avec la coloration syntaxique. " +"Pour plus d'informations à ce sujet, consultez ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Imprimer les en-têtes des pages" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Cochez cette option pour ajouter un en-tête sur chaque page imprimée. Les en-" +"têtes ne sont pas modifiables." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "Numéros de lignes" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Cochez l'option Imprimer les numéros de ligne pour " +"ajouter les numéros de ligne dans le texte imprimé." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Utilisez la zone de sélection numérique Numéro toutes les ... " +"lignes pour spécifier l'espacement des numéros de ligne, par " +"exemple toutes les 5 lignes, les 10 lignes, etc." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1176(guilabel) C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "Renvoi automatique à la ligne" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Cochez l'option Activer le retour à la ligne pour " +"renvoyer automatiquement à la ligne, au niveau du caractère, lors de " +"l'impression. À des fins de numérotation, l'application considère alors les " +"lignes issues du renvoi automatique comme de nouvelles lignes." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Cochez l'option Ne pas couper les mots sur deux lignes " +"pour que le renvoi automatique à la ligne se fasse au niveau du mot, lors de " +"l'impression." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Polices" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Corps" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Cliquez sur ce bouton pour choisir la police à utiliser pour l'impression du " +"corps du texte." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Numéros de lignes" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Cliquez sur ce bouton pour choisir la police à utiliser pour imprimer les " +"numéros de ligne." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "En-têtes et pieds de page" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Cliquez sur ce bouton pour choisir la police à utiliser pour l'impression " +"des en-têtes et des pieds de page." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Pour restaurer les polices proposées par défaut pour l'impression, cliquez " +"sur le bouton Restaurer les polices par défaut." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Impression d'un document" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Gedit permet d'exécuter les opérations " +"d'impression suivantes :" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Imprimer un document avec une imprimante." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Envoyer la sortie de la commande d'impression dans un fichier." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Si vous imprimez vers un fichier, gedit envoie le document dans un fichier " +"dans un format pré-traité. Les plus courants de ces formats sont PostScript " +"et PDF (Portable Document Format)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Affichez un aperçu des pages à imprimer avec FichierAperçu avant impression." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Pour imprimer le document actif sur une imprimante ou dans un fichier, " +"choisissez FichierImprimer. La boîte de dialogue Imprimer s'affiche." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "Les options d'impression suivantes sont disponibles :" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Onglet Travail" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Intervalle d'impression" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Sélectionnez l'une des options suivantes pour indiquer le nombre de pages à " +"imprimer :" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Tout" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Imprime toutes les pages du document." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Lignes" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Imprime les lignes spécifiées. Indiquez l'intervalle souhaité avec les zones " +"de sélection numérique De et À." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Sélection" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Imprime le texte sélectionné. Cette option n'est disponible que si vous avez " +"sélectionné du texte." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Copies" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Utilisez la zone de sélection numérique Nombre de copies pour indiquer le nombre d'exemplaires à imprimer." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Si vous imprimez plusieurs exemplaires du document, l'option " +"Rassembler permet de rassembler chaque copie." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Onglet Imprimante" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Imprimante" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Utilisez la liste pour choisir l'imprimante avec laquelle vous souhaitez " +"imprimer le document." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Paramètres" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Utilisez cette liste déroulante pour paramétrer l'impression." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Pour régler l'imprimante, cliquez sur Configurer. Par " +"exemple, il est possible de choisir une impression recto-verso ou de " +"planifier l'impression dans le temps, si cette option est prise en charge " +"par l'imprimante." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Emplacement" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Utilisez cette liste déroulante pour sélectionner l'une des destinations " +"d'impression suivantes :" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Impression du document avec une imprimante CUPS." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Si l'imprimante choisie est connue par CUPS, CUPS est " +"le seul choix dans la liste déroulante." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Impression du document à une imprimante." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Fichier" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Envoie le document dans un fichier PostScript." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Cliquez sur Enregistrer sous pour obtenir une boîte " +"de dialogue permettant de spécifier le nom et l'emplacement du fichier " +"postscript." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Personnalisé" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Commande à utiliser pour imprimer le document." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Saisissez la commande ainsi que tous ses arguments dans la fenêtre de texte." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Statut" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "" +"Cette fonctionnalité n'est pas prise en charge dans cette version de gedit." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Type" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Commentaire" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Onglet Papier" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Format du papier" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Sélectionnez le format du papier sur lequel imprimer le document dans la " +"liste déroulante." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Largeur" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"La zone de sélection numérique permet de spécifier la largeur du papier. La " +"liste déroulante adjacente offre la possibilité de modifier l'unité de " +"mesure utilisée." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Hauteur" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "" +"La zone de sélection numérique permet de spécifier la hauteur du papier." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Orientation du défilement" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"La liste déroulante permet de sélectionner l'orientation du papier dans " +"l'imprimante." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Orientation de la page" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "La liste déroulante permet de sélectionner l'orientation de la page." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Agencement" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"La liste déroulante permet de sélectionner l'agencement des pages. Un aperçu " +"de l'agencement choisi s'affiche dans la zone Aperçu." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Chargeur de papier" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "" +"La liste déroulante permet de sélectionner le bac de papier de l'imprimante." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Aides à la programmation" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Plusieurs aides à la programmation sont fournies par des greffons de " +"gedit. Par exemple, le greffon Liste de Balises " +"fournit les balises les plus communément utilisées par les différents " +"langages à balise : Voyez ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Coloration syntaxique" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"La coloration syntaxique rend les codes source plus faciles à lire en " +"colorant de manière différente certaines parties du texte." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit choisit automatiquement une coloration " +"syntaxique en fonction du type du document. Pour modifier ce choix, " +"choisissez AffichageMode de " +"coloration, puis sélectionnez l'une des entrées " +"de menu suivantes :" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Normal" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "N'utilise pas la coloration syntaxique." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Sources" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Active la coloration syntaxique. Sélectionnez le type de code source avec le " +"sous-menu Sources." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Balise" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Active la coloration syntaxique pour un code à balises. Sélectionnez le type " +"de balise avec le sous-menu Balisage." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Scripts" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Active la coloration syntaxique pour un code script. Sélectionnez le sous-" +"menu Scripts." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Autres" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Active la coloration syntaxique pour d'autres types de code. Sélectionnez le " +"sous-menu Autres." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Redirection de la sortie d'une commande shell dans un fichier" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"On peut rediriger la sortie d'une commande shell dans un document au travers " +"de gedit. Par exemple, pour rediriger la sortie " +"de la commande ls, entrez ls | gedit, " +"puis appuyez sur Entrée." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"La sortie de la commande s'affiche dans la zone d'affichage de " +"gedit, dans un nouveau document." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Vous pouvez encore utiliser le greffon Outils externes pour rediriger la sortie de la commande dans le document " +"courant." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Raccourcis clavier" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Les raccourcis clavier permettent d'effectuer des tâches courantes plus " +"rapidement qu'avec la souris et les menus. Les tableaux suivants énumèrent " +"tous les raccourcis clavier de gedit." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Pour en savoir plus sur les raccourcis clavier, consultez le Guide d'utilisation du " +"bureau MATE." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "Tabulations" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Raccourcis pour les onglets :" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) C/gedit.xml:1052(para) C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "Raccourci clavier" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) C/gedit.xml:1054(para) C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "Commande" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + Page haut" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Bascule sur l'onglet suivant vers la gauche." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + Page bas" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Bascule sur l'onglet suivant vers la droite." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Ferme l'onglet." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Maj + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Enregistre tous les onglets." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Maj + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Ferme tous les onglets." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Active le nième onglet." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Fichiers" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Raccourcis pour la manipulation des fichiers :" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Crée un nouveau document." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Ouvre un document." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Ouvre un emplacement." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Enregistre le document actuel." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Maj + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Enregistre le document actuel sous un nouveau nom." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Imprime le document actuel." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Maj + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Aperçu avant impression." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Ferme le document actuel." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Quitte Gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "Édition" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Raccourcis pour l'édition de documents :" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Annule la dernière action." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Maj + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Rétablit la dernière action annulée." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "" +"Coupe le texte ou la zone sélectionné et le place dans le presse-papiers." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Copie le texte ou la zone sélectionné dans le presse-papiers." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Colle le contenu du presse-papiers." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Sélectionne tout." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Supprime la ligne actuelle." + +#: C/gedit.xml:1003(para) +msgid "Alt + Up" +msgstr "Alt + flèche haut" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "Déplace la ligne sélectionnée d'une ligne vers le haut." + +#: C/gedit.xml:1007(para) +msgid "Alt + Down" +msgstr "Alt + flèche bas" + +#: C/gedit.xml:1008(para) +msgid "Move the selected line down one line." +msgstr "Déplace la ligne sélectionnée d'une ligne vers le bas." + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "Panneaux" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Raccourcis pour l'affichage et le masquage des panneaux :" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "Affiche ou masque le panneau latéral." + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "Affiche ou masque le panneau inférieur." + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "Recherche" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "Raccourcis pour la recherche :" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "Recherche un texte." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "Recherche la prochaine occurrence du texte." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Maj + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "Recherche l'occurrence précédente du texte." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "Recherche interactive." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "Recherche et remplace." + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Maj + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "Annule la surbrillance." + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "Se rendre à une ligne." + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "Outils" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "Raccourcis pour les outils :" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Maj + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "Vérifie l'orthographe (avec le greffon)." + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Enlève les espaces finales (avec le greffon)." + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "Indente les lignes (avec le greffon)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Maj + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "Supprime l'indentation (avec le greffon)." + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Exécute « make » dans le répertoire actuel (avec le greffon)." + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Maj + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "Affiche le contenu du répertoire (avec le greffon)." + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "Aide" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "Raccourcis pour l'aide :" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "Ouvre le manuel d'utilisation de gedit." + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "Préférences" + +#: C/gedit.xml:1164(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Pour configurer gedit, choisissez " +"ÉditionPréférences. La boîte de dialogue Préférences contient les catégories suivantes :" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "Affichage" + +#: C/gedit.xml:1178(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"L'option Activer le retour à la ligne permet d'activer " +"le renvoi automatique du texte à la ligne suivante lorsque un caractère " +"atteint la limite de la fenêtre de texte. Ceci évite d'avoir à faire défiler " +"le texte horizontalement." + +#: C/gedit.xml:1179(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Pour une lecture plus aisée, cochez l'option Ne pas couper les " +"mots. Elle permet de conserver l'intégralité d'un mot sur la même " +"ligne lorsque le renvoi de ligne est activé." + +#: C/gedit.xml:1185(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Cochez l'option Afficher les numéros de lignes pour " +"afficher les numéros de lignes du côté gauche de la fenêtre de " +"gedit." + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "Ligne actuelle" + +#: C/gedit.xml:1191(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Cochez l'option Surligner la ligne actuelle pour mettre " +"en évidence la ligne où se trouve le curseur." + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "Marge de droite" + +#: C/gedit.xml:1197(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Cochez l'option Afficher la marge de droite pour " +"afficher une ligne verticale représentant cette marge." + +#: C/gedit.xml:1198(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Utilisez la zone de sélection numérique Marge de droite à la " +"colonne pour indiquer la position de la ligne verticale." + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "Correspondance des parenthèses" + +#: C/gedit.xml:1204(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Cochez l'option Surligner les parenthèses correspondantes pour mettre en évidence les parenthèses correspondantes lorsque le " +"curseur se trouve sur une parenthèse." + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "Éditeur" + +#: C/gedit.xml:1217(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"La zone de sélection numérique Largeur des tabulations " +"permet de spécifier la largeur de la tabulation insérée lors de " +"l'utilisation de la touche Tabulation." + +#: C/gedit.xml:1218(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"L'option Insérer des espaces au lieu des tabulations " +"permet d'indiquer à gedit de remplacer les " +"tabulations par des espaces lors de l'utilisation de la touche " +"Tabulation." + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "Indentation automatique" + +#: C/gedit.xml:1224(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Cochez l'option Activer l'indentation automatique pour " +"indiquer que chaque prochaine prochaine ligne doit commencer au niveau " +"d'indentation de la ligne actuelle." + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "Enregistrement du fichier" + +#: C/gedit.xml:1230(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Cochez Créer une copie de sauvegarde des fichiers avant " +"l'enregistrement pour créer une copie de sauvegarde du document à " +"chaque fois que le document est enregistré. Le nom du fichier de sauvegarde " +"se termine par le signe ~." + +#: C/gedit.xml:1231(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Cochez Enregistrer automatiquement toutes les ... minutes pour enregistrer automatiquement le document actif à intervalles " +"réguliers. Indiquer dans la zone de sélection numérique l'intervalle de " +"temps entre ces enregistrements." + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "Police et couleurs" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "Police" + +#: C/gedit.xml:1243(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Cochez Utiliser la police du thème par défaut pour " +"utiliser la police par défaut du système pour le texte de la fenêtre de " +"gedit." + +#: C/gedit.xml:1244(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"Le champ Police de l'éditeur indique la police utilisée " +"par gedit pour afficher le texte. Le bouton " +"permet de spécifier son type, son style et sa taille." + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "Jeu de couleurs" + +#: C/gedit.xml:1250(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"Vous pouvez choisir un jeu de couleurs dans ls liste des jeux de couleurs. " +"Par défaut, les jeux de couleurs suivants sont installés :" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "Classique" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Un jeu de couleurs classique basé sur les couleurs gvim." + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Cobalt" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "Jeu de couleurs basé sur des tons bleus." + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Jeu de couleurs utilisé dans l'éditeur de texte Kate." + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Jeu de couleurs foncées utilisant la palette Tango." + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Jeu de couleurs utilisant la palette Tango." + +#: C/gedit.xml:1283(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Vous pouvez ajouter un nouveau jeu de couleurs en cliquant sur " +"Ajouter et en sélectionnant un fichier de jeu de " +"couleurs" + +#: C/gedit.xml:1284(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Vous pouvez supprimer le jeu de couleurs sélectionné en cliquant sur " +"Enlever" + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "Préférences des greffons" + +#: C/gedit.xml:1292(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Les greffons offrent des possibilités supplémentaires à gedit. Pour plus d'informations sur les greffons et comment utiliser " +"les greffons intégrés, voir ." + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "Activation d'un greffon" + +#: C/gedit.xml:1297(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Pour activer un greffon de gedit exécutez les " +"opérations suivantes :" + +#: C/gedit.xml:1300(para) C/gedit.xml:1321(para) C/gedit.xml:1643(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Choisissez Édition Préférences." + +#: C/gedit.xml:1303(para) C/gedit.xml:1324(para) C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "Sélectionnez l'onglet Greffons." + +#: C/gedit.xml:1306(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "Cochez la case en regard du nom du greffon à activer." + +#: C/gedit.xml:1309(para) C/gedit.xml:1330(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Cliquez sur Fermer pour fermer la boîte de dialogue " +"Préférences." + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "Désactivation d'un greffon" + +#: C/gedit.xml:1317(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Un greffon reste actif lorsque vous fermez gedit." + +#: C/gedit.xml:1318(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Pour activer un greffon dans gedit, suivez les " +"étapes ci-dessous :" + +#: C/gedit.xml:1327(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "Décochez la case en regard du nom du greffon à désactiver." + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "Greffons" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "Travail sur des documents" + +#: C/gedit.xml:1342(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Il est possible d'ajouter des fonctions supplémentaires à " +"gedit en validant les greffons. Un greffon est un programme annexe qui améliore les " +"fonctionnalités d'une application. Un greffon ajoute de nouvelles entrées " +"aux menus de gedit.suivant les fonctionnalités " +"apportées." + +#: C/gedit.xml:1344(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Certains greffons sont intégrés directement dans gedit mais on peut en installer d'autres. Le site de gedit recense les " +"greffons tierce partie." + +#: C/gedit.xml:1345(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Pour valider ou non l'utilisation d'un greffon ou pour voir la liste de ceux " +"qui le sont utilisez Préférences des " +"greffons." + +#: C/gedit.xml:1346(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"Les greffons suivants sont intégrés à gedit :" + +#: C/gedit.xml:1352(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Modifier la casse permet de modifier la casse du texte sélectionné." + +#: C/gedit.xml:1355(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Statistiques " +"du document affiche le nombre de lignes, de mots et de " +"caractères dans le document." + +#: C/gedit.xml:1358(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Outils externes permet d'exécuter des commandes externes depuis " +"gedit." + +#: C/gedit.xml:1361(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Navigateur de fichiers permet de parcourir vos " +"fichiers et vos dossier dans le panneau latéral." + +#: C/gedit.xml:1364(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Indenter les " +"lignes augmente ou réduit l'indentation des lignes " +"sélectionnées." + +#: C/gedit.xml:1367(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Insérer la date " +"et l'heure ajoute la date et l'heure actuelle dans un " +"document." + +#: C/gedit.xml:1370(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Modificateurs permet de définir des préférences d'édition pour chaque " +"document, et prend en charge les modificateurs d'Emacs, de Kate et de Vim." + +#: C/gedit.xml:1373(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Console Python permet de lancer des commandes dans le langage de " +"programmation Python." + +#: C/gedit.xml:1376(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Extraits de code permet de stocker des parties de code fréquemment " +"utilisées et de les insérer rapidement dans un document." + +#: C/gedit.xml:1379(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Trier " +"trie les lignes sélectionnées dans l'ordre alphabétique." + +#: C/gedit.xml:1382(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Vérificateur " +"orthographique corrige l'orthographe du texte " +"sélectionné, ou marque automatiquement les erreurs du document." + +#: C/gedit.xml:1385(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Liste des balises permet d'insérer des balises fréquemment utilisées pour " +"HTML et d'autres langages à partir du panneau latéral." + +#: C/gedit.xml:1389(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"Pour plus d'informations sur la création de greffons, consultez le site Web de " +"gedit." + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "Greffon Modifier la casse" + +#: C/gedit.xml:1394(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"Le greffon Modifier la casse change la casse du " +"texte sélectionné." + +#: C/gedit.xml:1395(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Quand le greffon Modifier la casse est activé, " +"les entrées de menu suivantes sont ajoutées au menu Édition :" + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "Entrée de menu" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "Action" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "Exemple" + +#: C/gedit.xml:1415(guisubmenu) C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "Changer la casse" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "Tout en majuscule" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "Passe chaque caractère en majuscule." + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "Ce texte devient CE TEXTE" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "Tout en minuscule" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "Passe chaque caractère en minuscule." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "Ce Texte devient ce texte" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "Inverser la casse" + +#: C/gedit.xml:1428(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "Inverse majuscules et minuscules pour chaque lettre." + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Ce Texte devient cE tEXTE" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "Casse du titre" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "Passe chaque initiale de mot en majuscule." + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "ce texte devient Ce Texte" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "Greffon Statistiques du document" + +#: C/gedit.xml:1445(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"Le greffon Statistiques du document compte le " +"nombre de lignes, de mots, de caractères avec ou sans espaces et d'octets du " +"document actif. Il affiche ensuite les résultats dans la boîte de dialogue " +"Statistiques du document. Pour l'utiliser, procédez " +"comme suit :" + +#: C/gedit.xml:1447(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Choisissez OutilsStatistiques du " +"document pour afficher la boîte de dialogue " +"Statistiques du document. La boîte de dialogue " +"Statistiques du document affiche les informations " +"suivantes concernant le document :" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "nombre de lignes du document courant." + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "nombre de mots du document." + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "nombre de caractères (espaces comprises) du document." + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "nombre de caractères (espaces non comprises) du document." + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "nombre d'octets du document." + +#: C/gedit.xml:1467(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Vous pouvez continuer à mettre le document gedit " +"à jour tandis que la boîte de dialogue Statistiques du document est ouverte. Pour en actualiser le contenu, cliquez sur le bouton " +"Mettre à jour." + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "Greffon Outils externes" + +#: C/gedit.xml:1475(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"Le greffon Outils externes permet d'exécuter des " +"commandes externes depuis gedit. Vous pouvez " +"transmettre des données à une commande pour exploiter sa sortie (par exemple " +"avec sed), ou lancer une commande prédéfinie (par " +"exemple make)." + +#: C/gedit.xml:1476(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Utilisez le Gestionnaire d'outils externes pour créer " +"et éditer les commandes. Pour lancer une commande externe, choisissez la " +"depuis le menu Outils." + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "Commandes prédéfinies" + +#: C/gedit.xml:1480(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"Le greffon Outils externes fournit les commandes " +"prédéfinies suivantes :" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Build (Construire)" + +#: C/gedit.xml:1484(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Lance make dans le répertoire du document actif." + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "Directory Listing (Contenu du répertoire)" + +#: C/gedit.xml:1489(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "" +"Affiche le contenu du répertoire du document actif dans un nouveau document." + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "Environment Variables (Variables d'environnement)" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Affiche les variables d'environnement dans le panneau inférieur." + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Recherche un terme dans tous les fichiers du répertoire du document actif, " +"en utilisant une correspondance de motif. Les résultats sont affichés dans " +"le panneau inférieur." + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "Remove Trailing Spaces (Enlever les espaces finales)" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Enlève toutes les espaces des fins de ligne du document." + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "Définition d'une commande" + +#: C/gedit.xml:1512(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Pour ajouter une commande externe, choisissez OutilsOutils externes." + +#: C/gedit.xml:1513(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"Dans la fenêtre Gestionnaire d'outils externes, cliquez " +"sur Nouveau. Renseignez les données suivantes de la " +"nouvelle commande :" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "Description" + +#: C/gedit.xml:1517(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"Cette description est affichée dans la barre d'état quand l'entrée de menu " +"est sélectionnée." + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "Raccourci" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Saisissez un raccourci clavier pour la commande." + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "Commande(s)" + +#: C/gedit.xml:1527(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Les commandes à lancer. De nombreuses variables d'environnement de " +"gedit peuvent être utilisées pour passer des " +"données à ces commandes : consultez ." + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "Entrée" + +#: C/gedit.xml:1532(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Les données à fournir aux commandes (comme un flux d'entrée " +"standard) : l'ensemble du texte du document actif, la sélection " +"active, la ligne active ou le mot actif." + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "Sortie" + +#: C/gedit.xml:1537(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"L'exploitation des données de sortie des commandes : les afficher dans le " +"panneau inférieur, les insérer dans un nouveau document, ou les ajouter au " +"document actif, à la fin, à la position du curseur, ou replacer la sélection " +"ou le document entier." + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "Applicabilité" + +#: C/gedit.xml:1542(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Détermine quels documents peuvent être affectés par la commande, par exemple " +"si le document est enregistré ou non, et s'il est local ou distant." + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "Édition et suppression d'outils" + +#: C/gedit.xml:1551(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Pour éditer un outil, sélectionnez-le dans la liste et effectuez les " +"modifications à ses propriétés." + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "Pour renommer un outil, cliquez à nouveau dessus dans la liste." + +#: C/gedit.xml:1553(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Pour restaurer un outil intégré que vous avez modifié, appuyez sur " +"Restaurer." + +#: C/gedit.xml:1554(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Pour enlever un outil, sélectionnez-le dans la liste et appuyez sur " +"Enlever. Il n'est pas possible de retirer un outil " +"intégré, uniquement ceux que vous avez créés." + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "Variables" + +#: C/gedit.xml:1559(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"Dans le champ Commande(s) définissant la commande à " +"exécuter, vous pouvez utiliser les variables suivantes :" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "Greffon Navigateur de fichiers" + +#: C/gedit.xml:1588(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Le greffon Navigateur de fichiers affiche vos " +"fichiers et vos dossiers dans le panneau latéral, permettant de les ouvrir " +"rapidement." + +#: C/gedit.xml:1589(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Pour afficher le navigateur de fichiers, choisissez " +"AffichagePanneau latéral puis cliquez sur l'onglet en haut du panneau " +"latéral montrant l'icône du navigateur." + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "Parcours de vos fichiers" + +#: C/gedit.xml:1592(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"L'onglet Navigateur de fichiers montre en premier lieu les signets de votre " +"gestionnaire de fichiers. Pour parcourir l'un d'entre eux, double-cliquez " +"dessus." + +#: C/gedit.xml:1593(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Pour afficher le dossier parent, sélectionnez-le depuis le menu déroulant ou " +"appuyez sur le bouton flèche vers le haut de la barre d'outils du navigateur " +"de fichiers." + +#: C/gedit.xml:1594(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Pour afficher le dossier qui contient le document sur lequel vous " +"travaillez, cliquez avec le bouton droit dans la liste des fichiers et " +"choisissez Définir la racine au document actif." + +#: C/gedit.xml:1598(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Pour ouvrir un fichier dans gedit, double-cliquez " +"dessus dans la liste des fichiers." + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "Création de documents et de dossiers" + +#: C/gedit.xml:1602(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Pour créer un nouveau document texte vide dans le dossier courant affiché " +"dans le navigateur, cliquez avec le bouton droit dans la liste des fichiers " +"et choisissez Nouveau fichier." + +#: C/gedit.xml:1603(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Pour créer un nouveau dossier dans le dossier actuellement affiché dans le " +"navigateur, cliquez avec le bouton droit dans la liste des fichiers et " +"choisissez Nouveau dossier." + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "Greffon Indenter les lignes" + +#: C/gedit.xml:1609(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"Le greffon Indenter les lignes augmente ou réduit " +"l'espace au début des lignes de texte." + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" +"Pour augmenter ou réduire l'indentation du texte, effectuez les opérations " +"suivantes :" + +#: C/gedit.xml:1612(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Sélectionnez les lignes à indenter. Pour n'agir que sur une seule ligne, " +"placez le curseur n'importe où sur celle-ci." + +#: C/gedit.xml:1617(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Pour augmenter l'indentation, choisissez ÉditionIndentation." + +#: C/gedit.xml:1620(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Pour retirer l'indentation, choisissez ÉditionDésindentation." + +#: C/gedit.xml:1625(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"La largeur des indentations et l'utilisation de tabulations ou d'espaces " +"dépendent des paramètres Tabulations dans les " +"préférences de l'éditeur : consultez ." + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "Greffon Insérer la date et l'heure" + +#: C/gedit.xml:1631(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Le greffon Insérer la date et l'heure permet " +"d'insérer la date et l'heure actuelles dans le document. Pour l'utiliser, " +"procédez comme suit :" + +#: C/gedit.xml:1633(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Choisissez ÉditionInsérer la " +"date et l'heure." + +#: C/gedit.xml:1634(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Si le greffon Insérer la date et l'heure n'est pas configuré pour le faire " +"automatiquement sans demander le format, gedit " +"affiche la boîte de dialogue Insertion de la date et de l'heure. Sélectionnez le format approprié dans la liste. Cliquez sur le " +"bouton Insérer pour fermer la boîte de dialogue ; " +"gedit insère la date et l'heure dans le document, " +"à l'emplacement du curseur." + +#: C/gedit.xml:1635(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Si gedit est configuré pour utiliser un format " +"date/heure particulier, la boîte de dialogue Insertion de la date " +"et de l'heure ne s'affiche pas et l'insertion se fait " +"automatiquement dans le document, à l'emplacement du curseur." + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Configuration du greffon Insérer la date et l'heure" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"Pour configurer le greffon Insérer la date et l'heure, suivez les étapes " +"indiquées ci-dessous :" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Sélectionnez le greffon Insertion de la date et de l'heure." + +#: C/gedit.xml:1652(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Cliquez sur le bouton Configurer le greffon pour " +"afficher la boîte de dialogue Configurer le greffon d'insertion de " +"date/heure." + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "Sélectionnez une des options comme indiqué ci-après :" + +#: C/gedit.xml:1657(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Pour définir le format date/heure à chaque insertion, sélectionnez l'option " +"Demander un format." + +#: C/gedit.xml:1660(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Pour utiliser le format proposé par gedit, " +"sélectionnez l'option Utilisez le format sélectionné, " +"puis sélectionnez-le dans la liste. Si cette option est activée, " +"gedit ne demande pas le format lorsque vous " +"choisissez ÉditionInsertion de " +"la date et de l'heure." + +#: C/gedit.xml:1663(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Pour utiliser le même format personnalisé à chaque insertion de la date et " +"de l'heure, sélectionnez l'option Utilisez un format personnalisé, puis entrez le format adéquat dans la zone de texte. Pour de plus " +"amples informations sur la définition d'un format personnalisé, reportez-" +"vous à strftime3. Si cette option est activée, " +"gedit ne demande pas le format lorsque vous " +"choisissez ÉditionInsertion de " +"la date et de l'heure." + +#: C/gedit.xml:1668(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Cliquez sur OK pour fermer la boîte de dialogue " +"Configurer le greffon d'insertion de date/heure." + +#: C/gedit.xml:1671(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Pour fermer la boîte de dialogue Préférences, cliquez " +"sur Fermer." + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Greffon Modificateurs" + +#: C/gedit.xml:1679(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Le greffon Modificateurs permet de définir des " +"préférences pour chaque document. Un modificateur est " +"une ligne de texte au début ou à la fin du document contenant des paramètres " +"reconnus par gedit." + +#: C/gedit.xml:1680(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Les préférences définies avec les modificateurs ont la priorité sur celles " +"définies dans la boîte de dialogue des préférences." + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "" +"Avec les modificateurs, vous pouvez définir les préférences suivantes :" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Largeur des tabulations" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "Largeur d'indentation" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "Insérer des espaces au lieu des tabulations" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "Marge de droite à la colonne" + +#: C/gedit.xml:1700(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Le greffon Modificateurs prend en charge " +"certaines des options utilisées par d'autres éditeurs de texte comme " +"Emacs, Kate et " +"Vim." + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Modificateurs d'Emacs" + +#: C/gedit.xml:1704(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"Les deux premières lignes d'un document sont analysées pour trouver les " +"modificateurs Emacs." + +#: C/gedit.xml:1705(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Les options d'Emacs, largeur de tabulation, " +"distance d'indentation, mode d'indentation des tabulations et repli de " +"ligne, sont prises en charge. Pour plus d'informations consultez le " +"manuel d'Emacs GNU." + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Modificateurs de Kate" + +#: C/gedit.xml:1709(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"Les modificateurs de Kate sont recherchés dans la " +"première et les dix dernières lignes du document." + +#: C/gedit.xml:1710(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Les options de Kate, largeur de tabulation, " +"espaces d'indentation et coupure des mots, sont prises en charge. Pour plus " +"d'informations consultez Le site Web de Kate." + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Modificateurs de Vim" + +#: C/gedit.xml:1714(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"Les modificateurs de Vim sont recherchés dans la " +"première et les trois dernières lignes du document." + +#: C/gedit.xml:1715(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Les options de Vim et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap et textwidth sont prises en charge. Pour plus " +"d'informations, consultez le site Web de Vim." + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Greffon Console Python" + +#: C/gedit.xml:1721(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Le greffon Console Python permet d'exécuter des " +"commandes de ce langage à partir de gedit. " +"Lorsque le greffon est activé, un onglet est ajouté au panneau inférieur. Il " +"montre les dernières sorties de commandes ainsi qu'un champ avec une invite " +"de saisie de commande." + +#: C/gedit.xml:1722(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Les commandes entrées à la console python ne sont pas vérifiées avant d'être " +"exécutées, aussi, il est possible de bloquer gedit en entrant, par exemple, une boucle infinie." + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "Greffon Extraits" + +#: C/gedit.xml:1727(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"Le greffon Extraits permet de stocker différentes " +"parties de texte fréquemment utilisées, appelées extraits et de les insérer rapidement dans un document." + +#: C/gedit.xml:1728(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Les extraits sont spécifiques à la syntaxe du langage du document courant. " +"Par exemple, avec un document HTML, on choisit une liste d'extraits adaptée " +"au HTML. Certains d'entre eux sont globaux et sont donc disponibles pour " +"tous les documents." + +#: C/gedit.xml:1729(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Un certain nombre d'extraits intégrés sont installés avec " +"gedit et peuvent être modifiés." + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "Insertion d'extraits" + +#: C/gedit.xml:1733(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Pour insérer un extrait dans un document tapez son déclencheur puis appuyez sur la touche Tabulation. Ce " +"déclencheur est en général constitué des premières lettres de l'extrait ou " +"de quelque chose de court et de facilement mémorisable." + +#: C/gedit.xml:1734(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Sinon, appuyez CtrlEspace pour afficher la liste des extraits qu'il est possible d'utiliser." + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "Ajout d'extraits" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "Création d'un nouvel extrait :" + +#: C/gedit.xml:1742(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Choisissez OutilsGérer les " +"extraits de code. La fenêtre " +"Gestionnaire des extraits de code s'ouvre." + +#: C/gedit.xml:1745(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"La liste des extraits est groupée par langages. Sélectionnez le langage dans " +"lequel doit être ajouté l'extrait ou un extrait de ce langage. Pour " +"l'ajouter à tous les langages, sélectionnez Global en haut de la liste. La " +"syntaxe du document actif est affichée par défaut." + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Cliquez sur Nouveau. Un nouvel extrait apparaît dans " +"la liste." + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "Fournissez les informations suivantes pour le nouvel extrait :" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "Nom" + +#: C/gedit.xml:1755(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Saisissez un nom dans le champ texte de la liste. Ce nom sert à se souvenir " +"de son utilité. Pour le modifier, cliquez dessus dans la liste." + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "Texte de l'extrait" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Saisissez le texte de l'extrait dans la zone de texte Modification " +"de l'extrait de code. Pour l'utilisation de codes spéciaux, voyez " +"." + +#: C/gedit.xml:1761(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Vous pouvez retourner dans la fenêtre du document pour copier du texte sans " +"fermer celle du Gestionnaire d'extraits." + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Déclencheur." + +#: C/gedit.xml:1766(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Entrez le déclencheur de l'extrait. C'est le texte que vous tapez avant " +"d'appuyer sur la touche Tabulation pour l'insérer." + +#: C/gedit.xml:1767(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Le déclencheur doit être un mot simple, constitué de quelques lettres, ou " +"d'un caractère unique. Le déclencheur deviendra rouge " +"si un commutateur invalide a été saisi." + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "Raccourci clavier" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Entrez le raccourci clavier à utiliser pour insérer l'extrait." + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "Édition et suppression des extraits" + +#: C/gedit.xml:1782(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Pour éditer un extrait, sélectionnez-le dans la liste et effectuez les " +"modifications dans son texte ou ses propriétés d'activation." + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Pour renommer un extrait, cliquez à nouveau dessus dans la liste." + +#: C/gedit.xml:1784(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Pour restaurer un extrait intégré que vous avez modifié, appuyez sur " +"Restaurer." + +#: C/gedit.xml:1785(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Pour enlever un extrait, sélectionnez le dans la liste et appuyez sur " +"Enlever. Il n'est pas possible de retirer un extrait " +"intégré, mais seulement ceux que vous avez crées." + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "Substitutions dans un extrait" + +#: C/gedit.xml:1790(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"En plus de l'insertion d'un texte précédemment stocké, un extrait peut " +"inclure un texte paramétrable avec des repères où il sera possible d'ajouter " +"du texte un fois l'extrait inséré dans le document." + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" +"Vous pouvez utiliser les codes de paramètres de substitution suivants dans " +"le texte d'un extrait :" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Étiquettes des paramètres de substitution" + +#: C/gedit.xml:1798(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n définit l'étiquette d'un " +"paramètre de substitution où n est tout nombre supérieur " +"ou égal à 1." + +#: C/gedit.xml:1799(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} définit l'étiquette d'un paramètre de substitution avec une valeur " +"par défaut." + +#: C/gedit.xml:1800(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Une étiquette de paramètre marque un endroit dans le texte d'un extrait où " +"il sera possible, après son insertion, d'y ajouter du texte." + +#: C/gedit.xml:1801(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Lors de l'utilisation d'étiquettes de paramètres de substitution, insérez " +"l'extrait normalement. Le curseur se place sur la première étiquette. Tapez " +"votre texte et appuyez sur Tabulation pour avancer à " +"l'étiquette suivante. Le numéro dans le code de l'étiquette définit l'ordre " +"dans lequel chacune d'elle sera accédée." + +#: C/gedit.xml:1802(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Appuyez sur MajusculeTabulation pour revenir à l'étiquette précédente. Appuyer sur " +"Tabulation quand il n'y a plus d'étiquette déplace le " +"curseur à la fin du texte de l'extrait ou sur la dernière étiquette si elle " +"existe." + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Miroir des paramètres de substitution" + +#: C/gedit.xml:1807(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Répéter une étiquette de paramètre de substitution déjà définie, permet de " +"ne saisir un texte qu'une seule fois et de le reproduire en plusieurs " +"endroits." + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "Paramètre de substitution terminal" + +#: C/gedit.xml:1812(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 définit le paramètre de substitution terminal. Il " +"permet de terminer le travail sur l'extrait avec le curseur à un endroit " +"différent de celui de la fin du texte de l'extrait." + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "Variables d'environnement" + +#: C/gedit.xml:1817(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Les variables d'environnement, telles que $PATH et " +"$HOME, sont substituées dans le texte de l'extrait. Les " +"variables suivantes, spécifiques à gedit peuvent " +"également être utilisées :" + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "La sélection de texte actuelle." + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Le nom du document, avec son chemin, ou une chaîne vide si le document n'a " +"pas encore été enregistré." + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"Le nom du document sans son chemin ou une chaîne vide si le document n'a pas " +"encore été enregistré." + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"Mot qui se trouve à l'emplacement du curseur dans le document. Quand cette " +"variable est utilisée, le mot actuel est remplacé par le texte de l'extrait." + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Paramètres de substitution pour le shell" + +#: C/gedit.xml:1846(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) est remplacé par le " +"résultat de l'exécution de la commande shell cmd." + +#: C/gedit.xml:1847(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) référence ce paramètre de substitution où n est supérieur ou égal à 1. Utilisez $n pour utiliser la sortie de la commande shell comme " +"entrée d'une autre variable." + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Paramètres de substitution pour Python" + +#: C/gedit.xml:1852(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> est remplacé par " +"le résultat de l'évaluation de la commande cmd " +"par l'interpréteur python." + +#: C/gedit.xml:1853(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" définit un autre paramètre de substitution python comme " +"dépendance, où a donne l'ordre dans l'extrait. " +"Ceci permet d'utiliser des fonctions python définies dans un autre extrait. " +"Pour spécifier plusieurs dépendances, séparez les nombres avec des virgules. " +"Par exemple : $<a,b:cmd>" + +#: C/gedit.xml:1854(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Pour utiliser une variable dans d'autres extraits python, déclarez-la comme " +"global." + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "Greffon Trier" + +#: C/gedit.xml:1864(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Le greffon Trier trie les lignes sélectionnées " +"dans l'ordre alphabétique." + +#: C/gedit.xml:1865(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Une opération de tri ne peut pas être annulée, il est donc recommandé " +"d'enregistrer le document avant de le faire. Pour revenir à la version " +"sauvegardée après une opération de tri, choisissez " +"FichierRétablir." + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Pour utiliser le greffon Trier, procédez comme suit :" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "Sélectionnez les lignes à trier." + +#: C/gedit.xml:1873(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Choisissez ÉditionTrier. La boîte de dialogue Trier." +"s'ouvre." + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "Choisissez les options de tri :" + +#: C/gedit.xml:1879(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Pour réaliser un tri inverse, cochez l'option Inverser l'ordre." + +#: C/gedit.xml:1882(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Pour supprimer les lignes identiques, cochez l'option Enlever les " +"doublons." + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Pour ignorer la casse, cochez l'option Ignorer la casse." + +#: C/gedit.xml:1888(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Pour que le tri ignore des caractères au début des lignes, indiquez dans la " +"zone de sélection numérique Commencer à la colonne les " +"premiers caractères devant être utilisés dans le tri." + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "Pour faire le tri, cliquez sur le bouton Trier." + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "Greffon Vérificateur orthographique" + +#: C/gedit.xml:1901(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Le greffon Vérificateur orthographique agit dans " +"le texte sélectionné. gedit peut le faire " +"automatiquement ou manuellement et dans une langue donnée. Le paramétrage de " +"la langue et les propriétés du correcteur orthographique s'appliquent à " +"l'ensemble du document. Pour utiliser le correcteur, suivez les étapes " +"suivantes :" + +#: C/gedit.xml:1903(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Choisissez OutilsSpécifier la " +"langue afin d'afficher la boîte de dialogue " +"Spécifier la langue. Sélectionnez dans la liste la " +"langue qui vous convient, puis cliquez sur Valider." + +#: C/gedit.xml:1906(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Pour vérifier l'orthographe automatiquement, choisissez " +"OutilsVérification " +"orthographique automatique. Pour ne plus faire " +"cette vérification automatiquement, refaites cette même sélection. Quand la " +"vérification automatique est activé, une coche s'affiche à côté de l'option " +"dans le menu Vérification orthographique automatique. Cette option est désactivée chaque fois que " +"gedit démarre." + +#: C/gedit.xml:1907(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Les mots dont l'orthographe est inconnue sont soulignés et affichés dans une " +"couleur différente. Cliquez avec le bouton droit sur l'un de ces mots, puis " +"choisissez Suggestions d'orthographe :" + +#: C/gedit.xml:1910(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Pour remplacer un mot inconnu par un de ceux de la liste, utilisez Remplacer " +"dans le menu Suggestion d'orthographe." + +#: C/gedit.xml:1913(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Pour ajouter un mot, dont l'orthographe n'a pas été trouvée, à votre propre " +"dictionnaire, choisissez Suggestion d'orthographeAjouter le mot." + +#: C/gedit.xml:1916(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Pour ignorer toutes les occurrences d'un mot non reconnu, afin qu'il ne soit " +"plus marqué comme inconnu mais qu'il ne soit pas ajouté à votre dictionnaire " +"personnel, choisissez Suggestion d'orthographeIgnorer tout. Le mot est " +"alors ignoré partout où il est rencontré durant la session actuelle de " +"gedit." + +#: C/gedit.xml:1921(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Choisissez OutilsVérification " +"orthographique pour une vérification manuelle." + +#: C/gedit.xml:1923(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"S'il n'y a aucune faute, une fenêtre Information " +"s'affiche pour indiquer que le document ne contient pas de mot mal " +"orthographié. Cliquez sur Fermer pour refermer cette " +"fenêtre." + +#: C/gedit.xml:1925(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"S'il y a des fautes, la boîte de dialogue Vérification " +"d'orthographe s'ouvre :" + +#: C/gedit.xml:1928(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"Le Mot mal orthographié est affiché en haut de la " +"fenêtre." + +#: C/gedit.xml:1931(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Une suggestion de mot est affichée dans la zone de texte Remplacer " +"par. Il est possible de choisir un autre mot dans la liste des " +"Suggestions ou encore de le saisir directement." + +#: C/gedit.xml:1934(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Pour vérifier l'orthographe du mot de la fenêtre de texte " +"Remplacer par, cliquez sur Vérifier le mot. S'il est reconnu, la liste de Suggestions " +"est remplacée par le texte (orthographe correcte), sinon " +"de nouvelles propositions apparaissent." + +#: C/gedit.xml:1937(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Pour ignorer l'occurrence courante du mot non reconnu, cliquez sur " +"Ignorer. Pour l'ignorer partout dans le texte cliquez " +"sur Toujours ignorer. Cela ne reste vrai que pour la " +"session actuelle de gedit." + +#: C/gedit.xml:1940(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Pour corriger l'occurrence courante d'un mot non reconnu par celui de la " +"zone de texte Remplacer par, cliquez sur " +"Remplacer. Pour corriger toutes les occurrences de ce " +"mot dans le texte, cliquez sur Tout remplacer." + +#: C/gedit.xml:1943(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Pour ajouter un mot inconnu à votre propre dictionnaire, cliquez sur le " +"bouton Ajouter le mot." + +#: C/gedit.xml:1946(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Pour fermer la boîte de dialogue Vérification orthographique, cliquez sur Fermer." + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "Greffon Liste des balises." + +#: C/gedit.xml:1956(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Le greffon Liste des balises permet d'insérer les " +"balises courantes à partir d'une liste située dans le panneau latéral." + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Pour utiliser le greffon Liste des balises, procédez comme suit :" + +#: C/gedit.xml:1959(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Choisissez AffichagePanneau " +"latéral." + +#: C/gedit.xml:1963(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Par défaut, le panneau latéral montre un onglet contenant la liste des " +"documents ouverts. Cliquez sur l'onglet montrant une icône + au bas du " +"panneau pour afficher la liste des étiquettes." + +#: C/gedit.xml:1965(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Sélectionnez la catégorie de balises appropriée dans la liste déroulante. " +"Par exemple, HTML - Balises." + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "" +"Faites défiler la liste des balises pour trouver celle qui vous convient." + +#: C/gedit.xml:1971(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Insérez la balise dans le document actif, à la position du curseur, en " +"cliquant deux fois sur son nom dans la liste. Vous pouvez également le faire " +"comme suit :" + +#: C/gedit.xml:1973(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Pour insérer une balise dans le document courant et passer de la fenêtre " +"Greffon de liste des balises à la fenêtre de l'éditeur, " +"appuyez sur Entrée." + +#: C/gedit.xml:1976(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Pour insérer une balise dans le document courant et rester sur la fenêtre " +"Greffon de liste des balises, appuyez sur " +"MajusculeEntrée." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Vincent Untz , 2006.\n" +"Jonathan Ernst , 2006.\n" +"Philippe Lefevre , 2006.\n" +"Christophe Bliard , 2006.\n" +"Claude Paroz , 2007-2009." + + diff --git a/help/gedit.omf.in b/help/gedit.omf.in new file mode 100755 index 00000000..4206f7c9 --- /dev/null +++ b/help/gedit.omf.in @@ -0,0 +1,9 @@ + + + + + user's guide + + + + diff --git a/help/hu/hu.po b/help/hu/hu.po new file mode 100755 index 00000000..4e601d3a --- /dev/null +++ b/help/hu/hu.po @@ -0,0 +1,4406 @@ +# Hungarian translation of gedit help +# Mate Ory , 2007, 2008. +# Gabor Kelemen , 2007, 2008, 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: gedit_help master\n" +"POT-Creation-Date: 2010-09-01 08:15+0000\n" +"PO-Revision-Date: 2010-09-23 23:08+0200\n" +"Last-Translator: Gabor Kelemen \n" +"Language-Team: Hungarian \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" + +#: 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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Jelen dokumentum szabadon másolható, terjeszthető és/vagy módosítható a GNU " +"Free Documentation License (GFDL) 1.1-es verziója vagy a Free Software " +"Foundation által kiadott ennél frissebb verziója alatt, a „Nem változtatható " +"szakaszok”, „Címlapszövegek” és a „Hátlapszövegek” kivételével. A GFDL " +"leírása ezen az oldalon " +"érhető el, vagy a jelen dokumentációban található COPYING-DOCS fájlban." + +#: 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 "" +"Ez a kézikönyv része a GFDL alatt megjelenő MATE dokumentációk " +"gyűjteményének. A kézikönyv a gyűjteménytől függetlenül szabadon " +"terjeszthető, a licenc másolatát mellékelve a 6. fejezetben leírtaknak " +"megfelelően." + +#: 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 "" +"A cégek különböző, védjegy alá tartozó elnevezéseket használnak termékeik és " +"szolgáltatásuk megkülönböztetéséhez. Ahol ezek a nevek megjelennek bármelyik " +"MATE dokumentációban és a MATE dokumentációs projekt tagjainak tudomásuk " +"van a védjegyről, abban az esetben ezek az elnevezések teljes egészében vagy " +"kezdőbetűik nagybetűsek." + +#: 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 " +"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 "" +"A DOKUMENTUM „JELEN ÁLLAPOTÁBAN” KERÜL KIADÁSRA MINDENFÉLE GARANCIAVÁLLALÁS " +"NÉLKÜL, LEGYEN AZ KIFEJEZETT VAGY BELEÉRTETT, BELEÉRTVE, DE NEM " +"KIZÁRÓLAGOSAN A FORGALOMBA HOZHATÓSÁGRA VAGY ALKALMAZHATÓSÁGRA, A JELEN " +"DOKUMENTUMNAK VAGY ANNAK MÓDOSÍTOTT VERZIÓJÁNAK HIBAMENTESSÉGÉRE VONATKOZÓ " +"GARANCIÁKAT. A DOKUMENTUM VAGY ANNAK MÓDOSÍTOTT VÁLTOZATÁNAK MINŐSÉGÉBŐL ÉS " +"FELHASZNÁLHATÓSÁGÁBÓL FAKADÓ ÖSSZES KOCKÁZAT A FELHASZNÁLÓT TERHELI. HA A " +"DOKUMENTUM BIZONYÍTOTTAN HIBÁS, A FELHASZNÁLÓNAK MAGÁNAK (NEM A DOKUMENTUM " +"ÍRÓJÁNAK, KIADÓJÁNAK VAGY BÁRMELY KÖZREMŰKÖDŐNEK) KELL VÁLLALNIA A " +"JAVÍTÁSHOZ SZÜKSÉGES MINDEN KÖLTSÉGET. A JELEN GARANCIAELUTASÍTÁS A JELEN " +"LICENC LÉNYEGI RÉSZE. A LEFEDETT DOKUMENTUM VAGY ANNAK MÓDOSÍTOTT " +"VERZIÓJÁNAK HASZNÁLATA CSAK A JELEN ELUTASÍTÁSSAL EGYÜTT ENGEDÉLYEZETT, ÉS " +"SEMMILYEN KÖRÜLMÉNYEK KÖZÖTT ÉS SEMMILYEN JOGI MEGFONTOLÁSBÓL, LEGYEN AZ " +"MAGÁNJOGI VÉTKES CSELEKMÉNY (BELEÉRTVE A HANYAGSÁGOT), SZERZŐDÉS VAGY " +"BÁRMELY MÁS DOLOG, NEM FELELŐS ÖN, A LEFEDETT KÓD ELSŐ FEJLESZTŐJE ÉS TÖBBI " +"KÖZREMŰKÖDŐJE VAGY EZEK BÁRMELY SZÁLLÍTÓJA SEMMILYEN MÁS SZEMÉLY FELÉ " +"SEMMILYEN FAJTA KÖZVETLEN, SPECIÁLIS, VÉLETLEN VAGY KÖVETKEZMÉNYES KÁRÉRT, " +"BELEÉRTVE DE NEM KIZÁRÓLAG A HÍRNÉV ELVESZTÉSÉBŐL, MUNKA LEÁLLÁSÁBÓL, " +"SZÁMÍTÓGÉP MEGHIBÁSODÁSÁBÓL VAGY HELYTELEN MŰKÖDÉSÉBŐL SZÁRMAZÓ, VAGY " +"BÁRMELY EGYÉB KERESKEDELMI KÁROKAT ÉS VESZTESÉGEKET, MÉG AKKOR IS, HA AZ " +"ILYEN FÉL INFORMÁLVA LETT AZ ILYEN KÁROK ELŐFORDULÁSÁNAK LEHETŐSÉGÉRŐL. A " +"FELELŐSSÉG EZEN KORLÁTOZÁSA NEM ALKALMAZHATÓ ABBAN AZ ESETBEN, HA HALÁL VAGY " +"SZEMÉLYI SÉRÜLÉS TÖRTÉNT A FÉL HANYAGSÁGÁBÓL KIFOLYÓLAG, OLYAN MÉRTÉKBEN, " +"AMENNYIRE AZ ALKALMAZHATÓ TÖRVÉNYEK MEGTILTJÁK AZ ILYEN KORLÁTOZÁSOKAT." + +#: 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: " +"" +msgstr "" +"A DOKUMENTUM ÉS A DOKUMENTUM MÓDOSÍTOTT VERZIÓJA A GNU FREE DOCUMENTATION " +"LICENSE (GFDL) ALATT JELENIK MEG AZ ALÁBBI ÉRTELMEZÉSSEL: " + +#. 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/gedit.xml:268(None) +msgid "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Gedit kézikönyv" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "MATE dokumentációs projekt" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002." + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003." + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004." + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000." + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Elkészítette a gyorsbillentyűk táblázatát" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java Desktop System dokumentációs csapat" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek információt nyújtott a gedit alkalmazás korábbi változatairól." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Köszönetnyilvánítások" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George a bővítményekről nyújtott információt." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit 1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit kézikönyv 2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "2002. március" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE dokumentációs csapat" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit kézikönyv 2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "2002. június" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit kézikönyv 2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "2002. augusztus" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit kézikönyv 2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "2002. szeptember" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit kézikönyv 2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "2003. január" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit kézikönyv 2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "2003. március" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "gedit kézikönyv 2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "2003. szeptember" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "gedit kézikönyv 2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "2004. március" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "gedit kézikönyv 2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "2006. július" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "gedit kézikönyv 2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "MATE dokumentációs csapat" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Ez a kézikönyv a gedit 2.16-os verzióját írja le." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Visszajelzés" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"A gedit alkalmazás vagy dokumentáció hibáiról " +"bejelentést, illetve javaslatokat a MATE visszajelzés oldal leírása alapján tehet." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"A gedit egy szövegszerkesztő a MATE asztali környezethez, amely alapvető és " +"robusztus képességekkel rendelkezik, mint például a nyomtatás, helyesírás-" +"ellenőrzés, keresés és csere, szintaxiskiemelés. További szolgáltatások " +"érhetők el a bővítmények formájában." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "szövegszerkesztő" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Bevezetés" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"A gedit lehetővé teszi szövegfájlok készítését és " +"szerkesztését." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"A gedit célja az egyszerűség és a könnyű " +"használat. Hatékonyabb eszközöket a bővítmények " +"nyújtanak, lehetővé téve szövegszerkesztési feladatok széles körének " +"végrehajtását." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Kezdeti lépések" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "A gedit indítása" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "A következő módokon lehet elindítani a geditet:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Alkalmazások menü" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Válassza a KellékekSzövegszerkesztő " +"menüpontot." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Parancssor" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Adja ki a gedit parancsot." + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Alapértelmezésben a fájlkezelőben megnyitott szövegfájlokat a gedit jeleníti " +"meg." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "A gedit ablaka" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"A gedit elindításakor a következő ablak jelenik " +"meg:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "A gedit ablaka" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "A gedit főablaka." + +#: C/gedit.xml:276(para) +msgid "The gedit window contains the following elements:" +msgstr "A gedit ablak a következő elemekből áll:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Menüsor" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"A menüsor menüi az összes parancsot tartalmazzák, amire szükség lehet a " +"fájlok kezeléséhez a gedittel." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Eszköztár" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "Az eszköztár a menüsorról elérhető parancsok egy részét tartalmazza." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Megjelenítő ablaktábla" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "A megjelenítő ablaktábla a szerkesztett fájl szövegét tartalmazza." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Állapotsor" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"Az állapotsor a pillanatnyi munkáról és környezeti információkról " +"tájékoztat. A gedit állapotsora a következőket is " +"tartalmazza:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "Kurzorpozíció: a kurzor jelenlegi helye sor és oszlop szerint." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Szerkesztési mód: Ha az editor beszúrási módban van, a BESZÚR szöveg jelenik meg az állapotsoron. Ha felülírási módban van, " +"akkor az ÁTÍR. A szerkesztési mód váltásához nyomja meg " +"a billentyűzet Insert gombját." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Oldalsó ablaktábla" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"Az oldalsó ablaktábla felsorolja a megnyitott dokumentumokat és további " +"bővítményfüggő adatokat jelenít meg." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Alapértelmezésben az oldalsó ablaktábla nem jelenik meg. Megjelenítése a " +"NézetOldalsó ablaktábla menüponttal kapcsolható be vagy ki." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Alsó ablaktábla" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Az alsó ablaktáblát különböző programozási eszközök használják, például a " +"Python konzol bővítmény a kimenetének " +"megjelenítésére." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Alapértelmezésben az alsó ablaktábla nem jelenik meg. Megjelenítése a " +"NézetAlsó ablaktábla menüponttal kapcsolható be vagy ki." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Ha a jobb gombbal kattint a gedit ablakra, " +"megjelenik egy helyi menü. Ez a helyi menü a legfontosabb szövegszerkesztő-" +"parancsokat tartalmazza." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Hasonlóan más MATE alkalmazásokhoz a geditben is " +"több módon lehet egy műveletet végrehajtani: a menüsorból, az eszköztárról " +"vagy gyorsbillentyűkkel. Az összes alkalmazásra jellemző gyorsbillentyűket a " +"Felhasználói " +"kézikönyv sorolja fel." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "A gedit futtatása parancssorból" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"A geditet parancssorból is futtatható. Így egy " +"vagy több fájlt is megnyithat. Több fájl megnyitásához gépelje be a " +"következő parancsot, majd üssön Entert:" + +# magyarul nem sorszámozunk hátul, pont nélkül... +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "első_fájl.txt második_fájl.txt harmadik_fájl.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Lehetőség van a fájlnév helyett URI használatára." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"További, a gedit parancssori használatáról szóló " +"információért tekintse meg a gedit unix kézikönyvoldalát, a gedit1-et." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Fájlok kezelése" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Új dokumentum létrehozása" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Új dokumentum létrehozásához válassza a FájlÚj menüpontot. Az alkalmazás " +"egy új üres dokumentumot fog megjeleníteni a gedit ablakban." + +#: C/gedit.xml:346(title) C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "Fájl megnyitása" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Fájl megnyitásához válassza a FájlMegnyitás… menüpontot a " +"Fájl megnyitása… ablak megjelenítéséhez. Válassza ki a " +"megnyitandó fájlt és kattintson a Megnyitás gombra. A " +"fájl megjelenik a gedit ablakban." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Nemrég használt fájlok megnyitása gomb." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Az alkalmazás megjegyzi az utolsó öt megnyitott fájl helyét és fájlnevét. " +"Ezek menüpontokként jelennek meg a Fájl menüben. Az eszköztár ikonjára kattintva " +"szintén megjelenik a nemrég használt fájlok listája." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"A gedittel egyszerre több fájlt is meg lehet " +"nyitni. Ekkor minden megnyitott fájl új lapra kerül. Erről további " +"részleteket a tartalmaz." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Fájl mentése" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "A következő módokon lehet fájlt menteni:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Létező fájl mentéséhez válassza a FájlMentés menüpontot." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Egy új fájl, vagy egy régi más néven való mentéséhez válassza a " +"FájlMentés másként… menüpontot. Írja be a kívánt fájlnevet a " +"Mentés másként… ablakban, majd kattintson a " +"Mentés gombra." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Az összes geditben megnyitott fájl mentéséhez " +"válassza a DokumentumokÖsszes " +"mentése menüpontot." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Az összes geditben megnyitott fájl bezárásához " +"válassza a DokumentumokÖsszes " +"bezárása menüpontot." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Fájl megnyitása URI alapján" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Fájl megnyitásához egységes erőforrás-azonosító (URI) használatával, tegye a " +"következőket:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Válassza a FájlHely megnyitása… menüpontot a Hely megnyitása " +"ablak megjelenítéséhez." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Írja be a megnyitni kívánt fájl URI címét." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Válassza ki a megfelelő karakterkódolást a Karakterkódolás legördülő listából." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Kattintson a Megnyitás gombra." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Az érvényes URI típusok a http:, az ftp:, a file: és minden " +"más, a mate-vfs által támogatott elérési mód." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Bizonyos típusú URI címekről megnyitott fájlok csak olvasható módban " +"használhatók, a változtatásokat csak más helyre lehet menteni. A HTTP-n " +"keresztül megnyitott fájlok csak olvashatóak. Az FTP-vel megnyitottak azért " +"nem módosíthatók, mert egyes FTP kiszolgálók hibásan kezelik a távoli fájlok " +"mentését." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Az FTP kiszolgálókra való mentés a Konfigurációszerkesztővel " +"kapcsolható be. A /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes kulcsot kell beállítani, de ez hibákat " +"okozhat." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Lapok kezelése" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Ha több fájl van megnyitva, akkor a gedit minden " +"dokumentumot külön lapon jelenít meg a megjelenítő ablaktáblán. Másik " +"dokumentumra váltáshoz kattintson a hozzá tartozó fülre." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"A dokumentumok gedit ablakok közti mozgatása az " +"adott fájlhoz tartozó fül másik ablakba húzásával lehetséges." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Dokumentum új gedit ablakba való mozgatásához " +"húzza a fület az Asztalra vagy válassza a DokumentumokÁthelyezés új ablakba " +"menüpontot." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Szöveg kezelése" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Szöveg szerkesztése" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "A következő módokon szerkesztheti szövegfájlok tartalmát:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Gépelje be az új szöveget. A villogó beszúró kurzor " +"jelöli az újonnan begépelt szövegek helyét. Ennek megváltoztatása a " +"nyílbillentyűkkel vagy egérkattintással lehetséges." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"A kijelölt szöveg vágólapra másolása a SzerkesztésMásolás menüpont " +"kiválasztásával lehetséges." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"A kijelölt szöveg törlése és vágólapra helyezése a " +"SzerkesztésKivágás menüpont kiválasztásával lehetséges." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"A kijelölt szöveg végleges törlése a SzerkesztésTörlés menüpont " +"kiválasztásával lehetséges." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"A vágólap tartalmának beszúrása a jelenlegi kurzorpozícióban a " +"SzerkesztésBeillesztés menüpont kiválasztásával lehetséges. Ehhez " +"előzőleg kivágással vagy másolással szöveget kell a vágólapra helyezni a " +"geditben vagy más alkalmazásban." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Egy szövegfájl teljes tartalmának kijelöléséhez válassza a " +"SzerkesztésMindent kijelöl menüpontot." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Változtatások visszavonása, változtatások visszavonásának megszüntetése" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Egy változtatás visszavonásához válassza a SzerkesztésVisszavonás menüpontot. Ha " +"mégis meg szeretné tartani a változtatást, kattintson a " +"SzerkesztésÚjra menüpontra." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Keresés és csere" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"A geditben két különböző módja van a szövegrészek " +"keresésnek. Használhatja a Keresés ablakot egy adott " +"szövegtöredék megkereséséhez, vagy kiemelheti a megfelelő szöveget gépelés " +"közben a Gyorskeresés használatával." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Szöveg keresése" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Karakterlánc kereséséhez egy szövegfájlban, tegye a következőket:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Válassza a KeresésKeresés… menüpontot, ami megjeleníti a Keresés… ablakot." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Gépelje be a keresett karakterláncot a Keresés erre " +"mezőbe. Lehetséges speciális karakterek, például újsor vagy tabulátor " +"beszúrása is. További információkért tekintse meg a részt." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Kattintson a Keresés gombra. A beírt szöveg aktuális " +"kurzorhely utáni első előfordulását a gedit " +"kijelöli, a többi találatot pedig kiemeli." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"A következő előfordulás megkereséséhez kattintson újra a Keresés gombra, vagy válassza a KeresésKövetkező találat " +"menüpontot. Az előző találatot a KeresésElőző találat menüpont " +"kiválasztásával érheti el." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"A Keresés ablak bezárása után a " +"KeresésKövetkező találat és KeresésElőző találat menüpontok " +"segítségével továbbra is kiválaszthatja a szöveg további előfordulásait." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"A szövegben a kiemelések megszüntetése a KeresésKiemelés törlése menüpont " +"kiválasztásával érhető el." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Gyorskeresés" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"A gyorskeresés gépelés közben, betűről betűre emeli ki a dokumentumban az " +"egyező szövegtöredékeket. (Hasonlóan bizonyos webböngészők keresés " +"funkciójához.)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Gyorskeresést a KeresésGyorskeresés menüpont " +"kiválasztásával indíthat. A keresődoboz a megjelenítő ablaktábla felső " +"részén jelenik meg." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Kezdjen el gépelni; az egyező szövegtöredékek a dokumentumban kiemelésre " +"kerülnek. A kurzor helye utáni első előfordulás ki is lesz jelölve." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"A kijelölés mozgatásához a találatok közt a gyorskeresődoboz nyitva tartása " +"mellett használja a CtrlG (előre) és CtrlShiftG (vissza) billentyűkombinációkat." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"A nyílbillentyűk és az egér görgetőkereke is alkalmas a kijelölés " +"mozgatására a találatok között." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Szöveg cseréje" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Egy karakterlánc kereséshez a szövegben és annak egy másik karakterlánccal " +"való helyettesítéséhez tegye a következőket:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Válassza ki a KeresésCsere… menüpontot, ami megnyitja a Csere… ablakot." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Írja be a keresett karakterláncot a Keresés erre " +"mezőbe. Speciális karaktereket, például újsort vagy tabulátort is " +"használhat. További információkért tekintse meg a részt." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"A Csere erre mezőbe írja be azt a karakterláncot, amire " +"a találatokat cserélni kívánja." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"A karakterlánc minden előfordulásának megvizsgálásához kattintson a " +"Keresés gombra. Ha a gedit " +"előfordulást talál, kijelöli azt. Ilyenkor a Csere " +"gombra kattintva az alkalmazás a kijelölt előfordulást lecseréli. A " +"következő előfordulásra lépéshez kattintson ismét a Keresés gombra." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"A dokumentumban lévő összes előfordulás cseréléséhez kattintson a " +"Mindet cseréli gombra." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Keresés és csere beállításai" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"A Keresés és a Csere ablak is " +"támogatja a következő beállításokat:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"A Kis- és nagybetű lehetőség kijelölésével a keresés " +"különbözőnek tekinti a kis- és nagybetűket. Például a Kis- és " +"nagybetű beállítás kiválasztásával a „SZÖVEG” keresőszóval nem " +"fogja megtalálni a dokumentumban lévő „szöveg” szót." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"A Csak teljes szóra lehetőség kijelölésével az " +"alkalmazás csak egész szavas egyezéseket tekinti találatnak. Például a " +"Csak teljes szóra beállítással az „egér” szóra kiadott " +"keresés nem tekinti találatnak a „szövegértés” szót." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"A Keresés visszafelé lehetőség kijelölésével a keresés " +"visszafelé, a dokumentum eleje felé történik." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"A Körbe lehetőség kijelölésével a keresés a dokumentum " +"egyik végének elérése után a másik végéről folytatódik." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Speciális karakterek" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"A következő escape sorozatokkal speciális karaktereket kereshet, illetve " +"azokat cserélheti:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Újsor karaktert jelöl." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Tabulátor karaktert jelöl." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Kocsivissza karaktert jelöl." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"A fordított törtvonal karaktert is escape-elni kell, ha ezt akarja keresni. " +"Ha például a „\\n” literált keresi, akkor a " +"Keresés erre mezőbe a „\\\\n” karakterláncot kell " +"írnia. Ha fordított törtvonalak sorozatát keresi, akkor meg kell dupláznia " +"azok számát." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Kurzor adott sorba mozgatása" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"A kurzor a jelenlegi fájl egy bizonyos számú sorába való mozgatásához " +"válassza a KeresésUgrás sorra menüpontot. A keresett sor számának beírására " +"szolgáló mező a megjelenítő ablaktábla tetején jelenik meg." + +# hulyeseg +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "Kezdje el írni a keresett sor számát, és a kurzor a megadott sorra ugrik." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"A mező eltüntetéséhez és a kurzor megadott sorba való mozgatásához nyomja " +"meg az Enter billentyűt." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Nyomtatás" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Oldalbeállítások" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Az oldalbeállítások megváltoztatásához válassza a FájlOldalbeállítás… menüpontot, " +"ami megjeleníti az Oldalbeállítás ablakot." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"Az Oldalbeállítás ablak lehetővé teszi a következő " +"nyomtatási beállítások megadását:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Általános lap" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Szintaxiskiemelés nyomtatása" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Ezt a lehetőséget kijelölve az alkalmazás kinyomtatja a szintaxiskiemelést. " +"További információért a szintaxiskiemelésről tekintse meg a részt." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Oldal fejlécének nyomtatása" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Ezt a lehetőséget kijelölve minden oldal tetején nyomtatásra kerül egy " +"fejléc. A fejlécet nem lehet finomhangolni." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "Sorszámozás" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"A Sorszámok nyomtatása lehetőség kiválasztásával a " +"dokumentum minden sorának elején szerepelni fog a száma." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Használja a Sorszám ... soronként léptetőmezőt a " +"sorszámnyomtatás gyakoriságának meghatározására, például 5, 10, stb. " +"soronként legyen sorszám." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1176(guilabel) C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "Szöveg tördelése" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"A Sortörés engedélyezése lehetőséget kiválasztva a " +"hosszú sorok nyomtatáskor karakterszinten kerülnek tördelésre. Az alkalmazás " +"a tördelt sorokat egy sornak számolja a sorszámok nyomtatásánál." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"A Ne törje a szavakat két sorba lehetőség " +"kiválasztásával nyomtatáskor a tördelés csak szóhatárokon fog megtörténni." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Betűkészletek" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Törzs" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Kattintson erre a gombra a szövegtörzs nyomtatásához használt betűkészlet " +"módosításához." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Sorszámok" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Kattintson erre a gombra a sorszámok nyomtatásához használt betűkészlet " +"módosításához." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Élőfej és élőláb" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Kattintson erre a gombra az élőfej és élőláb nyomtatásához használt " +"betűkészlet módosításához." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"A gedit nyomtatáshoz használt betűkészleteinek " +"alapértelmezettre állításához kattintson az Alapértelmezett " +"betűkészletek visszaállítása gombra." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Dokumentum nyomtatása" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"A gedit segítségével a következő nyomtatási " +"műveleteket hajthatja végre:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Dokumentum nyomtatása nyomtatóra." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "A nyomtatási parancs kimenetének fájlba nyomtatása." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Ha fájlba nyomtat, a gedit a nyomtatási parancs " +"kimenetét egy nyomtatási fájlba küldi. A legáltalánosabb nyomtatási " +"fájlformátumok a PostScript és a PDF." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"A nyomtatás előnézetének megtekintéséhez válassza a " +"FájlNyomtatási kép menüpontot." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"A jelenlegi fájl nyomtatóra vagy fájlba való nyomtatásához válassza a " +"FájlNyomtatás… menüpontot, ami megjeleníti a Nyomtatás " +"ablakot." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"A Nyomtatás ablak a következő beállítások megadását " +"teszi lehetővé:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Feladat lap" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Nyomtatási tartomány" + +#: C/gedit.xml:637(para) +msgid "Select one of the following options to determine how many pages to print:" +msgstr "" +"A a nyomtatandó oldalak számának meghatározásához válassza ki a következő " +"lehetőségek egyikét:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Mindent" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Válassza ezt a lehetőséget a fájl minden oldalának kinyomtatásához." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Sorok" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Válassza ezt a lehetőséget csak a megadott sorok nyomtatásához. Az " +"Ettől és Eddig léptetőmezőkkel " +"adja meg a kívánt sortartományt." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Kijelölés" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Válassza ezt a lehetőséget, ha csak a kijelölt szövegrészt kívánja " +"kinyomtatni. Ez a lehetőség csak akkor érhető el, ha kijelölt egy " +"szövegrészt." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Példányok" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Használja a Példányok száma léptetőmezőt a nyomtatandó " +"példányszám meghatározásához." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Amennyiben több példányt nyomtat, a Szétválogatás " +"lehetőség használatával különválogattathatja a kész példányokat." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Nyomtató lap" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Nyomtató" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "Válassza ki a legördülő menüből a fájl nyomtatásához használandó nyomtatót." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Beállítások" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Használja ezt a legördülő listát a nyomtató beállításainak módosításához." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"A nyomtató beállításainak módosításához kattintson a Beállítás gombra. Például be lehet állítani a kétoldalas vagy késleltetett " +"nyomtatást, ha a nyomtató támogatja ezeket a funkciókat." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Hely" + +#: C/gedit.xml:682(para) +msgid "Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Használja ezt a legördülő listát a következő nyomtatási célok egyikének " +"kiválasztására:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +# hülyeség +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Fájl nyomtatása egy CUPS nyomtatóval." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Ha a kiválasztott nyomtató egy CUPS nyomtató, a CUPS " +"lesz az egyetlen megjelenített elem a legördülő listában." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Fájl nyomtatása egy nyomtatóval." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Fájl" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Fájl nyomtatása PostScript fájlba." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Kattintson a Mentés másként gombra a létrehozandó " +"PostScript fájl helyének megadásához." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Egyéb" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Egy megadott parancs használata a fájl nyomtatására." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "Írja be a szövegmezőbe a nyomtatási parancsot a szükséges kapcsolókkal." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Állapot" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Ez a funkció nem támogatott ebben a gedit verzióban." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Típus" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Megjegyzés" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Papír lap" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Papírméret" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Ezzel a legördülő listával kiválaszthatja a fájl nyomtatásához használandó " +"papír méretét." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Szélesség" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Ezzel a léptetőmezővel kiválaszthatja a használt papír szélességét. A " +"szomszédos legördülő listából kiválasztható a mértékegység." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Magasság" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Ezzel a léptetőmezővel kiválaszthatja a papír magasságát." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Adagoló tájolása" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "Ezzel a legördülő listával kiválaszthatja a papírlap tájolását a nyomtatóban." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Oldal tájolása" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Ezzel a legördülő listával kiválaszthatja a nyomtatás tájolását." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Elrendezés" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Ezzel a legördülő listával kiválaszthatja az oldalelrendezést. Az " +"Előnézet ablaktáblán a kiválasztott elrendezés " +"előnézete látható." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Papírtálca" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Ezzel a legördülő listával kiválaszthatja a papírtálcát." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Programozási szolgáltatások" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"A gedit több programozást segítő szolgáltatása " +"bővítmény formájában érhető el. Például az elemlista bővítmény egyes " +"leírónyelvek gyakran használt elemeit sorolja fel. További részletekért " +"tekintse meg a részt." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Szintaxiskiemelés" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"A szintaxiskiemelés a szöveg eltérő jellegű részeinek színekkel való " +"elkülönítésével könnyebbé teszi a forráskódok olvasását." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"A gedit kiválasztja a megfelelő " +"szintaxiskiemelési módot a dokumentum típusa alapján, de ez felülbírálható a " +"NézetKiemelési üzemmód menüpont alatt:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Normál" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "A szintaxiskiemelés kikapcsolása." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Források" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Bekapcsolja a szintaxiskiemelést a forráskód szerkesztéséhez. A " +"Források almenüben kiválasztható a forráskód típusa." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Jelölés" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Bekapcsolja a szintaxiskiemelést leírónyelvekhez. A Leírás almenüben kiválasztható a jelölőnyelv." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Parancsfájlok" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Bekapcsolja a szintaxiskiemelést a parancsfájlok szerkesztéséhez. A " +"Parancsfájlok almenüben kiválasztható a " +"parancsfájlkód típusa." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Egyéb" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Bekapcsolja a szintaxiskiemelést egyéb jellegű fájlok szerkesztéséhez. Az " +"Egyéb almenüben kiválasztható a kód típusa." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Parancs kimenetének fájlba irányítása" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Egy parancs kimenetét átirányítás használatával átadhatja a " +"geditnek. Például az ls " +"parancs kimenetét az ls | gedit parancs begépelésével és " +"az Enter megnyomásával lehet egy új szövegfájlba küldeni." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Az ls parancs kimenete egy új szövegfájlban jelenik meg a " +"gedit ablakában." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"A Külső eszközök bővítmény használatával is " +"fájlba irányítható a parancsok kimenete." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Gyorsbillentyűk" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"A gyorsbillentyűk segítségével a gyakori feladatok az egér és menük " +"használatánál gyorsabban végezhetők el. A következő táblázatok felsorolják a " +"gedit összes gyorsbillentyűjét." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"További információért a gyorsbillentyűkről tekintse meg az Asztali környezet felhasználói " +"kézikönyvét." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "Lapok" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Gyorsbillentyűk a lapok kezeléséhez:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) C/gedit.xml:1052(para) C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "Gyorsbillentyű" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) C/gedit.xml:1054(para) C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "Parancs" + +# hulyeseg +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "A balra lévő lapra vált." + +# hulyeseg +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "A jobbra lévő lapra vált." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Bezárja a lapot." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Elmenti az összes lapot." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Bezárja az összes lapot." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + szám" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "A szám-adik lapra vált." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Fájlok" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Gyorsbillentyűk fájlok kezeléséhez:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Új dokumentum létrehozása." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Dokumentum megnyitása." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Hely megnyitása." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "A jelenlegi dokumentum lemezre mentése." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "A jelenlegi dokumentum mentése más fájlnéven." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "A jelenlegi dokumentum nyomtatása." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "A jelenlegi dokumentum nyomtatási előnézete." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "A jelenlegi dokumentum bezárása." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Kilépés a geditből." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "Szerkesztés" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Gyorsbillentyűk a dokumentumok szerkesztéséhez:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Utolsó művelet visszavonása." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Az előzőleg visszavont művelet ismételt végrehajtása." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "A kijelölt szöveg kivágása és vágólapra helyezése." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "A kijelölt szöveg másolása a vágólapra." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "A vágólap tartalmának beillesztése." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "A dokumentum tartalmának kijelölése." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "A jelenlegi sor törlése." + +#: C/gedit.xml:1003(para) +#| msgid "Alt + n" +msgid "Alt + Up" +msgstr "Alt + Fel" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "A kijelölt sor egy sorral feljebb mozgatása." + +#: C/gedit.xml:1007(para) +#| msgid "Alt + n" +msgid "Alt + Down" +msgstr "Alt + Le" + +#: C/gedit.xml:1008(para) +#| msgid "Copy the selected text or region onto the clipboard." +msgid "Move the selected line down one line." +msgstr "A kijelölt sor egy sorral lejjebb mozgatása." + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "Ablaktáblák" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Ablaktáblákat elrejtő és megjelenítő gyorsbillentyűk:" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "Oldalsó ablaktábla megjelenítése/elrejtése." + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "Alsó ablaktábla megjelenítése/elrejtése." + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "Keresés" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "Gyorsbillentyűk a kereséshez:" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "Karakterlánc keresése." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "A karakterlánc következő előfordulására ugrás." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "A karakterlánc előző előfordulására ugrás." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "Gyorskeresés." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "Keresés és csere." + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "Kiemelés törlése." + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "Ugrás sorra." + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "Eszközök" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "Gyorsbillentyűk az eszközökhöz:" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "Helyesírás ellenőrzése (bővítménnyel)." + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Sorvégi szóközök törlése (bővítménnyel)." + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "Behúzás (bővítménnyel)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "Behúzás csökkentése (bővítménnyel)." + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "A „make” futtatása a jelenlegi könyvtárban (bővítménnyel)." + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "Könyvtár listázása (bővítménnyel)." + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "Súgó" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "Súgó gyorsbillentyűi:" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "A gedit felhasználói kézikönyvének megnyitása." + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "Beállítások" + +#: C/gedit.xml:1164(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"A gedit beállításához válassza a " +"SzerkesztésBeállítások menüpontot. A Beállítások " +"ablak a következő kategóriákból áll:" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "Nézet beállításai" + +#: C/gedit.xml:1178(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Válassza ki a Sortörés engedélyezése lehetőséget a " +"hosszú sorok bekezdésekbe tördeléséhez a szövegablak szélein való túlfutás " +"helyett. Így elkerülhető a vízszintes görgetés." + +#: C/gedit.xml:1179(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Válassza ki a Ne törje a szavakat két sorba lehetőséget " +"a töréspontok szóhatárokra helyezéséhez. Ez könnyebbé teszi az olvasást." + +#: C/gedit.xml:1185(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Válassza ki a Sorok számának megjelenítése lehetőséget " +"a sorok számainak megjelenítéséhez a gedit ablak " +"bal oldalán." + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "Jelenlegi sor" + +#: C/gedit.xml:1191(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"A Jelenlegi sor kiemelése lehetőség kiválasztásával az " +"alkalmazás mindig kiemeli azt a sort, amelyikben a kurzor van." + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "Jobb margó" + +#: C/gedit.xml:1197(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Válassza ki a Jobb margó megjelenítése lehetőséget a " +"jobb margót jelző függőleges vonal megjelenítéséhez." + +#: C/gedit.xml:1198(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"A Jobb oldali margó ennél az oszlopnál léptetőmező " +"segítségével beállítható a vonal helye." + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "Zárójel párjának kijelölése" + +#: C/gedit.xml:1204(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Válassza a A zárójel párjának kijelölése lehetőséget, " +"hogy az alkalmazás kiemelje annak a zárójelnek a párját, amelyik előtt a " +"kurzor áll." + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "Szerkesztő beállításai" + +#: C/gedit.xml:1217(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"A Tabulátorok szélessége léptetőmezőben meghatározható " +"a tabulátorok (Tab billentyű) helyén a gedit által kihagyott hely szélességét." + +#: C/gedit.xml:1218(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"A Szóközök beillesztése tabulátorok helyett mező " +"kiválasztásával megadható, hogy a gedit " +"szóközöket használjon a tabulátor karakterek helyett a Tab " +"leütésekor." + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "Automatikus behúzás" + +#: C/gedit.xml:1224(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Az Automatikus behúzás engedélyezése lehetőség " +"kiválasztásakor az új sor mindig az azt megelőző sor behúzási szintjén fog " +"kezdődni." + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "Fájlmentés" + +#: C/gedit.xml:1230(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"A Biztonsági másolatok létrehozása mentés előtt " +"lehetőség kiválasztásával az alkalmazás mentéskor egy biztonsági másolatot " +"készít a fájlokról. A biztonsági másolat neve ~ jellel végződik." + +#: C/gedit.xml:1231(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Válassza ki a Fájlok automatikus mentése ... percenként " +"lehetőséget az aktuális fájl rendszeres mentéséhez. A léptetőmezőben adhatja " +"meg a fájl mentésének gyakoriságát." + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "Betűk és színek beállításai" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "Betűkészlet" + +# hulyeseg +#: C/gedit.xml:1243(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Válassza ki a Rendszer rögzített szélességű betűkészletének " +"használata lehetőséget az alapértelmezett betűkészlet " +"használatához a gedit megjelenítő ablaktáblában." + +#: C/gedit.xml:1244(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"A Szerkesztő betűkészlete mező megjeleníti a " +"gedit által a szöveg megjelenítésére használt " +"betűkészletet. Kattintson a gombra a betűtípus, -stílus és -méret " +"beállításához." + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "Színséma" + +#: C/gedit.xml:1250(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"A színsémák listájából választhat színsémát. Alapértelmezésben a következő " +"színsémák vannak telepítve:" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "Klasszikus" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Klasszikus színséma a gvim alapján." + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Kobalt" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "Kék alapú színséma." + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "A Kate szövegszerkesztőben használt színséma." + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "A Tango színpalettát használó sötét színséma." + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tangó" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "A Tango színpalettát használó színséma." + +#: C/gedit.xml:1283(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Új színsémát a Hozzáadás… gomb megnyomásával és egy " +"színsémafájl kiválasztásával telepíthet." + +#: C/gedit.xml:1284(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"A kiválasztott színsémát az Eltávolítás gomb " +"megnyomásával távolíthatja el." + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "Bővítmények beállításai" + +#: C/gedit.xml:1292(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"A bővítmények további szolgáltatásokat adnak a gedithez. A bővítményekről és a beépített bővítményekről szóló további " +"információkért tekintse meg a " +"részt." + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "Bővítmény engedélyezése" + +#: C/gedit.xml:1297(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Egy gedit bővítmény engedélyezéséhez tegye a " +"következőket:" + +#: C/gedit.xml:1300(para) C/gedit.xml:1321(para) C/gedit.xml:1643(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Válassza a SzerkesztésBeállítások menüpontot." + +#: C/gedit.xml:1303(para) C/gedit.xml:1324(para) C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "Válassza ki a Bővítmények fület." + +#: C/gedit.xml:1306(para) +msgid "Select the check box next to the name of the plugin that you want to enable." +msgstr "Jelölje be az engedélyezendő bővítmény neve melletti jelölőnégyzetet." + +#: C/gedit.xml:1309(para) C/gedit.xml:1330(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Kattintson a Bezárás gombra a Beállítások ablak bezárásához." + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "Bővítmény tiltása" + +#: C/gedit.xml:1317(para) +msgid "A plugin remains enabled when you quit gedit." +msgstr "" +"A bővítmények a geditből való kilépés után is " +"engedélyezve maradnak." + +#: C/gedit.xml:1318(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Egy gedit bővítmény tiltásához tegye a " +"következőket:" + +#: C/gedit.xml:1327(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "Szüntesse meg a tiltandó bővítmény neve melletti jelölőnégyzet kijelölését." + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "Bővítmények" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "Bővítmények használata" + +#: C/gedit.xml:1342(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"A bővítmények engedélyezésével a gedit szolgáltatásai kiegészíthetőek továbbiakkal. A bővítmény egy " +"olyan járulékos program, amelyik bővíti egy alkalmazás funkcionalitását. A " +"bővítmények új gedit menüpontokat hoznak létre az " +"új szolgáltatásokhoz." + +#: C/gedit.xml:1344(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Néhány bővítményt alapértelmezetten tartalmaz a gedit, de továbbiakat is telepíthet. Harmadik fél által készített " +"bővítmények tölthetőek le a gedit weboldaláról." + +#: C/gedit.xml:1345(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"A bővítmények engedélyezéséről és tiltásáról, illetve állapotuk " +"megtekintéséről a Bővítmények " +"beállításai oldalon olvashat." + +#: C/gedit.xml:1346(para) +msgid "The following plugins come built-in with gedit:" +msgstr "" +"A következő bővítmények érkeznek alapértelmezésben a gedittel:" + +#: C/gedit.xml:1352(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"A Kis- és nagybetű " +"módosítása lehetővé teszi kijelölt szövegrész " +"kisbetűssé vagy nagybetűssé alakítását." + +#: C/gedit.xml:1355(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"A Statisztika a dokumentumról kijelzi a dokumentum " +"sorainak, szavainak és karaktereinek számát." + +#: C/gedit.xml:1358(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"A Külső eszközök lehetővé teszik külső parancsok végrehajtását a " +"geditből." + +#: C/gedit.xml:1361(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"A Fájlböngésző ablaktábla lehetővé teszi fájlok " +"és mappák böngészését az oldalsávban." + +#: C/gedit.xml:1364(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"A Sorok behúzása a behúzás növelését és csökkentését teszi lehetővé a " +"kijelölt sorokban." + +#: C/gedit.xml:1367(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"A Dátum és idő " +"beszúrása a jelenlegi dátumot és időt szúrja be a " +"dokumentumba." + +#: C/gedit.xml:1370(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"A Módsorok lehetővé teszi az egyedi dokumentumok szerkesztési " +"beállításainak kezelését. Emacs, " +"Kate és Vim stílusú " +"módsorokat támogat." + +#: C/gedit.xml:1373(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"A Python konzol lehetővé teszi python programozási nyelven írt parancsok " +"végrehajtását." + +#: C/gedit.xml:1376(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"A Töredékek lehetővé teszi gyakran használt szövegdarabok tárolását, és " +"azok egyszerű és gyors beillesztését a dokumentumba." + +#: C/gedit.xml:1379(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"A Rendezés a dokumentum kijelölt sorait betűrendbe rendezi." + +#: C/gedit.xml:1382(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"A Helyesírás-" +"ellenőrző javítja a kijelölt szövegrész helyesírását, " +"és automatikusan jelöli a hibákat a dokumentumban." + +#: C/gedit.xml:1385(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Az Elemlista lehetővé teszi gyakran használt HTML és más nyelvi elemek " +"beszúrását az oldalsó ablaktáblán megjelenő felsorolásból." + +#: C/gedit.xml:1389(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"A bővítménykészítésről további angol nyelvű információt a gedit weblapon találhat." + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "Kis- és nagybetű bővítmény" + +#: C/gedit.xml:1394(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"A Kis- és nagybetű módosítása bővítmény a kis- és " +"nagybetűk közti váltást segíti." + +#: C/gedit.xml:1395(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"A következő menüpontok jelennek meg a Szerkesztés " +"menüben, ha a Kis- és nagybetű módosítása " +"bővítmény engedélyezve van:" + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "Menüpont" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "Művelet" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "Példa" + +#: C/gedit.xml:1415(guisubmenu) C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "Kis- és nagybetű módosítása" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "Mind nagybetűs" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "Minden karakter nagybetűssé alakítása." + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "Ez a szöveg átalakul EZ A SZÖVEG-gé" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "Mind kisbetűs" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "Minden karakter kisbetűssé alakítása." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "Ez A Szöveg átalakul ez a szöveg-gé" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "Kis- és nagybetű invertálása" + +#: C/gedit.xml:1428(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "Minden kisbetű nagybetűre cserélése, és minden nagybetű kisbetűre cserélése." + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Ez A Szöveg átalakul eZ a sZÖVEG-gé" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "Szókezdő" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "Minden szó első karakterének nagybetűre cserélése." + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "ez a szöveg átalakul Ez A Szöveg-gé" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "Statisztika a dokumentumról bővítmény" + +#: C/gedit.xml:1445(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"A Statisztika a dokumentumról bővítmény " +"megszámolja a sorok számát, a karakterekét szóközökkel együtt, szóközök " +"nélkül, és a szöveg méretét byte-okban. A bővítmény az eredményt a " +"Statisztika a dokumentumról ablakban. A " +"megjelenítéséhez tegye a következőket:" + +#: C/gedit.xml:1447(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Válassza az EszközökStatisztika " +"a dokumentumról menüpontot, ami megjeleníti a " +"Statisztika a dokumentumról ablakot. A " +"Statisztika a dokumentumról ablak a következő " +"információkat jeleníti meg a fájlról:" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "Sorok száma az aktuális dokumentumban." + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "Szavak száma az aktuális dokumentumban." + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Karakterek száma a dokumentumban, beleértve a szóközöket is." + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Karakterek száma a dokumentumban, a szóközök nélkül." + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "A dokumentum mérete bájtban mérve." + +#: C/gedit.xml:1467(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"A dokumentum szerkesztése folytatható a geditben, " +"amíg a Statisztika a dokumentumról ablak nyitva van, de " +"az adatokat frissíteni kell a Statisztika a dokumentumról ablak Frissítés gombjára való kattintással." + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "Külső eszközök bővítmény" + +#: C/gedit.xml:1475(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"A Külső eszközök bővítmény lehetővé teszi külső " +"parancsok futtatását a geditből. Lehetőség van " +"egy szövegrész egy parancs bemenetére küldésére, majd az így kiadott parancs " +"kimenetére való cseréjére (például sed). " +"Lehetséges előre megadott parancsok futtatása is (például make)." + +#: C/gedit.xml:1476(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"A Külső eszközök kezelése eszközzel lehet parancsokat " +"létrehozni és szerkeszteni. Egy külső parancs futtatásához válassza ki azt " +"az Eszközök menüből." + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "Beépített parancsok" + +#: C/gedit.xml:1480(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"A következő parancsok érkeznek a Külső eszközök " +"bővítménnyel:" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Összeállítás" + +#: C/gedit.xml:1484(para) +msgid "Runs make in the current document's directory." +msgstr "Futtatja a make parancsot a jelenlegi könyvtárban." + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "Könyvtárlista" + +#: C/gedit.xml:1489(para) +msgid "Lists the contents of the current document's directory in a new document." +msgstr "Felsorolja a dokumentum könyvtárának tartalmát egy új dokumentumba." + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "Környezeti változók" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Az alsó ablaktáblában kijelzi a környezeti változók értékét." + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Rákeres egy kifejezésre mintaillesztés használatával a jelenlegi dokumentum " +"sorai közt, és a találatokat az alsó ablaktáblán jeleníti meg." + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "Befejező szóközök eltávolítása" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Eltávolítja a sorok végén lévő szóközöket." + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "Parancs létrehozása" + +#: C/gedit.xml:1512(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Egy külső parancs létrehozásához válassza az EszközökKülső eszközök menüpontot." + +#: C/gedit.xml:1513(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"A Külső eszközök kezelése ablakon kattintson az " +"Új gombra. A következő részleteket lehet megadni az " +"új parancshoz:" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "Leírás" + +#: C/gedit.xml:1517(para) +msgid "This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"A leírás az állapotsoron jelenik meg, amikor a menüből a parancs " +"kiválasztásra kerül." + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "Gyorsbillentyű" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Megadhat egy gyorsbillentyűt, amire a parancs lefut." + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "Parancsok" + +#: C/gedit.xml:1527(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"A futtatandó parancsok. Néhány gedit környezeti " +"változó is használható. Lásd ." + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "Bemenet" + +#: C/gedit.xml:1532(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"A parancsnak (stdin formájában) adandó bemenet: az " +"egész szöveg, a kijelölés, az aktuális sor vagy szó." + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "Kimenet" + +#: C/gedit.xml:1537(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Mi történjen a parancs kimenetével: az alsó ablaktáblán jelenjen meg, egy új " +"dokumentumba kerüljön, vagy a jelenlegi dokumentumban cserélje le az egész " +"szöveget, a kijelölést, vagy kerüljön az elejére vagy a végére." + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "Alkalmazhatóság" + +#: C/gedit.xml:1542(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Meghatározza, hogy milyen típusú dokumentumokon hajtható végre a parancs. " +"Például csak a mentetteken vagy mentetleneken, a helyieken vagy éppen a " +"távoliakon." + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "Eszközök szerkesztése és eltávolítása" + +#: C/gedit.xml:1551(para) +msgid "To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Egy eszköz szerkesztéséhez válassza ki a listából és módosítsa a " +"beállításait." + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "Egy eszköz átnevezéséhez kattintson újra a nevére a listában." + +#: C/gedit.xml:1553(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Egy beépített eszközön végzett módosításokon végzett módosítások " +"visszavonásához kattintson a Visszaállítás gombra." + +#: C/gedit.xml:1554(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Egy eszköz eltávolításához válassza ki a listából és kattintson az " +"Eltávolítás gombra. A beépített eszközöket nem lehet " +"törölni." + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "Változók" + +#: C/gedit.xml:1559(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "A következő változókat használhatja a Parancsok mezőben:" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "Fájlböngésző bővítmény" + +#: C/gedit.xml:1588(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"A Fájlböngésző bővítmény fájlokat és mappákat " +"jelenít meg az oldalsó ablaktáblában, megkönnyítve a fájlok megnyitását." + +#: C/gedit.xml:1589(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"A fájlböngésző megtekintéséhez válassza a NézetOldalsó ablaktábla " +"menüpontot, majd az ablaktábla alján a fájlböngészőt ábrázoló fülre." + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "Fájlok böngészése" + +#: C/gedit.xml:1592(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"A fájlböngésző oldal alapértelmezésben a fájlböngésző könyvjelzőit jeleníti " +"meg. Valamelyikük böngészéséhez kattintson rá duplán." + +#: C/gedit.xml:1593(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Egy szülőmappa kiválasztásához válassza ki a legördülő listából, vagy " +"kattintson a fájlböngésző eszközsorán a fölfelé mutató nyílra." + +#: C/gedit.xml:1594(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Az aktuális dokumentumot tartalmazó könyvtárra való navigáláshoz kattintson " +"jobb gombbal a fájllistára, majd válassza az A gyökér " +"beállítása az aktív dokumentumra elemet." + +#: C/gedit.xml:1598(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Egy fájl geditben való megnyitásához kattintson " +"rá duplán a fájllistában." + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "Fájlok és mappák létrehozása" + +#: C/gedit.xml:1602(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Egy új, üres szövegfájl jelenleg a fájlböngészőben megjelenített mappában " +"történő létrehozásához kattintson jobb egérgombbal a fájllistára és válassza " +"az Új fájl elemet." + +#: C/gedit.xml:1603(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Egy új mappa jelenleg a fájlböngészőben megjelenített mappában történő " +"létrehozásához kattintson jobb egérgombbal a fájllistára és válassza az " +"Új mappa elemet." + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "Sorok behúzása bővítmény" + +#: C/gedit.xml:1609(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"A Sorok behúzása bővítmény a sorkezdeteken " +"megjelenő behúzást növeli vagy csökkenti." + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "A behúzás növeléséhez vagy csökkentéséhez tegye a következőket:" + +#: C/gedit.xml:1612(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Jelölje ki a behúzandó sorokat. Egy sor behúzásához egyszerűen legyen a " +"kurzor abban a sorban." + +#: C/gedit.xml:1617(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"A behúzás növeléséhez válassza a SzerkesztésBehúzás menüpontot." + +#: C/gedit.xml:1620(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"A behúzás mértékének csökkentéséhez válassza a " +"SzerkesztésBehúzás csökkentése menüpontot." + +#: C/gedit.xml:1625(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"A behúzáshoz használt szóközök száma, illetve a tabulátor karakter " +"használata a Tabulátorok beállításától függ, ami a " +"Beállítások ablak Szerkesztő lapján található. Lásd ." + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "Dátum és idő beszúrása bővítmény" + +#: C/gedit.xml:1631(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"A Dátum és idő beszúrása bővítmény a jelenlegi " +"dátumot és időt szúrja be a dokumentumba. A Dátum és idő beszúrása bővítmény " +"használatához tegye a következőket:" + +#: C/gedit.xml:1633(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Válassza a SzerkesztésDátum és " +"idő beszúrása menüpontot." + +#: C/gedit.xml:1634(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Ha nem állította be, hogy a Dátum és idő beszúrása bővítmény kérdés nélkül " +"egy bizonyos dátum- és időformátumot használjon, a gedit egy Dátum és idő beszúrása című ablakot " +"jelenít meg. Válassza ki a kívánt formátumot a felsorolásból. Kattintson a " +"Beszúrás gombra a Dátum és idő beszúrása ablak bezárásához. A gedit beszúrja a " +"az aktuális dátumot és időt a kurzorhoz." + +#: C/gedit.xml:1635(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Ha úgy állította be a geditet, hogy használjon " +"egy bizonyos dátum- és időformátumot, a Dátum és idő beszúrása ablak nem jelenik meg, hanem a beállított formában került a dátum " +"és idő a beszúrásra a kurzorhoz." + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "A Dátum és idő beszúrása bővítmény beállítása" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "A Dátum és idő beszúrása bővítmény beállításához tegye a következőket:" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Válassza ki a Dátum és idő beszúrása bővítményt." + +#: C/gedit.xml:1652(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Kattintson a Bővítmény beállítása gombra a " +"Dátum/idő bővítmény beállítása ablak megjelenítéséhez." + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "Válasszon a következő lehetőségekből:" + +#: C/gedit.xml:1657(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"A dátum és idő formátumának minden egyes beszúrás előtt való megkérdezéséhez " +"válassza a Formátum bekérése lehetőséget." + +#: C/gedit.xml:1660(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"A dátum és idő formátumának egy gedit által " +"javasolt formátumra rögzítéséhez válassza az A kiválasztott " +"formátum használata lehetőséget, majd válassza ki a kívánt " +"formátumot a listából. Ha ezt a lehetőséget választja, a gedit nem fogja megkérdezni a SzerkesztésDátum és idő beszúrása " +"menüpont kiválasztásakor a beszúrandó formátumot." + +#: C/gedit.xml:1663(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Egy egyedi dátum- és időformátum rögzítéséhez válassza az Egyéni " +"formátum használata lehetőséget, majd írja be a kívánt formátumot " +"a szövegmezőbe. Ennek módjáról a strftime oldalon olvashat. Ha ezt a lehetőséget " +"választja, a gedit nem fogja megkérdezni a " +"SzerkesztésDátum és idő " +"beszúrása menüpont kiválasztásakor a beszúrandó " +"formátumot." + +#: C/gedit.xml:1668(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Kattintson az OK gombra a Dátum/idő " +"bővítmény beállítása ablak bezárásához." + +#: C/gedit.xml:1671(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"A Beállítások ablak bezárásához kattintson a " +"Bezárás gombra." + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Módsorok bővítmény" + +#: C/gedit.xml:1679(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"A Módsorok bővítmény lehetővé teszi a " +"dokumentumonkénti szerkesztésibeállítás-megadást. Módsor alatt egy olyan sornyi szöveg a dokumentum elején vagy végén, " +"amely a gedit által értelmezhető beállításokat " +"tartalmaz." + +#: C/gedit.xml:1680(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"A módsor beállításai elsőbbséget élveznek a beállítások ablakban " +"megadottakkal szemben." + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "A következő beállításokat lehet módsorokkal megadni:" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Tabulátorszélesség" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "Behúzás szélessége" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "Tabulátorok helyett szóközök használata" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "Jobb margó szélessége" + +#: C/gedit.xml:1700(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"A Módsorok bővítmény az Emacs, Kate és Vim által használt lehetőségek egy részét támogatja." + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Emacs módsorok" + +#: C/gedit.xml:1704(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"A dokumentum első két sorában kerülnek felismerésre az Emacs módsorok." + +#: C/gedit.xml:1705(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"A következő Emacs beállítások vannak támogatva: " +"tab-width, indent-offset, indent-tabs-mode és autowrap. Továbbiakért lásd a " +"GNU Emacs kézikönyvét (angolul)." + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Kate módsorok" + +#: C/gedit.xml:1709(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"A dokumentum első és utolsó 10 sorában kerülnek felismerésre a " +"Kate módsorok." + +#: C/gedit.xml:1710(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"A következő Kate beállítások vannak támogatva: " +"tab-width, indent-width, space-indent, word-wrap és word-wrap-column. " +"Továbbiakért lásd a Kate weboldalát (angolul)." + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Vim módsorok" + +#: C/gedit.xml:1714(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"A dokumentum első és utolsó 3 sorában kerülnek felismerésre a " +"Vim módsorok." + +#: C/gedit.xml:1715(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"A következő Vim beállítások vannak támogatva: et, " +"expandtab, ts, tabstop, sw, shiftwidth, wrap, és textwidth. Továbbiakért " +"lásd a Vim weboldalát (angolul)." + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Python konzol bővítmény" + +#: C/gedit.xml:1721(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"A Python konzol bővítmény lehetővé teszi python " +"programozási nyelven írt parancsok végrehajtását a geditből. A bővítmény engedélyezésekor megjelenik az alsó ablaktáblán " +"egy új fül. Ez a kimenetet és a parancsbeíró mezőt jeleníti meg." + +#: C/gedit.xml:1722(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"A konzolra beírt parancsok nem kerülnek végrehajtás előtt ellenőrzésre. A " +"gedit kiakasztása is lehetséges, például egy " +"végtelen ciklusba való belépéssel." + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "Töredékek bővítmény" + +#: C/gedit.xml:1727(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"A Töredékek bővítmény lehetővé teszi gyakran " +"használt szövegrészletek, úgynevezett töredékek " +"tárolását, és gyors beszúrását a dokumentumba." + +#: C/gedit.xml:1728(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"A töredékek a jelenlegi dokumentum nyelvi szintaxisához kötődnek. Például " +"HTML dokumentum szerkesztésekor HTML-hez használható töredékekből lehet " +"választani. Néhány töredék globális, mindenféle dokumentumból elérhető." + +#: C/gedit.xml:1729(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Számos beépített töredék érkezik a gedittel, " +"amelyek módosíthatóak." + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "Töredékek beszúrása" + +#: C/gedit.xml:1733(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Egy töredék beszúrásához írja be a tab aktiválóját " +"majd nyomja meg a Tab billentyűt. A töredék tab aktiválója " +"általában a töredék első néhány betűje, vagy valami más könnyen " +"megjegyezhető." + +#: C/gedit.xml:1734(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"A CtrlSzóköz " +"billentyűkombinációval megjelennek a beszúrható töredékek." + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "Töredékek hozzáadása" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "Egy új töredék létrehozásához tegye a következőt:" + +#: C/gedit.xml:1742(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Válassza az EszközökTöredékek " +"kezelése menüpontot. Megjelenik a " +"Töredékek kezelése ablak." + +#: C/gedit.xml:1745(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"A töredékek listája nyelv szerinti csoportokra van bontva. Válassza ki a " +"kívánt nyelvet, vagy egy ehhez a nyelvhez tartozó töredéket. Egy az összes " +"nyelvre alkalmazható töredék felvételéhez válassza a Globális lehetőséget a " +"lista tetejéről. A jelenleg megnyitott dokumentum szintaxisa lesz az " +"alapértelmezetten kiválasztott lehetőség." + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Kattintson az Új gombra. Egy új töredék jelenik meg a " +"listában." + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "Adja meg a következő adatokat az új töredékről:" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "Név" + +#: C/gedit.xml:1755(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Adjon nevet a töredéknek a listában lévő szövegmezőben. A töredék neve csak " +"a céljára emlékeztet. A listán a töredék nevére kattintva lehet " +"megváltoztatni azt." + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "Töredék szövege" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Írja be a töredék szövegét a Töredék szerkesztése " +"szövegdobozba. A speciális kódokról lásd ." + +#: C/gedit.xml:1761(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Vissza lehet váltani a dokumentumablakra is a Töredékkezelő bezárása nélkül, így lehet onnan szöveget másolni is." + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Tab aktiváló" + +#: C/gedit.xml:1766(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Adja meg a tab aktiválót a töredékhez. Ez a szöveg az, amit a Tab billentyű leütése előtt be kell írni a töredék beszúrásához." + +#: C/gedit.xml:1767(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Ez egy csak betűkből álló szó vagy egy karakter lehet. A Tab " +"aktiváló mező pirossá válik, ha érvénytelen tab aktiválót ad meg." + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "Gyorsbillentyű" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "A töredék beszúrására használt gyorsbillentyű." + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "Töredékek szerkesztése és törlése" + +#: C/gedit.xml:1782(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Egy töredék szerkesztéséhez válassza ki azt a listából és tegye meg a kívánt " +"változtatásokat a szövegében vagy az aktiválási módjának beállításaiban." + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Egy töredék átnevezéséhez kattintson még egyszer a nevére a listán." + +#: C/gedit.xml:1784(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Egy ön által megváltoztatott beépített töredék visszaállításához az " +"eredetire kattintson a Visszaállítás gombra." + +#: C/gedit.xml:1785(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Egy töredék eltávolításához kattintson a Törlés " +"gombra. A beépített töredékek nem törölhetőek." + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "Helykitöltők a töredékekben" + +#: C/gedit.xml:1790(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"A tárolt szöveg beszúrásán túl lehetőség van személyre szabható töredékek " +"használatára is. Meg lehet jelölni olyan helyeket a töredéken belül, ahol a " +"beszúrás után könnyedén írható más szöveg (érték)." + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "A következő helykitöltő kódokat lehet használni a töredék szövegében:" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Tab helykitöltők" + +#: C/gedit.xml:1798(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"A $n olyan tab helykitöltőt " +"jelez, ahol n pozitív egész." + +#: C/gedit.xml:1799(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"A ${n:alapértelmezés} olyan tab helykitöltőt jelez, amely rendelkezik " +"alapértelmezett értékkel." + +#: C/gedit.xml:1800(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"A tab helykitöltő olyan helyet jelöl a szövegben, ahova további szöveg " +"írható a töredék beszúrása után." + +#: C/gedit.xml:1801(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"A tab helykitöltő használatához szúrja be a töredéket a szokott módon. A " +"kurzor az első helykitöltőhöz kerül. Írja be a kívánt szöveget, majd nyomja " +"meg a Tab billentyűt a következő helykitöltőre való " +"lépéshez. A helykitöltők sorszáma a kitöltés sorrendjét is meghatározza." + +#: C/gedit.xml:1802(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"A ShiftTab " +"billentyűkombinációval visszafele léphet a helykitöltők között. Az utolsó " +"tab helykitöltő kitöltése után a Tab billentyűt megnyomva a " +"töredék végére vagy, ha létezik, a záró helykitöltőre kerül a kurzor." + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Tükrözött helykitöltő" + +#: C/gedit.xml:1807(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Egy megismételt tab helykitöltő tükrözni fogja a korábban definiált " +"helykitöltő változásait. Ez lehetővé teszi egy többször megjelenítendő " +"szöveg egyszeri beírását." + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "Záró helykitöltő" + +#: C/gedit.xml:1812(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"A $0 egy záró helykitöltőt határoz meg. Ez lehetővé teszi " +"a töredék beszúrását befejezvén a munka folytatását egy a töredék végétől " +"eltérő kurzorpozíción." + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "Környezeti változók" + +#: C/gedit.xml:1817(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"A környezeti változók – mint a $PATH és a $HOME – behelyettesítésre kerülnek a töredék szövegében. A következő " +"gedit-specifikus változók érhetőek el:" + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "Az aktuálisan kijelölt szöveg." + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"A dokumentum teljes fájlneve, vagy egy üres karakterlánc, ha a dokumentum " +"még nincs mentve." + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"A dokumentum kiterjesztés és könyvtárútvonal nélküli fájlneve, vagy egy üres " +"karakterlánc, ha a dokumentum még nincs mentve." + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"Az a szó, melyen a kurzor pillanatnyilag áll. Ha a változó szerepel a " +"töredék szövegében, ez a szó kerül lecserélésre a beszúrt töredékkel." + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Parancsértelmezett helykitöltők" + +#: C/gedit.xml:1846(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"A $(parancs) helyére a " +"parancs parancs kimenete kerül." + +#: C/gedit.xml:1847(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"A $(n:parancs)" +" forma lehetővé teszi a parancsnak referenciaszám adását, ahol " +"n pozitív egész. $n formában hivatkozhat ennek a parancsnak a kimenetére " +"egy másik parancs bemeneti paramétereként." + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Python helykitöltők" + +#: C/gedit.xml:1852(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<parancs> kicserélésre " +"kerül a python által a parancs parancsra adott " +"kimenetre." + +#: C/gedit.xml:1853(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"<a:parancs> egy másik python helykitöltőt tesz függőséggé, " +"ahol a a sorrendet adja meg a töredékben. Ez " +"lehetővé teszi más töredékekben használt python függvények használatát a " +"töredékben. Több függőség megadásához vesszővel válassza el a számokat: " +"<a,b:" +"parancs>" + +#: C/gedit.xml:1854(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Egy változó bármelyik másik python töredékben való használatához deklarálja " +"azt globálisként (global)." + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "Rendezés bővítmény" + +#: C/gedit.xml:1864(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"A Rendezés bővítmény a kijelölt sorokat " +"betűrendbe teszi." + +#: C/gedit.xml:1865(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"A rendezés művelet nem vonható vissza, ezért érdemes végrehajtása előtt " +"menteni. A mentett verzióra való visszatéréshez válassza a " +"FájlVisszaállítás menüpontot." + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "A Rendezés bővítmény használatához tegye a következőket:" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "Jelölje ki a rendezendő sorokat a szövegben." + +#: C/gedit.xml:1873(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Válassza a SzerkesztésRendezés menüpontot. Megjelenik a Rendezés ablak." + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "Válassza ki a kívánt beállításokat:" + +#: C/gedit.xml:1879(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"A fordított betűrendbe való rendezéshez válassza a Fordított " +"sorrend lehetőséget." + +#: C/gedit.xml:1882(para) +msgid "To delete duplicate lines, select Remove duplicates." +msgstr "" +"A többször szereplő sorok törléséhez válassza a Duplikátumok " +"eltávolítása lehetőséget." + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"A kis- és nagybetűk egyenrangúként kezeléséhez válassza a Kis- és " +"nagybetű nem számít lehetőséget." + +#: C/gedit.xml:1888(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Ahhoz, hogy a rendezésnél a sorok első néhány karaktere ne kerüljön " +"figyelembevételre, válassza ki az első figyelembe veendő karakter számát a " +"Kezdőoszlop léptetőmezőben." + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"A rendezés végrehajtásához kattintson a Rendezés " +"gombra." + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "Helyesírás-ellenőrző bővítmény" + +#: C/gedit.xml:1901(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"A Helyesírás-ellenőrző bővítmény ellenőrzi a " +"helyesírást a kiválasztott szövegben. Be lehet úgy is állítani a " +"geditet, hogy automatikusan ellenőrizze a " +"helyesírást. Kézzel is elindíthatja a helyesírás-ellenőrzést egy megadott " +"nyelven. A nyelvi és automatikus-ellenőrzési beállítások dokumentumonként " +"kerülnek alkalmazásra. A Helyesírás-ellenőrző bővítmény használatához tegye " +"a következőket:" + +#: C/gedit.xml:1903(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Válassza az EszközökNyelv " +"megadása menüpontot, ami megjeleníti a " +"Nyelv megadása ablakot. Válassza ki a kívánt nyelvet a " +"felsorolásból. Kattintson az OK gombra, ami bezárja a " +"Nyelv megadása ablakot." + +#: C/gedit.xml:1906(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"A helyesírás automatikus ellenőrzéséhez válassza az " +"EszközökHelyesírás automatikus " +"ellenőrzése menüpontot. A kikapcsolásához " +"válassza újra az EszközökHelyesírás automatikus ellenőrzése menüpontot. Amennyiben be van kapcsolva, az " +"Helyesírás automatikus ellenőrzése menüpont " +"mellett megjelenik egy pipa. A helyesírás automatikus ellenőrzése a " +"gedit minden indításakor automatikusan ki van " +"kapcsolva." + +#: C/gedit.xml:1907(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"A felismert helyesírási hibák más színnel, aláhúzva jelennek meg. Jobb " +"egérgombbal a szóra kattintva válassza a Helyesírási javaslatok menüpontot a megjelenő menüből:" + +#: C/gedit.xml:1910(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"A hibás szó egy javaslatra cseréléséhez válassza ki azt a " +"Helyesírási javaslatok menüből." + +#: C/gedit.xml:1913(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Ha a szó mégis helyes, fölveheti a személyes szótárába a " +"Helyesírási javaslatokHozzáadás menüpontot választva." + +#: C/gedit.xml:1916(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"A hibajelzés megszüntetéséhez a hibásnak jelzett szó minden előfordulásánál " +"válassza a Helyesírási javaslatokMindet átugorja menüpontot. " +"Így a szó nem kerül be a személyes szótárba, de gedit munkamenet végéig nem lesz hibásnak jelölve." + +#: C/gedit.xml:1921(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"A helyesírás kézi ellenőrzéséhez válassza az EszközökHelyesírás-ellenőrzés " +"menüpontot." + +#: C/gedit.xml:1923(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Ha az alkalmazás nem talál helyesírási hibát, egy Információ ablak jelenik meg jelezve, hogy nem talált helyesírási hibát. " +"Kattintson az OK gombra az Információ ablak bezárásához." + +#: C/gedit.xml:1925(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Ha az alkalmazás talált helyesírási hibát, a Helyesírás-" +"ellenőrzés ablak jelenik meg:" + +#: C/gedit.xml:1928(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "A Hibásan írt szó az ablak felső részén jelenik meg." + +#: C/gedit.xml:1931(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Az Erre mezőben jelenik meg a kiválasztott javaslat. " +"Ezt a Javaslatok felsorolásból való kiválasztással vagy " +"a helyes szó Erre mezőbe való begépelésével " +"változtathatja meg." + +#: C/gedit.xml:1934(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Az Erre mezőbe begépelt szó ellenőrzéséhez kattintson a " +"Szó ellenőrzése gombra. Ha a szó helyes, a " +"Javaslatok felsorolás helyére a (helyes " +"írásmód) szöveg kerül. Ha a szó ismeretlen, az arra vonatkozó " +"helyesírás-javítási javaslatok jelennek meg a Javaslatok felsorolásban." + +#: C/gedit.xml:1937(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"A hibásnak jelölt szó jelen előfordulásának figyelmen kívül hagyásához " +"kattintson a Kihagyás gombra. A szó összes " +"előfordulásának figyelmen kívül hagyásához kattintson a Mindet " +"kihagyja gombra. A szó csak a jelenlegi gedit munkamenetben kerül figyelmen kívül hagyásra." + +#: C/gedit.xml:1940(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"A szó jelen előfordulásának az Erre mezőbe írt szóra " +"való cseréjéhez kattintson a Módosítás gombra. A " +"szóalak összes előfordulásának az Erre mezőbe írt szóra " +"való cseréjéhez kattintson a Mindet módosítja gombra." + +#: C/gedit.xml:1943(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"A hibásnak jelölt szó személyes szótárba való felvételéhez kattintson a " +"Szó hozzáadása gombra." + +#: C/gedit.xml:1946(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"A Helyesírás-ellenőrzés ablak bezárásához kattintson a " +"Bezárás gombra." + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "Elemlista bővítmény" + +#: C/gedit.xml:1956(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Az Elemlista bővítmény lehetővé teszi a gyakori " +"elemek egy oldalsávi ablaktábláról való beillesztését." + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Az elemlista bővítmény használatához tegye a következőket:" + +#: C/gedit.xml:1959(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Válassza a NézetOldalsó " +"ablaktábla menüpontot." + +#: C/gedit.xml:1963(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Alapértelmezésben az oldalsó ablaktábla a megnyitott dokumentumok listáját " +"jeleníti meg. Kattintson a + jelet ábrázoló fülre az oldaltábla alján." + +#: C/gedit.xml:1965(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Válassza ki a megfelelő elemkategóriát a legördülő listáról. Például " +"HTML – elemek." + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Görgesse a megjelenő felsorolást a kívánt elem megkereséséhez." + +#: C/gedit.xml:1971(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"A jelenlegi fájlba az elem kurzorpozíciónál való beszúrásához kattintson " +"duplán a felsorolásban lévő elemre. A következő módon is szúrhat be elemet:" + +#: C/gedit.xml:1973(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Nyomja meg az Enter billentyűt az elem beillesztéséhez és a " +"fókusz megjelenítőterületre való helyezéséhez." + +#: C/gedit.xml:1976(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Az elem beszúrásához és a fókusz elemlista bővítmény " +"ablakán való tartásához használja a ShiftEnter billentyűkombinációt." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Kelemen Gábor , 2007., 2008.\n" +"Őry Máté , 2007., 2008." + diff --git a/help/it/figures/gedit_window.png b/help/it/figures/gedit_window.png new file mode 100755 index 00000000..0f4c1ff7 Binary files /dev/null and b/help/it/figures/gedit_window.png differ diff --git a/help/it/it.po b/help/it/it.po new file mode 100755 index 00000000..af39b561 --- /dev/null +++ b/help/it/it.po @@ -0,0 +1,4679 @@ +# Italian translation of Gedit manual +# Copyright (C) 2007, 2008, 2009 The Free Software Foundation, Inc +# This file is distributed under the same license as the gedit package. +# +# Milo Casagrande , 2007-2009 +msgid "" +msgstr "" +"Project-Id-Version: gedit manual\n" +"POT-Creation-Date: 2009-03-04 16:53+0000\n" +"PO-Revision-Date: 2009-03-04 19:23+0100\n" +"Last-Translator: Milo Casagrande \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Questo documento può essere copiato, distribuito o modificato in base ai " +"termini della GNU Free Documentation License (GFDL), versione 1.1 o di " +"versioni successive pubblicate dalla Free Software Foundation che siano " +"prive di sezioni invariabili, frontespizi e retrocopertine. La GFDL è " +"disponibile accedendo a questo link o nel file COPYING-DOCS distribuito con questo manuale." + +#: 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 "" +"Questo manuale fa parte di una raccolta di documenti su MATE distribuita " +"secondo i termini della GFDL. Per distribuire questo manuale separatamente, " +"è necessario aggiungere al documento una copia della licenza, come descritto " +"nella sezione 6 di quest'ultima." + +#: 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 "" +"Molti dei nomi utilizzati dalle aziende per distinguere i propri prodotti e " +"servizi sono rivendicati come marchi. Ove tali nomi sono citati nella " +"documentazione di MATE e i membri del MATE Documentation Project sono a " +"conoscenza della loro natura di marchi, tali nomi vengono riportati a " +"lettere maiuscole o con iniziale maiuscola." + +#: 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 " +"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 "" +"IL DOCUMENTO VIENE DISTRIBUITO SENZA ALCUNA GARANZIA ESPLICITA O IMPLICITA " +"DI ALCUN TIPO, INCLUSE, SENZA LIMITAZIONE, LA GARANZIA DI ASSENZA DI DIFETTI " +"DEL DOCUMENTO O DELLE SUE VERSIONI MODIFICATE O LA GARANZIA CHE IL DOCUMENTO " +"SIA COMMERCIABILE, SIA ADATTO A UN DETERMINATO SCOPO O NON VIOLI DIRITTI DI " +"TERZI. TUTTI I RISCHI RIGUARDO ALLA QUALITÀ;, L'ACCURATEZZA E LE PRESTAZIONI " +"DEL DOCUMENTO O DELLE SUE VERSIONI MODIFICATE SONO A CARICO DELL'UTENTE. " +"QUALORA UN DOCUMENTO O UNA SUA VERSIONE MODIFICATA SI RIVELINO DIFETTOSI, I " +"COSTI DEGLI EVENTUALI INTERVENTI DI ASSISTENZA, RIPARAZIONE O CORREZIONE " +"SARANNO A CARICO DELL'UTENTE (NON DEL REDATTORE INIZIALE, DELL'AUTORE O DI " +"ALTRI COLLABORATORI). LA PRESENTE ESCLUSIONE DI GARANZIA COSTITUISCE PARTE " +"ESSENZIALE DELLA LICENZA. SONO AUTORIZZATI SOLO GLI USI DEL DOCUMENTO O " +"DELLE SUE VERSIONI MODIFICATE PREVISTI DALLA PRESENTE ESCLUSIONE DI " +"GARANZIA; INOLTRE IN NESSUNA CIRCOSTANZA E IN NESSUNA INTERPRETAZIONE " +"GIURIDICA, INCLUSI I CASI DI ILLECITO (ANCHE PER NEGLIGENZA), VIOLAZIONE " +"CONTRATTUALE O ALTRO, L'AUTORE, IL REDATTORE INIZIALE, ALTRI COLLABORATORI, " +"QUALUNQUE DISTRIBUTORE DEL DOCUMENTO O DI UNA SUA VERSIONE MODIFICATA O " +"QUALUNQUE FORNITORE DELLE PARTI CITATE POTRÀ; ESSERE RITENUTO RESPONSABILE " +"NEI CONFRONTI DI QUALUNQUE PERSONA PER DANNI DIRETTI, INDIRETTI, SPECIALI, " +"INCIDENTALI O CONSEQUENZIALI DI QUALUNQUE NATURA, INCLUSI, SENZA " +"LIMITAZIONE, I DANNI DOVUTI A PERDITA DI AVVIAMENTO, INTERRUZIONE DEL " +"LAVORO, GUASTO O MALFUNZIONAMENTO DEL COMPUTER O QUALUNQUE ALTRO DANNO O " +"PERDITA DERIVANTE DA O CORRELATO ALL'USO DEL DOCUMENTO O DI UNA SUA VERSIONE " +"MODIFICATA, ANCHE NEL CASO IN CUI TALI PARTI FOSSERO STATE INFORMATE DELLA " +"POSSIBILITÀ; DI TALI DANNI." + +#: 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: " +"" +msgstr "" +"QUESTO DOCUMENTO E LE SUE VERSIONI MODIFICATE SONO DISTRIBUITI SECONDO I " +"TERMINI DELLA GNU FREE DOCUMENTATION LICENSE, CON L'ULTERIORE INTESA CHE: " +"" + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "fatto" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "fatto" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Manuale di gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Progetto documentazione di MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Aggiunta la tabella sulle scorciatoie" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java Desktop System Documentation Team" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "" +"Cicek ha fornito informazioni sulle revisioni precedenti dell'applicazione " +"gedit." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Ringraziamenti" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George ha fornito informazioni sui plugin." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Manuale di gedit V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Marzo 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE Documentation Team" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Manuale di gedit V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Giugno 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Manuale di gedit V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Agosto 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Manuale di gedit V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Settembre 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Manuale di gedit V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Gennaio 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Manuale di gedit V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Marzo 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Manuale di gedit V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Settembre 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Manuale di gedit V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Marzo 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Manuale di gedit V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Luglio 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Manuale di gedit V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "Team di documentazione di MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Questo manuale descrive la versione 2.16 di gedit." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Commenti" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Per segnalare un problema o inviare suggerimenti sull'applicazione " +"gedit o su questo manuale, seguire le istruzioni " +"presenti alla pagina di commenti su MATE." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit è un editor di testo per lo MATE Desktop dotato di funzionalità " +"basilari e avanzate come la stampa dei documenti, il controllo ortografico, " +"la ricerca e sostituzione del testo e l'evidenziazione della sintassi. " +"Ulteriori funzionalità avanzate sono disponibili come plugin." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "editor di testo" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Introduzione" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"L'applicazione gedit consente di creare e " +"modificare file di testo." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"Lo scopo di gedit è quello di essere un semplice " +"editor di testo. Caratteristiche più avanzate possono essere abilitate " +"attraverso l'uso di diversi plugin, che consentono lo " +"svolgimento di diverse attività correlate alla modifica di file di testo." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Per iniziare" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Avviare gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"È possibile avviare gedit nei seguenti modi:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Menù Applicazioni" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Scegliere AccessoriEditor di " +"testo." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Riga di comando" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Eseguire il seguente comando: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"In modo predefinito, aprendo un documento di testo dal file manager, gedit " +"viene avviato mostrando il contenuto del documento." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "La finestra di gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"All'avvio di gedit viene visualizzata la seguente " +"finestra:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Finestra di gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Mostra la finestra principale di gedit." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"La finestra di gedit contiene i seguenti elementi:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Barra dei menù" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"I menù della barra dei menù contengono tutti i comandi necessari per le " +"operazioni sui file in gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Barra degli strumenti" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"La barra degli strumenti contiene un sottoinsieme dei comandi a cui è " +"possibile accedere nella barra dei menù." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Area di visualizzazione" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "" +"L'area di visualizzazione contiene il testo del file che si sta modificando." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Barra di stato" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"La barra di stato visualizza informazioni sulle attività di " +"gedit attualmente in corso e altre indicazioni " +"contestuali relative alle voci di menù." + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Posizione del cursore: il numero di riga e di colonna in cui è posizionato " +"il cursore." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Modalità di modifica: se l'editor è in modalità di inserimento, la barra di " +"stato contiene l'indicazione INS. Se l'editor è in " +"modalità di sovrascrittura, la barra di stato contiene l'indicazione " +"SSC. Premere Ins per cambiare la " +"modalità di modifica." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Riquadro laterale" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"Il riquadro laterale visualizza l'elenco dei documenti aperti e altre " +"informazioni in base ai plugin abilitati." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Il riquadro laterale, in modo predefinito, non è mostrato. Per " +"visualizzarlo, scegliere VisualizzaRiquadro laterale." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Riquadro inferiore" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Il riquadro inferiore è utilizzato dagli strumenti di programmazione come il " +"plugin Console Python per la visualizzazione " +"dell'output." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Il riquadro inferiore, in modo predefinito, non è mostrato. Per " +"visualizzarlo, scegliere VisualizzaRiquadro inferiore." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Facendo clic con il pulsante destro del mouse nella finestra di " +"gedit, l'applicazione visualizza un menù pop-up. " +"Questo menù contiene i comandi di uso più frequente per la modifica del " +"testo." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Come in altre applicazioni di MATE, le azioni da svolgere in " +"gedit possono essere svolte in diversi modi: " +"attraverso i menù, dalla barra degli strumenti o con le scorciatoie da " +"tastiera. Le scorciatoie da tastiera comuni a tutte le applicazioni sono " +"elencate nella Guida utente." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Eseguire gedit dalla riga di comando" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"È possibile eseguire gedit dalla riga di comando " +"e aprire automaticamente uno o più file. Per aprire più file dalla riga di " +"comando, digitare il comando seguente e premere Invio:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "" +"In alternativa, è possibile specificare un URI invece del nome di un file." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Per maggiori informazioni sull'esecuzione di gedit dalla riga di comando, consultare la pagina di manuale Unix di " +"gedit, gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Lavorare con i file" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Creare un nuovo documento" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Per creare un nuovo documento, scegliere FileNuovo. L'applicazione " +"visualizza un nuovo file nella finestra di gedit." + +#: C/gedit.xml:346(title) C/gedit.xml:1591(title) +msgid "Opening a File" +msgstr "Aprire un file" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Per aprire un file, scegliere FileApri per visualizzare il " +"dialogo Apri file. Selezionare il file da aprire e fare " +"clic su Apri. Il file viene visualizzato nella " +"finestra di gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Mostra l'icona del menù File recenti." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"L'applicazione memorizza il percorso e il nome degli ultimi cinque file che " +"sono stati modificati e li visualizza come voci nel menù " +"File. Questi file sono " +"accessibili anche facendo clic sull'icona della barra degli " +"strumenti." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"Con gedit è possibile aprire anche file multipli. " +"L'applicazione aggiunge, nella finestra, una scheda per ogni file aperto. " +"Per maggiori informazioni, consultare ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Salvare un file" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "È possibile salvare un file nei seguenti modi:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Per salvare le modifiche a un file esistente, scegliere " +"FileSalva." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Per salvare un file nuovo o per salvare un file esistente con un nuovo nome, " +"scegliere FileSalva come.... Inserire il nome da assegnare al file nel dialogo " +"Salva come... e fare clic su Salva." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Per salvare tutti i file aperti in quel momento in gedit, scegliere DocumentiSalva tutti." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Per chiudere tutti i file aperti in quel momento in gedit, scegliere DocumentiChiudi tutti." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Aprire un file da un URI" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Per aprire un file usando un URI (Uniform Resource Identifier), procedere " +"come segue:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Scegliere FileApri posizione per visualizzare il dialogo Apri " +"posizione." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Inserire l'URI del file da aprire." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Usare l'elenco a discesa Codifiche dei caratteri per " +"selezionare la codifica appropriata." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Fare clic su Apri." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"URI validi sono: http:, " +"ftp:, file: e tutti i metodi " +"supportati da mate-vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"I file da alcuni tipi di URI sono aperti in sola lettura e qualsiasi " +"modifica apportata deve essere salvata in una posizione diversa. HTTP " +"consente di leggere solamente i file, anche i file aperti attraverso FTP " +"sono a sola lettura in quanto non tutti i server FTP sono in grado di " +"gestire il salvataggio remoto di file." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Il salvataggio di file su server FTP può essere abilitato attraverso " +"l'Editor della " +"configurazione, impostando la chiave /apps/" +"gedit-2/preferences/editor/save/writable_vfs_schemes. Questo " +"però, potrebbe causare degli errori." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Lavorare con le schede" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Quando sono aperti più file, gedit mostra una " +"scheda per ogni documento sopra l'area di " +"visualizzazione. Per passare a un altro documento, fare clic sulla sua " +"scheda." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Per spostare un documento in un'altra finestra di gedit, trascinare la scheda corrispondente nella finestra in cui si " +"vuole spostarlo." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Inoltre, per spostare un documento in un'altra finestra di " +"gedit, è possibile scegliere " +"DocumentiSposta in una nuova " +"finestra." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Lavorare con il testo" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Modificare il testo" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "È possibile modificare il testo di un file nei seguenti modi:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Inserire del nuovo testo attraverso l'uso della tastiera. Il " +"cursore di inserimento lampeggiante indica il punto " +"dove appare il testo. Per modificarlo, utilizzare le frecce direzionali o " +"fare clic col mouse." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Per copiare il testo selezionato negli appunti, scegliere " +"ModificaCopia." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Per eliminare il testo selezionato dal file e spostarlo negli appunti, " +"scegliere ModificaTaglia." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Per eliminare definitivamente il testo dal file, scegliere " +"ModificaElimina." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Per inserire il contenuto degli appunti nella posizione del cursore, " +"scegliere ModificaIncolla. Prima di incollare un testo in un file è " +"necessario copiarlo o tagliarlo da gedit o da un'altra applicazione." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Per selezionare tutto il testo incluso in un file, scegliere " +"ModificaSeleziona tutto." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Annullare e ripetere le modifiche" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Per annullare una modifica apportata, scegliere " +"ModificaAnnulla. Per ripristinare questa azione, scegliere " +"ModificaRipeti." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Trovare e sostituire del testo" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"In gedit ci sono due modi per cercare del testo. " +"È possibile utilizzare il dialogo Trova per cercare un " +"testo specifico, oppure la Ricerca incrementale per " +"evidenziare le corrispondenze mentre viene digitato il testo." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Trovare del testo" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Per cercare una stringa all'interno di un file, procedere come segue:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Scegliere CercaTrova per visualizzare il dialogo Trova." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Digitare la stringa da trovare nel campo Cerca. È " +"possibile utilizzare dei caratteri speciali come le tabulazioni o gli a " +"capo: consultare ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Fare clic su Trova per cercare la prima occorrenza " +"della stringa nel file dopo la posizione del cursore. Se gedit trova la stringa, l'applicazione ne seleziona la prima " +"occorrenza, le altre vengono solo evidenziate." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Per trovare la prossima occorrenza della stringa, fare clic su " +"Trova o scegliere CercaTrova successivo. Per " +"trovare l'occorrenza precedente, scegliere CercaTrova precedente." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Dopo aver chiuso la finestra di dialogo Trova, è " +"possibile spostare la selezione ad altre occorrenze scegliendo " +"CercaTrova successivo e CercaTrova precedente." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Per rimuovere l'evidenziazione dal testo, scegliere " +"CercaAzzera evidenziazione." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Ricerca incrementale" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"La ricerca incrementale evidenzia le corrispondenze del testo nel documento " +"durante la digitazione, lettera per lettera (simile alla ricerca in diversi " +"browser web)." + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Per avviare una ricerca incrementale, scegliere CercaRicerca incrementale.... " +"Appare la casella di ricerca nella parte superiore dell'area di " +"visualizzazione." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Iniziando a digitare una parola, il testo corrispondente viene evidenziato " +"nel documento e viene selezionata la prima istanza successiva alla posizione " +"del cursore." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Per spostare la selezione alla corrispondenza successiva mantenendo la " +"casella di ricerca aperta, premere CtrlG. Premere CtrlMaiuscG per spostare la selezione indietro." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"È anche possibile utilizzare le frecce direzionali su e giù o la rotellina " +"di scorrimento del mouse per spostare la selezione tra le varie " +"corrispondenze." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Sostituire il testo" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Per cercare una stringa all'interno di un file e sostituirla con un'altra, " +"procedere come segue:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Scegliere CercaSostituisci per aprire la finestra di dialogo " +"Sostituisci." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Digitare la stringa da trovare nel campo Cerca. È " +"possibile utilizzare dei caratteri speciali come le tabulazioni o gli a " +"capo: consultare ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Digitare la stringa con cui sostituire quella che si sta ricercando nel " +"campo Sostituisci con." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Per controllare le occorrenze della stringa prima di sostituirla, fare clic " +"su Trova. Se gedit trova " +"la stringa, questa viene selezionata. Fare clic su Sostituisci per sostituire l'occorrenza selezionata della stringa. Per " +"trovare l'occorrenza successiva, fare clic nuovamente su Trova." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Per sostituire tutte le occorrenze della stringa all'interno del documento, " +"fare clic su Sostituisci tutti." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Opzioni di trova e sostituisci" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Le finestre di dialogo Trova e Sostituisci presentano entrambe le seguenti opzioni:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Selezionare l'opzione Maiuscole/minuscole per " +"individuare solo le occorrenze della stringa che corrispondono esattamente " +"al testo digitato. Per esempio, con l'opzione Maiuscole/minuscole selezionata, «TESTO» non corrisponde a «testo»." + +# (NdT) non mi veniva un esempio migliore... +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Selezionare l'opzione Solo parole intere per " +"individuare solo le occorrenze della stringa che corrispondono a parole " +"intere del testo digitato. Per esempio, con l'opzione Solo parole " +"intere selezionata, «testa» non corrisponde a «testamento»." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Selezionare l'opzione Cercare all'indietro per eseguire " +"la ricerca dalla fine del file al suo inizio." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Selezionare l'opzione Ricominciare dall'inizio per " +"eseguire la ricerca fino alla fine del file e continuare dall'inizio del " +"file." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Caratteri speciali" + +# (NdT) un po' libera... +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"È possibile includere i seguenti caratteri speciali per eseguire ricerche o " +"sostituzioni:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Specifica un \"new line\"." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Specifica un carattere di tabulazione." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +# (NdT) trovare differenza con 'new line' +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Specifica un \"carriage return\"." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"Affinché il carattere backslash possa essere cercato, è necessario usare una " +"sequenza di escape. Per esempio, per cercare \"\\n\", è " +"necessario digitare \"\\\\n\" nel campo Cerca. Oppure, " +"per cercare una sequenza di backslash, è necessario raddoppiare il numero di " +"backslash da cercare." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Posizionare il cursore su una riga specifica" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Per posizionare il cursore su una riga specifica nel file corrente, " +"scegliere CercaVai alla riga.... Appare la casella del numero riga nella parte " +"superiore dell'area di visualizzazione." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Digitare il numero della riga in cui si intende spostare il cursore e il " +"documento scorrerà fino alla riga specificata." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Per rimuovere la casella di testo e spostare il cursore alla riga " +"specificata, premere Invio." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Stampa" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Impostare le opzioni della pagina" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Per impostare le opzioni di pagina, scegliere FileConfigurazione stampa per " +"visualizzare la finestra di dialogo Impostazioni pagina." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"La finestra di dialogo Impostazioni pagina consente di " +"specificare le seguenti opzioni di stampa:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Scheda Generale" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Stampare evidenziazione sintassi" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Selezionare questa opzione per stampare l'evidenziazione di sintassi. Per " +"maggiori informazioni al riguardo, consultare ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Stampare intestazioni di pagina" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Selezionare questa opzione per includere un'intestazione in ogni pagina " +"stampata. Non è possibile configurare l'intestazione." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "Numeri di riga" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Selezionare l'opzione Stampare numeri di riga per " +"includere i numeri delle righe nella stampa di un file." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Usare il controllo di selezione Numeri ogni ... righe " +"per specificare la frequenza con cui stampare i numeri, per esempio ogni 5 " +"righe, ogni 10 righe e così via." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1168(guilabel) C/gedit.xml:1687(para) +msgid "Text Wrapping" +msgstr "A capo automatico" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Selezionare l'opzione Attivare a capo automatico per " +"mandare a capo il testo automaticamente a livello di parola durante la " +"stampa di un file. L'applicazione conteggia le righe mandate a capo come una " +"singola riga ai fini della numerazione." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Selezionare l'opzione Non dividere le parole su due righe per impostare il ritorno a capo del testo a livello di parola " +"durante la stampa di un file." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Caratteri" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Corpo del testo" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Fare clic su questo pulsante per selezionare il tipo di carattere da usare " +"per stampare il testo di un file." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Numeri di riga" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Fare clic su questo pulsante per selezionare il tipo di carattere da usare " +"per stampare i numeri di riga di un file." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Intestazioni e piè di pagina" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Fare clic su questo pulsante per selezionare il tipo di carattere da usare " +"per stampare le intestazioni e i piè di pagina di un file." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Per ripristinare i caratteri predefiniti per la stampa dei file da " +"gedit, fare clic sul pulsante " +"Ripristina caratteri predefiniti." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Stampare un documento" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"gedit consente di eseguire le seguenti operazioni " +"di stampa:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Stampare un documento su una stampante." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Inviare l'output di un comando di stampa in un file." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Quando si stampa su un file, gedit invia l'output " +"al file in un formato di prestampa. I formati di prestampa più diffusi sono " +"PostScript e PDF (Portable Document Format)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Per visualizzare un'anteprima delle pagine da stampare, scegliere " +"FileAnteprima di stampa." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Per stampare il file attivo su una stampante o su un file, scegliere " +"FileStampa per visualizzare la finestra di dialogo Stampa." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"La finestra di dialogo Stampa consente di specificare " +"le seguenti opzioni di stampa:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Scheda Lavoro" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Intervallo di stampa" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Selezionare una delle opzioni seguenti per determinare quali pagine stampare:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Tutte" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Selezionare questa opzione per stampare tutte le pagine del file." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Righe" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Selezionare questa opzione per stampare solamente le righe specificate. " +"Usare i controlli di selezione Da: e A: per specificare un intervallo di righe." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Selezione" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Selezionare questa opzione per stampare solo il testo selezionato. L'opzione " +"è abilitata solo quando è stata effettuata una selezione." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Copie" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Usare il controllo di selezione Numero di copie per " +"specificare il numero di copie da stampare." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Se si intendono stampare più copie del file, selezionare l'opzione " +"Fascicola per fascicolare le copie stampate." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Scheda Stampante" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Stampante" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Usare questo elenco a discesa per selezionare la stampante con cui stampare " +"il file." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Impostazioni" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "" +"Usare questa elenco a discesa per selezionare le impostazioni della pagina." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Per configurare la stampante, fare clic su Configura. " +"Per esempio, è possibile abilitare la stampa fronte retro o impostare una " +"stampa ritardata, sempre che queste funzionalità siano supportate dalla " +"stampante." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Posizione" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Usare questo elenco a discesa per selezionare una delle seguenti opzioni:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Stampa il file su una stampante CUPS." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Se la stampante selezionata è una stampante CUPS, CUPS " +"è l'unica voce di questo elenco a discesa." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Stampa il file su una stampante." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "File" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Stampa su un file PostScript." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Fare clic su Salva come per visualizzare la finestra " +"di dialogo in cui specificare il nome e la posizione del file PostScript." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Personalizzato" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Usa il comando specificato per stampare il file." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Digitare il nome del comando nella casella di testo. Includere anche tutti " +"gli argomenti a riga di comando." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Stato" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Questa funzionalità non è supportata da questa versione di gedit." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Tipo" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Commento" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Scheda Carta" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Dimensione carta" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Usare questo elenco a discesa per selezionare la dimensione della carta su " +"cui stampare il file." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Larghezza" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Usare questo controllo di selezione per specificare la larghezza della " +"carta. Usare l'elenco a discesa adiacente per modificare l'unità di misura " +"per la dimensione della carta." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Altezza" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "" +"Usare questo controllo di selezione per specificare l'altezza della carta." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Orientamento alimentazione" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"Usare questo elenco a discesa per selezionare l'orientamento della carta " +"nella stampante." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Orientamento pagina" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "" +"Usare questo elenco a discesa per selezionare l'orientamento della pagina." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Disposizione" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Usare questo elenco a discesa per selezionare la disposizione della pagina. " +"La disposizione prescelta viene visualizzata in anteprima nell'area " +"Anteprima." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Vassoio carta" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "" +"Usare questo elenco a discesa per selezionare l'orientamento della pagina." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Caratteristiche di programmazione" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Molte delle caratteristiche di programmazione di gedit vengono fornite attraverso plugin. Il plugin «Elenco dei tag», " +"per esempio, fornisce un elenco dei tag più usati per i maggiori linguaggi " +"di marcatura del testo: consultare ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Evidenziazione sintassi" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"L'evidenziazione della sintassi rende la lettura del codice sorgente più " +"semplice visualizzando diverse parti del testo con colori differenti." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit sceglie un'evidenziazione della sintassi " +"appropriata in base al tipo di documento. Per modificare la modalità di " +"evidenziazione, scegliere VisualizzaModalità di evidenziazione e " +"quindi scegliere una delle seguenti voci:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Nessuna" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Non visualizza alcuna evidenziazione." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Sorgenti" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Visualizza l'evidenziazione della sintassi per il codice sorgente. Usare il " +"sotto-menù Sorgenti per selezionare il tipo di " +"codice sorgente." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Markup" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Visualizza l'evidenziazione della sintassi per il codice di marcatura. Usare " +"il sotto-menù Markup per selezionare il tipo di " +"marcatura." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Script" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Visualizza l'evidenziazione della sintassi per gli script. Usare il sotto-" +"menù Script per selezionare il tipo di script." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Altri" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Visualizza l'evidenziazione di sintassi per altri tipi di codice. Usare il " +"sotto-menù Altri per selezionare il tipo." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Inviare l'output di un comando in pipe a un file" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"È possibile usare gedit per inviare con una pipe " +"l'output di un comando a un file di testo. Per esempio, per inviare in pipe " +"l'output del comando ls a un file di testo, digitare " +"ls | gedit, quindi premere Invio." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"L'output del comando ls viene visualizzato in un nuovo " +"file di testo nella finestra di gedit." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"In alternativa, è possibile usare il plugin Strumenti esterni per inviare in pipe l'output del comando al file aperto." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Scorciatoie da tastiera" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"È possibile usare le scorciatoie da tastiera per eseguire delle azioni " +"comuni più velocemente rispetto all'utilizzo del mouse o dei menù. La " +"seguente tabella elenca tutte le scorciatoie di gedit." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Per maggiori informazioni sulle scorciatoie da tastiera, consultare la " +"Guida " +"all'ambiente grafico per l'utente." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "Tabulazioni" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Scorciatoie per le tabulazioni:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1016(para) C/gedit.xml:1044(para) C/gedit.xml:1091(para) +#: C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "Scorciatoia" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) C/gedit.xml:1046(para) C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Command" +msgstr "Comando" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PagSu" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Passa alla successiva scheda sulla sinistra." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PagGiù" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Passa alla successiva scheda sulla destra." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Chiude la scheda." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Maiusc + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Salva tutte le schede." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Maiusc + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Chiude tutte le schede." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Passa all'n-esima scheda." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "File" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Scorciatoie per lavorare con i file:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Creare un nuovo file." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Apre un file." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Apre una posizione." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Salva il file aperto sul disco." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Maiusc + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Salva il file aperto con un nuovo nome." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Stampa il file corrente." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Maiusc + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Anteprima di stampa." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Chiude il file corrente." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Esce da Gedit" + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1408(guimenu) +#: C/gedit.xml:1414(guimenu) C/gedit.xml:1420(guimenu) +#: C/gedit.xml:1426(guimenu) +msgid "Edit" +msgstr "Modifica" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Scorciatoie per modificare i file:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Annulla l'ultima azione." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Maiusc + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Ripete l'ultima azione annullata." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Taglia il testo o la regione selezionata e la mette negli appunti." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Copia il testo o la regione selezionata negli appunti." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Incolla il contenuto degli appunti." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Seleziona tutto." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Elimina la riga attuale." + +#. ============= Panes ======================= +#: C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "Riquadri" + +#: C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Scorciatoie per mostrare e nascondere i riquadri:" + +#: C/gedit.xml:1023(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "Mostra/Nasconde il riquadro laterale." + +#: C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "Mostra/Nasconde il riquadro inferiore." + +#. ============= Search ======================= +#: C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "Cerca" + +#: C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "Scorciatoie per eseguire ricerche:" + +#: C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "Trova una stringa." + +#: C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "Trova l'istanza successiva della stringa." + +#: C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Maiusc + G" + +#: C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "Trova l'istanza precedente della stringa." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +# (NdT) è la ricerca incrementale... +#: C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "Ricerca incrementale." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "Cerca e sostituisce." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Maiusc + K" + +#: C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "Azzera evidenziazione." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "Va alla riga." + +#. ============= Tools ======================= +#: C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "Strumenti" + +#: C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "Scorciatoie per gli strumenti:" + +#: C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "Maiusc + F7" + +#: C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "Controllo ortografico (con plugin)." + +#: C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Rimuove gli spazi di fine riga (con plugin)." + +#: C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "Rientro (con plugin)." + +#: C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Maiusc + T" + +#: C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "Rimuove rientro (con plugin)." + +#: C/gedit.xml:1114(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Esegue \"make\" nella directory attuale (con plugin)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Maiusc + D" + +#: C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "Elenco directory (con plugin)." + +#. ============= Help ======================= +#: C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "Aiuto" + +#: C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "Scorciatoie per l'aiuto:" + +#: C/gedit.xml:1141(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "Apre il manuale utente di gedit." + +#: C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "Preferenze" + +#: C/gedit.xml:1156(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Per configurare gedit, scegliere " +"ModificaPreferenze. La finestra di dialogo Preferenze contiene le seguenti categorie:" + +#: C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "Preferenze di visualizzazione" + +#: C/gedit.xml:1170(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Selezionare l'opzione Attivare a capo automatico in " +"modo che le righe di testo più lunghe non vadano oltre il bordo della " +"finestra. In questo modo si evita lo scorrimento orizzontale." + +#: C/gedit.xml:1171(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Selezionare l'opzione Non dividere le parole su due righe in modo che l'opzione di a capo automatico preservi le parole a " +"fine riga intere. Consente una lettura più facile del testo." + +#: C/gedit.xml:1177(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Selezionare l'opzione Mostrare i numeri di riga per " +"visualizzare i numeri di riga nella parte sinistra della finestra di " +"gedit." + +#: C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "Riga corrente" + +#: C/gedit.xml:1183(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Selezionare l'opzione Evidenziare la riga corrente per " +"evidenziare la riga a cui il cursore è posizionato." + +#: C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "Margine destro" + +#: C/gedit.xml:1189(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Selezionare l'opzione Mostrare il margine destro per " +"visualizzare una riga verticale indicante il margine destro." + +#: C/gedit.xml:1190(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Usare il controllo di selezione Margine destro alla colonna per specificare la posizione della riga verticale." + +#: C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "Corrispondenza parentesi" + +#: C/gedit.xml:1196(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Selezionare l'opzione Evidenziare la parentesi corrispondente per evidenziare la parentesi corrispondente quando il cursore è " +"posizionato su una parentesi." + +#: C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "Preferenze dell'editor" + +#: C/gedit.xml:1209(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Usare il controllo di selezione Ampiezza tabulazione " +"per specificare la larghezza dello spazio che gedit deve inserire quando si preme il tasto Tab." + +#: C/gedit.xml:1210(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Selezionare l'opzione Inserire spazi invece di tabulazioni per specificare che gedit deve inserire " +"una sequenza di spazi anziché un carattere di tabulazione quando si preme il " +"tasto Tab." + +#: C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "Rientro automatico" + +#: C/gedit.xml:1216(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Selezionare l'opzione Attivare rientro automatico per " +"specificare che la riga successiva deve iniziare al livello di rientro di " +"quella attuale." + +#: C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "Salvataggio file" + +#: C/gedit.xml:1222(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Selezionare l'opzione Creare una copia di backup dei file prima di " +"salvare per creare una copia di backup di un file ogni volta che " +"viene salvato. La copia di backup del file presenta una tilde (~) alla fine " +"del nome." + +#: C/gedit.xml:1223(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Selezionare l'opzione Salvataggio automatico ogni ... minuti per impostare il salvataggio automatico del file a intervalli " +"regolari. Usare il controllo di selezione per specificare l'intervallo per " +"il salvataggio automatico del file." + +#: C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "Caratteri & colori" + +#: C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "Carattere" + +# (NdT) ma dove è? +#: C/gedit.xml:1235(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Selezionare l'opzione Usare il carattere predefinito del tema per usare il tipo di carattere predefinito del sistema nella " +"finestra di testo di gedit." + +#: C/gedit.xml:1236(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"Il campo Carattere dell'editor visualizza il tipo di " +"carattere utilizzato da gedit per la " +"visualizzazione del testo. Fare clic sul pulsante per specificare il tipo di " +"carattere, lo stile e la dimensione da usare per il testo." + +#: C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "Schema colore" + +#: C/gedit.xml:1242(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"È possibile scegliere uno schema di colori dall'elenco di quelli installati. " +"Quelli che seguono sono gli schemi di colori installati in modo predefinito:" + +#: C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "Classic" + +#: C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Schema colore classico basato su quello di gvim." + +#: C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "Cobalt" + +#: C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "Schema colore basato sul blu." + +#: C/gedit.xml:1257(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Schema colore usato nell'editor di testo Kate." + +#: C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Schema colore scuro che fa uso dei colori del progetto Tango." + +#: C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Schema colore che fa uso dei colori del progetto Tango." + +#: C/gedit.xml:1275(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"È possibile aggiungere un nuovo schema di colori facendo clic su " +"Aggiungi... e selezionando un file contenente lo schema " +"di colori" + +#: C/gedit.xml:1276(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"È possibile rimuovere lo schema colore selezionato facendo clic su " +"Rimuovi" + +#: C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "Plugin" + +#: C/gedit.xml:1284(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"I plugin aggiungono funzionalità a gedit. Per " +"maggiori informazioni sull'utilizzo dei plugin integrati, consultare ." + +#: C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "Abilitare un plugin" + +#: C/gedit.xml:1289(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Per abilitare un plugin di gedit, procedere come " +"segue:" + +#: C/gedit.xml:1292(para) C/gedit.xml:1313(para) C/gedit.xml:1637(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Scegliere ModificaPreferenze." + +#: C/gedit.xml:1295(para) C/gedit.xml:1316(para) C/gedit.xml:1640(para) +msgid "Select the Plugins tab." +msgstr "Selezionare la scheda Plugin." + +#: C/gedit.xml:1298(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"Selezionare la casella di spunta a fianco il nome del plugin da abilitare." + +#: C/gedit.xml:1301(para) C/gedit.xml:1322(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Fare clic su Chiudi per chiudere la finestra di " +"dialogo Preferenze." + +#: C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "Disabilitare un plugin" + +#: C/gedit.xml:1309(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Quando si esce da gedit, i plugin rimangono " +"abilitati." + +#: C/gedit.xml:1310(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Per disabilitare un plugin di gedit, procedere " +"come segue:" + +#: C/gedit.xml:1319(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Deselezionare la casella di spunta a fianco del nome del plugin da " +"disabilitare." + +# (NdT) ho differenziato il titolo per via dello stesso usato precedentemente +# in cui veniva indicata la scheda Plugin nelle Preferenze +#: C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "I plugin" + +#: C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "Lavorare con i plugin" + +#: C/gedit.xml:1334(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"È possibile aggiungere ulteriori caratteristiche a gedit attraverso l'uso dei plugin. Un plugin è un programma " +"ausiliario che aumenta le funzionalità di un'applicazione. I plugin " +"aggiungono nuovi oggetti ai menù di gedit in base " +"alle funzionalità che forniscono." + +#: C/gedit.xml:1336(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Diversi plugin sono integrati in gedit ed è " +"possibile installarne altri. Il sito wed di gedit elenca ulteriori plugin." + +#: C/gedit.xml:1337(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Per abilitare o disabilitare un plugin o per vedere quali plugin sono " +"attualmente abilitati, consultare la sezione Plugin." + +#: C/gedit.xml:1338(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "I seguenti plugin sono integrati in gedit:" + +#: C/gedit.xml:1344(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Cambia maiuscole/" +"minuscole consente di cambiare il testo selezionato tra " +"maiuscolo e minuscolo." + +#: C/gedit.xml:1347(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Statistiche " +"sul documento mostra il numero di righe, parole e " +"caratteri del documento." + +#: C/gedit.xml:1350(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Strumenti " +"esterni consente di eseguire comandi esterni da " +"gedit." + +#: C/gedit.xml:1353(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Pannello dell'esplorazione file consente di " +"esplorare i propri file e cartelle nel riquadro laterale." + +#: C/gedit.xml:1356(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Applica un rientro " +"alle righe aggiunge o rimuove un rientro alle righe " +"selezionate." + +#: C/gedit.xml:1359(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Inserisci date " +"e ora aggiunge al documento la data e l'ora correnti." + +#: C/gedit.xml:1362(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Modeline consente di impostare delle preferenze di modifica per alcuni " +"documenti e supporta le modeline in stile Emacs, " +"Kate e Vim." + +#: C/gedit.xml:1365(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Console python consente di eseguire comandi attraverso il linguaggio di " +"programmazione python." + +#: C/gedit.xml:1368(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Snippet consente di archiviare dei frammenti di testo usati " +"frequentemente e di inserirli all'interno di un documento." + +#: C/gedit.xml:1371(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Ordina " +"organizza alfabeticamente le righe di testo selezionate." + +#: C/gedit.xml:1374(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Correttore " +"ortografico controlla l'ortografia del testo " +"selezionato o evidenzia automaticamente gli errori nel documento." + +#: C/gedit.xml:1377(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Elenco tag consente di inserire i tag più usati per l'HTML e altri " +"linguaggi da un elenco nel riquadro laterale." + +#: C/gedit.xml:1380(para) +msgid "" +"User Name inserts the username of the current user into the document." +msgstr "" +"Nome utente inserisce il nome dell'utente nel documento." + +#: C/gedit.xml:1387(title) +msgid "Change Case Plugin" +msgstr "Plugin «Cambia maiuscole/minuscole»" + +#: C/gedit.xml:1388(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"Il plugin Cambia maiuscole/minuscole cambia tra " +"maiuscole e minuscole il testo selezionato." + +#: C/gedit.xml:1389(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"I seguenti elementi sono aggiunti al menù Modifica quando " +"il plugin Cambia maiuscole/minuscole è abilitato:" + +#: C/gedit.xml:1399(para) +msgid "Menu Item" +msgstr "Voce di menù" + +#: C/gedit.xml:1401(para) +msgid "Action" +msgstr "Azione" + +#: C/gedit.xml:1403(para) +msgid "Example" +msgstr "Esempio" + +#: C/gedit.xml:1409(guisubmenu) C/gedit.xml:1415(guisubmenu) +#: C/gedit.xml:1421(guisubmenu) C/gedit.xml:1427(guisubmenu) +msgid "Change Case" +msgstr "Modifica maiuscole/minuscole" + +#: C/gedit.xml:1409(guimenuitem) +msgid "All Upper Case" +msgstr "Tutto in maiuscolo" + +#: C/gedit.xml:1410(para) +msgid "Change each character to uppercase." +msgstr "Modifica ogni carattere in maiuscolo." + +#: C/gedit.xml:1411(para) +msgid "This text becomes THIS TEXT" +msgstr "" +"Questo testo diventa QUESTO TESTO" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Lower Case" +msgstr "Tutto in minuscolo" + +#: C/gedit.xml:1416(para) +msgid "Change each character to lowercase." +msgstr "Modifica ogni carattere in minuscolo." + +#: C/gedit.xml:1417(para) +msgid "This Text becomes this text" +msgstr "" +"Questo Testo diventa questo testo" + +#: C/gedit.xml:1421(guimenuitem) +msgid "Invert Case" +msgstr "Inverti maiuscole/minuscole" + +# (NdT) più corta :) +#: C/gedit.xml:1422(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "Modifica ogni carattere minuscolo in maiuscolo e viceversa." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" +"Questo Testo diventa qUESTO tESTO" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Title Case" +msgstr "Iniziali in maiuscolo" + +#: C/gedit.xml:1428(para) +msgid "Change the first character of each word to uppercase." +msgstr "Modifica il primo carattere di ogni parola in maiuscolo." + +#: C/gedit.xml:1429(para) +msgid "this text becomes This Text" +msgstr "" +"questo testo diventa Questo Testo" + +#: C/gedit.xml:1438(title) +msgid "Document Statistics Plugin" +msgstr "Plugin «Statistiche sul documento»" + +#: C/gedit.xml:1439(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"Il plugin Statistiche sul documento conta il " +"numero di righe, parole, caratteri, compresi ed esclusi gli spazi, e byte " +"del file attivo. I risultati vengono visualizzati nella finestra di dialogo " +"Statistiche sul documento. Per usare il plugin " +"«Statistiche sul documento», procedere come segue:" + +#: C/gedit.xml:1441(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Scegliere StrumentiStatistiche " +"sul documento per aprire la finestra di dialogo " +"Statistiche sul documento. La finestra di dialogo " +"Statistiche sul documento visualizza le seguenti " +"informazioni sul file:" + +#: C/gedit.xml:1444(para) +msgid "Number of lines in the current document." +msgstr "Numero di righe del documento." + +#: C/gedit.xml:1447(para) +msgid "Number of words in the current document." +msgstr "Numero di parole del documento." + +#: C/gedit.xml:1450(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Numero di caratteri, compresi gli spazi, del documento." + +#: C/gedit.xml:1453(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Numero di caratteri, esclusi gli spazi, del documento." + +#: C/gedit.xml:1456(para) +msgid "Number of bytes in the current document." +msgstr "Numero di byte del documento." + +#: C/gedit.xml:1461(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"È possibile continuare ad aggiornare il file di gedit anche tenendo aperta la finestra di dialogo " +"Statistiche sul documento. Per aggiornare il contenuto " +"della finestra di dialogo Statistiche sul documento, " +"fare clic su Aggiorna." + +#: C/gedit.xml:1468(title) +msgid "External Tools Plugin" +msgstr "Plugin «Strumenti esterni»" + +#: C/gedit.xml:1469(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"Il plugin Strumenti esterni consente di eseguire " +"dei comandi esterni all'interno di gedit. È " +"possibile inviare in pipe dei contenuti a un comando e sfruttarne l'output " +"(per esempio sed) o eseguire un comando " +"predefinito (come make)." + +#: C/gedit.xml:1470(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Usare Gestore strumenti esterni per creare e modificare " +"i comandi. Per eseguire un comando esterno, sceglierlo dal menù " +"Strumenti." + +#: C/gedit.xml:1473(title) +msgid "Built-in Commands" +msgstr "Comandi integrati" + +#: C/gedit.xml:1474(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"I seguenti comandi sono forniti con il plugin Strumenti " +"esterni:" + +#: C/gedit.xml:1476(term) +msgid "Build" +msgstr "Crea" + +#: C/gedit.xml:1478(para) +msgid "" +"Runs make in the current document's directory." +msgstr "Esegue make nella directory del documento." + +# (NdT) Non traducibile nell'interfaccia +#: C/gedit.xml:1481(term) +msgid "Directory Listing" +msgstr "Directory Listing" + +#: C/gedit.xml:1483(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "Elenca i contenuti della cartella del documento in un nuovo documento." + +# (NdT) Non traducibile nell'interfaccia +#: C/gedit.xml:1486(term) +msgid "Environment Variables" +msgstr "Environment Variables" + +#: C/gedit.xml:1488(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Visualizza l'elenco delle variabili d'ambiente nel riquadro inferiore." + +#: C/gedit.xml:1491(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1493(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Cerca un termine in tutti i file nella directory del documento attuale " +"usando una ricerca per corrispondenza. I risultati sono mostrati nel " +"riquadro inferiore." + +#: C/gedit.xml:1496(term) +msgid "Remove Trailing Spaces" +msgstr "Rimuovi gli spazi di fine riga" + +#: C/gedit.xml:1498(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Rimuove tutti gli spazi alla fine di ogni riga del documento." + +#: C/gedit.xml:1505(title) +msgid "Defining a Command" +msgstr "Definire un comando" + +#: C/gedit.xml:1506(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Per aggiungere un comando esterno, scegliere StrumentiStrumenti esterni...." + +#: C/gedit.xml:1507(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"Nella finestra di Gestore strumenti esterni, fare clic " +"su Nuovo. È possibile specificare i seguenti dettagli " +"per il nuovo comando:" + +#: C/gedit.xml:1509(term) +msgid "Description" +msgstr "Descrizione" + +#: C/gedit.xml:1511(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"La descrizione è mostrata nella barra di stato quando viene scelto il " +"comando." + +#: C/gedit.xml:1514(term) +msgid "Accelerator" +msgstr "Tasto scorciatoia" + +#: C/gedit.xml:1516(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Inserire una scorciatoia da tastiera per il comando." + +#: C/gedit.xml:1519(term) +msgid "Commands" +msgstr "Comando/i" + +#: C/gedit.xml:1521(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"I comandi da eseguire. È possibile utilizzare diverse variabili d'ambiente " +"di gedit per passare i contenuti a questi " +"comandi: consultare ." + +#: C/gedit.xml:1524(term) +msgid "Input" +msgstr "Input" + +#: C/gedit.xml:1526(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Il contenuto da passare ai comandi (come stdin): " +"l'intero documento, la selezione, una riga o una parola." + +#: C/gedit.xml:1529(term) +msgid "Output" +msgstr "Output" + +#: C/gedit.xml:1531(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Cosa fare con l'output dei comandi: visualizzarlo nel riquadro inferiore, in " +"un nuovo documento o posizionarlo alla fine del documento attuale, alla " +"posizione del cursore o sostituire la selezione o tutto il documento." + +#: C/gedit.xml:1534(term) +msgid "Applicability" +msgstr "Applicabilità" + +#: C/gedit.xml:1536(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Determina quali documenti sono interessati dal comando, per esempio i " +"documenti salvati oppure no, i documenti locali o quelli remoti." + +#: C/gedit.xml:1544(title) +msgid "Editing and Removing Tools" +msgstr "Modificare e rimuovere gli strumenti" + +#: C/gedit.xml:1545(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Per modificare uno strumenti, selezionarlo dall'elenco e modificare le sue " +"proprietà." + +#: C/gedit.xml:1546(para) +msgid "To rename a tool, click it again in the list." +msgstr "" +"Per rinominare uno strumento, fare nuovamente clic su di esso nell'elenco." + +#: C/gedit.xml:1547(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Per ripristinare uno strumento integrato che è stato modificato, fare clic " +"su Ripristina." + +#: C/gedit.xml:1548(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Per rimuovere uno strumento, selezionarlo dall'elenco e fare clic su " +"Rimuovi. Non è possibile rimuovere gli strumenti " +"integrati, solo quelli che vengono creati dall'utente." + +#: C/gedit.xml:1552(title) +msgid "Variables" +msgstr "Variabili" + +#: C/gedit.xml:1553(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"È possibile utilizzare le seguenti variabili nel campo Comando/i della definizione del comando:" + +#: C/gedit.xml:1556(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1559(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1581(title) +msgid "File Browser Plugin" +msgstr "Plugin «Esplorazione file»" + +#: C/gedit.xml:1582(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Il plugin Esplorazione file mostra i propri file " +"e cartelle nel riquadro laterale, consentendo un'apertura veloce dei file." + +#: C/gedit.xml:1583(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Per visualizzare il riquadro dei file, scegliere " +"VisualizzaRiquadro laterale e quindi fare clic sull'icona identificante " +"l'esplorazione dei file in basso nel riquadro." + +#: C/gedit.xml:1585(title) +msgid "Browsing your Files" +msgstr "Esplorare i propri file" + +#: C/gedit.xml:1586(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"La scheda dei file, inizialmente, mostra i segnalibri del gestore dei file. " +"Per esplorare il contenuto di un oggetto, fare doppio clic su di esso." + +#: C/gedit.xml:1587(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Per mostrare una cartella superiore, sceglierla dall'elenco a discesa o " +"premere la freccia verso l'alto nella barra degli strumenti del riquadro." + +#: C/gedit.xml:1588(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Per mostrare la cartella del documento a cui si sta lavorando, fare clic col " +"tasto destro all'interno dell'elenco e scegliere Imposta il " +"documento attivo come radice." + +#: C/gedit.xml:1592(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Per aprire un file in gedit, fare doppio clic su " +"di esso nell'elenco." + +#: C/gedit.xml:1595(title) +msgid "Creating Files and Folders" +msgstr "Creare file e cartelle" + +#: C/gedit.xml:1596(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Per creare un nuovo file nella cartella attuale mostrata nel riquadro, fare " +"clic col tasto destro del mouse nell'elenco dei file e scegliere " +"Nuovo file." + +#: C/gedit.xml:1597(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Per creare una nuova cartella nella cartella attuale mostrata nel riquadro, " +"fare clic col tasto destro del mouse nell'elenco e scegliere " +"Nuova cartella." + +#: C/gedit.xml:1602(title) +msgid "Indent Lines Plugin" +msgstr "Plugin «Applica un rientro alle righe»" + +#: C/gedit.xml:1603(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"Il plugin Applica un rientro alle righe aggiunge " +"o rimuove degli spazi all'inizio delle righe di testo." + +#: C/gedit.xml:1604(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Per applicare o rimuovere un rientro, procedere come segue:" + +#: C/gedit.xml:1606(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Selezionare le righe a cui si desidera applicare il rientro. Per applicare o " +"rimuovere un rientro su una singola riga, posizionare il cursore all'interno " +"di quella riga." + +#: C/gedit.xml:1611(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Per applicare un rientro, scegliere ModificaRientro." + +#: C/gedit.xml:1614(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Per rimuovere il rientro, scegliere ModificaElimina rientro." + +#: C/gedit.xml:1619(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"La quantità di spazio usato, o l'uso di spazi o caratteri di tabulazione, " +"dipende delle impostazione di Tabulazioni nelle " +"preferenze: consultare ." + +#: C/gedit.xml:1624(title) +msgid "Insert Date/Time Plugin" +msgstr "Plugin «Inserisci data e ora»" + +#: C/gedit.xml:1625(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Il plugin Inserisci data e ora permette di " +"inserire la data e l'ora corrente in un documento. Per usare il plugin " +"«Inserisci data e ora», procedere come segue:" + +#: C/gedit.xml:1627(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Scegliere ModificaInserisci data " +"e ora." + +#: C/gedit.xml:1628(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Se il plugin non è stato configurato per inserire automaticamente la data e " +"l'ora senza richiedere il formato all'utente, gedit visualizza la finestra di dialogo Inserisci data e " +"ora. Selezionare dall'elenco il formato appropriato per la data e " +"l'ora. Fare clic su Inserisci per chiudere la " +"finestra di dialogo Inserisci data e ora;" +"gedit inserisce la data e l'ora nella posizione " +"del cursore." + +#: C/gedit.xml:1629(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Se gedit è stato configurato per usare un " +"determinato formato per la data e l'ora, la finestra di dialogo " +"Inserisci data e ora non viene visualizzata; la data e " +"l'ora vengono inserite automaticamente nella posizione del cursore." + +#: C/gedit.xml:1634(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Configurare il plugin «Inserisci data e ora»" + +#: C/gedit.xml:1635(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Per configurare il plugin «Inserisci data e ora», procedere come segue:" + +#: C/gedit.xml:1643(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Selezionare il plugin Inserisci data e ora." + +#: C/gedit.xml:1646(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Fare clic su Configura plugin per aprire la finestra " +"di dialogo Configura plugin «Inserisci data e ora»." + +#: C/gedit.xml:1649(para) +msgid "Select one of the options, as follows:" +msgstr "Selezionare una delle seguenti opzioni:" + +#: C/gedit.xml:1651(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Per specificare il formato da utilizzare ogni volta che si inseriscono la " +"data e l'ora, selezionare l'opzione Chiedere il formato." + +#: C/gedit.xml:1654(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Per usare lo stesso formato fornito da gedit ogni " +"volta che si inseriscono la data e l'ora, selezionare l'opzione " +"Usare il formato selezionato e scegliere il formato " +"appropriato nell'elenco. Selezionando questa opzione, gedit non richiede il formato per la data e l'ora quando si sceglie " +"ModificaInserisci data e ora." + +#: C/gedit.xml:1657(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Per usare lo stesso formato personalizzato ogni volta che si inseriscono la " +"data e l'ora, selezionare l'opzione Usare un formato " +"personalizzato e inserire il formato appropriato nella casella di " +"testo. Per maggiori informazioni su come specificare un formato " +"personalizzato, consultare strftime3. Selezionando questa opzione, " +"gedit non richiede il formato per la data e l'ora " +"quando si sceglie ModificaInserisci data e ora." + +#: C/gedit.xml:1662(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Fare clic su OK per chiudere la finestra di dialogo " +"Configura plugin «Inserisci data e ora»." + +#: C/gedit.xml:1665(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Per chiudere la finestra di dialogo Preferenze, fare " +"clic su Chiudi." + +#: C/gedit.xml:1672(title) +msgid "Modelines Plugin" +msgstr "Plugin «Modeline»" + +#: C/gedit.xml:1673(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Il plugin Modeline consente di impostare delle " +"preferenze per ogni documento. Una modeline è una " +"riga di testo all'inizio o alla fine del documento con delle impostazioni " +"riconosciute da gedit." + +#: C/gedit.xml:1674(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Le preferenze impostate usando le modeline hanno la precedenza su quelle " +"specificate nella finestra di dialogo delle preferenze." + +#: C/gedit.xml:1675(para) +msgid "You can set the following preferences with modelines:" +msgstr "È possibile impostare le seguenti preferenze con le modeline:" + +#: C/gedit.xml:1678(para) +msgid "Tab width" +msgstr "Larghezza tabulazioni" + +#: C/gedit.xml:1681(para) +msgid "Indent width" +msgstr "Larghezza rientro" + +#: C/gedit.xml:1684(para) +msgid "Insert spaces instead of tabs" +msgstr "Inserire spazi al posto di tabulazioni" + +#: C/gedit.xml:1690(para) +msgid "Right margin width" +msgstr "Larghezza margine destro" + +#: C/gedit.xml:1694(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Il plugin Modeline supporta un sottoinsieme delle " +"opzioni usate da altri editor di testi come Emacs, Kate e Vim." + +#: C/gedit.xml:1697(title) +msgid "Emacs Modelines" +msgstr "Modeline Emacs" + +#: C/gedit.xml:1698(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"Le prime due righe di un documento vengono analizzate per le modeline di " +"Emacs." + +#: C/gedit.xml:1699(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Le opzioni di Emacs per la larghezza delle " +"tabulazioni, la modalità di rientro attraverso il tasto tabulatore e l'a " +"capo automatico sono supportate. Per maggiori informazioni, consultare " +"GNU Emacs Manual." + +#: C/gedit.xml:1702(title) +msgid "Kate Modelines" +msgstr "Modeline Kate" + +#: C/gedit.xml:1703(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"Le prime e le ultime dieci righe di un documento sono analizzate per le " +"modeline di Kate." + +#: C/gedit.xml:1704(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Le opzioni di Kate per la larghezza delle " +"tabulazioni, la larghezza del rientro, il rientro tramite la barra " +"spaziatrice, l'a capo automatico e l'a capo a una colonna sono supportate. " +"Per maggiori informazioni, consultare Kate website." + +#: C/gedit.xml:1707(title) +msgid "Vim Modelines" +msgstr "Modeline Vim" + +#: C/gedit.xml:1708(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"Le prime e le ultime tre righe di un documento sono analizzate per le " +"modeline di Vim." + +#: C/gedit.xml:1709(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Le opzioni di Vim per et, expandtab, ts, tabstop, " +"wrap e textwidth sono supportate. Per maggiori informazioni, consultare il " +"sito web di Vim." + +#: C/gedit.xml:1714(title) +msgid "Python Console Plugin" +msgstr "Plugin «Console python»" + +#: C/gedit.xml:1715(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Il plugin Console python consente di eseguire " +"comandi con il linguaggio di programmazione Python all'interno di " +"gedit. Abilitando il plugin, viene aggiunta una " +"scheda nel riquadro inferiore. Questa mostra l'ultimo output e un prompt dei " +"comandi." + +#: C/gedit.xml:1716(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"I comandi digitati all'interno della console python non vengono verificati " +"prima dell'esecuzione. È possibile anche bloccare gedit eseguendo un ciclo infinito." + +# (NdT) Snippet al femminile? intesa come "porzione di testo"... +#: C/gedit.xml:1720(title) +msgid "Snippets Plugin" +msgstr "Plugin «Snippet»" + +#: C/gedit.xml:1721(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"Il plugin Snippet consente di memorizzare parti " +"di testo molto usate, snippet, e di inserirle " +"velocemente in un documento." + +#: C/gedit.xml:1722(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Le snippet sono specifiche del linguaggio del documento attuale. Per " +"esempio, lavorando con un documento HTML, è possibile scegliere alcune " +"snippet utili per l'HTML. Oltre a queste, alcune snippet sono globali e " +"quindi disponibili in tutti i documenti." + +#: C/gedit.xml:1723(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Alcune snippet sono installate con gedit ed è " +"possibile modificarle." + +#: C/gedit.xml:1726(title) +msgid "Inserting Snippets" +msgstr "Inserire snippet" + +#: C/gedit.xml:1727(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Per inserire una snippet in un documento, digitare il suo tab " +"trigger e premere Tab. Un tab trigger è " +"composto solitamente dalle prime lettere della snippet o qualsiasi altra " +"cosa corta e facile da ricordare." + +#: C/gedit.xml:1728(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"In alternativa, premere CtrlSpazio per l'elenco degli snippet da poter inserire." + +#: C/gedit.xml:1732(title) +msgid "Adding Snippets" +msgstr "Aggiungere snippet" + +#: C/gedit.xml:1733(para) +msgid "To create a new snippet, do the following:" +msgstr "Per creare una nuova snippet, procedere come segue:" + +#: C/gedit.xml:1736(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Scegliere StrumentiGestione " +"snippet... per aprire la finestra " +"Gestione snippet." + +#: C/gedit.xml:1739(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"L'elenco delle snippet è raggruppato per linguaggio. Selezionare il " +"linguaggio per cui aggiungere una snippet o una snippet nel gruppo di " +"linguaggi. Per aggiungere una snippet per tutti i linguaggi scegliere " +"«Globale» in alto nell'elenco. Viene mostrata in modo predefinito la sintassi " +"del documento attuale." + +#: C/gedit.xml:1742(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Fare clic su Nuovo per creare una nuova snippet " +"nell'elenco." + +#: C/gedit.xml:1745(para) +msgid "Enter the following information for the new snippet:" +msgstr "Inserire le seguenti informazioni per la nuova snippet:" + +#: C/gedit.xml:1747(term) +msgid "Name" +msgstr "Nome" + +#: C/gedit.xml:1749(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Inserire un nome per la snippet nel campo di testo all'interno dell'elenco " +"delle snippet. Il nome serve solo come promemoria per lo scopo della " +"snippet. È possibile modificare il nome della snippet creata facendo clic su " +"di esso." + +#: C/gedit.xml:1752(term) +msgid "Snippet text" +msgstr "Testo della snippet" + +#: C/gedit.xml:1754(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Inserire il testo della snippet nella casella di testo Modifica " +"snippet. Per i codici speciali da poter usare, consultare ." + +#: C/gedit.xml:1755(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"È possibile ritornare alla finestra del documento per copiare il testo senza " +"chiudere la finestra Gestore snippet." + +#: C/gedit.xml:1758(term) +msgid "Tab Trigger" +msgstr "Tab trigger" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Inserire il tab trigger per la snippet. Questo è il testo da digitare prima " +"di premere il tasto Tab per inserire la snippet." + +#: C/gedit.xml:1761(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"L'etichetta deve essere una sola parola composta di sole lettere o qualsiasi " +"carattere singolo. Il Tab trigger si colora di rosso se " +"viene inserito un tab trigger non valido." + +#: C/gedit.xml:1764(term) +msgid "Shortcut key" +msgstr "Tasto scorciatoia" + +#: C/gedit.xml:1766(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Digitare una scorciatoia per l'inserimento della snippet." + +#: C/gedit.xml:1775(title) +msgid "Editing and Removing Snippets" +msgstr "Modificare e rimuovere snippet" + +# (NdT) semplificata un po'... +#: C/gedit.xml:1776(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Per modificare una snippet, selezionarla dall'elenco e apportare le " +"modifiche necessarie." + +#: C/gedit.xml:1777(para) +msgid "To rename a snippet, click it again in the list." +msgstr "" +"Per rinominare una snippet, fare nuovamente clic su di essa nell'elenco." + +#: C/gedit.xml:1778(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Per ripristinare una snippet integrata, modificata, fare clic su " +"Ripristina." + +#: C/gedit.xml:1779(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Per rimuovere una snippet, selezionarla dall'elenco e fare clic su " +"Rimuovi. Non è possibile rimuovere una snippet " +"integrata, solamente quelle create personalmente." + +#: C/gedit.xml:1783(title) +msgid "Snippet Substitutions" +msgstr "Sostituire snippet" + +#: C/gedit.xml:1784(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Oltre ad aggiungere del testo, una snippet può contenere del testo " +"personalizzabile o segnalare degli spazi in cui è possibile inserire del " +"testo una volta inserita la snippet nel documento." + +#: C/gedit.xml:1788(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" +"È possibile utilizzare i seguenti simboli per i segnaposti nel testo della " +"snippet:" + +#: C/gedit.xml:1790(term) +msgid "Tab placeholders" +msgstr "Segnaposti di tabulazione" + +#: C/gedit.xml:1792(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n definisce un segnaposto di " +"tabulazione, in cui n è un numero da 1 in su." + +#: C/gedit.xml:1793(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} definisce un segnaposto di tabulazione con un valore predefinito." + +#: C/gedit.xml:1794(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Un segnaposto di tabulazione indica una posizione nel testo della snippet in " +"cui è possibile aggiungere dell'altro testo una volta inserita la snippet." + +# (NdT) un po' riadattata... ma l'ultima frase in originale +# poteva essere più chiara... +#: C/gedit.xml:1795(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Per usare un segnaposto di tabulazione, inserire la snippet normalmente. Il " +"cursore è posizionato al primo segnaposto. Digitare il testo e premere " +"Tab per avanzare al segnaposto successivo. Il numero nel " +"codice del segnaposto indica l'ordine con cui il tasto tab avanza nel testo." + +#: C/gedit.xml:1796(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Premere MaiuscTab per " +"tornare al segnaposto precedente. Premendo Tab quando non " +"ci sono altri segnaposti di tabulazione, il cursore viene spostato alla fine " +"del testo della snippet o, se esiste, al segnaposto di terminazione." + +#: C/gedit.xml:1799(term) +msgid "Mirror placeholders" +msgstr "Segnaposti rispecchiati" + +#: C/gedit.xml:1801(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Un segnaposto di tabulazione ripetuto, rispecchia (ripete) il segnaposto già " +"definito. Questo consente di digitare il testo da far apparire più volte " +"nella snippet una sola volta." + +#: C/gedit.xml:1804(term) +msgid "End placeholder" +msgstr "Segnaposto di terminazione" + +# (NdT) non è molto chiara... +#: C/gedit.xml:1806(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 definisce il segnaposto di terminazione. Questo " +"consente di terminare il lavoro con la snippet con il cursore in una " +"posizione diversa da quella della terminazione della snippet." + +#: C/gedit.xml:1809(term) +msgid "Environmental variables" +msgstr "Variabili d'ambiente" + +#: C/gedit.xml:1811(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Le variabili d'ambiente come $PATH e $HOME vengono sostituite all'interno del testo della snippet. Possono " +"essere usate anche le seguenti variabili specifiche di gedit:" + +#: C/gedit.xml:1813(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1815(para) +msgid "The currently selected text." +msgstr "Il testo attualmente selezionato." + +#: C/gedit.xml:1818(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1820(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Il nome completo del file o una stringa vuota se il documento non è ancora " +"stato salvato." + +#: C/gedit.xml:1823(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1825(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"Il nome del file o una stringa vuota se il documento non è ancora stato " +"salvato." + +#: C/gedit.xml:1828(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1830(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"La parola alla posizione del cursore. Quando questa variabile è usata, la " +"parola attuale è sostituita con il testo dello snippet." + +#: C/gedit.xml:1838(term) +msgid "Shell placeholders" +msgstr "Segnaposti della shell" + +#: C/gedit.xml:1840(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) è sostituito dal " +"risultato dell'esecuzione di cmd nella shell." + +#: C/gedit.xml:1841(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) consente di impostare un riferimento a questo segnaposto, in cui " +"n è un qualsiasi numero da 1 in su. Usare " +"$n per utilizzare l'output di " +"un segnaposto della shell come input per un altro segnaposto." + +#: C/gedit.xml:1844(term) +msgid "Python placeholders" +msgstr "Segnaposti di python" + +#: C/gedit.xml:1846(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> è sostituito dal " +"risultato della valutazione di cmd " +"nell'interprete python." + +#: C/gedit.xml:1847(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" specifica un altro segnalibro python come una dipendenza, dove " +"a indica l'ordine nella snippet. Questo consente " +"di usare funzioni python definite in un'altra snippet. Per specificare molte " +"dipendenze, separare i numeri con delle virgole: $<" +"a,b:cmd>" + +#: C/gedit.xml:1848(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Per usare una variabile in tutte le altre snippet, dichiararla " +"global (globale)." + +#: C/gedit.xml:1857(title) +msgid "Sort Plugin" +msgstr "Plugin «Ordina»" + +#: C/gedit.xml:1858(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Il plugin Ordina ordina alfabeticamente le righe " +"selezionate in un file." + +#: C/gedit.xml:1859(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"L'operazione Ordina non può essere annullata, perciò è consigliabile salvare " +"il file prima di procedere. Per ripristinare la versione salvata del file " +"dopo avere eseguito l'ordinamento, scegliere FileRipristina." + +#: C/gedit.xml:1862(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Per usare il plugin Ordina, procedere come segue:" + +#: C/gedit.xml:1865(para) +msgid "Select the lines of text you want to sort." +msgstr "Selezionare le righe di testo da ordinare." + +#: C/gedit.xml:1867(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Scegliere ModificaOrdina per aprire il dialogo Ordina." + +#: C/gedit.xml:1870(para) +msgid "Choose the options you want for the sort:" +msgstr "Scegliere le opzioni per l'ordinamento:" + +#: C/gedit.xml:1873(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Per disporre il testo in ordine inverso, selezionare Ordine " +"invertito." + +#: C/gedit.xml:1876(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Per eliminare le righe doppie, selezionare Rimuovere i duplicati." + +#: C/gedit.xml:1879(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Per ignorare le differenze tra maiuscole e minuscole, selezionare l'opzione " +"Ignorare maiuscole/minuscole." + +#: C/gedit.xml:1882(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Affinché l'operazione di ordinamento ignori il primo carattere della riga, " +"impostare il numero del primo carattere da ordinare attraverso il controllo " +"di selezione Incomincia dalla colonna." + +#: C/gedit.xml:1887(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"Per iniziare l'ordinamento, fare clic su Ordina." + +#: C/gedit.xml:1894(title) +msgid "Spell Checker Plugin" +msgstr "Plugin «Correttore ortografico»" + +#: C/gedit.xml:1895(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Il plugin Correttore ortografico controlla " +"l'ortografia nel testo selezionato. È possibile configurare " +"gedit per il controllo automatico, o manuale, " +"nella lingua specificata. L'impostazione della lingua e le proprietà del " +"controllo automatico, si applicano al singolo documento. Per usare il plugin " +"«Correttore ortografico» procedere come segue:" + +#: C/gedit.xml:1897(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Scegliere StrumentiConfigura " +"lingua... per visualizzare la finestra di dialogo " +"Configura lingua. Selezionare la lingua appropriata " +"dall'elenco e fare clic su OK per chiudere la " +"finestra di dialogo Configura lingua." + +#: C/gedit.xml:1900(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Per il controllo automatico dell'ortografia, scegliere " +"StrumentiControllo ortografico " +"automatico. Per disabilitare l'opzione, scegliere " +"StrumentiControllo ortografico " +"automatico nuovamente. Quando il controllo " +"automatico è abilitato, viene mostrato un segno di spunta a fianco della " +"voce Controllo ortografico automatico. Il " +"controllo automatico è disabilitato in modo predefinito a ogni avvio di " +"gedit." + +#: C/gedit.xml:1901(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Le parole sconosciute sono mostrare in un colore diverso e sottolineate. " +"Fare clic col tasto destro del mouse su una parola sconosciuta, quindi " +"selezionare Suggerimenti ortografici dal menù a comparsa:" + +#: C/gedit.xml:1904(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Per sostituire una parola sconosciuta con un'altra presente nell'elenco, " +"selezionare la parola dal menù a comparsa Suggerimenti ortografici." + +#: C/gedit.xml:1907(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Per aggiungere la parola sconosciuta al dizionario, selezionare " +"Suggerimenti ortografici...Aggiungi." + +#: C/gedit.xml:1910(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Per ignorare tutte le occorrenze di una parola sconosciuta, in modo che non " +"vengano visualizzate come sconosciute, ma senza aggiungerle al dizionario, " +"selezionare Suggerimenti ortografici...Ignora tutto. La parola " +"sconosciuta viene ignorata solamente nella sessione attuale di " +"gedit." + +#: C/gedit.xml:1915(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Per eseguire il controllo ortografico manualmente, scegliere " +"StrumentiControllo ortografico." + +#: C/gedit.xml:1917(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Se non ci sono errori, una finestra di dialogo Informazioni visualizza un messaggio indicante l'assenza di errori. Fare clic " +"su OK per chiudere la finestra di dialogo " +"Informazioni." + +#: C/gedit.xml:1919(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"In caso di errori ortografici, viene mostrata la finestra di dialogo " +"Controllo ortografico:" + +#: C/gedit.xml:1922(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"La Parola errata è mostrata nella parte alta della " +"finestra di dialogo." + +#: C/gedit.xml:1925(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Una parola conosciuta è mostrata nella casella di testo " +"Sostituisci con. È possibile sostituire questa parola " +"con un'altra selezionandola dall'elenco Suggerimenti " +"oppure è possibile digitare del testo direttamente nella casella di testo " +"Sostituisci con." + +#: C/gedit.xml:1928(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Per controllare l'ortografia del testo nella casella di testo " +"Sostituisci con, fare clic su Controlla " +"parola. Se è una parola conosciuta, l'elenco " +"Suggerimenti è sostituito con la scritta " +"(ortografia corretta). Se la parola non è conosciuta, vengono " +"visualizzate delle nuove voci sotto Suggerimenti." + +#: C/gedit.xml:1931(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Per ignorare l'occorrenza attuale della parola sconosciuta, fare clic su " +"Ignora. Per ignorare tutte le occorrenze, fare clic " +"su Ignora tutto. La parola sconosciuta viene ignorata " +"nella sessione attuale di gedit." + +#: C/gedit.xml:1934(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Per cambiare l'occorrenza della parola sconosciuta con il testo presente " +"nella casella di testo Sostituisci con, fare clic su " +"Modifica. Per cambiare tutte le occorrenze della " +"parola sconosciuta, fare clic su Modifica tutto." + +#: C/gedit.xml:1937(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Per aggiungere la parola sconosciuta al proprio dizionario, fare clic su " +"Aggiungi parola." + +#: C/gedit.xml:1940(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Per chiudere la finestra di dialogo Controllo ortografico, fare clic su Chiudi." + +#: C/gedit.xml:1949(title) +msgid "Tag List Plugin" +msgstr "Plugin «Elenco tag»" + +#: C/gedit.xml:1950(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Il plugin Elenco tag consente di inserire, da un " +"elenco nel riquadro laterale, dei tag comuni." + +#: C/gedit.xml:1951(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Per usare il plugin «Elenco tag», procedere come segue:" + +#: C/gedit.xml:1953(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Scegliere VisualizzaRiquadro " +"laterale." + +#: C/gedit.xml:1957(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"In modo predefinito, il riquadro laterale mostra una scheda contenente un " +"elenco di documenti aperti. Per visualizzare la scheda dell'elenco dei tag, " +"fare clic sulla scheda indicante il segno più («+») in basso nel riquadro " +"laterale." + +#: C/gedit.xml:1959(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Selezionare la categoria di tag appropriata dall'elenco a discesa; per " +"esempio HTML - Tag." + +#: C/gedit.xml:1962(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Se necessario, scorrere l'elenco per cercare il tag richiesto." + +#: C/gedit.xml:1965(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Per inserire un tag nella posizione del cursore nel file corrente, fare " +"doppio clic sul tag nell'elenco. È anche possibile procedere come segue:" + +#: C/gedit.xml:1967(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Per inserire un tag nel file corrente e spostare il focus dal riquadro " +"laterale all'area di visualizzazione, premere Invio." + +#: C/gedit.xml:1970(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Per inserire un tag nel file corrente e mantenere il punto attivo nella " +"finestra Plugin Elenco tag, premere " +"MaiuscInvio." + +#: C/gedit.xml:1979(title) +msgid "User Name Plugin" +msgstr "Plugin «Nome utente»" + +#: C/gedit.xml:1980(para) +msgid "" +"The User name plugin inserts the username of the " +"current user into the document." +msgstr "" +"Il plugin Nome utente inserisce il nome " +"dell'utente corrente nel file." + +#: C/gedit.xml:1981(para) +msgid "" +"To insert your username at the cursor position, choose " +"EditInsert User Name." +msgstr "" +"Per inserire il proprio nome alla posizione del cursore, scegliere " +"ModificaInserisci il nome " +"utente." + +#: C/gedit.xml:1983(para) +msgid "" +"This plugin is mostly provided as an example of how to create your own " +"plugins. For more information on creating plugins, see the gedit website." +msgstr "" +"Questo plugin è solo un esempio per aiutare nella creazione di altri plugin. " +"Per maggiori informazioni sulla creazione di plugin, consultare il sito web di " +"gedit." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Milo Casagrande " + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "fatto" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "fatto" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "fatto" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "fatto" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "Per maggiori informazioni sulla configurazione dell'evidenziazione della " +#~ "sintassi, consultare ." + +#~ msgid "Colors" +#~ msgstr "Colori" + +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Selezionare l'opzione Usare i colori predefiniti del tema per usare i colori del tema predefinito nella finestra di testo " +#~ "di gedit." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Fare clic sul pulsante Colore normale del testo " +#~ "per visualizzare la finestra di dialogo per la selezione dei colori. " +#~ "Scegliere un colore per il testo da visualizzare nella finestra di testo " +#~ "di gedit." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Fare clic sul pulsante Colore di sfondo per " +#~ "visualizzare la finestra di dialogo per la selezione dei colori. " +#~ "Selezionare un colore di sfondo per la finestra di testo di " +#~ "gedit." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Fare clic sul pulsante Colore del testo selezionato per visualizzare la finestra di dialogo per la selezione dei " +#~ "colori. Selezionare un colore da usare per visualizzare il testo " +#~ "selezionato." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Fare clic sul pulsante Colore della selezione per " +#~ "visualizzare la finestra di dialogo per la selezione dei colori. " +#~ "Selezionare un colore di sfondo da usare per evidenziare una selezione di " +#~ "testo." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Evidenziazione della sintassi" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "Attivare evidenziazione sintassi" + +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "" +#~ "Selezionare questa opzione per abilitare l'evidenziazione della sintassi " +#~ "del file da modificare." + +#~ msgid "Highlight mode" +#~ msgstr "Modalità di evidenziazione" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Usare questo elenco a discesa per selezionare la modalità di " +#~ "evidenziazione da configurare." + +#~ msgid "Elements" +#~ msgstr "Elementi" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "" +#~ "Usare questo elenco per selezionare un elemento della sintassi da " +#~ "configurare." + +#~ msgid "Format buttons" +#~ msgstr "Pulsanti di formattazione" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Usare i seguenti pulsanti di formattazione per modificare il formato " +#~ "dell'elemento della sintassi selezionato:" + +#~ msgid "Button" +#~ msgstr "Pulsante" + +#~ msgid "Format" +#~ msgstr "Formato" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Mostra l'icona per il testo grassetto." + +#~ msgid "Bold" +#~ msgstr "Grassetto" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Mostra l'icona per il testo corsivo." + +#~ msgid "Italic" +#~ msgstr "Corsivo" + +#~ msgid "Shows icon for underline." +#~ msgstr "Mostra l'icona per il testo sottolineato." + +#~ msgid "Underline" +#~ msgstr "Sottolineato" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Mostra l'icona per il testo barrato." + +#~ msgid "Strikethrough" +#~ msgstr "Barrato" + +#~ msgid "Foreground" +#~ msgstr "Primo piano" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Selezionare questa opzione per modificare il colore del carattere " +#~ "dell'elemento selezionato. Fare clic sul pulsante per visualizzare la " +#~ "finestra di dialogo per la selezione dei colori e selezionare un colore " +#~ "per il carattere. " + +#~ msgid "Background" +#~ msgstr "Sfondo" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Selezionare questa opzione per modificare il colore di sfondo " +#~ "dell'elemento selezionato. Fare clic sul pulsante per visualizzare la " +#~ "finestra di dialogo per la selezione dei colori e selezionare un colore " +#~ "per sfondo." + +#~ msgid "Reset to Default" +#~ msgstr "Ripristina predefinito" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Fare clic su questo pulsante per ripristinare i valori predefiniti del " +#~ "colore di primo piano e di sfondo dell'elemento della sintassi " +#~ "selezionato." diff --git a/help/ja/figures/gedit_window.png b/help/ja/figures/gedit_window.png new file mode 100755 index 00000000..62fb6e52 Binary files /dev/null and b/help/ja/figures/gedit_window.png differ diff --git a/help/ja/ja.po b/help/ja/ja.po new file mode 100755 index 00000000..c99c458c --- /dev/null +++ b/help/ja/ja.po @@ -0,0 +1,4472 @@ +# gedit/help ja.po. +# +# Mitsuya Shibata , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit help 2.24\n" +"POT-Creation-Date: 2008-05-12 19:08+0000\n" +"PO-Revision-Date: 2008-10-13 08:08+0900\n" +"Last-Translator: Mitsuya Shibata \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"GNU Free Documentation License (GFDL) の管理下でこのドキュメントをコピー、配" +"布、または変更することを許可します。Free Software Foundation から発行された" +"バージョン 1.1 以降のドキュメントには、 セクションや表紙などがありません。" +"GFDL のコピーは、URL またはこ" +"のマニュアルと一緒に配布された COPYING-DOCS を参照してください。" + +#: 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 "" +"このマニュアルは、GFDL から配布された MATE マニュアルの一部です。個々の" +"マニュアルを別々に提供したい場合は、 ライセンスのセクション 6 で説明し" +"ているように、マニュアルにライセンスを追加してください。" + +#: 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 "" +"他の企業の製品やサービスと区別するために使用する名前を登録商標と呼びます。" +"MATE ドキュメンテーション プロジェクトで登録商標を表示する場合は、すべて大文字か" +"最初の1文字だけ大文字で記載しています。" + +#: 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 " +"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/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: " +"" +msgstr "" +"ドキュメントおよび変更されているドキュメントは、下記の GNU FREE " +"DOCUMENTATION ライセンスのもとにおいて頒布されます。 " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#. 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/gedit.xml:1289(None) +msgid "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" +msgstr "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" + +#. 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/gedit.xml:1308(None) +msgid "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" +msgstr "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" + +#. 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/gedit.xml:1326(None) +msgid "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" +msgstr "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#. 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/gedit.xml:1344(None) +msgid "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" +msgstr "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "gedit マニュアル" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "MATE ドキュメンテーション プロジェクト" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "ショートカットキーテーブルの追加" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java デスクトップシステム ドキュメンテーションチーム" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "" +"Cicek 氏より、旧リビジョンの gedit アプリケーションについて情報を提供していた" +"だきました。" + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "謝辞" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George 氏よりプラグインについて情報を提供していただきました。" + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit マニュアル V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "2002 年 3 月" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE ドキュメンテーションチーム" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit マニュアル V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "2002 年 6 月" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit マニュアル V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "2002 年 8 月" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit マニュアル V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "2002 年 9 月" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit マニュアル V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "2003 年 1 月" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit マニュアル V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "2003 年 3 月" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "gedit マニュアル V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "2003 年 9 月" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "gedit マニュアル V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "2004 年 3 月" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "gedit マニュアル V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "2006 年 6 月" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "gedit マニュアル V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "MATE ドキュメンテーションチーム" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "このマニュアルは gedit のバージョン 2.16 について説明します。" + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "フィードバック" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"geditアプリケーションまたはこのマニュアルに関してバグやご意見をご報告いただく" +"場合は、「MATE フィード" +"バックページ」を参照してください。" + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit は印刷やスペル・チェック、検索、強調表示といった基本的な機能を兼ね備えた、" +" MATE デスクトップのテキスト・エディタです。さらに、プラグインを導入することで" +"より強力な機能を利用することもできます。" + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "text editor" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "概要" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"gedit はテキストファイルを作成・編集するための" +"アプリケーションです。" + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"gedit はより単純に、より簡単に使えるように作られて" +"います。テキスト編集に関する複雑な作業については、強力なプラグイン" +"を導入することで、補うことができます。" + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "基本的な使用方法" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "gedit を起動する" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "以下の方法で gedit を起動してください。" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "アプリケーションメニュー" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"アクセサリテキスト・" +"エディタを選択します。" + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "コマンドライン" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "次のコマンドを実行します: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"初期設定のままファイル・マネージャからテキストドキュメントを開いた場合、" +"gedit が起動し、テキストの内容を表示するでしょう。" + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "gedit ウィンドウ" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"gedit を起動すると、次のウィンドウが表示されます。" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "gedit ウィンドウ" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "gedit のメインウィンドウを表示。" + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"gedit ウィンドウの構成要素は次のとおりです。" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "メニューバー" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"メニューバー上のメニューには、gedit でファイルを操" +"作するために必要なコマンドがすべて含まれています。" + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "ツールバー" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"ツールバーには、メニューバーからアクセスできるコマンドの一部の機能が含まれて" +"います。" + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "表示領域" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "表示領域には、編集中のファイルのテキストが表示されます。" + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "ステータスバー" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"ステータスバーには、gedit で実行中の操作に関する情" +"報や、選択中のメニュー項目に関する説明が表示されます。また、以下の情報も" +"表示されます。" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "カーソルの位置:現在カーソルがある、行番号および列番号を表示します。" + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"編集モード:エディタが挿入モードになっている場合は、ステータス" +"バーに挿入と表示されます。上書きモードになっている場合は、" +"ステータスバーに上書きと表示されます。編集モードを切り替える" +"には、Insertキーを押してください。" + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "サイド・ペイン" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"サイド・ペインには現在開いているドキュメントや、プラグインによるさまざまな" +"情報が表示されます。" + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"初期設定ではサイド・ペインは表示されていません。これを表示するためには、" +"表示サイド・ペインを選択してください。" + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "ボトム・ペイン" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"ボトム・ペインは Python コンソールプラグインのような" +"プログラミングツールの出力を表示するために使われます。" + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"初期設定ではボトム・ペインは表示されていません。これを表示するためには、" +"表示ボトム・ペインを選択してください。" + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"gedit ウィンドウ内で右クリックすると、ポップアップ" +"メニューが表示されます。 ポップアップメニューからは、使用頻度の高いテキスト編集" +"コマンドを実行できます。" + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"他の MATE アプリケーションと同様に、 gedit の" +"コマンドは、メニューやツールバー、ショートカットキーなどさまざまな方法で" +"実行できます。すべてのアプリケーションで共通なショートカットキーの一覧は、" +"ユーザーガイドに掲載されています。" + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "コマンドラインから gedit を起動する" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"コマンドラインから gedit を起動し、単一のファイ" +"ル、または複数のファイルを開くことができます。コマンドラインから複数のファイ" +"ルを開くには、次のコマンドを入力して Enter キーを押してください。" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "ファイル名の代わりに、URI を指定することもできます。" + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"コマンドラインから gedit を実行する方法について" +"は、gedit1 を参照してください。" + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "ファイルの操作" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "新しいファイルを作成する" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"新しいファイルを作成するには、ファイル新規を選択します。" +" gedit ウィンドウに新規の何も書かれていないファイルが" +"表示されます。" + +#: C/gedit.xml:346(title) C/gedit.xml:1690(title) +msgid "Opening a File" +msgstr "ファイルを開く" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"ファイルを開くには、ファイル" +"開くを選択してファイルを開くダイアログを表示させます。開きたいファイルを選択して、" +"開くをクリックします。選択したファイルが gedit ウィンドウに表示されます。" + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "最近開いたファイルを表示するには。" + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"最後に編集したファイルのパスとファイル名は 5 つまで記憶され、" +"ファイルメニューの項目として" +"表示されます。ツールバーの アイコンをクリックすることで、" +"最近編集したファイルを表示することもできます。" + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"gedit では複数のファイルを開くこともできます。" +"その場合、一つのウィンドウ内に複数のタブにわかれて、それぞれのファイルが" +"表示されます。より詳しいことは、を参照してください。" + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "ファイルを保存する" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "ファイルの保存方法は次のとおりです。" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"既存のファイルに対する変更点を、同じファイルに保存するには、" +"ファイル保存を選択してください。" + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"新しいファイルに保存する場合、または既存のファイルを新しい名前で保存する場合" +"は、ファイル別名で保存" +"を選択します。別名で保存ダイアログにファイル名を" +"入力し、保存をクリックします。" + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"gedit で現在開いている全てのファイルを保存するには、" +"ドキュメント全て保存" +"を選択します。" + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"gedit で現在開いている全てのファイルを閉じるには、" +"ドキュメント全て閉じる" +"を選択します。" + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "URI からファイルを開く" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"URI (Uniform Resource Identifier) からファイルを開くには、以下の操作" +"を行います。" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"ファイル場所を開くを選択し、場所を開く " +"ダイアログを表示します。" + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "開きたいファイルの URI を入力します。" + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"文字のエンコーディングから、開きたいファイルの文字コード" +"を選択します。" + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "開くをクリックします。" + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"有効な URIhttp:ftp:file:、および" +" mate-vfs でサポートしている全ての形式です。" + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"URI の形式によっては、ファイルを読み込み専用として開きます。その場合、変更点を" +"保存する際には、別の場所を指定してください。例えば HTTP はファイルの読み込みのみ" +"可能です。全ての FTP サーバがリモートファイルの保存をサポートしているわけでは" +"ないので、FTP からファイルを開いた場合も、読み込み専用となります。" + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"設定エディタを利用すれば" +"FTP サーバへの保存も利用可能になります。/apps/gedit-2/preferences/" +"editor/save/writable_vfs_schemes キーを変更してください。" +"ただしこれはエラーの原因にもなります。" + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "タブを利用する" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"複数のファイルを開いた場合、gedit は" +"表示領域の上にドキュメントごとのタブを表示します。" +"別のドキュメントを表示するには、このタブをクリックしてください。" + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"あるドキュメントを別の gedit ウィンドウに移動したい" +"場合は、そのドキュメントが表示されているタブを、移動したいウィンドウまで" +"ドラッグしてください。" + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"あるドキュメントを新しい gedit ウィンドウで開きたい" +"場合は、そのタブをデスクトップ上の何もないところへ移動するか、" +"ドキュメント新しいウィンドウへ移動" +"を選択してください。" + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "テキストの操作" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "テキストを編集する" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "ファイルのテキストを編集する方法は次のとおりです。" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"キーボードから新しいテキストを入力します。点滅している入力カーソルは、新しいテキストが書き込まれる場所を示しています。場所を変更する" +"には、キーボード上の矢印キーで移動するか、マウスを使って入力したい場所をクリック" +"してください。" + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"選択したテキストをクリップボードにコピーするには、" +"編集コピーを選択してください。" + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"選択したテキストをファイルから削除するか、クリップボードに移動するには、" +"編集切り取り" +"を選択してください。" + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"選択したテキストをファイルから完全に削除するには、編" +"集削除を選択してください。" + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"現在のカーソルの位置にクリップボードの内容を挿入するには、" +"編集貼り付けを選択してください。実際にテキストを貼り付けるには、事前に gedit" +" もしくは他のアプリケーション上で、コピーもしくは切り取りを行っておく" +"必要があります。" + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"ファイル内のすべてのテキストを選択するには、編集全て選択を選択してください。" + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "元に戻すもしくはやり直す" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"加えた変更点を元に戻したい場合は、編集元に戻すを選択してください。" +"逆に元に戻した操作をやり直したい場合は、編集<" +"guimenuitem>やり直すを選択してください。" + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "文字列の検索・置換" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"gedit には文字列を検索するための二つの方法が" +"存在します。特定の文字列を検索したい場合は検索ダイアログを、" +"入力にあわせて即座に検索したい場合はインクリメンタル検索" +"を利用できます。" + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "文字列を検索する" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "ファイル内の特定の文字列を検索するには、次のようにします。" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"検索検索を選択して、検索ダイアログを表示します。" + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"検索する文字列フィールドに、検索したい文字列を入力します。" +"改行やタブなど特別な文字も入力できます。詳しいことは" +"を参照してください。" + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"検索をクリックすると、現在のカーソルの位置より後ろにある、" +"入力した文字列と一致する最初の文字列が検索されます。gedit " +"が文字列を発見した場合、最初の文字列を選択状態にします。他の場所で一致した文字列については" +"強調表示されます。" + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"次の一致文字列を発見するには、検索をクリックするか、" +"検索次を検索" +"を選択します。一つ前の一致文字列を発見するには、検索前を検索を選択します。" + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"検索ダイアログを閉じたあとでも、" +"検索次を検索や" +"検索前を検索" +"を選択することで、一致した文字列間を移動できます。" + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"テキストの強調表示を解除するには、検索" +"強調表示のクリアを選択してください。" + + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "インクリメンタル検索" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"インクリメンタル検索は、キーボードからの文字の入力にあわせてリアルタイムに" +"検索する機能です(いくつかのウェブブラウザに搭載されている検索機能に似ています)。" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"インクリメンタル検索を開始するには検索インクリメンタル検索" +"を選択してください。すると、表示領域の上に検索ボックスが表示されます。" + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"次に検索したい文字列を入力してください。入力した文字列にあわせて、ドキュメント上で" +"一致した文字列が強調表示され、カーソルの場所から一番最初に一致された文字列が選択" +"状態になります。" + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"インクリメンタル検索ボックスを開いたまま、次の一致文字列に移動したい場合は、" +"CtrlGを押してください。" +"CtrlShiftGを押すと、一つ前の一致文字列に移動します。" + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"矢印キーやマウスホイールを使っても、一致文字列間を移動できます。" + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "文字列を置換する" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"ファイル内の特定の文字列を検索し、別の文字列に置換するには、次のようにします。" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"検索置換を選択して置換 ダイアログを表示します。" + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"検索する文字列フィールドに、検索したい文字列を入力します。" +"改行やタブなど特別な文字も入力できます。詳しいことは" +"を参照してください。" + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"置換後の文字列フィールドに、検索した文字列の代わりに表示したい" +"文字列を入力します。" + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"一致した文字列ごとに置換するかどうかを確認したい場合は、" +"検索をクリックしてください。gedit " +"が文字列を発見した場合、その文字列が選択状態になります。置換" +"をクリックすれば、選択した文字列が置換されます。次の一致文字列に移動するには、" +"再び検索をクリックしてください。" + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"ドキュメントにある全ての一致文字列を置換するには、全て置換をクリックしてください。" + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "検索・置換オプション" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"検索ダイアログと置換ダイアログ" +"では、以下のオプションを指定できます。" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"大/小文字を区別するオプションを選択すると、入力した" +"アルファベット文字列の大小が一致した文字列のみを表示します。例えば" +"大/小文字を区別するが選択されている状態では、" +"\"TEXT\" を検索しても \"text\" に一致しません。" + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"単語全体にマッチさせるオプションを選択すると、単語の" +"一部のみ一致した文字列は無視します。例えば単語全体にマッチさせる" +"が選択されている状態では、\"text\" を検索しても \"texture\" に一致しません。" + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"前方へ検索するオプションを選択すると、現在のカーソル一に対して" +"ドキュメントの前の方へ検索を行います。" + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"折り返しも対象にするオプションを選択すると、ファイルの最後" +"まで検索を行った後、再びファイルの最初から検索を行います。" + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "特殊文字" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"エスケープ文字を使うことで、検索・置換の際に以下のような特殊文字を" +"使うことができます。" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "改行を意味します。" + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "タブ文字を意味します。" + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "復帰 (CR: Carriage Return) を意味します。" + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"バックスラッシュ文字を検索したい場合は、それ自身をエスケープする必要があります。" +"たとえば \"\\n\" という文字列を検索したい場合は、" +"検索する文字列フィールドに \"\\\\n\" と入力してください。" +"もしバックスラッシュからなる文字列を検索したい場合は、倍の数のバックスラッシュを" +"入力する必要があります。" + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "カーソルを指定行へ移動する" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"現在開いているファイルの指定行へカーソルを移動するには、" +"検索指定行へジャンプを選択してください。表示領域の上に行番号ボックスが表示されます。" + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"移動したい行番号の入力を開始すると、その数字に合わせてドキュメントが自動的に" +"スクロールします。" + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"ボックスを消してカーソルの移動を確定したい場合は、" +"Enterキーを押してください。" + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "印刷" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "ページオプションを設定する" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"ページオプションを設定するには、ファイルページ設定を選択し、" +"ページの設定ダイアログを開きます。" + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"ページの設定ダイアログでは、以下のオプションを" +"指定できます。" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "全般タブ" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "構文の強調表示" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"このオプションを選択した場合、構文の強調表示も印刷に反映されます。構文の強調表示" +"機能については、を参照してください。" + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "ページのヘッダ" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"このオプションを選択した場合、ページごとにヘッダが印刷されます。ヘッダの内容を" +"設定することはできません。" + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1178(guilabel) +msgid "Line Numbers" +msgstr "行番号" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"行番号を印刷するオプションを選択した場合、ファイルの" +"行番号も併せて印刷されます。" + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"行番号を付与する間隔では、行番号の印刷頻度、例えば 5 行ごと" +"や 10 行ごとなどを指定できます。" + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1171(guilabel) C/gedit.xml:1786(para) +msgid "Text Wrapping" +msgstr "テキストの折り返し" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"テキストの折り返しを有効にするオプションを選択した場合、" +"印刷する際に、必要に応じて文字単位で文字列の改行を行います。行番号を印刷する場合は、" +"改行の前後を含めて 1 行として扱います。" + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"単語を二行以上に分割しないオプションを選択すると、" +"印刷時に単語単位で折り返しを行います。" + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "フォント" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "本文" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"このボタンをクリックして、ドキュメント本文の印刷に使用するフォントを選" +"択します。" + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "行番号" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "このボタンをクリックして、行番号の印刷に使用するフォントを選択します。" + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "ヘッダとフッタ" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"このボタンをクリックして、ファイルのヘッダとフッタの印刷に使用するフォントを選択し" +"ます。" + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"gedit からファイルを印刷するときに使用するフォント" +"を初期設定に戻したい場合は、デフォルトに戻す" +"をクリックしてください。" + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "ドキュメントを印刷する" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"gedit を使って、次の印刷操作を実行できます。" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "ドキュメントをプリンタで印刷する。" + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "印刷コマンドの実行結果をファイルに出力する。" + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"ファイルに出力する場合、gedit は印刷用のフォーマット" +"をファイルに送信します。最も一般的なフォーマットは、PostScript と PDF (Portable " +"Document Format) です。" + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"出力するページをプレビューするには、ファイル印刷プレビューを選択してください。" + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"現在のファイルをプリンタまたはファイルに出力するには、" +"ファイル印刷を選択" +"して、印刷ダイアログを表示します。" + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"印刷ダイアログでは、次の印刷オプションを指定できます。" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "ジョブタブ" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "印刷するページ" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"次のいずれかのオプションを選択して、出力するページ数を指定します。" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "全て" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "ファイルの全ページを出力します。" + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "範囲" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"指定した行のみを出力します。FromTo " +"にて、出力する行範囲を指定します。" + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "選択" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"選択したテキストだけを出力します。 このオプションは、テキストを選択している場" +"合にのみ有効です。" + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "コピー" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "コピーの数を使って、出力部数を指定します。" + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"ファイルを複数の部数出力する場合に、ページを揃える" +"オプションを選択すると、各部ごとにページ順に並んだ結果が出力されます。" + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "プリンタタブ" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "プリンタ" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"ドロップダウンリストからファイルを出力するプリンタを選択します。" + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "設定" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "ドロップダウンリストからプリンタの設定を選択します。" + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"プリンタの設定を行うには、設定するをクリックしてください。" +"プリンタがその機能をサポートしていれば、両面印刷、印刷スケジュールなどを設定できます。" + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "場所" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"ドロップダウンリストから印刷データの送り先を選択します。" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "CUPSプリンタに出力します。" + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"選択したプリンタがCUPSプリンタの場合、このドロップダウンリストには" +"CUPSのみが表示されます。" + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "プリンタに出力します。" + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "ファイル" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "PostScript ファイルに出力します。" + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"別名で保存をクリックし、表示されるダイアログに" +" PostScript ファイルの名前と場所を指定します。" + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "カスタム" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "印刷コマンドを直接記述します。" + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"テキストボックスに、引数も含めたコマンドを入力してください。" + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "状態" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "現在のバージョンではサポートされていません。" + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "タイプ" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "コメント" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "用紙タブ" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "用紙サイズ" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "ドロップダウンリストから印刷用紙のサイズを選択します。" + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "幅" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"用紙の幅を指定します。用紙サイズの単位を変更するには、隣のドロップダウンリス" +"トを使用します。" + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "高さ" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "用紙の高さを指定します。" + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "フィード方向" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "ドロップダウンリストからプリンタ内の用紙の向きを選択します。" + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "ページの向き" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "ドロップダウンリストからページの向きを選択します。" + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "レイアウト" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"ドロップダウンリストからページレイアウトを選択します。プレ" +"ビュー領域には、選択した各レイアウトのプレビューが表示されます。" + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "用紙トレイ" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "ドロップダウンリストから用紙のトレイを選択します。" + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "プログラミング機能" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"gedit プラグインによって、さまざまなプログラミング向け機能" +"が提供されています。例えば、タグの一覧プラグインを使えば、マークアップ言語ごとに、" +"よく使われるタグの一覧を表示してくれます。詳しいことは、を参照してください。" + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "構文の強調表示" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"構文の強調表示を使うと、ソースコードがその構文にしたがって色分けされ、より" +"読みやすくなります。" + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit は、そのドキュメントの種類から適切な" +"文法を選択します。構文の強調表示モードで利用する文法を選択しなおすには、" +"表示強調表示モードを選択し、以下の項目から適切なものを選んでください。" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "なし" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "強調表示を行いません。" + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "ソース" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"ソースコード向け強調表示を行います。ソース" +"サブメニューから、ソースコードの種類を選択してください。" + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "マークアップ" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"マークアップ言語向け強調表示を行います。マークアップ" +"サブメニューから、マークアップ言語の種類を選択してください。" + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "スクリプト" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"スクリプト言語向け強調表示を行います。スクリプト" +"サブメニューから、スクリプト言語の種類を選択してください。" + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "その他" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"その他のファイル向け強調表示を行います。その他" +"サブメニューから、ファイルの種類を選択してください。" + +#: C/gedit.xml:841(para) +msgid "" +"For more information about how to configure syntax highlighting, see ." +msgstr "" +"構文の強調表示機能の設定方法については、 を参照してください。" + +#: C/gedit.xml:847(title) +msgid "Piping the Output of a Command to a File" +msgstr "コマンドの出力をファイルにパイプする" + +#: C/gedit.xml:848(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"gedit を使って、コマンド出力をテキストファイルに" +"直接渡す(パイプする)ことができます。 例えば、ls コマンドの" +"出力をテキストファイルに渡すには、ls | gedit と入力して、" +"Enter キーを押します。" + +#: C/gedit.xml:849(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"ls コマンドの結果が新しいテキストファイルに出力され、" +"gedit ウィンドウに表示されます。" + +#: C/gedit.xml:850(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"別の方法として、外部ツールプラグインを使えば、" +"コマンドの出力結果を現在開いているファイルに渡すことができます。" + +#: C/gedit.xml:856(title) +msgid "Shortcut Keys" +msgstr "ショートカットキー" + +#: C/gedit.xml:857(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"ショートカットキーを使えば、よく使う作業をマウスやメニューを使うよりも" +"素早く実行できます。以下の表は、gedit で" +"利用できるすべてのショートカットキーの一覧です。" + +#: C/gedit.xml:858(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"ショートカットキーについての詳しいことは、デスクトップユーザーガイドを参照してください。" + +#. ============= Tabs ======================== +#: C/gedit.xml:861(bridgehead) C/gedit.xml:1209(guilabel) +msgid "Tabs" +msgstr "タブ" + +#: C/gedit.xml:862(para) +msgid "Shortcuts for tabs:" +msgstr "タブ用のショートカット" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) C/gedit.xml:1046(para) C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Shortcut Key" +msgstr "ショートカットキー" + +#: C/gedit.xml:872(para) C/gedit.xml:916(para) C/gedit.xml:972(para) +#: C/gedit.xml:1020(para) C/gedit.xml:1048(para) C/gedit.xml:1095(para) +#: C/gedit.xml:1138(para) +msgid "Command" +msgstr "コマンド" + +#: C/gedit.xml:877(para) C/gedit.xml:881(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:878(para) +msgid "Switches to the next tab to the left." +msgstr "左のタブに移動します。" + +#: C/gedit.xml:882(para) +msgid "Switches to the next tab to the right." +msgstr "右のタブに移動します。" + +#: C/gedit.xml:885(para) C/gedit.xml:949(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:886(para) +msgid "Close tab." +msgstr "タブを閉じます。" + +#: C/gedit.xml:889(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:890(para) +msgid "Save all tabs." +msgstr "全てのタブを保存します。" + +#: C/gedit.xml:893(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:894(para) +msgid "Close all tabs." +msgstr "全てのタブを閉じます。" + +#: C/gedit.xml:897(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:898(para) +msgid "Jump to nth tab." +msgstr "n 番目のタブに移動します。" + +#. ============= Files ======================== +#: C/gedit.xml:905(bridgehead) +msgid "Files" +msgstr "ファイル" + +#: C/gedit.xml:906(para) +msgid "Shortcuts for working with files:" +msgstr "ファイル用のショートカット" + +#: C/gedit.xml:921(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:922(para) +msgid "Create a new document." +msgstr "新しいドキュメントを作成します。" + +#: C/gedit.xml:925(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:926(para) +msgid "Open a document." +msgstr "ドキュメントを開きます。" + +#: C/gedit.xml:929(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:930(para) +msgid "Open a location." +msgstr "指定した場所にあるファイルを開きます。" + +#: C/gedit.xml:933(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:934(para) +msgid "Save the current document to disk." +msgstr "現在のドキュメントをファイルに保存します。" + +#: C/gedit.xml:937(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:938(para) +msgid "Save the current document with a new filename." +msgstr "現在のドキュメントを新しいファイル名で保存します。" + +#: C/gedit.xml:941(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:942(para) +msgid "Print the current document." +msgstr "現在のドキュメントを印刷します。" + +#: C/gedit.xml:945(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:946(para) +msgid "Print preview." +msgstr "印刷プレビューを表示します。" + +#: C/gedit.xml:950(para) +msgid "Close the current document." +msgstr "現在のドキュメントを閉じます。" + +#: C/gedit.xml:953(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:954(para) +msgid "Quit Gedit." +msgstr "gedit を終了します。" + +#. ============= Edit ======================= +#: C/gedit.xml:961(bridgehead) C/gedit.xml:1507(guimenu) +#: C/gedit.xml:1513(guimenu) C/gedit.xml:1519(guimenu) +#: C/gedit.xml:1525(guimenu) +msgid "Edit" +msgstr "編集" + +#: C/gedit.xml:962(para) +msgid "Shortcuts for editing documents:" +msgstr "編集用のショートカット" + +#: C/gedit.xml:977(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:978(para) +msgid "Undo the last action." +msgstr "最後に行った作業を元に戻します。" + +#: C/gedit.xml:981(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:982(para) +msgid "Redo the last undone action ." +msgstr "最後に元に戻した作業をやり直します。" + +#: C/gedit.xml:985(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:986(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "選択したテキストもしくは領域を切り取り、クリップボードに移動します。" + +#: C/gedit.xml:989(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:990(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "選択したテキストもしくは領域をクリップボードにコピーします。" + +#: C/gedit.xml:993(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:994(para) +msgid "Paste the contents of the clipboard." +msgstr "クリップボードの内容を貼り付けます。" + +#: C/gedit.xml:997(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:998(para) +msgid "Select all." +msgstr "全てを選択状態にします。" + +#: C/gedit.xml:1001(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1002(para) +msgid "Delete current line." +msgstr "現在カーソルがある行を削除します。" + +#. ============= Panes ======================= +#: C/gedit.xml:1009(bridgehead) +msgid "Panes" +msgstr "ペイン" + +#: C/gedit.xml:1010(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "ペイン用のショートカット" + +#: C/gedit.xml:1025(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1026(para) +msgid "Show/hide the side pane." +msgstr "サイド・ペインの表示/非表示を切り替えます。" + +#: C/gedit.xml:1029(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1030(para) +msgid "Show/hide the bottom pane." +msgstr "ボトム・ペインの表示/非表示を切り替えます。" + +#. ============= Search ======================= +#: C/gedit.xml:1037(bridgehead) +msgid "Search" +msgstr "検索" + +#: C/gedit.xml:1038(para) +msgid "Shortcuts for searching:" +msgstr "検索用のショートカット" + +#: C/gedit.xml:1053(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1054(para) +msgid "Find a string." +msgstr "文字列を検索します。" + +#: C/gedit.xml:1057(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1058(para) +msgid "Find the next instance of the string." +msgstr "次の一致文字列に移動します。" + +#: C/gedit.xml:1061(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1062(para) +msgid "Find the previous instance of the string." +msgstr "前の一致文字列に移動します。" + +#: C/gedit.xml:1065(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1066(para) +msgid "Interactive search." +msgstr "インクリメンタル検索を行います。" + +#: C/gedit.xml:1069(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1070(para) +msgid "Search and replace." +msgstr "文字列を検索し置換します。" + +#: C/gedit.xml:1073(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1074(para) +msgid "Clear highlight." +msgstr "一致した文字列の強調表示を解除します。" + +#: C/gedit.xml:1077(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1078(para) +msgid "Goto line." +msgstr "指定した行番号へ移動します。" + +#. ============= Tools ======================= +#: C/gedit.xml:1084(bridgehead) +msgid "Tools" +msgstr "ツール" + +#: C/gedit.xml:1085(para) +msgid "Shortcuts for tools:" +msgstr "ツール用のショートカット" + +#: C/gedit.xml:1100(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1101(para) +msgid "Check spelling (with plugin)." +msgstr "スペル・チェックを行います(プラグインを使用します)。" + +#: C/gedit.xml:1104(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1105(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "文字列の終端にある空白を削除します(プラグインを使用します)。" + +#: C/gedit.xml:1108(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1109(para) +msgid "Indent (with plugin)." +msgstr "指定した行をインデントします(プラグインを使用します)。" + +#: C/gedit.xml:1112(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1113(para) +msgid "Remove Indent (with plugin)." +msgstr "指定した行のインデントを削除します(プラグインを使用します)。" + +#: C/gedit.xml:1116(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1117(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "現在のディレクトリで \"make\" を実行します(プラグインを使用します)。" + +#: C/gedit.xml:1120(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1121(para) +msgid "Directory listing (with plugin)." +msgstr "ディレクトリを表示します(プラグインを使用します)。" + +#. ============= Help ======================= +#: C/gedit.xml:1127(bridgehead) +msgid "Help" +msgstr "ヘルプ" + +#: C/gedit.xml:1128(para) +msgid "Shortcuts for help:" +msgstr "ヘルプ用のショートカット" + +#: C/gedit.xml:1143(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1144(para) +msgid "Open gedit's user manual." +msgstr "gedit のマニュアルを開きます。" + +#: C/gedit.xml:1156(title) +msgid "Preferences" +msgstr "設定" + +#: C/gedit.xml:1158(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"gedit の設定を行うには、編" +"集設定を選択します。" +"設定ダイアログには次のカテゴリがあります。" + +#: C/gedit.xml:1168(title) +msgid "View Preferences" +msgstr "表示" + +#: C/gedit.xml:1173(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"テキストの折り返しを有効にするオプションを選択した場合、" +"長い文字列がテキストウィンドウの端まで来たときに、文字単位で次の行に折り返します。" +"これにより、水平方向のスクロールを避けることができます。" + +#: C/gedit.xml:1174(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"単語を二行以上に分割しないオプションを選択した場合、" +"一つの単語が二行以上にまたがらないように折り返しが行われます。" +"これにより、テキストが読みやすくなります。" + +#: C/gedit.xml:1180(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"行番号を表示するオプションを選択した場合、" +"gedit ウィンドウの左側に、行番号を表示します。" + +#: C/gedit.xml:1184(guilabel) +msgid "Current Line" +msgstr "カーソルがある行" + +#: C/gedit.xml:1186(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"カーソルのある行を強調表示するオプションを選択した場合、" +"カーソルのある行の背景色が変わります。" + +#: C/gedit.xml:1190(guilabel) +msgid "Right Margin" +msgstr "右マージン" + +#: C/gedit.xml:1192(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"右マージンを表示するオプションを選択した場合、右マージンの位置が" +"垂直線で表示されます。" + +#: C/gedit.xml:1193(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"右マージンを表す列番号を使って、垂直線の表示位置を指定できます。" + +#: C/gedit.xml:1197(guilabel) +msgid "Bracket Matching" +msgstr "対応するカッコ" + +#: C/gedit.xml:1199(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"対応するカッコを強調表示するオプションを選択した場合、" +"カーソルの位置にカッコ文字が存在した場合、それに対応するカッコが強調表示されます。" + +#: C/gedit.xml:1207(title) +msgid "Editor Preferences" +msgstr "エディタ" + +#: C/gedit.xml:1211(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"タブの幅を使って、Tab キーを押したときに" +"gedit が挿入する空白の幅を指定することができます。" + +#: C/gedit.xml:1212(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"タブの代わりにスペースを挿入するオプションを選択した場合、" +"Tab キーを押したときにgedit " +"はタブ文字ではなく、適切な数の半角空白文字を挿入します。" + +#: C/gedit.xml:1215(guilabel) +msgid "Auto Indentation" +msgstr "自動インデント" + +#: C/gedit.xml:1216(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"自動インデントを有効にするオプションを選択した場合、" +"改行すると元の行のインデントと同じ位置までインデントを行います。" + +#: C/gedit.xml:1219(guilabel) +msgid "File Saving" +msgstr "ファイルの保存" + +#: C/gedit.xml:1221(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"保存する前にバックアップを生成するオプションを選択した場合、" +"ファイルを保存するたびに、バックアップ用のコピーも生成します。バックアップ用の" +"コピーファイルは、ファイル名の末尾に ~ が付きます。" + +#: C/gedit.xml:1222(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"ファイルを自動的に保存する間隔 ... 分ごとオプションを使えば、" +"現在のファイルを定期的に保存できます。ファイルを保存したい時間間隔を指定してください。" + +#: C/gedit.xml:1229(title) +msgid "Font & Colors Preferences" +msgstr "フォントと色" + +#: C/gedit.xml:1231(guilabel) +msgid "Font" +msgstr "フォント" + +#: C/gedit.xml:1233(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"システムの固定幅フォントを使うオプションを選択した場合、" +"gedit テキストウィンドウの文字列には、システムの" +"標準フォントが使われます。" + +#: C/gedit.xml:1234(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"エディタのフォントフィールドには、gedit が使う表示フォントの種類が表示されます。ボタンをクリックすれば、" +"使用したいフォントの種類やスタイル、サイズを指定できます。" + +#: C/gedit.xml:1237(guilabel) +msgid "Colors" +msgstr "色のスキーム" + +#: C/gedit.xml:1239(para) +msgid "" +"Select the Use default theme colors option to use the " +"default theme colors in the gedit text window." +msgstr "" +"デフォルトのテーマカラーを使用するオプションが選択されている場合、" +"gedit テキストウィンドウには、デフォルトのテーマカラー" +"が使用されます。" + +#: C/gedit.xml:1240(para) +msgid "" +"Click on the Normal text color color button to " +"display the color selector dialog. Select a color to use to display normal " +"text in the gedit text window." +msgstr "" +"通常のテキストの色ボタンをクリックすると、色の選択" +"ダイアログが表示されます。gedit テキストウィンドウ" +"の通常のテキストで利用したい色を選択してください。" + +#: C/gedit.xml:1241(para) +msgid "" +"Click on the Background color color button to display " +"the color selector dialog. Select a background color for the " +"gedit text window." +msgstr "" +"背景色ボタンをクリックすると、色の選択" +"ダイアログが表示されます。gedit テキストウィンドウ" +"の背景で利用したい色を選択してください。" + +#: C/gedit.xml:1242(para) +msgid "" +"Click on the Selected text color color button to " +"display the color selector dialog. Select a color to use to display selected " +"text." +msgstr "" +"選択したテキストの色ボタンをクリックすると、色の選択" +"ダイアログが表示されます。選択したテキストで利用したい色を選択してください。" + +#: C/gedit.xml:1244(para) +msgid "" +"Click on the Selection color color button to display " +"the color selector dialog. Select a background color to use to highlight a " +"text selection." +msgstr "" +"選択した色ボタンをクリックすると、色の選択" +"ダイアログが表示されます。選択したテキストの背景色として利用したい色を選択してください。" + +#: C/gedit.xml:1251(title) +msgid "Syntax Highlighting Preferences" +msgstr "構文の強調表示" + +#: C/gedit.xml:1253(guilabel) +msgid "Enable syntax highlighting" +msgstr "構文の強調表示を有効にする" + +#: C/gedit.xml:1255(para) +msgid "Select this option to highlight the syntax of the text that you edit." +msgstr "このオプションを選択した場合、編集中のドキュメントの構文を強調表示します。" + +#: C/gedit.xml:1258(guilabel) +msgid "Highlight mode" +msgstr "強調表示モード" + +#: C/gedit.xml:1260(para) +msgid "Use this drop-down list to select a syntax mode to configure." +msgstr "ドロップダウンリストから構文の種類を選択します。" + +#: C/gedit.xml:1263(guilabel) +msgid "Elements" +msgstr "要素" + +#: C/gedit.xml:1265(para) +msgid "Use this list box to select a syntax element to configure." +msgstr "ドロップダウンリストから構文要素を選択します。" + +#: C/gedit.xml:1268(term) +msgid "Format buttons" +msgstr "形式ボタン" + +#: C/gedit.xml:1270(para) +msgid "" +"Use the following buttons to change the format of the selected syntax " +"element:" +msgstr "" +"構文要素ごとに、以下の形式を選択することができます。" + +#: C/gedit.xml:1278(para) +msgid "Button" +msgstr "ボタン" + +#: C/gedit.xml:1280(para) +msgid "Format" +msgstr "形式" + +#: C/gedit.xml:1292(phrase) +msgid "Shows icon for bold format." +msgstr "太字形式のアイコン" + +#: C/gedit.xml:1298(para) +msgid "Bold" +msgstr "太字" + +#: C/gedit.xml:1310(phrase) +msgid "Shows icon for italic format." +msgstr "イタリック形式のアイコン" + +#: C/gedit.xml:1316(para) +msgid "Italic" +msgstr "イタリック" + +#: C/gedit.xml:1328(phrase) +msgid "Shows icon for underline." +msgstr "下線形式のアイコン" + +#: C/gedit.xml:1334(para) +msgid "Underline" +msgstr "下線" + +#: C/gedit.xml:1346(phrase) +msgid "Shows icon for strikethrough." +msgstr "取り消し線形式のアイコン" + +#: C/gedit.xml:1352(para) +msgid "Strikethrough" +msgstr "取り消し線" + +#: C/gedit.xml:1362(guilabel) +msgid "Foreground" +msgstr "前景色" + +#: C/gedit.xml:1364(para) +msgid "" +"Select this option to change the font color of the selected syntax element. " +"Click on the color button to display the color selector dialog, then select " +"the font color." +msgstr "" +"このオプションを選択すると、選択した構文要素の文字色を変更できます。" +"カラーボタンをクリックして、色の選択ダイアログを表示し、設定したい文字色を選択してください。" + +#: C/gedit.xml:1367(guilabel) +msgid "Background" +msgstr "背景色" + +#: C/gedit.xml:1369(para) +msgid "" +"Select this option to change the background color of the selected syntax " +"element. Click on the color button to display the color selector dialog, " +"then select the background color." +msgstr "" +"このオプションを選択すると、選択した構文要素の背景色を変更できます。" +"カラーボタンをクリックして、色の選択ダイアログを表示し、設定したい背景色を選択してください。" + +#: C/gedit.xml:1372(guibutton) +msgid "Reset to Default" +msgstr "初期設定に戻す" + +#: C/gedit.xml:1374(para) +msgid "" +"Click on this button to reset the foreground color and background color of " +"the selected syntax element to the default values." +msgstr "" +"このボタンをクリックすると、選択している構文要素の前景色と背景色の" +"設定が、初期状態に戻ります。" + +#: C/gedit.xml:1381(title) +msgid "Plugins Preferences" +msgstr "プラグイン" + +#: C/gedit.xml:1382(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"プラグインを使えば、より多彩な機能を gedit に" +"追加できます。プラグインについての詳しい情報と、内蔵のプラグインについては、" +"を参照してください。" + +#: C/gedit.xml:1387(title) +msgid "Enabling a Plugin" +msgstr "プラグインを有効化する" + +#: C/gedit.xml:1388(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"gedit プラグインを有効化するには、以下の操作を実行してください。" + +#: C/gedit.xml:1391(para) C/gedit.xml:1412(para) C/gedit.xml:1736(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"編集設定を選択します。" + +#: C/gedit.xml:1394(para) C/gedit.xml:1415(para) C/gedit.xml:1739(para) +msgid "Select the Plugins tab." +msgstr "プラグインタブを選択します。" + +#: C/gedit.xml:1397(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"利用したいプラグインの名前の横にあるチェックボックスを選択します。" + +#: C/gedit.xml:1400(para) C/gedit.xml:1421(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"閉じるをクリックして、設定ダイアログ" +"を閉じます。" + +#: C/gedit.xml:1407(title) +msgid "Disabling a Plugin" +msgstr "プラグインを無効化する" + +#: C/gedit.xml:1408(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"gedit を終了しても、プラグインは有効化されたままです。" + +#: C/gedit.xml:1409(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"gedit プラグインを無効化するには、以下の操作を実行してください。" + +#: C/gedit.xml:1418(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"無効化したいプラグインの名前の横にあるチェックボックスを非選択状態にします。" + +#: C/gedit.xml:1430(title) +msgid "Plugins" +msgstr "プラグイン" + +#: C/gedit.xml:1432(title) +msgid "Working with Plugins" +msgstr "プラグインを使用する" + +#: C/gedit.xml:1433(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"プラグインとはアプリケーションの機能を強化する補完プログラムであり、" +"プラグインを導入することで、gedit " +"に多様な機能を追加することができます。例えば、gedit " +"メニューに新しい項目や新機能が追加されます。" + +#: C/gedit.xml:1435(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"いくつかのプラグインが gedit に内蔵されています。" +"また、追加でインストールすることも可能です。サードパーティのプラグインについては、" +"gedit のウェブサイトに一覧が存在します。" + +#: C/gedit.xml:1436(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"プラグインを有効化・無効化する方法や、どのプラグインが有効化されているかを" +"確認する方法については、プラグイン設定" +"の項目を参照してください。" + +#: C/gedit.xml:1437(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"以下のプラグインは gedit に内蔵されています。" + +#: C/gedit.xml:1443(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"大/小文字の変更は、選択したテキストの大/小文字を変更します。" + +#: C/gedit.xml:1446(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"ドキュメントの" +"統計は、ドキュメントの行数や単語数、文字数を表示します。" + +#: C/gedit.xml:1449(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"外部ツールgedit から外部コマンドを" +"実行します。" + +#: C/gedit.xml:1452(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"ファイル参照ペインはサイド・ペインから、ファイルや" +"フォルダの閲覧が可能になります。" + +#: C/gedit.xml:1455(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"行のインデントは指定した行にインデントを追加・削除します。" + +#: C/gedit.xml:1458(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"日付/時刻の" +"挿入はドキュメントに現在の日付や時刻を追加します。" + +#: C/gedit.xml:1461(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"モードラインは、個々のドキュメントごとに設定を保存したり、" +"EmacsKate、" +"Vim 風のモードラインをサポートします。" + +#: C/gedit.xml:1464(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Python コンソールは、プログラミング言語である Python のコマンドを実行します。" + +#: C/gedit.xml:1467(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"コード・スニペットは、よく使われる文字列を保存し、手軽にドキュメントに挿入できます。" + +#: C/gedit.xml:1470(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"並び替え" +"は、選択した行を並び替えることができます。" + +#: C/gedit.xml:1473(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"スペル・チェッカは、選択したテキストのスペルを修正したり、ドキュメント内の" +"誤字を自動的に発見します。" + +#: C/gedit.xml:1476(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"タグの一覧は、HTML やその他の言語で一般的に使われるタグをサイド・ペインから簡単に" +"挿入することができます。" + +#: C/gedit.xml:1479(para) +msgid "" +"User Name inserts the username of the current user into the document." +msgstr "" +"ユーザ名は、ドキュメントに現在のユーザ名を挿入します。" + +#: C/gedit.xml:1486(title) +msgid "Change Case Plugin" +msgstr "大/小文字の変更プラグイン" + +#: C/gedit.xml:1487(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"大/小文字の変更プラグインは選択した文字列の、" +"大文字・小文字を切り替えます。" + +#: C/gedit.xml:1488(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"大/小文字の変更プラグインを有効にすると、" +"以下の項目が編集メニューに追加されます。" + +#: C/gedit.xml:1498(para) +msgid "Menu Item" +msgstr "項目" + +#: C/gedit.xml:1500(para) +msgid "Action" +msgstr "動作" + +#: C/gedit.xml:1502(para) +msgid "Example" +msgstr "例" + +#: C/gedit.xml:1508(guisubmenu) C/gedit.xml:1514(guisubmenu) +#: C/gedit.xml:1520(guisubmenu) C/gedit.xml:1526(guisubmenu) +msgid "Change Case" +msgstr "大/小文字の変更" + +#: C/gedit.xml:1508(guimenuitem) +msgid "All Upper Case" +msgstr "全て大文字にする" + +#: C/gedit.xml:1509(para) +msgid "Change each character to uppercase." +msgstr "選択中の文字を全て大文字に変更します。" + +#: C/gedit.xml:1510(para) +msgid "This text becomes THIS TEXT" +msgstr "This textTHIS TEXT" + +#: C/gedit.xml:1514(guimenuitem) +msgid "All Lower Case" +msgstr "全て小文字にする" + +#: C/gedit.xml:1515(para) +msgid "Change each character to lowercase." +msgstr "選択中の文字を全て小文字に変更します。" + +#: C/gedit.xml:1516(para) +msgid "This Text becomes this text" +msgstr "This Textthis text" + +#: C/gedit.xml:1520(guimenuitem) +msgid "Invert Case" +msgstr "大/小文字を逆にする" + +#: C/gedit.xml:1521(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" +"選択中の全ての小文字を大文字に変更し、逆に選択中の" +"全ての大文字を小文字に変更します。" + +#: C/gedit.xml:1522(para) +msgid "This Text becomes tHIS tEXT" +msgstr "This TexttHIS tEXT" + +#: C/gedit.xml:1526(guimenuitem) +msgid "Title Case" +msgstr "先頭文字を大文字にする" + +#: C/gedit.xml:1527(para) +msgid "Change the first character of each word to uppercase." +msgstr "各単語の最初の文字を大文字に変更します。" + +#: C/gedit.xml:1528(para) +msgid "this text becomes This Text" +msgstr "this textThis Text" + +#: C/gedit.xml:1537(title) +msgid "Document Statistics Plugin" +msgstr "ドキュメントの統計プラグイン" + +#: C/gedit.xml:1538(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"ドキュメントの統計プラグインは、現在のファイルに" +"対して、行数、空白込みの文字数、空白なしの文字数、バイト数を計算します。" +"その計算結果はドキュメントの統計ダイアログ" +"に表示されます。ドキュメントの統計プラグインを利用するには、以下の手順を" +"実行します。" + +#: C/gedit.xml:1540(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"ツールドキュメントの統計情報" +"を選択して、ドキュメントの統計ダイアログを表示します。ドキュメントの統計" +"ダイアログには次の情報が表示されます。" + +#: C/gedit.xml:1543(para) +msgid "Number of lines in the current document." +msgstr "現在のドキュメントの行数" + +#: C/gedit.xml:1546(para) +msgid "Number of words in the current document." +msgstr "現在のドキュメントの単語数" + +#: C/gedit.xml:1549(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "現在の文書の文字数(空白を含む)" + +#: C/gedit.xml:1552(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "現在の文書の文字数(空白を除く)" + +#: C/gedit.xml:1555(para) +msgid "Number of bytes in the current document." +msgstr "現在の文書のバイト数" + +#: C/gedit.xml:1560(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"ドキュメントの統計ダイアログを開いたまま、" +"gedit 中のファイルを編集し続けることもできます。" +"ドキュメントの統計ダイアログの情報を更新するには、" +"更新をクリックしてください。" + +#: C/gedit.xml:1567(title) +msgid "External Tools Plugin" +msgstr "外部ツールプラグイン" + +#: C/gedit.xml:1568(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"外部ツールプラグインを使えば、" +"gedit から外部コマンドを実行することができます。" +"コマンドにデータを渡して、その出力結果を取得したり(例えば、sed)、独立した外部コマンドを実行したり(例えば、make)といったことが可能になります。" + +#: C/gedit.xml:1569(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"外部ツール・マネージャを使って、実行したいコマンドを" +"定義することができます。定義したコマンドは、ツール" +"メニューに表示されます。" + +#: C/gedit.xml:1572(title) +msgid "Built-in Commands" +msgstr "組み込みコマンド" + +#: C/gedit.xml:1573(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"以下のコマンドは、外部ツールプラグインを" +"有効にした段階で利用できます。" + +#: C/gedit.xml:1575(term) +msgid "Build" +msgstr "ビルド" + +#: C/gedit.xml:1577(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"編集中のドキュメントが存在するディレクトリで、make " +"を実行します。" + +#: C/gedit.xml:1580(term) +msgid "Directory Listing" +msgstr "ディレクトリの内容を表示" + +#: C/gedit.xml:1582(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "" +"編集中のドキュメントが存在するディレクトリの内容を、新しいドキュメントに出力します。" + +#: C/gedit.xml:1585(term) +msgid "Environment Variables" +msgstr "環境変数" + +#: C/gedit.xml:1587(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "ボトム・ペインに環境変数の一覧を表示します。" + +#: C/gedit.xml:1590(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1592(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"編集中のドキュメントが存在するディレクトリ中の全てのファイルに対して検索を行います。" +"結果はボトム・ペインに表示されます。" + +#: C/gedit.xml:1595(term) +msgid "Remove Trailing Spaces" +msgstr "末尾の空白を削除する" + +#: C/gedit.xml:1597(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "ドキュメント中の各行末尾にある空白を削除します。" + +#: C/gedit.xml:1604(title) +msgid "Defining a Command" +msgstr "コマンドの定義" + +#: C/gedit.xml:1605(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"外部コマンドを新規に追加するには、ツール" +"外部ツールを選択してください。" + +#: C/gedit.xml:1606(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"外部ツール・マネージャウィンドウが開きますので、" +"新規をクリックします。実行したいコマンドにあわせて、" +"以下の情報を入力してください。" + +#: C/gedit.xml:1608(term) +msgid "Description" +msgstr "説明" + +#: C/gedit.xml:1610(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"メニュー上でコマンドを選択したときに、ステータスバーに表示される説明です。" + +#: C/gedit.xml:1613(term) +msgid "Accelerator" +msgstr "ショートカット・キー" + +#: C/gedit.xml:1615(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "キーボードショートカットを行うためのキーコマンドを入力してください。" + +#: C/gedit.xml:1618(term) +msgid "Commands" +msgstr "コマンド" + +#: C/gedit.xml:1620(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"実行したいコマンドを入力します。コマンドに現在編集しているドキュメントの情報などを" +"渡すために、gedit 環境変数を使うこともできます。" +"詳しいことは" +"を参照してください。" + +#: C/gedit.xml:1623(term) +msgid "Input" +msgstr "入力" + +#: C/gedit.xml:1625(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"コマンドに(標準入力として)与える内容を指定します。" +"編集中のドキュメント全体や、選択中のテキスト、行、単語などを指定できます。" + +#: C/gedit.xml:1628(term) +msgid "Output" +msgstr "出力" + +#: C/gedit.xml:1630(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"コマンドの結果をどこに出力するかを指定します。ボトム・ペインに表示、新しいドキュメント" +"に出力、編集中のドキュメントの末尾に追記する、カーソル位置に挿入する、" +"選択部分を置き換える、ドキュメント全体を置き換えるなどを指定できます。" + +#: C/gedit.xml:1633(term) +msgid "Applicability" +msgstr "適用範囲" + +#: C/gedit.xml:1635(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"コマンドで扱えるドキュメントの種類を指定します。保存されているドキュメントか" +"そうでないか、ローカルのドキュメントかリモートのドキュメントかなどから選べます。" + +#: C/gedit.xml:1643(title) +msgid "Editing and Removing Tools" +msgstr "ツールの編集・削除" + +#: C/gedit.xml:1644(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"既存のツールを編集するには、一覧から編集したいツールを選択し、設定を変更してください。" + +#: C/gedit.xml:1645(para) +msgid "To rename a tool, click it again in the list." +msgstr "" +"ツールの名前を変更するには、一覧にて名前を二度クリックしてください。" + +#: C/gedit.xml:1646(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"組み込みコマンドに加えた変更を元に戻したい場合は、" +"元に戻すをクリックしてください。" + +#: C/gedit.xml:1647(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"定義したツールを削除するには、一覧にてツールを選択し、" +"削除をクリックしてください。ただし組み込みコマンドは" +"削除できません。削除できるのは、新規に作成したコマンドのみです。" + +#: C/gedit.xml:1651(title) +msgid "Variables" +msgstr "変数" + +#: C/gedit.xml:1652(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"コマンドフィールドでコマンドを定義する際に、" +"以下の変数を利用することができます。" + +#: C/gedit.xml:1655(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1658(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1661(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1664(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1667(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1670(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1673(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1680(title) +msgid "File Browser Plugin" +msgstr "ファイル参照ペインプラグイン" + +#: C/gedit.xml:1681(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"ファイル参照ペインプラグインを使えば、サイド・ペイン" +"にてファイルやフォルダを参照することができ、簡単にファイルを開くことができます。" + +#: C/gedit.xml:1682(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"プラグインを有効にした状態でファイル参照ペインを表示するには、" +"表示サイド・ペイン" +"を選択し、サイド・ペインの下部にあるファイル・ブラウザアイコンをクリックしてください。" + +#: C/gedit.xml:1684(title) +msgid "Browsing your Files" +msgstr "ファイルを表示する" + +#: C/gedit.xml:1685(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"初期状態のファイル・ブラウザタブでは、ファイル・マネージャでブックマークされている" +"内容が表示されています。中身を表示するには、それぞれの項目をダブルクリックしてください。" + +#: C/gedit.xml:1686(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"親フォルダを表示するには、ドロップダウンリストから選択するか、ファイル・ブラウザ" +"ツールバー上の上矢印をクリックしてください。" + +#: C/gedit.xml:1687(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"編集中のドキュメントが存在するフォルダを表示するには、ファイルの一覧で右クリックし、" +"ドキュメントのルートにするを選択してください。" + +#: C/gedit.xml:1691(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"ファイルを gedit で開くには、ファイルの一覧から" +"開きたいファイルをダブルクリックしてください。" + +#: C/gedit.xml:1694(title) +msgid "Creating Files and Folders" +msgstr "ファイルやフォルダを作成する" + +#: C/gedit.xml:1695(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"ファイル・ブラウザで表示されているフォルダに、新規に空のテキストファイル" +"を作成するには、そのファイル一覧上で右クリックし、" +"新しいファイルを選択してください。" + +#: C/gedit.xml:1696(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"ファイル・ブラウザで表示されているフォルダに、新規にフォルダ" +"を作成するには、そのファイル一覧上で右クリックし、" +"新しいフォルダを選択してください。" + +#: C/gedit.xml:1701(title) +msgid "Indent Lines Plugin" +msgstr "行のインデントプラグイン" + +#: C/gedit.xml:1702(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"行のインデントプラグインは、行の先頭に" +"空白を追加・削除します。" + +#: C/gedit.xml:1703(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "インデントやインデントの解除を行うには、次の手順を実行します。" + +#: C/gedit.xml:1705(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"インデントを設定する行を選択します。1 行にインデントを設定したり削除したりす" +"るには、その行にカーソルを置きます。同じ行であればカーソルの位置はどこでも構いません。" + +#: C/gedit.xml:1710(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"インデントするには、編集" +"インデントを選択します。" + +#: C/gedit.xml:1713(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"インデントを削除するには、編集" +"インデント解除を選択します。" + +#: C/gedit.xml:1718(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"インデント幅やタブ文字/空白文字のどちらを使うかといった設定は、エディタ設定の" +"タブ文字に依存します。詳しいことは、" +"を参照してください。" + +#: C/gedit.xml:1723(title) +msgid "Insert Date/Time Plugin" +msgstr "日付/時間の挿入プラグイン" + +#: C/gedit.xml:1724(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"日付/時間の挿入プラグインプラグインは、ドキュメント" +"に原罪の日付や時刻を挿入します。日付/時間の挿入プラグインを使用するには、" +"次の手順を実行します。" + +#: C/gedit.xml:1726(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"編集日付/時間の挿入を選択します。" + +#: C/gedit.xml:1727(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"自動的に指定した形式で日付/時刻を挿入するよう日付/時刻の挿入プラグインで設定" +"していない場合は、日付と時刻の挿入ダイアログが表示されます。" +"一覧の中から、希望の形式を選択してください。挿入を" +"クリックすれば、日付と時刻の挿入ダイアログが閉じます。" +"さらに現在編集中のファイルのカーソル位置に、日付/時刻が挿入されます。" + +#: C/gedit.xml:1728(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"特定の日付/時間形式を gedit が使用する設定になって" +"いる場合は、日付と時刻の挿入ダイアログは表示されませ" +"ん。日付/時間は、現在編集中のファイルのカーソル位置に自動的に挿入されます。" + +#: C/gedit.xml:1733(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "日付/時間の挿入プラグインの設定" + +#: C/gedit.xml:1734(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "日付/時間の挿入プラグインを設定するには、次の手順を実行します。" + +#: C/gedit.xml:1742(para) +msgid "Select the Insert Date/Time plugin." +msgstr "日付/時間の挿入 プラグインを選択します。" + +#: C/gedit.xml:1745(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"プラグインの設定をクリックして、" +"日付/時間挿入プラグインの設定ダイアログを表示します。" + +#: C/gedit.xml:1748(para) +msgid "Select one of the options, as follows:" +msgstr "次のようにオプションを 1 つ選択します。" + +#: C/gedit.xml:1750(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"日付/時間を挿入するたびに日付/時間の形式を指定したい場合は、フォーマット" +"のためのプロンプトオプションを選択します。" + +#: C/gedit.xml:1753(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"gedit が提供する日付/時間形式の 1 つを毎回使用する" +"場合は、指定したフォーマットを使うオプションを選択後、" +"一覧から適当な形式を選択します。このオプションを選択すると、" +"編集日付/時刻の挿入を選択しても、日付/時間の形式を尋ねるダイアログは" +"表示されません。" + +#: C/gedit.xml:1756(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"独自の日付/時間形式を毎回使用する場合は、その他オプション" +"を選択後、適当な形式をテキストボックスに入力します。カスタム形式の指定方法については、" +"strftime3を参照してください。このオプションを選択する" +"と、編集日付/時刻の挿入を選択しても、日付/時間の形式を尋ねるダイアログは" +"表示されません。" + +#: C/gedit.xml:1761(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"OKをクリックして、日付/時間挿入プ" +"ラグインの設定ダイアログを閉じます。" + +#: C/gedit.xml:1764(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"設定ダイアログを閉じるには、閉じるをクリックします。" + +#: C/gedit.xml:1771(title) +msgid "Modelines Plugin" +msgstr "モードラインプラグイン" + +#: C/gedit.xml:1772(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"モードラインプラグインを使えば、ドキュメントごと" +"の設定を保存できます。モードラインとは" +" gedit がそのドキュメントを判別するための" +"テキストの先頭もしくは終端行を意味します。" + +#: C/gedit.xml:1773(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"モードラインを使えば、設定ダイアログで設定できる項目を上書きすることができます。" + +#: C/gedit.xml:1774(para) +msgid "You can set the following preferences with modelines:" +msgstr "モードラインでは以下の項目を設定できます。" + +#: C/gedit.xml:1777(para) +msgid "Tab width" +msgstr "タブの幅" + +#: C/gedit.xml:1780(para) +msgid "Indent width" +msgstr "インデントの幅" + +#: C/gedit.xml:1783(para) +msgid "Insert spaces instead of tabs" +msgstr "タブ文字の代わりに半角空白を使うかどうか" + +#: C/gedit.xml:1789(para) +msgid "Right margin width" +msgstr "右マージン幅" + +#: C/gedit.xml:1793(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"モードラインプラグインでは、EmacsKateVim" +" などのテキストエディタでも使われているモードラインをサポートしています。" + +#: C/gedit.xml:1796(title) +msgid "Emacs Modelines" +msgstr "Emacs モードライン" + +#: C/gedit.xml:1797(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"Emacs モードラインでは、ドキュメントの先頭" +"二行を使って判別します。" + +#: C/gedit.xml:1798(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Emacs ではタブの幅 (tab-width)、インデントの幅 (indent-offset)" +"、インデント文字の種類 (indent-tabs-mode)、自動テキストの折り返し (autowrap)" +"オプションなどをサポートしています。詳しいことは " +"GNU Emacs マニュアルを参照してください。" + +#: C/gedit.xml:1801(title) +msgid "Kate Modelines" +msgstr "Kate モードライン" + +#: C/gedit.xml:1802(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"Kate モードラインでは、ドキュメントの先頭と終端の" +"十行を使って判別します。" + +#: C/gedit.xml:1803(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Kate ではタブの幅 (tab-width)、インデントの幅 (indent-width)" +"、空白文字によるインデント (space-indent)、単語の折り返し (word-wrap)、折り返し幅 " +"(word-wrap-column)オプションなどをサポートしています。詳しいことは " +"Kate のウェブサイトを参照してください。" + +#: C/gedit.xml:1806(title) +msgid "Vim Modelines" +msgstr "Vim モードライン" + +#: C/gedit.xml:1807(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"Vim モードラインでは、ドキュメントの先頭と終端の" +"三行を使って判別します。" + +#: C/gedit.xml:1808(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Vim ではタブ文字の種類 (expandtab)、タブの幅 (tabstop)、" +"インデントの幅 (shiftwidth)、テキストの折り返し (wrap)、折り返し幅 (textwidth)" +"オプションなどをサポートしています。詳しいことは " +"Vim のウェブサイトを参照してください。" + +#: C/gedit.xml:1813(title) +msgid "Python Console Plugin" +msgstr "Python コンソールプラグイン" + +#: C/gedit.xml:1814(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Python コンソールプラグインを使えば、" +"gedit からプログラミング言語である Python の" +"コマンドを実行できます。プラグインを有効にするとボトム・ペインにタブが追加されて、" +"ここにコマンドプロンプトやその結果が出力されます。" + +#: C/gedit.xml:1815(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Python コンソールで入力されたコマンドは、実行前の確認が行われません。そのため、" +"無限ループなどを実行することで、gedit が停止" +"してしまう可能性もあります。" + +#: C/gedit.xml:1819(title) +msgid "Snippets Plugin" +msgstr "コード・スニペットプラグイン" + +#: C/gedit.xml:1820(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"コード・スニペットプラグインを使えば、よく使う" +"文字列(スニペット)を保存し、手軽にドキュメントに" +"挿入できます。" + +#: C/gedit.xml:1821(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"挿入できるスニペットは、現在編集中のドキュメントの種類に依存します。例えば、" +"HTML ドキュメントを編集中であれば、HTML でよく使われるスニペットの一覧から" +"文字列を選択することができます。一部のスニペットは、全ての種類のドキュメントで" +"利用できます。" + +#: C/gedit.xml:1822(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"gedit には数多くの組み込みスニペットが" +"存在し、それを編集することも可能です。" + +#: C/gedit.xml:1825(title) +msgid "Inserting Snippets" +msgstr "スニペットの挿入" + +#: C/gedit.xml:1826(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"スニペットを実際に挿入するにはまずタブトリガと" +"呼ばれる単語を入力してから、Tab キーを押します。スニペットの" +"タブトリガは、一般的に挿入したいスニペットの一部の文字で構成されるか、" +"より覚えやすい短い単語が選ばれています。" + +#: C/gedit.xml:1827(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"別の方法として、CtrlSpace を入力すれば、挿入可能なスニペットの一覧が表示されます。訳注:日本語" +"環境の場合、CtrlSpace は日本語入力のオン/オフが割り当てられていることがあるため、" +"日本語入力の設定を変更しない限り使えない場合もあります。" + +#: C/gedit.xml:1831(title) +msgid "Adding Snippets" +msgstr "スニペットの追加" + +#: C/gedit.xml:1832(para) +msgid "To create a new snippet, do the following:" +msgstr "新規にスニペットを追加する方法は次のとおりです。" + +#: C/gedit.xml:1835(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"ツールスニペットの管理を選択し、スニペットの管理ウィンドウ" +"を開きます。" + +#: C/gedit.xml:1838(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"スニペットの一覧は言語ごとにグループ分けされていますので、追加したいスニペットの言語か" +"言語グループにあるスニペット自体を選択します。全ての言語に共通するスニペットを追加したい" +"場合は、一覧の先頭にある全般を選択します。標準状態では、現在編集中のドキュメント" +"の種類が選択されています。" + +#: C/gedit.xml:1841(para) +msgid "Click New. A new snippet appears in the list." +msgstr "新規をクリックします。一覧の中に新しいスニペットの項目が現れます。" + +#: C/gedit.xml:1844(para) +msgid "Enter the following information for the new snippet:" +msgstr "新しいスニペットに対して、以下の情報を入力してください。" + +#: C/gedit.xml:1846(term) +msgid "Name" +msgstr "名前" + +#: C/gedit.xml:1848(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"スニペットの一覧で表示される、スニペットの名前を入力します。この名前は、そのスニペットが" +"どういうものかを思い出すためだけに使われます。一覧の中でスニペットの名前をクリックすれば、" +"名前を変更することができます。" + +#: C/gedit.xml:1851(term) +msgid "Snippet text" +msgstr "スニペットテキスト" + +#: C/gedit.xml:1853(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"編集ボックスに、挿入したいスニペットの文字列を入力します。" +"特殊なコードも入力可能です。詳しいことは、を参照してください。" + +#: C/gedit.xml:1854(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"スニペットの管理ウィンドウを閉じることなく、ドキュメントウィンドウ" +"に一旦戻って、そこから入力したい文字列をコピーすることも可能です。" + +#: C/gedit.xml:1857(term) +msgid "Tab Trigger" +msgstr "タブトリガ" + +#: C/gedit.xml:1859(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"タブ欄にタブトリガとなる文字列を入力します。これは、Tab キーを" +"押した際に、どのスニペットに置き換えるべきかを識別するための文字列です。" + +#: C/gedit.xml:1860(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"タブトリガは他のスニペットのタブトリガと重複できません。もし、入力した文字列が" +"重複している場合は、タブの欄が赤く表示されます。" + +#: C/gedit.xml:1863(term) +msgid "Shortcut key" +msgstr "ショートカット・キー" + +#: C/gedit.xml:1865(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "スニペットを挿入するためのショートカット・キーを入力します。" + +#: C/gedit.xml:1874(title) +msgid "Editing and Removing Snippets" +msgstr "スニペットの編集・削除" + +#: C/gedit.xml:1875(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"特定のスニペットを編集するには、一覧からスニペットを選択後、表示される各設定を" +"適宜修正してください。" + +#: C/gedit.xml:1876(para) +msgid "To rename a snippet, click it again in the list." +msgstr "特定のスニペットの名前を編集するには、スニペットの名前を二度クリックしてください。" + +#: C/gedit.xml:1877(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"一度編集した組み込みスニペットを元に戻すには、元に戻すをクリックしてください。" + +#: C/gedit.xml:1878(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"特定のスニペットを削除するには、スニペットを選択後、削除をクリックしてください。組み込みスニペットは削除できません。" +"自分で作ったスニペットのみ削除可能です。" + +#: C/gedit.xml:1882(title) +msgid "Snippet Substitutions" +msgstr "スニペット置換" + +#: C/gedit.xml:1883(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"文字列を挿入するだけでなく、スニペットには状況に合わせて変更可能な文字列を" +"挿入したり、スニペット挿入後に修正が必要な場所を指定したりといったことが可能です。" + +#: C/gedit.xml:1887(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "スニペットテキストに、以下のコードを入力できます。" + +#: C/gedit.xml:1889(term) +msgid "Tab placeholders" +msgstr "タブコード" + +#: C/gedit.xml:1891(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n はタブコードを表します。" +"n は 1 から始まるタブの番号です。" + +#: C/gedit.xml:1892(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} は初期値付きのタブコードです。" + +#: C/gedit.xml:1893(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"タブコードは、そのスニペットを挿入後に別の文字列を挿入する可能性がある場所を" +"指定するコードです。" + +#: C/gedit.xml:1894(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"タブコードを使うためには、まず普通にスニペットを挿入します。その後、カーソルが" +"最初のタブ番号の位置に移動します。テキストを入力し、Tab " +"キーを押せば、次のタブ番号の位置に移動します。タブコードの番号は、" +"Tab キーを押すことによって進む順番を指定します。" + +#: C/gedit.xml:1895(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"ShiftTab を押せば" +"一つ前のタブ番号の位置にカーソルが移動します。一番最後の位置で、" +"Tab キーを押した場合、スニペットで挿入された文字列の最後か、" +"もし存在すれば終端コードの位置にカーソルが移動します。" + +#: C/gedit.xml:1898(term) +msgid "Mirror placeholders" +msgstr "ミラーコード" + +#: C/gedit.xml:1900(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"タブコード連続して記述すると、既に定義されたコードを複写します。これにより" +"スニペットが数回現れる場面でも、入力は一度だけで済みます。" + +#: C/gedit.xml:1903(term) +msgid "End placeholder" +msgstr "終端コード" + +#: C/gedit.xml:1905(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 は終端コードを表します。これはスニペットの末尾に記され、" +"カーソルがスニペットの最後尾に移動する際に使われます。" + +#: C/gedit.xml:1908(term) +msgid "Environmental variables" +msgstr "環境変数" + +#: C/gedit.xml:1910(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"$PATH$HOME のような環境変数は" +"スニペットでも利用できます。gedit では" +"以下の独自の環境変数も使用できます。" + +#: C/gedit.xml:1912(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1914(para) +msgid "The currently selected text." +msgstr "現在選択中の文字列を表します。" + +#: C/gedit.xml:1917(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1919(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"現在編集中のファイル名を表します。ドキュメントが未保存であれば、空文字となります。" + +#: C/gedit.xml:1922(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1924(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"現在編注のファイル名の、拡張子を除いた部分を表します。ドキュメントが" +"未保存であれば、空文字となります。" + +#: C/gedit.xml:1927(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1929(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"現在カーソルが存在する場所の単語を表します。この変数が使われたとき、" +"現在の単語は、スニペットに置換されます。" + +#: C/gedit.xml:1937(term) +msgid "Shell placeholders" +msgstr "シェルコード" + +#: C/gedit.xml:1939(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) は端末内で" +" cmd を実行した結果に置換されます。" + +#: C/gedit.xml:1940(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) は参照番号付きのシェルコードで、n には" +" 1 以上の数字を割り当てます。$n " +"を使えば、その番号の割り当てられたシェルコードと同じ出力結果を挿入できます。" + +#: C/gedit.xml:1943(term) +msgid "Python placeholders" +msgstr "Python コード" + +#: C/gedit.xml:1945(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> は Python インタプリタ" +"内で cmd を実行した結果に置換されます。" + +#: C/gedit.xml:1946(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" は、別の Python コードへの依存性を表しています。ここで " +"a はスニペットの順番です。これを使えば、他のスニペットで" +"定義された Python 関数を利用できます。複数の依存性を表すには、次のようにカンマで区切って" +"ください: $<" +"a,b:cmd>" + +#: C/gedit.xml:1947(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"他の Python スニペットで使っている変数を利用するには、その変数が" +"グローバルとして定義されている必要があります。" + +#: C/gedit.xml:1956(title) +msgid "Sort Plugin" +msgstr "並び替えプラグイン" + +#: C/gedit.xml:1957(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"並び替えプラグインは、選択した行をアルファベット順" +"(文字コード順)に並べ替えます。" + +#: C/gedit.xml:1958(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"並び替えの操作は元に戻すことができませんので、並び替えの実行前にファイルを保存して" +"おいた方が良いでしょう。保存しておけば、" +"ファイル元に戻すを選択することで" +"保存時の状態に戻すことができます。" + +#: C/gedit.xml:1961(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "並び替えプラグインを使用するには、次の手順を実行します。" + +#: C/gedit.xml:1964(para) +msgid "Select the lines of text you want to sort." +msgstr "並び替えたい行を選択します。" + +#: C/gedit.xml:1966(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"編集並び替えを選択して、並び替えダイアログを表示します。" + +#: C/gedit.xml:1969(para) +msgid "Choose the options you want for the sort:" +msgstr "並び替え作業で使用したいオプションを選択します。" + +#: C/gedit.xml:1972(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"逆の順序に並べ替えたい場合は、逆順にするオプションを選択します。" + +#: C/gedit.xml:1975(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"重複した行を削除する場合は、重複する部分を削除するオプ" +"ションを選択します。" + +#: C/gedit.xml:1978(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"大文字と小文字を認識して並び替えたい場合は、大/小文字を区別するオプ" +"ションを選択します。" + +#: C/gedit.xml:1981(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"各行ごとに最初の数文字を並び替え判別の対称から外したい場合は、" +"開始行でその文字数を指定します。" + +#: C/gedit.xml:1986(para) +msgid "To perform the sort operation, click Sort." +msgstr "並び替え操作を実行するには、並び替えをクリックします。" + +#: C/gedit.xml:1993(title) +msgid "Spell Checker Plugin" +msgstr "スペル・チェッカプラグイン" + +#: C/gedit.xml:1994(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"スペル・チェッカプラグインは、選択したテキストの" +"スペルを確認します。自動的にスペルチェックを行ったり、特定の言語で手動でスペルチェック" +"を行うといった設定が可能です。言語設定や自動チェックのオン/オフについては、ドキュメント" +"ごとに保存されます。スペル・チェッカプラグインを使用するには、以下の手順を" +"実行します。" + +#: C/gedit.xml:1996(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"ツール言語の設定を選択し、言語の設定" +"ダイアログを表示します。一覧の中から適切な言語を選択し OK を押して言語の設定ダイアログを閉じてください。" + +#: C/gedit.xml:1999(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"自動的にスペルチェックを行うには、ツール自動スペル・チェックを選択します。" +"自動スペルチェックを解除するには、もう一度ツール自動スペル・チェックを選択します。" +"自動スペルチェックが設定されると、メニューの自動スペル・チェック" +"項目の隣にアイコンが表示されます。gedit が起動した" +"初期状態では、自動スペルチェック機能はオフになっています。" + +#: C/gedit.xml:2000(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"辞書にないスペルが発見されたときは、別の色で下線が表示されます。その単語を" +"右クリックし、スペルの提示を選択すると、以下の選択肢が表示されます。" + +#: C/gedit.xml:2003(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"辞書にないスペルを別のスペルに置き換える場合は、スペルの提示" +"に表示されているスペルを選択してください。" + +#: C/gedit.xml:2006(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"辞書にないスペルを個人の辞書に追加したい場合は、" +"スペルの提示追加を選択してください。" + +#: C/gedit.xml:2009(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"そのスペルについてはスペルチェックの対称から外したいが、個人辞書には追加したくない場合、" +"スペルの提示全て無視を選択してください。" +"ただしこれは、gedit を再起動すると無効になります。" + +#: C/gedit.xml:2014(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"手動でスペルチェックを行う場合は、ツールスペル・チェック" +"を選択します。" + +#: C/gedit.xml:2016(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"スペルミスが発見されなかった場合は、情報ダイアログ" +"に、スペルミスと思われる単語が見つからなかった旨が表示されます。" +"OK をクリックして情報ダイアログ" +"を閉じてください。" + +#: C/gedit.xml:2018(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"スペルミスが発見された場合、スペルチェックダイアログが表示されます。" + +#: C/gedit.xml:2021(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"ダイアログの冒頭にはスペルミスと思われる単語が表示されます。" + +#: C/gedit.xml:2024(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"変更先には、正しいと予想される候補が表示されます。" +"正解の候補リストから別の候補を選択することや、" +"変更先に直接正しいスペルを書き込むこともできます。" + +#: C/gedit.xml:2027(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"変更先に入力したスペルが正しいかどうかを確認するには、" +"単語のチェックをクリックしてください。辞書の単語と一致すれば、" +"正解の候補リストの内容は" +"(正しいつづり)に置き換わります。辞書の単語と一致しなければ、" +"新しい候補が正解の候補リストに表示されます。" + +#: C/gedit.xml:2030(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"現在の単語に対するスペルチェックを無視するには、無視" +"をクリックしてください。同じドキュメント中にある同じ単語全てを無視するには" +"全て無視をクリックしてください。これらの設定は" +" gedit を再起動すると無効になります。" + +#: C/gedit.xml:2033(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"現在、確認している単語のみを変更先の単語に置き換える" +"場合は、変更をクリックします。同じスペルの単語を" +"全て置き換える場合は、全て変更をクリックします。" + +#: C/gedit.xml:2036(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"その不明な単語を個人辞書に追加するには、単語の追加を" +"クリックします。" + +#: C/gedit.xml:2039(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"スペル・チェックダイアログを閉じるには、" +"閉じるをクリックしてください。" + +#: C/gedit.xml:2048(title) +msgid "Tag List Plugin" +msgstr "タグの一覧プラグイン" + +#: C/gedit.xml:2049(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"タグの一覧プラグインを使えば、よく使われるタグがサイド・ペイン" +"に表示され、そこから簡単にドキュメントに挿入できます。" + +#: C/gedit.xml:2050(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "タグの一覧プラグインを使用するには、次の手順を実行します。" + +#: C/gedit.xml:2052(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"表示サイド・ペインを選択します。" + +#: C/gedit.xml:2056(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"初期設定では、サイドペインには開いているファイルの一覧が表示されます。タグの一覧を" +"表示するためには、サイド・ペインの下部にある + アイコンをクリックしてください。" + +#: C/gedit.xml:2058(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"ドロップダウンリストから、適切なタグカテゴリを選択します。例えば、" +"HTML - タグを選択します。" + +#: C/gedit.xml:2061(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "タグの一覧をスクロールして、希望のタグを見つけます。" + +#: C/gedit.xml:2064(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"編集中のドキュメントのカーソル位置にタグを挿入するには、タグの一覧で該当するタグを" +"ダブルクリックします。次の方法でもタグを挿入できます。" + +#: C/gedit.xml:2066(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Enter キーを押せば、タグを挿入し、サイド・ペインから表示領域に戻れます。" + +#: C/gedit.xml:2069(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"ShiftEnter キーを押せば、" +"タグを挿入し、フォーカスはサイド・ペイン上に残ります。" + +#: C/gedit.xml:2078(title) +msgid "User Name Plugin" +msgstr "ユーザ名プラグイン" + +#: C/gedit.xml:2079(para) +msgid "" +"The User name plugin inserts the username of the " +"current user into the document." +msgstr "" +"ユーザ名プラグインはユーザ名を編集中の" +"ドキュメントに挿入します。" + +#: C/gedit.xml:2080(para) +msgid "" +"To insert your username at the cursor position, choose " +"EditInsert User Name." +msgstr "" +"現在のカーソル位置にユーザ名を挿入するには編集ユーザ名の挿入を選択します。" + +#: C/gedit.xml:2082(para) +msgid "" +"This plugin is mostly provided as an example of how to create your own " +"plugins. For more information on creating plugins, see the gedit website." +msgstr "" +"このプラグインは、新規にプラグインを作成するための例として提供されています。" +"プラグインの作成方法については、gedit のウェブサイトを参照してください。" + + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "柴田 充也 , 2008" + + diff --git a/help/ko/figures/gedit_window.png b/help/ko/figures/gedit_window.png new file mode 100755 index 00000000..3d8368c2 Binary files /dev/null and b/help/ko/figures/gedit_window.png differ diff --git a/help/ko/ko.po b/help/ko/ko.po new file mode 100755 index 00000000..e4953bcd --- /dev/null +++ b/help/ko/ko.po @@ -0,0 +1,4399 @@ +# Sun Microsystems, 2002. +# Changwoo Ryu , 2007, 2008, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit-help\n" +"POT-Creation-Date: 2008-02-01 21:04+0000\n" +"PO-Revision-Date: 2010-04-16 01:32+0900\n" +"Last-Translator: Changwoo Ryu \n" +"Language-Team: MATE Korea \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"본 설명서는 프리 소프트웨어 재단(FSF)에서 발행한 GNU 자유 문서 라이센스" +"(GFDL) 버전 1.1 이상의 조항에 따라 변경 불가 부분, 앞 표지 텍스트 및 뒷 표지 " +"텍스트를 제외하고 복사, 수정 및/또는 배포할 수 있습니다. GFDL의 사본은 " +"링크 또는 본 설명서와 함께 배" +"포된 COPYING-DOCS 파일에서 찾을 수 있습니다." + +#: 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 "" +"본 설명서는 GFDL에 따라 배포된 그놈 설명서 컬렉션의 일부입니다. 본 설명서를 " +"컬렉션과 별도로 배포하려는 경우에는 라이센스 조항 6에 따라 라이센스 사본을 설" +"명서에 추가하면 됩니다." + +#: 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 "" +"기업의 제품과 서비스를 식별하기 위해 사용된 많은 이름은 상표로 간주됩니다. 그" +"놈 문서에 사용된 이름과 그놈 문서 프로젝트의 구성원은 해당 상표로, 모두 대문" +"자로 표시되거나 첫 글자가 대문자로 표시되어 있습니다." + +#: 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 " +"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/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: " +"" +msgstr "" +"문서 및 수정판은 다음 GNU 자유 문서 라이센스의 조항에 따라 제공됩니다. " +"" + +#. 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/gedit.xml:266(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:347(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#. 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/gedit.xml:1273(None) +msgid "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" +msgstr "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" + +#. 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/gedit.xml:1292(None) +msgid "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" +msgstr "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" + +#. 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/gedit.xml:1310(None) +msgid "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" +msgstr "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#. 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/gedit.xml:1328(None) +msgid "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" +msgstr "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "gedit 설명서" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "그놈 문서 프로젝트" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "키보드 바로 가기 표 추가" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java Desktop System Documentation Team" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek가 이전 버전의 gedit 응용 프로그램의 정보를 알려주었습니다." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "도음 주신 분들" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George가 플러그인에 관한 정보를 알려주었습니다." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit 버전 1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit 설명서 버전 2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "2002년 3월" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun 그놈 문서 팀" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit 설명서 버전 2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "2002년 6월" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit 설명서 버전 2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "2002년 8월" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit 설명서 버전 2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "2002년 9월" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit 설명서 버전 2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "2003년 1월" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit 설명서 버전 2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "2003년 3월" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "gedit 설명서 버전 2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "2003 9월" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "gedit 설명서 버전 2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "2004 3월" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "gedit 설명서 버전 2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "2006년 6월" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "gedit 설명서 버전 2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "그놈 문서 팀" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "이 설명서는 gedit 버전 2.16에 대해 설명합니다." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "피드백" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"gedit 또는 이 설명서에 대한 버그를 알려 주시거나 " +"의견을 제시하려면 그놈 피드백 페이지에 있는 대로 해 주십시오." + +#: C/gedit.xml:213(para) +msgid "gedit is the MATE text editor." +msgstr "gedit는 그놈 텍스트 편집기입니다." + +#: C/gedit.xml:216(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:217(primary) +msgid "text editor" +msgstr "텍스트 편집기" + +#: C/gedit.xml:222(title) +msgid "Introduction" +msgstr "소개" + +#: C/gedit.xml:227(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"gedit 응용 프로그램으로 텍스트 파일을 만들고 편집" +"할 수 있습니다." + +#: C/gedit.xml:229(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"gedit의 목표는 간단하고 사용하기 쉬운 텍스트 편집" +"기입니다. 플러그인을 사용해 더 강력한 기능을 사용할 " +"수 있습니다. 플러그인에 텍스트 편집과 관련된 여러가지 기능이 들어 있습니다." + +#: C/gedit.xml:233(title) +msgid "Getting Started" +msgstr "시작하기" + +#: C/gedit.xml:237(title) +msgid "Starting gedit" +msgstr "gedit 시작하기" + +#: C/gedit.xml:238(para) +msgid "You can start gedit in the following ways:" +msgstr "다음 방법으로 gedit를 시작할 수 있습니다:" + +#: C/gedit.xml:241(term) +msgid "Applications menu" +msgstr "프로그램 메뉴" + +#: C/gedit.xml:243(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"보조 프로그램텍스트 편집기" +"를 선택하십시오." + +#: C/gedit.xml:247(term) +msgid "Command line" +msgstr "명령행" + +#: C/gedit.xml:249(para) +msgid "Execute the following command: gedit" +msgstr "다음 명령을 실행합니다: gedit" + +#: C/gedit.xml:253(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"기본값으로, 파일 관리자에서 텍스트 문서를 열면 gedit가 시작하고 그 문서를 표" +"시합니다." + +#: C/gedit.xml:258(title) +msgid "The gedit Window" +msgstr "gedit 창" + +#: C/gedit.xml:259(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "gedit를 시작하면 다음 창이 나타납니다:" + +#: C/gedit.xml:262(title) +msgid "gedit Window" +msgstr "gedit 창" + +#: C/gedit.xml:268(phrase) +msgid "Shows gedit main window." +msgstr "gedit 메인 창을 표시합니다." + +#: C/gedit.xml:274(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "gedit 창에는 다음이 들어 있습니다:" + +#: C/gedit.xml:277(term) +msgid "Menubar" +msgstr "메뉴 모음" + +#: C/gedit.xml:279(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"메뉴 모음의 메뉴에는 gedit에서 파일 작업을 하는 " +"데 필요한 명령이 모두 들어있습니다." + +#: C/gedit.xml:282(term) +msgid "Toolbar" +msgstr "도구 모음" + +#: C/gedit.xml:284(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"도구 모음에는 메뉴 모음에서 접근할 수 있는 명령의 일부가 들어 있습니다." + +#: C/gedit.xml:287(term) +msgid "Display area" +msgstr "표시 영역" + +#: C/gedit.xml:289(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "표시 영역에는 편집하고 있는 파일의 텍스트가 들어있습니다." + +#: C/gedit.xml:292(term) +msgid "Statusbar" +msgstr "상태 표시줄" + +#: C/gedit.xml:294(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"상태 표시줄에는 현재 gedit 동작에 대한 정보와 메" +"뉴 항목의 컨텍스트 정보를 표시합니다. 상태 표시줄에는 다음 정보도 표시합니다:" + +#: C/gedit.xml:297(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "커서 위치: 커서가 있는 곳의 줄 번호와 열 번호." + +#: C/gedit.xml:300(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"편집 모드: 편집기가 삽입 모드인 경우, 상태 표시줄에 삽입" +"이라는 글이 들어 있습니다. 덮어쓰기 모드인 경우, 상태 표시줄에 바꿈" +"이라는 글이 들어 있습니다. 편집 모드를 바꾸려면 Insert 키를 누르십시오." + +#: C/gedit.xml:305(term) +msgid "Side Pane" +msgstr "가장자리 창" + +#: C/gedit.xml:307(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"가장자리 창에는 열린 문서의 목록을 표시하고, 또 어떤 플러그인을 사용하느냐에 " +"따라 기타 정보를 표시합니다." + +#: C/gedit.xml:308(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"기본값으로 가장자리 창은 표시하지 않습니다. 가장자리 창을 보려면, " +"보기가장자리 창을 선택하십시오." + +#: C/gedit.xml:311(term) +msgid "Bottom Pane" +msgstr "아래 창" + +#: C/gedit.xml:313(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "아래 창은 파이썬 콘솔 플러그인에서 출력을 표시할 때처럼 프로그래밍 도구에 사용합니다." + +#: C/gedit.xml:314(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "기본값으로 아래 창은 표시하지 않습니다. 아래 창을 보려면, 보기아래 창을 선택하십시오." + +#: C/gedit.xml:318(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"gedit 창에 마우스 오른쪽 단추를 누르면, 팝업 메뉴" +"를 표시합니다. 이 팝업 메뉴에 자주 사용하는 텍스트 편집 명령이 들어 있습니다." + +#: C/gedit.xml:320(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"다른 그놈 프로그램과 마찬가지로, gedit 동작은 여러" +"가지 방법으로 할 수 있습니다. 메뉴로도 할 수 있고, 도구 모음으로도 할 수 있" +"고, 바로 가기 키로도 할 수 있습니다. 모든 응용 프로그램에서 공통으로 사용할 " +"수 있는 바로 가기 키 목록이 사용자 안내서에 있습니다." + +#: C/gedit.xml:325(title) +msgid "Running gedit from a Command Line" +msgstr "명령행에서 gedit 실행하기" + +#: C/gedit.xml:326(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "명령행에서 gedit를 실행해서 파일 한 개 혹은 여러 개를 열 수 있습니다. 명령행에서 여러 개 파일을 열려면, 다음 명령어를 입력하고 Return 키를 누르십시오:" + +#: C/gedit.xml:327(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: C/gedit.xml:327(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:328(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "다른 방법으로, 파일 이름 대신에 URI를 지정할 수도 있습니다." + +#: C/gedit.xml:329(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"명령행에서 gedit 실행하는 방법에 대해 좀 더 알고 " +"싶으시면, geidt의 유닉스 맨 페이지를 (gedit1.) 참고하십시오." + +#: C/gedit.xml:334(title) +msgid "Working with Files" +msgstr "파일 작업하기" + +#: C/gedit.xml:338(title) +msgid "Creating a New Document" +msgstr "새 문서 만들기" + +#: C/gedit.xml:339(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"새 문서를 만드려면, 파일새로 만들" +"기를 선택하십시오. gedit 창에 비어 있는 새 문서를 표시합니다." + +#: C/gedit.xml:344(title) C/gedit.xml:1674(title) +msgid "Opening a File" +msgstr "파일 열기" + +#: C/gedit.xml:345(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"파일을 열려면, 파일열기를 선택해 파일 열기 대화 상자" +"를 표시합니다. 열려는 파일을 선택하고 확인을 누르십시" +"오. 해당 파일이 gedit 창에 표시됩니다." + +#: C/gedit.xml:347(phrase) +msgid "Shows Recent Files menu icon." +msgstr "최근 파일 메뉴 아이콘 보기." + +#: C/gedit.xml:347(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"응용 프로그램은 가장 최근에 편집한 파일을 5개까지 그 경로와 파일 이름을 기록" +"해 두고 있고, 그 파일을 파일 메뉴" +"의 메뉴 항목으로 표시합니다. 최근 파일 목록을 표시하려면 도구 모음의 " +" 아이콘을 눌러도 됩니다." + +#: C/gedit.xml:349(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"gedit에 여러 개의 파일을 열 수 있습니다. 파일을 하" +"나씩 열 때마다 창에 탭을 하나씩 추가합니다. 좀 더 알고 싶으시면, 부분을 참고하십시오." + +#: C/gedit.xml:355(title) +msgid "Saving a File" +msgstr "파일 저장하기" + +#: C/gedit.xml:356(para) +msgid "You can save files in the following ways:" +msgstr "다음 방법으로 파일을 저장할 수 있습니다:" + +#: C/gedit.xml:358(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"기존 파일의 바뀐 사항을 저장하려면 파일저장을 선택하십시오." + +#: C/gedit.xml:360(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"새 파일을 저장하거나 기존 파일을 다른 이름으로 저장하려면 " +"파일다른 이름으로 저장을 선택하십시오. 다른 이름으로 저장 대화 상자에서 파일 이름을 입력하고 확인을 누" +"르십시오." + +#: C/gedit.xml:362(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"현재 gedit에 열려 있는 파일을 모두 저장하려면 " +"문서모두 저장을 선택하십시오." + +#: C/gedit.xml:365(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"현재 gedit에 열려 있는 파일을 모두 닫으려면, " +"문서모두 닫기를 선택하십시오." + +#: C/gedit.xml:370(title) +msgid "Opening a File from a URI" +msgstr "URI에서 파일 열기" + +#: C/gedit.xml:371(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"URI(Uniform Resource Identifier)에서 파일을 열려면, 다음 순서대로 하십시오:" + +#: C/gedit.xml:374(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"파일위치 열기를 선택해 위치 열기 대화 상자를 표시합니다." + +#: C/gedit.xml:377(para) +msgid "Enter the URI of the file that you want to open." +msgstr "열려는 파일의 URI를 입력하십시오." + +#: C/gedit.xml:380(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"문자 코딩 드롭다운 목록에서 적당한 문자 코딩을 선택하십" +"시오." + +#: C/gedit.xml:383(para) +msgid "Click Open." +msgstr "열기를 누르십시오." + +#: C/gedit.xml:386(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"올바른 형식의 URIhttp:, " +"ftp:, file:mate-vfs에서 지원하는 모든 프로토콜을 사용할 수 있습니다." + +#: C/gedit.xml:387(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"어떤 종류의 URI의 경우 파일이 읽기 전용으로 열려서, 파일을 편집하면 다른 위치" +"에 저장해야 합니다. HTTP는 파일 읽기만 가능합니다. 모든 FTP 서버가 원격 파일 " +"저장을 할 수 있는 게 아니기 때문에 FTP로 연 파일도 읽기 전용입니다." + +#: C/gedit.xml:388(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"FTP 서버로 저장하는 기능은 설정 편집기로 저장할 수 있게 바꿀 수 있" +"습니다. /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes키를 설정하면 되지만, 이 기능때문에 오류가 " +"발생할 수도 있습니다." + +#: C/gedit.xml:393(title) +msgid "Working With Tabs" +msgstr "탭 작업하기" + +#: C/gedit.xml:395(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"여러 개 파일을 연 경우, gedit의 표시 영역 위에 문" +"서 하나마다 탭을 하나씩 표시합니다. 다른 문서로 이동하려면, 해당하는 탭을 누" +"르십시오." + +#: C/gedit.xml:396(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"문서를 다른 gedit 창으로 옮기려면, 그 파일에 해당" +"하는 탭을 옮기려는 창으로 끌어 놓으십시오." + +#: C/gedit.xml:397(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"문서를 새 gedit 창으로 옮기려면, 탭을 바탕 화면으" +"로 끌어 놓거나, 문서새 창으로 옮" +"기기를 선택하십시오." + +#: C/gedit.xml:403(title) +msgid "Working with Text" +msgstr "텍스트 작업하기" + +#: C/gedit.xml:407(title) +msgid "Editing Text" +msgstr "텍스트 편집하기" + +#: C/gedit.xml:408(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "다음 방법으로 파일의 텍스트를 편집할 수 있습니다:" + +#: C/gedit.xml:410(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"키보드로 새 텍스트를 입력하십시오. 깜박이는 삽입 커서" +"가 새 텍스트를 표시할 위치를 가리킵니다. 위치를 바꾸려면 키보드의 화살표 키" +"를 사용하거나 마우스 단추를 누르십시오." + +#: C/gedit.xml:412(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"선택한 텍스트를 클립보드에 복사하려면 편집복사를 선택하십시오." + +#: C/gedit.xml:414(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"선택한 텍스트를 파일에서 지우고 그 텍스트를 클립보드로 옮기려면 " +"편집잘라내기를 선택하십시오." + +#: C/gedit.xml:416(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"선택한 텍스트를 파일에서 완전히 지우려면 편집지우기를 선택하십시오." + +#: C/gedit.xml:418(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"클리보드의 내용을 커서 위치에 넣으려면 편집붙여 넣기를 선택하십시오. 붙" +"여 넣기 전에, gedit나 다른 응용 프로그램에서 텍스트를 잘라내거나 복사해야 합" +"니다." + +#: C/gedit.xml:420(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"파일의 텍스트를 모두 선택하려면, 편집모두 선택을 선택하십시오." + +#: C/gedit.xml:426(title) +msgid "Undoing and Redoing Changes" +msgstr "편집한 내용을 취소하거나 다시 실행하려면" + +#: C/gedit.xml:427(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "편집한 사항을 실행 취소하려면, 편집실행 취소를 선택하십시오. 이 동작을 되돌리려면, 편집다시 실행을 선택하십시오." + +#: C/gedit.xml:432(title) +msgid "Finding and Replacing" +msgstr "찾기 및 바꾸기" + +#: C/gedit.xml:434(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"gedit에서 텍스트를 찾는 방법은 두 가지가 있습니" +"다. 찾기 대화 창을 사용해 특정 텍스트를 찾아 볼 수 있" +"고, 바로 찾기를 사용해 입력하는 텍스트에 맞는 글자를 강" +"조할 수 있습니다." + +#: C/gedit.xml:439(title) +msgid "Finding Text" +msgstr "텍스트 찾기" + +#: C/gedit.xml:440(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "파일에서 텍스트 문자열을 찾으려면, 다음 순서대로 하십시오:" + +#: C/gedit.xml:442(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"찾기찾기를 선택하십시오. 찾기 대화 상자를 표시합니다." + +#: C/gedit.xml:444(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"찾으려는 문자열을 찾을 문자열 입력란에 입력하십시오. 줄" +"바꿈이나 탭 문자같은 특수 문자를 넣을 수도 있습니다. 부분을 참고하십시오." + +#: C/gedit.xml:446(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"찾기를 눌러 파일에서 현재 커서 위치 뒤로 그 스트링이 " +"첫번째로 나오는 위치를 찾습니다. 그 문자열을 찾고, 첫번째로 나오는 문자열을 " +"선택합니다. 그 외에 그 문자열이 있으면 강조합니다." + +#: C/gedit.xml:448(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"그 다음에 있는 문자열을 찾으려면, 찾기를 누르거나 " +"찾기다음 찾기를 선택하십시오. 그 이전에 있는 문자열을 찾으려면, " +"찾기이전 찾기를 선택하십시오." + +#: C/gedit.xml:451(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"찾기 대화 창을 닫은 다음에도, 찾기" +"다음 찾기 및 " +"찾기이전 찾기를 선택해서 다른 곳에 있는 같은 텍스트를 선택할 수 있습니다." + +#: C/gedit.xml:452(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "텍스트의 강조를 지우려면, 찾기강조 지우기를 선택하십시오." + +#: C/gedit.xml:456(title) +msgid "Incremental Search" +msgstr "바로 찾기" + +#: C/gedit.xml:458(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"바로 찾기에서는 한 글자를 입력할 때마다 문서에 그에 해당하는 텍스트를 강조합" +"니다. (이 기능은 몇 가지 웹 브라우저의 찾기 기능과 비슷합니다.)" + +#: C/gedit.xml:459(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"바로 찾기를 시작하려면, 찾기바로 " +"찾기를 선택하십시오. 찾기 입력란이 표시 영역 위에 " +"나타납니다." + +#: C/gedit.xml:460(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"입력을 시작하십시오. 그러면 문서 안에 해당하는 텍스트를 강조합니다. 또 커서 " +"위치 다음에 처음으로 나오는 텍스트를 선택합니다." + +#: C/gedit.xml:461(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "바로 찾기 입력란이 열린 상태로, 다음 위치에 있는 텍스트로 선택을 옮기려면, CtrlG 키를 누르십시오. 이전 위치에 있는 텍스트로 돌아가려면 CtrlShiftG 키를 누르십시오." + +#: C/gedit.xml:462(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"위 아래 화살표 키를 사용하거나 마우스 휠을 사용해서 일치하는 문자열의 선택을 " +"옮길 수도 있습니다." + +#: C/gedit.xml:467(title) +msgid "Replacing Text" +msgstr "텍스트 바꾸기" + +#: C/gedit.xml:469(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"파일에서 문자열을 찾고 그 문자열을 다른 문자열로 바꾸려면, 다음 순서대로 하십" +"시오:" + +#: C/gedit.xml:471(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"찾기바꾸기를 선택하십시오. 바꾸기 대화 창이 나타납니다." + +#: C/gedit.xml:473(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"찾으려는 문자열을 찾을 문자열 입력란에 입력하십시오. 줄" +"바꿈이나 탭 문자같은 특수 문자를 넣을 수도 있습니다. 부분을 참고하십시오." + +#: C/gedit.xml:474(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"찾은 문자열을 바꿀 문자열을 바꿀 문자열 입력란에 입력하" +"십시오." + +#: C/gedit.xml:478(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"바꾸기 전에 바꿀 문자열을 살펴보려면, 찾기를 누르십시" +"오. 그 문자열을 찾으면, 문자열이 선택됩니다. 바꾸기를 " +"누르면 선택한 문자열을 바꿉니다. 다음에 나오는 문자열을 찾아보려면 " +"찾기를 다시 한번 누르십시오." + +#: C/gedit.xml:479(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "문서에 있는 그 문자열을 모두 바꾸려면 모두 바꾸기를 누르십시오." + +#: C/gedit.xml:484(title) +msgid "Find and Replace Options" +msgstr "찾기 및 바꾸기 옵션" + +#: C/gedit.xml:485(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"찾기 대화 창과 바꾸기 대화 창에는 " +"모두 다음 옵션이 들어 있습니다:" + +#: C/gedit.xml:487(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"대소문자 일치 옵션을 선택하면 입력하는 텍스트의 대소문자" +"가 일치하는 문자열만 찾습니다. 예를 들어 대소문자 일치" +"를 선택하면, 대문자 \"TEXT\"는 소문자 \"text\"를 찾지 않습니다." + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"전체가 맞는 단어만 옵션을 사용하면 입력한 텍스트와 전체 " +"단어가 맞는 문자열만 찾습니다. 예를 들어 전체가 맞는 단어만 옵션을 선택하면, \"text\"는 \"texture\"를 찾지 않습니다." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"뒤로 찾기 옵션을 선택하면 뒤 방향으로 문서의 처음까지 찾" +"습니다." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"끝까지 가면 처음부터 옵션을 선택하면 문서의 끝까지 찾았" +"을 때 다시 파일의 반대쪽 끝에서부터 찾기를 계속합니다." + +#: C/gedit.xml:500(title) +msgid "Special Characters" +msgstr "특수 문자" + +#: C/gedit.xml:501(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"찾기나 바꾸기를 할 때 다음 이스케이프 시퀀스를 이용해 특수 문자를 입력할 수 " +"있습니다:" + +#: C/gedit.xml:504(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:506(para) +msgid "Specifies a new line." +msgstr "줄바꿈을 나타냅니다." + +#: C/gedit.xml:510(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:512(para) +msgid "Specifies a tab character." +msgstr "탭 문자를 나타냅니다." + +#: C/gedit.xml:516(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:518(para) +msgid "Specifies a carriage return." +msgstr "캐리지 리턴을 나타냅니다." + +#: C/gedit.xml:526(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "커서를 특정 줄로 옮기기" + +#: C/gedit.xml:528(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "현재 파일의 특정 줄로 커서를 옮기려면, 찾기줄로 이동을 선택하십시오. 줄 번호 입력 창이 표시 영역 위에 나타납니다." + +#: C/gedit.xml:529(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "커서를 옮기려는 줄 번호를 입력하면 문서를 지정한 줄로 스크롤합니다." + +#: C/gedit.xml:530(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "대화 상자를 닫고 커서를 지정한 줄로 옮기려면, Return 키를 누르십시오." + +#: C/gedit.xml:536(title) +msgid "Printing" +msgstr "인쇄하기" + +#: C/gedit.xml:540(title) +msgid "Setting the Page Options" +msgstr "페이지 옵션 설정하기" + +#: C/gedit.xml:542(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"페이지 옵션을 설정하려면, 파일페" +"이지 설정을 선택하십시오. 페이지 설정 대화 창이 나타납니다." + +#: C/gedit.xml:544(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"페이지 설정 대화 창에서 다음 인쇄 옵션을 지정할 수 있습" +"니다:" + +#: C/gedit.xml:547(title) +msgid "General Tabbed Section" +msgstr "일반 탭 섹션" + +#: C/gedit.xml:549(guilabel) +msgid "Print syntax highlighting" +msgstr "구문 강조 인쇄" + +#: C/gedit.xml:551(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"이 옵션을 선택하면 구문 강조를 인쇄합니다. 구문 강조에 대해 좀 더 알고 싶으시" +"면, 부분을 참고하십시오." + +#: C/gedit.xml:554(guilabel) +msgid "Print page headers" +msgstr "글머리 인쇄" + +#: C/gedit.xml:556(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"이 옵션을 선택하면 인쇄하는 페이지마다 글머리를 붙입니다. 글머리 내용을 설정" +"할 수는 없습니다." + +#: C/gedit.xml:559(guilabel) C/gedit.xml:1162(guilabel) +msgid "Line Numbers" +msgstr "줄 번호" + +#: C/gedit.xml:562(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"줄 번호 인쇄 옵션을 선택하면 파일을 인쇄할 때 줄 번호를 " +"붙입니다." + +#: C/gedit.xml:563(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"다음 줄마다 줄 번호: ... 줄 스핀 상자로 몇 줄마다 줄 번" +"호를 인쇄할 지 지정합니다. 예를 들어 5줄 마다 할 수도 있고, 10줄 마다 할 수" +"도 있고, ... 식으로 할 수 있습니다." + +#: C/gedit.xml:566(guilabel) C/gedit.xml:1155(guilabel) C/gedit.xml:1770(para) +msgid "Text Wrapping" +msgstr "텍스트 줄 바꿈" + +#: C/gedit.xml:568(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"줄 바꿈 사용 옵션을 선택하면, 파일을 인쇄할 때 긴 줄을 " +"문자 단위로 다음 줄로 바꿉니다. 줄 번호를 지정할 때는 이렇게 넘어가서 바뀐 " +"긴 줄은 한 줄로 취급합니다." + +#: C/gedit.xml:570(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"단어를 여러 줄로 나누지 않기 옵션을 선택하면, 파일을 인" +"쇄할 때 긴 줄을 단어 단위로 다음 줄로 바꿉니다." + +#: C/gedit.xml:578(title) +msgid "Fonts" +msgstr "글꼴" + +#: C/gedit.xml:580(guilabel) +msgid "Body" +msgstr "본문" + +#: C/gedit.xml:582(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "파일의 본문을 인쇄할 때 사용할 글꼴을 지정하려면 이 단추를 누르십시오." + +#: C/gedit.xml:585(guilabel) +msgid "Line numbers" +msgstr "줄 번호" + +#: C/gedit.xml:588(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "줄 번호를 인쇄할 때 사용할 글꼴을 지정하려면 이 단추를 누르십시오." + +#: C/gedit.xml:591(guilabel) +msgid "Headers and footers" +msgstr "글머리 및 글꼬리" + +#: C/gedit.xml:593(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"파일의 글머리 및 글꼬리를 인쇄할 때 사용할 글꼴을 지정하려면 이 단추를 누르십" +"시오." + +#: C/gedit.xml:597(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"파일 인쇄할 때 사용할 글꼴을 기본값 글꼴로 리셋하려면, 기본 글꼴" +"로 되돌리기를 누르십시오." + +#: C/gedit.xml:604(title) +msgid "Printing a Document" +msgstr "문서 인쇄하기" + +#: C/gedit.xml:605(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"gedit을 사용해 다음 인쇄 작업을 할 수 있습니다:" + +#: C/gedit.xml:607(para) +msgid "Print a document to a printer." +msgstr "문서를 프린터로 인쇄합니다." + +#: C/gedit.xml:609(para) +msgid "Print the output of the print command to a file." +msgstr "인쇄 명령의 결과를 파일로 인쇄합니다." + +#: C/gedit.xml:612(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"파일로 인쇄하는 경우 파일의 출력물을 인쇄용 파일 형식의 파일로 만듭니다. 가" +"장 일반적인 인쇄용 파일 형식은 PostScript와 PDF(Portable Document Format)입" +"니다." + +#: C/gedit.xml:614(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"인쇄하려는 페이지를 미리 보려면 파일인쇄 미리 보기를 선택하십시" +"오." + +#: C/gedit.xml:616(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"현재 파일을 프린터나 파일로 인쇄하려면 파일인쇄를 선택하십시오. " +"인쇄 대화 상자가 나타납니다." + +#: C/gedit.xml:618(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"인쇄 대화 상자에서 다음 인쇄 옵션을 지정할 수 있습니다:" + +#: C/gedit.xml:621(title) +msgid "Job Tabbed Section" +msgstr "작업 탭 섹션" + +#: C/gedit.xml:623(guilabel) +msgid "Print range" +msgstr "인쇄 범위" + +#: C/gedit.xml:625(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "다음 옵션 중 하나로 인쇄할 페이지 수를 지정합니다:" + +#: C/gedit.xml:628(guilabel) +msgid "All" +msgstr "모두" + +#: C/gedit.xml:629(para) +msgid "Select this option to print all of the pages in the file." +msgstr "파일의 모든 페이지를 인쇄하려면 이 옵션을 선택하십시오." + +#: C/gedit.xml:632(guilabel) +msgid "Lines" +msgstr "줄" + +#: C/gedit.xml:633(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"지정한 줄만 인쇄하려면 이 옵션을 선택하십시오. 시작과 " +" 스핀 상자에서 줄 범위를 지정하십시오." + +#: C/gedit.xml:636(guilabel) +msgid "Selection" +msgstr "선택" + +#: C/gedit.xml:637(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"선택된 텍스트만 인쇄하려면 이 옵션을 선택하십시오. 이 옵션은 선택한 텍스트가 " +"있는 경우에만 사용할 수 있습니다." + +#: C/gedit.xml:643(guilabel) +msgid "Copies" +msgstr "매수" + +#: C/gedit.xml:645(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"인쇄 매수 스핀 상자를 사용해 파일을 몇 매 인쇄할 지 지정" +"합니다." + +#: C/gedit.xml:646(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"파일을 여러 매 인쇄하는 경우, 순서 맞추기 옵션으로 인쇄" +"물의 순서를 맞출 수 있습니다." + +#: C/gedit.xml:653(title) +msgid "Printer Tabbed Section" +msgstr "프린터 탭 섹션" + +#: C/gedit.xml:655(guilabel) +msgid "Printer" +msgstr "프린터" + +#: C/gedit.xml:657(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "이 드롭다운 목록에서 파일을 어떤 프린터로 인쇄할 지 선택하십시오." + +#: C/gedit.xml:660(guilabel) +msgid "Settings" +msgstr "설정" + +#: C/gedit.xml:662(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "이 드롭다운 목록에서 프린터 설정을 지정하십시오." + +#: C/gedit.xml:664(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"프린터를 설정하려면, 설정을 누르십시오. 예를 들어 프린" +"터가 지원하는 기능에 따라서 양면 인쇄 사용 여부를 설정할 수도 있고, 일정 시" +"간 뒤에 인쇄를 할 수도 있습니다." + +#: C/gedit.xml:668(guilabel) +msgid "Location" +msgstr "위치" + +#: C/gedit.xml:670(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "이 드롭다운 목록에서 다음 인쇄 대상 중의 하나를 선택하십시오:" + +#: C/gedit.xml:675(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:677(para) +msgid "Print the file to a CUPS printer." +msgstr "파일을 CUPS 프린터로 인쇄합니다." + +#: C/gedit.xml:681(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"선택한 프린터가 CUPS 프린터인 경우, 이 드롭다운 목록에는 CUPS만 들어 있습니다." + +#: C/gedit.xml:688(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:690(para) +msgid "Print the file to a printer." +msgstr "파일을 프린터로 인쇄합니다." + +#: C/gedit.xml:696(guilabel) +msgid "File" +msgstr "파일" + +#: C/gedit.xml:698(para) +msgid "Print the file to a PostScript file." +msgstr "파일을 PostScript 파일로 인쇄합니다." + +#: C/gedit.xml:701(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"다른 이름으로 저장을 누르면 PostScript 파일의 경로와 " +"이름을 지정하는 대화 창이 나타납니다." + +#: C/gedit.xml:707(guilabel) +msgid "Custom" +msgstr "사용자 지정" + +#: C/gedit.xml:709(para) +msgid "Use the specified command to print the file." +msgstr "지정한 명령어를 이용해 파일을 인쇄합니다." + +#: C/gedit.xml:712(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"텍스트 입력란에서 명령어의 이름을 입력하십시오. 명령행 인자를 모두 입력하십시" +"오." + +#: C/gedit.xml:720(guilabel) +msgid "State" +msgstr "상태" + +#: C/gedit.xml:722(para) C/gedit.xml:728(para) C/gedit.xml:734(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "이 기능은 이 버전의 gedit가 지원하지 않습니다." + +#: C/gedit.xml:726(guilabel) +msgid "Type" +msgstr "형식" + +#: C/gedit.xml:732(guilabel) +msgid "Comment" +msgstr "설명" + +#: C/gedit.xml:742(title) +msgid "Paper Tabbed Section" +msgstr "용지 탭 섹션" + +#: C/gedit.xml:744(guilabel) +msgid "Paper size" +msgstr "용지 크기" + +#: C/gedit.xml:746(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "이 드롭다운 목록을 사용해 파일을 인쇄할 용지의 크기를 선택하십시오." + +#: C/gedit.xml:749(guilabel) +msgid "Width" +msgstr "너비" + +#: C/gedit.xml:751(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"이 스핀 상자를 사용해 용지 너비를 지정하십시오. 옆에 있는 드롭다운 목록으로 " +"크기의 단위를 바꿀 수 있습니다." + +#: C/gedit.xml:754(guilabel) +msgid "Height" +msgstr "높이" + +#: C/gedit.xml:756(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "이 스핀 상자를 사용해 용지의 높이를 지정하십시오." + +#: C/gedit.xml:759(guilabel) +msgid "Feed orientation" +msgstr "용지 보급 방향" + +#: C/gedit.xml:761(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "이 드롭다운 목록을 사용해 프린터의 용지 방향을 선택합니다." + +#: C/gedit.xml:764(guilabel) +msgid "Page orientation" +msgstr "페이지 방향" + +#: C/gedit.xml:766(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "이 드롭다운 목록을 사용해 페이지 방향을 선택하십시오." + +#: C/gedit.xml:769(guilabel) +msgid "Layout" +msgstr "배치" + +#: C/gedit.xml:771(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"이 드롭다운 목록을 사용해 페이지 레이아웃을 선택하십시오. 선택한 각 레이아웃" +"의 미리 보기를 미리 보기 영역에 표시합니다." + +#: C/gedit.xml:774(guilabel) +msgid "Paper tray" +msgstr "용지 트레이" + +#: C/gedit.xml:776(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "이 드롭다운 목록을 사용해 용지 트레이를 선택하십시오." + +#: C/gedit.xml:787(title) +msgid "Programming Features" +msgstr "프로그래밍 기능" + +#: C/gedit.xml:789(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"gedit의 프로그래밍을 위한 몇 가지 기능이 플러그인" +"에 들어 있습니다. 예를 들어 태그 목록 플러그인에는 여러가지 마크업 언어에서 " +"많이 사용하는 태그 목록이 들어 있습니다. 부분을 참고하십시오." + +#: C/gedit.xml:793(title) +msgid "Syntax Highlighting" +msgstr "구문 강조" + +#: C/gedit.xml:794(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"구문 강조를 사용하면 텍스트를 각 부분마다 다른 색으로 표시해서 소스 코드를 읽" +"기 쉽게 만듭니다." + +#: C/gedit.xml:796(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"문서의 형식에 따라 거기에 맞는 구문 강조 모드를 자동으로 선택합니다. 구문 강" +"조 모드를 강제로 바꾸려면, 보기강" +"조 모드를 선택해, 다음 메뉴 항목 중의 하나를 고르" +"십시오:" + +# FIXME: "None" in the program +#: C/gedit.xml:799(guimenuitem) +msgid "Normal" +msgstr "보통" + +#: C/gedit.xml:801(para) +msgid "Do not display any syntax highlighting." +msgstr "구문 강조를 표시하지 않습니다." + +#: C/gedit.xml:805(guisubmenu) +msgid "Sources" +msgstr "소스" + +#: C/gedit.xml:807(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"소스 코드를 편집할 때 구문 강조를 표시합니다. 소스 " +"서브메뉴에서 소스 코드의 종류를 선택하십시오." + +#: C/gedit.xml:811(guisubmenu) +msgid "Markup" +msgstr "마크업" + +#: C/gedit.xml:813(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"마크업 코드를 편집할 때 구문 강조를 표시합니다. 마크업 서브메뉴에서 마크어 코드의 종류를 선택하십시오." + +#: C/gedit.xml:817(guisubmenu) +msgid "Scripts" +msgstr "스크립트" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"스크립트 코드를 편집할 때 구문 강조를 표시합니다. 스크립트 서브메뉴에서 스크립트 코드의 종류를 선택하십시오." + +#: C/gedit.xml:823(guisubmenu) +msgid "Others" +msgstr "기타" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"기타 형식의 코드를 편집할 때 구문 강조를 표시합니다. 기타 서브메뉴에서 기타 코드의 종류를 선택하십시오." + +#: C/gedit.xml:829(para) +msgid "" +"For more information about how to configure syntax highlighting, see ." +msgstr "" +"구문 분석을 설정하는 방법에 대해 좀 더 알고 싶으시면, 부분을 참고하십시오." + +#: C/gedit.xml:835(title) +msgid "Piping the Output of a Command to a File" +msgstr "명령어 출력을 파일로 돌려 넣기" + +#: C/gedit.xml:836(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "gedit를 사용해 어떤 명령어의 출력을 텍스트 파일로 돌려 넣을 수 있습니다. 예를 들어 ls 명령의 출력을 텍스트 파일로 돌려 넣으려면, ls | gedit라고 입력하고 Return 키를 누르십시오." + +#: C/gedit.xml:837(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"gedit 창에서 ls 명령의 출력을 " +"새 텍스트 파일로 표시합니다." + +#: C/gedit.xml:838(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"다른 방법으로, 외부 도구 플러그인을 사용해 명령어 " +"출력을 현재 파일로 돌려 넣을 수 있습니다." + +#: C/gedit.xml:844(title) +msgid "Shortcut Keys" +msgstr "바로 가기 키" + +#: C/gedit.xml:845(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"바로 가기 키를 사용하면 마우스나 메뉴보다 더 빠르게 많이 사용하는 작업을 할 " +"수 있습니다. 다음 표에 gedit의 모든 바로 가기 키" +"의 목록이 있습니다." + +#: C/gedit.xml:846(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"바로 가기 키에 대해 좀 더 알고 싶으시면, 데스크탑 사용자 안내서를 참고하십시오." + +#. ============= Tabs ======================== +#: C/gedit.xml:849(bridgehead) C/gedit.xml:1193(guilabel) +msgid "Tabs" +msgstr "탭" + +#: C/gedit.xml:850(para) +msgid "Shortcuts for tabs:" +msgstr "탭 관련 바로 가기:" + +#: C/gedit.xml:858(para) C/gedit.xml:902(para) C/gedit.xml:958(para) +#: C/gedit.xml:1002(para) C/gedit.xml:1030(para) C/gedit.xml:1077(para) +#: C/gedit.xml:1120(para) +msgid "Shortcut Key" +msgstr "바로 가기 키" + +#: C/gedit.xml:860(para) C/gedit.xml:904(para) C/gedit.xml:960(para) +#: C/gedit.xml:1004(para) C/gedit.xml:1032(para) C/gedit.xml:1079(para) +#: C/gedit.xml:1122(para) +msgid "Command" +msgstr "명령" + +#: C/gedit.xml:865(para) C/gedit.xml:869(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:866(para) +msgid "Switches to the next tab to the left." +msgstr "왼쪽 옆에 있는 탭으로 이동합니다." + +#: C/gedit.xml:870(para) +msgid "Switches to the next tab to the right." +msgstr "오른쪽 옆에 있는 탭으로 이동합니다." + +#: C/gedit.xml:873(para) C/gedit.xml:937(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:874(para) +msgid "Close tab." +msgstr "탭을 닫습니다." + +#: C/gedit.xml:877(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:878(para) +msgid "Save all tabs." +msgstr "모든 탭을 저장합니다." + +#: C/gedit.xml:881(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:882(para) +msgid "Close all tabs." +msgstr "모든 탭을 닫습니다." + +#: C/gedit.xml:885(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:886(para) +msgid "Jump to nth tab." +msgstr "n번째 탭으로 이동합니다." + +#. ============= Files ======================== +#: C/gedit.xml:893(bridgehead) +msgid "Files" +msgstr "파일" + +#: C/gedit.xml:894(para) +msgid "Shortcuts for working with files:" +msgstr "파일 작업 관련 바로 가기:" + +#: C/gedit.xml:909(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:910(para) +msgid "Create a new document." +msgstr "새 문서를 만듭니다." + +#: C/gedit.xml:913(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:914(para) +msgid "Open a document." +msgstr "문서를 엽니다." + +#: C/gedit.xml:917(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:918(para) +msgid "Open a location." +msgstr "위치를 엽니다." + +#: C/gedit.xml:921(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:922(para) +msgid "Save the current document to disk." +msgstr "현재 문서를 디스크에 저장합니다." + +#: C/gedit.xml:925(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:926(para) +msgid "Save the current document with a new filename." +msgstr "현재 문서를 다른 파일 이름으로 저장합니다." + +#: C/gedit.xml:929(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:930(para) +msgid "Print the current document." +msgstr "현재 문서를 인쇄합니다." + +#: C/gedit.xml:933(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:934(para) +msgid "Print preview." +msgstr "인쇄 미리 보기." + +#: C/gedit.xml:938(para) +msgid "Close the current document." +msgstr "현재 문서를 닫습니다." + +#: C/gedit.xml:941(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:942(para) +msgid "Quit Gedit." +msgstr "gedit를 끝냅니다." + +#. ============= Edit ======================= +#: C/gedit.xml:949(bridgehead) C/gedit.xml:1491(guimenu) +#: C/gedit.xml:1497(guimenu) C/gedit.xml:1503(guimenu) +#: C/gedit.xml:1509(guimenu) +msgid "Edit" +msgstr "편집" + +#: C/gedit.xml:950(para) +msgid "Shortcuts for editing documents:" +msgstr "문서 편집 관련 바로 가기:" + +#: C/gedit.xml:965(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:966(para) +msgid "Undo the last action." +msgstr "마지막 동작을 취소합니다." + +#: C/gedit.xml:969(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:970(para) +msgid "Redo the last undone action ." +msgstr "마지막 취소한 동작을 다시 실행합니다." + +#: C/gedit.xml:973(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:974(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "선택한 텍스트를 잘라 클립보드에 넣습니다." + +#: C/gedit.xml:977(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:978(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "선택한 텍스트를 복사해 클립보드에 넣습니다." + +#: C/gedit.xml:981(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:982(para) +msgid "Paste the contents of the clipboard." +msgstr "클립보드의 내용을 붙여 넣습니다." + +#: C/gedit.xml:985(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:986(para) +msgid "Select all." +msgstr "모두 선택합니다." + +#. ============= Panes ======================= +#: C/gedit.xml:993(bridgehead) +msgid "Panes" +msgstr "창 부분" + +#: C/gedit.xml:994(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "창 부분을 보이고 감추는 바로 가기:" + +#: C/gedit.xml:1009(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1010(para) +msgid "Show/hide the side pane." +msgstr "가장자리 창을 보이고 감춥니다." + +#: C/gedit.xml:1013(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1014(para) +msgid "Show/hide the bottom pane." +msgstr "아래 창을 보이고 감춥니다." + +#. ============= Search ======================= +#: C/gedit.xml:1021(bridgehead) +msgid "Search" +msgstr "찾기" + +#: C/gedit.xml:1022(para) +msgid "Shortcuts for searching:" +msgstr "찾기 관련 바로 가기:" + +#: C/gedit.xml:1037(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1038(para) +msgid "Find a string." +msgstr "문자열을 찾습니다." + +#: C/gedit.xml:1041(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1042(para) +msgid "Find the next instance of the string." +msgstr "다음에 나오는 그 문자열을 찾습니다." + +#: C/gedit.xml:1045(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1046(para) +msgid "Find the previous instance of the string." +msgstr "이전에 나오는 그 문자열을 찾습니다." + +#: C/gedit.xml:1049(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1050(para) +msgid "Interactive search." +msgstr "바로 찾기." + +#: C/gedit.xml:1053(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1054(para) +msgid "Search and replace." +msgstr "찾기 및 바꾸기." + +#: C/gedit.xml:1057(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1058(para) +msgid "Clear highlight." +msgstr "강조를 지웁니다." + +#: C/gedit.xml:1061(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1062(para) +msgid "Goto line." +msgstr "줄로 이동합니다." + +#. ============= Tools ======================= +#: C/gedit.xml:1068(bridgehead) +msgid "Tools" +msgstr "도구" + +#: C/gedit.xml:1069(para) +msgid "Shortcuts for tools:" +msgstr "도구에 사용하는 바로 가기:" + +#: C/gedit.xml:1084(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1085(para) +msgid "Check spelling (with plugin)." +msgstr "맞춤법을 검사합니다. (플러그인 사용)" + +#: C/gedit.xml:1088(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1089(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "뒤에 붙은 공백을 지웁니다. (플러그인 사용)" + +#: C/gedit.xml:1092(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1093(para) +msgid "Indent (with plugin)." +msgstr "들여 씁니다. (플러그인 사용)" + +#: C/gedit.xml:1096(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1097(para) +msgid "Remove Indent (with plugin)." +msgstr "들여 쓰기를 지웁니다. (플러그인 사용)" + +#: C/gedit.xml:1100(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1101(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "현재 디렉토리에서 \"make\"를 실행합니다. (플러그인 사용)" + +#: C/gedit.xml:1104(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1105(para) +msgid "Directory listing (with plugin)." +msgstr "디렉토리 내용을 봅니다. (플러그인 사용)" + +#. ============= Help ======================= +#: C/gedit.xml:1111(bridgehead) +msgid "Help" +msgstr "도움말" + +#: C/gedit.xml:1112(para) +msgid "Shortcuts for help:" +msgstr "도움말에 사용하는 바로 가기:" + +#: C/gedit.xml:1127(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1128(para) +msgid "Open gedit's user manual." +msgstr "gedit 사용자 설명서를 엽니다." + +#: C/gedit.xml:1140(title) +msgid "Preferences" +msgstr "기본 설정" + +#: C/gedit.xml:1142(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"gedit를 설정하려면 편집기본 설정을 선택하십시오. " +"기본 설정 대화 상자에는 다음 분류가 들어 있습니다:" + +#: C/gedit.xml:1152(title) +msgid "View Preferences" +msgstr "보기 미리 설정" + +#: C/gedit.xml:1157(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"줄 바꿈 사용 옵션을 선택하면 긴 줄을 여러 한 문단으로 취" +"급하고, 텍스트 창의 끝을 벗어나지 않도록 만듭니다. 이 기능을 사용하면 가로 방" +"향으로 스크롤할 필요가 없어집니다." + +#: C/gedit.xml:1158(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"단어를 여러 줄로 나누지 않기 옵션을 선택하면 텍스트가 다" +"음 줄로 넘어갈 때 단어 중간에서 줄을 바꾸지 않게 만듭니다. 이 기능을 사용하" +"면 글을 읽기가 쉬워집니다." + +#: C/gedit.xml:1164(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"줄 번호 표시 옵션을 선택하면 gedit 창의 왼 쪽에 줄 번호를 표시합니다." + +#: C/gedit.xml:1168(guilabel) +msgid "Current Line" +msgstr "현재 줄" + +#: C/gedit.xml:1170(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "현재 줄 강조 옵션을 선택하면 커서가 있는 줄을 강조합니다." + +#: C/gedit.xml:1174(guilabel) +msgid "Right Margin" +msgstr "오른쪽 여백" + +#: C/gedit.xml:1176(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"오른쪽 여백 표시 옵션을 선택하면 오른쪽 여백을 나타내는 " +"수직선을 표시합니다." + +#: C/gedit.xml:1177(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"다음 열에 오른쪽 여백 스핀 상자에서 수직선의 위치를 지정" +"하십시오." + +#: C/gedit.xml:1181(guilabel) +msgid "Bracket Matching" +msgstr "일치하는 괄호" + +#: C/gedit.xml:1183(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "일치하는 괄호 강조 옵션을 사용하면 커서가 괄호 문자 위에 있을 때 그 괄호와 대응하는 괄호를 강조합니다." + +#: C/gedit.xml:1191(title) +msgid "Editor Preferences" +msgstr "편집기 기본 설정" + +#: C/gedit.xml:1195(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"탭 너비 스핀 상자를 사용해 Tab 키를 누" +"를 때 넣을 공백의 너비를 지정하십시오." + +#: C/gedit.xml:1196(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"탭 대신 공백 넣기 옵션을 사용해 Tab 키" +"를 눌렀을 때 탭 문자가 아니라 여러 개의 공백을 넣도록 지정합니다." + +#: C/gedit.xml:1199(guilabel) +msgid "Auto Indentation" +msgstr "자동 들여쓰기" + +#: C/gedit.xml:1200(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"자동 들여 쓰기 사용 옵션을 선택해 다음 줄이 현재 줄의 들" +"여 쓰기 위치에서 시작하도록 만듭니다." + +#: C/gedit.xml:1203(guilabel) +msgid "File Saving" +msgstr "저장 저장" + +#: C/gedit.xml:1205(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"저장하기 전에 백업 만들기 옵션을 선택하면 파일을 저장할 " +"때마다 파일의 백업 복사본을 만듭니다. 파일의 백업 복사본에는 파일 이름 뒤에 ~" +"가 하나 붙습니다." + +#: C/gedit.xml:1206(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"현재 파일을 매 ... 분마다 저장 옵션을 선택하면 현재 파일" +"을 일정 시간마다 자동으로 저장합니다. 스핀 상자로 얼마나 자주 파일을 저장할 " +"지 지정합니다." + +#: C/gedit.xml:1213(title) +msgid "Font & Colors Preferences" +msgstr "글꼴 및 색 기본 설정" + +#: C/gedit.xml:1215(guilabel) +msgid "Font" +msgstr "글꼴" + +#: C/gedit.xml:1217(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"기본 테마 색 사용 옵션을 선택하면 gedit 텍스트 창의 텍스트에 기본 시스템 글꼴을 사용합니다." + +#: C/gedit.xml:1218(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"편집기 글꼴 부분은 텍스트를 표시할 때 사용하는 글꼴을 표" +"시합니다. 이 단추를 눌러 글꼴의 종류, 유형, 크기를 지정할 수 있습니다." + +#: C/gedit.xml:1221(guilabel) +msgid "Colors" +msgstr "색" + +#: C/gedit.xml:1223(para) +msgid "" +"Select the Use default theme colors option to use the " +"default theme colors in the gedit text window." +msgstr "" +"기본 테마 색 사용 옵션을 선택하면 gedit 텍스트 창에서 기본 테마 색을 사용합니다." + +#: C/gedit.xml:1224(para) +msgid "" +"Click on the Normal text color color button to " +"display the color selector dialog. Select a color to use to display normal " +"text in the gedit text window." +msgstr "" +"일반 텍스트 색 색 단추를 누르면 색 선택 대화 창을 표시" +"합니다. gedit 텍스트 창에서 일반 텍스트를 표시할 " +"때 사용할 색을 고르십시오." + +#: C/gedit.xml:1225(para) +msgid "" +"Click on the Background color color button to display " +"the color selector dialog. Select a background color for the " +"gedit text window." +msgstr "" +"배경색 색 단추를 누르면 색 선택 대화 창을 표시합니다. " +"gedit 텍스트 창에서 배경색을 표시할 때 사용할 색" +"을 고르십시오." + +#: C/gedit.xml:1226(para) +msgid "" +"Click on the Selected text color color button to " +"display the color selector dialog. Select a color to use to display selected " +"text." +msgstr "" +"선택한 텍스트 색 색 단추를 누르면 색 선택 대화 창을 표" +"시합니다. 선택한 텍스트를 표시할 때 사용할 색을 고르십시오." + +#: C/gedit.xml:1228(para) +msgid "" +"Click on the Selection color color button to display " +"the color selector dialog. Select a background color to use to highlight a " +"text selection." +msgstr "" +"선택 색 색 단추를 누르면 색 선택 대화 창을 표시합니" +"다. 선택한 텍스트를 강조할 때 사용할 배경색을 고르십시오." + +#: C/gedit.xml:1235(title) +msgid "Syntax Highlighting Preferences" +msgstr "구문 강조 기본 설정" + +#: C/gedit.xml:1237(guilabel) +msgid "Enable syntax highlighting" +msgstr "구문 강조 사용" + +#: C/gedit.xml:1239(para) +msgid "Select this option to highlight the syntax of the text that you edit." +msgstr "이 옵션을 선택하면 텍스트를 편집할 때 구문을 강조합니다." + +#: C/gedit.xml:1242(guilabel) +msgid "Highlight mode" +msgstr "강조 모드" + +#: C/gedit.xml:1244(para) +msgid "Use this drop-down list to select a syntax mode to configure." +msgstr "이 드롭다운 목록에서 설정할 구문 모드를 고릅니다." + +#: C/gedit.xml:1247(guilabel) +msgid "Elements" +msgstr "구성 요소" + +#: C/gedit.xml:1249(para) +msgid "Use this list box to select a syntax element to configure." +msgstr "이 목록에서 설정할 구문 구성 요소를 고릅니다." + +#: C/gedit.xml:1252(term) +msgid "Format buttons" +msgstr "형식 단추" + +#: C/gedit.xml:1254(para) +msgid "" +"Use the following buttons to change the format of the selected syntax " +"element:" +msgstr "다음 단추를 사용해 선택한 구문 구성 요소의 형식을 바꿉니다:" + +#: C/gedit.xml:1262(para) +msgid "Button" +msgstr "단추" + +#: C/gedit.xml:1264(para) +msgid "Format" +msgstr "형식" + +#: C/gedit.xml:1276(phrase) +msgid "Shows icon for bold format." +msgstr "굵은 글씨 형식의 아이콘을 표시합니다." + +#: C/gedit.xml:1282(para) +msgid "Bold" +msgstr "굵게" + +#: C/gedit.xml:1294(phrase) +msgid "Shows icon for italic format." +msgstr "이탤릭 형식의 아이콘을 표시합니다." + +#: C/gedit.xml:1300(para) +msgid "Italic" +msgstr "이탤릭" + +#: C/gedit.xml:1312(phrase) +msgid "Shows icon for underline." +msgstr "밑줄 아이콘을 표시합니다." + +#: C/gedit.xml:1318(para) +msgid "Underline" +msgstr "밑줄" + +#: C/gedit.xml:1330(phrase) +msgid "Shows icon for strikethrough." +msgstr "취소선 아이콘을 표시합니다." + +#: C/gedit.xml:1336(para) +msgid "Strikethrough" +msgstr "취소선" + +#: C/gedit.xml:1346(guilabel) +msgid "Foreground" +msgstr "글자색" + +#: C/gedit.xml:1348(para) +msgid "" +"Select this option to change the font color of the selected syntax element. " +"Click on the color button to display the color selector dialog, then select " +"the font color." +msgstr "" +"이 옵션으로 선택한 구문 구성 요소의 글꼴 색을 바꿉니다. 색 단추를 눌러 색 선" +"택 대화 창을 표시하고, 글꼴의 색을 고르십시오." + +#: C/gedit.xml:1351(guilabel) +msgid "Background" +msgstr "배경색" + +#: C/gedit.xml:1353(para) +msgid "" +"Select this option to change the background color of the selected syntax " +"element. Click on the color button to display the color selector dialog, " +"then select the background color." +msgstr "" +"이 옵션으로 선택한 구문 구성 요소의 배경 색을 바꿉니다. 색 단추를 눌러 색 선" +"택 대화 창을 표시하고, 배경 색을 고르십시오." + +#: C/gedit.xml:1356(guibutton) +msgid "Reset to Default" +msgstr "기본값으로 리셋" + +#: C/gedit.xml:1358(para) +msgid "" +"Click on this button to reset the foreground color and background color of " +"the selected syntax element to the default values." +msgstr "" +"이 단추를 누르면 선택한 구문 구성 요소의 글자색과 배경색을 기본값으로 바꿉니" +"다." + +#: C/gedit.xml:1365(title) +msgid "Plugins Preferences" +msgstr "플러그인 기본 설정" + +#: C/gedit.xml:1366(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"플러그인은 gedit에 부가적인 기능을 추가합니다. 플" +"러그인 및 내장 플러그인 사용법에 대해 좀 더 알고 싶으시면, 부분을 참고하십시오." + +#: C/gedit.xml:1371(title) +msgid "Enabling a Plugin" +msgstr "플러그인 사용하기" + +#: C/gedit.xml:1372(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"gedit 플러그인을 사용하려면, 다음 순서대로 하십시" +"오:" + +#: C/gedit.xml:1375(para) C/gedit.xml:1396(para) C/gedit.xml:1720(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"편집기본 설정을 선택하십시오." + +#: C/gedit.xml:1378(para) C/gedit.xml:1399(para) C/gedit.xml:1723(para) +msgid "Select the Plugins tab." +msgstr "플러그인 탭을 선택하십시오." + +#: C/gedit.xml:1381(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "사용하려는 플러그인의 이름 옆에 있는 확인란을 선택하십시오." + +#: C/gedit.xml:1384(para) C/gedit.xml:1405(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"닫기를 눌러 기본 설정 대화 창을 " +"닫으십시오." + +#: C/gedit.xml:1391(title) +msgid "Disabling a Plugin" +msgstr "플러그인 사용하지 않기" + +#: C/gedit.xml:1392(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"gedit을 끝내더라도 플러그인은 계속 사용하는 상태" +"로 남아 있습니다." + +#: C/gedit.xml:1393(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"gedit 플러그인을 사용하지 않으려면, 다음 순서대로 " +"하십시오:" + +#: C/gedit.xml:1402(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"사용하지 않으려는 플러그인의 이름 옆에 있는 확인란의 선택을 지우십시오." + +#: C/gedit.xml:1414(title) +msgid "Plugins" +msgstr "플러그인" + +#: C/gedit.xml:1416(title) +msgid "Working with Plugins" +msgstr "플러그인 작업하기" + +#: C/gedit.xml:1417(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"플러그인을 사용해 gedit에 " +"부가적인 기능을 추가할 수 있습니다. 플러그인은 어떤 응용 프로그램의 기능을 향" +"상시켜 주는 보조 프로그램입니다. 플러그인을 사용하면 그 플러그인에 들어 있는 " +"기능에 해당하는 메뉴 항목을 gedit 메뉴에 새로 추가" +"합니다." + +#: C/gedit.xml:1419(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"몇 가지 플러그인이 gedit에 내장되어 있고, 플러그인" +"을 더 설치할 수도 있습니다. gedit 웹사이트에 외부에서 만든 플러그인의 목록이 있습" +"니다." + +#: C/gedit.xml:1420(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"플러그인을 사용하거나 사용하지 않으려면, 아니면 현재 사용하고 있는 플러그인" +"을 보려면, 플러그인 기본 설정을 " +"사용하십시오." + +#: C/gedit.xml:1421(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "다음 플러그인이 gedit에 내장되어 있습니다:" + +#: C/gedit.xml:1427(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"대소문자 바꾸기로 선택한 텍스트의 대소문자를 바꿀 수 있습니다." + +#: C/gedit.xml:1430(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"문서 통계는 문서에 들어 있는 줄, 단어, 문자의 개수를 표시합니다." + +#: C/gedit.xml:1433(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"외부 도구gedit에서 외부의 명령어를 실행할 " +"수 있습니다." + +# FIXME: "File Browser Pane" in the program +#: C/gedit.xml:1436(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"파일 찾아보기로 가장자리 창에서 파일을 찾아볼 수 " +"있습니다." + +#: C/gedit.xml:1439(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"줄 들여쓰기로 선택한 줄의 들여 쓰기를 더하거나 뺄 수 있습니다." + +#: C/gedit.xml:1442(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"날짜/시간 넣기으로 현재 날짜와 시간을 문서 안에 써 넣습니다." + +#: C/gedit.xml:1445(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"모드라인을 사용하면 문서마다 편집 설정을 따로 할 수 있고, " +"EmacsKate와 " +"Vim 스타일의 모드라인을 지원합니다." + +#: C/gedit.xml:1448(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"파이썬 콘솔을 사용하면 파이썬 프로그래밍 언어로 명령어를 실행할 수 있" +"습니다." + +#: C/gedit.xml:1451(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"관용구를 사용하면, 자주 사용하는 텍스트를 저장해 놓고 빠르게 문서에 입" +"력할 수 있습니다." + +#: C/gedit.xml:1454(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"정렬은 " +"선택한 텍스트 줄을 사전 순서로 정렬합니다." + +#: C/gedit.xml:1457(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"맞춤법 검사는 선택한 텍스트의 맞춤법을 바로잡고, 문서에서 틀린 사항" +"을 자동으로 표시해 줍니다." + +#: C/gedit.xml:1460(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"태그 목록을 사용하면 HTML 및 기타 언어에서 자주 사용하는 태그를 가장자리 " +"창의 목록에서 입력할 수 있습니다." + +#: C/gedit.xml:1463(para) +msgid "" +"User Name inserts the username of the current user into the document." +msgstr "" +"사용자 이름은 현재 사용자의 사용자 이름을 문서에 입력합니다." + +#: C/gedit.xml:1470(title) +msgid "Change Case Plugin" +msgstr "대소문자 바꾸기 플러그인" + +#: C/gedit.xml:1471(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"대소문자 바꾸기 플러그인으로 선택한 텍스트의 대소" +"문자를 바꿉니다." + +#: C/gedit.xml:1472(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"대소문자 바꾸기 플러그인을 사용하면 다음 항목을 " +"편집 메뉴에 추가합니다:" + +#: C/gedit.xml:1482(para) +msgid "Menu Item" +msgstr "메뉴 항목" + +#: C/gedit.xml:1484(para) +msgid "Action" +msgstr "동작" + +#: C/gedit.xml:1486(para) +msgid "Example" +msgstr "예제" + +#: C/gedit.xml:1492(guisubmenu) C/gedit.xml:1498(guisubmenu) +#: C/gedit.xml:1504(guisubmenu) C/gedit.xml:1510(guisubmenu) +msgid "Change Case" +msgstr "대소문자 바꾸기" + +#: C/gedit.xml:1492(guimenuitem) +msgid "All Upper Case" +msgstr "모두 대문자" + +#: C/gedit.xml:1493(para) +msgid "Change each character to uppercase." +msgstr "모든 문자를 대문자로 바꿉니다." + +#: C/gedit.xml:1494(para) +msgid "This text becomes THIS TEXT" +msgstr "This textTHIS TEXT가 됩니다" + +#: C/gedit.xml:1498(guimenuitem) +msgid "All Lower Case" +msgstr "모두 소문자" + +#: C/gedit.xml:1499(para) +msgid "Change each character to lowercase." +msgstr "모든 문자를 소문자로 바꿉니다." + +#: C/gedit.xml:1500(para) +msgid "This Text becomes this text" +msgstr "This textthis text가 됩니다" + +#: C/gedit.xml:1504(guimenuitem) +msgid "Invert Case" +msgstr "대소문자 뒤바꾸기" + +#: C/gedit.xml:1505(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "모든 소문자를 대문자로 바꾸고, 모든 대문자를 소문자로 바꿉니다." + +#: C/gedit.xml:1506(para) +msgid "This Text becomes tHIS tEXT" +msgstr "This TexttHIS tEXT가 됩니다." + +#: C/gedit.xml:1510(guimenuitem) +msgid "Title Case" +msgstr "제목 대소문자" + +#: C/gedit.xml:1511(para) +msgid "Change the first character of each word to uppercase." +msgstr "모든 단어의 첫 글자를 대문자로 바꿉니다." + +#: C/gedit.xml:1512(para) +msgid "this text becomes This Text" +msgstr "this textThis Text가 됩니다" + +#: C/gedit.xml:1521(title) +msgid "Document Statistics Plugin" +msgstr "문서 통계 플러그인" + +#: C/gedit.xml:1522(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"문서 통계 플러그인은 현재 문서의 줄, 단어, 문자, " +"바이트 수를 계산합니다. 결과를 문서 통계 대화 창에 표시" +"합니다. 문서 통계 플러그인을 사용하려면, 다음 순서대로 하십시오:" + +#: C/gedit.xml:1524(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"도구문서 통계를 선택하면 문서 통계 대화 창이 나타납니다. " +"문서 통계 대화 창에 파일에 대해 다음 정보를 표시합니다:" + +#: C/gedit.xml:1527(para) +msgid "Number of lines in the current document." +msgstr "현재 문서의 줄 수." + +#: C/gedit.xml:1530(para) +msgid "Number of words in the current document." +msgstr "현재 문서의 단어 수." + +#: C/gedit.xml:1533(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "현재 문서의 문자 수, 공백 포함." + +#: C/gedit.xml:1536(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "현재 문서의 문자 수, 공백 포함하지 않음." + +#: C/gedit.xml:1539(para) +msgid "Number of bytes in the current document." +msgstr "현재 문서의 바이트 수." + +#: C/gedit.xml:1544(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"문서 통계 대화 창이 열려 있는 도중에도 " +"gedit의 파일을 편집할 수 있습니다. 문서 " +"통계 대화 창의 내용을 다시 읽어들이려면, 업데이트를 누르십시오." + +#: C/gedit.xml:1551(title) +msgid "External Tools Plugin" +msgstr "외부 도구 플러그인" + +#: C/gedit.xml:1552(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"외부 도구 플러그인을 사용해 gedit에서 외부 명령어를 실행할 수 있습니다. 어떤 내용을 파이프를 통해 " +"명령어로 돌려 넣어서 그 출력을 알아볼 수도 있고 (예를 들어 sed), 미리 정의한 명령어를 실행할 수도 (예를 들어 " +"make) 있습니다." + +#: C/gedit.xml:1553(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"외부 도구 관리자를 사용해 명령어를 새로 만들고 편집합니" +"다. 외부 명령어를 실행하려면, 도구 메뉴에서 명령어를 하나 " +"고르십시오." + +#: C/gedit.xml:1556(title) +msgid "Built-in Commands" +msgstr "내장 명령어" + +#: C/gedit.xml:1557(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"외부 도구 플러그인에는 다음 명령어가 들어 있습니" +"다:" + +#: C/gedit.xml:1559(term) +msgid "Build" +msgstr "컴파일하기" + +#: C/gedit.xml:1561(para) +msgid "" +"Runs make in the current document's directory." +msgstr "현재 문서의 디렉토리에서 make를 실행합니다." + +# FIXME: no such feature +#: C/gedit.xml:1564(term) +msgid "Directory Listing" +msgstr "디렉토리 목록" + +# FIXME: no such feature +#: C/gedit.xml:1566(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "현재 문서의 디렉토리의 파일 목록을 새 문서에 표시합니다." + +# FIXME: no such feature +#: C/gedit.xml:1569(term) +msgid "Environment Variables" +msgstr "환경 변수" + +# FIXME: no such feature +#: C/gedit.xml:1571(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "환경 변수 목록을 아래 창에 표시합니다." + +# FIXME: no such feature +#: C/gedit.xml:1574(term) +msgid "Grep" +msgstr "파일 내용 찾기" + +# FIXME: no such feature +#: C/gedit.xml:1576(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"현재 문서 디렉토리 안의 모든 파일에서 지정한 패턴을 찾습니다. 결과는 아래 창" +"에 표시합니다." + +#: C/gedit.xml:1579(term) +msgid "Remove Trailing Spaces" +msgstr "뒤에 붙은 공백 지우기" + +#: C/gedit.xml:1581(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "문서의 줄 끝에 있는 모든 공백을 지웁니다." + +#: C/gedit.xml:1588(title) +msgid "Defining a Command" +msgstr "명령 정의하기" + +#: C/gedit.xml:1589(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "외부 명령을 새로 추가하려면, 도구외부 도구를 선택하십시오." + +#: C/gedit.xml:1590(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"외부 도구 관리 창에서, 새로 만들기을 누르십시오. 새 명령어에 다음과 같은 사항을 지정할 수 있습니다:" + +#: C/gedit.xml:1592(term) +msgid "Description" +msgstr "설명" + +#: C/gedit.xml:1594(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "이 설명은 메뉴 명령어를 선택할 때 상태 표시줄에 나타납니다." + +# FIXME: "shortcut key" in the program +#: C/gedit.xml:1597(term) +msgid "Accelerator" +msgstr "바로 가기 키" + +#: C/gedit.xml:1599(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "명령어의 키보드 바로 가기를 입력합니다." + +#: C/gedit.xml:1602(term) +msgid "Commands" +msgstr "명령" + +#: C/gedit.xml:1604(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"실행할 명령어. gedit 환경 변수를 사용해 이 명령어" +"에 데이터를 전달할 수 있습니다. 부분을 참고하십시오." + +#: C/gedit.xml:1607(term) +msgid "Input" +msgstr "입력" + +#: C/gedit.xml:1609(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"명령어에 (stdin을 통해) 넘길 내용. 현재 문서의 전체 " +"텍스트, 현재 선택한 부분, 현재 줄, 현재 단어 중의 하나입니다." + +#: C/gedit.xml:1612(term) +msgid "Output" +msgstr "출력" + +#: C/gedit.xml:1614(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"명령어의 출력으로 무엇을 할 지 지정합니다. 아래 창에 표시, 새 문서에 넣기, 현" +"재 문서의 끝이나 커서 위치에 넣기, 선택한 부분이나 전체 문서 바꾸기 중의 하나" +"입니다." + +#: C/gedit.xml:1617(term) +msgid "Applicability" +msgstr "적용 범위" + +#: C/gedit.xml:1619(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"어떤 종류의 문서에 대해 이 명령어를 사용할 수 있는 지 지정합니다. 예를 들어 " +"저장한 문서와 그렇지 않은 문서, 로컬 문서와 원격 문서를 지정합니다." + +#: C/gedit.xml:1627(title) +msgid "Editing and Removing Tools" +msgstr "도구 편집하기 및 지우기" + +#: C/gedit.xml:1628(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "도구를 편집하려면, 목록에서 선택한 다음 그 속성을 바꾸십시오." + +#: C/gedit.xml:1629(para) +msgid "To rename a tool, click it again in the list." +msgstr "도구의 이름을 바꾸려면, 목록에서 다시 한 번 누르십시오." + +#: C/gedit.xml:1630(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"바꾼 내장 도구를 원래대로 복구하려면, 되돌리기를 누르십" +"시오." + +#: C/gedit.xml:1631(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"도구를 지우려면, 목록에서 선택하고 지우기를 누르십시" +"오. 내장 도구는 지울 수 없고, 직접 만든 도구만 지울 수 있습니다." + +#: C/gedit.xml:1635(title) +msgid "Variables" +msgstr "변수" + +#: C/gedit.xml:1636(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"명령어 정의의 명령 입력란에서 다음 변수를 사용할 수 있습" +"니다:" + +#: C/gedit.xml:1639(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1642(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1645(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1648(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1651(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1654(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1657(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +# FIXME: "File Browser Pane" in the program +#: C/gedit.xml:1664(title) +msgid "File Browser Plugin" +msgstr "파일 찾아보기 플러그인" + +# FIXME: "File Browser Pane" in the program +#: C/gedit.xml:1665(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"파일 찾아보기 플러그인은 가장 자리 창에서 파일과 " +"폴더를 표시합니다. 이 기능을 사용해 파일을 빠르게 열 수 있습니다." + +#: C/gedit.xml:1666(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"파일 찾아보기를 표시하려면, 보기" +"가장자리 창을 선택한 다음, 가장자리 창의 아래에 있" +"는 탭에서 파일 찾아보기 아이콘을 누르십시오." + +#: C/gedit.xml:1668(title) +msgid "Browsing your Files" +msgstr "파일 찾아보기" + +#: C/gedit.xml:1669(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"파일 찾아보기 탭은 맨 처음에는 파일 관리자 책갈피를 표시합니다. 어떤 항목의 " +"내용을 보려면, 그 항목을 두 번 누르십시오." + +#: C/gedit.xml:1670(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"상위 폴더를 보려면, 드롭다운 목록에서 상위 폴더를 선택하거나, 파일 찾아보기" +"의 도구 모음에서 위 화살표를 누르십시오." + +#: C/gedit.xml:1671(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"현재 작업중인 문서가 들어 있는 폴더를 보려면, 파일 목록에 마우스 오른쪽 단추" +"를 누르고 Set현재 문서의 상위 디렉토리 선택을 선택" +"하십시오." + +#: C/gedit.xml:1675(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"gedit에서 파일을 열려면, 파일 목록에서 파일을 두 " +"번 누르십시오." + +#: C/gedit.xml:1678(title) +msgid "Creating Files and Folders" +msgstr "파일 및 폴더 만들기" + +#: C/gedit.xml:1679(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "찾아보기 창에 표시하는 현재 폴더에서 빈 텍스트 파일을 새로 만드려면, 파일 목록에서 마우스 오른쪽 단추를 누르고 새 파일을 선택하십시오." + +#: C/gedit.xml:1680(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"찾아보기 창에 표시하는 현재 폴더에서 새 폴더를 만드려면, 파일 목록에서 마우" +"스 오른쪽 단추를 누르고 새 폴더를 선택하십시오." + +#: C/gedit.xml:1685(title) +msgid "Indent Lines Plugin" +msgstr "줄 들여쓰기 플러그인" + +#: C/gedit.xml:1686(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"줄 들여쓰기 플러그인으로 줄 앞에 공백을 더하거나 " +"뺍니다." + +#: C/gedit.xml:1687(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "텍스트를 들여 쓰거나 내어 쓰려면, 다음 순서대로 하십시오:" + +#: C/gedit.xml:1689(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"들여 쓰려는 줄을 선택하십시오. 한 줄만 들여 쓰거나 내어 쓰려면, 커서를 그 줄" +"의 아무 곳으로 옮기면 됩니다." + +#: C/gedit.xml:1694(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"텍스트를 들여 쓰려면, 편집들여 쓰" +"기를 선택하십시오." + +#: C/gedit.xml:1697(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"들여 쓰기를 지우려면, 편집내어 쓰" +"기를 선택하십시오." + +#: C/gedit.xml:1702(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"몇 칸의 공백을 사용할 지, 또 탭 문자와 공백 문자 중 무엇을 사용할 지는 편집" +"기 기본 설정의 탭 위치 설정에 따라 다릅니다. 부분을 보십시오." + +#: C/gedit.xml:1707(title) +msgid "Insert Date/Time Plugin" +msgstr "날짜/시간 넣기 플러그인" + +#: C/gedit.xml:1708(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"날짜/시간 넣기 플러그인은 현재 날짜와 시각을 문서" +"에 끼워 넣습니다. 날짜/시간 넣기 플러그인을 사용하려면, 다음 순서대로 하십시" +"오:" + +#: C/gedit.xml:1710(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"편집날짜 및 시간 넣기를 선택하십시오." + +#: C/gedit.xml:1711(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"날짜/시간 넣기 플러그인에서 형식을 물어보지 않고 날짜/시간을 넣도록 설정하지 " +"않은 상태라면, gedit에서 날짜 및 시간 넣" +"기 대화 창을 표시합니다. 목록에서 적당한 날짜/시간 형식을 고르십시" +"오. 넣기는 눌러 날짜 및 시간 넣기 대화 창을 닫으십시오. 그러면 날짜/시간을 현재 파일의 커서 위치에 입" +"력합니다." + +#: C/gedit.xml:1712(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"한 가지 특정 날짜/시간 형식을 사용하도록 gedit를 " +"설정했다면, 날짜 및 시간 넣기 대화 창은 표시하지 않습니" +"다. 날짜/시간을 자동으로 현재 파일의 커서 위치에 입력합니다." + +#: C/gedit.xml:1717(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "날짜/시간 넣기 플러그인 설정하기" + +#: C/gedit.xml:1718(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "날짜/시간 넣기 플러그인을 설정하려면, 다음 순서대로 하십시오:" + +#: C/gedit.xml:1726(para) +msgid "Select the Insert Date/Time plugin." +msgstr "날짜/시간 넣기 플러그인을 선택하십시오." + +#: C/gedit.xml:1729(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Click 플러그인 설정을 눌러 날짜/시간 넣기 플" +"러그인 설정 대화 창을 여십시오." + +#: C/gedit.xml:1732(para) +msgid "Select one of the options, as follows:" +msgstr "다음과 같이 옵션 중의 하나를 선택하십시오:" + +#: C/gedit.xml:1734(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"날짜/시간을 넣을 때마다 날짜/시간 형식을 지정하려면, 형식 물어보기" +" 옵션을 선택하십시오." + +#: C/gedit.xml:1737(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"날짜/시간을 넣을 때마다 동일한 날짜/시간 형식을 사용하려면, 선택한 " +"형식 사용 옵션을 선택하고, 목록에서 원하는 형식을 고르십시오. 이 " +"옵션을 선택하면, 편집날짜/시간 넣" +"기를 선택했을 때 날짜/시간 형식을 물어보지 않습니" +"다." + +#: C/gedit.xml:1740(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"날짜/시간을 넣을 때마다 동일한 사용자 설정 날짜/시간 형식을 사용하려면, " +"사용자 형식 사용 옵션을 사용하고, 텍스트 입력 창에서 원" +"하는 형식을 입력하십시오. 사용자 설정 형식을 지정하는 방법에 대해 좀 더 알고 " +"싶으시면, strftime3을 참고하십시오. 이 옵션을 선택하면, " +"편집날짜/시간 넣기를 선택했을 때 날짜/시간 형식을 물어보지 않습니다." + +#: C/gedit.xml:1745(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"확인을 눌러 날짜/시간 넣기 플러그인 설정 대화 창을 닫으십시오." + +#: C/gedit.xml:1748(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"기본 설정 대화 창을 닫으려면, 닫기를 누르십시오." + +#: C/gedit.xml:1755(title) +msgid "Modelines Plugin" +msgstr "모드라인 플러그인" + +#: C/gedit.xml:1756(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"모드라인 플러그인으로 각 문서마다 설정을 할 수 있" +"습니다. 모드라인은 문서의 처음이나 끝에 쓰여 있는 한 " +"줄짜리 텍스트로, 그 텍스트를 gedit가 인식해서 그 " +"문서의 설정을 합니다." + +#: C/gedit.xml:1757(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "모드라인에서 설정한 사항은 기본 설정 대화 상자에서 설정한 것보다 우선합니다." + +#: C/gedit.xml:1758(para) +msgid "You can set the following preferences with modelines:" +msgstr "모드라인에서 다음 설정을 할 수 있습니다:" + +#: C/gedit.xml:1761(para) +msgid "Tab width" +msgstr "탭 너비" + +#: C/gedit.xml:1764(para) +msgid "Indent width" +msgstr "들여쓰기 너비" + +#: C/gedit.xml:1767(para) +msgid "Insert spaces instead of tabs" +msgstr "탭 대신 공백 넣기" + +#: C/gedit.xml:1773(para) +msgid "Right margin width" +msgstr "오른쪽 여백 너비" + +#: C/gedit.xml:1777(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"모드라인 플러그인은 다른 텍스트 편집기 " +"이맥스, Kate, " +"Vim에서 사용하는 옵션의 일부를 지원합니다." + +#: C/gedit.xml:1780(title) +msgid "Emacs Modelines" +msgstr "이맥스 모드라인" + +#: C/gedit.xml:1781(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"문서의 처음 두 줄에서 이맥스 모드라인을 검사합니" +"다." + +#: C/gedit.xml:1782(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "이맥스의 tab-width, indent-offset, indent-tabs-mode, autorap 옵션을 지원합니다. 좀 더 자세히 알고 싶으시면, GNU 이맥스 설명서를 참고하십시오." + +#: C/gedit.xml:1785(title) +msgid "Kate Modelines" +msgstr "Kate 모드라인" + +#: C/gedit.xml:1786(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"문서의 처음과 마지막의 열 줄에서 Kate 모드라인을 " +"검사합니다." + +#: C/gedit.xml:1787(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Kate의 tab-width, indent-width, space-indent, " +"word-wrap, word-wrap-column 옵션을 지원합니다. 좀 더 알고 싶으시면 Kate 웹사이트를 참고하십시오." + +#: C/gedit.xml:1790(title) +msgid "Vim Modelines" +msgstr "VIM 모드라인" + +#: C/gedit.xml:1791(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"문서의 처음과 마지막의 세 줄에서 Kate 모드라인을 " +"검사합니다." + +#: C/gedit.xml:1792(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "Vim의 et, expandtab, ts, tabstop, sw, shiftwidth, wrap, textwidth 옵션을 지원합니다. 좀 더 알고 싶으시면 Vim 웹사이트를 참고하십시오." + +#: C/gedit.xml:1797(title) +msgid "Python Console Plugin" +msgstr "파이썬 콘솔 플러그인" + +#: C/gedit.xml:1798(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"파이썬 콘솔 플러그인으로 gedit 안에서 파이썬 프로그래밍 언어로 작성한 명령을 실행할 수 있습니" +"다. 이 플러그인을 사용하면 아래 창에 탭을 하나 추가합니다. 이 탭에서 최근의 " +"출력과 명령어 프롬프트를 표시합니다." + +#: C/gedit.xml:1799(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"파이썬 콘솔에 입력한 명령어는 실행하기 전에 검사하지 않습니다. 즉 파이썬 명령" +"때문에 gedit가 멈출 수 있습니다. 예를 들어 무한 루" +"프에 들어갈 수 있습니다." + +#: C/gedit.xml:1803(title) +msgid "Snippets Plugin" +msgstr "관용구 플러그인" + +#: C/gedit.xml:1804(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"관용구 플러그인으로 자주 사용하는 텍스트를 " +"(관용구라고 합니다) 저장하고, 저장해 놓은 관용구를 빠" +"르게 문서에 입력합니다." + +#: C/gedit.xml:1805(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"관용구는 현재 문서의 언어 문법에 따라 다릅니다. 예를 들어 HTML 문서 작업을 하" +"는 경우, HTML에서 유용한 관용구 목록에서 선택해서 사용할 수 있습니다. 또 어" +"떤 관용구는 파일 형식에 관계 없이 모든 문서에서 사용할 수 있습니다." + +#: C/gedit.xml:1806(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"gedit에 여러가지 내장 관용구가 설치되어 있고, 이 " +"관용구를 바꿀 수도 있습니다." + +#: C/gedit.xml:1809(title) +msgid "Inserting Snippets" +msgstr "관용구 넣기" + +#: C/gedit.xml:1810(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "관용구를 문서에 넣으려면, 그 탭 트리거을 입력하고 Tab 키를 누르십시오. 관용구의 탭 트리거는 보통 그 관용구의 맨 앞의 글자이거나, 짧고 기억하기 쉬운 단어입니다." + +#: C/gedit.xml:1811(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "다른 방법으로, Ctrl스페이스 키를 누르면 넣을 수 있는 관용구 목록이 나타납니다." + +#: C/gedit.xml:1815(title) +msgid "Adding Snippets" +msgstr "관용구 추가하기" + +#: C/gedit.xml:1816(para) +msgid "To create a new snippet, do the following:" +msgstr "새 관용구를 만드려면, 다음과 같이 하십시오:" + +#: C/gedit.xml:1819(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"도구관용구 관리를 선택하십시오. 관용구 관리자 창이 열립니다." + +#: C/gedit.xml:1822(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"관용구 목록은 언어마다 묶여 있습니다. 관용구를 추가하려는 언어를 선택하거나, " +"그 언어 안의 관용구를 선택하십시오. 모든 언어에 대해 새 관용구를 추가하려면, " +"목록의 맨 위에 있는 전체를 선택하십시오. 처음에는 기본값으로 현재 작업하고 있" +"는 문서의 언어를 표시합니다." + +#: C/gedit.xml:1825(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"새로 만들기를 누르십시오. 새 관용구가 목록에 나타납니" +"다." + +#: C/gedit.xml:1828(para) +msgid "Enter the following information for the new snippet:" +msgstr "새 관용구에 대해 다음 정보를 입력하십시오:" + +#: C/gedit.xml:1830(term) +msgid "Name" +msgstr "이름" + +#: C/gedit.xml:1832(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"관용구 목록 안의 텍스트 입력란에서 관용구의 이름을 입력하십시오. 관용구의 이" +"름은 그 관용구의 목적을 알리는 용도일 뿐입니다. 목록의 관용구를 눌러서 새로 " +"만든 관용구의 이름을 바꿀 수 있습니다." + +#: C/gedit.xml:1835(term) +msgid "Snippet text" +msgstr "관용구 텍스트" + +#: C/gedit.xml:1837(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"관용구 편집 텍스트 상자에서 관용구의 텍스트를 입력하십시" +"오. 사용할 수 있는 특수 코드에 대해서는, 부분을 참고하십시오." + +#: C/gedit.xml:1838(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"관용구 관리자 창을 닫지 않고 문서 창으로 돌아가서 텍스트" +"를 복사할 수도 있습니다." + +#: C/gedit.xml:1841(term) +msgid "Tab Trigger" +msgstr "탭 트리거" + +#: C/gedit.xml:1843(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "관용구의 탭 트리거를 입력하십시오. 탭 트리거는 관용구를 입력할 때 Tab 키를 누르기 전에 입력할 텍스트를 말합니다." + +#: C/gedit.xml:1844(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "태그는 문자로만 이루어진 한 개의 단어이거나, 아니면 한 글자여야 합니다. 잘못 입력하면 탭 트리거를 빨간 색으로 강조합니다." + +#: C/gedit.xml:1847(term) +msgid "Shortcut key" +msgstr "바로 가기 키" + +#: C/gedit.xml:1849(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "관용구를 넣을 때 사용할 바로 가기 키를 입력하십시오." + +#: C/gedit.xml:1858(title) +msgid "Editing and Removing Snippets" +msgstr "관용구 편집 및 지우기" + +#: C/gedit.xml:1859(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"관용구를 편집하려면, 목록에서 선택한 다음 그 텍스트와 활성화 속성을 바꾸십시" +"오." + +#: C/gedit.xml:1860(para) +msgid "To rename a snippet, click it again in the list." +msgstr "관용구의 이름을 바꾸려면, 목록에서 관용구를 다시 누르십시오." + +#: C/gedit.xml:1861(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"직접 바꾼 내장 관용구를 원래대로 복구하려면, 되돌리기를 " +"누르십시오." + +#: C/gedit.xml:1862(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"관용구를 지우려면, 목록에서 선택하고 지우기를 누르십시" +"오. 내장 관용구는 지울 수 없고, 직접 만든 관용구만 지울 수 있습니다." + +#: C/gedit.xml:1866(title) +msgid "Snippet Substitutions" +msgstr "관용구 대체" + +#: C/gedit.xml:1867(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"저장한 텍스트를 입력하는 것 외에도, 관용구에는 사용자가 입력하는 텍스트가 들" +"어갈 수 있습니다. 관용구를 문서에 입력한 다음에 입력할 텍스트의 위치를 알려 " +"주기도 합니다." + +#: C/gedit.xml:1871(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "관용구 텍스트에서 다음 입력 위치를 사용할 수 있습니다:" + +#: C/gedit.xml:1873(term) +msgid "Tab placeholders" +msgstr "탭 입력 위치" + +#: C/gedit.xml:1875(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$nn이 1 " +"이상의 숫자인 탭 입력 위치입니다." + +#: C/gedit.xml:1876(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default}은 기본값에 대한 탭 입력 위치입니다." + +#: C/gedit.xml:1877(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"탭 입력 위치는 관용구 텍스트에서 관용구를 입력한 다음에 추가 텍스트를 입력할 " +"수 있는 위치를 표시합니다." + +#: C/gedit.xml:1878(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "탭 포매팅 코드를 사용하려면, 관용구를 평소와 같이 입력합니다. 커서가 첫 번째 탭 위치에 있습니다. 텍스트를 입력하고 Tab 키를 누르면 다음 탭 입력 위치로 이동합니다. 탭 입력 위치 코드의 번호는 탭으로 이동하는 순서를 지정합니다." + +#: C/gedit.xml:1879(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "ShiftTab 키를 누르면 이전의 탭 입력 위치로 돌아갑니다. 탭 입력 위치가 더 없을 때 Tab 키를 누르면 커서를 관용구 텍스트의 맨 끝으로 옮기거나, 끝 입력 위치가 있으면 거기로 커서를 옮깁니다." + +#: C/gedit.xml:1882(term) +msgid "Mirror placeholders" +msgstr "미러 입력 위치" + +#: C/gedit.xml:1884(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"반복 입력 위치는 이미 정의한 입력 위치의 텍스트를 따라갑니다. 이 방법으로 관" +"용구에서 여러번 써야 하는 텍스트를 한번만 입력할 수 있습니다." + +#: C/gedit.xml:1887(term) +msgid "End placeholder" +msgstr "끝 입력 위치" + +#: C/gedit.xml:1889(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0이 끝 입력 위치를 지정합니다. 끝 입력 위치를 사용하면 관" +"용구를 관용구 텍스트의 끝이 아닌 커서 위치에서 관용구를 끝마칠 수 있습니다." + +#: C/gedit.xml:1892(term) +msgid "Environmental variables" +msgstr "환경 변수" + +#: C/gedit.xml:1894(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"$PATH$HOME과 같은 환경 변수를 관용구" +"에서 사용할 수 있습니다. gedit 전용의 다음과 같은 " +"변수도 사용할 수 있습니다:" + +#: C/gedit.xml:1896(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1898(para) +msgid "The currently selected text." +msgstr "현재 선택한 텍스트." + +#: C/gedit.xml:1901(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1903(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "문서의 전체 파일 이름, 문서를 저장하지 않았으면 빈 문자열." + +#: C/gedit.xml:1906(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1908(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"문서의 파일 이름의 폴더 부분을 제외한 이름, 문서를 저장하지 않았으면 빈 문자" +"열." + +#: C/gedit.xml:1911(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1913(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"문서의 커서 위치에 있는 단어. 이 변수를 사용하면 현재 단어를 관용구로 바꿉니" +"다." + +#: C/gedit.xml:1921(term) +msgid "Shell placeholders" +msgstr "쉘 입력 위치" + +#: C/gedit.xml:1923(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd)는 쉘에서 " +"cmd 명령어를 실행한 결과로 바뀝니다." + +#: C/gedit.xml:1924(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd)로 이 입력 위치를 레퍼런스로 사용할 수 있습니다. 여기서 " +"n은 1 이상의 숫자입니다. " +"$n을 사용하면 한 개의 쉘 입력 위치의 출" +"력 내용을 다른 위치에서도 사용할 수 있습니다." + +#: C/gedit.xml:1927(term) +msgid "Python placeholders" +msgstr "파이썬 입력 위치" + +#: C/gedit.xml:1929(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd>은 파이썬 인터프리" +"터에서 cmd의 값을 계산한 결과로 바뀝니다." + +#: C/gedit.xml:1930(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +"는 다른 파이썬 관용구에 의존성을 지정하고, 여기서 a는 관용구의 순서를 말합니다. 이 기능을 이용해 다른 관용구에 정의" +"한 파이썬 함수를 사용할 수 있습니다. 의존성을 여러 개 지정하려면, 숫자를 쉼표" +"로 구분하십시오: $<a,b:cmd>" + +#: C/gedit.xml:1931(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"다른 파이썬 관용구에서 변수를 사용하려면, global로 선언하" +"십시오." + +#: C/gedit.xml:1940(title) +msgid "Sort Plugin" +msgstr "정렬 플러그인" + +#: C/gedit.xml:1941(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"정렬 플러그인으로 선택한 텍스트를 사전 순서로 정렬" +"합니다." + +#: C/gedit.xml:1942(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"정렬 동작은 실행을 취소할 수 없으므로, 정렬을 하기 전에 파일을 저장해 놓아야 " +"합니다. 정렬을 한 다음에 저장한 파일로 되돌리려면, 파일" +"되돌리기를 선택하십시오." + +#: C/gedit.xml:1945(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "정렬 플러그인을 사용하려면, 다음 순서대로 하십시오:" + +#: C/gedit.xml:1948(para) +msgid "Select the lines of text you want to sort." +msgstr "정렬하려는 텍스트 줄을 선택하십시오." + +#: C/gedit.xml:1950(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"편집정렬을 선택하십시오. 정렬 대화 창이 열립니다." + +#: C/gedit.xml:1953(para) +msgid "Choose the options you want for the sort:" +msgstr "정렬에 사용할 옵션을 선택하십시오:" + +#: C/gedit.xml:1956(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "반대 순서로 정렬하려면, 반대 순서를 선택하십시오." + +#: C/gedit.xml:1959(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"같은 줄을 지우려면, 같은 줄 지우기를 선택하십시오." + +#: C/gedit.xml:1962(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"대소문자 구별을 무시하려면, 대소문자 무시를 선택하십시" +"오." + +#: C/gedit.xml:1965(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"정렬할 때 줄 시작 부분에 있는 문자를 무시하려면, 시작할 열 스핀 상자에서 정렬할 때 사용할 첫 번째 문자를 지정하십시오." + +#: C/gedit.xml:1970(para) +msgid "To perform the sort operation, click Sort." +msgstr "정렬을 시작하려면, 정렬을 누르십시오." + +#: C/gedit.xml:1977(title) +msgid "Spell Checker Plugin" +msgstr "맞춤법 검사 플러그인" + +#: C/gedit.xml:1978(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "맞춤법 검사 플러그인은 선택한 텍스트의 맞춤법을 검사합니다. 자동으로 맞춤법을 검사하도록 gedit를 설정할 수 있고, 수동으로 맞춤법을 지정한 언어로 검사할 수도 있습니다. 언어 설정 및 맞춤법 자동 검사 속성은 문서마다 적용됩니다. 맞춤법 검사 플러그인을 사용하려면, 다음 순서대로 하십시오:" + +#: C/gedit.xml:1980(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"도구언어 설정을 선택하면 언어 설정 대화 창을 표시합니다. " +"목록에서 원하는 언어를 선택하십시오. 확인을을 눌러 " +"언어 설정 대화 창을 닫으십시오." + +#: C/gedit.xml:1983(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "맞춤법을 자동으로 검사하려면, 도구맞춤법 자동 검사를 선택하십시오. 맞춤법 자동 검사를 사용하지 않으려면, 도구맞춤법 자동 검사를 다시 선택하십시오. 맞춤법 자동 검사를 사용하면, 맞춤법 자동 검사를 메뉴 항목 옆에 아이콘을 표시합니다. 맞춤법 자동 검사는 gedit를 시작할 때 기본값으로 사용하지 않는 상태입니다." + +#: C/gedit.xml:1984(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"알려지지 않은 맞춤법은 다른 색과 밑줄로 표시합니다. 알려지지 않은 맞춤법에 마" +"우스 오른쪽 단추를 누르고, 팝업 메뉴에서 맞춤법 추천을 선" +"택하십시오:" + +#: C/gedit.xml:1987(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"알려지지 않은 맞춤법을 목록의 다른 맞춤법으로 바꾸려면, 맞춤법 추천" +" 팝업 메뉴에서 바꿀 맞춤법을 선택하십시오." + +#: C/gedit.xml:1990(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"알려지지 않은 맞춤법을 개인 사전에 추가하려면, 맞춤법 추" +"천추가를 선택하십시오." + +#: C/gedit.xml:1993(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"알려지지 않은 맞춤법을 모두 무시해서 알려지지 않았다고 표시하지 않게 하면서 " +"개인 사전에는 추가하지 않으려면, 맞춤법 추천모두 무시를 선택하십시오. 현" +"재 gedit 세션에서만 알려지지 않은 단어를 무시합니" +"다." + +#: C/gedit.xml:1998(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"수동으로 맞춤법을 검사하려면, 도구맞춤법 검사를 선택하십시오." + +#: C/gedit.xml:2000(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"맞춤법 오류가 없으면, 정보 대화 창에서 이 문서 안에 맞춤" +"법이 틀린 단어가 없다는 메세지를 표시합니다. 확인을 눌" +"러 정보 대화 창을 닫으십시오." + +#: C/gedit.xml:2002(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"맞춤법 오류가 있으면, 맞춤법 검사 대화 창을 표시합니다:" + +#: C/gedit.xml:2005(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "맞춤법이 틀린 단어를 대화 창의 위에 표시합니다." + +#: C/gedit.xml:2008(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"추천하는 알려진 맞춤법을 바꿀 단어 텍스트 상자에 표시합" +"니다. 추천 목록에서 다른 맞춤법을 고르면 다른 알려진 맞" +"춤법을 이 텍스트 상자에 표시합니다. 아니면 직접 바꿀 단어 텍스트 상자에 텍스트를 입력할 수도 있습니다." + +#: C/gedit.xml:2011(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"바꿀 단어 텍스트 상자의 맞춤법을 검사하려면, " +"단어 검사를 누르십시오. 알려진 단어인 경우, 추천목록이 (올바른 맞춤법)이라는 텍스트로 바뀝니다. " +"그 단어가 알려지지 않은 경우, 추천목록에 새 항목이 나타" +"납니다." + +#: C/gedit.xml:2014(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"현재 알려지지 않은 단어를 무시하려면, 무시를 누르십시" +"오. 알려지지 않은 단어를 모두 무시하려면, 모두 무시를 " +"누르십시오. 현재 gedit 세션에서만 알려지지 않은 단" +"어를 무시합니다." + +#: C/gedit.xml:2017(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"현재 알려지지 않은 단어를 바꿀 단어 텍스트 상자에 들어 " +"있는 텍스트로 바꾸려면, 바꾸기를 누르십시오. 그 알려지" +"지 않은 단어를 모두 바꿀 단어 텍스트 상자의 텍스트로 바" +"꾸려면, 모두 바꾸기를 누르십시오." + +#: C/gedit.xml:2020(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"알려지지 않은 단어를 개인 사전에 추가하려면, 단어 추가" +"를 누르십시오." + +#: C/gedit.xml:2023(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"맞춤법 검사 대화 창을 닫으려면, 닫기를 누르십시오." + +#: C/gedit.xml:2032(title) +msgid "Tag List Plugin" +msgstr "태그 목록 플러그인" + +#: C/gedit.xml:2033(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"태그 목록 플러그인으로 가장자리 창의 목록에서 자" +"주 사용하는 태그를 입력할 수 있습니다." + +#: C/gedit.xml:2034(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "태그 목록 플러그인을 사용하려면 다음 순서대로 하십시오:" + +#: C/gedit.xml:2036(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"보기가장자리 창을 선택하십시오." + +#: C/gedit.xml:2040(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"기본값으로 가장자리 창은 열려 있는 문서의 목록이 들어 있는 탭을 표시합니다. " +"가장자리 창의 아래에 있는 + 아이콘을 누르면 태그 목록 탭을 표시합니다." + +#: C/gedit.xml:2042(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"드롭다운 목록에서 필요한 태그 분류를 선택하십시오. 예를 들어 HTML " +"- 태그를 선택하십시오." + +#: C/gedit.xml:2045(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "태그 목록을 스크롤해서 필요한 태그를 찾으십시오." + +#: C/gedit.xml:2048(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"현재 파일의 커서 위치에 태그를 넣으려면, 태그 목록에서 해당 태그를 두 번 누르" +"십시오. 다음과 같이 태그를 넣을 수도 있습니다:" + +#: C/gedit.xml:2050(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "현재 파일에 태그를 넣고 포커스를 가장자리 창에서 표시 영역으로 바꾸려면, Return 키를 누르십시오." + +#: C/gedit.xml:2053(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "현재 파일에 태그를 넣고 포커스를 태그 목록 플러그인 창에 유지하려면, ShiftReturn 키를 누르십시오." + +#: C/gedit.xml:2062(title) +msgid "User Name Plugin" +msgstr "사용자 이름 플러그인" + +#: C/gedit.xml:2063(para) +msgid "" +"The User name plugin inserts the username of the " +"current user into the document." +msgstr "" +"사용자 이름 플러그인은 현재 사용자의 사용자 이름" +"을 문서에 넣습니다." + +#: C/gedit.xml:2064(para) +msgid "" +"To insert your username at the cursor position, choose " +"EditInsert User Name." +msgstr "" +"커서 위치에 사용자 이름을 넣으려면, 편집사용자 이름 넣기를 선택하십시" +"오." + +#: C/gedit.xml:2066(para) +msgid "" +"This plugin is mostly provided as an example of how to create your own " +"plugins. For more information on creating plugins, see the gedit website." +msgstr "" +"자기만의 플러그인을 만드는 방법에 대한 예제로서의 기능이 이 플러그인의 주된 " +"목적입니다. 플러그인을 만드는 방법에 대해 좀 더 알고 싶으시면, gedit 웹사이트를 참고하십시오." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Sun Microsystems, 2002.\n" +"류창우 , 2007." + +#~ msgid "" +#~ "To undo a change you have made, choose EditUndo. To reverse this " +#~ "action, choose EditRedo. The number of previous edits that you can undo " +#~ "is determined by the Undo limit setting in the " +#~ "Editor tabbed section of the Preferences dialog: see ." +#~ msgstr "" +#~ "편집한 내용을 취소하려면 편집" +#~ "실행 취소를 선택하십시오. 취소한 내용을 되돌리" +#~ "려면 편집다시 실행을 선택하십시오. 이전에 편집한 내용 중 실행 취소" +#~ "할 수 있는 회수는 기본 설정 대화 상자의 편" +#~ "집기 탭 섹션에 있는 실행 취소 제한 설정에 " +#~ "따라 다릅니다. 부분을 참고하십시오." + +#~ msgid "" +#~ "To position the cursor on a specific line in the current file, perform " +#~ "the following steps:" +#~ msgstr "커서를 현재 파일의 특정 줄로 옮기려면, 다음 순서대로 하십시오:" + +#~ msgid "" +#~ "Choose SearchGo to Line to display the Go to Line " +#~ "dialog." +#~ msgstr "" +#~ "찾기줄로 이동을 선택하십시오. 줄로 이동 대화 창을 표시" +#~ "합니다." + +#~ msgid "" +#~ "Click Go to Line. The application moves the cursor " +#~ "to the line number that you specify." +#~ msgstr "" +#~ "줄로 이동을 누르십시오. 커서가 지정한 번호의 줄로 " +#~ "이동합니다." + +#~ msgid "" +#~ "To close the Go to Line dialog, click " +#~ "Close." +#~ msgstr "" +#~ "줄로 이동 대화 창을 닫으려면, 닫기를 누르십시오." + +#~ msgid "F7" +#~ msgstr "F7" + +#~ msgid "Undo" +#~ msgstr "실행 취소" + +# FIXME: obsolete feature +#~ msgid "" +#~ "Select the Limit to ... actions option to set a " +#~ "limit on the number of editing actions that you can undo. Use the spin " +#~ "box to specify the maximum number of actions that you can undo." +#~ msgstr "" +#~ "... 개 작업으로 제한 옵션을 선택하면 실행 취소할 수 " +#~ "있는 편집 작업의 개수를 제한할 수 있습니다. 스핀 상자를 사용해 실행 취소" +#~ "할 수 있는 최대 작업 개수를 지정합니다." + +# FIXME: obsolete feature +#~ msgid "" +#~ "Select the Unlimited undo option to set no limit on " +#~ "the number of editing actions that you can undo." +#~ msgstr "" +#~ "무제한 실행 취소 옵션을 선택하면 실행 취소할 수 있는 " +#~ "편집 작업 수에 제한이 없습니다." diff --git a/help/oc/oc.po b/help/oc/oc.po new file mode 100755 index 00000000..3772fd58 --- /dev/null +++ b/help/oc/oc.po @@ -0,0 +1,3650 @@ +# Translation of oc.po to Occitan +# Occitan translation of gedit documentation. +# Copyright (C) 2006-2007 Free Software Foundation, Inc. +# This file is distributed under the same license as the gedit documentation +# package. +# +# Yannig Marchegay (Kokoyaya) , 2006-2008. +msgid "" +msgstr "" +"Project-Id-Version: oc\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-02-28 21:49+0100\n" +"PO-Revision-Date: 2007-12-27 13:34+0100\n" +"Last-Translator: Yannig Marchegay (Kokoyaya) \n" +"Language-Team: Occitan \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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" + +#: ../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 "" + +#: ../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 "" + +#: ../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 " +"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/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: " +"" +msgstr "" + +#. 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/gedit.xml:262(None) +msgid "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:342(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#. 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/gedit.xml:1266(None) +msgid "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" +msgstr "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" + +#. 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/gedit.xml:1285(None) +msgid "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" +msgstr "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" + +#. 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/gedit.xml:1303(None) +msgid "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" +msgstr "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#. 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/gedit.xml:1321(None) +msgid "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" +msgstr "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" + +#: ../C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "" + +#: ../C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: ../C/gedit.xml:26(holder) ../C/gedit.xml:45(publishername) +#: ../C/gedit.xml:52(firstname) ../C/gedit.xml:75(orgname) +#: ../C/gedit.xml:116(para) ../C/gedit.xml:124(para) ../C/gedit.xml:132(para) +#: ../C/gedit.xml:140(para) ../C/gedit.xml:148(para) ../C/gedit.xml:156(para) +#: ../C/gedit.xml:164(para) ../C/gedit.xml:172(para) ../C/gedit.xml:180(para) +#: ../C/gedit.xml:188(para) ../C/gedit.xml:196(para) +msgid "MATE Documentation Project" +msgstr "Projècte de documentacion de MATE" + +#: ../C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: ../C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: ../C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: ../C/gedit.xml:31(holder) ../C/gedit.xml:67(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: ../C/gedit.xml:33(year) ../C/gedit.xml:112(date) +msgid "2000" +msgstr "2000" + +#: ../C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: ../C/gedit.xml:55(orgname) +msgid "MATE" +msgstr "MATE" + +#: ../C/gedit.xml:59(firstname) +msgid "Hal" +msgstr "" + +#: ../C/gedit.xml:60(surname) +msgid "Canary" +msgstr "" + +#: ../C/gedit.xml:61(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "" + +#: ../C/gedit.xml:64(firstname) ../C/gedit.xml:187(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "" + +#: ../C/gedit.xml:68(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: ../C/gedit.xml:72(firstname) +msgid "Eric" +msgstr "Eric" + +#: ../C/gedit.xml:73(surname) +msgid "Baudais" +msgstr "Baudais" + +#: ../C/gedit.xml:76(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: ../C/gedit.xml:80(firstname) +msgid "Baris" +msgstr "Baris" + +#: ../C/gedit.xml:81(surname) +msgid "Cicek provided information from earlier revisions of the gedit application." +msgstr "" + +#: ../C/gedit.xml:82(contrib) ../C/gedit.xml:87(contrib) +msgid "Acknowledgements" +msgstr "" + +#: ../C/gedit.xml:85(firstname) +msgid "Ajit" +msgstr "" + +#: ../C/gedit.xml:86(surname) +msgid "George provided information about plugins." +msgstr "" + +#: ../C/gedit.xml:111(revnumber) +msgid "gedit V1.0" +msgstr "" + +#: ../C/gedit.xml:114(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: ../C/gedit.xml:120(revnumber) +msgid "gedit Manual V2.0" +msgstr "" + +#: ../C/gedit.xml:121(date) +msgid "March 2002" +msgstr "Març de 2002" + +#: ../C/gedit.xml:123(para) ../C/gedit.xml:131(para) ../C/gedit.xml:139(para) +#: ../C/gedit.xml:147(para) ../C/gedit.xml:155(para) ../C/gedit.xml:163(para) +#: ../C/gedit.xml:171(para) ../C/gedit.xml:179(para) +msgid "Sun MATE Documentation Team" +msgstr "Còla Sun de documentacion de MATE" + +#: ../C/gedit.xml:128(revnumber) +msgid "gedit Manual V2.1" +msgstr "" + +#: ../C/gedit.xml:129(date) +msgid "June 2002" +msgstr "Junh de 2002" + +#: ../C/gedit.xml:136(revnumber) +msgid "gedit Manual V2.2" +msgstr "" + +#: ../C/gedit.xml:137(date) +msgid "August 2002" +msgstr "Agost de 2002" + +#: ../C/gedit.xml:144(revnumber) +msgid "gedit Manual V2.3" +msgstr "" + +#: ../C/gedit.xml:145(date) +msgid "September 2002" +msgstr "Setembre de 2002" + +#: ../C/gedit.xml:152(revnumber) +msgid "gedit Manual V2.4" +msgstr "" + +#: ../C/gedit.xml:153(date) +msgid "January 2003" +msgstr "Genièr de 2003" + +#: ../C/gedit.xml:160(revnumber) +msgid "gedit Manual V2.5" +msgstr "" + +#: ../C/gedit.xml:161(date) +msgid "March 2003" +msgstr "Març de 2003" + +#: ../C/gedit.xml:168(revnumber) +msgid "gedit Manual V2.6" +msgstr "" + +#: ../C/gedit.xml:169(date) +msgid "September 2003" +msgstr "Setembre de 2003" + +#: ../C/gedit.xml:176(revnumber) +msgid "gedit Manual V2.7" +msgstr "" + +#: ../C/gedit.xml:177(date) +msgid "March 2004" +msgstr "Març de 2004" + +#: ../C/gedit.xml:184(revnumber) +msgid "gedit Manual V2.8" +msgstr "" + +#: ../C/gedit.xml:185(date) ../C/gedit.xml:193(date) +msgid "July 2006" +msgstr "" + +#: ../C/gedit.xml:192(revnumber) +msgid "gedit Manual V2.9" +msgstr "" + +#: ../C/gedit.xml:195(para) +msgid "MATE Documentation Team" +msgstr "Còla de documentacion de MATE" + +#: ../C/gedit.xml:200(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "" + +#: ../C/gedit.xml:203(title) +msgid "Feedback" +msgstr "" + +#: ../C/gedit.xml:204(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" + +#: ../C/gedit.xml:209(para) +msgid "gedit is the MATE text editor." +msgstr "" + +#: ../C/gedit.xml:212(primary) +msgid "gedit" +msgstr "" + +#: ../C/gedit.xml:213(primary) +msgid "text editor" +msgstr "" + +#: ../C/gedit.xml:218(title) +msgid "Introduction" +msgstr "Introduccion" + +#: ../C/gedit.xml:223(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" + +#: ../C/gedit.xml:225(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" + +#: ../C/gedit.xml:229(title) +msgid "Getting Started" +msgstr "Per començar" + +#: ../C/gedit.xml:233(title) +msgid "Starting gedit" +msgstr "" + +#: ../C/gedit.xml:234(para) +msgid "You can start gedit in the following ways:" +msgstr "" + +#: ../C/gedit.xml:237(term) +msgid "Applications menu" +msgstr "Menut Applications" + +#: ../C/gedit.xml:239(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" + +#: ../C/gedit.xml:243(term) +msgid "Command line" +msgstr "Linha de comanda" + +#: ../C/gedit.xml:245(para) +msgid "Execute the following command: gedit" +msgstr "" + +#: ../C/gedit.xml:249(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" + +#: ../C/gedit.xml:254(title) +msgid "The gedit Window" +msgstr "" + +#: ../C/gedit.xml:255(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" + +#: ../C/gedit.xml:258(title) +msgid "gedit Window" +msgstr "" + +#: ../C/gedit.xml:264(phrase) +msgid "Shows gedit main window." +msgstr "" + +#: ../C/gedit.xml:270(para) +msgid "The gedit window contains the following elements:" +msgstr "" + +#: ../C/gedit.xml:273(term) +msgid "Menubar" +msgstr "Barra de menuts" + +#: ../C/gedit.xml:275(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" + +#: ../C/gedit.xml:278(term) +msgid "Toolbar" +msgstr "Barra d'espleches" + +#: ../C/gedit.xml:280(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" + +#: ../C/gedit.xml:283(term) +msgid "Display area" +msgstr "" + +#: ../C/gedit.xml:285(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "" + +#: ../C/gedit.xml:288(term) +msgid "Statusbar" +msgstr "Barra d'estat" + +#: ../C/gedit.xml:290(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" + +#: ../C/gedit.xml:293(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" + +#: ../C/gedit.xml:296(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" + +#: ../C/gedit.xml:301(term) +msgid "Side Pane" +msgstr "" + +#: ../C/gedit.xml:303(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" + +#: ../C/gedit.xml:304(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" + +#: ../C/gedit.xml:307(term) +msgid "Bottom Pane" +msgstr "" + +#: ../C/gedit.xml:309(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output. It is not shown by default." +msgstr "" + +#: ../C/gedit.xml:313(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" + +#: ../C/gedit.xml:315(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" + +#: ../C/gedit.xml:320(title) +msgid "Running gedit from a Command Line" +msgstr "" + +#: ../C/gedit.xml:321(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" + +#: ../C/gedit.xml:322(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "" + +#: ../C/gedit.xml:322(command) +msgid "gedit " +msgstr "" + +#: ../C/gedit.xml:323(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "" + +#: ../C/gedit.xml:324(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" + +#: ../C/gedit.xml:329(title) +msgid "Working with Files" +msgstr "" + +#: ../C/gedit.xml:333(title) +msgid "Creating a New Document" +msgstr "" + +#: ../C/gedit.xml:334(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" + +#: ../C/gedit.xml:339(title) ../C/gedit.xml:1667(title) +msgid "Opening a File" +msgstr "" + +#: ../C/gedit.xml:340(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" + +#: ../C/gedit.xml:342(phrase) +msgid "Shows Recent Files menu icon." +msgstr "" + +#: ../C/gedit.xml:342(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" + +#: ../C/gedit.xml:344(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" + +#: ../C/gedit.xml:350(title) +msgid "Saving a File" +msgstr "" + +#: ../C/gedit.xml:351(para) +msgid "You can save files in the following ways:" +msgstr "" + +#: ../C/gedit.xml:353(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" + +#: ../C/gedit.xml:355(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" + +#: ../C/gedit.xml:357(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" + +#: ../C/gedit.xml:360(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" + +#: ../C/gedit.xml:365(title) +msgid "Opening a File from a URI" +msgstr "" + +#: ../C/gedit.xml:366(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" + +#: ../C/gedit.xml:369(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" + +#: ../C/gedit.xml:372(para) +msgid "Enter the URI of the file that you want to open." +msgstr "" + +#: ../C/gedit.xml:375(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" + +#: ../C/gedit.xml:378(para) +msgid "Click Open." +msgstr "" + +#: ../C/gedit.xml:381(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" + +#: ../C/gedit.xml:382(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" + +#: ../C/gedit.xml:383(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" + +#: ../C/gedit.xml:388(title) +msgid "Working With Tabs" +msgstr "" + +#: ../C/gedit.xml:390(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" + +#: ../C/gedit.xml:391(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" + +#: ../C/gedit.xml:392(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" + +#: ../C/gedit.xml:398(title) +msgid "Working with Text" +msgstr "" + +#: ../C/gedit.xml:402(title) +msgid "Editing Text" +msgstr "" + +#: ../C/gedit.xml:403(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "" + +#: ../C/gedit.xml:405(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" + +#: ../C/gedit.xml:407(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" + +#: ../C/gedit.xml:409(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" + +#: ../C/gedit.xml:411(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" + +#: ../C/gedit.xml:413(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" + +#: ../C/gedit.xml:415(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" + +#: ../C/gedit.xml:421(title) +msgid "Undoing and Redoing Changes" +msgstr "" + +#: ../C/gedit.xml:422(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo. The number of previous edits that you can undo is " +"determined by the Undo limit setting in the " +"Editor tabbed section of the Preferences dialog: see ." +msgstr "" + +#: ../C/gedit.xml:427(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "" + +#: ../C/gedit.xml:428(para) +msgid "" +"To position the cursor on a specific line in the current file, perform the " +"following steps:" +msgstr "" + +#: ../C/gedit.xml:430(para) +msgid "" +"Choose SearchGo to Line to display the Go to Line " +"dialog." +msgstr "" + +#: ../C/gedit.xml:432(para) +msgid "" +"Type the number of the line that you want to move the cursor to in the " +"Line number field." +msgstr "" + +#: ../C/gedit.xml:434(para) +msgid "" +"Click Go to Line. The application moves the cursor to " +"the line number that you specify." +msgstr "" + +#: ../C/gedit.xml:436(para) +msgid "" +"To close the Go to Line dialog, click Close." +msgstr "" + +#: ../C/gedit.xml:443(title) +msgid "Finding and Replacing" +msgstr "" + +#: ../C/gedit.xml:445(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" + +#: ../C/gedit.xml:450(title) +msgid "Finding Text" +msgstr "" + +#: ../C/gedit.xml:451(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "" + +#: ../C/gedit.xml:453(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" + +#: ../C/gedit.xml:455(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" + +#: ../C/gedit.xml:457(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" + +#: ../C/gedit.xml:459(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" + +#: ../C/gedit.xml:462(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" + +#: ../C/gedit.xml:463(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" + +#: ../C/gedit.xml:467(title) +msgid "Incremental Search" +msgstr "" + +#: ../C/gedit.xml:469(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" + +#: ../C/gedit.xml:470(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" + +#: ../C/gedit.xml:471(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" + +#: ../C/gedit.xml:472(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" + +#: ../C/gedit.xml:473(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" + +#: ../C/gedit.xml:478(title) +msgid "Replacing Text" +msgstr "" + +#: ../C/gedit.xml:480(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" + +#: ../C/gedit.xml:482(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" + +#: ../C/gedit.xml:484(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" + +#: ../C/gedit.xml:485(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" + +#: ../C/gedit.xml:489(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" + +#: ../C/gedit.xml:490(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" + +#: ../C/gedit.xml:495(title) +msgid "Find and Replace Options" +msgstr "" + +#: ../C/gedit.xml:496(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" + +#: ../C/gedit.xml:498(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" + +#: ../C/gedit.xml:500(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" + +#: ../C/gedit.xml:502(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" + +#: ../C/gedit.xml:504(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" + +#: ../C/gedit.xml:511(title) +msgid "Special Characters" +msgstr "" + +#: ../C/gedit.xml:512(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" + +#: ../C/gedit.xml:515(literal) +msgid " n" +msgstr "" + +#: ../C/gedit.xml:517(para) +msgid "Specifies a new line." +msgstr "" + +#: ../C/gedit.xml:521(literal) +msgid " t" +msgstr "" + +#: ../C/gedit.xml:523(para) +msgid "Specifies a tab character." +msgstr "" + +#: ../C/gedit.xml:527(literal) +msgid " r" +msgstr "" + +#: ../C/gedit.xml:529(para) +msgid "Specifies a carriage return." +msgstr "" + +#: ../C/gedit.xml:537(title) +msgid "Printing" +msgstr "Estampatge" + +#: ../C/gedit.xml:541(title) +msgid "Setting the Page Options" +msgstr "" + +#: ../C/gedit.xml:543(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" + +#: ../C/gedit.xml:545(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" + +#: ../C/gedit.xml:548(title) +msgid "General Tabbed Section" +msgstr "" + +#: ../C/gedit.xml:550(guilabel) +msgid "Print syntax highlighting" +msgstr "" + +#: ../C/gedit.xml:552(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" + +#: ../C/gedit.xml:555(guilabel) +msgid "Print page headers" +msgstr "" + +#: ../C/gedit.xml:557(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" + +#: ../C/gedit.xml:560(guilabel) ../C/gedit.xml:1162(guilabel) +msgid "Line Numbers" +msgstr "" + +#: ../C/gedit.xml:563(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" + +#: ../C/gedit.xml:564(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" + +#: ../C/gedit.xml:567(guilabel) ../C/gedit.xml:1155(guilabel) +#: ../C/gedit.xml:1759(para) +msgid "Text Wrapping" +msgstr "" + +#: ../C/gedit.xml:569(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" + +#: ../C/gedit.xml:571(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" + +#: ../C/gedit.xml:579(title) +msgid "Fonts" +msgstr "Poliças" + +#: ../C/gedit.xml:581(guilabel) +msgid "Body" +msgstr "Còs" + +#: ../C/gedit.xml:583(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" + +#: ../C/gedit.xml:586(guilabel) +msgid "Line numbers" +msgstr "" + +#: ../C/gedit.xml:589(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" + +#: ../C/gedit.xml:592(guilabel) +msgid "Headers and footers" +msgstr "" + +#: ../C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" + +#: ../C/gedit.xml:598(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" + +#: ../C/gedit.xml:605(title) +msgid "Printing a Document" +msgstr "" + +#: ../C/gedit.xml:606(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" + +#: ../C/gedit.xml:608(para) +msgid "Print a document to a printer." +msgstr "" + +#: ../C/gedit.xml:610(para) +msgid "Print the output of the print command to a file." +msgstr "" + +#: ../C/gedit.xml:613(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" + +#: ../C/gedit.xml:615(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" + +#: ../C/gedit.xml:617(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" + +#: ../C/gedit.xml:619(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" + +#: ../C/gedit.xml:622(title) +msgid "Job Tabbed Section" +msgstr "" + +#: ../C/gedit.xml:624(guilabel) +msgid "Print range" +msgstr "Airal d'estampatge" + +#: ../C/gedit.xml:626(para) +msgid "Select one of the following options to determine how many pages to print:" +msgstr "" + +#: ../C/gedit.xml:629(guilabel) +msgid "All" +msgstr "Totes" + +#: ../C/gedit.xml:630(para) +msgid "Select this option to print all of the pages in the file." +msgstr "" + +#: ../C/gedit.xml:633(guilabel) +msgid "Lines" +msgstr "Linhas" + +#: ../C/gedit.xml:634(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" + +#: ../C/gedit.xml:637(guilabel) +msgid "Selection" +msgstr "Seleccion" + +#: ../C/gedit.xml:638(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" + +#: ../C/gedit.xml:644(guilabel) +msgid "Copies" +msgstr "Còpias" + +#: ../C/gedit.xml:646(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" + +#: ../C/gedit.xml:647(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" + +#: ../C/gedit.xml:654(title) +msgid "Printer Tabbed Section" +msgstr "" + +#: ../C/gedit.xml:656(guilabel) +msgid "Printer" +msgstr "Estampaira" + +#: ../C/gedit.xml:658(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" + +#: ../C/gedit.xml:661(guilabel) +msgid "Settings" +msgstr "Paramètres" + +#: ../C/gedit.xml:663(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "" + +#: ../C/gedit.xml:665(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" + +#: ../C/gedit.xml:669(guilabel) +msgid "Location" +msgstr "Emplaçament" + +#: ../C/gedit.xml:671(para) +msgid "Use this drop-down list to select one of the following print destinations:" +msgstr "" + +#: ../C/gedit.xml:676(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: ../C/gedit.xml:678(para) +msgid "Print the file to a CUPS printer." +msgstr "" + +#: ../C/gedit.xml:682(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" + +#: ../C/gedit.xml:689(guilabel) +msgid "lpr" +msgstr "lpr" + +#: ../C/gedit.xml:691(para) +msgid "Print the file to a printer." +msgstr "" + +#: ../C/gedit.xml:697(guilabel) +msgid "File" +msgstr "Fichièr" + +#: ../C/gedit.xml:699(para) +msgid "Print the file to a PostScript file." +msgstr "" + +#: ../C/gedit.xml:702(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" + +#: ../C/gedit.xml:708(guilabel) +msgid "Custom" +msgstr "Personalizat" + +#: ../C/gedit.xml:710(para) +msgid "Use the specified command to print the file." +msgstr "" + +#: ../C/gedit.xml:713(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" + +#: ../C/gedit.xml:721(guilabel) +msgid "State" +msgstr "Estat" + +#: ../C/gedit.xml:723(para) ../C/gedit.xml:729(para) ../C/gedit.xml:735(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "" + +#: ../C/gedit.xml:727(guilabel) +msgid "Type" +msgstr "Tipe" + +#: ../C/gedit.xml:733(guilabel) +msgid "Comment" +msgstr "Comentari" + +#: ../C/gedit.xml:743(title) +msgid "Paper Tabbed Section" +msgstr "" + +#: ../C/gedit.xml:745(guilabel) +msgid "Paper size" +msgstr "Talha de papièr" + +#: ../C/gedit.xml:747(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" + +#: ../C/gedit.xml:750(guilabel) +msgid "Width" +msgstr "Largor" + +#: ../C/gedit.xml:752(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" + +#: ../C/gedit.xml:755(guilabel) +msgid "Height" +msgstr "Nautor" + +#: ../C/gedit.xml:757(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "" + +#: ../C/gedit.xml:760(guilabel) +msgid "Feed orientation" +msgstr "" + +#: ../C/gedit.xml:762(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" + +#: ../C/gedit.xml:765(guilabel) +msgid "Page orientation" +msgstr "" + +#: ../C/gedit.xml:767(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "" + +#: ../C/gedit.xml:770(guilabel) +msgid "Layout" +msgstr "Presentacion" + +#: ../C/gedit.xml:772(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" + +#: ../C/gedit.xml:775(guilabel) +msgid "Paper tray" +msgstr "" + +#: ../C/gedit.xml:777(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "" + +#: ../C/gedit.xml:788(title) +msgid "Programming Features" +msgstr "" + +#: ../C/gedit.xml:790(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" + +#: ../C/gedit.xml:794(title) +msgid "Syntax Highlighting" +msgstr "" + +#: ../C/gedit.xml:795(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" + +#: ../C/gedit.xml:797(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" + +#: ../C/gedit.xml:800(guimenuitem) +msgid "Normal" +msgstr "Normal" + +#: ../C/gedit.xml:802(para) +msgid "Do not display any syntax highlighting." +msgstr "" + +#: ../C/gedit.xml:806(guisubmenu) +msgid "Sources" +msgstr "" + +#: ../C/gedit.xml:808(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" + +#: ../C/gedit.xml:812(guisubmenu) +msgid "Markup" +msgstr "" + +#: ../C/gedit.xml:814(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" + +#: ../C/gedit.xml:818(guisubmenu) +msgid "Scripts" +msgstr "" + +#: ../C/gedit.xml:820(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" + +#: ../C/gedit.xml:824(guisubmenu) +msgid "Others" +msgstr "Autres" + +#: ../C/gedit.xml:826(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" + +#: ../C/gedit.xml:830(para) +msgid "" +"For more information about how to configure syntax highlighting, see ." +msgstr "" + +#: ../C/gedit.xml:836(title) +msgid "Piping the Output of a Command to a File" +msgstr "" + +#: ../C/gedit.xml:837(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" + +#: ../C/gedit.xml:838(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" + +#: ../C/gedit.xml:839(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" + +#: ../C/gedit.xml:845(title) +msgid "Shortcut Keys" +msgstr "" + +#: ../C/gedit.xml:846(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" + +#: ../C/gedit.xml:847(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" + +#. ============= Tabs ======================== +#: ../C/gedit.xml:850(bridgehead) ../C/gedit.xml:1180(guilabel) +msgid "Tabs" +msgstr "Onglets" + +#: ../C/gedit.xml:851(para) +msgid "Shortcuts for tabs:" +msgstr "" + +#: ../C/gedit.xml:859(para) ../C/gedit.xml:903(para) ../C/gedit.xml:959(para) +#: ../C/gedit.xml:1003(para) ../C/gedit.xml:1031(para) +#: ../C/gedit.xml:1078(para) ../C/gedit.xml:1121(para) +msgid "Shortcut Key" +msgstr "" + +#: ../C/gedit.xml:861(para) ../C/gedit.xml:905(para) ../C/gedit.xml:961(para) +#: ../C/gedit.xml:1005(para) ../C/gedit.xml:1033(para) +#: ../C/gedit.xml:1080(para) ../C/gedit.xml:1123(para) +msgid "Command" +msgstr "Comanda" + +#: ../C/gedit.xml:866(para) ../C/gedit.xml:870(para) +msgid "Ctrl + Alt + PageDown" +msgstr "" + +#: ../C/gedit.xml:867(para) +msgid "Switches to the next tab to the left." +msgstr "" + +#: ../C/gedit.xml:871(para) +msgid "Switches to the next tab to the right." +msgstr "" + +#: ../C/gedit.xml:874(para) ../C/gedit.xml:938(para) +msgid "Ctrl + W" +msgstr "" + +#: ../C/gedit.xml:875(para) +msgid "Close tab." +msgstr "" + +#: ../C/gedit.xml:878(para) +msgid "Ctrl + Shift + L" +msgstr "" + +#: ../C/gedit.xml:879(para) +msgid "Save all tabs." +msgstr "" + +#: ../C/gedit.xml:882(para) +msgid "Ctrl + Shift + W" +msgstr "" + +#: ../C/gedit.xml:883(para) +msgid "Close all tabs." +msgstr "" + +#: ../C/gedit.xml:886(para) +msgid "Alt + n" +msgstr "" + +#: ../C/gedit.xml:887(para) +msgid "Jump to nth tab." +msgstr "" + +#. ============= Files ======================== +#: ../C/gedit.xml:894(bridgehead) +msgid "Files" +msgstr "Fichièrs" + +#: ../C/gedit.xml:895(para) +msgid "Shortcuts for working with files:" +msgstr "" + +#: ../C/gedit.xml:910(para) +msgid "Ctrl + N" +msgstr "" + +#: ../C/gedit.xml:911(para) +msgid "Create a new document." +msgstr "" + +#: ../C/gedit.xml:914(para) +msgid "Ctrl + O" +msgstr "" + +#: ../C/gedit.xml:915(para) +msgid "Open a document." +msgstr "" + +#: ../C/gedit.xml:918(para) +msgid "Ctrl + L" +msgstr "" + +#: ../C/gedit.xml:919(para) +msgid "Open a location." +msgstr "" + +#: ../C/gedit.xml:922(para) +msgid "Ctrl + S" +msgstr "" + +#: ../C/gedit.xml:923(para) +msgid "Save the current document to disk." +msgstr "" + +#: ../C/gedit.xml:926(para) +msgid "Ctrl + Shift + S" +msgstr "" + +#: ../C/gedit.xml:927(para) +msgid "Save the current document with a new filename." +msgstr "" + +#: ../C/gedit.xml:930(para) +msgid "Ctrl + P" +msgstr "" + +#: ../C/gedit.xml:931(para) +msgid "Print the current document." +msgstr "" + +#: ../C/gedit.xml:934(para) +msgid "Ctrl + Shift + P" +msgstr "" + +#: ../C/gedit.xml:935(para) +msgid "Print preview." +msgstr "" + +#: ../C/gedit.xml:939(para) +msgid "Close the current document." +msgstr "" + +#: ../C/gedit.xml:942(para) +msgid "Ctrl + Q" +msgstr "" + +#: ../C/gedit.xml:943(para) +msgid "Quit Gedit." +msgstr "" + +#. ============= Edit ======================= +#: ../C/gedit.xml:950(bridgehead) ../C/gedit.xml:1484(guimenu) +#: ../C/gedit.xml:1490(guimenu) ../C/gedit.xml:1496(guimenu) +#: ../C/gedit.xml:1502(guimenu) +msgid "Edit" +msgstr "Edicion" + +#: ../C/gedit.xml:951(para) +msgid "Shortcuts for editing documents:" +msgstr "" + +#: ../C/gedit.xml:966(para) +msgid "Ctrl + Z" +msgstr "" + +#: ../C/gedit.xml:967(para) +msgid "Undo the last action." +msgstr "" + +#: ../C/gedit.xml:970(para) +msgid "Ctrl + Shift + Z" +msgstr "" + +#: ../C/gedit.xml:971(para) +msgid "Redo the last undone action ." +msgstr "" + +#: ../C/gedit.xml:974(para) +msgid "Ctrl + X" +msgstr "" + +#: ../C/gedit.xml:975(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "" + +#: ../C/gedit.xml:978(para) +msgid "Ctrl + C" +msgstr "" + +#: ../C/gedit.xml:979(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "" + +#: ../C/gedit.xml:982(para) +msgid "Ctrl + V" +msgstr "" + +#: ../C/gedit.xml:983(para) +msgid "Paste the contents of the clipboard." +msgstr "" + +#: ../C/gedit.xml:986(para) +msgid "Ctrl + A" +msgstr "" + +#: ../C/gedit.xml:987(para) +msgid "Select all." +msgstr "" + +#. ============= Panes ======================= +#: ../C/gedit.xml:994(bridgehead) +msgid "Panes" +msgstr "" + +#: ../C/gedit.xml:995(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "" + +#: ../C/gedit.xml:1010(para) +msgid "F9" +msgstr "F9" + +#: ../C/gedit.xml:1011(para) +msgid "Show/hide the side pane." +msgstr "" + +#: ../C/gedit.xml:1014(para) +msgid "Ctrl + F9" +msgstr "" + +#: ../C/gedit.xml:1015(para) +msgid "Show/hide the bottom pane." +msgstr "" + +#. ============= Search ======================= +#: ../C/gedit.xml:1022(bridgehead) +msgid "Search" +msgstr "Recercar" + +#: ../C/gedit.xml:1023(para) +msgid "Shortcuts for searching:" +msgstr "" + +#: ../C/gedit.xml:1038(para) +msgid "Ctrl + F" +msgstr "" + +#: ../C/gedit.xml:1039(para) +msgid "Find a string." +msgstr "" + +#: ../C/gedit.xml:1042(para) +msgid "Ctrl + G" +msgstr "" + +#: ../C/gedit.xml:1043(para) +msgid "Find the next instance of the string." +msgstr "" + +#: ../C/gedit.xml:1046(para) +msgid "Ctrl + Shift + G" +msgstr "" + +#: ../C/gedit.xml:1047(para) +msgid "Find the previous instance of the string." +msgstr "" + +#: ../C/gedit.xml:1050(para) +msgid "Ctrl + K" +msgstr "" + +#: ../C/gedit.xml:1051(para) +msgid "Interactive search." +msgstr "" + +#: ../C/gedit.xml:1054(para) +msgid "Ctrl + H" +msgstr "" + +#: ../C/gedit.xml:1055(para) +msgid "Search and replace." +msgstr "" + +#: ../C/gedit.xml:1058(para) +msgid "Ctrl + Shift + K" +msgstr "" + +#: ../C/gedit.xml:1059(para) +msgid "Clear highlight." +msgstr "" + +#: ../C/gedit.xml:1062(para) +msgid "Ctrl + I" +msgstr "" + +#: ../C/gedit.xml:1063(para) +msgid "Goto line." +msgstr "" + +#. ============= Tools ======================= +#: ../C/gedit.xml:1069(bridgehead) +msgid "Tools" +msgstr "Espleches" + +#: ../C/gedit.xml:1070(para) +msgid "Shortcuts for tools:" +msgstr "" + +#: ../C/gedit.xml:1085(para) +msgid "F7" +msgstr "F7" + +#: ../C/gedit.xml:1086(para) +msgid "Check spelling (with plugin)." +msgstr "" + +#: ../C/gedit.xml:1089(para) +msgid "Alt + F12" +msgstr "" + +#: ../C/gedit.xml:1090(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "" + +#: ../C/gedit.xml:1093(para) +msgid "Ctrl + T" +msgstr "" + +#: ../C/gedit.xml:1094(para) +msgid "Indent (with plugin)." +msgstr "" + +#: ../C/gedit.xml:1097(para) +msgid "Ctrl + Shift + T" +msgstr "" + +#: ../C/gedit.xml:1098(para) +msgid "Remove Indent (with plugin)." +msgstr "" + +#: ../C/gedit.xml:1101(para) +msgid "F8" +msgstr "F8" + +#: ../C/gedit.xml:1102(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "" + +#: ../C/gedit.xml:1105(para) +msgid "Ctrl + Shift + D" +msgstr "" + +#: ../C/gedit.xml:1106(para) +msgid "Directory listing (with plugin)." +msgstr "" + +#. ============= Help ======================= +#: ../C/gedit.xml:1112(bridgehead) +msgid "Help" +msgstr "Ajuda" + +#: ../C/gedit.xml:1113(para) +msgid "Shortcuts for help:" +msgstr "" + +#: ../C/gedit.xml:1128(para) +msgid "F1" +msgstr "F1" + +#: ../C/gedit.xml:1129(para) +msgid "Open gedit's user manual." +msgstr "" + +#: ../C/gedit.xml:1141(title) +msgid "Preferences" +msgstr "Preferéncias" + +#: ../C/gedit.xml:1143(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" + +#: ../C/gedit.xml:1153(title) +msgid "View Preferences" +msgstr "" + +#: ../C/gedit.xml:1157(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" + +#: ../C/gedit.xml:1158(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" + +#: ../C/gedit.xml:1164(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" + +#: ../C/gedit.xml:1168(guilabel) +msgid "Right Margin" +msgstr "" + +#: ../C/gedit.xml:1170(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" + +#: ../C/gedit.xml:1171(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" + +#: ../C/gedit.xml:1178(title) +msgid "Editor Preferences" +msgstr "" + +#: ../C/gedit.xml:1182(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" + +#: ../C/gedit.xml:1183(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" + +#: ../C/gedit.xml:1186(guilabel) +msgid "Auto Indentation" +msgstr "" + +#: ../C/gedit.xml:1187(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" + +#: ../C/gedit.xml:1190(guilabel) +msgid "File Saving" +msgstr "" + +#: ../C/gedit.xml:1192(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" + +#: ../C/gedit.xml:1193(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" + +#: ../C/gedit.xml:1196(guilabel) +msgid "Undo" +msgstr "Anullar" + +#: ../C/gedit.xml:1198(para) +msgid "" +"Select the Limit to ... actions option to set a limit " +"on the number of editing actions that you can undo. Use the spin box to " +"specify the maximum number of actions that you can undo." +msgstr "" + +#: ../C/gedit.xml:1199(para) +msgid "" +"Select the Unlimited undo option to set no limit on the " +"number of editing actions that you can undo." +msgstr "" + +#: ../C/gedit.xml:1206(title) +msgid "Font & Colors Preferences" +msgstr "" + +#: ../C/gedit.xml:1208(guilabel) +msgid "Font" +msgstr "Poliça" + +#: ../C/gedit.xml:1210(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" + +#: ../C/gedit.xml:1211(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" + +#: ../C/gedit.xml:1214(guilabel) +msgid "Colors" +msgstr "Colors" + +#: ../C/gedit.xml:1216(para) +msgid "" +"Select the Use default theme colors option to use the " +"default theme colors in the gedit text window." +msgstr "" + +#: ../C/gedit.xml:1217(para) +msgid "" +"Click on the Normal text color color button to " +"display the color selector dialog. Select a color to use to display normal " +"text in the gedit text window." +msgstr "" + +#: ../C/gedit.xml:1218(para) +msgid "" +"Click on the Background color color button to display " +"the color selector dialog. Select a background color for the " +"gedit text window." +msgstr "" + +#: ../C/gedit.xml:1219(para) +msgid "" +"Click on the Selected text color color button to " +"display the color selector dialog. Select a color to use to display selected " +"text." +msgstr "" + +#: ../C/gedit.xml:1221(para) +msgid "" +"Click on the Selection color color button to display " +"the color selector dialog. Select a background color to use to highlight a " +"text selection." +msgstr "" + +#: ../C/gedit.xml:1228(title) +msgid "Syntax Highlighting Preferences" +msgstr "" + +#: ../C/gedit.xml:1230(guilabel) +msgid "Enable syntax highlighting" +msgstr "" + +#: ../C/gedit.xml:1232(para) +msgid "Select this option to highlight the syntax of the text that you edit." +msgstr "" + +#: ../C/gedit.xml:1235(guilabel) +msgid "Highlight mode" +msgstr "" + +#: ../C/gedit.xml:1237(para) +msgid "Use this drop-down list to select a syntax mode to configure." +msgstr "" + +#: ../C/gedit.xml:1240(guilabel) +msgid "Elements" +msgstr "Elements" + +#: ../C/gedit.xml:1242(para) +msgid "Use this list box to select a syntax element to configure." +msgstr "" + +#: ../C/gedit.xml:1245(term) +msgid "Format buttons" +msgstr "" + +#: ../C/gedit.xml:1247(para) +msgid "" +"Use the following buttons to change the format of the selected syntax " +"element:" +msgstr "" + +#: ../C/gedit.xml:1255(para) +msgid "Button" +msgstr "Boton" + +#: ../C/gedit.xml:1257(para) +msgid "Format" +msgstr "Format" + +#: ../C/gedit.xml:1269(phrase) +msgid "Shows icon for bold format." +msgstr "" + +#: ../C/gedit.xml:1275(para) +msgid "Bold" +msgstr "Gras" + +#: ../C/gedit.xml:1287(phrase) +msgid "Shows icon for italic format." +msgstr "" + +#: ../C/gedit.xml:1293(para) +msgid "Italic" +msgstr "Italic" + +#: ../C/gedit.xml:1305(phrase) +msgid "Shows icon for underline." +msgstr "" + +#: ../C/gedit.xml:1311(para) +msgid "Underline" +msgstr "Soslinhat" + +#: ../C/gedit.xml:1323(phrase) +msgid "Shows icon for strikethrough." +msgstr "" + +#: ../C/gedit.xml:1329(para) +msgid "Strikethrough" +msgstr "Barrat" + +#: ../C/gedit.xml:1339(guilabel) +msgid "Foreground" +msgstr "" + +#: ../C/gedit.xml:1341(para) +msgid "" +"Select this option to change the font color of the selected syntax element. " +"Click on the color button to display the color selector dialog, then select " +"the font color." +msgstr "" + +#: ../C/gedit.xml:1344(guilabel) +msgid "Background" +msgstr "Fons" + +#: ../C/gedit.xml:1346(para) +msgid "" +"Select this option to change the background color of the selected syntax " +"element. Click on the color button to display the color selector dialog, " +"then select the background color." +msgstr "" + +#: ../C/gedit.xml:1349(guibutton) +msgid "Reset to Default" +msgstr "" + +#: ../C/gedit.xml:1351(para) +msgid "" +"Click on this button to reset the foreground color and background color of " +"the selected syntax element to the default values." +msgstr "" + +#: ../C/gedit.xml:1358(title) +msgid "Plugins Preferences" +msgstr "" + +#: ../C/gedit.xml:1359(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" + +#: ../C/gedit.xml:1364(title) +msgid "Enabling a Plugin" +msgstr "" + +#: ../C/gedit.xml:1365(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" + +#: ../C/gedit.xml:1368(para) ../C/gedit.xml:1389(para) +#: ../C/gedit.xml:1713(para) +msgid "" +"Choose EditPreferences." +msgstr "" + +#: ../C/gedit.xml:1371(para) ../C/gedit.xml:1392(para) +#: ../C/gedit.xml:1716(para) +msgid "Select the Plugins tab." +msgstr "" + +#: ../C/gedit.xml:1374(para) +msgid "Select the check box next to the name of the plugin that you want to enable." +msgstr "" + +#: ../C/gedit.xml:1377(para) ../C/gedit.xml:1398(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" + +#: ../C/gedit.xml:1384(title) +msgid "Disabling a Plugin" +msgstr "" + +#: ../C/gedit.xml:1385(para) +msgid "A plugin remains enabled when you quit gedit." +msgstr "" + +#: ../C/gedit.xml:1386(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" + +#: ../C/gedit.xml:1395(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" + +#: ../C/gedit.xml:1407(title) +msgid "Plugins" +msgstr "Ajustons" + +#: ../C/gedit.xml:1409(title) +msgid "Working with Plugins" +msgstr "" + +#: ../C/gedit.xml:1410(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" + +#: ../C/gedit.xml:1412(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" + +#: ../C/gedit.xml:1413(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" + +#: ../C/gedit.xml:1414(para) +msgid "The following plugins come built-in with gedit:" +msgstr "" + +#: ../C/gedit.xml:1420(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" + +#: ../C/gedit.xml:1423(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" + +#: ../C/gedit.xml:1426(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" + +#: ../C/gedit.xml:1429(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" + +#: ../C/gedit.xml:1432(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" + +#: ../C/gedit.xml:1435(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" + +#: ../C/gedit.xml:1438(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" + +#: ../C/gedit.xml:1441(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" + +#: ../C/gedit.xml:1444(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" + +#: ../C/gedit.xml:1447(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" + +#: ../C/gedit.xml:1450(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" + +#: ../C/gedit.xml:1453(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" + +#: ../C/gedit.xml:1456(para) +msgid "" +"User Name inserts the username of the current user into the document." +msgstr "" + +#: ../C/gedit.xml:1463(title) +msgid "Change Case Plugin" +msgstr "" + +#: ../C/gedit.xml:1464(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" + +#: ../C/gedit.xml:1465(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" + +#: ../C/gedit.xml:1475(para) +msgid "Menu Item" +msgstr "" + +#: ../C/gedit.xml:1477(para) +msgid "Action" +msgstr "Accion" + +#: ../C/gedit.xml:1479(para) +msgid "Example" +msgstr "Exemple" + +#: ../C/gedit.xml:1485(guisubmenu) ../C/gedit.xml:1491(guisubmenu) +#: ../C/gedit.xml:1497(guisubmenu) ../C/gedit.xml:1503(guisubmenu) +msgid "Change Case" +msgstr "" + +#: ../C/gedit.xml:1485(guimenuitem) +msgid "All Upper Case" +msgstr "" + +#: ../C/gedit.xml:1486(para) +msgid "Change each character to uppercase." +msgstr "" + +#: ../C/gedit.xml:1487(para) +msgid "This text becomes THIS TEXT" +msgstr "" + +#: ../C/gedit.xml:1491(guimenuitem) +msgid "All Lower Case" +msgstr "" + +#: ../C/gedit.xml:1492(para) +msgid "Change each character to lowercase." +msgstr "" + +#: ../C/gedit.xml:1493(para) +msgid "This Text becomes this text" +msgstr "" + +#: ../C/gedit.xml:1497(guimenuitem) +msgid "Invert Case" +msgstr "" + +#: ../C/gedit.xml:1498(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" + +#: ../C/gedit.xml:1499(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" + +#: ../C/gedit.xml:1503(guimenuitem) +msgid "Title Case" +msgstr "" + +#: ../C/gedit.xml:1504(para) +msgid "Change the first character of each word to uppercase." +msgstr "" + +#: ../C/gedit.xml:1505(para) +msgid "this text becomes This Text" +msgstr "" + +#: ../C/gedit.xml:1514(title) +msgid "Document Statistics Plugin" +msgstr "" + +#: ../C/gedit.xml:1515(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" + +#: ../C/gedit.xml:1517(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" + +#: ../C/gedit.xml:1520(para) +msgid "Number of lines in the current document." +msgstr "" + +#: ../C/gedit.xml:1523(para) +msgid "Number of words in the current document." +msgstr "" + +#: ../C/gedit.xml:1526(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "" + +#: ../C/gedit.xml:1529(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "" + +#: ../C/gedit.xml:1532(para) +msgid "Number of bytes in the current document." +msgstr "" + +#: ../C/gedit.xml:1537(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" + +#: ../C/gedit.xml:1544(title) +msgid "External Tools Plugin" +msgstr "" + +#: ../C/gedit.xml:1545(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" + +#: ../C/gedit.xml:1546(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" + +#: ../C/gedit.xml:1549(title) +msgid "Built-in Commands" +msgstr "" + +#: ../C/gedit.xml:1550(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" + +#: ../C/gedit.xml:1552(term) +msgid "Build" +msgstr "Version" + +#: ../C/gedit.xml:1554(para) +msgid "Runs make in the current document's directory." +msgstr "" + +#: ../C/gedit.xml:1557(term) +msgid "Directory Listing" +msgstr "" + +#: ../C/gedit.xml:1559(para) +msgid "Lists the contents of the current document's directory in a new document." +msgstr "" + +#: ../C/gedit.xml:1562(term) +msgid "Environment Variables" +msgstr "" + +#: ../C/gedit.xml:1564(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "" + +#: ../C/gedit.xml:1567(term) +msgid "Grep" +msgstr "" + +#: ../C/gedit.xml:1569(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" + +#: ../C/gedit.xml:1572(term) +msgid "Remove Trailing Spaces" +msgstr "" + +#: ../C/gedit.xml:1574(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "" + +#: ../C/gedit.xml:1581(title) +msgid "Defining a Command" +msgstr "" + +#: ../C/gedit.xml:1582(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" + +#: ../C/gedit.xml:1583(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" + +#: ../C/gedit.xml:1585(term) +msgid "Description" +msgstr "Descripcion" + +#: ../C/gedit.xml:1587(para) +msgid "This description is shown in the statusbar when the menu command is chosen." +msgstr "" + +#: ../C/gedit.xml:1590(term) +msgid "Accelerator" +msgstr "" + +#: ../C/gedit.xml:1592(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "" + +#: ../C/gedit.xml:1595(term) +msgid "Commands" +msgstr "Comandas" + +#: ../C/gedit.xml:1597(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" + +#: ../C/gedit.xml:1600(term) +msgid "Input" +msgstr "Entrada" + +#: ../C/gedit.xml:1602(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" + +#: ../C/gedit.xml:1605(term) +msgid "Output" +msgstr "Sortida" + +#: ../C/gedit.xml:1607(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" + +#: ../C/gedit.xml:1610(term) +msgid "Applicability" +msgstr "" + +#: ../C/gedit.xml:1612(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" + +#: ../C/gedit.xml:1620(title) +msgid "Editing and Removing Tools" +msgstr "" + +#: ../C/gedit.xml:1621(para) +msgid "To edit a tool, select it in the list and make changes to its properties." +msgstr "" + +#: ../C/gedit.xml:1622(para) +msgid "To rename a tool, click it again in the list." +msgstr "" + +#: ../C/gedit.xml:1623(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" + +#: ../C/gedit.xml:1624(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" + +#: ../C/gedit.xml:1628(title) +msgid "Variables" +msgstr "Variables" + +#: ../C/gedit.xml:1629(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" + +#: ../C/gedit.xml:1632(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "" + +#: ../C/gedit.xml:1635(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "" + +#: ../C/gedit.xml:1638(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "" + +#: ../C/gedit.xml:1641(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "" + +#: ../C/gedit.xml:1644(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "" + +#: ../C/gedit.xml:1647(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "" + +#: ../C/gedit.xml:1650(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "" + +#: ../C/gedit.xml:1657(title) +msgid "File Browser Plugin" +msgstr "" + +#: ../C/gedit.xml:1658(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" + +#: ../C/gedit.xml:1659(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" + +#: ../C/gedit.xml:1661(title) +msgid "Browsing your Files" +msgstr "" + +#: ../C/gedit.xml:1662(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" + +#: ../C/gedit.xml:1663(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" + +#: ../C/gedit.xml:1664(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" + +#: ../C/gedit.xml:1668(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" + +#: ../C/gedit.xml:1671(title) +msgid "Creating Files and Folders" +msgstr "" + +#: ../C/gedit.xml:1672(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" + +#: ../C/gedit.xml:1673(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" + +#: ../C/gedit.xml:1678(title) +msgid "Indent Lines Plugin" +msgstr "" + +#: ../C/gedit.xml:1679(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" + +#: ../C/gedit.xml:1680(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" + +#: ../C/gedit.xml:1682(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" + +#: ../C/gedit.xml:1687(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" + +#: ../C/gedit.xml:1690(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" + +#: ../C/gedit.xml:1695(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" + +#: ../C/gedit.xml:1700(title) +msgid "Insert Date/Time Plugin" +msgstr "" + +#: ../C/gedit.xml:1701(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" + +#: ../C/gedit.xml:1703(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" + +#: ../C/gedit.xml:1704(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" + +#: ../C/gedit.xml:1705(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" + +#: ../C/gedit.xml:1710(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "" + +#: ../C/gedit.xml:1711(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" + +#: ../C/gedit.xml:1719(para) +msgid "Select the Insert Date/Time plugin." +msgstr "" + +#: ../C/gedit.xml:1722(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" + +#: ../C/gedit.xml:1725(para) +msgid "Select one of the options, as follows:" +msgstr "" + +#: ../C/gedit.xml:1727(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" + +#: ../C/gedit.xml:1730(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" + +#: ../C/gedit.xml:1733(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" + +#: ../C/gedit.xml:1738(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" + +#: ../C/gedit.xml:1741(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" + +#: ../C/gedit.xml:1748(title) +msgid "Modelines Plugin" +msgstr "" + +#: ../C/gedit.xml:1749(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" + +#: ../C/gedit.xml:1750(para) +msgid "You can override the following preferences with modelines:" +msgstr "" + +#: ../C/gedit.xml:1753(para) +msgid "Tab width" +msgstr "" + +#: ../C/gedit.xml:1756(para) +msgid "Insert spaces instead of tabs" +msgstr "" + +#: ../C/gedit.xml:1762(para) +msgid "Right margin width" +msgstr "" + +#: ../C/gedit.xml:1766(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" + +#: ../C/gedit.xml:1769(title) +msgid "Emacs Modelines" +msgstr "" + +#: ../C/gedit.xml:1770(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" + +#: ../C/gedit.xml:1771(para) +msgid "" +"The Emacs options for tab-width, indent-tabs-mode " +"and autowrap are supported. For more information, see the GNU Emacs " +"Manual." +msgstr "" + +#: ../C/gedit.xml:1774(title) +msgid "Kate Modelines" +msgstr "" + +#: ../C/gedit.xml:1775(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" + +#: ../C/gedit.xml:1776(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" + +#: ../C/gedit.xml:1779(title) +msgid "Vim Modelines" +msgstr "" + +#: ../C/gedit.xml:1780(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" + +#: ../C/gedit.xml:1781(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"wrap, and textwidth are supported. For more information, see the Vim website." +msgstr "" + +#: ../C/gedit.xml:1786(title) +msgid "Python Console Plugin" +msgstr "" + +#: ../C/gedit.xml:1787(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" + +#: ../C/gedit.xml:1788(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" + +#: ../C/gedit.xml:1792(title) +msgid "Snippets Plugin" +msgstr "" + +#: ../C/gedit.xml:1793(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" + +#: ../C/gedit.xml:1794(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" + +#: ../C/gedit.xml:1795(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" + +#: ../C/gedit.xml:1798(title) +msgid "Inserting Snippets" +msgstr "" + +#: ../C/gedit.xml:1799(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" + +#: ../C/gedit.xml:1800(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" + +#: ../C/gedit.xml:1804(title) +msgid "Adding Snippets" +msgstr "" + +#: ../C/gedit.xml:1805(para) +msgid "To create a new snippet, do the following:" +msgstr "" + +#: ../C/gedit.xml:1808(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" + +#: ../C/gedit.xml:1811(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" + +#: ../C/gedit.xml:1814(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" + +#: ../C/gedit.xml:1817(para) +msgid "Enter the following information for the new snippet:" +msgstr "" + +#: ../C/gedit.xml:1819(term) +msgid "Name" +msgstr "Nom" + +#: ../C/gedit.xml:1821(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" + +#: ../C/gedit.xml:1824(term) +msgid "Snippet text" +msgstr "" + +#: ../C/gedit.xml:1826(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" + +#: ../C/gedit.xml:1827(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" + +#: ../C/gedit.xml:1830(term) +msgid "Tab Trigger" +msgstr "" + +#: ../C/gedit.xml:1832(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" + +#: ../C/gedit.xml:1833(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" + +#: ../C/gedit.xml:1836(term) +msgid "Shortcut key" +msgstr "" + +#: ../C/gedit.xml:1838(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "" + +#: ../C/gedit.xml:1847(title) +msgid "Editing and Removing Snippets" +msgstr "" + +#: ../C/gedit.xml:1848(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" + +#: ../C/gedit.xml:1849(para) +msgid "To rename a snippet, click it again in the list." +msgstr "" + +#: ../C/gedit.xml:1850(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" + +#: ../C/gedit.xml:1851(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" + +#: ../C/gedit.xml:1855(title) +msgid "Snippet Substitutions" +msgstr "" + +#: ../C/gedit.xml:1856(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" + +#: ../C/gedit.xml:1860(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" + +#: ../C/gedit.xml:1862(term) +msgid "Tab placeholders" +msgstr "" + +#: ../C/gedit.xml:1864(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" + +#: ../C/gedit.xml:1865(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" + +#: ../C/gedit.xml:1866(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" + +#: ../C/gedit.xml:1867(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" + +#: ../C/gedit.xml:1868(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" + +#: ../C/gedit.xml:1871(term) +msgid "Mirror placeholders" +msgstr "" + +#: ../C/gedit.xml:1873(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" + +#: ../C/gedit.xml:1876(term) +msgid "End placeholder" +msgstr "" + +#: ../C/gedit.xml:1878(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" + +#: ../C/gedit.xml:1881(term) +msgid "Environmental variables" +msgstr "" + +#: ../C/gedit.xml:1883(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" + +#: ../C/gedit.xml:1885(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "" + +#: ../C/gedit.xml:1887(para) +msgid "The currently selected text." +msgstr "" + +#: ../C/gedit.xml:1890(term) +msgid "$GEDIT_FILENAME" +msgstr "" + +#: ../C/gedit.xml:1892(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" + +#: ../C/gedit.xml:1895(term) +msgid "$GEDIT_BASENAME" +msgstr "" + +#: ../C/gedit.xml:1897(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" + +#: ../C/gedit.xml:1900(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "" + +#: ../C/gedit.xml:1902(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" + +#: ../C/gedit.xml:1910(term) +msgid "Shell placeholders" +msgstr "" + +#: ../C/gedit.xml:1912(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" + +#: ../C/gedit.xml:1913(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" + +#: ../C/gedit.xml:1916(term) +msgid "Python placeholders" +msgstr "" + +#: ../C/gedit.xml:1918(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" + +#: ../C/gedit.xml:1919(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" + +#: ../C/gedit.xml:1920(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" + +#: ../C/gedit.xml:1929(title) +msgid "Sort Plugin" +msgstr "" + +#: ../C/gedit.xml:1930(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" + +#: ../C/gedit.xml:1931(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" + +#: ../C/gedit.xml:1934(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "" + +#: ../C/gedit.xml:1937(para) +msgid "Select the lines of text you want to sort." +msgstr "" + +#: ../C/gedit.xml:1939(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" + +#: ../C/gedit.xml:1942(para) +msgid "Choose the options you want for the sort:" +msgstr "" + +#: ../C/gedit.xml:1945(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" + +#: ../C/gedit.xml:1948(para) +msgid "To delete duplicate lines, select Remove duplicates." +msgstr "" + +#: ../C/gedit.xml:1951(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" + +#: ../C/gedit.xml:1954(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" + +#: ../C/gedit.xml:1959(para) +msgid "To perform the sort operation, click Sort." +msgstr "" + +#: ../C/gedit.xml:1966(title) +msgid "Spell Checker Plugin" +msgstr "" + +#: ../C/gedit.xml:1967(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" + +#: ../C/gedit.xml:1969(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" + +#: ../C/gedit.xml:1972(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" + +#: ../C/gedit.xml:1973(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" + +#: ../C/gedit.xml:1976(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" + +#: ../C/gedit.xml:1979(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" + +#: ../C/gedit.xml:1982(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" + +#: ../C/gedit.xml:1987(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" + +#: ../C/gedit.xml:1989(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" + +#: ../C/gedit.xml:1991(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" + +#: ../C/gedit.xml:1994(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" + +#: ../C/gedit.xml:1997(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" + +#: ../C/gedit.xml:2000(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" + +#: ../C/gedit.xml:2003(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" + +#: ../C/gedit.xml:2006(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" + +#: ../C/gedit.xml:2009(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" + +#: ../C/gedit.xml:2012(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" + +#: ../C/gedit.xml:2021(title) +msgid "Tag List Plugin" +msgstr "" + +#: ../C/gedit.xml:2022(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" + +#: ../C/gedit.xml:2023(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "" + +#: ../C/gedit.xml:2025(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" + +#: ../C/gedit.xml:2029(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" + +#: ../C/gedit.xml:2031(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" + +#: ../C/gedit.xml:2034(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "" + +#: ../C/gedit.xml:2037(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" + +#: ../C/gedit.xml:2039(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" + +#: ../C/gedit.xml:2042(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" + +#: ../C/gedit.xml:2051(title) +msgid "User Name Plugin" +msgstr "" + +#: ../C/gedit.xml:2052(para) +msgid "" +"The User name plugin inserts the username of the " +"current user into the document." +msgstr "" + +#: ../C/gedit.xml:2053(para) +msgid "" +"To insert your username at the cursor position, choose " +"EditInsert User Name." +msgstr "" + +#: ../C/gedit.xml:2055(para) +msgid "" +"This plugin is mostly provided as an example of how to create your own " +"plugins. For more information on creating plugins, see the gedit website." +msgstr "" + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: ../C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Yannig Marchegay (Kokoyaya) " + diff --git a/help/pt_BR/pt_BR.po b/help/pt_BR/pt_BR.po new file mode 100755 index 00000000..d8f0f64f --- /dev/null +++ b/help/pt_BR/pt_BR.po @@ -0,0 +1,4672 @@ +# Brazilian Portuguese translation of gedit documentation. +# Copyright (C) 2002-2006, 2007 Free Software Foundation, Inc. +# This file is distributed under the same license as the mate-terminal package. +# Wagner Luís de A. M. Macêdo , 2007. +# Pedro Vaz de Mello de Medeiros , 2007. +# Leonardo Ferreira Fontenelle , 2007, 2008. +# Vladimir Melo , 2008. +# Fabricio Godoy , 2008. +# Krix Apolinário , 2009. +# Rodrigo L. M. Flores , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit documentation 2.26.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-05-17 18:37+0000\n" +"PO-Revision-Date: 2009-09-01 21:27-0300\n" +"Last-Translator: Rodrigo L. M. Flores \n" +"Language-Team: Brazilian Portuguese \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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Permissão concedida para copiar, distribuir e/ou modificar este documento " +"dentro dos termos da GNU Free Documentation License (GFDL), Versão 1.1 ou " +"qualquer versão superior publicada pela Free Software Foundation sem Seções " +"Invariantes, Textos de Capa e Contra-Capa. Você pode achar uma cópia do GFDL " +"neste link ou no arquivo " +"COPYING-DOCS distribuido com este 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 "" +"Este manual é parte de uma coleção de manuais do MATE distribuídos sob a " +"GFDL. Se você quiser distribuir este manual separadamente da coleção, você " +"pode fazer adicionando uma cópia da licença ao manual, como descrito na " +"seção 6 da licença." + +#: 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 "" +"Muitos dos nomes usados pelas empresas para distinguir seus produtos e " +"serviços são marcas registradas. Onde esses nomes aparecerem em qualquer " +"documentação do MATE e os membros do Projeto de Documentação do MATE " +"estiverem cientes daquelas marcas registradas, os nomes aparecerão em letras " +"maíusculas ou com iniciais em maíusculas." + +#: 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 " +"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 "" +"O DOCUMENTO É FORNECIDO \"COMO ESTÁ\", SEM GARANTIA DE QUALQUER TIPO, SEJA " +"EXPRESSA OU IMPLÍCITA, INCLUINDO, SEM LIMITAÇÃO, GARANTIAS DE QUE O " +"DOCUMENTO OU VERSÃO MODIFICADA DO MESMO É COMERCIALIZÁVEL, LIVRE DE " +"DEFEITOS, PRÓPRIO PARA UM PROPÓSITO ESPECÍFICO OU SEM INFRAÇÕES. TODO O " +"RISCO REFERENTE À QUALIDADE, PRECISÃO E DESEMPENHO DO DOCUMENTO OU VERSÃO " +"MODIFICADA É SEU. SE ALGUM DOCUMENTO OU VERSÃO MODIFICADA SE PROVAR " +"DEFEITUOSO EM QUALQUER ASPECTO, VOCÊ (NÃO O ESCRITOR INICIAL, AUTOR OU " +"QUALQUER CONTRIBUIDOR) ASSUME O CUSTO DE QUALQUER SERVIÇO NECESSÁRIO, REPARO " +"OU CORREÇÃO. ESTA RENÚNCIA DE GARANTIA CONSTITUI UMA PARTE ESSENCIAL DA " +"LICENÇA. NENHUM USO DE QUALQUER DOCUMENTO OU VERSÃO MODIFICADA DO DOCUMENTO " +"É AUTORIZADO EXCETO SOB ESTA CONDIÇÃO; E SOB NENHUMA CIRCUNSTÂNCIA E NENHUMA " +"TEORIA LEGAL, TANTO EM DANOS (INCLUINDO POR NEGLICÊNCIA), CONTRATO OU " +"OUTROS, DEVEM O AUTOR, ESCRITOR INICIAL, QUALQUER CONTRIBUIDOR OU QUALQUER " +"DISTRIBUIDOR DO DOCUMENTO OU VERSÃO MODIFICADA DO MESMO, OU QUALQUER " +"FORNECEDOR DE QUALQUER DESSAS PARTES, SER CONSIDERADOS RESPONSÁVEIS A " +"QUALQUER PESSOA POR QUALQUER DANO, SEJA DIRETO, INDIRETO, ESPECIAL, " +"ACIDENTAL OU CONSEQÜENCIAL DE QUALQUER INDIVÍDUO, INCLUINDO, SEM LIMITAÇÃO, " +"DANOS POR PERDA DE BOA VONTADE, TRABALHO PARADO, FALHA DE COMPUTADOR OU MAL-" +"FUNCIONAMENTO, OU QUALQUER E TODOS OS OUTROS DANOS OU PERDAS RESULTANTES OU " +"RELACIONADAS AO USO DO DOCUMENTO E VERSÕES MODIFICADAS, MESMO QUE TAL PARTE " +"TENHA SIDO INFORMADA DA POSSIBILIDADE DE TAIS DANOS." + +#: 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: " +"" +msgstr "" +"O DOCUMENTO E VERSÕES MODIFICADAS DO MESMO SÃO FORNECIDO SOB OS TERMOS DA " +"LICENÇA DE DOCUMENTAÇÃO LIVRE GNU (GNU FREE DOCUMENTATION LICENSE) COM O " +"ENTENDIMENTO ADICIONAL DE QUE: " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Manual do Gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Projeto de Documentação do MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Adicionada a Tabela de Teclas de Atalho" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Equipe de Documentação da Sun Java Desktop System" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek forneceu informações das revisões recentes da aplicação gedit." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Reconhecimentos" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George forneceu informações sobre plug-ins." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Manual do gedit V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Março de 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Equipe de Documentação Sun MATE" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Manual do gedit V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Junho de 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Manual do gedit V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Agosto de 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Manual do gedit V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Setembro de 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Manual do gedit V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Janeiro de 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Manual do gedit V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Março de 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Manual do gedit V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Setembro de 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Manual do gedit V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Março de 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Manual do gedit V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Julho de 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Manual do gedit V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "Equipe de Documentação do MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Este manual descreve a versão 2.16 do gedit." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Comentários" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Para relatar um erro ou fazer uma sugestão a respeito do gedit ou desse manual, siga as instruções da Página de Comentários do MATE." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"O gedit é um editor de texto para o MATE, contando com recursos básicos mas " +"robustos como impressão, verificação ortográfica, localização e " +"substituição, e destaque de sintaxe. Recursos mais avançados estão " +"disponíveis como plug-ins." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "editor de texto" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Introdução" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"O gedit permite a você criar e editar arquivos de " +"texto." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"O propósito do gedit é ser um editor de texto " +"simples e fácil de usar. Recursos mais poderosos podem ser habilitados com " +"diferentes plug-ins, permitindo uma variedade de " +"tarefas relacionadas à edição de texto." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Iniciando" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Iniciando o gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"Você pode iniciar o gedit das seguintes formas:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Menu Aplicações" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Selecione AcessóriosEditor " +"de Texto." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Linha de comando" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Execute o seguinte comando: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Por padrão, quando você abre um arquivo de texto no gerenciador de arquivos, " +"gedit irá iniciar e exibir o documento." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "A Janela do gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Quando iniciar o gedit, a seguinte janela é " +"exibida:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Janela do gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Exibe janela principal do gedit." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"A janela do gedit contém os seguintes elementos:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Barra de Menus" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Os menus na barra de menus contêm todos os comandos de que você precisa para " +"trabalhar com arquivos no gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Barra de Ferramentas" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"A barra de ferramentas contém um subconjunto dos comandos que você pode " +"acessar a partir da barra de menus." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Área de Visualização" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "" +"A área de visualização contém o texto do arquivo que está sendo editado." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Barra de Status" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"A barra de status exibe informação sobre a atividade corrente do " +"gedit e informação contextual sobre os itens do " +"menu. A barra de status também exibe a seguinte informação:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "" +"Posição do cursor: o número da linha e da coluna onde o cursor está " +"localizado." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Modo de edição: Se o editor estiver em modo de inserção, a barra de status " +"exibe o texto INS. Se o editor estiver em modo de " +"sobrescrita, a barra de status exibe o texto SBR. " +"Pressione a tecla Insert para alterar o modo de edição." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Painel Lateral" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"O painel lateral exibe uma lista de documentos abertos e outras informações, " +"dependendo de quais plug-ins estão sendo usados." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Por padrão o painel lateral não é exibido. Para exibi-lo, escolha " +"VerPainel Lateral." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Painel Inferior" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"O painel inferior é usado por ferramentas de programação como o plug-in " +"Console Python para exibir saída." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"Por padrão o painel inferior não é mostrado. Para mostrá-lo, escolha " +"VerPainel Inferior." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"Quando você pressiona o botão direito do mouse na janela do " +"gedit, é exibido um menu de contexto. O menu de " +"contexto contém os comandos de edição mais usados." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Assim como em outras aplicações do MATE, ações no gedit podem ser efetuadas de várias formas: com o menu, com a barra " +"de ferramentas ou com teclas de atalho. Teclas de atalho comuns a todas as " +"aplicações são listadas no Guia do Usuário." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Executando gedit a partir da Linha de Comando" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Você pode executar o gedit a partir da linha de " +"comando e abrir um ou vários arquivos. Para abrir vários arquivos pela linha " +"de comando, digite o seguinte comando, então pressione Enter:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "arquivo1.txt arquivo2.txt arquivo3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "" +"Em alternativa, você pode especificar um URI em lugar de um nome de arquivo." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Para mais informações em como executar o gedit a " +"partir da linha de comando, veja a página do manual unix para gedit, gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Trabalhando com Arquivos" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Criando um Novo Documento" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Para criar um novo documento, escolha ArquivoNovo. A aplicação exibe um " +"novo documento em branco na janela do gedit." + +#: C/gedit.xml:346(title) C/gedit.xml:1589(title) +msgid "Opening a File" +msgstr "Abrindo um Arquivo" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Para abrir um arquivo, escolha ArquivoAbrir para exibir a janela " +"de Abrir Arquivo. Selecione o arquivo que você quer " +"abrir, então clique no botão Abrir. O arquivo é " +"exibido na janela do gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Mostra Arquivos Recentes no ícone do menu." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"A aplicação guarda os caminhos e nomes de arquivo dos cinco últimos arquivos " +"editados e exibe os arquivos como itens do menu " +"Arquivo. Você pode também clicar " +"no ícone na barra de ferramentas para exibir a lista dos " +"arquivos recentes." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"Você pode abrir vários arquivos no gedit. A " +"aplicação adiciona uma aba na janela para cada arquivo aberto. Para mais " +"informações veja a ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Salvando um Arquivo" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Você pode salvar arquivos das seguintes formas:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Para salvar alterações a um arquivo existente, escolha " +"ArquivoSalvar." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Para salvar um novo arquivo ou salvar um existente sob um novo nome, escolha " +"ArquivoSalvar Como. Digite um nome para o arquivo na janela " +"Salvar Como, então clique no botão Salvar." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Para salvar todos os arquivos abertos no gedit, " +"escolha DocumentosSalvar Todos." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Para fechar todos os arquivos abertos no gedit, " +"escolha DocumentosFechar Todos." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Abrindo um Arquivo a partir de um URI" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Para abrir um arquivo a partir de um Identificador Uniforme de Recursos (do " +"inglês URI, Uniform Resource Identifier), efetue os seguintes passos:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Selecione ArquivoAbrir " +"Localização para exibir a janela Abrir " +"Localização." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Digite o URI do arquivo que você deseja abrir." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Use a lista Codificação de caracteres para selecionar a " +"codificação de caracteres apropriada." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Clique no botão Abrir." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Tipos válidos de URI são http:, ftp:, file: e todos os " +"métodos aceitos pelo mate-vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Arquivos que estão em alguns tipos de URI são abertos como somente para " +"leitura, e qualquer mudança que você fizer deve ser salva em um local " +"diferente. O HTTP só permite que os arquivos sejam lidos. Arquivos aberto a " +"partir de FTP são somente para leitura porque nem todos os servidores de FTP " +"trabalham corretamente salvando arquivos remotos." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Salvar em servidores FTP pode ser habilitado com o Editor de Configurações, ajustando a chave /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, mas isso pode causar erros." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Trabalhando com Abas" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Quando mais de um arquivo está aberto, o gedit " +"mostra uma aba para cada documento acima da área de " +"visualização. Para mudar para outro documento, clique na aba correspondente." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Para mover um documento para outra janela do gedit, arraste a aba correspondente ao arquivo para a janela que você " +"deseja que receba o arquivo." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Para mover um documento para uma nova janela do gedit, ou arraste a aba correspondente para a área de trabalho, ou " +"escolha DocumentosMover para " +"Nova Janela." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Trabalhando com Texto" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Editando Texto" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Você pode editar o texto de um arquivo das seguintes maneiras:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Digite o novo texto no teclado. O cursor de inserção " +"piscante marca o ponto onde o novo texto aparece. Para mudar isso, use as " +"teclas de seta no teclado ou clique com o mouse." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Para copiar o texto selecionado para a área de transferência, escolha " +"EditarCopiar." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Para apagar o texto selecionado do arquivo e mover esse texto para a área de " +"transferência, escolha EditarRecortar." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Para apagar permanentemente o texto selecionado do arquivo, escolha " +"EditarExcluir." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Para inserir o conteúdo da área de transferência na posição do cursor, " +"escolha EditarColar. Você deve cortar ou copiar um texto antes que " +"você possa colar dentro do arquivo, a partir do gedit ou qualquer outra " +"aplicação." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Para selecionar todo o texto em um arquivo, escolha " +"EditarSelecionar Tudo." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Desfazendo e Refazendo Alterações" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Para desfazer uma alteração que você tenha feito, escolha " +"EditarDesfazer. Para reverter essa ação, escolha EditarRefazer." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Procurando e Substituindo" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"No gedit, há duas formas de pesquisar por texto. " +"Você pode usar a janela Localizar para procurar por um " +"pedaço de texto específico, ou a Pesquisa Incremental " +"para destacar o texto à medida que você for digitando." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Procurando Texto" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "" +"Para pesquisar em um arquivo por uma seqüência de texto, efetue os seguintes " +"passos:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Selecione PesquisarLocalizar para exibir a janela Localizar." + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Digite o texto que você deseja procurar no campo Pesquisar por. Você pode incluir caracteres especiais como uma nova linha ou " +"tabulação: veja a ." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Clique no botão Localizar para pesquisar no arquivo a " +"primeira ocorrência do texto depois da posição atual do cursor. Se o " +"gedit encontrar o texto, a aplicação seleciona a " +"primeira ocorrência do mesmo. Outras ocorrências do texto são destacadas." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Para procurar a próxima ocorrência do texto, clique no botão " +"Localizar ou escolha PesquisarLocalizar Próxima. Para " +"procurar pela ocorrência anterior do texto, escolha " +"PesquisarLocalizar Anterior." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Depois que você fechar a janela Localizar, você ainda " +"pode mover a seleção às outras ocorrências do texto selecionando " +"PesquisarLocalizar Próxima e PesquisarLocalizar Anterior." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Para remover o destaque do texto, escolha PesquisarLimpar Destaque." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Pesquisa Incremental" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"Pesquisa incremental destaca o texto no documento à medida que você digita, " +"letra por letra. (É similar ao recurso de pesquisa em diversos navegadores " +"web.)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Para iniciar uma pesquisa incremental, escolha " +"PesquisarPesquisa Incremental. A caixa de pesquisa aparece no topo da área de " +"visualização." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Comece a digitar e o texto será destacado no documento. A primeira instância " +"depois da posição do cursor também é selecionada." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Para avançar a seleção para a próxima ocorrência enquanto mantém a caixa de " +"pesquisa incremental aberta, pressione CtrlG. Pressione CtrlShiftG para voltar à " +"ocorrência anterior." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Você pode também usar as teclas de seta para cima e para baixo ou o botão de " +"rolagem do mouse para mover a seleção entre as ocorrências." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Substituindo Texto" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Para pesquisar em um arquivo por uma seqüência de texto e substituí-la por " +"uma seqüência alternativa, siga os seguintes passos:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Selecione PesquisarSubstituir para exibir a janela Substituir." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Digite o texto que você quer procurar no campo Pesquisar por. Você pode incluir caracteres especiais como uma nova linha ou " +"tabulação: veja a ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"Digite o texto que você deseja usar para substituir o que você encontrar, no " +"campo Substituir por." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Para examinar cada ocorrência do texto antes de substituir, clique no botão " +"Localizar. Se o gedit " +"encontrar o texto, a aplicação o seleciona. Clique no botão " +"Substituir para substituir a ocorrência selecionada " +"do texto. Para procurar pela próxima ocorrência do texto, clique no botão " +"Localizar novamente." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Para substituir todas as ocorrências do texto por todo documento, clique no " +"botão Substituir Todas." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Opções de Procurar e Substituir" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"A janela Localizar e a janela Substituir ambas têm as seguintes opções:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Selecione a opção Diferenciar maiúsculas/minúsculas " +"para encontrar somente ocorrências do texto que coincidam com as letras " +"maiúsculas e minúsculas no texto que você digitou. Por exemplo, com " +"Diferenciar maiúsculas/minúsculas selecionada, \"TEXTO" +"\" não encontrará \"texto\"." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Selecione a opção Coincidir apenas com palavra completa " +"para procurar somente ocorrências do texto que coincidam com todas as " +"palavras do texto que você digitou. Por exemplo, com Coincidir " +"apenas com palavra completa selecionada, \"text\" não encontrará " +"\"textura\"." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Selecione a opção Pesquisar para trás para pesquisar " +"voltando em direção ao início do documento." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"Selecione a opção Voltar ao início para pesquisar até o " +"fim do documento e então continuar a pesquisa a partir do início do arquivo." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Caracteres Especiais" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"Você pode incluir as seguintes seqüências de escape nos textos a encontrar " +"ou substituir para representar caracteres especiais:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Especifica uma nova linha." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Especifica um caractere de tabulação." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Especifica um retorno do carro (do inglês CR, carriage return)." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"O próprio caractere de barra invertida deve ser escapado se ele estiver na " +"busca. Por exemplo, se você estiver procurando pela literal \"\\n\", terá que escrever \"\\\\n\" no campo Pesquisar por. Ou se você estiver procurando por uma seqüência de barras " +"invertidas, você terá que dobrar o número de barras invertidas pesquisadas." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Posicionando o Cursor em uma Linha Específica" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Para posicionar o cursor numa linha específica no arquivo atual, escolha " +"PesquisarIr para a Linha. A caixa de número da linha aparece no topo da " +"área de visualização." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Comece a digitar o número da linha para a qual você deseja mover o cursor e " +"o documento irá até a linha especificada." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Para fechar a caixa e mover o cursor à linha especificada, pressione " +"Enter." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Imprimindo" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Configurando as Opções de Página" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Para configurar as opções de página, escolha ArquivoConfiguração da Página para " +"exibir a janela de Configuração de Página." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" +"A janela de Configuração de Página permite a você " +"especificar as seguintes opções de impressão:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Seção da Aba Geral" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Imprimir o destaque de sintaxe" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Selecione essa opção para imprimir o destaque de sintaxe. Para mais " +"informações sobre destaque de sintaxe, veja a ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Imprimir cabeçalhos da página" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Selecione essa opção para incluir um cabeçalho em cada página que você " +"imprimir. Você não pode alterar o cabeçalho." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "Números de Linha" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Selecione a opção Imprimir números de linha para " +"incluir os números de linha quando você imprimir um arquivo." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Use o seletor numérico Enumerar a cada ... linhas para " +"especificar com que freqüência imprimir as linhas numeradas, por exemplo, a " +"cada 5 linhas, a cada 10 linhas, e assim por diante." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1168(guilabel) C/gedit.xml:1685(para) +msgid "Text Wrapping" +msgstr "Quebra de Texto" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Selecione a opção Habilitar quebra de texto para " +"quebrar o texto em uma nova linha, num nível de caractere, quando você " +"imprimir um arquivo. A aplicação conta linhas quebradas como uma nova linha " +"para propósitos de numeração de linhas." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Selecione a opção Não dividir uma palavra em duas linhas para quebrar o texto em uma nova linha sem dividir a palavra, " +"quando você imprimir um arquivo." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Fontes" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Corpo" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" +"Clique nesse botão para selecionar a fonte a ser usada na impressão do corpo " +"do texto de um arquivo." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Números de linha" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" +"Clique nesse botão para selecionar a fonte a ser usada na impressão dos " +"números de linha." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Cabeçalhos e rodapés" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Clique nesse botão para selecionar a fonte a ser usada na impressão dos " +"cabeçalhos e rodapés em um arquivo." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Para restaurar as fontes para impressão de um arquivo no gedit para o padrão, clique em Restaurar Fontes Padrão." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Imprimindo um Documento" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Você pode usar o gedit para realizar as seguintes " +"operações de impressão:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Imprimir um documento para uma impressora." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Imprimir a saída do comando de impressão para um arquivo." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"Se você imprimir para um arquivo, o gedit envia a " +"saída do arquivo para um formato de arquivo pré-impresso. Os formatos pré-" +"impressos mais comuns são o PostScript e o Portable Document Format (PDF, " +"Formato de Documento Portátil, em português)." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Para ver como ficarão as página que você deseja imprimir, escolha " +"ArquivoVisualizar Impressão." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Para imprimir o arquivo atual para uma impressora ou um arquivo, escolha " +"ArquivoImprimir para exibir a janela Imprimir." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" +"A janela Imprimir permite a você especificar as " +"seguintes opções de impressão:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Seção da Aba Trabalho" + +# Traduzi como 'Imprimir intervalo' para ficar de acordo com a tradução da UI. O correto (ao menos para mim) seria 'Intervalo de impressão'. +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Imprimir intervalo" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Selecione uma das seguintes opções para determinar quantas páginas imprimir:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Tudo" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Selecione essa opção para imprimir todas as páginas no arquivo." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Linhas" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"Selecione essa opção para imprimir somente as linhas especificadas. Use os " +"seletores numéricos De e Até para " +"especificar o intervalo de linhas." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Seleção" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Selecione essa opção para imprimir somente o texto selecionado. Essa opção " +"só está disponível se você selecionar um texto." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Cópias" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"Use o seletor numérico Número de cópias para " +"especificar o número de cópias do arquivo que você deseja imprimir." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Se você imprimir múltiplas cópias do arquivo, selecione a opção " +"Agrupar para agrupar as cópias impressas." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Seção da Aba Impressora" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Impressora" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Use essa lista suspensa para selecionar a impressora para a qual você deseja " +"mandar imprimir o arquivo." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Configurações" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "" +"Use essa lista suspensa para selecionar as configurações da impressora." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Para configurar a impressora, clique em Configurar. " +"Você pode, por exemplo, habilitar ou desabilitar impressão duplex, ou " +"agendar impressão com atraso, se a impressora tiver suporte a essa " +"funcionalidade." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Localização" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"Use essa lista suspensa para selecionar um dos seguintes destinos de " +"impressão:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Imprimir o arquivo para uma impressora CUPS." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Se a impressora selecionada é uma impressora CUPS, CUPS " +"é a única opção nessa lista suspensa." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Imprimir o arquivo em uma impressora." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Arquivo" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Imprimir o arquivo em um arquivo PostScript." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Clique em Salvar Como para exibir uma janela onde " +"você especifica o nome e localização do arquivo PostScript." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Personalizado" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Use o comando especificado para imprimir o arquivo." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" +"Digite o nome do comando na caixa de texto. Inclua todos os argumentos de " +"linha de comando." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Estado" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Esta versão do gedit não tem suporte a essa funcionalidade." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Tipo" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Comentário" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Seção da Aba Papel" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Tamanho do papel" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"Use essa lista suspensa para selecionar o tamanho do papel no qual você " +"deseja imprimir o arquivo." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Largura" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"Use esse seletor numérico para especificar a largura do papel. Use a lista " +"suspensa adjacente para alterar a unidade de medida." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Altura" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Use esse seletor numérico para especificar a altura do papel." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Orientação para alimentação" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" +"Use essa lista suspensa para selecionar a orientação do papel na impressora." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Orientação da página" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Use essa lista suspensa para selecionar a orientação da página." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Disposição" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Use essa lista suspensa para selecionar a disposição da página. Uma " +"visualização de cada disposição que você selecionar é exibida na área de " +"Visualização." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Bandeja de papel" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Use essa lista suspensa para selecionar a bandeja de papel." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Recursos de Programação" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Vários dos recursos para programação do gedit são " +"proporcionados com plug-ins. Por exemplo, o plug-in de Lista de Tags oferece " +"uma lista de tags comumente usadas em diferentes linguagens de marcação: " +"veja a ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Destaque de Sintaxe" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"O destaque de sintaxe faz o código fonte ficar mais legível, mostrando as " +"diferentes partes do texto em cores diferenciadas." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"O gedit escolhe um modo de destaque de sintaxe " +"apropriado baseado no tipo de documento. Para sobrepor o modo de destaque de " +"sintaxe, escolha VerModo de " +"Destaque, então escolha um dos seguintes itens de " +"menu:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Nenhum" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Não exibe qualquer destaque de sintaxe." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Fontes" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"Exibe destaques de sintaxe para editar código fonte. Use o submenu " +"Fontes para selecionar o tipo de código fonte." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Marcação" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"Exibe destaques de sintaxe para editar código de marcação. Use o submenu " +"Marcação para selecionar o tipo de código de " +"marcação." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Scripts" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"Exibe destaque de sintaxe para editar código de script. Use o submenu " +"Scripts para selecionar o tipo de código de script." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Outros" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"Exibe destaque de sintaxe para editar outros tipos de código. Use o submenu " +"Outros para selecionar o tipo de código." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Passando a Saída de um Comando para um Arquivo" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Você pode usar o gedit para redirecionar a saída " +"de um comando para um arquivo de texto. Por exemplo, para passar a saída de " +"um comando ls para um arquivo de texto, digite " +"ls | gedit, então pressione Enter." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"A saída do comando ls é exibida num novo arquivo de texto " +"na janela do gedit." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Opcionalmente, você pode usar o plug-in Ferramentas externas para redirecionar a saída de um comando para o arquivo atual." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Teclas de Atalho" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Use as teclas de atalho para realizar as tarefas mais comuns mais " +"rapidamente que com o mouse e menus. As seguintes tabelas listam todas as " +"teclas de atalho do gedit." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Para mais informações sobre teclas de atalho, veja o Desktop User Guide." + +# De acordo com Claude Paroz, podemos considerar apenas o uso de "Tabs" no +# guilabel, não no bridgehead. http://bugzilla.mate.org/show_bug.cgi?id=500542 +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "Tabulações" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Atalhos para abas:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1016(para) C/gedit.xml:1044(para) C/gedit.xml:1091(para) +#: C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "Tecla de Atalho" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) C/gedit.xml:1046(para) C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Command" +msgstr "Comando" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Muda para a próxima aba à esquerda." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Muda para a próxima aba à direita." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Fecha a aba." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Salva todas as abas." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Fecha todas as abas." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Pula para a aba número n." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Arquivos" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Atalhos para trabalhar com arquivos:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Criar um novo documento." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Abrir um documento." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Abrir uma localização." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Salvar o documento atual para o disco." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Salvar o documento atual com um novo nome." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Imprimir o documento atual." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Visualizar a impressão." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Fechar o documento atual." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Sair do Gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1406(guimenu) +#: C/gedit.xml:1412(guimenu) C/gedit.xml:1418(guimenu) +#: C/gedit.xml:1424(guimenu) +msgid "Edit" +msgstr "Editar" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Atalhos para edição de documentos:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Desfazer a última ação." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Refazer a última ação desfeita." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "" +"Cortar o texto selecionado ou região e mandar para a área de transferência." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Copiar o texto selecionado ou região para a área de transferência." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Colar o conteúdo da área de transferência." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Selecionar tudo." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Remove a linha atual." + +#. ============= Panes ======================= +#: C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "Painéis" + +#: C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Atalhos para mostrar e esconder painéis:" + +#: C/gedit.xml:1023(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "Mostrar/esconder o painel lateral." + +#: C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "Mostrar/esconder o painel inferior." + +#. ============= Search ======================= +#: C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "Pesquisa" + +#: C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "Atalhos para pesquisa:" + +#: C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "Localizar um texto." + +#: C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "Localizar a próxima instância do texto." + +#: C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "Localizar a instância anterior do texto." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "Pesquisa interativa." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "Pesquisar e substituir." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "Limpar destaque." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "Ir para a linha." + +#. ============= Tools ======================= +#: C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "Ferramentas" + +#: C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "Atalhos para ferramentas:" + +#: C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "Verificar ortografia (com plug-in)." + +#: C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Remover espaços à direita (com plug-in)." + +#: C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "Criar recuo (com plug-in)." + +#: C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "Remover recuo (com plug-in)." + +#: C/gedit.xml:1114(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Executa \"make\" no diretório atual (com plug-in)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "Listar diretórios (com plug-in)." + +#. ============= Help ======================= +#: C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "Ajuda" + +#: C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "Atalhos para ajuda:" + +#: C/gedit.xml:1141(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "Abrir o manual do usuário do gedit." + +#: C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "Preferências" + +#: C/gedit.xml:1156(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Para configurar o gedit, escolha " +"EditarPreferências. A janela Preferências contém " +"as seguintes categorias:" + +#: C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "Preferências de Visualização" + +# O ponto ao fim do parágrafo é de propósito, mesmo que ausente no original +#: C/gedit.xml:1170(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Selecione a opção Habilitar quebra de texto para que " +"linhas grandes de texto formem parágrafos, ao invés de se perderem além do " +"limite da área de texto. Isso evita ter que rolar o texto horizontalmente." + +#: C/gedit.xml:1171(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Selecione a opção Não dividir uma palavra em duas linhas para que a opção quebra de texto preserve palavras inteiras quando " +"o texto fluir para a próxima linha. Isso torna o texto mais fácil de ler." + +#: C/gedit.xml:1177(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Selecione a opção Mostrar números de linha para exibir " +"os números de linha no lado esquerdo da janela do gedit." + +#: C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "Linha Atual" + +#: C/gedit.xml:1183(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Selecione a opção Destacar linha atual para destacar a " +"linha onde o cursor está posicionado." + +#: C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "Margem Direita" + +#: C/gedit.xml:1189(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Selecione a opção Mostrar margem direita para exibir " +"uma linha vertical que indica a margem direita." + +#: C/gedit.xml:1190(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Use o seletor numérico Margem direita na coluna para " +"especificar a localização da linha vertical." + +#: C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "Parênteses Correspondentes" + +#: C/gedit.xml:1196(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Selecione a opção Destacar parênteses correspondentes " +"para destacar o parêntese correspondente quando o cursor está posicionado em " +"um caractere de parêntese." + +#: C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "Preferências do Editor" + +#: C/gedit.xml:1209(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"Use o seletor numérico Largura das tabulações para " +"especificar a largura do espaço que o gedit " +"insere quando você pressiona a tecla Tab." + +#: C/gedit.xml:1210(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Selecione a opção Inserir espaços em vez de tabulações " +"para especificar que o gedit insira espaços ao " +"invés de caracteres de tabulações quando você pressionar a tecla " +"Tab." + +#: C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "Recuo Automático" + +#: C/gedit.xml:1216(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Selecione a opção Habilitar recuo automático para " +"especificar que a próxima linha inicie no mesmo nível de recuo da linha " +"atual." + +#: C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "Salvando o Arquivo" + +#: C/gedit.xml:1222(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"Selecione a opção Criar uma cópia de backup dos arquivos antes de " +"salvar para criar uma cópia de segurança de um arquivo cada vez " +"que salvar o arquivo. A cópia de segurança do arquivo contém um ~ no final " +"do nome do arquivo." + +#: C/gedit.xml:1223(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Selecione a opção Salvar arquivos automaticamente a cada ... " +"minutos para salvar automaticamente o arquivo atual em intervalos " +"regulares. Use o seletor numérico para especificar com que freqüência você " +"deseja salvar o arquivo." + +#: C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "Preferências de Fonte & Cores" + +#: C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "Fonte" + +#: C/gedit.xml:1235(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Selecione a opção Usar fonte de largura fixa padrão " +"para usar a fonte padrão do sistema para o texto na área de texto do " +"gedit." + +#: C/gedit.xml:1236(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"O campo Fonte do editor exibe a fonte que o " +"gedit usa para exibir texto. Clique no botão para " +"especificar o tipo de fonte, estilo e tamanho a usar para o texto." + +#: C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "Esquema de cor" + +#: C/gedit.xml:1242(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"Você pode escolher um esquema de cor na lista de esquema de cores. Por " +"padrão, os esquemas de cores instalados são:" + +#: C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "Clássico" + +#: C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Esquema de cor baseado no esquema de cor do gvim." + +#: C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "Metálico" + +#: C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "Esquema de cor no azul." + +#: C/gedit.xml:1257(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Esquema de cor usado no editor de texto Kate." + +#: C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Esquema de cor escuro usando a paleta de cor Tango." + +#: C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Esquema de cor usando o esquema de cor Tango." + +#: C/gedit.xml:1275(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Você pode adicionar um novo esquema de cor clicando em Adicionar..." +", e selecionando o arquivo de esquema de cor" + +#: C/gedit.xml:1276(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Você pode remover o esquema de cor selecionado clicando em " +"Remover" + +#: C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "Preferências de Plug-ins" + +#: C/gedit.xml:1284(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Plug-ins adicionam recursos extras ao gedit. Para " +"mais informações sobre plug-ins e como usar os plug-ins embutidos, veja a " +"." + +#: C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "Habilitando um Plug-in" + +#: C/gedit.xml:1289(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Para habilitar um plug-in do gedit, siga os " +"seguintes passos:" + +#: C/gedit.xml:1292(para) C/gedit.xml:1313(para) C/gedit.xml:1635(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Selecione EditarPreferências." + +#: C/gedit.xml:1295(para) C/gedit.xml:1316(para) C/gedit.xml:1638(para) +msgid "Select the Plugins tab." +msgstr "Selecione a aba Plug-ins." + +#: C/gedit.xml:1298(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" +"Selecione a caixa de seleção próxima ao nome do plug-in que você deseja " +"habilitar." + +#: C/gedit.xml:1301(para) C/gedit.xml:1322(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Clique no botão Fechar para fechar a janela de " +"Preferências." + +#: C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "Desativando um Plug-in" + +#: C/gedit.xml:1309(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Um plug-in permanece habilitado quando você fechar o gedit." + +#: C/gedit.xml:1310(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Para desativar um plug-in do gedit, siga os " +"seguintes passos:" + +#: C/gedit.xml:1319(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" +"Selecione a caixa de seleção próxima ao nome do plug-in que você deseja " +"desabilitar." + +#: C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "Plug-ins" + +#: C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "Trabalhando com Plug-ins" + +#: C/gedit.xml:1334(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Você pode adicionar recursos extras ao gedit " +"ativando plug-ins. Um plug-in é um programa " +"suplementar que aumenta a funcionalidade de uma aplicação. Plug-ins " +"adicionam novos itens aos menus do gedit para os " +"novos recursos que eles provêem." + +#: C/gedit.xml:1336(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Vários plug-ins vêm embutidos com o gedit, e você " +"pode instalar mais. O site do gedit lista plug-ins de terceiros." + +#: C/gedit.xml:1337(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Para habilitar e desabilitar plug-ins, ou ver quais plug-ins estão " +"habilitados no momento, use as Preferências de Plug-ins." + +#: C/gedit.xml:1338(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" +"Os seguintes plug-ins vêm embutidos com o gedit:" + +#: C/gedit.xml:1344(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Alterar " +"Maiusculização permite que você mude as letras " +"maiúsculas e minúsculas do texto selecionado." + +#: C/gedit.xml:1347(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Estatísticas " +"do Documento mostra o número de linhas, palavras e " +"caracteres no documento." + +#: C/gedit.xml:1350(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Ferramentas " +"Externas permite que você execute comandos externos a " +"partir do gedit." + +#: C/gedit.xml:1353(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Navegador de Arquivos permite que você navegue " +"seus arquivos e pastas no painel lateral." + +#: C/gedit.xml:1356(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Recuar Linhas adiciona ou remove recuo nas linhas selecionadas." + +#: C/gedit.xml:1359(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Inserir Data/" +"Hora adiciona a hora e data atual em um documento." + +#: C/gedit.xml:1362(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Modelines permite que você defina preferências de edição para documentos " +"individuais, e aceita as modelines do tipo Emacs, " +"Kate e Vim." + +#: C/gedit.xml:1365(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Console Python permite que você execute comandos na linguagem de " +"programação python." + +#: C/gedit.xml:1368(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Trechos permite que você armazene pedaços de texto freqüentemente " +"usados e inseri-los rapidamente em um documento." + +#: C/gedit.xml:1371(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Ordenar arruma linhas selecionadas de texto em ordem alfabética." + +#: C/gedit.xml:1374(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Verificador " +"Ortográfico corrige a ortografia no texto selecionado " +"ou marca erros automaticamente no documento." + +#: C/gedit.xml:1377(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Lista de Tags permite que você insira tags comumente usadas para HTML e " +"outras linguagens, a partir de uma lista no painel lateral." + +#: C/gedit.xml:1381(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"Para mais informações sobre a criação de plug-ins, veja o Site do gedit " +"." + +#: C/gedit.xml:1385(title) +msgid "Change Case Plugin" +msgstr "Plug-in de Alterar Maiusculização" + +#: C/gedit.xml:1386(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"O plug-in Alterar Maiusculização muda as letras " +"maiúsculas e minúsculas do texto selecionado." + +#: C/gedit.xml:1387(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Os seguintes itens são adicionados ao menu Editar quando " +"o plug-in Alterar Maiusculização está habilitado:" + +#: C/gedit.xml:1397(para) +msgid "Menu Item" +msgstr "Item de Menu" + +#: C/gedit.xml:1399(para) +msgid "Action" +msgstr "Ação" + +#: C/gedit.xml:1401(para) +msgid "Example" +msgstr "Exemplo" + +#: C/gedit.xml:1407(guisubmenu) C/gedit.xml:1413(guisubmenu) +#: C/gedit.xml:1419(guisubmenu) C/gedit.xml:1425(guisubmenu) +msgid "Change Case" +msgstr "Alterar Maiusculização" + +#: C/gedit.xml:1407(guimenuitem) +msgid "All Upper Case" +msgstr "Todas em Maiúsculas" + +#: C/gedit.xml:1408(para) +msgid "Change each character to uppercase." +msgstr "Altera cada caractere para maiúsculo." + +#: C/gedit.xml:1409(para) +msgid "This text becomes THIS TEXT" +msgstr "Este texto torna-se ESTE TEXTO" + +#: C/gedit.xml:1413(guimenuitem) +msgid "All Lower Case" +msgstr "Todas em Minúsculas" + +#: C/gedit.xml:1414(para) +msgid "Change each character to lowercase." +msgstr "Altera cada caractere para minúsculo." + +#: C/gedit.xml:1415(para) +msgid "This Text becomes this text" +msgstr "Este Texto torna-se este texto" + +#: C/gedit.xml:1419(guimenuitem) +msgid "Invert Case" +msgstr "Inverter Maiusculização" + +#: C/gedit.xml:1420(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" +"Altera cada caractere de minúsculo para maiúsculo, e altera cada maiúsculo " +"para minúsculo." + +#: C/gedit.xml:1421(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Este Texto torna-se eSTE tEXTO" + +#: C/gedit.xml:1425(guimenuitem) +msgid "Title Case" +msgstr "Iniciais Maiúsculas" + +#: C/gedit.xml:1426(para) +msgid "Change the first character of each word to uppercase." +msgstr "Altera o primeiro caractere de cada palavra para maiúsculo." + +#: C/gedit.xml:1427(para) +msgid "this text becomes This Text" +msgstr "este texto torna-se Este Texto" + +#: C/gedit.xml:1436(title) +msgid "Document Statistics Plugin" +msgstr "Plug-in de Estatísticas do Documento" + +#: C/gedit.xml:1437(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"O plug-in de Estatísticas do Documento conta o " +"número de linhas, palavras, caracteres com espaços, caracteres sem espaços e " +"bytes no arquivo atual. O plug-in exibe os resultados numa janela de " +"Estatísticas do Documento. Para usar o plug-in " +"Estatísticas do Documento, siga os seguintes passos:" + +#: C/gedit.xml:1439(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Selecione FerramentasEstatísticas do Documento " +"para exibir a janela Estatísticas do Documento. A " +"janela de Estatísticas do Documento exibe as seguintes " +"informações sobre o arquivo:" + +#: C/gedit.xml:1442(para) +msgid "Number of lines in the current document." +msgstr "Número de linhas no documento atual." + +#: C/gedit.xml:1445(para) +msgid "Number of words in the current document." +msgstr "Número de palavras no documento atual." + +#: C/gedit.xml:1448(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Número de caracteres, incluindo espaços, no documento atual." + +#: C/gedit.xml:1451(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Número de caracteres, não incluindo espaços, no documento atual." + +#: C/gedit.xml:1454(para) +msgid "Number of bytes in the current document." +msgstr "Número de bytes no documento atual." + +#: C/gedit.xml:1459(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Você pode continuar a modificar o arquivo do gedit enquanto a janela de Estatísticas do Documento está aberta. Para atualizar o conteúdo da janela de " +"Estatísticas do Documento, clique no botão " +"Atualizar." + +#: C/gedit.xml:1466(title) +msgid "External Tools Plugin" +msgstr "Plug-in de Ferramentas Externas" + +#: C/gedit.xml:1467(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"O plug-in Ferramentas Externas permite que você " +"execute comandos externos a partir do gedit. Você " +"pode redirecionar um conteúdo dentro de um comando e utilizar sua saída (por " +"exemplo, sed), ou lançar um comando predefinido " +"(por exemplo, make)." + +#: C/gedit.xml:1468(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Use o Gerenciador de Ferramentas Externas para criar e " +"editar comandos. Para executar um comando externo, escolha-o a partir do " +"menu Ferramentas." + +#: C/gedit.xml:1471(title) +msgid "Built-in Commands" +msgstr "Comandos Embutidos" + +#: C/gedit.xml:1472(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" +"Os seguintes comando estão disponíveis com o plug-in " +"Ferramentas Externas:" + +#: C/gedit.xml:1474(term) +msgid "Build" +msgstr "Compilar" + +#: C/gedit.xml:1476(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Executa o comando make no diretório do documento " +"atual." + +#: C/gedit.xml:1479(term) +msgid "Directory Listing" +msgstr "Listagem de Diretórios" + +#: C/gedit.xml:1481(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "Lista o conteúdo do diretório do documento atual em um novo documento." + +#: C/gedit.xml:1484(term) +msgid "Environment Variables" +msgstr "Variáveis de Ambiente" + +#: C/gedit.xml:1486(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Exibe a lista de variáveis de ambiente no painel inferior." + +#: C/gedit.xml:1489(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1491(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Pesquisa por um termo em todos os arquivos no diretório do documento atual, " +"usando o padrão correspondente. Os resultados são mostrados no painel " +"inferior." + +#: C/gedit.xml:1494(term) +msgid "Remove Trailing Spaces" +msgstr "Remover Espaços à Direita" + +#: C/gedit.xml:1496(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Remove todos os espaços do final das linhas no documento." + +#: C/gedit.xml:1503(title) +msgid "Defining a Command" +msgstr "Definindo um Comando" + +#: C/gedit.xml:1504(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Para adicionar um comando externo, escolha FerramentasFerramentas Externas." + +#: C/gedit.xml:1505(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"Na janela do Gerenciador de Ferramentas Externas, " +"clique no botão Novo. Você pode especificar os " +"seguintes detalhes para o novo comando:" + +#: C/gedit.xml:1507(term) +msgid "Description" +msgstr "Descrição" + +#: C/gedit.xml:1509(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" +"Esta descrição é mostrada na barra de status quando o comando é selecionado " +"no menu." + +#: C/gedit.xml:1512(term) +msgid "Accelerator" +msgstr "Tecla de atalho" + +#: C/gedit.xml:1514(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Digite um atalho de teclado para o comando." + +#: C/gedit.xml:1517(term) +msgid "Commands" +msgstr "Comandos" + +#: C/gedit.xml:1519(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Os comandos atuais a serem executados. Várias variáveis de ambiente do " +"gedit podem ser usadas para passar conteúdos para " +"esses comandos: veja a ." + +#: C/gedit.xml:1522(term) +msgid "Input" +msgstr "Entrada" + +#: C/gedit.xml:1524(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"O conteúdo que pode ser dado aos comandos (como stdin): todo o texto do documento atual, a seleção atual, linha ou " +"palavra." + +#: C/gedit.xml:1527(term) +msgid "Output" +msgstr "Saída" + +#: C/gedit.xml:1529(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"O que pode ser feito com a saída dos comandos: exibir no painel inferior, " +"lançar em um novo documento, ou colocar no documento atual, no final, na " +"posição do cursor ou substituindo a seleção ou o documento por completo." + +#: C/gedit.xml:1532(term) +msgid "Applicability" +msgstr "Aplicabilidade" + +#: C/gedit.xml:1534(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Determina que tipo de documentos podem ser afetados pelo comando, por " +"exemplo se está salvo ou não, e se é local ou remoto." + +#: C/gedit.xml:1542(title) +msgid "Editing and Removing Tools" +msgstr "Editando e Removendo Ferramentas" + +#: C/gedit.xml:1543(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Para editar uma ferramenta, selecione-a na lista e faça alterações nas suas " +"propriedades." + +#: C/gedit.xml:1544(para) +msgid "To rename a tool, click it again in the list." +msgstr "Para renomear uma ferramenta, clique nela novamente na lista." + +#: C/gedit.xml:1545(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Para restaurar uma ferramenta embutida que você alterou, pressione " +"Reverter." + +#: C/gedit.xml:1546(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Para remover uma ferramenta, selecione-a na lista e pressione no botão " +"Remover. Você não pode remover ferramentas embutidas, " +"só as que você mesmo criou." + +#: C/gedit.xml:1550(title) +msgid "Variables" +msgstr "Variáveis" + +#: C/gedit.xml:1551(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"Você pode usar as seguintes variáveis no campo Comandos " +"da definição do comando:" + +#: C/gedit.xml:1554(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1557(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1560(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1563(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1566(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1569(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1572(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1579(title) +msgid "File Browser Plugin" +msgstr "Plug-in de Navegador de Arquivos" + +#: C/gedit.xml:1580(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"O Plug-in Navegador de Arquivos mostra seus " +"arquivos e pastas no painel lateral, permitindo que você abra arquivos " +"rapidamente." + +#: C/gedit.xml:1581(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Para ver o Navegador de Arquivos, escolha VerPainel Lateral e então " +"clique na aba que mostra o ícone do Navegador de Arquivos na parte inferior " +"do painel lateral." + +#: C/gedit.xml:1583(title) +msgid "Browsing your Files" +msgstr "Navegando nos seus Arquivos" + +#: C/gedit.xml:1584(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"A aba do Navegador de Arquivos inicialmente mostra seus marcadores do " +"gerenciador de arquivos. Para navegar no conteúdo de qualquer item, dê um " +"clique duplo nele." + +#: C/gedit.xml:1585(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Para mostrar uma pasta pai, escolha a partir da lista superior ou pressione " +"a seta para cima na barra de ferramentas do Navegador de Arquivos." + +#: C/gedit.xml:1586(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Para mostrar a pasta que contém o documento no qual você está trabalhando, " +"clique com o botão direito na lista de arquivo e escolha " +"Definir raiz para documento ativo." + +#: C/gedit.xml:1590(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Para abrir um arquivo no gedit, dê um clique " +"duplo neste na lista de arquivo." + +#: C/gedit.xml:1593(title) +msgid "Creating Files and Folders" +msgstr "Criando Arquivos e Pastas" + +#: C/gedit.xml:1594(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Para criar um novo arquivo de texto vazio na pasta mostrada no navegador, " +"aperte o botão direito na lista de arquivos e escolha Novo " +"Arquivo." + +#: C/gedit.xml:1595(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Para criar uma nova pasta dentro da pasta mostrada no navegador, clique com " +"o botão direito na lista de arquivos e escolha Nova Pasta." + +#: C/gedit.xml:1600(title) +msgid "Indent Lines Plugin" +msgstr "Plug-in de Recuar Linhas" + +#: C/gedit.xml:1601(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"O plug-in Recuar Linhas adiciona ou remove espaço " +"do início das linhas do texto." + +#: C/gedit.xml:1602(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Para recuar ou desfazer recuo no texto, siga os seguintes passos:" + +#: C/gedit.xml:1604(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Selecione as linhas que você deseja recuar. Para recuar ou desfazer o recuo " +"em uma única linha, deixe o cursor em qualquer lugar da linha." + +#: C/gedit.xml:1609(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Para recuar o texto, escolha EditarCriar Recuo." + +#: C/gedit.xml:1612(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Para remover o recuo, escolha EditarDesfazer Recuo." + +#: C/gedit.xml:1617(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"O tamanho do espaço usado, e se será usado caractere de tabulação ou " +"caracteres de espaço, depende da configuração de Paradas de " +"Tabulação nas Preferências de Editor: veja a ." + +#: C/gedit.xml:1622(title) +msgid "Insert Date/Time Plugin" +msgstr "Plug-in de Inserir Data/Hora" + +#: C/gedit.xml:1623(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"O plug-in Inserir Data/Hora insere a data e hora " +"atual em um documento. Para usar o plug-in de Inserir Data/Hora, siga os " +"seguintes passos:" + +#: C/gedit.xml:1625(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Selecione EditarInserir Data/" +"Hora." + +#: C/gedit.xml:1626(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Se você não configurou o plug-in de Inserir Data/Hora para inserir " +"automaticamente a data/hora sem perguntar pelo formato, o " +"gedit exibe a janela Inserir Data e " +"Hora. Selecione o formato de data/hora apropriado na lista. " +"Clique no botão Inserir para fechar a janela de " +"Inserir Data e Hora. O gedit " +"insere a data/hora na posição do cursor no arquivo atual." + +#: C/gedit.xml:1627(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Se você configurou o gedit para usar um formato " +"de data/hora particular, a janela Inserir Data e Hora " +"não é exibida. A data/hora é inserida automaticamente na posição do cursor " +"no arquivo atual." + +#: C/gedit.xml:1632(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Configurando o Plug-in de Inserir Data/Hora" + +#: C/gedit.xml:1633(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Para configurar o plug-in Inserir Data/Hora, siga os seguintes passos:" + +#: C/gedit.xml:1641(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Selecione o plug-in Inserir Data/Hora." + +#: C/gedit.xml:1644(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Clique em Configurar Plug-in para exibir a janela " +"Configurar o plug-in de inserção de data/hora." + +#: C/gedit.xml:1647(para) +msgid "Select one of the options, as follows:" +msgstr "Selecione uma das opções, como se segue:" + +#: C/gedit.xml:1649(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Para especificar o formato de data/hora cada vez que você inserir a data/" +"hora, selecione a opção Alertar para um formato." + +#: C/gedit.xml:1652(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Para usar o próprio formato de data/hora que já vem com o " +"gedit cada vez que você inserir a data/hora, " +"selecione a opção Usar o formato selecionado, então " +"selecione o formato apropriado a partir da lista. Quando você selecionar " +"essa opção, o gedit não pergunta pelo formato de " +"data/hora quando você escolher EditarInserir Data e Hora." + +#: C/gedit.xml:1655(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Para usar o formato personalizado de data/hora cada vez que você inserir a " +"data/hora, selecione a opção Usar o formato personalizado, então digite o formato apropriado na caixa de texto. Para mais " +"informações sobre como descrever um formato personalizado, veja strftime3. Quando você " +"selecionar essa opção, o gedit não pergunta pelo " +"formato de data/hora quando você escolher EditarInserir Data e Hora." + +#: C/gedit.xml:1660(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"Clique no botão OK para fechar a janela " +"Configurar o plug-in de inserção de data/hora." + +#: C/gedit.xml:1663(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Para fechar a janela de Preferências, clique no botão " +"Fechar." + +#: C/gedit.xml:1670(title) +msgid "Modelines Plugin" +msgstr "Plug-in de Modelines" + +#: C/gedit.xml:1671(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"O plug-in Modelines permite que você configure " +"preferências para documentos individuais. Uma modeline é uma linha de texto no início ou no fim do documento com " +"configurações que o gedit reconhece." + +#: C/gedit.xml:1672(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Preferências definidas usando modelines têm prioridade sobre as " +"especificadas na janela de preferências." + +#: C/gedit.xml:1673(para) +msgid "You can set the following preferences with modelines:" +msgstr "Você pode definir as seguintes preferências com modelines:" + +#: C/gedit.xml:1676(para) +msgid "Tab width" +msgstr "Largura da tabulação" + +#: C/gedit.xml:1679(para) +msgid "Indent width" +msgstr "Largura do recuo" + +#: C/gedit.xml:1682(para) +msgid "Insert spaces instead of tabs" +msgstr "Inserir espaços ao invés de tabulações" + +#: C/gedit.xml:1688(para) +msgid "Right margin width" +msgstr "Largura da margem à direita" + +#: C/gedit.xml:1692(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"O plug-in Modelines aceita um subconjunto de " +"opções usadas por outros editores de texto: Emacs, Kate e Vim." + +#: C/gedit.xml:1695(title) +msgid "Emacs Modelines" +msgstr "Modelines de Emacs" + +#: C/gedit.xml:1696(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" +"As primeiras duas linhas de um documento são analisadas em busca de " +"modelines do Emacs." + +#: C/gedit.xml:1697(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"As opções do Emacs: tab-width, indent-offset, " +"indent-tabs-mode e autowrap são aceitas. Para mais informações, veja o " +"Manual do GNU Emacs." + +#: C/gedit.xml:1700(title) +msgid "Kate Modelines" +msgstr "Modelines de Kate" + +#: C/gedit.xml:1701(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" +"As primeiras e últimas dez linhas de um documento são analisadas em busca de " +"modelines do Kate." + +#: C/gedit.xml:1702(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"As opções do Kate: tab-width, indent-width, space-" +"indent, word-wrap e word-wrap-column são aceitas. Para mais informações, " +"veja o Site do Kate." + +#: C/gedit.xml:1705(title) +msgid "Vim Modelines" +msgstr "Modelines de Vim" + +#: C/gedit.xml:1706(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" +"As primeiras e últimas três linhas de um documento são analisadas em busca " +"de modelines do Vim." + +#: C/gedit.xml:1707(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"A opções do Vim: et, expandtab, ts, tabstop, sw, " +"shiftwidth, wrap e textwidth são aceitas. Para mais informações, veja o " +"Site do Vim." + +#: C/gedit.xml:1712(title) +msgid "Python Console Plugin" +msgstr "Plug-in de Console Python" + +#: C/gedit.xml:1713(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"O Plug-in Console Python permite que você execute " +"comandos na linguagem de programação python a partir do gedit. Ativando o plug-in adiciona uma aba ao painel inferior. Este " +"mostra a saída recente e um campo de prompt de comando." + +#: C/gedit.xml:1714(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Comandos digitados dentro do console python não são verificados antes que " +"eles sejam executados. Conseqüentemente, é possível que travem o " +"gedit, por exemplo entrando um loop infinito." + +#: C/gedit.xml:1718(title) +msgid "Snippets Plugin" +msgstr "Plug-in de Trechos" + +#: C/gedit.xml:1719(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"O plug-in Trechos permite que você armazene " +"pedaços de texto usados freqüentemente, chamados trechos, e inseri-los rapidamente dentro de um documento." + +#: C/gedit.xml:1720(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Os trechos são específicos à sintaxe da linguagem do documento atual. Por " +"exemplo, quando você está trabalhando com um documento HTML, você pode " +"escolher de uma lista de trechos que são úteis para HTML. Além disso, alguns " +"trechos são globais e estão disponíveis para todos os documentos." + +#: C/gedit.xml:1721(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Um número de trechos embutidos já vem instalado com o gedit, e pode ser modificado." + +#: C/gedit.xml:1724(title) +msgid "Inserting Snippets" +msgstr "Inserindo Trechos" + +#: C/gedit.xml:1725(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Para inserir um trecho dentro de um documento, digite seu " +"disparador e pressione Tab. Um " +"disparador de trecho é geralmente as primeiras letras do trecho, ou alguma " +"outra coisa que seja pequena e fácil de lembrar." + +#: C/gedit.xml:1726(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Opcionalmente, pressione CtrlSpace para ver uma lista de trechos que você pode inserir." + +#: C/gedit.xml:1730(title) +msgid "Adding Snippets" +msgstr "Adicionando Trechos" + +#: C/gedit.xml:1731(para) +msgid "To create a new snippet, do the following:" +msgstr "Para criar um novo trecho, faça o seguinte:" + +#: C/gedit.xml:1734(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Selecione FerramentasGerenciar " +"Trechos. A janela Gerenciador de " +"Trechos será aberta." + +#: C/gedit.xml:1737(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"A lista de trechos é agrupada por linguagens. Selecione a linguagem para a " +"qual você quer adicionar um trecho, ou um trecho nesse grupo. Para adicionar " +"um trecho, escolha Global no topo da lista. A sintaxe do documento que você " +"estiver trabalhando é mostrada por padrão." + +#: C/gedit.xml:1740(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Clique no botão Novo. Um novo trecho aparece na lista." + +#: C/gedit.xml:1743(para) +msgid "Enter the following information for the new snippet:" +msgstr "Digite as seguintes informações para o novo trecho:" + +#: C/gedit.xml:1745(term) +msgid "Name" +msgstr "Nome" + +#: C/gedit.xml:1747(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Insira um nome para o trecho no campo de texto dentro da lista de trechos. O " +"nome de um trecho serve somente para lembrar para o que ele serve. Você pode " +"mudar o nome de um trecho que você criou clicando nele na lista." + +#: C/gedit.xml:1750(term) +msgid "Snippet text" +msgstr "Texto do trecho" + +#: C/gedit.xml:1752(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Insira o texto do trecho na caixa de texto de Editar trecho. Para códigos especiais que você pode usar, veja a ." + +#: C/gedit.xml:1753(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Você pode mudar para a janela do documento para copiar texto sem fechar a " +"janela do Gerenciador de Trechos." + +#: C/gedit.xml:1756(term) +msgid "Tab Trigger" +msgstr "Disparador" + +#: C/gedit.xml:1758(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Insira o disparador para o trecho. Este é o texto que você digita antes de " +"pressionar Tab para inserir o trecho." + +#: C/gedit.xml:1759(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"A identificação deve ser uma única palavra contendo somente letras, ou " +"qualquer caractere. O Disparador destacará em vermelho " +"se um disparador inválido é inserido." + +#: C/gedit.xml:1762(term) +msgid "Shortcut key" +msgstr "Tecla de atalho" + +#: C/gedit.xml:1764(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Digite uma tecla de atalho a usar para inserir o trecho." + +#: C/gedit.xml:1773(title) +msgid "Editing and Removing Snippets" +msgstr "Editando e Removendo Trechos" + +#: C/gedit.xml:1774(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Para editar um trecho, selecione-o na lista e faça as alterações ao texto e " +"propriedades de ativação." + +#: C/gedit.xml:1775(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Para renomear um trecho, clique no trecho novamente na lista." + +#: C/gedit.xml:1776(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Para restaurar um trecho embutido que você alterou, pressione em " +"Reverter." + +#: C/gedit.xml:1777(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Para remover um trecho, selecione-o na lista e pressione no botão " +"Remover. Você não pode remover trechos embutidos, só " +"aqueles que você criou." + +#: C/gedit.xml:1781(title) +msgid "Snippet Substitutions" +msgstr "Substituições de Trechos" + +#: C/gedit.xml:1782(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Além de inserir textos armazenados, um trecho pode incluir textos " +"personalizados, ou espaços marcados aos quais você pode adicionar texto, uma " +"vez que o trecho é inserido em seu documento." + +#: C/gedit.xml:1786(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" +"Você pode usar os seguintes códigos para marcadores de substituição em " +"trechos de texto:" + +#: C/gedit.xml:1788(term) +msgid "Tab placeholders" +msgstr "Marcadores de substituição" + +#: C/gedit.xml:1790(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n define um marcador de " +"substituição, onde n é qualquer número de 1 para cima." + +#: C/gedit.xml:1791(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:padrão} define um marcador de substituição com um valor padrão." + +#: C/gedit.xml:1792(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Um marcador de substituição marca um local no trecho onde você pode " +"adicionar texto depois que o trecho é inserido." + +#: C/gedit.xml:1793(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Para usar os marcadores de substituição, insira o trecho normalmente. O " +"cursor irá até o primeiro marcador. Digite o texto e pressione Tab para ir para o próximo. O Número no código do marcador define a " +"ordem na qual o cursor avança ao pressionar Tab." + +#: C/gedit.xml:1794(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Pressione ShiftTab " +"para retornar ao marcador de substituição anterior. Pressionar Tab quando não há mais marcadores de substituição move o cursor até o " +"fim do trecho, ou até o marcador de fim, se existir." + +#: C/gedit.xml:1797(term) +msgid "Mirror placeholders" +msgstr "Marcadores espelhos" + +#: C/gedit.xml:1799(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Um marcador de substituição repetido irá copiar o marcador já definido. Isso " +"permite a você digitar só uma vez um texto que você quer que apareça várias " +"vezes no trecho." + +#: C/gedit.xml:1802(term) +msgid "End placeholder" +msgstr "Marcador de fim" + +#: C/gedit.xml:1804(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 define um marcador de fim. Isso permite a você " +"terminar de trabalhar no trecho com o cursor em um lugar diferente do fim do " +"trecho." + +#: C/gedit.xml:1807(term) +msgid "Environmental variables" +msgstr "Variáveis de ambiente" + +#: C/gedit.xml:1809(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Variáveis de ambiente como $PATH e $HOME são substituídas no texto do trecho. As seguintes variáveis " +"específicas do gedit podem ser usadas:" + +#: C/gedit.xml:1811(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1813(para) +msgid "The currently selected text." +msgstr "O texto selecionado no momento." + +#: C/gedit.xml:1816(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1818(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"O nome completo de arquivo do documento, ou uma seqüência vazia se o " +"documento ainda não estiver salvo." + +#: C/gedit.xml:1821(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1823(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" +"O nome do arquivo sem a extensão, ou uma seqüência vazia se o documento " +"ainda não estiver salvo." + +#: C/gedit.xml:1826(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1828(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" +"A palavra que estiver na posição do cursor no documento. Quando essa " +"variável é usada, a palavra atual será substituída pelo texto do trecho." + +#: C/gedit.xml:1836(term) +msgid "Shell placeholders" +msgstr "Marcadores de substituição do Shell" + +#: C/gedit.xml:1838(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) é substituído pelo " +"resultado da execução de cmd no shell." + +#: C/gedit.xml:1839(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) permite a você dar a esse marcador de substituição uma referência, " +"onde n é qualquer número de 1 para cima. Use " +"$n para usar a saída de um " +"marcador de substituição de shell como entrada em outro." + +#: C/gedit.xml:1842(term) +msgid "Python placeholders" +msgstr "Marcadores de substituição do Python" + +#: C/gedit.xml:1844(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> é substituído " +"pelo resultado da execução de cmd no " +"interpretador python." + +#: C/gedit.xml:1845(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" especifica outro marcador de substituição do python como uma " +"dependência, onde a fornece sua ordem no trecho. " +"Isso permite a você usar funções do python definidos em outro trecho. Para " +"especificar várias dependências, separe os números com vírgulas, assim: " +"$<a,b:" +"cmd>" + +#: C/gedit.xml:1846(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Para usar uma variável em todos os outros trechos de python, declare-a como " +"global." + +#: C/gedit.xml:1855(title) +msgid "Sort Plugin" +msgstr "Plug-in de Ordenar" + +#: C/gedit.xml:1856(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"O plug-in Ordenar arruma linhas selecionadas de " +"texto em ordem alfabética." + +#: C/gedit.xml:1857(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Você não pode desfazer a operação de Ordenar, portanto você deve salvar o " +"arquivo antes de efetuar a ordenação. Para reverter à versão salva do " +"arquivo depois da operação de ordenar, escolha ArquivoReverter." + +#: C/gedit.xml:1860(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Para usar o plug-in Ordenar, siga os seguintes passos:" + +#: C/gedit.xml:1863(para) +msgid "Select the lines of text you want to sort." +msgstr "Selecione as linhas de texto que você quer ordenar." + +#: C/gedit.xml:1865(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Selecione EditarOrdenar. A janela Ordenar se abrirá." + +#: C/gedit.xml:1868(para) +msgid "Choose the options you want for the sort:" +msgstr "Selecione as opções que você deseja para ordenar:" + +#: C/gedit.xml:1871(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Para arrumar o texto em ordem inversa, selecione Inverter ordem." + +#: C/gedit.xml:1874(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Para apagar linhas duplicadas, selecione a opção Remover " +"duplicadas." + +#: C/gedit.xml:1877(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Para ignorar a distinção entre maiúsculas e minúsculas, selecione " +"Ignorar maiúsculas/minúsculas." + +#: C/gedit.xml:1880(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Para que a ordenação ignore os caracteres no início das linhas, defina o " +"primeiro caractere a ser usado para ordenação no seletor numérico " +"Iniciar na coluna." + +#: C/gedit.xml:1885(para) +msgid "To perform the sort operation, click Sort." +msgstr "" +"Para efetuar a operação de ordenação, clique no botão Ordenar." + +#: C/gedit.xml:1892(title) +msgid "Spell Checker Plugin" +msgstr "Plug-in de Verificador Ortográfico" + +#: C/gedit.xml:1893(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"O plug-in Verificador Ortográfico verifica a " +"ortografia no texto selecionado. Você pode configurar o gedit para verificar a ortografia automaticamente ou você pode " +"verificar manualmente no idioma especificado. A configuração do idioma e as " +"propriedades da auto-verificação são aplicadas por documento. Para usar o " +"plug-in de Verificador ortográfico, siga os seguintes passos:" + +#: C/gedit.xml:1895(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Selecione FerramentasDefinir " +"Idioma para exibir a janela Definir " +"idioma. Selecione o idioma apropriado a partir da lista. Clique " +"em OK para fechar a janela Definir idioma." + +#: C/gedit.xml:1898(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Para verificar a ortografia automaticamente, escolha " +"FerramentasAuto-verificação de " +"Ortografia. Para desativar a verificação " +"automática, escolha FerramentasAuto-verificação de Ortografia novamente. Quando a auto-verificação está ativada, um ícone é " +"exibido ao lado do item de menu Auto-verificação de Ortografia. A auto-verificação é desativada por padrão, cada vez que o " +"gedit inicia." + +#: C/gedit.xml:1899(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Ortografias desconhecidas são exibidas em uma cor diferente e sublinhadas. " +"Aperte o botão direito em uma ortografia desconhecida, então selecione " +"Sugestões de Ortografia a partir do menu que aparece:" + +#: C/gedit.xml:1902(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Para substituir a palavra desconhecida por outra na lista, selecione a " +"palavra a substituir no menu Sugestões de Ortografia." + +#: C/gedit.xml:1905(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Para adicionar a palavra desconhecida ao seus dicionário pessoal, selecione " +"Sugestões de OrtografiaAdicionar." + +#: C/gedit.xml:1908(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Para ignorar todas as ocorrências da palavra desconhecida, fazendo com que " +"não sejam mais marcadas como desconhecidas sem serem adicionadas ao " +"dicionário pessoal, selecione Sugestões de OrtografiaIgnorar Todos. A palavra " +"desconhecida é ignorada somente na seção atual do gedit." + +#: C/gedit.xml:1913(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Para verificar a ortografia manualmente, escolha " +"FerramentasVerificar Ortografia." + +#: C/gedit.xml:1915(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Se não houver erros de ortografia, uma janela de Informação exibe uma mensagem que o documento não contém palavras com grafia " +"errada. Clique no botão OK para fechar a janela de " +"Informação." + +#: C/gedit.xml:1917(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Se houver erros de ortografia, a janela Verificação de Ortografia é exibida:" + +#: C/gedit.xml:1920(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"A Palavra com erro de ortografia é exibida no topo da " +"janela." + +#: C/gedit.xml:1923(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Uma ortografia conhecida sugerida é exibida na caixa de texto " +"Modificar para. Você pode substituir essa opção por " +"outra selecionando uma palavra a partir da lista de Sugestões, ou você pode digitar o texto diretamente dentro da caixa de texto " +"Modificar para." + +#: C/gedit.xml:1926(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Para verificar a ortografia do texto na caixa de texto Modificar " +"para, clique em Verificar Palavra. Se é " +"uma palavra conhecida, a lista de Sugestões é " +"substituída pelo texto (ortografia correta). Se a palavra " +"não é conhecida, novas entradas aparecem na lista de Sugestões." + +#: C/gedit.xml:1929(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Para ignorar a ocorrência atual da palavra desconhecida, clique em " +"Ignorar. Para ignorar todas as ocorrências da " +"palavra, clique em Ignorar Todos. A palavra " +"desconhecida é ignorada somente na seção atual do gedit." + +#: C/gedit.xml:1932(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Para alterar a ocorrência atual da palavra desconhecida no texto da caixa de " +"texto Modificar para, clique no botão " +"Modificar. Para modificar todas as ocorrências da " +"palavra desconhecida no texto da caixa de texto Modificar para, clique em Modificar Todos." + +#: C/gedit.xml:1935(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Para adicionar a palavra desconhecida para o seu dicionário pessoal, clique " +"no botão Adicionar palavra." + +#: C/gedit.xml:1938(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Para fechar a janela Verificar Ortografia, clique em " +"Fechar." + +#: C/gedit.xml:1947(title) +msgid "Tag List Plugin" +msgstr "Plug-in de Lista de Tags" + +#: C/gedit.xml:1948(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"O plug-in Lista de Tags permite que você insira " +"tags comuns de uma lista no painel lateral." + +#: C/gedit.xml:1949(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Para usar o plug-in de Lista de Tags, efetue as seguintes etapas:" + +#: C/gedit.xml:1951(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Selecione VerPainel Lateral." + +#: C/gedit.xml:1955(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Por padrão, o painel lateral mostra uma aba contendo uma lista de documentos " +"abertos. Clique na aba mostrando um ícone de + na parte inferior do painel " +"lateral para mostrar a aba de lista de tags." + +#: C/gedit.xml:1957(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Selecione a categoria de tag apropriada a partir da lista. Por exemplo, " +"HTML - Tags." + +#: C/gedit.xml:1960(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Role pela lista de tags para pesquisar pela tag requerida." + +#: C/gedit.xml:1963(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Para inserir uma tag na posição do cursor no arquivo atual, dê um clique " +"duplo na tag na lista. Você pode também inserir uma tag da seguinte maneira:" + +#: C/gedit.xml:1965(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Para inserir uma tag no arquivo atual e mudar o foco do painel lateral para " +"a área de visualização, pressione Enter." + +#: C/gedit.xml:1968(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Para inserir uma tag no arquivo atual e manter o foco na janela do " +"Plug-in de lista de tags, pressione " +"ShiftEnter." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "" +"Wagner Luís de Araújo Menezes Macêdo , 2007\n" +"Pedro Vaz de Mello de Medeiros , 2007\n" +"Leonardo Ferreira Fontenelle , 2007, 2008\n" +"Vladimir Melo , 2008\n" +"Fabricio Godoy , 2008\n" +"Krix Apolinário , 2009" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Nome do Usuário insere o nome de usuário do usuário atual no " +#~ "documento." + +#~ msgid "User Name Plugin" +#~ msgstr "Plug-in de Nome do Usuário" + +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "O plug-in Nome do usuário insere o nome de " +#~ "usuário do usuário atual no documento." + +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "Para inserir seu nome de usuário na posição do cursor, escolha " +#~ "EditarInserir Nome do " +#~ "Usuário." + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "Para mais informações sobre como configurar o destaque de sintaxe, veja a " +#~ "." + +#~ msgid "Colors" +#~ msgstr "Cores" + +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Selecione a opção Usar cores do tema padrão para " +#~ "usar as cores do tema padrão na área de texto do gedit." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Clique no botão de Cor do texto normal para exibir " +#~ "o diálogo seletor de cores. Selecione uma cor a usar para exibir texto " +#~ "normal na área de texto do gedit." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Clique no botão de Cor de fundo para exibir o " +#~ "diálogo seletor de cores. Selecione uma cor de fundo para a área de texto " +#~ "do gedit." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Clique no botão de Cor do texto selecionado para " +#~ "exibir o diálogo seletor de cores. Selecione uma cor a usar para exibir " +#~ "texto selecionado." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Clique no botão de Cor da seleção para exibir o " +#~ "diálogo seletor de cores. Selecione uma cor de fundo a usar para o " +#~ "destaque da seleção de texto." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Preferências de Destaque de Sintaxe" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "Habilitar destaque de sintaxe" + +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "" +#~ "Selecione essa opção para destacar a sintaxe do texto que você editar." + +#~ msgid "Highlight mode" +#~ msgstr "Modo de destaque" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Use essa lista suspensa para selecionar um modo de sintaxe a configurar." + +#~ msgid "Elements" +#~ msgstr "Elementos" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "" +#~ "Use essa caixa de lista para selecionar um elemento de sintaxe a " +#~ "configurar." + +#~ msgid "Format buttons" +#~ msgstr "Botões de formatação" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Use os seguintes botões para alterar a formatação do elemento de sintaxe " +#~ "selecionado:" + +#~ msgid "Button" +#~ msgstr "Botão" + +#~ msgid "Format" +#~ msgstr "Formatação" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Mostra o ícone para formato negrito." + +#~ msgid "Bold" +#~ msgstr "Negrito" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Mostra o ícone para formato itálico." + +#~ msgid "Italic" +#~ msgstr "Itálico" + +#~ msgid "Shows icon for underline." +#~ msgstr "Mostra o ícone para sublinhado." + +#~ msgid "Underline" +#~ msgstr "Sublinhado" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Mostra o ícone para tachado." + +#~ msgid "Strikethrough" +#~ msgstr "Tachado" + +#~ msgid "Foreground" +#~ msgstr "Primeiro plano" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Selecione essa opção para alterar a cor da fonte do elemento de sintaxe " +#~ "selecionado. Clique no botão da cor para exibir o diálogo seletor de " +#~ "cores, então selecione a cor da fonte." + +#~ msgid "Background" +#~ msgstr "Cor de fundo" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Selecione essa opção para alterar a cor de fundo do elemento de sintaxe " +#~ "selecionado. Clique no botão para exibir o diálogo seletor de cores, " +#~ "então selecione a cor de fundo." + +#~ msgid "Reset to Default" +#~ msgstr "Restaurar para Padrão" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Clique nesse botão para restaurar a cor de primeiro plano e cor de fundo " +#~ "do elemento de sintaxe selecionado para os valores padrões." + +#~ msgid "" +#~ "To undo a change you have made, choose EditUndo. To reverse this " +#~ "action, choose EditRedo. The number of previous edits that you can undo " +#~ "is determined by the Undo limit setting in the " +#~ "Editor tabbed section of the Preferences dialog: see ." +#~ msgstr "" +#~ "Para desfazer uma alteração que você tenha feito, selecione " +#~ "EditarDesfazer. Para reverter esta ação, selecione " +#~ "EditarRefazer. O número de edições prévias que você pode desfazer é " +#~ "determinada pela configuração do limite de Desfazer " +#~ "na seção da aba Editor da janela " +#~ "Preferências: veja a ." diff --git a/help/ru/ru.po b/help/ru/ru.po new file mode 100755 index 00000000..dafd348a --- /dev/null +++ b/help/ru/ru.po @@ -0,0 +1,4488 @@ +# Russian translation of GEdit help +# Copyright 2008 Free Software Foundation Inc. +msgid "" +msgstr "" +"Project-Id-Version: gedit HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-02-06 23:45+0000\n" +"PO-Revision-Date: 2009-02-15 01:56+0300\n" +"Last-Translator: Salikhov Timur \n" +"Language-Team: Russian \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%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Этот документ распространяется в соответствии с условиями GNU Free " +"Documentation License (GFDL) версии 1.1 или поздней, выпущенной Free " +"Software Foundation; без инвариантных разделов, вступления и заключения. " +"Полный текст лицензии можно прочитать в разделе link или в файле COPYING-DOCS, распространяемым вместе " +"с данным руководством." + +#: 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 "" +"Данное руководство является частью документации MATE, распространяемой под " +"лицензией GFDL. Если вы хотите распространять этот документ отдельно — вы " +"можете это сделать, добавив копию лицензионного соглашения в документ, как " +"описано в секции 6 упомянутой лицензии." + +#: 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 "" +"Некоторые имена используются компаниями для обозначения их продуктов и услуг " +"и являются торговыми марками. Эти марки присутствуют в документации и члены " +"проекта документирования MATE знают об этом. Имена выделяются заглавными " +"буквами или начальной заглавной буквой." + +#: 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 " +"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/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: " +"" +msgstr "" +"ДОКУМЕНТ И ИЗМЕНЁННЫЕ ВЕРСИИ ДОКУМЕНТА ПРЕДОСТАВЛЯЮТСЯ ПОЛЬЗОВАТЕЛЮ НА " +"УСЛОВИЯХ ЛИЦЕНЗИИ GNU FREE DOCUMENTATION LICENSE С УВЕДОМЛЕНИЕМ О ТОМ, ЧТО: " +"" + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Руководство по Gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "Проект документирования MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Добавлена таблица клавиатурных комбинаций" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Команда документирования Sun Java Desktop System" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek готовил информацию по ранним версиям gedit." + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Благодарности" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George предоставил информацию о модулях." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Руководство версии 2.0 по gedit." + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Март 2002" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Команда документирования Sun MATE" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Руководство версии 2.1 по gedit." + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Июнь 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Руководство версии 2.2 по gedit." + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Август 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Руководство версии 2.3 по gedit." + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "Сентябрь 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Руководство версии 2.4 по gedit." + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Январь 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Руководство версии 2.5 по gedit." + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Март 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Руководство версии 2.6 по gedit." + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "Сентябрь 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Руководство версии 2.7 по gedit." + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Март 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Руководство версии 2.8 по gedit." + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +#| msgid "June 2002" +msgid "July 2006" +msgstr "Июль 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Руководство версии 2.9 по gedit." + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "Команда документирования MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Данное руководство описывает gedit версии 2.16." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Обратная связь" + +#: C/gedit.xml:208(para) +#| msgid "" +#| "To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the " +#| "MATE Feedback Page." +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Чтобы сообщить об ошибке или предложить что-то касательно приложения " +"gedit либо этого документа, последуйте ссылке " +"MATE Feedback Page." + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit — текстовый редактор для среды MATE, простой, но поддерживающий " +"основные функции по работе с текстом, печать, проверку орфографии, поиск и " +"замену, подсветку синтаксиса. Множество дополнительных функций доступны как " +"модули." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "текстовый редактор" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Введение" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"Приложение gedit позволяет вам создавать и " +"редактировать текстовые файлы." + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"Цель gedit — быть простым и лёгким в " +"использовании текстовым редактором. Многие возможности могут быть включены " +"модулями, решающими множество задач по редактированию " +"текста." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Начало" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Запуск gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "Можно запустить gedit следующими способами:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Меню Приложения" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Выберите СтандартныеТекстовый редактор." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Командная строка" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Выполните команду: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"По умолчанию, когда вы открываете текстовый документ в файловом менеджере, " +"gedit запускается и отображает открываемый файл." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "Окно gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Когда запускается gedit, отображается следующее " +"окно:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Окно gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Главное окно gedit." + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "Окно gedit состоит из следующих элементов:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Строка меню" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"Меню включает в себя все команды необходимые для работы с файлами в " +"gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Панель инструментов" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "" +"Панель инструментов включает в себя некоторые команды, доступные из меню." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Область просмотра" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "В области просмотра отображается редактируемый текст." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Строка статуса" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"Строка статуса показывает текущее состояние gedit, а также контекстную информацию о пунктах меню. Информация о " +"состоянии может быть следующей:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "Позиция курсора: номер строки и номер столбца, где находится курсор." + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Режим редактирования: если редактор находится в режиме вставки, в строке " +"статуса отобразится ВСТ. Если редактор в режиме замены, " +"строка статуса покажет ЗАМ. Нажатие клавиши " +"Insert меняет режим редактирования." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Боковая панель" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"В боковой панели отображается список открытых документов и другая " +"информация, зависящая от загруженных модулей." + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"По умолчанию боковая панель скрыта. Чтобы увидеть её, выберите " +"ВидБоковая панель." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Нижняя панель" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"Нижняя панель используется инструментами программирования, такими как модуль " +"Консоль Python, для отображения результатов " +"работы." + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"По умолчанию нижняя панель скрыта. Чтобы увидеть её, выберите " +"ВидНижняя панель." + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"При щелчке правой кнопкой мыши в окне gedit, " +"появляется всплывающее меню. Оно содержит общие команды редактирования " +"текста." + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Подобно другим приложениям MATE большинство действий в gedit можно выполнить несколькими способами: через меню, через панель " +"инструментов и с помощью горячих клавиш. Общие для всех приложений горячие " +"клавиши перечислены в Руководстве пользователя." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Запуск gedit из командной строки" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Можно запустить gedit из командной строки с одним или несколькими файлами. " +"Для открытия нескольких файлов введите следующую команду и нажмите клавишу " +"Ввод:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "файл1.txt файл2.txt файл3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Также, вместо имени файла можно указать URI." + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Для дополнительной информации о запуске gedit из " +"командной строки смотрите страницы руководства unix для gedit, gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Работа с файлами" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Создание нового документа" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Чтобы создать новый документ выберите ФайлСоздать. Новый чистый " +"документ отобразится в окне gedit." + +#: C/gedit.xml:346(title) C/gedit.xml:1591(title) +msgid "Opening a File" +msgstr "Открытие файла" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Чтобы открыть файл выберите ФайлОткрыть. В диалоге выбора " +"файлов найдите нужный и нажмите кнопку guibutton>Открыть. Файл " +"будет показан в окне gedit." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Значок меню списка недавних документов." + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Приложение запоминает имена пяти последних открытых файлов и отображает их в " +"меню Файл. Также для отображения " +"списка недавно использованных файлов можно щёлкнуть значок " +"на панели инструментов." + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"В gedit можно открывать несколько файлов. " +"Приложение добавляет вкладку для каждого открытого файла в окно. Смотрите " +"также ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Сохранение файла" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Сохранять файлы можно несколькими способами:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Чтобы сохранить изменения в уже существующем файле, выберите " +"ФайлСохранить." + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Для записи нового файла или записи уже существующего файла под новым именем, " +"выберите ФайлСохранить как. Введите имя для файла в диалоге " +"Сохранить как и нажмите кнопку Сохранить." + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Чтобы сохранить все открытые в данный момент файлы, нужно выбрать " +"ДокументыСохранить всё." + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Для закрытия всех открытых в gedit файлов, " +"выберите ДокументыЗакрыть всё." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Открытие файла через URI" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Чтобы открыть файл через Uniform Resource Identifier (URI), выполните " +"следующее:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Выберите ФайлОткрыть адрес. Появится диалог Открыть адрес." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Введите URI файла, что вы хотите открыть." + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Используя выпадающий список Кодировка символов, " +"выберите подходящую кодировку." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Нажмите кнопку Открыть." + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"URI может содержать http:, " +"ftp:, file: и все протоколы, " +"поддерживаемые mate-vfs." + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Файлы с некоторых типов URI могут быть открыты только для чтения, поэтому " +"изменения в таких файлах должны быть сохранены в другое место. Например, " +"HTTP позволяет открывать файлы лишь для чтения. Файлы открытые с FTP тоже " +"могут оказаться недоступными для записи, поскольку не все FTP-серверы умеют " +"правильно работать с записью таких файлов." + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Запись на FTP-серверы может быть включена с помощью приложения Редактор конфигурации, установкой ключа /apps/gedit-2/preferences/" +"editor/save/writable_vfs_schemes, но это может приводить к " +"ошибкам." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Работа со вкладками" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Когда открыто более одного файла, gedit " +"отображает в верхней части области просмотра вкладки " +"для каждого документа. Переключиться на другой документ можно щёлкнув по " +"соответствующей вкладке." + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Для перемещения документа в другое окно gedit, " +"перетащите соответствующую вкладку." + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Для перемещения документа в новое окно gedit, " +"перетащите вкладку на рабочий стол или выберите " +"ДокументыПереместить в новое " +"окно." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Работа с текстом" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Редактирование текста" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "При редактировании текста можно использовать следующие приёмы:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Ввести новый текст с клавиатуры. Мерцающий курсор " +"показывает место ввода текста, изменить которое можно с помощью клавиш " +"управления курсором или щелчком мыши." + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Чтобы скопировать выделенный текст в буфер обмена, выберите " +"ПравкаКопировать." + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Для удаления выделенного текста из файла и перемещения в буфер обмена, " +"выберите ПравкаВырезать." + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Чтобы удалить выделенный текст, выберите ПравкаУдалить." + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Для вставки содержимого буфера обмена в позицию курсора, нужно выбрать " +"ПравкаВставить. Перед вставкой текста необходимо переместить или скопировать " +"нужный текст в буфер обмена из gedit или из другого приложения." + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Чтобы выделить весь текст в файле, нужно выбрать " +"ПравкаВыделить всё." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Отмена и возврат изменений" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"Для отмены сделанных изменений, выберите ПравкаОтменить. Для возврата " +"отмененного, нужно выбрать ПравкаВернуть." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Поиск и замена" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"В gedit существует два способа поиска текста. " +"Можно использовать диалог Найти для поиска текстового " +"блока, или воспользоваться Интерактивным поиском для " +"подсветки текста по мере набора." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Поиск текста" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Чтобы найти в файле строку текста, выполните следующие действия:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Выберите ПоискНайти для отображения диалога Найти" + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"Введите искомую строку в поле Найти. Можно использовать " +"специальные символы, такие как, символ новой строки или табуляции: смотрите " +"." + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Нажмите Найти для поиска первого совпадения строк с " +"текущей позиции курсора. Если строка найдена, приложение выделяет первое " +"совпадение. Остальные совпадения строк будут подсвечены." + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Для перехода к следующему совпадению, щёлкните Найти " +"еще раз, или выберите ПоискНайти следующее. Для перехода к предыдущему совпадению текста, " +"выберите ПоискНайти предыдущее." + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"После закрытия диалога Найти, вы по-прежнему можете " +"перемещаться между найденными совпадениями текста используя " +"ПоискНайти следующее и ПоискНайти предыдущее." + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Для удаления подсветки текста, выберите ПоискОчистить подсветку." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Интерактивный поиск" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"Интерактивный поиск подсвечивает вводимый текст по мере печати буква за " +"буквой. (Подобная функция есть у некоторых веб-браузеров.)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Для начала интерактивного поиска, выберите ПоискПоиск по мере набора. Окно " +"поиска появляется в нижней части области просмотра." + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Начните печатать, и текст в документе будет подсвечен. Выделяется первое " +"совпадение от позиции курсора." + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Чтобы выделить другие совпадения, в открытом окне «Интерактивный поиск» " +"нажмите CtrlG. " +"Нажмите CtrlShiftG для возврата к предыдущему совпадению." + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Также можно использовать клавиши управления курсором и колесо мыши для " +"перемещения между совпадениями." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Замена текста" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Для поиска и замены строки в файле на другую строку, выполните следующие " +"действия:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Выберите ПоискЗаменить для вызова диалогового окна Заменить." + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Напечатайте заменяемую строку в поле Найти. Можно " +"использовать и специальные символы, как например, символ новой строки или " +"символ табуляции: смотрите ." + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"В поле Заменить на введите строку на которую требуется " +"заменить." + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Для просмотра каждого совпадения строки перед её заменой, щёлкните " +"Найти. Если совпадение есть, gedit выделит его. Для замены нажмите Заменить. Чтобы перейти к следующему совпадению, щёлкните " +"Найти ещё раз." + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Для замены всех совпадений сразу, нажмите guibutton>Заменить всё." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Параметры поиска и замены" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Диалог Найти, ровно как и диалог Заменить, имеют следующие настройки:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Выберите Учитывать регистр, чтобы найти текст в том " +"регистре, в котором вы его ввели. Например, в этом случае «ТЕКСТ» не то же " +"самое, что и «текст»." + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Выберите Только полные слова, чтобы вести поиск только " +"по полным словам. Так, например, «текст» не то же что и «текстура»." + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Выберите Обратный поиск, для поиска в обратном " +"направлении, к началу документа." + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"При включенном Автоматически переходить к началу, поиск " +"ведется с текущей позиции курсора до конца и, затем, от начала документа до " +"текущей позиции." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Специальные символы" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"В искомый текст можно включать следующие escape-последовательности, " +"представляющие спец. символы:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "символ новой строки." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Символ табуляции." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Символ возврата каретки." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"При поиске необходимо экранировать символы обратного слеша. Например, если " +"вы ищете \"\\n\", в поле Найти " +"нужно напечатать \"\\\\n\". Иными словами, если вы хотите найти " +"последовательность обратных слэшей, вам необходимо увеличить число вводимых " +"обратных слэшей вдвое." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Установка курсора на определённую строку" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"Для установки курсора на определённую строку в текущем файле, выберите " +"ПоискПерейти к строке. Окно для указания строки появится в верхней части " +"области просмотра." + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" +"Начните вводить номер строки, на которую хотите переместить курсор, и " +"документ прокрутится до указанной строки." + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" +"Чтобы покинуть окно и перейти к указанной строке, нажмите клавишу " +"Ввод." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Печать" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Установка параметров страницы" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Чтобы настроить параметры страницы, нужно выбрать ФайлПараметры страницы. На " +"экране отобразится диалоговое окно Параметры страницы." + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "Этот диалог позволит настроить следующие параметры печати:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Вкладка «Общие»" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Печать подсветки синтаксиса" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Выберите эту настройку для печати синтаксической подсветки. Смотрите также " +"." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Печать заголовков страниц" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Параметр включает заголовок для каждой страницы. Заголовок не " +"конфигурируется." + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "Номера строк" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Параметр Печатать номера строк включает печать номеров " +"строк." + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Используя поле Печатать номера строк каждые ... строк, " +"можно указать как часто будут печататься номера. Например, каждые 5 или " +"каждые 10 строк." + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1168(guilabel) C/gedit.xml:1687(para) +msgid "Text Wrapping" +msgstr "Перенос текста" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Параметр Включить режим переноса текста позволяет " +"переносить не убирающийся в строку текст на новую строку. Не влияет на " +"нумерацию строк." + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Параметр Не разрывать слово между строками позволяет " +"переносить текст по целым словам." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Шрифты" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Тело" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "Щёлкнув по этой кнопке, можно выбрать шрифт для печати тела текста." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Номера строк" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "Эта кнопка позволит выбрать шрифт для печати номеров строк." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Верхние и нижние колонтитулы" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Этой кнопкой выбирается шрифт для печати верхних и нижних колонтитулов." + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Кнопкой Восстановить исходные шрифты можно " +"восстановить шрифты по умолчанию." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Печать документа" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Gedit может осуществлять следующие задачи печати:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Печать документа на принтере." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Печать в файл." + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"При печати в файл, gedit создает файл в одном из " +"предпечатных форматов. PostScript и Portable Document Format (PDF) являются " +"общими предпечатными форматами." + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Для предварительного просмотра печатаемой страницы, выберите " +"ФайлПросмотр печати." + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Чтобы напечатать текущий документ на принтере или в файл, необходимо вызвать " +"диалоговое окно Печать выполнив, например, " +"menuchoice>ФайлПечать." + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "Это окно позволит вам установить следующие параметры печати:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Вкладка «Задание»" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Диапазон печати" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "Выбор печатаемых страниц" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Все" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Печать всех страниц в документе." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Строки" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "В соответствующих полях можно указать номера печатаемых строк." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Выделенное" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Будет напечатан только выделенный текст. Если никакой текст не выделен, " +"параметр недоступен." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Копии" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"В поле Число копий можно указать сколько экземпляров " +"документа нужно напечатать." + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"При печати множества экземпляров, можно сортировать страницы по копиям с " +"помощью параметра Сортировать." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Вкладка «Принтер»" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Принтер" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "Используя этот список, можно выбрать принтер для печати." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Параметры" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Здесь можно выбрать настройки принтера." + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Чтобы настроить принтер, щёлкните Настроить. " +"Например, можно включить или отключить двухстороннюю печать, или отложенную " +"печать, если подобная функциональность поддерживается принтером." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Адрес" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "Можно выбрать:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Печать документа на CUPS-принтере." + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Если выбранный принтер — CUPS-принтер, значение списка может быть только " +"CUPS." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Печать документа на lpr-принтере." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Файл" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Печать в файл PostScript." + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"С помощью кнопки Сохранить как, можно указать имя и " +"местоположение файла." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Другой" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Позволяет использовать указанную команду для печати документа." + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "Введите в текстовом окне команду, включите все необходимые аргументы." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Состояние" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Функциональность не поддерживается в данной версии gedit." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Тип" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Комментарий" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Вкладка «Бумага»" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Размер бумаги" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "Можно выбрать из списка размер листа бумаги для последующей печати." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Ширина" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"В этом поле можно указать ширину листа бумаги. Соседний список задает " +"единицы измерения." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Высота" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Через это поле можно указать высоту листа бумаги." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Ориентация подачи" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "С помощью этого списка можно выбрать ориентацию бумаги в принтере." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Ориентация бумаги" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Через этот список выбирается ориентация страницы." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Размещение" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"Можно задать размещение страниц. В поле Образец можно " +"просмотреть каждое из сделанных изменений." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Источник бумаги" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Из этого списка можно выбрать источник бумаги." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Программирование" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Некоторые из возможностей программирования в gedit поддерживаются модулями. Например, «Список тегов» — модуль, " +"отображающий теги различных языков разметки: смотрите ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Подсветка синтаксиса" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"Синтаксическая подсветка делает код более легким в чтении человеком. " +"Различные смысловые элементы текста получают цветовую раскраску." + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"Gedit выбирает соответствующий режим подсветки " +"исходя из типа документа. Для замены режима подсветки выберите " +"ВидРежим подсветки синтаксиса, затем выберите один из пунктов меню:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Обычный" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Без подсветки." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Исходные тексты" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "Подсветка исходных кодов. Из подменю выберите нужный тип." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Разметка" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "Подсвечивает языки разметки. Из подменю можно выбрать нужный." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Языки сценариев" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "Подсветка скриптов. В подменю содержатся некоторые «скриптовые» языки." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Прочее" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "Другие режимы подсветки." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Вставка результатов выполнения команды в файл" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Можно использовать gedit для вставки результатов " +"выполнения какой-либо команды в текстовый файл. Например, ls | " +"gedit." + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Вывод команды ls будет помещён в новый текстовый файл в " +"окне gedit." + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Другой способ — использовать Внешние инструменты " +"для вставки результатов выполнения команды в текущий файл." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Клавиатурные комбинации" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Испольуйте комбинации клавиш, чтобы быстрее выполнять действия, нежели с " +"помощью мыши и меню. В следующей таблице представлены все комбинации клавиш " +"gedit." + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Подробнее о клавиатурных комбинациях можно узнать здесь: Desktop User Guide." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "Вкладки" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Клавиши для управления вкладками:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1016(para) C/gedit.xml:1044(para) C/gedit.xml:1091(para) +#: C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "Клавиши" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) C/gedit.xml:1046(para) C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Command" +msgstr "Действия" + +#: C/gedit.xml:875(para) +#| msgid "Ctrl + Alt + PageDown" +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Переключиться на следующую вкладку влево." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Переключиться на следующую вкладку вправо." + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Закрыть вкладку." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Сохранить документы во всех вкладках." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Закрыть все вкладки." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Перейти на n-ю вкладку." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Файлы" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Комбинации клавиш для работы с файлами:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Создать новый документ." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Открыть документ." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Открыть адрес (URI)." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Сохранить текущий документ." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Сохранить текущий документ под новым именем." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Напечатать текущий документ." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Настроить параметры печати." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Закрыть документ.." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Завершить работу Gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1408(guimenu) +#: C/gedit.xml:1414(guimenu) C/gedit.xml:1420(guimenu) +#: C/gedit.xml:1426(guimenu) +msgid "Edit" +msgstr "Правка" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Комбинации клавиш для редактирования:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Отменить последнюю операцию." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Вернуть последнюю отменённую операцию." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Вырезать выделенный текст и поместить его в буфер обмена." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Скопировать выделенный текст в буфер обмена." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Вставить содержимого буфера обмена." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Выделить весь текст." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Удалить текущую строку." + +#. ============= Panes ======================= +#: C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "Панели" + +#: C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Комбинации клавиш для отображения или скрытия панелей:" + +#: C/gedit.xml:1023(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "Отобразить или скрыть боковую панель." + +#: C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "Отобразить или скрыть нижнюю панель." + +#. ============= Search ======================= +#: C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "Поиск" + +#: C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "Комбинации клавиш для поиска:" + +#: C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "Найти строку." + +#: C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "Найти следующее совпадение." + +#: C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "Найти предыдущее совпадение." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "Интерактивный поиск." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "Найти и заменить." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "Очистить подсветку найденных вхождений." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "Перейти к строке по её номеру." + +#. ============= Tools ======================= +#: C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "Инструменты." + +#: C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "Комбинации клавиш для управления инструментами:" + +#: C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "Проверить орфографию." + +#: C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Удалить завершающие пробелы." + +#: C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "Добавить отступ." + +#: C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "Удалить отступ." + +#: C/gedit.xml:1114(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Запустить \"make\" в текущем каталоге (при наличии модуля)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "Вывести список файлов (при наличии модуля)." + +#. ============= Help ======================= +#: C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "Справка" + +#: C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "Комбинации клавиш для управления справочной системой:" + +#: C/gedit.xml:1141(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "Открыть руководство пользователя gedit." + +#: C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "Параметры" + +#: C/gedit.xml:1156(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Для настройки gedit выберите " +"ПравкаПараметры. Диалоговое окно Параметры содержит " +"элементы:" + +#: C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "Настройки вида" + +#: C/gedit.xml:1170(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Выберите Включить режим переноса текста, чтобы длинные " +"строки объединялись в абзацы, а не забегали за край окна. Горизонтальная " +"прокрутка станет не нужной." + +#: C/gedit.xml:1171(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Параметр Не разрывать слово между двумя строками " +"включает перенос текста между строками по словам. Текст становится легче " +"читать." + +#: C/gedit.xml:1177(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"Выбор настройки Показывать номера строк отобразит " +"номера строк по левому краю окна gedit." + +#: C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "Текущая строка" + +#: C/gedit.xml:1183(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"Выберите параметр Подсвечивать текущую строку для " +"подсветки строки, где находится курсор." + +#: C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "Правая граница" + +#: C/gedit.xml:1189(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Выберите Отображать правую границу, чтобы отображалась " +"вертикальная линия — правая граница." + +#: C/gedit.xml:1190(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"Используя поле Правая граница у столбца, можно указать " +"положение этой вертикальной линии." + +#: C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "Соответствие скобок" + +#: C/gedit.xml:1196(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"Выберите параметр Подсвечивать соответствующую скобку " +"для подсветки соответствующих скобок, когда курсор установлен на одной из " +"них." + +#: C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "Настройки редактирования" + +#: C/gedit.xml:1209(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"С помощью поля Ширина табуляции, можно задать ширину " +"свободного пространства, вставляемого gedit по " +"нажатию клавиши Tab." + +#: C/gedit.xml:1210(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Параметр Вставлять пробелы вместо табуляций укажет " +"gedit по нажатию клавиши Tab " +"вставлять вместо символа табуляции определённое число пробелов." + +#: C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "Автоматический отступ" + +#: C/gedit.xml:1216(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Параметр Включить автоматический отступ определяет " +"будет ли следующая строка начинаться с такого же отступа как и предыдущая." + +#: C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "Сохранение файлов" + +#: C/gedit.xml:1222(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"При включённой настройке Создавать резервную копию файла перед " +"сохранением каждый раз при сохранении файла, создается его " +"резервная копия. Резервная копия содержит символ ~ в конце имени файла." + +#: C/gedit.xml:1223(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Параметр Автоматически сохранять каждые ... минут " +"позволяет автоматически сохранять текущий файл через определённые промежутки " +"времени." + +#: C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "Шрифты и цвета" + +#: C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "Шрифт" + +#: C/gedit.xml:1235(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Выберите guilabel>Использовать исходный шрифт темы, чтобы текст в " +"окне gedit отображался шрифтом определённым по " +"умолчанию." + +#: C/gedit.xml:1236(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"В поле Шрифт редактора отображается текущий шрифт, " +"используемый для отрисовки текста. Щелчок по кнопке позволит установить сам " +"шрифт, его начертание и размер." + +#: C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "Цветовая схема" + +#: C/gedit.xml:1242(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"Вы можете выбрать цветовую схему из списка схем. По умолчанию, " +"представлены следующие цветовые схемы:" + +#: C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "Классическая" + +#: C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Классическая цветовая схема. Основана на цветовой схеме gvim." + +#: C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "Кобальтовая синь" + +#: C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "Синеватая цветовая схема." + +#: C/gedit.xml:1257(guilabel) +#| msgid "State" +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Цветовая схема, используемая в текстовом редакторе Kate." + +#: C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "Забвение" + +#: C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Темная цветовая схема, использующая цветовую палитру Танго." + +#: C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "Танго" + +#: C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Цветовая схема Танго." + +#: C/gedit.xml:1275(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"Чтобы добавить новые цветовые схемы, щёлкните Добавить..." +"и выберите файл с цветовой схемой" + +#: C/gedit.xml:1276(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" +"Чтобы удалить выбранную цветовую схему, щёлкните на кнопке Удалить" + +#: C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "Настройка модулей" + +#: C/gedit.xml:1284(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Модули расширяют возможности gedit. Для " +"информации о встроенных модулях смотрите ." + +#: C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "Подключение модулей" + +#: C/gedit.xml:1289(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Чтобы подключить модуль в gedit, следуйте " +"инструкциям:" + +#: C/gedit.xml:1292(para) C/gedit.xml:1313(para) C/gedit.xml:1637(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Выберите ПравкаПараметры." + +#: C/gedit.xml:1295(para) C/gedit.xml:1316(para) C/gedit.xml:1640(para) +msgid "Select the Plugins tab." +msgstr "Перейдите на вкладку Модули." + +#: C/gedit.xml:1298(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "Отметьте модуль который хотите включить." + +#: C/gedit.xml:1301(para) C/gedit.xml:1322(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Щёлкните кнопку Закрыть для закрытия диалога " +"Параметры." + +#: C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "Отключение модулей" + +#: C/gedit.xml:1309(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Модули остаются включёнными после выхода из gedit." + +#: C/gedit.xml:1310(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "Чтобы отключить модуль проделайте следующее:" + +#: C/gedit.xml:1319(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "Просто снимите галочку с отключаемого модуля." + +#: C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "Модули" + +#: C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "Работа с модулями" + +#: C/gedit.xml:1334(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Подключая модули, можно расширить функциональность " +"gedit. Модули — это дополнительные программы. Они " +"могут добавлять новые пункты меню для доступа к предоставляемым ими " +"возможностям." + +#: C/gedit.xml:1336(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Некоторые модули идут вместе с gedit, но можно " +"установить и другие. На веб-сайте gedit есть список дополнительных модулей." + +#: C/gedit.xml:1337(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Для включения или отключения модулей смотрите Настройка модулей." + +#: C/gedit.xml:1338(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "Следующие модули идут вместе с gedit:" + +#: C/gedit.xml:1344(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Изменить регистр позволяет сменить регистр символов выделенного текста." + +#: C/gedit.xml:1347(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Статистика " +"документа показывает число строк, слов и символов в " +"документе." + +#: C/gedit.xml:1350(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Внешние " +"инструменты позволяет исполнить внешние команды из " +"gedit." + +#: C/gedit.xml:1353(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Обозреватель файлов позволяет просмотреть папки и " +"файлы в боковой панели." + +#: C/gedit.xml:1356(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Отступ вставляет или убирает отступ в выделенных строках." + +#: C/gedit.xml:1359(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Вставка даты и " +"времени вставляет текущую дату и время в позиции " +"курсора." + +#: C/gedit.xml:1362(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Modelines Поддержка Emacs, Kate и Vim-стиля строк режимов для gedit." + +#: C/gedit.xml:1365(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Консоль Python позволяет запускать команды на языке программирования " +"Python." + +#: C/gedit.xml:1368(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Фрагменты текста позволяет быстро вставлять часто используемые фрагменты " +"текста." + +#: C/gedit.xml:1371(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Сортировка сортирует документ или выделенный текст." + +#: C/gedit.xml:1374(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Проверка " +"орфографии проверяет орфографию в текущем документе." + +#: C/gedit.xml:1377(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Список тегов предоставляет простой способ вставки в документ часто " +"используемых тегов или строк без необходимости набирать их вручную." + +#: C/gedit.xml:1380(para) +msgid "" +"User Name inserts the username of the current user into the document." +msgstr "" +"Имя пользователя вставляет имя пользователя в позиции курсора." + +#: C/gedit.xml:1387(title) +msgid "Change Case Plugin" +msgstr "Модуль смены регистра символов" + +#: C/gedit.xml:1388(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"Модуль Изменить регистр меняет регистр символов " +"выделенного текста." + +#: C/gedit.xml:1389(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Если модуль включен, в меню Правка будут доступны " +"следующие пункты меню:" + +#: C/gedit.xml:1399(para) +msgid "Menu Item" +msgstr "Пункт меню" + +#: C/gedit.xml:1401(para) +msgid "Action" +msgstr "Действие" + +#: C/gedit.xml:1403(para) +msgid "Example" +msgstr "Пример" + +#: C/gedit.xml:1409(guisubmenu) C/gedit.xml:1415(guisubmenu) +#: C/gedit.xml:1421(guisubmenu) C/gedit.xml:1427(guisubmenu) +msgid "Change Case" +msgstr "Изменить регистр" + +#: C/gedit.xml:1409(guimenuitem) +msgid "All Upper Case" +msgstr "Все в верхнем регистре" + +#: C/gedit.xml:1410(para) +msgid "Change each character to uppercase." +msgstr "Меняет регистр каждого символа в верхний регистр." + +#: C/gedit.xml:1411(para) +msgid "This text becomes THIS TEXT" +msgstr "" +"Этот текст превратится в ЭТОТ ТЕКСТ" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Lower Case" +msgstr "Все в нижнем регистре" + +#: C/gedit.xml:1416(para) +msgid "Change each character to lowercase." +msgstr "Сменяет регистр каждого символа к нижнему регистру." + +#: C/gedit.xml:1417(para) +msgid "This Text becomes this text" +msgstr "" +"Этот Текст превратится в этот текст" + +#: C/gedit.xml:1421(guimenuitem) +msgid "Invert Case" +msgstr "Инвертировать регистр" + +#: C/gedit.xml:1422(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" +"Меняет регистр каждого символа, нижний к верхнему, а верхний к нижнему." + +#: C/gedit.xml:1423(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" +"Этот Текст превратится в эТОТ тЕКСТ" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Title Case" +msgstr "Регистр заголовка" + +#: C/gedit.xml:1428(para) +msgid "Change the first character of each word to uppercase." +msgstr "Меняет регистр первого символа каждого слова к верхнему регистру." + +#: C/gedit.xml:1429(para) +msgid "this text becomes This Text" +msgstr "" +"этот текст превратится в Этот Текст" + +#: C/gedit.xml:1438(title) +msgid "Document Statistics Plugin" +msgstr "Модуль «Статистика документа»" + +#: C/gedit.xml:1439(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"Модуль Статистика документа подсчитывает число " +"строк, слов, символов с пробелами, символов без пробелов, а также байты в " +"текущем файле. Результаты выводятся в диалоговом окне Статистика " +"документа. Чтобы воспользоваться данным модулем выполните " +"следующие действия:" + +#: C/gedit.xml:1441(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Выберите СервисПоказать " +"статистику документа. Диалог будет содержать поля:" + +#: C/gedit.xml:1444(para) +msgid "Number of lines in the current document." +msgstr "Число строк в текущем документе." + +#: C/gedit.xml:1447(para) +msgid "Number of words in the current document." +msgstr "Количество слов." + +#: C/gedit.xml:1450(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Число символов вместе с пробелами." + +#: C/gedit.xml:1453(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Число символов, не считая пробелов." + +#: C/gedit.xml:1456(para) +msgid "Number of bytes in the current document." +msgstr "Число байт." + +#: C/gedit.xml:1461(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Можно продолжать редактирование файла и при открытом окне " +"Статистика документа. Кнопка Обновить обновляет содержимое диалога." + +#: C/gedit.xml:1468(title) +msgid "External Tools Plugin" +msgstr "Модуль «Внешние инструменты»" + +#: C/gedit.xml:1469(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"Модуль Внешние инструменты позволяет выполнить " +"внешние команды и скрипты оболочки. Можно передать команде некоторые данные, " +"а затем использовать ее вывод (например, sed)." + +#: C/gedit.xml:1470(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Используя Менеджер внешних инструментов можно создавать " +"и редактировать команды. Для запуска внешних команд испоьзуйте " +"Сервис." + +#: C/gedit.xml:1473(title) +msgid "Built-in Commands" +msgstr "Встроенные команды" + +#: C/gedit.xml:1474(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "Следующие команды поставляются вместе с модулем:" + +#: C/gedit.xml:1476(term) +msgid "Build" +msgstr "Сборка" + +#: C/gedit.xml:1478(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Запускает make в каталоге текущего документа." + +#: C/gedit.xml:1481(term) +msgid "Directory Listing" +msgstr "Список файлов в каталоге" + +#: C/gedit.xml:1483(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "Вставляет содержание каталога текущего документа в новый документ." + +#: C/gedit.xml:1486(term) +msgid "Environment Variables" +msgstr "Переменные окружения" + +#: C/gedit.xml:1488(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Отображает список переменных окружения в нижней панели." + +#: C/gedit.xml:1491(term) +msgid "Grep" +msgstr "Поиск по файлам" + +#: C/gedit.xml:1493(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Ищет выражение во всех файлах в каталоге текущего документа, используя " +"шаблоны. Результаты отображаются в нижней панели." + +#: C/gedit.xml:1496(term) +msgid "Remove Trailing Spaces" +msgstr "Удалить конечные пробелы" + +#: C/gedit.xml:1498(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Удаляет все начинающие и завершающие пробелы в строках." + +#: C/gedit.xml:1505(title) +msgid "Defining a Command" +msgstr "Определение команд" + +#: C/gedit.xml:1506(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Чтобы добавить внешнюю команду, выберите СервисExternal Tools." + +#: C/gedit.xml:1507(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"В окне External Tools Manager щёлкните кнопку " +"Создать. Для новой команды можно указать следующие " +"детали:" + +#: C/gedit.xml:1509(term) +msgid "Description" +msgstr "Описание" + +#: C/gedit.xml:1511(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "Когда меню команды выбрано, описание отображается в строке статуса." + +#: C/gedit.xml:1514(term) +msgid "Accelerator" +msgstr "Комбинация клавиш" + +#: C/gedit.xml:1516(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Комбинация клавиш для вызова команды." + +#: C/gedit.xml:1519(term) +msgid "Commands" +msgstr "Команды" + +#: C/gedit.xml:1521(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Запускаемые команды. Можно использовать также и переменные окружения, " +"подробнее смотрите ." + +#: C/gedit.xml:1524(term) +msgid "Input" +msgstr "Ввод" + +#: C/gedit.xml:1526(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Данные, получаемые командами (как stdin): текст " +"всего текущего документа, выделение, строка или слово." + +#: C/gedit.xml:1529(term) +msgid "Output" +msgstr "Окно вывода" + +#: C/gedit.xml:1531(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Что делать с выводом команд: отобразить в нижней панели, вставить в новый " +"документ или в текущий; в конец, в позицию курсора, заменить выделенный " +"текст в документе или же заменить весь документ." + +#: C/gedit.xml:1534(term) +msgid "Applicability" +msgstr "Применимость" + +#: C/gedit.xml:1536(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Определяет тип документа, к которому применимы команды, например, локальные " +"документы или документы в сети." + +#: C/gedit.xml:1544(title) +msgid "Editing and Removing Tools" +msgstr "Изменение и удаление инструментов" + +#: C/gedit.xml:1545(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" +"Для настройки инструмента выберите его из списка и измените его параметры." + +#: C/gedit.xml:1546(para) +msgid "To rename a tool, click it again in the list." +msgstr "Для переименования инструмента, щёлкните его в списке." + +#: C/gedit.xml:1547(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Чтобы восстановить измененные встроенные инструменты, нажмите " +"Вернуть." + +#: C/gedit.xml:1548(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Для удаления инструмента, выберите его в списке и нажмите кнопку " +"Удалить. Встроенные инструменты удалить нельзя. " +"Удаляются только инструменты сделанные вами." + +#: C/gedit.xml:1552(title) +msgid "Variables" +msgstr "Переменные" + +#: C/gedit.xml:1553(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"В поле Команда можно использовать следующие переменные:" + +#: C/gedit.xml:1556(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1559(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1581(title) +msgid "File Browser Plugin" +msgstr "Модуль просмотра файловой системы" + +#: C/gedit.xml:1582(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Модуль File Browser отображает папки и файлы в " +"боковой панели, позволяя быстро открывать файлы." + +#: C/gedit.xml:1583(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Для просмотра папок и файлов выберите ВидБоковая панель, щёлкните " +"вкладку внизу." + +#: C/gedit.xml:1585(title) +msgid "Browsing your Files" +msgstr "Просмотр файлов" + +#: C/gedit.xml:1586(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"Вкладка Просмотр файлов изначально отображает закладки. Для просмотра " +"содержимого любого элемента щёлкните по нему дважды." + +#: C/gedit.xml:1587(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Чтобы подняться на уровень выше, воспользуйтесь выпадающим списком или " +"нажмите клавишу со стрелкой вверх (фокус ввода должен быть на панели)." + +#: C/gedit.xml:1588(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Чтобы просмотреть папку документа, с которым работаете сейчас, щёлкните " +"правой кнопкой на списке файлов и выберите Перейти в активному " +"документу." + +#: C/gedit.xml:1592(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Двойной щелчок на файле открывает его в gedit." + +#: C/gedit.xml:1595(title) +msgid "Creating Files and Folders" +msgstr "Создание файлов и папок" + +#: C/gedit.xml:1596(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Чтобы создать файл в текущей папке, щёлкните на списке файлов правой кнопкой " +"мыши и выберите Создать файл." + +#: C/gedit.xml:1597(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Для создания новой папки в текущей, отображаемой в браузере, щёлкните правой " +"кнопкой мыши в списке файлов и выберите Создать папку." + +#: C/gedit.xml:1602(title) +msgid "Indent Lines Plugin" +msgstr "Модуль «Отступы строк»" + +#: C/gedit.xml:1603(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"Модуль Отступ вставляет или убирает отступ в " +"начале строки." + +#: C/gedit.xml:1604(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Чтобы вставить или убрать отступ, сделайте следующее:" + +#: C/gedit.xml:1606(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Выделите строки. Если это одна строка, просто оставьте курсор где-нибудь в " +"ее пределах." + +#: C/gedit.xml:1611(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Для вставки отступа выберите ПравкаСделать отступ." + +#: C/gedit.xml:1614(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Для его удаления: ПравкаУбрать " +"отступ." + +#: C/gedit.xml:1619(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"Количество пробелов, а также будут ли это пробелы или символ табуляции " +"зависят от настроек Метки табуляции в параметрах " +"редактора, смотрите ." + +#: C/gedit.xml:1624(title) +msgid "Insert Date/Time Plugin" +msgstr "Модуль вставки даты и времени" + +#: C/gedit.xml:1625(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Модуль Вставка даты и времени вставляет текущую " +"дату и время в текущий документ. Чтобы использовать его:" + +#: C/gedit.xml:1627(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Выберите ПравкаВставить дату и " +"время." + +#: C/gedit.xml:1628(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Если вы не настраивали данный модуль на вставку даты и времени без запроса " +"формата, то gedit отобразит диалог " +"Вставить дату и время. Выберите из списка нужный формат " +"и щёлкните Вставить. Текущие дата и время будут " +"вставлены в позицию курсора. Диалог закроется автоматически." + +#: C/gedit.xml:1629(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Если gedit уже настроен для вставки даты и " +"времени определённого формата, диалог Вставить дату и время показан не будет." + +#: C/gedit.xml:1634(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Настройка модуля вставки даты и времени" + +#: C/gedit.xml:1635(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Для настройки модуля вставки даты и времени, выполните следующее:" + +#: C/gedit.xml:1643(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Выберите модуль Вставка даты и времени." + +#: C/gedit.xml:1646(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Щёлкните кнопку Настроить модуль. Появится диалог " +"Настроить модуль вставки даты и времени." + +#: C/gedit.xml:1649(para) +msgid "Select one of the options, as follows:" +msgstr "Выберите одну из возможностей:" + +#: C/gedit.xml:1651(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Для запроса формата вставки каждый раз, выберите Запрашивать " +"формат." + +#: C/gedit.xml:1654(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Если вы хотите использовать один и тот же формат при вставке даты и времени, " +"и не хотите, чтобы gedit спрашивал о формате " +"каждый раз — ваш выбор Использовать указанный формат. " +"Формат вставки можно выбрать из списка." + +#: C/gedit.xml:1657(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Можно предложить свой собственный формат выбрав Использовать " +"другой формат. Подробнее смотрите strftime3. При вставке " +"формат также запрашиваться не будет." + +#: C/gedit.xml:1662(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "Щёлкните OK для закрытия диалога." + +#: C/gedit.xml:1665(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Закройте диалог Параметры щелкнув по кнопке " +"Закрыть." + +#: C/gedit.xml:1672(title) +msgid "Modelines Plugin" +msgstr "Модуль «Строки режимов»" + +#: C/gedit.xml:1673(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Модуль Строки режимов позволяет установить " +"индивидуальные настройки документа. Строки режимов " +"представляют собой строки текста в начале или конце документа с параметрами " +"для gedit." + +#: C/gedit.xml:1674(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" +"Значения параметров установленных с помощью строк режимов имеют преимущество " +"перед значениями тех же параметров установленных через диалог установки " +"параметров." + +#: C/gedit.xml:1675(para) +msgid "You can set the following preferences with modelines:" +msgstr "Можно установить следующие параметры с помощью строк режимов:" + +#: C/gedit.xml:1678(para) +msgid "Tab width" +msgstr "Ширина табуляции" + +#: C/gedit.xml:1681(para) +msgid "Indent width" +msgstr "Ширина отступа" + +#: C/gedit.xml:1684(para) +msgid "Insert spaces instead of tabs" +msgstr "Пробелы вместо табуляций" + +#: C/gedit.xml:1690(para) +msgid "Right margin width" +msgstr "Положение правой границы" + +#: C/gedit.xml:1694(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Модуль Строки режимов поддерживает некоторые " +"возможности настроек других текстовых редакторов: Emacs, Kate и Vim по заголовку текстового файла." + +#: C/gedit.xml:1697(title) +msgid "Emacs Modelines" +msgstr "«Строки режимов» Emacs" + +#: C/gedit.xml:1698(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "Сканируются первые две строки в документе." + +#: C/gedit.xml:1699(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"Из настроек Emacs поддерживаются ширина " +"табуляции, отступ выравнивания, режим отступа с помощью табуляции и авто-" +"перенос. Для дополнительной информации смотрите Руководство по GNU " +"Emacs." + +#: C/gedit.xml:1702(title) +msgid "Kate Modelines" +msgstr "«Строки режимов» Kate" + +#: C/gedit.xml:1703(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "Сканируются первые и последние десять строк документа." + +#: C/gedit.xml:1704(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"Из настроек Kate поддерживаются ширина табуляции, " +"ширина отступа, отступ пробелами, перенос слов и номер столбца для переноса. " +"Для дополнительной информации смотрите Kate website." + +#: C/gedit.xml:1707(title) +msgid "Vim Modelines" +msgstr "«Строки режимов» Vim" + +#: C/gedit.xml:1708(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "Сканируются первые и последние три строки документа." + +#: C/gedit.xml:1709(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"Из настроек Vim поддерживаются expandtab, ts, " +"tabstop, shiftwidth, wrap и textwidth. Подробнее смотрите Vim " +"website." + +#: C/gedit.xml:1714(title) +msgid "Python Console Plugin" +msgstr "Модуль «Консоль Python»" + +#: C/gedit.xml:1715(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Модуль Консоль Python позволяет запускать команды " +"на языке программирования python. В нижнюю панель будет добавлена вкладка, в " +"которой можно ввести команду и просмотреть ее вывод." + +#: C/gedit.xml:1716(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Вводимые команды исполняются безо всякой проверки. Возможны зависания " +"gedit, например, при входе в бесконечный цикл." + +#: C/gedit.xml:1720(title) +msgid "Snippets Plugin" +msgstr "Модуль «Фрагменты текста»" + +#: C/gedit.xml:1721(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"Модуль Фрагменты текста позволяет сохранять часто " +"используемые куски текста и, затем быстро вставлять эти куски в любое место " +"в редактируемом документе." + +#: C/gedit.xml:1722(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Фрагменты текста специфичны для языка текущего документа. Например, работая " +"с HTML-документом, можно выбирать фрагменты для HTML. Некоторые текстовые " +"фрагменты глобальны, они доступны для всех видов документов." + +#: C/gedit.xml:1723(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Некоторое количество фрагментов поставляется в составе gedit. Их можно менять." + +#: C/gedit.xml:1726(title) +msgid "Inserting Snippets" +msgstr "Вставка фрагментов" + +#: C/gedit.xml:1727(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Для вставки фрагмента напечатайте его tab trigger и " +"нажмите клавишу Tab. Tab trigger " +"фрагмента текста — это обычно первые несколько символов нужного фрагмента, " +"либо какая-нибудь еще короткая и легко запоминающаяся последовательность." + +#: C/gedit.xml:1728(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Другой способ: нажатие CtrlSpace позволит выбрать из списка нужный для вставки фрагмент." + +#: C/gedit.xml:1732(title) +msgid "Adding Snippets" +msgstr "Добавление фрагментов" + +#: C/gedit.xml:1733(para) +msgid "To create a new snippet, do the following:" +msgstr "Чтобы создать новый фрагмент текста:" + +#: C/gedit.xml:1736(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Выберите СервисУправление " +"фрагментами. Откроется окно Менеджер " +"фрагментов." + +#: C/gedit.xml:1739(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"В списке фрагменты текста сгруппированы по языкам. Выберите язык, для " +"которого хотите добавить фрагмент. Для добавления фрагмента, касающегося " +"всех языков, выберите «Глобальный»." + +#: C/gedit.xml:1742(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Щёлкните Создать, и новый фрагмент добавится в список." + +#: C/gedit.xml:1745(para) +msgid "Enter the following information for the new snippet:" +msgstr "Введите следующую информацию о фрагменте:" + +#: C/gedit.xml:1747(term) +msgid "Name" +msgstr "Имя" + +#: C/gedit.xml:1749(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Введите имя фрагмента в текстовое поле в списке. Имя служит только для " +"отражения сути фрагмента. Можно изменить имя текстового фрагмента, щелкнув " +"по нему мышкой." + +#: C/gedit.xml:1752(term) +msgid "Snippet text" +msgstr "Текст фрагмента" + +#: C/gedit.xml:1754(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Введите текст самого фрагмента в текстовое поле Редактировать " +"фрагмент. Смотрите также ." + +#: C/gedit.xml:1755(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Можно переключаться в окно документа без закрытия окна Менеджер " +"фрагментов." + +#: C/gedit.xml:1758(term) +msgid "Tab Trigger" +msgstr "Tab Trigger" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Введите tab trigger для фрагмента. Этот текст нужно напечатать до нажатия " +"клавиши Tab при вставке фрагмента." + +#: C/gedit.xml:1761(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Tab trigger Может быть либо одним символом, либо " +"словом, состоящим только из букв. Если введенный tab trigger невозможен, он " +"будет подсвечен красным цветом." + +#: C/gedit.xml:1764(term) +msgid "Shortcut key" +msgstr "Комбинация клавиш" + +#: C/gedit.xml:1766(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Введите комбинацию клавиш, для вставки фрагмента." + +#: C/gedit.xml:1775(title) +msgid "Editing and Removing Snippets" +msgstr "Редактирование и удаление фрагментов" + +#: C/gedit.xml:1776(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" +"Для редактирования фрагмента выберите его из списка и отредактируйте. его " +"текст и параметры." + +#: C/gedit.xml:1777(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Для переименования фрагмента, щёлкните его в списке." + +#: C/gedit.xml:1778(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Чтобы восстановить измененные встроенные фрагменты, нажмите " +"Revert." + +#: C/gedit.xml:1779(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Для удаления фрагмента, выберите его в списке и нажмите кнопку " +"Удалить. Встроенные фрагменты удалить нельзя." + +#: C/gedit.xml:1783(title) +msgid "Snippet Substitutions" +msgstr "Подстановка во фрагментах" + +#: C/gedit.xml:1784(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"В дополнение к статичному тексту во фрагменты можно включать и изменяемый " +"текст, либо символы пробелов, куда можно будет добавить текст после вставки " +"фрагмента в документ." + +#: C/gedit.xml:1788(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "Можно использовать следующие символы-заменители:" + +#: C/gedit.xml:1790(term) +msgid "Tab placeholders" +msgstr "Закладки" + +#: C/gedit.xml:1792(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n устанавливает закладку, где " +"n — число больше 1." + +#: C/gedit.xml:1793(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} устанавливает закладку со значением по умолчанию." + +#: C/gedit.xml:1794(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Закладка маркирует место во фрагменте, куда можно добавить текст после " +"вставки фрагмента." + +#: C/gedit.xml:1795(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"После вставки фрагмента, курсор помещается в позицию первой закладки. Можно " +"ввести некоторый текст и, нажав клавишу Tab, переместиться " +"в позицию следующей закладки. Нумерация закладок и определяет порядок " +"переключения между ними." + +#: C/gedit.xml:1796(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"Нажав комбинацию клавиш ShiftTab, можно перейти к предыдущей закладке. Если закладок " +"больше нет, клавиша Tab перемещает курсор в конец " +"фрагмента, или к концевому символу-заменителю, если таковой имеется." + +#: C/gedit.xml:1799(term) +msgid "Mirror placeholders" +msgstr "Зеркала" + +#: C/gedit.xml:1801(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Несколько закладок будут отображать один и тот же текст. Зеркала позволяют " +"ввести текст лишь однажды и этот текст будет отображен в нескольких местах " +"во фрагменте." + +#: C/gedit.xml:1804(term) +msgid "End placeholder" +msgstr "Концевой символ-заменитель" + +#: C/gedit.xml:1806(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 определяет концевой символ-заменитель. Позволяет " +"завершить работу с фрагментом, оставив курсор в нужной позиции." + +#: C/gedit.xml:1809(term) +msgid "Environmental variables" +msgstr "Переменные окружения" + +#: C/gedit.xml:1811(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"Переменные окружения, такие как $PATH и $HOME могут быть использованы во фрагментах. Вот полный список переменных " +"окружения, что могут использоваться:" + +#: C/gedit.xml:1813(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1815(para) +msgid "The currently selected text." +msgstr "Текущий выделенный текст." + +#: C/gedit.xml:1818(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1820(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Полное имя текущего документа. Если документ еще не был сохранен, " +"возвращается пустая строка." + +#: C/gedit.xml:1823(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1825(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "Имя файла без пути, или пустая строка если файл не сохранен." + +#: C/gedit.xml:1828(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1830(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "Слово в позиции курсора. Слово будет заменено фрагментом текста." + +#: C/gedit.xml:1838(term) +msgid "Shell placeholders" +msgstr "Команды shell" + +#: C/gedit.xml:1840(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) во фрагменте текста " +"заменяется результатом выполнения cmd в shell." + +#: C/gedit.xml:1841(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) позволяет назначить ссылку этому элементу, где n — число больше 1. С помощью $n можно вывод одной команды подать на вход другой." + +#: C/gedit.xml:1844(term) +msgid "Python placeholders" +msgstr "Команды Python" + +#: C/gedit.xml:1846(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> заменяется " +"результатами вычислений cmd в интерпретаторе " +"языка python." + +#: C/gedit.xml:1847(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" определяет связь с другими python командами, где a — порядок их во фрагменте. Это позволяет использовать функции " +"python, определённые в других фрагментах. Для указания нескольких " +"зависимостей, разделите их запятыми: $<a,b:cmd>" +"" + +#: C/gedit.xml:1848(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Для использования переменных в python фрагментах, объявите их как " +"global." + +#: C/gedit.xml:1857(title) +msgid "Sort Plugin" +msgstr "Модуль сортировки" + +#: C/gedit.xml:1858(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Модуль Сортировка упорядочивает выбранные строки " +"в по алфавиту." + +#: C/gedit.xml:1859(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Операцию сортировки нельзя отменить, поэтому лучше сохранить файл перед ее " +"применением. Для возврата к сохраненной версии файла, можно будет выбрать " +"ФайлВосстановить." + +#: C/gedit.xml:1862(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Чтобы воспользоваться сортировкой выполните следующие действия:" + +#: C/gedit.xml:1865(para) +msgid "Select the lines of text you want to sort." +msgstr "Выделите строки для сортировки" + +#: C/gedit.xml:1867(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Выберите ПравкаСортировать. Откроется диалог Сортировка." + +#: C/gedit.xml:1870(para) +msgid "Choose the options you want for the sort:" +msgstr "Отметьте нужные параметры сортировки:" + +#: C/gedit.xml:1873(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Чтобы сортировать в обратном порядке, выберите В обратном порядке." + +#: C/gedit.xml:1876(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Для удаления дублирующих строк, отметьте Убирать повторения." + +#: C/gedit.xml:1879(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Чтобы не обращать внимания на регистр символов, выберите " +"Игнорировать регистр." + +#: C/gedit.xml:1882(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Можно также производить сортировку игнорируя первые несколько символов " +"строк. Для этого воспользуйтесь полем Начинать со столбца." + +#: C/gedit.xml:1887(para) +msgid "To perform the sort operation, click Sort." +msgstr "Кнопка Сортировать выполнит сортировку." + +#: C/gedit.xml:1894(title) +msgid "Spell Checker Plugin" +msgstr "Модуль проверки орфографии" + +#: C/gedit.xml:1895(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Модуль Проверка орфографии проверяет орфографию " +"выделенного текста. Можно настроить gedit на " +"автоматическую проверку орфографии, либо делать это вручную. Языковые " +"настройки и настройки авто-проверки применяются к документу. Для " +"использования модуля, следуйте инструкциям:" + +#: C/gedit.xml:1897(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Выберите СервисУстановить язык. На экране появится диалоговое окно " +"Установить язык. Выберите нужный язык из списка. " +"Щёлкните OK для закрытия диалога." + +#: C/gedit.xml:1900(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Для включения автоматической проверки орфографии выберите " +"СервисАвтоматически проверять " +"орфографию. Для отключения выберите " +"СервисАвтоматически проверять " +"орфографию еще раз. Когда авто-проверка включена, " +"рядом с этим пунктом меню появляется галочка. По умолчанию, авто-проверка " +"выключена." + +#: C/gedit.xml:1901(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Неизвестные слова отображаются другим цветом и подчёркиваются. Щелчок правой " +"кнопкой на таком слове и выбор подменю Возможные варианты " +"позволяет:" + +#: C/gedit.xml:1904(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Заменить слово на другое, предлагаемое из списка, просто щелкнув по нему." + +#: C/gedit.xml:1907(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Добавить слово в свой персональный словарь, выбрав " +"Возможные вариантыДобавить." + +#: C/gedit.xml:1910(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Игнорировать все подобные слова. Так слова не будут помечены как " +"неизвестные, но и не будут добавлены в ваш персональный словарь. Выберите " +"Возможные вариантыИгнорировать " +"все. Действует только в пределах текущей сессии " +"gedit." + +#: C/gedit.xml:1915(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Для проверки орфографии вручную, выберите СервисПроверить орфографию." + +#: C/gedit.xml:1917(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Если никаких ошибок найдено не было, будет выведено сообщение: нет ошибочных " +"слов." + +#: C/gedit.xml:1919(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Если же ошибки были встречены, отобразится диалог Проверка " +"орфографии:" + +#: C/gedit.xml:1922(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"Ошибочное слово будет показано в верхней части диалога." + +#: C/gedit.xml:1925(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Поле Заменить на будет содержать предлагаемый вариант " +"написания слова. Можно ввести в это поле свой вариант для замены, либо " +"выбрать альтернативу из списка Варианты." + +#: C/gedit.xml:1928(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Можно проверить написание введённого на замену слова, нажав кнопку " +"Проверить слово. Если написание правильное, в списке " +"Варианты будет надпись (правильное написание). Если же слово неизвестно, в списке Варианты " +"будут отражены уже варианты его написания." + +#: C/gedit.xml:1931(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Для игнорирования неизвестного слова, нажмите Игнорировать. Чтобы игнорировать все подобные слова, нажмите " +"Игнорировать все. Действительно только в пределах " +"текущей сессии gedit." + +#: C/gedit.xml:1934(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Для замены неизвестного слова на слово в текстовом поле Изменить " +"на, щёлкните на кнопке Изменить. Чтобы " +"заменить все подобные неизвестные слова в тексте всего документа, щёлкните " +"Изменить все." + +#: C/gedit.xml:1937(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Добавить неизвестное слово в свой персональный словарь можно щелкнув по " +"кнопке Добавить слово." + +#: C/gedit.xml:1940(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Для закрытия диалога Проверка орфографии щёлкните " +"Закрыть." + +#: C/gedit.xml:1949(title) +msgid "Tag List Plugin" +msgstr "Модуль списка тегов" + +#: C/gedit.xml:1950(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Модуль Список тегов позволяет вставлять в " +"документ теги из списка в боковой панели." + +#: C/gedit.xml:1951(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Для использования модуля:" + +#: C/gedit.xml:1953(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Выберите ВидБоковая панель." + +#: C/gedit.xml:1957(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"По умолчанию, в боковой панели отображается вкладка со списком открытых " +"документов. Щёлкните вкладку с изображением «+» внизу панели." + +#: C/gedit.xml:1959(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Выберите подходящую категорию тегов из выпадающего списка, например, " +"HTML - Теги." + +#: C/gedit.xml:1962(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Можно прокручивать список тегов в поисках нужного." + +#: C/gedit.xml:1965(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Чтобы вставить тег в позицию курсора в текущем файле, дважды щёлкните по " +"нужному тегу в списке. Другие способы вставки тегов:" + +#: C/gedit.xml:1967(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Для того, чтобы вставить тэг и переместить фокус ввода с боковой панели к " +"окну редактирования текущего документа, нажмите клавишу Ввод." + +#: C/gedit.xml:1970(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Для вставки тега и сохранения фокуса ввода за списком тегов, нажмите " +"комбинацию клавиш ShiftReturn." + +#: C/gedit.xml:1979(title) +msgid "User Name Plugin" +msgstr "Модуль «Имя пользователя»" + +#: C/gedit.xml:1980(para) +msgid "" +"The User name plugin inserts the username of the " +"current user into the document." +msgstr "" +"Модуль Имя пользователя вставляет имя текущего " +"пользователя в документ." + +#: C/gedit.xml:1981(para) +msgid "" +"To insert your username at the cursor position, choose " +"EditInsert User Name." +msgstr "" +"Чтобы вставить имя пользователя в позицию курсора, выберите " +"ПравкаВставить имя пользователя." + +#: C/gedit.xml:1983(para) +msgid "" +"This plugin is mostly provided as an example of how to create your own " +"plugins. For more information on creating plugins, see the gedit website." +msgstr "" +"Этот модуль, в основном, служит примером для создания своих собственных " +"модулей. Для дополнительной информации смотрите сайт gedit." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Салихов Тимур , 2006 - 2009." + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" + +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "Для дополнительной информации о настройке подсветки смотрите ." + +#~ msgid "Colors" +#~ msgstr "Цвета" + +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Выберите настройку Использовать исходный набор цветоа для использованию цветовой темы по умолчанию." + +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Щелчок по кнопке Цвет обычного текста позволит " +#~ "выбрать цвет для отрисовки обычного текста в окне gedit." + +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Кнопка Цвет фона позволит установить цвет фона " +#~ "текстового окна." + +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Кнопкой Цвет выделенного текста можно выбрать цвет " +#~ "шрифта для выделенного текста." + +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Кнопка Цвет выделения устанавливает цвет фона для " +#~ "выделенного текста." + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Настройка синтаксической подсветки" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "Включить подсветку синтаксиса" + +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "Параметр включает подсветку синтаксиса редактируемого текста." + +#~ msgid "Highlight mode" +#~ msgstr "Режим подсветки" + +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "Из списка можно выбрать режим подсветки для его настройки." + +#~ msgid "Elements" +#~ msgstr "Элементы" + +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "" +#~ "Здесь находятся синтаксические элементы, подсветку которых можно " +#~ "настроить." + +#~ msgid "Format buttons" +#~ msgstr "Кнопки форматирования" + +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Следующие кнопки меняют форматирование выбранного синтаксического " +#~ "элемента:" + +#~ msgid "Button" +#~ msgstr "Кнопка" + +#~ msgid "Format" +#~ msgstr "Форматирование" + +#~ msgid "Shows icon for bold format." +#~ msgstr "Полужирное форматирование." + +#~ msgid "Bold" +#~ msgstr "Полужирный" + +#~ msgid "Shows icon for italic format." +#~ msgstr "Курсив." + +#~ msgid "Italic" +#~ msgstr "Курсив" + +#~ msgid "Shows icon for underline." +#~ msgstr "Подчеркивание." + +#~ msgid "Underline" +#~ msgstr "Подчеркивание" + +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Перечеркнутое начертание." + +#~ msgid "Strikethrough" +#~ msgstr "Перечеркивание" + +#~ msgid "Foreground" +#~ msgstr "Буквы" + +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Параметр позволяет изменить цвет выбранного синтаксического элемента." +#~ "Щёлкните на кнопке для отображения диалога выбора цвета, затем выберите " +#~ "цвет." + +#~ msgid "Background" +#~ msgstr "Фон" + +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Параметр позволяет изменить цвет фона для выбранного синтаксического " +#~ "элемента. Щёлкните на кнопке для отображения диалога выбора цвета, затем " +#~ "выберите цвет фона." + +#~ msgid "Reset to Default" +#~ msgstr "По умолчанию" + +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Щелчок по данной кнопке сбрасывает настроенное форматирование выбранного " +#~ "синтаксического элемента." diff --git a/help/sv/figures/gedit_window.png b/help/sv/figures/gedit_window.png new file mode 100755 index 00000000..dc001845 Binary files /dev/null and b/help/sv/figures/gedit_window.png differ diff --git a/help/sv/sv.po b/help/sv/sv.po new file mode 100755 index 00000000..49cff67a --- /dev/null +++ b/help/sv/sv.po @@ -0,0 +1,3026 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: gedit\n" +"POT-Creation-Date: 2009-05-17 18:37+0000\n" +"PO-Revision-Date: 2009-08-23 23:06+0100\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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 link 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 länk eller i filen COPYING-DOCS som medföljer denna handbok." + +#: 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 "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." + +#: 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 "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." + +#: 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 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 "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; 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." + +#: 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: " +msgstr "DOKUMENTET OCH MODIFIERADE VERSIONER AV DOKUMENTET TILLHANDAHÅLLS UNDER VILLKOREN I GNU FREE DOCUMENTATION LICENSE ENDAST UNDER FÖLJANDE FÖRUTSÄTTNINGAR: " + +#. 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/gedit.xml:268(None) +msgid "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "@@image: 'figures/gedit_recent_files_menu_icon.png'; md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "@@image: 'figures/gedit_recent_files_menu_icon.png'; md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Handbok för Gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) +#: C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) +#: C/gedit.xml:79(orgname) +#: C/gedit.xml:120(para) +#: C/gedit.xml:128(para) +#: C/gedit.xml:136(para) +#: C/gedit.xml:144(para) +#: C/gedit.xml:152(para) +#: C/gedit.xml:160(para) +#: C/gedit.xml:168(para) +#: C/gedit.xml:176(para) +#: C/gedit.xml:184(para) +#: C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "MATE:s dokumentationsprojekt" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) +#: C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) +#: C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Lade till tabell för snabbtangenter" + +#: C/gedit.xml:68(firstname) +#: C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java Desktop System Documentation Team" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek tillhandahöll information från tidigare revisioner av programmet gedit." + +#: C/gedit.xml:86(contrib) +#: C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "Tillkännagivanden" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George tillhandhöll information om insticksmoduler." + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "Handbok för gedit v2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "Mars 2002" + +#: C/gedit.xml:127(para) +#: C/gedit.xml:135(para) +#: C/gedit.xml:143(para) +#: C/gedit.xml:151(para) +#: C/gedit.xml:159(para) +#: C/gedit.xml:167(para) +#: C/gedit.xml:175(para) +#: C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Suns MATE-dokumentationsteam" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "Handbok för gedit v2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "Juni 2002" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "Handbok för gedit v2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "Augusti 2002" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "Handbok för gedit v2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "September 2002" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "Handbok för gedit v2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "Januari 2003" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "Handbok för gedit v2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "Mars 2003" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "Handbok för gedit v2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "September 2003" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "Handbok för gedit v2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "Mars 2004" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "Handbok för gedit v2.8" + +#: C/gedit.xml:189(date) +#: C/gedit.xml:197(date) +msgid "July 2006" +msgstr "Juli 2006" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "Handbok för gedit v2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "MATE-dokumentationsteam" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "Den här handboken beskriver version 2.16 av gedit." + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "Återkoppling" + +#: C/gedit.xml:208(para) +msgid "To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "För att rapportera ett fel eller komma med ett förslag angående programmet gedit eller denna handbok, följ instruktionerna på MATE:s återkopplingssida." + +#: C/gedit.xml:213(para) +msgid "gedit is a text editor for the MATE Desktop featuring basic yet robust capabilities such as printing, spell checking, find and replace, and syntax highlighting. More advanced features are available as plugins." +msgstr "gedit är en textredigerare för MATE-skrivbordet som innehåller grundläggande men även kraftiga funktioner såsom utskrifter, stavningskontroll, sök och ersätt samt syntaxmarkering. Mer avancerade funktioner finns tillgängliga som insticksmoduler." + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "textredigerare" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "Introduktion" + +#: C/gedit.xml:229(para) +msgid "The gedit application enables you to create and edit text files." +msgstr "Programmet gedit låter dig skapa och redigera textfiler." + +#: C/gedit.xml:231(para) +msgid "The aim of gedit is to be a simple and easy to use text editor. More powerful features can be enabled with different plugins, allowing a variety of tasks related to text-editing." +msgstr "Målet med gedit är att vara en enkel och lättanvänd textredigerare. Mer kraftfulla funktioner kan aktiveras med olika insticksmoduler, som erbjuder en mängd funktioner relaterade till textredigering." + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "Komma igång" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "Starta gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "Du kan starta gedit på följande sätt:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "Program-menyn" + +#: C/gedit.xml:245(para) +msgid "Choose AccessoriesText Editor." +msgstr "Välj TillbehörTextredigerare." + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "Kommandorad" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "Kör följande kommando: gedit" + +#: C/gedit.xml:255(para) +msgid "By default, when you open a text document in the file manager, gedit will start, and display the document." +msgstr "Som standard, när du öppnar ett textdokument i filhanteraren, kommer gedit att starta och visa dokumentet." + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "Gedit-fönstret" + +#: C/gedit.xml:261(para) +msgid "When you start gedit, the following window is displayed:" +msgstr "När du startar gedit visas följande fönster:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "Gedit-fönstret" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "Visar gedits huvudfönster." + +#: C/gedit.xml:276(para) +msgid "The gedit window contains the following elements:" +msgstr "gedit-fönstret innehåller följande element:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "Menyrad" + +#: C/gedit.xml:281(para) +msgid "The menus on the menubar contain all of the commands you need to work with files in gedit." +msgstr "Menyerna på menyraden innehåller alla de kommandon som du behöver för att arbeta med filer i gedit." + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "Verktygsrad" + +#: C/gedit.xml:286(para) +msgid "The toolbar contains a subset of the commands that you can access from the menubar." +msgstr "Verktygsraden innehåller en del av de kommandon som du kan komma åt i menyraden." + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "Visningsrutan" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "Visningsrutan innehåller texten för filer som du redigerar." + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "Statusrad" + +#: C/gedit.xml:296(para) +msgid "The statusbar displays information about current gedit activity and contextual information about the menu items. The statusbar also displays the following information:" +msgstr "Statusraden visar information om aktuell aktivitet i gedit och sammanhangsinformation om menyobjekten. Statusraden visar även följande information:" + +#: C/gedit.xml:299(para) +msgid "Cursor position: the line number and column number where the cursor is located." +msgstr "Markörposition: rad- och kolumnnumret där markören är placerad." + +#: C/gedit.xml:302(para) +msgid "Edit mode: If the editor is in insert mode, the statusbar contains the text INS. If the editor is in overwrite mode, the statusbar contains the text OVR. Press the Insert key to change edit mode." +msgstr "Redigeringsläge: Om redigeraren är i infogningsläge kommer statusraden att innehålla texten INF. Om redigeraren är i överskrivningsläge kommer statusraden att innehålla texten ÖVR. Tryck på tangenten Insert för att ändra redigeringsläge." + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "Sidopanel" + +#: C/gedit.xml:309(para) +msgid "The side pane displays a list of open documents, and other information depending on which plugins are enabled." +msgstr "Sidopanelen visar en lista över öppnade dokument, och annan information beroende på vilka insticksmoduler som är aktiverade." + +#: C/gedit.xml:310(para) +msgid "By default the side pane is not shown. To show it, choose ViewSide Pane." +msgstr "Som standard visas inte sidopanelen. Välj VisaSidopanel för att visa den." + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "Underpanelen" + +#: C/gedit.xml:315(para) +msgid "The bottom pane is used by programming tools such as the Python Console plugin to display output." +msgstr "Underpanelen används av programmeringsverktyg, som till exempel insticksmodulen Python-konsoll, för att visa utdata." + +#: C/gedit.xml:316(para) +msgid "By default the bottom pane is not shown. To show it, choose ViewBottom Pane." +msgstr "Som standard visas inte underpanelen. Välj VisaUnderpanel för att visa den." + +#: C/gedit.xml:320(para) +msgid "When you right-click in the gedit window, the application displays a popup menu. The popup menu contains the most common text editing commands." +msgstr "När du högerklickar i gedit-fönstret kommer programmet att visa en popup-meny. Popup-menyn innehåller de mest vanliga textredigeringskommandona." + +#: C/gedit.xml:322(para) +msgid "Like other MATE applications, actions in gedit can be performed in several ways: with the menu, with the toolbar, or with shortcut keys. Shortcuts keys common to all applications are listed in the User Guide." +msgstr "Precis som andra MATE-program kan åtgärder i gedit genomföras på flera olika sätt: med menyn, med verktygsraden, eller med snabbtangenter. Vanliga snabbtangenter för samtliga program listas i Användarguiden." + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "Kör gedit från en kommandorad" + +#: C/gedit.xml:328(para) +msgid "You can run gedit from a command line and open a single file or multiple files. To open multiple files from a command line, type the following command, then press Return:" +msgstr "Du kan köra gedit från en kommandorad och öppna en eller flera filer. För att öppna flera filer från en kommandorad, ange följande kommando och tryck sedan Return:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "fil1.txt fil2.txt fil3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Alternativt kan du ange en uri istället för ett filnamn." + +#: C/gedit.xml:331(para) +msgid "For more information on how to run gedit from a command line, see the unix manual page for gedit, gedit1." +msgstr "För mer information om hur man kör gedit från en kommandorad, se Unix-manualsidan för gedit, gedit1." + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "Arbeta med filer" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "Skapa ett nytt dokument" + +#: C/gedit.xml:341(para) +msgid "To create a new document, choose FileNew. The application displays a new blank document in the gedit window." +msgstr "För att skapa ett nytt dokument, välj ArkivNy. Programmet visar ett blankt dokument i gedit-fönstret." + +#: C/gedit.xml:346(title) +#: C/gedit.xml:1589(title) +msgid "Opening a File" +msgstr "Öppna en fil" + +#: C/gedit.xml:347(para) +msgid "To open a file, choose FileOpen to display the Open File dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit window." +msgstr "För att öppna en fil, välj ArkivÖppna för att visa dialogrutan Öppna fil. Välj filen som du vill öppna och klicka sedan på Öppna. Filen visas i gedit-fönstret." + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Visar menyikonen Senaste filer" + +#: C/gedit.xml:349(para) +msgid "The application records the paths and filenames of the five most recent files that you edited and displays the files as menu items on the File menu. You can also click on the icon on the toolbar to display the list of recent files." +msgstr "Programmet sparar information om sökvägar och filnamn för de fem senaste filerna som du redigerat och visar filerna som menyobjekt i menyn Arkiv. Du kan även klicka på ikonen på verktygsraden för att visa listan över de senaste filerna." + +#: C/gedit.xml:351(para) +msgid "You can open multiple files in gedit. The application adds a tab for each open file to the window. For more on this see ." +msgstr "Du kan öppna flera filer i gedit. Programmet lägger till en flik i fönstret för varje öppnad fil. För mer information om detta, se ." + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "Spara en fil" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "Du kan spara filer på följande sätt:" + +#: C/gedit.xml:360(para) +msgid "To save changes to an existing file, choose FileSave." +msgstr "För att spara ändringar till en befintlig fil, välj ArkivSpara." + +#: C/gedit.xml:362(para) +msgid "To save a new file or to save an existing file under a new filename, choose FileSave As. Enter a name for the file in the Save As dialog, then click Save." +msgstr "För att spara en ny fil eller att spara en befintlig fil under ett nytt filnamn, välj ArkivSpara som. Ange ett namn för filen i dialogrutan Spara som, klicka sedan på Spara." + +#: C/gedit.xml:364(para) +msgid "To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "För att spara alla filerna som för närvarande är öppnade i gedit, välj DokumentSpara alla." + +#: C/gedit.xml:367(para) +msgid "To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "För att stänga alla filerna som för närvarande är öppnade i gedit, välj DokumentStäng alla." + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "Öppna en fil från en uri" + +#: C/gedit.xml:373(para) +msgid "To open a file from a Uniform Resource Identifier (URI), perform the following steps:" +msgstr "Genomför följande steg för att öppna en fil från en Uniform Resource Identifier (URI):" + +#: C/gedit.xml:376(para) +msgid "Choose FileOpen Location to display the Open Location dialog." +msgstr "Välj ArkivÖppna plats för att visa dialogrutan Öppna plats." + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Ange uri:n för filen som du vill öppna." + +#: C/gedit.xml:382(para) +msgid "Use the Character coding drop-down list to select the appropriate character coding." +msgstr "Använd rullgardinsmenyn Teckenkodning för att välja lämplig teckenkodning." + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "Klicka på Öppna." + +#: C/gedit.xml:388(para) +msgid "Valid types of URI include http:, ftp:, file:, and all of the methods supported by mate-vfs." +msgstr "Giltiga typer av uri inkluderar http:, ftp:, file:, och alla de metoder som stöds av mate-vfs." + +#: C/gedit.xml:389(para) +msgid "Files from some types of URI are opened as read-only, and any changes you make must be saved to a different location. HTTP only allows files to be read. Files opened from FTP are read-only because because not all FTP servers may correctly work with saving remote files." +msgstr "Filer från vissa typer av uri:er öppnas skrivskyddade, och alla ändringar du gör måste sparas på en annan plats. HTTP tillåter endast filer att bli lästa. Filer öppnade från en FTP-server är skrivskyddade på grund av att inte alla FTP-servrar fungerar korrekt när man sparar fjärrfiler." + +#: C/gedit.xml:390(para) +msgid "Saving to FTP servers can be enabled with Configuration Editor, setting the key /apps/gedit-2/preferences/editor/save/writable_vfs_schemes, but this may cause errors." +msgstr "Skrivning till FTP-servrar kan aktiveras med Konfigurationsredigerare, ställ in nyckeln /apps/gedit-2/preferences/editor/save/writable_vfs_schemes, men det kan orsaka fel." + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "Arbeta med flikar" + +#: C/gedit.xml:397(para) +msgid "When more than one file is open, gedit shows a tab for each document above the display area. To switch to another document, click on its tab." +msgstr "När fler än en fil är öppnade, visar gedit en flik för varje dokument ovanför visningsrutan. Klicka på fliken för att växla till dokumentet." + +#: C/gedit.xml:398(para) +msgid "To move a document to another gedit window, drag the tab corresponding to the file to the window you want to move it to." +msgstr "För att flytta ett dokument till ett annat gedit-fönster, dra fliken som motsvarar filen till det fönster som du vill flytta det till." + +#: C/gedit.xml:399(para) +msgid "To move a document to a new gedit window, either drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "För att flytta ett dokument till ett nytt gedit-fönster, antingen dra dess flik till skrivbordet eller välj DokumentFlytta till nytt fönster." + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "Arbeta med text" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "Redigera text" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "Du kan redigera texten för en fil på följande sätt:" + +#: C/gedit.xml:412(para) +msgid "Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the arrow keys on the keyboard or click with the mouse." +msgstr "Skriv in ny text med tangentbordet. Den blinkande inmatningsmarkören markerar var den nya texten dyker upp. För att ändra det här, använd piltangenterna på tangentbordet eller klicka med musen." + +#: C/gedit.xml:414(para) +msgid "To copy the selected text to the clipboard, choose EditCopy." +msgstr "För att kopiera den markerade texten till urklipp, välj RedigeraKopiera." + +#: C/gedit.xml:416(para) +msgid "To delete the selected text from the file and move the selected text to the clipboard, choose EditCut." +msgstr "För att ta bort den markerade texten från en fil och flytta den till urklipp, välj RedigeraKlipp ut." + +#: C/gedit.xml:418(para) +msgid "To permanently delete the selected text from the file, choose EditDelete." +msgstr "För att permanent ta bort den markerade texten från filen, välj RedigeraTa bort." + +#: C/gedit.xml:420(para) +msgid "To insert the contents of the clipboard at the cursor position, choose EditPaste. You must cut or copy text before you can paste text into the file, either from gedit or another application." +msgstr "För att infoga innehållet i urklipp vid markörens position, välj RedigeraKlistra in. Du måste klipp ut eller kopiera text innan du kan klistra in i filen, antingen från gedit eller från något annat program." + +#: C/gedit.xml:422(para) +msgid "To select all of the text in a file, choose EditSelect All." +msgstr "För att markera all text i en fil, välj RedigeraMarkera allt." + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "Ångra och gör om ändringar" + +#: C/gedit.xml:429(para) +msgid "To undo a change you have made, choose EditUndo. To reverse this action, choose EditRedo." +msgstr "För att ångra en ändring du har gjort, välj RedigeraÅngra. För att omvända denna åtgärd, välj RedigeraGör om." + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "Hitta och ersätta" + +#: C/gedit.xml:436(para) +msgid "In gedit, there are two ways of searching for text. You can use the Find dialog to search for a specific piece of text, or Incremental Search to highlight matching text as you type it." +msgstr "I gedit finns det två sätt att söka efter text på. Du kan använda dialogrutan Sök för att söka efter en specifik text, eller Interaktiv sökning för att färgmarkera matchande text under tiden du skriver in den." + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "Hitta text" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Genomför följande steg för att söka i en fil efter en textsträng:" + +#: C/gedit.xml:444(para) +msgid "Choose SearchFind to display the Find dialog." +msgstr "Välj SökSök för att visa dialogrutan Sök." + +#: C/gedit.xml:446(para) +msgid "Type the string that you want to find in the Search for field. You can include special characters such as a new line or tab: see ." +msgstr "Skriv in strängen som du vill söka efter i fältet Sök efter. Du kan inkludera specialtecken såsom en ny rad eller tabulatortecken: se ." + +#: C/gedit.xml:448(para) +msgid "Click Find to search the file for the first occurrence of the string after your current cursor position. If gedit finds the string, the application selects first occurrence of the string. Other occurrences of the string are highlighted." +msgstr "Klicka på Sök för att söka igenom filen efter första förekomsten av strängen efter den nuvarande markörpositionen. Om gedit hittar strängen, väljer programmet den första förekomsten av strängen. Andra förekomster av strängen kommer att färgmarkeras." + +#: C/gedit.xml:450(para) +msgid "To find the next occurrence of the string, click Find or choose SearchFind Next. To find the previous occurrence of the text, choose SearchFind Previous." +msgstr "För att söka efter nästa förekomst av strängen, klicka på Sök eller välj SökSök nästa. För att söka efter föregående förekomst av texten, välj SökSök föregående." + +#: C/gedit.xml:453(para) +msgid "After you have closed the Find dialog, you can still move the selection to other occurrences of the text by choosing SearchFind Next and SearchFind Previous." +msgstr "Efter att du har stängt dialogrutan Sök kan du fortfarande flytta markeringen till andra förekomster av texten genom att välja SökSök nästa och SökSök föregående." + +#: C/gedit.xml:454(para) +msgid "To remove the highlighting from the text, choose SearchClear Highlight." +msgstr "För att ta bort färgmarkeringen från texten, välj SökRensa färgmarkeringsläge." + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "Interaktiv sökning" + +#: C/gedit.xml:460(para) +msgid "Incremental search highlights matching text in the document as you type it letter by letter. (This is similar to the search feature in several web browsers.)" +msgstr "Interaktiv sökning färgmarkerar matchande text i dokumentet när du skriver in den, bokstav för bokstav. (Det här liknar sökfunktionen i flera webbläsare.)" + +#: C/gedit.xml:461(para) +msgid "To start an incremental search, choose SearchIncremental Search. The search box appears at the top of the display area." +msgstr "För att påbörja en interaktiv sökning, välj SökInteraktiv sökning. Sökrutan visas i överkanten av visningsrutan." + +#: C/gedit.xml:462(para) +msgid "Begin typing, and text that matches will be highlighted in the document. The first instance after the cursor position is also selected." +msgstr "Börja att skriva in text. Den text som matchas kommer att färgmarkeras i dokumentet. Första förekomsten efter markörpositionen kommer också att markeras." + +#: C/gedit.xml:463(para) +msgid "To advance the selection to the next match while keeping the incremental search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "För att flytta fram markeringen till nästa sökträff samtidigt som den interaktiva sökrutan är öppen, tryck CtrlG. Tryck CtrlSkiftG för att gå tillbaka till föregående sökträff." + +#: C/gedit.xml:464(para) +msgid "You can also use the up and down arrow keys or the mouse wheel to move the selection between matches." +msgstr "Du kan också använda uppåt- och nedåtpiltangenterna eller mushjulet för att flytta markeringen mellan sökträffar." + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "Ersätt text" + +#: C/gedit.xml:471(para) +msgid "To search a file for a string, and replace the string with an alternative string, perform the following steps:" +msgstr "Genomför följande steg för att söka i en fil efter en sträng och ersätta strängen med en alternativ sträng:" + +#: C/gedit.xml:473(para) +msgid "Choose SearchReplace to display the Replace dialog." +msgstr "Välj SökErsätt för att visa dialogrutan Ersätt." + +#: C/gedit.xml:475(para) +msgid "Type the string that you want to find, in the Search for field. You can include special characters such as a new line or tab: see ." +msgstr "Skriv strängen som du vill söka efter i fältet Sök efter. Du kan inkludera specialtecken såsom en ny rad eller tabulatortecken: se ." + +#: C/gedit.xml:476(para) +msgid "Type the string that you want to use to replace the string that you find, in the Replace with field." +msgstr "Skriv in strängen som du vill använda för att ersätta strängen som du söka efter i fältet Ersätt med." + +#: C/gedit.xml:480(para) +msgid "To examine each occurrence of the string before replacing it, click Find. If gedit finds the string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the next occurrence of the string, click Find again." +msgstr "För att granska varje förekomst av strängen innan den ersätts, klicka på Sök. Om gedit hittar strängen, kommer programmet att markera strängen. Klicka på Ersätt för att ersätta den markerade förekomsten av strängen. För att söka efter nästa förekomst av strängen, klicka på Sök igen." + +#: C/gedit.xml:481(para) +msgid "To replace all occurrences of the string throughout the document, click Replace All." +msgstr "För att ersätta alla förekomster av strängen genom hela dokumentet, klicka på Ersätt alla." + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "Alternativ för att söka och ersätta" + +#: C/gedit.xml:487(para) +msgid "The Find dialog and the Replace dialog both have the following options:" +msgstr "Dialogrutorna Sök och Ersätt har båda följande alternativ:" + +#: C/gedit.xml:489(para) +msgid "Select the Match case option to only find occurrences of the string that match the case of the text that you type. For example, with Match case selected, \"TEXT\" will not match \"text\"." +msgstr "Välj alternativet Gör skillnad på gemener/VERSALER för att endast söka efter förekomster av strängen som matchar skiftläget för texten som du anger. Till exempel om Gör skillnad på gemener/VERSALER har valts kommer \"TEXT\" inte att matcha \"text\"." + +#: C/gedit.xml:491(para) +msgid "Select the Match entire word only option to only find occurrences of the string that match the entire words of the text that you type. For example, with Match entire word only selected, \"text\" will not match \"texture\"." +msgstr "Välj alternativet Sök endast hela ord för att endast söka efter förekomster av strängen som matchar hela ord av texten som du anger. Till exempel om Sök endast hela ord har valts kommer \"text\" inte att matcha \"textur\"." + +#: C/gedit.xml:493(para) +msgid "Select the Search backwards option to search backwards towards the beginning of the document." +msgstr "Välj alternativet Sök bakåt för att söka bakåt mot början av dokumentet." + +#: C/gedit.xml:495(para) +msgid "Select the Wrap around option to search to one end of the document and then continue the search from the other end of the file." +msgstr "Välj alternativet Börja om från början för att söka mot slutet av dokumentet och sedan fortsätta från början av filen." + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "Specialtecken" + +#: C/gedit.xml:503(para) +msgid "You can include the following escape sequences in the text to find or replace to represent special characters:" +msgstr "Du kan inkludera följande specialtecken i texten för att hitta eller ersätta för visade specialtecken." + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "Anger en ny rad." + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "Anger ett tabulatortecken." + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "Anger en vagnretur." + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. For example, if you are looking for the \"\\n" +"\" literal, you will have to type \"\\\\n" +"\" in the Search for field. Or if you are looking for a sequence of backslashes, you will have to double the number of searched backslashes." +msgstr "" +"Själv backstegstecknet måste upprepas om det ska sökas efter. Till exempel om du letar efter \"\\n" +"\", så måste du ange \"\\\\n" +"\" i fältet Sök efter. Om du letar efter en sekvens av backsteg så måste du dubbla antalet eftersökta backstegstecken." + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Positionera markören på en specifik rad" + +#: C/gedit.xml:540(para) +msgid "To position the cursor on a specific line in the current file, choose SearchGo to Line. The line number box appears at the top of the display area." +msgstr "För att positionera markören på en specifik rad i den aktuella filen kan du välja SökGå till rad. Radnumret visas i en ruta i överkant av visningsrutan." + +#: C/gedit.xml:541(para) +msgid "Begin typing the number of the line that you want to move the cursor to and the document will scroll to the specified line." +msgstr "Börja att skriva in numret på raden som du vill flytta markören till och dokumentet kommer att rulla fram till den angivna raden." + +#: C/gedit.xml:542(para) +msgid "To dismiss the box and move the cursor to the specified line, press Return." +msgstr "Tryck på Return för att stänga rutan och flytta markören till den angivna raden." + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "Utskrifter" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "Ställ in sidalternativen" + +#: C/gedit.xml:554(para) +msgid "To set the page options, choose FilePage Setup to display the Page Setup dialog." +msgstr "För att ställa in sidalternativ, välj ArkivSidkonfiguration för att visa dialogrutan Sidkonfiguration." + +#: C/gedit.xml:556(para) +msgid "The Page Setup dialog enables you to specify the following print options:" +msgstr "Dialogrutan Sidkonfiguration låter dig ange följande utskriftsalternativ:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "Fliksektionen Allmänt" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "Skriv ut syntaxmarkering" + +#: C/gedit.xml:563(para) +msgid "Select this option to print syntax highlighting. For more information about syntax highlighting, see ." +msgstr "Välj det här alternativet för att skriva ut syntaxmarkering. För mer information om syntaxmarkering, se ." + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "Skriv ut sidhuvud" + +#: C/gedit.xml:568(para) +msgid "Select this option to include a header on each page that you print. You cannot configure the header." +msgstr "Välj det här alternativet för att inkludera ett sidhuvud på varje sida som du skriver ut. Du kan inte konfigurera sidhuvudet." + +#: C/gedit.xml:571(guilabel) +#: C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "Radnummer" + +#: C/gedit.xml:574(para) +msgid "Select the Print line numbers option to include line numbers when you print a file." +msgstr "Välj alternativet Skriv ut radnummer för att inkludera radnummer när du skriver ut en fil." + +#: C/gedit.xml:575(para) +msgid "Use the Number every ... lines spin box to specify how often to print the line numbers, for example every 5 lines, every 10 lines, and so on." +msgstr "Använd snurrväljaren Tal var ... rad för att ange hur ofta radnumren ska skrivas ut, till exempel var 5:e rad, var 10:e rad, och så vidare." + +#: C/gedit.xml:578(guilabel) +#: C/gedit.xml:1168(guilabel) +#: C/gedit.xml:1685(para) +msgid "Text Wrapping" +msgstr "Textradbrytning" + +#: C/gedit.xml:580(para) +msgid "Select the Enable text wrapping option to wrap text onto the next line, at a character level, when you print a file. The application counts wrapped lines as one line for line numbering purposes." +msgstr "Välj alternativet Aktivera textradbrytning för att radbryta text till nästa rad, på teckennivå, när du skriver ut en fil. Programmet räknar radbrytna rader som en rad för radnumreringens skull." + +#: C/gedit.xml:582(para) +msgid "Select the Do not split words over two lines option to wrap text onto the next line, at a word level, when you print a file." +msgstr "Välj alternativet Dela inte ord över två rader för att radbryta text till nästa rad, på ordnivå, när du skriver ut en fil." + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "Typsnitt" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "Text" + +#: C/gedit.xml:594(para) +msgid "Click on this button to select the font to use to print the body text of a file." +msgstr "Klicka på den här knappen för att välja typsnittet att använda för att skriva ut huvudtexten för en fil." + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "Radnummer" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "Klicka på den här knappen för att välja typsnittet att använda för att skriva ut radnummer." + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "Sidhuvuden och sidfötter" + +#: C/gedit.xml:605(para) +msgid "Click on this button to select the font to use to print the headers and footers in a file." +msgstr "Klicka på den här knappen för att välja typsnittet att använda för att skriva ut sidhuvuden och sidfötter i en fil." + +#: C/gedit.xml:609(para) +msgid "To reset the fonts to the default fonts for printing a file from gedit, click Restore Default Fonts." +msgstr "För att återställa typsnitten till standardvärden för utskrift av en fil från gedit, klicka på Återställ standardtypsnitt." + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "Skriv ut ett dokument" + +#: C/gedit.xml:617(para) +msgid "You can use gedit to perform the following print operations:" +msgstr "Du kan använda gedit för att genomföra följande utskriftsåtgärder:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "Skriva ut ett dokument till en skrivare." + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "Skriva ut utdata för utskriftskommandot till en fil." + +#: C/gedit.xml:624(para) +msgid "If you print to a file, gedit sends the output of the file to a pre-press format file. The most common pre-press formats are PostScript and Portable Document Format (PDF)." +msgstr "Om du skriver ut till en fil, skickar gedit utdata för filen till en förtryckningsformaterad fil. De mest vanliga förtryckningsformaten är PostScript och Portable Document Format (PDF)." + +#: C/gedit.xml:626(para) +msgid "To preview the pages that you want to print, choose FilePrint Preview." +msgstr "För att förhandsvisa sidorna som du vill skriva ut, välj ArkivFörhandsgranska utskrift." + +#: C/gedit.xml:628(para) +msgid "To print the current file to a printer or a file, choose FilePrint to display the Print dialog." +msgstr "För att skriva ut den aktuella filen till en skrivare eller till en fil, välj ArkivSkriv ut för att visa dialogrutan Skriv ut." + +#: C/gedit.xml:630(para) +msgid "The Print dialog enables you to specify the following print options:" +msgstr "Dialogrutan Skriv ut låter dig ange följande utskriftsalternativ:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "Fliksektionen Jobb" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "Sidintervall" + +#: C/gedit.xml:637(para) +msgid "Select one of the following options to determine how many pages to print:" +msgstr "Välj en av följande åtgärder för att bestämma hur många sidor som ska skrivas ut:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "Alla" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Välj detta alternativ för att skriva ut alla sidorna i filen." + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "Rader" + +#: C/gedit.xml:645(para) +msgid "Select this option to print the specified lines only. Use the From and To spin boxes to specify the line range." +msgstr "Välj detta alternativ för att endast skriva ut de angivna raderna. Använd väljaren för Från och Till för att ange radintervallet." + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "Markering" + +#: C/gedit.xml:649(para) +msgid "Select this option to print the selected text only. This option is only available if you select text." +msgstr "Välj det här alternativet för att endast skriv ut den markerade texten. Detta alternativ finns endast tillgängligt om du har markerat text." + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "Kopior" + +#: C/gedit.xml:657(para) +msgid "Use the Number of copies spin box to specify the number of copies of the file that you want to print." +msgstr "Använd väljaren Antal kopior för att ange antalet kopior av filen som du vill skriva ut." + +#: C/gedit.xml:658(para) +msgid "If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "Om du skriver ut flera kopior av filen, välj alternativet Sortera för att sortera de utskrivna kopiorna." + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "Fliksektionen Skrivare" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "Skrivare" + +#: C/gedit.xml:669(para) +msgid "Use this drop-down list to select the printer to which you want to print the file." +msgstr "Använd den här rullgardinslistan för att välja skrivaren till vilken du vill skriva ut filen." + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "Inställningar" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "Använd den här rullgardinslistan för att välja utskriftsinställningarna." + +#: C/gedit.xml:676(para) +msgid "To configure the printer, click Configure. For example, you can enable or disable duplex printing, or schedule delayed printing, if this functionality is supported by the printer." +msgstr "För att konfigurera skrivaren, klicka på Konfigurera. Till exempel kan du aktivera eller inaktivera dubbelsidig utskrift, eller schemalägga utskriften, om den här funktionaliteten stöds av skrivaren." + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "Plats" + +#: C/gedit.xml:682(para) +msgid "Use this drop-down list to select one of the following print destinations:" +msgstr "Använd den här rullgardinslistan för att välja ett av följande utskriftsmål:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "Skriv ut filen till en CUPS-skrivare." + +#: C/gedit.xml:693(para) +msgid "If the selected printer is a CUPS printer, CUPS is the only entry in this drop-down list." +msgstr "Om den valda skrivaren är en CUPS-skrivare, kommer CUPS att vara den enda posten i den här rullgardinslistan." + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "Skriv ut filen till en skrivare." + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "Fil" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "Skriv ut filen till en PostScript-fil." + +#: C/gedit.xml:713(para) +msgid "Click Save As to display a dialog where you specify the name and location of the PostScript file." +msgstr "Klicka på Spara som för att visa en dialogruta där du anger namnet och platsen för PostScript-filen." + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "Anpassad" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "Använd det angivna kommandot för att skriva ut filen." + +#: C/gedit.xml:724(para) +msgid "Type the name of the command in the text box. Include all command-line arguments." +msgstr "Skriv in namnet på kommandot i textrutan. Inkludera alla kommandoradsargument." + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "Tillstånd" + +#: C/gedit.xml:734(para) +#: C/gedit.xml:740(para) +#: C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Den här funktionaliteten stöds inte av den här versionen av gedit." + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "Typ" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "Kommentar" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "Fliksektionen Papper" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "Pappersstorlek" + +#: C/gedit.xml:758(para) +msgid "Use this drop-down list to select the size of the paper to which you want to print the file." +msgstr "Använd den här rullgardinslistan för att välja storleken på pappret till vilket du vill skriva ut filen." + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "Bredd" + +#: C/gedit.xml:763(para) +msgid "Use this spin box to specify the width of the paper. Use the adjacent drop-down list to change the measurement unit." +msgstr "Använd den här snurrväljaren för att ange bredden på pappret. Använd den närliggande rullgardinslistan för att ändra mätenhet." + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "Höjd" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "Använd den här snurrväljaren för att ange höjden på pappret." + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "Matningsorientering" + +#: C/gedit.xml:773(para) +msgid "Use this drop-down list to select the orientation of the paper in the printer." +msgstr "Använd den här rullgardinslistan för att välja orienteringen på pappret i skrivaren." + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "Sidorientering" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "Använd den här rullgardinslistan för att välja sidorienteringen." + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "Layout" + +#: C/gedit.xml:783(para) +msgid "Use this drop-down list to select the page layout. A preview of each layout that you select is displayed in the Preview area." +msgstr "Använd den här rullgardinslistan för att välja sidlayouten. En förhandsvisning för varje layout som du kan välja visas i rutan Förhandsgranska." + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "Pappersfack" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "Använd den här rullgardinslistan för att välja pappersfack." + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "Programmeringsfunktioner" + +#: C/gedit.xml:801(para) +msgid "Several of gedit's features for programming are provided with plugins. For example, the Tag List plugin provides a list of commonly-used tags for different markup languages: see ." +msgstr "Flera programmeringsfunktioner i gedit tillhandahålls med hjälp av insticksmoduler. Till exempel tillhandahåller insticksmodulen Tagglista en lista över vanligen använda taggar för olika markup-språk: se ." + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "Syntaxmarkering" + +#: C/gedit.xml:806(para) +msgid "Syntax highlighting makes source code easier to read by showing different parts of the text in different colors." +msgstr "Syntaxmarkering gör det lättare att läsa källkod genom att visa olika delar av texten i olika färger." + +#: C/gedit.xml:808(para) +msgid "gedit chooses an appropriate syntax highlighting mode based on a document's type. To override the syntax highlighting mode, choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "gedit väljer ett lämpligt syntaxmarkeringsläge baserat på dokumenttypen. För att åsidosätta syntaxmarkeringsläget, välj VisaFärgmarkeringsläge och välj sedan ett av följande menyobjekt:" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "Normal" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "Visa inte någon syntaxmarkering." + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "Källkoder" + +#: C/gedit.xml:819(para) +msgid "Display syntax highlighting to edit source code. Use the Sources submenu to select the source code type." +msgstr "Visa syntaxmarkering för att redigera källkod. Använd undermenyn Källkoder för att välja källkodstypen." + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "Märkning" + +#: C/gedit.xml:825(para) +msgid "Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "Visa syntaxmarkering för att redigera märkningskod. Använd undermenyn Märkning för att välja märkningskodtypen." + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "Skript" + +#: C/gedit.xml:831(para) +msgid "Display syntax highlighting to edit script code. Use the Scripts submenu to select the script code type." +msgstr "Visa syntaxmarkering för att redigera skriptkod. Använd undermenyn Skript för att välja skriptkodtypen." + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "Andra" + +#: C/gedit.xml:837(para) +msgid "Display syntax highlighting to edit other types of code. Use the Others submenu to select the code type." +msgstr "Visa syntaxmarkering för att redigera andra typer av kod. Använd undermenyn Andra för att välja kodtypen." + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "Omdirigera utdata för ett kommando till en fil" + +#: C/gedit.xml:846(para) +msgid "You can use gedit to pipe the output of a command to a text file. For example, to pipe the output of an ls command to a text file, type ls | gedit, then press Return." +msgstr "Du kan använda gedit för att omdirigera utdata från ett kommando till en textfil. För att till exempel omdirigera utdata för kommandot ls till en textfil, skriv ls | gedit och tryck på Return." + +#: C/gedit.xml:847(para) +msgid "The output of the ls command is displayed in a new text file in the gedit window." +msgstr "Utdata från kommandot ls visas i en ny textfil i gedit-fönstret." + +#: C/gedit.xml:848(para) +msgid "Alternatively, you can use the External tools plugin to pipe command output to the current file." +msgstr "Alternativt kan du använda insticksmodulen Externa verktyg för att omdirigera kommandoutdata till den aktuella filen." + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "Snabbtangenter" + +#: C/gedit.xml:855(para) +msgid "Use shortcut keys to perform common tasks more quickly than with the mouse and menus. The following tables list all of gedit's shortcut keys." +msgstr "Använd snabbtangenter för att genomföra vanliga uppgifter på ett snabbare sätt än med musen och menyerna. Följande tabell listar alla snabbtangenter i gedit." + +#: C/gedit.xml:856(para) +msgid "For more on shortcut keys, see the Desktop User Guide." +msgstr "För mer information om snabbtangenter, se Användarguide för skrivbordet." + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) +#: C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "Tabulatorer" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "Snabbtangenter för flikar:" + +#: C/gedit.xml:868(para) +#: C/gedit.xml:912(para) +#: C/gedit.xml:968(para) +#: C/gedit.xml:1016(para) +#: C/gedit.xml:1044(para) +#: C/gedit.xml:1091(para) +#: C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "Snabbtangent" + +#: C/gedit.xml:870(para) +#: C/gedit.xml:914(para) +#: C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) +#: C/gedit.xml:1046(para) +#: C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Command" +msgstr "Kommando" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "Växlar till nästa flik åt vänster." + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "Växlar till nästa flik åt höger." + +#: C/gedit.xml:883(para) +#: C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "Stäng flik." + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Skift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "Spara alla flikar." + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Skift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "Stäng alla flikar." + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "Hoppa till flik nummer n." + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "Filer" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "Snabbtangenter för arbete med filer:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "Skapa ett nytt dokument." + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "Öppna ett dokument." + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "Öppna en plats." + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "Spara det aktuella dokumentet till disk." + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Skift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "Spara aktuellt dokument med ett nytt filnamn." + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "Skriv ut det aktuella dokumentet." + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Skift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "Förhandsvisa utskrift." + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "Stäng aktuellt dokument." + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "Avsluta Gedit." + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) +#: C/gedit.xml:1406(guimenu) +#: C/gedit.xml:1412(guimenu) +#: C/gedit.xml:1418(guimenu) +#: C/gedit.xml:1424(guimenu) +msgid "Edit" +msgstr "Redigera" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "Snabbtangenter för redigering av dokument:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "Ångra föregående åtgärd." + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Skift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "Gör om senaste ångrade åtgärden." + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Klipp ut markerad text eller område och placera den i urklipp." + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Kopiera markerad text eller område till urklipp." + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "Klistra in innehållet i urklipp." + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "Markera allt." + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "Ta bort aktuell rad." + +#. ============= Panes ======================= +#: C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "Paneler" + +#: C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Snabbtangenter för att visa och dölja paneler:" + +#: C/gedit.xml:1023(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "Visa/dölj sidopanelen." + +#: C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "Visa/dölj nederkantspanelen." + +#. ============= Search ======================= +#: C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "Sök" + +#: C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "Snabbtangenter för sökning:" + +#: C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "Sök efter en sträng." + +#: C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "Sök nästa förekomst av strängen." + +#: C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Skift + G" + +#: C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "Sök föregående förekomst av strängen." + +#: C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "Interaktiv sökning." + +#: C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "Sök och ersätt." + +#: C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Skift + K" + +#: C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "Ta bort markering." + +#: C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "Gå till rad." + +#. ============= Tools ======================= +#: C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "Verktyg" + +#: C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "Snabbtangenter för verktyg:" + +#: C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "Skift + F7" + +#: C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "Kontrollera stavning (med insticksmodul)." + +#: C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Ta bort eftersläpande blanksteg (med insticksmodul)." + +#: C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "Dra in rader (med insticksmodul)." + +#: C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Skift + T" + +#: C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "Ta bort indragning (med insticksmodul)." + +#: C/gedit.xml:1114(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Kör \"make\" i aktuell katalog (med insticksmodul)." + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Skift + D" + +#: C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "Kataloglistning (med insticksmodul)." + +#. ============= Help ======================= +#: C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "Hjälp" + +#: C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "Snabbtangent för hjälp:" + +#: C/gedit.xml:1141(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "Öppna handboken för gedit." + +#: C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "Inställningar" + +#: C/gedit.xml:1156(para) +msgid "To configure gedit, choose EditPreferences. The Preferences dialog contains the following categories:" +msgstr "För att konfigurera gedit, välj RedigeraInställningar. Dialogrutan Inställningar innehåller följande kategorier:" + +#: C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "Visa inställningar" + +#: C/gedit.xml:1170(para) +msgid "Select the Enable text wrapping option to have long lines of text flow into paragraphs instead of running off the edge of the text window. This avoids having to scroll horizontally" +msgstr "Välj alternativet Aktivera textradbrytning för att långa rader av text flyter i avsnitt istället för att fortsätta utanför kanten i textfönstret. Det här gör att man slipper rulla texten horisontellt." + +#: C/gedit.xml:1171(para) +msgid "Select the Do not split words over two lines option to have the text wrapping option preserve whole words when flowing text to the next line. This makes text easier to read." +msgstr "Välj alternativet Dela inte ord över två rader för att textradbrytningsalternativet ska behålla hela ord när text radbryts till nästa rad. Det här gör att texten blir enklare att läsa." + +#: C/gedit.xml:1177(para) +msgid "Select the Display line numbers option to display line numbers on the left side of the gedit window." +msgstr "Välj alternativet Visa radnummer för att visa radnummer på vänster sida i gedit-fönstret." + +#: C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "Aktuell rad" + +#: C/gedit.xml:1183(para) +msgid "Select the Highlight current line option to highlight the line where the cursor is placed." +msgstr "Välj alternativet Färgmarkera aktuell rad för att färgmarkera raden där markören är placerad." + +#: C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "Högermarginal" + +#: C/gedit.xml:1189(para) +msgid "Select the Display right margin option to display a vertical line that indicates the right margin." +msgstr "Välj alternativet Visa högermarginal för att visa en vertikal linje som indikerar den högra marginalen." + +#: C/gedit.xml:1190(para) +msgid "Use the Right margin at column spin box to specify the location of the vertical line." +msgstr "Använd snurrväljaren Högermarginal vid kolumn för att ange platsen för den vertikala linjen." + +#: C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "Klammermatchning" + +#: C/gedit.xml:1196(para) +msgid "Select the Highlight matching bracket option to highlight the corresponding bracket when the cursor is positioned on a bracket character." +msgstr "Välj alternativet Färgmarkera matchande klammer för att färgmarkera motsvarande klammer när markören är positionerad på ett klammertecken." + +#: C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "Redigerarinställningar" + +#: C/gedit.xml:1209(para) +msgid "Use the Tab width spin box to specify the width of the space that gedit inserts when you press the Tab key." +msgstr "Använd snurrväljaren Tabulatorbredd för att ange bredden på utrymmet som gedit infogar när du trycker på tabulatortangenten." + +#: C/gedit.xml:1210(para) +msgid "Select the Insert spaces instead of tabs option to specify that gedit inserts spaces instead of a tab character when you press the Tab key." +msgstr "Välj alternativet Infoga blanksteg istället för tabulatortecken för att ange att gedit infogar blanksteg istället för ett tabulatortecken när du trycker på tabulatortangenten." + +#: C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "Automatiskt indrag" + +#: C/gedit.xml:1216(para) +msgid "Select the Enable auto indentation option to specify that the next line starts at the indentation level of the current line." +msgstr "Välj alternativet Aktivera automatiskt indrag för att ange att nästa rad börjar vid indragsnivån för den aktuella raden." + +#: C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "Filsparande" + +#: C/gedit.xml:1222(para) +msgid "Select the Create a backup copy of files before saving option to create a backup copy of a file each time you save the file. The backup copy of the file contains a ~ at the end of the filename." +msgstr "Välj alternativet Skapa en säkerhetskopia av filen innan den sparas för att skapa en säkerhetskopia av filen varje gång du sparar filen. Säkerhetskopian för filen innehåller ett ~ i slutet av filnamnet." + +#: C/gedit.xml:1223(para) +msgid "Select the Autosave files every ... minutes option to automatically save the current file at regular intervals. Use the spin box to specify how often you want to save the file." +msgstr "Välj alternativet Spara filer automatiskt var ... minut för att automatiskt spara den aktuella filen med jämna intervall. Använd snurrväljaren för att ange hur ofta du vill spara filen." + +#: C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "Typsnitt och färger" + +#: C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "Typsnitt" + +#: C/gedit.xml:1235(para) +msgid "Select the Use default theme font option to use the default system font for the text in the gedit text window." +msgstr "Välj alternativet Använd standardtematypsnitt för att använda standardsystemtypsnittet för texten i gedit-textfönstret." + +#: C/gedit.xml:1236(para) +msgid "The Editor font field displays the font that gedit uses to display text. Click on the button to specify the font type, style, and size to use for text." +msgstr "Fältet Redigerartypsnitt visar typsnittet som gedit använder för att visa text. Klicka på knappenför att ange typsnittstypen, stil och storlek för att använda för text." + +#: C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "Färgschema" + +#: C/gedit.xml:1242(para) +msgid "You can choose a color scheme from the list of color schemes. By default, the following color schemes are installed:" +msgstr "Du kan välja ett färgschema från listan över färgscheman. Som standard finns följande färgscheman installerade:" + +#: C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "Klassisk" + +#: C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "Klassiskt färgschema baserat på gvim-färgschemat." + +#: C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "Cobalt" + +#: C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "Blått färgschema." + +#: C/gedit.xml:1257(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "Färgschema som används i textredigeraren Kate." + +#: C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "Mörkt färgschema som använder Tango-färgpaletten." + +#: C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "Färgschema som använder Tango-färgschemat." + +#: C/gedit.xml:1275(para) +msgid "You can add a new color scheme by clicking on Add..., and selecting a color scheme file" +msgstr "Du kan lägga till ett nytt färgschema genom att klicka på Lägg till... och välja en färgschemafil" + +#: C/gedit.xml:1276(para) +msgid "You can remove the selected color scheme by clicking on Remove" +msgstr "Du kan ta bort det markerade färgschemat genom att klicka på Ta bort" + +#: C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "Inställningar för insticksmoduler" + +#: C/gedit.xml:1284(para) +msgid "Plugins add extra features to gedit. For more information on plugins and how to use the built-in plugins, see ." +msgstr "Insticksmoduler lägger till extrafunktioner till gedit. För mer information om insticksmoduler och hur man använder de inbyggda insticksmodulerna, se ." + +#: C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "Aktivera en insticksmodul" + +#: C/gedit.xml:1289(para) +msgid "To enable a gedit plugin, perform the following steps:" +msgstr "Genomför följande steg för att aktivera en insticksmodul i gedit:" + +#: C/gedit.xml:1292(para) +#: C/gedit.xml:1313(para) +#: C/gedit.xml:1635(para) +msgid "Choose EditPreferences." +msgstr "Välj RedigeraInställningar." + +#: C/gedit.xml:1295(para) +#: C/gedit.xml:1316(para) +#: C/gedit.xml:1638(para) +msgid "Select the Plugins tab." +msgstr "Välj fliken Insticksmoduler." + +#: C/gedit.xml:1298(para) +msgid "Select the check box next to the name of the plugin that you want to enable." +msgstr "Välj kryssrutan bredvid namnet på insticksmodulen som du vill aktivera." + +#: C/gedit.xml:1301(para) +#: C/gedit.xml:1322(para) +msgid "Click Close to close the Preferences dialog." +msgstr "Klicka på Stäng för att stänga dialogrutan Inställningar." + +#: C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "Inaktivera en insticksmodul" + +#: C/gedit.xml:1309(para) +msgid "A plugin remains enabled when you quit gedit." +msgstr "En insticksmodul är fortfarande aktiverad när du avslutar gedit." + +#: C/gedit.xml:1310(para) +msgid "To disable a gedit plugin, perform the following steps:" +msgstr "Genomför följande steg för att inaktivera en insticksmodul i gedit:" + +#: C/gedit.xml:1319(para) +msgid "Deselect the check box next to the name of the plugin that you want to disable." +msgstr "Avmarkera kryssrutan bredvid namnet på insticksmodulen som du vill inaktivera." + +#: C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "Insticksmoduler" + +#: C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "Arbeta med insticksmoduler" + +#: C/gedit.xml:1334(para) +msgid "You can add extra features to gedit by enabling plugins. A plugin is a supplementary program that enhances the functionality of an application. Plugins add new items to the gedit menus for the new features they provide." +msgstr "Du kan lägga till extrafunktioner till gedit genom att aktivera insticksmoduler. En insticksmodul är ett tilläggsprogram som utökar funktionaliteten för ett program. Insticksmoduler lägger till nya objekt i gedit-menyerna för de nya funktioner som de tillhandahåller." + +#: C/gedit.xml:1336(para) +msgid "Several plugins come built-in with gedit, and you can install more. The gedit website lists third-party plugins." +msgstr "Flera insticksmoduler är redan inbyggda i gedit och du kan installera fler. Webbsidan för insticksmoduler för gedit listar insticksmoduler från tredjepartsleverantörer." + +#: C/gedit.xml:1337(para) +msgid "To enable and disable plugins, or see which plugins are currently enabled, use the Plugins Preferences." +msgstr "För att aktivera eller inaktivera insticksmoduler, eller se vilka insticksmoduler som för närvarande är aktiverade, använd Inställningar för insticksmoduler." + +#: C/gedit.xml:1338(para) +msgid "The following plugins come built-in with gedit:" +msgstr "Följande insticksmoduler är inbyggda som standard i gedit:" + +#: C/gedit.xml:1344(para) +msgid "Change Case allows you to change the case of the selected text." +msgstr "Ändra skiftläge låter dig ändra skiftläget på den markerade texten." + +#: C/gedit.xml:1347(para) +msgid "Document Statistics shows the number of lines, words, and characters in the document." +msgstr "Dokumentstatistik visar antal rader, ord och tecken i dokumentet." + +#: C/gedit.xml:1350(para) +msgid "External Tools allows you to execute external commands from gedit." +msgstr "Externa verktyg låter dig köra externa kommandon från gedit." + +#: C/gedit.xml:1353(para) +msgid "File Browser allows you to browse your files and folders in the side pane." +msgstr "Filbläddrarpanel låter dig bläddra i din filer och mappar via sidopanelen." + +#: C/gedit.xml:1356(para) +msgid "Indent Lines adds or removes indentation from the selected lines." +msgstr "Dra in rader lägger till eller tar bort indragningen för markerade rader." + +#: C/gedit.xml:1359(para) +msgid "Insert Date/Time adds the current date and time into a document." +msgstr "Infoga datum/tid lägger till det aktuella datumet och tiden in i ett dokument." + +#: C/gedit.xml:1362(para) +msgid "Modelines allows you to set editing preferences for individual documents, and supports Emacs, Kate and Vim-style modelines." +msgstr "Lägesrader låter dig ställa in redigeringsinställningar för individuella dokument, och har stöd för lägesradstyperna Emacs, Kate och Vim." + +#: C/gedit.xml:1365(para) +msgid "Python Console allows you to run commands in the python programming language." +msgstr "Python-konsoll låter dig köra kommandon i programspråket Python." + +#: C/gedit.xml:1368(para) +msgid "Snippets allows you to store frequently-used pieces of text and insert them quickly into a document." +msgstr "Textsnuttar låter dig lagra ofta använda textstycken och infoga dem snabbt i ett dokument." + +#: C/gedit.xml:1371(para) +msgid "Sort arranges selected lines of text into alphabetical order." +msgstr "Sortera arrangerar om markerade textrader i alfabetisk ordning." + +#: C/gedit.xml:1374(para) +msgid "Spell Checker corrects the spelling in the selected text, or marks errors automatically in the document." +msgstr "Stavningskontroll rättar stavningen i den markerade texten, eller markerar automatiskt fel i dokumentet." + +#: C/gedit.xml:1377(para) +msgid "Tag List lets you insert commonly-used tags for HTML and other languages from a list in the side pane." +msgstr "Tagglista låter dig infoga vanligen använda HTML-taggar och taggar för andra språk från en lista i sidopanelen." + +#: C/gedit.xml:1381(para) +#| msgid "" +#| "This plugin is mostly provided as an example of how to create your own " +#| "plugins. For more information on creating plugins, see the gedit website." +msgid "For more information on creating plugins, see the gedit website." +msgstr "För mer information om hur man skapar insticksmoduler, se webbsidan för gedit." + +#: C/gedit.xml:1385(title) +msgid "Change Case Plugin" +msgstr "Insticksmodulen Ändra skiftläge" + +#: C/gedit.xml:1386(para) +msgid "The Change Case plugin changes the case of the selected text." +msgstr "Insticksmodulen Ändra skiftläge ändrar skiftläget på den markerade texten." + +#: C/gedit.xml:1387(para) +msgid "The following items are added to the Edit menu when the Change Case plugin is enabled:" +msgstr "Följande objekt läggs till i menyn Redigera när insticksmodulen Ändra skiftläge aktiveras:" + +#: C/gedit.xml:1397(para) +msgid "Menu Item" +msgstr "Menyobjekt" + +#: C/gedit.xml:1399(para) +msgid "Action" +msgstr "Åtgärd" + +#: C/gedit.xml:1401(para) +msgid "Example" +msgstr "Exempel" + +#: C/gedit.xml:1407(guisubmenu) +#: C/gedit.xml:1413(guisubmenu) +#: C/gedit.xml:1419(guisubmenu) +#: C/gedit.xml:1425(guisubmenu) +msgid "Change Case" +msgstr "Ändra skiftläge" + +#: C/gedit.xml:1407(guimenuitem) +msgid "All Upper Case" +msgstr "Gör allt till versaler" + +#: C/gedit.xml:1408(para) +msgid "Change each character to uppercase." +msgstr "Ändra varje tecken till versaler." + +#: C/gedit.xml:1409(para) +msgid "This text becomes THIS TEXT" +msgstr "Denna text blir DENNA TEXT" + +#: C/gedit.xml:1413(guimenuitem) +msgid "All Lower Case" +msgstr "Gör allt till gemener" + +#: C/gedit.xml:1414(para) +msgid "Change each character to lowercase." +msgstr "Ändra varje tecken till gemener." + +#: C/gedit.xml:1415(para) +msgid "This Text becomes this text" +msgstr "Denna Text blir denna text" + +#: C/gedit.xml:1419(guimenuitem) +msgid "Invert Case" +msgstr "Invertera skiftläge" + +#: C/gedit.xml:1420(para) +msgid "Change each lowercase character to uppercase, and change each uppercase character to lowercase." +msgstr "Ändra varje gement tecken till versalt och ändra varje versalt tecken till gement." + +#: C/gedit.xml:1421(para) +msgid "This Text becomes tHIS tEXT" +msgstr "Denna Text blir dENNA tEXT" + +#: C/gedit.xml:1425(guimenuitem) +msgid "Title Case" +msgstr "Engelsk rubriksversalisering" + +#: C/gedit.xml:1426(para) +msgid "Change the first character of each word to uppercase." +msgstr "Ändra första tecknet för varje ord till en gemen." + +#: C/gedit.xml:1427(para) +msgid "this text becomes This Text" +msgstr "denna text blir Denna Text" + +#: C/gedit.xml:1436(title) +msgid "Document Statistics Plugin" +msgstr "Insticksmodulen Dokumentstatistik" + +#: C/gedit.xml:1437(para) +msgid "The Document Statistics plugin counts the number of lines, words, characters with spaces, characters without spaces, and bytes in the current file. The plugin displays the results in a Document Statistics dialog. To use the Document Statistics plugin, perform the following steps:" +msgstr "Insticksmodulen Dokumentstatistik räknar antalet rader, ord, tecken med blanksteg, tecken utan blanksteg och antal byte i den aktuella filen. Insticksmodulen visar resultatet i en Dokumentstatistik-dialog. Genomför följande steg för att använda insticksmodulen Dokumentstatistik:" + +#: C/gedit.xml:1439(para) +msgid "Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog displays the following information about the file:" +msgstr "Välj VerktygDokumentstatistik för att visa dialogrutan Dokumentstatistik. Dialogrutan Dokumentstatistik visar följande information om filen:" + +#: C/gedit.xml:1442(para) +msgid "Number of lines in the current document." +msgstr "Antal rader i det aktuella dokumentet." + +#: C/gedit.xml:1445(para) +msgid "Number of words in the current document." +msgstr "Antal ord i det aktuella dokumentet." + +#: C/gedit.xml:1448(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Antal tecken, inklusive blanksteg, i det aktuella dokumentet." + +#: C/gedit.xml:1451(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Antal tecken, blanksteg undantaget, i det aktuella dokumentet." + +#: C/gedit.xml:1454(para) +msgid "Number of bytes in the current document." +msgstr "Antal byte i det aktuella dokumentet." + +#: C/gedit.xml:1459(para) +msgid "You can continue to update the gedit file while the Document Statistics dialog is open. To refresh the contents of the Document Statistics dialog, click Update." +msgstr "Du kan fortsätta att uppdatera filen i gedit under tiden dialogrutan Dokumentstatistik är öppen. För att uppdatera innehållet i dialogrutan Dokumentstatistik, klicka på Uppdatera." + +#: C/gedit.xml:1466(title) +msgid "External Tools Plugin" +msgstr "Insticksmodulen Externa verktyg" + +#: C/gedit.xml:1467(para) +msgid "The External Tools plugin allows you to execute external commands from gedit. You can pipe some content into a command and exploit its output (for example, sed), or launch a predefined command (for example, make)." +msgstr "Insticksmodulen Externa verktyg låter dig köra externa kommandon från gedit. Du kan omdirigera visst innehåll in i ett kommando och utforska dess utdata (till exempel, sed), eller starta ett fördefinierat kommando (till exempel, make)." + +#: C/gedit.xml:1468(para) +msgid "Use the External Tools Manager to create and edit commands. To run an external command, choose it from the Tools menu." +msgstr "Använd Hanterar för externa verktyg för att skapa och redigera kommandon. För att köra ett externt kommando, välj det från menyn Verktyg." + +#: C/gedit.xml:1471(title) +msgid "Built-in Commands" +msgstr "Inbyggda kommandon" + +#: C/gedit.xml:1472(para) +msgid "The following commands are provided with the External Tools plugin:" +msgstr "Följande kommandon tillhandahålls av insticksmodulen Externa verktyg:" + +#: C/gedit.xml:1474(term) +msgid "Build" +msgstr "Bygg" + +#: C/gedit.xml:1476(para) +msgid "Runs make in the current document's directory." +msgstr "Kör make i katalogen för det aktuella dokumentet." + +#: C/gedit.xml:1479(term) +msgid "Directory Listing" +msgstr "Kataloglistning" + +#: C/gedit.xml:1481(para) +msgid "Lists the contents of the current document's directory in a new document." +msgstr "Listar innehållet i det aktuella dokumentets katalog i ett nytt dokument." + +#: C/gedit.xml:1484(term) +msgid "Environment Variables" +msgstr "Miljövariabler" + +#: C/gedit.xml:1486(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Visar listan över miljövariabler i underpanelen." + +#: C/gedit.xml:1489(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1491(para) +msgid "Searches for a term in all files in the current document directory, using pattern matching. Results are shown in the bottom pane." +msgstr "Söker efter en term i alla filer i det aktuella dokumentets katalog med hjälp av mönstermatchning. Resultatet visas i underpanelen." + +#: C/gedit.xml:1494(term) +msgid "Remove Trailing Spaces" +msgstr "Ta bort eftersläpande blanksteg" + +#: C/gedit.xml:1496(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Tar bort alla blanksteg från slutet av rader i dokumentet." + +#: C/gedit.xml:1503(title) +msgid "Defining a Command" +msgstr "Definiera ett kommando" + +#: C/gedit.xml:1504(para) +msgid "To add an external command, choose ToolsExternal Tools." +msgstr "För att lägga till ett externt kommando, välj VerktygExterna verktyg." + +#: C/gedit.xml:1505(para) +msgid "In the External Tools Manager window, click New. You can speficy the following details for the new command:" +msgstr "I Hanterare för externa verktyg-fönstret, klicka på Nytt. Du kan ange följande detaljer för det nya kommandot:" + +#: C/gedit.xml:1507(term) +msgid "Description" +msgstr "Beskrivning" + +#: C/gedit.xml:1509(para) +msgid "This description is shown in the statusbar when the menu command is chosen." +msgstr "Den här beskrivningen visas i statusraden när menykommandot väljs." + +#: C/gedit.xml:1512(term) +msgid "Accelerator" +msgstr "Snabbtangent" + +#: C/gedit.xml:1514(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Ange en snabbtangent för kommandot." + +#: C/gedit.xml:1517(term) +msgid "Commands" +msgstr "Kommandon" + +#: C/gedit.xml:1519(para) +msgid "The actual commands to be run. Several gedit environment variables can be used to pass content to these commands: see ." +msgstr "De faktiska kommandon som ska köras. Flera miljövariabler i gedit kan användas för att skicka innehåll till dessa kommandon: se ." + +#: C/gedit.xml:1522(term) +msgid "Input" +msgstr "Inmatning" + +#: C/gedit.xml:1524(para) +msgid "The content to give to the commands (as stdin): the entire text of the current document, the current selection, line, or word." +msgstr "Innehållet att ge till kommandon (som stdin): hela texten av det aktuella dokumentet, nuvarande markeringen, rad eller ord." + +#: C/gedit.xml:1527(term) +msgid "Output" +msgstr "Utdata" + +#: C/gedit.xml:1529(para) +msgid "What to do with the output of the commands: display in the bottom pane, put in a new document, or place in the current document, at the end, at the cursor position, or replacing the selection or the entire document." +msgstr "Vad som ska göras med det utdata som kommer från kommandon: visa i underpanelen, lägg in i ett nytt dokument, eller placera det i det aktuella dokumentet, på slutet, vid markörens position, eller ersätt markeringen eller hela dokumentet." + +#: C/gedit.xml:1532(term) +msgid "Applicability" +msgstr "Användbarhet" + +#: C/gedit.xml:1534(para) +msgid "Determines which sort of documents can be affected by the command, for example whether saved or not, and local or remote." +msgstr "Bestämmer vilka sorter av dokument som kan påverkas av kommandot, till exempel huruvida sparade eller inte, och lokala eller fjärr." + +#: C/gedit.xml:1542(title) +msgid "Editing and Removing Tools" +msgstr "Verktyg för att redigera och ta bort" + +#: C/gedit.xml:1543(para) +msgid "To edit a tool, select it in the list and make changes to its properties." +msgstr "För att redigera ett verktyg, välj den i listan och gör ändringar i dess egenskaper." + +#: C/gedit.xml:1544(para) +msgid "To rename a tool, click it again in the list." +msgstr "För att byta namn på ett verktyg, klicka på den igen i listan." + +#: C/gedit.xml:1545(para) +msgid "To restore a built-in tool that you have changed, press Revert." +msgstr "För att återställa ett inbyggt verktyg som du har ändrat, tryck på Återställ." + +#: C/gedit.xml:1546(para) +msgid "To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created yourself." +msgstr "För att ta bort ett verktyg, välj den från listan och tryck på Ta bort. Du kan inte ta bort inbyggda verktyg, endast de som du själv har skapat." + +#: C/gedit.xml:1550(title) +msgid "Variables" +msgstr "Variabler" + +#: C/gedit.xml:1551(para) +msgid "You can use the following variables in the Commands field of the command definition:" +msgstr "Du kan använda följande variabler i fältet Kommandon för kommandodefinitionen:" + +#: C/gedit.xml:1554(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1557(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1560(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1563(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1566(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1569(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1572(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1579(title) +msgid "File Browser Plugin" +msgstr "Insticksmodulen Filbläddrarpanel" + +#: C/gedit.xml:1580(para) +msgid "The File Browser Plugin shows your files and folders in the side pane, allowing you to quickly open files." +msgstr "Insticksmodulen Filbläddrarpanel visar dina filer och mappar i sidopanelen, vilket låter dig att snabbt öppna filer." + +#: C/gedit.xml:1581(para) +msgid "To view the File Browser, choose ViewSide Pane and then click on the tab showing the File Browser icon at the bottom of the side pane." +msgstr "För att visa Filbläddrarpanelen, välj VisaSidopanel och klicka sedan på fliken som visar Filbläddrarikonen i nederkant av sidopanelen." + +#: C/gedit.xml:1583(title) +msgid "Browsing your Files" +msgstr "Bläddra bland dina filer" + +#: C/gedit.xml:1584(para) +msgid "The File Browser tab initially shows your file manager bookmarks. To browse the contents of any item, double-click it." +msgstr "Fliken Filbläddrare visar initialt dina filhanterarbokmärken. Dubbelklicka på valfritt objekt för att bläddra i dess innehåll." + +#: C/gedit.xml:1585(para) +msgid "To show a parent folder, choose from the drop-down list, or press the up arrow on the File Browser's toolbar." +msgstr "För att visa en föräldramapp, välj det från rullgardinslistan, eller tryck på uppåtpilen i Filbläddrarens verktygsrad." + +#: C/gedit.xml:1586(para) +msgid "To show the folder that contains the document you are currently working on, right-click in the file list and choose Set root to active document." +msgstr "För att visa mappen som innehåller dokumentet som du för närvarande arbetar med, högerklicka i fillistan och välj Ställ in rot till aktivt dokument." + +#: C/gedit.xml:1590(para) +msgid "To open a file in gedit, double-click it in the file list." +msgstr "För att öppna en fil i gedit, dubbelklicka på den i fillistan." + +#: C/gedit.xml:1593(title) +msgid "Creating Files and Folders" +msgstr "Skapa filer och mappar" + +#: C/gedit.xml:1594(para) +msgid "To create a new, empty text file in the current folder shown in the browser, right-click in the file list and choose New File." +msgstr "För att skapa en ny, tom textfil i den aktuella mappen som visas i bläddraren, högerklicka i fillistan och välj Ny fil." + +#: C/gedit.xml:1595(para) +msgid "To create a new folder in the current folder shown in the browser, right-click in the file list and choose New Folder." +msgstr "För att skapa en ny mapp i den aktuella mappen som visas i bläddraren, högerklicka i fillistan och välj Ny mapp." + +#: C/gedit.xml:1600(title) +msgid "Indent Lines Plugin" +msgstr "Insticksmodulen Dra in rader" + +#: C/gedit.xml:1601(para) +msgid "The Indent Lines plugin adds or removes space from the beginning of lines of text." +msgstr "Insticksmodulen Dra in rader lägger till eller tar bort blanksteg från början av textrader." + +#: C/gedit.xml:1602(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Genomför följande steg för att dra in eller dra ut text:" + +#: C/gedit.xml:1604(para) +msgid "Select the lines that you want to indent. To indent or unindent a single line, place the cursor anywhere on that line." +msgstr "Markera raderna som du vill dra in. För att dra in eller dra ut en enda rad, placera markören någonstans på den raden." + +#: C/gedit.xml:1609(para) +msgid "To indent the text, choose EditIndent." +msgstr "För att dra in texten, välj RedigeraDra in." + +#: C/gedit.xml:1612(para) +msgid "To remove the indentation, choose EditUnindent." +msgstr "För att ta bort indragningen, välj RedigeraDra ut." + +#: C/gedit.xml:1617(para) +msgid "The amount of space used, and whether tab character or space characters are used, depends on the Tab Stops settings in the Editor Preferences: see ." +msgstr "Mängden utrymme som används, och huruvida tabulatortecknet eller blankstegstecken används, beror på inställningen Tabulatorstopp i redigerarinställningarna: se ." + +#: C/gedit.xml:1622(title) +msgid "Insert Date/Time Plugin" +msgstr "Insticksmodulen Infoga datum/tid" + +#: C/gedit.xml:1623(para) +msgid "The Insert Date/Time plugin inserts the current date and time into a document. To use the Insert Date/Time plugin, perform the following steps:" +msgstr "Insticksmodulen Infoga datum/tid infogar det aktuella datumet och tiden in i ett dokument. Genomför följande steg för att använda insticksmodulen Infoga datum/tid:" + +#: C/gedit.xml:1625(para) +msgid "Choose EditInsert Date and Time." +msgstr "Välj RedigeraInfoga datum och tid." + +#: C/gedit.xml:1626(para) +msgid "If you have not configured the Insert Date/Time plugin to automatically insert the date/time without prompting you for the format, gedit displays the Insert Date and Time dialog. Select the appropriate date/time format from the list. Click Insert to close the Insert Date and Time dialog. gedit inserts the date/time at the cursor position in the current file." +msgstr "Om du inte har konfigurat insticksmodulen Infoga datum/tid till att automatiskt infoga datumet/tiden utan att fråga dig efter formatet, kommer gedit att visa dialogrutan Infoga datum och tid. Välj det lämpliga formatet för datum och tid från listan. Klicka på Infoga för att stänga dialogrutan Infoga datum och tid. gedit infogar datumet och tiden vid markörpositionen i den aktuella filen." + +#: C/gedit.xml:1627(para) +msgid "If you have configured gedit to use one particular date/time format, the Insert Date and Time dialog is not displayed. The date/time is automatically entered at the cursor position in the current file." +msgstr "Om du har konfigurat gedit till att använda ett specifikt format för datum och tid, kommer dialogrutan Infoga datum och tid inte att visas. Datumet och tiden kommer då att automatiskt infogas vid markörpositionen i den aktuella filen." + +#: C/gedit.xml:1632(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Konfigurera insticksmodulen Infoga datum/tid" + +#: C/gedit.xml:1633(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Genomför följande steg för att konfigurera insticksmodulen Infoga datum/tid:" + +#: C/gedit.xml:1641(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Välj insticksmodulen Infoga datum/tid." + +#: C/gedit.xml:1644(para) +msgid "Click Configure Plugin to display the Configure insert date/time plugin dialog." +msgstr "Klicka på Konfigurera för att visa dialogrutan Konfigurera insticksmodulen för infoga datum/tid." + +#: C/gedit.xml:1647(para) +msgid "Select one of the options, as follows:" +msgstr "Välj ett av följande alternativ:" + +#: C/gedit.xml:1649(para) +msgid "To specify the date/time format each time you insert the date/time, select the Prompt for a format option." +msgstr "För att ange formatet för datum och tid varje gång som du infogar datumet och tiden, välj alternativet Fråga efter ett format." + +#: C/gedit.xml:1652(para) +msgid "To use the same gedit-provided date/time format each time you insert the date/time, select the Use the selected format option, then select the appropriate format from the list. When you select this option, gedit does not prompt you for the date/time format when you choose EditInsert Date and Time." +msgstr "För att använda samma format för datum och tid som gedit tillhandahåller varje gång som du infogar datumet och tiden, välj alternativet Använd det valda formatet, välj sedan det lämpliga formatet från listan. När du väljer det här alternativet, kommer gedit inte att fråga dig efter formatet för datum och tid när du väljer RedigeraInfoga datum och tid." + +#: C/gedit.xml:1655(para) +msgid "To use the same customized date/time format each time you insert the date/time, select the Use custom format option, then enter the appropriate format in the text box. For more information about how to specify a custom format, see strftime3. When you select this option, gedit does not prompt you for the date/time format when you choose EditInsert Date and Time." +msgstr "För att använda samma anpassade format för datum och tid varje gång du infogar datumet och tiden, välj alternativet Använd anpassat format, ange sedan det lämpliga formatet i textrutan. För mer information om hur man anger ett anpassat format, se strftime3. När du väljer det här alternativet, kommer gedit inte att fråga dig efter formatet för datumet och tiden när du väljer RedigeraInfoga datum och tid." + +#: C/gedit.xml:1660(para) +msgid "Click OK to close the Configure insert date/time plugin dialog." +msgstr "Klicka på OK för att stänga dialogrutan Konfigurera insticksmodulen Infoga datum/tid." + +#: C/gedit.xml:1663(para) +msgid "To close the Preferences dialog, click Close." +msgstr "För att stänga dialogrutan Inställningar, klicka på Stäng." + +#: C/gedit.xml:1670(title) +msgid "Modelines Plugin" +msgstr "Insticksmodulen Lägesrader" + +#: C/gedit.xml:1671(para) +msgid "The Modelines plugin allows you to set preferences for individual documents. A modeline is a line of text at the start or end of the document with settings that gedit recognises." +msgstr "Insticksmodulen Lägesrader låter dig ställa in inställningar för individuella dokument. En lägesrad är en textrad vid början eller slutet av dokumentet med inställningar som gedit känner igen." + +#: C/gedit.xml:1672(para) +msgid "Preferences set using modelines take precedence over the ones specified in the preference dialog." +msgstr "Inställningar inställda med lägesrader åsidosätter de som angivits i inställningsdialogen." + +#: C/gedit.xml:1673(para) +msgid "You can set the following preferences with modelines:" +msgstr "Du kan ställa in följande inställningar med lägesrader:" + +#: C/gedit.xml:1676(para) +msgid "Tab width" +msgstr "Tabulatorbredd" + +#: C/gedit.xml:1679(para) +msgid "Indent width" +msgstr "Indenteringsbredd" + +#: C/gedit.xml:1682(para) +msgid "Insert spaces instead of tabs" +msgstr "Infoga blanksteg istället för tabulatortecken" + +#: C/gedit.xml:1688(para) +msgid "Right margin width" +msgstr "Högermarginalbredd" + +#: C/gedit.xml:1692(para) +msgid "The Modelines plugin supports a subset of the options used by other text editors Emacs, Kate and Vim." +msgstr "Insticksmodulen Lägesrader har stöd för en mindre uppsättning av alternativ som används av de andra textredigerarna Emacs, Kate och Vim." + +#: C/gedit.xml:1695(title) +msgid "Emacs Modelines" +msgstr "Lägesrader för Emacs" + +#: C/gedit.xml:1696(para) +msgid "The first two lines of a document are scanned for Emacs modelines." +msgstr "De två raderna raderna i ett dokument söks igenom efter lägesrader för Emacs." + +#: C/gedit.xml:1697(para) +msgid "The Emacs options for tab-width, indent-offset, indent-tabs-mode and autowrap are supported. For more information, see the GNU Emacs Manual." +msgstr "Emacs-alternativen för tab-width, indent-offset, indent-tabs-mode och autowrap stöds. För mer information, se handboken för GNU Emacs." + +#: C/gedit.xml:1700(title) +msgid "Kate Modelines" +msgstr "Lägesrader för Kate" + +#: C/gedit.xml:1701(para) +msgid "The first and last ten lines a document are scanned for Kate modelines." +msgstr "De tio första och sista raderna i ett dokument söks igenom efter lägesrader för Kate." + +#: C/gedit.xml:1702(para) +msgid "The Kate options for tab-width, indent-width, space-indent, word-wrap and word-wrap-column are supported. For more information, see the Kate website." +msgstr "Kate-alternativen för tab-width, indent-width, space-indent, word-wrap och word-wrap-column stöds. För mer information, se webbsidan för Kate." + +#: C/gedit.xml:1705(title) +msgid "Vim Modelines" +msgstr "Lägesrader för Vim" + +#: C/gedit.xml:1706(para) +msgid "The first and last three lines a document are scanned for Vim modelines." +msgstr "De tre första och sista raderna i ett dokument söks igenom efter lägesrader för Vim." + +#: C/gedit.xml:1707(para) +msgid "The Vim options for et, expandtab, ts, tabstop, sw, shiftwidth, wrap, and textwidth are supported. For more information, see the Vim website." +msgstr "Vim-alternativen för et, expandtab, ts, tabstop, sw, shiftwidth, wrap och textwidth stöds. För mer information, se webbsidan för Vim." + +#: C/gedit.xml:1712(title) +msgid "Python Console Plugin" +msgstr "Insticksmodulen Python-konsoll" + +#: C/gedit.xml:1713(para) +msgid "The Python Console Plugin allows you to run commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows recent output and a command prompt field." +msgstr "insticksmodulen Python-konsoll låter dig köra kommandon i programspråket Python från gedit. Aktivering av insticksmodulen lägger till en flik till underpanelen. Den visar senaste utdata och ett kommandofält." + +#: C/gedit.xml:1714(para) +msgid "Commands entered into the python console are not checked before they are run. It is therefore possible to hang gedit, for example by entering an infinite loop." +msgstr "Kommandon som anges i Python-konsollen kontrolleras inte innan de körs. Det är därför möjligt att låsa hela gedit, till exempel genom att ange en oändlig slinga." + +#: C/gedit.xml:1718(title) +msgid "Snippets Plugin" +msgstr "Insticksmodulen Textsnuttar" + +#: C/gedit.xml:1719(para) +msgid "The Snippets plugin allows you to store frequently-used pieces of text, called snippets, and insert them quickly into a document." +msgstr "Insticksmodulen Textsnuttar låter dig lagra ofta använda delar av text, kallade textsnuttar, och infoga dem snabbt i ett dokument." + +#: C/gedit.xml:1720(para) +msgid "Snippets are specific to the language syntax of the current document. For example, when you are working with an HTML document, you can choose from a list of snippets that are useful for HTML. In addition, some snippets are global, and are available in all documents." +msgstr "Textsnuttar är specifika för språksyntaxen för det aktuella dokumentet. Till exempel när du arbetar med ett HTML-dokument kan du välja från en lista över textsnuttar som är användbara för HTML. I tilläggt till det är vissa textsnuttar globala och finns tillgängliga för alla dokument." + +#: C/gedit.xml:1721(para) +msgid "A number of built-in snippets are installed with gedit, which can be modified." +msgstr "Ett antal inbyggda textsnuttar installeras med gedit, vilka kan ändras." + +#: C/gedit.xml:1724(title) +msgid "Inserting Snippets" +msgstr "Infoga textsnuttar" + +#: C/gedit.xml:1725(para) +msgid "To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is usually the first few letters of the snippet, or something else that is short and easy to remember." +msgstr "För att infoga en textsnutt i ett dokument, skriv in dess tabulatorutlösare och tryck på tabulatorn. Tabulatorutlösaren för en textsnutt är vanligtvis de första bokstäverna i textsnutten, eller någonting annat som är kort och enkelt att komma ihåg." + +#: C/gedit.xml:1726(para) +msgid "Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "Alternativt, tryck CtrlBlanksteg för att se en lista över de textsnuttar du kan infoga." + +#: C/gedit.xml:1730(title) +msgid "Adding Snippets" +msgstr "Lägg till textsnuttar" + +#: C/gedit.xml:1731(para) +msgid "To create a new snippet, do the following:" +msgstr "Gör följande för att skapa en ny textsnutt:" + +#: C/gedit.xml:1734(para) +msgid "Choose ToolsManage Snippets. The Snippets Manager window opens." +msgstr "Välj VerktygHantera textsnuttar. Fönstret Hantera textsnuttar öppnas." + +#: C/gedit.xml:1737(para) +msgid "The list of snippets is grouped by language. Select the language you want to add a snippet to, or a snippet in that language group. To add a snippet for all languages, choose Global at the top of the list. The syntax of the document you are currently working with is shown by default." +msgstr "Listan över textsnuttar grupperas efter språk. Välj språket som du vill lägga till en textsnutt till, eller en textsnutt i den språkgruppen. För att lägga till en textsnutt för alla språk, Välj Global i övre delen av listan. Syntaxen för dokumentet som du för närvarande arbetar med kommer att visas som standard." + +#: C/gedit.xml:1740(para) +msgid "Click New. A new snippet appears in the list." +msgstr "Klicka på Ny. En ny textsnutt visas i listan." + +#: C/gedit.xml:1743(para) +msgid "Enter the following information for the new snippet:" +msgstr "Ange följande information för den nya textsnutten:" + +#: C/gedit.xml:1745(term) +msgid "Name" +msgstr "Namn" + +#: C/gedit.xml:1747(para) +msgid "Enter a name for the snippet in the text field within the snippet list. The name of a snippet serves only as a reminder of its purpose. You can change name of a snippet you create by clicking on it in the list." +msgstr "Ange ett namn för textsnutten i textfältet i listan. Namnet på textsnutten är bara för att påminna om dess syfte. Du kan ändra namnet på en textsnutt som du har skapat genom att klicka på den i listan." + +#: C/gedit.xml:1750(term) +msgid "Snippet text" +msgstr "Textsnutt" + +#: C/gedit.xml:1752(para) +msgid "Enter the text of the snippet in the Edit snippet text box. For special codes you can use, see ." +msgstr "Ange texten för textsnutten i textrutan Redigera textsnutt. För de specialkoder som du kan använda, se ." + +#: C/gedit.xml:1753(para) +msgid "You can switch back to the document window to copy text without closing the Snippets Manager window." +msgstr "Du kan växla tillbaka till dokumentfönstret för att kopiera text utan att stänga fönstret Hantera textsnuttar." + +#: C/gedit.xml:1756(term) +msgid "Tab Trigger" +msgstr "Tabulatorutlösare" + +#: C/gedit.xml:1758(para) +msgid "Enter the tab trigger for the snippet. This is the text that you type before pressing Tab to insert the snippet." +msgstr "Ange tabulatorutlösaren för textsnutten. Det här är texten som du skriver innan du trycker på tabulatorn för att infoga textsnutten." + +#: C/gedit.xml:1759(para) +msgid "The tag must be either a single word comprising only letters, or any single character. The Tab trigger will highlight in red if an invalid tab trigger is entered." +msgstr "Taggen måste antingen vara ett enda ord som består av endast bokstäver, eller ett enda tecken. Tabulatorutlösaren kommer att färgmarkeras i rött om en ogiltig tabulatorutlösare anges." + +#: C/gedit.xml:1762(term) +msgid "Shortcut key" +msgstr "Snabbtangent" + +#: C/gedit.xml:1764(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Ange en snabbtangent att använda för att infoga textsnutten." + +#: C/gedit.xml:1773(title) +msgid "Editing and Removing Snippets" +msgstr "Redigera och ta bort textsnuttar" + +#: C/gedit.xml:1774(para) +msgid "To edit a snippet, select it in the list and make changes to its text and activation properties." +msgstr "För att redigera en textsnutt, välj den i listan och gör ändringar till dess text- och aktiveringsegenskaper." + +#: C/gedit.xml:1775(para) +msgid "To rename a snippet, click it again in the list." +msgstr "För att byta namn på en textsnutt, klicka på den igen i listan." + +#: C/gedit.xml:1776(para) +msgid "To restore a built-in snippet that you have changed, press Revert." +msgstr "För att återställa en inbyggd textsnutt som du har ändrat, tryck på Återställ." + +#: C/gedit.xml:1777(para) +msgid "To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have created yourself." +msgstr "För att ta bort en textsnutt, välj den från listan och tryck på Ta bort. Du kan inte ta bort inbyggda textsnuttar, endast de som du själv har skapat." + +#: C/gedit.xml:1781(title) +msgid "Snippet Substitutions" +msgstr "Textsnuttsersättare" + +#: C/gedit.xml:1782(para) +msgid "In addition to inserting stored text, a snippet can include customizable text, or mark spaces where you can add text once the snippet is inserted in your document." +msgstr "I tillägg till att infoga lagrad text kan en textsnutt inkludera anpassningsbar text, eller markera utrymme där du kan lägga till text när textsnutten har infogats i ditt dokument." + +#: C/gedit.xml:1786(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "Du kan använda följande koder för platshållare i textsnutten:" + +#: C/gedit.xml:1788(term) +msgid "Tab placeholders" +msgstr "Platshållare för tabulator" + +#: C/gedit.xml:1790(para) +msgid "$n defines a tab placeholder, where n is any number from 1 upwards." +msgstr "$n definierar en platshållare för tabulator, där n är någon siffra från 1 och uppåt." + +#: C/gedit.xml:1791(para) +msgid "${n:default} defines a tab placeholder with a default value." +msgstr "${n:standard} definierar en platshållare för tabulator med ett standardvärde." + +#: C/gedit.xml:1792(para) +msgid "A tab placeholder marks a place in the snippet text where you can add extra text after the snippet is inserted." +msgstr "En platshållare för tabulator markerar en plats i textsnutten där du kan lägga till extra text efter att textsnutten har infogats." + +#: C/gedit.xml:1793(para) +msgid "To use tab placeholders, insert the snippet as normal. The cursor is placed at the first tab placeholder. Type text, and press Tab to advance to the next tab placeholder. The number in the placeholder code defines the order in which tab advances to each place in the text." +msgstr "För att använda platshållare för tabulator, infoga textsnutten som vanligt. Markören placeras på den första platshållaren. Skriv in text och tryck på tabulatorn för att gå vidare till nästa platshållare. Siffran i platshållarkoden definierar ordningen i vilken tabulatorn går vidare till varje plats i texten." + +#: C/gedit.xml:1794(para) +msgid "Press ShiftTab to return to the previous tab placeholder. Pressing Tab when there are no more tab placeholders moves the cursor to the end of the snippet text, or to the end placeholder if it exists." +msgstr "Tryck på SkiftTabulator för att återgå till den föregående platshållaren. Tryck på Tabulator när det inte finns fler platshållare för tabulator flyttas markören till slutet av textsnutten, eller till slutet av platshållaren för avslut om det finns en." + +#: C/gedit.xml:1797(term) +msgid "Mirror placeholders" +msgstr "Platshållare för spegel" + +#: C/gedit.xml:1799(para) +msgid "A repeated tab placeholder will mirror the placeholder already defined. This allows you to type in text only once that you want to appear several times in the snippet." +msgstr "En upprepad platshållare för tabulator kommer att spegla platshållaren som redan har definierats. Det här gör att du kan skriva in text en gång som du vill ska visas flera gånger i textsnutten." + +#: C/gedit.xml:1802(term) +msgid "End placeholder" +msgstr "Platshållare för avslut" + +#: C/gedit.xml:1804(para) +msgid "$0 defines the end placeholder. This allows you to finish working with the snippet with the cursor at a point other than the end of the snippet text." +msgstr "$0 definierar platshållaren för avslut. Det här gör att du kan sluta arbeta med textsnutten när markören är vid en position annan än för slutet av textsnutten." + +#: C/gedit.xml:1807(term) +msgid "Environmental variables" +msgstr "Miljövariabler" + +#: C/gedit.xml:1809(para) +msgid "Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific to gedit can also be used:" +msgstr "Miljövariabler som $PATH och $HOME ersätts i textsnutten. Följande variabler som är specifika för gedit kan också användas:" + +#: C/gedit.xml:1811(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1813(para) +msgid "The currently selected text." +msgstr "Den för närvarande markerade texten." + +#: C/gedit.xml:1816(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1818(para) +msgid "The full filename of the document, or an empty string if the document isn't saved yet." +msgstr "Det fullständiga namnet på dokumentet, eller en tom sträng om dokumentet inte har sparats än." + +#: C/gedit.xml:1821(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1823(para) +msgid "The basename of the filename of the document, or an empty string if the document isn't saved yet." +msgstr "Basnamnet för filnamnet för dokumentet, eller en tom sträng om dokumentet inte har sparats än." + +#: C/gedit.xml:1826(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1828(para) +msgid "The word at the cursor's location in the document. When this variable is used, the current word will be replaced by the snippet text." +msgstr "Ordet vid markörens plats i dokumentet. När den här variabeln används kommer det aktuella ordet att ersättas med textsnutten." + +#: C/gedit.xml:1836(term) +msgid "Shell placeholders" +msgstr "Platshållare för skal" + +#: C/gedit.xml:1838(para) +msgid "$(cmd) is replaced by the result of executing cmd in a shell." +msgstr "$(kommando) ersätts av resultatet för körningen av kommando i ett skal." + +#: C/gedit.xml:1839(para) +msgid "$(n:cmd) allows you to give this placeholder a reference, where n is any number from 1 upwards. Use $n to use the output from one shell placeholder as input in another." +msgstr "$(n:kommando) låter dig ange en referens för den här platshållaren, där n är en siffra från 1 och uppåt. Använd $n för att använda utdata från en platshållare för skal som indata till ett annat." + +#: C/gedit.xml:1842(term) +msgid "Python placeholders" +msgstr "Platshållare för Python" + +#: C/gedit.xml:1844(para) +msgid "$<cmd> is replaced by the result of evaluating cmd in the python interpreter." +msgstr "$<kommando> ersätts av resultatet för evaluering av kommando i python-tolkaren." + +#: C/gedit.xml:1845(para) +msgid "$<a:cmd> specifies another python placeholder as a dependency, where a gives its order in the snippet. This allows you to use python functions defined in another snippet. To specify several dependencies, separate the numbers with commas thus: $<a,b:cmd>" +msgstr "$<a:kommando> anger en annan platshållare för python som en beroende, där a anger dess ordning i textsnutten. Det här låter dig använda python-funktioner som definierats i en annan textsnutt. För att ange flera beroenden, separera siffrorna med kommatecken så här: $<a,b:kommando>" + +#: C/gedit.xml:1846(para) +msgid "To use a variable in all other python snippets, declare it as global." +msgstr "För att använda en variabel i alla andra python-textsnuttar, deklarera den som global." + +#: C/gedit.xml:1855(title) +msgid "Sort Plugin" +msgstr "Insticksmodulen Sortera" + +#: C/gedit.xml:1856(para) +msgid "The Sort plugin arranges selected lines of text into alphabetical order." +msgstr "Insticksmodulen Sortera arrangerar om markerade textrader till alfabetisk ordning." + +#: C/gedit.xml:1857(para) +msgid "You cannot undo the Sort operation, so you should save the file before performing the sort. To revert to the saved version of the file after the sort operation, choose FileRevert." +msgstr "Du kan inte ångra sorteringsåtgärden, så du bör spara filen innan du genomför sorteringen. För att återgå till den sparade versionen av filen efter sorteringsåtgärden, välj ArkivÅterställ." + +#: C/gedit.xml:1860(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Genomför följande steg för att använda insticksmodulen Sortera:" + +#: C/gedit.xml:1863(para) +msgid "Select the lines of text you want to sort." +msgstr "Markera textraderna som du vill sortera." + +#: C/gedit.xml:1865(para) +msgid "Choose EditSort. The Sort dialog opens." +msgstr "Välj RedigeraSortera. Dialogrutan Sortera öppnas." + +#: C/gedit.xml:1868(para) +msgid "Choose the options you want for the sort:" +msgstr "Välj alternativen som du vill använda för sorteringen:" + +#: C/gedit.xml:1871(para) +msgid "To arrange the text in reverse order, select Reverse order." +msgstr "För att arrangera texten i omvänd ordning, välj Baklänges." + +#: C/gedit.xml:1874(para) +msgid "To delete duplicate lines, select Remove duplicates." +msgstr "För att ta bort dubblettrader, välj Ta bort dubletter." + +#: C/gedit.xml:1877(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "För att ignorera skiftläge, välj Gör ingen skillnad på gemener/VERSALER." + +#: C/gedit.xml:1880(para) +msgid "To have the sort ignore the characters at the start of the lines, set the first character that should be used for sorting in the Start at column spin box." +msgstr "För att sorteringen ska ignorera tecknen i början av raderna, ställ in det första tecknet som ska användas för sorteringen i snurrväljaren Börja vid kolumn." + +#: C/gedit.xml:1885(para) +msgid "To perform the sort operation, click Sort." +msgstr "För att genomföra sorteringsåtgärden, klicka på Sortera." + +#: C/gedit.xml:1892(title) +msgid "Spell Checker Plugin" +msgstr "Insticksmodulen Stavningskontroll" + +#: C/gedit.xml:1893(para) +msgid "The Spell Checker plugin checks the spelling in the selected text. You can configure gedit to check the spelling automatically, or you can check the spelling manually, in the specified language. The language setting, and the autocheck spelling properties, apply per document. To use the Spell checker plugin, perform the following steps:" +msgstr "Insticksmodulen Stavningskontroll kontrollerar stavningen i den markerade texten. Du kan konfigurera gedit till att kontrollera stavningen automatiskt, eller bara kontrollera stavningen manuellt, för det angivna språket. Språkinställningen, och egenskaperna för den automatiskt stavningskontrollen, gäller per dokument. Genomför följande steg för att använda insticksmodulen Stavningskontroll:" + +#: C/gedit.xml:1895(para) +msgid "Choose ToolsSet Language to display the Set language dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "Välj VerktygStäll in språk för att visa dialogrutan Ställ in språk. Välj det lämpliga språket från listan. Klicka på OK för att stänga dialogrutan Ställ in språk." + +#: C/gedit.xml:1898(para) +msgid "To check the spelling automatically, choose ToolsAutocheck Spelling. To unset the automatic spell check, choose ToolsAutocheck Spelling again. When automatic spell checking is set, an icon is displayed beside the Autocheck Spelling menu item. Automatic spell checking is unset by default, each time gedit starts." +msgstr "För att automatiskt kontrollera stavningen, välj VerktygKontrollera stavning automatiskt. För att inaktivera automatisk stavningskontroll, välj VerktygKontrollera stavning automatiskt igen. När automatiskt stavningskontroll är aktiverad, kommer en ikon att visas bredvid menyobjektet Kontrollera stavning automatist. Automatisk stavningskontroll är inaktiverat som standard, varje gång gedit startar." + +#: C/gedit.xml:1899(para) +msgid "Unknown spellings are displayed in a different color, and underlined. Right-click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "Okända stavningar visas i en annan färg, och är understruken. Högerklicka på en okänd stavning, välj sedan Stavningsförslag från popup-menyn:" + +#: C/gedit.xml:1902(para) +msgid "To replace the unknown spelling with another spelling in the list, select the replacement spelling from the Spelling Suggestions popup menu." +msgstr "För att ersätta den okända stavningen med en annan stavning i listan, välj ersättningsstavningen från popup-menyn Stavningsförslag." + +#: C/gedit.xml:1905(para) +msgid "To add the unknown spelling to your personal dictionary, select Spelling SuggestionsAdd." +msgstr "För att lägga till den okända stavningen till din personliga ordbok, välj StavningsförslagLägg till." + +#: C/gedit.xml:1908(para) +msgid "To ignore all occurrences of the unknown spelling, so that they are no longer flagged as unknown but are not added to your personal dictionary, select Spelling SuggestionsIgnore All. The unknown word is ignored in the current gedit session only." +msgstr "För att ignorera alla förekomster av den okända stavningen, så att de inte längre flaggas som okända men inte läggs till i din personliga ordbok, välj StavningsförslagIgnorera alla. Det okända ordet kommer endast att ignoreras i den aktuella gedit-sessionen." + +#: C/gedit.xml:1913(para) +msgid "To check the spelling manually, choose ToolsCheck Spelling." +msgstr "För att kontrollera stavningen manuellt, välj VerktygKontrollera stavning." + +#: C/gedit.xml:1915(para) +msgid "If there are no spelling errors, an Information dialog displays a message stating that the document does not contain misspelled words. Click OK to close the Information dialog." +msgstr "Om det inte finns några stavningsfel, kommer dialogrutan Information att visa ett meddelande som säger att dokumentet inte innehåller några felstavade ord. Klicka på OK för att stänga dialogrutan Information." + +#: C/gedit.xml:1917(para) +msgid "If there are spelling errors, the Check Spelling dialog is displayed:" +msgstr "Om det finns stavningsfel kommer dialogrutan Kontrollera stavning att visa:" + +#: C/gedit.xml:1920(para) +msgid "The Misspelled word is displayed at the top of the dialog." +msgstr "Felstavade ord visas i överkant av dialogrutan." + +#: C/gedit.xml:1923(para) +msgid "A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by selecting a spelling from the Suggestions list, or you can enter text directly into the Change to text box." +msgstr "Ett förslag på stavning visas i textrutan Ändra till. Du kan ersätta det här med en annan känd stavning genom att välja en stavning från listan Förslag, eller så kan du ange text direkt i textrutan Ändra till." + +#: C/gedit.xml:1926(para) +msgid "To check the spelling of the text in the Change to text box, click Check Word. If this is a known word, the Suggestions list is replaced with the text (correct spelling). If the word is not known, new entries appear in the Suggestions list." +msgstr "För att kontrollera stavningen på texten i textrutan Ändra till, klicka på Kontrollera ord. Om det här är ett känt ord kommer listan Förslag att ersättas med texten (korrekt stavning). Om ordet inte är känt kommer nya poster att visas i listan Förslag." + +#: C/gedit.xml:1929(para) +msgid "To ignore the current occurrence of the unknown word, click Ignore. To ignore all occurrences of the unknown word, click Ignore All. The unknown word is ignored in the current gedit session only." +msgstr "För att ignorera det aktuella förekomsten av det okända ordet, klicka på Ignorera. För att ignorera alla förekomster av det okända ordet, klicka på Ignorera alla. Det okända ordet kommer endast att ignoreras i den aktuella gedit-sessionen." + +#: C/gedit.xml:1932(para) +msgid "To change the current occurrence of the unknown word to the text in the Change to text box, click Change. To change all occurrences of the unknown word to the text in the Change to text box, click Change All." +msgstr "För att ändra den aktuella förekomsten av det okända ordet till texten i textrutan Ändra till, klicka på Ändra. För att ändra alla förekomster av det okända ordet till texten i textrutan Ändra till, klicka på Ändra alla." + +#: C/gedit.xml:1935(para) +msgid "To add the unknown word to your personal dictionary, click Add word." +msgstr "För att lägga till det okända ordet till din personliga ordbok, klicka på Lägg till ord." + +#: C/gedit.xml:1938(para) +msgid "To close the Check Spelling dialog, click Close." +msgstr "För att stänga dialogrutan Kontrollera stavning, klicka på Stäng." + +#: C/gedit.xml:1947(title) +msgid "Tag List Plugin" +msgstr "Insticksmodulen Tagglista" + +#: C/gedit.xml:1948(para) +msgid "The Tag List plugin allows you to insert common tags from a list in the side pane." +msgstr "Insticksmodulen Tagglista låter dig infoga vanligen använda taggar från en lista i sidopanelen." + +#: C/gedit.xml:1949(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Genomför följande steg för att använda insticksmodulen Tagglista:" + +#: C/gedit.xml:1951(para) +msgid "Choose ViewSide Pane." +msgstr "Välj VisaSidopanel." + +#: C/gedit.xml:1955(para) +msgid "By default, the side pane shows a tab containing a list of open documents. Click on the tab showing a + icon at the bottom of the side pane to show the tag list tab." +msgstr "Som standard visar sidopanelen en flik som innehåller en lista över öppna dokument. Klicka på fliken som visar ikonen + vid nederkant av sidopanelen för att visa fliken för tagglistor." + +#: C/gedit.xml:1957(para) +msgid "Select the appropriate tag category from the drop-down list. For example, HTML - Tags." +msgstr "Välj den lämpliga taggkategorin från rullgardinslistan. Till exempel, HTML - Taggar." + +#: C/gedit.xml:1960(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Rulla genom tagglistan för att hitta den önskade taggen." + +#: C/gedit.xml:1963(para) +msgid "To insert a tag at the cursor position in the current file, double-click on the tag in the tag list. You can also insert a tag as follows:" +msgstr "För att infoga en tagg vid markörpositionen i den aktuella filen, dubbelklicka på taggen i tagglistan. Du kan även infoga ett tagg på dessa sätt:" + +#: C/gedit.xml:1965(para) +msgid "To insert a tag in the current file and change the focus from the side pane to the display area, press Return." +msgstr "För att infoga en tagg i den aktuella filen och ändra fokus från sidopanelen till visningsrutan, tryck på Return." + +#: C/gedit.xml:1968(para) +msgid "To insert a tag in the current file and maintain the focus on the Tag list plugin window, press ShiftReturn." +msgstr "För att infoga en tagg i den aktuella filen och bibehålla fokus för fönstret Insticksmodulen Tagglista, tryck på SkiftReturn." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Daniel Nylander , 2007, 2008, 2009" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "Användarnamn infogar användarnamnet för den aktuella användaren in " +#~ "i dokumentet." +#~ msgid "User Name Plugin" +#~ msgstr "Insticksmodulen Användarnamn" +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "Insticksmodulen Användarnamn infogar " +#~ "användarnamnet för den aktuella användaren in i dokumentet." +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "För att infoga ditt användarnamn vid markörpositionen, välj " +#~ "RedigeraInfoga användarnamn." +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgid "" +#~ "For more information about how to configure syntax highlighting, see " +#~ "." +#~ msgstr "" +#~ "För mer information om hur man konfigurerar syntaxmarkering, se ." +#~ msgid "Colors" +#~ msgstr "Färger" +#~ msgid "" +#~ "Select the Use default theme colors option to use " +#~ "the default theme colors in the gedit text " +#~ "window." +#~ msgstr "" +#~ "Välj alternativet Använd standardtemafärger för att " +#~ "använda standardtemafärgerna i gedit-" +#~ "textfönstret." +#~ msgid "" +#~ "Click on the Normal text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "normal text in the gedit text window." +#~ msgstr "" +#~ "Klicka på färgknappen Normal textfärg för att visa " +#~ "färgväljaren. Välj en färg att använda för att visa normal text i " +#~ "gedit-textfönstret." +#~ msgid "" +#~ "Click on the Background color color button to " +#~ "display the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "Klicka på färgknappen Bakgrundsfärg för att visa " +#~ "färgväljaren. Välj en bakgrundsfärg för gedit-" +#~ "textfönstret." +#~ msgid "" +#~ "Click on the Selected text color color button to " +#~ "display the color selector dialog. Select a color to use to display " +#~ "selected text." +#~ msgstr "" +#~ "Klicka på färgknappen Färg på markerad text för " +#~ "att visa färgväljaren. Välj en färg att använda för att visa markerad " +#~ "text." +#~ msgid "" +#~ "Click on the Selection color color button to " +#~ "display the color selector dialog. Select a background color to use to " +#~ "highlight a text selection." +#~ msgstr "" +#~ "Klicka på färgknappen Markeringsfärg för att visa " +#~ "färgväljaren. Välj en bakgrundsfärg att använda för att färgmarkera en " +#~ "textmarkering." +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "Inställningar för syntaxmarkering" +#~ msgid "Enable syntax highlighting" +#~ msgstr "Aktivera syntaxmarkering" +#~ msgid "" +#~ "Select this option to highlight the syntax of the text that you edit." +#~ msgstr "" +#~ "Välj det här alternativet för att färgmarkera syntaxen för texten som du " +#~ "redigerar." +#~ msgid "Highlight mode" +#~ msgstr "Färgmarkeringsläge" +#~ msgid "Use this drop-down list to select a syntax mode to configure." +#~ msgstr "" +#~ "Använd den här rullgardinslistan för att välja ett syntaxläge att " +#~ "konfigurera." +#~ msgid "Elements" +#~ msgstr "Element" +#~ msgid "Use this list box to select a syntax element to configure." +#~ msgstr "" +#~ "Använd den här listrutan för att välja ett syntaxelement att konfigurera." +#~ msgid "Format buttons" +#~ msgstr "Formatknappar" +#~ msgid "" +#~ "Use the following buttons to change the format of the selected syntax " +#~ "element:" +#~ msgstr "" +#~ "Använd följande knappar för att ändra formatet på det markerade " +#~ "syntaxelementet." +#~ msgid "Button" +#~ msgstr "Knapp" +#~ msgid "Format" +#~ msgstr "Format" +#~ msgid "Shows icon for bold format." +#~ msgstr "Visar ikonen för fet text." +#~ msgid "Bold" +#~ msgstr "Fet" +#~ msgid "Shows icon for italic format." +#~ msgstr "Visar ikonen för kursiv text." +#~ msgid "Italic" +#~ msgstr "Kursiv" +#~ msgid "Shows icon for underline." +#~ msgstr "Visar ikonen för understreck." +#~ msgid "Underline" +#~ msgstr "Understruken" +#~ msgid "Shows icon for strikethrough." +#~ msgstr "Visar ikonen för genomstruken." +#~ msgid "Strikethrough" +#~ msgstr "Genomstruken" +#~ msgid "Foreground" +#~ msgstr "Förgrund" +#~ msgid "" +#~ "Select this option to change the font color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the font color." +#~ msgstr "" +#~ "Välj det här alternativet för att ändra typsnittsfärgen på det markerade " +#~ "syntaxelementet. Klicka på färgknappen för att visa färgväljaren, välj " +#~ "sedan typsnittsfärgen." +#~ msgid "Background" +#~ msgstr "Bakgrund" +#~ msgid "" +#~ "Select this option to change the background color of the selected syntax " +#~ "element. Click on the color button to display the color selector dialog, " +#~ "then select the background color." +#~ msgstr "" +#~ "Välj det här alternativet för att ändra bakgrundsfärg för det markerade " +#~ "syntaxelementet. Klicka på färgknappen för att visa färgväljaren, välj " +#~ "sedan bakgrundsfärgen." +#~ msgid "Reset to Default" +#~ msgstr "Återställ till standardvärde" +#~ msgid "" +#~ "Click on this button to reset the foreground color and background color " +#~ "of the selected syntax element to the default values." +#~ msgstr "" +#~ "Klicka på den här knappen för att återställa förgrund- och " +#~ "bakgrundsfärgen för det markerade syntaxelementet till standardvärden." +#~ msgid "" +#~ "To undo a change you have made, choose EditUndo. To reverse this " +#~ "action, choose EditRedo. The number of previous edits that you can undo " +#~ "is determined by the Undo limit setting in the " +#~ "Editor tabbed section of the Preferences dialog: see ." +#~ msgstr "" +#~ "För att ångra en ändring som du har gjort, välj " +#~ "RedigeraÅngra. För att återställa den här åtgärden, välj " +#~ "RedigeraGör om. Antalet tidigare redigeringar som du kan ångra bestäms av " +#~ "inställningen för Ångra-gränsen i fliksektionen " +#~ "Redigerare i dialogrutan Inställningar: se ." +#~ msgid "F7" +#~ msgstr "F7" +#~ msgid "Undo" +#~ msgstr "Ångra" +#~ msgid "" +#~ "Select the Limit to ... actions option to set a " +#~ "limit on the number of editing actions that you can undo. Use the spin " +#~ "box to specify the maximum number of actions that you can undo." +#~ msgstr "" +#~ "Välj alternativet Begränsa till ... åtgärder för att " +#~ "ställa in en gräns på antalet redigeringsåtgärder som du kan ångra. " +#~ "Använd snurrväljaren för att ange maximalt antal åtgärder som du kan " +#~ "ångra." +#~ msgid "" +#~ "Select the Unlimited undo option to set no limit on " +#~ "the number of editing actions that you can undo." +#~ msgstr "" +#~ "Välj alternativet Obegränsat antal ångringar för att " +#~ "ställa in ett obegränsat antal redigeringsåtgärder som du kan ångra." +#~ msgid "" +#~ "To position the cursor on a specific line in the current file, perform " +#~ "the following steps:" +#~ msgstr "" +#~ "Genomför följande steg för att positionera markören på en specifik rad i " +#~ "den aktuella filen:" +#~ msgid "" +#~ "Choose SearchGo to Line to display the Go to Line " +#~ "dialog." +#~ msgstr "" +#~ "Välj SökGå till rad för att visa dialogrutan Gå till rad." +#~ msgid "" +#~ "Click Go to Line. The application moves the cursor " +#~ "to the line number that you specify." +#~ msgstr "" +#~ "Klicka på Gå till rad. Programmet flyttar markören " +#~ "till radnumret som du angav." +#~ msgid "" +#~ "To close the Go to Line dialog, click " +#~ "Close." +#~ msgstr "" +#~ "För att stänga dialogrutan Gå till rad, klicka på " +#~ "Stäng." +#~ msgid "" +#~ "When the application starts, the files that you specify are displayed in " +#~ "the gedit window." +#~ msgstr "" +#~ "När programmet startar kommer de filer som du anger att visas i " +#~ "gedit-fönstret." +#~ msgid "The application opens the file located at the URI in read-only mode." +#~ msgstr "Programmet öppnar filen som finns på uri:n i skrivskyddat läge." +#~ msgid "" +#~ "A current limitation in gedit prevents the " +#~ "last line of a document from being used as a modeline." +#~ msgstr "" +#~ "En begränsning för närvarande i gedit " +#~ "förhindrar att den sista raden i ett dokument kan användas som en " +#~ "lägesrad." + diff --git a/help/th/th.po b/help/th/th.po new file mode 100755 index 00000000..cb458a78 --- /dev/null +++ b/help/th/th.po @@ -0,0 +1,3777 @@ +# Thai translation of gedit help. +# Copyright (C) 2008-2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the gedit package. +# +# Tosaporn Kijosoth , 2008. +# Kittiphong Meesawat , 2010. +msgid "" +msgstr "" +"Project-Id-Version: gedit\n" +"POT-Creation-Date: 2010-04-22 09:31+0000\n" +"PO-Revision-Date: 2010-04-27 15:40+0700\n" +"Last-Translator: Kittiphong Meesawat \n" +"Language-Team: Thai \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Thai\n" +"X-Poedit-Country: THAILAND\n" +"X-Poedit-SourceCharset: utf-8\n" +"Plural-Forms: nplurals=1; plural=0;\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"อนุญาตให้ทำซ้ำ เผยแพร่ และ/หรือ ดัดแปลงเอกสารนี้ได้ ภายใต้เงื่อนไขของ GNU Free " +"Documentation License (GFDL) รุ่น 1.1 หรือรุ่นถัดมารุ่นใดๆ ที่เผยแพร่โดยมูลนิธิซอฟต์แวร์เสรี " +"(Free Software Foundation) โดยไม่มี \"หัวข้อห้ามเปลี่ยน\" (Invariant Sections), ไม่มี " +"\"ข้อความปกหน้า\" (Front-Cover Texts) และไม่มี \"ข้อความปกหลัง\" (Back-Cover " +"Texts) คุณสามารถอ่านสำเนาของ GFDL ได้จาก ลิงก์นี้ หรือในแฟ้ม COPYING-DOCS ที่เผยแพร่มาพร้อมกับคู่มือนี้" + +#: 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 "" +"คู่มือนี้ เป็นส่วนหนึ่งของชุดคู่มือ MATE ที่เผยแพร่ภายใต้ GFDL " +"ถ้าคุณต้องการเผยแพร่คู่มือนี้แยกต่างหากจากชุด " +"คุณสามารถทำได้โดยเพิ่มสำเนาของสัญญาอนุญาตไปกับคู่มือ ตามที่อธิบายในข้อ 6 ของสัญญาอนุญาต" + +#: 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 "" +"มีชื่อหลายชื่อที่บริษัทต่างๆ ใช้แยกความแตกต่างของผลิตภัณฑ์และบริการของตนจากบริษัทอื่น " +"และอ้างเป็นเครื่องหมายการค้า ที่ใดก็ตามที่ชื่อเหล่านั้นปรากฏในเอกสารของ MATE " +"และสมาชิกโครงการเอกสาร MATE ได้รับทราบเกี่ยวกับเครื่องหมายการค้าเหล่านั้น " +"ชื่อเหล่านั้นจะเขียนด้วยตัวพิมพ์ใหญ่ หรือขึ้นต้นด้วยตัวพิมพ์ใหญ่" + +#: 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 " +"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/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: " +"" +msgstr "" +"เอกสารนี้และฉบับดัดแปลงของเอกสารนี้ เผยแพร่ภายใต้เงื่อนไขของ GNU FREE DOCUMENTATION " +"LICENSE พร้อมด้วยความเข้าใจในสิ่งต่อไปนี้: " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "คู่มือ Gedit" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2550" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "โครงการเอกสาร MATE" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2545" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2546" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2547" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "ซัน ไมโครซิสเท็มส์" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2543" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "เพิ่มตารางปุ่มลัด" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "ทีมเอกสารระบบเดสก์ท็อปจาวาของซัน" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek ให้ข้อมูลเกี่ยวกับโปรแกรม gedit รุ่นก่อนหน้า" + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "กิติกรรมประกาศ" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George ให้ข้อมูลเกี่ยวกับปลั๊กอินต่าง ๆ" + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit รุ่น 1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "คู่มือ gedit รุ่น 2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "มีนาคม 2545" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "ทีมเอกสาร MATE ของซัน" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "คู่มือ gedit รุ่น 2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "มิถุนายน 2545" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "คู่มือ gedit รุ่น 2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "สิงหาคม 2545" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "คู่มือ gedit รุ่น 2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "ตุลาคม 2545" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "คู่มือ gedit รุ่น 2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "มกราคม 2546" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "คู่มือ gedit รุ่น 2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "มีนาคม 2546" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "คู่มือ gedit รุ่น 2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "กันยายน 2546" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "คู่มือ gedit รุ่น 2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "มีนาคม 2547" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "คู่มือ gedit รุ่น 2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "มิถุนายน 2549" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "คู่มือ gedit รุ่น 2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "ทีมเอกสาร MATE" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "คู่มือนี้อธิบาย gedit รุ่น 2.16" + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "ข้อเสนอแนะ" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"หากพบปัญหาหรือมีข้อเสนอแนะสำหรับโปรแกรม gedit " +"หรือเกี่ยวกับคู่มือนี้ กรุณาแจ้งให้เราทราบ ตามขั้นตอนใน หน้าเสนอแนะ MATE" + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit เป็นเครื่องมือแก้ไขข้อความสำหรับเดสก์ท็อป MATE โดยมาพร้อมกับความสามารถพื้น ๆ " +"แต่เปี่ยมประสิทธิภาพ เช่น การพิมพ์ การตรวจตัวสะกด การหาและแทนที่ และการเน้นไวยากรณ์ " +"และยังสามารถติดตั้งคุณสมบัติพิเศษเพิ่มเติมได้จากปลั๊กอินต่าง ๆ" + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "เครื่องมือแก้ไขข้อความ" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "เกริ่นนำ" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "โปรแกรม gedit ช่วยคุณสร้างและแก้ไขแฟ้มข้อความ" + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"เป้าหมายของ gedit " +"คือการเป็นเครื่องมือแก้ไขข้อความที่เรียบง่ายและใช้ง่าย ผู้ใช้สามารถเพิ่มความสามารถพิเศษได้ด้วย " +"ปลั๊กอิน ต่าง ๆ " +"ซึ่งช่วยให้ดำเนินการเกี่ยวกับการแก้ไขข้อความได้หลายหลาย" + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "เริ่มต้นใช้งาน" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "การเรียกใช้ gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"คุณสามารถเปิดใช้งาน gedit ได้ด้วยวิธีต่าง ๆ ดังต่อไปนี้:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "เมนู โปรแกรม" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"เลือก เครื่องใช้ไม้สอยเครื่องมือแก้ไขข้อความ" + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "บรรทัดคำสั่ง" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "เรียกคำสั่งต่อไปนี้: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"โดยปกติแล้ว เมื่อคุณเปิดแฟ้มข้อความในโปรแกรมจัดการแฟ้ม gedit " +"ก็จะเริ่มทำงานและแสดงแฟ้มข้อความดังกล่าว" + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "หน้าต่าง gedit" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "เมื่อคุณเปิด gedit จะปรากฏหน้าต่างต่อไปนี้:" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "หน้าต่าง gedit" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "แสดงหน้าต่างหลักของ gedit" + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "หน้าต่าง gedit มีองค์ประกอบดังต่อไปนี้:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "แถบเมนู" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"เมนูในแถบเมนูบรรจุคำสั่งทั้งหมดที่จำเป็นสำหรับการทำงานกับแฟ้มต่าง ๆ ใน gedit" + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "แถบเครื่องมือ" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "แถบเครื่องมือบรรจุคำสั่งบางส่วนจากคำสั่งที่คุณสามารถเข้าถึงได้จากแถบเมนู" + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "พื้นที่แสดงผล" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "พื้นที่แสดงผลจะแสดงข้อความจากแฟ้มที่คุณกำลังแก้ไขอยู่" + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "แถบสถานะ" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"แถบสถานะแสดงข้อมูลเกี่ยวกับกิจกรรมที่ gedit กำลังทำอยู่ " +"และรายละเอียดเกี่ยวกับรายการเมนู นอกจากนี้แถบสถานะยังแสดงข้อมูลต่อไปนี้:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "ตำแหน่งเคอร์เซอร์: เลขบรรทัดและคอลัมน์ที่เคอร์เซอร์วางอยู่" + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"โหมดแก้ไข: หากเครื่องมือแก้ไขข้อความอยู่ในโหมดแทรก แถบสถานะจะแสดงข้อความ " +"แทรก หากเครื่องมือแก้ไขอยู่ในโหมดเขียนทับ แถบสถานะจะแสดงข้อความ " +"ทับ โหมดของเครื่องมือแก้ไขเปลี่ยนแปลงได้โดยกดปุ่ม Insert" + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "แถบข้าง" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "แถบด้านข้างแสดงรายชื่อเอกสารที่เปิดอยู่และข้อมูลอื่น ๆ ตามแต่ปลั๊กอินที่เปิดใช้งาน" + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"โดยปกติ แถบข้างจะไม่แสดง หากต้องการแสดง ให้เลือก มุมมองแถบข้าง" + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "แถบด้านล่าง" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"แถบด้านล่างมีไว้สำหรับให้เครื่องมือเขียนโปรแกรม เช่น ปลั๊กอิน คอนโซลไพธอน ใช้แสดงผลลัพธ์" + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"โดยปกติ แถบด้านล่างจะไม่แสดง หากต้องการแสดง ให้เลือก มุมมองแถบด้านล่าง" + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"เมื่อคุณคลิกขวาในหน้าต่าง gedit จะปรากฏเมนูผุดขึ้น " +"เมนูที่ผุดขึ้นนี้จะบรรจุคำสั่งเกี่ยวกับการแก้ไขข้อความที่ใช้บ่อย" + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"เช่นเดียวกับโปรแกรมอื่น ๆ ของ MATE การกระทำต่าง ๆ ใน gedit สามารถสั่งได้หลายทาง: ด้วยเมนู ด้วยแถบเครื่องมือ หรือด้วยปุ่มลัด " +"รายชื่อปุ่มลัดที่ใช้ร่วมกันในทุกโปรแกรมจะรวบรวมไว้ใน คู่มือผู้ใช้" + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "การเรียก gedit จากบรรทัดคำสั่ง" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"คุณสามารถเรียกใช้ gedit ได้จากบรรทัดคำสั่ง " +"โดยสามารถเปิดเพียงหนึ่งแฟ้มหรือจะเปิดหลายแฟ้มก็ได้ สำหรับการเปิดหลายแฟ้มจากบรรทัดคำสั่ง " +"ให้พิมพ์คำสั่งดังนี้แล้วกด Enter:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "อีกทางหนึ่ง คุณสามารถระบุ URI แทนชื่อแฟ้มก็ได้" + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"ดูข้อมูลเพิ่มเติมเกี่ยวกับการเรียกใช้ gedit " +"จากบรรดทัดคำสั่งได้ที่หน้า manual ของยูนิกซ์สำหรับ gedit ที่ gedit1" + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "การทำงานกับแฟ้ม" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "การสร้างเอกสารใหม่" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"การสร้างเอกสารใหม่ทำได้โดยเลือก แฟ้มใหม่ " +"โปรแกรมจะแสดงเอกสารเปล่าขึ้นมาใหม่หน้าต่าง gedit" + +#: C/gedit.xml:346(title) C/gedit.xml:1589(title) +msgid "Opening a File" +msgstr "การเปิดแฟ้ม" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"การเปิดแฟ้ม ทำได้โดยเลือก แฟ้มเปิด เพื่อแสดงกล่องโต้ตอบ เปิดแฟ้ม จากนั้น " +"เลือกแฟ้มที่ต้องการเปิดแล้วคลิก เปิด เนื้อหาแฟ้มจะปรากฏในหน้าต่าง " +"gedit" + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "แสดงไอคอนของเมนูแฟ้มล่าสุด" + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"โปรแกรมจะเก็บบันทึกรายชื่อแฟ้ม 5 แฟ้มล่าสุดที่คุณเปิดแก้ และจะแสดงแฟ้มเหล่านี้ในเมนู " +"แฟ้ม นอกจากนี้คุณยังสามารถคลิกที่ไอคอน " +" บนแถบเครื่องมือเพื่อแสดงรายชื่อแฟ้มล่าสุดดังกล่าวได้ด้วย" + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"ใน gedit คุณสามารถเปิดแฟ้มได้พร้อม ๆ กันหลายแฟ้ม " +"โปรแกรมจะเพิ่มแท็บสำหรับแต่ละแฟ้มลงในหน้าต่าง ดูรายละเอียดเพิ่มเติมได้ที่ " + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "การบันทึกแฟ้ม" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "คุณสามารถบันทึกแฟ้มได้ด้วยวิธีต่าง ๆ ดังนี้" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"การบันทึกแฟ้มที่มีอยู่แล้ว ทำได้โดยเลือก แฟ้มบันทึก" + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"การบันทึกแฟ้มที่สร้างขึ้นใหม่หรือบันทึกแฟ้มที่มีอยู่เดิมในชื่อใหม่ ทำได้โดยเลือก " +"แฟ้มบันทึกเป็น กรอกชื่อแฟ้มที่ต้องการลงในกล่องโต้ตอบ บันทึกเป็น " +"จากนั้นกดปุ่ม บันทึก" + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"การบันทึกแฟ้มทุกแฟ้มที่เปิดอยู่ใน gedit ทำได้โดยเลือก " +"เอกสารบันทึกทุกเอกสาร" + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"การปิดแฟ้มทุกแฟ้มที่เปิดอยู่ใน gedit ทำได้โดยเลือก " +"เอกสารปิดทั้งหมด" + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "การเปิดแฟ้มจาก URI" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "การเปิดแฟ้มจาก Uniform Resource Identifier (URI) ทำได้ตามขั้นตอนต่อไปนี้:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"เลือก แฟ้มเปิดตำแหน่งแฟ้ม เพื่อแสดงกล่องโต้ตอบ เปิดตำแหน่งแฟ้ม" + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "กรอก URI ของแฟ้มที่คุณต้องการเปิด" + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "ใช้รายชื่อดึงลง รหัสอักขระ เลือกรหัสอักขระที่เหมาะสม" + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "คลิก เปิด" + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"ชนิดของ URI ที่ใช้ได้ มี http:, " +"ftp:, file: และอื่น ๆ ที่รองรับโดย " +"mate-vfs" + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"แฟ้มเอกสารจาก URI บางชนิดจะสามารถเปิดได้แบบอ่านอย่างเดียวเท่านั้น การเปลี่ยนแปลงใด ๆ " +"จะต้องบันทึกลงในตำแหน่งอื่น HTTP จะให้อ่านแฟ้มอย่างเดียวเท่านั้น แฟ้มที่เปิดจาก FTP " +"จะเป็นแบบอ่านอย่างเดียวเท่านั้น เพราะเซิร์ฟเวอร์ FTP ต่าง ๆ " +"ไม่ได้รองรับการบันทึกแฟ้มระยะไกลได้ถูกต้องไปเสียทั้งหมด" + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "การใช้แท็บ" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"เมื่อเปิดแฟ้มมากกว่าหนึ่งแฟ้ม gedit จะแสดง " +"แท็บ สำหรับแต่ละเอกสารที่ด้านบนของพื้นที่แสดงผล " +"เมื่อต้องการสลับไปที่เอกสารอื่น ให้คลิกที่แท็บของเอกสารนั้น ๆ" + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"เมื่อต้องการย้ายเอกสารไปที่หน้าต่างอื่นของ gedit " +"ให้ลากแท็บของแฟ้มนั้น ๆ ไปยังหน้าต่างที่คุณต้องการ" + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"เมื่อต้องการย้ายเอกสารออกไปเป็นหน้าต่างใหม่ของ gedit " +"ทำได้โดยลากแท็บเอกสารไปยังพื้นโต๊ะ หรือเลือก เอกสารย้ายไปหน้าต่างใหม่" + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "การทำงานกับข้อความ" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "การแก้ไขข้อความ" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "คุณสามารถแก้ไขข้อความในแฟ้มได้ด้วยวิธีต่าง ๆ ดังนี้:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"พิมพ์ข้อความใหม่จากแป้นพิมพ์ เคอร์เซอร์แทรก " +"ที่กะพริบอยู่นั้นจะระบุตำแหน่งที่ข้อความจะปรากฏขึ้น หากต้องการเปลี่ยนตำแหน่ง " +"ให้ใช้ปุ่มลูกศรบนแป้นพิมพ์หรือคลิกด้วยเมาส์" + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"การคัดลอกข้อความที่เลือกไว้ไปที่คลิปบอร์ด ทำได้โดยเลือก แก้ไขคัดลอก" + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"การลบข้อความที่เลือกออกจากแฟ้ม พร้อมกับย้ายข้อความไปยังคลิปบอร์ด ทำได้โดยเลือก " +"แก้ไขตัด" + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"การลบข้อความที่เลือกออกจากแฟ้มอย่างถาวร ทำได้โดยเลือก แก้ไขลบ" + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"การแทรกเนื้อหาจากคลิปบอร์ดไปยังตำแหน่งของเคอร์เซอร์ ทำได้โดยเลือก " +"แก้ไขแปะ คุณจะต้องตัดหรือคัดลอกข้อความก่อน ไม่ว่าจะจาก gedit หรือจากโปรแกรมอื่น " +"ก่อนที่คุณจะสามารถแปะข้อความดังกล่าวลงในแฟ้มได้" + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"การเลือกข้อความทั้งหมดในแฟ้ม ทำได้โดยเลือก แก้ไขเลือกทั้งหมด" + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "การเรียกคืนและทำซ้ำการเปลี่ยนแปลง" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"การเรียกคืนการเปลี่ยนแปลงที่คุณทำไว้ ทำได้โดยเลือก แก้ไขเรียกคืน " +"หากต้องการยกเลิกการเรียกคืนนี้ ก็เลือก แก้ไขทำซ้ำ" + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "การค้นหาและแทนที่" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"ใน gedit การค้นหาข้อความทำได้สองวิธีด้วยกัน " +"คุณสามารถใช้กล่องโต้ตอบ หา เพื่อค้นหาข้อความที่เจาะจง หรือจะใช้ " +"ค้นหาแบบคืบหน้าทีละส่วน เพื่อเน้นข้อความที่ตรงกันขณะที่คุณพิมพ์ก็ได้" + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "การค้นหาข้อความ" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "การค้นหาข้อความในแฟ้ม ทำได้ตามขั้นตอนต่อไปนี้:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"เลือก ค้นหาหา เพื่อแสดงกล่องโต้ตอบ หา" + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"คลิก หา เพื่อค้นหาข้อความโดยเริ่มจากตำแหน่งปัจจุบัน ถ้า " +"gedit หาข้อความพบ โปรแกรมจะเลือกข้อความแห่งแรกที่ปรากฏ " +"และจะเน้นแห่งที่เหลือไว้" + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"การหาคำเดิมที่ปรากฏถัดไป ทำได้โดยคลิก หา หรือเลือก " +"ค้นหาหาต่อ การหาคำเดิมที่ปรากฏก่อนหน้า ทำได้โดยเลือก ค้นหาหาก่อนหน้า" + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"หลังจากที่คุณปิดกล่องโต้ตอบ หา ไปแล้ว " +"คุณยังสามารถหาและเลือกคำค้นที่ปรากฏในตำแหน่งอื่น ๆ ได้ โดยเลือก " +"ค้นหาหาต่อ และ ค้นหาหาก่อนหน้า" + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"การยกเลิกการเน้นข้อความ ทำได้โดยเลือก ค้นหาเลิกเน้นคำค้น" + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "การค้นหาแบบคืบหน้าทีละส่วน" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"การค้นหาแบบคืบหน้าทีละส่วนจะเน้นข้อความในเอกสารที่ตรงกับคำค้นไปพร้อม ๆ " +"กับที่คุณพิมพ์คำค้นแต่ละตัวอักษร " +"(ซึ่งคล้ายกับความสามารถในการค้นหาคำในเว็บเบราว์เซอร์หลายโปรแกรม)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"การเริ่มค้นหาแบบคืบหน้าทีละส่วน ทำได้โดยเลือก ค้นหาค้นหาแบบคืบหน้าทีละส่วน " +"กล่องค้นหาจะปรากฏขึ้นที่ด้านบนของพื้นที่แสดงผล" + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"เมื่อเริ่มพิมพ์ ข้อความในเอกสารที่ตรงกับคำค้นจะถูกเน้น และข้อความแรกที่ตรงกับคำค้นจะถูกเลือกด้วย" + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"การเลื่อนการเลือกข้อความไปยังตำแหน่งปรากฏถัดไปทั้งที่ยังเปิดกล่องค้นหาแบบคืบหน้าทีละส่วนอยู่ " +"ทำได้โดยกดปุ่ม CtrlG " +"ถ้าจะกลับไปยังตำแหน่งปรากฏก่อนหน้า ก็กดปุ่ม CtrlShiftG" + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "การแทนที่ข้อความ" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "การค้นหาข้อความในแฟ้มและแทนที่ด้วยอีกข้อความหนึ่ง ทำได้โดยขั้นตอนต่อไปนี้:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"เลือก ค้นหาแทนที่ เพื่อแสดงกล่องโต้ตอบ แทนที่" + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"พิมพ์ข้อความที่คุณต้องการใช้แทนข้อความที่คุณค้นหาลงในช่องข้อมูล แทนที่ด้วย" + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"การตรวจสอบข้อความที่ตรงกับคำค้นในแต่ละที่ที่ปรากฏก่อนจะแทนที่ ทำได้โดยคลิก หา หาก gedit พบข้อความที่ตรงกับคำค้น " +"ก็จะเลือกข้อความนั้น ๆ ให้ ถ้าต้องการแทนที่ข้อความที่เลือกอยู่นั้น ก็คลิก แทนที่ ถ้าต้องการหาข้อความที่ตรงกับคำค้นในตำแหน่งถัดไป ก็คลิก หา อีกครั้ง" + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"หากต้องการแทนที่ข้อความทั้งหมดในเอกสารที่ตรงกับคำค้น ให้คลิก แทนที่ทั้งหมด" + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "ตัวเลือกการค้นหาและแทนที่" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"กล่องโต้ตอบ หา และกล่องโต้ตอบ แทนที่ " +"มีตัวเลือกที่เหมือนกันดังต่อไปนี้:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"เลือกตัวเลือก ตัวพิมพ์ใหญ่-เล็กตรงกัน " +"ถ้าต้องการหาข้อความที่ตรงกับคำค้นแบบตัวพิมพ์ใหญ่-เล็กตรงกันเท่านั้น ตัวอย่างเช่น เมื่อเลือกตัวเลือก " +"ตัวพิมพ์ใหญ่-เล็กตรงกัน ข้อความ \"TEXT\" จะถือว่าไม่ตรงกันกับ \"text" +"\"" + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "อักขระพิเศษ" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "" + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "" + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "" + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "" + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "" + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "การพิมพ์" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1175(guilabel) +msgid "Line Numbers" +msgstr "เลขบรรทัด" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1168(guilabel) C/gedit.xml:1685(para) +msgid "Text Wrapping" +msgstr "" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "ตัวเนื้อความ" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "" + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "เลขบรรทัด" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "" + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "" + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "" + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "" + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "" + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "" + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "" + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "แฟ้ม" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "" + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "" + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "" + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "" + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "" + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "" + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "" + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "" + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "" + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1207(guilabel) +msgid "Tabs" +msgstr "" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1016(para) C/gedit.xml:1044(para) C/gedit.xml:1091(para) +#: C/gedit.xml:1134(para) +msgid "Shortcut Key" +msgstr "" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1018(para) C/gedit.xml:1046(para) C/gedit.xml:1093(para) +#: C/gedit.xml:1136(para) +msgid "Command" +msgstr "" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "" + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "" + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "" + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "" + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "" + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "" + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "" + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "" + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "" + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "" + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "" + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "" + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "" + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "" + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "" + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1406(guimenu) +#: C/gedit.xml:1412(guimenu) C/gedit.xml:1418(guimenu) +#: C/gedit.xml:1424(guimenu) +msgid "Edit" +msgstr "" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "" + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "" + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "" + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "" + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "" + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "" + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "" + +#. ============= Panes ======================= +#: C/gedit.xml:1007(bridgehead) +msgid "Panes" +msgstr "" + +#: C/gedit.xml:1008(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "" + +#: C/gedit.xml:1023(para) +msgid "F9" +msgstr "" + +#: C/gedit.xml:1024(para) +msgid "Show/hide the side pane." +msgstr "" + +#: C/gedit.xml:1027(para) +msgid "Ctrl + F9" +msgstr "" + +#: C/gedit.xml:1028(para) +msgid "Show/hide the bottom pane." +msgstr "" + +#. ============= Search ======================= +#: C/gedit.xml:1035(bridgehead) +msgid "Search" +msgstr "" + +#: C/gedit.xml:1036(para) +msgid "Shortcuts for searching:" +msgstr "" + +#: C/gedit.xml:1051(para) +msgid "Ctrl + F" +msgstr "" + +#: C/gedit.xml:1052(para) +msgid "Find a string." +msgstr "" + +#: C/gedit.xml:1055(para) +msgid "Ctrl + G" +msgstr "" + +#: C/gedit.xml:1056(para) +msgid "Find the next instance of the string." +msgstr "" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + Shift + G" +msgstr "" + +#: C/gedit.xml:1060(para) +msgid "Find the previous instance of the string." +msgstr "" + +#: C/gedit.xml:1063(para) +msgid "Ctrl + K" +msgstr "" + +#: C/gedit.xml:1064(para) +msgid "Interactive search." +msgstr "" + +#: C/gedit.xml:1067(para) +msgid "Ctrl + H" +msgstr "" + +#: C/gedit.xml:1068(para) +msgid "Search and replace." +msgstr "" + +#: C/gedit.xml:1071(para) +msgid "Ctrl + Shift + K" +msgstr "" + +#: C/gedit.xml:1072(para) +msgid "Clear highlight." +msgstr "" + +#: C/gedit.xml:1075(para) +msgid "Ctrl + I" +msgstr "" + +#: C/gedit.xml:1076(para) +msgid "Goto line." +msgstr "" + +#. ============= Tools ======================= +#: C/gedit.xml:1082(bridgehead) +msgid "Tools" +msgstr "" + +#: C/gedit.xml:1083(para) +msgid "Shortcuts for tools:" +msgstr "" + +#: C/gedit.xml:1098(para) +msgid "Shift + F7" +msgstr "" + +#: C/gedit.xml:1099(para) +msgid "Check spelling (with plugin)." +msgstr "" + +#: C/gedit.xml:1102(para) +msgid "Alt + F12" +msgstr "" + +#: C/gedit.xml:1103(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "" + +#: C/gedit.xml:1106(para) +msgid "Ctrl + T" +msgstr "" + +#: C/gedit.xml:1107(para) +msgid "Indent (with plugin)." +msgstr "" + +#: C/gedit.xml:1110(para) +msgid "Ctrl + Shift + T" +msgstr "" + +#: C/gedit.xml:1111(para) +msgid "Remove Indent (with plugin)." +msgstr "" + +#: C/gedit.xml:1114(para) +msgid "F8" +msgstr "" + +#: C/gedit.xml:1115(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "" + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + D" +msgstr "" + +#: C/gedit.xml:1119(para) +msgid "Directory listing (with plugin)." +msgstr "" + +#. ============= Help ======================= +#: C/gedit.xml:1125(bridgehead) +msgid "Help" +msgstr "" + +#: C/gedit.xml:1126(para) +msgid "Shortcuts for help:" +msgstr "" + +#: C/gedit.xml:1141(para) +msgid "F1" +msgstr "" + +#: C/gedit.xml:1142(para) +msgid "Open gedit's user manual." +msgstr "" + +#: C/gedit.xml:1154(title) +msgid "Preferences" +msgstr "การปรับแต่ง" + +#: C/gedit.xml:1156(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" + +#: C/gedit.xml:1165(title) +msgid "View Preferences" +msgstr "" + +#: C/gedit.xml:1170(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" + +#: C/gedit.xml:1171(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" + +#: C/gedit.xml:1177(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" + +#: C/gedit.xml:1181(guilabel) +msgid "Current Line" +msgstr "บรรทัดปัจจุบัน" + +#: C/gedit.xml:1183(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" + +#: C/gedit.xml:1187(guilabel) +msgid "Right Margin" +msgstr "" + +#: C/gedit.xml:1189(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" + +#: C/gedit.xml:1190(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" + +#: C/gedit.xml:1194(guilabel) +msgid "Bracket Matching" +msgstr "" + +#: C/gedit.xml:1196(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" + +#: C/gedit.xml:1204(title) +msgid "Editor Preferences" +msgstr "" + +#: C/gedit.xml:1209(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" + +#: C/gedit.xml:1210(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" + +#: C/gedit.xml:1214(guilabel) +msgid "Auto Indentation" +msgstr "" + +#: C/gedit.xml:1216(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" + +#: C/gedit.xml:1220(guilabel) +msgid "File Saving" +msgstr "" + +#: C/gedit.xml:1222(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" + +#: C/gedit.xml:1223(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" + +#: C/gedit.xml:1230(title) +msgid "Font & Colors Preferences" +msgstr "การปรับแต่งแบบอักษรและสี" + +#: C/gedit.xml:1233(guilabel) +msgid "Font" +msgstr "แบบอักษร" + +#: C/gedit.xml:1235(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" + +#: C/gedit.xml:1236(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" + +#: C/gedit.xml:1240(guilabel) +msgid "Color Scheme" +msgstr "" + +#: C/gedit.xml:1242(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" + +#: C/gedit.xml:1245(guilabel) +msgid "Classic" +msgstr "" + +#: C/gedit.xml:1247(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "" + +#: C/gedit.xml:1251(guilabel) +msgid "Cobalt" +msgstr "" + +#: C/gedit.xml:1253(para) +msgid "Blue based color scheme." +msgstr "" + +#: C/gedit.xml:1257(guilabel) +msgid "Kate" +msgstr "" + +#: C/gedit.xml:1259(para) +msgid "Color scheme used in the Kate text editor." +msgstr "" + +#: C/gedit.xml:1263(guilabel) +msgid "Oblivion" +msgstr "" + +#: C/gedit.xml:1265(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "" + +#: C/gedit.xml:1269(guilabel) +msgid "Tango" +msgstr "" + +#: C/gedit.xml:1271(para) +msgid "Color scheme using the Tango color scheme." +msgstr "" + +#: C/gedit.xml:1275(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" + +#: C/gedit.xml:1276(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "" + +#: C/gedit.xml:1283(title) +msgid "Plugins Preferences" +msgstr "" + +#: C/gedit.xml:1284(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" + +#: C/gedit.xml:1288(title) +msgid "Enabling a Plugin" +msgstr "" + +#: C/gedit.xml:1289(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" + +#: C/gedit.xml:1292(para) C/gedit.xml:1313(para) C/gedit.xml:1635(para) +msgid "" +"Choose EditPreferences." +msgstr "" + +#: C/gedit.xml:1295(para) C/gedit.xml:1316(para) C/gedit.xml:1638(para) +msgid "Select the Plugins tab." +msgstr "" + +#: C/gedit.xml:1298(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "" + +#: C/gedit.xml:1301(para) C/gedit.xml:1322(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" + +#: C/gedit.xml:1308(title) +msgid "Disabling a Plugin" +msgstr "" + +#: C/gedit.xml:1309(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" + +#: C/gedit.xml:1310(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "" + +#: C/gedit.xml:1319(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "" + +#: C/gedit.xml:1331(title) +msgid "Plugins" +msgstr "" + +#: C/gedit.xml:1333(title) +msgid "Working with Plugins" +msgstr "" + +#: C/gedit.xml:1334(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" + +#: C/gedit.xml:1336(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" + +#: C/gedit.xml:1337(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" + +#: C/gedit.xml:1338(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "" + +#: C/gedit.xml:1344(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" + +#: C/gedit.xml:1347(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" + +#: C/gedit.xml:1350(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" + +#: C/gedit.xml:1353(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" + +#: C/gedit.xml:1356(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" + +#: C/gedit.xml:1359(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" + +#: C/gedit.xml:1362(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" + +#: C/gedit.xml:1365(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" + +#: C/gedit.xml:1368(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" + +#: C/gedit.xml:1371(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" + +#: C/gedit.xml:1374(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" + +#: C/gedit.xml:1377(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" + +#: C/gedit.xml:1381(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" + +#: C/gedit.xml:1385(title) +msgid "Change Case Plugin" +msgstr "" + +#: C/gedit.xml:1386(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" + +#: C/gedit.xml:1387(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" + +#: C/gedit.xml:1397(para) +msgid "Menu Item" +msgstr "" + +#: C/gedit.xml:1399(para) +msgid "Action" +msgstr "" + +#: C/gedit.xml:1401(para) +msgid "Example" +msgstr "" + +#: C/gedit.xml:1407(guisubmenu) C/gedit.xml:1413(guisubmenu) +#: C/gedit.xml:1419(guisubmenu) C/gedit.xml:1425(guisubmenu) +msgid "Change Case" +msgstr "" + +#: C/gedit.xml:1407(guimenuitem) +msgid "All Upper Case" +msgstr "" + +#: C/gedit.xml:1408(para) +msgid "Change each character to uppercase." +msgstr "" + +#: C/gedit.xml:1409(para) +msgid "This text becomes THIS TEXT" +msgstr "" + +#: C/gedit.xml:1413(guimenuitem) +msgid "All Lower Case" +msgstr "" + +#: C/gedit.xml:1414(para) +msgid "Change each character to lowercase." +msgstr "" + +#: C/gedit.xml:1415(para) +msgid "This Text becomes this text" +msgstr "" + +#: C/gedit.xml:1419(guimenuitem) +msgid "Invert Case" +msgstr "" + +#: C/gedit.xml:1420(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" + +#: C/gedit.xml:1421(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" + +#: C/gedit.xml:1425(guimenuitem) +msgid "Title Case" +msgstr "" + +#: C/gedit.xml:1426(para) +msgid "Change the first character of each word to uppercase." +msgstr "" + +#: C/gedit.xml:1427(para) +msgid "this text becomes This Text" +msgstr "" + +#: C/gedit.xml:1436(title) +msgid "Document Statistics Plugin" +msgstr "" + +#: C/gedit.xml:1437(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" + +#: C/gedit.xml:1439(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" + +#: C/gedit.xml:1442(para) +msgid "Number of lines in the current document." +msgstr "" + +#: C/gedit.xml:1445(para) +msgid "Number of words in the current document." +msgstr "" + +#: C/gedit.xml:1448(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "" + +#: C/gedit.xml:1451(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "" + +#: C/gedit.xml:1454(para) +msgid "Number of bytes in the current document." +msgstr "" + +#: C/gedit.xml:1459(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" + +#: C/gedit.xml:1466(title) +msgid "External Tools Plugin" +msgstr "" + +#: C/gedit.xml:1467(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" + +#: C/gedit.xml:1468(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" + +#: C/gedit.xml:1471(title) +msgid "Built-in Commands" +msgstr "" + +#: C/gedit.xml:1472(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "" + +#: C/gedit.xml:1474(term) +msgid "Build" +msgstr "" + +#: C/gedit.xml:1476(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" + +#: C/gedit.xml:1479(term) +msgid "Directory Listing" +msgstr "" + +#: C/gedit.xml:1481(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "" + +#: C/gedit.xml:1484(term) +msgid "Environment Variables" +msgstr "" + +#: C/gedit.xml:1486(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "" + +#: C/gedit.xml:1489(term) +msgid "Grep" +msgstr "" + +#: C/gedit.xml:1491(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" + +#: C/gedit.xml:1494(term) +msgid "Remove Trailing Spaces" +msgstr "" + +#: C/gedit.xml:1496(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "" + +#: C/gedit.xml:1503(title) +msgid "Defining a Command" +msgstr "" + +#: C/gedit.xml:1504(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" + +#: C/gedit.xml:1505(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" + +#: C/gedit.xml:1507(term) +msgid "Description" +msgstr "" + +#: C/gedit.xml:1509(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "" + +#: C/gedit.xml:1512(term) +msgid "Accelerator" +msgstr "" + +#: C/gedit.xml:1514(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "" + +#: C/gedit.xml:1517(term) +msgid "Commands" +msgstr "" + +#: C/gedit.xml:1519(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" + +#: C/gedit.xml:1522(term) +msgid "Input" +msgstr "" + +#: C/gedit.xml:1524(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" + +#: C/gedit.xml:1527(term) +msgid "Output" +msgstr "" + +#: C/gedit.xml:1529(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" + +#: C/gedit.xml:1532(term) +msgid "Applicability" +msgstr "" + +#: C/gedit.xml:1534(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" + +#: C/gedit.xml:1542(title) +msgid "Editing and Removing Tools" +msgstr "" + +#: C/gedit.xml:1543(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "" + +#: C/gedit.xml:1544(para) +msgid "To rename a tool, click it again in the list." +msgstr "" + +#: C/gedit.xml:1545(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" + +#: C/gedit.xml:1546(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" + +#: C/gedit.xml:1550(title) +msgid "Variables" +msgstr "" + +#: C/gedit.xml:1551(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" + +#: C/gedit.xml:1554(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "" + +#: C/gedit.xml:1557(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "" + +#: C/gedit.xml:1560(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "" + +#: C/gedit.xml:1563(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "" + +#: C/gedit.xml:1566(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "" + +#: C/gedit.xml:1569(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "" + +#: C/gedit.xml:1572(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "" + +#: C/gedit.xml:1579(title) +msgid "File Browser Plugin" +msgstr "" + +#: C/gedit.xml:1580(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" + +#: C/gedit.xml:1581(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" + +#: C/gedit.xml:1583(title) +msgid "Browsing your Files" +msgstr "" + +#: C/gedit.xml:1584(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" + +#: C/gedit.xml:1585(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" + +#: C/gedit.xml:1586(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" + +#: C/gedit.xml:1590(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" + +#: C/gedit.xml:1593(title) +msgid "Creating Files and Folders" +msgstr "" + +#: C/gedit.xml:1594(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" + +#: C/gedit.xml:1595(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" + +#: C/gedit.xml:1600(title) +msgid "Indent Lines Plugin" +msgstr "" + +#: C/gedit.xml:1601(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" + +#: C/gedit.xml:1602(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "" + +#: C/gedit.xml:1604(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" + +#: C/gedit.xml:1609(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" + +#: C/gedit.xml:1612(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" + +#: C/gedit.xml:1617(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" + +#: C/gedit.xml:1622(title) +msgid "Insert Date/Time Plugin" +msgstr "" + +#: C/gedit.xml:1623(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" + +#: C/gedit.xml:1625(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" + +#: C/gedit.xml:1626(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" + +#: C/gedit.xml:1627(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" + +#: C/gedit.xml:1632(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "" + +#: C/gedit.xml:1633(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "" + +#: C/gedit.xml:1641(para) +msgid "Select the Insert Date/Time plugin." +msgstr "" + +#: C/gedit.xml:1644(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" + +#: C/gedit.xml:1647(para) +msgid "Select one of the options, as follows:" +msgstr "" + +#: C/gedit.xml:1649(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" + +#: C/gedit.xml:1652(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" + +#: C/gedit.xml:1655(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" + +#: C/gedit.xml:1660(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" + +#: C/gedit.xml:1663(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" + +#: C/gedit.xml:1670(title) +msgid "Modelines Plugin" +msgstr "" + +#: C/gedit.xml:1671(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" + +#: C/gedit.xml:1672(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "" + +#: C/gedit.xml:1673(para) +msgid "You can set the following preferences with modelines:" +msgstr "" + +#: C/gedit.xml:1676(para) +msgid "Tab width" +msgstr "" + +#: C/gedit.xml:1679(para) +msgid "Indent width" +msgstr "" + +#: C/gedit.xml:1682(para) +msgid "Insert spaces instead of tabs" +msgstr "" + +#: C/gedit.xml:1688(para) +msgid "Right margin width" +msgstr "" + +#: C/gedit.xml:1692(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" + +#: C/gedit.xml:1695(title) +msgid "Emacs Modelines" +msgstr "" + +#: C/gedit.xml:1696(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "" + +#: C/gedit.xml:1697(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" + +#: C/gedit.xml:1700(title) +msgid "Kate Modelines" +msgstr "" + +#: C/gedit.xml:1701(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "" + +#: C/gedit.xml:1702(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" + +#: C/gedit.xml:1705(title) +msgid "Vim Modelines" +msgstr "" + +#: C/gedit.xml:1706(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "" + +#: C/gedit.xml:1707(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" + +#: C/gedit.xml:1712(title) +msgid "Python Console Plugin" +msgstr "" + +#: C/gedit.xml:1713(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" + +#: C/gedit.xml:1714(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" + +#: C/gedit.xml:1718(title) +msgid "Snippets Plugin" +msgstr "" + +#: C/gedit.xml:1719(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" + +#: C/gedit.xml:1720(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" + +#: C/gedit.xml:1721(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" + +#: C/gedit.xml:1724(title) +msgid "Inserting Snippets" +msgstr "" + +#: C/gedit.xml:1725(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" + +#: C/gedit.xml:1726(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" + +#: C/gedit.xml:1730(title) +msgid "Adding Snippets" +msgstr "" + +#: C/gedit.xml:1731(para) +msgid "To create a new snippet, do the following:" +msgstr "" + +#: C/gedit.xml:1734(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" + +#: C/gedit.xml:1737(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" + +#: C/gedit.xml:1740(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" + +#: C/gedit.xml:1743(para) +msgid "Enter the following information for the new snippet:" +msgstr "" + +#: C/gedit.xml:1745(term) +msgid "Name" +msgstr "" + +#: C/gedit.xml:1747(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" + +#: C/gedit.xml:1750(term) +msgid "Snippet text" +msgstr "" + +#: C/gedit.xml:1752(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" + +#: C/gedit.xml:1753(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" + +#: C/gedit.xml:1756(term) +msgid "Tab Trigger" +msgstr "" + +#: C/gedit.xml:1758(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" + +#: C/gedit.xml:1759(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" + +#: C/gedit.xml:1762(term) +msgid "Shortcut key" +msgstr "" + +#: C/gedit.xml:1764(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "" + +#: C/gedit.xml:1773(title) +msgid "Editing and Removing Snippets" +msgstr "" + +#: C/gedit.xml:1774(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "" + +#: C/gedit.xml:1775(para) +msgid "To rename a snippet, click it again in the list." +msgstr "" + +#: C/gedit.xml:1776(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" + +#: C/gedit.xml:1777(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" + +#: C/gedit.xml:1781(title) +msgid "Snippet Substitutions" +msgstr "" + +#: C/gedit.xml:1782(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" + +#: C/gedit.xml:1786(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "" + +#: C/gedit.xml:1788(term) +msgid "Tab placeholders" +msgstr "" + +#: C/gedit.xml:1790(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" + +#: C/gedit.xml:1791(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" + +#: C/gedit.xml:1792(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" + +#: C/gedit.xml:1793(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" + +#: C/gedit.xml:1794(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" + +#: C/gedit.xml:1797(term) +msgid "Mirror placeholders" +msgstr "" + +#: C/gedit.xml:1799(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" + +#: C/gedit.xml:1802(term) +msgid "End placeholder" +msgstr "" + +#: C/gedit.xml:1804(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" + +#: C/gedit.xml:1807(term) +msgid "Environmental variables" +msgstr "" + +#: C/gedit.xml:1809(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" + +#: C/gedit.xml:1811(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "" + +#: C/gedit.xml:1813(para) +msgid "The currently selected text." +msgstr "" + +#: C/gedit.xml:1816(term) +msgid "$GEDIT_FILENAME" +msgstr "" + +#: C/gedit.xml:1818(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" + +#: C/gedit.xml:1821(term) +msgid "$GEDIT_BASENAME" +msgstr "" + +#: C/gedit.xml:1823(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "" + +#: C/gedit.xml:1826(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "" + +#: C/gedit.xml:1828(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "" + +#: C/gedit.xml:1836(term) +msgid "Shell placeholders" +msgstr "" + +#: C/gedit.xml:1838(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" + +#: C/gedit.xml:1839(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" + +#: C/gedit.xml:1842(term) +msgid "Python placeholders" +msgstr "" + +#: C/gedit.xml:1844(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" + +#: C/gedit.xml:1845(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" + +#: C/gedit.xml:1846(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" + +#: C/gedit.xml:1855(title) +msgid "Sort Plugin" +msgstr "" + +#: C/gedit.xml:1856(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" + +#: C/gedit.xml:1857(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" + +#: C/gedit.xml:1860(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "" + +#: C/gedit.xml:1863(para) +msgid "Select the lines of text you want to sort." +msgstr "" + +#: C/gedit.xml:1865(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" + +#: C/gedit.xml:1868(para) +msgid "Choose the options you want for the sort:" +msgstr "" + +#: C/gedit.xml:1871(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" + +#: C/gedit.xml:1874(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" + +#: C/gedit.xml:1877(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" + +#: C/gedit.xml:1880(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" + +#: C/gedit.xml:1885(para) +msgid "To perform the sort operation, click Sort." +msgstr "" + +#: C/gedit.xml:1892(title) +msgid "Spell Checker Plugin" +msgstr "" + +#: C/gedit.xml:1893(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" + +#: C/gedit.xml:1895(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" + +#: C/gedit.xml:1898(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" + +#: C/gedit.xml:1899(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" + +#: C/gedit.xml:1902(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" + +#: C/gedit.xml:1905(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" + +#: C/gedit.xml:1908(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" + +#: C/gedit.xml:1913(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" + +#: C/gedit.xml:1915(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" + +#: C/gedit.xml:1917(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" + +#: C/gedit.xml:1920(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" + +#: C/gedit.xml:1923(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" + +#: C/gedit.xml:1926(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" + +#: C/gedit.xml:1929(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" + +#: C/gedit.xml:1932(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" + +#: C/gedit.xml:1935(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" + +#: C/gedit.xml:1938(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" + +#: C/gedit.xml:1947(title) +msgid "Tag List Plugin" +msgstr "" + +#: C/gedit.xml:1948(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" + +#: C/gedit.xml:1949(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "" + +#: C/gedit.xml:1951(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" + +#: C/gedit.xml:1955(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" + +#: C/gedit.xml:1957(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" + +#: C/gedit.xml:1960(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "" + +#: C/gedit.xml:1963(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" + +#: C/gedit.xml:1965(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" + +#: C/gedit.xml:1968(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Tosaporn Kijosoth , 2008" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_bold.png'; " +#~ "md5=950264711a3f0808bef134fa94b0a582" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_italic.png'; " +#~ "md5=feb9817676516ae91b9f6b1cd36a5eca" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_underline.png'; " +#~ "md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#~ msgid "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" +#~ msgstr "" +#~ "@@image: 'figures/gedit_format_strikethrough.png'; " +#~ "md5=cf962f5d9df721c1f4f4cef2780915ed" + +#~ msgid "Colors" +#~ msgstr "สี" + +#~ msgid "Syntax Highlighting Preferences" +#~ msgstr "การปรับแต่งการเน้นไวยากรณ์" + +#~ msgid "Enable syntax highlighting" +#~ msgstr "เปิดใช้งานการเน้นไวยากรณ์" + +#~ msgid "Highlight mode" +#~ msgstr "โหมดเน้น" + +#~ msgid "Format buttons" +#~ msgstr "ปุ่มรูปแบบข้อความ" + +#~ msgid "Button" +#~ msgstr "ปุ่ม" + +#~ msgid "Format" +#~ msgstr "รูปแบบ" diff --git a/help/uk/figures/gedit_window.png b/help/uk/figures/gedit_window.png new file mode 100755 index 00000000..e5b56e71 Binary files /dev/null and b/help/uk/figures/gedit_window.png differ diff --git a/help/uk/uk.po b/help/uk/uk.po new file mode 100755 index 00000000..abac3226 --- /dev/null +++ b/help/uk/uk.po @@ -0,0 +1,4362 @@ +# Ukrainian translation to gedit manual. +# Copyright © Free Software Foundation, 2007 +# This file is distributed under the same license as the gedit package. +# Maxim Dziumanenko , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit manual\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-14 10:25+0200\n" +"PO-Revision-Date: 2007-03-14 10:28+0300\n" +"Last-Translator: Maxim V. Dziumanenko \n" +"Language-Team: Ukrainian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"Дозволяється копіювати, розповсюджувати та/або змінювати цей документ на " +"умовах ліцензії GNU Free Documentation License (GFDL), версії 1.1 або будь-" +"якої старшої версії, що опублікована Free Software Foundation без " +"інваріантних розділів, тексту титульної сторінки, та тексту фінальної " +"сторінки. Копію GFDL можна знайти за " +"адресою або у файлі COPYING-DOCS, що постачається з цією довідкою." + +#: ../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 "" +"Ця довідка є частиною збірки документації з MATE, що постачається на умовах " +"ліцензії GFDL. Якщо ви бажаєте розповсюджувати цю довідку окремо від збірки, " +"можете це зробити додавши до довідки копію ліцензії, як описано у пункті 6 " +"ліцензії." + +#: ../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 "" +"Більшість назв, що використовуються компаніями для розповсюдження їх " +"продуктів та послуг є торговими марками. Якщо такі назви зустрічаються у " +"документації з MATE та учасникам проекту документування MATE відомо, що " +"вони є торговими марками, тоді ці назви пишуться великими літерами або " +"починаються з великої літери." + +#: ../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 " +"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 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/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: " +"" +msgstr "" +"ДОКУМЕНТ ТА ЗМІНЕНІ ВЕРСІЇ ЦЬОГО ДОКУМЕНТУ ПОСТАЧАЮТЬСЯ НА УМОВАХ ВІЛЬНОЇ " +"ЛІЦЕНЗІЇ ДЛЯ ДОКУМЕНТАЦІЇ GNU З ПОДАЛЬШИМ РОЗУМІННЯМ ЩО: " + +#. 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/gedit.xml:262(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:342(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#. 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/gedit.xml:1266(None) +msgid "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" +msgstr "" +"@@image: 'figures/gedit_format_bold.png'; " +"md5=950264711a3f0808bef134fa94b0a582" + +#. 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/gedit.xml:1285(None) +msgid "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" +msgstr "" +"@@image: 'figures/gedit_format_italic.png'; " +"md5=feb9817676516ae91b9f6b1cd36a5eca" + +#. 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/gedit.xml:1303(None) +msgid "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" +msgstr "" +"@@image: 'figures/gedit_format_underline.png'; " +"md5=58f5848d81ea3f0656ccce82ba32ec9c" + +#. 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/gedit.xml:1321(None) +msgid "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" +msgstr "" +"@@image: 'figures/gedit_format_strikethrough.png'; " +"md5=cf962f5d9df721c1f4f4cef2780915ed" + +#: ../C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Посібник з gedit" + +#: ../C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: ../C/gedit.xml:26(holder) ../C/gedit.xml:45(publishername) +#: ../C/gedit.xml:52(firstname) ../C/gedit.xml:75(orgname) +#: ../C/gedit.xml:116(para) ../C/gedit.xml:124(para) ../C/gedit.xml:132(para) +#: ../C/gedit.xml:140(para) ../C/gedit.xml:148(para) ../C/gedit.xml:156(para) +#: ../C/gedit.xml:164(para) ../C/gedit.xml:172(para) ../C/gedit.xml:180(para) +#: ../C/gedit.xml:188(para) ../C/gedit.xml:196(para) +msgid "MATE Documentation Project" +msgstr "Проект документування MATE" + +#: ../C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: ../C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: ../C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: ../C/gedit.xml:31(holder) ../C/gedit.xml:67(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: ../C/gedit.xml:33(year) ../C/gedit.xml:112(date) +msgid "2000" +msgstr "2000" + +#: ../C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: ../C/gedit.xml:55(orgname) +msgid "MATE" +msgstr "MATE" + +#: ../C/gedit.xml:59(firstname) +msgid "Hal" +msgstr "Hal" + +#: ../C/gedit.xml:60(surname) +msgid "Canary" +msgstr "Canary" + +#: ../C/gedit.xml:61(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "Пов'язати комбінації клавіш з командами" + +#: ../C/gedit.xml:64(firstname) ../C/gedit.xml:187(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun команда документування Java Desktop System" + +#: ../C/gedit.xml:68(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: ../C/gedit.xml:72(firstname) +msgid "Eric" +msgstr "Eric" + +#: ../C/gedit.xml:73(surname) +msgid "Baudais" +msgstr "Baudais" + +#: ../C/gedit.xml:76(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: ../C/gedit.xml:80(firstname) +msgid "Baris" +msgstr "Baris" + +#: ../C/gedit.xml:81(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek готував інформацію про ранні версії gedit." + +#: ../C/gedit.xml:82(contrib) ../C/gedit.xml:87(contrib) +msgid "Acknowledgements" +msgstr "Подяки" + +#: ../C/gedit.xml:85(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: ../C/gedit.xml:86(surname) +msgid "George provided information about plugins." +msgstr "George надав інформацію про модулі." + +#: ../C/gedit.xml:111(revnumber) +msgid "gedit V1.0" +msgstr "gedit версії 1.0" + +#: ../C/gedit.xml:114(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: ../C/gedit.xml:120(revnumber) +msgid "gedit Manual V2.0" +msgstr "Довідка з програми Gedit версії 2.0" + +#: ../C/gedit.xml:121(date) +msgid "March 2002" +msgstr "Березень 2002" + +#: ../C/gedit.xml:123(para) ../C/gedit.xml:131(para) ../C/gedit.xml:139(para) +#: ../C/gedit.xml:147(para) ../C/gedit.xml:155(para) ../C/gedit.xml:163(para) +#: ../C/gedit.xml:171(para) ../C/gedit.xml:179(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun команда документування MATE" + +#: ../C/gedit.xml:128(revnumber) +msgid "gedit Manual V2.1" +msgstr "Довідка з програми Gedit версії 2.1" + +#: ../C/gedit.xml:129(date) +msgid "June 2002" +msgstr "Червень 2002" + +#: ../C/gedit.xml:136(revnumber) +msgid "gedit Manual V2.2" +msgstr "Довідка з програми Gedit версії 2.2" + +#: ../C/gedit.xml:137(date) +msgid "August 2002" +msgstr "Серпень 2002" + +#: ../C/gedit.xml:144(revnumber) +msgid "gedit Manual V2.3" +msgstr "Довідка з програми Gedit версії 2.3" + +#: ../C/gedit.xml:145(date) +msgid "September 2002" +msgstr "Вересень 2002" + +#: ../C/gedit.xml:152(revnumber) +msgid "gedit Manual V2.4" +msgstr "Довідка з програми Gedit версії 2.4" + +#: ../C/gedit.xml:153(date) +msgid "January 2003" +msgstr "Січень 2003" + +#: ../C/gedit.xml:160(revnumber) +msgid "gedit Manual V2.5" +msgstr "Довідка з програми Gedit версії 2.5" + +#: ../C/gedit.xml:161(date) +msgid "March 2003" +msgstr "Березень 2003" + +#: ../C/gedit.xml:168(revnumber) +msgid "gedit Manual V2.6" +msgstr "Довідка з програми Gedit версії 2.6" + +#: ../C/gedit.xml:169(date) +msgid "September 2003" +msgstr "Вересень 2003" + +#: ../C/gedit.xml:176(revnumber) +msgid "gedit Manual V2.7" +msgstr "Довідка з програми Gedit версії 2.7" + +#: ../C/gedit.xml:177(date) +msgid "March 2004" +msgstr "Березень 2004" + +#: ../C/gedit.xml:184(revnumber) +msgid "gedit Manual V2.8" +msgstr "Довідка з програми Gedit версії 2.8" + +#: ../C/gedit.xml:192(revnumber) +msgid "gedit Manual V2.9" +msgstr "Довідка з програми Gedit версії 2.9" + +#: ../C/gedit.xml:195(para) +msgid "MATE Documentation Team" +msgstr "Команда документування MATE" + +#: ../C/gedit.xml:200(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "У довідці описується програма Gedit версії 2.16" + +#: ../C/gedit.xml:203(title) +msgid "Feedback" +msgstr "Зворотній зв'язок" + +#: ../C/gedit.xml:204(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"Щоб сповістити про помилку або внести пропозицію відносно програми gedit або цієї довідки, дотримуйтесь інструкцій на сторінці Зворотний зв'язок з MATE." + +#: ../C/gedit.xml:209(para) +msgid "gedit is the MATE text editor." +msgstr "gedit - це текстовий редактор для MATE." + +#: ../C/gedit.xml:212(primary) +msgid "gedit" +msgstr "gedit" + +#: ../C/gedit.xml:213(primary) +msgid "text editor" +msgstr "Текстовий редактор" + +#: ../C/gedit.xml:218(title) +msgid "Introduction" +msgstr "Вступ" + +#: ../C/gedit.xml:223(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "" +"Програма gedit дозволяє створювати та редагувати текстові файли." + +#: ../C/gedit.xml:225(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"gedit — має бути простим та легким у " +"використанні текстовим редактором. Багато можливостей можуть бути включені " +"модулями, що вирішують ряд завдань з редагування " +"тексту." + +#: ../C/gedit.xml:229(title) +msgid "Getting Started" +msgstr "Початок роботи" + +#: ../C/gedit.xml:233(title) +msgid "Starting gedit" +msgstr "Запуск gedit" + +#: ../C/gedit.xml:234(para) +msgid "You can start gedit in the following ways:" +msgstr "" +"gedit можна запустити наступними способами:" + +#: ../C/gedit.xml:237(term) +msgid "Applications menu" +msgstr "Меню Програми" + +#: ../C/gedit.xml:239(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"Виберіть СтандартніТекстовий " +"редактор." + +#: ../C/gedit.xml:243(term) +msgid "Command line" +msgstr "Командний рядок" + +#: ../C/gedit.xml:245(para) +msgid "Execute the following command: gedit" +msgstr "Виконайте команду: gedit" + +#: ../C/gedit.xml:249(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"Якщо ви відкриваєте текстовий документ у файловому менеджері, " +"gedit запускається автоматично та відображає файл, що відкривається." + +#: ../C/gedit.xml:254(title) +msgid "The gedit Window" +msgstr "Вікно gedit" + +#: ../C/gedit.xml:255(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "" +"Після запуску програми gedit " +"відкривається наступне вікно:" + +#: ../C/gedit.xml:258(title) +msgid "gedit Window" +msgstr "Вікно gedit" + +#: ../C/gedit.xml:264(phrase) +msgid "Shows gedit main window." +msgstr "Показано вікно програми gedit." + +#: ../C/gedit.xml:270(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"Вікно gedit містить наступні елементи:" + +#: ../C/gedit.xml:273(term) +msgid "Menubar" +msgstr "Панель меню" + +#: ../C/gedit.xml:275(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "Меню містить усі необхідні команди для роботи з файлами у gedit." + +#: ../C/gedit.xml:278(term) +msgid "Toolbar" +msgstr "Панель інструментів" + +#: ../C/gedit.xml:280(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "Панель меню містить деякі команди, доступні у меню." + +#: ../C/gedit.xml:283(term) +msgid "Display area" +msgstr "Область відображення" + +#: ../C/gedit.xml:285(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "У області перегляду відображається текст, що редагується." + +#: ../C/gedit.xml:288(term) +msgid "Statusbar" +msgstr "Рядок стану" + +#: ../C/gedit.xml:290(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"Рядок стану показує поточний стан gedit, а також контекстну інформацію про пункти меню. Інформація про " +"стан може бути такою:" + +#: ../C/gedit.xml:293(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "Позиція курсору: номер рядка та номер стовпчика, де знаходиться курсор." + +#: ../C/gedit.xml:296(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"Режим редагування: Якщо редактор знаходиться у режимі вставки, у рядку " +"статусу відображається ВСТ. Якщо редактор у режимі заміни, " +"рядок відображає ЗАМ. Натискання клавіші " +"Insert змінює режим редагування." + +#: ../C/gedit.xml:301(term) +msgid "Side Pane" +msgstr "Бічна панель" + +#: ../C/gedit.xml:303(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "" +"У бічній панелі відображається список відкритих документів та інша " +"інформація, що залежить від завантажених модулів." + +#: ../C/gedit.xml:304(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"Типово бічна панель не відображається. Щоб її побачити, виберіть " +"ВиглядБічна панель." + +#: ../C/gedit.xml:307(term) +msgid "Bottom Pane" +msgstr "Нижня панель" + +#: ../C/gedit.xml:309(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output. It is not shown by default." +msgstr "" +"Нижня панель використовується для виводу інформації інструментами програмування, такими як модуль " +"Python Console. Типово не відображається." + +#: ../C/gedit.xml:313(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"При клацанні правою кнопкою миші у вікні gedit, " +"з'являється контекстне меню. Воно містить загальні команди редагування " +"тексту." + +#: ../C/gedit.xml:315(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"Подібно до інших програм MATE, більшість дій у gedit можна виконати кількома способами: через меню, через панель " +"інструментів або за допомогою гарячих клавіш. Спільні для усіх програм гарячі " +"клавіші перелічені у Посібнику користувача." + +#: ../C/gedit.xml:320(title) +msgid "Running gedit from a Command Line" +msgstr "Запуск gedit з командного рядка" + +#: ../C/gedit.xml:321(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"Можна запустить gedit з командного рядка з одним або кількома файлами. " +"Для відкривання кількох файлів введіть наступну команду та натисніть клавішу " +"Enter:" + +#: ../C/gedit.xml:322(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "файл1.txt файл2.txt файл3.txt" + +#: ../C/gedit.xml:322(command) +msgid "gedit " +msgstr "gedit " + +#: ../C/gedit.xml:323(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "Або ж замість назви файлу можна вказати URI." + +#: ../C/gedit.xml:324(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"Додаткову інформацію про запуск gedit з " +"командного рядка дивіться man-сторінці для gedit, gedit1." + +#: ../C/gedit.xml:329(title) +msgid "Working with Files" +msgstr "Робота с файлами" + +#: ../C/gedit.xml:333(title) +msgid "Creating a New Document" +msgstr "Створення нового документу" + +#: ../C/gedit.xml:334(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"Щоб створити новий документ виберіть ФайлСтворити. У вікні gedit з'явиться новий порожній " +"документ." + +#: ../C/gedit.xml:339(title) ../C/gedit.xml:1667(title) +msgid "Opening a File" +msgstr "Відкриття файлу" + +#: ../C/gedit.xml:340(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"Щоб відкрити файл виберіть ФайлВідкрити. У діалозі вибору " +"файлів знайдіть потрібний файл та натисніть кнопку Відкрити. Файл " +"відобразиться у вікні gedit." + +#: ../C/gedit.xml:342(phrase) +msgid "Shows Recent Files menu icon." +msgstr "Значок списку недавно недавніх файлів." + +#: ../C/gedit.xml:342(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"Програма запам'ятовує 5 останніх відкритих файлів та відображає їх назви " +"у вигляді пунктів у меню Файл. " +"Також для відображення списку недавніх файлів можна натиснути " +"значок на панелі інструментів." + +#: ../C/gedit.xml:344(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"У gedit можна відкривати декілька файлів. " +"Програма додає вкладку для кожного відкритого файлу у вікно. Також дивіться " +"." + +#: ../C/gedit.xml:350(title) +msgid "Saving a File" +msgstr "Збереження файлу" + +#: ../C/gedit.xml:351(para) +msgid "You can save files in the following ways:" +msgstr "Зберігати файли можна кількома способами:" + +#: ../C/gedit.xml:353(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"Щоб зберегти зміни у існуючому файлі, виберіть " +"ФайлЗберегти." + +#: ../C/gedit.xml:355(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"Для запису нового файлу або запису існуючого файлу з новою назвою, " +"виберіть ФайлЗберегти як. Введіть назву файлу у діалоговому вікні " +"Зберегти як та натисніть кнопку Зберегти." + +#: ../C/gedit.xml:357(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"Щоб зберегти всі відкриті наразі файли, треба вибрати " +"ДокументиЗберегти все." + +#: ../C/gedit.xml:360(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"Для закриття усіх відкритих у gedit файлів, " +"виберіть ДокументиЗакрити все." + +#: ../C/gedit.xml:365(title) +msgid "Opening a File from a URI" +msgstr "Відкриття файлу через URI" + +#: ../C/gedit.xml:366(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "" +"Щоб відкрити файл через Uniform Resource Identifier (URI), виконайте " +"наступне:" + +#: ../C/gedit.xml:369(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"Виберіть ФайлВідкрити адресу, з'явиться діалогове вікно Відкрити " +"адресу." + +#: ../C/gedit.xml:372(para) +msgid "Enter the URI of the file that you want to open." +msgstr "Введіть URI файлу, який хочете відкрити." + +#: ../C/gedit.xml:375(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "" +"Виберіть відповідне кодування у розкривному списку Кодування символів." + +#: ../C/gedit.xml:378(para) +msgid "Click Open." +msgstr "Натисніть кнопку Відкрити." + +#: ../C/gedit.xml:381(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"Інший спосіб - ввести у командному рядку: gedit URI, де URI — URI " +"файлу, що відкривається, а потім натиснути клавішу Enter. " +"URI може містити http:, " +"ftp:, file: та усі протоколи, що підтримуються mate-vfs." + +#: ../C/gedit.xml:382(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"Файли з деякими типами URI відкриваються лише для читання, для внесення будь-яких змін треба " +"зберегти їх у інше місце. Протокол HTTP дозволяє лише читати файли. " +"Файли відкриті через протокол FTP доступні лише для читання, оскільки не усі сервери FTP " +"можуть коректно підтримують збереження віддалених файлів." + +#: ../C/gedit.xml:383(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"Збереження файлів на сервер FTP можна увімкнути у Редакторі конфігурації, " +"встановивши ключ /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes. Але подібний режим використання може призводити до помилок." + +#: ../C/gedit.xml:388(title) +msgid "Working With Tabs" +msgstr "Робота з вкладками" + +#: ../C/gedit.xml:390(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"Коли відкрито більше одного файлу, gedit " +"відображає у верхній частині області перегляду вкладки " +"для кожного документу. Перейти до іншого документу можна натиснувши на " +"відповідній вкладці." + +#: ../C/gedit.xml:391(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"Для переміщення документу в інше вікно gedit, " +"перетягніть відповідну вкладку." + +#: ../C/gedit.xml:392(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"Для переміщення документу у нове вікно gedit, " +"перетягніть вкладку на робочий стіл або виберіть " +"ДокументиПеремістити у нове " +"вікно." + +#: ../C/gedit.xml:398(title) +msgid "Working with Text" +msgstr "Робота с текстом" + +#: ../C/gedit.xml:402(title) +msgid "Editing Text" +msgstr "Редагування тексту" + +#: ../C/gedit.xml:403(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "При редагуванні тексту можна використовувати наступні прийоми:" + +#: ../C/gedit.xml:405(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"Ввести новий текст з клавіатури. Курсор " +"показує місце вводу тексту, змінити яке можна за допомогою клавіш " +"керування курсором або клацання мишею." + +#: ../C/gedit.xml:407(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"Щоб скопіювати виділений текст у буфер обміну, виберіть " +"ПравкаКопіювати." + +#: ../C/gedit.xml:409(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"Для видалення виділеного тексту з файлу та переміщення у буфер обміну, " +"виберіть ПравкаВирізати." + +#: ../C/gedit.xml:411(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"Щоб видалити виділений текст, виберіть ПравкаВидалити." + +#: ../C/gedit.xml:413(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"Для вставки змісту буферу обміну у позицію курсору, треба вибрати " +"ПравкаВставити. Перед вставкою тексту треба перемістити або скопіювати " +"потрібний текст у буфер обміну у gedit або іншій програмі." + +#: ../C/gedit.xml:415(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"Для виділення всього тексту у файлі, треба вибрати " +"ПравкаВиділити все." + +#: ../C/gedit.xml:421(title) +msgid "Undoing and Redoing Changes" +msgstr "Повернення та повтор змін" + +#: ../C/gedit.xml:422(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo. The number of previous edits that you can undo is " +"determined by the Undo limit setting in the " +"Editor tabbed section of the Preferences dialog: see ." +msgstr "" +"Для повернення зроблених змін, треба вибрати ПравкаВернути. Щоб повторити ці " +"зміни, виберіть ПравкаПовторити. Кількість повернень змін регулюється на вкладці " +"Редактор діалогового вікна Параметри: дивіться ." + +#: ../C/gedit.xml:427(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "Встановлення курсору на певний рядок" + +#: ../C/gedit.xml:428(para) +msgid "" +"To position the cursor on a specific line in the current file, perform the " +"following steps:" +msgstr "" +"Для встановлення курсору на певний рядок у поточному файлі, виконайте наступне:" + +#: ../C/gedit.xml:430(para) +msgid "" +"Choose SearchGo to Line to display the Go to Line " +"dialog." +msgstr "" +"Виберіть ЗнайтиПерейти на рядок. Відкриється діалогове вікно." + +#: ../C/gedit.xml:432(para) +msgid "" +"Type the number of the line that you want to move the cursor to in the " +"Line number field." +msgstr "" +"Введіть номер потрібного рядка у полі Номер рядка." + +#: ../C/gedit.xml:434(para) +msgid "" +"Click Go to Line. The application moves the cursor to " +"the line number that you specify." +msgstr "" +"Натисніть Перейти до рядка. Програма перемістить " +"курсор на вказаний рядок." + +#: ../C/gedit.xml:436(para) +msgid "" +"To close the Go to Line dialog, click Close." +msgstr "Для закриття діалогу, натисніть Закрити." + +#: ../C/gedit.xml:443(title) +msgid "Finding and Replacing" +msgstr "Пошук та заміна" + +#: ../C/gedit.xml:445(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"У gedit є два способи пошуку тексту. " +"Для пошуку текстового блоку можна використовувати діалог Знайти, " +"або блока скористатись Інтерактивним пошуком для " +"виділення кольором тексту під час вводу." + +#: ../C/gedit.xml:450(title) +msgid "Finding Text" +msgstr "Пошук тексту" + +#: ../C/gedit.xml:451(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "Щоб знайти у файлі рядок тексту, виконайте наступні дії:" + +#: ../C/gedit.xml:453(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"Виберіть ЗнайтиЗнайти, відкриється діалогове вікно Знайти" + +#: ../C/gedit.xml:455(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"У полі Знайти введіть рядок, що шукається. Можна використовувати " +"спеціальні символи, такі як, символ нового рядка чи табуляції: дивіться ." + +#: ../C/gedit.xml:457(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"Для пошуку першого збігу після поточної позиції курсору натисніть Знайти. " +"Якщо рядок знайдений, програма виділяє перший збіг. Інші рядки, що збігаються, будуть виділені кольором." + +#: ../C/gedit.xml:459(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"Для переходу до наступного збігу, ще раз натисніть Знайти, " +"або виберіть ЗнайтиЗнайти далі. Для переходу до попереднього збігу тексту, " +"виберіть ЗнайтиЗнайти попередній." + +#: ../C/gedit.xml:462(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"Після закриття діалогу Знайти, ви досі можете " +"переміщуватись між знайденими збігами тексту використовуючи " +"ЗнайтиЗнайти далі та знайтиЗнайти попередній." + +#: ../C/gedit.xml:463(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"Щоб прибирати виділення кольором, виберіть ЗнайтиОчистити виділення кольором." + +#: ../C/gedit.xml:467(title) +msgid "Incremental Search" +msgstr "Інтерактивний пошук" + +#: ../C/gedit.xml:469(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"Інтерактивний пошук виділяє кольором текст під час вводу, буква за " +"буквою. (Подібну функцію підтримують деякі веб-переглядачі.)" + +#: ../C/gedit.xml:470(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"Щоб почати інтерактивний пошук, виберіть ЗнайтиІнтерактивний пошук. У верхній частині " +"області перегляду з'явиться вікно пошуку." + +#: ../C/gedit.xml:471(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "" +"Почніть ввід, та текст у документі буде виділений кольором. Виділиться перший збіг " +"від позиції курсору." + +#: ../C/gedit.xml:472(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"Щоб подовжити виділення до наступного збігу не закриваючи вікно інтерактивного пошуку, " +"натисніть CtrlG. Щоб перетйти до попереднього збігу натисніть CtrlShiftG." + +#: ../C/gedit.xml:473(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "" +"Також для переходу між місцями збігу можна використовувати клавіші зі стрілками вгору та вниз, або колесо миші." + +#: ../C/gedit.xml:478(title) +msgid "Replacing Text" +msgstr "Заміна тексту" + +#: ../C/gedit.xml:480(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"Для пошуку та заміни рядка у файлі іншим рядком, виконайте наступні " +"дії:" + +#: ../C/gedit.xml:482(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"Виберіть ЗнайтиЗамінити для відкривання діалогового вікна Замінити." + +#: ../C/gedit.xml:484(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"Введіть рядок, що замінюється у полі Знайти. Можна " +"використовувати та спеціальні символи, як наприклад, символ нового рядка чи " +"символ табуляції: дивіться ." + +#: ../C/gedit.xml:485(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"У полі Замінити на введіть рядок на який треба замінити." + +#: ../C/gedit.xml:489(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"Для перегляду кожного збігу рядка перед його заміною, натисніть " +"Знайти. Якщо збіг є, gedit виділить його. Для заміни натисніть Замінити. Щоб перейти до наступного збігу, ще раз натисніть " +"Знайти." + +#: ../C/gedit.xml:490(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "" +"Для негайної заміни збігів, натисніть Замінити все." + +#: ../C/gedit.xml:495(title) +msgid "Find and Replace Options" +msgstr "Параметри пошуку та заміни" + +#: ../C/gedit.xml:496(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"Діалог Знайти, як і діалог Замінити, мають наступні параметри:" + +#: ../C/gedit.xml:498(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"Виберіть Збігається регістр, щоб шукати текст у тому " +"регістрі, у якому ви його ввели. Наприклад, у цьому випадку «ТЕКСТ» не те ж " +"саме, що й «текст»." + +#: ../C/gedit.xml:500(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"Виберіть Збігається ціле слово, щоб ввести пошук лише " +"за повними словами. Так, наприклад, «текст» не те ж саме що й «текстура»." + +#: ../C/gedit.xml:502(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "" +"Виберіть Шукати назад, для пошуку у зворотному напрямку, до початку документу." + +#: ../C/gedit.xml:504(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"При увімкненому Досягнувши кінця, починати спочатку, пошук " +"йде від поточної позиції курсору до кінця, потім, від початку документу до " +"поточної позиції." + +#: ../C/gedit.xml:511(title) +msgid "Special Characters" +msgstr "Спеціальні символи" + +#: ../C/gedit.xml:512(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "" +"У текст для пошуку можна включати наступні escape-послідовності, " +"що замінюють спеціальні символи:" + +#: ../C/gedit.xml:515(literal) +msgid "\\n" +msgstr "\\n" + +#: ../C/gedit.xml:517(para) +msgid "Specifies a new line." +msgstr "Символ нового рядка." + +#: ../C/gedit.xml:521(literal) +msgid "\\t" +msgstr "\\t" + +#: ../C/gedit.xml:523(para) +msgid "Specifies a tab character." +msgstr "Символ табуляції." + +#: ../C/gedit.xml:527(literal) +msgid "\\r" +msgstr "\\r" + +#: ../C/gedit.xml:529(para) +msgid "Specifies a carriage return." +msgstr "Символ переведення каретки." + +#: ../C/gedit.xml:537(title) +msgid "Printing" +msgstr "Друк" + +#: ../C/gedit.xml:541(title) +msgid "Setting the Page Options" +msgstr "Встановлення параметрів сторінки" + +#: ../C/gedit.xml:543(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"Для налаштовування параметрів сторінки треба вибрати ФайлПараметри сторінки. На " +"екрані відкриється діалогове вікно Параметри сторінки." + +#: ../C/gedit.xml:545(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "Це діалогове вікно дозволяє налаштувати наступні параметри друку:" + +#: ../C/gedit.xml:548(title) +msgid "General Tabbed Section" +msgstr "Вкладка «Загальне»" + +#: ../C/gedit.xml:550(guilabel) +msgid "Print syntax highlighting" +msgstr "Друкувати виділення синтаксису" + +#: ../C/gedit.xml:552(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"Відмітьте цей параметр, для друку з виділенням синтаксису кольором. Також дивіться ." + +#: ../C/gedit.xml:555(guilabel) +msgid "Print page headers" +msgstr "Друкувати заголовки сторінок" + +#: ../C/gedit.xml:557(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "" +"Параметр вмикає заголовок для кожної сторінки. Заголовок не налаштовується." + +#: ../C/gedit.xml:560(guilabel) ../C/gedit.xml:1162(guilabel) +msgid "Line Numbers" +msgstr "Нумерація рядків" + +#: ../C/gedit.xml:563(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "" +"Параметр Друкувати номери рядків вмикає друк номерів " +"рядків." + +#: ../C/gedit.xml:564(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"Використовуючи поле Нумерувати кожен ... рядок, " +"можна вказати як часто будуть друкуватись номери. Наприклад, кожні 5 чи " +"кожні 10 рядків." + +#: ../C/gedit.xml:567(guilabel) ../C/gedit.xml:1155(guilabel) +#: ../C/gedit.xml:1759(para) +msgid "Text Wrapping" +msgstr "Перенос тексту" + +#: ../C/gedit.xml:569(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"Параметр Увімкнути перенос тексту дозволяє " +"переносити довгі рядки на інший рядок. Не впливає на нумерацію рядків." + +#: ../C/gedit.xml:571(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"Параметр Не розривати слово між рядками дозволяє " +"переносити текст цілими словами." + +#: ../C/gedit.xml:579(title) +msgid "Fonts" +msgstr "Шрифти" + +#: ../C/gedit.xml:581(guilabel) +msgid "Body" +msgstr "Текст" + +#: ../C/gedit.xml:583(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "Натискаючи цю кнопку можна обрати шрифт для друку тексту." + +#: ../C/gedit.xml:586(guilabel) +msgid "Line numbers" +msgstr "Номери рядків" + +#: ../C/gedit.xml:589(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "Ця кнопка дозволяє обрати шрифт для друку номерів рядків." + +#: ../C/gedit.xml:592(guilabel) +msgid "Headers and footers" +msgstr "Верхній та нижній колонтитули" + +#: ../C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "" +"Цією кнопкою обирається шрифт для друку верхніх та нижніх колонтитулів." + +#: ../C/gedit.xml:598(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"Кнопкою Відновити початкові шрифти можна " +"відновити типові шрифти." + +#: ../C/gedit.xml:605(title) +msgid "Printing a Document" +msgstr "Друк документу" + +#: ../C/gedit.xml:606(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "" +"Gedit може виконувати наступні завдання друку:" + +#: ../C/gedit.xml:608(para) +msgid "Print a document to a printer." +msgstr "Друк документу на принтері." + +#: ../C/gedit.xml:610(para) +msgid "Print the output of the print command to a file." +msgstr "Друк у файл." + +#: ../C/gedit.xml:613(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"При друкуванні у файл, gedit створює файл в одному з " +"друкованих форматів. Загальними форматами друку є PostScript та Portable Document Format." + +#: ../C/gedit.xml:615(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"Для попереднього перегляду друкованої сторінки, виберіть " +"ФайлПопередній перегляд." + +#: ../C/gedit.xml:617(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"Щоб надрукувати поточний документ на принтері чи у файл, відкрийте " +"ФайлДрук." + +#: ../C/gedit.xml:619(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "Вікно Друк дозволяє встановлювати наступні параметри друку:" + +#: ../C/gedit.xml:622(title) +msgid "Job Tabbed Section" +msgstr "Вкладка «Завдання»" + +#: ../C/gedit.xml:624(guilabel) +msgid "Print range" +msgstr "Діапазон друку" + +#: ../C/gedit.xml:626(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "" +"Для визначення кількості сторінок для друку виберіть один з наступних " +"параметрів:" + +#: ../C/gedit.xml:629(guilabel) +msgid "All" +msgstr "Все" + +#: ../C/gedit.xml:630(para) +msgid "Select this option to print all of the pages in the file." +msgstr "Відмітьте цей параметр для друкування усіх сторінок документа." + +#: ../C/gedit.xml:633(guilabel) +msgid "Lines" +msgstr "Рядки" + +#: ../C/gedit.xml:634(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"При виборі цього параметра друкуються лише певний діапазон рядків. Діапазон " +"визначається полями Від та До." + +#: ../C/gedit.xml:637(guilabel) +msgid "Selection" +msgstr "Виділений фрагмент" + +#: ../C/gedit.xml:638(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"Буде надрукований лише виділений текст. Якщо текст не виділений, " +"параметр недоступний." + +#: ../C/gedit.xml:644(guilabel) +msgid "Copies" +msgstr "Копії" + +#: ../C/gedit.xml:646(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "" +"У полі Кількість копій можна вказати скільки екземплярів " +"документу треба надрукувати." + +#: ../C/gedit.xml:647(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"Для друку кількох екземплярів, можна сортувати сторінки за копіями за " +"допомогою параметра Розібрати за копіями." + +#: ../C/gedit.xml:654(title) +msgid "Printer Tabbed Section" +msgstr "Вкладка «Принтер»" + +#: ../C/gedit.xml:656(guilabel) +msgid "Printer" +msgstr "Принтер" + +#: ../C/gedit.xml:658(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "" +"Використовуючи цей список можна вибрати принтер для друку." + +#: ../C/gedit.xml:661(guilabel) +msgid "Settings" +msgstr "Параметри" + +#: ../C/gedit.xml:663(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "У цьому списку обираються параметри принтера." + +#: ../C/gedit.xml:665(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"Для налаштовування принтера натисніть Налаштувати. " +"Наприклад, можна увімкнути або вимкнути друк з двох сторін, або відкласти друк " +"до певного часу, якщо ця функціональність підтримується принтером." + +#: ../C/gedit.xml:669(guilabel) +msgid "Location" +msgstr "Адреса" + +#: ../C/gedit.xml:671(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "" +"У цьому списку можна вибрати:" + +#: ../C/gedit.xml:676(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: ../C/gedit.xml:678(para) +msgid "Print the file to a CUPS printer." +msgstr "Друк документу на принтер CUPS." + +#: ../C/gedit.xml:682(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"Якщо виділений принтер є принтером CUPS, тоді у цьому розкривному списку є " +"єдиний елемент - CUPS." + +#: ../C/gedit.xml:689(guilabel) +msgid "lpr" +msgstr "lpr" + +#: ../C/gedit.xml:691(para) +msgid "Print the file to a printer." +msgstr "Друк документу на принтер lpr." + +#: ../C/gedit.xml:697(guilabel) +msgid "File" +msgstr "Файл" + +#: ../C/gedit.xml:699(para) +msgid "Print the file to a PostScript file." +msgstr "Друк документу у файл PostScript." + +#: ../C/gedit.xml:702(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"Натисніть Зберегти як щоб відкрити діалогове вікно," +"у якому вказується назва та розташування файлу PostScript." + +#: ../C/gedit.xml:708(guilabel) +msgid "Custom" +msgstr "Інший" + +#: ../C/gedit.xml:710(para) +msgid "Use the specified command to print the file." +msgstr "Дозволяє використовувати вказану команду для друку документу." + +#: ../C/gedit.xml:713(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "Введіть у текстовому полі назву команди та її аргументи." + +#: ../C/gedit.xml:721(guilabel) +msgid "State" +msgstr "Стан" + +#: ../C/gedit.xml:723(para) ../C/gedit.xml:729(para) ../C/gedit.xml:735(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "Функціональність не підтримується у цій версії gedit." + +#: ../C/gedit.xml:727(guilabel) +msgid "Type" +msgstr "Тип" + +#: ../C/gedit.xml:733(guilabel) +msgid "Comment" +msgstr "Коментар" + +#: ../C/gedit.xml:743(title) +msgid "Paper Tabbed Section" +msgstr "Вкладка «Папір»" + +#: ../C/gedit.xml:745(guilabel) +msgid "Paper size" +msgstr "Розмір аркуша" + +#: ../C/gedit.xml:747(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "" +"У цьому розкривному списку можна вибрати розмір аркушів, на які буде друкуватись документ." + +#: ../C/gedit.xml:750(guilabel) +msgid "Width" +msgstr "Ширина" + +#: ../C/gedit.xml:752(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "" +"У цьому полі визначається ширина аркуша. Одиниця виміру обирається " +"у сусідньому розкривному списку." + +#: ../C/gedit.xml:755(guilabel) +msgid "Height" +msgstr "Висота" + +#: ../C/gedit.xml:757(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "У цьому полі визначається висота сторінки." + +#: ../C/gedit.xml:760(guilabel) +msgid "Feed orientation" +msgstr "Орієнтація подачі" + +#: ../C/gedit.xml:762(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "У цьому списку вибирається орієнтація паперу у принтері." + +#: ../C/gedit.xml:765(guilabel) +msgid "Page orientation" +msgstr "Орієнтація аркуша" + +#: ../C/gedit.xml:767(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "У цьому списку вибирається орієнтація сторінки." + +#: ../C/gedit.xml:770(guilabel) +msgid "Layout" +msgstr "Розташування" + +#: ../C/gedit.xml:772(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"У цьому списку вказується схема розташування сторінки. Попередній " +"вигляд компонування сторінки відображається у полі Попередній " +"перегляд." + +#: ../C/gedit.xml:775(guilabel) +msgid "Paper tray" +msgstr "Джерело паперу" + +#: ../C/gedit.xml:777(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "У цьому списку можна вибрати джерело паперу." + +#: ../C/gedit.xml:788(title) +msgid "Programming Features" +msgstr "Програмування" + +#: ../C/gedit.xml:790(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"Деякі з можливостей програмування у gedit підтримуються модулями. Наприклад, «Список тегів» — модуль, " +"що відображає теги різних мов розмітки: дивіться ." + +#: ../C/gedit.xml:794(title) +msgid "Syntax Highlighting" +msgstr "Виділення синтаксису" + +#: ../C/gedit.xml:795(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "" +"Виділення синтаксису кольором робить полегшує читання коду людиною. " +"Різні смислові елементи тексту виділяються різними кольорами." + +#: ../C/gedit.xml:797(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"Gedit обирає відповідний режим виділення кольором " +"на основі типу документу. Для заміни режиму виділення кольором " +"ВиглядВиділення синтаксису, потім виберіть один з пунктів меню:" + +#: ../C/gedit.xml:800(guimenuitem) +msgid "Normal" +msgstr "Немає" + +#: ../C/gedit.xml:802(para) +msgid "Do not display any syntax highlighting." +msgstr "Без виділення кольором." + +#: ../C/gedit.xml:806(guisubmenu) +msgid "Sources" +msgstr "Тексти програми" + +#: ../C/gedit.xml:808(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "Виділення програмних текстів. З підменю виберіть потрібний тип." + +#: ../C/gedit.xml:812(guisubmenu) +msgid "Markup" +msgstr "Розмітка" + +#: ../C/gedit.xml:814(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "Виділяє мови розмітки. З підменю можна обрати потрібну." + +#: ../C/gedit.xml:818(guisubmenu) +msgid "Scripts" +msgstr "Мови сценаріїв" + +#: ../C/gedit.xml:820(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "Виділення кольором синтаксису сценаріїв. У підменю містяться деякі мови «сценаріїв»." + +#: ../C/gedit.xml:824(guisubmenu) +msgid "Others" +msgstr "Інше" + +#: ../C/gedit.xml:826(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "Інші режими виділення кольором." + +#: ../C/gedit.xml:830(para) +msgid "" +"For more information about how to configure syntax highlighting, see ." +msgstr "" +"Додаткову інформацію про налаштовування виділення кольором дивіться у ." + +#: ../C/gedit.xml:836(title) +msgid "Piping the Output of a Command to a File" +msgstr "Вставка результатів виконання команд у файл" + +#: ../C/gedit.xml:837(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"Можна використовувати gedit для вставки результатів " +"виконання певної команди у текстовий файл. Наприклад, ls | " +"gedit." + +#: ../C/gedit.xml:838(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"Вивід команди ls буде занесений у новий текстовий файл у " +"вікні gedit." + +#: ../C/gedit.xml:839(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"Інший спосіб — використовувати модуль Зовнішні інструменти " +"для вставки результатів виконання команди у поточний файл." + +#: ../C/gedit.xml:845(title) +msgid "Shortcut Keys" +msgstr "Комбінації клавіш" + +#: ../C/gedit.xml:846(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"Для прискорення виконання поширених операцій замість миші та меню використовуйте " +"комбінації клавіш. У наступній таблиці перелічені усі комбінації клавіш gedit." + +#: ../C/gedit.xml:847(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"Докладнішу інформацію про комбінації клавіш дивіться у Посібнику користувача середовища MATE." + +#. ============= Tabs ======================== +#: ../C/gedit.xml:850(bridgehead) ../C/gedit.xml:1180(guilabel) +msgid "Tabs" +msgstr "Вкладки" + +#: ../C/gedit.xml:851(para) +msgid "Shortcuts for tabs:" +msgstr "Комбінації клавіш для роботи з вкладкам" + +#: ../C/gedit.xml:859(para) ../C/gedit.xml:903(para) ../C/gedit.xml:959(para) +#: ../C/gedit.xml:1003(para) ../C/gedit.xml:1031(para) +#: ../C/gedit.xml:1078(para) ../C/gedit.xml:1121(para) +msgid "Shortcut Key" +msgstr "Комбінація клавіш" + +#: ../C/gedit.xml:861(para) ../C/gedit.xml:905(para) ../C/gedit.xml:961(para) +#: ../C/gedit.xml:1005(para) ../C/gedit.xml:1033(para) +#: ../C/gedit.xml:1080(para) ../C/gedit.xml:1123(para) +msgid "Command" +msgstr "Команда" + +#: ../C/gedit.xml:866(para) ../C/gedit.xml:870(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: ../C/gedit.xml:867(para) +msgid "Switches to the next tab to the left." +msgstr "Перейти до сусідньої вкладки, що розташована ліворуч" + +#: ../C/gedit.xml:871(para) +msgid "Switches to the next tab to the right." +msgstr "Перейти до сусідньої вкладки, що розташована праворуч" + +#: ../C/gedit.xml:874(para) ../C/gedit.xml:938(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: ../C/gedit.xml:875(para) +msgid "Close tab." +msgstr "Закрити вкладку." + +#: ../C/gedit.xml:878(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: ../C/gedit.xml:879(para) +msgid "Save all tabs." +msgstr "Зберегти усі вкладки." + +#: ../C/gedit.xml:882(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: ../C/gedit.xml:883(para) +msgid "Close all tabs." +msgstr "Закрити усі вкладки." + +#: ../C/gedit.xml:886(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: ../C/gedit.xml:887(para) +msgid "Jump to nth tab." +msgstr "Перейти до n-ої вкладки" + +#. ============= Files ======================== +#: ../C/gedit.xml:894(bridgehead) +msgid "Files" +msgstr "Файли" + +#: ../C/gedit.xml:895(para) +msgid "Shortcuts for working with files:" +msgstr "Комбінації клавіш для роботи з файлами:" + +#: ../C/gedit.xml:910(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: ../C/gedit.xml:911(para) +msgid "Create a new document." +msgstr "Створити новий документ." + +#: ../C/gedit.xml:914(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: ../C/gedit.xml:915(para) +msgid "Open a document." +msgstr "Відкрити документ." + +#: ../C/gedit.xml:918(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: ../C/gedit.xml:919(para) +msgid "Open a location." +msgstr "Відкрити адресу." + +#: ../C/gedit.xml:922(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: ../C/gedit.xml:923(para) +msgid "Save the current document to disk." +msgstr "Зберегти поточний документ на диск." + +#: ../C/gedit.xml:926(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: ../C/gedit.xml:927(para) +msgid "Save the current document with a new filename." +msgstr "Зберегти поточний документ з новою назвою." + +#: ../C/gedit.xml:930(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: ../C/gedit.xml:931(para) +msgid "Print the current document." +msgstr "Надрукувати поточний документ." + +#: ../C/gedit.xml:934(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: ../C/gedit.xml:935(para) +msgid "Print preview." +msgstr "Попередній перегляд документу." + +#: ../C/gedit.xml:939(para) +msgid "Close the current document." +msgstr "Закрити поточний документ." + +#: ../C/gedit.xml:942(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: ../C/gedit.xml:943(para) +msgid "Quit Gedit." +msgstr "Вихід з gedit." + +#. ============= Edit ======================= +#: ../C/gedit.xml:950(bridgehead) ../C/gedit.xml:1484(guimenu) +#: ../C/gedit.xml:1490(guimenu) ../C/gedit.xml:1496(guimenu) +#: ../C/gedit.xml:1502(guimenu) +msgid "Edit" +msgstr "Правка" + +#: ../C/gedit.xml:951(para) +msgid "Shortcuts for editing documents:" +msgstr "Комбінації клавіш для правки документу:" + +#: ../C/gedit.xml:966(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: ../C/gedit.xml:967(para) +msgid "Undo the last action." +msgstr "Скасувати останню операцію" + +#: ../C/gedit.xml:970(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: ../C/gedit.xml:971(para) +msgid "Redo the last undone action ." +msgstr "Повторити скасовану дію" + +#: ../C/gedit.xml:974(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: ../C/gedit.xml:975(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "Вирізати виділену текстову область та перемістити у буфер обміну." + +#: ../C/gedit.xml:978(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: ../C/gedit.xml:979(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "Копіювати виділений текст або регіон у буфер обміну." + +#: ../C/gedit.xml:982(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: ../C/gedit.xml:983(para) +msgid "Paste the contents of the clipboard." +msgstr "Вставити текст з буферу обміну." + +#: ../C/gedit.xml:986(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: ../C/gedit.xml:987(para) +msgid "Select all." +msgstr "Виділити все." + +#. ============= Panes ======================= +#: ../C/gedit.xml:994(bridgehead) +msgid "Panes" +msgstr "Панелі" + +#: ../C/gedit.xml:995(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "Комбінації клавіш для роботи з панелями:" + +#: ../C/gedit.xml:1010(para) +msgid "F9" +msgstr "F9" + +#: ../C/gedit.xml:1011(para) +msgid "Show/hide the side pane." +msgstr "Показати чи сховати бічну панель." + +#: ../C/gedit.xml:1014(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: ../C/gedit.xml:1015(para) +msgid "Show/hide the bottom pane." +msgstr "Відобразити/приховати нижню панель." + +#. ============= Search ======================= +#: ../C/gedit.xml:1022(bridgehead) +msgid "Search" +msgstr "Пошук" + +#: ../C/gedit.xml:1023(para) +msgid "Shortcuts for searching:" +msgstr "Комбінації клавіш для виконання пошуку" + +#: ../C/gedit.xml:1038(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: ../C/gedit.xml:1039(para) +msgid "Find a string." +msgstr "Знайти рядок" + +#: ../C/gedit.xml:1042(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: ../C/gedit.xml:1043(para) +msgid "Find the next instance of the string." +msgstr "Пошук місця наступного збігу з вказаним рядком." + +#: ../C/gedit.xml:1046(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: ../C/gedit.xml:1047(para) +msgid "Find the previous instance of the string." +msgstr "Знайти попереднє місце збігу з рядком" + +#: ../C/gedit.xml:1050(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: ../C/gedit.xml:1051(para) +msgid "Interactive search." +msgstr "Інтерактивний пошук." + +#: ../C/gedit.xml:1054(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: ../C/gedit.xml:1055(para) +msgid "Search and replace." +msgstr "Пошук та заміна." + +#: ../C/gedit.xml:1058(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: ../C/gedit.xml:1059(para) +msgid "Clear highlight." +msgstr "Очистити виділення кольором" + +#: ../C/gedit.xml:1062(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: ../C/gedit.xml:1063(para) +msgid "Goto line." +msgstr "Перейти на рядок." + +#. ============= Tools ======================= +#: ../C/gedit.xml:1069(bridgehead) +msgid "Tools" +msgstr "Сервіс" + +#: ../C/gedit.xml:1070(para) +msgid "Shortcuts for tools:" +msgstr "Комбінації клавіш для сервісних функцій:" + +#: ../C/gedit.xml:1085(para) +msgid "F7" +msgstr "F7" + +#: ../C/gedit.xml:1086(para) +msgid "Check spelling (with plugin)." +msgstr "Перевірка орфографії" + +#: ../C/gedit.xml:1089(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: ../C/gedit.xml:1090(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "Видалення завершальних пробілів (модуль)." + +#: ../C/gedit.xml:1093(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: ../C/gedit.xml:1094(para) +msgid "Indent (with plugin)." +msgstr "Модуль «Відступи рядків»" + +#: ../C/gedit.xml:1097(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: ../C/gedit.xml:1098(para) +msgid "Remove Indent (with plugin)." +msgstr "Забрати відступ у рядку (модуль)." + +#: ../C/gedit.xml:1101(para) +msgid "F8" +msgstr "F8" + +#: ../C/gedit.xml:1102(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "Запустити \"make\" у поточному каталозі (модуль)." + +#: ../C/gedit.xml:1105(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: ../C/gedit.xml:1106(para) +msgid "Directory listing (with plugin)." +msgstr "Список файлів каталогу (модуль)." + +#. ============= Help ======================= +#: ../C/gedit.xml:1112(bridgehead) +msgid "Help" +msgstr "Довідка" + +#: ../C/gedit.xml:1113(para) +msgid "Shortcuts for help:" +msgstr "Комбінації клавіш для отримання довідки" + +#: ../C/gedit.xml:1128(para) +msgid "F1" +msgstr "F1" + +#: ../C/gedit.xml:1129(para) +msgid "Open gedit's user manual." +msgstr "Відкривання посібника користувача gedit:" + +#: ../C/gedit.xml:1141(title) +msgid "Preferences" +msgstr "Параметри" + +#: ../C/gedit.xml:1143(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"Для налаштовування gedit виберіть " +"ПравкаПараметри. Діалогове вікно Параметры містить " +"елементи:" + +#: ../C/gedit.xml:1153(title) +msgid "View Preferences" +msgstr "Зовнішній вигляд" + +#: ../C/gedit.xml:1157(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"Відмітьте Увімкнути перенос тексту, щоб довгі рядки " +"відображались як абзаци, а не забігли за край вікна. Горизонтальне " +"прокручування стане зайвим." + +#: ../C/gedit.xml:1158(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"Параметр Не розривати слово між рядками включає " +"перенос по словам тексту між рядками. Такий текст легше читати." + +#: ../C/gedit.xml:1164(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"При відміченому параметрі Показувати номери рядків коло " +"лівої межі вікна gedit відображаються номери рядків." + +#: ../C/gedit.xml:1168(guilabel) +msgid "Right Margin" +msgstr "Праве поле" + +#: ../C/gedit.xml:1170(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "" +"Відмітьте Відображати праву межу, щоб відображалась " +"вертикальна лінія праворуч - права межа." + +#: ../C/gedit.xml:1171(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"У параметрі Права межа у стовпчику, можна вказати " +"розташування цієї вертикальної лінії." + +#: ../C/gedit.xml:1178(title) +msgid "Editor Preferences" +msgstr "Параметри редактора" + +#: ../C/gedit.xml:1182(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"У полі Ширина табуляції можна вказати ширину " +"вільного простору, що додається gedit при " +"натисканні клавіші Tab." + +#: ../C/gedit.xml:1183(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"Параметр Вставляти пробіли замість табуляції вказує " +"gedit при натисканні клавіші Tab " +"замість символу табуляції вставляти певну кількість пробілів." + +#: ../C/gedit.xml:1186(guilabel) +msgid "Auto Indentation" +msgstr "Автоматичний відступ" + +#: ../C/gedit.xml:1187(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "" +"Параметр Увімкнути автоматичний відступ визначає чи буде " +"наступний рядок починатись з такого ж відступу як і попередній." + +#: ../C/gedit.xml:1190(guilabel) +msgid "File Saving" +msgstr "Збереження файлів" + +#: ../C/gedit.xml:1192(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"При увімкненому параметрі Створювати резервну копію файлу перед " +"збереженням кожен раз при збереженні файлу створюється його " +"резервна копія. Резервна копія містить символ ~ наприкінці імені файлу." + +#: ../C/gedit.xml:1193(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"Параметр Автоматично зберігати поточний файл кожні ... хв " +"дозволяє періодично автоматично зберігати поточний файл." + +#: ../C/gedit.xml:1196(guilabel) +msgid "Undo" +msgstr "Вернути" + +#: ../C/gedit.xml:1198(para) +msgid "" +"Select the Limit to ... actions option to set a limit " +"on the number of editing actions that you can undo. Use the spin box to " +"specify the maximum number of actions that you can undo." +msgstr "" +"Для вказування максимальної кількості дій, що можна скасувати, виберіть параметр " +"параметр Скасовувати ... дій." + +#: ../C/gedit.xml:1199(para) +msgid "" +"Select the Unlimited undo option to set no limit on the " +"number of editing actions that you can undo." +msgstr "" +"Відмітьте Скасування без обмежень для скасування без обмежень." + +#: ../C/gedit.xml:1206(title) +msgid "Font & Colors Preferences" +msgstr "Параметри шрифтів та кольорів" + +#: ../C/gedit.xml:1208(guilabel) +msgid "Font" +msgstr "Шрифт" + +#: ../C/gedit.xml:1210(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"Виберіть Шрифт типової теми, щоб текст у " +"вікні gedit відображався типовим шрифтом." + +#: ../C/gedit.xml:1211(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"В полі Шрифт редактора відображається поточний шрифт, " +"що використовується для виводу тексту. Натискання на кнопку дозволяє встановити " +"сам шрифт, гарнітуру та розмір." + +#: ../C/gedit.xml:1214(guilabel) +msgid "Colors" +msgstr "Кольори" + +#: ../C/gedit.xml:1216(para) +msgid "" +"Select the Use default theme colors option to use the " +"default theme colors in the gedit text window." +msgstr "" +"Відмітьте параметр Використовувати початковий набір кольорів " +"для використання типової гами кольорів." + +#: ../C/gedit.xml:1217(para) +msgid "" +"Click on the Normal text color color button to " +"display the color selector dialog. Select a color to use to display normal " +"text in the gedit text window." +msgstr "" +"Натискання на кнопку Колір звичайного тексту дозволяє " +"обрати колір для виводу звичайного тексту у вікні gedit." + +#: ../C/gedit.xml:1218(para) +msgid "" +"Click on the Background color color button to display " +"the color selector dialog. Select a background color for the " +"gedit text window." +msgstr "" +"Кнопка Колір тла дозволяє встановити колір тла " +"текстового вікна." + +#: ../C/gedit.xml:1219(para) +msgid "" +"Click on the Selected text color color button to " +"display the color selector dialog. Select a color to use to display selected " +"text." +msgstr "" +"Кнопкою Колір виділеного тексту можна обрати колір " +"шрифту для виділеного тексту." + +#: ../C/gedit.xml:1221(para) +msgid "" +"Click on the Selection color color button to display " +"the color selector dialog. Select a background color to use to highlight a " +"text selection." +msgstr "" +"Кнопка Колір виділення визначає колір тла для " +"виділеного тексту." + +#: ../C/gedit.xml:1228(title) +msgid "Syntax Highlighting Preferences" +msgstr "Параметри виділення синтаксису" + +#: ../C/gedit.xml:1230(guilabel) +msgid "Enable syntax highlighting" +msgstr "Увімкнути виділення синтаксису" + +#: ../C/gedit.xml:1232(para) +msgid "Select this option to highlight the syntax of the text that you edit." +msgstr "Параметр вмикає виділення кольором синтаксису тексту, що редагується." + +#: ../C/gedit.xml:1235(guilabel) +msgid "Highlight mode" +msgstr "Режим виділення" + +#: ../C/gedit.xml:1237(para) +msgid "Use this drop-down list to select a syntax mode to configure." +msgstr "Зі списку можна вибрати режим виділення кольором." + +#: ../C/gedit.xml:1240(guilabel) +msgid "Elements" +msgstr "Елементи" + +#: ../C/gedit.xml:1242(para) +msgid "Use this list box to select a syntax element to configure." +msgstr "" +"Тут знаходяться синтаксичні елементи, виділення яких можна налаштувати." + +#: ../C/gedit.xml:1245(term) +msgid "Format buttons" +msgstr "Кнопки форматування" + +#: ../C/gedit.xml:1247(para) +msgid "" +"Use the following buttons to change the format of the selected syntax " +"element:" +msgstr "" +"Наступні кнопки міняють форматування вибраного синтаксичного елементу:" + +#: ../C/gedit.xml:1255(para) +msgid "Button" +msgstr "Кнопка" + +#: ../C/gedit.xml:1257(para) +msgid "Format" +msgstr "Форматувати" + +#: ../C/gedit.xml:1269(phrase) +msgid "Shows icon for bold format." +msgstr "Напівжирне форматування." + +#: ../C/gedit.xml:1275(para) +msgid "Bold" +msgstr "Жирний" + +#: ../C/gedit.xml:1287(phrase) +msgid "Shows icon for italic format." +msgstr "Курсив." + +#: ../C/gedit.xml:1293(para) +msgid "Italic" +msgstr "Курсив" + +#: ../C/gedit.xml:1305(phrase) +msgid "Shows icon for underline." +msgstr "Підкреслення." + +#: ../C/gedit.xml:1311(para) +msgid "Underline" +msgstr "Підкреслений" + +#: ../C/gedit.xml:1323(phrase) +msgid "Shows icon for strikethrough." +msgstr "Перекреслений текст." + +#: ../C/gedit.xml:1329(para) +msgid "Strikethrough" +msgstr "Перекреслити" + +#: ../C/gedit.xml:1339(guilabel) +msgid "Foreground" +msgstr "Передній план" + +#: ../C/gedit.xml:1341(para) +msgid "" +"Select this option to change the font color of the selected syntax element. " +"Click on the color button to display the color selector dialog, then select " +"the font color." +msgstr "Параметр дозволяє встановити колір синтаксичного елементу." + +#: ../C/gedit.xml:1344(guilabel) +msgid "Background" +msgstr "Тло" + +#: ../C/gedit.xml:1346(para) +msgid "" +"Select this option to change the background color of the selected syntax " +"element. Click on the color button to display the color selector dialog, " +"then select the background color." +msgstr "Параметр дозволяє встановити колір тла для синтаксичного елементу." + +#: ../C/gedit.xml:1349(guibutton) +msgid "Reset to Default" +msgstr "Скинути на типові" + +#: ../C/gedit.xml:1351(para) +msgid "" +"Click on this button to reset the foreground color and background color of " +"the selected syntax element to the default values." +msgstr "" +"При натисканні на цю кнопку скидає налаштоване форматування " +"синтаксичного елементу." + +#: ../C/gedit.xml:1358(title) +msgid "Plugins Preferences" +msgstr "Параметри модулів" + +#: ../C/gedit.xml:1359(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"Модулі розширюють можливості gedit. Для " +"інформації про вбудовані модулі дивіться ." + +#: ../C/gedit.xml:1364(title) +msgid "Enabling a Plugin" +msgstr "Підключення модулів" + +#: ../C/gedit.xml:1365(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "" +"Щоб підключити модуль у gedit, виконайте " +"інструкції:" + +#: ../C/gedit.xml:1368(para) ../C/gedit.xml:1389(para) +#: ../C/gedit.xml:1713(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"Виберіть ПравкаПараметри." + +#: ../C/gedit.xml:1371(para) ../C/gedit.xml:1392(para) +#: ../C/gedit.xml:1716(para) +msgid "Select the Plugins tab." +msgstr "Перейдіть до вкладки Модулі." + +#: ../C/gedit.xml:1374(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "Відмітьте модуль, який хочете увімкнути." + +#: ../C/gedit.xml:1377(para) ../C/gedit.xml:1398(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"Натисніть на кнопку Закрити для закриття діалогу " +"Параметри." + +#: ../C/gedit.xml:1384(title) +msgid "Disabling a Plugin" +msgstr "Вимикання модулів" + +#: ../C/gedit.xml:1385(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "" +"Модулі залишаються увімкненими після виходу з gedit." + +#: ../C/gedit.xml:1386(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "Щоб вимкнути модуль виконайте наступне:" + +#: ../C/gedit.xml:1395(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "Просто зніміть позначку з модуля, що вимикається." + +#: ../C/gedit.xml:1407(title) +msgid "Plugins" +msgstr "Модулі" + +#: ../C/gedit.xml:1409(title) +msgid "Working with Plugins" +msgstr "Робота з модулями" + +#: ../C/gedit.xml:1410(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"Підключенням модулів, можна розширити функціональність " +"gedit. Модулі — це додаткові програми. Вони " +"можуть додавати нові пункти меню для доступу до своєї функціональності." + +#: ../C/gedit.xml:1412(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"Деякі модулі постачаються разом з gedit, але можна " +"встановити й інші. На веб-сайті gedit є список додаткових модулів." + +#: ../C/gedit.xml:1413(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"Для вмикання та вимикання модулів дивіться розділ Налаштовування модулів." + +#: ../C/gedit.xml:1414(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "Наступні модулі постачаються разом з gedit:" + +#: ../C/gedit.xml:1420(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"Заміна регістру дозволяє змінити регістр символів виділеного тексту." + +#: ../C/gedit.xml:1423(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"Статистика " +"документа показує кількість рядків, слів та символів у " +"документі." + +#: ../C/gedit.xml:1426(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"Зовнішні " +"інструменти дозволяє виконати зовнішні команди з " +"gedit." + +#: ../C/gedit.xml:1429(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "" +"Перегляд файлів дозволяє переглядати теки та " +"файли у бічній панелі." + +#: ../C/gedit.xml:1432(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"Відступ у рядках вставляє або прибирає відступ у виділених рядках." + +#: ../C/gedit.xml:1435(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"Вставка дати й " +"часу вставляє поточну дату й час у позиції " +"курсору." + +#: ../C/gedit.xml:1438(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Стилі редагування підтримка стилів редагування рядків Emacs, Kate та Vim для gedit." + +#: ../C/gedit.xml:1441(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Консоль Python дозволяє запускати команди на мові програмування " +"Python." + +#: ../C/gedit.xml:1444(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"Фрагменти тексту дозволяє швидко вставляти фрагменти тексту, що часто використовуються." + +#: ../C/gedit.xml:1447(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"Сортування сортує документ або виділений текст." + +#: ../C/gedit.xml:1450(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"Перевірка " +"орфографії перевіряє орфографію у поточному документі." + +#: ../C/gedit.xml:1453(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"Список тегів надає простий спосіб вставки у документ теги або рядки, " +"не вводячи їх вручну." + +#: ../C/gedit.xml:1456(para) +msgid "" +"User Name inserts the username of the current user into the document." +msgstr "" +"Ім'я користувача вставляє ім'я користувача у позиції курсору." + +#: ../C/gedit.xml:1463(title) +msgid "Change Case Plugin" +msgstr "Модуль зміни регістру символів" + +#: ../C/gedit.xml:1464(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "" +"Модуль Заміна регістру змінює регістр символів " +"виділеного тексту." + +#: ../C/gedit.xml:1465(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"Якщо модуль увімкнений, у меню Правка будуть доступні " +"наступні пункти меню:" + +#: ../C/gedit.xml:1475(para) +msgid "Menu Item" +msgstr "Пункт меню" + +#: ../C/gedit.xml:1477(para) +msgid "Action" +msgstr "Дія" + +#: ../C/gedit.xml:1479(para) +msgid "Example" +msgstr "Приклад" + +#: ../C/gedit.xml:1485(guisubmenu) ../C/gedit.xml:1491(guisubmenu) +#: ../C/gedit.xml:1497(guisubmenu) ../C/gedit.xml:1503(guisubmenu) +msgid "Change Case" +msgstr "Заміна регістру" + +#: ../C/gedit.xml:1485(guimenuitem) +msgid "All Upper Case" +msgstr "Усе у верхній регістр" + +#: ../C/gedit.xml:1486(para) +msgid "Change each character to uppercase." +msgstr "Змінює регістр кожного символу у верхній регістр." + +#: ../C/gedit.xml:1487(para) +msgid "This text becomes THIS TEXT" +msgstr "" +"Цей текст перетворюється у ЦЕЙ ТЕКСТ" + +#: ../C/gedit.xml:1491(guimenuitem) +msgid "All Lower Case" +msgstr "Усе у нижній регістр" + +#: ../C/gedit.xml:1492(para) +msgid "Change each character to lowercase." +msgstr "Змінює регістр кожного символу на нижній регістр." + +#: ../C/gedit.xml:1493(para) +msgid "This Text becomes this text" +msgstr "" +"Цей текст перетворюється на цей текст" + +#: ../C/gedit.xml:1497(guimenuitem) +msgid "Invert Case" +msgstr "Інвертувати регістр" + +#: ../C/gedit.xml:1498(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "" +"Змінює регістр кожного символу, нижній на верхній, а верхній на нижній." + +#: ../C/gedit.xml:1499(para) +msgid "This Text becomes tHIS tEXT" +msgstr "" +"Цей Текст перетвориться на цЕЙ тЕКСТ" + +#: ../C/gedit.xml:1503(guimenuitem) +msgid "Title Case" +msgstr "Регістр заголовку" + +#: ../C/gedit.xml:1504(para) +msgid "Change the first character of each word to uppercase." +msgstr "Змінює регістр першого символу кожного слова у верхньому регістрі." + +#: ../C/gedit.xml:1505(para) +msgid "this text becomes This Text" +msgstr "" +"цей текст перетвориться на Цей Текст" + +#: ../C/gedit.xml:1514(title) +msgid "Document Statistics Plugin" +msgstr "Модуль «Статистика документа»" + +#: ../C/gedit.xml:1515(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"Модуль Статистика документа підраховує кількість " +"рядків, слів, символів з пробілами, символів без пробілів, а також байтів у " +"поточному файлі. Результати виводяться у діалоговому вікні Статистика " +"документа. Щоб скористатись цим модулем виконайте наступні дії:" + +#: ../C/gedit.xml:1517(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"Виберіть СервісСтатистика " +"документа. Діалогове вікно буде містити поля:" + +#: ../C/gedit.xml:1520(para) +msgid "Number of lines in the current document." +msgstr "Кількість рядків у поточному документі." + +#: ../C/gedit.xml:1523(para) +msgid "Number of words in the current document." +msgstr "Кількість слів." + +#: ../C/gedit.xml:1526(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "Кількість символів разом з пробілами." + +#: ../C/gedit.xml:1529(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "Кількість символів без урахування пробілів." + +#: ../C/gedit.xml:1532(para) +msgid "Number of bytes in the current document." +msgstr "Кількість байт." + +#: ../C/gedit.xml:1537(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"Можна продовжувати редагування файлів та при відкритому вікну " +"Статистика документа. Кнопка Оновити оновлює зміст діалогового вікна." + +#: ../C/gedit.xml:1544(title) +msgid "External Tools Plugin" +msgstr "Модуль «Зовнішні інструменти»" + +#: ../C/gedit.xml:1545(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"Модуль Зовнішні інструменти дозволяє виконувати зовнішні " +"команди та сценарії оболонки. Команді можна передавати деякі дані, " +"а потім використовувати виведену нею інформацію (наприклад, sed), або " +"запускати запускати певну команду (наприклад, make)" + +#: ../C/gedit.xml:1546(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"Використовуючи Менеджер зовнішніх інструментів можна створювати " +"та редагувати команди. Для запуску зовнішніх команд використовуйте меню " +"Сервіс." + +#: ../C/gedit.xml:1549(title) +msgid "Built-in Commands" +msgstr "Вбудовані команди" + +#: ../C/gedit.xml:1550(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "З модулем постачаються наступні команди:" + +#: ../C/gedit.xml:1552(term) +msgid "Build" +msgstr "Build" + +#: ../C/gedit.xml:1554(para) +msgid "" +"Runs make in the current document's directory." +msgstr "" +"Запускає make у каталозі поточного документу." + +#: ../C/gedit.xml:1557(term) +msgid "Directory Listing" +msgstr "Directory Listing" + +#: ../C/gedit.xml:1559(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "Вставляє зміст каталогу поточного документу у новий документ." + +#: ../C/gedit.xml:1562(term) +msgid "Environment Variables" +msgstr "Environment Variables" + +#: ../C/gedit.xml:1564(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "Відображає список змінних оточення у нижній панелі." + +#: ../C/gedit.xml:1567(term) +msgid "Grep" +msgstr "Grep" + +#: ../C/gedit.xml:1569(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"Шукає вираз в усіх файлах у каталозі поточного документу, використовуючи " +"шаблони. Результати відображаються у нижній панелі." + +#: ../C/gedit.xml:1572(term) +msgid "Remove Trailing Spaces" +msgstr "Remove Trailing Spaces" + +#: ../C/gedit.xml:1574(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "Видаляє всі початкові та завершальні пробіли у рядках." + +#: ../C/gedit.xml:1581(title) +msgid "Defining a Command" +msgstr "Визначення команд" + +#: ../C/gedit.xml:1582(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"Щоб додати зовнішню команду, виберіть СервісЗовнішні інструменти." + +#: ../C/gedit.xml:1583(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"У вікні Менеджер зовнішніх інструментів натисніть кнопку " +"Створити. Для нової команди можна вказати наступні " +"подробиці:" + +#: ../C/gedit.xml:1585(term) +msgid "Description" +msgstr "Опис" + +#: ../C/gedit.xml:1587(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "Коли меню команди обрано, опис відображається у рядку статусу." + +#: ../C/gedit.xml:1590(term) +msgid "Accelerator" +msgstr "Комбінація клавіш" + +#: ../C/gedit.xml:1592(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "Комбінація клавіш для виклику команди." + +#: ../C/gedit.xml:1595(term) +msgid "Commands" +msgstr "Команди" + +#: ../C/gedit.xml:1597(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"Команди, що запускаються. Можна використовувати також і змінні оточення, " +"докладніше дивіться ." + +#: ../C/gedit.xml:1600(term) +msgid "Input" +msgstr "Ввід" + +#: ../C/gedit.xml:1602(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"Дані, що отримуються командами (як stdin): текст " +"всього поточного документу, виділена область, рядок або слово." + +#: ../C/gedit.xml:1605(term) +msgid "Output" +msgstr "Вікно виводу" + +#: ../C/gedit.xml:1607(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"Що робити з виводом команди: відобразити у нижній панелі, вставити у новий " +"документ або у поточний; у кінець, у позицію курсора, замінити виділений " +"текст у документі або ж замінити весь документ." + +#: ../C/gedit.xml:1610(term) +msgid "Applicability" +msgstr "Застосовність:" + +#: ../C/gedit.xml:1612(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "" +"Визначає тип документу, до якого типу застосовуються команди, наприклад, локальні " +"документи або документи у мережі." + +#: ../C/gedit.xml:1620(title) +msgid "Editing and Removing Tools" +msgstr "Редагування та видалення фрагментів" + +#: ../C/gedit.xml:1621(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "Для редагування фрагменту виберіть його зі списку та відредагуйте." + +#: ../C/gedit.xml:1622(para) +msgid "To rename a tool, click it again in the list." +msgstr "Для перейменування фрагменту, клацніть на ньому у списку." + +#: ../C/gedit.xml:1623(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "" +"Щоб відновити змінені вбудовані фрагменти, натисніть " +"Відновити." + +#: ../C/gedit.xml:1624(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"Для видалення фрагменту, виберіть його у списку та натисніть кнопку " +"Видалити. Вбудовані фрагменти видалити неможливо." + +#: ../C/gedit.xml:1628(title) +msgid "Variables" +msgstr "Змінні" + +#: ../C/gedit.xml:1629(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "" +"У полі Команда(и) можна використовувати наступні " +"змінні:" + +#: ../C/gedit.xml:1632(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: ../C/gedit.xml:1635(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: ../C/gedit.xml:1638(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: ../C/gedit.xml:1641(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: ../C/gedit.xml:1644(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: ../C/gedit.xml:1647(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: ../C/gedit.xml:1650(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: ../C/gedit.xml:1657(title) +msgid "File Browser Plugin" +msgstr "Модуль перегляду файлової системи" + +#: ../C/gedit.xml:1658(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"Модуль Перегляд файлів відображає теки та файли у " +"бічній панелі, дозволяючи швидко відкривати файли." + +#: ../C/gedit.xml:1659(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"Для перегляду тек та файлів виберіть ВиглядБічна панель, натисніть " +"на вкладці знизу." + +#: ../C/gedit.xml:1661(title) +msgid "Browsing your Files" +msgstr "Перегляд ваших файлів" + +#: ../C/gedit.xml:1662(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"Вкладка Перегляд файлів початково відображає закладки. Для перегляду " +"змісту будь-якого елементу двічі клацніть на ньому." + +#: ../C/gedit.xml:1663(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"Щоб піднятись рівнем вище, скористайтесь розкривним списком або " +"натисніть клавішу зі стрілкою вгору (фокус вводу повинен бути на панелі)." + +#: ../C/gedit.xml:1664(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"Щоб переглянути теку документу, з яким ви працюєте зараз, клацніть " +"правою кнопкою на списку файлів та виберіть Встановити корінь на активний документ." + +#: ../C/gedit.xml:1668(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"Подвійне клацання на файлі відкриває його у gedit." + +#: ../C/gedit.xml:1671(title) +msgid "Creating Files and Folders" +msgstr "Створення файлів та тек" + +#: ../C/gedit.xml:1672(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"Щоб створити файл у поточній теці, клацніть на списку файлів правою кнопкою " +"миші та виберіть Створити файл." + +#: ../C/gedit.xml:1673(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"Щоб створити нову теку у поточній теці, у контекстному меню виберіть " +"Створити теку." + +#: ../C/gedit.xml:1678(title) +msgid "Indent Lines Plugin" +msgstr "Модуль «Відступи в рядках»" + +#: ../C/gedit.xml:1679(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "" +"Модуль Відступ у рядках вставляє або прибирає відступ на " +"початку рядків." + +#: ../C/gedit.xml:1680(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "Щоб вставити чи прибрати відступ, зробіть наступне:" + +#: ../C/gedit.xml:1682(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"Виділіть рядки. Якщо це один рядок, просто залиште курсор десь у " +"його межах." + +#: ../C/gedit.xml:1687(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"Для вставки відступу виберіть ПравкаВідступ." + +#: ../C/gedit.xml:1690(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"Для його видалення: ПравкаЗабрати відступ." + +#: ../C/gedit.xml:1695(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"Кількість пробілів, а також чи будуть ці пробіли або символ табуляції " +"залежать від параметрів Знаки табуляції у параметрах " +"редактора, дивіться ." + +#: ../C/gedit.xml:1700(title) +msgid "Insert Date/Time Plugin" +msgstr "Модуль вставки дати та часу" + +#: ../C/gedit.xml:1701(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"Модуль Вставка дати й часу вставляє поточну " +"дату й час у поточний документ. Щоб використати його:" + +#: ../C/gedit.xml:1703(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"Виберіть ПравкаВставити дату й " +"час." + +#: ../C/gedit.xml:1704(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"Якщо ви не налаштовували цей модуль на вставку дати та часу без запиту " +"формату, тоді gedit відобразить діалог " +"Вставити дату й час. Виберіть зі списку потрібний формат " +"та натисніть Вставити. У позицію курсору будуть вставлені " +"нова дата та час. Діалог закриється автоматично." + +#: ../C/gedit.xml:1705(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"Якщо gedit вже налаштований для вставки дати та " +"часу визначеного формату, діалог Вставити дату й час показаний не буде." + +#: ../C/gedit.xml:1710(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "Настройка модуль вставляння дати й часу" + +#: ../C/gedit.xml:1711(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "Для налаштовування модуля вставки дати й часу, виконайте наступне:" + +#: ../C/gedit.xml:1719(para) +msgid "Select the Insert Date/Time plugin." +msgstr "Виберіть модуль Вставка дати й часу." + +#: ../C/gedit.xml:1722(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"Натисніть кнопку Налаштувати модуль. Відкриється діалог " +"Налаштовування модуля вставляння дати й часу." + +#: ../C/gedit.xml:1725(para) +msgid "Select one of the options, as follows:" +msgstr "Виберіть один з параметрів:" + +#: ../C/gedit.xml:1727(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"Для запиту формату вставки кожен раз, відмітьте Запитувати " +"формат." + +#: ../C/gedit.xml:1730(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"Якщо ви хочете використовувати один і той самий формат при вставлянні дати та часу, " +"та не хочете, щоб формат запитувався щоразу — відмітьте Використати вибраний формат. " +"Формат вставки можна вибрати зі списку." + +#: ../C/gedit.xml:1733(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"Можна вказати власний формат формат обравши Інший формат. Докладніше дивіться strftime3. При вставленні формат також запитуватись не " +"буде." + +#: ../C/gedit.xml:1738(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "Натисніть Гаразд для закриття діалогу." + +#: ../C/gedit.xml:1741(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"Закрийте діалог Параметри натисніть на кнопку " +"Закрити." + +#: ../C/gedit.xml:1748(title) +msgid "Modelines Plugin" +msgstr "Модуль «Стилі редагування»" + +#: ../C/gedit.xml:1749(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Модуль Стилі редагування дозволяє встановити " +"індивідуальні параметри документа. Стилі редагування " +"є рядками тексту на початку або наприкінці документу з параметрами " +"для gedit." + +#: ../C/gedit.xml:1750(para) +msgid "You can override the following preferences with modelines:" +msgstr "Параметрами можуть бути:" + +#: ../C/gedit.xml:1753(para) +msgid "Tab width" +msgstr "Ширина табуляції" + +#: ../C/gedit.xml:1756(para) +msgid "Insert spaces instead of tabs" +msgstr "Пробіли замість табуляції" + +#: ../C/gedit.xml:1762(para) +msgid "Right margin width" +msgstr "Пробіли замість табуляцій" + +#: ../C/gedit.xml:1766(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Модуль Стилі редагування підтримує набори параметрів " +"інших текстових редакторів: Emacs, " +"Kate та Vim." + +#: ../C/gedit.xml:1769(title) +msgid "Emacs Modelines" +msgstr "«Стиль редагування» Emacs" + +#: ../C/gedit.xml:1770(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "Скануються перші два рядки документу." + +#: ../C/gedit.xml:1771(para) +msgid "" +"The Emacs options for tab-width, indent-tabs-mode " +"and autowrap are supported. For more information, see the GNU Emacs " +"Manual." +msgstr "" +"З параметрів Emacs підтримуються ширина табуляції, " +"indent-tabs-mode та авто-перенос. Додаткову інформацію дивіться у Посібнику з GNU Emacs." + +#: ../C/gedit.xml:1774(title) +msgid "Kate Modelines" +msgstr "«Стиль редагування» Kate" + +#: ../C/gedit.xml:1775(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "Скануються перші та останні десять рядків документу." + +#: ../C/gedit.xml:1776(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"З параметрів Kate підтримуються ширина табуляції, " +"ширина відступу, відступ пробілами, перенос слів та word-wrap-column. Додаткову " +"інформації дивіться веб-сайт Kate." + +#: ../C/gedit.xml:1779(title) +msgid "Vim Modelines" +msgstr "«Стиль редагування» Vim" + +#: ../C/gedit.xml:1780(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "Скануються перші та останні три рядки документа." + +#: ../C/gedit.xml:1781(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"wrap, and textwidth are supported. For more information, see the Vim website." +msgstr "" +"З параметрів Vim підтримуються expandtab, ts, " +"tabstop, wrap та textwidth. Докладніше дивіться веб-сайт Vim." + +#: ../C/gedit.xml:1786(title) +msgid "Python Console Plugin" +msgstr "Модуль «Консоль Python»" + +#: ../C/gedit.xml:1787(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Модуль Консоль Python дозволяє запускати команди " +"на мові програмування python. У нижню панель буде додана вкладка, у " +"якій можна ввести команду та переглянути її вивід." + +#: ../C/gedit.xml:1788(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"Команди, що вводяться, виконуються без будь-якої перевірки. Можливі зависання " +"gedit, наприклад, при вході у нескінченний цикл." + +#: ../C/gedit.xml:1792(title) +msgid "Snippets Plugin" +msgstr "Модуль «Фрагменти тексту»" + +#: ../C/gedit.xml:1793(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"Модуль Фрагменти тексту дозволяє зберігати " +"фрагменти тексту, що часто використовуються, потім швидко вставляти ці фрагменти у будь-яке місце документу." + +#: ../C/gedit.xml:1794(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"Фрагменти тексту специфічні для мови поточного документу. Наприклад, працюючи з " +"HTML-документом, можна обрати фрагменти для HTML. Деякі текстові " +"фрагменти глобальні, вони доступні для усіх видів документів." + +#: ../C/gedit.xml:1795(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "" +"Декілька фрагментів постачається у складі gedit. Їх можна змінювати." + +#: ../C/gedit.xml:1798(title) +msgid "Inserting Snippets" +msgstr "Вставка фрагментів" + +#: ../C/gedit.xml:1799(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"Для вставки фрагменту введіть його tab-тригер та " +"натисніть клавішу Tab. Tab-тригер " +"фрагменту тексту — це зазвичай перші декілька символів потрібного фрагменту, " +"або будь-яка послідовність, що легко запам'ятовується." + +#: ../C/gedit.xml:1800(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"Інший спосіб: натискання CtrlПробіл дозволяє обрати зі списку потрібний фрагмент для вставки." + +#: ../C/gedit.xml:1804(title) +msgid "Adding Snippets" +msgstr "Додавання фрагментів" + +#: ../C/gedit.xml:1805(para) +msgid "To create a new snippet, do the following:" +msgstr "Для створення нового фрагменту тексту:" + +#: ../C/gedit.xml:1808(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"Виберіть СервісКерування " +"фрагментами. Відкриється вікно Менеджер " +"фрагментів." + +#: ../C/gedit.xml:1811(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"У списку фрагменти тексту згруповані за мовою. Оберіть мову, для " +"якого хочете додати фрагмент. Для додавання фрагменту, що стосується " +"усіх мов, виберіть «Глобальний»." + +#: ../C/gedit.xml:1814(para) +msgid "Click New. A new snippet appears in the list." +msgstr "" +"Натисніть Створити, та новий фрагмент додається у список." + +#: ../C/gedit.xml:1817(para) +msgid "Enter the following information for the new snippet:" +msgstr "Введіть наступну інформацію про фрагмент:" + +#: ../C/gedit.xml:1819(term) +msgid "Name" +msgstr "Назва" + +#: ../C/gedit.xml:1821(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"Введіть назву фрагменту у текстове полі у списку. Назва служить лише для " +"відображення суті фрагменту. Можна змінити назва текстового фрагмента, клацнув " +"по ньому мишкою." + +#: ../C/gedit.xml:1824(term) +msgid "Snippet text" +msgstr "Текст фрагменту" + +#: ../C/gedit.xml:1826(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"Введіть текст самого фрагменту у текстовому полі Редагувати " +"фрагмент. Дивіться також ." + +#: ../C/gedit.xml:1827(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"Можна перемикнутися у вікно документу без закриття вікна Менеджер " +"фрагментів." + +#: ../C/gedit.xml:1830(term) +msgid "Tab Trigger" +msgstr "Tab-тригер" + +#: ../C/gedit.xml:1832(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"Введіть tab-тригер для фрагменту це - текст, який треба ввести до натискання " +"клавіші Tab при вставлянні фрагменту." + +#: ../C/gedit.xml:1833(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"Tab-тригер Може бути або одним символом, або " +"словом, що складається лише із літер. Якщо введений неправильний tab-тригер, він " +"буде виділений червоним кольором." + +#: ../C/gedit.xml:1836(term) +msgid "Shortcut key" +msgstr "Комбінація клавіш" + +#: ../C/gedit.xml:1838(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "Введіть комбінацію клавіш, для вставки фрагменту." + +#: ../C/gedit.xml:1847(title) +msgid "Editing and Removing Snippets" +msgstr "Редагування та видалення фрагментів" + +#: ../C/gedit.xml:1848(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "Для редагування фрагменту виберіть його з списку та відредагуйте." + +#: ../C/gedit.xml:1849(para) +msgid "To rename a snippet, click it again in the list." +msgstr "Для зміни назви фрагменту, клацніть на ньому у списку." + +#: ../C/gedit.xml:1850(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "" +"Щоб відновити змінені вбудовані фрагменти, натисніть " +"Відновити." + +#: ../C/gedit.xml:1851(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"Для видалення фрагменту, виберіть його зі списку та натисніть кнопку " +"Видалити. Вбудовані фрагменти видаляти не можна." + +#: ../C/gedit.xml:1855(title) +msgid "Snippet Substitutions" +msgstr "Підстановка у фрагментах" + +#: ../C/gedit.xml:1856(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"Окрім статичного тексту у фрагменти можна включати і змінюваний " +"текст, або символи пробілів, куди можна буде додати текст після вставки " +"фрагменту у документ." + +#: ../C/gedit.xml:1860(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "Можна використати наступні символи-замінники:" + +#: ../C/gedit.xml:1862(term) +msgid "Tab placeholders" +msgstr "Закладки" + +#: ../C/gedit.xml:1864(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n встановлює закладку, де " +"n — число більше 1." + +#: ../C/gedit.xml:1865(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} встановлює закладку з типовим значенням." + +#: ../C/gedit.xml:1866(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "" +"Закладка позначає місце у фрагменті, куди можна додати текст після " +"вставки фрагменту." + +#: ../C/gedit.xml:1867(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"Після вставки фрагменту, курсор переміщується у позицію першої закладки. Можна " +"ввести деякий текст та, натиснувши клавішу Tab, переміститися " +"у позицію наступної закладки. Нумерація закладок та визначає порядок " +"перемикання між ними." + +#: ../C/gedit.xml:1868(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"При натисканні комбінації клавіш ShiftTab, можна перейти до попередньої закладки. Якщо закладок " +"більше немає, клавіша Tab переміщує курсор у кінець " +"фрагменту, або до кінцевого символу-заміннику, якщо такий є." + +#: ../C/gedit.xml:1871(term) +msgid "Mirror placeholders" +msgstr "Дзеркала" + +#: ../C/gedit.xml:1873(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"Декілька закладок будуть відображати один і той самий текст. Дзеркала дозволяють " +"ввести текст один раз, і він відображатиметься у кількох місцях у фрагменті." + +#: ../C/gedit.xml:1876(term) +msgid "End placeholder" +msgstr "Кінцевий символ-замінник" + +#: ../C/gedit.xml:1878(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 визначає кінцевий символ-замінник. Дозволяє " +"завершити роботу з фрагментом, залишаючи курсор у потрібній позиції." + +#: ../C/gedit.xml:1881(term) +msgid "Environmental variables" +msgstr "Змінні оточення" + +#: ../C/gedit.xml:1883(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"У фрагментах можуть використовуватись змінні оточення, такі як $PATH та $HOME . Ось повний список змінних оточення, що можуть використовуватись:" + +#: ../C/gedit.xml:1885(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: ../C/gedit.xml:1887(para) +msgid "The currently selected text." +msgstr "Виділений текст." + +#: ../C/gedit.xml:1890(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: ../C/gedit.xml:1892(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "" +"Повна назва поточного документу. Якщо документ ще не був збережений, " +"повертається порожній рядок." + +#: ../C/gedit.xml:1895(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: ../C/gedit.xml:1897(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "Назва файлу без шляху, або порожній рядок, якщо файл не збережений." + +#: ../C/gedit.xml:1900(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: ../C/gedit.xml:1902(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "Слово у позиції курсору. Слово буде замінене фрагментом тексту." + +#: ../C/gedit.xml:1910(term) +msgid "Shell placeholders" +msgstr "Команди оболонки" + +#: ../C/gedit.xml:1912(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) у фрагменті тексту " +"замінюється результатом виконання cmd у оболонці." + +#: ../C/gedit.xml:1913(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) дозволяє призначити посиланню цьому елементу, де n — число більше 1. За допомогою $n можна вивід однієї команди подати на вхід іншої." + +#: ../C/gedit.xml:1916(term) +msgid "Python placeholders" +msgstr "Команди Python" + +#: ../C/gedit.xml:1918(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> замінюється " +"результатами обчислення cmd у інтерпретаторі " +"мови python." + +#: ../C/gedit.xml:1919(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" визначає зв'язок з іншими командами python, де a — їх порядок у фрагменті. Це дозволяє використовувати функції " +"python, визначення у інших фрагментах. Для вказування кількох " +"залежностей, розділіть їх комами: $<a,b:cmd>" +"" + +#: ../C/gedit.xml:1920(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "" +"Для використання змінних у python-фрагментах, декларуйте їх як " +"global." + +#: ../C/gedit.xml:1929(title) +msgid "Sort Plugin" +msgstr "Модуль сортування" + +#: ../C/gedit.xml:1930(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "" +"Модуль Сортування впорядковує виділені рядки " +"за алфавітом." + +#: ../C/gedit.xml:1931(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"Операцію сортування неможливо скасувати, тому краще зберегти файл перед його " +"застосуванням. Для повернення до збереженої версії файлу, можна вибрати " +"ФайлВідновити." + +#: ../C/gedit.xml:1934(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "Щоб скористатись сортуванням виконайте наступні дії:" + +#: ../C/gedit.xml:1937(para) +msgid "Select the lines of text you want to sort." +msgstr "Виділіть рядки для сортування" + +#: ../C/gedit.xml:1939(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"Виберіть ПравкаСортувати. Відкриється діалогове вікно Сортування." + +#: ../C/gedit.xml:1942(para) +msgid "Choose the options you want for the sort:" +msgstr "Відмітьте потрібні параметри сортування:" + +#: ../C/gedit.xml:1945(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "" +"Щоб сортувати у зворотному порядку, виберіть Зворотний порядок." + +#: ../C/gedit.xml:1948(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "" +"Для видалення дублікатів рядків, відмітьте Видаляти повтори." + +#: ../C/gedit.xml:1951(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "" +"Щоб не звертати увагу на регістр символів, виберіть " +"Ігнорувати регістр." + +#: ../C/gedit.xml:1954(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"Також можна виконувати сортування ігноруючи перші декілька символів " +"рядків. Для цього скористайтесь полем Починати з стовпчика." + +#: ../C/gedit.xml:1959(para) +msgid "To perform the sort operation, click Sort." +msgstr "При натисканні кнопки Сортувати виконується сортування." + +#: ../C/gedit.xml:1966(title) +msgid "Spell Checker Plugin" +msgstr "Модуль перевірки орфографії" + +#: ../C/gedit.xml:1967(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"Модуль Перевірка орфографії перевіряє орфографію " +"виділеного тексту. Можна налаштувати gedit на " +"автоматичну перевірку орфографії, або робити перевірку вручну. Мовні " +"параметри та параметри автоперевірки застосовуються до документу. Для " +"використання модуля, виконайте:" + +#: ../C/gedit.xml:1969(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"Виберіть СервісВстановити мову. На екрані відкриється діалогове вікно " +"Встановити мову. Оберіть потрібну мову зі списку. " +"Для закривання вікна натисніть Гаразд." + +#: ../C/gedit.xml:1972(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"Для вмикання автоматичної перевірки орфографії виберіть " +"СервісАвтоматична перевірка " +"орфографії. Для вимикання виберіть " +"СервісАвтоматична перевірка " +"орфографії ще раз. Коли автоматична перевірка увімкнена, " +"поруч з цим пунктом меню з'являється позначка. Типово, автоматична перевірка " +"вимкнена." + +#: ../C/gedit.xml:1973(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"Невідомі слова відображаються іншим кольором та підкреслюються. Клацніть правою " +"кнопкою на такому слові та виберіть підменю Можливі варіанти " +"дозволяє:" + +#: ../C/gedit.xml:1976(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "" +"Замінити слово на інше, що пропонується зі списку, просто клацнувши на ньому." + +#: ../C/gedit.xml:1979(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"Додати слово у власний персональний словник, обравши " +"Можливі варіантиДодати." + +#: ../C/gedit.xml:1982(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"Ігнорувати всі подібні слова. Так слова не будуть помічені як " +"невідомі, але не будуть додані у ваш особистий словник. Виберіть " +"Можливі варіантиІгнорувати " +"все. Діє лише у межах поточного сеансу " +"gedit." + +#: ../C/gedit.xml:1987(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"Для перевірки орфографії вручну, виберіть СервісПеревірити орфографію." + +#: ../C/gedit.xml:1989(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"Якщо ніяких помилок не знайдено, буде виведене повідомлення: немає помилкових " +"слів." + +#: ../C/gedit.xml:1991(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "" +"Якщо ж були помилки, відкриється діалогове вікно Перевірка " +"орфографії:" + +#: ../C/gedit.xml:1994(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "" +"Слово з помилкою буде показано у верхній частині вікна." + +#: ../C/gedit.xml:1997(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"Поле Замінити на буде містити пропонований варіант " +"напису слова. Можна ввести у це поле власний варіант для заміни, або " +"обрати альтернативу зі списку Варіанти." + +#: ../C/gedit.xml:2000(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"Можна перевірити напис введеного на заміну слова, натискаючи кнопку " +"Перевірити слово. Якщо слово правильне, у списку " +"Варіанти буде надпис (правильний напис). Якщо ж слово невідоме, у списку Варіанти " +"будуть відображені уже варіанти його написання." + +#: ../C/gedit.xml:2003(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"Для ігнорування невідомого слова, натисніть Ігнорувати. Щоб ігнорувати всі подібні слова, натисніть " +"Ігнорувати все. Дійсно лише у межах " +"поточної сеансу gedit." + +#: ../C/gedit.xml:2006(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"Для заміни невідомого слова на слово у текстовому полі Замінити " +"на, натисніть на кнопку Замінити. Щоб " +"замінити всі подібні невідомі слова у тексті всього документу, натисніть " +"Замінити все." + +#: ../C/gedit.xml:2009(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "" +"Додати невідоме слово у особистий словник можна натиснути на " +"кнопку Додати слово." + +#: ../C/gedit.xml:2012(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"Щоб закрити діалог Перевірка орфографії натисніть " +"Закрити." + +#: ../C/gedit.xml:2021(title) +msgid "Tag List Plugin" +msgstr "Модуль списку тегів" + +#: ../C/gedit.xml:2022(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "" +"Модуль Список тегів дозволяє вставити у " +"документ теги зі списку у бічній панелі." + +#: ../C/gedit.xml:2023(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "Для використання модуля:" + +#: ../C/gedit.xml:2025(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"Виберіть ВиглядБічна панель." + +#: ../C/gedit.xml:2029(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"Типово, у бічній панелі відображається вкладка зі списком відкритих " +"документів. Натисніть вкладку із зображенням «+» внизу панелі." + +#: ../C/gedit.xml:2031(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"Виберіть відповідну категорію тегів у розкривному списку, наприклад, " +"HTML - теги." + +#: ../C/gedit.xml:2034(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "Можна прокрутити список тегів для пошуку потрібного." + +#: ../C/gedit.xml:2037(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"Щоб вставити тег у позицію курсору у поточному файлі, двічі клацніть на " +"потрібному тегу у списку. Інші способи вставки тегів:" + +#: ../C/gedit.xml:2039(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"Для вставки тегу та зміни фокусу вводу з бічної панелі до редагування " +"поточного документу, натисніть клавішу Enter." + +#: ../C/gedit.xml:2042(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"Для вставки тегу та збереження фокусу вводу за списком тегів, натисніть " +"комбінацію клавіш ShiftEnter." + +#: ../C/gedit.xml:2051(title) +msgid "User Name Plugin" +msgstr "Модуль «Ім'я користувача»" + +#: ../C/gedit.xml:2052(para) +msgid "" +"The User name plugin inserts the username of the " +"current user into the document." +msgstr "" +"Модуль Ім'я користувача вставляє ім'я поточного " +"користувача у документ." + +#: ../C/gedit.xml:2053(para) +msgid "" +"To insert your username at the cursor position, choose " +"EditInsert User Name." +msgstr "" +"Щоб вставити ім'я користувача у позицію курсору, виберіть " +"ПравкаВставити ім'я користувача." + +#: ../C/gedit.xml:2055(para) +msgid "" +"This plugin is mostly provided as an example of how to create your own " +"plugins. For more information on creating plugins, see the gedit website." +msgstr "" +"Цей модуль, у основному, служить прикладом для створення власних " +"модулів. Додаткову інформацію дивіться на сайті gedit." + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2. +#: ../C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "Максим Дзюманенко , 2007" diff --git a/help/zh_CN/figures/gedit_window.png b/help/zh_CN/figures/gedit_window.png new file mode 100755 index 00000000..b2b7c927 Binary files /dev/null and b/help/zh_CN/figures/gedit_window.png differ diff --git a/help/zh_CN/zh_CN.po b/help/zh_CN/zh_CN.po new file mode 100755 index 00000000..3148b963 --- /dev/null +++ b/help/zh_CN/zh_CN.po @@ -0,0 +1,5100 @@ +# Chinese (China) translation of gedit help +# Copyright (C) 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the gedit package. +# +# 朱涛 , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: gedit mate-2-30\n" +"POT-Creation-Date: 2010-08-25 14:21+0000\n" +"PO-Revision-Date: 2010-09-06 18:55+0800\n" +"Last-Translator: 朱涛 \n" +"Language-Team: Chinese (simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"对于本文档的复制、分发和/或修改必须遵循自由软件基金会 (Free Software " +"Foundation) 发布的 GNU 自由文档许可证 (GFDL) 版本 1.1 或更高版本, 该许可证没" +"有固定的部分、没有封面和背页文本。您可以在此链接上或在随本手册一起分发的 COPYING-DOCS 文件中找到 GFDL 的副" +"本。" + +#: 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 "" +"本手册是在 GFDL 许可之下分发的 MATE 手册集合的一部分。如果想要单独分发此手" +"册,可以在手册中添加该许可证的一份副本然后分发,如该许可证的第 6 部分所述。" + +#: 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 "" +"各个公司使用的许多用于区别它们产品和服务的名称都声明为商标。在所有的 MATE 文" +"档以及 MATE Documentation Project 的成员中,这些名称都是以全大写字母或首字母" +"大写显示,从而表明它们是商标。" + +#: 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 " +"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/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: " +"" +msgstr "" +"本文档以及文档的修改版本都是在遵循 GNU 自由文档许可证的条款下提供,这表示具有" +"以下含义: " + +#. 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/gedit.xml:268(None) +msgid "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" +msgstr "" +"@@image: 'figures/gedit_window.png'; md5=a1daf2ed54a551bb590a172bc730594c" + +#. 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/gedit.xml:349(None) +msgid "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" +msgstr "" +"@@image: 'figures/gedit_recent_files_menu_icon.png'; " +"md5=62b4bede31db64226f7e7f9b18f5eb74" + +#: C/gedit.xml:23(title) +msgid "Gedit Manual" +msgstr "Gedit 手册" + +#: C/gedit.xml:25(year) +msgid "2007" +msgstr "2007" + +#: C/gedit.xml:26(holder) C/gedit.xml:45(publishername) +#: C/gedit.xml:56(firstname) C/gedit.xml:79(orgname) C/gedit.xml:120(para) +#: C/gedit.xml:128(para) C/gedit.xml:136(para) C/gedit.xml:144(para) +#: C/gedit.xml:152(para) C/gedit.xml:160(para) C/gedit.xml:168(para) +#: C/gedit.xml:176(para) C/gedit.xml:184(para) C/gedit.xml:192(para) +#: C/gedit.xml:200(para) +msgid "MATE Documentation Project" +msgstr "MATE 文档项目" + +#: C/gedit.xml:28(year) +msgid "2002" +msgstr "2002" + +#: C/gedit.xml:29(year) +msgid "2003" +msgstr "2003" + +#: C/gedit.xml:30(year) +msgid "2004" +msgstr "2004" + +#: C/gedit.xml:31(holder) C/gedit.xml:71(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: C/gedit.xml:33(year) C/gedit.xml:116(date) +msgid "2000" +msgstr "2000" + +#: C/gedit.xml:34(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: C/gedit.xml:52(firstname) +msgid "Joachim" +msgstr "Joachim" + +#: C/gedit.xml:53(surname) +msgid "Noreiko" +msgstr "Noreiko" + +#: C/gedit.xml:59(orgname) +msgid "MATE" +msgstr "MATE" + +#: C/gedit.xml:63(firstname) +msgid "Hal" +msgstr "Hal" + +#: C/gedit.xml:64(surname) +msgid "Canary" +msgstr "Canary" + +#: C/gedit.xml:65(contrib) +msgid "Added the Shortcut Keys Table" +msgstr "添加快捷键表" + +#: C/gedit.xml:68(firstname) C/gedit.xml:191(para) +msgid "Sun Java Desktop System Documentation Team" +msgstr "Sun Java Desktop System Documentation Team" + +#: C/gedit.xml:72(email) +msgid "gdocteam@sun.com" +msgstr "gdocteam@sun.com" + +#: C/gedit.xml:76(firstname) +msgid "Eric" +msgstr "Eric" + +#: C/gedit.xml:77(surname) +msgid "Baudais" +msgstr "Baudais" + +#: C/gedit.xml:80(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: C/gedit.xml:84(firstname) +msgid "Baris" +msgstr "Baris" + +#: C/gedit.xml:85(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek 提供了 gedit 应用程序早期修订的信息。" + +#: C/gedit.xml:86(contrib) C/gedit.xml:91(contrib) +msgid "Acknowledgements" +msgstr "致谢" + +#: C/gedit.xml:89(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: C/gedit.xml:90(surname) +msgid "George provided information about plugins." +msgstr "George 提供了有关插件的信息。" + +#: C/gedit.xml:115(revnumber) +msgid "gedit V1.0" +msgstr "gedit V1.0" + +#: C/gedit.xml:118(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: C/gedit.xml:124(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit 手册 V2.0" + +#: C/gedit.xml:125(date) +msgid "March 2002" +msgstr "2002年3月" + +#: C/gedit.xml:127(para) C/gedit.xml:135(para) C/gedit.xml:143(para) +#: C/gedit.xml:151(para) C/gedit.xml:159(para) C/gedit.xml:167(para) +#: C/gedit.xml:175(para) C/gedit.xml:183(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE Documentation Team" + +#: C/gedit.xml:132(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit 手册 V2.1" + +#: C/gedit.xml:133(date) +msgid "June 2002" +msgstr "2002年6月" + +#: C/gedit.xml:140(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit 手册 V2.2" + +#: C/gedit.xml:141(date) +msgid "August 2002" +msgstr "2002年8月" + +#: C/gedit.xml:148(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit 手册 V2.3" + +#: C/gedit.xml:149(date) +msgid "September 2002" +msgstr "2002年9月" + +#: C/gedit.xml:156(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit 手册 V2.4" + +#: C/gedit.xml:157(date) +msgid "January 2003" +msgstr "2003年1月" + +#: C/gedit.xml:164(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit 手册 V2.5" + +#: C/gedit.xml:165(date) +msgid "March 2003" +msgstr "2003年3月" + +#: C/gedit.xml:172(revnumber) +msgid "gedit Manual V2.6" +msgstr "gedit 手册 V2.6" + +#: C/gedit.xml:173(date) +msgid "September 2003" +msgstr "2003年9月" + +#: C/gedit.xml:180(revnumber) +msgid "gedit Manual V2.7" +msgstr "gedit 手册 V2.7" + +#: C/gedit.xml:181(date) +msgid "March 2004" +msgstr "2003年3月" + +#: C/gedit.xml:188(revnumber) +msgid "gedit Manual V2.8" +msgstr "gedit 手册 V2.8" + +#: C/gedit.xml:189(date) C/gedit.xml:197(date) +msgid "July 2006" +msgstr "2006年7月" + +#: C/gedit.xml:196(revnumber) +msgid "gedit Manual V2.9" +msgstr "gedit 手册 V2.9" + +#: C/gedit.xml:199(para) +msgid "MATE Documentation Team" +msgstr "MATE 文档小组" + +#: C/gedit.xml:204(releaseinfo) +msgid "This manual describes version 2.16 of gedit." +msgstr "本手册介绍 gedit 2.16 版。" + +#: C/gedit.xml:207(title) +msgid "Feedback" +msgstr "反馈" + +#: C/gedit.xml:208(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"要报告关于 gedit 应用程序或本手册的错误或提出建" +"议,请参照 MATE 反馈页 中的指导。" + +#: C/gedit.xml:213(para) +msgid "" +"gedit is a text editor for the MATE Desktop featuring basic yet robust " +"capabilities such as printing, spell checking, find and replace, and syntax " +"highlighting. More advanced features are available as plugins." +msgstr "" +"gedit 是一个 MATE 桌面环境下的文本编辑器,还可以对文档进行打印、拼写检查、查" +"找替换,以及高亮语法等。更更多的特性可以通过插件来实现。" + +#: C/gedit.xml:218(primary) +msgid "gedit" +msgstr "gedit" + +#: C/gedit.xml:219(primary) +msgid "text editor" +msgstr "文本编辑器" + +#: C/gedit.xml:224(title) +msgid "Introduction" +msgstr "简介" + +#: C/gedit.xml:229(para) +msgid "" +"The gedit application enables you to create and " +"edit text files." +msgstr "gedit 允许您创建和编辑文本文件。" + +#: C/gedit.xml:231(para) +msgid "" +"The aim of gedit is to be a simple and easy to " +"use text editor. More powerful features can be enabled with different " +"plugins, allowing a variety of tasks related to text-" +"editing." +msgstr "" +"gedit 的目标是,实现一个简单易用的文本编辑器。更强" +"大的功能可以通过不同的 插件,来实现执行各种文字编辑相" +"关的任务。" + +#: C/gedit.xml:235(title) +msgid "Getting Started" +msgstr "快速入门" + +#: C/gedit.xml:239(title) +msgid "Starting gedit" +msgstr "启动 gedit" + +#: C/gedit.xml:240(para) +msgid "You can start gedit in the following ways:" +msgstr "可以通过以下方式启动 gedit:" + +#: C/gedit.xml:243(term) +msgid "Applications menu" +msgstr "应用程序 菜单" + +#: C/gedit.xml:245(para) +msgid "" +"Choose AccessoriesText " +"Editor." +msgstr "" +"选择 附件文本编辑器。" + +#: C/gedit.xml:249(term) +msgid "Command line" +msgstr "命令行" + +#: C/gedit.xml:251(para) +msgid "Execute the following command: gedit" +msgstr "执行以下命令: gedit" + +#: C/gedit.xml:255(para) +msgid "" +"By default, when you open a text document in the file manager, gedit will " +"start, and display the document." +msgstr "" +"默认情况下,当您在文件管理器中打开一个文本文件,gedit 会自动运行,显示这个文" +"档。" + +#: C/gedit.xml:260(title) +msgid "The gedit Window" +msgstr "gedit 窗口" + +#: C/gedit.xml:261(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "在启动 gedit 时,系统会显示下面的窗口。" + +#: C/gedit.xml:264(title) +msgid "gedit Window" +msgstr "gedit 窗口" + +#: C/gedit.xml:270(phrase) +msgid "Shows gedit main window." +msgstr "显示 gedit 主窗口。" + +#: C/gedit.xml:276(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "该 gedit 窗口包含以下元件:" + +#: C/gedit.xml:279(term) +msgid "Menubar" +msgstr "菜单栏" + +#: C/gedit.xml:281(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"菜单栏上的菜单包含您在 gedit 中处理文件所需的所有" +"命令。" + +#: C/gedit.xml:284(term) +msgid "Toolbar" +msgstr "工具栏" + +#: C/gedit.xml:286(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "工具栏包含您可以从菜单栏访问的命令的子集。" + +#: C/gedit.xml:289(term) +msgid "Display area" +msgstr "显示区域" + +#: C/gedit.xml:291(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "该区域包含您正在编辑的文件的文本。" + +#: C/gedit.xml:294(term) +msgid "Statusbar" +msgstr "状态栏" + +#: C/gedit.xml:296(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items. The " +"statusbar also displays the following information:" +msgstr "" +"状态栏显示关于当前 gedit 活动的信息和菜单项的相关" +"信息。状态栏也显示下面的信息:" + +#: C/gedit.xml:299(para) +msgid "" +"Cursor position: the line number and column number where the cursor is " +"located." +msgstr "光标位置:显示光标所处的行号和列号。" + +#: C/gedit.xml:302(para) +msgid "" +"Edit mode: If the editor is in insert mode, the statusbar contains the text " +"INS. If the editor is in overwrite mode, the statusbar " +"contains the text OVR. Press the Insert key to change edit mode." +msgstr "" +"编辑模式:如果编辑器处于插入模式,则该状态栏显示 插入。" +"如果编辑器处于覆盖模式,状态栏显示 覆盖。按 " +"Insert 键切换两种编辑模式。" + +#: C/gedit.xml:307(term) +msgid "Side Pane" +msgstr "侧栏" + +#: C/gedit.xml:309(para) +msgid "" +"The side pane displays a list of open documents, and other information " +"depending on which plugins are enabled." +msgstr "侧栏中显示打开文档的列表,其他信息取决于您启用了哪些插件。" + +#: C/gedit.xml:310(para) +msgid "" +"By default the side pane is not shown. To show it, choose " +"ViewSide Pane." +msgstr "" +"默认侧边栏没有显示,要显示它,点菜单 查看侧边栏。" + +#: C/gedit.xml:313(term) +msgid "Bottom Pane" +msgstr "底部面板" + +#: C/gedit.xml:315(para) +msgid "" +"The bottom pane is used by programming tools such as the Python " +"Console plugin to display output." +msgstr "" +"底部面板用于一些编程工具,像 Python 控制台 插件," +"在这儿显示输出。" + +#: C/gedit.xml:316(para) +msgid "" +"By default the bottom pane is not shown. To show it, choose " +"ViewBottom Pane." +msgstr "" +"默认底部栏不显示,要显示它,点菜单 查看底部栏。" + +#: C/gedit.xml:320(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"当在 gedit 窗口中右击时,应用程序将会显示一个弹出" +"菜单。该弹出菜单包含最常用的文本编辑命令。" + +#: C/gedit.xml:322(para) +msgid "" +"Like other MATE applications, actions in gedit " +"can be performed in several ways: with the menu, with the toolbar, or with " +"shortcut keys. Shortcuts keys common to all applications are listed in the " +"User Guide." +msgstr "" +"像其它的 MATE 应用程序一样,运行 gedit 的方法有好" +"几种:可以用菜单,可以用工具栏,或者用快捷键。所有程序通用的快捷键列在 " +"用户指南 中。" + +#: C/gedit.xml:327(title) +msgid "Running gedit from a Command Line" +msgstr "从命令行运行 gedit" + +#: C/gedit.xml:328(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"您可以从命令行运行 gedit,并且打开一个文件或多个文" +"件。要从命令行打开多个文件,请键入下面的命令,然后按下回车" +"键:" + +#: C/gedit.xml:329(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: C/gedit.xml:329(command) +msgid "gedit " +msgstr "gedit " + +#: C/gedit.xml:330(para) +msgid "Alternatively, you can specify a URI instead of a filename." +msgstr "另外,您也可以指定一个 URI 作为文件名。" + +#: C/gedit.xml:331(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see the unix manual page for gedit, gedit1." +msgstr "" +"更多运行 gedit 的相关信息,请参阅: gedit1。" + +#: C/gedit.xml:336(title) +msgid "Working with Files" +msgstr "文件操作" + +#: C/gedit.xml:340(title) +msgid "Creating a New Document" +msgstr "创建新文档" + +#: C/gedit.xml:341(para) +msgid "" +"To create a new document, choose FileNew. The application " +"displays a new blank document in the gedit window." +msgstr "" +"要创建一个新文件,点菜单 文件新建" +"。在 gedit 窗口中,就会" +"显示一个新的空白文档。" + +#: C/gedit.xml:346(title) C/gedit.xml:1597(title) +msgid "Opening a File" +msgstr "打开文件" + +#: C/gedit.xml:347(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click Open. The file is displayed in the gedit " +"window." +msgstr "" +"要打开文件,点菜单 文件打开,出来一个 打开文件 对话框。选" +"择要打开的文件,然后点 确定。该文件就会显示在 " +"gedit 窗口中。" + +#: C/gedit.xml:349(phrase) +msgid "Shows Recent Files menu icon." +msgstr "显示最近访问过的文件菜单图标。" + +#: C/gedit.xml:349(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the icon on the toolbar to display the list of recent files." +msgstr "" +"应用程序会记住您最近编辑的五个文件,并显示在 文件 菜单中。您也可以点击工具栏上的 图标来" +"显示最近访问过的文件的列表。" + +#: C/gedit.xml:351(para) +msgid "" +"You can open multiple files in gedit. The " +"application adds a tab for each open file to the window. For more on this " +"see ." +msgstr "" +"您可以在 gedit 中打开多个文件。程序将为每个打开的" +"程序在窗口里增加一个标签。更多相关信息,请参阅:。" + +#: C/gedit.xml:357(title) +msgid "Saving a File" +msgstr "保存文件" + +#: C/gedit.xml:358(para) +msgid "You can save files in the following ways:" +msgstr "您可以使用以下几种方法来保存文件:" + +#: C/gedit.xml:360(para) +msgid "" +"To save changes to an existing file, choose FileSave." +msgstr "" +"要保存一个已经存在的文件,点菜单 文件保存 命令。" + +#: C/gedit.xml:362(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save As " +"dialog, then click Save." +msgstr "" +"要保存新文件或者用新的文件名保存一个现存的文件,请选择 " +"文件另存为。在 另" +"存为 对话框中输入文件名,然后点击 保存。" + +#: C/gedit.xml:364(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"如果要保存 gedit 中当前打开的所有文件,请选择 " +"文档全部保存。" + +#: C/gedit.xml:367(para) +msgid "" +"To close all of the files that are currently open in gedit, choose DocumentsClose All." +msgstr "" +"如果要关闭 gedit 中打开的所有文件,点菜单 " +"文档全部关闭。" + +#: C/gedit.xml:372(title) +msgid "Opening a File from a URI" +msgstr "从 URI 打开文件" + +#: C/gedit.xml:373(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform the " +"following steps:" +msgstr "要通过统一资源标识符 (URI) 打开文件,请执行以下步骤:" + +#: C/gedit.xml:376(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog." +msgstr "" +"点菜单 文件打开位置,出来一个 打开位置 对话框。" + +#: C/gedit.xml:379(para) +msgid "Enter the URI of the file that you want to open." +msgstr "输入您想打开文件的 URI。" + +#: C/gedit.xml:382(para) +msgid "" +"Use the Character coding drop-down list to select the " +"appropriate character coding." +msgstr "在 字符编码 下拉列表中,可以选择适当的字符编码。" + +#: C/gedit.xml:385(para) +msgid "Click Open." +msgstr "点 打开。" + +#: C/gedit.xml:388(para) +msgid "" +"Valid types of URI include http:, ftp:, file:, and all of the " +"methods supported by mate-vfs." +msgstr "" +"有效的 URI 包括 http:、" +"ftp:file: 和所有 mate-vfs 支持的格式。" + +#: C/gedit.xml:389(para) +msgid "" +"Files from some types of URI are opened as read-only, and any changes you " +"make must be saved to a different location. HTTP only allows files to be " +"read. Files opened from FTP are read-only because because not all FTP " +"servers may correctly work with saving remote files." +msgstr "" +"某些类型的 URI 会以只读方式打开,当您更改后必须另存到其他位置。 HTTP 只允许读" +"取文件。从 FTP 上打开的文件一般也是只读,因为并不是所有 FTP 服务器能够处理远" +"程保存文件。" + +#: C/gedit.xml:390(para) +msgid "" +"Saving to FTP servers can be enabled with Configuration Editor, " +"setting the key /apps/gedit-2/preferences/editor/save/" +"writable_vfs_schemes, but this may cause errors." +msgstr "" +"保存到远程服务器,可以通过 配置编辑器 来启用,设置 /" +"apps/gedit-2/preferences/editor/save/writable_vfs_schemes,但这" +"可能导致错误发生。" + +#: C/gedit.xml:395(title) +msgid "Working With Tabs" +msgstr "标签操作" + +#: C/gedit.xml:397(para) +msgid "" +"When more than one file is open, gedit shows a " +"tab for each document above the display area. To " +"switch to another document, click on its tab." +msgstr "" +"当打开多个文件时,gedit 在上边为每个文档显示一个 " +"tab,要切换文档,点击标签即可。" + +#: C/gedit.xml:398(para) +msgid "" +"To move a document to another gedit window, drag " +"the tab corresponding to the file to the window you want to move it to." +msgstr "" +"要移动文档到另外的 gedit 窗口,只要把这个文档标签" +"拖过去即可。" + +#: C/gedit.xml:399(para) +msgid "" +"To move a document to a new gedit window, either " +"drag its tab to the desktop, or choose DocumentsMove to New Window." +msgstr "" +"要移动一个文档到新的 gedit 窗口,或者拖动标签到桌" +"面上,也可以点菜单 文档移动到新窗" +"口。" + +#: C/gedit.xml:405(title) +msgid "Working with Text" +msgstr "文本操作" + +#: C/gedit.xml:409(title) +msgid "Editing Text" +msgstr "编辑文本" + +#: C/gedit.xml:410(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "您可以通过以下方法来编辑文件中的文本:" + +#: C/gedit.xml:412(para) +msgid "" +"Type new text from the keyboard. The blinking insertion cursor marks the point where new text appears. To change this, use the " +"arrow keys on the keyboard or click with the mouse." +msgstr "" +"通过键盘来输入文字。光标插入点 指示新的文本将输入到这" +"里。要插入到别处,可以用方向键或鼠标点击来改变光标插入点位置。" + +#: C/gedit.xml:414(para) +msgid "" +"To copy the selected text to the clipboard, choose " +"EditCopy." +msgstr "" +"要将选定的文本复制到剪贴板,点菜单 编辑复制。" + +#: C/gedit.xml:416(para) +msgid "" +"To delete the selected text from the file and move the selected text to the " +"clipboard, choose EditCut." +msgstr "" +"要将选定的文本剪切到剪贴板中,点菜单 编辑剪切。" + +#: C/gedit.xml:418(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"要从文件中永久删除选定的文本,点菜单 编辑删除。" + +#: C/gedit.xml:420(para) +msgid "" +"To insert the contents of the clipboard at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file, either from gedit or another application." +msgstr "" +"要在光标位置插入剪贴板中的内容,点菜单 编辑粘贴。您必须要在gedit 或其他" +"程序里,先剪切或者复制文本,然后才能粘贴文本。" + +#: C/gedit.xml:422(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"要选择文件中的所有文本,点菜单 编辑全部选定。" + +#: C/gedit.xml:428(title) +msgid "Undoing and Redoing Changes" +msgstr "撤销和重做" + +#: C/gedit.xml:429(para) +msgid "" +"To undo a change you have made, choose EditUndo. To reverse this " +"action, choose EditRedo." +msgstr "" +"要撤销你做的更改,点菜单 编辑撤销" +"。要恢复一个操作,点菜单 编辑" +"重做。" + +#: C/gedit.xml:434(title) +msgid "Finding and Replacing" +msgstr "查找和替换文本" + +#: C/gedit.xml:436(para) +msgid "" +"In gedit, there are two ways of searching for " +"text. You can use the Find dialog to search for a " +"specific piece of text, or Incremental Search to " +"highlight matching text as you type it." +msgstr "" +"在 gedit 中,有两种方法搜索文本。您可以使用 " +"查找 对话框来搜索指定的一段文字,也可以使用 增" +"量搜索 高亮匹配您输入的文本。" + +#: C/gedit.xml:441(title) +msgid "Finding Text" +msgstr "查找文本" + +#: C/gedit.xml:442(para) +msgid "To search a file for a string of text, perform the following steps:" +msgstr "要在文件中搜索文本字符串,请按以下步骤操作:" + +#: C/gedit.xml:444(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"点菜单 搜索查找,显示 查找 对话框。" + +#: C/gedit.xml:446(para) +msgid "" +"Type the string that you want to find in the Search for " +"field. You can include special characters such as a new line or tab: see " +"." +msgstr "" +"在 搜索框 里输入您要查找的字符串,可以包括换行符和制表" +"符,请参阅:。" + +#: C/gedit.xml:448(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string after your current cursor position. If " +"gedit finds the string, the application selects " +"first occurrence of the string. Other occurrences of the string are " +"highlighted." +msgstr "" +"点击 查找 就可以从当前位置开始搜索字符串。如果 " +"gedit 找到了该字符串,就会选中第一个匹配项,其他的" +"匹配项则会高亮显示。" + +#: C/gedit.xml:450(para) +msgid "" +"To find the next occurrence of the string, click Find " +"or choose SearchFind Next. To find the previous occurrence of the text, " +"choose SearchFind Previous." +msgstr "" +"要查找下一个匹配项,继续点 查找,也可以点菜单 " +"搜索查找下一个。要查找前一个匹配项,点菜单 搜索查找上一个。" + +#: C/gedit.xml:453(para) +msgid "" +"After you have closed the Find dialog, you can still " +"move the selection to other occurrences of the text by choosing " +"SearchFind Next and SearchFind " +"Previous." +msgstr "" +"关闭了 查找 对话框后,您还可以通过 " +"搜索查找下一个 命令,或者 " +"搜索查找上一个 ,来搜索另外的匹配项。" + +#: C/gedit.xml:454(para) +msgid "" +"To remove the highlighting from the text, choose " +"SearchClear Highlight." +msgstr "" +"要清除所有高亮文本,点菜单 搜索清" +"除高亮显示。" + +#: C/gedit.xml:458(title) +msgid "Incremental Search" +msgstr "增量搜索" + +#: C/gedit.xml:460(para) +msgid "" +"Incremental search highlights matching text in the document as you type it " +"letter by letter. (This is similar to the search feature in several web " +"browsers.)" +msgstr "" +"增量搜索会高亮匹配文档中,您要查找的文本。(这个特性类似于一些网页浏览器中的搜" +"索功能。)" + +#: C/gedit.xml:461(para) +msgid "" +"To start an incremental search, choose SearchIncremental Search. The " +"search box appears at the top of the display area." +msgstr "" +"要开始一个增量搜索,点菜单 搜索增" +"量搜索。在工作区顶部出现一个搜索框。" + +#: C/gedit.xml:462(para) +msgid "" +"Begin typing, and text that matches will be highlighted in the document. The " +"first instance after the cursor position is also selected." +msgstr "输入后,文档中匹配的文本都会高亮显示,第一个匹配项也会被选中。" + +#: C/gedit.xml:463(para) +msgid "" +"To advance the selection to the next match while keeping the incremental " +"search box open, press CtrlG. Press CtrlShiftG to go back to the previous match." +msgstr "" +"要想跳到第二个匹配项,按组合键 CtrlG。按 CtrlShiftG 回到前一个匹配项。" + +#: C/gedit.xml:464(para) +msgid "" +"You can also use the up and down arrow keys or the mouse wheel to move the " +"selection between matches." +msgstr "您也可以使用上下方向键或鼠标滚轮,在各个匹配项之前切换。" + +#: C/gedit.xml:469(title) +msgid "Replacing Text" +msgstr "替换文本" + +#: C/gedit.xml:471(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "" +"要在文件中搜索一个字符串,并用另一个字符串替换该字符串,请执行以下步骤:" + +#: C/gedit.xml:473(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"选择“搜索”“替换”,显示“替换”对话框。" + +#: C/gedit.xml:475(para) +msgid "" +"Type the string that you want to find, in the Search for field. You can include special characters such as a new line or " +"tab: see ." +msgstr "" +"在 搜索框 中输入您想查找的字符。还可以输入特殊字符,像换" +"行符或制表符,请参阅: 。" + +#: C/gedit.xml:476(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "" +"在 替换为 文本框中输入用来替换查找到的字符串的字符串。" + +#: C/gedit.xml:480(para) +msgid "" +"To examine each occurrence of the string before replacing it, click " +"Find. If gedit finds the " +"string, the application selects the string. Click Replace to replace the selected occurrence of the string. To find the " +"next occurrence of the string, click Find again." +msgstr "" +"在替换之前如果想检查一下,点击 查找,如果 " +"gedit 找到对应的字符,将会选中它,然后点 " +"替换,就可以替换找到的字符。要查找下一个匹配项,继续" +"点 查找。" + +#: C/gedit.xml:481(para) +msgid "" +"To replace all occurrences of the string throughout the document, click " +"Replace All." +msgstr "要替换文档中的所有匹配项,点 替换全部。" + +#: C/gedit.xml:486(title) +msgid "Find and Replace Options" +msgstr "查找和替换选项" + +#: C/gedit.xml:487(para) +msgid "" +"The Find dialog and the Replace " +"dialog both have the following options:" +msgstr "" +"查找 对话框和 替换 对话框,都有下面" +"的这些选项:" + +#: C/gedit.xml:489(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type. For example, " +"with Match case selected, \"TEXT\" will not match \"text" +"\"." +msgstr "" +"选中 区分大小写 选项,仅查找完全匹配大小写的字符串。例" +"如,选中 区分大小写, “TEXT”和“text”是不一样的。" + +#: C/gedit.xml:491(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type. For example, with Match entire word only " +"selected, \"text\" will not match \"texture\"." +msgstr "" +"选中 匹配整个单词 选项,只是查找那些与您键入文本的整个单" +"词相同的字符串。例如,选中了 匹配整个单词 选" +"项,“text”和“texture”是不匹配的。" + +#: C/gedit.xml:493(para) +msgid "" +"Select the Search backwards option to search backwards " +"towards the beginning of the document." +msgstr "选中 反向搜索,就会向着文件开头的方向搜索。" + +#: C/gedit.xml:495(para) +msgid "" +"Select the Wrap around option to search to one end of " +"the document and then continue the search from the other end of the file." +msgstr "" +"选中 回到头部继续搜索 选项,当搜索到文件尾以后,接着从文" +"件开头继续搜索。" + +#: C/gedit.xml:502(title) +msgid "Special Characters" +msgstr "特殊的字符" + +#: C/gedit.xml:503(para) +msgid "" +"You can include the following escape sequences in the text to find or " +"replace to represent special characters:" +msgstr "您可以在查找或替换文本中,包括下列转义字符:" + +#: C/gedit.xml:506(literal) +msgid "\\n" +msgstr "\\n" + +#: C/gedit.xml:508(para) +msgid "Specifies a new line." +msgstr "插入一个新行。" + +#: C/gedit.xml:512(literal) +msgid "\\t" +msgstr "\\t" + +#: C/gedit.xml:514(para) +msgid "Specifies a tab character." +msgstr "插入一个 Tab 制表符。" + +#: C/gedit.xml:518(literal) +msgid "\\r" +msgstr "\\r" + +#: C/gedit.xml:520(para) +msgid "Specifies a carriage return." +msgstr "插入一个回车符" + +#: C/gedit.xml:524(literal) +msgid "\\\\" +msgstr "\\\\" + +#: C/gedit.xml:526(para) +msgid "" +"The backslash character itself must be escaped if it is being searched for. " +"For example, if you are looking for the \"\\n\" literal, " +"you will have to type \"\\\\n\" in the Search for " +"field. Or if you are looking for a sequence of backslashes, you will have to " +"double the number of searched backslashes." +msgstr "" +"反斜杠转义字符在搜索时会被忽略。例如如果您想查找文字 \"\\n" +"\" ,您需要在 搜索框 里输入 \"\\\\n\"。或者如果您要查找" +"连续的反斜杠,您必须输入两个反斜杠来搜索它。" + +#: C/gedit.xml:538(title) +msgid "Positioning the Cursor on a Specific Line" +msgstr "将光标定位到指定的行" + +#: C/gedit.xml:540(para) +msgid "" +"To position the cursor on a specific line in the current file, choose " +"SearchGo to Line. The line number box appears at the top of the display area." +msgstr "" +"要把定位光标到当前文件指定的行,点菜单 搜索转到行。在工作区顶部出现一个" +"行号文本框。" + +#: C/gedit.xml:541(para) +msgid "" +"Begin typing the number of the line that you want to move the cursor to and " +"the document will scroll to the specified line." +msgstr "输入您想转到的行,文档会自动跳转到这一行显示。" + +#: C/gedit.xml:542(para) +msgid "" +"To dismiss the box and move the cursor to the specified line, press " +"Return." +msgstr "要去掉这个文本框,并将光标移到指定行,按一下 回车键。" + +#: C/gedit.xml:548(title) +msgid "Printing" +msgstr "打印" + +#: C/gedit.xml:552(title) +msgid "Setting the Page Options" +msgstr "设置页面选项" + +#: C/gedit.xml:554(para) +msgid "" +"To set the page options, choose FilePage Setup to display the " +"Page Setup dialog." +msgstr "" +"要设置页面选项,点菜单 文件页面设" +"置,出来一个 页面设置 对话" +"框。" + +#: C/gedit.xml:556(para) +msgid "" +"The Page Setup dialog enables you to specify the " +"following print options:" +msgstr "页面设置 对话框允许您设定下面这些打印选项:" + +#: C/gedit.xml:559(title) +msgid "General Tabbed Section" +msgstr "常规标签" + +#: C/gedit.xml:561(guilabel) +msgid "Print syntax highlighting" +msgstr "打印出高亮格式" + +#: C/gedit.xml:563(para) +msgid "" +"Select this option to print syntax highlighting. For more information about " +"syntax highlighting, see ." +msgstr "" +"选中此项,打印高亮语法格式。更多相关信息,请参阅:。" + +#: C/gedit.xml:566(guilabel) +msgid "Print page headers" +msgstr "打印页眉" + +#: C/gedit.xml:568(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "如果选择此选项,系统会在打印时打印每页的页眉。您不能配置页眉。" + +#: C/gedit.xml:571(guilabel) C/gedit.xml:1183(guilabel) +msgid "Line Numbers" +msgstr "行号" + +#: C/gedit.xml:574(para) +msgid "" +"Select the Print line numbers option to include line " +"numbers when you print a file." +msgstr "选中 打印行号 选项,打印文件时也包括行号。" + +#: C/gedit.xml:575(para) +msgid "" +"Use the Number every ... lines spin box to specify how " +"often to print the line numbers, for example every 5 lines, every 10 lines, " +"and so on." +msgstr "" +"在 每几行打印一次行 微调按钮框中,设定多久打印一次行号," +"例如每 5 行打印一次,每 10 行 打印一次,等等。" + +#: C/gedit.xml:578(guilabel) C/gedit.xml:1176(guilabel) C/gedit.xml:1693(para) +msgid "Text Wrapping" +msgstr "文本换行" + +#: C/gedit.xml:580(para) +msgid "" +"Select the Enable text wrapping option to wrap text " +"onto the next line, at a character level, when you print a file. The " +"application counts wrapped lines as one line for line numbering purposes." +msgstr "" +"选中 允许文本换行,当您打印一个文件时,将自动换行文本字" +"符。程序在统计行数时,将折行还是算作一行。" + +#: C/gedit.xml:582(para) +msgid "" +"Select the Do not split words over two lines option to " +"wrap text onto the next line, at a word level, when you print a file." +msgstr "" +"选中 不将一个单词拆在两行 选项,会将整个单词换到下一行," +"当您打印文件时,将自动换行文本单词。" + +#: C/gedit.xml:590(title) +msgid "Fonts" +msgstr "字体" + +#: C/gedit.xml:592(guilabel) +msgid "Body" +msgstr "正文" + +#: C/gedit.xml:594(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "单击此按钮可以选择打印文件正文文本所用的字体。" + +#: C/gedit.xml:597(guilabel) +msgid "Line numbers" +msgstr "行号" + +#: C/gedit.xml:600(para) +msgid "Click on this button to select the font to use to print line numbers." +msgstr "单击此按钮可以选择打印行号所用的字体。" + +#: C/gedit.xml:603(guilabel) +msgid "Headers and footers" +msgstr "页眉和页脚" + +#: C/gedit.xml:605(para) +msgid "" +"Click on this button to select the font to use to print the headers and " +"footers in a file." +msgstr "单击此按钮可以选择打印文件页眉、页脚所用的字体。" + +#: C/gedit.xml:609(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit, click Restore Default Fonts." +msgstr "" +"要在 gedit 中,将打印字体恢复到默认字体,点击 " +"恢复为默认字体。" + +#: C/gedit.xml:616(title) +msgid "Printing a Document" +msgstr "打印文档" + +#: C/gedit.xml:617(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "您可以使用 gedit 来执行以下打印操作:" + +#: C/gedit.xml:619(para) +msgid "Print a document to a printer." +msgstr "用打印机来打印文档。" + +#: C/gedit.xml:621(para) +msgid "Print the output of the print command to a file." +msgstr "将打印命令的输出打印到文件中。" + +#: C/gedit.xml:624(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"如果是打印到文件中,gedit 会将该文件的输出发送到一" +"个印前格式的文件中。最常用的印前格式是 PostScript 格式和可移植文档格式 " +"(PDF)。" + +#: C/gedit.xml:626(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"要预览要打印的页面,请选择 文件打" +"印预览。" + +#: C/gedit.xml:628(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"要将当前文件打印到打印机或者一个文件中,点菜单 文件打印,显示 打印 对话框。" + +#: C/gedit.xml:630(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "打印 对话框允许您指定以下打印选项:" + +#: C/gedit.xml:633(title) +msgid "Job Tabbed Section" +msgstr "任务区段" + +#: C/gedit.xml:635(guilabel) +msgid "Print range" +msgstr "打印范围" + +#: C/gedit.xml:637(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "选择以下一个选项,以确定要打印的页数:" + +#: C/gedit.xml:640(guilabel) +msgid "All" +msgstr "全部" + +#: C/gedit.xml:641(para) +msgid "Select this option to print all of the pages in the file." +msgstr "如果选择该选项,将打印文件中的所有页。" + +#: C/gedit.xml:644(guilabel) +msgid "Lines" +msgstr "行" + +#: C/gedit.xml:645(para) +msgid "" +"Select this option to print the specified lines only. Use the " +"From and To spin boxes to specify " +"the line range." +msgstr "" +"选中此项,仅打印指定行。使用 微调按钮框,指定打印行的范围。" + +#: C/gedit.xml:648(guilabel) +msgid "Selection" +msgstr "选定范围" + +#: C/gedit.xml:649(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "如果选择该选项,将只打印选定的文本。该选项只有在选定了文本时才可用。" + +#: C/gedit.xml:655(guilabel) +msgid "Copies" +msgstr "副本" + +#: C/gedit.xml:657(para) +msgid "" +"Use the Number of copies spin box to specify the number " +"of copies of the file that you want to print." +msgstr "点击 副本数 微调按钮框,指定您想打印的份数。" + +#: C/gedit.xml:658(para) +msgid "" +"If you print multiple copies of the file, select the Collate option to collate the printed copies." +msgstr "" +"如果您要该文件的多个副本,则可以 顺序 选项中指定副本打印" +"的顺序。" + +#: C/gedit.xml:665(title) +msgid "Printer Tabbed Section" +msgstr "打印机标签段" + +#: C/gedit.xml:667(guilabel) +msgid "Printer" +msgstr "打印机" + +#: C/gedit.xml:669(para) +msgid "" +"Use this drop-down list to select the printer to which you want to print the " +"file." +msgstr "点击下拉列表,选择您想要用来打印文件的打印机。" + +#: C/gedit.xml:672(guilabel) +msgid "Settings" +msgstr "设置" + +#: C/gedit.xml:674(para) +msgid "Use this drop-down list to select the printer settings." +msgstr "点击下拉列表,设定打印机选项。" + +#: C/gedit.xml:676(para) +msgid "" +"To configure the printer, click Configure. For " +"example, you can enable or disable duplex printing, or schedule delayed " +"printing, if this functionality is supported by the printer." +msgstr "" +"要配置打印机,点 配置。例如,你可以启用或禁用双面打" +"印,或放入打印队列中,如果打印机支持此项功能。" + +#: C/gedit.xml:680(guilabel) +msgid "Location" +msgstr "位置" + +#: C/gedit.xml:682(para) +msgid "" +"Use this drop-down list to select one of the following print destinations:" +msgstr "点击下拉列表,选择下面一个打印目标:" + +#: C/gedit.xml:687(guilabel) +msgid "CUPS" +msgstr "CUPS" + +#: C/gedit.xml:689(para) +msgid "Print the file to a CUPS printer." +msgstr "将文件打印到 CUPS 打印机。" + +#: C/gedit.xml:693(para) +msgid "" +"If the selected printer is a CUPS printer, CUPS is the " +"only entry in this drop-down list." +msgstr "" +"如果选择的打印机是一个 CUPS 打印机,CUPS 是下拉列表中的" +"唯一一项。" + +#: C/gedit.xml:700(guilabel) +msgid "lpr" +msgstr "lpr" + +#: C/gedit.xml:702(para) +msgid "Print the file to a printer." +msgstr "将文件打印到打印机。" + +#: C/gedit.xml:708(guilabel) +msgid "File" +msgstr "文件" + +#: C/gedit.xml:710(para) +msgid "Print the file to a PostScript file." +msgstr "将文件打印输出到一个 PostScript 文件中。" + +#: C/gedit.xml:713(para) +msgid "" +"Click Save As to display a dialog where you specify " +"the name and location of the PostScript file." +msgstr "" +"点 另存为 出来一个对话框,您可以指定 PostScript 文件保" +"存的位置和文件名。" + +#: C/gedit.xml:719(guilabel) +msgid "Custom" +msgstr "自定义" + +#: C/gedit.xml:721(para) +msgid "Use the specified command to print the file." +msgstr "使用指定的命令来打印文件。" + +#: C/gedit.xml:724(para) +msgid "" +"Type the name of the command in the text box. Include all command-line " +"arguments." +msgstr "在文本框中输入命令的名称,包括所有的命令行参数。" + +#: C/gedit.xml:732(guilabel) +msgid "State" +msgstr "状态" + +#: C/gedit.xml:734(para) C/gedit.xml:740(para) C/gedit.xml:746(para) +msgid "This functionality is not supported in this version of gedit." +msgstr "在这个版本的 gedit 中,不支持这个功能。" + +#: C/gedit.xml:738(guilabel) +msgid "Type" +msgstr "类型" + +#: C/gedit.xml:744(guilabel) +msgid "Comment" +msgstr "注释" + +#: C/gedit.xml:754(title) +msgid "Paper Tabbed Section" +msgstr "纸张标签段" + +#: C/gedit.xml:756(guilabel) +msgid "Paper size" +msgstr "纸张大小" + +#: C/gedit.xml:758(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "使用此下拉列表可以选择您用来打印该文件的纸张的大小。" + +#: C/gedit.xml:761(guilabel) +msgid "Width" +msgstr "纸张宽度" + +#: C/gedit.xml:763(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit." +msgstr "点击微调按钮框指定纸张宽度,在旁边的下拉列表中可以更改用度量单位。" + +#: C/gedit.xml:766(guilabel) +msgid "Height" +msgstr "纸张高度" + +#: C/gedit.xml:768(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "使用此微调按钮框可以指定纸张高度。" + +#: C/gedit.xml:771(guilabel) +msgid "Feed orientation" +msgstr "送纸方向" + +#: C/gedit.xml:773(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "使用此下拉列表可以选择打印机中的纸张方向。" + +#: C/gedit.xml:776(guilabel) +msgid "Page orientation" +msgstr "纸张方向" + +#: C/gedit.xml:778(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "使用此下拉列表可以选择纸张方向。" + +#: C/gedit.xml:781(guilabel) +msgid "Layout" +msgstr "布局" + +#: C/gedit.xml:783(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"使用此下拉列表可以选择纸张布局。您选择的每个布局的预览会显示在 预览" +"区域中。" + +#: C/gedit.xml:786(guilabel) +msgid "Paper tray" +msgstr "纸盘" + +#: C/gedit.xml:788(para) +msgid "Use this drop-down list to select the paper tray." +msgstr "点下拉列表,选择纸盘。" + +#: C/gedit.xml:799(title) +msgid "Programming Features" +msgstr "程序特性" + +#: C/gedit.xml:801(para) +msgid "" +"Several of gedit's features for programming are " +"provided with plugins. For example, the Tag List plugin provides a list of " +"commonly-used tags for different markup languages: see ." +msgstr "" +"gedit 的一些特性由插件提供。例如,标记列表插件提供" +"一个不同标记语言的常用标记列表:请参阅 。" + +#: C/gedit.xml:805(title) +msgid "Syntax Highlighting" +msgstr "高亮语法格式" + +#: C/gedit.xml:806(para) +msgid "" +"Syntax highlighting makes source code easier to read by showing different " +"parts of the text in different colors." +msgstr "高亮语法格式,将不同部分文本显示不同颜色,使得源代码更容易阅读。" + +#: C/gedit.xml:808(para) +msgid "" +"gedit chooses an appropriate syntax highlighting " +"mode based on a document's type. To override the syntax highlighting mode, " +"choose ViewHighlight Mode, then choose one of the following menu items:" +msgstr "" +"gedit 针对文本的类型,选择一个合适的高亮语法模式。" +"要替换高亮语法模式,点菜单 查看高" +"亮语法模式,然后选择下面的一种。" + +#: C/gedit.xml:811(guimenuitem) +msgid "Normal" +msgstr "普通" + +#: C/gedit.xml:813(para) +msgid "Do not display any syntax highlighting." +msgstr "不显示高亮语法格式" + +#: C/gedit.xml:817(guisubmenu) +msgid "Sources" +msgstr "源代码" + +#: C/gedit.xml:819(para) +msgid "" +"Display syntax highlighting to edit source code. Use the " +"Sources submenu to select the source code type." +msgstr "" +"显示编辑源代码的高亮语法格式。在 源代码 子菜单中,再" +"选择源代码类型。" + +#: C/gedit.xml:823(guisubmenu) +msgid "Markup" +msgstr "标记语言" + +#: C/gedit.xml:825(para) +msgid "" +"Display syntax highlighting to edit markup code. Use the Markup submenu to select the markup code type." +msgstr "" +"显示标记语言的高亮语法格式。在 guisubmenu>标记语言 子菜单中选择" +"一种标记语言类型。" + +#: C/gedit.xml:829(guisubmenu) +msgid "Scripts" +msgstr "脚本" + +#: C/gedit.xml:831(para) +msgid "" +"Display syntax highlighting to edit script code. Use the " +"Scripts submenu to select the script code type." +msgstr "" +"显示编辑脚本语言的高亮语法格式。在 脚本语言 子菜单" +"中,选择一种脚本语言类型。" + +#: C/gedit.xml:835(guisubmenu) +msgid "Others" +msgstr "其他" + +#: C/gedit.xml:837(para) +msgid "" +"Display syntax highlighting to edit other types of code. Use the " +"Others submenu to select the code type." +msgstr "" +"显示编辑其他代码的高亮语法格式。在 其他 子菜单中选择" +"一种代码类型。" + +#: C/gedit.xml:845(title) +msgid "Piping the Output of a Command to a File" +msgstr "通过管道命令输出到文件" + +#: C/gedit.xml:846(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"您可以使用 gedit 将命令的输出输送到文本文件中。例" +"如,要将 ls 命令的输出输送到一个文本文件中,输入 " +"ls | gedit,然后按 回车键。" + +#: C/gedit.xml:847(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"ls 命令的输出就会显示在 gedit " +"窗口的一个新文件中。" + +#: C/gedit.xml:848(para) +msgid "" +"Alternatively, you can use the External tools " +"plugin to pipe command output to the current file." +msgstr "" +"另外,您也可以使用外部工具 插件,把命令输出到当前" +"文件。" + +#: C/gedit.xml:854(title) +msgid "Shortcut Keys" +msgstr "快捷键" + +#: C/gedit.xml:855(para) +msgid "" +"Use shortcut keys to perform common tasks more quickly than with the mouse " +"and menus. The following tables list all of gedit's shortcut keys." +msgstr "" +"使用快捷键执行常用任务,比用鼠标和菜单要快。下表列出了 gedit 的常用快捷键。" + +#: C/gedit.xml:856(para) +msgid "" +"For more on shortcut keys, see the Desktop User Guide." +msgstr "" +"更多快捷键,请参阅:桌面用户指南。" + +#. ============= Tabs ======================== +#: C/gedit.xml:859(bridgehead) C/gedit.xml:1215(guilabel) +msgid "Tabs" +msgstr "制表符" + +#: C/gedit.xml:860(para) +msgid "Shortcuts for tabs:" +msgstr "标签快捷键:" + +#: C/gedit.xml:868(para) C/gedit.xml:912(para) C/gedit.xml:968(para) +#: C/gedit.xml:1024(para) C/gedit.xml:1052(para) C/gedit.xml:1099(para) +#: C/gedit.xml:1142(para) +msgid "Shortcut Key" +msgstr "快捷键" + +#: C/gedit.xml:870(para) C/gedit.xml:914(para) C/gedit.xml:970(para) +#: C/gedit.xml:1026(para) C/gedit.xml:1054(para) C/gedit.xml:1101(para) +#: C/gedit.xml:1144(para) +msgid "Command" +msgstr "命令" + +#: C/gedit.xml:875(para) +msgid "Ctrl + Alt + PageUp" +msgstr "Ctrl + Alt + PageUp" + +#: C/gedit.xml:876(para) +msgid "Switches to the next tab to the left." +msgstr "切换到左边的标签页。" + +#: C/gedit.xml:879(para) +msgid "Ctrl + Alt + PageDown" +msgstr "Ctrl + Alt + PageDown" + +#: C/gedit.xml:880(para) +msgid "Switches to the next tab to the right." +msgstr "切换到右边的标签页。" + +#: C/gedit.xml:883(para) C/gedit.xml:947(para) +msgid "Ctrl + W" +msgstr "Ctrl + W" + +#: C/gedit.xml:884(para) +msgid "Close tab." +msgstr "关闭标签页。" + +#: C/gedit.xml:887(para) +msgid "Ctrl + Shift + L" +msgstr "Ctrl + Shift + L" + +#: C/gedit.xml:888(para) +msgid "Save all tabs." +msgstr "保存全部标签页。" + +#: C/gedit.xml:891(para) +msgid "Ctrl + Shift + W" +msgstr "Ctrl + Shift + W" + +#: C/gedit.xml:892(para) +msgid "Close all tabs." +msgstr "关闭全部标签页。" + +#: C/gedit.xml:895(para) +msgid "Alt + n" +msgstr "Alt + n" + +#: C/gedit.xml:896(para) +msgid "Jump to nth tab." +msgstr "跳到第 n 个标签页(n 是数字)。" + +#. ============= Files ======================== +#: C/gedit.xml:903(bridgehead) +msgid "Files" +msgstr "文件" + +#: C/gedit.xml:904(para) +msgid "Shortcuts for working with files:" +msgstr "文件操作的快捷键:" + +#: C/gedit.xml:919(para) +msgid "Ctrl + N" +msgstr "Ctrl + N" + +#: C/gedit.xml:920(para) +msgid "Create a new document." +msgstr "创建新文件" + +#: C/gedit.xml:923(para) +msgid "Ctrl + O" +msgstr "Ctrl + O" + +#: C/gedit.xml:924(para) +msgid "Open a document." +msgstr "打开文档。" + +#: C/gedit.xml:927(para) +msgid "Ctrl + L" +msgstr "Ctrl + L" + +#: C/gedit.xml:928(para) +msgid "Open a location." +msgstr "打开位置。" + +#: C/gedit.xml:931(para) +msgid "Ctrl + S" +msgstr "Ctrl + S" + +#: C/gedit.xml:932(para) +msgid "Save the current document to disk." +msgstr "保存当前文档。" + +#: C/gedit.xml:935(para) +msgid "Ctrl + Shift + S" +msgstr "Ctrl + Shift + S" + +#: C/gedit.xml:936(para) +msgid "Save the current document with a new filename." +msgstr "用一个新的文件名保存当前文档。" + +#: C/gedit.xml:939(para) +msgid "Ctrl + P" +msgstr "Ctrl + P" + +#: C/gedit.xml:940(para) +msgid "Print the current document." +msgstr "打印当前文档。" + +#: C/gedit.xml:943(para) +msgid "Ctrl + Shift + P" +msgstr "Ctrl + Shift + P" + +#: C/gedit.xml:944(para) +msgid "Print preview." +msgstr "打印预览。" + +#: C/gedit.xml:948(para) +msgid "Close the current document." +msgstr "关闭当前文档。" + +#: C/gedit.xml:951(para) +msgid "Ctrl + Q" +msgstr "Ctrl + Q" + +#: C/gedit.xml:952(para) +msgid "Quit Gedit." +msgstr "退出 Gedit。" + +#. ============= Edit ======================= +#: C/gedit.xml:959(bridgehead) C/gedit.xml:1414(guimenu) +#: C/gedit.xml:1420(guimenu) C/gedit.xml:1426(guimenu) +#: C/gedit.xml:1432(guimenu) +msgid "Edit" +msgstr "编辑" + +#: C/gedit.xml:960(para) +msgid "Shortcuts for editing documents:" +msgstr "编辑文档的快捷键:" + +#: C/gedit.xml:975(para) +msgid "Ctrl + Z" +msgstr "Ctrl + Z" + +#: C/gedit.xml:976(para) +msgid "Undo the last action." +msgstr "撤销上一次操作。" + +#: C/gedit.xml:979(para) +msgid "Ctrl + Shift + Z" +msgstr "Ctrl + Shift + Z" + +#: C/gedit.xml:980(para) +msgid "Redo the last undone action ." +msgstr "重做最上一次的撤销操作。" + +#: C/gedit.xml:983(para) +msgid "Ctrl + X" +msgstr "Ctrl + X" + +#: C/gedit.xml:984(para) +msgid "Cut the selected text or region and place it on the clipboard." +msgstr "剪切选中的文本或区域,并放到剪贴板中。" + +#: C/gedit.xml:987(para) +msgid "Ctrl + C" +msgstr "Ctrl + C" + +#: C/gedit.xml:988(para) +msgid "Copy the selected text or region onto the clipboard." +msgstr "复制选中的文本或区域,并放到剪贴板中。" + +#: C/gedit.xml:991(para) +msgid "Ctrl + V" +msgstr "Ctrl + V" + +#: C/gedit.xml:992(para) +msgid "Paste the contents of the clipboard." +msgstr "从剪贴板中粘贴内容。" + +#: C/gedit.xml:995(para) +msgid "Ctrl + A" +msgstr "Ctrl + A" + +#: C/gedit.xml:996(para) +msgid "Select all." +msgstr "全选" + +#: C/gedit.xml:999(para) +msgid "Ctrl + D" +msgstr "Ctrl + D" + +#: C/gedit.xml:1000(para) +msgid "Delete current line." +msgstr "删除当前行。" + +#: C/gedit.xml:1003(para) +msgid "Alt + Up" +msgstr "Alt + Up" + +#: C/gedit.xml:1004(para) +msgid "Move the selected line up one line." +msgstr "将选中的行上移一行。" + +#: C/gedit.xml:1007(para) +msgid "Alt + Down" +msgstr "Alt + Down" + +#: C/gedit.xml:1008(para) +msgid "Move the selected line down one line." +msgstr "将选中的行下移一行。" + +#. ============= Panes ======================= +#: C/gedit.xml:1015(bridgehead) +msgid "Panes" +msgstr "面板" + +#: C/gedit.xml:1016(para) +msgid "Shortcuts for showing and hiding panes:" +msgstr "显示和隐藏面板的快捷键:" + +#: C/gedit.xml:1031(para) +msgid "F9" +msgstr "F9" + +#: C/gedit.xml:1032(para) +msgid "Show/hide the side pane." +msgstr "显示/隐藏侧边栏。" + +#: C/gedit.xml:1035(para) +msgid "Ctrl + F9" +msgstr "Ctrl + F9" + +#: C/gedit.xml:1036(para) +msgid "Show/hide the bottom pane." +msgstr "显示/隐藏底边栏。" + +#. ============= Search ======================= +#: C/gedit.xml:1043(bridgehead) +msgid "Search" +msgstr "搜索" + +#: C/gedit.xml:1044(para) +msgid "Shortcuts for searching:" +msgstr "搜索的快捷键:" + +#: C/gedit.xml:1059(para) +msgid "Ctrl + F" +msgstr "Ctrl + F" + +#: C/gedit.xml:1060(para) +msgid "Find a string." +msgstr "查找字符串。" + +#: C/gedit.xml:1063(para) +msgid "Ctrl + G" +msgstr "Ctrl + G" + +#: C/gedit.xml:1064(para) +msgid "Find the next instance of the string." +msgstr "查找下一个匹配的字符串。" + +#: C/gedit.xml:1067(para) +msgid "Ctrl + Shift + G" +msgstr "Ctrl + Shift + G" + +#: C/gedit.xml:1068(para) +msgid "Find the previous instance of the string." +msgstr "查找前一个匹配的字符串。" + +#: C/gedit.xml:1071(para) +msgid "Ctrl + K" +msgstr "Ctrl + K" + +#: C/gedit.xml:1072(para) +msgid "Interactive search." +msgstr "交互式搜索。" + +#: C/gedit.xml:1075(para) +msgid "Ctrl + H" +msgstr "Ctrl + H" + +#: C/gedit.xml:1076(para) +msgid "Search and replace." +msgstr "查找并替换" + +#: C/gedit.xml:1079(para) +msgid "Ctrl + Shift + K" +msgstr "Ctrl + Shift + K" + +#: C/gedit.xml:1080(para) +msgid "Clear highlight." +msgstr "清除高亮显示。" + +#: C/gedit.xml:1083(para) +msgid "Ctrl + I" +msgstr "Ctrl + I" + +#: C/gedit.xml:1084(para) +msgid "Goto line." +msgstr "跳转到行。" + +#. ============= Tools ======================= +#: C/gedit.xml:1090(bridgehead) +msgid "Tools" +msgstr "工具" + +#: C/gedit.xml:1091(para) +msgid "Shortcuts for tools:" +msgstr "工具快捷键:" + +#: C/gedit.xml:1106(para) +msgid "Shift + F7" +msgstr "Shift + F7" + +#: C/gedit.xml:1107(para) +msgid "Check spelling (with plugin)." +msgstr "检查拼写(使用插件)。" + +#: C/gedit.xml:1110(para) +msgid "Alt + F12" +msgstr "Alt + F12" + +#: C/gedit.xml:1111(para) +msgid "Remove trailing spaces (with plugin)." +msgstr "删除尾部空格(使用插件)。" + +#: C/gedit.xml:1114(para) +msgid "Ctrl + T" +msgstr "Ctrl + T" + +#: C/gedit.xml:1115(para) +msgid "Indent (with plugin)." +msgstr "缩进(使用插件)。" + +#: C/gedit.xml:1118(para) +msgid "Ctrl + Shift + T" +msgstr "Ctrl + Shift + T" + +#: C/gedit.xml:1119(para) +msgid "Remove Indent (with plugin)." +msgstr "清除缩进(使用插件)。" + +#: C/gedit.xml:1122(para) +msgid "F8" +msgstr "F8" + +#: C/gedit.xml:1123(para) +msgid "Run \"make\" in current directory (with plugin)." +msgstr "在当前文件夹运行“make”命令(用插件)。" + +#: C/gedit.xml:1126(para) +msgid "Ctrl + Shift + D" +msgstr "Ctrl + Shift + D" + +#: C/gedit.xml:1127(para) +msgid "Directory listing (with plugin)." +msgstr "文件夹列表(使用插件)。" + +#. ============= Help ======================= +#: C/gedit.xml:1133(bridgehead) +msgid "Help" +msgstr "帮助" + +#: C/gedit.xml:1134(para) +msgid "Shortcuts for help:" +msgstr "帮助的快捷键:" + +#: C/gedit.xml:1149(para) +msgid "F1" +msgstr "F1" + +#: C/gedit.xml:1150(para) +msgid "Open gedit's user manual." +msgstr "打开 gedit 的用户手册。" + +#: C/gedit.xml:1162(title) +msgid "Preferences" +msgstr "首选项" + +#: C/gedit.xml:1164(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"要配置 gedit,点菜单 编辑首选项首选项 对话框包含以下类别:" + +#: C/gedit.xml:1173(title) +msgid "View Preferences" +msgstr "查看" + +#: C/gedit.xml:1178(para) +msgid "" +"Select the Enable text wrapping option to have long " +"lines of text flow into paragraphs instead of running off the edge of the " +"text window. This avoids having to scroll horizontally" +msgstr "" +"选中 允许文本换行 选项,长的文本行会折行,而不是跑到文本" +"窗口外边。这就不需要使用水平滚动条。" + +#: C/gedit.xml:1179(para) +msgid "" +"Select the Do not split words over two lines option to " +"have the text wrapping option preserve whole words when flowing text to the " +"next line. This makes text easier to read." +msgstr "" +"选中 不将一个单词拆在两行 选项,会将整个单词换到下一行," +"使文本更容易阅读。" + +#: C/gedit.xml:1185(para) +msgid "" +"Select the Display line numbers option to display line " +"numbers on the left side of the gedit window." +msgstr "" +"选中 显示行号,在 gedit 窗口" +"的左侧显示行号。" + +#: C/gedit.xml:1189(guilabel) +msgid "Current Line" +msgstr "当前行" + +#: C/gedit.xml:1191(para) +msgid "" +"Select the Highlight current line option to highlight " +"the line where the cursor is placed." +msgstr "" +"选中 高亮显示当前行 选项,光标所在的行会高亮显示。" + +#: C/gedit.xml:1195(guilabel) +msgid "Right Margin" +msgstr "右边距" + +#: C/gedit.xml:1197(para) +msgid "" +"Select the Display right margin option to display a " +"vertical line that indicates the right margin." +msgstr "选中 显示右边距 选项,显示一条竖线指示右边距。" + +#: C/gedit.xml:1198(para) +msgid "" +"Use the Right margin at column spin box to specify the " +"location of the vertical line." +msgstr "" +"在 右边距位于列 微调按钮框,指定竖线所在的列号位置。" + +#: C/gedit.xml:1202(guilabel) +msgid "Bracket Matching" +msgstr "括号匹配" + +#: C/gedit.xml:1204(para) +msgid "" +"Select the Highlight matching bracket option to " +"highlight the corresponding bracket when the cursor is positioned on a " +"bracket character." +msgstr "" +"选中 高亮显示匹配的括号 选项,当光标位于括号位置时,高亮" +"显示匹配的另一个括号。" + +#: C/gedit.xml:1212(title) +msgid "Editor Preferences" +msgstr "编辑器" + +#: C/gedit.xml:1217(para) +msgid "" +"Use the Tab width spin box to specify the width of the " +"space that gedit inserts when you press the " +"Tab key." +msgstr "" +"在 Tab 宽度 微调按钮框里,指定当您按下 Tab 键时,gedit 插入的空格宽度。" + +#: C/gedit.xml:1218(para) +msgid "" +"Select the Insert spaces instead of tabs option to " +"specify that gedit inserts spaces instead of a " +"tab character when you press the Tab key." +msgstr "" +"选中 插入空格替代制表符,指定当您按下 Tab 键时,gedit 插入空格而不是制表符。" + +#: C/gedit.xml:1222(guilabel) +msgid "Auto Indentation" +msgstr "自动缩进" + +#: C/gedit.xml:1224(para) +msgid "" +"Select the Enable auto indentation option to specify " +"that the next line starts at the indentation level of the current line." +msgstr "选中 启用自动缩进,指定下一行在缩进后再开始。" + +#: C/gedit.xml:1228(guilabel) +msgid "File Saving" +msgstr "保存文件" + +#: C/gedit.xml:1230(para) +msgid "" +"Select the Create a backup copy of files before saving " +"option to create a backup copy of a file each time you save the file. The " +"backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"选中 在保存之前创建一个文件备份,在每次保存文件的时候创" +"建文件的备份副本。备份文件的文件名的末尾包含一个 ~。" + +#: C/gedit.xml:1231(para) +msgid "" +"Select the Autosave files every ... minutes option to " +"automatically save the current file at regular intervals. Use the spin box " +"to specify how often you want to save the file." +msgstr "" +"选中 自动保存,每隔...分钟,在指定的时间间隔后,会自动保" +"存当前文件。使用微调按钮框可以指定多久保存一次文件。" + +#: C/gedit.xml:1238(title) +msgid "Font & Colors Preferences" +msgstr "字体和颜色选项" + +#: C/gedit.xml:1241(guilabel) +msgid "Font" +msgstr "字体" + +#: C/gedit.xml:1243(para) +msgid "" +"Select the Use default theme font option to use the " +"default system font for the text in the gedit " +"text window." +msgstr "" +"选中 使用默认主题字体, 该选项,将在 " +"gedit 文本窗口中使用默认系统字体来显示文本。" + +#: C/gedit.xml:1244(para) +msgid "" +"The Editor font field displays the font that " +"gedit uses to display text. Click on the button " +"to specify the font type, style, and size to use for text." +msgstr "" +"编辑器字体 显示 gedit 用来显" +"示文本的字体。 单击该按钮可以指定文本使用的字体、样式和大小。" + +#: C/gedit.xml:1248(guilabel) +msgid "Color Scheme" +msgstr "颜色方案" + +#: C/gedit.xml:1250(para) +msgid "" +"You can choose a color scheme from the list of color schemes. By default, " +"the following color schemes are installed:" +msgstr "" +"您可以从颜色方案列表中选择一种颜色方案。默认情况下,安装有下面的颜色方案:" + +#: C/gedit.xml:1253(guilabel) +msgid "Classic" +msgstr "经典" + +#: C/gedit.xml:1255(para) +msgid "Classic color scheme based on the gvim color scheme." +msgstr "基于 gvim 颜色方案的经典颜色方案。" + +#: C/gedit.xml:1259(guilabel) +msgid "Cobalt" +msgstr "Cobalt" + +#: C/gedit.xml:1261(para) +msgid "Blue based color scheme." +msgstr "蓝色主题颜色方案。" + +#: C/gedit.xml:1265(guilabel) +msgid "Kate" +msgstr "Kate" + +#: C/gedit.xml:1267(para) +msgid "Color scheme used in the Kate text editor." +msgstr "用于 Kate 文本编辑器的颜色方案。" + +#: C/gedit.xml:1271(guilabel) +msgid "Oblivion" +msgstr "Oblivion" + +#: C/gedit.xml:1273(para) +msgid "Dark color scheme using the Tango color palette." +msgstr "用于 Tango 调色板的黑色主题方案。" + +#: C/gedit.xml:1277(guilabel) +msgid "Tango" +msgstr "Tango" + +#: C/gedit.xml:1279(para) +msgid "Color scheme using the Tango color scheme." +msgstr "用于 Tango 的颜色方案。" + +#: C/gedit.xml:1283(para) +msgid "" +"You can add a new color scheme by clicking on Add..., " +"and selecting a color scheme file" +msgstr "" +"您可以通过点击 添加...,选择一个颜色方案文件,来添加一个" +"新的颜色方案" + +#: C/gedit.xml:1284(para) +msgid "" +"You can remove the selected color scheme by clicking on Remove" +msgstr "您可以通过点击 删除,删除选中的颜色方案" + +#: C/gedit.xml:1291(title) +msgid "Plugins Preferences" +msgstr "插件" + +#: C/gedit.xml:1292(para) +msgid "" +"Plugins add extra features to gedit. For more " +"information on plugins and how to use the built-in plugins, see ." +msgstr "" +"通过插件给 gedit 添加扩展特性。更多相关信息,请参" +"阅:。" + +#: C/gedit.xml:1296(title) +msgid "Enabling a Plugin" +msgstr "启用一个插件" + +#: C/gedit.xml:1297(para) +msgid "" +"To enable a gedit plugin, perform the following " +"steps:" +msgstr "要启用一个 gedit 插件,请安下面的步骤操作:" + +#: C/gedit.xml:1300(para) C/gedit.xml:1321(para) C/gedit.xml:1643(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"点菜单 编辑首选项。" + +#: C/gedit.xml:1303(para) C/gedit.xml:1324(para) C/gedit.xml:1646(para) +msgid "Select the Plugins tab." +msgstr "点击 插件 标签。" + +#: C/gedit.xml:1306(para) +msgid "" +"Select the check box next to the name of the plugin that you want to enable." +msgstr "选中您想启用的插件名称旁边的复选框。" + +#: C/gedit.xml:1309(para) C/gedit.xml:1330(para) +msgid "" +"Click Close to close the Preferences dialog." +msgstr "" +"点 关闭 按钮,关闭 首选项 对话" +"框。" + +#: C/gedit.xml:1316(title) +msgid "Disabling a Plugin" +msgstr "禁用一个插件" + +#: C/gedit.xml:1317(para) +msgid "" +"A plugin remains enabled when you quit gedit." +msgstr "当您退出了 gedit,但插件仍保持启用状态。" + +#: C/gedit.xml:1318(para) +msgid "" +"To disable a gedit plugin, perform the following " +"steps:" +msgstr "要禁用一个 gedit 插件,请按下面的步骤操作:" + +#: C/gedit.xml:1327(para) +msgid "" +"Deselect the check box next to the name of the plugin that you want to " +"disable." +msgstr "不选中插件名称旁边的复选框,就可以禁用它。" + +#: C/gedit.xml:1339(title) +msgid "Plugins" +msgstr "插件" + +#: C/gedit.xml:1341(title) +msgid "Working with Plugins" +msgstr "使用插件" + +#: C/gedit.xml:1342(para) +msgid "" +"You can add extra features to gedit by enabling " +"plugins. A plugin is a supplementary program that " +"enhances the functionality of an application. Plugins add new items to the " +"gedit menus for the new features they provide." +msgstr "" +"您可以通过启用 插件gedit 添加扩展特性。插件是一个额外的小程序,可以增强应用程序的功能。插" +"件会在 gedit 中增加新的菜单项,提供新的特性。" + +#: C/gedit.xml:1344(para) +msgid "" +"Several plugins come built-in with gedit, and you " +"can install more. The gedit website lists third-party plugins." +msgstr "" +"gedit 内置了一些插件,您也可以安装更多,gedit website 中,列出了第三方开发的插件。" + +#: C/gedit.xml:1345(para) +msgid "" +"To enable and disable plugins, or see which plugins are currently enabled, " +"use the Plugins Preferences." +msgstr "" +"要启用或禁用一个插件,或者查看当前启用了哪些插件,请使用 插件选项。" + +#: C/gedit.xml:1346(para) +msgid "" +"The following plugins come built-in with gedit:" +msgstr "下面的插件是 gedit 内置的插件。" + +#: C/gedit.xml:1352(para) +msgid "" +"Change Case allows you to change the case of the selected text." +msgstr "" +"改变大小写 允许您更改选中文本的大小写。" + +#: C/gedit.xml:1355(para) +msgid "" +"Document " +"Statistics shows the number of lines, words, and " +"characters in the document." +msgstr "" +"文档统计 显示文档的行数、单词数和字符数。" + +#: C/gedit.xml:1358(para) +msgid "" +"External Tools allows you to execute external commands from " +"gedit." +msgstr "" +"外部工具 允许您在 gedit 中激活外部的命令。" + +#: C/gedit.xml:1361(para) +msgid "" +"File Browser allows you to browse your files and " +"folders in the side pane." +msgstr "文件浏览器 允许您在侧边栏浏览文件和文件夹。" + +#: C/gedit.xml:1364(para) +msgid "" +"Indent Lines adds or removes indentation from the selected lines." +msgstr "" +"行缩进 为选中的行添加或清除缩进。" + +#: C/gedit.xml:1367(para) +msgid "" +"Insert Date/" +"Time adds the current date and time into a document." +msgstr "" +"插入日期/时间 在文档中插入当前的日期和时间。" + +#: C/gedit.xml:1370(para) +msgid "" +"Modelines allows you to set editing preferences for individual documents, " +"and supports Emacs, Kate and Vim-style modelines." +msgstr "" +"Modelines 允许您为特殊的文档设置编辑器选项,支持 EmacsKateVim 风格的 modelines。" + +#: C/gedit.xml:1373(para) +msgid "" +"Python Console allows you to run commands in the python programming " +"language." +msgstr "" +"Python 控制台 运行您在 python 编程语言中运行命令。" + +#: C/gedit.xml:1376(para) +msgid "" +"Snippets allows you to store frequently-used pieces of text and insert " +"them quickly into a document." +msgstr "" +"片段 允许您存储常用的文本片段,并快速插入到文档中。" + +#: C/gedit.xml:1379(para) +msgid "" +"Sort " +"arranges selected lines of text into alphabetical order." +msgstr "" +"排序 按" +"字母顺序排列选定的行。" + +#: C/gedit.xml:1382(para) +msgid "" +"Spell Checker corrects the spelling in the selected text, or marks " +"errors automatically in the document." +msgstr "" +"拼写检查 检查选定文本的拼写正确性,或者标记文档中的错误。" + +#: C/gedit.xml:1385(para) +msgid "" +"Tag List lets you insert commonly-used tags for HTML and other languages " +"from a list in the side pane." +msgstr "" +"标记列表 允许您从侧栏中插入常用的 HTML 或其他语言标记。" + +#: C/gedit.xml:1389(para) +msgid "" +"For more information on creating plugins, see the gedit " +"website." +msgstr "" +"关于创建插件的更多信息,请参阅:gedit 网站。" + +#: C/gedit.xml:1393(title) +msgid "Change Case Plugin" +msgstr "更改大小写插件" + +#: C/gedit.xml:1394(para) +msgid "" +"The Change Case plugin changes the case of the " +"selected text." +msgstr "更改大小写 插件更改选中文本的大小写状态。" + +#: C/gedit.xml:1395(para) +msgid "" +"The following items are added to the Edit menu when the " +"Change Case plugin is enabled:" +msgstr "" +"当 改变大小写 插件启用后,下面的项将添加到 " +"编辑 菜单:" + +#: C/gedit.xml:1405(para) +msgid "Menu Item" +msgstr "菜单项" + +#: C/gedit.xml:1407(para) +msgid "Action" +msgstr "操作" + +#: C/gedit.xml:1409(para) +msgid "Example" +msgstr "举例" + +#: C/gedit.xml:1415(guisubmenu) C/gedit.xml:1421(guisubmenu) +#: C/gedit.xml:1427(guisubmenu) C/gedit.xml:1433(guisubmenu) +msgid "Change Case" +msgstr "改变大小写" + +#: C/gedit.xml:1415(guimenuitem) +msgid "All Upper Case" +msgstr "全部大写字母" + +#: C/gedit.xml:1416(para) +msgid "Change each character to uppercase." +msgstr "把字符都改成大写字母。" + +#: C/gedit.xml:1417(para) +msgid "This text becomes THIS TEXT" +msgstr "This text 将变成 THIS TEXT" + +#: C/gedit.xml:1421(guimenuitem) +msgid "All Lower Case" +msgstr "全部小写字母" + +#: C/gedit.xml:1422(para) +msgid "Change each character to lowercase." +msgstr "把字符都改成小写字母。" + +#: C/gedit.xml:1423(para) +msgid "This Text becomes this text" +msgstr "This Text 将变成 this text" + +#: C/gedit.xml:1427(guimenuitem) +msgid "Invert Case" +msgstr "反转大小写" + +#: C/gedit.xml:1428(para) +msgid "" +"Change each lowercase character to uppercase, and change each uppercase " +"character to lowercase." +msgstr "把小写字母改成大写,把大写字母改成小写。" + +#: C/gedit.xml:1429(para) +msgid "This Text becomes tHIS tEXT" +msgstr "This Text 将变成 tHIS tEXT" + +#: C/gedit.xml:1433(guimenuitem) +msgid "Title Case" +msgstr "字首大写" + +#: C/gedit.xml:1434(para) +msgid "Change the first character of each word to uppercase." +msgstr "每个单词的第一个字母改成大写。" + +#: C/gedit.xml:1435(para) +msgid "this text becomes This Text" +msgstr "this text 将变成 This Text" + +#: C/gedit.xml:1444(title) +msgid "Document Statistics Plugin" +msgstr "文档统计插件" + +#: C/gedit.xml:1445(para) +msgid "" +"The Document Statistics plugin counts the number " +"of lines, words, characters with spaces, characters without spaces, and " +"bytes in the current file. The plugin displays the results in a " +"Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"文档统计插件 统计当前文件的行数、单词数、字数(含空" +"格)、字数(不含空格)、字节数。该插件将结果显示在一个文档统计信息 对话框中。 要使用文档统计插件,请按以下步骤操作:" + +#: C/gedit.xml:1447(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"displays the following information about the file:" +msgstr "" +"点菜单 工具文档统计,出来一个 文档统计信息 对话" +"框。文档统计信息 对话框显示文件的以下信息:" + +#: C/gedit.xml:1450(para) +msgid "Number of lines in the current document." +msgstr "当前文档中的行数。" + +#: C/gedit.xml:1453(para) +msgid "Number of words in the current document." +msgstr "当前文档中的字数。" + +#: C/gedit.xml:1456(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "当前文档中的字符数(包括空格)。" + +#: C/gedit.xml:1459(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "当前文档中的字符数(不包括空格)。" + +#: C/gedit.xml:1462(para) +msgid "Number of bytes in the current document." +msgstr "当前文档中的字节数。" + +#: C/gedit.xml:1467(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click " +"Update." +msgstr "" +"在 文档统计信息 对话框打开时,您可以继续在 " +"gedit 里编辑文件。 要刷新 文档统计信息 对话框的内容,点击 更新 按钮。" + +#: C/gedit.xml:1474(title) +msgid "External Tools Plugin" +msgstr "外部工具插件" + +#: C/gedit.xml:1475(para) +msgid "" +"The External Tools plugin allows you to execute " +"external commands from gedit. You can pipe some " +"content into a command and exploit its output (for example, " +"sed), or launch a predefined command (for " +"example, make)." +msgstr "" +"The External Tools 允许您在 gedit 中运行外部命令。您可以通过管道命令来编辑它们的输出(例如 " +"sed),或者启动一个预编译命令(如 " +"make)。" + +#: C/gedit.xml:1476(para) +msgid "" +"Use the External Tools Manager to create and edit " +"commands. To run an external command, choose it from the Tools menu." +msgstr "" +"使用 外部工具管理器 来创建和编辑命令。要运行一个外部命" +"令,点 工具 菜单。" + +#: C/gedit.xml:1479(title) +msgid "Built-in Commands" +msgstr "内置命令" + +#: C/gedit.xml:1480(para) +msgid "" +"The following commands are provided with the External Tools plugin:" +msgstr "下面的命令由 外部工具 插件提供:" + +#: C/gedit.xml:1482(term) +msgid "Build" +msgstr "Build" + +#: C/gedit.xml:1484(para) +msgid "" +"Runs make in the current document's directory." +msgstr "在当前文档的文件夹下,运行 make 命令。" + +#: C/gedit.xml:1487(term) +msgid "Directory Listing" +msgstr "列出文件夹" + +#: C/gedit.xml:1489(para) +msgid "" +"Lists the contents of the current document's directory in a new document." +msgstr "在一个新文档中,列出当前文件夹的内容。" + +#: C/gedit.xml:1492(term) +msgid "Environment Variables" +msgstr "环境变量" + +#: C/gedit.xml:1494(para) +msgid "Displays the environment variables list in the bottom pane." +msgstr "在底部面板显示环境变量。" + +#: C/gedit.xml:1497(term) +msgid "Grep" +msgstr "Grep" + +#: C/gedit.xml:1499(para) +msgid "" +"Searches for a term in all files in the current document directory, using " +"pattern matching. Results are shown in the bottom pane." +msgstr "" +"使用匹配模式,在当前文件夹中的全部文件中搜索匹配项。结果显示在底部面板。" + +#: C/gedit.xml:1502(term) +msgid "Remove Trailing Spaces" +msgstr "删除尾部空格" + +#: C/gedit.xml:1504(para) +msgid "Removes all spaces from the end of lines in the document." +msgstr "删除文档中每一行的尾部空格。" + +#: C/gedit.xml:1511(title) +msgid "Defining a Command" +msgstr "定义一个命令" + +#: C/gedit.xml:1512(para) +msgid "" +"To add an external command, choose ToolsExternal Tools." +msgstr "" +"要添加一个外部命令,点菜单 工具外" +"部工具。" + +#: C/gedit.xml:1513(para) +msgid "" +"In the External Tools Manager window, click " +"New. You can speficy the following details for the " +"new command:" +msgstr "" +"在 外部工具管理器 窗口中,点 新建。您可以指定命令的下面内容细节:" + +#: C/gedit.xml:1515(term) +msgid "Description" +msgstr "说明" + +#: C/gedit.xml:1517(para) +msgid "" +"This description is shown in the statusbar when the menu command is chosen." +msgstr "当选中菜单命令时,这个描述将显示在状态栏。" + +#: C/gedit.xml:1520(term) +msgid "Accelerator" +msgstr "快捷键" + +#: C/gedit.xml:1522(para) +msgid "Enter a keyboard shortcut for the command." +msgstr "输入此命令的快捷键。" + +#: C/gedit.xml:1525(term) +msgid "Commands" +msgstr "命令" + +#: C/gedit.xml:1527(para) +msgid "" +"The actual commands to be run. Several gedit " +"environment variables can be used to pass content to these commands: see " +"." +msgstr "" +"要运行的命令。一些 gedit 环境变量可以传递给命令," +"请参阅 。" + +#: C/gedit.xml:1530(term) +msgid "Input" +msgstr "输入" + +#: C/gedit.xml:1532(para) +msgid "" +"The content to give to the commands (as stdin): the " +"entire text of the current document, the current selection, line, or word." +msgstr "" +"这个内容将传递给命令(像 stdin):当前文档的全部文本、" +"段、行或词。" + +#: C/gedit.xml:1535(term) +msgid "Output" +msgstr "输出窗口" + +#: C/gedit.xml:1537(para) +msgid "" +"What to do with the output of the commands: display in the bottom pane, put " +"in a new document, or place in the current document, at the end, at the " +"cursor position, or replacing the selection or the entire document." +msgstr "" +"输出这个命令做了什么:显示在底部面板、放入一个新文档,或者放到当前文档,放在" +"文档尾部、光标位置,或者替换这一段、替换整个文档。" + +#: C/gedit.xml:1540(term) +msgid "Applicability" +msgstr "适用性" + +#: C/gedit.xml:1542(para) +msgid "" +"Determines which sort of documents can be affected by the command, for " +"example whether saved or not, and local or remote." +msgstr "确定哪一类文档会被这个命令影响,例如是否保存,本地还是远程。" + +#: C/gedit.xml:1550(title) +msgid "Editing and Removing Tools" +msgstr "编辑和删除工具" + +#: C/gedit.xml:1551(para) +msgid "" +"To edit a tool, select it in the list and make changes to its properties." +msgstr "要编辑一个工具,在列表中选中它,然后更改它的属性。" + +#: C/gedit.xml:1552(para) +msgid "To rename a tool, click it again in the list." +msgstr "要重命名一个工具,在列表中再点击它一次。" + +#: C/gedit.xml:1553(para) +msgid "" +"To restore a built-in tool that you have changed, press Revert." +msgstr "要恢复您已经改变了的内置工具,点 还原/guilabel> 按钮。" + +#: C/gedit.xml:1554(para) +msgid "" +"To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created " +"yourself." +msgstr "" +"要删除一个工具,在列表中选中它,然后点 删除。您不能删" +"除内置的工具,只能删除您自己创建的工具。" + +#: C/gedit.xml:1558(title) +msgid "Variables" +msgstr "变量" + +#: C/gedit.xml:1559(para) +msgid "" +"You can use the following variables in the Commands " +"field of the command definition:" +msgstr "在 命令 文本框中,您可以使用下面的变量:" + +#: C/gedit.xml:1562(para) +msgid "GEDIT_CURRENT_DOCUMENT_URI" +msgstr "GEDIT_CURRENT_DOCUMENT_URI" + +#: C/gedit.xml:1565(para) +msgid "GEDIT_CURRENT_DOCUMENT_NAME" +msgstr "GEDIT_CURRENT_DOCUMENT_NAME" + +#: C/gedit.xml:1568(para) +msgid "GEDIT_CURRENT_DOCUMENT_SCHEME" +msgstr "GEDIT_CURRENT_DOCUMENT_SCHEME" + +#: C/gedit.xml:1571(para) +msgid "GEDIT_CURRENT_DOCUMENT_PATH" +msgstr "GEDIT_CURRENT_DOCUMENT_PATH" + +#: C/gedit.xml:1574(para) +msgid "GEDIT_CURRENT_DOCUMENT_DIR" +msgstr "GEDIT_CURRENT_DOCUMENT_DIR" + +#: C/gedit.xml:1577(para) +msgid "GEDIT_DOCUMENTS_URI" +msgstr "GEDIT_DOCUMENTS_URI" + +#: C/gedit.xml:1580(para) +msgid "GEDIT_DOCUMENTS_PATH" +msgstr "GEDIT_DOCUMENTS_PATH" + +#: C/gedit.xml:1587(title) +msgid "File Browser Plugin" +msgstr "文件浏览器插件" + +#: C/gedit.xml:1588(para) +msgid "" +"The File Browser Plugin shows your files and " +"folders in the side pane, allowing you to quickly open files." +msgstr "" +"文件浏览器 插件,在侧栏中显示您的文件和文件夹,允" +"许你快速打开文件。" + +#: C/gedit.xml:1589(para) +msgid "" +"To view the File Browser, choose ViewSide Pane and then click on " +"the tab showing the File Browser icon at the bottom of the side pane." +msgstr "" +"要显示文件浏览器,点菜单 查看侧边" +"栏,然后点击面板下边的文件浏览器图标。" + +#: C/gedit.xml:1591(title) +msgid "Browsing your Files" +msgstr "浏览文件" + +#: C/gedit.xml:1592(para) +msgid "" +"The File Browser tab initially shows your file manager bookmarks. To browse " +"the contents of any item, double-click it." +msgstr "" +"文件浏览器标签开始只显示文件管理器书签。要浏览每一项的内容,在标签上双击。" + +#: C/gedit.xml:1593(para) +msgid "" +"To show a parent folder, choose from the drop-down list, or press the up " +"arrow on the File Browser's toolbar." +msgstr "" +"要显示上一级父目录,在下拉列表中选择,或者点文件管理器工具栏的向上箭头。" + +#: C/gedit.xml:1594(para) +msgid "" +"To show the folder that contains the document you are currently working on, " +"right-click in the file list and choose Set root to active " +"document." +msgstr "" +"要显示您当前工作的文件夹中包含的内容,在文件列表中点右键,选 当" +"前文件夹设定为根目录。" + +#: C/gedit.xml:1598(para) +msgid "" +"To open a file in gedit, double-click it in the " +"file list." +msgstr "" +"要在 gedit 里打开一个文件,在文件列表中双击它。" + +#: C/gedit.xml:1601(title) +msgid "Creating Files and Folders" +msgstr "创建文件和文件夹" + +#: C/gedit.xml:1602(para) +msgid "" +"To create a new, empty text file in the current folder shown in the browser, " +"right-click in the file list and choose New File." +msgstr "" +"要在当前文件夹中创建一个新的空文本文件,在文件列表里点右键,选 " +"新建文件。" + +#: C/gedit.xml:1603(para) +msgid "" +"To create a new folder in the current folder shown in the browser, right-" +"click in the file list and choose New Folder." +msgstr "" +"要在当前文件夹中创建一个新的文件夹,在文件列表里点右键,选 新建" +"文件夹。" + +#: C/gedit.xml:1608(title) +msgid "Indent Lines Plugin" +msgstr "缩进行插件" + +#: C/gedit.xml:1609(para) +msgid "" +"The Indent Lines plugin adds or removes space " +"from the beginning of lines of text." +msgstr "缩进行 插件,在行的开头添加或清除空白缩进。" + +#: C/gedit.xml:1610(para) +msgid "To indent or unindent text, perform the following steps:" +msgstr "要对文本使用缩进或取消缩进,请按下面的步骤操作:" + +#: C/gedit.xml:1612(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"选择所需缩进行。要对单行进行缩进或取消缩进,请将光标放在该行的任意位置上。" + +#: C/gedit.xml:1617(para) +msgid "" +"To indent the text, choose EditIndent." +msgstr "" +"要缩进文本,点菜单 编辑缩进。" + +#: C/gedit.xml:1620(para) +msgid "" +"To remove the indentation, choose EditUnindent." +msgstr "" +"要取消缩进,点菜单 编辑取消缩进。" + +#: C/gedit.xml:1625(para) +msgid "" +"The amount of space used, and whether tab character or space characters are " +"used, depends on the Tab Stops settings in the Editor " +"Preferences: see ." +msgstr "" +"空白的数量,或者是否使用 Tab 制表符,使用空格字符,取决于编辑器首选项中的 " +"制表符 设置,请参阅:。" + +#: C/gedit.xml:1630(title) +msgid "Insert Date/Time Plugin" +msgstr "插入日期/时间插件" + +#: C/gedit.xml:1631(para) +msgid "" +"The Insert Date/Time plugin inserts the current " +"date and time into a document. To use the Insert Date/Time plugin, perform " +"the following steps:" +msgstr "" +"插入日期/时间 插件可以在文档中插入当前的日期和时" +"间。 要使用插入日期/时间插件,请按以下步骤操作:" + +#: C/gedit.xml:1633(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"点菜单 编辑插入日期和时间。" + +#: C/gedit.xml:1634(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click Insert to close the Insert Date " +"and Time dialog. gedit inserts the " +"date/time at the cursor position in the current file." +msgstr "" +"如果您还没配置“插入日期/时间”插件配置为不提示格式自动插入方式," +"gedit 将显示< guilabel>插入日期和时间 " +"对话框。在列表中选择合适的日期/时间格式。单击 插入,关" +"闭 插入日期和时间 对话框;gedit 将在光标的位置插入日期/时间。" + +#: C/gedit.xml:1635(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed. The date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"如果您已经配置了 gedit 使用一种指定的日期/时间格" +"式,就不会显示插入日期和时间 对话框,在当前光标位置处自" +"动插入日期/时间。" + +#: C/gedit.xml:1640(title) +msgid "Configuring the Insert Date/Time Plugin" +msgstr "配置插入日期/时间插件" + +#: C/gedit.xml:1641(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "要配置插入日期/时间插件,请执行以下步骤:" + +#: C/gedit.xml:1649(para) +msgid "Select the Insert Date/Time plugin." +msgstr "选择 插入日期/时间插件。" + +#: C/gedit.xml:1652(para) +msgid "" +"Click Configure Plugin to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"点 配置插件 按钮,出来一个 配置插入日期/时间" +"插件 对话框。" + +#: C/gedit.xml:1655(para) +msgid "Select one of the options, as follows:" +msgstr "如下所述,选择其中一个选项:" + +#: C/gedit.xml:1657(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"要在每次插入日期/时间时,都指定日期/时间的格式,请选择 提示输入格" +"式 选项。" + +#: C/gedit.xml:1660(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"要在每次插入日期/时间时使用 gedit 提供的同一日期/" +"时间格式,请选择 使用选定的格式 选项,然后从列表中选择合" +"适的格式。选择此选项后,gedit 便不会在您点 " +"编辑插入日期和时间 时提示您输入日期/时间格式。" + +#: C/gedit.xml:1663(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"要在每次插入日期/时间时使用同一定制日期/时间格式,请选择 使用定制格" +"式 选项,然后在文本框中输入合适的格式。有关如何指定定制格式的更多" +"信息,请参阅 strftime3。选择此选项后,gedit 便不会在您点 编辑插" +"入日期和时间 时提示您输入日期/时间格式。" + +#: C/gedit.xml:1668(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"单击 确定,关闭 配置插入日期/时间插件 对话框。" + +#: C/gedit.xml:1671(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"要关闭 首选项 对话框,请单击 关闭。" + +#: C/gedit.xml:1678(title) +msgid "Modelines Plugin" +msgstr "Modelines 插件" + +#: C/gedit.xml:1679(para) +msgid "" +"The Modelines plugin allows you to set " +"preferences for individual documents. A modeline is a " +"line of text at the start or end of the document with settings that " +"gedit recognises." +msgstr "" +"Modelines 允许您为特殊的文档设置选项。" +"modeline 是在文档开头或结束的一行文本,可以由 " +"gedit 识别。" + +#: C/gedit.xml:1680(para) +msgid "" +"Preferences set using modelines take precedence over the ones specified in " +"the preference dialog." +msgstr "使用 modelines 设置的选项,会覆盖在首选项对话框里设定的选项。" + +#: C/gedit.xml:1681(para) +msgid "You can set the following preferences with modelines:" +msgstr "您可以用 modelines 设定下面的选项:" + +#: C/gedit.xml:1684(para) +msgid "Tab width" +msgstr "Tab 制表符宽度" + +#: C/gedit.xml:1687(para) +msgid "Indent width" +msgstr "缩进宽度" + +#: C/gedit.xml:1690(para) +msgid "Insert spaces instead of tabs" +msgstr "插入空格而不是制表符" + +#: C/gedit.xml:1696(para) +msgid "Right margin width" +msgstr "右边距宽度" + +#: C/gedit.xml:1700(para) +msgid "" +"The Modelines plugin supports a subset of the " +"options used by other text editors Emacs, " +"Kate and Vim." +msgstr "" +"Modelines 支持其他文本编辑器的子选项,像 " +"EmacsKate 和 " +"Vim。" + +#: C/gedit.xml:1703(title) +msgid "Emacs Modelines" +msgstr "Emacs Modelines" + +#: C/gedit.xml:1704(para) +msgid "" +"The first two lines of a document are scanned for Emacs modelines." +msgstr "为 Emacs modelines 扫描文档开头的两行。" + +#: C/gedit.xml:1705(para) +msgid "" +"The Emacs options for tab-width, indent-offset, " +"indent-tabs-mode and autowrap are supported. For more information, see the " +"GNU Emacs Manual." +msgstr "" +"支持 Emacs 的制表符宽度、缩进量、缩进模式和自动换" +"行。更多相关信息,请参阅:GNU Emacs 手册。" + +#: C/gedit.xml:1708(title) +msgid "Kate Modelines" +msgstr "Kate Modelines" + +#: C/gedit.xml:1709(para) +msgid "" +"The first and last ten lines a document are scanned for Kate modelines." +msgstr "为 Kate modelines 扫描文档开头和最后十行。" + +#: C/gedit.xml:1710(para) +msgid "" +"The Kate options for tab-width, indent-width, " +"space-indent, word-wrap and word-wrap-column are supported. For more " +"information, see the Kate website." +msgstr "" +"支持 Emacs 的制表符宽度、缩进量、空格缩进、单词换" +"行和单词列换行。更多相关信息,请参阅: Kate 网站。" + +#: C/gedit.xml:1713(title) +msgid "Vim Modelines" +msgstr "Vim Modelines" + +#: C/gedit.xml:1714(para) +msgid "" +"The first and last three lines a document are scanned for Vim modelines." +msgstr "为 Vim modelines 扫描文档开头和最后的三行。" + +#: C/gedit.xml:1715(para) +msgid "" +"The Vim options for et, expandtab, ts, tabstop, " +"sw, shiftwidth, wrap, and textwidth are supported. For more information, see " +"the Vim website." +msgstr "" +"支持 Emacs 的 et、expandtab、ts、tabstop、sw、" +"shiftwidth、wrap 和 textwidth。更多相关信息,请参阅:Vim 网站" +"。" + +#: C/gedit.xml:1720(title) +msgid "Python Console Plugin" +msgstr "Python 控制台插件" + +#: C/gedit.xml:1721(para) +msgid "" +"The Python Console Plugin allows you to run " +"commands in the python programming language from gedit. Enabling the plugin adds a tab to the bottom pane. This shows " +"recent output and a command prompt field." +msgstr "" +"Python 控制台 插件允许您在 gedit 中运行 python 编程语言中命令。启用该插件会在底部栏添加一个标签。" +"显示最近输出结果和命令提示符域。" + +#: C/gedit.xml:1722(para) +msgid "" +"Commands entered into the python console are not checked before they are " +"run. It is therefore possible to hang gedit, for " +"example by entering an infinite loop." +msgstr "" +"命令进入 python 控制台运行前并不检查。因而它可能导致 gedit 挂起,例如输入了一个无限循环。" + +#: C/gedit.xml:1726(title) +msgid "Snippets Plugin" +msgstr "片段插件" + +#: C/gedit.xml:1727(para) +msgid "" +"The Snippets plugin allows you to store " +"frequently-used pieces of text, called snippets, and " +"insert them quickly into a document." +msgstr "" +"片段 插件,允许您存储常用的文本片段,称作" +"片段,可以很方便地插入文档中。" + +#: C/gedit.xml:1728(para) +msgid "" +"Snippets are specific to the language syntax of the current document. For " +"example, when you are working with an HTML document, you can choose from a " +"list of snippets that are useful for HTML. In addition, some snippets are " +"global, and are available in all documents." +msgstr "" +"片段指定到了当前语言格式。例如,当您在 HTML 下操作,您可以从片段列表中选择有" +"用的 HTML 片段。另外,一些片段是全局的,可用于所有的文档。" + +#: C/gedit.xml:1729(para) +msgid "" +"A number of built-in snippets are installed with gedit, which can be modified." +msgstr "gedit 提供了许多内置的片段,可以被设置。" + +#: C/gedit.xml:1732(title) +msgid "Inserting Snippets" +msgstr "插入片段" + +#: C/gedit.xml:1733(para) +msgid "" +"To insert a snippet into a document, type its tab trigger and press Tab. A snippet's tab trigger is " +"usually the first few letters of the snippet, or something else that is " +"short and easy to remember." +msgstr "" +"要在文档中插入一个片段,输入它的 Tab 触发器,然后按 " +"Tab。片段触发器通常是片段的开头几个字符,或者是一些其他短的" +"好记的字符。" + +#: C/gedit.xml:1734(para) +msgid "" +"Alternatively, press CtrlSpace to see a list of snippets you can insert." +msgstr "" +"另外,按 CtrlSpace " +"键,查看您可以使用的片段列表。" + +#: C/gedit.xml:1738(title) +msgid "Adding Snippets" +msgstr "添加片段" + +#: C/gedit.xml:1739(para) +msgid "To create a new snippet, do the following:" +msgstr "要创建一个新片段,请按下面的步骤操作:" + +#: C/gedit.xml:1742(para) +msgid "" +"Choose ToolsManage Snippets. The Snippets Manager window " +"opens." +msgstr "" +"点菜单 工具管理片段,出来一个 片段管理器 窗口。" + +#: C/gedit.xml:1745(para) +msgid "" +"The list of snippets is grouped by language. Select the language you want to " +"add a snippet to, or a snippet in that language group. To add a snippet for " +"all languages, choose Global at the top of the list. The syntax of the " +"document you are currently working with is shown by default." +msgstr "" +"片段列表按语言分组。选择您想添加片段的语言,或者那个语言的片段组。要为所有语" +"言添加片段,点列表顶部的全局。默认显示您当前编辑文档的格式。" + +#: C/gedit.xml:1748(para) +msgid "Click New. A new snippet appears in the list." +msgstr "点 新建,列表中出来一个新的片段。" + +#: C/gedit.xml:1751(para) +msgid "Enter the following information for the new snippet:" +msgstr "为新片段输入下面的信息:" + +#: C/gedit.xml:1753(term) +msgid "Name" +msgstr "名称" + +#: C/gedit.xml:1755(para) +msgid "" +"Enter a name for the snippet in the text field within the snippet list. The " +"name of a snippet serves only as a reminder of its purpose. You can change " +"name of a snippet you create by clicking on it in the list." +msgstr "" +"在文本框中输入片段的名称。片段名称仅仅是它作用的提示。您可以通过点击它来改变" +"名称。" + +#: C/gedit.xml:1758(term) +msgid "Snippet text" +msgstr "片段文本" + +#: C/gedit.xml:1760(para) +msgid "" +"Enter the text of the snippet in the Edit snippet text " +"box. For special codes you can use, see ." +msgstr "" +"在编辑片段 文本框中,输入片段的内容。您可以使用特殊代" +"码,请参阅:。" + +#: C/gedit.xml:1761(para) +msgid "" +"You can switch back to the document window to copy text without closing the " +"Snippets Manager window." +msgstr "" +"您可以切换到文档窗口,复制里面的文本,而不需要关闭 片段管理器 窗口。" + +#: C/gedit.xml:1764(term) +msgid "Tab Trigger" +msgstr "Tab 触发器" + +#: C/gedit.xml:1766(para) +msgid "" +"Enter the tab trigger for the snippet. This is the text that you type before " +"pressing Tab to insert the snippet." +msgstr "" +"为片段输入标记触发器。这个文本是您输入后按 Tab 键,就会插入" +"片段。" + +#: C/gedit.xml:1767(para) +msgid "" +"The tag must be either a single word comprising only letters, or any single " +"character. The Tab trigger will highlight in red if an " +"invalid tab trigger is entered." +msgstr "" +"标记必须是单个由字母组成的词,或者是单个字符。Tab 触发器 会用红色高亮显示,表示输入了一个触发器。" + +#: C/gedit.xml:1770(term) +msgid "Shortcut key" +msgstr "快捷键" + +#: C/gedit.xml:1772(para) +msgid "Type a shortcut key to use for inserting the snippet." +msgstr "输入用来插入片段的快捷键。" + +#: C/gedit.xml:1781(title) +msgid "Editing and Removing Snippets" +msgstr "编辑和删除片段" + +#: C/gedit.xml:1782(para) +msgid "" +"To edit a snippet, select it in the list and make changes to its text and " +"activation properties." +msgstr "要编辑一个片段,在列表中选中它,然后更改它的文本和激活属性。" + +#: C/gedit.xml:1783(para) +msgid "To rename a snippet, click it again in the list." +msgstr "要重命名一个片段,在列表中再次点击它。" + +#: C/gedit.xml:1784(para) +msgid "" +"To restore a built-in snippet that you have changed, press Revert." +msgstr "要恢复您更改了的内置片段,点 复原 按钮。" + +#: C/gedit.xml:1785(para) +msgid "" +"To remove a snippet, select it in the list and press Remove. You can not remove built-in snippets, only those you have " +"created yourself." +msgstr "" +"要删除一个片段,在列表中选中它,然后点 删除。您不能删" +"除内置的片段,只能删除您自己创建的片段。" + +#: C/gedit.xml:1789(title) +msgid "Snippet Substitutions" +msgstr "替代片段" + +#: C/gedit.xml:1790(para) +msgid "" +"In addition to inserting stored text, a snippet can include customizable " +"text, or mark spaces where you can add text once the snippet is inserted in " +"your document." +msgstr "" +"除了插入已经存储的文本,片段可以包括自定义文本,或者标记空格,您可以添加自己" +"文本。" + +#: C/gedit.xml:1794(para) +msgid "You can use the following placeholder codes in snippet text:" +msgstr "您可以在片段文本中使用下面的占位符代码:" + +#: C/gedit.xml:1796(term) +msgid "Tab placeholders" +msgstr "Tab 占位符" + +#: C/gedit.xml:1798(para) +msgid "" +"$n defines a tab placeholder, " +"where n is any number from 1 upwards." +msgstr "" +"$n 定义一个 tab 占位符," +"n 是从 1 开始的数字。" + +#: C/gedit.xml:1799(para) +msgid "" +"${n:default} defines a tab placeholder with a default value." +msgstr "" +"${n:default} 用默认值定义一个 tab 占位符。" + +#: C/gedit.xml:1800(para) +msgid "" +"A tab placeholder marks a place in the snippet text where you can add extra " +"text after the snippet is inserted." +msgstr "tab 占位符在片段文本中标记一个区域,您可以在插入片段后添加额外的文本。" + +#: C/gedit.xml:1801(para) +msgid "" +"To use tab placeholders, insert the snippet as normal. The cursor is placed " +"at the first tab placeholder. Type text, and press Tab to " +"advance to the next tab placeholder. The number in the placeholder code " +"defines the order in which tab advances to each place in the text." +msgstr "" +"要使用 tab 占位符,像平常一样插入片段。光标定位于第一个 tab 占位符。输入文" +"本,然后按 Tab 到下一个 tab 占位符。占位符的序号定义了在文本" +"中各个 tab 的位置。" + +#: C/gedit.xml:1802(para) +msgid "" +"Press ShiftTab to " +"return to the previous tab placeholder. Pressing Tab when " +"there are no more tab placeholders moves the cursor to the end of the " +"snippet text, or to the end placeholder if it exists." +msgstr "" +"按 ShiftTab 返回到上一" +"个 tab 占位符。当再没有占位符时,按 Tab 键结束片段,或者到最" +"后一个占位符,如果它存在的话。" + +#: C/gedit.xml:1805(term) +msgid "Mirror placeholders" +msgstr "Mirror 占位符" + +#: C/gedit.xml:1807(para) +msgid "" +"A repeated tab placeholder will mirror the placeholder already defined. This " +"allows you to type in text only once that you want to appear several times " +"in the snippet." +msgstr "" +"重复 tab 占位符,将会映像已经定义的占位符。这就可以让您输入一次而重复多次这个" +"片段。" + +#: C/gedit.xml:1810(term) +msgid "End placeholder" +msgstr "End 占位符" + +#: C/gedit.xml:1812(para) +msgid "" +"$0 defines the end placeholder. This allows you to finish " +"working with the snippet with the cursor at a point other than the end of " +"the snippet text." +msgstr "" +"$0 定义最后占位符。这就允许您完成片段操作,而不是光标停在" +"最后一个片段文本。" + +#: C/gedit.xml:1815(term) +msgid "Environmental variables" +msgstr "环境变量" + +#: C/gedit.xml:1817(para) +msgid "" +"Environmental variable such as $PATH and $HOME are substituted in snippet text. The following variables specific " +"to gedit can also be used:" +msgstr "" +"环境变量是指像 $PATH$HOME,可以在片" +"段中替代。下面的变量可以在 gedit 中使用:" + +#: C/gedit.xml:1819(term) +msgid "$GEDIT_SELECTED_TEXT" +msgstr "$GEDIT_SELECTED_TEXT" + +#: C/gedit.xml:1821(para) +msgid "The currently selected text." +msgstr "当前选中的文本。" + +#: C/gedit.xml:1824(term) +msgid "$GEDIT_FILENAME" +msgstr "$GEDIT_FILENAME" + +#: C/gedit.xml:1826(para) +msgid "" +"The full filename of the document, or an empty string if the document isn't " +"saved yet." +msgstr "文档的完整名称,对于还没有保存的问道,是一个空字符串。" + +#: C/gedit.xml:1829(term) +msgid "$GEDIT_BASENAME" +msgstr "$GEDIT_BASENAME" + +#: C/gedit.xml:1831(para) +msgid "" +"The basename of the filename of the document, or an empty string if the " +"document isn't saved yet." +msgstr "文档文件名的基本名,对于还没保存的文档,是一个空字符串。" + +#: C/gedit.xml:1834(term) +msgid "$GEDIT_CURRENT_WORD" +msgstr "$GEDIT_CURRENT_WORD" + +#: C/gedit.xml:1836(para) +msgid "" +"The word at the cursor's location in the document. When this variable is " +"used, the current word will be replaced by the snippet text." +msgstr "文档里光标所在位置的词。当使用这个变量时,当前词将会被片段替代。" + +#: C/gedit.xml:1844(term) +msgid "Shell placeholders" +msgstr "Shell 占位符" + +#: C/gedit.xml:1846(para) +msgid "" +"$(cmd) is replaced by the " +"result of executing cmd in a shell." +msgstr "" +"$(cmd) 会被 shell 里运行的 " +"cmd 结果替换。" + +#: C/gedit.xml:1847(para) +msgid "" +"$(n:cmd) allows you to give this placeholder a reference, where " +"n is any number from 1 upwards. Use " +"$n to use the output from one shell " +"placeholder as input in another." +msgstr "" +"$(n:cmd) 允许您给这个占位符一个索引,这儿的 n 是一" +"个从 1 开始的数字。使用 $n,用" +"一个 shell 的输出,作为另一个的输入。" + +#: C/gedit.xml:1850(term) +msgid "Python placeholders" +msgstr "Python 占位符" + +#: C/gedit.xml:1852(para) +msgid "" +"$<cmd> is replaced by " +"the result of evaluating cmd in the python " +"interpreter." +msgstr "" +"$<cmd> 在 python 解释器" +"里,用结果值来替换。" + +#: C/gedit.xml:1853(para) +msgid "" +"$<a:cmd>" +" specifies another python placeholder as a dependency, where " +"a gives its order in the snippet. This allows you " +"to use python functions defined in another snippet. To specify several " +"dependencies, separate the numbers with commas thus: $<" +"a,b:cmd>" +msgstr "" +"$<a:cmd>" +" 指定另一个 python 占位符作为附属,a 给" +"出它在片段里的顺序。这就允许您在另一个片段里使用 python 的功能定义。要指定几" +"个附属,用逗号分隔开: $<a," +"b:cmd>" + +#: C/gedit.xml:1854(para) +msgid "" +"To use a variable in all other python snippets, declare it as " +"global." +msgstr "要在所有 python 片段里使用变量,用 global 声明它。" + +#: C/gedit.xml:1863(title) +msgid "Sort Plugin" +msgstr "排序插件" + +#: C/gedit.xml:1864(para) +msgid "" +"The Sort plugin arranges selected lines of text " +"into alphabetical order." +msgstr "排序 插件,可以按字母顺序排列选中的行。" + +#: C/gedit.xml:1865(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"该排序操作无法取消,所以您应在执行排序前保存文件。要在执行排序操作后恢复为已" +"保存的文件,点菜单 文件复原。" + +#: C/gedit.xml:1868(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "要使用排序插件,请执行以下步骤:" + +#: C/gedit.xml:1871(para) +msgid "Select the lines of text you want to sort." +msgstr "选中你想排序的行。" + +#: C/gedit.xml:1873(para) +msgid "" +"Choose EditSort. The Sort dialog opens." +msgstr "" +"点菜单 编辑排序,出来一个 排序 对话框。" + +#: C/gedit.xml:1876(para) +msgid "Choose the options you want for the sort:" +msgstr "设定您想要的排序选项:" + +#: C/gedit.xml:1879(para) +msgid "" +"To arrange the text in reverse order, select Reverse order." +msgstr "要按反向顺序排列文本,选中 逆序顺序 选项。" + +#: C/gedit.xml:1882(para) +msgid "" +"To delete duplicate lines, select Remove duplicates." +msgstr "要删除重复的行,选中 删除重复内容 选项。" + +#: C/gedit.xml:1885(para) +msgid "To ignore case sensitivity, select Ignore case." +msgstr "要忽略大小写,选中 忽略大小写 选项。" + +#: C/gedit.xml:1888(para) +msgid "" +"To have the sort ignore the characters at the start of the lines, set the " +"first character that should be used for sorting in the Start at " +"column spin box." +msgstr "" +"要指定排序的开始位置,请在 起始列 微调按钮框中设定开始排" +"序的字符列。" + +#: C/gedit.xml:1893(para) +msgid "To perform the sort operation, click Sort." +msgstr "要执行排序操作,点击 排序 按钮。" + +#: C/gedit.xml:1900(title) +msgid "Spell Checker Plugin" +msgstr "拼写检查插件" + +#: C/gedit.xml:1901(para) +msgid "" +"The Spell Checker plugin checks the spelling in " +"the selected text. You can configure gedit to " +"check the spelling automatically, or you can check the spelling manually, in " +"the specified language. The language setting, and the autocheck spelling " +"properties, apply per document. To use the Spell checker plugin, perform the " +"following steps:" +msgstr "" +"拼写检查 检查选中文本的拼写。您可以在指定的语言" +"里,配置 gedit 自动简单拼写,或者您可以手动检查拼" +"写。语言设置、自动拼写检查属性,应用于每个文档。要使用拼写检查插件,请按下面" +"的步骤操作:" + +#: C/gedit.xml:1903(para) +msgid "" +"Choose ToolsSet Language to display the Set language " +"dialog. Select the appropriate language from the list. Click OK to close the Set language dialog." +msgstr "" +"点菜单 工具设置语言,出来一个 设置语言 对话框。在" +"列表中选择合适的语言,然后点 确定,关闭 设置" +"语言 对话框。" + +#: C/gedit.xml:1906(para) +msgid "" +"To check the spelling automatically, choose ToolsAutocheck Spelling. To unset " +"the automatic spell check, choose ToolsAutocheck Spelling again. " +"When automatic spell checking is set, an icon is displayed beside the " +"Autocheck Spelling menu item. Automatic spell " +"checking is unset by default, each time gedit " +"starts." +msgstr "" +"要启用自动拼写检查,点菜单 工具自" +"动检查拼写。要取消自动拼写检查,再次点 " +"工具自动检查拼写。当启用自动拼写检查,在 自动检查拼写 " +"菜单项旁边会出现一个图标。默认情况下,每次 gedit " +"启动时,不启用自动拼写检查。" + +#: C/gedit.xml:1907(para) +msgid "" +"Unknown spellings are displayed in a different color, and underlined. Right-" +"click on an unknown spelling, then select Spelling Suggestions from the popup menu:" +msgstr "" +"未知拼写的词会显示不同的颜色和带有下划线。在词语上点右键,然后从弹出菜单里选" +"择 拼写建议:" + +#: C/gedit.xml:1910(para) +msgid "" +"To replace the unknown spelling with another spelling in the list, select " +"the replacement spelling from the Spelling Suggestions " +"popup menu." +msgstr "要替换未知拼写,从 拼写建议 菜单里选择一项。" + +#: C/gedit.xml:1913(para) +msgid "" +"To add the unknown spelling to your personal dictionary, select " +"Spelling SuggestionsAdd." +msgstr "" +"要添加未知拼写到您的个人字典,选择 拼写建议添加。" + +#: C/gedit.xml:1916(para) +msgid "" +"To ignore all occurrences of the unknown spelling, so that they are no " +"longer flagged as unknown but are not added to your personal dictionary, " +"select Spelling SuggestionsIgnore All. The unknown word " +"is ignored in the current gedit session only." +msgstr "" +"要忽略所有这个未知的拼写,以便它们不再显示未知拼写,但不添加到您的个人字典" +"中,选择 拼写建议全部忽略。在当前 gedit 中会忽略所" +"有这个未知的词。" + +#: C/gedit.xml:1921(para) +msgid "" +"To check the spelling manually, choose ToolsCheck Spelling." +msgstr "" +"要手动进行拼写检查,点菜单 工具拼" +"写检查。" + +#: C/gedit.xml:1923(para) +msgid "" +"If there are no spelling errors, an Information dialog " +"displays a message stating that the document does not contain misspelled " +"words. Click OK to close the Information dialog." +msgstr "" +"如果这儿没有拼写错误,出来一个 信息 对话框,提示没有包含" +"错误拼写。点 确定 关闭这个 信息 " +"对话框。" + +#: C/gedit.xml:1925(para) +msgid "" +"If there are spelling errors, the Check Spelling dialog " +"is displayed:" +msgstr "如果发现错误拼写,出来一个 检查拼写 对话框:" + +#: C/gedit.xml:1928(para) +msgid "" +"The Misspelled word is displayed at the top of the " +"dialog." +msgstr "拼错的词 显示在对话框的顶部。" + +#: C/gedit.xml:1931(para) +msgid "" +"A suggested known spelling is displayed in the Change to text box. You can replace this with another known spelling by " +"selecting a spelling from the Suggestions list, or you " +"can enter text directly into the Change to text box." +msgstr "" +"一个建议的拼写会显示在 更改为 文本框里。您可以在 " +"建议 里,选择其他词语来替换,或者您可以直接输入到 " +"更改为 文本框里。" + +#: C/gedit.xml:1934(para) +msgid "" +"To check the spelling of the text in the Change to text " +"box, click Check Word. If this is a known word, the " +"Suggestions list is replaced with the text " +"(correct spelling). If the word is not known, new entries appear " +"in the Suggestions list." +msgstr "" +"要检查 更改为 文本框里的拼写,点 检查单词 按钮。如果这是一个已知的词,建议 列表被这个词" +"替换 (正确拼写)。如果这个词也未知,新的项出现在 " +"建议 列表中。" + +#: C/gedit.xml:1937(para) +msgid "" +"To ignore the current occurrence of the unknown word, click " +"Ignore. To ignore all occurrences of the unknown " +"word, click Ignore All. The unknown word is ignored " +"in the current gedit session only." +msgstr "" +"要忽略当前的检查,点 忽略。要忽略所有这个未知词的检" +"查,点 全部忽略。在当前 gedit 中不再对这个词检查。" + +#: C/gedit.xml:1940(para) +msgid "" +"To change the current occurrence of the unknown word to the text in the " +"Change to text box, click Change. To change all occurrences of the unknown word to the text in the " +"Change to text box, click Change All." +msgstr "" +"要用 更改为 文本框里的词,替换当前检查的未知词,点 " +"更改 按钮。要把所有这个未知词替换为 更改为 文本框里的词,点 全部更改。" + +#: C/gedit.xml:1943(para) +msgid "" +"To add the unknown word to your personal dictionary, click Add " +"word." +msgstr "要添加未知单词到您的个人字典,点 添加单词。" + +#: C/gedit.xml:1946(para) +msgid "" +"To close the Check Spelling dialog, click " +"Close." +msgstr "" +"要关闭 拼写检查 对话框,点 关闭。" + +#: C/gedit.xml:1955(title) +msgid "Tag List Plugin" +msgstr "标记列表插件" + +#: C/gedit.xml:1956(para) +msgid "" +"The Tag List plugin allows you to insert common " +"tags from a list in the side pane." +msgstr "标记列表 插件,允许您从侧栏中插入通用标记。" + +#: C/gedit.xml:1957(para) +msgid "To use the Tag List plugin, perform the following steps:" +msgstr "要使用标记列表插件,请按以下步骤操作:" + +#: C/gedit.xml:1959(para) +msgid "" +"Choose ViewSide Pane." +msgstr "" +"点菜单 查看侧边栏。" + +#: C/gedit.xml:1963(para) +msgid "" +"By default, the side pane shows a tab containing a list of open documents. " +"Click on the tab showing a + icon at the bottom of the side pane to show the " +"tag list tab." +msgstr "" +"默认情况下,侧边栏显示包含打开文档列表的标签。点击侧栏底部一个 + 图标的标签," +"显示标记列表。" + +#: C/gedit.xml:1965(para) +msgid "" +"Select the appropriate tag category from the drop-down list. For example, " +"HTML - Tags." +msgstr "" +"在下拉列表中选择合适的标记种类。例如,HTML - 标记。" + +#: C/gedit.xml:1968(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "卷动该标记列表查找所需的标记。" + +#: C/gedit.xml:1971(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"要在当前文件的光标位置插入标记,请双击标记列表中的标记。您也可以按照如下步骤" +"插入标记:" + +#: C/gedit.xml:1973(para) +msgid "" +"To insert a tag in the current file and change the focus from the side pane " +"to the display area, press Return." +msgstr "" +"要在当前文件中插入标记,并将焦点从 标记列表 栏移到工作" +"区,按一下 回车键。" + +#: C/gedit.xml:1976(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftReturn." +msgstr "" +"要在当前文件中插入标记,并将焦点仍保留在 标记列表 栏," +"按 Shift回车键。" + +#. Put one translator per line, in the form of NAME , YEAR1, YEAR2 +#: C/gedit.xml:0(None) +msgid "translator-credits" +msgstr "TeliuTe" + +#~ msgid "" +#~ "User Name inserts the username of the current user into the document." +#~ msgstr "" +#~ "用户名 在文档中插入当前用户名。" + +#~ msgid "User Name Plugin" +#~ msgstr "用户名插件" + +#~ msgid "" +#~ "The User name plugin inserts the username of " +#~ "the current user into the document." +#~ msgstr "" +#~ "用户名 插件,可以在文档中插入当前的用户名。" + +#~ msgid "" +#~ "To insert your username at the cursor position, choose " +#~ "EditInsert User Name." +#~ msgstr "" +#~ "要在当前光标位置插入您的用户名,点菜单 编辑插入用户名。" + +#~ msgid "gedit Manual V2.5.1" +#~ msgstr "gedit 手册 V2.5.1" + +#~ msgid "" +#~ "The gedit application enables you to create " +#~ "and edit text files. You can use gedit plugins " +#~ "to perform a variety of tasks related to text-editing from within the " +#~ "gedit window." +#~ msgstr "" +#~ "gedit 应用程序使您可以创建和编辑文本文件。您可" +#~ "以使用 gedit 插件在 gedit 窗口中执行有关文本编辑的各种任务。" + +#~ msgid "" +#~ "For information about how to start gedit from " +#~ "a menu, see the latest version of the MATE Desktop User Guide for your " +#~ "platform." +#~ msgstr "" +#~ "有关如何从菜单启动 gedit 的信息,请参见适用于您" +#~ "的平台的 MATE Desktop User Guide 的最新版本。" + +#~ msgid "When You Start gedit" +#~ msgstr "在启动 gedit 时" + +#~ msgid "" +#~ "The output window displays the output returned by the Shell command " +#~ "plugin and the Compare Files plugin." +#~ msgstr "输出窗口显示 Shell 命令插件和比较文件插件返回的输出。" + +#~ msgid "" +#~ "You can open multiple files in gedit. The " +#~ "application displays one file at a time in the application window. The " +#~ "application adds a tab for each open file to the window. To display " +#~ "another open file, click on the tab that corresponds to the file. To " +#~ "create a new gedit window for each file that " +#~ "is open, drag the tab corresponding to each file to the desktop " +#~ "background." +#~ msgstr "" +#~ "您可以在 gedit 中打开多个文件。 该应用程序一次" +#~ "只能在应用程序窗口中显示一个文件。该应用程序会在窗口上为每个打开的文件添加" +#~ "一个选项卡。要显示另一个打开的文件,请单击与该文件对应的选项卡。要为每个打" +#~ "开的文件创建一个新的 gedit 窗口,请将与每个文件" +#~ "对应的选项卡拖到桌面背景上。" + +#~ msgid "" +#~ "You can also use the Documents menu to move between " +#~ "the open files. You can choose DocumentsMove to New Window to " +#~ "move a document to a new gedit window." +#~ msgstr "" +#~ "也可以使用“文档”菜单在打开的文件之间移动。您可以选择" +#~ "“文档”“移动到新窗口”将一个文档移动到新 gedit窗口中。" + +#~ msgid "" +#~ "When the application starts, the files that you specify are displayed in " +#~ "the gedit window." +#~ msgstr "" +#~ "当该应用程序启动之后,您指定的文件将会显示在 gedit 窗口中。" + +#~ msgid "Usage" +#~ msgstr "用法" + +#~ msgid "" +#~ "To save changes to an existing file, choose FileSave or click " +#~ "Save on the toolbar." +#~ msgstr "" +#~ "要保存对现存文件的更改,请选择“文件”“保存”,或者单击工具栏上的" +#~ "“保存”按钮。" + +#~ msgid "Type new text from the keyboard." +#~ msgstr "从键盘输入新的文本。" + +#~ msgid "Use the Delete key to delete text." +#~ msgstr "使用 Delete 键删除文本。" + +#~ msgid "" +#~ "Use the Cut, Copy, " +#~ "Paste, and Delete " +#~ "menu items on the Edit menu to edit text." +#~ msgstr "" +#~ "使用“编辑”菜单中的“剪切”、" +#~ "“复制”“粘贴”和" +#~ "“删除”菜单项编辑文本。" + +#~ msgid "To Undo or Redo Edits" +#~ msgstr "取消或重复编辑" + +#~ msgid "" +#~ "To undo an edit, choose EditUndo. To redo an edit, " +#~ "choose EditRedo. The number of previous edits that you can undo " +#~ "is determined by the Set limit on undo actions to " +#~ "setting in the tabbed section of the " +#~ "Preferences dialog." +#~ msgstr "" +#~ "要取消编辑操作,请选择“编辑”“取消”。要重复编辑操作,请" +#~ "选择“编辑”“重复”。可以取消的先前编辑操作的次数由下面的设置来确" +#~ "定:“首选项”对话框中 选项卡式部分的“将取消操作的限制设置为”设置。" + +#~ msgid "Use this escape sequence to specify a new line" +#~ msgstr "使用此转义序列指定一个新行。" + +#~ msgid "Use this escape sequence to specify a tab character" +#~ msgstr "使用此转义序列指定一个制表符。" + +#~ msgid "Use this escape sequence to specify a carriage return" +#~ msgstr "使用此转义序列指定一个回车。" + +#~ msgid "" +#~ "Select the Match case option to only find " +#~ "occurrences of the string that match the case of the text that you enter." +#~ msgstr "" +#~ "选择“大小写匹配”选项就只能查找与您输入的文本大小写完" +#~ "全匹配的字符串。" + +#~ msgid "" +#~ "Click on the Replace button to replace the " +#~ "occurrence of the string with the text in the Replace with field. Click on the Replace All button " +#~ "to replace all occurrences of the string." +#~ msgstr "" +#~ "单击“替换”按钮可以用“替换为”字" +#~ "段中的文本替换出现的字符串。单击“全部替换”按钮可以" +#~ "替换文件中出现的所有该字符串。" + +#~ msgid "" +#~ "Choose FileOpen Location to display the Open Location dialog. Enter the URI of the file that you want to open, then " +#~ "click Open." +#~ msgstr "" +#~ "选择“文件”“打开位置”,显示“打开位置”对话框。输入" +#~ "您要打开的文件的 URI,然后单击“打开”。" + +#~ msgid "The application opens the file located at the URI in read-only mode." +#~ msgstr "该应用程序将以只读模式打开位于该 URI 位置的文件。" + +#~ msgid "" +#~ "Alternatively, you can use the Shell command plugin to pipe command " +#~ "output to the current file. For information about how to use the Shell " +#~ "command plugin, see ." +#~ msgstr "" +#~ "另外,您还可以使用 Shell 命令插件将命令的输出输送到当前文件中。有关如何使" +#~ "用 Shell 命令插件的信息,请参阅 。" + +#~ msgid "" +#~ "To position the cursor on a specific line in the current file, perform " +#~ "the following steps:" +#~ msgstr "要将光标定位在当前文件的指定行上,请执行以下步骤:" + +#~ msgid "" +#~ "Choose SearchGo to Line to display the Go to Line " +#~ "dialog." +#~ msgstr "" +#~ "选择“搜索”“转到行”,显示“转到行”对话框。" + +#~ msgid "" +#~ "Click Go to Line. The application moves the cursor " +#~ "to the line number that you specify." +#~ msgstr "" +#~ "单击“转到行”。 该应用程序会将光标移动到您指定的行号" +#~ "处。" + +#~ msgid "To Change the Input Mode" +#~ msgstr "更改输入模式" + +#~ msgid "" +#~ "To change the input mode, right-click in the text window, then select " +#~ "Input Methods. The Insert Unicode " +#~ "control character menu item provides character layout " +#~ "options that are useful for working with non-Latin character sets." +#~ msgstr "" +#~ "要更改输入模式,请右击文本窗口,然后选择“Input Methods”“插入 Unicode 控制字符”菜单项提" +#~ "供字符布局选项,这些选项对使用非拉丁字符集很有用。" + +#~ msgid "To Print a File" +#~ msgstr "打印文件" + +#~ msgid "Printer pane" +#~ msgstr "打印机窗格" + +#~ msgid "Number of copies" +#~ msgstr "打印份数" + +#~ msgid "Filename" +#~ msgstr "文件名" + +#~ msgid "" +#~ "To print the file to a print file, type the name of the output file in " +#~ "this text box." +#~ msgstr "要将文件打印到某个打印文件,请在此文本框中键入输出文件的名称。" + +#~ msgid "To Customize the Toolbar and Statusbar" +#~ msgstr "定制工具栏和状态栏" + +#~ msgid "Desktop Default" +#~ msgstr "桌面默认" + +#~ msgid "Display the default toolbar." +#~ msgstr "显示默认工具栏。" + +#~ msgid "Icon" +#~ msgstr "图标" + +#~ msgid "Display icons only." +#~ msgstr "只显示图标。" + +#~ msgid "Icon and Text" +#~ msgstr "图标和文本" + +#~ msgid "Display icons and text." +#~ msgstr "显示图标和文本。" + +#~ msgid "Priority Text beside Icons" +#~ msgstr "图标旁的优先级文字" + +#~ msgid "Display icons, and display text beside some of the icons." +#~ msgstr "显示图标及某些图标旁的文字。" + +#~ msgid "Show Cursor Position" +#~ msgstr "显示光标位置" + +#~ msgid "Show Overwrite Mode" +#~ msgstr "显示覆盖模式:" + +#~ msgid "Editor" +#~ msgstr "编辑器" + +#~ msgid "" +#~ "The Editor category is subdivided into the following " +#~ "subcategories:" +#~ msgstr "“编辑器”类别还可以再细分为以下子类别:" + +#~ msgid "Fonts and Colors" +#~ msgstr "字体和颜色" + +#~ msgid "Use default theme font" +#~ msgstr "使用默认主题字体" + +#~ msgid "Editor font" +#~ msgstr "编辑器字体" + +#~ msgid "Use default theme colors" +#~ msgstr "使用默认主题颜色" + +#~ msgid "" +#~ "Select this option to use the default theme colors in the " +#~ "gedit text window." +#~ msgstr "" +#~ "如果选择该选项,系统将在 gedit 文本窗口中使用默" +#~ "认主题颜色。" + +#~ msgid "Text color" +#~ msgstr "文本颜色" + +#~ msgid "" +#~ "Click on the Text color button to display the " +#~ "color selector dialog. Select a color to use to display text in the " +#~ "gedit text window." +#~ msgstr "" +#~ "单击“文本颜色”按钮可以显示颜色选择器对话框。选择一" +#~ "种用于在 gedit 文本窗口中显示文本的颜色。" + +#~ msgid "Background color" +#~ msgstr "背景颜色" + +#~ msgid "" +#~ "Click on the Background color button to display " +#~ "the color selector dialog. Select a background color for the " +#~ "gedit text window." +#~ msgstr "" +#~ "单击“背景颜色”按钮可以显示颜色选择器对话框。为 " +#~ "gedit 文本窗口选择一种背景色。" + +#~ msgid "Selected text color" +#~ msgstr "选定的文本颜色" + +#~ msgid "" +#~ "Click on the Selected text color button to display " +#~ "the color selector dialog. Select a color to use to display selected text." +#~ msgstr "" +#~ "单击“选定的文本颜色”按钮可以显示颜色选择器对话框。" +#~ "选择一种用于显示选定文本的颜色。" + +#~ msgid "" +#~ "Click on the Selection color button to display the " +#~ "color selector dialog. Select a background color to use to highlight a " +#~ "text selection." +#~ msgstr "" +#~ "单击“选择区颜色”按钮可以显示颜色选择器对话框。选择" +#~ "一种用于突出显示文本选择区的背景色。" + +#~ msgid "Set tabs width equivalent to" +#~ msgstr "将制表符宽度设置为" + +#~ msgid "Wrap Mode" +#~ msgstr "回绕模式" + +#~ msgid "" +#~ "Select this option to wrap text onto the next line, at a character level, " +#~ "when you reach the text window boundary." +#~ msgstr "选择此选项可以在您到达文本窗口边界时按字符级别将文本换行到下一行。" + +#~ msgid "Do not split words over two lines" +#~ msgstr "不要将单词拆开放在两行上" + +#~ msgid "Enable auto indentation" +#~ msgstr "启用自动缩进" + +#~ msgid "Display line numbers" +#~ msgstr "显示行号" + +#~ msgid "Open" +#~ msgstr "打开" + +#~ msgid "Supported encodings" +#~ msgstr "支持的编码" + +#~ msgid "" +#~ "A character encoding is a method of converting bytes to characters. " +#~ "Different encodings might convert the same byte sequence into different " +#~ "characters, or might produce invalid output. If you open a file using the " +#~ "same encoding as that used to create the file, all characters are " +#~ "displayed as intended. However, if you open a file using a different " +#~ "encoding, some characters might not be displayed correctly, or an error " +#~ "might be returned." +#~ msgstr "" +#~ "字符编码是将字节转换为字符的方法。 不同的编码方法可能会将相同的字节序列转" +#~ "换成不同的字符,或生成无效的输出。 如果使用创建文件的编码方法打开该文件," +#~ "则所有的字符都按预期的结果显示。 但是,如果使用不同的编码方法打开文件,则" +#~ "某些字符可能无法正确显示,或返回错误。" + +#~ msgid "" +#~ "By default, gedit uses UTF-8 encoding to try " +#~ "to open a file. UTF-8 encoding can be used for multilingual texts, as UTF-" +#~ "8 covers almost all known alphabets and character sets. If the file is " +#~ "not a valid UTF-8 file, gedit tries to open " +#~ "the file by using the encoding for the current locale. If this also " +#~ "fails, gedit tries to use an encoding from the " +#~ "Supported encodings list, starting at the top of the list." +#~ msgstr "" +#~ "在默认情况下,gedit 会尝试使用 UTF-8 编码打开文" +#~ "件。 UTF-8 编码可用于多语言文本,这是因为 UTF-8 涵盖了几乎所有已知的字母表" +#~ "和字符集。如果文件不是有效的 UTF-8 文件,gedit " +#~ "会尝试使用当前语言环境的编码打开该文件。如果这个方法也无效," +#~ "gedit 会尝试从“支援的编码”列表顶部开始选用编" +#~ "码。" + +#~ msgid "" +#~ "To modify the contents of the Supported encodings list, use the buttons " +#~ "described in the following table:" +#~ msgstr "要修改“支持的编码”列表中的内容,请使用下表中说明的按钮:" + +#~ msgid "Button" +#~ msgstr "按钮" + +#~ msgid "Add" +#~ msgstr "添加" + +#~ msgid "Adds an encoding to the list." +#~ msgstr "将编码添加到列表。" + +#~ msgid "Remove" +#~ msgstr "删除" + +#~ msgid "Removes an encoding from the list." +#~ msgstr "从列表中删除编码。" + +#~ msgid "Up arrow" +#~ msgstr "上箭头" + +#~ msgid "Moves an encoding to a higher position in the list." +#~ msgstr "将编码移动到列表中较高的位置上。" + +#~ msgid "Down arrow" +#~ msgstr "下箭头" + +#~ msgid "Moves an encoding to a lower position in the list." +#~ msgstr "将编码移动到列表中较低的位置上。" + +#~ msgid "Create a backup copy of files before saving" +#~ msgstr "保存前创建文件的备份副本" + +#~ msgid "Autosave current file every" +#~ msgstr "自动保存当前文件的时间间隔" + +#~ msgid "When saving an existing file" +#~ msgstr "保存现存文件时" + +#~ msgid "Select one of the following save options:" +#~ msgstr "选择以下保存选项之一:" + +#~ msgid "Always use UTF-8 encoding (faster)" +#~ msgstr "总是使用 UTF-8 编码(较快)" + +#~ msgid "Select this option to save files using UTF-8 encoding." +#~ msgstr "如果选择该选项,系统将使用 UTF-8 编码来保存文件。" + +#~ msgid "Use current locale's encoding if possible" +#~ msgstr "如果可能的话,使用当前语言环境的编码" + +#~ msgid "" +#~ "Select this option to save files using the current locale. You can set up " +#~ "locales for different input methods." +#~ msgstr "" +#~ "如果选择此选项,系统将使用当前语言环境来保存文件。 您可以为不同的输入方法" +#~ "设置语言环境。" + +#~ msgid "Use original file encoding if possible" +#~ msgstr "如果可能的话,使用原文件编码" + +#~ msgid "" +#~ "Select this option to save a file using the current locale if the file " +#~ "was already saved in the current locale." +#~ msgstr "" +#~ "如果选择该选项,当该文件已经以当前语言环境保存的情况下,系统才会使用当前语" +#~ "言环境保存该文件。" + +#~ msgid "When saving a new file" +#~ msgstr "保存新文件时" + +#~ msgid "Select this option to save new files using UTF-8 encoding." +#~ msgstr "如果选择该选项,系统将使用 UTF-8 编码来保存新文件。" + +#~ msgid "" +#~ "Select this option to save new files using the current locale. You can " +#~ "set up locales for different input methods." +#~ msgstr "" +#~ "如果选择此选项,系统将使用当前语言环境来保存新文件。 您可以为不同的输入方" +#~ "法设置语言环境。" + +#~ msgid "Undo" +#~ msgstr "取消" + +#~ msgid "" +#~ "Select this option to set a limit on the number of editing actions that " +#~ "you can undo. Use the spin box to specify the maximum number of actions " +#~ "that you can undo." +#~ msgstr "" +#~ "选择此选项可以限制您能取消的编辑操作的次数。使用该旋转框可以指定您最多能取" +#~ "消的操作次数。" + +#~ msgid "" +#~ "The Print category is subdivided into the following " +#~ "subcategories:" +#~ msgstr "“打印”类别还可以再细分为以下子类别:" + +#~ msgid "Print line numbers every" +#~ msgstr "打印行号的间隔" + +#~ msgid "Page headers" +#~ msgstr "页眉" + +#~ msgid "" +#~ "For information about how to use the Plugins " +#~ "category of the Preferences dialog, see ." +#~ msgstr "" +#~ "有关如何使用“首选项”对话框的“插件”类别的信息,请参见。" + +#~ msgid "" +#~ "A plugin is a supplementary program that enhances the functionality of an " +#~ "application. The gedit plugins enable you to " +#~ "perform a variety of functions related to text editing from within the " +#~ " gedit window. The following table lists the " +#~ " gedit plugins." +#~ msgstr "" +#~ "插件就是用来增强应用程序功能的辅助程序。gedit " +#~ "插件使您可以在 gedit 窗口内执行有关文本编辑的各" +#~ "种功能。下表列出了 gedit 插件。" + +#~ msgid "Plugin Name" +#~ msgstr "插件名称" + +#~ msgid "Purpose" +#~ msgstr "目的" + +#~ msgid "ASCII table" +#~ msgstr "ASCII 表" + +#~ msgid "" +#~ "Displays a dialog that contains an ASCII table. You can use the ASCII " +#~ "table to insert characters into a file." +#~ msgstr "" +#~ "显示一个包含 ASCII 表的对话框。您可以使用 ASCII 表将字符插入到文件中。" + +#~ msgid "CVS ChangeLog" +#~ msgstr "CVS 更改日志" + +#~ msgid "Opens the log messages associated with CVS commit commands." +#~ msgstr "打开与 CVS 提交命令关联的日志消息。" + +#~ msgid "" +#~ "Compares two files and displays the differences between the files in the " +#~ "output window. This plugin uses the diff command to " +#~ "compare the files." +#~ msgstr "" +#~ "比较两个文件并在输出窗口中显示它们的差别。 该插件使用 diff 命令来比较文件。" + +#~ msgid "Document Statistics" +#~ msgstr "文档统计信息" + +#~ msgid "" +#~ "Counts the number of lines, words, characters, and bytes in the current " +#~ "file. The plugin displays the results in a Document Statistics dialog." +#~ msgstr "" +#~ "计算当前文件中的行数、单词数、字符数及字节数。该插件将结果显示在一个" +#~ "“文档统计信息”对话框中。" + +#~ msgid "" +#~ "Indents the selected lines, or removes the indentation from the selected " +#~ "lines." +#~ msgstr "对选定的行进行缩进,或从选定的行删除缩进。" + +#~ msgid "Insert Date/Time" +#~ msgstr "插入日期/时间" + +#~ msgid "Shell command" +#~ msgstr "Shell 命令" + +#~ msgid "Displays the text output of a shell command in the output window." +#~ msgstr "在输出窗口中显示 shell 命令的文本输出。" + +#~ msgid "Sort" +#~ msgstr "排序" + +#~ msgid "Tag list" +#~ msgstr "标记列表" + +#~ msgid "" +#~ "Displays a window that contains a list of common tags. You can use the " +#~ "window to insert a tag into a file." +#~ msgstr "" +#~ "显示一个包含常用标记列表的窗口。您可以使用此窗口将标记插入到文件中。" + +#~ msgid "User name" +#~ msgstr "用户名" + +#~ msgid "Inserts the username of the current user into the file." +#~ msgstr "在文件中插入当前用户的用户名。" + +#~ msgid "To Load gedit Plugins" +#~ msgstr "载入 gedit 插件" + +#~ msgid "" +#~ "To load gedit plugins, choose " +#~ "EditPreferences. Within the Plugins " +#~ "category, click on the Manager subcategory. The " +#~ "Manager subcategory displays the following " +#~ "information:" +#~ msgstr "" +#~ "要载入 gedit 插件,请选择" +#~ "“编辑”“首选项”。在“插件”类别中,单击“管理器”子类别。 “管理器”子类别会显示以下信息:" + +#~ msgid "" +#~ "A Configure plugin button. You can use this button " +#~ "to open a configuration dialog for the plugins that you can configure. " +#~ "For example, see and " +#~ "." +#~ msgstr "" +#~ "“配置插件”按钮。您可以使用该按钮打开一个配置对话" +#~ "框,在该对话框中可以对插件进行配置。例如,请参见。" + +#~ msgid "" +#~ "A brief description of each plugin. To display a description, select the " +#~ "plugin from the list of plugins." +#~ msgstr "每个插件的简要说明。要显示一个说明,请从插件列表中选择该插件。" + +#~ msgid "Details about the author of the plugin and the name of the module." +#~ msgstr "有关插件作者和模块名称的细节。" + +#~ msgid "" +#~ "To load a plugin, select the check box next to the name of the plugin. " +#~ "The gedit application adds the plugin to the " +#~ "appropriate gedit menu, as described in the " +#~ "following table." +#~ msgstr "" +#~ "要载入插件,请选择该插件名称旁的复选框。gedit " +#~ "应用程序会将插件添加到适当的 gedit 菜单中,如下" +#~ "表中所述:" + +#~ msgid "Added to Menu" +#~ msgstr "添加到的菜单" + +#~ msgid "View" +#~ msgstr "视图" + +#~ msgid "ASCII Table" +#~ msgstr "ASCII 表" + +#~ msgid "Open CVS ChangeLogs" +#~ msgstr "打开 CVS 更改日志" + +#~ msgid "Indent" +#~ msgstr "“缩进”" + +#~ msgid "Unindent" +#~ msgstr "“取消缩进”" + +#~ msgid "Insert Date and Time" +#~ msgstr "“插入日期和时间”" + +#~ msgid "Tag List" +#~ msgstr "标记列表" + +#~ msgid "Insert User Name" +#~ msgstr "插入用户名" + +#~ msgid "To Remove gedit Plugins" +#~ msgstr "删除 gedit 插件" + +#~ msgid "" +#~ "To remove gedit plugins, choose " +#~ "EditPreferences. Within the Plugins " +#~ "category, click on the Manager subcategory. To " +#~ "remove a plugin, deselect the check box next to the name of the plugin." +#~ msgstr "" +#~ "要删除 gedit 插件,请选择" +#~ "“编辑”“首选项”。在“插件”类别中,单击“管理器”子类别。 要删除插件,请取消选择该插件旁的复选框。" + +#~ msgid "ASCII Table Plugin" +#~ msgstr "ASCII 表插件" + +#~ msgid "" +#~ "The ASCII table plugin displays a dialog that contains an ASCII table. " +#~ "You can use the ASCII table to insert characters into a file. To use the " +#~ "ASCII table plugin, perform the following steps:" +#~ msgstr "" +#~ "ASCII 表插件会显示包含 ASCII 表的对话框。您可以使用 ASCII 表将字符插入到文" +#~ "件中。 要使用 ASCII 表插件,请执行以下步骤:" + +#~ msgid "Load the ASCII table plugin." +#~ msgstr "载入 ASCII 表插件。" + +#~ msgid "" +#~ "Choose ViewASCII Table to display the ASCII Table " +#~ "dialog." +#~ msgstr "" +#~ "选择“视图”“ASCII 表”,显示“ASCII 表”对话框。" + +#~ msgid "" +#~ "Scroll through the list to find the character that you require, then " +#~ "select the character with a single click." +#~ msgstr "滚动列表查找所需的字符,然后单击该字符以选中它。" + +#~ msgid "" +#~ "Click on the Insert char button to insert the " +#~ "character at the cursor position in the current file." +#~ msgstr "" +#~ "单击“插入字符”按钮在当前文件的光标位置处插入该字" +#~ "符。" + +#~ msgid "" +#~ "When you finish entering ASCII characters, click Close to close the ASCII Table dialog." +#~ msgstr "" +#~ "输入 ASCII 字符后,单击“关闭”以关闭" +#~ "“ASCII 表”对话框。" + +#~ msgid "" +#~ "The CVS ChangeLog plugin opens the log messages associated with CVS " +#~ "commit commands. This plugin enables you to easily paste text into the " +#~ "commit message from the ChangeLog file. To use the CVS ChangeLog plugin, " +#~ "perform the following steps:" +#~ msgstr "" +#~ "CVS 更改日志插件可以打开与 CVS 提交命令关联的日志消息。 该插件使您可以轻松" +#~ "地将文本从更改日志文件中粘贴到提交消息中。 要使用 CSV 更改日志插件,请执行" +#~ "以下步骤:" + +#~ msgid "" +#~ "Set the environment variable CVSEDITOR to gedit. For example, if you are using the bash " +#~ "shell, run the following command at the operating system prompt: " +#~ "export CVSEDITOR=gedit " +#~ "" +#~ msgstr "" +#~ "将环境变量 CVSEDITOR 设置为 gedit。 例如,如果" +#~ "您使用 bash shell,则请在操作系统提示符下使用下面的命" +#~ "令: export CVSEDITOR=gedit " + +#~ msgid "" +#~ "Commit a file to CVS in the usual way. A gedit " +#~ "window opens, to enable you to enter the commit message." +#~ msgstr "" +#~ "以通常的方式将文件提交到 CVS。系统会打开 gedit " +#~ "窗口,使您可以输入提交消息。" + +#~ msgid "Load the CVS ChangeLog plugin." +#~ msgstr "载入 CVS 更改日志插件。" + +#~ msgid "" +#~ "Choose FileOpen CVS " +#~ "ChangeLogs to open all of the ChangeLog files " +#~ "referenced in the commit message. gedit opens " +#~ "each ChangeLog file in a new tab." +#~ msgstr "" +#~ "选择“文件”“打开 CVS 更改日" +#~ "志”,打开提交消息中引用的所有更改日志文件。" +#~ "gedit 会在新选项卡中打开每个更改日志文件。" + +#~ msgid "" +#~ "Copy the ChangeLog entries that you want to add to the commit message " +#~ "from the gedit ChangeLog files." +#~ msgstr "" +#~ "从 gedit 更改日志文件复制更改日志项(您要将这些" +#~ "更改日志项添加到提交消息中)。" + +#~ msgid "" +#~ "Insert the copied ChangeLog entries in the gedit commit message tab." +#~ msgstr "" +#~ "在 gedit 提交消息选项卡中插入复制的更改日志项。" + +#~ msgid "Save your changes to the commit message, then close all files." +#~ msgstr "将更改保存到提交消息中,然后关闭所有文件。" + +#~ msgid "" +#~ "The Compare Files plugin compares two files and displays the differences " +#~ "between the files in the output window. This plugin uses the " +#~ "diff command to compare the files. To use the Compare " +#~ "Files plugin, perform the following steps:" +#~ msgstr "" +#~ "比较文件插件会比较两个文件,并在输出窗口中显示两个文件之间的差异。 该插件" +#~ "使用 diff 命令来比较文件。 要使用比较文件插件,请执行以" +#~ "下步骤:" + +#~ msgid "Load the Compare Files plugin." +#~ msgstr "载入比较文件插件。" + +#~ msgid "" +#~ "Choose ToolsCompare Files. When you choose this option for the first " +#~ "time, you are prompted to confirm the location of the diff command. You are not prompted for this location again. See for information about how to " +#~ "change this location later." +#~ msgstr "" +#~ "选择“工具”“比较文件”。 当首次选择此选项时,系统会提示您确认 " +#~ "diff 命令的位置。系统不会再次提示您确认该位置。有关如何" +#~ "在以后更改此位置的信息,请参见。" + +#~ msgid "" +#~ "Click OK to display the Compare Files dialog." +#~ msgstr "" +#~ "单击“确定”显示“比较文件”对话" +#~ "框。" + +#~ msgid "" +#~ "Specify the files that you want to compare. To specify an open file, " +#~ "select the file from the drop-down list. To specify a closed file, enter " +#~ "the location of the file in the text box." +#~ msgstr "" +#~ "指定要比较的文件。要指定打开的文件,请从下拉列表中选择。要指定已关闭的文" +#~ "件,请在文本框中输入文件的位置。" + +#~ msgid "" +#~ "To ignore changes in the amount of white space, select the " +#~ "Ignore blanks option." +#~ msgstr "要忽略空白大小的更改,请选择“忽略空白”选项。" + +#~ msgid "" +#~ "To use the unified output format, showing three lines of context, select " +#~ "the Use the unified output format option." +#~ msgstr "" +#~ "要使用统一的输出格式,显示三行上下文,请选择“使用统一的输出格" +#~ "式”选项。" + +#~ msgid "" +#~ "Click on the Compare button to compare the " +#~ "contents of the specified files. The command output is displayed in the " +#~ "output window." +#~ msgstr "" +#~ "单击“比较”按钮以比较指定文件的内容。该命令输出会显" +#~ "示在输出窗口中。" + +#~ msgid "" +#~ "For more information, see diff1." +#~ msgstr "" +#~ "有关更多信息,请参见 diff1。" + +#~ msgid "To Configure the Compare Files Plugin" +#~ msgstr "配置比较文件插件" + +#~ msgid "" +#~ "To change the location of the command that the Compare Files plugin uses, " +#~ "perform the following steps:" +#~ msgstr "要更改比较文件插件所使用的命令的位置,请执行以下步骤:" + +#~ msgid "" +#~ "Within the Plugins category, click on the " +#~ "Manager subcategory." +#~ msgstr "" +#~ "在“插件”类别中,单击“管理器”子类" +#~ "别。" + +#~ msgid "" +#~ "Click on the Configure plugin button to display " +#~ "the Set program location dialog." +#~ msgstr "" +#~ "单击“配置插件”按钮以显示“设置程序位置”对话框。" + +#~ msgid "" +#~ "Specify the location of the diff command in the " +#~ "Location to search for text box." +#~ msgstr "" +#~ "在“搜索位置”文本框中指定 diff 命令" +#~ "的位置。" + +#~ msgid "Load the Document Statistics plugin." +#~ msgstr "载入文档统计插件。" + +#~ msgid "" +#~ "To close the Document Statistics dialog, click " +#~ "Close." +#~ msgstr "" +#~ "要关闭“文档统计信息”对话框,请单击“关闭”。" + +#~ msgid "" +#~ "The Indent lines plugin indents the selected lines, or removes the " +#~ "indentation from the selected lines. To use the Indent lines plugin, " +#~ "perform the following steps:" +#~ msgstr "" +#~ "缩进行插件对选定的行进行缩进,或从选定的行删除缩进。 要使用缩进行插件,请" +#~ "执行以下步骤:" + +#~ msgid "Load the Insert Date/Time plugin." +#~ msgstr "载入插入日期/时间插件。" + +#~ msgid "" +#~ "See for information about " +#~ "how to configure the Insert Date/Time plugin." +#~ msgstr "" +#~ "有关如何配置插入日期/时间插件的信息,请参见。" + +#~ msgid "" +#~ "The Shell Command plugin enables you to capture the output from a shell " +#~ "command in gedit, by displaying the text " +#~ "output of the shell command in the output window. To use the Shell " +#~ "command plugin, perform the following steps:" +#~ msgstr "" +#~ "Shell 命令插件使您可以抓取 gedit 中shell 命令的" +#~ "输出,其方式是在输出窗口中显示 shell 命令的文本输出。要使用 Shell 命令插" +#~ "件,请执行以下步骤:" + +#~ msgid "Load the Shell command plugin." +#~ msgstr "载入 Shell 命令插件。" + +#~ msgid "" +#~ "Choose ToolsRun Command to display the Run Command " +#~ "dialog." +#~ msgstr "" +#~ "选择“工具”“运行命令” 以显示“运行命令”对话框。" + +#~ msgid "" +#~ "Type the shell command that you want to execute in the Command field." +#~ msgstr "在“命令”字段中键入您要执行的 Shell 命令。" + +#~ msgid "%f" +#~ msgstr "%f" + +#~ msgid "" +#~ "Use these special characters to specify the filename of the current " +#~ "active document, including the path." +#~ msgstr "这些特殊字符可用于指定当前活动文档的文件名,包括路径。" + +#~ msgid "%n" +#~ msgstr "%n" + +#~ msgid "" +#~ "Use these special characters to specify the filename of the current " +#~ "active document, without the path. In this case, gedit looks for the file in the Working directory." +#~ msgstr "" +#~ "这些特殊字符可用于指定当前活动文档的文件名,不包括路径。在这种情况下," +#~ "gedit 会在工作目录中查找该文件。" + +#~ msgid "" +#~ "Edit the Working directory field if necessary. By " +#~ "default, the Shell command plugin executes the command you specify in the " +#~ "current directory." +#~ msgstr "" +#~ "如果需要,编辑“工作目录”字段。默认情况下,Shell 命令" +#~ "插件会在当前目录中执行您指定的命令。" + +#~ msgid "" +#~ "Select the Show results in Output Window option to " +#~ "display the results of the command in the output window. If you do not " +#~ "select this option, gedit discards the results " +#~ "of the command." +#~ msgstr "" +#~ "选择“在输出窗口中显示结果”选项,以便在输出窗口中显示" +#~ "命令的结果。如果不选择此选项,gedit 会丢弃该命" +#~ "令的结果。" + +#~ msgid "" +#~ "Click Run. The Shell command plugin executes the " +#~ "command and inserts the text output into the output window." +#~ msgstr "" +#~ "单击“Run”。该 Shell 命令插件会执行该命令,并将文本" +#~ "输出插入到输出窗口中。" + +#~ msgid "" +#~ "Use the Shift key to select the text in the output " +#~ "window." +#~ msgstr "使用 Shift 键在输出窗口中选择文本。" + +#~ msgid "" +#~ "Click on the Copy selected lines button to copy " +#~ "the selected text into the buffer." +#~ msgstr "" +#~ "单击“复制选定的文本”按钮将选定的文本复制到缓冲区" +#~ "中。" + +#~ msgid "" +#~ "Click on the Close the output window button to " +#~ "close the output window." +#~ msgstr "单击“关闭输出窗口”按钮关闭输出窗口。" + +#~ msgid "The Sort plugin sorts the selected text." +#~ msgstr "排序插件对选定的文本进行排序。" + +#~ msgid "Load the Sort plugin." +#~ msgstr "载入排序插件。" + +#~ msgid "" +#~ "The Tag List plugin displays a window that contains a list of common " +#~ "tags. You can use the window to insert a tag into a file. To use the Tag " +#~ "List plugin, perform the following steps:" +#~ msgstr "" +#~ "标记列表插件会显示包含常用标记列表的窗口。您可以使用该窗口将标记插入到文件" +#~ "中。 要使用标记列表插件,请执行以下步骤:" + +#~ msgid "Load the Tag List plugin." +#~ msgstr "载入标记列表插件。" + +#~ msgid "" +#~ "To close the Tag list plugin window, click on the " +#~ "Close Window button in the window frame. " +#~ "Alternatively, press CtrlW when the focus is on the Tag list plugin " +#~ "window." +#~ msgstr "" +#~ "要关闭“标记列表插件”窗口,请单击窗口框中的" +#~ "“关闭窗口”按钮。或者,当焦点在“标记列表插" +#~ "件”窗口时,按下 CtrlW。" + +#~ msgid "Load the User name plugin." +#~ msgstr "载入用户名插件。" + +#~ msgid "" +#~ "Choose EditInsert User Name to insert your username at the cursor position " +#~ "in the current file." +#~ msgstr "" +#~ "选择“编辑”“插入用户名”以在当前文件的光标位置处插入您的用户名。" diff --git a/help/zh_HK/figures/gedit_window.png b/help/zh_HK/figures/gedit_window.png new file mode 100755 index 00000000..b2b7c927 Binary files /dev/null and b/help/zh_HK/figures/gedit_window.png differ diff --git a/help/zh_HK/zh_HK.po b/help/zh_HK/zh_HK.po new file mode 100755 index 00000000..9f07c5d2 --- /dev/null +++ b/help/zh_HK/zh_HK.po @@ -0,0 +1,2717 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2005-10-22 13:29-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../base.xml:24(title) ../base.xml:95(revnumber) +msgid "gedit Manual V2.5.1" +msgstr "gedit 手冊 V2.5.1" + +#: ../base.xml:26(year) +msgid "2003" +msgstr "2003 年" + +#: ../base.xml:27(holder) ../base.xml:30(holder) ../base.xml:52(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: ../base.xml:29(year) +msgid "2002" +msgstr "2002 年" + +#: ../base.xml:32(year) ../base.xml:152(date) +msgid "2000" +msgstr "2000 年" + +#: ../base.xml:33(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: ../base.xml:44(publishername) ../base.xml:59(orgname) ../base.xml:99(para) +#: ../base.xml:107(para) ../base.xml:115(para) ../base.xml:123(para) +#: ../base.xml:131(para) ../base.xml:139(para) ../base.xml:147(para) +#: ../base.xml:156(para) +msgid "MATE Documentation Project" +msgstr "MATE 文件專案" + +#: ../base.xml:56(firstname) +msgid "Eric" +msgstr "Eric" + +#: ../base.xml:57(surname) +msgid "Baudais" +msgstr "Baudais" + +#: ../base.xml:60(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: ../base.xml:64(firstname) +msgid "Baris" +msgstr "Baris" + +#: ../base.xml:65(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek 提供 gedit 應用程式較早版本的資訊。" + +#: ../base.xml:66(contrib) +msgid "Acknowledgements" +msgstr "感謝" + +#: ../base.xml:69(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: ../base.xml:70(surname) +msgid "George provided information about plugins." +msgstr "George 提供增效模組的相關資訊。" + +#: ../base.xml:98(para) ../base.xml:106(para) ../base.xml:114(para) +#: ../base.xml:122(para) ../base.xml:130(para) ../base.xml:138(para) +#: ../base.xml:146(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE 文件小組" + +#: ../base.xml:103(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit 手冊 V2.5" + +#: ../base.xml:104(date) +msgid "March 2003" +msgstr "2003 年 3 月" + +#: ../base.xml:111(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit 手冊 V2.4" + +#: ../base.xml:112(date) +msgid "January 2003" +msgstr "2003 年 1 月" + +#: ../base.xml:119(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit 手冊 V2.3" + +#: ../base.xml:120(date) +msgid "September 2002" +msgstr "2002 年 9 月" + +#: ../base.xml:127(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit 手冊 V2.2" + +#: ../base.xml:128(date) +msgid "August 2002" +msgstr "2002 年 8 月" + +#: ../base.xml:135(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit 手冊 V2.1" + +#: ../base.xml:136(date) +msgid "June 2002" +msgstr "2002 年 6 月" + +#: ../base.xml:143(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit 手冊 V2.0" + +#: ../base.xml:144(date) +msgid "March 2002" +msgstr "2002 年 3 月" + +#: ../base.xml:151(revnumber) +msgid "gedit V1.0" +msgstr "gedit 手冊 V1.0" + +#: ../base.xml:154(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: ../base.xml:160(releaseinfo) +msgid "This manual describes version 2.2.1 of gedit." +msgstr "本手冊的內容是說明 2.2.1 版的 gedit。" + +#: ../base.xml:163(title) +msgid "Feedback" +msgstr "意見回饋" + +#: ../base.xml:164(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"關於本 gedit 應用程式或本手冊,如果要報告錯誤 或提" +"出建議,請遵照 MATE " +"Feedback Page 的指示。" + +#: ../base.xml:171(primary) +msgid "gedit" +msgstr "gedit" + +#: ../base.xml:172(primary) +msgid "text editor" +msgstr "文字編輯器" + +#: ../base.xml:177(title) +msgid "Introduction" +msgstr "介紹" + +#: ../base.xml:178(para) +msgid "" +"The gedit application enables you to create and " +"edit text files. You can use gedit plugins to " +"perform a variety of tasks related to text-editing from within the " +"gedit window." +msgstr "" +"您可以使用 gedit 應用程式建立和編輯文字 檔案。您可" +"以使用 gedit 增效模組在 gedit 視窗中 執行各種和文字編輯相關的工作。" + +#: ../base.xml:185(title) +msgid "Getting Started" +msgstr "入門" + +#: ../base.xml:189(title) +msgid "To Start gedit" +msgstr "啟動 gedit" + +#: ../base.xml:190(para) +msgid "You can start gedit in the following ways:" +msgstr "您可以使用下列方式啟動 gedit:" + +#: ../base.xml:193(guimenu) +msgid "Menu" +msgstr "功能表" + +#: ../base.xml:195(para) +msgid "" +"For information about how to start gedit from a " +"menu, see the latest version of the MATE Desktop User Guide for your " +"platform." +msgstr "" +"若需如何從功能表啟動 gedit 的詳細資訊,請參閱最新" +"版的平台 MATE Desktop User Guide。" + +#: ../base.xml:200(term) +msgid "Command line" +msgstr "指令行" + +#: ../base.xml:202(para) +msgid "Execute the following command: gedit" +msgstr "執行以下的指令: gedit" + +#: ../base.xml:210(title) +msgid "When You Start gedit" +msgstr "當您啟動 gedit" + +#: ../base.xml:211(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "當您啟動 gedit 後,會顯示下面的視窗:" + +#: ../base.xml:214(title) +msgid "gedit Window" +msgstr "gedit 視窗" + +#: ../base.xml:220(phrase) +msgid "Shows gedit main window." +msgstr "顯示 gedit 主視窗。" + +#: ../base.xml:226(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"gedit 視窗包含下列的 元素:您可以選擇下列條件中的" +"一項或以上:" + +#: ../base.xml:229(term) +msgid "Menubar" +msgstr "功能表列" + +#: ../base.xml:231(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"在功能表列上的功能表中,有您在 gedit 中與檔案工作" +"所需的所有指令。" + +#: ../base.xml:235(term) +msgid "Toolbar" +msgstr "工具列" + +#: ../base.xml:237(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "工具列包含了您可以由功能表列 存取的指令子集。" + +#: ../base.xml:241(term) +msgid "Display area" +msgstr "顯示區域" + +#: ../base.xml:243(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "顯示區域包含了您正在 編輯之檔案的文字。" + +#: ../base.xml:247(term) +msgid "Output window" +msgstr "輸出視窗" + +#: ../base.xml:249(para) +msgid "" +"The output window displays the output returned by the Shell command plugin " +"and the Compare Files plugin." +msgstr "輸出視窗可以顯示由 Shell 指令增效模組和比對檔案增效模組傳回的輸出。" + +#: ../base.xml:252(term) +msgid "Statusbar" +msgstr "狀態列" + +#: ../base.xml:254(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items." +msgstr "" +"狀態列可以顯示目前 gedit 活動的資訊,以及有關功能" +"表項目 的上下文資訊。" + +#: ../base.xml:260(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"當您在 gedit 視窗中按滑鼠右鍵時,應用程式會顯示即" +"現式功能表。即現式功能表包含了 最常用的文字編輯指令。" + +#: ../base.xml:266(title) +msgid "To Open a File" +msgstr "開啟檔案" + +#: ../base.xml:267(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click OK. The file is displayed in the gedit " +"window." +msgstr "" +"如果要開啟檔案,請選擇 檔案開啟 ,顯示開啟檔案對話方塊。選取要" +"開啟的檔案 ,然後按一下確定。這個檔案便會 顯示在 " +"gedit 視窗中。" + +#: ../base.xml:273(para) +msgid "" +"You can open multiple files in gedit. The " +"application displays one file at a time in the application window. The " +"application adds a tab for each open file to the window. To display another " +"open file, click on the tab that corresponds to the file. To create a new " +" gedit window for each file that is open, drag " +"the tab corresponding to each file to the desktop background." +msgstr "" +"您可以在 gedit 中,開啟多個檔案。 本應用程式在應用" +"程式視窗中,一次只會顯示一個檔案。 應用程式會為每個開啟的檔案,在視窗中增加一" +"個標籤。如果要顯示另外一個 開啟的檔案,請按該檔案的標籤。如果為每一個開啟的檔" +"案,建立一個新的 gedit 視窗,請將檔案的 標籤一個" +"個地拖曳至桌面背景上。" + +#: ../base.xml:279(para) +msgid "" +"You can also use the Documents menu to move between the " +"open files. You can choose DocumentsMove to New Window to move a " +"document to a new gedit window." +msgstr "" +"您也可以使用 文件功能表,在開啟的檔案之間移動。您可以選擇" +"文件移至新視窗,將文件移到新的 gedit 視窗。" + +#: ../base.xml:290(phrase) +msgid "Shows Recent Files menu icon." +msgstr "顯示最近使用的檔案功能表圖示。" + +#: ../base.xml:282(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the " +"icon on the toolbar to display the list of recent files." +msgstr "" +"應用程式會記錄您所編輯的最後 5 個 檔案,並以功能表項目的方式,顯示在 " +"檔案功能表中。您也可以按一下 " +" 工具" +"列上的圖示,顯示最近使用的檔案清單。" + +#: ../base.xml:297(title) +msgid "To Open Multiple Files from a Command Line" +msgstr "從指令行開啟多個檔案" + +#: ../base.xml:298(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"您可以從指令行執行 gedit,並開啟一個或多個檔案。如" +"果要從指令行開啟多個檔案,請鍵入下列指令,然後按一下 Return " +"鍵。" + +#: ../base.xml:301(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: ../base.xml:301(command) +msgid "gedit " +msgstr "gedit " + +#: ../base.xml:302(para) +msgid "" +"When the application starts, the files that you specify are displayed in the " +"gedit window." +msgstr "" +"當應用程式啟動時,您所指定的檔案便會顯示在 gedit " +"視窗內。" + +#: ../base.xml:304(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see gedit1." +msgstr "" +"若需如何從指令行執行 gedit 的詳細資訊,請參閱 " +"gedit1。" + +#: ../base.xml:309(title) +msgid "Usage" +msgstr "使用" + +#: ../base.xml:313(title) +msgid "To Create a New File" +msgstr "建立新檔案" + +#: ../base.xml:314(para) +msgid "" +"To create a new file, choose FileNew. The application " +"displays a new file in the gedit window." +msgstr "" +"如果要建立新檔案,請選擇 檔案開新" +"檔案。應用程式會在 gedit 視窗內顯示新檔案。" + +#: ../base.xml:321(title) +msgid "To Save a File" +msgstr "儲存檔案" + +#: ../base.xml:322(para) +msgid "You can save files in the following ways:" +msgstr "您可以用下列方式儲存檔案:" + +#: ../base.xml:324(para) +msgid "" +"To save changes to an existing file, choose FileSave or click " +"Save on the toolbar." +msgstr "" +"如果要將變更儲存到目前的檔案,請選擇 檔案儲存 或按一下工具列上的" +"儲存 。" + +#: ../base.xml:329(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save as " +"dialog box, then click OK." +msgstr "" +"如果要儲存新檔案,或以新的檔案名稱儲存目前的檔案,請選擇 " +"檔案另存 新檔。請將檔案名稱輸入另存 新檔對話方塊,然後按一" +"下確定。" + +#: ../base.xml:334(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"如果要儲存目前在 gedit 中開啟的所有檔案,請選擇 " +"文件全部 儲存。" + +#: ../base.xml:343(title) +msgid "To Edit Text" +msgstr "編輯文字" + +#: ../base.xml:344(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "您可以使用下列方式編輯檔案文字:" + +#: ../base.xml:346(para) +msgid "Type new text from the keyboard." +msgstr "由鍵盤輸入新的文字。" + +#: ../base.xml:348(para) +msgid "Use the Delete key to delete text." +msgstr "使用刪除鍵刪除文字。" + +#: ../base.xml:351(para) +msgid "" +"Use the Cut, Copy, " +"Paste, and Delete menu " +"items on the Edit menu to edit text." +msgstr "" +"請使用剪下複製、" +"貼上刪除功能表項目 " +"(在編輯功能表上) 來編輯文字。" + +#: ../base.xml:356(para) +msgid "You can perform any of the following actions on the selected text:" +msgstr "您可以在所選取的文字上執行下列任何一個動作:" + +#: ../base.xml:359(para) +msgid "" +"To copy the selected text to a buffer, choose EditCopy." +msgstr "" +"如果要將選取的文字複製到緩衝區中,請選擇 編輯複製。" + +#: ../base.xml:363(para) +msgid "" +"To delete the selected text from the file and move the selected text to a " +"buffer, choose EditCut." +msgstr "" +"如果要從檔案中刪除選取的文字,並將 選取的文字移動至緩衝區,請選擇 " +"編輯剪下。" + +#: ../base.xml:368(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"如果要從檔案中永遠刪除選取的文字,請選擇 編輯刪除e。" + +#: ../base.xml:372(para) +msgid "" +"To insert the contents of the buffer at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file." +msgstr "" +"如果要在游標位置上加入緩衝區 的內容,請選擇 編輯貼上。您必須先剪下或複製文字 " +"才能將文字貼進檔案。" + +#: ../base.xml:378(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"如果要選取檔案中所有的文字,請選擇 編輯全部 選取。" + +#: ../base.xml:386(title) +msgid "To Undo or Redo Edits" +msgstr "還原或重做編輯" + +#: ../base.xml:387(para) +msgid "" +"To undo an edit, choose EditUndo. To redo an edit, " +"choose EditRedo. The number of previous edits that you can undo is determined by " +"the Set limit on undo actions to setting in the tabbed section of the Preferences dialog." +msgstr "" +"如果要還原或重做編輯,請選擇 編輯" +"還原。如果要重做編輯,請選擇 " +"編輯重做。您所能還原之前編" +"輯的次數,是取決於 限制還原次數為設定 (在 標籤區段中 (在 偏好設定對話方塊" +"中))。" + +#: ../base.xml:399(title) +msgid "To Find Text" +msgstr "尋找文字" + +#: ../base.xml:400(para) +msgid "To search a file for a string, perform the following steps:" +msgstr "如果要搜尋檔案中的字串,請執行下列步驟:" + +#: ../base.xml:402(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"請選擇 搜尋尋找 以顯示尋找對話方塊。" + +#: ../base.xml:407(para) ../base.xml:459(para) +msgid "" +"Type the string that you want to find, in the Search for field." +msgstr "將您要尋找的字串,鍵入 搜尋欄位中。" + +#: ../base.xml:409(para) ../base.xml:461(para) +msgid "You can include the following escape sequences:" +msgstr "您可以包括下列的逸出序列:" + +#: ../base.xml:412(literal) ../base.xml:464(literal) +msgid "\\n" +msgstr "\\n" + +#: ../base.xml:413(para) ../base.xml:465(para) +msgid "Use this escape sequence to specify a new line" +msgstr "請使用這個逸出序列,指定新的一行" + +#: ../base.xml:416(literal) ../base.xml:468(literal) +msgid "\\t" +msgstr "\\t" + +#: ../base.xml:417(para) ../base.xml:469(para) +msgid "Use this escape sequence to specify a tab character" +msgstr "請使用這個逸出序列,指定 Tab 字元" + +#: ../base.xml:420(literal) ../base.xml:472(literal) +msgid "\\r" +msgstr "\\r" + +#: ../base.xml:421(para) ../base.xml:473(para) +msgid "Use this escape sequence to specify a carriage return" +msgstr "請使用這個逸出序列,指定換行鍵" + +#: ../base.xml:425(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type." +msgstr "" +"選取符合大小寫選項, 尋找只符合您所鍵入文字狀況 的字串。" + +#: ../base.xml:429(para) ../base.xml:484(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type." +msgstr "" +"選取全字相符選項, 尋找字串中完全符合您所輸入的 文字。" + +#: ../base.xml:433(para) ../base.xml:488(para) +msgid "" +"Select the Wrap around option to search to the end of " +"the file and then continue the search from the beginning of the file." +msgstr "" +"選取全檔搜尋選項,搜尋到檔案結尾後再從檔案開頭繼續搜尋。" + +#: ../base.xml:435(para) ../base.xml:490(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string. If gedit finds the " +"string, the application moves the cursor to the string, and selects the " +"string." +msgstr "" +"按一下尋找,搜尋檔案中 第一個字串事件。如果 " +"gedit 找到字串,應用程式會將游標移動到字串上,並選" +"取 該字串。" + +#: ../base.xml:440(para) ../base.xml:500(para) +msgid "" +"To find the next occurrence of the string, click Find." +msgstr "如果要尋找符合的下一個字串,請按一下 找下一個。" + +#: ../base.xml:443(para) ../base.xml:503(para) +msgid "To finish the search, click Close." +msgstr "如果要結束搜尋,請按一下 關閉。" + +#: ../base.xml:450(title) +msgid "To Find and Replace Text" +msgstr "尋找並取代文字" + +#: ../base.xml:451(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "如果要搜尋檔案中的字串,並以另外一個字串 取代之,請執行下列的步驟:" + +#: ../base.xml:454(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"請選擇 搜尋取代 ,顯示取代對話方塊。" + +#: ../base.xml:477(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "將您要用來取代尋找 字串的字串,鍵入取代為欄位中。" + +#: ../base.xml:480(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you enter." +msgstr "" +"選取符合大小寫選項, 尋找只符合您所鍵入文字狀況 的字串。" + +#: ../base.xml:495(para) +msgid "" +"Click on the Replace button to replace the occurrence " +"of the string with the text in the Replace with field. " +"Click on the Replace All button to replace all " +"occurrences of the string." +msgstr "" +"按一下取代按鈕,以您在 取代為 欄" +"位中鍵入的文字取代該字串。按一下全部取代按鈕,取代 所" +"有符合的字串。" + +#: ../base.xml:510(title) +msgid "To Open a File from a URI" +msgstr "從 URI 開啟檔案" + +#: ../base.xml:511(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform one of the " +"following steps:" +msgstr "" +"如果要從資源識別統一描述器 (Uniform Resource Identifier,URI) 開啟檔案,請執" +"行下列任一項步驟:" + +#: ../base.xml:514(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog. Enter the URI of the file that you want to open, then click " +"Open." +msgstr "" +"請選擇檔案開啟位置 ,顯示開啟位置 對話方塊。輸入" +"您要開啟 檔案的 URI ,然後按一下開啟。" + +#: ../base.xml:522(para) +msgid "" +"Type gedit URI at a command " +"line, where URI is the URI of the file that you " +"want to open, then press Return. Valid types of " +"URI include http:, " +"ftp:, file:, and all of the methods " +"supported by mate-vfs." +msgstr "" +"在指令行上輸入 gedit URI (此處" +"的 URI 是指您要開啟之檔案的 URI),然後按下 " +"Return 鍵。有效的 URI 類型包括 " +"http:ftp:file:," +"以及 mate-vfs 支援的所有方法。" + +#: ../base.xml:527(para) +msgid "The application opens the file located at the URI in read-only mode." +msgstr "應用程式會以唯讀模式開啟位於 URI 的檔案。" + +#: ../base.xml:531(title) +msgid "To Pipe the Output of a Command to a File" +msgstr "輸出指令到檔案" + +#: ../base.xml:532(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"您可以使用 gedit,將指令的輸出傳送到 文字檔案。例" +"如,如果要將 ls 指令的輸出傳送到文字檔案,請鍵入 " +"ls | gedit,然後按下 Return 鍵。" + +#: ../base.xml:536(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"ls 指令的輸出,會 在 gedit 視窗" +"中以一個新的文字檔案顯示。" + +#: ../base.xml:538(para) +msgid "" +"Alternatively, you can use the Shell command plugin to pipe command output " +"to the current file. For information about how to use the Shell command " +"plugin, see ." +msgstr "" +"或者,您可以使用 Shell 指令增效模組,將指令輸出 傳送到目前的檔案中。如需如何" +"使用 Shell 指令增效模組的資訊,請參閱 。" + +#: ../base.xml:543(title) +msgid "To Position the Cursor on a Specific Line" +msgstr "將游標移到特定行" + +#: ../base.xml:544(para) +msgid "" +"To position the cursor on a specific line in the current file, perform the " +"following steps:" +msgstr "如果要將游標移到目前檔案中的特定行,請執行下列的 步驟:" + +#: ../base.xml:547(para) +msgid "" +"Choose SearchGo to Line to display the Go to Line " +"dialog." +msgstr "" +"請選擇 搜尋移至 某行 ,顯示移至某行對話方塊。" + +#: ../base.xml:552(para) +msgid "" +"Type the number of the line that you want to move the cursor to in the " +"Line number field." +msgstr "" +"如果您想把游標移動到某一行,請將 行數鍵入行數欄位中。" + +#: ../base.xml:555(para) +msgid "" +"Click Go to Line. The application moves the cursor to " +"the line number that you specify." +msgstr "" +"按一下移至某行。應用程式 便會將游標移動至您指定的行" +"數。" + +#: ../base.xml:558(para) +msgid "" +"To close the Go to Line dialog, click Close." +msgstr "" +"如果要關閉移至某行對話方塊,請按一下關閉。" + +#: ../base.xml:563(title) +msgid "To Change the Input Mode" +msgstr "變更輸入模式" + +#: ../base.xml:564(para) +msgid "" +"To change the input mode, right-click in the text window, then select " +"Input Methods. The Insert Unicode " +"control character menu item provides character layout options " +"that are useful for working with non-Latin character sets." +msgstr "" +"如果要變更輸入模式,請在文字視窗上按滑鼠右鍵,然後選取 輸入方法" +"插入統一碼控制字元功能表項目會提" +"供字元配置選項,這對使用非拉丁語系的字元集很有幫助。" + +#: ../base.xml:570(title) +msgid "To Print a File" +msgstr "列印檔案" + +#: ../base.xml:571(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "您可以使用gedit,執行 下列列印作業:" + +#: ../base.xml:574(para) +msgid "Print a file to a printer." +msgstr "由印表機列印檔案。" + +#: ../base.xml:576(para) +msgid "Print the output of the print command to a file." +msgstr "將列印指令的輸出列印到檔案。" + +#: ../base.xml:579(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"如果您是列印至檔案,gedit 會先將 檔案輸出傳送到某" +"個印前格式檔案。最常見的印前 格式為 PostScript 與 Portable Document Format " +"(PDF)。" + +#: ../base.xml:583(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"如果要預覽想列印的頁面,請選擇 檔案預覽列印。" + +#: ../base.xml:587(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"如果要將目前的檔案列印至印表機或檔案,請選擇 檔案列印 ,顯示列印對話方塊。" + +#: ../base.xml:592(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "列印對話方塊可以讓您指定下列 列印選項:" + +#: ../base.xml:596(title) +msgid "Printer Tabbed Section" +msgstr "印表機標籤區段" + +#: ../base.xml:598(term) +msgid "Printer pane" +msgstr "印表機窗格" + +#: ../base.xml:600(para) +msgid "Select the printer to which you want to print the file." +msgstr "選取您要列印檔案 的印表機。" + +#: ../base.xml:604(guilabel) +msgid "Print range" +msgstr "列印範圍" + +#: ../base.xml:606(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "選取下列任一選項,決定 要列印的頁數:" + +#: ../base.xml:610(guilabel) +msgid "All" +msgstr "全部" + +#: ../base.xml:611(para) +msgid "Select this option to print all of the pages in the file." +msgstr "選取這個選項,會列印檔案中的所有頁面。" + +#: ../base.xml:614(guilabel) +msgid "Selection" +msgstr "選取部分" + +#: ../base.xml:615(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"選取這個選項,只會列印所選取的文字。這個選項 只有當您已選取文字後,才能使用。" + +#: ../base.xml:622(guilabel) +msgid "Number of copies" +msgstr "列印份數" + +#: ../base.xml:624(para) +msgid "" +"Use this spin box to specify the number of copies of the file that you want " +"to print." +msgstr "使用這個旋轉方塊以指定您要列印檔案的副本數。" + +#: ../base.xml:628(guilabel) +msgid "Collate" +msgstr "理序" + +#: ../base.xml:630(para) +msgid "" +"If you are printing multiple copies of the file, select this option to " +"collate the printed copies." +msgstr "如果您要將檔案列印多份副本,請選取這個選項,以理序已列印的副本。" + +#: ../base.xml:634(guilabel) +msgid "Filename" +msgstr "檔案名稱" + +#: ../base.xml:636(para) +msgid "" +"To print the file to a print file, type the name of the output file in this " +"text box." +msgstr "如果要列印檔案至列印檔案,請在這個文字方塊中輸入輸出檔案的名稱。" + +#: ../base.xml:643(title) +msgid "Paper Tabbed Section" +msgstr "紙張標籤區段" + +#: ../base.xml:645(guilabel) +msgid "Paper size" +msgstr "紙張大小" + +#: ../base.xml:647(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "請使用這個下拉式清單,選取列印檔案用的紙張大小。" + +#: ../base.xml:651(guilabel) +msgid "Width" +msgstr "寬度" + +#: ../base.xml:653(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit for specifying the paper size." +msgstr "" +"請使用這個旋轉方塊,指定紙張寬度。請使用 旁邊的下拉式清單,變更 指定紙張大小" +"的度量單位。" + +#: ../base.xml:658(guilabel) +msgid "Height" +msgstr "高度" + +#: ../base.xml:660(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "請使用這個選轉方塊,指定紙張高度。" + +#: ../base.xml:663(guilabel) +msgid "Feed orientation" +msgstr "入紙方向" + +#: ../base.xml:665(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "請使用這個下拉式清單來選取印表機 的紙張方向。" + +#: ../base.xml:669(guilabel) +msgid "Page orientation" +msgstr "紙張方向" + +#: ../base.xml:671(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "請使用這個下拉式清單,選取紙張方向。" + +#: ../base.xml:674(guilabel) +msgid "Layout" +msgstr "配置" + +#: ../base.xml:676(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"請使用這個下拉式清單,選取頁面的版面配置。您選取的每個版面配置,其預覽會顯示" +"在預覽區域中。" + +#: ../base.xml:687(title) +msgid "To Customize the Toolbar and Statusbar" +msgstr "自訂工具列與狀態列" + +#: ../base.xml:689(para) +msgid "" +"To display or hide the toolbar, choose ViewToolbar. To customize how " +"gedit displays the toolbar, choose " +"ViewCustomize Toolbar, then select one of the following menu items:" +msgstr "" +"如果要顯示或隱藏工具列,請選擇檢視工具列。如果要自訂 " +"gedit 顯示工具列的方式,請選擇" +"檢視自訂工具列,然後選取下列任一項 功能表項目:" + +#: ../base.xml:696(guimenuitem) +msgid "Desktop Default" +msgstr "桌面預設值" + +#: ../base.xml:697(para) +msgid "Display the default toolbar." +msgstr "顯示預設的工具列。" + +#: ../base.xml:700(guimenuitem) +msgid "Icon" +msgstr "圖示" + +#: ../base.xml:701(para) +msgid "Display icons only." +msgstr "僅顯示圖示。" + +#: ../base.xml:704(guimenuitem) +msgid "Icon and Text" +msgstr "圖示與文字" + +#: ../base.xml:705(para) +msgid "Display icons and text." +msgstr "顯示圖示與文字。" + +#: ../base.xml:708(guimenuitem) +msgid "Priority Text beside Icons" +msgstr "在優先項目上顯示圖示及文字" + +#: ../base.xml:709(para) +msgid "Display icons, and display text beside some of the icons." +msgstr "顯示圖示,以及顯示一些圖示旁的文字。" + +#: ../base.xml:712(para) +msgid "" +"To display or hide the statusbar, choose ViewStatusbar. To customize how " +"gedit displays the statusbar, choose " +"ViewCustomize Statusbar, then select one of the following menu items:" +msgstr "" +"如果要顯示或隱藏狀態列,請選擇檢視狀態列。如果要自訂 " +"gedit 顯示狀態列的方式,請選擇" +"檢視自訂狀態列,然後選取下列任一項 功能表項目:" + +#: ../base.xml:719(guimenuitem) +msgid "Show Cursor Position" +msgstr "顯示游標位置" + +#: ../base.xml:720(para) +msgid "Display the line number and column number where the cursor is located." +msgstr "顯示游標所在的行數與欄數。" + +#: ../base.xml:723(guimenuitem) +msgid "Show Overwrite Mode" +msgstr "顯示覆寫模式" + +#: ../base.xml:724(para) +msgid "" +"Display the editing mode. If the editor is in insert mode, the statusbar " +"contains the word INS. If the editor is in overwrite mode, the statusbar " +"contains the word OVR." +msgstr "" +"顯示編輯模式。如果編輯器是處於插入模式,狀態列便會出現 INS 字樣。如果編輯器是" +"處於覆寫模式,狀態列便會出現 OVR 字樣。" + +#: ../base.xml:728(para) +msgid "" +"To display or hide the output window, choose ViewOutput Window." +msgstr "" +"如果要顯示或隱藏輸出視窗,請選擇檢視輸出視窗。" + +#: ../base.xml:735(title) +msgid "Preferences" +msgstr "偏好設定" + +#: ../base.xml:737(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"如果要配置 gedit,請選擇 編輯" +"偏好設定偏好設" +"定對話方塊含有下列 種類:" + +#: ../base.xml:754(title) +msgid "Editor" +msgstr "編輯器" + +#: ../base.xml:755(para) +msgid "" +"The Editor category is subdivided into the following " +"subcategories:" +msgstr "編輯器的種類又可分為下列幾種 子類:" + +#: ../base.xml:759(title) +msgid "Fonts and Colors" +msgstr "字型與色彩" + +#: ../base.xml:761(guilabel) +msgid "Use default theme font" +msgstr "使用預設配色字型" + +#: ../base.xml:763(para) +msgid "" +"Select this option to use the default system font for the text in the " +"gedit text window." +msgstr "" +"選取這個選項,在 gedit 文字視窗的文字中,會使用系" +"統預設的字型。" + +#: ../base.xml:766(guilabel) +msgid "Editor font" +msgstr "編輯器字型" + +#: ../base.xml:768(para) +msgid "" +"This field displays the font that gedit uses to " +"display text. Click on the button to specify the font type, style, and size " +"to use for text." +msgstr "" +"這個欄位會顯示 gedit 用來顯示文字的字型。 按一下按" +"鈕,指定文字所使用的字體類型、樣式與大小。" + +#: ../base.xml:772(guilabel) +msgid "Use default theme colors" +msgstr "使用預設的配色色彩" + +#: ../base.xml:774(para) +msgid "" +"Select this option to use the default theme colors in the " +"gedit text window." +msgstr "" +"選取這個選項,會在 gedit 文字視窗中,使用預設的配" +"色色彩。" + +#: ../base.xml:777(guilabel) +msgid "Text color" +msgstr "文字色彩" + +#: ../base.xml:779(para) +msgid "" +"Click on the Text color button to display the color " +"selector dialog. Select a color to use to display text in the " +"gedit text window." +msgstr "" +"按一下文字色彩按鈕, 顯示色彩選擇元件對話方塊。請選取" +"顏色,程式會在 gedit 文字視窗中,以該顏色顯示文" +"字。" + +#: ../base.xml:784(guilabel) +msgid "Background color" +msgstr "背景色彩" + +#: ../base.xml:786(para) +msgid "" +"Click on the Background color button to display the " +"color selector dialog. Select a background color for the gedit text window." +msgstr "" +"按一下背景色彩按鈕, 顯示色彩選擇元件對話方塊。請為 " +"gedit 文字視窗選取背景色彩。" + +#: ../base.xml:791(guilabel) +msgid "Selected text color" +msgstr "選取文字的色彩" + +#: ../base.xml:793(para) +msgid "" +"Click on the Selected text color button to display " +"the color selector dialog. Select a color to use to display selected text." +msgstr "" +"按一下選取文字的色彩按鈕, 顯示色彩選擇元件對話方塊。" +"請選取用來顯示選取文字的色彩。" + +#: ../base.xml:798(guilabel) +msgid "Selection color" +msgstr "選取區域的色彩" + +#: ../base.xml:800(para) +msgid "" +"Click on the Selection color button to display the " +"color selector dialog. Select a background color to use to highlight a text " +"selection." +msgstr "" +"按一下選取區域的色彩按鈕, 顯示色彩選擇元件對話方塊。" +"請選取背景色彩,用來反白顯示選取的文字。" + +#: ../base.xml:809(title) +msgid "Tabs" +msgstr "跳格" + +#: ../base.xml:811(guilabel) +msgid "Set tabs width equivalent to" +msgstr "tab 字元的寬度為" + +#: ../base.xml:813(para) +msgid "" +"Use this spin box to specify the width of the space that " +"gedit inserts when you press the Tab key." +msgstr "" +"請使用這個旋轉方塊,指定 gedit 在您按下 " +"Tab 鍵時會加入的空格寬度。" + +#: ../base.xml:818(guilabel) +msgid "Insert spaces instead of tabs" +msgstr "以插入空格取代跳格" + +#: ../base.xml:820(para) +msgid "" +"Select this option to specify that gedit inserts " +"spaces instead of a tab character when you press the Tab " +"key." +msgstr "" +"選取這個選項可以指定 gedit 在您按下 Tab 鍵時,以插入空格取 代跳格字元。" + +#: ../base.xml:830(title) +msgid "Wrap Mode" +msgstr "換行模式" + +#: ../base.xml:832(guilabel) ../base.xml:1003(guilabel) +msgid "Enable text wrapping" +msgstr "啟用文字換行" + +#: ../base.xml:833(para) +msgid "" +"Select this option to wrap text onto the next line, at a character level, " +"when you reach the text window boundary." +msgstr "選取這個選項可以在到達文字視窗 界限時,以字元為單位將文字換到下一行。" + +#: ../base.xml:837(guilabel) +msgid "Do not split words over two lines" +msgstr "不要將字分成兩行" + +#: ../base.xml:838(para) +msgid "" +"Select this option to wrap text onto the next line, at a word level, when " +"you reach the text window boundary." +msgstr "選取這個選項可以在到達文字視窗 界限時,以字為單位將文字換到下一行。" + +#: ../base.xml:846(title) +msgid "Auto Indent" +msgstr "自動縮排" + +#: ../base.xml:848(guilabel) +msgid "Enable auto indentation" +msgstr "啟用自動縮排" + +#: ../base.xml:849(para) +msgid "" +"Select this option to specify that the next line starts at the indentation " +"level of the current line." +msgstr "選取這個選項可以指定下一行使用目前這一行的縮排設定。" + +#: ../base.xml:857(title) +msgid "Line Numbers" +msgstr "行號" + +#: ../base.xml:859(guilabel) +msgid "Display line numbers" +msgstr "顯示行號" + +#: ../base.xml:861(para) +msgid "" +"Select this option to display line numbers on the left side of the " +"gedit window." +msgstr "選取這個選項,會在 gedit 視窗左側顯示行號。" + +#: ../base.xml:869(title) +msgid "Open" +msgstr "開啟" + +#: ../base.xml:871(guilabel) +msgid "Supported encodings" +msgstr "支援的編碼" + +#: ../base.xml:872(para) +msgid "" +"A character encoding is a method of converting bytes to characters. " +"Different encodings might convert the same byte sequence into different " +"characters, or might produce invalid output. If you open a file using the " +"same encoding as that used to create the file, all characters are displayed " +"as intended. However, if you open a file using a different encoding, some " +"characters might not be displayed correctly, or an error might be returned." +msgstr "" +"字元編碼,是將位元組轉換為字元的方式。 不同的編碼方式會將相同的位元組序列轉換" +"為不同的字元,或產生無效的輸出。 如果您是以建立檔案時所用的編碼,來開啟該檔" +"案,則所有的字元顯示,都會跟原來建立時一模一樣。 然而,如果您開啟檔案時的編碼" +"不是原來的編碼,有些字元的顯示可能會不正常,或者,系統會傳回錯誤訊息。" + +#: ../base.xml:877(para) +msgid "" +"By default, gedit uses UTF-8 encoding to try to " +"open a file. UTF-8 encoding can be used for multilingual texts, as UTF-8 " +"covers almost all known alphabets and character sets. If the file is not a " +"valid UTF-8 file, gedit tries to open the file by " +"using the encoding for the current locale. If this also fails, " +"gedit tries to use an encoding from the Supported " +"encodings list, starting at the top of the list." +msgstr "" +"依預設值,gedit 是使用 UTF-8 編碼來開啟檔案。UTF-" +"8 編碼可用於內含多種語言的文件,因為 UTF-8 涵蓋了大多數已知的字母與字元集。如" +"果檔案並不是有效的 UTF-8 檔,gedit 會試著以目前語" +"系的編碼來開啟檔案。如果這樣依然有問題,gedit 會從" +"支援的編碼清單中第一個編碼方式開始,一個個地來試著開啟檔案。" + +#: ../base.xml:880(para) +msgid "" +"To modify the contents of the Supported encodings list, use the buttons " +"described in the following table:" +msgstr "如果要修改支援的編碼清單內容,請使用下列表格所述的按鈕:" + +#: ../base.xml:889(para) +msgid "Button" +msgstr "按鈕" + +#: ../base.xml:890(para) +msgid "Description" +msgstr "說明" + +#: ../base.xml:895(guilabel) +msgid "Add" +msgstr "新增" + +#: ../base.xml:896(para) +msgid "Adds an encoding to the list." +msgstr "將編碼加入清單。" + +#: ../base.xml:899(guilabel) +msgid "Remove" +msgstr "移除" + +#: ../base.xml:900(para) +msgid "Removes an encoding from the list." +msgstr "將編碼從清單中移除。" + +#: ../base.xml:903(para) +msgid "Up arrow" +msgstr "向上箭頭" + +#: ../base.xml:904(para) +msgid "Moves an encoding to a higher position in the list." +msgstr "將編碼移到清單中較高的位置。" + +#: ../base.xml:907(para) +msgid "Down arrow" +msgstr "向下箭頭" + +#: ../base.xml:908(para) +msgid "Moves an encoding to a lower position in the list." +msgstr "將編碼移到清單中較低的位置。" + +#: ../base.xml:919(title) +msgid "Save" +msgstr "儲存" + +#: ../base.xml:921(guilabel) +msgid "Create a backup copy of files before saving" +msgstr "在儲存前先建立檔案備份副本" + +#: ../base.xml:923(para) +msgid "" +"Select this option to create a backup copy of a file each time you save the " +"file. The backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"選取這個選項,可以在每次儲存檔案時,建立備份副本。檔案的備份 副本在檔名的最末" +"會以波浪號 (˜) 做結尾。" + +#: ../base.xml:927(guilabel) +msgid "Autosave current file every" +msgstr "自動儲存目前檔案的時間間隔" + +#: ../base.xml:929(para) +msgid "" +"Select this option to automatically save the current file at regular " +"intervals. Use the spin box to specify the interval at which you want to " +"save the file." +msgstr "" +"選取這個選項,會自動地在固定的時間間隔,儲存目前的檔案。請使用這個旋轉方塊," +"指定儲存檔案的時間間隔。" + +#: ../base.xml:933(guilabel) +msgid "When saving an existing file" +msgstr "儲存現有的檔案時" + +#: ../base.xml:935(para) +msgid "Select one of the following save options:" +msgstr "請選取下列任一項儲存選項:" + +#: ../base.xml:938(guilabel) ../base.xml:958(guilabel) +msgid "Always use UTF-8 encoding (faster)" +msgstr "總是使用 UTF-8 編碼 (較快)" + +#: ../base.xml:939(para) +msgid "Select this option to save files using UTF-8 encoding." +msgstr "選取這個選項,會使用 UTF-8 編碼儲存檔案。" + +#: ../base.xml:942(guilabel) ../base.xml:962(guilabel) +msgid "Use current locale's encoding if possible" +msgstr "可能的話,儲存時請使用目前語言環境的編碼" + +#: ../base.xml:943(para) +msgid "" +"Select this option to save files using the current locale. You can set up " +"locales for different input methods." +msgstr "" +"選取這個選項,會使用目前的語言儲存檔案。您可以為不同的輸入法設定語言環境。" + +#: ../base.xml:947(guilabel) +msgid "Use original file encoding if possible" +msgstr "可能的話,請使用原始檔案的編碼" + +#: ../base.xml:948(para) +msgid "" +"Select this option to save a file using the current locale if the file was " +"already saved in the current locale." +msgstr "" +"選取這個選項,如果檔案已經是使用目前的區性儲存過,程式會使用目前區性來儲存檔" +"案 。" + +#: ../base.xml:953(guilabel) +msgid "When saving a new file" +msgstr "儲存新檔案時" + +#: ../base.xml:955(para) +msgid "Select one of the following save options for new files:" +msgstr "請為新檔案選取下列任一項儲存選項:" + +#: ../base.xml:959(para) +msgid "Select this option to save new files using UTF-8 encoding." +msgstr "選取這個選項,會使用 UTF-8 編碼儲存新檔案。" + +#: ../base.xml:963(para) +msgid "" +"Select this option to save new files using the current locale. You can set " +"up locales for different input methods." +msgstr "" +"選取這個選項,會使用目前的語言環境儲存新檔案。您可以為不同的輸入法設定語言環" +"境。" + +#: ../base.xml:975(title) +msgid "Undo" +msgstr "復原" + +#: ../base.xml:977(guilabel) +msgid "Set limit on undo actions to" +msgstr "復原的次數限制為" + +#: ../base.xml:979(para) +msgid "" +"Select this option to set a limit on the number of editing actions that you " +"can undo. Use the spin box to specify the maximum number of actions that you " +"can undo." +msgstr "" +"選取這個選項,可以限制編輯動作的 可復原次數。請使用旋轉方塊,指定 可復原動作" +"的最多次數。" + +#: ../base.xml:990(title) +msgid "Print" +msgstr "列印" + +#: ../base.xml:991(para) +msgid "" +"The Print category is subdivided into the following " +"subcategories:" +msgstr "列印種類又可分為下列幾種 子類:" + +#: ../base.xml:995(title) +msgid "Page" +msgstr "頁面" + +#: ../base.xml:997(guilabel) +msgid "Print page headers" +msgstr "列印頁面標頭" + +#: ../base.xml:999(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "選取這個選項,會在列印的每一頁上面 加上標頭。您無法配置標頭。" + +#: ../base.xml:1005(para) +msgid "" +"Select this option to automatically wrap text at a word level when you print " +"a file. The application counts wrapped lines as one line for line numbering " +"purposes." +msgstr "" +"選取這個選項,在列印檔案時,可以自動以字為單位 換行。應用程式每換行一次計為一" +"行。" + +#: ../base.xml:1010(guilabel) +msgid "Print line numbers every" +msgstr "每次印出行號相隔的行數" + +#: ../base.xml:1013(para) +msgid "" +"Select this option to include line numbers when you print a file. Use the " +"spin box to specify how often to print the line numbers, for example every 5 " +"lines, every 10 lines, and so on." +msgstr "" +"選取這個選項,會在列印檔案時 加上行數。請使用旋轉方塊,指定列印行號的間隔。" +"例 如,每 5 行或每 10 行等。" + +#: ../base.xml:1022(title) +msgid "Fonts" +msgstr "字型" + +#: ../base.xml:1024(guilabel) +msgid "Body" +msgstr "內文" + +#: ../base.xml:1026(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "按一下這個按鈕,可以選取列印檔案內容文字時,所要使用的字型。" + +#: ../base.xml:1030(guilabel) +msgid "Page headers" +msgstr "頁面標頭" + +#: ../base.xml:1032(para) +msgid "" +"Click on this button to select the font to use to print the headers in a " +"file." +msgstr "按一下這個按鈕,可以選取列印檔案標頭時,所要使用的字型。" + +#: ../base.xml:1036(guilabel) +msgid "Line numbers" +msgstr "行號" + +#: ../base.xml:1039(para) +msgid "Click on this button to select a font to use to print line numbers." +msgstr "按一下這個按鈕,可以選取列印行號時的字型。" + +#: ../base.xml:1043(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit click on the Restore Default " +"Fonts button." +msgstr "" +"如果要將 gedit 列印檔案時的字型,重設為預設值, 請" +"按一下還原預設字型按鈕。" + +#: ../base.xml:1050(title) +msgid "Plugins" +msgstr "增效模組" + +#: ../base.xml:1051(para) +msgid "" +"For information about how to use the Plugins category " +"of the Preferences dialog, see ." +msgstr "" +"關於如何使用偏好設定對話方塊的增效模組類別,進一步資訊請參閱 。" + +#: ../base.xml:1058(title) +msgid "Working with Plugins" +msgstr "使用增效模組" + +#: ../base.xml:1059(para) +msgid "" +"A plugin is a supplementary program that enhances the functionality of an " +"application. The gedit plugins enable you to " +"perform a variety of functions related to text editing from within the " +" gedit window. The following table lists the " +" gedit plugins." +msgstr "" +"增效模組是一種以可增強應用程式功能的 補強性程式。您可以使用 " +"gedit 增效模組,在 gedit 視窗內,執行多種文字編輯功能。下表所列的,便是 " +"gedit 的增效模組。" + +#: ../base.xml:1070(para) ../base.xml:1150(para) +msgid "Plugin Name" +msgstr "增效模組名稱" + +#: ../base.xml:1071(para) +msgid "Purpose" +msgstr "用途" + +#: ../base.xml:1076(para) ../base.xml:1156(para) +msgid "ASCII table" +msgstr "ASCII 表 (ASCII 表格)" + +#: ../base.xml:1077(para) +msgid "" +"Displays a dialog that contains an ASCII table. You can use the ASCII table " +"to insert characters into a file." +msgstr "顯示包含 ASCII 表的對話方塊。您可以使用 ASCII 表,在檔案中插入字元。" + +#: ../base.xml:1080(para) ../base.xml:1161(para) +msgid "CVS ChangeLog" +msgstr "CVS 變更Log" + +#: ../base.xml:1081(para) +msgid "Opens the log messages associated with CVS commit commands." +msgstr "開啟與 CVS 確定指令相關的日誌記錄訊息。" + +#: ../base.xml:1084(para) ../base.xml:1166(para) ../base.xml:1168(guimenuitem) +msgid "Compare Files" +msgstr "比較檔案" + +#: ../base.xml:1085(para) +msgid "" +"Compares two files and displays the differences between the files in the " +"output window. This plugin uses the diff command to " +"compare the files." +msgstr "" +"比較兩個檔案,並將檔案的不同處,顯示在輸出視窗中。 這個增效模組是使用 " +"diff 指令來比較檔案。" + +#: ../base.xml:1089(para) ../base.xml:1171(para) ../base.xml:1173(guimenuitem) +msgid "Document Statistics" +msgstr "文件統計資料" + +#: ../base.xml:1090(para) +msgid "" +"Counts the number of lines, words, characters, and bytes in the current " +"file. The plugin displays the results in a Document Statistics dialog." +msgstr "" +"計算目前檔案的行數、字數、字元數和位元組數。增效模組 會在文件統計資" +"料對話方塊中顯示結果。" + +#: ../base.xml:1094(para) ../base.xml:1176(para) +msgid "Indent lines" +msgstr "縮排行" + +#: ../base.xml:1095(para) +msgid "" +"Indents the selected lines, or removes the indentation from the selected " +"lines." +msgstr "將選取的行縮排,或移除選取行的縮排設定。" + +#: ../base.xml:1098(para) ../base.xml:1183(para) +msgid "Insert Date/Time" +msgstr "加入日期/時間 (插入 Date/Time)" + +#: ../base.xml:1099(para) +msgid "Inserts the current date and time into a file." +msgstr "在檔案中加入目前的日期及時間。" + +#: ../base.xml:1102(para) ../base.xml:1188(para) +msgid "Shell command" +msgstr "Shell 指令" + +#: ../base.xml:1103(para) +msgid "Displays the text output of a shell command in the output window." +msgstr "將 shell 指令的文字輸出顯示於輸出視窗。" + +#: ../base.xml:1106(para) ../base.xml:1193(para) ../base.xml:1195(guimenuitem) +msgid "Sort" +msgstr "排序" + +#: ../base.xml:1107(para) +msgid "Sorts the selected text." +msgstr "將選取的文字排序。" + +#: ../base.xml:1110(para) ../base.xml:1198(para) +msgid "Tag list" +msgstr "標記清單 (Tag 清單)" + +#: ../base.xml:1111(para) +msgid "" +"Displays a window that contains a list of common tags. You can use the " +"window to insert a tag into a file." +msgstr "顯示包含一般標記清單的視窗。您可以使用本視窗 將標記加入檔案。" + +#: ../base.xml:1115(para) ../base.xml:1203(para) +msgid "User name" +msgstr "使用者名稱 (使用r 名稱)" + +#: ../base.xml:1116(para) +msgid "Inserts the username of the current user into the file." +msgstr "將目前的使用者名稱加入到檔案中。" + +#: ../base.xml:1123(title) +msgid "To Load gedit Plugins" +msgstr "載入 gedit 增效模組" + +#: ../base.xml:1124(para) +msgid "" +"To load gedit plugins, choose " +"EditPreferences. Within the Plugins category, click on the " +"Manager subcategory. The Manager " +"subcategory displays the following information:" +msgstr "" +"如果要載入 gedit增效模組,請選擇" +"編輯偏好設定。在增效模組類別中,按一下管理員子類別。 管理員子類別會顯示下列資訊:" + +#: ../base.xml:1131(para) +msgid "" +"A list of the plugins that you can use with gedit." +msgstr "可以與 gedit 一同使用之增效模組的清單。" + +#: ../base.xml:1133(para) +msgid "" +"A Configure plugin button. You can use this button to " +"open a configuration dialog for the plugins that you can configure. For " +"example, see and ." +msgstr "" +"配置增效模組 按鈕。您可以使用這個按鈕,為您可以配置的" +"增效模組,開啟配置對話方塊。例如,請參閱 以及 。" + +#: ../base.xml:1136(para) +msgid "" +"A brief description of each plugin. To display a description, select the " +"plugin from the list of plugins." +msgstr "" +"每一個增效模組的簡短說明。如果要顯示說明,請從增效模組清單中選取增效模組。" + +#: ../base.xml:1139(para) +msgid "Details about the author of the plugin and the name of the module." +msgstr "增效模組作者及模組名稱之詳細資訊。" + +#: ../base.xml:1142(para) +msgid "" +"To load a plugin, select the check box next to the name of the plugin. The " +"gedit application adds the plugin to the " +"appropriate gedit menu, as described in the " +"following table." +msgstr "" +"如果要載入增效模組,請選取增效模組名稱旁的核取方塊。gedit 應用程式 會如下表所述,將外掛程式加入適當的 gedit 功能表中。" + +#: ../base.xml:1151(para) +msgid "Added to Menu" +msgstr "加入至功能表" + +#: ../base.xml:1157(guimenu) ../base.xml:1199(guimenu) +msgid "View" +msgstr "檢視" + +#: ../base.xml:1158(guimenuitem) +msgid "ASCII Table" +msgstr "ASCII 表" + +#: ../base.xml:1162(guimenu) +msgid "File" +msgstr "檔案" + +#: ../base.xml:1163(guimenuitem) +msgid "Open CVS ChangeLogs" +msgstr "開啟 CVS 變更Logs" + +#: ../base.xml:1167(guimenu) ../base.xml:1172(guimenu) +#: ../base.xml:1189(guimenu) +msgid "Tools" +msgstr "工具" + +#: ../base.xml:1177(guimenu) ../base.xml:1179(guimenu) +#: ../base.xml:1184(guimenu) ../base.xml:1194(guimenu) +#: ../base.xml:1204(guimenu) +msgid "Edit" +msgstr "編輯" + +#: ../base.xml:1178(guimenuitem) +msgid "Indent" +msgstr "縮排" + +#: ../base.xml:1180(guimenuitem) +msgid "Unindent" +msgstr "減少縮排" + +#: ../base.xml:1185(guimenuitem) +msgid "Insert Date and Time" +msgstr "加入日期和時間" + +#: ../base.xml:1190(guimenuitem) +msgid "Run Command" +msgstr "執行指令" + +#: ../base.xml:1200(guimenuitem) +msgid "Tag List" +msgstr "標記清單" + +#: ../base.xml:1205(guimenuitem) +msgid "Insert User Name" +msgstr "加入使用者名稱" + +#: ../base.xml:1210(para) ../base.xml:1224(para) ../base.xml:1341(para) +#: ../base.xml:1454(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"如果要關閉偏好設定對話方塊,請按一下關閉。" + +#: ../base.xml:1216(title) +msgid "To Remove gedit Plugins" +msgstr "移除 gedit 增效模組" + +#: ../base.xml:1217(para) +msgid "A plugin remains loaded when you quit gedit." +msgstr "" +"即使您離開了 gedit,增效模組仍然是載入應用程式中。" + +#: ../base.xml:1218(para) +msgid "" +"To remove gedit plugins, choose " +"EditPreferences. Within the Plugins category, click on the " +"Manager subcategory. To remove a plugin, deselect the " +"check box next to the name of the plugin." +msgstr "" +"如果要移除 gedit 增效模組,請選擇" +"編輯偏好設定。在增效模組類別中,按一下管理員子類別。 如果要移除增效模組,請取消選取增效模組名稱旁的核取方塊。" + +#: ../base.xml:1230(title) +msgid "ASCII Table Plugin" +msgstr "ASCII 表增效模組" + +#: ../base.xml:1231(para) +msgid "" +"The ASCII table plugin displays a dialog that contains an ASCII table. You " +"can use the ASCII table to insert characters into a file. To use the ASCII " +"table plugin, perform the following steps:" +msgstr "" +"ASCII 表增效模組會顯示一個對話方塊,其內含有 ASCII 表。您可以使用 ASCII 表," +"在檔案中插入字元。 如果要使用 ASCII 表增效模組,請執行下列的步驟:" + +#: ../base.xml:1234(para) +msgid "Load the ASCII table plugin." +msgstr "載入 ASCII 表增效模組。" + +#: ../base.xml:1236(para) +msgid "" +"Choose ViewASCII Table to display the ASCII Table " +"dialog." +msgstr "" +"請選擇檢視ASCII 表,顯示 ASCII 表對話方塊。" + +#: ../base.xml:1240(para) +msgid "" +"Scroll through the list to find the character that you require, then select " +"the character with a single click." +msgstr "在清單中捲動,找尋您所需的字元,然後在字元上按一下,選取該字元。" + +#: ../base.xml:1243(para) +msgid "" +"Click on the Insert char button to insert the " +"character at the cursor position in the current file." +msgstr "" +"按一下加入字元按鈕,將字元加入目前游標所在的檔案位置" +"上。" + +#: ../base.xml:1246(para) +msgid "" +"When you finish entering ASCII characters, click Close to close the ASCII Table dialog." +msgstr "" +"完成所有 ASCII 字元輸入後,請按一下關閉,關閉 " +"ASCII 表對話方塊。" + +#: ../base.xml:1253(title) +msgid "CVS ChangeLog Plugin" +msgstr "CVS ChangeLog 增效模組" + +#: ../base.xml:1254(para) +msgid "" +"The CVS ChangeLog plugin opens the log messages associated with CVS commit " +"commands. This plugin enables you to easily paste text into the commit " +"message from the ChangeLog file. To use the CVS ChangeLog plugin, perform " +"the following steps:" +msgstr "" +"CVS ChangeLog 增效模組會開啟與 CVS commit 指令相關的記錄訊息。 這個增效模組可" +"以讓您輕易地從 ChangeLog 檔案中,將文字貼入 commit 訊息裡。 如果要使用 CVS 變" +"更Log 增效模組,請執行下列步驟:" + +#: ../base.xml:1258(para) +msgid "" +"Set the environment variable CVSEDITOR to gedit. " +"For example, if you are using the bash shell, run the " +"following command at the operating system prompt: export " +"CVSEDITOR=gedit " +msgstr "" +"將環境變數 CVSEDITOR 設為 gedit。 例如,如果您正在" +"使用 bash shell,請在作業系統 提示的時候,輸入下面的指" +"令: export CVSEDITOR=gedit " + +#: ../base.xml:1264(para) +msgid "" +"Commit a file to CVS in the usual way. A gedit " +"window opens, to enable you to enter the commit message." +msgstr "" +"以平常的方式將檔案確定至 CVS。此時會開啟 gedit 視" +"窗,讓您輸入 commit 訊息。" + +#: ../base.xml:1267(para) +msgid "Load the CVS ChangeLog plugin." +msgstr "載入 CVS ChangeLog 增效模組。" + +#: ../base.xml:1269(para) +msgid "" +"Choose FileOpen CVS ChangeLogs to open all of the ChangeLog files referenced in " +"the commit message. gedit opens each ChangeLog " +"file in a new tab." +msgstr "" +"請選擇 檔案開啟 CVS ChangeLogs,開啟所有 commit 訊息中所出現的 ChangeLog 檔案。" +"gedit 會為每個 變更Log 檔案開啟一個新標籤。" + +#: ../base.xml:1272(para) +msgid "" +"Copy the ChangeLog entries that you want to add to the commit message from " +"the gedit ChangeLog files." +msgstr "" +"gedit ChangeLog 檔案中,複製您想加入 commit 訊息" +"的 ChangeLog 記錄。" + +#: ../base.xml:1275(para) +msgid "" +"Insert the copied ChangeLog entries in the gedit " +"commit message tab." +msgstr "" +"將 ChangeLog 記錄加入 gedit 的 commit 訊息標籤內。" + +#: ../base.xml:1278(para) +msgid "Save your changes to the commit message, then close all files." +msgstr "儲存您對 commit 訊息所做的變更,然後關閉所有的檔案。" + +#: ../base.xml:1281(para) +msgid "Quit gedit." +msgstr "結束 gedit。" + +#: ../base.xml:1288(title) +msgid "Compare Files Plugin" +msgstr "比較檔案增效模組" + +#: ../base.xml:1289(para) +msgid "" +"The Compare Files plugin compares two files and displays the differences " +"between the files in the output window. This plugin uses the diff command to compare the files. To use the Compare Files plugin, " +"perform the following steps:" +msgstr "" +"比較檔案增效模組會比較兩個檔案,並將這兩個檔案不同的地方,顯示在輸出視窗中。 " +"這個增效模組會使用 diff 指令來比較檔案。 如果要使用比較檔" +"案增效模組,請執行下列的步驟:" + +#: ../base.xml:1293(para) +msgid "Load the Compare Files plugin." +msgstr "載入比較檔案增效模組。" + +#: ../base.xml:1295(para) +msgid "" +"Choose ToolsCompare Files. When you choose this option for the first time, " +"you are prompted to confirm the location of the diff " +"command. You are not prompted for this location again. See for information about how to change this " +"location later." +msgstr "" +"請選擇 工具比較檔案。 當您是第一次選擇這個選項,系統會提示您,請您確認 " +"diff 指令的位置。以後則不會再提示您確認位置。若需如何在日" +"後變更這個位置的詳細資訊,請參閱 。" + +#: ../base.xml:1299(para) +msgid "" +"Click OK to display the Compare Files dialog." +msgstr "" +"按一下確定,顯示比較檔案對話方" +"塊。" + +#: ../base.xml:1302(para) +msgid "" +"Specify the files that you want to compare. To specify an open file, select " +"the file from the drop-down list. To specify a closed file, enter the " +"location of the file in the text box." +msgstr "" +"指定您想要比較的檔案。如果要指定已開啟的檔案,請 從下拉式清單中選取。如果要指" +"定關閉的檔案,請在文字方塊中,輸入該檔案的位置。" + +#: ../base.xml:1306(para) +msgid "" +"To ignore changes in the amount of white space, select the Ignore " +"blanks option." +msgstr "如果要忽略空白數量的不同,請選取忽略空白選項。" + +#: ../base.xml:1309(para) +msgid "" +"To use the unified output format, showing three lines of context, select the " +"Use the unified output format option." +msgstr "" +"如果要使用 unified 輸出格式,也就是顯示三行內文的形式,請選取使用 " +"unified 輸出格式選項。" + +#: ../base.xml:1312(para) +msgid "" +"Click on the Compare button to compare the contents " +"of the specified files. The command output is displayed in the output window." +msgstr "" +"按一下比較按鈕,開始比較所指定檔案的內容。指令輸出會顯" +"示在輸出視窗中。" + +#: ../base.xml:1316(para) +msgid "" +"For more information, see diff1." +msgstr "" +"若需詳細的資訊,請參閱 diff1。 您可以選擇下列條件中的一項或以上:" + +#: ../base.xml:1320(title) +msgid "To Configure the Compare Files Plugin" +msgstr "配置比較檔案增效模組" + +#: ../base.xml:1321(para) +msgid "" +"To change the location of the command that the Compare Files plugin uses, " +"perform the following steps:" +msgstr "如果要變更比較檔案增效模組所使用之指令的位置,請執行下列步驟:" + +#: ../base.xml:1323(para) ../base.xml:1425(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"請選擇編輯偏好設定。" + +#: ../base.xml:1326(para) ../base.xml:1428(para) +msgid "" +"Within the Plugins category, click on the " +"Manager subcategory." +msgstr "" +"在增效模組類別中,按一下管理員子類" +"別。" + +#: ../base.xml:1329(para) +msgid "Select the Compare Files plugin." +msgstr "選取比較檔案增效模組。" + +#: ../base.xml:1332(para) +msgid "" +"Click on the Configure plugin button to display the " +"Set program location dialog." +msgstr "" +"按一下配置增效模組按鈕,顯示設定程式位置對話方塊。" + +#: ../base.xml:1335(para) +msgid "" +"Specify the location of the diff command in the " +"Location to search for text box." +msgstr "" +"請指定 diff 指令的位置 (在搜尋的位置" +"文字方塊中)。" + +#: ../base.xml:1338(para) +msgid "" +"Click OK to close the Set program location dialog." +msgstr "" +"按一下確定,關閉設定程式位置對話" +"方塊。" + +#: ../base.xml:1348(title) +msgid "Document Statistics Plugin" +msgstr "文件統計資料增效模組" + +#: ../base.xml:1349(para) +msgid "" +"The Document Statistics plugin counts the number of lines, words, " +"characters, and bytes in the current file. The plugin displays the results " +"in a Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"文件統計資料增效模組可以計算目前檔案的行數、字數、字元數和位元組數。增效模組 " +"會在文件統計資料對話方塊中顯示結果。 如果要使用文件統計" +"資料增效模組,請執行下列的步驟:" + +#: ../base.xml:1353(para) +msgid "Load the Document Statistics plugin." +msgstr "載入文件統計資料增效模組。" + +#: ../base.xml:1355(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"display the following information about the file:" +msgstr "" +"請選擇 工具文件統計資料,顯示文件統計資料對話方塊。" +"文件統計資料對話方塊可以顯示下列的檔案資訊:" + +#: ../base.xml:1359(para) +msgid "Number of lines in the current document." +msgstr "目前文件的行數。" + +#: ../base.xml:1362(para) +msgid "Number of words in the current document." +msgstr "目前文件的字數。" + +#: ../base.xml:1365(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "目前文件的字元數,包括空格。" + +#: ../base.xml:1368(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "目前文件的字元數,不包括空格。" + +#: ../base.xml:1371(para) +msgid "Number of bytes in the current document." +msgstr "目前文件的位元組數。" + +#: ../base.xml:1376(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click on " +"the Update button." +msgstr "" +"您可以不斷地更新gedit 檔案,而無須關閉文" +"件統計資料對話方塊。要重新整理文件統計資料對" +"話方塊的內容,請按一下更新按鈕。" + +#: ../base.xml:1379(para) +msgid "" +"To close the Document Statistics dialog, click " +"Close." +msgstr "" +"如果要關閉文件統計資料對話方塊,請按一下關閉" +"。" + +#: ../base.xml:1386(title) +msgid "Indent Lines Plugin" +msgstr "縮排行增效模組" + +#: ../base.xml:1387(para) +msgid "" +"The Indent lines plugin indents the selected lines, or removes the " +"indentation from the selected lines. To use the Indent lines plugin, perform " +"the following steps:" +msgstr "" +"縮排行增效模組會縮排選取的行,或移除選取行的縮排設定。 如果要使用縮排行增效模" +"組,請執行下列的步驟:" + +#: ../base.xml:1390(para) +msgid "Load the Indent lines plugin." +msgstr "載入縮排行增效模組。" + +#: ../base.xml:1392(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"選取您要縮排的行。如果要縮排或減少縮排單一行,請將游標置於該行的任一位置上。" + +#: ../base.xml:1395(para) +msgid "" +"Choose EditIndent." +msgstr "" +"請選擇 編輯縮排。" + +#: ../base.xml:1399(para) +msgid "" +"To remove the indentation, select the lines and choose " +"EditUnindent." +msgstr "" +"如果要移除縮排,請選取要移除縮排的行,然後選擇 編輯減少縮排。" + +#: ../base.xml:1407(title) +msgid "Insert Date/Time Plugin" +msgstr "加入日期/時間增效模組" + +#: ../base.xml:1408(para) +msgid "" +"The Insert Date/Time plugin inserts the current date and time into a file. " +"To use the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"加入日期及時間增效模組會將目前的日期及時間,加入檔案中。 如果要使用加入日期/" +"時間增效模組,請執行下列的步驟:" + +#: ../base.xml:1411(para) +msgid "Load the Insert Date/Time plugin." +msgstr "載入加入日期及時間增效模組。" + +#: ../base.xml:1413(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"請選擇 編輯加入日期和時間。" + +#: ../base.xml:1415(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click on the Insert button to close the " +"Insert Date and Time dialog; gedit inserts the date/time at the cursor position in the current " +"file." +msgstr "" +"如果您尚未將加入日期/時間增效模組配置成不需提示即自動加入日期/時間," +"gedit 會顯示加入日期和時間對" +"話方塊。從清單中選取適當的日期/時間格式。按一下插入按" +"鈕,關閉加入日期和時間對話方塊;gedit 會在目前檔案的游標位置上插入日期/時間。" + +#: ../base.xml:1416(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed; the date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"如果您已經將 gedit 配置成使用特定的日期/時間格式," +"則不會顯示加入日期和時間對話方塊;即會在目前檔案的游標位" +"置上插入日期/時間。" + +#: ../base.xml:1417(para) +msgid "" +"See for information about how " +"to configure the Insert Date/Time plugin." +msgstr "" +"若需如何配置加入日期/時間增效模組的詳細資訊,請參閱 。" + +#: ../base.xml:1422(title) +msgid "To Configure the Insert Date/Time Plugin" +msgstr "配置加入日期/時間增效模組" + +#: ../base.xml:1423(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "如果要配置加入日期及時間增效模組,請執行下列步驟:" + +#: ../base.xml:1432(para) +msgid "Select the Insert Date/Time plugin." +msgstr "選取 加入日期及時間增效模組。" + +#: ../base.xml:1435(para) +msgid "" +"Click on the Configure plugin button to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"按一下配置增效模組按鈕,顯示配置加入日期/時" +"間增效模組對話方塊。" + +#: ../base.xml:1438(para) +msgid "Select one of the options, as follows:" +msgstr "選取下列任一選項:您可以選擇下列條件中的一項或以上:" + +#: ../base.xml:1440(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"如果要在每次加入日期/時間時指定日期/時間格式,請選取提示指定格式選項。" + +#: ../base.xml:1443(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"如果要在每次加入日期/時間時都使用 gedit 提供的日" +"期/時間格式,請選取使用選取的格式選項,然後從清單中選取" +"適當的格式。當您選取這個選項後,gedit 並不會在您選" +"擇編輯加入日期和時間時,提示您設定日期/時間的格式。" + +#: ../base.xml:1446(para) +msgid "" +"To use the same customized date/time format each time you insert the date/" +"time, select the Use custom format option, then enter " +"the appropriate format in the text box. For more information about how to " +"specify a custom format, see strftime3. When you select this option, " +"gedit does not prompt you for the date/time " +"format when you choose EditInsert Date and Time." +msgstr "" +"如果要在每次加入日期/時間時都使用自訂的日期/時間的格式,請選取使用" +"自訂格式選項,然後在文字方塊中輸入適當的格式。若需如何自訂格式的詳" +"細資訊,請參閱 strftime3。當您選取這個選項後,gedit 並不會在您選擇編輯加" +"入日期和時間時,提示您設定日期/時間的格式。" + +#: ../base.xml:1451(para) +msgid "" +"Click OK to close the Configure insert date/" +"time plugin dialog." +msgstr "" +"按一下確定,關閉配置加入日期/時間增效模組對話方塊。" + +#: ../base.xml:1461(title) +msgid "Shell Command Plugin" +msgstr "Shell 指令增效模組" + +#: ../base.xml:1463(para) +msgid "" +"The Shell Command plugin enables you to capture the output from a shell " +"command in gedit, by displaying the text output " +"of the shell command in the output window. To use the Shell command plugin, " +"perform the following steps:" +msgstr "" +"Shell 指令增效模組可以從 gedit 的 shell 指令擷取輸" +"出,而將 shell 指令的文字輸出 顯示於輸出視窗中。如果要使用 Shell 指令增效模" +"組,請執行 下列的步驟:" + +#: ../base.xml:1467(para) +msgid "Load the Shell command plugin." +msgstr "載入 Shell 指令增效模組。" + +#: ../base.xml:1470(para) +msgid "" +"Choose ToolsRun Command to display the Run Command " +"dialog." +msgstr "" +"請選擇 工具執行指令 ,顯示執行指令對話方塊。" + +#: ../base.xml:1475(para) +msgid "" +"Type the shell command that you want to execute in the Command field." +msgstr "將您想執行的 shell 指令,鍵入 指令欄位中。" + +#: ../base.xml:1477(para) +msgid "You can include the following special characters:" +msgstr "您可以包括下列的特殊字元:" + +#: ../base.xml:1480(literal) +msgid "%f" +msgstr "%f" + +#: ../base.xml:1481(para) +msgid "" +"Use these special characters to specify the filename of the current active " +"document, including the path." +msgstr "使用此類特殊字元,指定目前使用中的檔案名稱,包括路徑。" + +#: ../base.xml:1484(literal) +msgid "%n" +msgstr "%n" + +#: ../base.xml:1485(para) +msgid "" +"Use these special characters to specify the filename of the current active " +"document, without the path. In this case, gedit " +"looks for the file in the Working directory." +msgstr "" +"使用此類特殊字元,指定目前使用中的檔案名稱,不包括路徑。此時," +"gedit 會在工作目錄中找尋檔案。" + +#: ../base.xml:1489(para) +msgid "" +"Edit the Working directory field if necessary. By " +"default, the Shell command plugin executes the command you specify in the " +"current directory." +msgstr "" +"有必要的話,請編輯工作目錄欄位。依預設值,Shell 指令增效" +"模組會執行您在目前目錄中 指定的指令。" + +#: ../base.xml:1493(para) +msgid "" +"Select the Show results in Output Window option to " +"display the results of the command in the output window. If you do not " +"select this option, gedit discards the results of " +"the command." +msgstr "" +"選取在輸出視窗顯示結果選項,在輸出視窗顯示指令的執行結" +"果。如果沒有選取這個選項,gedit 會放棄指令結果。" + +#: ../base.xml:1496(para) +msgid "" +"Click Run. The Shell command plugin executes the " +"command and inserts the text output into the output window." +msgstr "" +"按一下執行。Shell 指令 增效模組會執行該指令,並將文字" +"輸出插入輸出視窗。" + +#: ../base.xml:1500(para) +msgid "" +"Use the Shift key to select the text in the output window." +msgstr "請使用 Shift 鍵在輸出視窗中選取文字。" + +#: ../base.xml:1503(para) +msgid "" +"Click on the Copy selected lines button to copy the " +"selected text into the buffer." +msgstr "" +"按一下複製選取的行按鈕,將選取的文字複製到緩衝區。" + +#: ../base.xml:1506(para) +msgid "" +"Choose EditPaste to paste the selected text into the file." +msgstr "" +"選擇編輯貼上,將選取的文字貼入檔案。" + +#: ../base.xml:1510(para) +msgid "" +"Click on the Close the output window button to close " +"the output window." +msgstr "按一下關閉輸出視窗按鈕,關閉輸出視窗。" + +#: ../base.xml:1517(title) +msgid "Sort Plugin" +msgstr "排序增效模組" + +#: ../base.xml:1518(para) +msgid "The Sort plugin sorts the selected text." +msgstr "排序增效模組可以將選取的文字排序。" + +#: ../base.xml:1519(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"您不可以復原排序作業,因此在執行排序前應先儲存檔案。如果要在排序作業後回復成" +"之前儲存的檔案版本,請選擇檔案復" +"原。" + +#: ../base.xml:1522(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "如果要使用排序增效模組,請執行下列的步驟:" + +#: ../base.xml:1524(para) +msgid "Load the Sort plugin." +msgstr "載入增效模組。" + +#: ../base.xml:1526(para) +msgid "" +"Choose EditSort to display the Sort dialog." +msgstr "" +"請選擇 編輯排序,顯示排序對話方塊。" + +#: ../base.xml:1530(para) +msgid "" +"To arrange the text in reverse sort order, select the Reverse " +"order option." +msgstr "如果要反向排序文字,請選取反向排序選項。" + +#: ../base.xml:1533(para) +msgid "" +"To delete duplicate lines, select the Remove duplicates " +"option." +msgstr "如果要刪除重複的行,請選取移除重複的行選項。" + +#: ../base.xml:1536(para) +msgid "" +"To ignore case sensitivity, select the Ignore case " +"option." +msgstr "如果不要區分大小寫,請選取忽略大小寫選項。" + +#: ../base.xml:1539(para) +msgid "" +"To specify the start position of the sort, select the appropriate column " +"from the Start at column spin box." +msgstr "" +"如果要指定排序的啟始位置,請從啟始欄旋轉方塊中選取適當的" +"欄。" + +#: ../base.xml:1542(para) +msgid "" +"To perform the sort operation, click on the Sort " +"button." +msgstr "如果要執行排序作業,請按一下排序按鈕。" + +#: ../base.xml:1549(title) +msgid "Tag List Plugin" +msgstr "速成標記增效模組" + +#: ../base.xml:1550(para) +msgid "" +"The Tag List plugin displays a window that contains a list of common tags. " +"You can use the window to insert a tag into a file. To use the Tag List " +"plugin, perform the following steps:" +msgstr "" +"速成標記增效模組會將常見的標記,顯示在視窗中。您可以使用這個視窗將 標記插入檔" +"案。 如果要使用速成標記增效模組,請執行下列的步驟:" + +#: ../base.xml:1554(para) +msgid "Load the Tag List plugin." +msgstr "載入速成標記增效模組。" + +#: ../base.xml:1556(para) +msgid "" +"Choose ViewTag List to display the Tag list plugin window." +msgstr "" +"選擇檢視標記清單,顯示速成標記增效模組視窗。" + +#: ../base.xml:1560(para) +msgid "" +"Select the appropriate tag category from the drop-down list; for example, " +"HTML - Tags." +msgstr "" +"請從下拉式清單中,選取適當的標記類別。例如,HTML - Tags。" + +#: ../base.xml:1563(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "在標記清單中捲動,尋找所需的標記。" + +#: ../base.xml:1566(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"要在目前檔案游標的位置上加入標記,請在標記清單中的標記上連按兩下。您也可以使" +"用下列方式加入標記:" + +#: ../base.xml:1568(para) +msgid "" +"To insert a tag in the current file and change the focus from the " +"Tag list plugin window to the editor window, press " +"Enter." +msgstr "" +"如果要將標記加入目前檔案,並且將焦點由速成標記增效模組視" +"窗,變更到編輯器視窗的話,請按一下 輸入 鍵。" + +#: ../base.xml:1571(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftEnter." +msgstr "" +"如果要將標記加入目前的檔案,但是焦點保持在速成標記增效模組視窗的話,請按 Shift輸入。" + +#: ../base.xml:1576(para) +msgid "" +"To close the Tag list plugin window, click on the " +"Close Window button in the window frame. " +"Alternatively, press CtrlW when the focus is on the Tag list plugin " +"window." +msgstr "" +"如果要關閉速成標記增效模組視窗,請按一下視窗框架上的" +"關閉視窗按鈕。或者,您也可以按 " +"CtrlW,但是焦點必須是" +"在速成標記增效模組視窗上。" + +#: ../base.xml:1583(title) +msgid "User Name Plugin" +msgstr "使用者名稱增效模組" + +#: ../base.xml:1584(para) +msgid "" +"The User name plugin inserts the username of the current user into the file. " +"To use the User name plugin, perform the following steps:" +msgstr "" +"使用者名稱增效模組會將目前使用者的名稱,加入檔案中。 如果要使用使用者名稱增效" +"模組,請執行下列步驟:" + +#: ../base.xml:1587(para) +msgid "Load the User name plugin." +msgstr "載入使用者名稱增效模組。" + +#: ../base.xml:1589(para) +msgid "" +"Choose EditInsert User Name to insert your username at the cursor position in " +"the current file." +msgstr "" +"選擇編輯加入使用者名稱,將您的使用者名稱加入目前檔案游標所在的位置。" + +#: ../lbase.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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"根據自由軟體基金會 (Free Software Foundation) 所發佈 的 GNU 自由文件授權 " +"(GNU Free Documentation License, GFDL) 1.1 (含) 以後版本, 使用者可以複製、散" +"佈,或修改本文件,但不得增刪章節,不得加上封面文字, 亦不得加上封底文字。 如" +"要取得 GFDL 的副本,請參閱 此連結,或是參閱與本手冊一同隨附的 COPYING-DOCS 檔案。" + +#: ../lbase.xml:5(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 手冊集中的一部份。 如果您只要單獨散佈" +"本手冊,依據授權聲明第六節之敘述, 您必須另外將授權聲明加入本手冊中。" + +#: ../lbase.xml:8(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 文件 專案小組成員亦明白這些名稱為商標" +"時, 這些名稱會以大寫字母或是首字母大寫表示。" + +#: ../lbase.xml:17(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 " +"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 "" +"文件提供是以其「原樣」呈現,不管明示或暗示,皆不具任何 保證,包括 (但不限於) " +"文件或修正版毫無錯誤、可販售、 具特殊用途,或不侵權。 關於本文件與修正版文件" +"之品質、正確性及功用, 其風險您必須自行承擔。 若本文件或修正版有任何缺陷,任" +"何必須之保養,修理及更正, 應由您自行承擔,原始作者、作者或任何散佈者無須負" +"責。 本免責聲明是本授權聲明極重要與必要的一部份,因此任何文件或 修正版的授" +"權,皆須在同意本免責聲明的情況下進行;同時在任何情況或法律理論下,亦即不管是" +"在侵權 (包括疏忽)、契約或 其他情形,或是已預先告知會有下列損害之可能時,本文" +"件 或修正版的任何作者、原始作者、投稿人以及散佈者,或是 任何提供單位,對於因" +"使用本文件及修正版,或與本文件及 修正版使用相關所造成的任何直接、間接、特殊、" +"偶然或必 然之損害,包括 (但不限於) 信譽受損、工作停止、電腦當 機或不正常運" +"作,或任何所有其他損害,上述人等皆不需負 任何責任。" + +#: ../lbase.xml:12(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: " +"" +msgstr "" +"本文件及其修正版本的提供,是基於 GNU 自由文件授權聲明的條款,同時亦有下列共" +"識: " diff --git a/help/zh_TW/figures/gedit_window.png b/help/zh_TW/figures/gedit_window.png new file mode 100755 index 00000000..b2b7c927 Binary files /dev/null and b/help/zh_TW/figures/gedit_window.png differ diff --git a/help/zh_TW/zh_TW.po b/help/zh_TW/zh_TW.po new file mode 100755 index 00000000..677cb853 --- /dev/null +++ b/help/zh_TW/zh_TW.po @@ -0,0 +1,2686 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2005-10-22 13:45-0400\n" +"PO-Revision-Date: 2007-02-12 08:54+0800\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../base.xml:24(title) ../base.xml:95(revnumber) +msgid "gedit Manual V2.5.1" +msgstr "gedit 手冊 V2.5.1" + +#: ../base.xml:26(year) +msgid "2003" +msgstr "2003 年" + +#: ../base.xml:27(holder) ../base.xml:30(holder) ../base.xml:52(orgname) +msgid "Sun Microsystems" +msgstr "Sun Microsystems" + +#: ../base.xml:29(year) +msgid "2002" +msgstr "2002 年" + +#: ../base.xml:32(year) ../base.xml:152(date) +msgid "2000" +msgstr "2000 年" + +#: ../base.xml:33(holder) +msgid "Eric Baudais" +msgstr "Eric Baudais" + +#: ../base.xml:44(publishername) ../base.xml:59(orgname) ../base.xml:99(para) +#: ../base.xml:107(para) ../base.xml:115(para) ../base.xml:123(para) +#: ../base.xml:131(para) ../base.xml:139(para) ../base.xml:147(para) +#: ../base.xml:156(para) +msgid "MATE Documentation Project" +msgstr "MATE 文件專案" + +#: ../base.xml:56(firstname) +msgid "Eric" +msgstr "Eric" + +#: ../base.xml:57(surname) +msgid "Baudais" +msgstr "Baudais" + +#: ../base.xml:60(email) +msgid "baudais@okstate.edu" +msgstr "baudais@okstate.edu" + +#: ../base.xml:64(firstname) +msgid "Baris" +msgstr "Baris" + +#: ../base.xml:65(surname) +msgid "" +"Cicek provided information from earlier revisions of the gedit application." +msgstr "Cicek 提供 gedit 應用程式較早版本的資訊。" + +#: ../base.xml:66(contrib) +msgid "Acknowledgements" +msgstr "感謝" + +#: ../base.xml:69(firstname) +msgid "Ajit" +msgstr "Ajit" + +#: ../base.xml:70(surname) +msgid "George provided information about plugins." +msgstr "George 提供增效模組的相關資訊。" + +#: ../base.xml:98(para) ../base.xml:106(para) ../base.xml:114(para) +#: ../base.xml:122(para) ../base.xml:130(para) ../base.xml:138(para) +#: ../base.xml:146(para) +msgid "Sun MATE Documentation Team" +msgstr "Sun MATE 文件小組" + +#: ../base.xml:103(revnumber) +msgid "gedit Manual V2.5" +msgstr "gedit 手冊 V2.5" + +#: ../base.xml:104(date) +msgid "March 2003" +msgstr "2003 年 3 月" + +#: ../base.xml:111(revnumber) +msgid "gedit Manual V2.4" +msgstr "gedit 手冊 V2.4" + +#: ../base.xml:112(date) +msgid "January 2003" +msgstr "2003 年 1 月" + +#: ../base.xml:119(revnumber) +msgid "gedit Manual V2.3" +msgstr "gedit 手冊 V2.3" + +#: ../base.xml:120(date) +msgid "September 2002" +msgstr "2002 年 9 月" + +#: ../base.xml:127(revnumber) +msgid "gedit Manual V2.2" +msgstr "gedit 手冊 V2.2" + +#: ../base.xml:128(date) +msgid "August 2002" +msgstr "2002 年 8 月" + +#: ../base.xml:135(revnumber) +msgid "gedit Manual V2.1" +msgstr "gedit 手冊 V2.1" + +#: ../base.xml:136(date) +msgid "June 2002" +msgstr "2002 年 6 月" + +#: ../base.xml:143(revnumber) +msgid "gedit Manual V2.0" +msgstr "gedit 手冊 V2.0" + +#: ../base.xml:144(date) +msgid "March 2002" +msgstr "2002 年 3 月" + +#: ../base.xml:151(revnumber) +msgid "gedit V1.0" +msgstr "gedit 手冊 V1.0" + +#: ../base.xml:154(para) +msgid "Eric Baudais baudais@okstate.edu" +msgstr "Eric Baudais baudais@okstate.edu" + +#: ../base.xml:160(releaseinfo) +msgid "This manual describes version 2.2.1 of gedit." +msgstr "本手冊的內容是說明 2.2.1 版的 gedit。" + +#: ../base.xml:163(title) +msgid "Feedback" +msgstr "意見回饋" + +#: ../base.xml:164(para) +msgid "" +"To report a bug or make a suggestion regarding the gedit application or this manual, follow the directions in the MATE Feedback Page." +msgstr "" +"關於本 gedit 應用程式或本手冊,如果要報告錯誤 或提" +"出建議,請遵照 MATE " +"Feedback Page 的指示。" + +#: ../base.xml:171(primary) +msgid "gedit" +msgstr "gedit" + +#: ../base.xml:172(primary) +msgid "text editor" +msgstr "文字編輯器" + +#: ../base.xml:177(title) +msgid "Introduction" +msgstr "介紹" + +#: ../base.xml:178(para) +msgid "" +"The gedit application enables you to create and " +"edit text files. You can use gedit plugins to " +"perform a variety of tasks related to text-editing from within the " +"gedit window." +msgstr "" +"您可以使用 gedit 應用程式建立和編輯文字 檔案。您可" +"以使用 gedit 增效模組在 gedit 視窗中 執行各種和文字編輯相關的工作。" + +#: ../base.xml:185(title) +msgid "Getting Started" +msgstr "入門" + +#: ../base.xml:189(title) +msgid "To Start gedit" +msgstr "啟動 gedit" + +#: ../base.xml:190(para) +msgid "You can start gedit in the following ways:" +msgstr "您可以使用下列方式啟動 gedit:" + +#: ../base.xml:193(guimenu) +msgid "Menu" +msgstr "功能表" + +#: ../base.xml:195(para) +msgid "" +"For information about how to start gedit from a " +"menu, see the latest version of the MATE Desktop User Guide for your " +"platform." +msgstr "" +"若需如何從功能表啟動 gedit 的詳細資訊,請參閱最新" +"版的平台 MATE Desktop User Guide。" + +#: ../base.xml:200(term) +msgid "Command line" +msgstr "指令行" + +#: ../base.xml:202(para) +msgid "Execute the following command: gedit" +msgstr "執行以下的指令: gedit" + +#: ../base.xml:210(title) +msgid "When You Start gedit" +msgstr "當您啟動 gedit" + +#: ../base.xml:211(para) +msgid "" +"When you start gedit, the following window is " +"displayed:" +msgstr "當您啟動 gedit 後,會顯示下面的視窗:" + +#: ../base.xml:214(title) +msgid "gedit Window" +msgstr "gedit 視窗" + +#: ../base.xml:220(phrase) +msgid "Shows gedit main window." +msgstr "顯示 gedit 主視窗。" + +#: ../base.xml:226(para) +msgid "" +"The gedit window contains the following elements:" +msgstr "" +"gedit 視窗包含下列的 元素:您可以選擇下列條件中的" +"一項或以上:" + +#: ../base.xml:229(term) +msgid "Menubar" +msgstr "功能表列" + +#: ../base.xml:231(para) +msgid "" +"The menus on the menubar contain all of the commands you need to work with " +"files in gedit." +msgstr "" +"在功能表列上的功能表中,有您在 gedit 中與檔案工作" +"所需的所有指令。" + +#: ../base.xml:235(term) +msgid "Toolbar" +msgstr "工具列" + +#: ../base.xml:237(para) +msgid "" +"The toolbar contains a subset of the commands that you can access from the " +"menubar." +msgstr "工具列包含了您可以由功能表列 存取的指令子集。" + +#: ../base.xml:241(term) +msgid "Display area" +msgstr "顯示區域" + +#: ../base.xml:243(para) +msgid "The display area contains the text of the file that you are editing." +msgstr "顯示區域包含了您正在 編輯之檔案的文字。" + +#: ../base.xml:247(term) +msgid "Output window" +msgstr "輸出視窗" + +#: ../base.xml:249(para) +msgid "" +"The output window displays the output returned by the Shell command plugin " +"and the Compare Files plugin." +msgstr "輸出視窗可以顯示由 Shell 指令增效模組和比對檔案增效模組傳回的輸出。" + +#: ../base.xml:252(term) +msgid "Statusbar" +msgstr "狀態列" + +#: ../base.xml:254(para) +msgid "" +"The statusbar displays information about current gedit activity and contextual information about the menu items." +msgstr "" +"狀態列可以顯示目前 gedit 活動的資訊,以及有關功能" +"表項目 的上下文資訊。" + +#: ../base.xml:260(para) +msgid "" +"When you right-click in the gedit window, the " +"application displays a popup menu. The popup menu contains the most common " +"text editing commands." +msgstr "" +"當您在 gedit 視窗中按滑鼠右鍵時,應用程式會顯示即" +"現式功能表。即現式功能表包含了 最常用的文字編輯指令。" + +#: ../base.xml:266(title) +msgid "To Open a File" +msgstr "開啟檔案" + +#: ../base.xml:267(para) +msgid "" +"To open a file, choose FileOpen to display the Open File " +"dialog. Select the file that you want to open, then click OK. The file is displayed in the gedit " +"window." +msgstr "" +"如果要開啟檔案,請選擇 檔案開啟 ,顯示開啟檔案對話方塊。選取要" +"開啟的檔案 ,然後按一下確定。這個檔案便會 顯示在 " +"gedit 視窗中。" + +#: ../base.xml:273(para) +msgid "" +"You can open multiple files in gedit. The " +"application displays one file at a time in the application window. The " +"application adds a tab for each open file to the window. To display another " +"open file, click on the tab that corresponds to the file. To create a new " +" gedit window for each file that is open, drag " +"the tab corresponding to each file to the desktop background." +msgstr "" +"您可以在 gedit 中,開啟多個檔案。 本應用程式在應用" +"程式視窗中,一次只會顯示一個檔案。 應用程式會為每個開啟的檔案,在視窗中增加一" +"個標籤。如果要顯示另外一個 開啟的檔案,請按該檔案的標籤。如果為每一個開啟的檔" +"案,建立一個新的 gedit 視窗,請將檔案的 標籤一個" +"個地拖曳至桌面背景上。" + +#: ../base.xml:279(para) +msgid "" +"You can also use the Documents menu to move between the " +"open files. You can choose DocumentsMove to New Window to move a " +"document to a new gedit window." +msgstr "" +"您也可以使用 文件功能表,在開啟的檔案之間移動。您可以選擇" +"文件移至新視窗,將文件移到新的 gedit 視窗。" + +#: ../base.xml:290(phrase) +msgid "Shows Recent Files menu icon." +msgstr "顯示最近使用的檔案功能表圖示。" + +#: ../base.xml:282(para) +msgid "" +"The application records the paths and filenames of the five most recent " +"files that you edited and displays the files as menu items on the " +"File menu. You can also click on " +"the " +"icon on the toolbar to display the list of recent files." +msgstr "" +"應用程式會記錄您所編輯的最後 5 個 檔案,並以功能表項目的方式,顯示在 " +"檔案功能表中。您也可以按一下 " +" 工具" +"列上的圖示,顯示最近使用的檔案清單。" + +#: ../base.xml:297(title) +msgid "To Open Multiple Files from a Command Line" +msgstr "從指令行開啟多個檔案" + +#: ../base.xml:298(para) +msgid "" +"You can run gedit from a command line and open a " +"single file or multiple files. To open multiple files from a command line, " +"type the following command, then press Return:" +msgstr "" +"您可以從指令行執行 gedit,並開啟一個或多個檔案。如" +"果要從指令行開啟多個檔案,請鍵入下列指令,然後按一下 Return " +"鍵。" + +#: ../base.xml:301(replaceable) +msgid "file1.txt file2.txt file3.txt" +msgstr "file1.txt file2.txt file3.txt" + +#: ../base.xml:301(command) +msgid "gedit " +msgstr "gedit " + +#: ../base.xml:302(para) +msgid "" +"When the application starts, the files that you specify are displayed in the " +"gedit window." +msgstr "" +"當應用程式啟動時,您所指定的檔案便會顯示在 gedit " +"視窗內。" + +#: ../base.xml:304(para) +msgid "" +"For more information on how to run gedit from a " +"command line, see gedit1." +msgstr "" +"若需如何從指令行執行 gedit 的詳細資訊,請參閱 " +"gedit1。" + +#: ../base.xml:309(title) +msgid "Usage" +msgstr "使用" + +#: ../base.xml:313(title) +msgid "To Create a New File" +msgstr "建立新檔案" + +#: ../base.xml:314(para) +msgid "" +"To create a new file, choose FileNew. The application " +"displays a new file in the gedit window." +msgstr "" +"如果要建立新檔案,請選擇 檔案開新" +"檔案。應用程式會在 gedit 視窗內顯示新檔案。" + +#: ../base.xml:321(title) +msgid "To Save a File" +msgstr "儲存檔案" + +#: ../base.xml:322(para) +msgid "You can save files in the following ways:" +msgstr "您可以用下列方式儲存檔案:" + +#: ../base.xml:324(para) +msgid "" +"To save changes to an existing file, choose FileSave or click " +"Save on the toolbar." +msgstr "" +"如果要將變更儲存到目前的檔案,請選擇 檔案儲存 或按一下工具列上的" +"儲存 。" + +#: ../base.xml:329(para) +msgid "" +"To save a new file or to save an existing file under a new filename, choose " +"FileSave As. Enter a name for the file in the Save as " +"dialog box, then click OK." +msgstr "" +"如果要儲存新檔案,或以新的檔案名稱儲存目前的檔案,請選擇 " +"檔案另存 新檔。請將檔案名稱輸入另存 新檔對話方塊,然後按一" +"下確定。" + +#: ../base.xml:334(para) +msgid "" +"To save all of the files that are currently open in gedit, choose DocumentsSave All." +msgstr "" +"如果要儲存目前在 gedit 中開啟的所有檔案,請選擇 " +"文件全部 儲存。" + +#: ../base.xml:343(title) +msgid "To Edit Text" +msgstr "編輯文字" + +#: ../base.xml:344(para) +msgid "You can edit the text of a file in the following ways:" +msgstr "您可以使用下列方式編輯檔案文字:" + +#: ../base.xml:346(para) +msgid "Type new text from the keyboard." +msgstr "由鍵盤輸入新的文字。" + +#: ../base.xml:348(para) +msgid "Use the Delete key to delete text." +msgstr "使用刪除鍵刪除文字。" + +#: ../base.xml:351(para) +msgid "" +"Use the Cut, Copy, " +"Paste, and Delete menu " +"items on the Edit menu to edit text." +msgstr "" +"請使用剪下複製、" +"貼上刪除功能表項目 " +"(在編輯功能表上) 來編輯文字。" + +#: ../base.xml:356(para) +msgid "You can perform any of the following actions on the selected text:" +msgstr "您可以在所選取的文字上執行下列任何一個動作:" + +#: ../base.xml:359(para) +msgid "" +"To copy the selected text to a buffer, choose EditCopy." +msgstr "" +"如果要將選取的文字複製到緩衝區中,請選擇 編輯複製。" + +#: ../base.xml:363(para) +msgid "" +"To delete the selected text from the file and move the selected text to a " +"buffer, choose EditCut." +msgstr "" +"如果要從檔案中刪除選取的文字,並將 選取的文字移動至緩衝區,請選擇 " +"編輯剪下。" + +#: ../base.xml:368(para) +msgid "" +"To permanently delete the selected text from the file, choose " +"EditDelete." +msgstr "" +"如果要從檔案中永遠刪除選取的文字,請選擇 編輯刪除e。" + +#: ../base.xml:372(para) +msgid "" +"To insert the contents of the buffer at the cursor position, choose " +"EditPaste. You must cut or copy text before you can paste text into the " +"file." +msgstr "" +"如果要在游標位置上加入緩衝區 的內容,請選擇 編輯貼上。您必須先剪下或複製文字 " +"才能將文字貼進檔案。" + +#: ../base.xml:378(para) +msgid "" +"To select all of the text in a file, choose EditSelect All." +msgstr "" +"如果要選取檔案中所有的文字,請選擇 編輯全部 選取。" + +#: ../base.xml:386(title) +msgid "To Undo or Redo Edits" +msgstr "還原或重做編輯" + +#: ../base.xml:387(para) +msgid "" +"To undo an edit, choose EditUndo. To redo an edit, " +"choose EditRedo. The number of previous edits that you can undo is determined by " +"the Set limit on undo actions to setting in the tabbed section of the Preferences dialog." +msgstr "" +"如果要還原或重做編輯,請選擇 編輯" +"還原。如果要重做編輯,請選擇 " +"編輯重做。您所能還原之前編" +"輯的次數,是取決於 限制還原次數為設定 (在 標籤區段中 (在 偏好設定對話方塊" +"中))。" + +#: ../base.xml:399(title) +msgid "To Find Text" +msgstr "尋找文字" + +#: ../base.xml:400(para) +msgid "To search a file for a string, perform the following steps:" +msgstr "如果要搜尋檔案中的字串,請執行下列步驟:" + +#: ../base.xml:402(para) +msgid "" +"Choose SearchFind to display the Find dialog." +msgstr "" +"請選擇 搜尋尋找 以顯示尋找對話方塊。" + +#: ../base.xml:407(para) ../base.xml:459(para) +msgid "" +"Type the string that you want to find, in the Search for field." +msgstr "將您要尋找的字串,鍵入 搜尋欄位中。" + +#: ../base.xml:409(para) ../base.xml:461(para) +msgid "You can include the following escape sequences:" +msgstr "您可以包括下列的逸出序列:" + +#: ../base.xml:412(literal) ../base.xml:464(literal) +msgid "\\n" +msgstr "\\n" + +#: ../base.xml:413(para) ../base.xml:465(para) +msgid "Use this escape sequence to specify a new line" +msgstr "請使用這個逸出序列,指定新的一行" + +#: ../base.xml:416(literal) ../base.xml:468(literal) +msgid "\\t" +msgstr "\\t" + +#: ../base.xml:417(para) ../base.xml:469(para) +msgid "Use this escape sequence to specify a tab character" +msgstr "請使用這個逸出序列,指定 Tab 字元" + +#: ../base.xml:420(literal) ../base.xml:472(literal) +msgid "\\r" +msgstr "\\r" + +#: ../base.xml:421(para) ../base.xml:473(para) +msgid "Use this escape sequence to specify a carriage return" +msgstr "請使用這個逸出序列,指定換行鍵" + +#: ../base.xml:425(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you type." +msgstr "" +"選取符合大小寫選項, 尋找只符合您所鍵入文字狀況 的字串。" + +#: ../base.xml:429(para) ../base.xml:484(para) +msgid "" +"Select the Match entire word only option to only find " +"occurrences of the string that match the entire words of the text that you " +"type." +msgstr "" +"選取全字相符選項, 尋找字串中完全符合您所輸入的 文字。" + +#: ../base.xml:433(para) ../base.xml:488(para) +msgid "" +"Select the Wrap around option to search to the end of " +"the file and then continue the search from the beginning of the file." +msgstr "" +"選取全檔搜尋選項,搜尋到檔案結尾後再從檔案開頭繼續搜尋。" + +#: ../base.xml:435(para) ../base.xml:490(para) +msgid "" +"Click Find to search the file for the first " +"occurrence of the string. If gedit finds the " +"string, the application moves the cursor to the string, and selects the " +"string." +msgstr "" +"按一下尋找,搜尋檔案中 第一個字串事件。如果 " +"gedit 找到字串,應用程式會將游標移動到字串上,並選" +"取 該字串。" + +#: ../base.xml:440(para) ../base.xml:500(para) +msgid "" +"To find the next occurrence of the string, click Find." +msgstr "如果要尋找符合的下一個字串,請按一下 找下一個。" + +#: ../base.xml:443(para) ../base.xml:503(para) +msgid "To finish the search, click Close." +msgstr "如果要結束搜尋,請按一下 關閉。" + +#: ../base.xml:450(title) +msgid "To Find and Replace Text" +msgstr "尋找並取代文字" + +#: ../base.xml:451(para) +msgid "" +"To search a file for a string, and replace the string with an alternative " +"string, perform the following steps:" +msgstr "如果要搜尋檔案中的字串,並以另外一個字串 取代之,請執行下列的步驟:" + +#: ../base.xml:454(para) +msgid "" +"Choose SearchReplace to display the Replace dialog." +msgstr "" +"請選擇 搜尋取代 ,顯示取代對話方塊。" + +#: ../base.xml:477(para) +msgid "" +"Type the string that you want to use to replace the string that you find, in " +"the Replace with field." +msgstr "將您要用來取代尋找 字串的字串,鍵入取代為欄位中。" + +#: ../base.xml:480(para) +msgid "" +"Select the Match case option to only find occurrences " +"of the string that match the case of the text that you enter." +msgstr "" +"選取符合大小寫選項, 尋找只符合您所鍵入文字狀況 的字串。" + +#: ../base.xml:495(para) +msgid "" +"Click on the Replace button to replace the occurrence " +"of the string with the text in the Replace with field. " +"Click on the Replace All button to replace all " +"occurrences of the string." +msgstr "" +"按一下取代按鈕,以您在 取代為 欄" +"位中鍵入的文字取代該字串。按一下全部取代按鈕,取代 所" +"有符合的字串。" + +#: ../base.xml:510(title) +msgid "To Open a File from a URI" +msgstr "從 URI 開啟檔案" + +#: ../base.xml:511(para) +msgid "" +"To open a file from a Uniform Resource Identifier (URI), perform one of the " +"following steps:" +msgstr "" +"如果要從資源識別統一描述器 (Uniform Resource Identifier,URI) 開啟檔案,請執" +"行下列任一項步驟:" + +#: ../base.xml:514(para) +msgid "" +"Choose FileOpen Location to display the Open Location " +"dialog. Enter the URI of the file that you want to open, then click " +"Open." +msgstr "" +"請選擇檔案開啟位置 ,顯示開啟位置 對話方塊。輸入" +"您要開啟 檔案的 URI ,然後按一下開啟。" + +#: ../base.xml:522(para) +msgid "" +"Type gedit URI at a command " +"line, where URI is the URI of the file that you " +"want to open, then press Return. Valid types of " +"URI include http:, " +"ftp:, file:, and all of the methods " +"supported by mate-vfs." +msgstr "" +"在指令行上輸入 gedit URI (此處" +"的 URI 是指您要開啟之檔案的 URI),然後按下 " +"Return 鍵。有效的 URI 類型包括 " +"http:ftp:file:," +"以及 mate-vfs 支援的所有方法。" + +#: ../base.xml:527(para) +msgid "The application opens the file located at the URI in read-only mode." +msgstr "應用程式會以唯讀模式開啟位於 URI 的檔案。" + +#: ../base.xml:531(title) +msgid "To Pipe the Output of a Command to a File" +msgstr "輸出指令到檔案" + +#: ../base.xml:532(para) +msgid "" +"You can use gedit to pipe the output of a command " +"to a text file. For example, to pipe the output of an ls " +"command to a text file, type ls | gedit, then press " +"Return." +msgstr "" +"您可以使用 gedit,將指令的輸出傳送到 文字檔案。例" +"如,如果要將 ls 指令的輸出傳送到文字檔案,請鍵入 " +"ls | gedit,然後按下 Return 鍵。" + +#: ../base.xml:536(para) +msgid "" +"The output of the ls command is displayed in a new text " +"file in the gedit window." +msgstr "" +"ls 指令的輸出,會 在 gedit 視窗" +"中以一個新的文字檔案顯示。" + +#: ../base.xml:538(para) +msgid "" +"Alternatively, you can use the Shell command plugin to pipe command output " +"to the current file. For information about how to use the Shell command " +"plugin, see ." +msgstr "" +"或者,您可以使用 Shell 指令增效模組,將指令輸出 傳送到目前的檔案中。如需如何" +"使用 Shell 指令增效模組的資訊,請參閱 。" + +#: ../base.xml:543(title) +msgid "To Position the Cursor on a Specific Line" +msgstr "將游標移到特定行" + +#: ../base.xml:544(para) +msgid "" +"To position the cursor on a specific line in the current file, perform the " +"following steps:" +msgstr "如果要將游標移到目前檔案中的特定行,請執行下列的 步驟:" + +#: ../base.xml:547(para) +msgid "" +"Choose SearchGo to Line to display the Go to Line " +"dialog." +msgstr "" +"請選擇 搜尋移至 某行 ,顯示移至某行對話方塊。" + +#: ../base.xml:552(para) +msgid "" +"Type the number of the line that you want to move the cursor to in the " +"Line number field." +msgstr "" +"如果您想把游標移動到某一行,請將 行數鍵入行數欄位中。" + +#: ../base.xml:555(para) +msgid "" +"Click Go to Line. The application moves the cursor to " +"the line number that you specify." +msgstr "" +"按一下移至某行。應用程式 便會將游標移動至您指定的行" +"數。" + +#: ../base.xml:558(para) +msgid "" +"To close the Go to Line dialog, click Close." +msgstr "" +"如果要關閉移至某行對話方塊,請按一下關閉。" + +#: ../base.xml:563(title) +msgid "To Change the Input Mode" +msgstr "變更輸入模式" + +#: ../base.xml:564(para) +msgid "" +"To change the input mode, right-click in the text window, then select " +"Input Methods. The Insert Unicode " +"control character menu item provides character layout options " +"that are useful for working with non-Latin character sets." +msgstr "" +"如果要變更輸入模式,請在文字視窗上按滑鼠右鍵,然後選取 輸入方法" +"插入統一碼控制字元功能表項目會提" +"供字元配置選項,這對使用非拉丁語系的字元集很有幫助。" + +#: ../base.xml:570(title) +msgid "To Print a File" +msgstr "列印檔案" + +#: ../base.xml:571(para) +msgid "" +"You can use gedit to perform the following print " +"operations:" +msgstr "您可以使用gedit,執行 下列列印作業:" + +#: ../base.xml:574(para) +msgid "Print a file to a printer." +msgstr "由印表機列印檔案。" + +#: ../base.xml:576(para) +msgid "Print the output of the print command to a file." +msgstr "將列印指令的輸出列印到檔案。" + +#: ../base.xml:579(para) +msgid "" +"If you print to a file, gedit sends the output of " +"the file to a pre-press format file. The most common pre-press formats are " +"PostScript and Portable Document Format (PDF)." +msgstr "" +"如果您是列印至檔案,gedit 會先將 檔案輸出傳送到某" +"個印前格式檔案。最常見的印前 格式為 PostScript 與 Portable Document Format " +"(PDF)。" + +#: ../base.xml:583(para) +msgid "" +"To preview the pages that you want to print, choose " +"FilePrint Preview." +msgstr "" +"如果要預覽想列印的頁面,請選擇 檔案預覽列印。" + +#: ../base.xml:587(para) +msgid "" +"To print the current file to a printer or a file, choose " +"FilePrint to display the Print dialog." +msgstr "" +"如果要將目前的檔案列印至印表機或檔案,請選擇 檔案列印 ,顯示列印對話方塊。" + +#: ../base.xml:592(para) +msgid "" +"The Print dialog enables you to specify the following " +"print options:" +msgstr "列印對話方塊可以讓您指定下列 列印選項:" + +#: ../base.xml:596(title) +msgid "Printer Tabbed Section" +msgstr "印表機標籤區段" + +#: ../base.xml:598(term) +msgid "Printer pane" +msgstr "印表機窗格" + +#: ../base.xml:600(para) +msgid "Select the printer to which you want to print the file." +msgstr "選取您要列印檔案 的印表機。" + +#: ../base.xml:604(guilabel) +msgid "Print range" +msgstr "列印範圍" + +#: ../base.xml:606(para) +msgid "" +"Select one of the following options to determine how many pages to print:" +msgstr "選取下列任一選項,決定 要列印的頁數:" + +#: ../base.xml:610(guilabel) +msgid "All" +msgstr "全部" + +#: ../base.xml:611(para) +msgid "Select this option to print all of the pages in the file." +msgstr "選取這個選項,會列印檔案中的所有頁面。" + +#: ../base.xml:614(guilabel) +msgid "Selection" +msgstr "選取部分" + +#: ../base.xml:615(para) +msgid "" +"Select this option to print the selected text only. This option is only " +"available if you select text." +msgstr "" +"選取這個選項,只會列印所選取的文字。這個選項 只有當您已選取文字後,才能使用。" + +#: ../base.xml:622(guilabel) +msgid "Number of copies" +msgstr "列印份數" + +#: ../base.xml:624(para) +msgid "" +"Use this spin box to specify the number of copies of the file that you want " +"to print." +msgstr "使用這個旋轉方塊以指定您要列印檔案的副本數。" + +#: ../base.xml:628(guilabel) +msgid "Collate" +msgstr "理序" + +#: ../base.xml:630(para) +msgid "" +"If you are printing multiple copies of the file, select this option to " +"collate the printed copies." +msgstr "如果您要將檔案列印多份副本,請選取這個選項,以理序已列印的副本。" + +#: ../base.xml:634(guilabel) +msgid "Filename" +msgstr "檔案名稱" + +#: ../base.xml:636(para) +msgid "" +"To print the file to a print file, type the name of the output file in this " +"text box." +msgstr "如果要列印檔案至列印檔案,請在這個文字方塊中輸入輸出檔案的名稱。" + +#: ../base.xml:643(title) +msgid "Paper Tabbed Section" +msgstr "紙張標籤區段" + +#: ../base.xml:645(guilabel) +msgid "Paper size" +msgstr "紙張大小" + +#: ../base.xml:647(para) +msgid "" +"Use this drop-down list to select the size of the paper to which you want to " +"print the file." +msgstr "請使用這個下拉式清單,選取列印檔案用的紙張大小。" + +#: ../base.xml:651(guilabel) +msgid "Width" +msgstr "寬度" + +#: ../base.xml:653(para) +msgid "" +"Use this spin box to specify the width of the paper. Use the adjacent drop-" +"down list to change the measurement unit for specifying the paper size." +msgstr "" +"請使用這個旋轉方塊,指定紙張寬度。請使用 旁邊的下拉式清單,變更 指定紙張大小" +"的度量單位。" + +#: ../base.xml:658(guilabel) +msgid "Height" +msgstr "高度" + +#: ../base.xml:660(para) +msgid "Use this spin box to specify the height of the paper." +msgstr "請使用這個選轉方塊,指定紙張高度。" + +#: ../base.xml:663(guilabel) +msgid "Feed orientation" +msgstr "入紙方向" + +#: ../base.xml:665(para) +msgid "" +"Use this drop-down list to select the orientation of the paper in the " +"printer." +msgstr "請使用這個下拉式清單來選取印表機 的紙張方向。" + +#: ../base.xml:669(guilabel) +msgid "Page orientation" +msgstr "紙張方向" + +#: ../base.xml:671(para) +msgid "Use this drop-down list to select the page orientation." +msgstr "請使用這個下拉式清單,選取紙張方向。" + +#: ../base.xml:674(guilabel) +msgid "Layout" +msgstr "配置" + +#: ../base.xml:676(para) +msgid "" +"Use this drop-down list to select the page layout. A preview of each layout " +"that you select is displayed in the Preview area." +msgstr "" +"請使用這個下拉式清單,選取頁面的版面配置。您選取的每個版面配置,其預覽會顯示" +"在預覽區域中。" + +#: ../base.xml:687(title) +msgid "To Customize the Toolbar and Statusbar" +msgstr "自訂工具列與狀態列" + +#: ../base.xml:689(para) +msgid "" +"To display or hide the toolbar, choose ViewToolbar. To customize how " +"gedit displays the toolbar, choose " +"ViewCustomize Toolbar, then select one of the following menu items:" +msgstr "" +"如果要顯示或隱藏工具列,請選擇檢視工具列。如果要自訂 " +"gedit 顯示工具列的方式,請選擇" +"檢視自訂工具列,然後選取下列任一項 功能表項目:" + +#: ../base.xml:696(guimenuitem) +msgid "Desktop Default" +msgstr "桌面預設值" + +#: ../base.xml:697(para) +msgid "Display the default toolbar." +msgstr "顯示預設的工具列。" + +#: ../base.xml:700(guimenuitem) +msgid "Icon" +msgstr "圖示" + +#: ../base.xml:701(para) +msgid "Display icons only." +msgstr "僅顯示圖示。" + +#: ../base.xml:704(guimenuitem) +msgid "Icon and Text" +msgstr "圖示與文字" + +#: ../base.xml:705(para) +msgid "Display icons and text." +msgstr "顯示圖示與文字。" + +#: ../base.xml:708(guimenuitem) +msgid "Priority Text beside Icons" +msgstr "在優先項目上顯示圖示及文字" + +#: ../base.xml:709(para) +msgid "Display icons, and display text beside some of the icons." +msgstr "顯示圖示,以及顯示一些圖示旁的文字。" + +#: ../base.xml:712(para) +msgid "" +"To display or hide the statusbar, choose ViewStatusbar. To customize how " +"gedit displays the statusbar, choose " +"ViewCustomize Statusbar, then select one of the following menu items:" +msgstr "" +"如果要顯示或隱藏狀態列,請選擇檢視狀態列。如果要自訂 " +"gedit 顯示狀態列的方式,請選擇" +"檢視自訂狀態列,然後選取下列任一項 功能表項目:" + +#: ../base.xml:719(guimenuitem) +msgid "Show Cursor Position" +msgstr "顯示游標位置" + +#: ../base.xml:720(para) +msgid "Display the line number and column number where the cursor is located." +msgstr "顯示游標所在的行數與欄數。" + +#: ../base.xml:723(guimenuitem) +msgid "Show Overwrite Mode" +msgstr "顯示覆寫模式" + +#: ../base.xml:724(para) +msgid "" +"Display the editing mode. If the editor is in insert mode, the statusbar " +"contains the word INS. If the editor is in overwrite mode, the statusbar " +"contains the word OVR." +msgstr "" +"顯示編輯模式。如果編輯器是處於插入模式,狀態列便會出現 INS 字樣。如果編輯器是" +"處於覆寫模式,狀態列便會出現 OVR 字樣。" + +#: ../base.xml:728(para) +msgid "" +"To display or hide the output window, choose ViewOutput Window." +msgstr "" +"如果要顯示或隱藏輸出視窗,請選擇檢視輸出視窗。" + +#: ../base.xml:735(title) +msgid "Preferences" +msgstr "偏好設定" + +#: ../base.xml:737(para) +msgid "" +"To configure gedit, choose " +"EditPreferences. The Preferences dialog contains the " +"following categories:" +msgstr "" +"如果要配置 gedit,請選擇 編輯" +"偏好設定偏好設" +"定對話方塊含有下列 種類:" + +#: ../base.xml:754(title) +msgid "Editor" +msgstr "編輯器" + +#: ../base.xml:755(para) +msgid "" +"The Editor category is subdivided into the following " +"subcategories:" +msgstr "編輯器的種類又可分為下列幾種 子類:" + +#: ../base.xml:759(title) +msgid "Fonts and Colors" +msgstr "字型與色彩" + +#: ../base.xml:761(guilabel) +msgid "Use default theme font" +msgstr "使用預設配色字型" + +#: ../base.xml:763(para) +msgid "" +"Select this option to use the default system font for the text in the " +"gedit text window." +msgstr "" +"選取這個選項,在 gedit 文字視窗的文字中,會使用系" +"統預設的字型。" + +#: ../base.xml:766(guilabel) +msgid "Editor font" +msgstr "編輯器字型" + +#: ../base.xml:768(para) +msgid "" +"This field displays the font that gedit uses to " +"display text. Click on the button to specify the font type, style, and size " +"to use for text." +msgstr "" +"這個欄位會顯示 gedit 用來顯示文字的字型。 按一下按" +"鈕,指定文字所使用的字體類型、樣式與大小。" + +#: ../base.xml:772(guilabel) +msgid "Use default theme colors" +msgstr "使用預設的配色色彩" + +#: ../base.xml:774(para) +msgid "" +"Select this option to use the default theme colors in the " +"gedit text window." +msgstr "" +"選取這個選項,會在 gedit 文字視窗中,使用預設的配" +"色色彩。" + +#: ../base.xml:777(guilabel) +msgid "Text color" +msgstr "文字色彩" + +#: ../base.xml:779(para) +msgid "" +"Click on the Text color button to display the color " +"selector dialog. Select a color to use to display text in the " +"gedit text window." +msgstr "" +"按一下文字色彩按鈕, 顯示色彩選擇元件對話方塊。請選取" +"顏色,程式會在 gedit 文字視窗中,以該顏色顯示文" +"字。" + +#: ../base.xml:784(guilabel) +msgid "Background color" +msgstr "背景色彩" + +#: ../base.xml:786(para) +msgid "" +"Click on the Background color button to display the " +"color selector dialog. Select a background color for the gedit text window." +msgstr "" +"按一下背景色彩按鈕, 顯示色彩選擇元件對話方塊。請為 " +"gedit 文字視窗選取背景色彩。" + +#: ../base.xml:791(guilabel) +msgid "Selected text color" +msgstr "選取文字的色彩" + +#: ../base.xml:793(para) +msgid "" +"Click on the Selected text color button to display " +"the color selector dialog. Select a color to use to display selected text." +msgstr "" +"按一下選取文字的色彩按鈕, 顯示色彩選擇元件對話方塊。" +"請選取用來顯示選取文字的色彩。" + +#: ../base.xml:798(guilabel) +msgid "Selection color" +msgstr "選取區域的色彩" + +#: ../base.xml:800(para) +msgid "" +"Click on the Selection color button to display the " +"color selector dialog. Select a background color to use to highlight a text " +"selection." +msgstr "" +"按一下選取區域的色彩按鈕, 顯示色彩選擇元件對話方塊。" +"請選取背景色彩,用來反白顯示選取的文字。" + +#: ../base.xml:809(title) +msgid "Tabs" +msgstr "跳格" + +#: ../base.xml:811(guilabel) +msgid "Set tabs width equivalent to" +msgstr "tab 字元的寬度為" + +#: ../base.xml:813(para) +msgid "" +"Use this spin box to specify the width of the space that " +"gedit inserts when you press the Tab key." +msgstr "" +"請使用這個旋轉方塊,指定 gedit 在您按下 " +"Tab 鍵時會加入的空格寬度。" + +#: ../base.xml:818(guilabel) +msgid "Insert spaces instead of tabs" +msgstr "以插入空格取代跳格" + +#: ../base.xml:820(para) +msgid "" +"Select this option to specify that gedit inserts " +"spaces instead of a tab character when you press the Tab " +"key." +msgstr "" +"選取這個選項可以指定 gedit 在您按下 Tab 鍵時,以插入空格取 代跳格字元。" + +#: ../base.xml:830(title) +msgid "Wrap Mode" +msgstr "換行模式" + +#: ../base.xml:832(guilabel) ../base.xml:1003(guilabel) +msgid "Enable text wrapping" +msgstr "啟用文字換行" + +#: ../base.xml:833(para) +msgid "" +"Select this option to wrap text onto the next line, at a character level, " +"when you reach the text window boundary." +msgstr "選取這個選項可以在到達文字視窗 界限時,以字元為單位將文字換到下一行。" + +#: ../base.xml:837(guilabel) +msgid "Do not split words over two lines" +msgstr "不要將字分成兩行" + +#: ../base.xml:838(para) +msgid "" +"Select this option to wrap text onto the next line, at a word level, when " +"you reach the text window boundary." +msgstr "選取這個選項可以在到達文字視窗 界限時,以字為單位將文字換到下一行。" + +#: ../base.xml:846(title) +msgid "Auto Indent" +msgstr "自動縮排" + +#: ../base.xml:848(guilabel) +msgid "Enable auto indentation" +msgstr "啟用自動縮排" + +#: ../base.xml:849(para) +msgid "" +"Select this option to specify that the next line starts at the indentation " +"level of the current line." +msgstr "選取這個選項可以指定下一行使用目前這一行的縮排設定。" + +#: ../base.xml:857(title) +msgid "Line Numbers" +msgstr "行號" + +#: ../base.xml:859(guilabel) +msgid "Display line numbers" +msgstr "顯示行號" + +#: ../base.xml:861(para) +msgid "" +"Select this option to display line numbers on the left side of the " +"gedit window." +msgstr "選取這個選項,會在 gedit 視窗左側顯示行號。" + +#: ../base.xml:869(title) +msgid "Open" +msgstr "開啟" + +#: ../base.xml:871(guilabel) +msgid "Supported encodings" +msgstr "支援的編碼" + +#: ../base.xml:872(para) +msgid "" +"A character encoding is a method of converting bytes to characters. " +"Different encodings might convert the same byte sequence into different " +"characters, or might produce invalid output. If you open a file using the " +"same encoding as that used to create the file, all characters are displayed " +"as intended. However, if you open a file using a different encoding, some " +"characters might not be displayed correctly, or an error might be returned." +msgstr "" +"字元編碼,是將位元組轉換為字元的方式。 不同的編碼方式會將相同的位元組序列轉換" +"為不同的字元,或產生無效的輸出。 如果您是以建立檔案時所用的編碼,來開啟該檔" +"案,則所有的字元顯示,都會跟原來建立時一模一樣。 然而,如果您開啟檔案時的編碼" +"不是原來的編碼,有些字元的顯示可能會不正常,或者,系統會傳回錯誤訊息。" + +#: ../base.xml:877(para) +msgid "" +"By default, gedit uses UTF-8 encoding to try to " +"open a file. UTF-8 encoding can be used for multilingual texts, as UTF-8 " +"covers almost all known alphabets and character sets. If the file is not a " +"valid UTF-8 file, gedit tries to open the file by " +"using the encoding for the current locale. If this also fails, " +"gedit tries to use an encoding from the Supported " +"encodings list, starting at the top of the list." +msgstr "" +"依預設值,gedit 是使用 UTF-8 編碼來開啟檔案。UTF-" +"8 編碼可用於內含多種語言的文件,因為 UTF-8 涵蓋了大多數已知的字母與字元集。如" +"果檔案並不是有效的 UTF-8 檔,gedit 會試著以目前語" +"系的編碼來開啟檔案。如果這樣依然有問題,gedit 會從" +"支援的編碼清單中第一個編碼方式開始,一個個地來試著開啟檔案。" + +#: ../base.xml:880(para) +msgid "" +"To modify the contents of the Supported encodings list, use the buttons " +"described in the following table:" +msgstr "如果要修改支援的編碼清單內容,請使用下列表格所述的按鈕:" + +#: ../base.xml:889(para) +msgid "Button" +msgstr "按鈕" + +#: ../base.xml:890(para) +msgid "Description" +msgstr "說明" + +#: ../base.xml:895(guilabel) +msgid "Add" +msgstr "新增" + +#: ../base.xml:896(para) +msgid "Adds an encoding to the list." +msgstr "將編碼加入清單。" + +#: ../base.xml:899(guilabel) +msgid "Remove" +msgstr "移除" + +#: ../base.xml:900(para) +msgid "Removes an encoding from the list." +msgstr "將編碼從清單中移除。" + +#: ../base.xml:903(para) +msgid "Up arrow" +msgstr "向上箭頭" + +#: ../base.xml:904(para) +msgid "Moves an encoding to a higher position in the list." +msgstr "將編碼移到清單中較高的位置。" + +#: ../base.xml:907(para) +msgid "Down arrow" +msgstr "向下箭頭" + +#: ../base.xml:908(para) +msgid "Moves an encoding to a lower position in the list." +msgstr "將編碼移到清單中較低的位置。" + +#: ../base.xml:919(title) +msgid "Save" +msgstr "儲存" + +#: ../base.xml:921(guilabel) +msgid "Create a backup copy of files before saving" +msgstr "在儲存前先建立檔案備份副本" + +#: ../base.xml:923(para) +msgid "" +"Select this option to create a backup copy of a file each time you save the " +"file. The backup copy of the file contains a ~ at the end of the filename." +msgstr "" +"選取這個選項,可以在每次儲存檔案時,建立備份副本。檔案的備份 副本在檔名的最末" +"會以波浪號 (˜) 做結尾。" + +#: ../base.xml:927(guilabel) +msgid "Autosave current file every" +msgstr "自動儲存目前檔案的時間間隔" + +#: ../base.xml:929(para) +msgid "" +"Select this option to automatically save the current file at regular " +"intervals. Use the spin box to specify the interval at which you want to " +"save the file." +msgstr "" +"選取這個選項,會自動地在固定的時間間隔,儲存目前的檔案。請使用這個旋轉方塊," +"指定儲存檔案的時間間隔。" + +#: ../base.xml:933(guilabel) +msgid "When saving an existing file" +msgstr "儲存現有的檔案時" + +#: ../base.xml:935(para) +msgid "Select one of the following save options:" +msgstr "請選取下列任一項儲存選項:" + +#: ../base.xml:938(guilabel) ../base.xml:958(guilabel) +msgid "Always use UTF-8 encoding (faster)" +msgstr "總是使用 UTF-8 編碼 (較快)" + +#: ../base.xml:939(para) +msgid "Select this option to save files using UTF-8 encoding." +msgstr "選取這個選項,會使用 UTF-8 編碼儲存檔案。" + +#: ../base.xml:942(guilabel) ../base.xml:962(guilabel) +msgid "Use current locale's encoding if possible" +msgstr "可能的話,儲存時請使用目前語言環境的編碼" + +#: ../base.xml:943(para) +msgid "" +"Select this option to save files using the current locale. You can set up " +"locales for different input methods." +msgstr "" +"選取這個選項,會使用目前的語言儲存檔案。您可以為不同的輸入法設定語言環境。" + +#: ../base.xml:947(guilabel) +msgid "Use original file encoding if possible" +msgstr "可能的話,請使用原始檔案的編碼" + +#: ../base.xml:948(para) +msgid "" +"Select this option to save a file using the current locale if the file was " +"already saved in the current locale." +msgstr "" +"選取這個選項,如果檔案已經是使用目前的區性儲存過,程式會使用目前區性來儲存檔" +"案 。" + +#: ../base.xml:953(guilabel) +msgid "When saving a new file" +msgstr "儲存新檔案時" + +#: ../base.xml:955(para) +msgid "Select one of the following save options for new files:" +msgstr "請為新檔案選取下列任一項儲存選項:" + +#: ../base.xml:959(para) +msgid "Select this option to save new files using UTF-8 encoding." +msgstr "選取這個選項,會使用 UTF-8 編碼儲存新檔案。" + +#: ../base.xml:963(para) +msgid "" +"Select this option to save new files using the current locale. You can set " +"up locales for different input methods." +msgstr "" +"選取這個選項,會使用目前的語言環境儲存新檔案。您可以為不同的輸入法設定語言環" +"境。" + +#: ../base.xml:975(title) +msgid "Undo" +msgstr "復原" + +#: ../base.xml:977(guilabel) +msgid "Set limit on undo actions to" +msgstr "復原的次數限制為" + +#: ../base.xml:979(para) +msgid "" +"Select this option to set a limit on the number of editing actions that you " +"can undo. Use the spin box to specify the maximum number of actions that you " +"can undo." +msgstr "" +"選取這個選項,可以限制編輯動作的 可復原次數。請使用旋轉方塊,指定 可復原動作" +"的最多次數。" + +#: ../base.xml:990(title) +msgid "Print" +msgstr "列印" + +#: ../base.xml:991(para) +msgid "" +"The Print category is subdivided into the following " +"subcategories:" +msgstr "列印種類又可分為下列幾種 子類:" + +#: ../base.xml:995(title) +msgid "Page" +msgstr "頁面" + +#: ../base.xml:997(guilabel) +msgid "Print page headers" +msgstr "列印頁面標頭" + +#: ../base.xml:999(para) +msgid "" +"Select this option to include a header on each page that you print. You " +"cannot configure the header." +msgstr "選取這個選項,會在列印的每一頁上面 加上標頭。您無法配置標頭。" + +#: ../base.xml:1005(para) +msgid "" +"Select this option to automatically wrap text at a word level when you print " +"a file. The application counts wrapped lines as one line for line numbering " +"purposes." +msgstr "" +"選取這個選項,在列印檔案時,可以自動以字為單位 換行。應用程式每換行一次計為一" +"行。" + +#: ../base.xml:1010(guilabel) +msgid "Print line numbers every" +msgstr "每次印出行號相隔的行數" + +#: ../base.xml:1013(para) +msgid "" +"Select this option to include line numbers when you print a file. Use the " +"spin box to specify how often to print the line numbers, for example every 5 " +"lines, every 10 lines, and so on." +msgstr "" +"選取這個選項,會在列印檔案時 加上行數。請使用旋轉方塊,指定列印行號的間隔。" +"例 如,每 5 行或每 10 行等。" + +#: ../base.xml:1022(title) +msgid "Fonts" +msgstr "字型" + +#: ../base.xml:1024(guilabel) +msgid "Body" +msgstr "內文" + +#: ../base.xml:1026(para) +msgid "" +"Click on this button to select the font to use to print the body text of a " +"file." +msgstr "按一下這個按鈕,可以選取列印檔案內容文字時,所要使用的字型。" + +#: ../base.xml:1030(guilabel) +msgid "Page headers" +msgstr "頁面標頭" + +#: ../base.xml:1032(para) +msgid "" +"Click on this button to select the font to use to print the headers in a " +"file." +msgstr "按一下這個按鈕,可以選取列印檔案標頭時,所要使用的字型。" + +#: ../base.xml:1036(guilabel) +msgid "Line numbers" +msgstr "行號" + +#: ../base.xml:1039(para) +msgid "Click on this button to select a font to use to print line numbers." +msgstr "按一下這個按鈕,可以選取列印行號時的字型。" + +#: ../base.xml:1043(para) +msgid "" +"To reset the fonts to the default fonts for printing a file from " +"gedit click on the Restore Default " +"Fonts button." +msgstr "" +"如果要將 gedit 列印檔案時的字型,重設為預設值, 請" +"按一下還原預設字型按鈕。" + +#: ../base.xml:1050(title) +msgid "Plugins" +msgstr "增效模組" + +#: ../base.xml:1051(para) +msgid "" +"For information about how to use the Plugins category " +"of the Preferences dialog, see ." +msgstr "" +"關於如何使用偏好設定對話方塊的增效模組類別,進一步資訊請參閱 。" + +#: ../base.xml:1058(title) +msgid "Working with Plugins" +msgstr "使用增效模組" + +#: ../base.xml:1059(para) +msgid "" +"A plugin is a supplementary program that enhances the functionality of an " +"application. The gedit plugins enable you to " +"perform a variety of functions related to text editing from within the " +" gedit window. The following table lists the " +" gedit plugins." +msgstr "" +"增效模組是一種以可增強應用程式功能的 補強性程式。您可以使用 " +"gedit 增效模組,在 gedit 視窗內,執行多種文字編輯功能。下表所列的,便是 " +"gedit 的增效模組。" + +#: ../base.xml:1070(para) ../base.xml:1150(para) +msgid "Plugin Name" +msgstr "增效模組名稱" + +#: ../base.xml:1071(para) +msgid "Purpose" +msgstr "用途" + +#: ../base.xml:1076(para) ../base.xml:1156(para) +msgid "ASCII table" +msgstr "ASCII 表 (ASCII 表格)" + +#: ../base.xml:1077(para) +msgid "" +"Displays a dialog that contains an ASCII table. You can use the ASCII table " +"to insert characters into a file." +msgstr "顯示包含 ASCII 表的對話方塊。您可以使用 ASCII 表,在檔案中插入字元。" + +#: ../base.xml:1080(para) ../base.xml:1161(para) +msgid "CVS ChangeLog" +msgstr "CVS 變更Log" + +#: ../base.xml:1081(para) +msgid "Opens the log messages associated with CVS commit commands." +msgstr "開啟與 CVS 確定指令相關的日誌記錄訊息。" + +#: ../base.xml:1084(para) ../base.xml:1166(para) ../base.xml:1168(guimenuitem) +msgid "Compare Files" +msgstr "比較檔案" + +#: ../base.xml:1085(para) +msgid "" +"Compares two files and displays the differences between the files in the " +"output window. This plugin uses the diff command to " +"compare the files." +msgstr "" +"比較兩個檔案,並將檔案的不同處,顯示在輸出視窗中。 這個增效模組是使用 " +"diff 指令來比較檔案。" + +#: ../base.xml:1089(para) ../base.xml:1171(para) ../base.xml:1173(guimenuitem) +msgid "Document Statistics" +msgstr "文件統計資料" + +#: ../base.xml:1090(para) +msgid "" +"Counts the number of lines, words, characters, and bytes in the current " +"file. The plugin displays the results in a Document Statistics dialog." +msgstr "" +"計算目前檔案的行數、字數、字元數和位元組數。增效模組 會在文件統計資" +"料對話方塊中顯示結果。" + +#: ../base.xml:1094(para) ../base.xml:1176(para) +msgid "Indent lines" +msgstr "縮排行" + +#: ../base.xml:1095(para) +msgid "" +"Indents the selected lines, or removes the indentation from the selected " +"lines." +msgstr "將選取的行縮排,或移除選取行的縮排設定。" + +#: ../base.xml:1098(para) ../base.xml:1183(para) +msgid "Insert Date/Time" +msgstr "加入日期/時間 (插入 Date/Time)" + +#: ../base.xml:1099(para) +msgid "Inserts the current date and time into a file." +msgstr "在檔案中加入目前的日期及時間。" + +#: ../base.xml:1102(para) ../base.xml:1188(para) +msgid "Shell command" +msgstr "Shell 指令" + +#: ../base.xml:1103(para) +msgid "Displays the text output of a shell command in the output window." +msgstr "將 shell 指令的文字輸出顯示於輸出視窗。" + +#: ../base.xml:1106(para) ../base.xml:1193(para) ../base.xml:1195(guimenuitem) +msgid "Sort" +msgstr "排序" + +#: ../base.xml:1107(para) +msgid "Sorts the selected text." +msgstr "將選取的文字排序。" + +#: ../base.xml:1110(para) ../base.xml:1198(para) +msgid "Tag list" +msgstr "標記清單 (Tag 清單)" + +#: ../base.xml:1111(para) +msgid "" +"Displays a window that contains a list of common tags. You can use the " +"window to insert a tag into a file." +msgstr "顯示包含一般標記清單的視窗。您可以使用本視窗 將標記加入檔案。" + +#: ../base.xml:1115(para) ../base.xml:1203(para) +msgid "User name" +msgstr "使用者名稱 (使用r 名稱)" + +#: ../base.xml:1116(para) +msgid "Inserts the username of the current user into the file." +msgstr "將目前的使用者名稱加入到檔案中。" + +#: ../base.xml:1123(title) +msgid "To Load gedit Plugins" +msgstr "載入 gedit 增效模組" + +#: ../base.xml:1124(para) +msgid "" +"To load gedit plugins, choose " +"EditPreferences. Within the Plugins category, click on the " +"Manager subcategory. The Manager " +"subcategory displays the following information:" +msgstr "" +"如果要載入 gedit增效模組,請選擇" +"編輯偏好設定。在增效模組類別中,按一下管理員子類別。 管理員子類別會顯示下列資訊:" + +#: ../base.xml:1131(para) +msgid "" +"A list of the plugins that you can use with gedit." +msgstr "可以與 gedit 一同使用之增效模組的清單。" + +#: ../base.xml:1133(para) +msgid "" +"A Configure plugin button. You can use this button to " +"open a configuration dialog for the plugins that you can configure. For " +"example, see and ." +msgstr "" +"配置增效模組 按鈕。您可以使用這個按鈕,為您可以配置的" +"增效模組,開啟配置對話方塊。例如,請參閱 以及 。" + +#: ../base.xml:1136(para) +msgid "" +"A brief description of each plugin. To display a description, select the " +"plugin from the list of plugins." +msgstr "" +"每一個增效模組的簡短說明。如果要顯示說明,請從增效模組清單中選取增效模組。" + +#: ../base.xml:1139(para) +msgid "Details about the author of the plugin and the name of the module." +msgstr "增效模組作者及模組名稱之詳細資訊。" + +#: ../base.xml:1142(para) +msgid "" +"To load a plugin, select the check box next to the name of the plugin. The " +"gedit application adds the plugin to the " +"appropriate gedit menu, as described in the " +"following table." +msgstr "" +"如果要載入增效模組,請選取增效模組名稱旁的核取方塊。gedit 應用程式 會如下表所述,將外掛程式加入適當的 gedit 功能表中。" + +#: ../base.xml:1151(para) +msgid "Added to Menu" +msgstr "加入至功能表" + +#: ../base.xml:1157(guimenu) ../base.xml:1199(guimenu) +msgid "View" +msgstr "檢視" + +#: ../base.xml:1158(guimenuitem) +msgid "ASCII Table" +msgstr "ASCII 表" + +#: ../base.xml:1162(guimenu) +msgid "File" +msgstr "檔案" + +#: ../base.xml:1163(guimenuitem) +msgid "Open CVS ChangeLogs" +msgstr "開啟 CVS 變更Logs" + +#: ../base.xml:1167(guimenu) ../base.xml:1172(guimenu) +#: ../base.xml:1189(guimenu) +msgid "Tools" +msgstr "工具" + +#: ../base.xml:1177(guimenu) ../base.xml:1179(guimenu) +#: ../base.xml:1184(guimenu) ../base.xml:1194(guimenu) +#: ../base.xml:1204(guimenu) +msgid "Edit" +msgstr "編輯" + +#: ../base.xml:1178(guimenuitem) +msgid "Indent" +msgstr "縮排" + +#: ../base.xml:1180(guimenuitem) +msgid "Unindent" +msgstr "減少縮排" + +#: ../base.xml:1185(guimenuitem) +msgid "Insert Date and Time" +msgstr "加入日期和時間" + +#: ../base.xml:1190(guimenuitem) +msgid "Run Command" +msgstr "執行指令" + +#: ../base.xml:1200(guimenuitem) +msgid "Tag List" +msgstr "標記清單" + +#: ../base.xml:1205(guimenuitem) +msgid "Insert User Name" +msgstr "加入使用者名稱" + +#: ../base.xml:1210(para) ../base.xml:1224(para) ../base.xml:1341(para) +#: ../base.xml:1454(para) +msgid "" +"To close the Preferences dialog, click " +"Close." +msgstr "" +"如果要關閉偏好設定對話方塊,請按一下關閉。" + +#: ../base.xml:1216(title) +msgid "To Remove gedit Plugins" +msgstr "移除 gedit 增效模組" + +#: ../base.xml:1217(para) +msgid "A plugin remains loaded when you quit gedit." +msgstr "" +"即使您離開了 gedit,增效模組仍然是載入應用程式中。" + +#: ../base.xml:1218(para) +msgid "" +"To remove gedit plugins, choose " +"EditPreferences. Within the Plugins category, click on the " +"Manager subcategory. To remove a plugin, deselect the " +"check box next to the name of the plugin." +msgstr "" +"如果要移除 gedit 增效模組,請選擇" +"編輯偏好設定。在增效模組類別中,按一下管理員子類別。 如果要移除增效模組,請取消選取增效模組名稱旁的核取方塊。" + +#: ../base.xml:1230(title) +msgid "ASCII Table Plugin" +msgstr "ASCII 表增效模組" + +#: ../base.xml:1231(para) +msgid "" +"The ASCII table plugin displays a dialog that contains an ASCII table. You " +"can use the ASCII table to insert characters into a file. To use the ASCII " +"table plugin, perform the following steps:" +msgstr "" +"ASCII 表增效模組會顯示一個對話方塊,其內含有 ASCII 表。您可以使用 ASCII 表," +"在檔案中插入字元。 如果要使用 ASCII 表增效模組,請執行下列的步驟:" + +#: ../base.xml:1234(para) +msgid "Load the ASCII table plugin." +msgstr "載入 ASCII 表增效模組。" + +#: ../base.xml:1236(para) +msgid "" +"Choose ViewASCII Table to display the ASCII Table " +"dialog." +msgstr "" +"請選擇檢視ASCII 表,顯示 ASCII 表對話方塊。" + +#: ../base.xml:1240(para) +msgid "" +"Scroll through the list to find the character that you require, then select " +"the character with a single click." +msgstr "在清單中捲動,找尋您所需的字元,然後在字元上按一下,選取該字元。" + +#: ../base.xml:1243(para) +msgid "" +"Click on the Insert char button to insert the " +"character at the cursor position in the current file." +msgstr "" +"按一下加入字元按鈕,將字元加入目前游標所在的檔案位置" +"上。" + +#: ../base.xml:1246(para) +msgid "" +"When you finish entering ASCII characters, click Close to close the ASCII Table dialog." +msgstr "" +"完成所有 ASCII 字元輸入後,請按一下關閉,關閉 " +"ASCII 表對話方塊。" + +#: ../base.xml:1253(title) +msgid "CVS ChangeLog Plugin" +msgstr "CVS ChangeLog 增效模組" + +#: ../base.xml:1254(para) +msgid "" +"The CVS ChangeLog plugin opens the log messages associated with CVS commit " +"commands. This plugin enables you to easily paste text into the commit " +"message from the ChangeLog file. To use the CVS ChangeLog plugin, perform " +"the following steps:" +msgstr "" +"CVS ChangeLog 增效模組會開啟與 CVS commit 指令相關的記錄訊息。 這個增效模組可" +"以讓您輕易地從 ChangeLog 檔案中,將文字貼入 commit 訊息裡。 如果要使用 CVS 變" +"更Log 增效模組,請執行下列步驟:" + +#: ../base.xml:1258(para) +msgid "" +"Set the environment variable CVSEDITOR to gedit. " +"For example, if you are using the bash shell, run the " +"following command at the operating system prompt: export " +"CVSEDITOR=gedit " +msgstr "" +"將環境變數 CVSEDITOR 設為 gedit。 例如,如果您正在" +"使用 bash shell,請在作業系統 提示的時候,輸入下面的指" +"令: export CVSEDITOR=gedit " + +#: ../base.xml:1264(para) +msgid "" +"Commit a file to CVS in the usual way. A gedit " +"window opens, to enable you to enter the commit message." +msgstr "" +"以平常的方式將檔案確定至 CVS。此時會開啟 gedit 視" +"窗,讓您輸入 commit 訊息。" + +#: ../base.xml:1267(para) +msgid "Load the CVS ChangeLog plugin." +msgstr "載入 CVS ChangeLog 增效模組。" + +#: ../base.xml:1269(para) +msgid "" +"Choose FileOpen CVS ChangeLogs to open all of the ChangeLog files referenced in " +"the commit message. gedit opens each ChangeLog " +"file in a new tab." +msgstr "" +"請選擇 檔案開啟 CVS ChangeLogs,開啟所有 commit 訊息中所出現的 ChangeLog 檔案。" +"gedit 會為每個 變更Log 檔案開啟一個新標籤。" + +#: ../base.xml:1272(para) +msgid "" +"Copy the ChangeLog entries that you want to add to the commit message from " +"the gedit ChangeLog files." +msgstr "" +"gedit ChangeLog 檔案中,複製您想加入 commit 訊息" +"的 ChangeLog 記錄。" + +#: ../base.xml:1275(para) +msgid "" +"Insert the copied ChangeLog entries in the gedit " +"commit message tab." +msgstr "" +"將 ChangeLog 記錄加入 gedit 的 commit 訊息標籤內。" + +#: ../base.xml:1278(para) +msgid "Save your changes to the commit message, then close all files." +msgstr "儲存您對 commit 訊息所做的變更,然後關閉所有的檔案。" + +#: ../base.xml:1281(para) +msgid "Quit gedit." +msgstr "結束 gedit。" + +#: ../base.xml:1288(title) +msgid "Compare Files Plugin" +msgstr "比較檔案增效模組" + +#: ../base.xml:1289(para) +msgid "" +"The Compare Files plugin compares two files and displays the differences " +"between the files in the output window. This plugin uses the diff command to compare the files. To use the Compare Files plugin, " +"perform the following steps:" +msgstr "" +"比較檔案增效模組會比較兩個檔案,並將這兩個檔案不同的地方,顯示在輸出視窗中。 " +"這個增效模組會使用 diff 指令來比較檔案。 如果要使用比較檔" +"案增效模組,請執行下列的步驟:" + +#: ../base.xml:1293(para) +msgid "Load the Compare Files plugin." +msgstr "載入比較檔案增效模組。" + +#: ../base.xml:1295(para) +msgid "" +"Choose ToolsCompare Files. When you choose this option for the first time, " +"you are prompted to confirm the location of the diff " +"command. You are not prompted for this location again. See for information about how to change this " +"location later." +msgstr "" +"請選擇 工具比較檔案。 當您是第一次選擇這個選項,系統會提示您,請您確認 " +"diff 指令的位置。以後則不會再提示您確認位置。若需如何在日" +"後變更這個位置的詳細資訊,請參閱 。" + +#: ../base.xml:1299(para) +msgid "" +"Click OK to display the Compare Files dialog." +msgstr "" +"按一下確定,顯示比較檔案對話方" +"塊。" + +#: ../base.xml:1302(para) +msgid "" +"Specify the files that you want to compare. To specify an open file, select " +"the file from the drop-down list. To specify a closed file, enter the " +"location of the file in the text box." +msgstr "" +"指定您想要比較的檔案。如果要指定已開啟的檔案,請 從下拉式清單中選取。如果要指" +"定關閉的檔案,請在文字方塊中,輸入該檔案的位置。" + +#: ../base.xml:1306(para) +msgid "" +"To ignore changes in the amount of white space, select the Ignore " +"blanks option." +msgstr "如果要忽略空白數量的不同,請選取忽略空白選項。" + +#: ../base.xml:1309(para) +msgid "" +"To use the unified output format, showing three lines of context, select the " +"Use the unified output format option." +msgstr "" +"如果要使用 unified 輸出格式,也就是顯示三行內文的形式,請選取使用 " +"unified 輸出格式選項。" + +#: ../base.xml:1312(para) +msgid "" +"Click on the Compare button to compare the contents " +"of the specified files. The command output is displayed in the output window." +msgstr "" +"按一下比較按鈕,開始比較所指定檔案的內容。指令輸出會顯" +"示在輸出視窗中。" + +#: ../base.xml:1316(para) +msgid "" +"For more information, see diff1." +msgstr "" +"若需詳細的資訊,請參閱 diff1。 您可以選擇下列條件中的一項或以上:" + +#: ../base.xml:1320(title) +msgid "To Configure the Compare Files Plugin" +msgstr "配置比較檔案增效模組" + +#: ../base.xml:1321(para) +msgid "" +"To change the location of the command that the Compare Files plugin uses, " +"perform the following steps:" +msgstr "如果要變更比較檔案增效模組所使用之指令的位置,請執行下列步驟:" + +#: ../base.xml:1323(para) ../base.xml:1425(para) +msgid "" +"Choose EditPreferences." +msgstr "" +"請選擇編輯偏好設定。" + +#: ../base.xml:1326(para) ../base.xml:1428(para) +msgid "" +"Within the Plugins category, click on the " +"Manager subcategory." +msgstr "" +"在增效模組類別中,按一下管理員子類" +"別。" + +#: ../base.xml:1329(para) +msgid "Select the Compare Files plugin." +msgstr "選取比較檔案增效模組。" + +#: ../base.xml:1332(para) +msgid "" +"Click on the Configure plugin button to display the " +"Set program location dialog." +msgstr "" +"按一下配置增效模組按鈕,顯示設定程式位置對話方塊。" + +#: ../base.xml:1335(para) +msgid "" +"Specify the location of the diff command in the " +"Location to search for text box." +msgstr "" +"請指定 diff 指令的位置 (在搜尋的位置" +"文字方塊中)。" + +#: ../base.xml:1338(para) +msgid "" +"Click OK to close the Set program location dialog." +msgstr "" +"按一下確定,關閉設定程式位置對話" +"方塊。" + +#: ../base.xml:1348(title) +msgid "Document Statistics Plugin" +msgstr "文件統計資料增效模組" + +#: ../base.xml:1349(para) +msgid "" +"The Document Statistics plugin counts the number of lines, words, " +"characters, and bytes in the current file. The plugin displays the results " +"in a Document Statistics dialog. To use the Document " +"Statistics plugin, perform the following steps:" +msgstr "" +"文件統計資料增效模組可以計算目前檔案的行數、字數、字元數和位元組數。增效模組 " +"會在文件統計資料對話方塊中顯示結果。 如果要使用文件統計" +"資料增效模組,請執行下列的步驟:" + +#: ../base.xml:1353(para) +msgid "Load the Document Statistics plugin." +msgstr "載入文件統計資料增效模組。" + +#: ../base.xml:1355(para) +msgid "" +"Choose ToolsDocument Statistics to display the Document Statistics dialog. The Document Statistics dialog " +"display the following information about the file:" +msgstr "" +"請選擇 工具文件統計資料,顯示文件統計資料對話方塊。" +"文件統計資料對話方塊可以顯示下列的檔案資訊:" + +#: ../base.xml:1362(para) +msgid "Number of words in the current document." +msgstr "目前文件的字數。" + +#: ../base.xml:1365(para) +msgid "Number of characters, including spaces, in the current document." +msgstr "目前文件的字元數,包括空格。" + +#: ../base.xml:1368(para) +msgid "Number of characters, not including spaces, in the current document." +msgstr "目前文件的字元數,不包括空格。" + +#: ../base.xml:1371(para) +msgid "Number of bytes in the current document." +msgstr "目前文件的位元組數。" + +#: ../base.xml:1376(para) +msgid "" +"You can continue to update the gedit file while " +"the Document Statistics dialog is open. To refresh the " +"contents of the Document Statistics dialog, click on " +"the Update button." +msgstr "" +"您可以不斷地更新gedit 檔案,而無須關閉文" +"件統計資料對話方塊。要重新整理文件統計資料對" +"話方塊的內容,請按一下更新按鈕。" + +#: ../base.xml:1379(para) +msgid "" +"To close the Document Statistics dialog, click " +"Close." +msgstr "" +"如果要關閉文件統計資料對話方塊,請按一下關閉" +"。" + +#: ../base.xml:1386(title) +msgid "Indent Lines Plugin" +msgstr "縮排行增效模組" + +#: ../base.xml:1387(para) +msgid "" +"The Indent lines plugin indents the selected lines, or removes the " +"indentation from the selected lines. To use the Indent lines plugin, perform " +"the following steps:" +msgstr "" +"縮排行增效模組會縮排選取的行,或移除選取行的縮排設定。 如果要使用縮排行增效模" +"組,請執行下列的步驟:" + +#: ../base.xml:1390(para) +msgid "Load the Indent lines plugin." +msgstr "載入縮排行增效模組。" + +#: ../base.xml:1392(para) +msgid "" +"Select the lines that you want to indent. To indent or unindent a single " +"line, place the cursor anywhere on that line." +msgstr "" +"選取您要縮排的行。如果要縮排或減少縮排單一行,請將游標置於該行的任一位置上。" + +#: ../base.xml:1395(para) +msgid "" +"Choose EditIndent." +msgstr "" +"請選擇 編輯縮排。" + +#: ../base.xml:1399(para) +msgid "" +"To remove the indentation, select the lines and choose " +"EditUnindent." +msgstr "" +"如果要移除縮排,請選取要移除縮排的行,然後選擇 編輯減少縮排。" + +#: ../base.xml:1407(title) +msgid "Insert Date/Time Plugin" +msgstr "加入日期/時間增效模組" + +#: ../base.xml:1408(para) +msgid "" +"The Insert Date/Time plugin inserts the current date and time into a file. " +"To use the Insert Date/Time plugin, perform the following steps:" +msgstr "" +"加入日期及時間增效模組會將目前的日期及時間,加入檔案中。 如果要使用加入日期/" +"時間增效模組,請執行下列的步驟:" + +#: ../base.xml:1411(para) +msgid "Load the Insert Date/Time plugin." +msgstr "載入加入日期及時間增效模組。" + +#: ../base.xml:1413(para) +msgid "" +"Choose EditInsert Date and Time." +msgstr "" +"請選擇 編輯加入日期和時間。" + +#: ../base.xml:1415(para) +msgid "" +"If you have not configured the Insert Date/Time plugin to automatically " +"insert the date/time without prompting you for the format, " +"gedit displays the Insert Date and " +"Time dialog. Select the appropriate date/time format from the " +"list. Click on the Insert button to close the " +"Insert Date and Time dialog; gedit inserts the date/time at the cursor position in the current " +"file." +msgstr "" +"如果您尚未將加入日期/時間增效模組配置成不需提示即自動加入日期/時間," +"gedit 會顯示加入日期和時間對" +"話方塊。從清單中選取適當的日期/時間格式。按一下插入按" +"鈕,關閉加入日期和時間對話方塊;gedit 會在目前檔案的游標位置上插入日期/時間。" + +#: ../base.xml:1416(para) +msgid "" +"If you have configured gedit to use one " +"particular date/time format, the Insert Date and Time " +"dialog is not displayed; the date/time is automatically entered at the " +"cursor position in the current file." +msgstr "" +"如果您已經將 gedit 配置成使用特定的日期/時間格式," +"則不會顯示加入日期和時間對話方塊;即會在目前檔案的游標位" +"置上插入日期/時間。" + +#: ../base.xml:1417(para) +msgid "" +"See for information about how " +"to configure the Insert Date/Time plugin." +msgstr "" +"若需如何配置加入日期/時間增效模組的詳細資訊,請參閱 。" + +#: ../base.xml:1422(title) +msgid "To Configure the Insert Date/Time Plugin" +msgstr "配置加入日期/時間增效模組" + +#: ../base.xml:1423(para) +msgid "To configure the Insert Date/Time plugin, perform the following steps:" +msgstr "如果要配置加入日期及時間增效模組,請執行下列步驟:" + +#: ../base.xml:1432(para) +msgid "Select the Insert Date/Time plugin." +msgstr "選取 加入日期及時間增效模組。" + +#: ../base.xml:1435(para) +msgid "" +"Click on the Configure plugin button to display the " +"Configure insert date/time plugin dialog." +msgstr "" +"按一下配置增效模組按鈕,顯示配置加入日期/時" +"間增效模組對話方塊。" + +#: ../base.xml:1438(para) +msgid "Select one of the options, as follows:" +msgstr "選取下列任一選項:您可以選擇下列條件中的一項或以上:" + +#: ../base.xml:1440(para) +msgid "" +"To specify the date/time format each time you insert the date/time, select " +"the Prompt for a format option." +msgstr "" +"如果要在每次加入日期/時間時指定日期/時間格式,請選取提示指定格式選項。" + +#: ../base.xml:1443(para) +msgid "" +"To use the same gedit-provided date/time format " +"each time you insert the date/time, select the Use the selected " +"format option, then select the appropriate format from the list. " +"When you select this option, gedit does not " +"prompt you for the date/time format when you choose " +"EditInsert Date and Time." +msgstr "" +"如果要在每次加入日期/時間時都使用 gedit 提供的日" +"期/時間格式,請選取使用選取的格式選項,然後從清單中選取" +"適當的格式。當您選取這個選項後,gedit 並不會在您選" +"擇編輯加入日期和時間時,提示您設定日期/時間的格式。" + +#: ../base.xml:1461(title) +msgid "Shell Command Plugin" +msgstr "Shell 指令增效模組" + +#: ../base.xml:1463(para) +msgid "" +"The Shell Command plugin enables you to capture the output from a shell " +"command in gedit, by displaying the text output " +"of the shell command in the output window. To use the Shell command plugin, " +"perform the following steps:" +msgstr "" +"Shell 指令增效模組可以從 gedit 的 shell 指令擷取輸" +"出,而將 shell 指令的文字輸出 顯示於輸出視窗中。如果要使用 Shell 指令增效模" +"組,請執行 下列的步驟:" + +#: ../base.xml:1467(para) +msgid "Load the Shell command plugin." +msgstr "載入 Shell 指令增效模組。" + +#: ../base.xml:1470(para) +msgid "" +"Choose ToolsRun Command to display the Run Command " +"dialog." +msgstr "" +"請選擇 工具執行指令 ,顯示執行指令對話方塊。" + +#: ../base.xml:1475(para) +msgid "" +"Type the shell command that you want to execute in the Command field." +msgstr "將您想執行的 shell 指令,鍵入 指令欄位中。" + +#: ../base.xml:1477(para) +msgid "You can include the following special characters:" +msgstr "您可以包括下列的特殊字元:" + +#: ../base.xml:1480(literal) +msgid "%f" +msgstr "%f" + +#: ../base.xml:1481(para) +msgid "" +"Use these special characters to specify the filename of the current active " +"document, including the path." +msgstr "使用此類特殊字元,指定目前使用中的檔案名稱,包括路徑。" + +#: ../base.xml:1484(literal) +msgid "%n" +msgstr "%n" + +#: ../base.xml:1485(para) +msgid "" +"Use these special characters to specify the filename of the current active " +"document, without the path. In this case, gedit " +"looks for the file in the Working directory." +msgstr "" +"使用此類特殊字元,指定目前使用中的檔案名稱,不包括路徑。此時," +"gedit 會在工作目錄中找尋檔案。" + +#: ../base.xml:1489(para) +msgid "" +"Edit the Working directory field if necessary. By " +"default, the Shell command plugin executes the command you specify in the " +"current directory." +msgstr "" +"有必要的話,請編輯工作目錄欄位。依預設值,Shell 指令增效" +"模組會執行您在目前目錄中 指定的指令。" + +#: ../base.xml:1493(para) +msgid "" +"Select the Show results in Output Window option to " +"display the results of the command in the output window. If you do not " +"select this option, gedit discards the results of " +"the command." +msgstr "" +"選取在輸出視窗顯示結果選項,在輸出視窗顯示指令的執行結" +"果。如果沒有選取這個選項,gedit 會放棄指令結果。" + +#: ../base.xml:1496(para) +msgid "" +"Click Run. The Shell command plugin executes the " +"command and inserts the text output into the output window." +msgstr "" +"按一下執行。Shell 指令 增效模組會執行該指令,並將文字" +"輸出插入輸出視窗。" + +#: ../base.xml:1500(para) +msgid "" +"Use the Shift key to select the text in the output window." +msgstr "請使用 Shift 鍵在輸出視窗中選取文字。" + +#: ../base.xml:1503(para) +msgid "" +"Click on the Copy selected lines button to copy the " +"selected text into the buffer." +msgstr "" +"按一下複製選取的行按鈕,將選取的文字複製到緩衝區。" + +#: ../base.xml:1506(para) +msgid "" +"Choose EditPaste to paste the selected text into the file." +msgstr "" +"選擇編輯貼上,將選取的文字貼入檔案。" + +#: ../base.xml:1510(para) +msgid "" +"Click on the Close the output window button to close " +"the output window." +msgstr "按一下關閉輸出視窗按鈕,關閉輸出視窗。" + +#: ../base.xml:1517(title) +msgid "Sort Plugin" +msgstr "排序增效模組" + +#: ../base.xml:1518(para) +msgid "The Sort plugin sorts the selected text." +msgstr "排序增效模組可以將選取的文字排序。" + +#: ../base.xml:1519(para) +msgid "" +"You cannot undo the Sort operation, so you should save the file before " +"performing the sort. To revert to the saved version of the file after the " +"sort operation, choose FileRevert." +msgstr "" +"您不可以復原排序作業,因此在執行排序前應先儲存檔案。如果要在排序作業後回復成" +"之前儲存的檔案版本,請選擇檔案復" +"原。" + +#: ../base.xml:1522(para) +msgid "To use the Sort plugin, perform the following steps:" +msgstr "如果要使用排序增效模組,請執行下列的步驟:" + +#: ../base.xml:1524(para) +msgid "Load the Sort plugin." +msgstr "載入增效模組。" + +#: ../base.xml:1526(para) +msgid "" +"Choose EditSort to display the Sort dialog." +msgstr "" +"請選擇 編輯排序,顯示排序對話方塊。" + +#: ../base.xml:1530(para) +msgid "" +"To arrange the text in reverse sort order, select the Reverse " +"order option." +msgstr "如果要反向排序文字,請選取反向排序選項。" + +#: ../base.xml:1533(para) +msgid "" +"To delete duplicate lines, select the Remove duplicates " +"option." +msgstr "如果要刪除重複的行,請選取移除重複的行選項。" + +#: ../base.xml:1536(para) +msgid "" +"To ignore case sensitivity, select the Ignore case " +"option." +msgstr "如果不要區分大小寫,請選取忽略大小寫選項。" + +#: ../base.xml:1539(para) +msgid "" +"To specify the start position of the sort, select the appropriate column " +"from the Start at column spin box." +msgstr "" +"如果要指定排序的啟始位置,請從啟始欄旋轉方塊中選取適當的" +"欄。" + +#: ../base.xml:1542(para) +msgid "" +"To perform the sort operation, click on the Sort " +"button." +msgstr "如果要執行排序作業,請按一下排序按鈕。" + +#: ../base.xml:1549(title) +msgid "Tag List Plugin" +msgstr "速成標記增效模組" + +#: ../base.xml:1550(para) +msgid "" +"The Tag List plugin displays a window that contains a list of common tags. " +"You can use the window to insert a tag into a file. To use the Tag List " +"plugin, perform the following steps:" +msgstr "" +"速成標記增效模組會將常見的標記,顯示在視窗中。您可以使用這個視窗將 標記插入檔" +"案。 如果要使用速成標記增效模組,請執行下列的步驟:" + +#: ../base.xml:1554(para) +msgid "Load the Tag List plugin." +msgstr "載入速成標記增效模組。" + +#: ../base.xml:1556(para) +msgid "" +"Choose ViewTag List to display the Tag list plugin window." +msgstr "" +"選擇檢視標記清單,顯示速成標記增效模組視窗。" + +#: ../base.xml:1560(para) +msgid "" +"Select the appropriate tag category from the drop-down list; for example, " +"HTML - Tags." +msgstr "" +"請從下拉式清單中,選取適當的標記類別。例如,HTML - Tags。" + +#: ../base.xml:1563(para) +msgid "Scroll through the tag list to find the required tag." +msgstr "在標記清單中捲動,尋找所需的標記。" + +#: ../base.xml:1566(para) +msgid "" +"To insert a tag at the cursor position in the current file, double-click on " +"the tag in the tag list. You can also insert a tag as follows:" +msgstr "" +"要在目前檔案游標的位置上加入標記,請在標記清單中的標記上連按兩下。您也可以使" +"用下列方式加入標記:" + +#: ../base.xml:1568(para) +msgid "" +"To insert a tag in the current file and change the focus from the " +"Tag list plugin window to the editor window, press " +"Enter." +msgstr "" +"如果要將標記加入目前檔案,並且將焦點由速成標記增效模組視" +"窗,變更到編輯器視窗的話,請按一下 輸入 鍵。" + +#: ../base.xml:1571(para) +msgid "" +"To insert a tag in the current file and maintain the focus on the " +"Tag list plugin window, press ShiftEnter." +msgstr "" +"如果要將標記加入目前的檔案,但是焦點保持在速成標記增效模組視窗的話,請按 Shift輸入。" + +#: ../base.xml:1576(para) +msgid "" +"To close the Tag list plugin window, click on the " +"Close Window button in the window frame. " +"Alternatively, press CtrlW when the focus is on the Tag list plugin " +"window." +msgstr "" +"如果要關閉速成標記增效模組視窗,請按一下視窗框架上的" +"關閉視窗按鈕。或者,您也可以按 " +"CtrlW,但是焦點必須是" +"在速成標記增效模組視窗上。" + +#: ../base.xml:1583(title) +msgid "User Name Plugin" +msgstr "使用者名稱增效模組" + +#: ../base.xml:1584(para) +msgid "" +"The User name plugin inserts the username of the current user into the file. " +"To use the User name plugin, perform the following steps:" +msgstr "" +"使用者名稱增效模組會將目前使用者的名稱,加入檔案中。 如果要使用使用者名稱增效" +"模組,請執行下列步驟:" + +#: ../base.xml:1587(para) +msgid "Load the User name plugin." +msgstr "載入使用者名稱增效模組。" + +#: ../base.xml:1589(para) +msgid "" +"Choose EditInsert User Name to insert your username at the cursor position in " +"the current file." +msgstr "" +"選擇編輯加入使用者名稱,將您的使用者名稱加入目前檔案游標所在的位置。" + +#: ../lbase.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 link or " +"in the file COPYING-DOCS distributed with this manual." +msgstr "" +"根據自由軟體基金會 (Free Software Foundation) 所發佈 的 GNU 自由文件授權 " +"(GNU Free Documentation License, GFDL) 1.1 (含) 以後版本, 使用者可以複製、散" +"佈,或修改本文件,但不得增刪章節,不得加上封面文字, 亦不得加上封底文字。 如" +"要取得 GFDL 的副本,請參閱 此連結,或是參閱與本手冊一同隨附的 COPYING-DOCS 檔案。" + +#: ../lbase.xml:5(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 手冊集中的一部份。 如果您只要單獨散佈" +"本手冊,依據授權聲明第六節之敘述, 您必須另外將授權聲明加入本手冊中。" + +#: ../lbase.xml:8(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 文件 專案小組成員亦明白這些名稱為商標" +"時, 這些名稱會以大寫字母或是首字母大寫表示。" + +#: ../lbase.xml:17(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 " +"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 "" +"文件提供是以其「原樣」呈現,不管明示或暗示,皆不具任何 保證,包括 (但不限於) " +"文件或修正版毫無錯誤、可販售、 具特殊用途,或不侵權。 關於本文件與修正版文件" +"之品質、正確性及功用, 其風險您必須自行承擔。 若本文件或修正版有任何缺陷,任" +"何必須之保養,修理及更正, 應由您自行承擔,原始作者、作者或任何散佈者無須負" +"責。 本免責聲明是本授權聲明極重要與必要的一部份,因此任何文件或 修正版的授" +"權,皆須在同意本免責聲明的情況下進行;同時" +"在任何情況或法律理論下,亦即不管是在侵權 (包括疏忽)、契約或 其他情形,或是已" +"預先告知會有下列損害之可能時,本文件 或修正版的任何作者、原始作者、投稿人以及" +"散佈者,或是 任何提供單位,對於因使用本文件及修正版,或與本文件及 修正版使用" +"相關所造成的任何直接、間接、特殊、偶然或必 然之損害,包括 (但不限於) 信譽受" +"損、工作停止、電腦當 機或不正常運作,或任何所有其他損害,上述人等皆不需負 任" +"何責任。" + +#: ../lbase.xml:12(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: " +"" +msgstr "" +"本文件及其修正版本的提供,是基於 GNU 自由文件授權聲明的條款,同時亦有下列共" +"識: " diff --git a/osx/Info.plist.in b/osx/Info.plist.in new file mode 100755 index 00000000..f8e4c905 --- /dev/null +++ b/osx/Info.plist.in @@ -0,0 +1,260 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + gedit + CFBundleGetInfoString + @VERSION@ Copyright 2009, gedit + CFBundleIconFile + gedit.icns + CFBundleIdentifier + org.mate.gedit + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + @VERSION@ + CFBundleSignature + ???? + CFBundleVersion + @VERSION@ + NSHumanReadableCopyright + Copyright 2009 gedit, GNU General Public License. + LSMinimumSystemVersion + 10.4 + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + * + F + F90 + Filemaker + M + act3 + ada + applescript + as + asm + asp + awk + bak + bash + b + bf + brainfuck + c + cgi + c++ + cfm + cob + conf + cp + cpp + cs + csh + css + CSS + csv + custom + cxx + def + default + do + dtd + dxf + enc + eps + err + f + f90 + fcgi + for + fs + fscript + gcc + h + hpgl + htm + HTM + html + ics + idl + inc + ini + java + javascript + js + las + lasso + latex + lgt + lisp + log + ltx + lua + m + m1s + mel + m4 + mk + mm + msl + mtl + mws + mx + mxo + mysql + njs + p + ps + pas + pch + php + php3 + php4 + phtml + pl + plist + pm + pod + postgresql + pike + pp + pro + py + python + pyw + r + rb + rc + reb + rebol + rsp + rtf + ruby + rxp + s + sgml + sh + shtm + shtml + sieve + sl + strings + sty + sps + spss + sql + SQL + st + svg + tab + tcl + tcsh + tex + text + txt + types + uue + v + vbs + vcard + vcs + verilog + vhd + vhdl + vrm + vrml + wmk + x + xhtml + xml + xsl + xslt + yaml + + CFBundleTypeIconFile + geditdoc + CFBundleTypeMIMETypes + + application/base64 + application/dxf + application/php + application/plain + application/postscript + application/rtf + application/vnd.hp-hpgl + application/x-bsh + application/x-csh + application/x-javascript + application/x-latex + application/x-meme + application/x-pointplus + application/x-rtf + application/x-seelogo + application/x-sh + application/x-shar + application/x-tcl + application/x-tex + application/x-vrml + application/xml + image/svg+xml + image/svg-xml + image/vnd.dwg + image/x-dwg + image/x-xpixmap + model/vrml + text/asp + text/calendar + text/css + text/directory + text/html + text/javascript + text/pascal + text/php + text/plain + text/richtext + text/sgml + text/vcard + text/x-asm + text/x-c + text/x-fortran + text/x-h + text/x-java-source + text/x-m + text/x-pascal + text/x-perl-script + text/x-php-script + text/x-script.csh + text/x-script.perl-module + text/x-script.perl + text/x-script.phyton + text/x-script.sh + text/x-script.tcl + text/x-script.tcsh + text/x-server-parsed-html + text/x-sgml + text/x-uuencode + text/x-vcalendar + text/x-vcard + text/xml + x-world/x-vrml + + CFBundleTypeName + Gedit Document + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Editor + + + + diff --git a/osx/Makefile.am b/osx/Makefile.am new file mode 100755 index 00000000..a22da524 --- /dev/null +++ b/osx/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = Info.plist.in + +-include $(top_srcdir)/git.mk diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am new file mode 100755 index 00000000..d7ee4616 --- /dev/null +++ b/pixmaps/Makefile.am @@ -0,0 +1,12 @@ +icondir = $(datadir)/gedit-2/icons +icon_DATA = gedit-plugin.png + +logodir = $(datadir)/gedit-2/logo +logo_DATA = gedit-logo.png + +EXTRA_DIST = \ + $(icon_DATA) \ + $(logo_DATA) \ + gedit.ico + +-include $(top_srcdir)/git.mk diff --git a/pixmaps/gedit-logo.png b/pixmaps/gedit-logo.png new file mode 100755 index 00000000..43a36bdc Binary files /dev/null and b/pixmaps/gedit-logo.png differ diff --git a/pixmaps/gedit-plugin.png b/pixmaps/gedit-plugin.png new file mode 100755 index 00000000..7f8dc8bb Binary files /dev/null and b/pixmaps/gedit-plugin.png differ diff --git a/pixmaps/gedit.ico b/pixmaps/gedit.ico new file mode 100755 index 00000000..e9b7f5c2 Binary files /dev/null and b/pixmaps/gedit.ico differ diff --git a/plugin-loaders/Makefile.am b/plugin-loaders/Makefile.am new file mode 100755 index 00000000..bf1e9647 --- /dev/null +++ b/plugin-loaders/Makefile.am @@ -0,0 +1,7 @@ +SUBDIRS = c + +if ENABLE_PYTHON +SUBDIRS += python +endif + +-include $(top_srcdir)/git.mk diff --git a/plugin-loaders/c/Makefile.am b/plugin-loaders/c/Makefile.am new file mode 100755 index 00000000..7760aefe --- /dev/null +++ b/plugin-loaders/c/Makefile.am @@ -0,0 +1,24 @@ +# C plugin loader + +loaderdir = $(libdir)/gedit-2/plugin-loaders + +INCLUDES = \ + -I$(top_srcdir) \ + $(GEDIT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) \ + -DGEDIT_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" + +loader_LTLIBRARIES = libcloader.la + +NOINST_H_FILES = \ + gedit-plugin-loader-c.h + +libcloader_la_SOURCES = \ + gedit-plugin-loader-c.c \ + $(NOINST_H_FILES) + +libcloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS) +libcloader_la_LIBADD = $(GEDIT_LIBS) + +-include $(top_srcdir)/git.mk diff --git a/plugin-loaders/c/gedit-plugin-loader-c.c b/plugin-loaders/c/gedit-plugin-loader-c.c new file mode 100755 index 00000000..37b3d059 --- /dev/null +++ b/plugin-loaders/c/gedit-plugin-loader-c.c @@ -0,0 +1,182 @@ +/* + * gedit-plugin-loader-c.c + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +#include "gedit-plugin-loader-c.h" +#include + +#define GEDIT_PLUGIN_LOADER_C_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_PLUGIN_LOADER_C, GeditPluginLoaderCPrivate)) + +struct _GeditPluginLoaderCPrivate +{ + GHashTable *loaded_plugins; +}; + +static void gedit_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data); + +GEDIT_PLUGIN_LOADER_REGISTER_TYPE (GeditPluginLoaderC, gedit_plugin_loader_c, G_TYPE_OBJECT, gedit_plugin_loader_iface_init); + + +static const gchar * +gedit_plugin_loader_iface_get_id (void) +{ + return "C"; +} + +static GeditPlugin * +gedit_plugin_loader_iface_load (GeditPluginLoader *loader, + GeditPluginInfo *info, + const gchar *path) +{ + GeditPluginLoaderC *cloader = GEDIT_PLUGIN_LOADER_C (loader); + GeditObjectModule *module; + const gchar *module_name; + GeditPlugin *result; + + module = (GeditObjectModule *)g_hash_table_lookup (cloader->priv->loaded_plugins, info); + module_name = gedit_plugin_info_get_module_name (info); + + if (module == NULL) + { + /* For now we force all modules to be resident */ + module = gedit_object_module_new (module_name, + path, + "register_gedit_plugin", + TRUE); + + /* Infos are available for all the lifetime of the loader. + * If this changes, we should use weak refs or something */ + + g_hash_table_insert (cloader->priv->loaded_plugins, info, module); + } + + if (!g_type_module_use (G_TYPE_MODULE (module))) + { + g_warning ("Could not load plugin module: %s", gedit_plugin_info_get_name (info)); + + return NULL; + } + + /* TODO: for now we force data-dir-name = module-name... if needed we can + * add a datadir field to the plugin descriptor file. + */ + result = (GeditPlugin *)gedit_object_module_new_object (module, + "install-dir", path, + "data-dir-name", module_name, + NULL); + + if (!result) + { + g_warning ("Could not create plugin object: %s", gedit_plugin_info_get_name (info)); + g_type_module_unuse (G_TYPE_MODULE (module)); + + return NULL; + } + + g_type_module_unuse (G_TYPE_MODULE (module)); + + return result; +} + +static void +gedit_plugin_loader_iface_unload (GeditPluginLoader *loader, + GeditPluginInfo *info) +{ + //GeditPluginLoaderC *cloader = GEDIT_PLUGIN_LOADER_C (loader); + + /* this is a no-op, since the type module will be properly unused as + the last reference to the plugin dies. When the plugin is activated + again, the library will be reloaded */ +} + +static void +gedit_plugin_loader_iface_init (gpointer g_iface, + gpointer iface_data) +{ + GeditPluginLoaderInterface *iface = (GeditPluginLoaderInterface *)g_iface; + + iface->get_id = gedit_plugin_loader_iface_get_id; + iface->load = gedit_plugin_loader_iface_load; + iface->unload = gedit_plugin_loader_iface_unload; +} + +static void +gedit_plugin_loader_c_finalize (GObject *object) +{ + GeditPluginLoaderC *cloader = GEDIT_PLUGIN_LOADER_C (object); + GList *infos; + GList *item; + + /* FIXME: this sanity check it's not efficient. Let's remove it + * once we are confident with the code */ + + infos = g_hash_table_get_keys (cloader->priv->loaded_plugins); + + for (item = infos; item; item = item->next) + { + GeditPluginInfo *info = (GeditPluginInfo *)item->data; + + if (gedit_plugin_info_is_active (info)) + { + g_warning ("There are still C plugins loaded during destruction"); + break; + } + } + + g_list_free (infos); + + g_hash_table_destroy (cloader->priv->loaded_plugins); + + G_OBJECT_CLASS (gedit_plugin_loader_c_parent_class)->finalize (object); +} + +static void +gedit_plugin_loader_c_class_init (GeditPluginLoaderCClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_plugin_loader_c_finalize; + + g_type_class_add_private (object_class, sizeof (GeditPluginLoaderCPrivate)); +} + +static void +gedit_plugin_loader_c_class_finalize (GeditPluginLoaderCClass *klass) +{ +} + +static void +gedit_plugin_loader_c_init (GeditPluginLoaderC *self) +{ + self->priv = GEDIT_PLUGIN_LOADER_C_GET_PRIVATE (self); + + /* loaded_plugins maps GeditPluginInfo to a GeditObjectModule */ + self->priv->loaded_plugins = g_hash_table_new (g_direct_hash, + g_direct_equal); +} + +GeditPluginLoaderC * +gedit_plugin_loader_c_new () +{ + GObject *loader = g_object_new (GEDIT_TYPE_PLUGIN_LOADER_C, NULL); + + return GEDIT_PLUGIN_LOADER_C (loader); +} diff --git a/plugin-loaders/c/gedit-plugin-loader-c.h b/plugin-loaders/c/gedit-plugin-loader-c.h new file mode 100755 index 00000000..70420546 --- /dev/null +++ b/plugin-loaders/c/gedit-plugin-loader-c.h @@ -0,0 +1,60 @@ +/* + * gedit-plugin-loader-c.h + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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 __GEDIT_PLUGIN_LOADER_C_H__ +#define __GEDIT_PLUGIN_LOADER_C_H__ + +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_PLUGIN_LOADER_C (gedit_plugin_loader_c_get_type ()) +#define GEDIT_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_PLUGIN_LOADER_C, GeditPluginLoaderC)) +#define GEDIT_PLUGIN_LOADER_C_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_PLUGIN_LOADER_C, GeditPluginLoaderC const)) +#define GEDIT_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_PLUGIN_LOADER_C, GeditPluginLoaderCClass)) +#define GEDIT_IS_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_PLUGIN_LOADER_C)) +#define GEDIT_IS_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGIN_LOADER_C)) +#define GEDIT_PLUGIN_LOADER_C_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_PLUGIN_LOADER_C, GeditPluginLoaderCClass)) + +typedef struct _GeditPluginLoaderC GeditPluginLoaderC; +typedef struct _GeditPluginLoaderCClass GeditPluginLoaderCClass; +typedef struct _GeditPluginLoaderCPrivate GeditPluginLoaderCPrivate; + +struct _GeditPluginLoaderC { + GObject parent; + + GeditPluginLoaderCPrivate *priv; +}; + +struct _GeditPluginLoaderCClass { + GObjectClass parent_class; +}; + +GType gedit_plugin_loader_c_get_type (void) G_GNUC_CONST; +GeditPluginLoaderC *gedit_plugin_loader_c_new(void); + +/* All the loaders must implement this function */ +G_MODULE_EXPORT GType register_gedit_plugin_loader (GTypeModule * module); + +G_END_DECLS + +#endif /* __GEDIT_PLUGIN_LOADER_C_H__ */ diff --git a/plugin-loaders/python/Makefile.am b/plugin-loaders/python/Makefile.am new file mode 100755 index 00000000..174d57dc --- /dev/null +++ b/plugin-loaders/python/Makefile.am @@ -0,0 +1,36 @@ +# C plugin loader + +SUBDIRS = bindings +loaderdir = $(libdir)/gedit-2/plugin-loaders + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/gedit \ + -I$(top_builddir)/gedit \ + $(GEDIT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) \ + $(PYGTK_CFLAGS) \ + $(PYTHON_CFLAGS) \ + -DGEDIT_PLUGINS_LIBS_DIR=\"$(GEDIT_PLUGINS_LIBS_DIR)\" \ + -DGEDIT_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" + +loader_LTLIBRARIES = libpythonloader.la + + +NOINST_H_FILES = \ + gedit-plugin-loader-python.h \ + gedit-plugin-python.h + +libpythonloader_la_SOURCES = \ + gedit-plugin-loader-python.c \ + gedit-plugin-python.c \ + $(NOINST_H_FILES) + +libpythonloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS) +libpythonloader_la_LIBADD = \ + $(GEDIT_LIBS) \ + bindings/gedit.la + +-include $(top_srcdir)/git.mk diff --git a/plugin-loaders/python/bindings/Makefile.am b/plugin-loaders/python/bindings/Makefile.am new file mode 100755 index 00000000..47183a55 --- /dev/null +++ b/plugin-loaders/python/bindings/Makefile.am @@ -0,0 +1,115 @@ +## Process this file with automake to produce Makefile.in + +noinst_LTLIBRARIES = \ + gedit.la + +nodist_gedit_la_SOURCES = \ + gedit.c \ + geditutils.c \ + geditcommands.c + +gedit_la_LDFLAGS = \ + -module -avoid-version + +gedit_la_LIBADD = \ + $(PYTHON_LIB_LOC) \ + $(PYTHON_LIBS) \ + $(PYTHON_EXTRA_LIBS) \ + $(PYGTK_LIBS) + +gedit_la_CFLAGS = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/gedit \ + -I$(top_builddir)/gedit \ + -I$(top_srcdir)/plugin-loaders/python \ + -I$(top_builddir)/plugin-loaders/python \ + $(GEDIT_CFLAGS) \ + $(NO_STRICT_ALIASING_CFLAGS) \ + $(PYGTK_CFLAGS) \ + $(PYTHON_CFLAGS) \ + $(AM_CFLAGS) + +$(top_builddir)/gedit/gedit-enum-types.h: + cd $(top_builddir)/gedit && $(MAKE) gedit-enum-types.h + +gedit.c: gedit.defs gedit.override geditplugin.override geditmessage.override $(top_builddir)/gedit/gedit-enum-types.h + ( cd $(srcdir) && $(PYGTK_CODEGEN) \ + --register $(PYGTK_DEFSDIR)/pango-types.defs \ + --register $(PYGTK_DEFSDIR)/gdk-types.defs \ + --register $(PYGTK_DEFSDIR)/gtk-types.defs \ + --register $(PYGTK_DEFSDIR)/gtksourceview2.defs \ + --register $(PYGOBJECT_DEFSDIR)/gio-types.defs \ + --override $*.override \ + --prefix py$* $( $@ + +geditutils.c: geditutils.defs geditutils.override + ( cd $(srcdir) && $(PYGTK_CODEGEN) \ + --override $*.override \ + --prefix py$* $( $@ + +geditcommands.c: geditcommands.defs geditcommands.override gedit.defs + ( cd $(srcdir) && $(PYGTK_CODEGEN) \ + --register gedit.defs \ + --register $(PYGTK_DEFSDIR)/gtk-types.defs \ + --override $*.override \ + --prefix py$* $( $@ + +BINDING_GEDIT_HEADERS_SRCDIR_IN = \ + gedit/gedit-app.h \ + gedit/gedit-document.h \ + gedit/gedit-encodings.h \ + gedit/gedit-plugin.h \ + plugin-loaders/python/gedit-plugin-python.h \ + gedit/gedit-view.h \ + gedit/gedit-statusbar.h \ + gedit/gedit-tab.h \ + gedit/gedit-panel.h \ + gedit/gedit-window.h \ + gedit/gedit-help.h \ + gedit/gedit-debug.h \ + gedit/gedit-message-type.h \ + gedit/gedit-message.h \ + gedit/gedit-message-bus.h \ + gedit/gedit-language-manager.h + +BINDING_UTILS_HEADERS_SRCDIR_IN = \ + gedit/gedit-utils.h + +BINDING_COMMANDS_HEADERS_SRCDIR_IN = \ + gedit/gedit-commands.h + +BINDING_HEADERS_BUILDDIR_IN = + +BINDING_GEDIT_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_GEDIT_HEADERS_SRCDIR_IN)) +BINDING_UTILS_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_UTILS_HEADERS_SRCDIR_IN)) +BINDING_COMMANDS_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_COMMANDS_HEADERS_SRCDIR_IN)) + +BINDING_HEADERS_BUILDDIR := $(addprefix $(top_builddir)/,$(BINDING_HEADERS_BUILDDIR_IN)) + +regenerate-python-binding: + $(PYGTK_H2DEF) $(sort $(BINDING_GEDIT_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > gedit.defs.new + $(PYGTK_H2DEF) $(sort $(BINDING_UTILS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > geditutils.defs.new + $(PYGTK_H2DEF) $(sort $(BINDING_COMMANDS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > geditcommands.defs.new + +BUILT_SOURCES = \ + gedit.c \ + geditutils.c \ + geditcommands.c + +EXTRA_DIST = \ + gedit.override \ + gedit.defs \ + geditutils.override \ + geditutils.defs \ + geditcommands.override \ + geditcommands.defs \ + geditmessage.override \ + geditplugin.override + +CLEANFILES = $(BUILT_SOURCES) + +dist-hook: + cd $(distdir); rm -f $(BUILT_SOURCES) + +-include $(top_srcdir)/git.mk diff --git a/plugin-loaders/python/bindings/gedit.defs b/plugin-loaders/python/bindings/gedit.defs new file mode 100755 index 00000000..1b116396 --- /dev/null +++ b/plugin-loaders/python/bindings/gedit.defs @@ -0,0 +1,1461 @@ +;; -*- scheme -*- +; object definitions ... +(define-object App + (in-module "Gedit") + (parent "GObject") + (c-name "GeditApp") + (gtype-id "GEDIT_TYPE_APP") +) + +(define-object Document + (in-module "Gedit") + (parent "GtkSourceBuffer") + (c-name "GeditDocument") + (gtype-id "GEDIT_TYPE_DOCUMENT") +) + +(define-object Message + (in-module "Gedit") + (parent "GObject") + (c-name "GeditMessage") + (gtype-id "GEDIT_TYPE_MESSAGE") +) + +(define-object MessageBus + (in-module "Gedit") + (parent "GObject") + (c-name "GeditMessageBus") + (gtype-id "GEDIT_TYPE_MESSAGE_BUS") +) + +(define-object Panel + (in-module "Gedit") + (parent "GtkVBox") + (c-name "GeditPanel") + (gtype-id "GEDIT_TYPE_PANEL") +) + +(define-object __Plugin + (in-module "Gedit") + (parent "GObject") + (c-name "GeditPlugin") + (gtype-id "GEDIT_TYPE_PLUGIN") +) + +(define-object Plugin + (in-module "Gedit") + (parent "GeditPlugin") + (c-name "GeditPluginPython") + (gtype-id "GEDIT_TYPE_PLUGIN_PYTHON") +) + +(define-object Statusbar + (in-module "Gedit") + (parent "GtkStatusbar") + (c-name "GeditStatusbar") + (gtype-id "GEDIT_TYPE_STATUSBAR") +) + +(define-object Tab + (in-module "Gedit") + (parent "GtkVBox") + (c-name "GeditTab") + (gtype-id "GEDIT_TYPE_TAB") +) + +(define-object View + (in-module "Gedit") + (parent "GtkSourceView") + (c-name "GeditView") + (gtype-id "GEDIT_TYPE_VIEW") +) + +(define-object Window + (in-module "Gedit") + (parent "GtkWindow") + (c-name "GeditWindow") + (gtype-id "GEDIT_TYPE_WINDOW") +) + +;; Enumerations and flags ... + +(define-flags LockdownMask + (in-module "Gedit") + (c-name "GeditLockdownMask") + (gtype-id "GEDIT_TYPE_LOCKDOWN_MASK") + (values + '("command-line" "GEDIT_LOCKDOWN_COMMAND_LINE") + '("printing" "GEDIT_LOCKDOWN_PRINTING") + '("print-setup" "GEDIT_LOCKDOWN_PRINT_SETUP") + '("save-to-disk" "GEDIT_LOCKDOWN_SAVE_TO_DISK") + '("all" "GEDIT_LOCKDOWN_ALL") + ) +) + +(define-flags SearchFlags + (in-module "Gedit") + (c-name "GeditSearchFlags") + (gtype-id "GEDIT_TYPE_SEARCH_FLAGS") + (values + '("dont-set-flags" "GEDIT_SEARCH_DONT_SET_FLAGS") + '("entire-word" "GEDIT_SEARCH_ENTIRE_WORD") + '("case-sensitive" "GEDIT_SEARCH_CASE_SENSITIVE") + ) +) + +(define-flags DocumentSaveFlags + (in-module "Gedit") + (c-name "GeditDocumentSaveFlags") + (gtype-id "GEDIT_TYPE_DOCUMENT_SAVE_FLAGS") + (values + '("ignore-mtime" "GEDIT_DOCUMENT_SAVE_IGNORE_MTIME") + '("ignore-backup" "GEDIT_DOCUMENT_SAVE_IGNORE_BACKUP") + '("preserve-backup" "GEDIT_DOCUMENT_SAVE_PRESERVE_BACKUP") + ) +) + +(define-enum TabState + (in-module "Gedit") + (c-name "GeditTabState") + (gtype-id "GEDIT_TYPE_TAB_STATE") + (values + '("normal" "GEDIT_TAB_STATE_NORMAL") + '("loading" "GEDIT_TAB_STATE_LOADING") + '("reverting" "GEDIT_TAB_STATE_REVERTING") + '("saving" "GEDIT_TAB_STATE_SAVING") + '("printing" "GEDIT_TAB_STATE_PRINTING") + '("print-previewing" "GEDIT_TAB_STATE_PRINT_PREVIEWING") + '("showing-print-preview" "GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW") + '("generic-not-editable" "GEDIT_TAB_STATE_GENERIC_NOT_EDITABLE") + '("loading-error" "GEDIT_TAB_STATE_LOADING_ERROR") + '("reverting-error" "GEDIT_TAB_STATE_REVERTING_ERROR") + '("saving-error" "GEDIT_TAB_STATE_SAVING_ERROR") + '("generic-error" "GEDIT_TAB_STATE_GENERIC_ERROR") + '("closing" "GEDIT_TAB_STATE_CLOSING") + ) +) + +(define-flags WindowState + (in-module "Gedit") + (c-name "GeditWindowState") + (gtype-id "GEDIT_TYPE_WINDOW_STATE") + (values + '("normal" "GEDIT_WINDOW_STATE_NORMAL") + '("saving" "GEDIT_WINDOW_STATE_SAVING") + '("printing" "GEDIT_WINDOW_STATE_PRINTING") + '("loading" "GEDIT_WINDOW_STATE_LOADING") + '("error" "GEDIT_WINDOW_STATE_ERROR") + '("saving-session" "GEDIT_WINDOW_STATE_SAVING_SESSION") + ) +) + +;; Boxed types +(define-boxed Encoding + (in-module "Gedit") + (c-name "GeditEncoding") + (gtype-id "GEDIT_TYPE_ENCODING") + (copy-func "gedit_encoding_copy") + (release-func "gedit_encoding_free") +;; (fields +;; '("gint" "index") +;; '("gchar*" "charset") +;; '("gchar*" "name") +;; ) +) + +(define-boxed MessageType + (in-module "Gedit") + (c-name "GeditMessageType") + (gtype-id "GEDIT_TYPE_MESSAGE_TYPE") + (copy-func "gedit_message_type_ref") + (release-func "gedit_message_type_unref") +) + + +;; From ../../gedit/gedit-app.h + +(define-function gedit_app_get_type + (c-name "gedit_app_get_type") + (return-type "GType") +) + +(define-function app_get_default + (c-name "gedit_app_get_default") + (return-type "GeditApp*") +) + +; deprecated version ! +(define-function gedit_app_get_default + (c-name "gedit_app_get_default_deprecated") + (return-type "GeditApp*") +) + +(define-method create_window + (of-object "GeditApp") + (c-name "gedit_app_create_window") + (return-type "GeditWindow*") + (parameters + '("GdkScreen*" "screen") + ) +) + +(define-method get_windows + (of-object "GeditApp") + (c-name "gedit_app_get_windows") + (return-type "const-GList*") +) + +(define-method get_active_window + (of-object "GeditApp") + (c-name "gedit_app_get_active_window") + (return-type "GeditWindow*") +) + +(define-method get_documents + (of-object "GeditApp") + (c-name "gedit_app_get_documents") + (return-type "GList*") +) + +(define-method get_views + (of-object "GeditApp") + (c-name "gedit_app_get_views") + (return-type "GList*") +) + +(define-method get_lockdown + (of-object "GeditApp") + (c-name "gedit_app_get_lockdown") + (return-type "GeditLockdownMask") +) + + +;; From ../../gedit/gedit-document.h + +(define-function document_error_quark + (c-name "gedit_document_error_quark") + (return-type "GQuark") +) + +(define-function gedit_document_get_type + (c-name "gedit_document_get_type") + (return-type "GType") +) + +(define-function gedit_document_new + (c-name "gedit_document_new") + (is-constructor-of "GeditDocument") + (return-type "GeditDocument*") +) + +(define-method get_location + (of-object "GeditDocument") + (c-name "gedit_document_get_location") + (return-type "GFile*") +) + +(define-method get_uri + (of-object "GeditDocument") + (c-name "gedit_document_get_uri") + (return-type "gchar*") +) + +(define-method set_uri + (of-object "GeditDocument") + (c-name "gedit_document_set_uri") + (return-type "none") + (parameters + '("const-gchar*" "uri") + ) +) + +(define-method get_uri_for_display + (of-object "GeditDocument") + (c-name "gedit_document_get_uri_for_display") + (return-type "gchar*") +) + +(define-method get_short_name_for_display + (of-object "GeditDocument") + (c-name "gedit_document_get_short_name_for_display") + (return-type "gchar*") +) + +(define-method get_content_type + (of-object "GeditDocument") + (c-name "gedit_document_get_content_type") + (return-type "gchar*") +) + +(define-method get_mime_type + (of-object "GeditDocument") + (c-name "gedit_document_get_mime_type") + (return-type "gchar*") +) + +(define-method get_readonly + (of-object "GeditDocument") + (c-name "gedit_document_get_readonly") + (return-type "gboolean") +) + +(define-method load + (of-object "GeditDocument") + (c-name "gedit_document_load") + (return-type "none") + (parameters + '("const-gchar*" "uri") + '("const-GeditEncoding*" "encoding") + '("gint" "line_pos") + '("gboolean" "create") + ) +) + +(define-method insert_file + (of-object "GeditDocument") + (c-name "gedit_document_insert_file") + (return-type "gboolean") + (parameters + '("GtkTextIter*" "iter") + '("const-gchar*" "uri") + '("const-GeditEncoding*" "encoding") + ) +) + +(define-method load_cancel + (of-object "GeditDocument") + (c-name "gedit_document_load_cancel") + (return-type "gboolean") +) + +(define-method save + (of-object "GeditDocument") + (c-name "gedit_document_save") + (parameters + '("GeditDocumentSaveFlags" "flags") + ) + (return-type "none") +) + +(define-method save_as + (of-object "GeditDocument") + (c-name "gedit_document_save_as") + (return-type "none") + (parameters + '("const-gchar*" "uri") + '("const-GeditEncoding*" "encoding") + '("GeditDocumentSaveFlags" "flags") + ) +) + +(define-method is_untouched + (of-object "GeditDocument") + (c-name "gedit_document_is_untouched") + (return-type "gboolean") +) + +(define-method is_untitled + (of-object "GeditDocument") + (c-name "gedit_document_is_untitled") + (return-type "gboolean") +) + +(define-method is_local + (of-object "GeditDocument") + (c-name "gedit_document_is_local") + (return-type "gboolean") +) + +(define-method get_deleted + (of-object "GeditDocument") + (c-name "gedit_document_get_deleted") + (return-type "gboolean") +) + +(define-method goto_line + (of-object "GeditDocument") + (c-name "gedit_document_goto_line") + (return-type "gboolean") + (parameters + '("gint" "line") + ) +) + +(define-method set_search_text + (of-object "GeditDocument") + (c-name "gedit_document_set_search_text") + (return-type "none") + (parameters + '("const-gchar*" "text") + '("guint" "flags") + ) +) + +(define-method get_search_text + (of-object "GeditDocument") + (c-name "gedit_document_get_search_text") + (return-type "gchar*") + (parameters + '("guint*" "flags") + ) +) + +(define-method get_can_search_again + (of-object "GeditDocument") + (c-name "gedit_document_get_can_search_again") + (return-type "gboolean") +) + +(define-method search_forward + (of-object "GeditDocument") + (c-name "gedit_document_search_forward") + (return-type "gboolean") + (parameters + '("const-GtkTextIter*" "start") + '("const-GtkTextIter*" "end") + '("GtkTextIter*" "match_start") + '("GtkTextIter*" "match_end") + ) +) + +(define-method replace_all + (of-object "GeditDocument") + (c-name "gedit_document_replace_all") + (return-type "gint") + (parameters + '("const-gchar*" "find") + '("const-gchar*" "replace") + '("guint" "flags") + ) +) + +(define-method search_backward + (of-object "GeditDocument") + (c-name "gedit_document_search_backward") + (return-type "gboolean") + (parameters + '("const-GtkTextIter*" "start") + '("const-GtkTextIter*" "end") + '("GtkTextIter*" "match_start") + '("GtkTextIter*" "match_end") + ) +) + +(define-method set_language + (of-object "GeditDocument") + (c-name "gedit_document_set_language") + (return-type "none") + (parameters + '("GtkSourceLanguage*" "lang" (null-ok)) + ) +) + +(define-method get_language + (of-object "GeditDocument") + (c-name "gedit_document_get_language") + (return-type "GtkSourceLanguage*") +) + +(define-method get_encoding + (of-object "GeditDocument") + (c-name "gedit_document_get_encoding") + (return-type "const-GeditEncoding*") +) + +(define-method set_enable_search_highlighting + (of-object "GeditDocument") + (c-name "gedit_document_set_enable_search_highlighting") + (return-type "none") + (parameters + '("gboolean" "enable") + ) +) + +(define-method get_enable_search_highlighting + (of-object "GeditDocument") + (c-name "gedit_document_get_enable_search_highlighting") + (return-type "gboolean") +) + +;; From ../../gedit/gedit-encodings.h + +(define-function gedit_encoding_get_type + (c-name "gedit_encoding_get_type") + (return-type "GType") +) + +(define-method copy + (of-object "GeditEncoding") + (c-name "gedit_encoding_copy") + (return-type "GeditEncoding*") +) + +(define-method free + (of-object "GeditEncoding") + (c-name "gedit_encoding_free") + (return-type "none") +) + +(define-function encoding_get_from_charset + (c-name "gedit_encoding_get_from_charset") + (return-type "const-GeditEncoding*") + (parameters + '("const-gchar*" "charset") + ) +) + +; Deprecated version ! +(define-function gedit_encoding_get_from_charset + (c-name "gedit_encoding_get_from_charset_deprecated") + (return-type "const-GeditEncoding*") + (parameters + '("const-gchar*" "charset") + ) +) + +(define-function encoding_get_from_index + (c-name "gedit_encoding_get_from_index") + (return-type "const-GeditEncoding*") + (parameters + '("gint" "index") + ) +) + +; Deprecated version ! +(define-function gedit_encoding_get_from_index + (c-name "gedit_encoding_get_from_index_deprecated") + (return-type "const-GeditEncoding*") + (parameters + '("gint" "index") + ) +) + +(define-method to_string + (of-object "GeditEncoding") + (c-name "gedit_encoding_to_string") + (return-type "gchar*") +) + +(define-method get_name + (of-object "GeditEncoding") + (c-name "gedit_encoding_get_name") + (return-type "const-gchar*") +) + +(define-method get_charset + (of-object "GeditEncoding") + (c-name "gedit_encoding_get_charset") + (return-type "const-gchar*") +) + +(define-function encoding_get_utf8 + (c-name "gedit_encoding_get_utf8") + (return-type "const-GeditEncoding*") +) + +; Deprecated version ! +(define-function gedit_encoding_get_utf8 + (c-name "gedit_encoding_get_utf8_deprecated") + (return-type "const-GeditEncoding*") +) + +(define-function encoding_get_current + (c-name "gedit_encoding_get_current") + (return-type "const-GeditEncoding*") +) + +; Deprecated version ! +(define-function gedit_encoding_get_current + (c-name "gedit_encoding_get_current_deprecated") + (return-type "const-GeditEncoding*") +) + +;; From ../../gedit/gedit-help.h + +(define-function help_display + (c-name "gedit_help_display") + (return-type "gboolean") + (parameters + '("GtkWindow*" "parent") + '("const-gchar*" "name") + '("const-gchar*" "link_id") + ) +) + + + +;; From ../../gedit/gedit-panel.h + +(define-function gedit_panel_get_type + (c-name "gedit_panel_get_type") + (return-type "GType") +) + +(define-function gedit_panel_new + (c-name "gedit_panel_new") + (is-constructor-of "GeditPanel") + (return-type "GtkWidget*") +) + +(define-method add_item + (of-object "GeditPanel") + (c-name "gedit_panel_add_item") + (return-type "none") + (parameters + '("GtkWidget*" "item") + '("const-gchar*" "name") + '("GtkWidget*" "image") + ) +) + +(define-method add_item_with_stock_icon + (of-object "GeditPanel") + (c-name "gedit_panel_add_item_with_stock_icon") + (return-type "none") + (parameters + '("GtkWidget*" "item") + '("const-gchar*" "name") + '("const-gchar*" "stock_id") + ) +) + +(define-method remove_item + (of-object "GeditPanel") + (c-name "gedit_panel_remove_item") + (return-type "gboolean") + (parameters + '("GtkWidget*" "item") + ) +) + +(define-method activate_item + (of-object "GeditPanel") + (c-name "gedit_panel_activate_item") + (return-type "gboolean") + (parameters + '("GtkWidget*" "item") + ) +) + +(define-method item_is_active + (of-object "GeditPanel") + (c-name "gedit_panel_item_is_active") + (return-type "gboolean") + (parameters + '("GtkWidget*" "item") + ) +) + +(define-method get_orientation + (of-object "GeditPanel") + (c-name "gedit_panel_get_orientation") + (return-type "GtkOrientation") +) + +(define-method get_n_items + (of-object "GeditPanel") + (c-name "gedit_panel_get_n_items") + (return-type "gint") +) + + +;; From ../../gedit/gedit-plugin.h + +(define-function gedit_plugin_get_type + (c-name "gedit_plugin_get_type") + (return-type "GType") +) + +(define-method get_install_dir + (of-object "GeditPlugin") + (c-name "gedit_plugin_get_install_dir") + (return-type "gchar*") +) + +(define-method get_data_dir + (of-object "GeditPlugin") + (c-name "gedit_plugin_get_data_dir") + (return-type "gchar*") +) + +(define-method activate + (of-object "GeditPlugin") + (c-name "gedit_plugin_activate") + (return-type "none") + (parameters + '("GeditWindow*" "window") + ) +) + +(define-method deactivate + (of-object "GeditPlugin") + (c-name "gedit_plugin_deactivate") + (return-type "none") + (parameters + '("GeditWindow*" "window") + ) +) + +(define-method update_ui + (of-object "GeditPlugin") + (c-name "gedit_plugin_update_ui") + (return-type "none") + (parameters + '("GeditWindow*" "window") + ) +) + +(define-method is_configurable + (of-object "GeditPlugin") + (c-name "gedit_plugin_is_configurable") + (return-type "gboolean") +) + +(define-method create_configure_dialog + (of-object "GeditPlugin") + (c-name "gedit_plugin_create_configure_dialog") + (return-type "GtkWidget*") +) + +;; From ../gedit/gedit-plugin-python.h + +(define-function gedit_plugin_python_get_type + (c-name "gedit_plugin_python_get_type") + (return-type "GType") +) + +(define-function gedit_plugin_python_new + (c-name "gedit_plugin_python_new") + (is-constructor-of "GeditPluginPython") + (return-type "GeditPluginPython*") +) + +;; From ../../gedit/gedit-status-bar.h + +(define-method flash_message + (of-object "GeditStatusbar") + (c-name "gedit_statusbar_flash_message") + (return-type "none") + (parameters + '("int" "context_id") + '("const-gchar*" "message") + ) + ) + +;; From ../../gedit/gedit-tab.h + +(define-function gedit_tab_get_type + (c-name "gedit_tab_get_type") + (return-type "GType") +) + +(define-method get_view + (of-object "GeditTab") + (c-name "gedit_tab_get_view") + (return-type "GeditView*") +) + +(define-method get_document + (of-object "GeditTab") + (c-name "gedit_tab_get_document") + (return-type "GeditDocument*") +) + +(define-function tab_get_from_document + (c-name "gedit_tab_get_from_document") + (return-type "GeditTab*") + (parameters + '("GeditDocument*" "doc") + ) +) + +; Deprecated version ! +(define-function gedit_tab_get_from_document + (c-name "gedit_tab_get_from_document_deprecated") + (return-type "GeditTab*") + (parameters + '("GeditDocument*" "doc") + ) +) + +(define-method get_state + (of-object "GeditTab") + (c-name "gedit_tab_get_state") + (return-type "GeditTabState") +) + +(define-method set_auto_save_enabled + (of-object "GeditTab") + (c-name "gedit_tab_set_auto_save_enabled") + (return-type "none") + (parameters + '("gboolean" "enable") + ) +) + +(define-method get_auto_save_enabled + (of-object "GeditTab") + (c-name "gedit_tab_get_auto_save_enabled") + (return-type "gboolean") +) + +(define-method set_auto_save_interval + (of-object "GeditTab") + (c-name "gedit_tab_set_auto_save_interval") + (return-type "none") + (parameters + '("gint" "interval") + ) +) + +(define-method get_auto_save_interval + (of-object "GeditTab") + (c-name "gedit_tab_get_auto_save_interval") + (return-type "gint") +) + +;; From ../../gedit/gedit-view.h + +(define-function gedit_view_get_type + (c-name "gedit_view_get_type") + (return-type "GtkType") +) + +(define-function gedit_view_new + (c-name "gedit_view_new") + (is-constructor-of "GeditView") + (return-type "GtkWidget*") + (parameters + '("GeditDocument*" "doc") + ) +) + +(define-method cut_clipboard + (of-object "GeditView") + (c-name "gedit_view_cut_clipboard") + (return-type "none") +) + +(define-method copy_clipboard + (of-object "GeditView") + (c-name "gedit_view_copy_clipboard") + (return-type "none") +) + +(define-method paste_clipboard + (of-object "GeditView") + (c-name "gedit_view_paste_clipboard") + (return-type "none") +) + +(define-method delete_selection + (of-object "GeditView") + (c-name "gedit_view_delete_selection") + (return-type "none") +) + +(define-method select_all + (of-object "GeditView") + (c-name "gedit_view_select_all") + (return-type "none") +) + +(define-method scroll_to_cursor + (of-object "GeditView") + (c-name "gedit_view_scroll_to_cursor") + (return-type "none") +) + +(define-method set_font + (of-object "GeditView") + (c-name "gedit_view_set_font") + (return-type "none") + (parameters + '("gboolean" "def") + '("const-gchar*" "font_name") + ) +) + + + +;; From ../../gedit/gedit-window.h + +(define-function gedit_window_get_type + (c-name "gedit_window_get_type") + (return-type "GType") +) + +(define-method create_tab + (of-object "GeditWindow") + (c-name "gedit_window_create_tab") + (return-type "GeditTab*") + (parameters + '("gboolean" "jump_to") + ) +) + +(define-method create_tab_from_uri + (of-object "GeditWindow") + (c-name "gedit_window_create_tab_from_uri") + (return-type "GeditTab*") + (parameters + '("const-gchar*" "uri") + '("const-GeditEncoding*" "encoding" (null-ok)) + '("gint" "line_pos") + '("gboolean" "create") + '("gboolean" "jump_to") + ) +) + +(define-method close_tab + (of-object "GeditWindow") + (c-name "gedit_window_close_tab") + (return-type "none") + (parameters + '("GeditTab*" "tab") + ) +) + +(define-method close_tabs + (of-object "GeditWindow") + (c-name "gedit_window_close_tabs") + (return-type "none") + (parameters + '("const-GList*" "tabs") + ) +) + +(define-method close_all_tabs + (of-object "GeditWindow") + (c-name "gedit_window_close_all_tabs") + (return-type "none") +) + +(define-method get_active_tab + (of-object "GeditWindow") + (c-name "gedit_window_get_active_tab") + (return-type "GeditTab*") +) + +(define-method set_active_tab + (of-object "GeditWindow") + (c-name "gedit_window_set_active_tab") + (return-type "none") + (parameters + '("GeditTab*" "tab") + ) +) + +(define-method get_active_view + (of-object "GeditWindow") + (c-name "gedit_window_get_active_view") + (return-type "GeditView*") +) + +(define-method get_active_document + (of-object "GeditWindow") + (c-name "gedit_window_get_active_document") + (return-type "GeditDocument*") +) + +(define-method get_documents + (of-object "GeditWindow") + (c-name "gedit_window_get_documents") + (return-type "GList*") +) + +(define-method get_unsaved_documents + (of-object "GeditWindow") + (c-name "gedit_window_get_unsaved_documents") + (return-type "GList*") +) + +(define-method get_views + (of-object "GeditWindow") + (c-name "gedit_window_get_views") + (return-type "GList*") +) + +(define-method get_group + (of-object "GeditWindow") + (c-name "gedit_window_get_group") + (return-type "GtkWindowGroup*") +) + +(define-method get_side_panel + (of-object "GeditWindow") + (c-name "gedit_window_get_side_panel") + (return-type "GeditPanel*") +) + +(define-method get_bottom_panel + (of-object "GeditWindow") + (c-name "gedit_window_get_bottom_panel") + (return-type "GeditPanel*") +) + +(define-method get_statusbar + (of-object "GeditWindow") + (c-name "gedit_window_get_statusbar") + (return-type "GtkWidget*") +) + +(define-method get_ui_manager + (of-object "GeditWindow") + (c-name "gedit_window_get_ui_manager") + (return-type "GtkUIManager*") +) + +(define-method get_state + (of-object "GeditWindow") + (c-name "gedit_window_get_state") + (return-type "GeditWindowState") +) + +(define-method get_message_bus + (of-object "GeditWindow") + (c-name "gedit_window_get_message_bus") + (return-type "GeditMessageBus*") +) + +(define-method get_tab_from_uri + (of-object "GeditWindow") + (c-name "gedit_window_get_tab_from_uri") + (return-type "GeditTab*") + (parameters + '("const-gchar*" "uri") + ) +) + +;; From gedit-language-manager.h + +(define-function get_language_manager + (c-name "gedit_get_language_manager") + (return-type "GtkSourceLanguageManager*") +) + +(define-function language_manager_list_languages_sorted + (c-name "gedit_language_manager_list_languages_sorted") + (return-type "GSList*") + (parameters + '("GtkSourceLanguageManager*" "lm") + '("gboolean" "include_hidden") + ) +) + + +;; From gedit-message-bus.h + +(define-function gedit_message_bus_get_type + (c-name "gedit_message_bus_get_type") + (return-type "GType") +) + +(define-function message_bus_get_default + (c-name "gedit_message_bus_get_default") + (return-type "GeditMessageBus*") +) + +(define-function gedit_message_bus_new + (c-name "gedit_message_bus_new") + (is-constructor-of "GeditMessageBus") + (return-type "GeditMessageBus*") +) + +(define-method lookup + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_lookup") + (return-type "GeditMessageType*") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + ) +) + +(define-method register + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_register") + (return-type "GeditMessageType*") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + '("guint" "num_optional") + ) + (varargs #t) +) + +(define-method unregister + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_unregister") + (return-type "none") + (parameters + '("GeditMessageType*" "message_type") + ) +) + +(define-method unregister_all + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_unregister_all") + (return-type "none") + (parameters + '("const-gchar*" "object_path") + ) +) + +(define-method is_registered + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_is_registered") + (return-type "gboolean") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + ) +) + +(define-method connect + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_connect") + (return-type "guint") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + '("GeditMessageCallback" "callback") + '("gpointer" "userdata") + '("GDestroyNotify" "destroy_data") + ) +) + +(define-method disconnect + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_disconnect") + (return-type "none") + (parameters + '("guint" "id") + ) +) + +(define-method disconnect_by_func + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_disconnect_by_func") + (return-type "none") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + '("GeditMessageCallback" "callback") + '("gpointer" "userdata") + ) +) + +(define-method block + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_block") + (return-type "none") + (parameters + '("guint" "id") + ) +) + +(define-method block_by_func + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_block_by_func") + (return-type "none") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + '("GeditMessageCallback" "callback") + '("gpointer" "userdata") + ) +) + +(define-method unblock + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_unblock") + (return-type "none") + (parameters + '("guint" "id") + ) +) + +(define-method unblock_by_func + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_unblock_by_func") + (return-type "none") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + '("GeditMessageCallback" "callback") + '("gpointer" "userdata") + ) +) + +(define-method send_message + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_send_message") + (return-type "none") + (parameters + '("GeditMessage*" "message") + ) +) + +(define-method send_message_sync + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_send_message_sync") + (return-type "none") + (parameters + '("GeditMessage*" "message") + ) +) + +(define-method send + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_send") + (return-type "none") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + ) + (varargs #t) +) + +(define-method send_sync + (of-object "GeditMessageBus") + (c-name "gedit_message_bus_send_sync") + (return-type "GeditMessage*") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + ) + (varargs #t) +) + + +;; From gedit-message-type.h + +(define-function gedit_message_type_get_type + (c-name "gedit_message_type_get_type") + (return-type "GType") +) + +(define-function gedit_message_type_is_supported + (c-name "gedit_message_type_is_supported") + (return-type "gboolean") + (parameters + '("GType" "type") + ) +) + +(define-function gedit_message_type_identifier + (c-name "gedit_message_type_identifier") + (return-type "gchar*") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + ) +) + +(define-function gedit_message_type_new + (c-name "gedit_message_type_new") + (is-constructor-of "GeditMessageType") + (return-type "GeditMessageType*") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + '("guint" "num_optional") + ) + (varargs #t) +) + +(define-function gedit_message_type_new_valist + (c-name "gedit_message_type_new_valist") + (return-type "GeditMessageType*") + (parameters + '("const-gchar*" "object_path") + '("const-gchar*" "method") + '("guint" "num_optional") + '("va_list" "va_args") + ) +) + +(define-method ref + (of-object "GeditMessageType") + (c-name "gedit_message_type_ref") + (return-type "GeditMessageType*") +) + +(define-method unref + (of-object "GeditMessageType") + (c-name "gedit_message_type_unref") + (return-type "none") +) + +(define-method instantiate_valist + (of-object "GeditMessageType") + (c-name "gedit_message_type_instantiate_valist") + (return-type "GeditMessage*") + (parameters + '("va_list" "va_args") + ) +) + +(define-method instantiate + (of-object "GeditMessageType") + (c-name "gedit_message_type_instantiate") + (return-type "GeditMessage*") + (parameters + ) + (varargs #t) +) + +(define-method get_object_path + (of-object "GeditMessageType") + (c-name "gedit_message_type_get_object_path") + (return-type "const-gchar*") +) + +(define-method get_method + (of-object "GeditMessageType") + (c-name "gedit_message_type_get_method") + (return-type "const-gchar*") +) + +(define-method lookup + (of-object "GeditMessageType") + (c-name "gedit_message_type_lookup") + (return-type "GType") + (parameters + '("const-gchar*" "key") + ) +) + +(define-method foreach + (of-object "GeditMessageType") + (c-name "gedit_message_type_foreach") + (return-type "none") + (parameters + '("GeditMessageTypeForeach" "func") + '("gpointer" "user_data") + ) +) + + +;; From gedit-message.h + +(define-function gedit_message_get_type + (c-name "gedit_message_get_type") + (return-type "GType") +) + +(define-method get + (of-object "GeditMessage") + (c-name "gedit_message_get") + (return-type "none") + (parameters + ) + (varargs #t) +) + +(define-method get_valist + (of-object "GeditMessage") + (c-name "gedit_message_get_valist") + (return-type "none") + (parameters + '("va_list" "var_args") + ) +) + +(define-method get_value + (of-object "GeditMessage") + (c-name "gedit_message_get_value") + (return-type "none") + (parameters + '("const-gchar*" "key") + '("GValue*" "value") + ) +) + +(define-method set + (of-object "GeditMessage") + (c-name "gedit_message_set") + (return-type "none") + (parameters + ) + (varargs #t) +) + +(define-method set_valist + (of-object "GeditMessage") + (c-name "gedit_message_set_valist") + (return-type "none") + (parameters + '("va_list" "var_args") + ) +) + +(define-method set_value + (of-object "GeditMessage") + (c-name "gedit_message_set_value") + (return-type "none") + (parameters + '("const-gchar*" "key") + '("GValue*" "value") + ) +) + +(define-method set_valuesv + (of-object "GeditMessage") + (c-name "gedit_message_set_valuesv") + (return-type "none") + (parameters + '("const-gchar**" "keys") + '("GValue*" "values") + '("gint" "n_values") + ) +) + +(define-method get_object_path + (of-object "GeditMessage") + (c-name "gedit_message_get_object_path") + (return-type "const-gchar*") +) + +(define-method get_method + (of-object "GeditMessage") + (c-name "gedit_message_get_method") + (return-type "const-gchar*") +) + +(define-method has_key + (of-object "GeditMessage") + (c-name "gedit_message_has_key") + (return-type "gboolean") + (parameters + '("const-gchar*" "key") + ) +) + +(define-method get_key_type + (of-object "GeditMessage") + (c-name "gedit_message_get_key_type") + (return-type "GType") + (parameters + '("const-gchar*" "key") + ) +) + +(define-method validate + (of-object "GeditMessage") + (c-name "gedit_message_validate") + (return-type "gboolean") +) + + +;; From ../../gedit/gedit-debug.h + +(define-function debug + (c-name "gedit_debug") + (parameters + '("const-gchar*" "message") + ) + (return-type "none") +) + diff --git a/plugin-loaders/python/bindings/gedit.override b/plugin-loaders/python/bindings/gedit.override new file mode 100755 index 00000000..52c492a4 --- /dev/null +++ b/plugin-loaders/python/bindings/gedit.override @@ -0,0 +1,461 @@ +%% +headers +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gedit-plugin-python.h" + +void pygedit_register_classes (PyObject *d); +void pygedit_add_constants (PyObject *module, const gchar *strip_prefix); + +static PyObject * +_helper_wrap_gobject_glist (const GList *list) +{ + PyObject *py_list; + const GList *tmp; + + if ((py_list = PyList_New(0)) == NULL) { + return NULL; + } + for (tmp = list; tmp != NULL; tmp = tmp->next) { + PyObject *py_obj = pygobject_new(G_OBJECT(tmp->data)); + + if (py_obj == NULL) { + Py_DECREF(py_list); + return NULL; + } + PyList_Append(py_list, py_obj); + Py_DECREF(py_obj); + } + return py_list; +} + +static PyObject * +_helper_wrap_gobject_gslist (const GSList *list) +{ + PyObject *py_list; + const GSList *tmp; + + if ((py_list = PyList_New(0)) == NULL) { + return NULL; + } + for (tmp = list; tmp != NULL; tmp = tmp->next) { + PyObject *py_obj = pygobject_new(G_OBJECT(tmp->data)); + + if (py_obj == NULL) { + Py_DECREF(py_list); + return NULL; + } + PyList_Append(py_list, py_obj); + Py_DECREF(py_obj); + } + return py_list; +} +%% +include + geditplugin.override + geditmessage.override +%% +modulename gedit +%% +import gtk.Widget as PyGtkWidget_Type +import gobject.GObject as PyGObject_Type +import gtk.gdk.Screen as PyGdkScreen_Type +import gtk.VBox as PyGtkVBox_Type +import gtk.Window as PyGtkWindow_Type +import gtk.Image as PyGtkImage_Type +import gtk.Statusbar as PyGtkStatusbar_Type +import gtksourceview2.Buffer as PyGtkSourceBuffer_Type +import gtksourceview2.View as PyGtkSourceView_Type +import gtksourceview2.Language as PyGtkSourceLanguage_Type +import gtksourceview2.LanguageManager as PyGtkSourceLanguageManager_Type +%% +ignore-glob + *_get_type + gedit_document_error_quark + gedit_panel_add_item_with_stock_icon +%% +override gedit_app_create_window kwargs +static PyObject * +_wrap_gedit_app_create_window(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "screen", NULL}; + PyGObject *screen = NULL; + GeditWindow *ret; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "|O!", kwlist, + &PyGdkScreen_Type, &screen)) + return NULL; + + ret = gedit_app_create_window(GEDIT_APP(self->obj), + screen ? GDK_SCREEN(screen->obj) : NULL); + + /* pygobject_new handles NULL checking */ + return pygobject_new((GObject *)ret); +} +%% +override gedit_app_get_windows +static PyObject * +_wrap_gedit_app_get_windows(PyGObject *self) +{ + const GList *list; + PyObject *py_list; + + list = gedit_app_get_windows (GEDIT_APP (self->obj)); + + py_list = _helper_wrap_gobject_glist (list); + + return py_list; +} +%% +override gedit_app_get_views +static PyObject * +_wrap_gedit_app_get_views(PyGObject *self) +{ + GList *list; + PyObject *py_list; + + list = gedit_app_get_views (GEDIT_APP (self->obj)); + + py_list = _helper_wrap_gobject_glist (list); + + g_list_free (list); + + return py_list; +} +%% +override gedit_app_get_documents +static PyObject * +_wrap_gedit_app_get_documents(PyGObject *self) +{ + GList *list; + PyObject *py_list; + + list = gedit_app_get_documents (GEDIT_APP (self->obj)); + + py_list = _helper_wrap_gobject_glist (list); + + g_list_free (list); + + return py_list; +} +%% +override gedit_window_get_documents +static PyObject * +_wrap_gedit_window_get_documents(PyGObject *self) +{ + GList *list; + PyObject *py_list; + + list = gedit_window_get_documents (GEDIT_WINDOW (self->obj)); + + py_list = _helper_wrap_gobject_glist (list); + + g_list_free(list); + + return py_list; +} +%% +override gedit_window_get_unsaved_documents +static PyObject * +_wrap_gedit_window_get_unsaved_documents(PyGObject *self) +{ + GList *list; + PyObject *py_list; + + list = gedit_window_get_unsaved_documents (GEDIT_WINDOW (self->obj)); + + py_list = _helper_wrap_gobject_glist (list); + + g_list_free(list); + + return py_list; +} +%% +override gedit_window_get_views +static PyObject * +_wrap_gedit_window_get_views(PyGObject *self) +{ + GList *list; + PyObject *py_list; + + list = gedit_window_get_views (GEDIT_WINDOW (self->obj)); + + py_list = _helper_wrap_gobject_glist (list); + + g_list_free(list); + + return py_list; +} +%% +override gedit_window_close_tabs kwargs +static PyObject * +_wrap_gedit_window_close_tabs (PyGObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "tabs", NULL }; + PyObject *list, *item; + GList *glist = NULL; + int len, i; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O:GeditWindow.close_tabs", kwlist, + &list)) + return NULL; + + if (!PySequence_Check (list)) + { + PyErr_SetString (PyExc_TypeError, + "first argument must be a sequence"); + return NULL; + } + + len = PySequence_Length (list); + + for (i = 0; i < len; i++) + { + item = PySequence_GetItem (list, i); + Py_DECREF(item); + + if (!pygobject_check (item, &PyGeditTab_Type)) + { + PyErr_SetString (PyExc_TypeError, + "sequence item not a Gtkwidget object"); + g_list_free (glist); + return NULL; + } + + glist = g_list_append (glist, pygobject_get (item)); + } + + gedit_window_close_tabs (GEDIT_WINDOW (self->obj), glist); + + g_list_free (glist); + Py_INCREF (Py_None); + return Py_None; +} +%% +override gedit_document_get_search_text +static PyObject * +_wrap_gedit_document_get_search_text(PyGObject *self) +{ + PyObject *tuple, *string; + guint flags; + gchar *ret; + + ret = gedit_document_get_search_text (GEDIT_DOCUMENT (self->obj), &flags); + + tuple = PyTuple_New(2); + if (ret) { + string = PyString_FromString(ret); + PyTuple_SetItem(tuple, 0, string); + } else { + Py_INCREF(Py_None); + PyTuple_SetItem(tuple, 0, Py_None); + } + PyTuple_SetItem(tuple, 1, PyInt_FromLong(flags)); + + g_free(ret); + + return tuple; +} +%% +override gedit_panel_add_item kwargs +static PyObject * +_wrap_gedit_panel_add_item(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist1[] = { "item", "name", "image", NULL }; + static char *kwlist2[] = { "item", "name", "stock_id", NULL }; + PyGObject *item, *image; + char *name = NULL; + char *stock_id = NULL; + + if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!sO!:GeditPanel.add_item", kwlist1, &PyGtkWidget_Type, &item, &name, &PyGtkImage_Type, &image)) { + gedit_panel_add_item(GEDIT_PANEL(self->obj), GTK_WIDGET(item->obj), name, GTK_WIDGET(image->obj)); + Py_INCREF(Py_None); + return Py_None; + } + + PyErr_Clear(); + + if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!ss:GeditPanel.add_item", kwlist2, &PyGtkWidget_Type, &item, &name, &stock_id)) { + gedit_panel_add_item_with_stock_icon(GEDIT_PANEL(self->obj), GTK_WIDGET(item->obj), name, stock_id); + Py_INCREF(Py_None); + return Py_None; + } + + PyErr_Clear(); + PyErr_SetString(PyExc_TypeError, "the last arg should be either a gtk.Image or a stock_id string"); + return NULL; +} +%% +override gedit_app_get_default_deprecated +/* deprecated wrappers */ +static PyObject * +_wrap_gedit_app_get_default_deprecated(PyObject *self) +{ + if (PyErr_Warn(PyExc_DeprecationWarning, "use gedit.app_get_default instead") < 0) + return NULL; + return _wrap_gedit_app_get_default(self); +} +%% +override gedit_encoding_get_from_charset_deprecated kwargs +static PyObject * +_wrap_gedit_encoding_get_from_charset_deprecated(PyObject *self, PyObject *args, PyObject *kwargs) +{ + if (PyErr_Warn(PyExc_DeprecationWarning, "use gedit.encoding_get_from_charset instead") < 0) + return NULL; + return _wrap_gedit_encoding_get_from_charset(self, args, kwargs); +} +%% +override gedit_encoding_get_from_index_deprecated kwargs +static PyObject * +_wrap_gedit_encoding_get_from_index_deprecated(PyObject *self, PyObject *args, PyObject *kwargs) +{ + if (PyErr_Warn(PyExc_DeprecationWarning, "use gedit.encoding_get_from_index instead") < 0) + return NULL; + return _wrap_gedit_encoding_get_from_index(self, args, kwargs); +} +%% +override gedit_encoding_get_utf8_deprecated +static PyObject * +_wrap_gedit_encoding_get_utf8_deprecated(PyObject *self) +{ + if (PyErr_Warn(PyExc_DeprecationWarning, "use gedit.encoding_get_utf8 instead") < 0) + return NULL; + return _wrap_gedit_encoding_get_utf8(self); +} +%% +override gedit_encoding_get_current_deprecated +static PyObject * +_wrap_gedit_encoding_get_current_deprecated(PyObject *self) +{ + if (PyErr_Warn(PyExc_DeprecationWarning, "use gedit.encoding_get_current instead") < 0) + return NULL; + return _wrap_gedit_encoding_get_current(self); +} +%% +override gedit_tab_get_from_document_deprecated kwargs +static PyObject * +_wrap_gedit_tab_get_from_document_deprecated(PyObject *self, PyObject *args, PyObject *kwargs) +{ + if (PyErr_Warn(PyExc_DeprecationWarning, "use gedit.tab_get_from_document instead") < 0) + return NULL; + return _wrap_gedit_tab_get_from_document(self, args, kwargs); +} +%% +override gedit_language_manager_list_languages_sorted kwargs +static PyObject * +_wrap_gedit_language_manager_list_languages_sorted(PyObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "lm", "include_hidden", NULL }; + PyGObject *lm; + int include_hidden; + PyObject *py_list; + GSList *list; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O!i:language_manager_list_languages_sorted", + kwlist, &PyGtkSourceLanguageManager_Type, &lm, + &include_hidden)) + return NULL; + + list = gedit_language_manager_list_languages_sorted (GTK_SOURCE_LANGUAGE_MANAGER (lm->obj), + include_hidden); + + py_list = _helper_wrap_gobject_gslist (list); + + g_slist_free (list); + + return py_list; +} +%% +override gedit_debug kwargs +static PyObject * +_wrap_gedit_debug(PyObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "message", NULL }; + PyObject *traceback_module, *mdict, *func, *traceback, *tuple; + PyObject *filename, *lineno, *funcname; + char *message = NULL; + + if (g_getenv ("GEDIT_DEBUG_PLUGINS") == NULL) + { + Py_INCREF (Py_None); + return Py_None; + } + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "|s", kwlist, &message)) + return NULL; + + traceback_module = PyImport_ImportModule ("traceback"); + if (traceback_module == NULL) + { + g_warning ("traceback module cannot be imported"); + Py_INCREF (Py_None); + return Py_None; + } + + mdict = PyModule_GetDict (traceback_module); + func = PyDict_GetItemString (mdict, "extract_stack"); + traceback = PyObject_CallFunction (func, "zi", NULL, 1); + tuple = PyList_GetItem (traceback, 0); + + if (tuple == NULL || !PyTuple_Check (tuple)) + { + g_warning ("traceback tuple is null!"); + } + else + { + filename = PyTuple_GetItem (tuple, 0); + lineno = PyTuple_GetItem (tuple, 1); + funcname = PyTuple_GetItem (tuple, 2); + + if (message == NULL) + gedit_debug (GEDIT_DEBUG_PLUGINS, + PyString_AsString (filename), + PyInt_AsLong (lineno), + PyString_AsString (funcname)); + else + gedit_debug_message (GEDIT_DEBUG_PLUGINS, + PyString_AsString (filename), + PyInt_AsLong (lineno), + PyString_AsString (funcname), + "%s", + message); + } + Py_DECREF (traceback); + Py_DECREF (traceback_module); + + Py_INCREF (Py_None); + return Py_None; +} +%% +override gedit_statusbar_flash_message kwargs +static PyObject * +_wrap_gedit_statusbar_flash_message(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "context_id", "message", NULL }; + int context_id; + char *message; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs,"is:GeditStatusbar.flash_message", kwlist, &context_id, &message)) + return NULL; + + gedit_statusbar_flash_message(GEDIT_STATUSBAR(self->obj), context_id, "%s", message); + + Py_INCREF(Py_None); + return Py_None; +} +%% diff --git a/plugin-loaders/python/bindings/geditcommands.defs b/plugin-loaders/python/bindings/geditcommands.defs new file mode 100755 index 00000000..3808fa43 --- /dev/null +++ b/plugin-loaders/python/bindings/geditcommands.defs @@ -0,0 +1,45 @@ +;; -*- scheme -*- +; object definitions ... +;; Enumerations and flags ... + + +;; From ../../gedit/gedit-commands.h + +(define-function load_uri + (c-name "gedit_commands_load_uri") + (return-type "none") + (parameters + '("GeditWindow*" "window") + '("const-gchar*" "uri") + '("const-GeditEncoding*" "encoding") + '("gint" "line_pos") + ) +) + +(define-function load_uris + (c-name "gedit_commands_load_uris") + (return-type "gint") + (parameters + '("GeditWindow*" "window") + '("const-GSList*" "uris") + '("const-GeditEncoding*" "encoding") + '("gint" "line_pos") + ) +) + +(define-function save_document + (c-name "gedit_commands_save_document") + (return-type "none") + (parameters + '("GeditWindow*" "window") + '("GeditDocument*" "document") + ) +) + +(define-function save_all_documents + (c-name "gedit_commands_save_all_documents") + (return-type "none") + (parameters + '("GeditWindow*" "window") + ) +) diff --git a/plugin-loaders/python/bindings/geditcommands.override b/plugin-loaders/python/bindings/geditcommands.override new file mode 100755 index 00000000..a81f9181 --- /dev/null +++ b/plugin-loaders/python/bindings/geditcommands.override @@ -0,0 +1,122 @@ +%% +headers +#define NO_IMPORT_PYGOBJECT +#define NO_IMPORT_PYGTK +#include +#include + +#include "gedit-commands.h" +#include "gedit-window.h" + +void pygeditcommands_register_classes (PyObject *d); +void pygeditcommands_add_constants (PyObject *module, const gchar *strip_prefix); + +%% +modulename gedit.commands +%% +import gedit.Window as PyGeditWindow_Type +import gedit.Document as PyGeditDocument_Type +%% +ignore-glob + _* +%% +override gedit_commands_load_uri kwargs +static PyObject * +_wrap_gedit_commands_load_uri (PyObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "window", "uri", "encoding", "line_pos", NULL }; + PyGObject *window; + char *uri; + int line_pos = 0; + PyObject *py_encoding = NULL; + GeditEncoding *encoding = NULL; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!s|Oi:load_uri", + kwlist, &PyGeditWindow_Type, + &window, &uri, &py_encoding, + &line_pos)) + return NULL; + + if (py_encoding != NULL && py_encoding != Py_None) + { + if (pyg_boxed_check (py_encoding, GEDIT_TYPE_ENCODING)) + encoding = pyg_boxed_get (py_encoding, GeditEncoding); + else + { + PyErr_SetString (PyExc_TypeError, + "encoding should be a GeditEncoding"); + return NULL; + } + } + + gedit_commands_load_uri (GEDIT_WINDOW (window->obj), uri, encoding, + line_pos); + Py_INCREF (Py_None); + return Py_None; +} +%% +override gedit_commands_load_uris kwargs +static PyObject * +_wrap_gedit_commands_load_uris (PyObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "window", "uris", "encoding", "line_pos", NULL }; + PyGObject *window; + GSList *uris = NULL; + int line_pos = 0; + PyObject *py_encoding = NULL; + PyObject *list; + PyObject *item; + GeditEncoding *encoding = NULL; + int len; + int i; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!O|Oi:load_uri", + kwlist, &PyGeditWindow_Type, + &window, &list, &py_encoding, + &line_pos)) + return NULL; + + if (py_encoding != NULL && py_encoding != Py_None) + { + if (pyg_boxed_check (py_encoding, GEDIT_TYPE_ENCODING)) + encoding = pyg_boxed_get (py_encoding, GeditEncoding); + else { + PyErr_SetString (PyExc_TypeError, + "encoding should be a GeditEncoding"); + return NULL; + } + } + + if (!PySequence_Check (list)) + { + PyErr_SetString (PyExc_TypeError, + "second argument must be a sequence"); + return NULL; + } + + len = PySequence_Length (list); + + for (i = 0; i < len; i++) + { + item = PySequence_GetItem (list, i); + Py_DECREF (item); + + if (!PyString_Check (item)) + { + PyErr_SetString (PyExc_TypeError, + "sequence item not a string"); + g_slist_free (uris); + return NULL; + } + + uris = g_slist_prepend (uris, PyString_AsString (item)); + } + + uris = g_slist_reverse (uris); + gedit_commands_load_uris (GEDIT_WINDOW (window->obj), uris, + encoding, line_pos); + g_slist_free (uris); + + Py_INCREF (Py_None); + return Py_None; +} diff --git a/plugin-loaders/python/bindings/geditmessage.override b/plugin-loaders/python/bindings/geditmessage.override new file mode 100755 index 00000000..244d60ce --- /dev/null +++ b/plugin-loaders/python/bindings/geditmessage.override @@ -0,0 +1,556 @@ +%% +headers + +#include +#include + +static GType +_helper_wrap_get_gtype_from_pytype (PyObject *pytype) +{ + PyTypeObject *type = (PyTypeObject *)pytype; + + if (type == &PyList_Type || type == &PyTuple_Type) + return G_TYPE_STRV; + + return pyg_type_from_object (pytype); +} + +static gchar * +_helper_wrap_get_string (PyObject *obj) +{ + PyObject *str; + gchar *result; + + str = PyObject_Str (obj); + + if (!str) + return NULL; + + result = g_strdup (PyString_AsString (str)); + Py_DECREF (str); + + return result; +} + +static int +_helper_wrap_list_to_gvalue (GValue *gvalue, PyObject *pyvalue) +{ + int num; + gchar **lst; + gint i; + + num = PySequence_Size (pyvalue); + lst = g_new0 (gchar *, num + 1); + + for (i = 0; i < num; i++) + { + lst[i] = _helper_wrap_get_string (PySequence_GetItem (pyvalue, i)); + + if (lst[i] == NULL) + { + g_strfreev (lst); + return 1; + } + } + + g_value_set_boxed (gvalue, lst); + g_strfreev (lst); + + return 0; +} + +static int +_helper_wrap_get_gvalue_from_pyobject (GValue *gvalue, PyObject *pyvalue) +{ + if (pyvalue->ob_type == &PyList_Type || pyvalue->ob_type == &PyTuple_Type) + return _helper_wrap_list_to_gvalue (gvalue, pyvalue); + + return pyg_value_from_pyobject(gvalue, pyvalue); +} + +static int +_helper_wrap_message_set_value(GeditMessage *message, PyObject *pykey, PyObject *pyvalue) +{ + gchar *key; + GType gtype; + GValue value = {0,}; + + key = _helper_wrap_get_string(pykey); + + if (key == NULL) + return 0; + + gtype = gedit_message_get_key_type(message, key); + + if (gtype == 0) { + PyErr_SetString(PyExc_TypeError, "invalid key"); + g_free (key); + return 0; + } + + g_value_init(&value, gtype); + + if (_helper_wrap_get_gvalue_from_pyobject (&value, pyvalue)) { + PyErr_SetString(PyExc_TypeError, + "value is of the wrong type for this key"); + g_free (key); + return 0; + } + + gedit_message_set_value(message, key, &value); + g_value_unset(&value); + g_free (key); + + return 1; +} + +typedef void (*ParsePairFunc)(PyObject *key, PyObject *value, gpointer user_data); + +static void +_helper_parse_pairs_dict (PyObject *dict, ParsePairFunc func, gpointer user_data) +{ + if (!dict) + return; + + PyObject *key, *value; + Py_ssize_t i = 0; + + while (PyDict_Next(dict, &i, &key, &value)) + { + func(key, value, user_data); + } +} + +static void +_helper_parse_pairs(PyObject *args, PyObject *kwargs, ParsePairFunc func, gpointer user_data) +{ + guint len; + guint i; + + len = PyTuple_Size(args); + + for (i = 0; i < len; ++i) + { + PyObject *d = PyTuple_GetItem(args, i); + + if (PyDict_Check(d)) + _helper_parse_pairs_dict(d, func, user_data); + } + + _helper_parse_pairs_dict(kwargs, func, user_data); +} + +static void +_helper_message_set(PyObject *key, PyObject *value, GeditMessage *message) +{ + _helper_wrap_message_set_value(message, key, value); +} + +static void +_helper_message_set_values(GeditMessage *message, PyObject *args, PyObject *kwargs) +{ + _helper_parse_pairs(args, kwargs, (ParsePairFunc)_helper_message_set, message); +} + +static GeditMessage * +_helper_wrap_create_message(GeditMessageBus *bus, PyObject *args, PyObject *kwargs) +{ + PyObject *pypath, *pymethod, *pydict; + + if (!PyArg_ParseTuple(args, "OO|O:GeditMessage.create", &pypath, &pymethod, &pydict)) + return NULL; + + gchar *object_path = _helper_wrap_get_string(pypath); + gchar *method = _helper_wrap_get_string(pymethod); + + GeditMessageType *message_type = gedit_message_bus_lookup (bus, object_path, method); + GeditMessage *message; + + if (message_type) + { + message = gedit_message_type_instantiate(message_type, NULL); + _helper_message_set_values(message, args, kwargs); + } + else + { + PyErr_SetString(PyExc_StandardError, "Message type does not exist"); + message = NULL; + } + + g_free(object_path); + g_free(method); + + return message; +} + +typedef struct { + PyObject *func; + PyObject *data; +} PyGeditCustomNotify; + +static void +pygedit_custom_destroy_notify(gpointer user_data) +{ + PyGeditCustomNotify *cunote = user_data; + PyGILState_STATE state; + + g_return_if_fail(user_data); + state = pyg_gil_state_ensure(); + Py_XDECREF(cunote->func); + Py_XDECREF(cunote->data); + pyg_gil_state_release(state); + + g_free(cunote); +} +%% +ignore-glob + *_get_type + gedit_message_type_foreach + gedit_message_type_instantiate_valist + gedit_message_type_new_valist + gedit_message_get_valist + gedit_message_set_valist + gedit_message_set_valuesv + gedit_message_bus_disconnect_by_func + gedit_message_bus_block_by_func + gedit_message_bus_unblock_by_func +%% +override gedit_message_type_new kwargs + +typedef struct +{ + GeditMessageType *message_type; + PyObject *optional; +} MessageTypeSetInfo; + +static void +_message_type_set(PyObject *key, PyObject *value, MessageTypeSetInfo *info) +{ + GType gtype; + + gchar *k = _helper_wrap_get_string(key); + + if (!k) + return; + + gtype = _helper_wrap_get_gtype_from_pytype(value); + + gboolean optional = info->optional && PySequence_Contains(info->optional, key); + + gedit_message_type_set(info->message_type, optional, k, gtype, NULL); + g_free(k); +} + +static int +_wrap_gedit_message_type_new(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + PyObject *pypath, *pymethod, *optional = NULL, *pydict; + + if (!PyArg_ParseTuple(args, "OO|OO:GeditMessageType.new", &pypath, &pymethod, &optional, &pydict)) + return -1; + + GeditMessageType *message_type = GEDIT_MESSAGE_TYPE(g_object_new(pyg_type_from_object((PyObject *) self), NULL)); + + MessageTypeSetInfo info = {message_type, optional && PySequence_Check(optional) ? optional : NULL}; + _helper_parse_pairs (args, kwargs, (ParsePairFunc)_message_type_set, &info); + + self->obj = (GObject *)message_type; + pygobject_register_wrapper((PyObject *) self); + + return 0; +} +%% +override gedit_message_type_instantiate kwargs +static PyObject * +_wrap_gedit_message_type_instantiate(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + GeditMessageType *message_type = GEDIT_MESSAGE_TYPE (self->obj); + GeditMessage *message = gedit_message_type_instantiate(message_type, NULL); + + _helper_message_set_values(message, args, kwargs); + + return pygobject_new((GObject *)message); +} +%% +override gedit_message_get args +static PyObject * +_wrap_gedit_message_get(PyGObject *self, PyObject *args) +{ + guint len, i; + PyObject *ret; + + len = PyTuple_Size(args); + + ret = PyTuple_New(len); + + for (i = 0; i < len; i++) { + GValue value = { 0, }; + PyObject *py_key = PyTuple_GetItem(args, i); + gchar *key = _helper_wrap_get_string(py_key); + + if (!key) { + PyErr_SetString(PyExc_TypeError, "keys must be strings"); + Py_DECREF(ret); + return NULL; + } + + gedit_message_get_value (GEDIT_MESSAGE (self->obj), key, &value); + g_free (key); + + PyTuple_SetItem(ret, i, pyg_value_as_pyobject(&value, TRUE)); + g_value_unset(&value); + } + + return ret; +} +%% +override gedit_message_get_value kwargs +static PyObject * +_wrap_gedit_message_get_value(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "key", NULL }; + const gchar *key; + PyObject *ret; + GValue value = { 0, }; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:GeditMessage.get_value", kwlist, &key)) + return NULL; + + gedit_message_get_value(GEDIT_MESSAGE(self->obj), key, &value); + ret = pyg_value_as_pyobject(&value, TRUE); + g_value_unset(&value); + + return ret; +} +%% +override gedit_message_set_value kwargs +static PyObject * +_wrap_gedit_message_set_value(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "key", "value", NULL }; + PyObject *pykey, *pyvalue; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:GeditMessage.set_value", kwlist, &pykey, &pyvalue)) + return NULL; + + if (!_helper_wrap_message_set_value(GEDIT_MESSAGE(self->obj), pykey, pyvalue)) + return NULL; + + Py_INCREF(Py_None); + return Py_None; +} +%% +override gedit_message_set kwargs +static PyObject * +_wrap_gedit_message_set (PyGObject *self, PyObject *args, PyObject *kwargs) { + _helper_message_set_values(GEDIT_MESSAGE(self->obj), args, kwargs); + + Py_INCREF(Py_None); + return Py_None; +} +%% +override gedit_message_bus_new +static int +_wrap_gedit_message_bus_new(PyGObject *self) +{ + pygobject_construct (self, NULL); + + if (!self->obj) { + PyErr_SetString (PyExc_RuntimeError, "could not create gedit.MessageBus object"); + return -1; + } + + return 0; +} +%% +new-constructor GEDIT_TYPE_MESSAGE_BUS +%% +override gedit_message_bus_register kwargs +static PyObject * +_wrap_gedit_message_bus_register(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + PyObject *pypath, *pymethod, *optional = NULL, *pydict; + GeditMessageBus *bus = GEDIT_MESSAGE_BUS(self->obj); + + if (!PyArg_ParseTuple(args, "OO|OO:GeditMessageBus.register", &pypath, &pymethod, &optional, &pydict)) + return NULL; + + gchar *object_path = _helper_wrap_get_string(pypath); + gchar *method = _helper_wrap_get_string(pymethod); + + GeditMessageType *message_type = gedit_message_bus_register(bus, object_path, method, 0, NULL); + + g_free(object_path); + g_free(method); + + if (!message_type) + { + PyErr_SetString(PyExc_StandardError, "Message type already exists"); + return NULL; + } + + MessageTypeSetInfo info = {message_type, optional && PySequence_Check(optional) ? optional : NULL}; + _helper_parse_pairs (args, kwargs, (ParsePairFunc)_message_type_set, &info); + + return pyg_boxed_new(GEDIT_TYPE_MESSAGE_TYPE, message_type, TRUE, TRUE); +} +%% +override gedit_message_bus_connect kwargs +static void +pygedit_message_bus_connect_cb(GeditMessageBus *bus, GeditMessage *message, gpointer data) +{ + PyGILState_STATE state; + PyGeditCustomNotify *cunote = data; + PyObject *pybus, *pymessage, *retobj; + + g_assert(cunote->func); + + state = pyg_gil_state_ensure(); + + pybus = pygobject_new((GObject *)bus); + pymessage = pygobject_new((GObject *)message); + + if (cunote->data) { + retobj = PyEval_CallFunction(cunote->func, "(NNO)", pybus, pymessage, cunote->data); + } else { + retobj = PyEval_CallFunction(cunote->func, "(NN)", pybus, pymessage); + } + + if (PyErr_Occurred()) { + PyErr_Print(); + } + + Py_XDECREF(retobj); + + pyg_gil_state_release(state); +} + +static PyObject * +_wrap_gedit_message_bus_connect(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "domain", "name", "func", "data", NULL }; + PyObject *pyfunc, *pyarg = NULL; + const gchar *domain; + const gchar *name; + PyGeditCustomNotify *cunote; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "ssO|O:GeditMessageBus.connect", + kwlist, &domain, &name, &pyfunc, &pyarg)) + return NULL; + + if (!PyCallable_Check(pyfunc)) { + PyErr_SetString(PyExc_TypeError, "func must be a callable object"); + return NULL; + } + cunote = g_new(PyGeditCustomNotify, 1); + Py_INCREF(pyfunc); + cunote->func = pyfunc; + Py_XINCREF(pyarg); + cunote->data = pyarg; + + guint id = gedit_message_bus_connect(GEDIT_MESSAGE_BUS(self->obj), + domain, + name, + pygedit_message_bus_connect_cb, + (gpointer)cunote, + pygedit_custom_destroy_notify); + return PyLong_FromUnsignedLong(id); +} +%% +override gedit_message_bus_send kwargs +static PyObject * +_wrap_gedit_message_bus_send(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + /* create a new message object */ + GeditMessage *message; + GeditMessageBus *bus = GEDIT_MESSAGE_BUS(self->obj); + message = _helper_wrap_create_message(bus, args, kwargs); + + if (!message) + return NULL; + + gedit_message_bus_send_message(bus, message); + g_object_unref (message); + + Py_INCREF(Py_None); + return Py_None; +} +%% +override gedit_message_bus_send_sync kwargs +static PyObject * +_wrap_gedit_message_bus_send_sync(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + /* create a new message object */ + GeditMessage *message; + GeditMessageBus *bus = GEDIT_MESSAGE_BUS(self->obj); + + message = _helper_wrap_create_message(bus, args, kwargs); + + if (!message) + return NULL; + + gedit_message_bus_send_message_sync(bus, message); + return pygobject_new((GObject *)message); +} +%% +override-slot GeditMessage.tp_getattro +static PyObject * +_wrap_gedit_message_tp_getattro(PyObject *self, PyObject *attrname) +{ + GeditMessage *message = GEDIT_MESSAGE(((PyGObject *)self)->obj); + GeditMessageType *type; + + gchar *name = _helper_wrap_get_string (attrname); + gboolean exists; + gboolean intype; + PyObject *ret; + + if (name == NULL) + { + PyErr_SetString(PyExc_TypeError, "attr name somehow not a string"); + return NULL; + } + + g_object_get (message, "type", &type, NULL); + intype = gedit_message_type_lookup (type, name) != G_TYPE_INVALID; + gedit_message_type_unref (type); + + exists = gedit_message_has_key (message, name); + + if (!intype) + { + ret = PyObject_GenericGetAttr(self, attrname); + } + else if (exists) + { + GValue value = { 0, }; + gedit_message_get_value (message, name, &value); + ret = pyg_value_as_pyobject(&value, TRUE); + g_value_unset (&value); + } + else + { + Py_INCREF(Py_None); + ret = Py_None; + } + + g_free (name); + return ret; +} +%% +override-slot GeditMessage.tp_setattro +static int +_wrap_gedit_message_tp_setattro(PyObject *self, PyObject *attrname, PyObject *value) +{ + GeditMessage *message = GEDIT_MESSAGE(((PyGObject *)self)->obj); + + if (!_helper_wrap_message_set_value(message, attrname, value)) + { + return PyObject_GenericSetAttr(self, attrname, value); + } + else + { + return 1; + } +} diff --git a/plugin-loaders/python/bindings/geditplugin.override b/plugin-loaders/python/bindings/geditplugin.override new file mode 100755 index 00000000..178ea997 --- /dev/null +++ b/plugin-loaders/python/bindings/geditplugin.override @@ -0,0 +1,193 @@ +%% +headers +#include +#include +%% +override gedit_plugin_activate kwargs +static PyObject * +_wrap_gedit_plugin_activate(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + gpointer klass, klass2; + static char *kwlist[] = { "window", NULL }; + PyGObject *window; + PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type); + + if (!PyArg_ParseTupleAndKeywords (args, + kwargs, + "O!:GeditPlugin.activate", + kwlist, + &PyGeditWindow_Type, + &window)) + return NULL; + + klass = g_type_class_ref (pyg_type_from_object (cls)); + + if (GEDIT_IS_PLUGIN_PYTHON_CLASS (klass)) + { + klass2 = g_type_class_peek_parent (klass); + g_type_class_unref (klass); + klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2)); + } + + if (GEDIT_PLUGIN_CLASS (klass)->activate) + GEDIT_PLUGIN_CLASS (klass)->activate (GEDIT_PLUGIN (self->obj), + GEDIT_WINDOW (window->obj)); + else { + PyErr_SetString (PyExc_NotImplementedError, + "virtual method GeditPlugin.activate not implemented"); + g_type_class_unref (klass); + return NULL; + } + + g_type_class_unref (klass); + Py_INCREF(Py_None); + return Py_None; +} + +%% +override gedit_plugin_deactivate kwargs +static PyObject * +_wrap_gedit_plugin_deactivate(PyGObject *self, PyObject *args, PyObject *kwargs) +{ + gpointer klass, klass2; + static char *kwlist[] = {"window", NULL}; + PyGObject *window; + PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type); + + if (!PyArg_ParseTupleAndKeywords (args, + kwargs, + "O!:GeditPlugin.deactivate", + kwlist, + &PyGeditWindow_Type, + &window)) + return NULL; + + klass = g_type_class_ref (pyg_type_from_object (cls)); + + if (GEDIT_IS_PLUGIN_PYTHON_CLASS (klass)) + { + klass2 = g_type_class_peek_parent (klass); + g_type_class_unref (klass); + klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2)); + } + + if (GEDIT_PLUGIN_CLASS (klass)->deactivate) + GEDIT_PLUGIN_CLASS (klass)->deactivate (GEDIT_PLUGIN (self->obj), + GEDIT_WINDOW (window->obj)); + else { + PyErr_SetString (PyExc_NotImplementedError, + "virtual method GeditPlugin.deactivate not implemented"); + g_type_class_unref (klass); + return NULL; + } + + g_type_class_unref (klass); + Py_INCREF(Py_None); + return Py_None; +} + +%% +override gedit_plugin_update_ui kwargs +static PyObject * +_wrap_gedit_plugin_update_ui (PyGObject *self, PyObject *args, PyObject *kwargs) +{ + gpointer klass, klass2; + static char *kwlist[] = {"window", NULL}; + PyGObject *window; + PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type); + + if (!PyArg_ParseTupleAndKeywords (args, + kwargs, + "O!:GeditPlugin.update_ui", + kwlist, + &PyGeditWindow_Type, + &window)) + return NULL; + + klass = g_type_class_ref (pyg_type_from_object (cls)); + + if (GEDIT_IS_PLUGIN_PYTHON_CLASS (klass)) + { + klass2 = g_type_class_peek_parent (klass); + g_type_class_unref (klass); + klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2)); + } + + if (GEDIT_PLUGIN_CLASS (klass)->update_ui) + GEDIT_PLUGIN_CLASS (klass)->update_ui (GEDIT_PLUGIN (self->obj), + GEDIT_WINDOW (window->obj)); + else { + PyErr_SetString (PyExc_NotImplementedError, + "virtual method GeditPlugin.update_ui not implemented"); + g_type_class_unref (klass); + return NULL; + } + + g_type_class_unref (klass); + Py_INCREF(Py_None); + return Py_None; +} + +%% +override gedit_plugin_is_configurable +static PyObject * +_wrap_gedit_plugin_is_configurable (PyGObject *self) +{ + int ret; + gpointer klass, klass2; + PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type); + + klass = g_type_class_ref (pyg_type_from_object (cls)); + + if (GEDIT_IS_PLUGIN_PYTHON_CLASS (klass)) + { + klass2 = g_type_class_peek_parent (klass); + g_type_class_unref (klass); + klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2)); + } + + if (GEDIT_PLUGIN_CLASS (klass)->is_configurable) + ret = GEDIT_PLUGIN_CLASS (klass)->is_configurable (GEDIT_PLUGIN (self->obj)); + else { + PyErr_SetString (PyExc_NotImplementedError, + "virtual method GeditPlugin.is_configurable not implemented"); + g_type_class_unref (klass); + return NULL; + } + + g_type_class_unref (klass); + return PyBool_FromLong (ret); +} + +%% +override gedit_plugin_configure_dialog +static PyObject * +_wrap_gedit_plugin_create_configure_dialog (PyGObject *self) +{ + GtkWidget *ret; + gpointer klass, klass2; + PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type); + + klass = g_type_class_ref(pyg_type_from_object (cls)); + + if (GEDIT_IS_PLUGIN_PYTHON_CLASS (klass)) + { + klass2 = g_type_class_peek_parent (klass); + g_type_class_unref (klass); + klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2)); + } + + if (GEDIT_PLUGIN_CLASS (klass)->create_configure_dialog) + ret = GEDIT_PLUGIN_CLASS (klass)->create_configure_dialog (GEDIT_PLUGIN (self->obj)); + else { + PyErr_SetString (PyExc_NotImplementedError, + "virtual method GeditPlugin.create_configure_dialog not implemented"); + g_type_class_unref (klass); + return NULL; + } + + g_type_class_unref (klass); + + /* pygobject_new handles NULL checking */ + return pygobject_new ((GObject *)ret); +} diff --git a/plugin-loaders/python/bindings/geditutils.defs b/plugin-loaders/python/bindings/geditutils.defs new file mode 100755 index 00000000..3482f21c --- /dev/null +++ b/plugin-loaders/python/bindings/geditutils.defs @@ -0,0 +1,67 @@ +;; -*- scheme -*- + +;; From ../../gedit/gedit-utils.h + +(define-function uri_has_writable_scheme + (c-name "gedit_utils_uri_has_writable_scheme") + (return-type "gboolean") + (parameters + '("const-gchar*" "uri") + ) +) + +(define-function uri_has_file_scheme + (c-name "gedit_utils_uri_has_file_scheme") + (return-type "gboolean") + (parameters + '("const-gchar*" "uri") + ) +) + +(define-function uri_exists + (c-name "gedit_utils_uri_exists") + (return-type "gboolean") + (parameters + '("const-gchar*" "text_uri") + ) +) + +(define-function uri_is_valid + (c-name "gedit_utils_is_valid_uri") + (return-type "gboolean") + (parameters + '("const-gchar*" "uri") + ) +) + +(define-function uri_get_dirname + (c-name "gedit_utils_uri_get_dirname") + (return-type "gchar*") + (parameters + '("const-char*" "uri") + ) +) + +(define-function menu_position_under_widget + (c-name "gedit_utils_menu_position_under_widget") + (return-type "none") + (parameters + '("GtkMenu*" "menu") + '("gint*" "x") + '("gint*" "y") + '("gboolean*" "push_in") + '("gpointer" "user_data") + ) +) + +(define-function menu_position_under_tree_view + (c-name "gedit_utils_menu_position_under_tree_view") + (return-type "none") + (parameters + '("GtkMenu*" "menu") + '("gint*" "x") + '("gint*" "y") + '("gboolean*" "push_in") + '("gpointer" "user_data") + ) +) diff --git a/plugin-loaders/python/bindings/geditutils.override b/plugin-loaders/python/bindings/geditutils.override new file mode 100755 index 00000000..a7bf7fbe --- /dev/null +++ b/plugin-loaders/python/bindings/geditutils.override @@ -0,0 +1,85 @@ +%% +headers +#define NO_IMPORT_PYGOBJECT +#define NO_IMPORT_PYGTK +#include +#include + +#include "gedit-utils.h" + +void pygeditutils_register_classes (PyObject *d); +void pygeditutils_add_constants (PyObject *module, const gchar *strip_prefix); + +%% +modulename gedit.utils +%% +import gtk.Widget as PyGtkWidget_Type +import gtk.TreeView as PyGtkTreeView_Type +import gtk.Menu as PyGtkMenu_Type +%% +ignore-glob + _* +%% +override gedit_utils_menu_position_under_widget kwargs +static PyObject * +_wrap_gedit_utils_menu_position_under_widget (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "menu", "widget", NULL }; + PyObject *py_menu, *py_widget; + GtkMenu *menu; + GtkWidget *widget; + gint x, y; + gboolean push_in; + PyObject *tuple; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O!O!", kwlist, + &PyGtkMenu_Type, &py_menu, + &PyGtkWidget_Type, &py_widget)) + return NULL; + + menu = GTK_MENU (pygobject_get (py_menu)); + widget = GTK_WIDGET (pygobject_get (py_widget)); + + gedit_utils_menu_position_under_widget (menu, &x, &y, &push_in, widget); + + tuple = PyTuple_New (3); + PyTuple_SetItem (tuple, 0, PyInt_FromLong (x)); + PyTuple_SetItem (tuple, 1, PyInt_FromLong (y)); + PyTuple_SetItem (tuple, 2, PyBool_FromLong (push_in)); + return tuple; +} +%% +override gedit_utils_menu_position_under_tree_view kwargs +static PyObject * +_wrap_gedit_utils_menu_position_under_tree_view (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "menu", "tree_view", NULL }; + PyObject *py_menu, *py_view; + GtkMenu *menu; + GtkTreeView *view; + gint x, y; + gboolean push_in; + PyObject *tuple; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O!O!", kwlist, + &PyGtkMenu_Type, &py_menu, + &PyGtkTreeView_Type, &py_view)) + return NULL; + + menu = GTK_MENU (pygobject_get (py_menu)); + view = GTK_TREE_VIEW (pygobject_get (py_view)); + + gedit_utils_menu_position_under_widget (menu, &x, &y, &push_in, view); + + tuple = PyTuple_New (3); + PyTuple_SetItem (tuple, 0, PyInt_FromLong (x)); + PyTuple_SetItem (tuple, 1, PyInt_FromLong (y)); + PyTuple_SetItem (tuple, 2, PyBool_FromLong (push_in)); + return tuple; +} diff --git a/plugin-loaders/python/gedit-plugin-loader-python.c b/plugin-loaders/python/gedit-plugin-loader-python.c new file mode 100755 index 00000000..7a9c8d18 --- /dev/null +++ b/plugin-loaders/python/gedit-plugin-loader-python.c @@ -0,0 +1,719 @@ +/* + * gedit-plugin-loader-python.c + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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. + */ + +#include "gedit-plugin-loader-python.h" +#include "gedit-plugin-python.h" +#include + +#define NO_IMPORT_PYGOBJECT +#define NO_IMPORT_PYGTK + +#include +#include +#include +#include +#include "config.h" + +#if PY_VERSION_HEX < 0x02050000 +typedef int Py_ssize_t; +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#endif + +#define GEDIT_PLUGIN_LOADER_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_PLUGIN_LOADER_PYTHON, GeditPluginLoaderPythonPrivate)) + +struct _GeditPluginLoaderPythonPrivate +{ + GHashTable *loaded_plugins; + guint idle_gc; + gboolean init_failed; +}; + +typedef struct +{ + PyObject *type; + PyObject *instance; + gchar *path; +} PythonInfo; + +static void gedit_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data); + +/* Exported by pygedit module */ +void pygedit_register_classes (PyObject *d); +void pygedit_add_constants (PyObject *module, const gchar *strip_prefix); +extern PyMethodDef pygedit_functions[]; + +/* Exported by pygeditutils module */ +void pygeditutils_register_classes (PyObject *d); +extern PyMethodDef pygeditutils_functions[]; + +/* Exported by pygeditcommands module */ +void pygeditcommands_register_classes (PyObject *d); +extern PyMethodDef pygeditcommands_functions[]; + +/* We retreive this to check for correct class hierarchy */ +static PyTypeObject *PyGeditPlugin_Type; + +GEDIT_PLUGIN_LOADER_REGISTER_TYPE (GeditPluginLoaderPython, gedit_plugin_loader_python, G_TYPE_OBJECT, gedit_plugin_loader_iface_init); + + +static PyObject * +find_python_plugin_type (GeditPluginInfo *info, + PyObject *pymodule) +{ + PyObject *locals, *key, *value; + Py_ssize_t pos = 0; + + locals = PyModule_GetDict (pymodule); + + while (PyDict_Next (locals, &pos, &key, &value)) + { + if (!PyType_Check(value)) + continue; + + if (PyObject_IsSubclass (value, (PyObject*) PyGeditPlugin_Type)) + return value; + } + + g_warning ("No GeditPlugin derivative found in Python plugin '%s'", + gedit_plugin_info_get_name (info)); + return NULL; +} + +static GeditPlugin * +new_plugin_from_info (GeditPluginLoaderPython *loader, + GeditPluginInfo *info) +{ + PythonInfo *pyinfo; + PyTypeObject *pytype; + PyObject *pyobject; + PyGObject *pygobject; + GeditPlugin *instance; + PyObject *emptyarg; + + pyinfo = (PythonInfo *)g_hash_table_lookup (loader->priv->loaded_plugins, info); + + if (pyinfo == NULL) + return NULL; + + pytype = (PyTypeObject *)pyinfo->type; + + if (pytype->tp_new == NULL) + return NULL; + + emptyarg = PyTuple_New(0); + pyobject = pytype->tp_new (pytype, emptyarg, NULL); + Py_DECREF (emptyarg); + + if (pyobject == NULL) + { + g_error ("Could not create instance for %s.", gedit_plugin_info_get_name (info)); + return NULL; + } + + pygobject = (PyGObject *)pyobject; + + if (pygobject->obj != NULL) + { + Py_DECREF (pyobject); + g_error ("Could not create instance for %s (GObject already initialized).", gedit_plugin_info_get_name (info)); + return NULL; + } + + pygobject_construct (pygobject, + "install-dir", pyinfo->path, + "data-dir-name", gedit_plugin_info_get_module_name (info), + NULL); + + if (pygobject->obj == NULL) + { + g_error ("Could not create instance for %s (GObject not constructed).", gedit_plugin_info_get_name (info)); + Py_DECREF (pyobject); + + return NULL; + } + + /* now call tp_init manually */ + if (PyType_IsSubtype (pyobject->ob_type, pytype) && + pyobject->ob_type->tp_init != NULL) + { + emptyarg = PyTuple_New(0); + pyobject->ob_type->tp_init (pyobject, emptyarg, NULL); + Py_DECREF (emptyarg); + } + + instance = GEDIT_PLUGIN (pygobject->obj); + pyinfo->instance = (PyObject *)pygobject; + + /* make sure to register the python instance for the GeditPluginPython + object to it can wrap the virtual gedit plugin funcs back to python */ + _gedit_plugin_python_set_instance (GEDIT_PLUGIN_PYTHON (instance), (PyObject *)pygobject); + + /* we return a reference here because the other is owned by python */ + return GEDIT_PLUGIN (g_object_ref (instance)); +} + +static GeditPlugin * +add_python_info (GeditPluginLoaderPython *loader, + GeditPluginInfo *info, + PyObject *module, + const gchar *path, + PyObject *type) +{ + PythonInfo *pyinfo; + + pyinfo = g_new (PythonInfo, 1); + pyinfo->path = g_strdup (path); + pyinfo->type = type; + + Py_INCREF (pyinfo->type); + + g_hash_table_insert (loader->priv->loaded_plugins, info, pyinfo); + + return new_plugin_from_info (loader, info); +} + +static const gchar * +gedit_plugin_loader_iface_get_id (void) +{ + return "Python"; +} + +static GeditPlugin * +gedit_plugin_loader_iface_load (GeditPluginLoader *loader, + GeditPluginInfo *info, + const gchar *path) +{ + GeditPluginLoaderPython *pyloader = GEDIT_PLUGIN_LOADER_PYTHON (loader); + PyObject *main_module, *main_locals, *pytype; + PyObject *pymodule, *fromlist; + gchar *module_name; + GeditPlugin *result; + + if (pyloader->priv->init_failed) + { + g_warning ("Cannot load python plugin Python '%s' since gedit was" + "not able to initialize the Python interpreter.", + gedit_plugin_info_get_name (info)); + return NULL; + } + + /* see if py definition for the plugin is already loaded */ + result = new_plugin_from_info (pyloader, info); + + if (result != NULL) + return result; + + main_module = PyImport_AddModule ("gedit.plugins"); + if (main_module == NULL) + { + g_warning ("Could not get gedit.plugins."); + return NULL; + } + + /* If we have a special path, we register it */ + if (path != NULL) + { + PyObject *sys_path = PySys_GetObject ("path"); + PyObject *pypath = PyString_FromString (path); + + if (PySequence_Contains (sys_path, pypath) == 0) + PyList_Insert (sys_path, 0, pypath); + + Py_DECREF (pypath); + } + + main_locals = PyModule_GetDict (main_module); + + /* we need a fromlist to be able to import modules with a '.' in the + name. */ + fromlist = PyTuple_New(0); + module_name = g_strdup (gedit_plugin_info_get_module_name (info)); + + pymodule = PyImport_ImportModuleEx (module_name, + main_locals, + main_locals, + fromlist); + + Py_DECREF(fromlist); + + if (!pymodule) + { + g_free (module_name); + PyErr_Print (); + return NULL; + } + + PyDict_SetItemString (main_locals, module_name, pymodule); + g_free (module_name); + + pytype = find_python_plugin_type (info, pymodule); + + if (pytype) + return add_python_info (pyloader, info, pymodule, path, pytype); + + return NULL; +} + +static void +gedit_plugin_loader_iface_unload (GeditPluginLoader *loader, + GeditPluginInfo *info) +{ + GeditPluginLoaderPython *pyloader = GEDIT_PLUGIN_LOADER_PYTHON (loader); + PythonInfo *pyinfo; + PyGILState_STATE state; + + pyinfo = (PythonInfo *)g_hash_table_lookup (pyloader->priv->loaded_plugins, info); + + if (!pyinfo) + return; + + state = pyg_gil_state_ensure (); + Py_XDECREF (pyinfo->instance); + pyg_gil_state_release (state); + + pyinfo->instance = NULL; +} + +static gboolean +run_gc (GeditPluginLoaderPython *loader) +{ + while (PyGC_Collect ()) + ; + + loader->priv->idle_gc = 0; + return FALSE; +} + +static void +gedit_plugin_loader_iface_garbage_collect (GeditPluginLoader *loader) +{ + GeditPluginLoaderPython *pyloader; + + if (!Py_IsInitialized()) + return; + + pyloader = GEDIT_PLUGIN_LOADER_PYTHON (loader); + + /* + * We both run the GC right now and we schedule + * a further collection in the main loop. + */ + + while (PyGC_Collect ()) + ; + + if (pyloader->priv->idle_gc == 0) + pyloader->priv->idle_gc = g_idle_add ((GSourceFunc)run_gc, pyloader); +} + +static void +gedit_plugin_loader_iface_init (gpointer g_iface, + gpointer iface_data) +{ + GeditPluginLoaderInterface *iface = (GeditPluginLoaderInterface *)g_iface; + + iface->get_id = gedit_plugin_loader_iface_get_id; + iface->load = gedit_plugin_loader_iface_load; + iface->unload = gedit_plugin_loader_iface_unload; + iface->garbage_collect = gedit_plugin_loader_iface_garbage_collect; +} + +static void +gedit_python_shutdown (GeditPluginLoaderPython *loader) +{ + if (!Py_IsInitialized ()) + return; + + if (loader->priv->idle_gc != 0) + { + g_source_remove (loader->priv->idle_gc); + loader->priv->idle_gc = 0; + } + + while (PyGC_Collect ()) + ; + + Py_Finalize (); +} + + +/* C equivalent of + * import pygtk + * pygtk.require ("2.0") + */ +static gboolean +gedit_check_pygtk2 (void) +{ + PyObject *pygtk, *mdict, *require; + + /* pygtk.require("2.0") */ + pygtk = PyImport_ImportModule ("pygtk"); + if (pygtk == NULL) + { + g_warning ("Error initializing Python interpreter: could not import pygtk."); + return FALSE; + } + + mdict = PyModule_GetDict (pygtk); + require = PyDict_GetItemString (mdict, "require"); + PyObject_CallObject (require, + Py_BuildValue ("(S)", PyString_FromString ("2.0"))); + if (PyErr_Occurred()) + { + g_warning ("Error initializing Python interpreter: pygtk 2 is required."); + return FALSE; + } + + return TRUE; +} + +/* Note: the following two functions are needed because + * init_pyobject and init_pygtk which are *macros* which in case + * case of error set the PyErr and then make the calling + * function return behind our back. + * It's up to the caller to check the result with PyErr_Occurred() + */ +static void +gedit_init_pygobject (void) +{ + init_pygobject_check (2, 11, 5); /* FIXME: get from config */ +} + +static void +gedit_init_pygtk (void) +{ + PyObject *gtk, *mdict, *version, *required_version; + + init_pygtk (); + + /* there isn't init_pygtk_check(), do the version + * check ourselves */ + gtk = PyImport_ImportModule("gtk"); + mdict = PyModule_GetDict(gtk); + version = PyDict_GetItemString (mdict, "pygtk_version"); + if (!version) + { + PyErr_SetString (PyExc_ImportError, + "PyGObject version too old"); + return; + } + + required_version = Py_BuildValue ("(iii)", 2, 4, 0); /* FIXME */ + + if (PyObject_Compare (version, required_version) == -1) + { + PyErr_SetString (PyExc_ImportError, + "PyGObject version too old"); + Py_DECREF (required_version); + return; + } + + Py_DECREF (required_version); +} + +static void +old_gtksourceview_init (void) +{ + PyErr_SetString(PyExc_ImportError, + "gtksourceview module not allowed, use gtksourceview2"); +} + +static void +gedit_init_pygtksourceview (void) +{ + PyObject *gtksourceview, *mdict, *version, *required_version; + + gtksourceview = PyImport_ImportModule("gtksourceview2"); + if (gtksourceview == NULL) + { + PyErr_SetString (PyExc_ImportError, + "could not import gtksourceview"); + return; + } + + mdict = PyModule_GetDict (gtksourceview); + version = PyDict_GetItemString (mdict, "pygtksourceview2_version"); + if (!version) + { + PyErr_SetString (PyExc_ImportError, + "PyGtkSourceView version too old"); + return; + } + + required_version = Py_BuildValue ("(iii)", 0, 8, 0); /* FIXME */ + + if (PyObject_Compare (version, required_version) == -1) + { + PyErr_SetString (PyExc_ImportError, + "PyGtkSourceView version too old"); + Py_DECREF (required_version); + return; + } + + Py_DECREF (required_version); + + /* Create a dummy 'gtksourceview' module to prevent + * loading of the old 'gtksourceview' modules that + * has conflicting symbols with the gtksourceview2 module. + * Raise an exception when trying to import it. + */ + PyImport_AppendInittab ("gtksourceview", old_gtksourceview_init); +} + +static gboolean +gedit_python_init (GeditPluginLoaderPython *loader) +{ + PyObject *mdict, *tuple; + PyObject *gedit, *geditutils, *geditcommands, *geditplugins; + PyObject *gettext, *install, *gettext_args; + //char *argv[] = { "gedit", NULL }; + char *argv[] = { GEDIT_PLUGINS_LIBS_DIR, NULL }; +#ifdef HAVE_SIGACTION + gint res; + struct sigaction old_sigint; +#endif + + if (loader->priv->init_failed) + { + /* We already failed to initialized Python, don't need to + * retry again */ + return FALSE; + } + + if (Py_IsInitialized ()) + { + /* Python has already been successfully initialized */ + return TRUE; + } + + /* We are trying to initialize Python for the first time, + set init_failed to FALSE only if the entire initialization process + ends with success */ + loader->priv->init_failed = TRUE; + + /* Hack to make python not overwrite SIGINT: this is needed to avoid + * the crash reported on bug #326191 */ + + /* CHECK: can't we use Py_InitializeEx instead of Py_Initialize in order + to avoid to manage signal handlers ? - Paolo (Dec. 31, 2006) */ + +#ifdef HAVE_SIGACTION + /* Save old handler */ + res = sigaction (SIGINT, NULL, &old_sigint); + if (res != 0) + { + g_warning ("Error initializing Python interpreter: cannot get " + "handler to SIGINT signal (%s)", + g_strerror (errno)); + + return FALSE; + } +#endif + + /* Python initialization */ + Py_Initialize (); + +#ifdef HAVE_SIGACTION + /* Restore old handler */ + res = sigaction (SIGINT, &old_sigint, NULL); + if (res != 0) + { + g_warning ("Error initializing Python interpreter: cannot restore " + "handler to SIGINT signal (%s).", + g_strerror (errno)); + + goto python_init_error; + } +#endif + + PySys_SetArgv (1, argv); + + if (!gedit_check_pygtk2 ()) + { + /* Warning message already printed in check_pygtk2 */ + goto python_init_error; + } + + /* import gobject */ + gedit_init_pygobject (); + if (PyErr_Occurred ()) + { + g_warning ("Error initializing Python interpreter: could not import pygobject."); + + goto python_init_error; + } + + /* import gtk */ + gedit_init_pygtk (); + if (PyErr_Occurred ()) + { + g_warning ("Error initializing Python interpreter: could not import pygtk."); + + goto python_init_error; + } + + /* import gtksourceview */ + gedit_init_pygtksourceview (); + if (PyErr_Occurred ()) + { + PyErr_Print (); + + g_warning ("Error initializing Python interpreter: could not import pygtksourceview."); + + goto python_init_error; + } + + /* import gedit */ + gedit = Py_InitModule ("gedit", pygedit_functions); + mdict = PyModule_GetDict (gedit); + + pygedit_register_classes (mdict); + pygedit_add_constants (gedit, "GEDIT_"); + + /* gedit version */ + tuple = Py_BuildValue("(iii)", + GEDIT_MAJOR_VERSION, + GEDIT_MINOR_VERSION, + GEDIT_MICRO_VERSION); + PyDict_SetItemString(mdict, "version", tuple); + Py_DECREF(tuple); + + /* Retrieve the Python type for gedit.Plugin */ + PyGeditPlugin_Type = (PyTypeObject *) PyDict_GetItemString (mdict, "Plugin"); + if (PyGeditPlugin_Type == NULL) + { + PyErr_Print (); + + goto python_init_error; + } + + /* import gedit.utils */ + geditutils = Py_InitModule ("gedit.utils", pygeditutils_functions); + PyDict_SetItemString (mdict, "utils", geditutils); + + /* import gedit.commands */ + geditcommands = Py_InitModule ("gedit.commands", pygeditcommands_functions); + PyDict_SetItemString (mdict, "commands", geditcommands); + + /* initialize empty gedit.plugins module */ + geditplugins = Py_InitModule ("gedit.plugins", NULL); + PyDict_SetItemString (mdict, "plugins", geditplugins); + + mdict = PyModule_GetDict (geditutils); + pygeditutils_register_classes (mdict); + + mdict = PyModule_GetDict (geditcommands); + pygeditcommands_register_classes (mdict); + + /* i18n support */ + gettext = PyImport_ImportModule ("gettext"); + if (gettext == NULL) + { + g_warning ("Error initializing Python interpreter: could not import gettext."); + + goto python_init_error; + } + + mdict = PyModule_GetDict (gettext); + install = PyDict_GetItemString (mdict, "install"); + gettext_args = Py_BuildValue ("ss", GETTEXT_PACKAGE, GEDIT_LOCALEDIR); + PyObject_CallObject (install, gettext_args); + Py_DECREF (gettext_args); + + /* Python has been successfully initialized */ + loader->priv->init_failed = FALSE; + + return TRUE; + +python_init_error: + + g_warning ("Please check the installation of all the Python related packages required " + "by gedit and try again."); + + PyErr_Clear (); + + gedit_python_shutdown (loader); + + return FALSE; +} + +static void +gedit_plugin_loader_python_finalize (GObject *object) +{ + GeditPluginLoaderPython *pyloader = GEDIT_PLUGIN_LOADER_PYTHON (object); + + g_hash_table_destroy (pyloader->priv->loaded_plugins); + gedit_python_shutdown (pyloader); + + G_OBJECT_CLASS (gedit_plugin_loader_python_parent_class)->finalize (object); +} + +static void +gedit_plugin_loader_python_class_init (GeditPluginLoaderPythonClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_plugin_loader_python_finalize; + + g_type_class_add_private (object_class, sizeof (GeditPluginLoaderPythonPrivate)); +} + +static void +gedit_plugin_loader_python_class_finalize (GeditPluginLoaderPythonClass *klass) +{ +} + +static void +destroy_python_info (PythonInfo *info) +{ + PyGILState_STATE state = pyg_gil_state_ensure (); + Py_XDECREF (info->type); + pyg_gil_state_release (state); + + g_free (info->path); + g_free (info); +} + +static void +gedit_plugin_loader_python_init (GeditPluginLoaderPython *self) +{ + self->priv = GEDIT_PLUGIN_LOADER_PYTHON_GET_PRIVATE (self); + + /* initialize python interpreter */ + gedit_python_init (self); + + /* loaded_plugins maps GeditPluginInfo to a PythonInfo */ + self->priv->loaded_plugins = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + NULL, + (GDestroyNotify)destroy_python_info); +} + +GeditPluginLoaderPython * +gedit_plugin_loader_python_new () +{ + GObject *loader = g_object_new (GEDIT_TYPE_PLUGIN_LOADER_PYTHON, NULL); + + return GEDIT_PLUGIN_LOADER_PYTHON (loader); +} + diff --git a/plugin-loaders/python/gedit-plugin-loader-python.h b/plugin-loaders/python/gedit-plugin-loader-python.h new file mode 100755 index 00000000..35ae241c --- /dev/null +++ b/plugin-loaders/python/gedit-plugin-loader-python.h @@ -0,0 +1,61 @@ +/* + * gedit-plugin-loader-python.h + * This file is part of gedit + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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 __GEDIT_PLUGIN_LOADER_PYTHON_H__ +#define __GEDIT_PLUGIN_LOADER_PYTHON_H__ + +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_PLUGIN_LOADER_PYTHON (gedit_plugin_loader_python_get_type ()) +#define GEDIT_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_PLUGIN_LOADER_PYTHON, GeditPluginLoaderPython)) +#define GEDIT_PLUGIN_LOADER_PYTHON_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_PLUGIN_LOADER_PYTHON, GeditPluginLoaderPython const)) +#define GEDIT_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_PLUGIN_LOADER_PYTHON, GeditPluginLoaderPythonClass)) +#define GEDIT_IS_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_PLUGIN_LOADER_PYTHON)) +#define GEDIT_IS_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGIN_LOADER_PYTHON)) +#define GEDIT_PLUGIN_LOADER_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_PLUGIN_LOADER_PYTHON, GeditPluginLoaderPythonClass)) + +typedef struct _GeditPluginLoaderPython GeditPluginLoaderPython; +typedef struct _GeditPluginLoaderPythonClass GeditPluginLoaderPythonClass; +typedef struct _GeditPluginLoaderPythonPrivate GeditPluginLoaderPythonPrivate; + +struct _GeditPluginLoaderPython { + GObject parent; + + GeditPluginLoaderPythonPrivate *priv; +}; + +struct _GeditPluginLoaderPythonClass { + GObjectClass parent_class; +}; + +GType gedit_plugin_loader_python_get_type (void) G_GNUC_CONST; +GeditPluginLoaderPython *gedit_plugin_loader_python_new(void); + +/* All the loaders must implement this function */ +G_MODULE_EXPORT GType register_gedit_plugin_loader (GTypeModule * module); + +G_END_DECLS + +#endif /* __GEDIT_PLUGIN_LOADER_PYTHON_H__ */ + diff --git a/plugin-loaders/python/gedit-plugin-python.c b/plugin-loaders/python/gedit-plugin-python.c new file mode 100755 index 00000000..0573828b --- /dev/null +++ b/plugin-loaders/python/gedit-plugin-python.c @@ -0,0 +1,281 @@ +/* + * gedit-plugin-python.c + * This file is part of gedit + * + * Copyright (C) 2005 Raphael Slinckx + * Copyright (C) 2008 Jesse van den Kieboom + * + * 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. + */ + +#include + +#include "gedit-plugin-python.h" + +#include +#include +#include +#include + +#define GEDIT_PLUGIN_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_PLUGIN_PYTHON, GeditPluginPythonPrivate)) + +static GObjectClass *parent_class; + +struct _GeditPluginPythonPrivate +{ + PyObject *instance; +}; + +static void gedit_plugin_python_class_init (GeditPluginPythonClass *klass); +static void gedit_plugin_python_init (GeditPluginPython *plugin); + +G_DEFINE_TYPE (GeditPluginPython, gedit_plugin_python, GEDIT_TYPE_PLUGIN) + +static PyObject * +call_python_method (GeditPluginPythonPrivate *priv, + GeditWindow *window, + gchar *method) +{ + PyObject *py_ret = NULL; + + g_return_val_if_fail (PyObject_HasAttrString (priv->instance, method), NULL); + + if (window == NULL) + { + py_ret = PyObject_CallMethod (priv->instance, + method, + NULL); + } + else + { + py_ret = PyObject_CallMethod (priv->instance, + method, + "(N)", + pygobject_new (G_OBJECT (window))); + } + + if (!py_ret) + PyErr_Print (); + + return py_ret; +} + +static gboolean +check_py_object_is_gtk_widget (PyObject *py_obj) +{ + static PyTypeObject *_PyGtkWidget_Type = NULL; + + if (_PyGtkWidget_Type == NULL) + { + PyObject *module; + + if ((module = PyImport_ImportModule ("gtk"))) + { + PyObject *moddict = PyModule_GetDict (module); + _PyGtkWidget_Type = (PyTypeObject *) PyDict_GetItemString (moddict, "Widget"); + } + + if (_PyGtkWidget_Type == NULL) + { + PyErr_SetString(PyExc_TypeError, "could not find Python gtk widget type"); + PyErr_Print(); + + return FALSE; + } + } + + return PyObject_TypeCheck (py_obj, _PyGtkWidget_Type) ? TRUE : FALSE; +} + +static void +impl_update_ui (GeditPlugin *plugin, + GeditWindow *window) +{ + PyGILState_STATE state = pyg_gil_state_ensure (); + GeditPluginPythonPrivate *priv = GEDIT_PLUGIN_PYTHON(plugin)->priv; + + if (PyObject_HasAttrString (priv->instance, "update_ui")) + { + PyObject *py_ret = call_python_method (priv, window, "update_ui"); + + if (py_ret) + { + Py_XDECREF (py_ret); + } + } + else + GEDIT_PLUGIN_CLASS (parent_class)->update_ui (plugin, window); + + pyg_gil_state_release (state); +} + +static void +impl_deactivate (GeditPlugin *plugin, + GeditWindow *window) +{ + PyGILState_STATE state = pyg_gil_state_ensure (); + GeditPluginPythonPrivate *priv = GEDIT_PLUGIN_PYTHON(plugin)->priv; + + if (PyObject_HasAttrString (priv->instance, "deactivate")) + { + PyObject *py_ret = call_python_method (priv, window, "deactivate"); + + if (py_ret) + { + Py_XDECREF (py_ret); + } + } + else + GEDIT_PLUGIN_CLASS (parent_class)->deactivate (plugin, window); + + pyg_gil_state_release (state); +} + +static void +impl_activate (GeditPlugin *plugin, + GeditWindow *window) +{ + PyGILState_STATE state = pyg_gil_state_ensure (); + GeditPluginPythonPrivate *priv = GEDIT_PLUGIN_PYTHON(plugin)->priv; + + if (PyObject_HasAttrString (priv->instance, "activate")) + { + PyObject *py_ret = call_python_method (priv, window, "activate"); + + if (py_ret) + { + Py_XDECREF (py_ret); + } + } + else + GEDIT_PLUGIN_CLASS (parent_class)->activate (plugin, window); + + pyg_gil_state_release (state); +} + +static GtkWidget * +impl_create_configure_dialog (GeditPlugin *plugin) +{ + PyGILState_STATE state = pyg_gil_state_ensure (); + GeditPluginPythonPrivate *priv = GEDIT_PLUGIN_PYTHON(plugin)->priv; + GtkWidget *ret = NULL; + + if (PyObject_HasAttrString (priv->instance, "create_configure_dialog")) + { + PyObject *py_ret = call_python_method (priv, NULL, "create_configure_dialog"); + + if (py_ret) + { + if (check_py_object_is_gtk_widget (py_ret)) + { + ret = GTK_WIDGET (pygobject_get (py_ret)); + g_object_ref (ret); + } + else + { + PyErr_SetString(PyExc_TypeError, "return value for create_configure_dialog is not a GtkWidget"); + PyErr_Print(); + } + + Py_DECREF (py_ret); + } + } + else + ret = GEDIT_PLUGIN_CLASS (parent_class)->create_configure_dialog (plugin); + + pyg_gil_state_release (state); + + return ret; +} + +static gboolean +impl_is_configurable (GeditPlugin *plugin) +{ + PyGILState_STATE state = pyg_gil_state_ensure (); + GeditPluginPythonPrivate *priv = GEDIT_PLUGIN_PYTHON(plugin)->priv; + PyObject *dict = priv->instance->ob_type->tp_dict; + gboolean result; + + if (dict == NULL) + result = FALSE; + else if (!PyDict_Check(dict)) + result = FALSE; + else + result = PyDict_GetItemString(dict, "create_configure_dialog") != NULL; + + pyg_gil_state_release (state); + + return result; +} + +void +_gedit_plugin_python_set_instance (GeditPluginPython *plugin, + PyObject *instance) +{ + PyGILState_STATE state = pyg_gil_state_ensure (); + + /* we don't increment the instance here because we are the instance, + when it dies, we also die */ + plugin->priv->instance = instance; + pyg_gil_state_release (state); +} + +PyObject * +_gedit_plugin_python_get_instance (GeditPluginPython *plugin) +{ + return plugin->priv->instance; +} + +static void +gedit_plugin_python_init (GeditPluginPython *plugin) +{ + plugin->priv = GEDIT_PLUGIN_PYTHON_GET_PRIVATE(plugin); + + gedit_debug_message (DEBUG_PLUGINS, "Creating Python plugin instance"); + plugin->priv->instance = 0; +} + +static void +gedit_plugin_python_finalize (GObject *object) +{ + PyGILState_STATE state; + + gedit_debug_message (DEBUG_PLUGINS, "Finalizing Python plugin instance"); + + state = pyg_gil_state_ensure (); + Py_XDECREF (GEDIT_PLUGIN_PYTHON(object)->priv->instance); + pyg_gil_state_release (state); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +gedit_plugin_python_class_init (GeditPluginPythonClass *klass) +{ + GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + g_type_class_add_private (klass, sizeof (GeditPluginPythonPrivate)); + G_OBJECT_CLASS (klass)->finalize = gedit_plugin_python_finalize; + + plugin_class->activate = impl_activate; + plugin_class->deactivate = impl_deactivate; + plugin_class->update_ui = impl_update_ui; + plugin_class->create_configure_dialog = impl_create_configure_dialog; + plugin_class->is_configurable = impl_is_configurable; +} + diff --git a/plugin-loaders/python/gedit-plugin-python.h b/plugin-loaders/python/gedit-plugin-python.h new file mode 100755 index 00000000..e67584b0 --- /dev/null +++ b/plugin-loaders/python/gedit-plugin-python.h @@ -0,0 +1,88 @@ +/* + * gedit-plugin-python.h + * This file is part of gedit + * + * Copyright (C) 2005 - Raphael Slinckx + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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 __GEDIT_PLUGIN_PYTHON_H__ +#define __GEDIT_PLUGIN_PYTHON_H__ + +#define NO_IMPORT_PYGOBJECT + +#include +#include + +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_PLUGIN_PYTHON (gedit_plugin_python_get_type()) +#define GEDIT_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_PLUGIN_PYTHON, GeditPluginPython)) +#define GEDIT_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_PLUGIN_PYTHON, GeditPluginPythonClass)) +#define GEDIT_IS_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_PLUGIN_PYTHON)) +#define GEDIT_IS_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_PLUGIN_PYTHON)) +#define GEDIT_PLUGIN_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_PLUGIN_PYTHON, GeditPluginPythonClass)) + +/* Private structure type */ +typedef struct _GeditPluginPythonPrivate GeditPluginPythonPrivate; + +/* + * Main object structure + */ +typedef struct _GeditPluginPython GeditPluginPython; + +struct _GeditPluginPython +{ + GeditPlugin parent; + + /*< private > */ + GeditPluginPythonPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditPluginPythonClass GeditPluginPythonClass; + +struct _GeditPluginPythonClass +{ + GeditPluginClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_plugin_python_get_type (void) G_GNUC_CONST; + + +/* + * Private methods + */ +void _gedit_plugin_python_set_instance (GeditPluginPython *plugin, + PyObject *instance); +PyObject *_gedit_plugin_python_get_instance (GeditPluginPython *plugin); + +G_END_DECLS + +#endif /* __GEDIT_PLUGIN_PYTHON_H__ */ + diff --git a/plugins/Makefile.am b/plugins/Makefile.am new file mode 100755 index 00000000..ba80e090 --- /dev/null +++ b/plugins/Makefile.am @@ -0,0 +1,42 @@ +DIST_SUBDIRS = \ + changecase \ + checkupdate \ + docinfo \ + externaltools \ + filebrowser \ + modelines \ + pythonconsole \ + quickopen \ + snippets \ + sort \ + spell \ + taglist \ + time + +SUBDIRS = \ + changecase \ + docinfo \ + filebrowser \ + modelines \ + sort \ + taglist \ + time + +if ENABLE_PYTHON +SUBDIRS += pythonconsole snippets quickopen + +if !OS_WIN32 +SUBDIRS += externaltools +endif + +endif + +if ENABLE_ENCHANT +SUBDIRS += spell +endif + +if ENABLE_UPDATER +SUBDIRS += checkupdate +endif + +-include $(top_srcdir)/git.mk diff --git a/plugins/changecase/Makefile.am b/plugins/changecase/Makefile.am new file mode 100755 index 00000000..1f165f9e --- /dev/null +++ b/plugins/changecase/Makefile.am @@ -0,0 +1,34 @@ +# changecase plugin +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +INCLUDES = \ + -I$(top_srcdir) \ + $(GEDIT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) + +plugin_LTLIBRARIES = libchangecase.la + +libchangecase_la_SOURCES = \ + gedit-changecase-plugin.h \ + gedit-changecase-plugin.c + +libchangecase_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) +libchangecase_la_LIBADD = $(GEDIT_LIBS) + +uidir = $(GEDIT_PLUGINS_DATA_DIR)/changecase +ui_DATA = + +plugin_in_files = changecase.gedit-plugin.desktop.in + +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +EXTRA_DIST = $(ui_DATA) $(plugin_in_files) + +CLEANFILES = $(plugin_DATA) +DISTCLEANFILES = $(plugin_DATA) + + +-include $(top_srcdir)/git.mk diff --git a/plugins/changecase/changecase.gedit-plugin.desktop.in b/plugins/changecase/changecase.gedit-plugin.desktop.in new file mode 100755 index 00000000..52a226f4 --- /dev/null +++ b/plugins/changecase/changecase.gedit-plugin.desktop.in @@ -0,0 +1,8 @@ +[Gedit Plugin] +Module=changecase +IAge=2 +_Name=Change Case +_Description=Changes the case of selected text. +Authors=Paolo Borelli +Copyright=Copyright © 2004-2005 Paolo Borelli +Website=http://www.gedit.org diff --git a/plugins/changecase/gedit-changecase-plugin.c b/plugins/changecase/gedit-changecase-plugin.c new file mode 100755 index 00000000..8544aeb0 --- /dev/null +++ b/plugins/changecase/gedit-changecase-plugin.c @@ -0,0 +1,395 @@ +/* + * gedit-changecase-plugin.c + * + * Copyright (C) 2004-2005 - Paolo Borelli + * + * 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, 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. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "gedit-changecase-plugin.h" + +#include +#include + +#include + +#define WINDOW_DATA_KEY "GeditChangecasePluginWindowData" + +GEDIT_PLUGIN_REGISTER_TYPE(GeditChangecasePlugin, gedit_changecase_plugin) + +typedef enum { + TO_UPPER_CASE, + TO_LOWER_CASE, + INVERT_CASE, + TO_TITLE_CASE, +} ChangeCaseChoice; + +static void +do_upper_case (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end) +{ + GString *s = g_string_new (NULL); + + while (!gtk_text_iter_is_end (start) && + !gtk_text_iter_equal (start, end)) + { + gunichar c, nc; + + c = gtk_text_iter_get_char (start); + nc = g_unichar_toupper (c); + g_string_append_unichar (s, nc); + + gtk_text_iter_forward_char (start); + } + + gtk_text_buffer_delete_selection (buffer, TRUE, TRUE); + gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len); + + g_string_free (s, TRUE); +} + +static void +do_lower_case (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end) +{ + GString *s = g_string_new (NULL); + + while (!gtk_text_iter_is_end (start) && + !gtk_text_iter_equal (start, end)) + { + gunichar c, nc; + + c = gtk_text_iter_get_char (start); + nc = g_unichar_tolower (c); + g_string_append_unichar (s, nc); + + gtk_text_iter_forward_char (start); + } + + gtk_text_buffer_delete_selection (buffer, TRUE, TRUE); + gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len); + + g_string_free (s, TRUE); +} + +static void +do_invert_case (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end) +{ + GString *s = g_string_new (NULL); + + while (!gtk_text_iter_is_end (start) && + !gtk_text_iter_equal (start, end)) + { + gunichar c, nc; + + c = gtk_text_iter_get_char (start); + if (g_unichar_islower (c)) + nc = g_unichar_toupper (c); + else + nc = g_unichar_tolower (c); + g_string_append_unichar (s, nc); + + gtk_text_iter_forward_char (start); + } + + gtk_text_buffer_delete_selection (buffer, TRUE, TRUE); + gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len); + + g_string_free (s, TRUE); +} + +static void +do_title_case (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end) +{ + GString *s = g_string_new (NULL); + + while (!gtk_text_iter_is_end (start) && + !gtk_text_iter_equal (start, end)) + { + gunichar c, nc; + + c = gtk_text_iter_get_char (start); + if (gtk_text_iter_starts_word (start)) + nc = g_unichar_totitle (c); + else + nc = g_unichar_tolower (c); + g_string_append_unichar (s, nc); + + gtk_text_iter_forward_char (start); + } + + gtk_text_buffer_delete_selection (buffer, TRUE, TRUE); + gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len); + + g_string_free (s, TRUE); +} + +static void +change_case (GeditWindow *window, + ChangeCaseChoice choice) +{ + GeditDocument *doc; + GtkTextIter start, end; + + gedit_debug (DEBUG_PLUGINS); + + doc = gedit_window_get_active_document (window); + g_return_if_fail (doc != NULL); + + if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), + &start, &end)) + { + return; + } + + gtk_text_buffer_begin_user_action (GTK_TEXT_BUFFER (doc)); + + switch (choice) + { + case TO_UPPER_CASE: + do_upper_case (GTK_TEXT_BUFFER (doc), &start, &end); + break; + case TO_LOWER_CASE: + do_lower_case (GTK_TEXT_BUFFER (doc), &start, &end); + break; + case INVERT_CASE: + do_invert_case (GTK_TEXT_BUFFER (doc), &start, &end); + break; + case TO_TITLE_CASE: + do_title_case (GTK_TEXT_BUFFER (doc), &start, &end); + break; + default: + g_return_if_reached (); + } + + gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (doc)); +} + +static void +upper_case_cb (GtkAction *action, + GeditWindow *window) +{ + change_case (window, TO_UPPER_CASE); +} + +static void +lower_case_cb (GtkAction *action, + GeditWindow *window) +{ + change_case (window, TO_LOWER_CASE); +} + +static void +invert_case_cb (GtkAction *action, + GeditWindow *window) +{ + change_case (window, INVERT_CASE); +} + +static void +title_case_cb (GtkAction *action, + GeditWindow *window) +{ + change_case (window, TO_TITLE_CASE); +} + +static const GtkActionEntry action_entries[] = +{ + { "ChangeCase", NULL, N_("C_hange Case") }, + { "UpperCase", NULL, N_("All _Upper Case"), NULL, + N_("Change selected text to upper case"), + G_CALLBACK (upper_case_cb) }, + { "LowerCase", NULL, N_("All _Lower Case"), NULL, + N_("Change selected text to lower case"), + G_CALLBACK (lower_case_cb) }, + { "InvertCase", NULL, N_("_Invert Case"), NULL, + N_("Invert the case of selected text"), + G_CALLBACK (invert_case_cb) }, + { "TitleCase", NULL, N_("_Title Case"), NULL, + N_("Capitalize the first letter of each selected word"), + G_CALLBACK (title_case_cb) } +}; + +const gchar submenu[] = +"" +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +""; + +static void +gedit_changecase_plugin_init (GeditChangecasePlugin *plugin) +{ + gedit_debug_message (DEBUG_PLUGINS, "GeditChangecasePlugin initializing"); +} + +static void +gedit_changecase_plugin_finalize (GObject *object) +{ + G_OBJECT_CLASS (gedit_changecase_plugin_parent_class)->finalize (object); + + gedit_debug_message (DEBUG_PLUGINS, "GeditChangecasePlugin finalizing"); +} + +typedef struct +{ + GtkActionGroup *action_group; + guint ui_id; +} WindowData; + +static void +free_window_data (WindowData *data) +{ + g_return_if_fail (data != NULL); + + g_slice_free (WindowData, data); +} + +static void +update_ui_real (GeditWindow *window, + WindowData *data) +{ + GtkTextView *view; + GtkAction *action; + gboolean sensitive = FALSE; + + gedit_debug (DEBUG_PLUGINS); + + view = GTK_TEXT_VIEW (gedit_window_get_active_view (window)); + + if (view != NULL) + { + GtkTextBuffer *buffer; + + buffer = gtk_text_view_get_buffer (view); + sensitive = (gtk_text_view_get_editable (view) && + gtk_text_buffer_get_has_selection (buffer)); + } + + action = gtk_action_group_get_action (data->action_group, + "ChangeCase"); + gtk_action_set_sensitive (action, sensitive); +} + +static void +impl_activate (GeditPlugin *plugin, + GeditWindow *window) +{ + GtkUIManager *manager; + WindowData *data; + GError *error = NULL; + + gedit_debug (DEBUG_PLUGINS); + + data = g_slice_new (WindowData); + + manager = gedit_window_get_ui_manager (window); + + data->action_group = gtk_action_group_new ("GeditChangecasePluginActions"); + gtk_action_group_set_translation_domain (data->action_group, + GETTEXT_PACKAGE); + gtk_action_group_add_actions (data->action_group, + action_entries, + G_N_ELEMENTS (action_entries), + window); + + gtk_ui_manager_insert_action_group (manager, data->action_group, -1); + + data->ui_id = gtk_ui_manager_add_ui_from_string (manager, + submenu, + -1, + &error); + if (data->ui_id == 0) + { + g_warning ("%s", error->message); + free_window_data (data); + return; + } + + g_object_set_data_full (G_OBJECT (window), + WINDOW_DATA_KEY, + data, + (GDestroyNotify) free_window_data); + + update_ui_real (window, data); +} + +static void +impl_deactivate (GeditPlugin *plugin, + GeditWindow *window) +{ + GtkUIManager *manager; + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + manager = gedit_window_get_ui_manager (window); + + data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); + g_return_if_fail (data != NULL); + + gtk_ui_manager_remove_ui (manager, data->ui_id); + gtk_ui_manager_remove_action_group (manager, data->action_group); + + g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL); +} + +static void +impl_update_ui (GeditPlugin *plugin, + GeditWindow *window) +{ + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); + g_return_if_fail (data != NULL); + + update_ui_real (window, data); +} + +static void +gedit_changecase_plugin_class_init (GeditChangecasePluginClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + + object_class->finalize = gedit_changecase_plugin_finalize; + + plugin_class->activate = impl_activate; + plugin_class->deactivate = impl_deactivate; + plugin_class->update_ui = impl_update_ui; +} diff --git a/plugins/changecase/gedit-changecase-plugin.h b/plugins/changecase/gedit-changecase-plugin.h new file mode 100755 index 00000000..9587928c --- /dev/null +++ b/plugins/changecase/gedit-changecase-plugin.h @@ -0,0 +1,72 @@ +/* + * gedit-changecase-plugin.h + * + * Copyright (C) 2004-2005 - Paolo Borelli + * + * 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, 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. + * + * $Id$ + */ + +#ifndef __GEDIT_CHANGECASE_PLUGIN_H__ +#define __GEDIT_CHANGECASE_PLUGIN_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_CHANGECASE_PLUGIN (gedit_changecase_plugin_get_type ()) +#define GEDIT_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePlugin)) +#define GEDIT_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePluginClass)) +#define GEDIT_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_CHANGECASE_PLUGIN)) +#define GEDIT_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_CHANGECASE_PLUGIN)) +#define GEDIT_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_CHANGECASE_PLUGIN, GeditChangecasePluginClass)) + +/* + * Main object structure + */ +typedef struct _GeditChangecasePlugin GeditChangecasePlugin; + +struct _GeditChangecasePlugin +{ + GeditPlugin parent_instance; +}; + +/* + * Class definition + */ +typedef struct _GeditChangecasePluginClass GeditChangecasePluginClass; + +struct _GeditChangecasePluginClass +{ + GeditPluginClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_changecase_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __GEDIT_CHANGECASE_PLUGIN_H__ */ diff --git a/plugins/checkupdate/Makefile.am b/plugins/checkupdate/Makefile.am new file mode 100755 index 00000000..551b7eee --- /dev/null +++ b/plugins/checkupdate/Makefile.am @@ -0,0 +1,49 @@ +# gedit win32 updater + +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +INCLUDES = \ + -I$(top_srcdir) \ + $(GEDIT_CFLAGS) \ + $(LIBSOUP_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) + +plugin_LTLIBRARIES = libcheckupdate.la + +libcheckupdate_la_SOURCES = \ + gedit-check-update-plugin.h \ + gedit-check-update-plugin.c + +libcheckupdate_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) +libcheckupdate_la_LIBADD = $(GEDIT_LIBS) $(LIBSOUP_LIBS) + +plugin_in_files = checkupdate.gedit-plugin.desktop.in + +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +schemasdir = $(MATECONF_SCHEMA_FILE_DIR) +schemas_in_files = gedit-check-update.schemas.in +schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) +@INTLTOOL_SCHEMAS_RULE@ + +if MATECONF_SCHEMAS_INSTALL +install-data-local: + if test -z "$(DESTDIR)" ; then \ + for p in $(schemas_DATA) ; do \ + MATECONF_CONFIG_SOURCE=$(MATECONF_SCHEMA_CONFIG_SOURCE) $(MATECONFTOOL) --makefile-install-rule $(top_builddir)/plugins/checkupdate/$$p ; \ + done \ + fi +else +install-data-local: +endif + +EXTRA_DIST = $(plugin_in_files) $(schemas_in_files) + +CLEANFILES = $(plugin_DATA) $(schemas_DATA) + +DISTCLEANFILES = $(plugin_DATA) $(schemas_DATA) + +-include $(top_srcdir)/git.mk diff --git a/plugins/checkupdate/checkupdate.gedit-plugin.desktop.in b/plugins/checkupdate/checkupdate.gedit-plugin.desktop.in new file mode 100755 index 00000000..4699b6a2 --- /dev/null +++ b/plugins/checkupdate/checkupdate.gedit-plugin.desktop.in @@ -0,0 +1,9 @@ +[Gedit Plugin] +Module=checkupdate +IAge=2 +_Name=Check update +_Description=Check for latest version of gedit +Icon=gedit-plugin +Authors=Ignacio Casal Quinteiro +Copyright=Copyright © 2009 Ignacio Casal Quinteiro +Website=http://www.gedit.org diff --git a/plugins/checkupdate/gedit-check-update-plugin.c b/plugins/checkupdate/gedit-check-update-plugin.c new file mode 100755 index 00000000..aa9f7a5e --- /dev/null +++ b/plugins/checkupdate/gedit-check-update-plugin.c @@ -0,0 +1,697 @@ +/* + * Copyright (C) 2009 - Ignacio Casal Quinteiro + * + * 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, 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 +#endif + +#include "gedit-check-update-plugin.h" + +#include +#include +#include +#include +#include +#include + +#include + +#if !GTK_CHECK_VERSION(2, 17, 1) +#include +#endif + +#define MATECONF_KEY_BASE "/apps/gedit-2/plugins/checkupdate" +#define MATECONF_KEY_IGNORE_VERSION MATECONF_KEY_BASE "/ignore_version" + +#define WINDOW_DATA_KEY "GeditCheckUpdatePluginWindowData" + +#define VERSION_PLACE "" + +#ifdef G_OS_WIN32 +#define GEDIT_URL "http://ftp.acc.umu.se/pub/mate/binaries/win32/gedit/" +#define FILE_REGEX "gedit\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe" +#else +#define GEDIT_URL "http://ftp.acc.umu.se/pub/mate/binaries/mac/gedit/" +#define FILE_REGEX "gedit\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg" +#endif + +#ifdef OS_OSX +#include "gedit/osx/gedit-osx.h" +#endif + +#define GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((object), \ + GEDIT_TYPE_CHECK_UPDATE_PLUGIN, \ + GeditCheckUpdatePluginPrivate)) + +GEDIT_PLUGIN_REGISTER_TYPE (GeditCheckUpdatePlugin, gedit_check_update_plugin) + +struct _GeditCheckUpdatePluginPrivate +{ + SoupSession *session; + + MateConfClient *mateconf_client; +}; + +typedef struct +{ + GeditCheckUpdatePlugin *plugin; + + gchar *url; + gchar *version; +} WindowData; + +static void +free_window_data (gpointer data) +{ + WindowData *window_data; + + if (data == NULL) + return; + + window_data = (WindowData *)data; + + g_free (window_data->url); + g_free (window_data->version); + g_slice_free (WindowData, data); +} + +static void +gedit_check_update_plugin_init (GeditCheckUpdatePlugin *plugin) +{ + plugin->priv = GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE (plugin); + + gedit_debug_message (DEBUG_PLUGINS, + "GeditCheckUpdatePlugin initializing"); + + plugin->priv->session = soup_session_async_new (); + + plugin->priv->mateconf_client = mateconf_client_get_default (); + + mateconf_client_add_dir (plugin->priv->mateconf_client, + MATECONF_KEY_BASE, + MATECONF_CLIENT_PRELOAD_ONELEVEL, + NULL); +} + +static void +gedit_check_update_plugin_dispose (GObject *object) +{ + GeditCheckUpdatePlugin *plugin = GEDIT_CHECK_UPDATE_PLUGIN (object); + + if (plugin->priv->session != NULL) + { + g_object_unref (plugin->priv->session); + plugin->priv->session = NULL; + } + + if (plugin->priv->mateconf_client != NULL) + { + mateconf_client_suggest_sync (plugin->priv->mateconf_client, NULL); + + g_object_unref (G_OBJECT (plugin->priv->mateconf_client)); + + plugin->priv->mateconf_client = NULL; + } + + gedit_debug_message (DEBUG_PLUGINS, + "GeditCheckUpdatePlugin disposing"); + + G_OBJECT_CLASS (gedit_check_update_plugin_parent_class)->dispose (object); +} + +static void +gedit_check_update_plugin_finalize (GObject *object) +{ + gedit_debug_message (DEBUG_PLUGINS, + "GeditCheckUpdatePlugin finalizing"); + + G_OBJECT_CLASS (gedit_check_update_plugin_parent_class)->finalize (object); +} + +static void +set_contents (GtkWidget *infobar, + GtkWidget *contents) +{ +#if !GTK_CHECK_VERSION (2, 17, 1) + gedit_message_area_set_contents (GEDIT_MESSAGE_AREA (infobar), + contents); +#else + GtkWidget *content_area; + + content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar)); + gtk_container_add (GTK_CONTAINER (content_area), contents); +#endif +} + +static void +set_message_area_text_and_icon (GtkWidget *message_area, + const gchar *icon_stock_id, + const gchar *primary_text, + const gchar *secondary_text) +{ + GtkWidget *hbox_content; + GtkWidget *image; + GtkWidget *vbox; + gchar *primary_markup; + gchar *secondary_markup; + GtkWidget *primary_label; + GtkWidget *secondary_label; + + hbox_content = gtk_hbox_new (FALSE, 8); + gtk_widget_show (hbox_content); + + image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG); + gtk_widget_show (image); + gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); + + vbox = gtk_vbox_new (FALSE, 6); + gtk_widget_show (vbox); + gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); + + primary_markup = g_strdup_printf ("%s", primary_text); + primary_label = gtk_label_new (primary_markup); + g_free (primary_markup); + gtk_widget_show (primary_label); + gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5); + GTK_WIDGET_SET_FLAGS (primary_label, GTK_CAN_FOCUS); + gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); + + if (secondary_text != NULL) + { + secondary_markup = g_strdup_printf ("%s", + secondary_text); + secondary_label = gtk_label_new (secondary_markup); + g_free (secondary_markup); + gtk_widget_show (secondary_label); + gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0); + GTK_WIDGET_SET_FLAGS (secondary_label, GTK_CAN_FOCUS); + gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5); + } + + set_contents (message_area, hbox_content); +} + +static void +on_response_cb (GtkWidget *infobar, + gint response_id, + GeditWindow *window) +{ + if (response_id == GTK_RESPONSE_YES) + { + GError *error = NULL; + WindowData *data; + + data = g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + +#ifdef OS_OSX + gedit_osx_show_url (data->url); +#else + gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), + data->url, + GDK_CURRENT_TIME, + &error); +#endif + if (error != NULL) + { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("There was an error displaying the URI.")); + + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + "%s", error->message); + + g_signal_connect (G_OBJECT (dialog), + "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + gtk_widget_show (dialog); + + g_error_free (error); + } + } + else if (response_id == GTK_RESPONSE_NO) + { + WindowData *data; + + data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); + + mateconf_client_set_string (data->plugin->priv->mateconf_client, + MATECONF_KEY_IGNORE_VERSION, + data->version, + NULL); + } + + g_object_set_data (G_OBJECT (window), + WINDOW_DATA_KEY, + NULL); + + gtk_widget_destroy (infobar); +} + +static GtkWidget * +create_infobar (GeditWindow *window, + const gchar *version) +{ + GtkWidget *infobar; + gchar *message; + +#if !GTK_CHECK_VERSION (2, 17, 1) + infobar = gedit_message_area_new (); + + gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (infobar), + _("_Download"), + GTK_STOCK_SAVE, + GTK_RESPONSE_YES); + gedit_message_area_add_stock_button_with_text (GEDIT_MESSAGE_AREA (infobar), + _("_Ignore Version"), + GTK_STOCK_DISCARD, + GTK_RESPONSE_NO); + gedit_message_area_add_button (GEDIT_MESSAGE_AREA (infobar), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); +#else + GtkWidget *button; + + infobar = gtk_info_bar_new (); + + button = gedit_gtk_button_new_with_stock_icon (_("_Download"), + GTK_STOCK_SAVE); + gtk_widget_show (button); + + gtk_info_bar_add_action_widget (GTK_INFO_BAR (infobar), + button, + GTK_RESPONSE_YES); + + button = gedit_gtk_button_new_with_stock_icon (_("_Ignore Version"), + GTK_STOCK_DISCARD); + gtk_widget_show (button); + + gtk_info_bar_add_action_widget (GTK_INFO_BAR (infobar), + button, + GTK_RESPONSE_NO); + + gtk_info_bar_add_button (GTK_INFO_BAR (infobar), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + + gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), + GTK_MESSAGE_INFO); +#endif + + message = g_strdup_printf ("%s (%s)", _("There is a new version of gedit"), version); + set_message_area_text_and_icon (infobar, + "gtk-dialog-info", + message, + _("You can download the new version of gedit" + " by clicking on the download button or" + " ignore that version and wait for a new one")); + + g_free (message); + + g_signal_connect (infobar, "response", + G_CALLBACK (on_response_cb), + window); + + return infobar; +} + +static void +pack_infobar (GtkWidget *window, + GtkWidget *infobar) +{ + GtkWidget *vbox; + + vbox = gtk_bin_get_child (GTK_BIN (window)); + + gtk_box_pack_start (GTK_BOX (vbox), infobar, FALSE, FALSE, 0); + gtk_box_reorder_child (GTK_BOX (vbox), infobar, 2); +} + +static gchar * +get_file (const gchar *text, + const gchar *regex_place) +{ + GRegex *regex; + GMatchInfo *match_info; + gchar *word = NULL; + + regex = g_regex_new (regex_place, 0, 0, NULL); + g_regex_match (regex, text, 0, &match_info); + while (g_match_info_matches (match_info)) + { + g_free (word); + + word = g_match_info_fetch (match_info, 0); + + g_match_info_next (match_info, NULL); + } + g_match_info_free (match_info); + g_regex_unref (regex); + + return word; +} + +static void +get_numbers (const gchar *version, + gint *major, + gint *minor, + gint *micro) +{ + gchar **split; + gint num = 2; + + if (micro != NULL) + num = 3; + + split = g_strsplit (version, ".", num); + *major = atoi (split[0]); + *minor = atoi (split[1]); + if (micro != NULL) + *micro = atoi (split[2]); + + g_strfreev (split); +} + +static gboolean +newer_version (const gchar *v1, + const gchar *v2, + gboolean with_micro) +{ + gboolean newer = FALSE; + gint major1, minor1, micro1; + gint major2, minor2, micro2; + + if (v1 == NULL || v2 == NULL) + return FALSE; + + if (with_micro) + { + get_numbers (v1, &major1, &minor1, µ1); + get_numbers (v2, &major2, &minor2, µ2); + } + else + { + get_numbers (v1, &major1, &minor1, NULL); + get_numbers (v2, &major2, &minor2, NULL); + } + + if (major1 > major2) + { + newer = TRUE; + } + else if (minor1 > minor2 && major1 == major2) + { + newer = TRUE; + } + else if (with_micro && micro1 > micro2 && minor1 == minor2) + { + newer = TRUE; + } + + return newer; +} + +static gchar * +parse_file_version (const gchar *file) +{ + gchar *p, *aux; + + p = (gchar *)file; + + while (*p != '\0' && !g_ascii_isdigit (*p)) + { + p++; + } + + if (*p == '\0') + return NULL; + + aux = g_strrstr (p, "-"); + if (aux == NULL) + aux = g_strrstr (p, "."); + + return g_strndup (p, aux - p); +} + +static gchar * +get_ignore_version (GeditCheckUpdatePlugin *plugin) +{ + return mateconf_client_get_string (plugin->priv->mateconf_client, + MATECONF_KEY_IGNORE_VERSION, + NULL); +} + +static void +parse_page_file (SoupSession *session, + SoupMessage *msg, + GeditWindow *window) +{ + if (msg->status_code == SOUP_STATUS_OK) + { + gchar *file; + gchar *file_version; + gchar *ignore_version; + WindowData *data; + + data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); + + file = get_file (msg->response_body->data, FILE_REGEX); + file_version = parse_file_version (file); + ignore_version = get_ignore_version (data->plugin); + + if (newer_version (file_version, VERSION, TRUE) && + (ignore_version == NULL || *ignore_version == '\0' || + newer_version (file_version, ignore_version, TRUE))) + { + GtkWidget *infobar; + WindowData *data; + gchar *file_url; + + data = g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + + file_url = g_strconcat (data->url, file, NULL); + + g_free (data->url); + data->url = file_url; + data->version = g_strdup (file_version); + + infobar = create_infobar (window, file_version); + pack_infobar (GTK_WIDGET (window), infobar); + gtk_widget_show (infobar); + } + + g_free (ignore_version); + g_free (file_version); + g_free (file); + } + else + { + g_object_set_data (G_OBJECT (window), + WINDOW_DATA_KEY, + NULL); + } +} + +static gboolean +is_unstable (const gchar *version) +{ + gchar **split; + gint minor; + gboolean unstable = TRUE;; + + split = g_strsplit (version, ".", 2); + minor = atoi (split[1]); + g_strfreev (split); + + if ((minor % 2) == 0) + unstable = FALSE; + + return unstable; +} + +static gchar * +get_file_page_version (const gchar *text, + const gchar *regex_place) +{ + GRegex *regex; + GMatchInfo *match_info; + GString *string = NULL; + gchar *unstable = NULL; + gchar *stable = NULL; + + regex = g_regex_new (regex_place, 0, 0, NULL); + g_regex_match (regex, text, 0, &match_info); + while (g_match_info_matches (match_info)) + { + gint end; + gint i; + + g_match_info_fetch_pos (match_info, 0, NULL, &end); + + string = g_string_new (""); + + i = end; + while (text[i] != '/') + { + string = g_string_append_c (string, text[i]); + i++; + } + + if (is_unstable (string->str)) + { + g_free (unstable); + unstable = g_string_free (string, FALSE); + } + else + { + g_free (stable); + stable = g_string_free (string, FALSE); + } + + g_match_info_next (match_info, NULL); + } + g_match_info_free (match_info); + g_regex_unref (regex); + + if ((GEDIT_MINOR_VERSION % 2) == 0) + { + g_free (unstable); + + return stable; + } + else + { + /* We need to check that stable isn't newer than unstable */ + if (newer_version (stable, unstable, FALSE)) + { + g_free (unstable); + + return stable; + } + else + { + g_free (stable); + + return unstable; + } + } +} + +static void +parse_page_version (SoupSession *session, + SoupMessage *msg, + GeditWindow *window) +{ + if (msg->status_code == SOUP_STATUS_OK) + { + gchar *version; + SoupMessage *msg2; + WindowData *data; + + data = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); + + version = get_file_page_version (msg->response_body->data, + VERSION_PLACE); + + data->url = g_strconcat (GEDIT_URL, version, "/", NULL); + g_free (version); + msg2 = soup_message_new ("GET", data->url); + + soup_session_queue_message (session, msg2, + (SoupSessionCallback)parse_page_file, + window); + } + else + { + g_object_set_data (G_OBJECT (window), + WINDOW_DATA_KEY, + NULL); + } +} + +static void +impl_activate (GeditPlugin *plugin, + GeditWindow *window) +{ + SoupMessage *msg; + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + data = g_slice_new (WindowData); + data->plugin = GEDIT_CHECK_UPDATE_PLUGIN (plugin); + data->url = NULL; + data->version = NULL; + + g_object_set_data_full (G_OBJECT (window), + WINDOW_DATA_KEY, + data, + free_window_data); + + msg = soup_message_new ("GET", GEDIT_URL); + + soup_session_queue_message (GEDIT_CHECK_UPDATE_PLUGIN (plugin)->priv->session, msg, + (SoupSessionCallback)parse_page_version, + window); +} + +static void +impl_deactivate (GeditPlugin *plugin, + GeditWindow *window) +{ + + gedit_debug (DEBUG_PLUGINS); + + soup_session_abort (GEDIT_CHECK_UPDATE_PLUGIN (plugin)->priv->session); + + g_object_set_data (G_OBJECT (window), + WINDOW_DATA_KEY, + NULL); +} + +static void +gedit_check_update_plugin_class_init (GeditCheckUpdatePluginClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GeditCheckUpdatePluginPrivate)); + + object_class->finalize = gedit_check_update_plugin_finalize; + object_class->dispose = gedit_check_update_plugin_dispose; + + plugin_class->activate = impl_activate; + plugin_class->deactivate = impl_deactivate; +} diff --git a/plugins/checkupdate/gedit-check-update-plugin.h b/plugins/checkupdate/gedit-check-update-plugin.h new file mode 100755 index 00000000..68dc7f97 --- /dev/null +++ b/plugins/checkupdate/gedit-check-update-plugin.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2009 - Ignacio Casal Quinteiro + * + * 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, 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 __GEDIT_CHECK_UPDATE_PLUGIN_H__ +#define __GEDIT_CHECK_UPDATE_PLUGIN_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_CHECK_UPDATE_PLUGIN (gedit_check_update_plugin_get_type ()) +#define GEDIT_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePlugin)) +#define GEDIT_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePluginClass)) +#define IS_GEDIT_CHECK_UPDATE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN)) +#define IS_GEDIT_CHECK_UPDATE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_CHECK_UPDATE_PLUGIN)) +#define GEDIT_CHECK_UPDATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_CHECK_UPDATE_PLUGIN, GeditCheckUpdatePluginClass)) + +/* Private structure type */ +typedef struct _GeditCheckUpdatePluginPrivate GeditCheckUpdatePluginPrivate; + +/* + * Main object structure + */ +typedef struct _GeditCheckUpdatePlugin GeditCheckUpdatePlugin; + +struct _GeditCheckUpdatePlugin +{ + GeditPlugin parent_instance; + + /*< private >*/ + GeditCheckUpdatePluginPrivate *priv; +}; + +/* + * Class definition + */ +typedef struct _GeditCheckUpdatePluginClass GeditCheckUpdatePluginClass; + +struct _GeditCheckUpdatePluginClass +{ + GeditPluginClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_check_update_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __GEDIT_CHECK_UPDATE_PLUGIN_H__ */ diff --git a/plugins/checkupdate/gedit-check-update.schemas.in b/plugins/checkupdate/gedit-check-update.schemas.in new file mode 100755 index 00000000..67bc892b --- /dev/null +++ b/plugins/checkupdate/gedit-check-update.schemas.in @@ -0,0 +1,13 @@ + + + + /schemas/apps/gedit-2/plugins/checkupdate/ignore_version + /apps/gedit-2/plugins/checkupdate/ignore_version + gedit + string + + Version to ignore until the next version is released + + + + diff --git a/plugins/docinfo/Makefile.am b/plugins/docinfo/Makefile.am new file mode 100755 index 00000000..edf2909c --- /dev/null +++ b/plugins/docinfo/Makefile.am @@ -0,0 +1,34 @@ +# docinfo plugin +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +INCLUDES = \ + -I$(top_srcdir) \ + $(GEDIT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) + +plugin_LTLIBRARIES = libdocinfo.la + +libdocinfo_la_SOURCES = \ + gedit-docinfo-plugin.h \ + gedit-docinfo-plugin.c + +libdocinfo_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) +libdocinfo_la_LIBADD = $(GEDIT_LIBS) + +uidir = $(GEDIT_PLUGINS_DATA_DIR)/docinfo +ui_DATA = docinfo.ui + +plugin_in_files = docinfo.gedit-plugin.desktop.in + +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +EXTRA_DIST = $(ui_DATA) $(plugin_in_files) + +CLEANFILES = $(plugin_DATA) +DISTCLEANFILES = $(plugin_DATA) + + +-include $(top_srcdir)/git.mk diff --git a/plugins/docinfo/docinfo.gedit-plugin.desktop.in b/plugins/docinfo/docinfo.gedit-plugin.desktop.in new file mode 100755 index 00000000..77f2793d --- /dev/null +++ b/plugins/docinfo/docinfo.gedit-plugin.desktop.in @@ -0,0 +1,7 @@ +[Gedit Plugin] +Module=docinfo +IAge=2 +_Name=Document Statistics +_Description=Analyzes the current document and reports the number of words, lines, characters and non-space characters in it. +Authors=Paolo Maggi ;Jorge Alberto Torres +Copyright=Copyright © 2002-2005 Paolo Maggi diff --git a/plugins/docinfo/docinfo.ui b/plugins/docinfo/docinfo.ui new file mode 100755 index 00000000..bb73d40f --- /dev/null +++ b/plugins/docinfo/docinfo.ui @@ -0,0 +1,621 @@ + + + + + 5 + Document Statistics + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + True + False + 8 + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + + + _Update + True + True + True + True + False + update_image + + + False + False + 1 + + + + + 0 + False + True + GTK_PACK_END + + + + + 5 + True + False + 6 + + + True + File Name + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + + 0 + False + False + + + + + True + False + 0 + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 6 + True + 6 + 2 + False + 6 + 18 + + + True + Bytes + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 5 + 6 + fill + + + + + + True + Characters (no spaces) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 4 + 5 + fill + + + + + + True + Characters (with spaces) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + fill + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + True + Words + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + True + Lines + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + True + Document + True + True + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + 0 + True + True + + + + + 6 + True + False + 6 + + + True + Selection + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + True + 0 + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + close_button + update_button + + + + True + gtk-refresh + + diff --git a/plugins/docinfo/gedit-docinfo-plugin.c b/plugins/docinfo/gedit-docinfo-plugin.c new file mode 100755 index 00000000..a143a5a6 --- /dev/null +++ b/plugins/docinfo/gedit-docinfo-plugin.c @@ -0,0 +1,580 @@ +/* + * gedit-docinfo-plugin.c + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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, 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. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "gedit-docinfo-plugin.h" + +#include /* For strlen (...) */ + +#include +#include +#include + +#include +#include + +#define WINDOW_DATA_KEY "GeditDocInfoWindowData" +#define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_2" + +GEDIT_PLUGIN_REGISTER_TYPE(GeditDocInfoPlugin, gedit_docinfo_plugin) + +typedef struct +{ + GtkWidget *dialog; + GtkWidget *file_name_label; + GtkWidget *lines_label; + GtkWidget *words_label; + GtkWidget *chars_label; + GtkWidget *chars_ns_label; + GtkWidget *bytes_label; + GtkWidget *selection_vbox; + GtkWidget *selected_lines_label; + GtkWidget *selected_words_label; + GtkWidget *selected_chars_label; + GtkWidget *selected_chars_ns_label; + GtkWidget *selected_bytes_label; +} DocInfoDialog; + +typedef struct +{ + GeditPlugin *plugin; + + GtkActionGroup *ui_action_group; + guint ui_id; + + DocInfoDialog *dialog; +} WindowData; + +static void docinfo_dialog_response_cb (GtkDialog *widget, + gint res_id, + GeditWindow *window); + +static void +docinfo_dialog_destroy_cb (GtkObject *obj, + WindowData *data) +{ + gedit_debug (DEBUG_PLUGINS); + + if (data != NULL) + { + g_free (data->dialog); + data->dialog = NULL; + } +} + +static DocInfoDialog * +get_docinfo_dialog (GeditWindow *window, + WindowData *data) +{ + DocInfoDialog *dialog; + gchar *data_dir; + gchar *ui_file; + GtkWidget *content; + GtkWidget *error_widget; + gboolean ret; + + gedit_debug (DEBUG_PLUGINS); + + dialog = g_new (DocInfoDialog, 1); + + data_dir = gedit_plugin_get_data_dir (data->plugin); + ui_file = g_build_filename (data_dir, "docinfo.ui", NULL); + ret = gedit_utils_get_ui_objects (ui_file, + NULL, + &error_widget, + "dialog", &dialog->dialog, + "docinfo_dialog_content", &content, + "file_name_label", &dialog->file_name_label, + "words_label", &dialog->words_label, + "bytes_label", &dialog->bytes_label, + "lines_label", &dialog->lines_label, + "chars_label", &dialog->chars_label, + "chars_ns_label", &dialog->chars_ns_label, + "selection_vbox", &dialog->selection_vbox, + "selected_words_label", &dialog->selected_words_label, + "selected_bytes_label", &dialog->selected_bytes_label, + "selected_lines_label", &dialog->selected_lines_label, + "selected_chars_label", &dialog->selected_chars_label, + "selected_chars_ns_label", &dialog->selected_chars_ns_label, + NULL); + + g_free (data_dir); + g_free (ui_file); + + if (!ret) + { + const gchar *err_message; + + err_message = gtk_label_get_label (GTK_LABEL (error_widget)); + gedit_warning (GTK_WINDOW (window), "%s", err_message); + + g_free (dialog); + gtk_widget_destroy (error_widget); + + return NULL; + } + + gtk_dialog_set_default_response (GTK_DIALOG (dialog->dialog), + GTK_RESPONSE_OK); + gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), + GTK_WINDOW (window)); + + g_signal_connect (dialog->dialog, + "destroy", + G_CALLBACK (docinfo_dialog_destroy_cb), + data); + g_signal_connect (dialog->dialog, + "response", + G_CALLBACK (docinfo_dialog_response_cb), + window); + + return dialog; +} + +static void +calculate_info (GeditDocument *doc, + GtkTextIter *start, + GtkTextIter *end, + gint *chars, + gint *words, + gint *white_chars, + gint *bytes) +{ + gchar *text; + + gedit_debug (DEBUG_PLUGINS); + + text = gtk_text_buffer_get_slice (GTK_TEXT_BUFFER (doc), + start, + end, + TRUE); + + *chars = g_utf8_strlen (text, -1); + *bytes = strlen (text); + + if (*chars > 0) + { + PangoLogAttr *attrs; + gint i; + + attrs = g_new0 (PangoLogAttr, *chars + 1); + + pango_get_log_attrs (text, + -1, + 0, + pango_language_from_string ("C"), + attrs, + *chars + 1); + + for (i = 0; i < (*chars); i++) + { + if (attrs[i].is_white) + ++(*white_chars); + + if (attrs[i].is_word_start) + ++(*words); + } + + g_free (attrs); + } + else + { + *white_chars = 0; + *words = 0; + } + + g_free (text); +} + +static void +docinfo_real (GeditDocument *doc, + DocInfoDialog *dialog) +{ + GtkTextIter start, end; + gint words = 0; + gint chars = 0; + gint white_chars = 0; + gint lines = 0; + gint bytes = 0; + gchar *tmp_str; + gchar *doc_name; + + gedit_debug (DEBUG_PLUGINS); + + gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (doc), + &start, + &end); + + lines = gtk_text_buffer_get_line_count (GTK_TEXT_BUFFER (doc)); + + calculate_info (doc, + &start, &end, + &chars, &words, &white_chars, &bytes); + + if (chars == 0) + lines = 0; + + gedit_debug_message (DEBUG_PLUGINS, "Chars: %d", chars); + gedit_debug_message (DEBUG_PLUGINS, "Lines: %d", lines); + gedit_debug_message (DEBUG_PLUGINS, "Words: %d", words); + gedit_debug_message (DEBUG_PLUGINS, "Chars non-space: %d", chars - white_chars); + gedit_debug_message (DEBUG_PLUGINS, "Bytes: %d", bytes); + + doc_name = gedit_document_get_short_name_for_display (doc); + tmp_str = g_strdup_printf ("%s", doc_name); + gtk_label_set_markup (GTK_LABEL (dialog->file_name_label), tmp_str); + g_free (doc_name); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", lines); + gtk_label_set_text (GTK_LABEL (dialog->lines_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", words); + gtk_label_set_text (GTK_LABEL (dialog->words_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", chars); + gtk_label_set_text (GTK_LABEL (dialog->chars_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", chars - white_chars); + gtk_label_set_text (GTK_LABEL (dialog->chars_ns_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", bytes); + gtk_label_set_text (GTK_LABEL (dialog->bytes_label), tmp_str); + g_free (tmp_str); +} + +static void +selectioninfo_real (GeditDocument *doc, + DocInfoDialog *dialog) +{ + gboolean sel; + GtkTextIter start, end; + gint words = 0; + gint chars = 0; + gint white_chars = 0; + gint lines = 0; + gint bytes = 0; + gchar *tmp_str; + + gedit_debug (DEBUG_PLUGINS); + + sel = gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), + &start, + &end); + + if (sel) + { + lines = gtk_text_iter_get_line (&end) - gtk_text_iter_get_line (&start) + 1; + + calculate_info (doc, + &start, &end, + &chars, &words, &white_chars, &bytes); + + gedit_debug_message (DEBUG_PLUGINS, "Selected chars: %d", chars); + gedit_debug_message (DEBUG_PLUGINS, "Selected lines: %d", lines); + gedit_debug_message (DEBUG_PLUGINS, "Selected words: %d", words); + gedit_debug_message (DEBUG_PLUGINS, "Selected chars non-space: %d", chars - white_chars); + gedit_debug_message (DEBUG_PLUGINS, "Selected bytes: %d", bytes); + + gtk_widget_set_sensitive (dialog->selection_vbox, TRUE); + } + else + { + gtk_widget_set_sensitive (dialog->selection_vbox, FALSE); + + gedit_debug_message (DEBUG_PLUGINS, "Selection empty"); + } + + if (chars == 0) + lines = 0; + + tmp_str = g_strdup_printf("%d", lines); + gtk_label_set_text (GTK_LABEL (dialog->selected_lines_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", words); + gtk_label_set_text (GTK_LABEL (dialog->selected_words_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", chars); + gtk_label_set_text (GTK_LABEL (dialog->selected_chars_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", chars - white_chars); + gtk_label_set_text (GTK_LABEL (dialog->selected_chars_ns_label), tmp_str); + g_free (tmp_str); + + tmp_str = g_strdup_printf("%d", bytes); + gtk_label_set_text (GTK_LABEL (dialog->selected_bytes_label), tmp_str); + g_free (tmp_str); +} + +static void +docinfo_cb (GtkAction *action, + GeditWindow *window) +{ + GeditDocument *doc; + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + data = (WindowData *) g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + + doc = gedit_window_get_active_document (window); + g_return_if_fail (doc != NULL); + + if (data->dialog != NULL) + { + gtk_window_present (GTK_WINDOW (data->dialog->dialog)); + gtk_widget_grab_focus (GTK_WIDGET (data->dialog->dialog)); + } + else + { + DocInfoDialog *dialog; + + dialog = get_docinfo_dialog (window, data); + g_return_if_fail (dialog != NULL); + + data->dialog = dialog; + + gtk_widget_show (GTK_WIDGET (dialog->dialog)); + } + + docinfo_real (doc, + data->dialog); + selectioninfo_real (doc, + data->dialog); +} + +static void +docinfo_dialog_response_cb (GtkDialog *widget, + gint res_id, + GeditWindow *window) +{ + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + data = (WindowData *) g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + + switch (res_id) + { + case GTK_RESPONSE_CLOSE: + { + gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_CLOSE"); + gtk_widget_destroy (data->dialog->dialog); + + break; + } + + case GTK_RESPONSE_OK: + { + GeditDocument *doc; + + gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_OK"); + + doc = gedit_window_get_active_document (window); + g_return_if_fail (doc != NULL); + + docinfo_real (doc, + data->dialog); + + selectioninfo_real (doc, + data->dialog); + + break; + } + } +} + +static const GtkActionEntry action_entries[] = +{ + { "DocumentStatistics", + NULL, + N_("_Document Statistics"), + NULL, + N_("Get statistical information on the current document"), + G_CALLBACK (docinfo_cb) } +}; + +static void +free_window_data (WindowData *data) +{ + g_return_if_fail (data != NULL); + + gedit_debug (DEBUG_PLUGINS); + + g_object_unref (data->plugin); + + g_object_unref (data->ui_action_group); + + if (data->dialog != NULL) + { + gtk_widget_destroy (data->dialog->dialog); + } + + g_free (data); +} + +static void +update_ui_real (GeditWindow *window, + WindowData *data) +{ + GeditView *view; + + gedit_debug (DEBUG_PLUGINS); + + view = gedit_window_get_active_view (window); + + gtk_action_group_set_sensitive (data->ui_action_group, + (view != NULL)); + + if (data->dialog != NULL) + { + gtk_dialog_set_response_sensitive (GTK_DIALOG (data->dialog->dialog), + GTK_RESPONSE_OK, + (view != NULL)); + } +} + +static void +gedit_docinfo_plugin_init (GeditDocInfoPlugin *plugin) +{ + gedit_debug_message (DEBUG_PLUGINS, "GeditDocInfoPlugin initializing"); +} + +static void +gedit_docinfo_plugin_finalize (GObject *object) +{ + gedit_debug_message (DEBUG_PLUGINS, "GeditDocInfoPlugin finalizing"); + + G_OBJECT_CLASS (gedit_docinfo_plugin_parent_class)->finalize (object); +} + +static void +impl_activate (GeditPlugin *plugin, + GeditWindow *window) +{ + GtkUIManager *manager; + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + data = g_new (WindowData, 1); + + data->plugin = g_object_ref (plugin); + data->dialog = NULL; + data->ui_action_group = gtk_action_group_new ("GeditDocInfoPluginActions"); + + gtk_action_group_set_translation_domain (data->ui_action_group, + GETTEXT_PACKAGE); + gtk_action_group_add_actions (data->ui_action_group, + action_entries, + G_N_ELEMENTS (action_entries), + window); + + manager = gedit_window_get_ui_manager (window); + gtk_ui_manager_insert_action_group (manager, + data->ui_action_group, + -1); + + data->ui_id = gtk_ui_manager_new_merge_id (manager); + + g_object_set_data_full (G_OBJECT (window), + WINDOW_DATA_KEY, + data, + (GDestroyNotify) free_window_data); + + gtk_ui_manager_add_ui (manager, + data->ui_id, + MENU_PATH, + "DocumentStatistics", + "DocumentStatistics", + GTK_UI_MANAGER_MENUITEM, + FALSE); + + update_ui_real (window, + data); +} + +static void +impl_deactivate (GeditPlugin *plugin, + GeditWindow *window) +{ + GtkUIManager *manager; + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + manager = gedit_window_get_ui_manager (window); + + data = (WindowData *) g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + g_return_if_fail (data != NULL); + + gtk_ui_manager_remove_ui (manager, + data->ui_id); + gtk_ui_manager_remove_action_group (manager, + data->ui_action_group); + + g_object_set_data (G_OBJECT (window), + WINDOW_DATA_KEY, + NULL); +} + +static void +impl_update_ui (GeditPlugin *plugin, + GeditWindow *window) +{ + WindowData *data; + + gedit_debug (DEBUG_PLUGINS); + + data = (WindowData *) g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + g_return_if_fail (data != NULL); + + update_ui_real (window, + data); +} + +static void +gedit_docinfo_plugin_class_init (GeditDocInfoPluginClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + + object_class->finalize = gedit_docinfo_plugin_finalize; + + plugin_class->activate = impl_activate; + plugin_class->deactivate = impl_deactivate; + plugin_class->update_ui = impl_update_ui; +} diff --git a/plugins/docinfo/gedit-docinfo-plugin.h b/plugins/docinfo/gedit-docinfo-plugin.h new file mode 100755 index 00000000..36d6bddc --- /dev/null +++ b/plugins/docinfo/gedit-docinfo-plugin.h @@ -0,0 +1,75 @@ +/* + * gedit-docinfo-plugin.h + * + * Copyright (C) 2002-2005 Paolo Maggi + * + * 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, 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. + * + * $Id$ + */ + +#ifndef __GEDIT_DOCINFO_PLUGIN_H__ +#define __GEDIT_DOCINFO_PLUGIN_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_DOCINFO_PLUGIN (gedit_docinfo_plugin_get_type ()) +#define GEDIT_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPlugin)) +#define GEDIT_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPluginClass)) +#define GEDIT_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_DOCINFO_PLUGIN)) +#define GEDIT_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_DOCINFO_PLUGIN)) +#define GEDIT_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_DOCINFO_PLUGIN, GeditDocInfoPluginClass)) + +/* Private structure type */ +typedef struct _GeditDocInfoPluginPrivate GeditDocInfoPluginPrivate; + +/* + * Main object structure + */ +typedef struct _GeditDocInfoPlugin GeditDocInfoPlugin; + +struct _GeditDocInfoPlugin +{ + GeditPlugin parent_instance; +}; + +/* + * Class definition + */ +typedef struct _GeditDocInfoPluginClass GeditDocInfoPluginClass; + +struct _GeditDocInfoPluginClass +{ + GeditPluginClass parent_class; +}; + +/* + * Public methods + */ +GType gedit_docinfo_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __GEDIT_DOCINFO_PLUGIN_H__ */ diff --git a/plugins/externaltools/Makefile.am b/plugins/externaltools/Makefile.am new file mode 100755 index 00000000..f529640c --- /dev/null +++ b/plugins/externaltools/Makefile.am @@ -0,0 +1,15 @@ +# External Tools plugin +SUBDIRS = tools data scripts +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +plugin_in_files = externaltools.gedit-plugin.desktop.in +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +EXTRA_DIST = $(plugin_in_files) + +CLEANFILES = $(plugin_DATA) +DISTCLEANFILES = $(plugin_DATA) + +-include $(top_srcdir)/git.mk diff --git a/plugins/externaltools/data/Makefile.am b/plugins/externaltools/data/Makefile.am new file mode 100755 index 00000000..ae3a1c66 --- /dev/null +++ b/plugins/externaltools/data/Makefile.am @@ -0,0 +1,65 @@ +TOOL_MERGE=$(top_srcdir)/plugins/externaltools/scripts/gedit-tool-merge.pl + +tools_in_files = \ + build.tool.in \ + remove-trailing-spaces.tool.in + +tools_in_linux = \ + open-terminal-here.tool.in \ + run-command.tool.in + +tools_in_osx = \ + open-terminal-here-osx.tool.in + +tools_in_win32 = + +install_tools_in_files = $(tools_in_files) + +if PLATFORM_OSX +install_tools_in_files += $(tools_in_osx) +else +if PLATFORM_WIN32 +install_tools_in_files += $(tools_in_win32) +else +install_tools_in_files += $(tools_in_linux) +endif +endif + +desktop_in_files = $(install_tools_in_files:.tool.in=.desktop.in) +desktop_files = $(install_tools_in_files:.tool.in=.desktop) + +tools_SCRIPTS = $(install_tools_in_files:.tool.in=) +toolsdir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/tools + +all_tools_in_files = \ + $(tools_in_files) \ + $(tools_in_linux) \ + $(tools_in_osx) \ + $(tools_in_win32) + +all_desktop_in_files = $(all_tools_in_files:.tool.in=.desktop.in) +all_desktop_files = $(all_tools_in_files:.tool.in=.desktop) +all_tools_files = $(all_tools_in_files:.tool.in=) + +@INTLTOOL_DESKTOP_RULE@ + +# Tools are generated by merging a script file (.tool.in) with a data file +# (.desktop), which happens to be translated using intltool. +$(tools_SCRIPTS): %: %.tool.in %.desktop $(TOOL_MERGE) + perl $(TOOL_MERGE) -o $@ $< $(word 2,$^) + chmod 755 $@ + +EXTRA_DIST = \ + $(all_desktop_in_files) \ + $(all_tools_in_files) + +CLEANFILES = \ + $(all_desktop_files) \ + $(all_tools_files) + +DISTCLEANFILES = \ + $(all_desktop_files) \ + $(all_tools_files) + + +-include $(top_srcdir)/git.mk diff --git a/plugins/externaltools/data/build.desktop.in b/plugins/externaltools/data/build.desktop.in new file mode 100755 index 00000000..13767ee7 --- /dev/null +++ b/plugins/externaltools/data/build.desktop.in @@ -0,0 +1,9 @@ +[Gedit Tool] +_Name=Build +_Comment=Run "make" in the document directory +Input=nothing +Output=output-panel +Shortcut=F8 +Applicability=local +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/build.tool.in b/plugins/externaltools/data/build.tool.in new file mode 100755 index 00000000..0b81d5b6 --- /dev/null +++ b/plugins/externaltools/data/build.tool.in @@ -0,0 +1,15 @@ +#!/bin/sh + +EHOME=`echo $HOME | sed "s/#/\#/"` +DIR=$GEDIT_CURRENT_DOCUMENT_DIR +while test "$DIR" != "/"; do + for m in GNUmakefile makefile Makefile; do + if [ -f "${DIR}/${m}" ]; then + echo "Using ${m} from ${DIR}" | sed "s#$EHOME#~#" > /dev/stderr + make -C "${DIR}" + exit + fi + done + DIR=`dirname "${DIR}"` +done +echo "No Makefile found!" > /dev/stderr diff --git a/plugins/externaltools/data/open-terminal-here-osx.desktop.in b/plugins/externaltools/data/open-terminal-here-osx.desktop.in new file mode 100755 index 00000000..801b003c --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here-osx.desktop.in @@ -0,0 +1,8 @@ +[Gedit Tool] +_Name=Open terminal here +_Comment=Open a terminal in the document location +Input=nothing +Output=output-panel +Applicability=local +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/open-terminal-here-osx.tool.in b/plugins/externaltools/data/open-terminal-here-osx.tool.in new file mode 100755 index 00000000..c3360064 --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here-osx.tool.in @@ -0,0 +1,16 @@ +#!/usr/bin/osascript + +set the_path to system attribute "GEDIT_CURRENT_DOCUMENT_DIR" +set cmd to "cd " & quoted form of the_path + +tell application "System Events" to set terminalIsRunning to exists application process "Terminal" + +tell application "Terminal" + activate + + if terminalIsRunning is true then + do script with command cmd + else + do script with command cmd in window 1 + end if +end tell diff --git a/plugins/externaltools/data/open-terminal-here.desktop.in b/plugins/externaltools/data/open-terminal-here.desktop.in new file mode 100755 index 00000000..801b003c --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here.desktop.in @@ -0,0 +1,8 @@ +[Gedit Tool] +_Name=Open terminal here +_Comment=Open a terminal in the document location +Input=nothing +Output=output-panel +Applicability=local +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/open-terminal-here.tool.in b/plugins/externaltools/data/open-terminal-here.tool.in new file mode 100755 index 00000000..d2dda8db --- /dev/null +++ b/plugins/externaltools/data/open-terminal-here.tool.in @@ -0,0 +1,4 @@ +#!/bin/sh + +#TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec" +mate-terminal --working-directory=$GEDIT_CURRENT_DOCUMENT_DIR & diff --git a/plugins/externaltools/data/remove-trailing-spaces.desktop.in b/plugins/externaltools/data/remove-trailing-spaces.desktop.in new file mode 100755 index 00000000..99b8b703 --- /dev/null +++ b/plugins/externaltools/data/remove-trailing-spaces.desktop.in @@ -0,0 +1,9 @@ +[Gedit Tool] +_Name=Remove trailing spaces +_Comment=Remove useless trailing spaces in your file +Input=document +Output=replace-document +Shortcut=F12 +Applicability=all +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/remove-trailing-spaces.tool.in b/plugins/externaltools/data/remove-trailing-spaces.tool.in new file mode 100755 index 00000000..83e4c19b --- /dev/null +++ b/plugins/externaltools/data/remove-trailing-spaces.tool.in @@ -0,0 +1,3 @@ +#!/bin/sh + +sed 's/[[:blank:]]*$//' diff --git a/plugins/externaltools/data/run-command.desktop.in b/plugins/externaltools/data/run-command.desktop.in new file mode 100755 index 00000000..b58294b0 --- /dev/null +++ b/plugins/externaltools/data/run-command.desktop.in @@ -0,0 +1,8 @@ +[Gedit Tool] +_Name=Run command +_Comment=Execute a custom command and put its output in a new document +Input=nothing +Output=new-document +Applicability=all +Save-files=nothing +Languages= diff --git a/plugins/externaltools/data/run-command.tool.in b/plugins/externaltools/data/run-command.tool.in new file mode 100755 index 00000000..ee611bbb --- /dev/null +++ b/plugins/externaltools/data/run-command.tool.in @@ -0,0 +1,4 @@ +#!/bin/sh + +#TODO: use "mateconftool-2 -g /desktop/mate/applications/terminal/exec" +exec `matedialog --entry --title="Run command - gedit" --text="Command to run"` diff --git a/plugins/externaltools/externaltools.gedit-plugin.desktop.in b/plugins/externaltools/externaltools.gedit-plugin.desktop.in new file mode 100755 index 00000000..5212c49b --- /dev/null +++ b/plugins/externaltools/externaltools.gedit-plugin.desktop.in @@ -0,0 +1,9 @@ +[Gedit Plugin] +Loader=python +Module=externaltools +IAge=2 +_Name=External Tools +_Description=Execute external commands and shell scripts. +Authors=Steve Frécinaux +Copyright=Copyright © 2005 Steve Frécinaux +Website=http://www.gedit.org diff --git a/plugins/externaltools/scripts/Makefile.am b/plugins/externaltools/scripts/Makefile.am new file mode 100755 index 00000000..4ff8060b --- /dev/null +++ b/plugins/externaltools/scripts/Makefile.am @@ -0,0 +1,4 @@ +EXTRA_DIST = gedit-tool-merge.pl + + +-include $(top_srcdir)/git.mk diff --git a/plugins/externaltools/scripts/gedit-tool-merge.pl b/plugins/externaltools/scripts/gedit-tool-merge.pl new file mode 100755 index 00000000..780d95dd --- /dev/null +++ b/plugins/externaltools/scripts/gedit-tool-merge.pl @@ -0,0 +1,78 @@ +#!/usr/bin/perl + +# gedit-tool-merge.pl +# This file is part of gedit +# +# Copyright (C) 2006 - Steve Frécinaux +# +# gedit 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. +# +# gedit 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 gedit; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA + +# This script merges a script file with a desktop file containing +# metadata about the external tool. This is required in order to +# have translatable tools (bug #342042) since intltool can't extract +# string directly from tool files (a tool file being the combination +# of a script file and a metadata section). +# +# The desktop file is embedded in a comment of the script file, under +# the assumption that any scripting language supports # as a comment +# mark (this is likely to be true since the shebang uses #!). The +# section is placed at the top of the tool file, after the shebang and +# modelines if present. + +use strict; +use warnings; +use Getopt::Long; + +sub usage { + print < \$help, "output|o=s" => \$output) or &usage; +usage if $help or @ARGV lt 2; + +open INFILE, "<", $ARGV[0]; +open DFILE, "<", $ARGV[1]; +open STDOUT, ">", $output if $output; + +# Put shebang and various modelines at the top of the generated file. +$_ = ; +print and $_ = if /^#!/; +print and $_ = if /-\*-/; +print and $_ = if /(ex|vi|vim):/; + +# Put a blank line before the info block if there is one in INFILE. +print and $_ = if /^\s*$/; +seek INFILE, -length, 1; + +# Embed the desktop file... +print "# $_" while ; +print "\n"; + +# ...and write the remaining part of the script. +print while ; + +close INFILE; +close DFILE; +close STDOUT; diff --git a/plugins/externaltools/tools/Makefile.am b/plugins/externaltools/tools/Makefile.am new file mode 100755 index 00000000..5edcab58 --- /dev/null +++ b/plugins/externaltools/tools/Makefile.am @@ -0,0 +1,23 @@ +# Python snippets plugin + +plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/externaltools +plugin_PYTHON = \ + __init__.py \ + capture.py \ + library.py \ + functions.py \ + manager.py \ + outputpanel.py \ + filelookup.py \ + linkparsing.py + +uidir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/ui +ui_DATA = tools.ui \ + outputpanel.ui + +EXTRA_DIST = $(ui_DATA) + +CLEANFILES = *.bak *.gladep +DISTCLEANFILES = *.bak *.gladep + +-include $(top_srcdir)/git.mk diff --git a/plugins/externaltools/tools/__init__.py b/plugins/externaltools/tools/__init__.py new file mode 100755 index 00000000..a46aef8f --- /dev/null +++ b/plugins/externaltools/tools/__init__.py @@ -0,0 +1,281 @@ +# -*- coding: UTF-8 -*- +# Gedit External Tools plugin +# Copyright (C) 2005-2006 Steve Frécinaux +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +__all__ = ('ExternalToolsPlugin', 'ExternalToolsWindowHelper', + 'Manager', 'OutputPanel', 'Capture', 'UniqueById') + +import gedit +import gtk +from manager import Manager +from library import ToolLibrary +from outputpanel import OutputPanel +from capture import Capture +from functions import * + +class ToolMenu(object): + ACTION_HANDLER_DATA_KEY = "ExternalToolActionHandlerData" + ACTION_ITEM_DATA_KEY = "ExternalToolActionItemData" + + def __init__(self, library, window, menupath): + super(ToolMenu, self).__init__() + self._library = library + self._window = window + self._menupath = menupath + + self._merge_id = 0 + self._action_group = gtk.ActionGroup("ExternalToolsPluginToolActions") + self._signals = [] + + self.update() + + def deactivate(self): + self.remove() + + def remove(self): + if self._merge_id != 0: + self._window.get_ui_manager().remove_ui(self._merge_id) + self._window.get_ui_manager().remove_action_group(self._action_group) + self._merge_id = 0 + + for action in self._action_group.list_actions(): + handler = action.get_data(self.ACTION_HANDLER_DATA_KEY) + + if handler is not None: + action.disconnect(handler) + + action.set_data(self.ACTION_ITEM_DATA_KEY, None) + action.set_data(self.ACTION_HANDLER_DATA_KEY, None) + + self._action_group.remove_action(action) + + accelmap = gtk.accel_map_get() + + for s in self._signals: + accelmap.disconnect(s) + + self._signals = [] + + def _insert_directory(self, directory, path): + manager = self._window.get_ui_manager() + + for item in directory.subdirs: + action_name = 'ExternalToolDirectory%X' % id(item) + action = gtk.Action(action_name, item.name.replace('_', '__'), None, None) + self._action_group.add_action(action) + + manager.add_ui(self._merge_id, path, + action_name, action_name, + gtk.UI_MANAGER_MENU, False) + + self._insert_directory(item, path + '/' + action_name) + + for item in directory.tools: + action_name = 'ExternalToolTool%X' % id(item) + action = gtk.Action(action_name, item.name.replace('_', '__'), item.comment, None) + handler = action.connect("activate", capture_menu_action, self._window, item) + + action.set_data(self.ACTION_ITEM_DATA_KEY, item) + action.set_data(self.ACTION_HANDLER_DATA_KEY, handler) + + # Make sure to replace accel + accelpath = '/ExternalToolsPluginToolActions/%s' % (action_name, ) + + if item.shortcut: + key, mod = gtk.accelerator_parse(item.shortcut) + gtk.accel_map_change_entry(accelpath, key, mod, True) + + self._signals.append(gtk.accel_map_get().connect('changed::%s' % (accelpath,), self.on_accelmap_changed, item)) + + self._action_group.add_action_with_accel(action, item.shortcut) + + manager.add_ui(self._merge_id, path, + action_name, action_name, + gtk.UI_MANAGER_MENUITEM, False) + + def on_accelmap_changed(self, accelmap, path, key, mod, tool): + tool.shortcut = gtk.accelerator_name(key, mod) + tool.save() + + self._window.get_data("ExternalToolsPluginWindowData").update_manager(tool) + + def update(self): + self.remove() + self._merge_id = self._window.get_ui_manager().new_merge_id() + self._insert_directory(self._library.tree, self._menupath) + self._window.get_ui_manager().insert_action_group(self._action_group, -1) + self.filter(self._window.get_active_document()) + + def filter_language(self, language, item): + if not item.languages: + return True + + if not language and 'plain' in item.languages: + return True + + if language and (language.get_id() in item.languages): + return True + else: + return False + + def filter(self, document): + if document is None: + return + + titled = document.get_uri() is not None + remote = not document.is_local() + + states = { + 'all' : True, + 'local': titled and not remote, + 'remote': titled and remote, + 'titled': titled, + 'untitled': not titled, + } + + language = document.get_language() + + for action in self._action_group.list_actions(): + item = action.get_data(self.ACTION_ITEM_DATA_KEY) + + if item is not None: + action.set_visible(states[item.applicability] and self.filter_language(language, item)) + +class ExternalToolsWindowHelper(object): + def __init__(self, plugin, window): + super(ExternalToolsWindowHelper, self).__init__() + + self._window = window + self._plugin = plugin + self._library = ToolLibrary() + + manager = window.get_ui_manager() + + self._action_group = gtk.ActionGroup('ExternalToolsPluginActions') + self._action_group.set_translation_domain('gedit') + self._action_group.add_actions([('ExternalToolManager', + None, + _('Manage _External Tools...'), + None, + _("Opens the External Tools Manager"), + lambda action: plugin.open_dialog()), + ('ExternalTools', + None, + _('External _Tools'), + None, + _("External tools"), + None)]) + manager.insert_action_group(self._action_group, -1) + + ui_string = """ + + + + + + + + + + + + + + + + """ + + self._merge_id = manager.add_ui_from_string(ui_string) + + self.menu = ToolMenu(self._library, self._window, + "/MenuBar/ToolsMenu/ToolsOps_4/ExternalToolsMenu/ExternalToolPlaceholder") + manager.ensure_update() + + # Create output console + self._output_buffer = OutputPanel(self._plugin.get_data_dir(), window) + bottom = window.get_bottom_panel() + bottom.add_item(self._output_buffer.panel, + _("Shell Output"), + gtk.STOCK_EXECUTE) + + def update_ui(self): + self.menu.filter(self._window.get_active_document()) + self._window.get_ui_manager().ensure_update() + + def deactivate(self): + manager = self._window.get_ui_manager() + self.menu.deactivate() + manager.remove_ui(self._merge_id) + manager.remove_action_group(self._action_group) + manager.ensure_update() + + bottom = self._window.get_bottom_panel() + bottom.remove_item(self._output_buffer.panel) + + def update_manager(self, tool): + self._plugin.update_manager(tool) + +class ExternalToolsPlugin(gedit.Plugin): + WINDOW_DATA_KEY = "ExternalToolsPluginWindowData" + + def __init__(self): + super(ExternalToolsPlugin, self).__init__() + + self._manager = None + self._manager_default_size = None + + ToolLibrary().set_locations(os.path.join(self.get_data_dir(), 'tools')) + + def activate(self, window): + helper = ExternalToolsWindowHelper(self, window) + window.set_data(self.WINDOW_DATA_KEY, helper) + + def deactivate(self, window): + window.get_data(self.WINDOW_DATA_KEY).deactivate() + window.set_data(self.WINDOW_DATA_KEY, None) + + def update_ui(self, window): + window.get_data(self.WINDOW_DATA_KEY).update_ui() + + def create_configure_dialog(self): + return self.open_dialog() + + def open_dialog(self): + if not self._manager: + self._manager = Manager(self.get_data_dir()) + + if self._manager_default_size: + self._manager.dialog.set_default_size(*self._manager_default_size) + + self._manager.dialog.connect('destroy', self.on_manager_destroy) + + window = gedit.app_get_default().get_active_window() + self._manager.run(window) + + return self._manager.dialog + + def update_manager(self, tool): + if not self._manager: + return + + self._manager.tool_changed(tool, True) + + def on_manager_destroy(self, dialog): + self._manager_default_size = [dialog.allocation.width, dialog.allocation.height] + self._manager = None + +# ex:ts=4:et: diff --git a/plugins/externaltools/tools/capture.py b/plugins/externaltools/tools/capture.py new file mode 100755 index 00000000..e47862c8 --- /dev/null +++ b/plugins/externaltools/tools/capture.py @@ -0,0 +1,214 @@ +# -*- coding: utf-8 -*- +# Gedit External Tools plugin +# Copyright (C) 2005-2006 Steve Frécinaux +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +__all__ = ('Capture', ) + +import os, sys, signal +import locale +import subprocess +import gobject +import fcntl +import glib + +class Capture(gobject.GObject): + CAPTURE_STDOUT = 0x01 + CAPTURE_STDERR = 0x02 + CAPTURE_BOTH = 0x03 + CAPTURE_NEEDS_SHELL = 0x04 + + WRITE_BUFFER_SIZE = 0x4000 + + __gsignals__ = { + 'stdout-line' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING,)), + 'stderr-line' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING,)), + 'begin-execute': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, tuple()), + 'end-execute' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT,)) + } + + def __init__(self, command, cwd = None, env = {}): + gobject.GObject.__init__(self) + self.pipe = None + self.env = env + self.cwd = cwd + self.flags = self.CAPTURE_BOTH | self.CAPTURE_NEEDS_SHELL + self.command = command + self.input_text = None + + def set_env(self, **values): + self.env.update(**values) + + def set_command(self, command): + self.command = command + + def set_flags(self, flags): + self.flags = flags + + def set_input(self, text): + self.input_text = text + + def set_cwd(self, cwd): + self.cwd = cwd + + def execute(self): + if self.command is None: + return + + # Initialize pipe + popen_args = { + 'cwd' : self.cwd, + 'shell': self.flags & self.CAPTURE_NEEDS_SHELL, + 'env' : self.env + } + + if self.input_text is not None: + popen_args['stdin'] = subprocess.PIPE + if self.flags & self.CAPTURE_STDOUT: + popen_args['stdout'] = subprocess.PIPE + if self.flags & self.CAPTURE_STDERR: + popen_args['stderr'] = subprocess.PIPE + + self.tried_killing = False + self.idle_write_id = 0 + self.read_buffer = '' + + try: + self.pipe = subprocess.Popen(self.command, **popen_args) + except OSError, e: + self.pipe = None + self.emit('stderr-line', _('Could not execute command: %s') % (e, )) + return + + # Signal + self.emit('begin-execute') + + if self.flags & self.CAPTURE_STDOUT: + # Set non blocking + flags = fcntl.fcntl(self.pipe.stdout.fileno(), fcntl.F_GETFL) | os.O_NONBLOCK + fcntl.fcntl(self.pipe.stdout.fileno(), fcntl.F_SETFL, flags) + + gobject.io_add_watch(self.pipe.stdout, + gobject.IO_IN | gobject.IO_HUP, + self.on_output) + + if self.flags & self.CAPTURE_STDERR: + # Set non blocking + flags = fcntl.fcntl(self.pipe.stderr.fileno(), fcntl.F_GETFL) | os.O_NONBLOCK + fcntl.fcntl(self.pipe.stderr.fileno(), fcntl.F_SETFL, flags) + + gobject.io_add_watch(self.pipe.stderr, + gobject.IO_IN | gobject.IO_HUP, + self.on_output) + + # IO + if self.input_text is not None: + # Write async, in chunks of something + self.write_buffer = str(self.input_text) + + if self.idle_write_chunk(): + self.idle_write_id = gobject.idle_add(self.idle_write_chunk) + + # Wait for the process to complete + gobject.child_watch_add(self.pipe.pid, self.on_child_end) + + def idle_write_chunk(self): + if not self.pipe: + self.idle_write_id = 0 + return False + + try: + l = len(self.write_buffer) + m = min(l, self.WRITE_BUFFER_SIZE) + + self.pipe.stdin.write(self.write_buffer[:m]) + + if m == l: + self.write_buffer = '' + self.pipe.stdin.close() + + self.idle_write_id = 0 + + return False + else: + self.write_buffer = self.write_buffer[m:] + return True + except IOError: + self.pipe.stdin.close() + self.idle_write_id = 0 + + return False + + def on_output(self, source, condition): + if condition & (glib.IO_IN | glib.IO_PRI): + line = source.read() + + if len(line) > 0: + try: + line = unicode(line, 'utf-8') + except: + line = unicode(line, + locale.getdefaultlocale()[1], + 'replace') + + self.read_buffer += line + lines = self.read_buffer.splitlines(True) + + if not lines[-1].endswith("\n"): + self.read_buffer = lines[-1] + lines = lines[0:-1] + else: + self.read_buffer = '' + + for line in lines: + if not self.pipe or source == self.pipe.stdout: + self.emit('stdout-line', line) + else: + self.emit('stderr-line', line) + + if condition & ~(glib.IO_IN | glib.IO_PRI): + if self.read_buffer: + if source == self.pipe.stdout: + self.emit('stdout-line', self.read_buffer) + else: + self.emit('stderr-line', self.read_buffer) + + self.read_buffer = '' + + self.pipe = None + + return False + else: + return True + + def stop(self, error_code = -1): + if self.pipe is not None: + if self.idle_write_id: + gobject.source_remove(self.idle_write_id) + self.idle_write_id = 0 + + if not self.tried_killing: + os.kill(self.pipe.pid, signal.SIGTERM) + self.tried_killing = True + else: + os.kill(self.pipe.pid, signal.SIGKILL) + + def on_child_end(self, pid, error_code): + # In an idle, so it is emitted after all the std*-line signals + # have been intercepted + gobject.idle_add(self.emit, 'end-execute', error_code) + +# ex:ts=4:et: diff --git a/plugins/externaltools/tools/filelookup.py b/plugins/externaltools/tools/filelookup.py new file mode 100755 index 00000000..229823b7 --- /dev/null +++ b/plugins/externaltools/tools/filelookup.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2009-2010 Per Arneng +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import gio +import gedit + +class FileLookup: + """ + This class is responsible for looking up files given a part or the whole + path of a real file. The lookup is delegated to providers wich use different + methods of trying to find the real file. + """ + + def __init__(self): + self.providers = [] + self.providers.append(AbsoluteFileLookupProvider()) + self.providers.append(CwdFileLookupProvider()) + self.providers.append(OpenDocumentRelPathFileLookupProvider()) + self.providers.append(OpenDocumentFileLookupProvider()) + + def lookup(self, path): + """ + Tries to find a file specified by the path parameter. It delegates to + different lookup providers and the first match is returned. If no file + was found then None is returned. + + path -- the path to find + """ + found_file = None + for provider in self.providers: + found_file = provider.lookup(path) + if found_file is not None: + break + + return found_file + + +class FileLookupProvider: + """ + The base class of all file lookup providers. + """ + + def lookup(self, path): + """ + This method must be implemented by subclasses. Implementors will be + given a path and will try to find a matching file. If no file is found + then None is returned. + """ + raise NotImplementedError("need to implement a lookup method") + + +class AbsoluteFileLookupProvider(FileLookupProvider): + """ + This file tries to see if the path given is an absolute path and that the + path references a file. + """ + + def lookup(self, path): + if os.path.isabs(path) and os.path.isfile(path): + return gio.File(path) + else: + return None + + +class CwdFileLookupProvider(FileLookupProvider): + """ + This lookup provider tries to find a file specified by the path relative to + the current working directory. + """ + + def lookup(self, path): + try: + cwd = os.getcwd() + except OSError: + cwd = os.getenv('HOME') + + real_path = os.path.join(cwd, path) + + if os.path.isfile(real_path): + return gio.File(real_path) + else: + return None + + +class OpenDocumentRelPathFileLookupProvider(FileLookupProvider): + """ + Tries to see if the path is relative to any directories where the + currently open documents reside in. Example: If you have a document opened + '/tmp/Makefile' and a lookup is made for 'src/test2.c' then this class + will try to find '/tmp/src/test2.c'. + """ + + def lookup(self, path): + if path.startswith('/'): + return None + + for doc in gedit.app_get_default().get_documents(): + if doc.is_local(): + location = doc.get_location() + if location: + rel_path = location.get_parent().get_path() + joined_path = os.path.join(rel_path, path) + if os.path.isfile(joined_path): + return gio.File(joined_path) + + return None + + +class OpenDocumentFileLookupProvider(FileLookupProvider): + """ + Makes a guess that the if the path that was looked for matches the end + of the path of a currently open document then that document is the one + that is looked for. Example: If a document is opened called '/tmp/t.c' + and a lookup is made for 't.c' or 'tmp/t.c' then both will match since + the open document ends with the path that is searched for. + """ + + def lookup(self, path): + if path.startswith('/'): + return None + + for doc in gedit.app_get_default().get_documents(): + if doc.is_local(): + location = doc.get_location() + if location and location.get_uri().endswith(path): + return location + return None + +# ex:ts=4:et: diff --git a/plugins/externaltools/tools/functions.py b/plugins/externaltools/tools/functions.py new file mode 100755 index 00000000..0d2bfdbf --- /dev/null +++ b/plugins/externaltools/tools/functions.py @@ -0,0 +1,303 @@ +# -*- coding: utf-8 -*- +# Gedit External Tools plugin +# Copyright (C) 2005-2006 Steve Frécinaux +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import gtk +from gtk import gdk +import gio +import gedit +#import gtksourceview +from outputpanel import OutputPanel +from capture import * + +def default(val, d): + if val is not None: + return val + else: + return d + +def current_word(document): + piter = document.get_iter_at_mark(document.get_insert()) + start = piter.copy() + + if not piter.starts_word() and (piter.inside_word() or piter.ends_word()): + start.backward_word_start() + + if not piter.ends_word() and piter.inside_word(): + piter.forward_word_end() + + return (start, piter) + +# ==== Capture related functions ==== +def run_external_tool(window, node): + # Configure capture environment + try: + cwd = os.getcwd() + except OSError: + cwd = os.getenv('HOME'); + + capture = Capture(node.command, cwd) + capture.env = os.environ.copy() + capture.set_env(GEDIT_CWD = cwd) + + view = window.get_active_view() + if view is not None: + # Environment vars relative to current document + document = view.get_buffer() + uri = document.get_uri() + + # Current line number + piter = document.get_iter_at_mark(document.get_insert()) + capture.set_env(GEDIT_CURRENT_LINE_NUMBER=str(piter.get_line() + 1)) + + # Current line text + piter.set_line_offset(0) + end = piter.copy() + + if not end.ends_line(): + end.forward_to_line_end() + + capture.set_env(GEDIT_CURRENT_LINE=piter.get_text(end)) + + # Selected text (only if input is not selection) + if node.input != 'selection' and node.input != 'selection-document': + bounds = document.get_selection_bounds() + + if bounds: + capture.set_env(GEDIT_SELECTED_TEXT=bounds[0].get_text(bounds[1])) + + bounds = current_word(document) + capture.set_env(GEDIT_CURRENT_WORD=bounds[0].get_text(bounds[1])) + + capture.set_env(GEDIT_CURRENT_DOCUMENT_TYPE=document.get_mime_type()) + + if uri is not None: + gfile = gio.File(uri) + scheme = gfile.get_uri_scheme() + name = os.path.basename(uri) + capture.set_env(GEDIT_CURRENT_DOCUMENT_URI = uri, + GEDIT_CURRENT_DOCUMENT_NAME = name, + GEDIT_CURRENT_DOCUMENT_SCHEME = scheme) + if gedit.utils.uri_has_file_scheme(uri): + path = gfile.get_path() + cwd = os.path.dirname(path) + capture.set_cwd(cwd) + capture.set_env(GEDIT_CURRENT_DOCUMENT_PATH = path, + GEDIT_CURRENT_DOCUMENT_DIR = cwd) + + documents_uri = [doc.get_uri() + for doc in window.get_documents() + if doc.get_uri() is not None] + documents_path = [gio.File(uri).get_path() + for uri in documents_uri + if gedit.utils.uri_has_file_scheme(uri)] + capture.set_env(GEDIT_DOCUMENTS_URI = ' '.join(documents_uri), + GEDIT_DOCUMENTS_PATH = ' '.join(documents_path)) + + flags = capture.CAPTURE_BOTH + + if not node.has_hash_bang(): + flags |= capture.CAPTURE_NEEDS_SHELL + + capture.set_flags(flags) + + # Get input text + input_type = node.input + output_type = node.output + + # Get the panel + panel = window.get_data("ExternalToolsPluginWindowData")._output_buffer + panel.clear() + + if output_type == 'output-panel': + panel.show() + + # Assign the error output to the output panel + panel.set_process(capture) + + if input_type != 'nothing' and view is not None: + if input_type == 'document': + start, end = document.get_bounds() + elif input_type == 'selection' or input_type == 'selection-document': + try: + start, end = document.get_selection_bounds() + + print start, end + except ValueError: + if input_type == 'selection-document': + start, end = document.get_bounds() + + if output_type == 'replace-selection': + document.select_range(start, end) + else: + start = document.get_iter_at_mark(document.get_insert()) + end = start.copy() + + elif input_type == 'line': + start = document.get_iter_at_mark(document.get_insert()) + end = start.copy() + if not start.starts_line(): + start.set_line_offset(0) + if not end.ends_line(): + end.forward_to_line_end() + elif input_type == 'word': + start = document.get_iter_at_mark(document.get_insert()) + end = start.copy() + if not start.inside_word(): + panel.write(_('You must be inside a word to run this command'), + panel.command_tag) + return + if not start.starts_word(): + start.backward_word_start() + if not end.ends_word(): + end.forward_word_end() + + input_text = document.get_text(start, end) + capture.set_input(input_text) + + # Assign the standard output to the chosen "file" + if output_type == 'new-document': + tab = window.create_tab(True) + view = tab.get_view() + document = tab.get_document() + pos = document.get_start_iter() + capture.connect('stdout-line', capture_stdout_line_document, document, pos) + document.begin_user_action() + view.set_editable(False) + view.set_cursor_visible(False) + elif output_type != 'output-panel' and output_type != 'nothing' and view is not None: + document.begin_user_action() + view.set_editable(False) + view.set_cursor_visible(False) + + if output_type == 'insert': + pos = document.get_iter_at_mark(document.get_mark('insert')) + elif output_type == 'replace-selection': + document.delete_selection(False, False) + pos = document.get_iter_at_mark(document.get_mark('insert')) + elif output_type == 'replace-document': + document.set_text('') + pos = document.get_end_iter() + else: + pos = document.get_end_iter() + capture.connect('stdout-line', capture_stdout_line_document, document, pos) + elif output_type != 'nothing': + capture.connect('stdout-line', capture_stdout_line_panel, panel) + document.begin_user_action() + + capture.connect('stderr-line', capture_stderr_line_panel, panel) + capture.connect('begin-execute', capture_begin_execute_panel, panel, view, node.name) + capture.connect('end-execute', capture_end_execute_panel, panel, view, output_type) + + # Run the command + capture.execute() + + if output_type != 'nothing': + document.end_user_action() + +class MultipleDocumentsSaver: + def __init__(self, window, docs, node): + self._window = window + self._node = node + self._error = False + + self._counter = len(docs) + self._signal_ids = {} + self._counter = 0 + + signals = {} + + for doc in docs: + signals[doc] = doc.connect('saving', self.on_document_saving) + gedit.commands.save_document(window, doc) + doc.disconnect(signals[doc]) + + def on_document_saving(self, doc, size, total_size): + self._counter += 1 + self._signal_ids[doc] = doc.connect('saved', self.on_document_saved) + + def on_document_saved(self, doc, error): + if error: + self._error = True + + doc.disconnect(self._signal_ids[doc]) + del self._signal_ids[doc] + + self._counter -= 1 + + if self._counter == 0 and not self._error: + run_external_tool(self._window, self._node) + +def capture_menu_action(action, window, node): + if node.save_files == 'document' and window.get_active_document(): + MultipleDocumentsSaver(window, [window.get_active_document()], node) + return + elif node.save_files == 'all': + MultipleDocumentsSaver(window, window.get_documents(), node) + return + + run_external_tool(window, node) + +def capture_stderr_line_panel(capture, line, panel): + if not panel.visible(): + panel.show() + + panel.write(line, panel.error_tag) + +def capture_begin_execute_panel(capture, panel, view, label): + view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gdk.Cursor(gdk.WATCH)) + + panel['stop'].set_sensitive(True) + panel.clear() + panel.write(_("Running tool:"), panel.italic_tag); + panel.write(" %s\n\n" % label, panel.bold_tag); + +def capture_end_execute_panel(capture, exit_code, panel, view, output_type): + panel['stop'].set_sensitive(False) + + if output_type in ('new-document','replace-document'): + doc = view.get_buffer() + start = doc.get_start_iter() + end = start.copy() + end.forward_chars(300) + + mtype = gio.content_type_guess(data=doc.get_text(start, end)) + lmanager = gedit.get_language_manager() + + language = lmanager.guess_language(doc.get_uri(), mtype) + + if language is not None: + doc.set_language(language) + + view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gdk.Cursor(gdk.XTERM)) + view.set_cursor_visible(True) + view.set_editable(True) + + if exit_code == 0: + panel.write("\n" + _("Done.") + "\n", panel.italic_tag) + else: + panel.write("\n" + _("Exited") + ":", panel.italic_tag) + panel.write(" %d\n" % exit_code, panel.bold_tag) + +def capture_stdout_line_panel(capture, line, panel): + panel.write(line) + +def capture_stdout_line_document(capture, line, document, pos): + document.insert(pos, line) + +# ex:ts=4:et: diff --git a/plugins/externaltools/tools/library.py b/plugins/externaltools/tools/library.py new file mode 100755 index 00000000..6eb6ff1a --- /dev/null +++ b/plugins/externaltools/tools/library.py @@ -0,0 +1,493 @@ +# -*- coding: utf-8 -*- +# Gedit External Tools plugin +# Copyright (C) 2006 Steve Frécinaux +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import re +import locale +import platform + +class Singleton(object): + _instance = None + + def __new__(cls, *args, **kwargs): + if not cls._instance: + cls._instance = super(Singleton, cls).__new__( + cls, *args, **kwargs) + cls._instance.__init_once__() + + return cls._instance + +class ToolLibrary(Singleton): + def __init_once__(self): + self.locations = [] + + def set_locations(self, datadir): + self.locations = [] + + if platform.platform() != 'Windows': + for d in self.get_xdg_data_dirs(): + self.locations.append(os.path.join(d, 'gedit-2', 'plugins', 'externaltools', 'tools')) + + self.locations.append(datadir) + + # self.locations[0] is where we save the custom scripts + if platform.platform() == 'Windows': + toolsdir = os.path.expanduser('~/gedit/tools') + else: + userdir = os.getenv('MATE22_USER_DIR') + if userdir: + toolsdir = os.path.join(userdir, 'gedit/tools') + else: + toolsdir = os.path.expanduser('~/.mate2/gedit/tools') + + self.locations.insert(0, toolsdir); + + if not os.path.isdir(self.locations[0]): + os.makedirs(self.locations[0]) + self.tree = ToolDirectory(self, '') + self.import_old_xml_store() + else: + self.tree = ToolDirectory(self, '') + + # cf. http://standards.freedesktop.org/basedir-spec/latest/ + def get_xdg_data_dirs(self): + dirs = os.getenv('XDG_DATA_DIRS') + if dirs: + dirs = dirs.split(os.pathsep) + else: + dirs = ('/usr/local/share', '/usr/share') + return dirs + + # This function is meant to be ran only once, when the tools directory is + # created. It imports eventual tools that have been saved in the old XML + # storage file. + def import_old_xml_store(self): + import xml.etree.ElementTree as et + userdir = os.getenv('MATE22_USER_DIR') + if userdir: + filename = os.path.join(userdir, 'gedit/gedit-tools.xml') + else: + filename = os.path.expanduser('~/.mate2/gedit/gedit-tools.xml') + + if not os.path.isfile(filename): + return + + print "External tools: importing old tools into the new store..." + + xtree = et.parse(filename) + xroot = xtree.getroot() + + for xtool in xroot: + for i in self.tree.tools: + if i.name == xtool.get('label'): + tool = i + break + else: + tool = Tool(self.tree) + tool.name = xtool.get('label') + tool.autoset_filename() + self.tree.tools.append(tool) + tool.comment = xtool.get('description') + tool.shortcut = xtool.get('accelerator') + tool.applicability = xtool.get('applicability') + tool.output = xtool.get('output') + tool.input = xtool.get('input') + + tool.save_with_script(xtool.text) + + def get_full_path(self, path, mode='r', system = True, local = True): + assert (system or local) + if path is None: + return None + if mode == 'r': + if system and local: + locations = self.locations + elif local and not system: + locations = [self.locations[0]] + elif system and not local: + locations = self.locations[1:] + else: + raise ValueError("system and local can't be both set to False") + + for i in locations: + p = os.path.join(i, path) + if os.path.lexists(p): + return p + return None + else: + path = os.path.join(self.locations[0], path) + dirname = os.path.dirname(path) + if not os.path.isdir(dirname): + os.mkdir(dirname) + return path + +class ToolDirectory(object): + def __init__(self, parent, dirname): + super(ToolDirectory, self).__init__() + self.subdirs = list() + self.tools = list() + if isinstance(parent, ToolDirectory): + self.parent = parent + self.library = parent.library + else: + self.parent = None + self.library = parent + self.dirname = dirname + self._load() + + def listdir(self): + elements = dict() + for l in self.library.locations: + d = os.path.join(l, self.dirname) + if not os.path.isdir(d): + continue + for i in os.listdir(d): + elements[i] = None + keys = elements.keys() + keys.sort() + return keys + + def _load(self): + for p in self.listdir(): + path = os.path.join(self.dirname, p) + full_path = self.library.get_full_path(path) + if os.path.isdir(full_path): + self.subdirs.append(ToolDirectory(self, p)) + elif os.path.isfile(full_path) and os.access(full_path, os.X_OK): + self.tools.append(Tool(self, p)) + + def get_path(self): + if self.parent is None: + return self.dirname + else: + return os.path.join(self.parent.get_path(), self.dirname) + path = property(get_path) + + def get_name(self): + return os.path.basename(self.dirname) + name = property(get_name) + + def delete_tool(self, tool): + # Only remove it if it lays in $HOME + if tool in self.tools: + path = tool.get_path() + if path is not None: + filename = os.path.join(self.library.locations[0], path) + if os.path.isfile(filename): + os.unlink(filename) + self.tools.remove(tool) + return True + else: + return False + + def revert_tool(self, tool): + # Only remove it if it lays in $HOME + filename = os.path.join(self.library.locations[0], tool.get_path()) + if tool in self.tools and os.path.isfile(filename): + os.unlink(filename) + tool._load() + return True + else: + return False + + +class Tool(object): + RE_KEY = re.compile('^([a-zA-Z_][a-zA-Z0-9_.\-]*)(\[([a-zA-Z_@]+)\])?$') + + def __init__(self, parent, filename = None): + super(Tool, self).__init__() + self.parent = parent + self.library = parent.library + self.filename = filename + self.changed = False + self._properties = dict() + self._transform = { + 'Languages': [self._to_list, self._from_list] + } + self._load() + + def _to_list(self, value): + if value.strip() == '': + return [] + else: + return map(lambda x: x.strip(), value.split(',')) + + def _from_list(self, value): + return ','.join(value) + + def _parse_value(self, key, value): + if key in self._transform: + return self._transform[key][0](value) + else: + return value + + def _load(self): + if self.filename is None: + return + + filename = self.library.get_full_path(self.get_path()) + if filename is None: + return + + fp = file(filename, 'r', 1) + in_block = False + lang = locale.getlocale(locale.LC_MESSAGES)[0] + + for line in fp: + if not in_block: + in_block = line.startswith('# [Gedit Tool]') + continue + if line.startswith('##') or line.startswith('# #'): continue + if not line.startswith('# '): break + + try: + (key, value) = [i.strip() for i in line[2:].split('=', 1)] + m = self.RE_KEY.match(key) + if m.group(3) is None: + self._properties[m.group(1)] = self._parse_value(m.group(1), value) + elif lang is not None and lang.startswith(m.group(3)): + self._properties[m.group(1)] = self._parse_value(m.group(1), value) + except ValueError: + break + fp.close() + self.changed = False + + def _set_property_if_changed(self, key, value): + if value != self._properties.get(key): + self._properties[key] = value + + self.changed = True + + def is_global(self): + return self.library.get_full_path(self.get_path(), local=False) is not None + + def is_local(self): + return self.library.get_full_path(self.get_path(), system=False) is not None + + def is_global(self): + return self.library.get_full_path(self.get_path(), local=False) is not None + + def get_path(self): + if self.filename is not None: + return os.path.join(self.parent.get_path(), self.filename) + else: + return None + path = property(get_path) + + # This command is the one that is meant to be ran + # (later, could have an Exec key or something) + def get_command(self): + return self.library.get_full_path(self.get_path()) + command = property(get_command) + + def get_applicability(self): + applicability = self._properties.get('Applicability') + if applicability: return applicability + return 'all' + def set_applicability(self, value): + self._set_property_if_changed('Applicability', value) + applicability = property(get_applicability, set_applicability) + + def get_name(self): + name = self._properties.get('Name') + if name: return name + return os.path.basename(self.filename) + def set_name(self, value): + self._set_property_if_changed('Name', value) + name = property(get_name, set_name) + + def get_shortcut(self): + shortcut = self._properties.get('Shortcut') + if shortcut: return shortcut + return None + def set_shortcut(self, value): + self._set_property_if_changed('Shortcut', value) + shortcut = property(get_shortcut, set_shortcut) + + def get_comment(self): + comment = self._properties.get('Comment') + if comment: return comment + return self.filename + def set_comment(self, value): + self._set_property_if_changed('Comment', value) + comment = property(get_comment, set_comment) + + def get_input(self): + input = self._properties.get('Input') + if input: return input + return 'nothing' + def set_input(self, value): + self._set_property_if_changed('Input', value) + input = property(get_input, set_input) + + def get_output(self): + output = self._properties.get('Output') + if output: return output + return 'output-panel' + def set_output(self, value): + self._set_property_if_changed('Output', value) + output = property(get_output, set_output) + + def get_save_files(self): + save_files = self._properties.get('Save-files') + if save_files: return save_files + return 'nothing' + def set_save_files(self, value): + self._set_property_if_changed('Save-files', value) + save_files = property(get_save_files, set_save_files) + + def get_languages(self): + languages = self._properties.get('Languages') + if languages: return languages + return [] + def set_languages(self, value): + self._set_property_if_changed('Languages', value) + languages = property(get_languages, set_languages) + + def has_hash_bang(self): + if self.filename is None: + return True + + filename = self.library.get_full_path(self.get_path()) + if filename is None: + return True + + fp = open(filename, 'r', 1) + for line in fp: + if line.strip() == '': + continue + + return line.startswith('#!') + + # There is no property for this one because this function is quite + # expensive to perform + def get_script(self): + if self.filename is None: + return ["#!/bin/sh\n"] + + filename = self.library.get_full_path(self.get_path()) + if filename is None: + return ["#!/bin/sh\n"] + + fp = open(filename, 'r', 1) + lines = list() + + # before entering the data block + for line in fp: + if line.startswith('# [Gedit Tool]'): + break + lines.append(line) + # in the block: + for line in fp: + if line.startswith('##'): continue + if not (line.startswith('# ') and '=' in line): + # after the block: strip one emtpy line (if present) + if line.strip() != '': + lines.append(line) + break + # after the block + for line in fp: + lines.append(line) + fp.close() + return lines + + def _dump_properties(self): + lines = ['# [Gedit Tool]'] + for item in self._properties.iteritems(): + if item[0] in self._transform: + lines.append('# %s=%s' % (item[0], self._transform[item[0]][1](item[1]))) + elif item[1] is not None: + lines.append('# %s=%s' % item) + return '\n'.join(lines) + '\n' + + def save_with_script(self, script): + filename = self.library.get_full_path(self.filename, 'w') + + fp = open(filename, 'w', 1) + + # Make sure to first print header (shebang, modeline), then + # properties, and then actual content + header = [] + content = [] + inheader = True + + # Parse + for line in script: + line = line.rstrip("\n") + + if not inheader: + content.append(line) + elif line.startswith('#!'): + # Shebang (should be always present) + header.append(line) + elif line.strip().startswith('#') and ('-*-' in line or 'ex:' in line or 'vi:' in line or 'vim:' in line): + header.append(line) + else: + content.append(line) + inheader = False + + # Write out header + for line in header: + fp.write(line + "\n") + + fp.write(self._dump_properties()) + fp.write("\n") + + for line in content: + fp.write(line + "\n") + + fp.close() + os.chmod(filename, 0750) + self.changed = False + + def save(self): + if self.changed: + self.save_with_script(self.get_script()) + + def autoset_filename(self): + if self.filename is not None: + return + dirname = self.parent.path + if dirname != '': + dirname += os.path.sep + + basename = self.name.lower().replace(' ', '-').replace('/', '-') + + if self.library.get_full_path(dirname + basename): + i = 2 + while self.library.get_full_path(dirname + "%s-%d" % (basename, i)): + i += 1 + basename = "%s-%d" % (basename, i) + self.filename = basename + +if __name__ == '__main__': + library = ToolLibrary() + + def print_tool(t, indent): + print indent * " " + "%s: %s" % (t.filename, t.name) + + def print_dir(d, indent): + print indent * " " + d.dirname + '/' + for i in d.subdirs: + print_dir(i, indent+1) + for i in d.tools: + print_tool(i, indent+1) + + print_dir(library.tree, 0) + +# ex:ts=4:et: diff --git a/plugins/externaltools/tools/linkparsing.py b/plugins/externaltools/tools/linkparsing.py new file mode 100755 index 00000000..27b9ba89 --- /dev/null +++ b/plugins/externaltools/tools/linkparsing.py @@ -0,0 +1,231 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2009-2010 Per Arneng +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import re + +class Link: + """ + This class represents a file link from within a string given by the + output of some software tool. A link contains a reference to a file, the + line number within the file and the boundaries within the given output + string that should be marked as a link. + """ + + def __init__(self, path, line_nr, start, end): + """ + path -- the path of the file (that could be extracted) + line_nr -- the line nr of the specified file + start -- the index within the string that the link starts at + end -- the index within the string where the link ends at + """ + self.path = path + self.line_nr = int(line_nr) + self.start = start + self.end = end + + def __repr__(self): + return "%s[%s](%s:%s)" % (self.path, self.line_nr, + self.start, self.end) + +class LinkParser: + """ + Parses a text using different parsing providers with the goal of finding one + or more file links within the text. A typical example could be the output + from a compiler that specifies an error in a specific file. The path of the + file, the line nr and some more info is then returned so that it can be used + to be able to navigate from the error output in to the specific file. + + The actual work of parsing the text is done by instances of classes that + inherits from AbstractLinkParser or by regular expressions. To add a new + parser just create a class that inherits from AbstractLinkParser and then + register in this class cunstructor using the method add_parser. If you want + to add a regular expression then just call add_regexp in this class + constructor and provide your regexp string as argument. + """ + + def __init__(self): + self._providers = [] + self.add_regexp(REGEXP_STANDARD) + self.add_regexp(REGEXP_PYTHON) + self.add_regexp(REGEXP_VALAC) + self.add_regexp(REGEXP_BASH) + self.add_regexp(REGEXP_RUBY) + self.add_regexp(REGEXP_PERL) + self.add_regexp(REGEXP_MCS) + + def add_parser(self, parser): + self._providers.append(parser) + + def add_regexp(self, regexp): + """ + Adds a regular expression string that should match a link using + re.MULTILINE and re.VERBOSE regexp. The area marked as a link should + be captured by a group named lnk. The path of the link should be + captured by a group named pth. The line number should be captured by + a group named ln. To read more about this look at the documentation + for the RegexpLinkParser constructor. + """ + self.add_parser(RegexpLinkParser(regexp)) + + def parse(self, text): + """ + Parses the given text and returns a list of links that are parsed from + the text. This method delegates to parser providers that can parse + output from different kinds of formats. If no links are found then an + empty list is returned. + + text -- the text to scan for file links. 'text' can not be None. + """ + if text is None: + raise ValueError("text can not be None") + + links = [] + + for provider in self._providers: + links.extend(provider.parse(text)) + + return links + +class AbstractLinkParser(object): + """The "abstract" base class for link parses""" + + def parse(self, text): + """ + This method should be implemented by subclasses. It takes a text as + argument (never None) and then returns a list of Link objects. If no + links are found then an empty list is expected. The Link class is + defined in this module. If you do not override this method then a + NotImplementedError will be thrown. + + text -- the text to parse. This argument is never None. + """ + raise NotImplementedError("need to implement a parse method") + +class RegexpLinkParser(AbstractLinkParser): + """ + A class that represents parsers that only use one single regular expression. + It can be used by subclasses or by itself. See the constructor documentation + for details about the rules surrouning the regexp. + """ + + def __init__(self, regex): + """ + Creates a new RegexpLinkParser based on the given regular expression. + The regular expression is multiline and verbose (se python docs on + compilation flags). The regular expression should contain three named + capturing groups 'lnk', 'pth' and 'ln'. 'lnk' represents the area wich + should be marked as a link in the text. 'pth' is the path that should + be looked for and 'ln' is the line number in that file. + """ + self.re = re.compile(regex, re.MULTILINE | re.VERBOSE) + + def parse(self, text): + links = [] + for m in re.finditer(self.re, text): + path = m.group("pth") + line_nr = m.group("ln") + start = m.start("lnk") + end = m.end("lnk") + link = Link(path, line_nr, start, end) + links.append(link) + + return links + +# gcc 'test.c:13: warning: ...' +# javac 'Test.java:13: ...' +# ruby 'test.rb:5: ...' +# scalac 'Test.scala:5: ...' +# 6g (go) 'test.go:9: ...' +REGEXP_STANDARD = r""" +^ +(?P + (?P .*[a-z0-9] ) + \: + (?P \d+) +) +\:\s""" + +# python ' File "test.py", line 13' +REGEXP_PYTHON = r""" +^\s\sFile\s +(?P + \" + (?P [^\"]+ ) + \",\sline\s + (?P \d+ ) +),""" + +# python 'test.sh: line 5:' +REGEXP_BASH = r""" +^(?P + (?P .* ) + \:\sline\s + (?P \d+ ) +)\:""" + +# valac 'Test.vala:13.1-13.3: ...' +REGEXP_VALAC = r""" +^(?P + (?P + .*vala + ) + \: + (?P + \d+ + ) + \.\d+-\d+\.\d+ + )\: """ + +#ruby +#test.rb:5: ... +# from test.rb:3:in `each' +# fist line parsed by REGEXP_STANDARD +REGEXP_RUBY = r""" +^\s+from\s +(?P + (?P + .* + ) + \: + (?P + \d+ + ) + )""" + +# perl 'syntax error at test.pl line 88, near "$fake_var' +REGEXP_PERL = r""" +\sat\s +(?P + (?P .* ) + \sline\s + (?P \d+ ) +)""" + +# mcs (C#) 'Test.cs(12,7): error CS0103: The name `fakeMethod' +REGEXP_MCS = r""" +^ +(?P + (?P .*\.[cC][sS] ) + \( + (?P \d+ ) + ,\d+\) +) +\:\s +""" + +# ex:ts=4:et: diff --git a/plugins/externaltools/tools/manager.py b/plugins/externaltools/tools/manager.py new file mode 100755 index 00000000..e28a088a --- /dev/null +++ b/plugins/externaltools/tools/manager.py @@ -0,0 +1,948 @@ +# -*- coding: utf-8 -*- +# Gedit External Tools plugin +# Copyright (C) 2005-2006 Steve Frécinaux +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +__all__ = ('Manager', ) + +import gedit +import gtk +import gtksourceview2 as gsv +import os.path +from library import * +from functions import * +import hashlib +from xml.sax import saxutils +import gobject + +class LanguagesPopup(gtk.Window): + COLUMN_NAME = 0 + COLUMN_ID = 1 + COLUMN_ENABLED = 2 + + def __init__(self, languages): + gtk.Window.__init__(self, gtk.WINDOW_POPUP) + + self.set_default_size(200, 200) + self.props.can_focus = True + + self.build() + self.init_languages(languages) + + self.show() + self.map() + + self.grab_add() + + gtk.gdk.keyboard_grab(self.window, False, 0L) + gtk.gdk.pointer_grab(self.window, False, gtk.gdk.BUTTON_PRESS_MASK | + gtk.gdk.BUTTON_RELEASE_MASK | + gtk.gdk.POINTER_MOTION_MASK | + gtk.gdk.ENTER_NOTIFY_MASK | + gtk.gdk.LEAVE_NOTIFY_MASK | + gtk.gdk.PROXIMITY_IN_MASK | + gtk.gdk.PROXIMITY_OUT_MASK, None, None, 0L) + + self.view.get_selection().select_path((0,)) + + def build(self): + self.model = gtk.ListStore(str, str, bool) + + self.sw = gtk.ScrolledWindow() + self.sw.show() + + self.sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + self.sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) + + self.view = gtk.TreeView(self.model) + self.view.show() + + self.view.set_headers_visible(False) + + column = gtk.TreeViewColumn() + + renderer = gtk.CellRendererToggle() + column.pack_start(renderer, False) + column.set_attributes(renderer, active=self.COLUMN_ENABLED) + + renderer.connect('toggled', self.on_language_toggled) + + renderer = gtk.CellRendererText() + column.pack_start(renderer, True) + column.set_attributes(renderer, text=self.COLUMN_NAME) + + self.view.append_column(column) + self.view.set_row_separator_func(self.on_separator) + + self.sw.add(self.view) + + self.add(self.sw) + + def enabled_languages(self, model, path, piter, ret): + enabled = model.get_value(piter, self.COLUMN_ENABLED) + + if path == (0,) and enabled: + return True + + if enabled: + ret.append(model.get_value(piter, self.COLUMN_ID)) + + return False + + def languages(self): + ret = [] + + self.model.foreach(self.enabled_languages, ret) + return ret + + def on_separator(self, model, piter): + val = model.get_value(piter, self.COLUMN_NAME) + return val == '-' + + def init_languages(self, languages): + manager = gsv.LanguageManager() + langs = gedit.language_manager_list_languages_sorted(manager, True) + + self.model.append([_('All languages'), None, not languages]) + self.model.append(['-', None, False]) + self.model.append([_('Plain Text'), 'plain', 'plain' in languages]) + self.model.append(['-', None, False]) + + for lang in langs: + self.model.append([lang.get_name(), lang.get_id(), lang.get_id() in languages]) + + def correct_all(self, model, path, piter, enabled): + if path == (0,): + return False + + model.set_value(piter, self.COLUMN_ENABLED, enabled) + + def on_language_toggled(self, renderer, path): + piter = self.model.get_iter(path) + + enabled = self.model.get_value(piter, self.COLUMN_ENABLED) + self.model.set_value(piter, self.COLUMN_ENABLED, not enabled) + + if path == '0': + self.model.foreach(self.correct_all, False) + else: + self.model.set_value(self.model.get_iter_first(), self.COLUMN_ENABLED, False) + + def do_key_press_event(self, event): + if event.keyval == gtk.keysyms.Escape: + self.destroy() + return True + else: + event.window = self.view.get_bin_window() + return self.view.event(event) + + def do_key_release_event(self, event): + event.window = self.view.get_bin_window() + return self.view.event(event) + + def in_window(self, event, window=None): + if not window: + window = self.window + + geometry = window.get_geometry() + origin = window.get_origin() + + return event.x_root >= origin[0] and \ + event.x_root <= origin[0] + geometry[2] and \ + event.y_root >= origin[1] and \ + event.y_root <= origin[1] + geometry[3] + + def do_destroy(self): + gtk.gdk.keyboard_ungrab(0L) + gtk.gdk.pointer_ungrab(0L) + + return gtk.Window.do_destroy(self) + + def setup_event(self, event, window): + fr = event.window.get_origin() + to = window.get_origin() + + event.window = window + event.x += fr[0] - to[0] + event.y += fr[1] - to[1] + + def resolve_widgets(self, root): + res = [root] + + if isinstance(root, gtk.Container): + root.forall(lambda x, y: res.extend(self.resolve_widgets(x)), None) + + return res + + def resolve_windows(self, window): + if not window: + return [] + + res = [window] + res.extend(window.get_children()) + + return res + + def propagate_mouse_event(self, event): + allwidgets = self.resolve_widgets(self.get_child()) + allwidgets.reverse() + + orig = [event.x, event.y] + + for widget in allwidgets: + windows = self.resolve_windows(widget.window) + windows.reverse() + + for window in windows: + if not (window.get_events() & event.type): + continue + + if self.in_window(event, window): + self.setup_event(event, window) + + if widget.event(event): + return True + + return False + + def do_button_press_event(self, event): + if not self.in_window(event): + self.destroy() + else: + return self.propagate_mouse_event(event) + + def do_button_release_event(self, event): + if not self.in_window(event): + self.destroy() + else: + return self.propagate_mouse_event(event) + + def do_scroll_event(self, event): + return self.propagate_mouse_event(event) + + def do_motion_notify_event(self, event): + return self.propagate_mouse_event(event) + + def do_enter_notify_event(self, event): + return self.propagate_mouse_event(event) + + def do_leave_notify_event(self, event): + return self.propagate_mouse_event(event) + + def do_proximity_in_event(self, event): + return self.propagate_mouse_event(event) + + def do_proximity_out_event(self, event): + return self.propagate_mouse_event(event) + +gobject.type_register(LanguagesPopup) + +class Manager: + TOOL_COLUMN = 0 # For Tree + NAME_COLUMN = 1 # For Combo + + def __init__(self, datadir): + self.datadir = datadir + self.dialog = None + self._languages = {} + self._tool_rows = {} + + self.build() + + def build(self): + callbacks = { + 'on_new_tool_button_clicked' : self.on_new_tool_button_clicked, + 'on_remove_tool_button_clicked' : self.on_remove_tool_button_clicked, + 'on_tool_manager_dialog_response' : self.on_tool_manager_dialog_response, + 'on_tool_manager_dialog_focus_out': self.on_tool_manager_dialog_focus_out, + 'on_accelerator_key_press' : self.on_accelerator_key_press, + 'on_accelerator_focus_in' : self.on_accelerator_focus_in, + 'on_accelerator_focus_out' : self.on_accelerator_focus_out, + 'on_languages_button_clicked' : self.on_languages_button_clicked + } + + # Load the "main-window" widget from the ui file. + self.ui = gtk.Builder() + self.ui.add_from_file(os.path.join(self.datadir, 'ui', 'tools.ui')) + self.ui.connect_signals(callbacks) + self.dialog = self.ui.get_object('tool-manager-dialog') + + self.view = self.ui.get_object('view') + + self.__init_tools_model() + self.__init_tools_view() + + for name in ['input', 'output', 'applicability', 'save-files']: + self.__init_combobox(name) + + self.do_update() + + def expand_from_doc(self, doc): + row = None + + if doc: + if doc.get_language(): + lid = doc.get_language().get_id() + + if lid in self._languages: + row = self._languages[lid] + elif 'plain' in self._languages: + row = self._languages['plain'] + + if not row and None in self._languages: + row = self._languages[None] + + if not row: + return + + self.view.expand_row(row.get_path(), False) + self.view.get_selection().select_path(row.get_path()) + + def run(self, window): + if self.dialog == None: + self.build() + + # Open up language + self.expand_from_doc(window.get_active_document()) + + self.dialog.set_transient_for(window) + window.get_group().add_window(self.dialog) + self.dialog.present() + + def add_accelerator(self, item): + if not item.shortcut: + return + + if item.shortcut in self.accelerators: + if not item in self.accelerators[item.shortcut]: + self.accelerators[item.shortcut].append(item) + else: + self.accelerators[item.shortcut] = [item] + + def remove_accelerator(self, item, shortcut=None): + if not shortcut: + shortcut = item.shortcut + + if not shortcut in self.accelerators: + return + + self.accelerators[shortcut].remove(item) + + if not self.accelerators[shortcut]: + del self.accelerators[shortcut] + + def add_tool_to_language(self, tool, language): + if isinstance(language, gsv.Language): + lid = language.get_id() + else: + lid = language + + if not lid in self._languages: + piter = self.model.append(None, [language]) + + parent = gtk.TreeRowReference(self.model, self.model.get_path(piter)) + self._languages[lid] = parent + else: + parent = self._languages[lid] + + piter = self.model.get_iter(parent.get_path()) + child = self.model.append(piter, [tool]) + + if not tool in self._tool_rows: + self._tool_rows[tool] = [] + + self._tool_rows[tool].append(gtk.TreeRowReference(self.model, self.model.get_path(child))) + return child + + def add_tool(self, tool): + manager = gsv.LanguageManager() + ret = None + + for lang in tool.languages: + l = manager.get_language(lang) + + if l: + ret = self.add_tool_to_language(tool, l) + elif lang == 'plain': + ret = self.add_tool_to_language(tool, 'plain') + + if not ret: + ret = self.add_tool_to_language(tool, None) + + self.add_accelerator(tool) + return ret + + def __init_tools_model(self): + self.tools = ToolLibrary() + self.current_node = None + self.script_hash = None + self.accelerators = dict() + + self.model = gtk.TreeStore(object) + self.view.set_model(self.model) + + for tool in self.tools.tree.tools: + self.add_tool(tool) + + self.model.set_default_sort_func(self.sort_tools) + self.model.set_sort_column_id(-1, gtk.SORT_ASCENDING) + + def sort_tools(self, model, iter1, iter2): + # For languages, sort All before everything else, otherwise alphabetical + t1 = model.get_value(iter1, self.TOOL_COLUMN) + t2 = model.get_value(iter2, self.TOOL_COLUMN) + + if model.iter_parent(iter1) == None: + if t1 == None: + return -1 + + if t2 == None: + return 1 + + def lang_name(lang): + if isinstance(lang, gsv.Language): + return lang.get_name() + else: + return _('Plain Text') + + n1 = lang_name(t1) + n2 = lang_name(t2) + else: + n1 = t1.name + n2 = t2.name + + return cmp(n1.lower(), n2.lower()) + + def __init_tools_view(self): + # Tools column + column = gtk.TreeViewColumn('Tools') + renderer = gtk.CellRendererText() + column.pack_start(renderer, False) + renderer.set_property('editable', True) + self.view.append_column(column) + + column.set_cell_data_func(renderer, self.get_cell_data_cb) + + renderer.connect('edited', self.on_view_label_cell_edited) + renderer.connect('editing-started', self.on_view_label_cell_editing_started) + + self.selection_changed_id = self.view.get_selection().connect('changed', self.on_view_selection_changed, None) + + def __init_combobox(self, name): + combo = self[name] + combo.set_active(0) + + # Convenience function to get an object from its name + def __getitem__(self, key): + return self.ui.get_object(key) + + def set_active_by_name(self, combo_name, option_name): + combo = self[combo_name] + model = combo.get_model() + piter = model.get_iter_first() + while piter is not None: + if model.get_value(piter, self.NAME_COLUMN) == option_name: + combo.set_active_iter(piter) + return True + piter = model.iter_next(piter) + return False + + def get_selected_tool(self): + model, piter = self.view.get_selection().get_selected() + + if piter is not None: + tool = model.get_value(piter, self.TOOL_COLUMN) + + if not isinstance(tool, Tool): + tool = None + + return piter, tool + else: + return None, None + + def compute_hash(self, string): + return hashlib.md5(string).hexdigest() + + def save_current_tool(self): + if self.current_node is None: + return + + if self.current_node.filename is None: + self.current_node.autoset_filename() + + def combo_value(o, name): + combo = o[name] + return combo.get_model().get_value(combo.get_active_iter(), self.NAME_COLUMN) + + self.current_node.input = combo_value(self, 'input') + self.current_node.output = combo_value(self, 'output') + self.current_node.applicability = combo_value(self, 'applicability') + self.current_node.save_files = combo_value(self, 'save-files') + + buf = self['commands'].get_buffer() + script = buf.get_text(*buf.get_bounds()) + h = self.compute_hash(script) + if h != self.script_hash: + # script has changed -> save it + self.current_node.save_with_script([line + "\n" for line in script.splitlines()]) + self.script_hash = h + else: + self.current_node.save() + + self.update_remove_revert() + + def clear_fields(self): + self['accelerator'].set_text('') + + buf = self['commands'].get_buffer() + buf.begin_not_undoable_action() + buf.set_text('') + buf.end_not_undoable_action() + + for nm in ('input', 'output', 'applicability', 'save-files'): + self[nm].set_active(0) + + self['languages_label'].set_text(_('All Languages')) + + def fill_languages_button(self): + if not self.current_node or not self.current_node.languages: + self['languages_label'].set_text(_('All Languages')) + else: + manager = gsv.LanguageManager() + langs = [] + + for lang in self.current_node.languages: + if lang == 'plain': + langs.append(_('Plain Text')) + else: + l = manager.get_language(lang) + + if l: + langs.append(l.get_name()) + + self['languages_label'].set_text(', '.join(langs)) + + def fill_fields(self): + node = self.current_node + self['accelerator'].set_text(default(node.shortcut, '')) + + buf = self['commands'].get_buffer() + script = default(''.join(node.get_script()), '') + + buf.begin_not_undoable_action() + buf.set_text(script) + buf.end_not_undoable_action() + + self.script_hash = self.compute_hash(script) + contenttype = gio.content_type_guess(data=script) + lmanager = gedit.get_language_manager() + language = lmanager.guess_language(content_type=contenttype) + + if language is not None: + buf.set_language(language) + buf.set_highlight_syntax(True) + else: + buf.set_highlight_syntax(False) + + for nm in ('input', 'output', 'applicability', 'save-files'): + model = self[nm].get_model() + piter = model.get_iter_first() + + self.set_active_by_name(nm, + default(node.__getattribute__(nm.replace('-', '_')), + model.get_value(piter, self.NAME_COLUMN))) + + self.fill_languages_button() + + def update_remove_revert(self): + piter, node = self.get_selected_tool() + + removable = node is not None and node.is_local() + + self['remove-tool-button'].set_sensitive(removable) + self['revert-tool-button'].set_sensitive(removable) + + if node is not None and node.is_global(): + self['remove-tool-button'].hide() + self['revert-tool-button'].show() + else: + self['remove-tool-button'].show() + self['revert-tool-button'].hide() + + def do_update(self): + self.update_remove_revert() + + piter, node = self.get_selected_tool() + self.current_node = node + + if node is not None: + self.fill_fields() + self['tool-table'].set_sensitive(True) + else: + self.clear_fields() + self['tool-table'].set_sensitive(False) + + def language_id_from_iter(self, piter): + if not piter: + return None + + tool = self.model.get_value(piter, self.TOOL_COLUMN) + + if isinstance(tool, Tool): + piter = self.model.iter_parent(piter) + tool = self.model.get_value(piter, self.TOOL_COLUMN) + + if isinstance(tool, gsv.Language): + return tool.get_id() + elif tool: + return 'plain' + + return None + + def selected_language_id(self): + # Find current language if there is any + model, piter = self.view.get_selection().get_selected() + + return self.language_id_from_iter(piter) + + def on_new_tool_button_clicked(self, button): + self.save_current_tool() + + # block handlers while inserting a new item + self.view.get_selection().handler_block(self.selection_changed_id) + + self.current_node = Tool(self.tools.tree); + self.current_node.name = _('New tool') + self.tools.tree.tools.append(self.current_node) + + lang = self.selected_language_id() + + if lang: + self.current_node.languages = [lang] + + piter = self.add_tool(self.current_node) + + self.view.set_cursor(self.model.get_path(piter), self.view.get_column(self.TOOL_COLUMN), True) + self.fill_fields() + + self['tool-table'].set_sensitive(True) + self.view.get_selection().handler_unblock(self.selection_changed_id) + + def tool_changed(self, tool, refresh=False): + for row in self._tool_rows[tool]: + self.model.row_changed(row.get_path(), self.model.get_iter(row.get_path())) + + if refresh and tool == self.current_node: + self.fill_fields() + + self.update_remove_revert() + + def on_remove_tool_button_clicked(self, button): + piter, node = self.get_selected_tool() + + if not node: + return + + if node.is_global(): + shortcut = node.shortcut + + if node.parent.revert_tool(node): + self.remove_accelerator(node, shortcut) + self.add_accelerator(node) + + self['revert-tool-button'].set_sensitive(False) + self.fill_fields() + + self.tool_changed(node) + else: + parent = self.model.iter_parent(piter) + language = self.language_id_from_iter(parent) + + self.model.remove(piter) + + if language in node.languages: + node.languages.remove(language) + + self._tool_rows[node] = filter(lambda x: x.valid(), self._tool_rows[node]) + + if not self._tool_rows[node]: + del self._tool_rows[node] + + if node.parent.delete_tool(node): + self.remove_accelerator(node) + self.current_node = None + self.script_hash = None + + if self.model.iter_is_valid(piter): + self.view.set_cursor(self.model.get_path(piter), self.view.get_column(self.TOOL_COLUMN), False) + + self.view.grab_focus() + + path = self._languages[language].get_path() + parent = self.model.get_iter(path) + + if not self.model.iter_has_child(parent): + self.model.remove(parent) + del self._languages[language] + + def on_view_label_cell_edited(self, cell, path, new_text): + if new_text != '': + piter = self.model.get_iter(path) + tool = self.model.get_value(piter, self.TOOL_COLUMN) + + tool.name = new_text + + self.save_current_tool() + self.tool_changed(tool) + + def on_view_label_cell_editing_started(self, renderer, editable, path): + piter = self.model.get_iter(path) + tool = self.model.get_value(piter, self.TOOL_COLUMN) + + if isinstance(editable, gtk.Entry): + editable.set_text(tool.name) + editable.grab_focus() + + def on_view_selection_changed(self, selection, userdata): + self.save_current_tool() + self.do_update() + + def accelerator_collision(self, name, node): + if not name in self.accelerators: + return [] + + ret = [] + + for other in self.accelerators[name]: + if not other.languages or not node.languages: + ret.append(other) + continue + + for lang in other.languages: + if lang in node.languages: + ret.append(other) + continue + + return ret + + def set_accelerator(self, keyval, mod): + # Check whether accelerator already exists + self.remove_accelerator(self.current_node) + + name = gtk.accelerator_name(keyval, mod) + + if name == '': + self.current_node.shorcut = None + self.save_current_tool() + return True + + col = self.accelerator_collision(name, self.current_node) + + if col: + dialog = gtk.MessageDialog(self.dialog, + gtk.DIALOG_MODAL, + gtk.MESSAGE_ERROR, + gtk.BUTTONS_OK, + _('This accelerator is already bound to %s') % (', '.join(map(lambda x: x.name, col)),)) + + dialog.run() + dialog.destroy() + + self.add_accelerator(self.current_node) + return False + + self.current_node.shortcut = name + self.add_accelerator(self.current_node) + self.save_current_tool() + + return True + + def on_accelerator_key_press(self, entry, event): + mask = event.state & gtk.accelerator_get_default_mod_mask() + + if event.keyval == gtk.keysyms.Escape: + entry.set_text(default(self.current_node.shortcut, '')) + self['commands'].grab_focus() + return True + elif event.keyval == gtk.keysyms.Delete \ + or event.keyval == gtk.keysyms.BackSpace: + entry.set_text('') + self.remove_accelerator(self.current_node) + self.current_node.shortcut = None + self['commands'].grab_focus() + return True + elif event.keyval in range(gtk.keysyms.F1, gtk.keysyms.F12 + 1): + # New accelerator + if self.set_accelerator(event.keyval, mask): + entry.set_text(default(self.current_node.shortcut, '')) + self['commands'].grab_focus() + + # Capture all `normal characters` + return True + elif gtk.gdk.keyval_to_unicode(event.keyval): + if mask: + # New accelerator + if self.set_accelerator(event.keyval, mask): + entry.set_text(default(self.current_node.shortcut, '')) + self['commands'].grab_focus() + # Capture all `normal characters` + return True + else: + return False + + def on_accelerator_focus_in(self, entry, event): + if self.current_node is None: + return + if self.current_node.shortcut: + entry.set_text(_('Type a new accelerator, or press Backspace to clear')) + else: + entry.set_text(_('Type a new accelerator')) + + def on_accelerator_focus_out(self, entry, event): + if self.current_node is not None: + entry.set_text(default(self.current_node.shortcut, '')) + self.tool_changed(self.current_node) + + def on_tool_manager_dialog_response(self, dialog, response): + if response == gtk.RESPONSE_HELP: + gedit.help_display(self.dialog, 'gedit', 'gedit-external-tools-plugin') + return + + self.on_tool_manager_dialog_focus_out(dialog, None) + + self.dialog.destroy() + self.dialog = None + self.tools = None + + def on_tool_manager_dialog_focus_out(self, dialog, event): + self.save_current_tool() + + for window in gedit.app_get_default().get_windows(): + helper = window.get_data("ExternalToolsPluginWindowData") + helper.menu.update() + + def get_cell_data_cb(self, column, cell, model, piter): + tool = model.get_value(piter, self.TOOL_COLUMN) + + if tool == None or not isinstance(tool, Tool): + if tool == None: + label = _('All Languages') + elif not isinstance(tool, gsv.Language): + label = _('Plain Text') + else: + label = tool.get_name() + + markup = saxutils.escape(label) + editable = False + else: + escaped = saxutils.escape(tool.name) + + if tool.shortcut: + markup = '%s (%s)' % (escaped, saxutils.escape(tool.shortcut)) + else: + markup = escaped + + editable = True + + cell.set_properties(markup=markup, editable=editable) + + def tool_in_language(self, tool, lang): + if not lang in self._languages: + return False + + ref = self._languages[lang] + parent = ref.get_path() + + for row in self._tool_rows[tool]: + path = row.get_path() + + if path[0] == parent[0]: + return True + + return False + + def update_languages(self, popup): + self.current_node.languages = popup.languages() + self.fill_languages_button() + + piter, node = self.get_selected_tool() + ret = None + + if node: + ref = gtk.TreeRowReference(self.model, self.model.get_path(piter)) + + # Update languages, make sure to inhibit selection change stuff + self.view.get_selection().handler_block(self.selection_changed_id) + + # Remove all rows that are no longer + for row in list(self._tool_rows[self.current_node]): + piter = self.model.get_iter(row.get_path()) + language = self.language_id_from_iter(piter) + + if (not language and not self.current_node.languages) or \ + (language in self.current_node.languages): + continue + + # Remove from language + self.model.remove(piter) + self._tool_rows[self.current_node].remove(row) + + # If language is empty, remove it + parent = self.model.get_iter(self._languages[language].get_path()) + + if not self.model.iter_has_child(parent): + self.model.remove(parent) + del self._languages[language] + + # Now, add for any that are new + manager = gsv.LanguageManager() + + for lang in self.current_node.languages: + if not self.tool_in_language(self.current_node, lang): + l = manager.get_language(lang) + + if not l: + l = 'plain' + + self.add_tool_to_language(self.current_node, l) + + if not self.current_node.languages and not self.tool_in_language(self.current_node, None): + self.add_tool_to_language(self.current_node, None) + + # Check if we can still keep the current + if not ref or not ref.valid(): + # Change selection to first language + path = self._tool_rows[self.current_node][0].get_path() + piter = self.model.get_iter(path) + parent = self.model.iter_parent(piter) + + # Expand parent, select child and scroll to it + self.view.expand_row(self.model.get_path(parent), False) + self.view.get_selection().select_path(path) + self.view.set_cursor(path, self.view.get_column(self.TOOL_COLUMN), False) + + self.view.get_selection().handler_unblock(self.selection_changed_id) + + def on_languages_button_clicked(self, button): + popup = LanguagesPopup(self.current_node.languages) + popup.set_transient_for(self.dialog) + + origin = button.window.get_origin() + popup.move(origin[0], origin[1] - popup.allocation.height) + + popup.connect('destroy', self.update_languages) + +# ex:et:ts=4: diff --git a/plugins/externaltools/tools/outputpanel.py b/plugins/externaltools/tools/outputpanel.py new file mode 100755 index 00000000..a30aad72 --- /dev/null +++ b/plugins/externaltools/tools/outputpanel.py @@ -0,0 +1,224 @@ +# -*- coding: utf-8 -*- +# Gedit External Tools plugin +# Copyright (C) 2005-2006 Steve Frécinaux +# Copyright (C) 2010 Per Arneng +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +__all__ = ('OutputPanel', 'UniqueById') + +import gtk, gedit +import pango +import gobject +import os +from weakref import WeakKeyDictionary +from capture import * +from gtk import gdk +import re +import gio +import linkparsing +import filelookup + +class UniqueById: + __shared_state = WeakKeyDictionary() + + def __init__(self, i): + if i in self.__class__.__shared_state: + self.__dict__ = self.__class__.__shared_state[i] + return True + else: + self.__class__.__shared_state[i] = self.__dict__ + return False + + def states(self): + return self.__class__.__shared_state + +class OutputPanel(UniqueById): + def __init__(self, datadir, window): + if UniqueById.__init__(self, window): + return + + callbacks = { + 'on_stop_clicked' : self.on_stop_clicked, + 'on_view_visibility_notify_event': self.on_view_visibility_notify_event, + 'on_view_motion_notify_event': self.on_view_motion_notify_event, + 'on_view_button_press_event': self.on_view_button_press_event + } + + self.window = window + self.ui = gtk.Builder() + self.ui.add_from_file(os.path.join(datadir, 'ui', 'outputpanel.ui')) + self.ui.connect_signals(callbacks) + + self.panel = self["output-panel"] + self['view'].modify_font(pango.FontDescription('Monospace')) + + buffer = self['view'].get_buffer() + + self.normal_tag = buffer.create_tag('normal') + + self.error_tag = buffer.create_tag('error') + self.error_tag.set_property('foreground', 'red') + + self.italic_tag = buffer.create_tag('italic') + self.italic_tag.set_property('style', pango.STYLE_OBLIQUE) + + self.bold_tag = buffer.create_tag('bold') + self.bold_tag.set_property('weight', pango.WEIGHT_BOLD) + + self.invalid_link_tag = buffer.create_tag('invalid_link') + + self.link_tag = buffer.create_tag('link') + self.link_tag.set_property('underline', pango.UNDERLINE_SINGLE) + + self.link_cursor = gdk.Cursor(gdk.HAND2) + self.normal_cursor = gdk.Cursor(gdk.XTERM) + + self.process = None + + self.links = [] + + self.link_parser = linkparsing.LinkParser() + self.file_lookup = filelookup.FileLookup() + + def set_process(self, process): + self.process = process + + def __getitem__(self, key): + # Convenience function to get an object from its name + return self.ui.get_object(key) + + def on_stop_clicked(self, widget, *args): + if self.process is not None: + self.write("\n" + _('Stopped.') + "\n", + self.italic_tag) + self.process.stop(-1) + + def scroll_to_end(self): + iter = self['view'].get_buffer().get_end_iter() + self['view'].scroll_to_iter(iter, 0.0) + return False # don't requeue this handler + + def clear(self): + self['view'].get_buffer().set_text("") + self.links = [] + + def visible(self): + panel = self.window.get_bottom_panel() + return panel.props.visible and panel.item_is_active(self.panel) + + def write(self, text, tag = None): + buffer = self['view'].get_buffer() + + end_iter = buffer.get_end_iter() + insert = buffer.create_mark(None, end_iter, True) + + if tag is None: + buffer.insert(end_iter, text) + else: + buffer.insert_with_tags(end_iter, text, tag) + + # find all links and apply the appropriate tag for them + links = self.link_parser.parse(text) + for lnk in links: + + insert_iter = buffer.get_iter_at_mark(insert) + lnk.start = insert_iter.get_offset() + lnk.start + lnk.end = insert_iter.get_offset() + lnk.end + + start_iter = buffer.get_iter_at_offset(lnk.start) + end_iter = buffer.get_iter_at_offset(lnk.end) + + tag = None + + # if the link points to an existing file then it is a valid link + if self.file_lookup.lookup(lnk.path) is not None: + self.links.append(lnk) + tag = self.link_tag + else: + tag = self.invalid_link_tag + + buffer.apply_tag(tag, start_iter, end_iter) + + buffer.delete_mark(insert) + gobject.idle_add(self.scroll_to_end) + + def show(self): + panel = self.window.get_bottom_panel() + panel.show() + panel.activate_item(self.panel) + + def update_cursor_style(self, view, x, y): + if self.get_link_at_location(view, x, y) is not None: + cursor = self.link_cursor + else: + cursor = self.normal_cursor + + view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(cursor) + + def on_view_motion_notify_event(self, view, event): + if event.window == view.get_window(gtk.TEXT_WINDOW_TEXT): + self.update_cursor_style(view, int(event.x), int(event.y)) + + return False + + def on_view_visibility_notify_event(self, view, event): + if event.window == view.get_window(gtk.TEXT_WINDOW_TEXT): + x, y, m = event.window.get_pointer() + self.update_cursor_style(view, x, y) + + return False + + def idle_grab_focus(self): + self.window.get_active_view().grab_focus() + return False + + def get_link_at_location(self, view, x, y): + """ + Get the link under a specified x,y coordinate. If no link exists then + None is returned. + """ + + # get the offset within the buffer from the x,y coordinates + buff_x, buff_y = view.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT, + x, y) + iter_at_xy = view.get_iter_at_location(buff_x, buff_y) + offset = iter_at_xy.get_offset() + + # find the first link that contains the offset + for lnk in self.links: + if offset >= lnk.start and offset <= lnk.end: + return lnk + + # no link was found at x,y + return None + + def on_view_button_press_event(self, view, event): + if event.button != 1 or event.type != gdk.BUTTON_PRESS or \ + event.window != view.get_window(gtk.TEXT_WINDOW_TEXT): + return False + + link = self.get_link_at_location(view, int(event.x), int(event.y)) + if link is None: + return False + + gfile = self.file_lookup.lookup(link.path) + + if gfile: + gedit.commands.load_uri(self.window, gfile.get_uri(), None, + link.line_nr) + gobject.idle_add(self.idle_grab_focus) + +# ex:ts=4:et: diff --git a/plugins/externaltools/tools/outputpanel.ui b/plugins/externaltools/tools/outputpanel.ui new file mode 100755 index 00000000..f0281792 --- /dev/null +++ b/plugins/externaltools/tools/outputpanel.ui @@ -0,0 +1,53 @@ + + + + + True + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + False + GTK_WRAP_WORD + False + False + + + + + + + + + + True + 6 + 6 + GTK_BUTTONBOX_END + + + True + False + gtk-stop + True + + + + + + False + 1 + + + + diff --git a/plugins/externaltools/tools/tools.ui b/plugins/externaltools/tools/tools.ui new file mode 100755 index 00000000..dff7d192 --- /dev/null +++ b/plugins/externaltools/tools/tools.ui @@ -0,0 +1,606 @@ + + + + + + + + + + + + Nothing + nothing + + + Current document + document + + + All documents + all + + + + + + + + + + + Nothing + nothing + + + Current document + document + + + Current selection + selection + + + Current selection (default to document) + selection-document + + + Current line + line + + + Current word + word + + + + + + + + + + + + + Nothing + nothing + + + Display in bottom pane + output-panel + + + Create new document + new-document + + + Append to current document + append-document + + + Replace current document + replace-document + + + Replace current selection + replace-selection + + + Insert at cursor position + insert + + + + + + + + + + + + + All documents + all + + + All documents except untitled ones + titled + + + Local files only + local + + + Remote files only + remote + + + Untitled documents only + untitled + + + + + True + + + External Tools Manager + 750 + 500 + dialog + True + False + + + + + True + + + True + True + 6 + 275 + + + True + 6 + + + True + 0 + _Tools: + True + view + + + False + False + 0 + + + + + True + False + automatic + automatic + in + + + True + True + False + True + + + + + 1 + + + + + True + 6 + + + True + False + True + False + + + + True + gtk-new + 4 + + + + + False + False + 0 + + + + + False + False + + + + True + gtk-revert-to-saved + 4 + + + + + False + False + end + 2 + + + + + True + False + True + False + + + + True + gtk-delete + 4 + + + + + False + False + end + 1 + + + + + False + False + 2 + + + + + False + False + + + + + True + 6 + + + True + 0 + 0.5 + _Edit: + commands + True + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + 6 + 2 + 6 + 6 + + + True + True + + + + + + 1 + 2 + 1 + 2 + GTK_EXPAND | GTK_SHRINK | GTK_FILL + GTK_FILL + + + + + True + + + True + model_applicability + + + + 0 + + + + + 0 + False + True + + + + + True + True + + + True + + + + True + All Languages + 0 + 0.5 + PANGO_ELLIPSIZE_MIDDLE + + + + + + + 1 + True + True + + + + + 1 + 2 + 5 + 6 + GTK_EXPAND | GTK_SHRINK | GTK_FILL + GTK_FILL + + + + + True + model_output + + + + 0 + + + + + 1 + 2 + 4 + 5 + GTK_EXPAND | GTK_SHRINK | GTK_FILL + GTK_FILL + + + + + True + model_input + + + + 0 + + + + + 1 + 2 + 3 + 4 + GTK_EXPAND | GTK_SHRINK | GTK_FILL + GTK_FILL + + + + + model_save_files + True + + + + 0 + + + + + 1 + 2 + 2 + 3 + GTK_EXPAND | GTK_SHRINK | GTK_FILL + GTK_FILL + + + + + True + 0 + _Applicability: + True + applicability + + + 5 + 6 + GTK_FILL + + + + + + True + 0 + _Output: + True + output + + + 4 + 5 + GTK_FILL + + + + + + True + 0 + _Input: + True + input + + + 3 + 4 + GTK_FILL + + + + + + 0 + _Save: + True + save-files + True + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + _Shortcut Key: + True + accelerator + + + 1 + 2 + GTK_FILL + + + + + + True + True + automatic + automatic + in + + + commands_buffer + True + True + False + GTK_SOURCE_SMART_HOME_END_AFTER + 2 + True + False + True + + + + + 2 + + + + + 1 + + + + + 1 + + + + + True + False + + + + + 1 + + + + + True + end + + + gtk-help + True + True + True + False + True + + + False + False + 0 + + + + + gtk-close + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + button1 + button2 + + + diff --git a/plugins/filebrowser/Makefile.am b/plugins/filebrowser/Makefile.am new file mode 100755 index 00000000..22301d5b --- /dev/null +++ b/plugins/filebrowser/Makefile.am @@ -0,0 +1,104 @@ +# filebrowser + +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +INCLUDES = \ + -I$(top_srcdir) \ + $(GEDIT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) + +BUILT_SOURCES = \ + gedit-file-browser-enum-types.h \ + gedit-file-browser-enum-types.c \ + gedit-file-browser-marshal.h \ + gedit-file-browser-marshal.c + +plugin_LTLIBRARIES = libfilebrowser.la + +NOINST_H_FILES = \ + gedit-file-bookmarks-store.h \ + gedit-file-browser-store.h \ + gedit-file-browser-view.h \ + gedit-file-browser-widget.h \ + gedit-file-browser-error.h \ + gedit-file-browser-utils.h \ + gedit-file-browser-plugin.h \ + gedit-file-browser-messages.h + +libfilebrowser_la_SOURCES = \ + $(BUILT_SOURCES) \ + gedit-file-bookmarks-store.c \ + gedit-file-browser-store.c \ + gedit-file-browser-view.c \ + gedit-file-browser-widget.c \ + gedit-file-browser-utils.c \ + gedit-file-browser-plugin.c \ + gedit-file-browser-messages.c \ + $(NOINST_H_FILES) + +libfilebrowser_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) +libfilebrowser_la_LIBADD = $(GEDIT_LIBS) + +# UI files (if you use ui for your plugin, list those files here) +uidir = $(GEDIT_PLUGINS_DATA_DIR)/filebrowser +ui_DATA = gedit-file-browser-widget-ui.xml + +plugin_in_files = filebrowser.gedit-plugin.desktop.in + +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +gedit-file-browser-enum-types.h: gedit-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS) + (cd $(srcdir) && $(GLIB_MKENUMS) --template gedit-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@ + +gedit-file-browser-enum-types.c: gedit-file-browser-enum-types.c.template gedit-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS) + $(AM_V_GEN) (cd $(srcdir) && \ + $(GLIB_MKENUMS) --template gedit-file-browser-enum-types.c.template $(NOINST_H_FILES) && \ + $(GLIB_MKENUMS) --template gedit-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@ + +gedit-file-browser-marshal.h: gedit-file-browser-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=gedit_file_browser_marshal > $@ + +gedit-file-browser-marshal.c: gedit-file-browser-marshal.list $(GLIB_GENMARSHAL) + $(AM_V_GEN) echo "#include \"gedit-file-browser-marshal.h\"" > $@ && \ + $(GLIB_GENMARSHAL) $< --body --prefix=gedit_file_browser_marshal >> $@ + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +schemasdir = $(MATECONF_SCHEMA_FILE_DIR) +schemas_in_files = gedit-file-browser.schemas.in +schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) +@INTLTOOL_SCHEMAS_RULE@ + +if MATECONF_SCHEMAS_INSTALL +install-data-local: + if test -z "$(DESTDIR)" ; then \ + for p in $(schemas_DATA) ; do \ + MATECONF_CONFIG_SOURCE=$(MATECONF_SCHEMA_CONFIG_SOURCE) $(MATECONFTOOL) --makefile-install-rule $(top_builddir)/plugins/filebrowser/$$p ; \ + done \ + fi +else +install-data-local: +endif + + +EXTRA_DIST = \ + $(ui_DATA) \ + $(plugin_in_files) \ + $(schemas_in_files) \ + gedit-file-browser-enum-types.h.template \ + gedit-file-browser-enum-types.c.template \ + gedit-file-browser-enum-register.c.template \ + gedit-file-browser-marshal.list + +CLEANFILES = \ + $(plugin_DATA) \ + $(schemas_DATA) \ + $(BUILT_SOURCES) + +DISTCLEANFILES = \ + $(plugin_DATA) \ + $(schemas_DATA) \ + $(BUILT_SOURCES) + +-include $(top_srcdir)/git.mk diff --git a/plugins/filebrowser/filebrowser.gedit-plugin.desktop.in b/plugins/filebrowser/filebrowser.gedit-plugin.desktop.in new file mode 100755 index 00000000..808816c5 --- /dev/null +++ b/plugins/filebrowser/filebrowser.gedit-plugin.desktop.in @@ -0,0 +1,10 @@ +[Gedit Plugin] +Loader=C +Module=filebrowser +IAge=2 +_Name=File Browser Pane +_Description=Easy file access from the side pane +Icon=system-file-manager +Authors=Jesse van den Kieboom +Copyright=Copyright © 2006 Jesse van den Kieboom +Website=http://www.gedit.org diff --git a/plugins/filebrowser/gedit-file-bookmarks-store.c b/plugins/filebrowser/gedit-file-bookmarks-store.c new file mode 100755 index 00000000..86e7f0c8 --- /dev/null +++ b/plugins/filebrowser/gedit-file-bookmarks-store.c @@ -0,0 +1,879 @@ +/* + * gedit-file-bookmarks-store.c - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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. + */ + +#include +#include +#include +#include +#include + +#include "gedit-file-bookmarks-store.h" +#include "gedit-file-browser-utils.h" + +#define GEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE(object)( \ + G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_FILE_BOOKMARKS_STORE, \ + GeditFileBookmarksStorePrivate)) + +struct _GeditFileBookmarksStorePrivate +{ + GVolumeMonitor * volume_monitor; + GFileMonitor * bookmarks_monitor; +}; + +static void remove_node (GtkTreeModel * model, + GtkTreeIter * iter); + +static void on_fs_changed (GVolumeMonitor *monitor, + GObject *object, + GeditFileBookmarksStore *model); + +static void on_bookmarks_file_changed (GFileMonitor * monitor, + GFile * file, + GFile * other_file, + GFileMonitorEvent event_type, + GeditFileBookmarksStore * model); +static gboolean find_with_flags (GtkTreeModel * model, + GtkTreeIter * iter, + gpointer obj, + guint flags, + guint notflags); + +GEDIT_PLUGIN_DEFINE_TYPE(GeditFileBookmarksStore, gedit_file_bookmarks_store, GTK_TYPE_TREE_STORE) + +static void +gedit_file_bookmarks_store_dispose (GObject * object) +{ + GeditFileBookmarksStore *obj = GEDIT_FILE_BOOKMARKS_STORE (object); + + if (obj->priv->volume_monitor != NULL) { + g_signal_handlers_disconnect_by_func (obj->priv->volume_monitor, + on_fs_changed, + obj); + + g_object_unref (obj->priv->volume_monitor); + obj->priv->volume_monitor = NULL; + } + + if (obj->priv->bookmarks_monitor != NULL) { + g_object_unref (obj->priv->bookmarks_monitor); + obj->priv->bookmarks_monitor = NULL; + } + + G_OBJECT_CLASS (gedit_file_bookmarks_store_parent_class)->dispose (object); +} + +static void +gedit_file_bookmarks_store_finalize (GObject * object) +{ + G_OBJECT_CLASS (gedit_file_bookmarks_store_parent_class)->finalize (object); +} + +static void +gedit_file_bookmarks_store_class_init (GeditFileBookmarksStoreClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->dispose = gedit_file_bookmarks_store_dispose; + object_class->finalize = gedit_file_bookmarks_store_finalize; + + g_type_class_add_private (object_class, sizeof (GeditFileBookmarksStorePrivate)); +} + +static void +gedit_file_bookmarks_store_init (GeditFileBookmarksStore * obj) +{ + obj->priv = GEDIT_FILE_BOOKMARKS_STORE_GET_PRIVATE (obj); +} + +/* Private */ +static void +add_node (GeditFileBookmarksStore *model, + GdkPixbuf *pixbuf, + const gchar *name, + GObject *obj, + guint flags, + GtkTreeIter *iter) +{ + GtkTreeIter newiter; + + gtk_tree_store_append (GTK_TREE_STORE (model), &newiter, NULL); + + gtk_tree_store_set (GTK_TREE_STORE (model), &newiter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON, pixbuf, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, name, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, obj, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, flags, + -1); + + if (iter != NULL) + *iter = newiter; +} + +static gboolean +add_file (GeditFileBookmarksStore *model, + GFile *file, + const gchar *name, + guint flags, + GtkTreeIter *iter) +{ + GdkPixbuf *pixbuf = NULL; + gboolean native; + gchar *newname; + + native = g_file_is_native (file); + + if (native && !g_file_query_exists (file, NULL)) { + return FALSE; + } + + if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_HOME) + pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("user-home", GTK_ICON_SIZE_MENU); + else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP) + pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("user-desktop", GTK_ICON_SIZE_MENU); + else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT) + pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("drive-harddisk", GTK_ICON_SIZE_MENU); + + if (pixbuf == NULL) { + /* getting the icon is a sync get_info call, so we just do it for local files */ + if (native) { + pixbuf = gedit_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU); + } else { + pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU); + } + } + + if (name == NULL) { + newname = gedit_file_browser_utils_file_basename (file); + } else { + newname = g_strdup (name); + } + + add_node (model, pixbuf, newname, G_OBJECT (file), flags, iter); + + if (pixbuf) + g_object_unref (pixbuf); + + g_free (newname); + + return TRUE; +} + +static void +check_mount_separator (GeditFileBookmarksStore * model, guint flags, + gboolean added) +{ + GtkTreeIter iter; + gboolean found; + + found = + find_with_flags (GTK_TREE_MODEL (model), &iter, NULL, + flags | + GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, 0); + + if (added && !found) { + /* Add the separator */ + add_node (model, NULL, NULL, NULL, + flags | GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, + NULL); + } else if (!added && found) { + remove_node (GTK_TREE_MODEL (model), &iter); + } +} + +static void +init_special_directories (GeditFileBookmarksStore * model) +{ + gchar const *path; + GFile * file; + + path = g_get_home_dir (); + if (path != NULL) + { + file = g_file_new_for_path (path); + add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_HOME | + GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); + g_object_unref (file); + } + + path = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP); + if (path != NULL) + { + file = g_file_new_for_path (path); + add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP | + GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); + g_object_unref (file); + } + + path = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS); + if (path != NULL) + { + file = g_file_new_for_path (path); + add_file (model, file, NULL, GEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS | + GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, NULL); + g_object_unref (file); + } + + file = g_file_new_for_uri ("file:///"); + add_file (model, file, _("File System"), GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, NULL); + g_object_unref (file); + + check_mount_separator (model, GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, TRUE); +} + +static void +get_fs_properties (gpointer fs, + gchar **name, + GdkPixbuf **pixbuf, + guint *flags) +{ + GIcon *icon = NULL; + + *flags = GEDIT_FILE_BOOKMARKS_STORE_IS_FS; + *name = NULL; + *pixbuf = NULL; + + if (G_IS_DRIVE (fs)) + { + icon = g_drive_get_icon (G_DRIVE (fs)); + *name = g_drive_get_name (G_DRIVE (fs)); + + *flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE; + } + else if (G_IS_VOLUME (fs)) + { + icon = g_volume_get_icon (G_VOLUME (fs)); + *name = g_volume_get_name (G_VOLUME (fs)); + + *flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME; + } + else if (G_IS_MOUNT (fs)) + { + icon = g_mount_get_icon (G_MOUNT (fs)); + *name = g_mount_get_name (G_MOUNT (fs)); + + *flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT; + } + + if (icon) + { + *pixbuf = gedit_file_browser_utils_pixbuf_from_icon (icon, GTK_ICON_SIZE_MENU); + g_object_unref (icon); + } +} + + +static void +add_fs (GeditFileBookmarksStore *model, + gpointer fs, + guint flags, + GtkTreeIter *iter) +{ + gchar *name; + GdkPixbuf *pixbuf; + guint fsflags; + + get_fs_properties (fs, &name, &pixbuf, &fsflags); + add_node (model, pixbuf, name, fs, flags | fsflags, iter); + + if (pixbuf) + g_object_unref (pixbuf); + + g_free (name); + check_mount_separator (model, GEDIT_FILE_BOOKMARKS_STORE_IS_FS, TRUE); +} + +static void +process_volume_cb (GVolume *volume, + GeditFileBookmarksStore *model) +{ + GMount *mount; + guint flags = GEDIT_FILE_BOOKMARKS_STORE_NONE; + mount = g_volume_get_mount (volume); + + /* CHECK: should we use the LOCAL/REMOTE thing still? */ + if (mount) + { + /* Show mounted volume */ + add_fs (model, mount, flags, NULL); + g_object_unref (mount); + } + else if (g_volume_can_mount (volume)) + { + /* We also show the unmounted volume here so users can + mount it if they want to access it */ + add_fs (model, volume, flags, NULL); + } +} + +static void +process_drive_novolumes (GeditFileBookmarksStore *model, + GDrive *drive) +{ + if (g_drive_is_media_removable (drive) && + !g_drive_is_media_check_automatic (drive) && + g_drive_can_poll_for_media (drive)) + { + /* This can be the case for floppy drives or other + drives where media detection fails. We show the + drive and poll for media when the user activates + it */ + add_fs (model, drive, GEDIT_FILE_BOOKMARKS_STORE_NONE, NULL); + } +} + +static void +process_drive_cb (GDrive *drive, + GeditFileBookmarksStore *model) +{ + GList *volumes; + + volumes = g_drive_get_volumes (drive); + + if (volumes) + { + /* Add all volumes for the drive */ + g_list_foreach (volumes, (GFunc)process_volume_cb, model); + g_list_free (volumes); + } + else + { + process_drive_novolumes (model, drive); + } +} + +static void +init_drives (GeditFileBookmarksStore *model) +{ + GList *drives; + + drives = g_volume_monitor_get_connected_drives (model->priv->volume_monitor); + + g_list_foreach (drives, (GFunc)process_drive_cb, model); + g_list_foreach (drives, (GFunc)g_object_unref, NULL); + g_list_free (drives); +} + +static void +process_volume_nodrive_cb (GVolume *volume, + GeditFileBookmarksStore *model) +{ + GDrive *drive; + + drive = g_volume_get_drive (volume); + + if (drive) + { + g_object_unref (drive); + return; + } + + process_volume_cb (volume, model); +} + +static void +init_volumes (GeditFileBookmarksStore *model) +{ + GList *volumes; + + volumes = g_volume_monitor_get_volumes (model->priv->volume_monitor); + + g_list_foreach (volumes, (GFunc)process_volume_nodrive_cb, model); + g_list_foreach (volumes, (GFunc)g_object_unref, NULL); + g_list_free (volumes); +} + +static void +process_mount_novolume_cb (GMount *mount, + GeditFileBookmarksStore *model) +{ + GVolume *volume; + + volume = g_mount_get_volume (mount); + + if (volume) + { + g_object_unref (volume); + } + else if (!g_mount_is_shadowed (mount)) + { + /* Add the mount */ + add_fs (model, mount, GEDIT_FILE_BOOKMARKS_STORE_NONE, NULL); + } +} + +static void +init_mounts (GeditFileBookmarksStore *model) +{ + GList *mounts; + + mounts = g_volume_monitor_get_mounts (model->priv->volume_monitor); + + g_list_foreach (mounts, (GFunc)process_mount_novolume_cb, model); + g_list_foreach (mounts, (GFunc)g_object_unref, NULL); + g_list_free (mounts); +} + +static void +init_fs (GeditFileBookmarksStore * model) +{ + if (model->priv->volume_monitor == NULL) { + const gchar **ptr; + const gchar *signals[] = { + "drive-connected", "drive-changed", "drive-disconnected", + "volume-added", "volume-removed", "volume-changed", + "mount-added", "mount-removed", "mount-changed", + NULL + }; + + model->priv->volume_monitor = g_volume_monitor_get (); + + /* Connect signals */ + for (ptr = signals; *ptr; ptr++) + { + g_signal_connect (model->priv->volume_monitor, + *ptr, + G_CALLBACK (on_fs_changed), model); + } + } + + /* First go through all the connected drives */ + init_drives (model); + + /* Then add all volumes, not associated with a drive */ + init_volumes (model); + + /* Then finally add all mounts that have no volume */ + init_mounts (model); +} + +static gboolean +add_bookmark (GeditFileBookmarksStore * model, + gchar const * name, + gchar const * uri) +{ + GFile * file; + gboolean ret; + guint flags = GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK; + GtkTreeIter iter; + + file = g_file_new_for_uri (uri); + + if (g_file_is_native (file)) { + flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK; + } else { + flags |= GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK; + } + + ret = add_file (model, file, name, flags, &iter); + + g_object_unref (file); + + return ret; +} + +static void +init_bookmarks (GeditFileBookmarksStore * model) +{ + gchar *bookmarks; + GError *error = NULL; + gchar *contents; + gchar **lines; + gchar **line; + gboolean added = FALSE; + + /* Read the bookmarks file */ + bookmarks = g_build_filename (g_get_home_dir (), + ".gtk-bookmarks", + NULL); + + if (g_file_get_contents (bookmarks, &contents, NULL, &error)) { + lines = g_strsplit (contents, "\n", 0); + + for (line = lines; *line; ++line) { + if (**line) { + gchar *pos; + gchar *name; + + /* CHECK: is this really utf8? */ + pos = g_utf8_strchr (*line, -1, ' '); + + if (pos != NULL) { + *pos = '\0'; + name = pos + 1; + } else { + name = NULL; + } + + /* the bookmarks file should contain valid + * URIs, but paranoia is good */ + if (gedit_utils_is_valid_uri (*line)) { + added |= add_bookmark (model, name, *line); + } + } + } + + g_strfreev (lines); + g_free (contents); + + /* Add a watch */ + if (model->priv->bookmarks_monitor == NULL) { + GFile * file; + + file = g_file_new_for_path (bookmarks); + model->priv->bookmarks_monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + + g_signal_connect (model->priv->bookmarks_monitor, + "changed", + (GCallback)on_bookmarks_file_changed, + model); + } + } else { + /* The bookmarks file doesn't exist (which is perfectly fine) */ + g_error_free (error); + } + + if (added) { + /* Bookmarks separator */ + add_node (model, NULL, NULL, NULL, + GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK | + GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR, NULL); + } + + g_free (bookmarks); +} + +static gint flags_order[] = { + GEDIT_FILE_BOOKMARKS_STORE_IS_HOME, + GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP, + GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR, + GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT, + GEDIT_FILE_BOOKMARKS_STORE_IS_FS, + GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK, + -1 +}; + +static gint +utf8_casecmp (gchar const *s1, const gchar * s2) +{ + gchar *n1; + gchar *n2; + gint result; + + n1 = g_utf8_casefold (s1, -1); + n2 = g_utf8_casefold (s2, -1); + + result = g_utf8_collate (n1, n2); + + g_free (n1); + g_free (n2); + + return result; +} + +static gint +bookmarks_compare_names (GtkTreeModel * model, GtkTreeIter * a, + GtkTreeIter * b) +{ + gchar *n1; + gchar *n2; + gint result; + guint f1; + guint f2; + + gtk_tree_model_get (model, a, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n1, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1, + -1); + gtk_tree_model_get (model, b, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, &n2, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2, + -1); + + /* do not sort actual bookmarks to keep same order as in caja */ + if ((f1 & GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK) && + (f2 & GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK)) + result = 0; + else if (n1 == NULL && n2 == NULL) + result = 0; + else if (n1 == NULL) + result = -1; + else if (n2 == NULL) + result = 1; + else + result = utf8_casecmp (n1, n2); + + g_free (n1); + g_free (n2); + + return result; +} + +static gint +bookmarks_compare_flags (GtkTreeModel * model, GtkTreeIter * a, + GtkTreeIter * b) +{ + guint f1; + guint f2; + gint *flags; + guint sep; + + sep = GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR; + + gtk_tree_model_get (model, a, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f1, + -1); + gtk_tree_model_get (model, b, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &f2, + -1); + + for (flags = flags_order; *flags != -1; ++flags) { + if ((f1 & *flags) != (f2 & *flags)) { + if (f1 & *flags) { + return -1; + } else { + return 1; + } + } else if ((f1 & *flags) && (f1 & sep) != (f2 & sep)) { + if (f1 & sep) + return -1; + else + return 1; + } + } + + return 0; +} + +static gint +bookmarks_compare_func (GtkTreeModel * model, GtkTreeIter * a, + GtkTreeIter * b, gpointer user_data) +{ + gint result; + + result = bookmarks_compare_flags (model, a, b); + + if (result == 0) + result = bookmarks_compare_names (model, a, b); + + return result; +} + +static gboolean +find_with_flags (GtkTreeModel * model, GtkTreeIter * iter, gpointer obj, + guint flags, guint notflags) +{ + GtkTreeIter child; + guint childflags = 0; + GObject * childobj; + gboolean fequal; + + if (!gtk_tree_model_get_iter_first (model, &child)) + return FALSE; + + do { + gtk_tree_model_get (model, &child, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + &childobj, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + &childflags, -1); + + fequal = (obj == childobj); + + if (childobj) + g_object_unref (childobj); + + if ((obj == NULL || fequal) && + (childflags & flags) == flags + && !(childflags & notflags)) { + *iter = child; + return TRUE; + } + } while (gtk_tree_model_iter_next (model, &child)); + + return FALSE; +} + +static void +remove_node (GtkTreeModel * model, GtkTreeIter * iter) +{ + guint flags; + + gtk_tree_model_get (model, iter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!(flags & GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR)) { + if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS) { + check_mount_separator (GEDIT_FILE_BOOKMARKS_STORE (model), + flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS, + FALSE); + } + } + + gtk_tree_store_remove (GTK_TREE_STORE (model), iter); +} + +static void +remove_bookmarks (GeditFileBookmarksStore * model) +{ + GtkTreeIter iter; + + while (find_with_flags (GTK_TREE_MODEL (model), &iter, NULL, + GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK, + 0)) { + remove_node (GTK_TREE_MODEL (model), &iter); + } +} + +static void +initialize_fill (GeditFileBookmarksStore * model) +{ + init_special_directories (model); + init_fs (model); + init_bookmarks (model); +} + +/* Public */ +GeditFileBookmarksStore * +gedit_file_bookmarks_store_new (void) +{ + GeditFileBookmarksStore *model; + GType column_types[] = { + GDK_TYPE_PIXBUF, + G_TYPE_STRING, + G_TYPE_OBJECT, + G_TYPE_UINT + }; + + model = g_object_new (GEDIT_TYPE_FILE_BOOKMARKS_STORE, NULL); + gtk_tree_store_set_column_types (GTK_TREE_STORE (model), + GEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS, + column_types); + + gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (model), + bookmarks_compare_func, + NULL, NULL); + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), + GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, + GTK_SORT_ASCENDING); + + initialize_fill (model); + + return model; +} + +gchar * +gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model, + GtkTreeIter * iter) +{ + GObject * obj; + GFile * file = NULL; + guint flags; + gchar * ret = NULL; + gboolean isfs; + + g_return_val_if_fail (GEDIT_IS_FILE_BOOKMARKS_STORE (model), NULL); + g_return_val_if_fail (iter != NULL, NULL); + + gtk_tree_model_get (GTK_TREE_MODEL (model), iter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + &flags, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + &obj, + -1); + + if (obj == NULL) + return NULL; + + isfs = (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_FS); + + if (isfs && (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT)) + { + file = g_mount_get_root (G_MOUNT (obj)); + } + else if (!isfs) + { + file = g_object_ref (obj); + } + + g_object_unref (obj); + + if (file) + { + ret = g_file_get_uri (file); + g_object_unref (file); + } + + return ret; +} + +void +gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model) +{ + gtk_tree_store_clear (GTK_TREE_STORE (model)); + initialize_fill (model); +} + +static void +on_fs_changed (GVolumeMonitor *monitor, + GObject *object, + GeditFileBookmarksStore *model) +{ + GtkTreeModel *tree_model = GTK_TREE_MODEL (model); + guint flags = GEDIT_FILE_BOOKMARKS_STORE_IS_FS; + guint noflags = GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR; + GtkTreeIter iter; + + /* clear all fs items */ + while (find_with_flags (tree_model, &iter, NULL, flags, noflags)) + remove_node (tree_model, &iter); + + /* then reinitialize */ + init_fs (model); +} + +static void +on_bookmarks_file_changed (GFileMonitor * monitor, + GFile * file, + GFile * other_file, + GFileMonitorEvent event_type, + GeditFileBookmarksStore * model) +{ + switch (event_type) { + case G_FILE_MONITOR_EVENT_CHANGED: + case G_FILE_MONITOR_EVENT_CREATED: + /* Re-initialize bookmarks */ + remove_bookmarks (model); + init_bookmarks (model); + break; + case G_FILE_MONITOR_EVENT_DELETED: // FIXME: shouldn't we also monitor the directory? + /* Remove bookmarks */ + remove_bookmarks (model); + g_object_unref (monitor); + model->priv->bookmarks_monitor = NULL; + break; + default: + break; + } +} + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-bookmarks-store.h b/plugins/filebrowser/gedit-file-bookmarks-store.h new file mode 100755 index 00000000..bd20911e --- /dev/null +++ b/plugins/filebrowser/gedit-file-bookmarks-store.h @@ -0,0 +1,90 @@ +/* + * gedit-file-bookmarks-store.h - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 __GEDIT_FILE_BOOKMARKS_STORE_H__ +#define __GEDIT_FILE_BOOKMARKS_STORE_H__ + +#include + +G_BEGIN_DECLS +#define GEDIT_TYPE_FILE_BOOKMARKS_STORE (gedit_file_bookmarks_store_get_type ()) +#define GEDIT_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStore)) +#define GEDIT_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStore const)) +#define GEDIT_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStoreClass)) +#define GEDIT_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE)) +#define GEDIT_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BOOKMARKS_STORE)) +#define GEDIT_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BOOKMARKS_STORE, GeditFileBookmarksStoreClass)) + +typedef struct _GeditFileBookmarksStore GeditFileBookmarksStore; +typedef struct _GeditFileBookmarksStoreClass GeditFileBookmarksStoreClass; +typedef struct _GeditFileBookmarksStorePrivate GeditFileBookmarksStorePrivate; + +enum +{ + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + GEDIT_FILE_BOOKMARKS_STORE_N_COLUMNS +}; + +enum +{ + GEDIT_FILE_BOOKMARKS_STORE_NONE = 0, + GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */ + GEDIT_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */ + GEDIT_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */ + GEDIT_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */ + GEDIT_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */ + GEDIT_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */ + GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */ + GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */ + GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */ + GEDIT_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */ + GEDIT_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */ + GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */ + GEDIT_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */ +}; + +struct _GeditFileBookmarksStore +{ + GtkTreeStore parent; + + GeditFileBookmarksStorePrivate *priv; +}; + +struct _GeditFileBookmarksStoreClass +{ + GtkTreeStoreClass parent_class; +}; + +GType gedit_file_bookmarks_store_get_type (void) G_GNUC_CONST; +GType gedit_file_bookmarks_store_register_type (GTypeModule * module); + +GeditFileBookmarksStore *gedit_file_bookmarks_store_new (void); +gchar *gedit_file_bookmarks_store_get_uri (GeditFileBookmarksStore * model, + GtkTreeIter * iter); +void gedit_file_bookmarks_store_refresh (GeditFileBookmarksStore * model); + +G_END_DECLS +#endif /* __GEDIT_FILE_BOOKMARKS_STORE_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-enum-register.c.template b/plugins/filebrowser/gedit-file-browser-enum-register.c.template new file mode 100755 index 00000000..63a9c562 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-enum-register.c.template @@ -0,0 +1,20 @@ +/*** BEGIN file-header ***/ +void +gedit_file_browser_enum_and_flag_register_type (GTypeModule * module) +{ +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + /* Enumerations from "@filename@" */ + +/*** END file-production ***/ + +/*** BEGIN enumeration-production ***/ + register_@enum_name@ (module); + +/*** END enumeration-production ***/ + +/*** BEGIN file-tail ***/ +} + +/*** END file-tail ***/ diff --git a/plugins/filebrowser/gedit-file-browser-enum-types.c.template b/plugins/filebrowser/gedit-file-browser-enum-types.c.template new file mode 100755 index 00000000..4e89370d --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-enum-types.c.template @@ -0,0 +1,45 @@ +/*** BEGIN file-header ***/ +#include "gedit-file-browser-enum-types.h" + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +#include "@filename@" + +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +static GType @enum_name@_type = 0; + +static GType +register_@enum_name@ (GTypeModule *module) +{ + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, + "@VALUENAME@", + "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + + @enum_name@_type = + g_type_module_register_@type@ (module, + "@EnumName@", + values); + + return @enum_name@_type; +} + +GType +@enum_name@_get_type (void) +{ + return @enum_name@_type; +} + +/*** END value-tail ***/ diff --git a/plugins/filebrowser/gedit-file-browser-enum-types.h.template b/plugins/filebrowser/gedit-file-browser-enum-types.h.template new file mode 100755 index 00000000..aea4fad9 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-enum-types.h.template @@ -0,0 +1,29 @@ +/*** BEGIN file-header ***/ +#ifndef __GEDIT_FILE_BROWSER_ENUM_TYPES_H__ +#define __GEDIT_FILE_BROWSER_ENUM_TYPES_H__ + +#include + +G_BEGIN_DECLS + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* Enumerations from "@filename@" */ + +/*** END file-production ***/ + +/*** BEGIN enumeration-production ***/ +#define GEDIT_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) +GType @enum_name@_get_type (void) G_GNUC_CONST; + +/*** END enumeration-production ***/ + +/*** BEGIN file-tail ***/ +void gedit_file_browser_enum_and_flag_register_type (GTypeModule * module); + +G_END_DECLS + +#endif /* __GEDIT_FILE_BROWSER_ENUM_TYPES_H__ */ +/*** END file-tail ***/ + diff --git a/plugins/filebrowser/gedit-file-browser-error.h b/plugins/filebrowser/gedit-file-browser-error.h new file mode 100755 index 00000000..ec5b8618 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-error.h @@ -0,0 +1,41 @@ +/* + * gedit-file-browser-error.h - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 __GEDIT_FILE_BROWSER_ERROR_H__ +#define __GEDIT_FILE_BROWSER_ERROR_H__ + +G_BEGIN_DECLS + +typedef enum { + GEDIT_FILE_BROWSER_ERROR_NONE, + GEDIT_FILE_BROWSER_ERROR_RENAME, + GEDIT_FILE_BROWSER_ERROR_DELETE, + GEDIT_FILE_BROWSER_ERROR_NEW_FILE, + GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY, + GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY, + GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY, + GEDIT_FILE_BROWSER_ERROR_NUM +} GeditFileBrowserError; + +G_END_DECLS + +#endif /* __GEDIT_FILE_BROWSER_ERROR_H__ */ diff --git a/plugins/filebrowser/gedit-file-browser-marshal.list b/plugins/filebrowser/gedit-file-browser-marshal.list new file mode 100755 index 00000000..5fa72c8b --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-marshal.list @@ -0,0 +1,5 @@ +VOID:UINT,STRING +VOID:STRING,STRING +BOOL:OBJECT,POINTER +BOOL:POINTER +BOOL:VOID diff --git a/plugins/filebrowser/gedit-file-browser-messages.c b/plugins/filebrowser/gedit-file-browser-messages.c new file mode 100755 index 00000000..b587edf1 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-messages.c @@ -0,0 +1,1033 @@ +#include "gedit-file-browser-messages.h" +#include "gedit-file-browser-store.h" +#include + +#define MESSAGE_OBJECT_PATH "/plugins/filebrowser" +#define WINDOW_DATA_KEY "GeditFileBrowserMessagesWindowData" + +#define BUS_CONNECT(bus, name, data) gedit_message_bus_connect(bus, MESSAGE_OBJECT_PATH, #name, (GeditMessageCallback) message_##name##_cb, data, NULL) + +typedef struct +{ + GeditWindow *window; + GeditMessage *message; +} MessageCacheData; + +typedef struct +{ + guint row_inserted_id; + guint row_deleted_id; + guint root_changed_id; + guint begin_loading_id; + guint end_loading_id; + + GList *merge_ids; + GtkActionGroup *merged_actions; + + GeditMessageBus *bus; + GeditFileBrowserWidget *widget; + GHashTable *row_tracking; + + GHashTable *filters; +} WindowData; + +typedef struct +{ + gulong id; + + GeditWindow *window; + GeditMessage *message; +} FilterData; + +static WindowData * +window_data_new (GeditWindow *window, + GeditFileBrowserWidget *widget) +{ + WindowData *data = g_slice_new (WindowData); + GtkUIManager *manager; + GList *groups; + + data->bus = gedit_window_get_message_bus (window); + data->widget = widget; + data->row_tracking = g_hash_table_new_full (g_str_hash, + g_str_equal, + (GDestroyNotify)g_free, + (GDestroyNotify)gtk_tree_row_reference_free); + + data->filters = g_hash_table_new_full (g_str_hash, + g_str_equal, + (GDestroyNotify)g_free, + NULL); + + manager = gedit_file_browser_widget_get_ui_manager (widget); + + data->merge_ids = NULL; + data->merged_actions = gtk_action_group_new ("MessageMergedActions"); + + groups = gtk_ui_manager_get_action_groups (manager); + gtk_ui_manager_insert_action_group (manager, data->merged_actions, g_list_length (groups)); + + g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, data); + + return data; +} + +static WindowData * +get_window_data (GeditWindow * window) +{ + return (WindowData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY)); +} + +static void +window_data_free (GeditWindow *window) +{ + WindowData *data = get_window_data (window); + GtkUIManager *manager; + GList *item; + + g_hash_table_destroy (data->row_tracking); + g_hash_table_destroy (data->filters); + + manager = gedit_file_browser_widget_get_ui_manager (data->widget); + gtk_ui_manager_remove_action_group (manager, data->merged_actions); + + for (item = data->merge_ids; item; item = item->next) + gtk_ui_manager_remove_ui (manager, GPOINTER_TO_INT (item->data)); + + g_list_free (data->merge_ids); + g_object_unref (data->merged_actions); + + g_slice_free (WindowData, data); + + g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL); +} + +static FilterData * +filter_data_new (GeditWindow *window, + GeditMessage *message) +{ + FilterData *data = g_slice_new (FilterData); + WindowData *wdata; + + data->window = window; + data->id = 0; + data->message = message; + + wdata = get_window_data (window); + + g_hash_table_insert (wdata->filters, + gedit_message_type_identifier (gedit_message_get_object_path (message), + gedit_message_get_method (message)), + data); + + return data; +} + +static void +filter_data_free (FilterData *data) +{ + WindowData *wdata = get_window_data (data->window); + gchar *identifier; + + identifier = gedit_message_type_identifier (gedit_message_get_object_path (data->message), + gedit_message_get_method (data->message)); + + g_hash_table_remove (wdata->filters, identifier); + g_free (identifier); + + g_object_unref (data->message); + g_slice_free (FilterData, data); +} + +static GtkTreePath * +track_row_lookup (WindowData *data, + const gchar *id) +{ + GtkTreeRowReference *ref; + + ref = (GtkTreeRowReference *)g_hash_table_lookup (data->row_tracking, id); + + if (!ref) + return NULL; + + return gtk_tree_row_reference_get_path (ref); +} + +static void +message_cache_data_free (MessageCacheData *data) +{ + g_object_unref (data->message); + g_slice_free (MessageCacheData, data); +} + +static MessageCacheData * +message_cache_data_new (GeditWindow *window, + GeditMessage *message) +{ + MessageCacheData *data = g_slice_new (MessageCacheData); + + data->window = window; + data->message = message; + + return data; +} + +static void +message_get_root_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + GeditFileBrowserStore *store; + gchar *uri; + + store = gedit_file_browser_widget_get_browser_store (data->widget); + uri = gedit_file_browser_store_get_virtual_root (store); + + gedit_message_set (message, "uri", uri, NULL); + g_free (uri); +} + +static void +message_set_root_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gchar *root = NULL; + gchar *virtual = NULL; + + gedit_message_get (message, "uri", &root, NULL); + + if (!root) + return; + + if (gedit_message_has_key (message, "virtual")) + gedit_message_get (message, "virtual", &virtual, NULL); + + if (virtual) + gedit_file_browser_widget_set_root_and_virtual_root (data->widget, root, virtual); + else + gedit_file_browser_widget_set_root (data->widget, root, TRUE); + + g_free (root); + g_free (virtual); +} + +static void +message_set_emblem_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gchar *id = NULL; + gchar *emblem = NULL; + GtkTreePath *path; + GeditFileBrowserStore *store; + + gedit_message_get (message, "id", &id, "emblem", &emblem, NULL); + + if (!id || !emblem) + { + g_free (id); + g_free (emblem); + + return; + } + + path = track_row_lookup (data, id); + + if (path != NULL) + { + GError *error = NULL; + GdkPixbuf *pixbuf; + + pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), + emblem, + 10, + 0, + &error); + + if (pixbuf) + { + GValue value = { 0, }; + GtkTreeIter iter; + + store = gedit_file_browser_widget_get_browser_store (data->widget); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path)) + { + g_value_init (&value, GDK_TYPE_PIXBUF); + g_value_set_object (&value, pixbuf); + + gedit_file_browser_store_set_value (store, + &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM, + &value); + + g_value_unset (&value); + } + + g_object_unref (pixbuf); + } + + if (error) + g_error_free (error); + } + + g_free (id); + g_free (emblem); +} + +static gchar * +item_id (const gchar *path, + const gchar *uri) +{ + return g_strconcat (path, "::", uri, NULL); +} + +static gchar * +track_row (WindowData *data, + GeditFileBrowserStore *store, + GtkTreePath *path, + const gchar *uri) +{ + GtkTreeRowReference *ref; + gchar *id; + gchar *pathstr; + + pathstr = gtk_tree_path_to_string (path); + id = item_id (pathstr, uri); + + ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (store), path); + g_hash_table_insert (data->row_tracking, g_strdup (id), ref); + + g_free (pathstr); + + return id; +} + +static void +set_item_message (WindowData *data, + GtkTreeIter *iter, + GtkTreePath *path, + GeditMessage *message) +{ + GeditFileBrowserStore *store; + gchar *uri = NULL; + guint flags = 0; + gchar *track_id; + + store = gedit_file_browser_widget_get_browser_store (data->widget); + + gtk_tree_model_get (GTK_TREE_MODEL (store), iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!uri) + return; + + if (path && gtk_tree_path_get_depth (path) != 0) + track_id = track_row (data, store, path, uri); + else + track_id = NULL; + + gedit_message_set (message, + "id", track_id, + "uri", uri, + NULL); + + if (gedit_message_has_key (message, "is_directory")) + { + gedit_message_set (message, + "is_directory", FILE_IS_DIR (flags), + NULL); + } + + g_free (uri); + g_free (track_id); +} + +static gboolean +custom_message_filter_func (GeditFileBrowserWidget *widget, + GeditFileBrowserStore *store, + GtkTreeIter *iter, + FilterData *data) +{ + WindowData *wdata = get_window_data (data->window); + gchar *uri = NULL; + guint flags = 0; + gboolean filter = FALSE; + GtkTreePath *path; + + gtk_tree_model_get (GTK_TREE_MODEL (store), iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!uri || FILE_IS_DUMMY (flags)) + { + g_free (uri); + return FALSE; + } + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter); + set_item_message (wdata, iter, path, data->message); + gtk_tree_path_free (path); + + gedit_message_set (data->message, "filter", filter, NULL); + + gedit_message_bus_send_message_sync (wdata->bus, data->message); + gedit_message_get (data->message, "filter", &filter, NULL); + + return !filter; +} + +static void +message_add_filter_cb (GeditMessageBus *bus, + GeditMessage *message, + GeditWindow *window) +{ + gchar *object_path = NULL; + gchar *method = NULL; + gulong id; + GeditMessageType *message_type; + GeditMessage *cbmessage; + FilterData *filter_data; + WindowData *data = get_window_data (window); + + gedit_message_get (message, + "object_path", &object_path, + "method", &method, + NULL); + + // Check if there exists such a 'callback' message + if (!object_path || !method) + { + g_free (object_path); + g_free (method); + + return; + } + + message_type = gedit_message_bus_lookup (bus, object_path, method); + + if (!message_type) + { + g_free (object_path); + g_free (method); + + return; + } + + // Check if the message type has the correct arguments + if (gedit_message_type_lookup (message_type, "id") != G_TYPE_STRING || + gedit_message_type_lookup (message_type, "uri") != G_TYPE_STRING || + gedit_message_type_lookup (message_type, "is_directory") != G_TYPE_BOOLEAN || + gedit_message_type_lookup (message_type, "filter") != G_TYPE_BOOLEAN) + { + return; + } + + cbmessage = gedit_message_type_instantiate (message_type, + "id", NULL, + "uri", NULL, + "is_directory", FALSE, + "filter", FALSE, + NULL); + + // Register the custom filter on the widget + filter_data = filter_data_new (window, cbmessage); + id = gedit_file_browser_widget_add_filter (data->widget, + (GeditFileBrowserWidgetFilterFunc)custom_message_filter_func, + filter_data, + (GDestroyNotify)filter_data_free); + + filter_data->id = id; +} + +static void +message_remove_filter_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gulong id = 0; + + gedit_message_get (message, "id", &id, NULL); + + if (!id) + return; + + gedit_file_browser_widget_remove_filter (data->widget, id); +} + +static void +message_up_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + GeditFileBrowserStore *store = gedit_file_browser_widget_get_browser_store (data->widget); + + gedit_file_browser_store_set_virtual_root_up (store); +} + +static void +message_history_back_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gedit_file_browser_widget_history_back (data->widget); +} + +static void +message_history_forward_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gedit_file_browser_widget_history_forward (data->widget); +} + +static void +message_refresh_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gedit_file_browser_widget_refresh (data->widget); +} + +static void +message_set_show_hidden_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gboolean active = FALSE; + GeditFileBrowserStore *store; + GeditFileBrowserStoreFilterMode mode; + + gedit_message_get (message, "active", &active, NULL); + + store = gedit_file_browser_widget_get_browser_store (data->widget); + mode = gedit_file_browser_store_get_filter_mode (store); + + if (active) + mode &= ~GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + else + mode |= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + + gedit_file_browser_store_set_filter_mode (store, mode); +} + +static void +message_set_show_binary_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gboolean active = FALSE; + GeditFileBrowserStore *store; + GeditFileBrowserStoreFilterMode mode; + + gedit_message_get (message, "active", &active, NULL); + + store = gedit_file_browser_widget_get_browser_store (data->widget); + mode = gedit_file_browser_store_get_filter_mode (store); + + if (active) + mode &= ~GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + else + mode |= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + + gedit_file_browser_store_set_filter_mode (store, mode); +} + +static void +message_show_bookmarks_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gedit_file_browser_widget_show_bookmarks (data->widget); +} + +static void +message_show_files_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + gedit_file_browser_widget_show_files (data->widget); +} + +static void +message_add_context_item_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + GtkAction *action = NULL; + gchar *path = NULL; + gchar *name; + GtkUIManager *manager; + guint merge_id; + + gedit_message_get (message, + "action", &action, + "path", &path, + NULL); + + if (!action || !path) + { + if (action) + g_object_unref (action); + + g_free (path); + return; + } + + gtk_action_group_add_action (data->merged_actions, action); + manager = gedit_file_browser_widget_get_ui_manager (data->widget); + name = g_strconcat (gtk_action_get_name (action), "MenuItem", NULL); + merge_id = gtk_ui_manager_new_merge_id (manager); + + gtk_ui_manager_add_ui (manager, + merge_id, + path, + name, + gtk_action_get_name (action), + GTK_UI_MANAGER_AUTO, + FALSE); + + if (gtk_ui_manager_get_widget (manager, path)) + { + data->merge_ids = g_list_prepend (data->merge_ids, GINT_TO_POINTER (merge_id)); + gedit_message_set (message, "id", merge_id, NULL); + } + else + { + gedit_message_set (message, "id", 0, NULL); + } + + g_object_unref (action); + g_free (path); + g_free (name); +} + +static void +message_remove_context_item_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + guint merge_id = 0; + GtkUIManager *manager; + + gedit_message_get (message, "id", &merge_id, NULL); + + if (merge_id == 0) + return; + + manager = gedit_file_browser_widget_get_ui_manager (data->widget); + + data->merge_ids = g_list_remove (data->merge_ids, GINT_TO_POINTER (merge_id)); + gtk_ui_manager_remove_ui (manager, merge_id); +} + +static void +message_get_view_cb (GeditMessageBus *bus, + GeditMessage *message, + WindowData *data) +{ + GeditFileBrowserView *view; + view = gedit_file_browser_widget_get_browser_view (data->widget); + + gedit_message_set (message, "view", view, NULL); +} + +static void +register_methods (GeditWindow *window, + GeditFileBrowserWidget *widget) +{ + GeditMessageBus *bus = gedit_window_get_message_bus (window); + WindowData *data = get_window_data (window); + + /* Register method calls */ + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "get_root", + 1, + "uri", G_TYPE_STRING, + NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "set_root", + 1, + "uri", G_TYPE_STRING, + "virtual", G_TYPE_STRING, + NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "set_emblem", + 0, + "id", G_TYPE_STRING, + "emblem", G_TYPE_STRING, + NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "add_filter", + 1, + "object_path", G_TYPE_STRING, + "method", G_TYPE_STRING, + "id", G_TYPE_ULONG, + NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "remove_filter", + 0, + "id", G_TYPE_ULONG, + NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "add_context_item", + 1, + "action", GTK_TYPE_ACTION, + "path", G_TYPE_STRING, + "id", G_TYPE_UINT, + NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "remove_context_item", + 0, + "id", G_TYPE_UINT, + NULL); + + gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "up", 0, NULL); + + gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_back", 0, NULL); + gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "history_forward", 0, NULL); + + gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "refresh", 0, NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "set_show_hidden", + 0, + "active", G_TYPE_BOOLEAN, + NULL); + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "set_show_binary", + 0, + "active", G_TYPE_BOOLEAN, + NULL); + + gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_bookmarks", 0, NULL); + gedit_message_bus_register (bus, MESSAGE_OBJECT_PATH, "show_files", 0, NULL); + + gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "get_view", + 1, + "view", GEDIT_TYPE_FILE_BROWSER_VIEW, + NULL); + + BUS_CONNECT (bus, get_root, data); + BUS_CONNECT (bus, set_root, data); + BUS_CONNECT (bus, set_emblem, data); + BUS_CONNECT (bus, add_filter, window); + BUS_CONNECT (bus, remove_filter, data); + + BUS_CONNECT (bus, add_context_item, data); + BUS_CONNECT (bus, remove_context_item, data); + + BUS_CONNECT (bus, up, data); + BUS_CONNECT (bus, history_back, data); + BUS_CONNECT (bus, history_forward, data); + + BUS_CONNECT (bus, refresh, data); + + BUS_CONNECT (bus, set_show_hidden, data); + BUS_CONNECT (bus, set_show_binary, data); + + BUS_CONNECT (bus, show_bookmarks, data); + BUS_CONNECT (bus, show_files, data); + + BUS_CONNECT (bus, get_view, data); +} + +static void +store_row_inserted (GeditFileBrowserStore *store, + GtkTreePath *path, + GtkTreeIter *iter, + MessageCacheData *data) +{ + gchar *uri = NULL; + guint flags = 0; + + gtk_tree_model_get (GTK_TREE_MODEL (store), iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags)) + { + WindowData *wdata = get_window_data (data->window); + + set_item_message (wdata, iter, path, data->message); + gedit_message_bus_send_message_sync (wdata->bus, data->message); + } + + g_free (uri); +} + +static void +store_row_deleted (GeditFileBrowserStore *store, + GtkTreePath *path, + MessageCacheData *data) +{ + GtkTreeIter iter; + gchar *uri = NULL; + guint flags = 0; + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path)) + return; + + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!FILE_IS_DUMMY (flags) && !FILE_IS_FILTERED (flags)) + { + WindowData *wdata = get_window_data (data->window); + + set_item_message (wdata, &iter, path, data->message); + gedit_message_bus_send_message_sync (wdata->bus, data->message); + } + + g_free (uri); +} + +static void +store_virtual_root_changed (GeditFileBrowserStore *store, + GParamSpec *spec, + MessageCacheData *data) +{ + WindowData *wdata = get_window_data (data->window); + gchar *uri; + + uri = gedit_file_browser_store_get_virtual_root (store); + + if (!uri) + return; + + gedit_message_set (data->message, + "uri", uri, + NULL); + + gedit_message_bus_send_message_sync (wdata->bus, data->message); + + g_free (uri); +} + +static void +store_begin_loading (GeditFileBrowserStore *store, + GtkTreeIter *iter, + MessageCacheData *data) +{ + GtkTreePath *path; + WindowData *wdata = get_window_data (data->window); + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter); + + set_item_message (wdata, iter, path, data->message); + + gedit_message_bus_send_message_sync (wdata->bus, data->message); + gtk_tree_path_free (path); +} + +static void +store_end_loading (GeditFileBrowserStore *store, + GtkTreeIter *iter, + MessageCacheData *data) +{ + GtkTreePath *path; + WindowData *wdata = get_window_data (data->window); + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter); + + set_item_message (wdata, iter, path, data->message); + + gedit_message_bus_send_message_sync (wdata->bus, data->message); + gtk_tree_path_free (path); +} + +static void +register_signals (GeditWindow *window, + GeditFileBrowserWidget *widget) +{ + GeditMessageBus *bus = gedit_window_get_message_bus (window); + GeditFileBrowserStore *store; + GeditMessageType *inserted_type; + GeditMessageType *deleted_type; + GeditMessageType *begin_loading_type; + GeditMessageType *end_loading_type; + GeditMessageType *root_changed_type; + + GeditMessage *message; + WindowData *data; + + /* Register signals */ + root_changed_type = gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "root_changed", + 0, + "id", G_TYPE_STRING, + "uri", G_TYPE_STRING, + NULL); + + begin_loading_type = gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "begin_loading", + 0, + "id", G_TYPE_STRING, + "uri", G_TYPE_STRING, + NULL); + + end_loading_type = gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "end_loading", + 0, + "id", G_TYPE_STRING, + "uri", G_TYPE_STRING, + NULL); + + inserted_type = gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "inserted", + 0, + "id", G_TYPE_STRING, + "uri", G_TYPE_STRING, + "is_directory", G_TYPE_BOOLEAN, + NULL); + + deleted_type = gedit_message_bus_register (bus, + MESSAGE_OBJECT_PATH, "deleted", + 0, + "id", G_TYPE_STRING, + "uri", G_TYPE_STRING, + "is_directory", G_TYPE_BOOLEAN, + NULL); + + store = gedit_file_browser_widget_get_browser_store (widget); + + message = gedit_message_type_instantiate (inserted_type, + "id", NULL, + "uri", NULL, + "is_directory", FALSE, + NULL); + + data = get_window_data (window); + + data->row_inserted_id = + g_signal_connect_data (store, + "row-inserted", + G_CALLBACK (store_row_inserted), + message_cache_data_new (window, message), + (GClosureNotify)message_cache_data_free, + 0); + + message = gedit_message_type_instantiate (deleted_type, + "id", NULL, + "uri", NULL, + "is_directory", FALSE, + NULL); + data->row_deleted_id = + g_signal_connect_data (store, + "row-deleted", + G_CALLBACK (store_row_deleted), + message_cache_data_new (window, message), + (GClosureNotify)message_cache_data_free, + 0); + + message = gedit_message_type_instantiate (root_changed_type, + "id", NULL, + "uri", NULL, + NULL); + data->root_changed_id = + g_signal_connect_data (store, + "notify::virtual-root", + G_CALLBACK (store_virtual_root_changed), + message_cache_data_new (window, message), + (GClosureNotify)message_cache_data_free, + 0); + + message = gedit_message_type_instantiate (begin_loading_type, + "id", NULL, + "uri", NULL, + NULL); + data->begin_loading_id = + g_signal_connect_data (store, + "begin_loading", + G_CALLBACK (store_begin_loading), + message_cache_data_new (window, message), + (GClosureNotify)message_cache_data_free, + 0); + + message = gedit_message_type_instantiate (end_loading_type, + "id", NULL, + "uri", NULL, + NULL); + data->end_loading_id = + g_signal_connect_data (store, + "end_loading", + G_CALLBACK (store_end_loading), + message_cache_data_new (window, message), + (GClosureNotify)message_cache_data_free, + 0); +} + +static void +message_unregistered (GeditMessageBus *bus, + GeditMessageType *message_type, + GeditWindow *window) +{ + gchar *identifier = gedit_message_type_identifier (gedit_message_type_get_object_path (message_type), + gedit_message_type_get_method (message_type)); + FilterData *data; + WindowData *wdata = get_window_data (window); + + data = g_hash_table_lookup (wdata->filters, identifier); + + if (data) + gedit_file_browser_widget_remove_filter (wdata->widget, data->id); + + g_free (identifier); +} + +void +gedit_file_browser_messages_register (GeditWindow *window, + GeditFileBrowserWidget *widget) +{ + window_data_new (window, widget); + + register_methods (window, widget); + register_signals (window, widget); + + g_signal_connect (gedit_window_get_message_bus (window), + "unregistered", + G_CALLBACK (message_unregistered), + window); +} + +static void +cleanup_signals (GeditWindow *window) +{ + WindowData *data = get_window_data (window); + GeditFileBrowserStore *store; + + store = gedit_file_browser_widget_get_browser_store (data->widget); + + g_signal_handler_disconnect (store, data->row_inserted_id); + g_signal_handler_disconnect (store, data->row_deleted_id); + g_signal_handler_disconnect (store, data->root_changed_id); + g_signal_handler_disconnect (store, data->begin_loading_id); + g_signal_handler_disconnect (store, data->end_loading_id); + + g_signal_handlers_disconnect_by_func (data->bus, message_unregistered, window); +} + +void +gedit_file_browser_messages_unregister (GeditWindow *window) +{ + GeditMessageBus *bus = gedit_window_get_message_bus (window); + + cleanup_signals (window); + gedit_message_bus_unregister_all (bus, MESSAGE_OBJECT_PATH); + + window_data_free (window); +} diff --git a/plugins/filebrowser/gedit-file-browser-messages.h b/plugins/filebrowser/gedit-file-browser-messages.h new file mode 100755 index 00000000..e62094e8 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-messages.h @@ -0,0 +1,35 @@ +/* + * gedit-file-browser-messages.h - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2008 - Jesse van den Kieboom + * + * 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, 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 __GEDIT_FILE_BROWSER_MESSAGES_H__ +#define __GEDIT_FILE_BROWSER_MESSAGES_H__ + +#include +#include +#include "gedit-file-browser-widget.h" + +void gedit_file_browser_messages_register (GeditWindow *window, + GeditFileBrowserWidget *widget); +void gedit_file_browser_messages_unregister (GeditWindow *window); + +#endif /* __GEDIT_FILE_BROWSER_MESSAGES_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/gedit-file-browser-plugin.c new file mode 100755 index 00000000..f2da19f5 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-plugin.c @@ -0,0 +1,1254 @@ +/* + * gedit-file-browser-plugin.c - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "gedit-file-browser-enum-types.h" +#include "gedit-file-browser-plugin.h" +#include "gedit-file-browser-utils.h" +#include "gedit-file-browser-error.h" +#include "gedit-file-browser-widget.h" +#include "gedit-file-browser-messages.h" + +#define WINDOW_DATA_KEY "GeditFileBrowserPluginWindowData" +#define FILE_BROWSER_BASE_KEY "/apps/gedit-2/plugins/filebrowser" +#define CAJA_CLICK_POLICY_BASE_KEY "/apps/caja/preferences" +#define CAJA_CLICK_POLICY_KEY "click_policy" +#define CAJA_ENABLE_DELETE_KEY "enable_delete" +#define CAJA_CONFIRM_TRASH_KEY "confirm_trash" +#define TERMINAL_EXEC_KEY "/desktop/mate/applications/terminal/exec" + +#define GEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginPrivate)) + +struct _GeditFileBrowserPluginPrivate +{ + gpointer dummy; +}; + +typedef struct _GeditFileBrowserPluginData +{ + GeditFileBrowserWidget * tree_widget; + gulong merge_id; + GtkActionGroup * action_group; + GtkActionGroup * single_selection_action_group; + gboolean auto_root; + gulong end_loading_handle; + gboolean confirm_trash; + + guint click_policy_handle; + guint enable_delete_handle; + guint confirm_trash_handle; +} GeditFileBrowserPluginData; + +static void on_uri_activated_cb (GeditFileBrowserWidget * widget, + gchar const *uri, + GeditWindow * window); +static void on_error_cb (GeditFileBrowserWidget * widget, + guint code, + gchar const *message, + GeditWindow * window); +static void on_model_set_cb (GeditFileBrowserView * widget, + GParamSpec *arg1, + GeditWindow * window); +static void on_virtual_root_changed_cb (GeditFileBrowserStore * model, + GParamSpec * param, + GeditWindow * window); +static void on_filter_mode_changed_cb (GeditFileBrowserStore * model, + GParamSpec * param, + GeditWindow * window); +static void on_rename_cb (GeditFileBrowserStore * model, + const gchar * olduri, + const gchar * newuri, + GeditWindow * window); +static void on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget, + GParamSpec * param, + GeditWindow * window); +static void on_tab_added_cb (GeditWindow * window, + GeditTab * tab, + GeditFileBrowserPluginData * data); +static gboolean on_confirm_delete_cb (GeditFileBrowserWidget * widget, + GeditFileBrowserStore * store, + GList * rows, + GeditWindow * window); +static gboolean on_confirm_no_trash_cb (GeditFileBrowserWidget * widget, + GList * files, + GeditWindow * window); + +GEDIT_PLUGIN_REGISTER_TYPE_WITH_CODE (GeditFileBrowserPlugin, filetree_plugin, \ + gedit_file_browser_enum_and_flag_register_type (type_module); \ + gedit_file_browser_store_register_type (type_module); \ + gedit_file_bookmarks_store_register_type (type_module); \ + gedit_file_browser_view_register_type (type_module); \ + gedit_file_browser_widget_register_type (type_module); \ +) + + +static void +filetree_plugin_init (GeditFileBrowserPlugin * plugin) +{ + plugin->priv = GEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin); +} + +static void +filetree_plugin_finalize (GObject * object) +{ + //GeditFileBrowserPlugin * plugin = GEDIT_FILE_BROWSER_PLUGIN (object); + + G_OBJECT_CLASS (filetree_plugin_parent_class)->finalize (object); +} + +static GeditFileBrowserPluginData * +get_plugin_data (GeditWindow * window) +{ + return (GeditFileBrowserPluginData *) (g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY)); +} + +static void +on_end_loading_cb (GeditFileBrowserStore * store, + GtkTreeIter * iter, + GeditFileBrowserPluginData * data) +{ + /* Disconnect the signal */ + g_signal_handler_disconnect (store, data->end_loading_handle); + data->end_loading_handle = 0; + data->auto_root = FALSE; +} + +static void +prepare_auto_root (GeditFileBrowserPluginData *data) +{ + GeditFileBrowserStore *store; + + data->auto_root = TRUE; + + store = gedit_file_browser_widget_get_browser_store (data->tree_widget); + + if (data->end_loading_handle != 0) { + g_signal_handler_disconnect (store, data->end_loading_handle); + data->end_loading_handle = 0; + } + + data->end_loading_handle = g_signal_connect (store, + "end-loading", + G_CALLBACK (on_end_loading_cb), + data); +} + +static void +restore_default_location (GeditFileBrowserPluginData *data) +{ + gchar * root; + gchar * virtual_root; + gboolean bookmarks; + gboolean remote; + MateConfClient * client; + + client = mateconf_client_get_default (); + if (!client) + return; + + bookmarks = !mateconf_client_get_bool (client, + FILE_BROWSER_BASE_KEY "/on_load/tree_view", + NULL); + + if (bookmarks) { + g_object_unref (client); + gedit_file_browser_widget_show_bookmarks (data->tree_widget); + return; + } + + root = mateconf_client_get_string (client, + FILE_BROWSER_BASE_KEY "/on_load/root", + NULL); + virtual_root = mateconf_client_get_string (client, + FILE_BROWSER_BASE_KEY "/on_load/virtual_root", + NULL); + + remote = mateconf_client_get_bool (client, + FILE_BROWSER_BASE_KEY "/on_load/enable_remote", + NULL); + + if (root != NULL && *root != '\0') { + GFile *file; + + file = g_file_new_for_uri (root); + + if (remote || g_file_is_native (file)) { + if (virtual_root != NULL && *virtual_root != '\0') { + prepare_auto_root (data); + gedit_file_browser_widget_set_root_and_virtual_root (data->tree_widget, + root, + virtual_root); + } else { + prepare_auto_root (data); + gedit_file_browser_widget_set_root (data->tree_widget, + root, + TRUE); + } + } + + g_object_unref (file); + } + + g_object_unref (client); + g_free (root); + g_free (virtual_root); +} + +static void +restore_filter (GeditFileBrowserPluginData * data) +{ + MateConfClient * client; + gchar *filter_mode; + GeditFileBrowserStoreFilterMode mode; + gchar *pattern; + + client = mateconf_client_get_default (); + if (!client) + return; + + /* Get filter_mode */ + filter_mode = mateconf_client_get_string (client, + FILE_BROWSER_BASE_KEY "/filter_mode", + NULL); + + /* Filter mode */ + mode = gedit_file_browser_store_filter_mode_get_default (); + + if (filter_mode != NULL) { + if (strcmp (filter_mode, "hidden") == 0) { + mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + } else if (strcmp (filter_mode, "binary") == 0) { + mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + } else if (strcmp (filter_mode, "hidden_and_binary") == 0 || + strcmp (filter_mode, "binary_and_hidden") == 0) { + mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN | + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY; + } else if (strcmp (filter_mode, "none") == 0 || + *filter_mode == '\0') { + mode = GEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE; + } + } + + /* Set the filter mode */ + gedit_file_browser_store_set_filter_mode ( + gedit_file_browser_widget_get_browser_store (data->tree_widget), + mode); + + pattern = mateconf_client_get_string (client, + FILE_BROWSER_BASE_KEY "/filter_pattern", + NULL); + + gedit_file_browser_widget_set_filter_pattern (data->tree_widget, + pattern); + + g_object_unref (client); + g_free (filter_mode); + g_free (pattern); +} + +static GeditFileBrowserViewClickPolicy +click_policy_from_string (gchar const *click_policy) +{ + if (click_policy && strcmp (click_policy, "single") == 0) + return GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE; + else + return GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE; +} + +static void +on_click_policy_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + MateConfValue *value; + GeditFileBrowserPluginData * data; + gchar const *click_policy; + GeditFileBrowserViewClickPolicy policy = GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE; + GeditFileBrowserView *view; + + data = (GeditFileBrowserPluginData *)(user_data); + value = mateconf_entry_get_value (entry); + + if (value && value->type == MATECONF_VALUE_STRING) { + click_policy = mateconf_value_get_string (value); + + policy = click_policy_from_string (click_policy); + } + + view = gedit_file_browser_widget_get_browser_view (data->tree_widget); + gedit_file_browser_view_set_click_policy (view, policy); +} + +static void +on_enable_delete_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + MateConfValue *value; + GeditFileBrowserPluginData *data; + gboolean enable = FALSE; + + data = (GeditFileBrowserPluginData *)(user_data); + value = mateconf_entry_get_value (entry); + + if (value && value->type == MATECONF_VALUE_BOOL) + enable = mateconf_value_get_bool (value); + + g_object_set (G_OBJECT (data->tree_widget), "enable-delete", enable, NULL); +} + +static void +on_confirm_trash_changed (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + MateConfValue *value; + GeditFileBrowserPluginData *data; + gboolean enable = FALSE; + + data = (GeditFileBrowserPluginData *)(user_data); + value = mateconf_entry_get_value (entry); + + if (value && value->type == MATECONF_VALUE_BOOL) + enable = mateconf_value_get_bool (value); + + data->confirm_trash = enable; +} + +static void +install_caja_prefs (GeditFileBrowserPluginData *data) +{ + MateConfClient *client; + gchar *pref; + gboolean prefb; + GeditFileBrowserViewClickPolicy policy; + GeditFileBrowserView *view; + + client = mateconf_client_get_default (); + if (!client) + return; + + mateconf_client_add_dir (client, + CAJA_CLICK_POLICY_BASE_KEY, + MATECONF_CLIENT_PRELOAD_NONE, + NULL); + + /* Get click_policy */ + pref = mateconf_client_get_string (client, + CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_CLICK_POLICY_KEY, + NULL); + + policy = click_policy_from_string (pref); + + view = gedit_file_browser_widget_get_browser_view (data->tree_widget); + gedit_file_browser_view_set_click_policy (view, policy); + + if (pref) { + data->click_policy_handle = + mateconf_client_notify_add (client, + CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_CLICK_POLICY_KEY, + on_click_policy_changed, + data, + NULL, + NULL); + g_free (pref); + } + + /* Get enable_delete */ + prefb = mateconf_client_get_bool (client, + CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_ENABLE_DELETE_KEY, + NULL); + + g_object_set (G_OBJECT (data->tree_widget), "enable-delete", prefb, NULL); + + data->enable_delete_handle = + mateconf_client_notify_add (client, + CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_ENABLE_DELETE_KEY, + on_enable_delete_changed, + data, + NULL, + NULL); + + /* Get confirm_trash */ + prefb = mateconf_client_get_bool (client, + CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_CONFIRM_TRASH_KEY, + NULL); + + data->confirm_trash = prefb; + + data->confirm_trash_handle = + mateconf_client_notify_add (client, + CAJA_CLICK_POLICY_BASE_KEY "/" CAJA_CONFIRM_TRASH_KEY, + on_confirm_trash_changed, + data, + NULL, + NULL); + g_object_unref (client); +} + +static void +set_root_from_doc (GeditFileBrowserPluginData * data, + GeditDocument * doc) +{ + GFile *file; + GFile *parent; + + if (doc == NULL) + return; + + file = gedit_document_get_location (doc); + if (file == NULL) + return; + + parent = g_file_get_parent (file); + + if (parent != NULL) { + gchar * root; + + root = g_file_get_uri (parent); + + gedit_file_browser_widget_set_root (data->tree_widget, + root, + TRUE); + + g_object_unref (parent); + g_free (root); + } + + g_object_unref (file); +} + +static void +on_action_set_active_root (GtkAction * action, + GeditWindow * window) +{ + GeditFileBrowserPluginData *data; + + data = get_plugin_data (window); + set_root_from_doc (data, + gedit_window_get_active_document (window)); +} + +static gchar * +get_terminal (void) +{ + MateConfClient * client; + gchar * terminal; + + client = mateconf_client_get_default (); + terminal = mateconf_client_get_string (client, + TERMINAL_EXEC_KEY, + NULL); + g_object_unref (client); + + if (terminal == NULL) { + const gchar *term = g_getenv ("TERM"); + + if (term != NULL) + terminal = g_strdup (term); + else + terminal = g_strdup ("xterm"); + } + + return terminal; +} + +static void +on_action_open_terminal (GtkAction * action, + GeditWindow * window) +{ + GeditFileBrowserPluginData * data; + gchar * terminal; + gchar * wd = NULL; + gchar * local; + gchar * argv[2]; + GFile * file; + + GtkTreeIter iter; + GeditFileBrowserStore * store; + + data = get_plugin_data (window); + + /* Get the current directory */ + if (!gedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter)) + return; + + store = gedit_file_browser_widget_get_browser_store (data->tree_widget); + gtk_tree_model_get (GTK_TREE_MODEL (store), + &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + &wd, + -1); + + if (wd == NULL) + return; + + terminal = get_terminal (); + + file = g_file_new_for_uri (wd); + local = g_file_get_path (file); + g_object_unref (file); + + argv[0] = terminal; + argv[1] = NULL; + + g_spawn_async (local, + argv, + NULL, + G_SPAWN_SEARCH_PATH, + NULL, + NULL, + NULL, + NULL); + + g_free (terminal); + g_free (wd); + g_free (local); +} + +static void +on_selection_changed_cb (GtkTreeSelection *selection, + GeditWindow *window) +{ + GeditFileBrowserPluginData * data; + GtkTreeView * tree_view; + GtkTreeModel * model; + GtkTreeIter iter; + gboolean sensitive; + gchar * uri; + + data = get_plugin_data (window); + + tree_view = GTK_TREE_VIEW (gedit_file_browser_widget_get_browser_view (data->tree_widget)); + model = gtk_tree_view_get_model (tree_view); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return; + + sensitive = gedit_file_browser_widget_get_selected_directory (data->tree_widget, &iter); + + if (sensitive) { + gtk_tree_model_get (model, &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + &uri, -1); + + sensitive = gedit_utils_uri_has_file_scheme (uri); + g_free (uri); + } + + gtk_action_set_sensitive ( + gtk_action_group_get_action (data->single_selection_action_group, + "OpenTerminal"), + sensitive); +} + +#define POPUP_UI "" \ +"" \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +"" + +static GtkActionEntry extra_actions[] = +{ + {"SetActiveRoot", GTK_STOCK_JUMP_TO, N_("_Set root to active document"), + NULL, + N_("Set the root to the active document location"), + G_CALLBACK (on_action_set_active_root)} +}; + +static GtkActionEntry extra_single_selection_actions[] = { + {"OpenTerminal", "utilities-terminal", N_("_Open terminal here"), + NULL, + N_("Open a terminal at the currently opened directory"), + G_CALLBACK (on_action_open_terminal)} +}; + +static void +add_popup_ui (GeditWindow * window) +{ + GeditFileBrowserPluginData * data; + GtkUIManager * manager; + GtkActionGroup * action_group; + GError * error = NULL; + + data = get_plugin_data (window); + manager = gedit_file_browser_widget_get_ui_manager (data->tree_widget); + + action_group = gtk_action_group_new ("FileBrowserPluginExtra"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + extra_actions, + G_N_ELEMENTS (extra_actions), + window); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + data->action_group = action_group; + + action_group = gtk_action_group_new ("FileBrowserPluginSingleSelectionExtra"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + extra_single_selection_actions, + G_N_ELEMENTS (extra_single_selection_actions), + window); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + data->single_selection_action_group = action_group; + + data->merge_id = gtk_ui_manager_add_ui_from_string (manager, + POPUP_UI, + -1, + &error); + + if (data->merge_id == 0) { + g_warning("Unable to merge UI: %s", error->message); + g_error_free(error); + } +} + +static void +remove_popup_ui (GeditWindow * window) +{ + GeditFileBrowserPluginData * data; + GtkUIManager * manager; + + data = get_plugin_data (window); + manager = gedit_file_browser_widget_get_ui_manager (data->tree_widget); + gtk_ui_manager_remove_ui (manager, data->merge_id); + + gtk_ui_manager_remove_action_group (manager, data->action_group); + g_object_unref (data->action_group); + + gtk_ui_manager_remove_action_group (manager, data->single_selection_action_group); + g_object_unref (data->single_selection_action_group); +} + +static void +impl_updateui (GeditPlugin * plugin, GeditWindow * window) +{ + GeditFileBrowserPluginData * data; + GeditDocument * doc; + + data = get_plugin_data (window); + + doc = gedit_window_get_active_document (window); + + gtk_action_set_sensitive (gtk_action_group_get_action (data->action_group, + "SetActiveRoot"), + doc != NULL && + !gedit_document_is_untitled (doc)); +} + +static void +impl_activate (GeditPlugin * plugin, GeditWindow * window) +{ + GeditPanel * panel; + GeditFileBrowserPluginData * data; + GtkWidget * image; + GdkPixbuf * pixbuf; + GeditFileBrowserStore * store; + gchar *data_dir; + + data = g_new0 (GeditFileBrowserPluginData, 1); + + data_dir = gedit_plugin_get_data_dir (plugin); + data->tree_widget = GEDIT_FILE_BROWSER_WIDGET (gedit_file_browser_widget_new (data_dir)); + g_free (data_dir); + + g_signal_connect (data->tree_widget, + "uri-activated", + G_CALLBACK (on_uri_activated_cb), window); + + g_signal_connect (data->tree_widget, + "error", G_CALLBACK (on_error_cb), window); + + g_signal_connect (data->tree_widget, + "notify::filter-pattern", + G_CALLBACK (on_filter_pattern_changed_cb), + window); + + g_signal_connect (data->tree_widget, + "confirm-delete", + G_CALLBACK (on_confirm_delete_cb), + window); + + g_signal_connect (data->tree_widget, + "confirm-no-trash", + G_CALLBACK (on_confirm_no_trash_cb), + window); + + g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW + (gedit_file_browser_widget_get_browser_view + (data->tree_widget))), + "changed", + G_CALLBACK (on_selection_changed_cb), + window); + + panel = gedit_window_get_side_panel (window); + pixbuf = gedit_file_browser_utils_pixbuf_from_theme("system-file-manager", + GTK_ICON_SIZE_MENU); + + if (pixbuf) { + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + } else { + image = gtk_image_new_from_stock(GTK_STOCK_INDEX, GTK_ICON_SIZE_MENU); + } + + gtk_widget_show(image); + gedit_panel_add_item (panel, + GTK_WIDGET (data->tree_widget), + _("File Browser"), + image); + gtk_widget_show (GTK_WIDGET (data->tree_widget)); + g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, data); + + add_popup_ui (window); + + /* Restore filter options */ + restore_filter (data); + + /* Install caja preferences */ + install_caja_prefs (data); + + /* Connect signals to store the last visited location */ + g_signal_connect (gedit_file_browser_widget_get_browser_view (data->tree_widget), + "notify::model", + G_CALLBACK (on_model_set_cb), + window); + + store = gedit_file_browser_widget_get_browser_store (data->tree_widget); + g_signal_connect (store, + "notify::virtual-root", + G_CALLBACK (on_virtual_root_changed_cb), + window); + + g_signal_connect (store, + "notify::filter-mode", + G_CALLBACK (on_filter_mode_changed_cb), + window); + + g_signal_connect (store, + "rename", + G_CALLBACK (on_rename_cb), + window); + + g_signal_connect (window, + "tab-added", + G_CALLBACK (on_tab_added_cb), + data); + + /* Register messages on the bus */ + gedit_file_browser_messages_register (window, data->tree_widget); + + impl_updateui (plugin, window); +} + +static void +impl_deactivate (GeditPlugin * plugin, GeditWindow * window) +{ + GeditFileBrowserPluginData * data; + GeditPanel * panel; + MateConfClient *client; + + data = get_plugin_data (window); + + /* Unregister messages from the bus */ + gedit_file_browser_messages_unregister (window); + + /* Disconnect signals */ + g_signal_handlers_disconnect_by_func (window, + G_CALLBACK (on_tab_added_cb), + data); + + client = mateconf_client_get_default (); + mateconf_client_remove_dir (client, CAJA_CLICK_POLICY_BASE_KEY, NULL); + + if (data->click_policy_handle) + mateconf_client_notify_remove (client, data->click_policy_handle); + + if (data->enable_delete_handle) + mateconf_client_notify_remove (client, data->enable_delete_handle); + + if (data->confirm_trash_handle) + mateconf_client_notify_remove (client, data->confirm_trash_handle); + + g_object_unref (client); + remove_popup_ui (window); + + panel = gedit_window_get_side_panel (window); + gedit_panel_remove_item (panel, GTK_WIDGET (data->tree_widget)); + + g_free (data); + g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL); +} + +static void +filetree_plugin_class_init (GeditFileBrowserPluginClass * klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GeditPluginClass * plugin_class = GEDIT_PLUGIN_CLASS (klass); + + object_class->finalize = filetree_plugin_finalize; + + plugin_class->activate = impl_activate; + plugin_class->deactivate = impl_deactivate; + plugin_class->update_ui = impl_updateui; + + g_type_class_add_private (object_class, + sizeof (GeditFileBrowserPluginPrivate)); +} + +/* Callbacks */ +static void +on_uri_activated_cb (GeditFileBrowserWidget * tree_widget, + gchar const *uri, GeditWindow * window) +{ + gedit_commands_load_uri (window, uri, NULL, 0); +} + +static void +on_error_cb (GeditFileBrowserWidget * tree_widget, + guint code, gchar const *message, GeditWindow * window) +{ + gchar * title; + GtkWidget * dlg; + GeditFileBrowserPluginData * data; + + data = get_plugin_data (window); + + /* Do not show the error when the root has been set automatically */ + if (data->auto_root && (code == GEDIT_FILE_BROWSER_ERROR_SET_ROOT || + code == GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY)) + { + /* Show bookmarks */ + gedit_file_browser_widget_show_bookmarks (data->tree_widget); + return; + } + + switch (code) { + case GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY: + title = + _("An error occurred while creating a new directory"); + break; + case GEDIT_FILE_BROWSER_ERROR_NEW_FILE: + title = _("An error occurred while creating a new file"); + break; + case GEDIT_FILE_BROWSER_ERROR_RENAME: + title = + _ + ("An error occurred while renaming a file or directory"); + break; + case GEDIT_FILE_BROWSER_ERROR_DELETE: + title = + _ + ("An error occurred while deleting a file or directory"); + break; + case GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY: + title = + _ + ("An error occurred while opening a directory in the file manager"); + break; + case GEDIT_FILE_BROWSER_ERROR_SET_ROOT: + title = + _("An error occurred while setting a root directory"); + break; + case GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY: + title = + _("An error occurred while loading a directory"); + break; + default: + title = _("An error occurred"); + break; + } + + dlg = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "%s", title); + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), + "%s", message); + + gtk_dialog_run (GTK_DIALOG (dlg)); + gtk_widget_destroy (dlg); +} + +static void +on_model_set_cb (GeditFileBrowserView * widget, + GParamSpec *arg1, + GeditWindow * window) +{ + GeditFileBrowserPluginData * data = get_plugin_data (window); + GtkTreeModel * model; + MateConfClient * client; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (gedit_file_browser_widget_get_browser_view (data->tree_widget))); + + if (model == NULL) + return; + + client = mateconf_client_get_default (); + mateconf_client_set_bool (client, + FILE_BROWSER_BASE_KEY "/on_load/tree_view", + GEDIT_IS_FILE_BROWSER_STORE (model), + NULL); + g_object_unref (client); +} + +static void +on_filter_mode_changed_cb (GeditFileBrowserStore * model, + GParamSpec * param, + GeditWindow * window) +{ + MateConfClient * client; + GeditFileBrowserStoreFilterMode mode; + + client = mateconf_client_get_default (); + + if (!client) + return; + + mode = gedit_file_browser_store_get_filter_mode (model); + + if ((mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) && + (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY)) { + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/filter_mode", + "hidden_and_binary", + NULL); + } else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) { + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/filter_mode", + "hidden", + NULL); + } else if (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) { + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/filter_mode", + "binary", + NULL); + } else { + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/filter_mode", + "none", + NULL); + } + + g_object_unref (client); + +} + +static void +on_rename_cb (GeditFileBrowserStore * store, + const gchar * olduri, + const gchar * newuri, + GeditWindow * window) +{ + GeditApp * app; + GList * documents; + GList * item; + GeditDocument * doc; + GFile * docfile; + GFile * oldfile; + GFile * newfile; + gchar * uri; + + /* Find all documents and set its uri to newuri where it matches olduri */ + app = gedit_app_get_default (); + documents = gedit_app_get_documents (app); + + oldfile = g_file_new_for_uri (olduri); + newfile = g_file_new_for_uri (newuri); + + for (item = documents; item; item = item->next) { + doc = GEDIT_DOCUMENT (item->data); + uri = gedit_document_get_uri (doc); + + if (!uri) + continue; + + docfile = g_file_new_for_uri (uri); + + if (g_file_equal (docfile, oldfile)) { + gedit_document_set_uri (doc, newuri); + } else { + gchar *relative; + + relative = g_file_get_relative_path (oldfile, docfile); + + if (relative) { + /* relative now contains the part in docfile without + the prefix oldfile */ + + g_object_unref (docfile); + g_free (uri); + + docfile = g_file_get_child (newfile, relative); + uri = g_file_get_uri (docfile); + + gedit_document_set_uri (doc, uri); + } + + g_free (relative); + } + + g_free (uri); + g_object_unref (docfile); + } + + g_object_unref (oldfile); + g_object_unref (newfile); + + g_list_free (documents); +} + +static void +on_filter_pattern_changed_cb (GeditFileBrowserWidget * widget, + GParamSpec * param, + GeditWindow * window) +{ + MateConfClient * client; + gchar * pattern; + + client = mateconf_client_get_default (); + + if (!client) + return; + + g_object_get (G_OBJECT (widget), "filter-pattern", &pattern, NULL); + + if (pattern == NULL) + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/filter_pattern", + "", + NULL); + else + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/filter_pattern", + pattern, + NULL); + + g_free (pattern); +} + +static void +on_virtual_root_changed_cb (GeditFileBrowserStore * store, + GParamSpec * param, + GeditWindow * window) +{ + GeditFileBrowserPluginData * data = get_plugin_data (window); + gchar * root; + gchar * virtual_root; + MateConfClient * client; + + root = gedit_file_browser_store_get_root (store); + + if (!root) + return; + + client = mateconf_client_get_default (); + + if (!client) + return; + + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/on_load/root", + root, + NULL); + + virtual_root = gedit_file_browser_store_get_virtual_root (store); + + if (!virtual_root) { + /* Set virtual to same as root then */ + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/on_load/virtual_root", + root, + NULL); + } else { + mateconf_client_set_string (client, + FILE_BROWSER_BASE_KEY "/on_load/virtual_root", + virtual_root, + NULL); + } + + g_signal_handlers_disconnect_by_func (window, + G_CALLBACK (on_tab_added_cb), + data); + + g_object_unref (client); + g_free (root); + g_free (virtual_root); +} + +static void +on_tab_added_cb (GeditWindow * window, + GeditTab * tab, + GeditFileBrowserPluginData * data) +{ + MateConfClient *client; + gboolean open; + gboolean load_default = TRUE; + + client = mateconf_client_get_default (); + + if (!client) + return; + + open = mateconf_client_get_bool (client, + FILE_BROWSER_BASE_KEY "/open_at_first_doc", + NULL); + + if (open) { + GeditDocument *doc; + gchar *uri; + + doc = gedit_tab_get_document (tab); + + uri = gedit_document_get_uri (doc); + + if (uri != NULL && gedit_utils_uri_has_file_scheme (uri)) { + prepare_auto_root (data); + set_root_from_doc (data, doc); + load_default = FALSE; + } + + g_free (uri); + } + + if (load_default) + restore_default_location (data); + + g_object_unref (client); + + /* Disconnect this signal, it's only called once */ + g_signal_handlers_disconnect_by_func (window, + G_CALLBACK (on_tab_added_cb), + data); +} + +static gchar * +get_filename_from_path (GtkTreeModel *model, GtkTreePath *path) +{ + GtkTreeIter iter; + gchar *uri; + + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + -1); + + return gedit_file_browser_utils_uri_basename (uri); +} + +static gboolean +on_confirm_no_trash_cb (GeditFileBrowserWidget * widget, + GList * files, + GeditWindow * window) +{ + gchar *normal; + gchar *message; + gchar *secondary; + gboolean result; + + message = _("Cannot move file to trash, do you\nwant to delete permanently?"); + + if (files->next == NULL) { + normal = gedit_file_browser_utils_file_basename (G_FILE (files->data)); + secondary = g_strdup_printf (_("The file \"%s\" cannot be moved to the trash."), normal); + g_free (normal); + } else { + secondary = g_strdup (_("The selected files cannot be moved to the trash.")); + } + + result = gedit_file_browser_utils_confirmation_dialog (window, + GTK_MESSAGE_QUESTION, + message, + secondary, + GTK_STOCK_DELETE, + NULL); + g_free (secondary); + + return result; +} + +static gboolean +on_confirm_delete_cb (GeditFileBrowserWidget *widget, + GeditFileBrowserStore *store, + GList *paths, + GeditWindow *window) +{ + gchar *normal; + gchar *message; + gchar *secondary; + gboolean result; + GeditFileBrowserPluginData *data; + + data = get_plugin_data (window); + + if (!data->confirm_trash) + return TRUE; + + if (paths->next == NULL) { + normal = get_filename_from_path (GTK_TREE_MODEL (store), (GtkTreePath *)(paths->data)); + message = g_strdup_printf (_("Are you sure you want to permanently delete \"%s\"?"), normal); + g_free (normal); + } else { + message = g_strdup (_("Are you sure you want to permanently delete the selected files?")); + } + + secondary = _("If you delete an item, it is permanently lost."); + + result = gedit_file_browser_utils_confirmation_dialog (window, + GTK_MESSAGE_QUESTION, + message, + secondary, + GTK_STOCK_DELETE, + NULL); + + g_free (message); + + return result; +} + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-plugin.h b/plugins/filebrowser/gedit-file-browser-plugin.h new file mode 100755 index 00000000..19ca86bf --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-plugin.h @@ -0,0 +1,71 @@ +/* + * gedit-file-browser-plugin.h - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 __GEDIT_FILE_BROWSER_PLUGIN_H__ +#define __GEDIT_FILE_BROWSER_PLUGIN_H__ + +#include +#include +#include + +G_BEGIN_DECLS +/* + * Type checking and casting macros + */ +#define GEDIT_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ()) +#define GEDIT_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPlugin)) +#define GEDIT_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginClass)) +#define GEDIT_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN)) +#define GEDIT_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_FILE_BROWSER_PLUGIN)) +#define GEDIT_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_FILE_BROWSER_PLUGIN, GeditFileBrowserPluginClass)) + +/* Private structure type */ +typedef struct _GeditFileBrowserPluginPrivate GeditFileBrowserPluginPrivate; +typedef struct _GeditFileBrowserPlugin GeditFileBrowserPlugin; +typedef struct _GeditFileBrowserPluginClass GeditFileBrowserPluginClass; + +struct _GeditFileBrowserPlugin +{ + GeditPlugin parent_instance; + + /*< private > */ + GeditFileBrowserPluginPrivate *priv; +}; + + + +struct _GeditFileBrowserPluginClass +{ + GeditPluginClass parent_class; +}; + +/* + * Public methods + */ +GType filetree_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule * module); + +G_END_DECLS +#endif /* __GEDIT_FILE_BROWSER_PLUGIN_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/gedit-file-browser-store.c new file mode 100755 index 00000000..6c4f5b51 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-store.c @@ -0,0 +1,3625 @@ +/* + * gedit-file-browser-store.c - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 +#endif + +#include +#include +#include +#include +#include + +#include "gedit-file-browser-store.h" +#include "gedit-file-browser-marshal.h" +#include "gedit-file-browser-enum-types.h" +#include "gedit-file-browser-error.h" +#include "gedit-file-browser-utils.h" + +#define GEDIT_FILE_BROWSER_STORE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \ + GEDIT_TYPE_FILE_BROWSER_STORE, \ + GeditFileBrowserStorePrivate)) + +#define NODE_IS_DIR(node) (FILE_IS_DIR((node)->flags)) +#define NODE_IS_HIDDEN(node) (FILE_IS_HIDDEN((node)->flags)) +#define NODE_IS_TEXT(node) (FILE_IS_TEXT((node)->flags)) +#define NODE_LOADED(node) (FILE_LOADED((node)->flags)) +#define NODE_IS_FILTERED(node) (FILE_IS_FILTERED((node)->flags)) +#define NODE_IS_DUMMY(node) (FILE_IS_DUMMY((node)->flags)) + +#define FILE_BROWSER_NODE_DIR(node) ((FileBrowserNodeDir *)(node)) + +#define DIRECTORY_LOAD_ITEMS_PER_CALLBACK 100 +#define STANDARD_ATTRIBUTE_TYPES G_FILE_ATTRIBUTE_STANDARD_TYPE "," \ + G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "," \ + G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "," \ + G_FILE_ATTRIBUTE_STANDARD_NAME "," \ + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," \ + G_FILE_ATTRIBUTE_STANDARD_ICON + +typedef struct _FileBrowserNode FileBrowserNode; +typedef struct _FileBrowserNodeDir FileBrowserNodeDir; +typedef struct _AsyncData AsyncData; +typedef struct _AsyncNode AsyncNode; + +typedef gint (*SortFunc) (FileBrowserNode * node1, + FileBrowserNode * node2); + +struct _AsyncData +{ + GeditFileBrowserStore * model; + GCancellable * cancellable; + gboolean trash; + GList * files; + GList * iter; + gboolean removed; +}; + +struct _AsyncNode +{ + FileBrowserNodeDir *dir; + GCancellable *cancellable; + GSList *original_children; +}; + +typedef struct { + GeditFileBrowserStore * model; + gchar * virtual_root; + GMountOperation * operation; + GCancellable * cancellable; +} MountInfo; + +struct _FileBrowserNode +{ + GFile *file; + guint flags; + gchar *name; + + GdkPixbuf *icon; + GdkPixbuf *emblem; + + FileBrowserNode *parent; + gint pos; + gboolean inserted; +}; + +struct _FileBrowserNodeDir +{ + FileBrowserNode node; + GSList *children; + GHashTable *hidden_file_hash; + + GCancellable *cancellable; + GFileMonitor *monitor; + GeditFileBrowserStore *model; +}; + +struct _GeditFileBrowserStorePrivate +{ + FileBrowserNode *root; + FileBrowserNode *virtual_root; + GType column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_NUM]; + + GeditFileBrowserStoreFilterMode filter_mode; + GeditFileBrowserStoreFilterFunc filter_func; + gpointer filter_user_data; + + SortFunc sort_func; + + GSList *async_handles; + MountInfo *mount_info; +}; + +static FileBrowserNode *model_find_node (GeditFileBrowserStore *model, + FileBrowserNode *node, + GFile *uri); +static void model_remove_node (GeditFileBrowserStore * model, + FileBrowserNode * node, + GtkTreePath * path, + gboolean free_nodes); + +static void set_virtual_root_from_node (GeditFileBrowserStore * model, + FileBrowserNode * node); + +static void gedit_file_browser_store_iface_init (GtkTreeModelIface * iface); +static GtkTreeModelFlags gedit_file_browser_store_get_flags (GtkTreeModel * tree_model); +static gint gedit_file_browser_store_get_n_columns (GtkTreeModel * tree_model); +static GType gedit_file_browser_store_get_column_type (GtkTreeModel * tree_model, + gint index); +static gboolean gedit_file_browser_store_get_iter (GtkTreeModel * tree_model, + GtkTreeIter * iter, + GtkTreePath * path); +static GtkTreePath *gedit_file_browser_store_get_path (GtkTreeModel * tree_model, + GtkTreeIter * iter); +static void gedit_file_browser_store_get_value (GtkTreeModel * tree_model, + GtkTreeIter * iter, + gint column, + GValue * value); +static gboolean gedit_file_browser_store_iter_next (GtkTreeModel * tree_model, + GtkTreeIter * iter); +static gboolean gedit_file_browser_store_iter_children (GtkTreeModel * tree_model, + GtkTreeIter * iter, + GtkTreeIter * parent); +static gboolean gedit_file_browser_store_iter_has_child (GtkTreeModel * tree_model, + GtkTreeIter * iter); +static gint gedit_file_browser_store_iter_n_children (GtkTreeModel * tree_model, + GtkTreeIter * iter); +static gboolean gedit_file_browser_store_iter_nth_child (GtkTreeModel * tree_model, + GtkTreeIter * iter, + GtkTreeIter * parent, + gint n); +static gboolean gedit_file_browser_store_iter_parent (GtkTreeModel * tree_model, + GtkTreeIter * iter, + GtkTreeIter * child); +static void gedit_file_browser_store_row_inserted (GtkTreeModel * tree_model, + GtkTreePath * path, + GtkTreeIter * iter); + +static void gedit_file_browser_store_drag_source_init (GtkTreeDragSourceIface * iface); +static gboolean gedit_file_browser_store_row_draggable (GtkTreeDragSource * drag_source, + GtkTreePath * path); +static gboolean gedit_file_browser_store_drag_data_delete (GtkTreeDragSource * drag_source, + GtkTreePath * path); +static gboolean gedit_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, + GtkTreePath * path, + GtkSelectionData * selection_data); + +static void file_browser_node_free (GeditFileBrowserStore * model, + FileBrowserNode * node); +static void model_add_node (GeditFileBrowserStore * model, + FileBrowserNode * child, + FileBrowserNode * parent); +static void model_clear (GeditFileBrowserStore * model, + gboolean free_nodes); +static gint model_sort_default (FileBrowserNode * node1, + FileBrowserNode * node2); +static void model_check_dummy (GeditFileBrowserStore * model, + FileBrowserNode * node); +static void next_files_async (GFileEnumerator * enumerator, + AsyncNode * async); + +GEDIT_PLUGIN_DEFINE_TYPE_WITH_CODE (GeditFileBrowserStore, gedit_file_browser_store, + G_TYPE_OBJECT, + GEDIT_PLUGIN_IMPLEMENT_INTERFACE (gedit_file_browser_store_tree_model, + GTK_TYPE_TREE_MODEL, + gedit_file_browser_store_iface_init) + GEDIT_PLUGIN_IMPLEMENT_INTERFACE (gedit_file_browser_store_drag_source, + GTK_TYPE_TREE_DRAG_SOURCE, + gedit_file_browser_store_drag_source_init)) + +/* Properties */ +enum { + PROP_0, + + PROP_ROOT, + PROP_VIRTUAL_ROOT, + PROP_FILTER_MODE +}; + +/* Signals */ +enum +{ + BEGIN_LOADING, + END_LOADING, + ERROR, + NO_TRASH, + RENAME, + BEGIN_REFRESH, + END_REFRESH, + UNLOAD, + NUM_SIGNALS +}; + +static guint model_signals[NUM_SIGNALS] = { 0 }; + +static void +cancel_mount_operation (GeditFileBrowserStore *obj) +{ + if (obj->priv->mount_info != NULL) + { + obj->priv->mount_info->model = NULL; + g_cancellable_cancel (obj->priv->mount_info->cancellable); + obj->priv->mount_info = NULL; + } +} + +static void +gedit_file_browser_store_finalize (GObject * object) +{ + GeditFileBrowserStore *obj = GEDIT_FILE_BROWSER_STORE (object); + GSList *item; + + /* Free all the nodes */ + file_browser_node_free (obj, obj->priv->root); + + /* Cancel any asynchronous operations */ + for (item = obj->priv->async_handles; item; item = item->next) + { + AsyncData *data = (AsyncData *) (item->data); + g_cancellable_cancel (data->cancellable); + + data->removed = TRUE; + } + + cancel_mount_operation (obj); + + g_slist_free (obj->priv->async_handles); + G_OBJECT_CLASS (gedit_file_browser_store_parent_class)->finalize (object); +} + +static void +set_gvalue_from_node (GValue *value, + FileBrowserNode *node) +{ + gchar * uri; + + if (node == NULL || !node->file) { + g_value_set_string (value, NULL); + } else { + uri = g_file_get_uri (node->file); + g_value_take_string (value, uri); + } +} + +static void +gedit_file_browser_store_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditFileBrowserStore *obj = GEDIT_FILE_BROWSER_STORE (object); + + switch (prop_id) + { + case PROP_ROOT: + set_gvalue_from_node (value, obj->priv->root); + break; + case PROP_VIRTUAL_ROOT: + set_gvalue_from_node (value, obj->priv->virtual_root); + break; + case PROP_FILTER_MODE: + g_value_set_flags (value, obj->priv->filter_mode); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_file_browser_store_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditFileBrowserStore *obj = GEDIT_FILE_BROWSER_STORE (object); + + switch (prop_id) + { + case PROP_FILTER_MODE: + gedit_file_browser_store_set_filter_mode (obj, + g_value_get_flags (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_file_browser_store_class_init (GeditFileBrowserStoreClass * klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_file_browser_store_finalize; + + object_class->get_property = gedit_file_browser_store_get_property; + object_class->set_property = gedit_file_browser_store_set_property; + + g_object_class_install_property (object_class, PROP_ROOT, + g_param_spec_string ("root", + "Root", + "The root uri", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_VIRTUAL_ROOT, + g_param_spec_string ("virtual-root", + "Virtual Root", + "The virtual root uri", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_FILTER_MODE, + g_param_spec_flags ("filter-mode", + "Filter Mode", + "The filter mode", + GEDIT_TYPE_FILE_BROWSER_STORE_FILTER_MODE, + gedit_file_browser_store_filter_mode_get_default (), + G_PARAM_READWRITE)); + + model_signals[BEGIN_LOADING] = + g_signal_new ("begin-loading", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + begin_loading), NULL, NULL, + g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, + GTK_TYPE_TREE_ITER); + model_signals[END_LOADING] = + g_signal_new ("end-loading", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + end_loading), NULL, NULL, + g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, + GTK_TYPE_TREE_ITER); + model_signals[ERROR] = + g_signal_new ("error", G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + error), NULL, NULL, + gedit_file_browser_marshal_VOID__UINT_STRING, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); + model_signals[NO_TRASH] = + g_signal_new ("no-trash", G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + no_trash), g_signal_accumulator_true_handled, NULL, + gedit_file_browser_marshal_BOOL__POINTER, + G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); + model_signals[RENAME] = + g_signal_new ("rename", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + rename), NULL, NULL, + gedit_file_browser_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_STRING); + model_signals[BEGIN_REFRESH] = + g_signal_new ("begin-refresh", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + begin_refresh), NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + model_signals[END_REFRESH] = + g_signal_new ("end-refresh", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + end_refresh), NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + model_signals[UNLOAD] = + g_signal_new ("unload", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserStoreClass, + unload), NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); + + g_type_class_add_private (object_class, + sizeof (GeditFileBrowserStorePrivate)); +} + +static void +gedit_file_browser_store_iface_init (GtkTreeModelIface * iface) +{ + iface->get_flags = gedit_file_browser_store_get_flags; + iface->get_n_columns = gedit_file_browser_store_get_n_columns; + iface->get_column_type = gedit_file_browser_store_get_column_type; + iface->get_iter = gedit_file_browser_store_get_iter; + iface->get_path = gedit_file_browser_store_get_path; + iface->get_value = gedit_file_browser_store_get_value; + iface->iter_next = gedit_file_browser_store_iter_next; + iface->iter_children = gedit_file_browser_store_iter_children; + iface->iter_has_child = gedit_file_browser_store_iter_has_child; + iface->iter_n_children = gedit_file_browser_store_iter_n_children; + iface->iter_nth_child = gedit_file_browser_store_iter_nth_child; + iface->iter_parent = gedit_file_browser_store_iter_parent; + iface->row_inserted = gedit_file_browser_store_row_inserted; +} + +static void +gedit_file_browser_store_drag_source_init (GtkTreeDragSourceIface * iface) +{ + iface->row_draggable = gedit_file_browser_store_row_draggable; + iface->drag_data_delete = gedit_file_browser_store_drag_data_delete; + iface->drag_data_get = gedit_file_browser_store_drag_data_get; +} + +static void +gedit_file_browser_store_init (GeditFileBrowserStore * obj) +{ + obj->priv = GEDIT_FILE_BROWSER_STORE_GET_PRIVATE (obj); + + obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_URI] = + G_TYPE_STRING; + obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_NAME] = + G_TYPE_STRING; + obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS] = + G_TYPE_UINT; + obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_ICON] = + GDK_TYPE_PIXBUF; + obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM] = + GDK_TYPE_PIXBUF; + + // Default filter mode is hiding the hidden files + obj->priv->filter_mode = gedit_file_browser_store_filter_mode_get_default (); + obj->priv->sort_func = model_sort_default; +} + +static gboolean +node_has_parent (FileBrowserNode * node, FileBrowserNode * parent) +{ + if (node->parent == NULL) + return FALSE; + + if (node->parent == parent) + return TRUE; + + return node_has_parent (node->parent, parent); +} + +static gboolean +node_in_tree (GeditFileBrowserStore * model, FileBrowserNode * node) +{ + return node_has_parent (node, model->priv->virtual_root); +} + +static gboolean +model_node_visibility (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + if (node == NULL) + return FALSE; + + if (NODE_IS_DUMMY (node)) + return !NODE_IS_HIDDEN (node); + + if (node == model->priv->virtual_root) + return TRUE; + + if (!node_has_parent (node, model->priv->virtual_root)) + return FALSE; + + return !NODE_IS_FILTERED (node); +} + +static gboolean +model_node_inserted (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + return node == model->priv->virtual_root || (model_node_visibility (model, node) && node->inserted); +} + +/* Interface implementation */ + +static GtkTreeModelFlags +gedit_file_browser_store_get_flags (GtkTreeModel * tree_model) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + (GtkTreeModelFlags) 0); + + return GTK_TREE_MODEL_ITERS_PERSIST; +} + +static gint +gedit_file_browser_store_get_n_columns (GtkTreeModel * tree_model) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), 0); + + return GEDIT_FILE_BROWSER_STORE_COLUMN_NUM; +} + +static GType +gedit_file_browser_store_get_column_type (GtkTreeModel * tree_model, gint idx) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + G_TYPE_INVALID); + g_return_val_if_fail (idx < GEDIT_FILE_BROWSER_STORE_COLUMN_NUM && + idx >= 0, G_TYPE_INVALID); + + return GEDIT_FILE_BROWSER_STORE (tree_model)->priv->column_types[idx]; +} + +static gboolean +gedit_file_browser_store_get_iter (GtkTreeModel * tree_model, + GtkTreeIter * iter, GtkTreePath * path) +{ + gint * indices, depth, i; + FileBrowserNode * node; + GeditFileBrowserStore * model; + gint num; + + g_assert (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_assert (path != NULL); + + model = GEDIT_FILE_BROWSER_STORE (tree_model); + indices = gtk_tree_path_get_indices (path); + depth = gtk_tree_path_get_depth (path); + node = model->priv->virtual_root; + + for (i = 0; i < depth; ++i) { + GSList * item; + + if (node == NULL) + return FALSE; + + num = 0; + + if (!NODE_IS_DIR (node)) + return FALSE; + + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; item = item->next) { + FileBrowserNode * child; + + child = (FileBrowserNode *) (item->data); + + if (model_node_inserted (model, child)) { + if (num == indices[i]) { + node = child; + break; + } + + num++; + } + } + + if (item == NULL) + return FALSE; + + node = (FileBrowserNode *) (item->data); + } + + iter->user_data = node; + iter->user_data2 = NULL; + iter->user_data3 = NULL; + + return node != NULL; +} + +static GtkTreePath * +gedit_file_browser_store_get_path_real (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + GtkTreePath *path; + gint num = 0; + + path = gtk_tree_path_new (); + + while (node != model->priv->virtual_root) { + GSList *item; + + if (node->parent == NULL) { + gtk_tree_path_free (path); + return NULL; + } + + num = 0; + + for (item = FILE_BROWSER_NODE_DIR (node->parent)->children; item; item = item->next) { + FileBrowserNode *check; + + check = (FileBrowserNode *) (item->data); + + if (model_node_visibility (model, check) && (check == node || check->inserted)) { + if (check == node) { + gtk_tree_path_prepend_index (path, + num); + break; + } + + ++num; + } else if (check == node) { + if (NODE_IS_DUMMY (node)) + g_warning ("Dummy not visible???"); + + gtk_tree_path_free (path); + return NULL; + } + } + + node = node->parent; + } + + return path; +} + +static GtkTreePath * +gedit_file_browser_store_get_path (GtkTreeModel * tree_model, + GtkTreeIter * iter) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), NULL); + g_return_val_if_fail (iter != NULL, NULL); + g_return_val_if_fail (iter->user_data != NULL, NULL); + + return gedit_file_browser_store_get_path_real (GEDIT_FILE_BROWSER_STORE (tree_model), + (FileBrowserNode *) (iter->user_data)); +} + +static void +gedit_file_browser_store_get_value (GtkTreeModel * tree_model, + GtkTreeIter * iter, + gint column, + GValue * value) +{ + FileBrowserNode *node; + + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (iter != NULL); + g_return_if_fail (iter->user_data != NULL); + + node = (FileBrowserNode *) (iter->user_data); + + g_value_init (value, GEDIT_FILE_BROWSER_STORE (tree_model)->priv->column_types[column]); + + switch (column) { + case GEDIT_FILE_BROWSER_STORE_COLUMN_URI: + set_gvalue_from_node (value, node); + break; + case GEDIT_FILE_BROWSER_STORE_COLUMN_NAME: + g_value_set_string (value, node->name); + break; + case GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS: + g_value_set_uint (value, node->flags); + break; + case GEDIT_FILE_BROWSER_STORE_COLUMN_ICON: + g_value_set_object (value, node->icon); + break; + case GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM: + g_value_set_object (value, node->emblem); + break; + default: + g_return_if_reached (); + } +} + +static gboolean +gedit_file_browser_store_iter_next (GtkTreeModel * tree_model, + GtkTreeIter * iter) +{ + GeditFileBrowserStore * model; + FileBrowserNode * node; + GSList * item; + GSList * first; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (iter->user_data != NULL, FALSE); + + model = GEDIT_FILE_BROWSER_STORE (tree_model); + node = (FileBrowserNode *) (iter->user_data); + + if (node->parent == NULL) + return FALSE; + + first = g_slist_next (g_slist_find (FILE_BROWSER_NODE_DIR (node->parent)->children, node)); + + for (item = first; item; item = item->next) { + if (model_node_inserted (model, (FileBrowserNode *) (item->data))) { + iter->user_data = item->data; + return TRUE; + } + } + + return FALSE; +} + +static gboolean +gedit_file_browser_store_iter_children (GtkTreeModel * tree_model, + GtkTreeIter * iter, + GtkTreeIter * parent) +{ + FileBrowserNode * node; + GeditFileBrowserStore * model; + GSList * item; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + FALSE); + g_return_val_if_fail (parent == NULL + || parent->user_data != NULL, FALSE); + + model = GEDIT_FILE_BROWSER_STORE (tree_model); + + if (parent == NULL) + node = model->priv->virtual_root; + else + node = (FileBrowserNode *) (parent->user_data); + + if (node == NULL) + return FALSE; + + if (!NODE_IS_DIR (node)) + return FALSE; + + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; item = item->next) { + if (model_node_inserted (model, (FileBrowserNode *) (item->data))) { + iter->user_data = item->data; + return TRUE; + } + } + + return FALSE; +} + +static gboolean +filter_tree_model_iter_has_child_real (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + GSList *item; + + if (!NODE_IS_DIR (node)) + return FALSE; + + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; item = item->next) { + if (model_node_inserted (model, (FileBrowserNode *) (item->data))) + return TRUE; + } + + return FALSE; +} + +static gboolean +gedit_file_browser_store_iter_has_child (GtkTreeModel * tree_model, + GtkTreeIter * iter) +{ + FileBrowserNode *node; + GeditFileBrowserStore *model; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + FALSE); + g_return_val_if_fail (iter == NULL + || iter->user_data != NULL, FALSE); + + model = GEDIT_FILE_BROWSER_STORE (tree_model); + + if (iter == NULL) + node = model->priv->virtual_root; + else + node = (FileBrowserNode *) (iter->user_data); + + return filter_tree_model_iter_has_child_real (model, node); +} + +static gint +gedit_file_browser_store_iter_n_children (GtkTreeModel * tree_model, + GtkTreeIter * iter) +{ + FileBrowserNode *node; + GeditFileBrowserStore *model; + GSList *item; + gint num = 0; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + FALSE); + g_return_val_if_fail (iter == NULL + || iter->user_data != NULL, FALSE); + + model = GEDIT_FILE_BROWSER_STORE (tree_model); + + if (iter == NULL) + node = model->priv->virtual_root; + else + node = (FileBrowserNode *) (iter->user_data); + + if (!NODE_IS_DIR (node)) + return 0; + + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; item = item->next) + if (model_node_inserted (model, (FileBrowserNode *) (item->data))) + ++num; + + return num; +} + +static gboolean +gedit_file_browser_store_iter_nth_child (GtkTreeModel * tree_model, + GtkTreeIter * iter, + GtkTreeIter * parent, gint n) +{ + FileBrowserNode *node; + GeditFileBrowserStore *model; + GSList *item; + gint num = 0; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), + FALSE); + g_return_val_if_fail (parent == NULL + || parent->user_data != NULL, FALSE); + + model = GEDIT_FILE_BROWSER_STORE (tree_model); + + if (parent == NULL) + node = model->priv->virtual_root; + else + node = (FileBrowserNode *) (parent->user_data); + + if (!NODE_IS_DIR (node)) + return FALSE; + + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; + item = item->next) { + if (model_node_inserted (model, (FileBrowserNode *) (item->data))) { + if (num == n) { + iter->user_data = item->data; + return TRUE; + } + + ++num; + } + } + + return FALSE; +} + +static gboolean +gedit_file_browser_store_iter_parent (GtkTreeModel * tree_model, + GtkTreeIter * iter, + GtkTreeIter * child) +{ + FileBrowserNode *node; + GeditFileBrowserStore *model; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model), FALSE); + g_return_val_if_fail (child != NULL, FALSE); + g_return_val_if_fail (child->user_data != NULL, FALSE); + + node = (FileBrowserNode *) (child->user_data); + model = GEDIT_FILE_BROWSER_STORE (tree_model); + + if (!node_in_tree (model, node)) + return FALSE; + + if (node->parent == NULL) + return FALSE; + + iter->user_data = node->parent; + return TRUE; +} + +static void +gedit_file_browser_store_row_inserted (GtkTreeModel * tree_model, + GtkTreePath * path, + GtkTreeIter * iter) +{ + FileBrowserNode * node = (FileBrowserNode *)(iter->user_data); + + node->inserted = TRUE; +} + +static gboolean +gedit_file_browser_store_row_draggable (GtkTreeDragSource * drag_source, + GtkTreePath * path) +{ + GtkTreeIter iter; + GeditFileBrowserStoreFlag flags; + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), + &iter, path)) + { + return FALSE; + } + + gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + return !FILE_IS_DUMMY(flags); +} + +static gboolean +gedit_file_browser_store_drag_data_delete (GtkTreeDragSource * drag_source, + GtkTreePath * path) +{ + return FALSE; +} + +static gboolean +gedit_file_browser_store_drag_data_get (GtkTreeDragSource * drag_source, + GtkTreePath * path, + GtkSelectionData * selection_data) +{ + GtkTreeIter iter; + gchar *uri; + gchar *uris[2] = {0, }; + gboolean ret; + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), + &iter, path)) + { + return FALSE; + } + + gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + -1); + + g_assert (uri); + + uris[0] = uri; + ret = gtk_selection_data_set_uris (selection_data, uris); + + g_free (uri); + + return ret; +} + +#define FILTER_HIDDEN(mode) (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN) +#define FILTER_BINARY(mode) (mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY) + +/* Private */ +static void +model_begin_loading (GeditFileBrowserStore * model, FileBrowserNode * node) +{ + GtkTreeIter iter; + + iter.user_data = node; + g_signal_emit (model, model_signals[BEGIN_LOADING], 0, &iter); +} + +static void +model_end_loading (GeditFileBrowserStore * model, FileBrowserNode * node) +{ + GtkTreeIter iter; + + iter.user_data = node; + g_signal_emit (model, model_signals[END_LOADING], 0, &iter); +} + +static void +model_node_update_visibility (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + GtkTreeIter iter; + + node->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + + if (FILTER_HIDDEN (model->priv->filter_mode) && + NODE_IS_HIDDEN (node)) + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + else if (FILTER_BINARY (model->priv->filter_mode) && + (!NODE_IS_TEXT (node) && !NODE_IS_DIR (node))) + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + else if (model->priv->filter_func) { + iter.user_data = node; + + if (!model->priv-> + filter_func (model, &iter, + model->priv->filter_user_data)) + node->flags |= + GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED; + } +} + +static gint +collate_nodes (FileBrowserNode * node1, FileBrowserNode * node2) +{ + if (node1->name == NULL) + return -1; + else if (node2->name == NULL) + return 1; + else { + gchar *k1, *k2; + gint result; + + k1 = g_utf8_collate_key_for_filename (node1->name, -1); + k2 = g_utf8_collate_key_for_filename (node2->name, -1); + + result = strcmp (k1, k2); + + g_free (k1); + g_free (k2); + + return result; + } +} + +static gint +model_sort_default (FileBrowserNode * node1, FileBrowserNode * node2) +{ + gint f1; + gint f2; + + f1 = NODE_IS_DUMMY (node1); + f2 = NODE_IS_DUMMY (node2); + + if (f1 && f2) + { + return 0; + } + else if (f1 || f2) + { + return f1 ? -1 : 1; + } + + f1 = NODE_IS_DIR (node1); + f2 = NODE_IS_DIR (node2); + + if (f1 != f2) + { + return f1 ? -1 : 1; + } + + f1 = NODE_IS_HIDDEN (node1); + f2 = NODE_IS_HIDDEN (node2); + + if (f1 != f2) + { + return f2 ? -1 : 1; + } + + return collate_nodes (node1, node2); +} + +static void +model_resort_node (GeditFileBrowserStore * model, FileBrowserNode * node) +{ + FileBrowserNodeDir *dir; + GSList *item; + FileBrowserNode *child; + gint pos = 0; + GtkTreeIter iter; + GtkTreePath *path; + gint *neworder; + + dir = FILE_BROWSER_NODE_DIR (node->parent); + + if (!model_node_visibility (model, node->parent)) { + /* Just sort the children of the parent */ + dir->children = g_slist_sort (dir->children, + (GCompareFunc) (model->priv-> + sort_func)); + } else { + /* Store current positions */ + for (item = dir->children; item; item = item->next) { + child = (FileBrowserNode *) (item->data); + + if (model_node_visibility (model, child)) + child->pos = pos++; + } + + dir->children = g_slist_sort (dir->children, + (GCompareFunc) (model->priv-> + sort_func)); + neworder = g_new (gint, pos); + pos = 0; + + /* Store the new positions */ + for (item = dir->children; item; item = item->next) { + child = (FileBrowserNode *) (item->data); + + if (model_node_visibility (model, child)) + neworder[pos++] = child->pos; + } + + iter.user_data = node->parent; + path = + gedit_file_browser_store_get_path_real (model, + node->parent); + + gtk_tree_model_rows_reordered (GTK_TREE_MODEL (model), + path, &iter, neworder); + + g_free (neworder); + gtk_tree_path_free (path); + } +} + +static void +row_changed (GeditFileBrowserStore * model, + GtkTreePath ** path, + GtkTreeIter * iter) +{ + GtkTreeRowReference *ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (model), *path); + + /* Insert a copy of the actual path here because the row-inserted + signal may alter the path */ + gtk_tree_model_row_changed (GTK_TREE_MODEL(model), *path, iter); + gtk_tree_path_free (*path); + + *path = gtk_tree_row_reference_get_path (ref); + gtk_tree_row_reference_free (ref); +} + +static void +row_inserted (GeditFileBrowserStore * model, + GtkTreePath ** path, + GtkTreeIter * iter) +{ + /* This function creates a row reference for the path because it's + uncertain what might change the actual model/view when we insert + a node, maybe another directory load is triggered for example. + Because functions that use this function rely on the notion that + the path remains pointed towards the inserted node, we use the + reference to keep track. */ + GtkTreeRowReference *ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (model), *path); + GtkTreePath * copy = gtk_tree_path_copy (*path); + + gtk_tree_model_row_inserted (GTK_TREE_MODEL(model), copy, iter); + gtk_tree_path_free (copy); + + if (ref) + { + gtk_tree_path_free (*path); + + /* To restore the path, we get the path from the reference. But, since + we inserted a row, the path will be one index further than the + actual path of our node. We therefore call gtk_tree_path_prev */ + *path = gtk_tree_row_reference_get_path (ref); + gtk_tree_path_prev (*path); + } + + gtk_tree_row_reference_free (ref); +} + +static void +row_deleted (GeditFileBrowserStore * model, + const GtkTreePath * path) +{ + GtkTreePath *copy = gtk_tree_path_copy (path); + + /* Delete a copy of the actual path here because the row-deleted + signal may alter the path */ + gtk_tree_model_row_deleted (GTK_TREE_MODEL(model), copy); + gtk_tree_path_free (copy); +} + +static void +model_refilter_node (GeditFileBrowserStore * model, + FileBrowserNode * node, + GtkTreePath ** path) +{ + gboolean old_visible; + gboolean new_visible; + FileBrowserNodeDir *dir; + GSList *item; + GtkTreeIter iter; + GtkTreePath *tmppath = NULL; + gboolean in_tree; + + if (node == NULL) + return; + + old_visible = model_node_visibility (model, node); + model_node_update_visibility (model, node); + + in_tree = node_in_tree (model, node); + + if (path == NULL) + { + if (in_tree) + tmppath = gedit_file_browser_store_get_path_real (model, + node); + else + tmppath = gtk_tree_path_new_first (); + + path = &tmppath; + } + + if (NODE_IS_DIR (node)) { + if (in_tree) + gtk_tree_path_down (*path); + + dir = FILE_BROWSER_NODE_DIR (node); + + for (item = dir->children; item; item = item->next) { + model_refilter_node (model, + (FileBrowserNode *) (item->data), + path); + } + + if (in_tree) + gtk_tree_path_up (*path); + } + + if (in_tree) { + new_visible = model_node_visibility (model, node); + + if (old_visible != new_visible) { + if (old_visible) { + node->inserted = FALSE; + row_deleted (model, *path); + } else { + iter.user_data = node; + row_inserted (model, path, &iter); + gtk_tree_path_next (*path); + } + } else if (old_visible) { + gtk_tree_path_next (*path); + } + } + + model_check_dummy (model, node); + + if (tmppath) + gtk_tree_path_free (tmppath); +} + +static void +model_refilter (GeditFileBrowserStore * model) +{ + model_refilter_node (model, model->priv->root, NULL); +} + +static void +file_browser_node_set_name (FileBrowserNode * node) +{ + g_free (node->name); + + if (node->file) { + node->name = gedit_file_browser_utils_file_basename (node->file); + } else { + node->name = NULL; + } +} + +static void +file_browser_node_init (FileBrowserNode * node, GFile * file, + FileBrowserNode * parent) +{ + if (file != NULL) { + node->file = g_object_ref (file); + file_browser_node_set_name (node); + } + + node->parent = parent; +} + +static FileBrowserNode * +file_browser_node_new (GFile * file, FileBrowserNode * parent) +{ + FileBrowserNode *node = g_slice_new0 (FileBrowserNode); + + file_browser_node_init (node, file, parent); + return node; +} + +static FileBrowserNode * +file_browser_node_dir_new (GeditFileBrowserStore * model, + GFile * file, FileBrowserNode * parent) +{ + FileBrowserNode *node = + (FileBrowserNode *) g_slice_new0 (FileBrowserNodeDir); + + file_browser_node_init (node, file, parent); + + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY; + + FILE_BROWSER_NODE_DIR (node)->model = model; + + return node; +} + +static void +file_browser_node_free_children (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + GSList *item; + + if (node == NULL) + return; + + if (NODE_IS_DIR (node)) { + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; + item = item->next) + file_browser_node_free (model, + (FileBrowserNode *) (item-> + data)); + + g_slist_free (FILE_BROWSER_NODE_DIR (node)->children); + FILE_BROWSER_NODE_DIR (node)->children = NULL; + + /* This node is no longer loaded */ + node->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; + } +} + +static void +file_browser_node_free (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + gchar *uri; + + if (node == NULL) + return; + + if (NODE_IS_DIR (node)) + { + FileBrowserNodeDir *dir; + + dir = FILE_BROWSER_NODE_DIR (node); + + if (dir->cancellable) { + g_cancellable_cancel (dir->cancellable); + g_object_unref (dir->cancellable); + + model_end_loading (model, node); + } + + file_browser_node_free_children (model, node); + + if (dir->monitor) { + g_file_monitor_cancel (dir->monitor); + g_object_unref (dir->monitor); + } + + if (dir->hidden_file_hash) + g_hash_table_destroy (dir->hidden_file_hash); + } + + if (node->file) + { + uri = g_file_get_uri (node->file); + g_signal_emit (model, model_signals[UNLOAD], 0, uri); + + g_free (uri); + g_object_unref (node->file); + } + + if (node->icon) + g_object_unref (node->icon); + + if (node->emblem) + g_object_unref (node->emblem); + + g_free (node->name); + + if (NODE_IS_DIR (node)) + g_slice_free (FileBrowserNodeDir, (FileBrowserNodeDir *)node); + else + g_slice_free (FileBrowserNode, (FileBrowserNode *)node); +} + +/** + * model_remove_node_children: + * @model: the #GeditFileBrowserStore + * @node: the FileBrowserNode to remove + * @path: the path of the node, or NULL to let the path be calculated + * @free_nodes: whether to also remove the nodes from memory + * + * Removes all the children of node from the model. This function is used + * to remove the child nodes from the _model_. Don't use it to just free + * a node. + **/ +static void +model_remove_node_children (GeditFileBrowserStore * model, + FileBrowserNode * node, + GtkTreePath * path, + gboolean free_nodes) +{ + FileBrowserNodeDir *dir; + GtkTreePath *path_child; + GSList *list; + GSList *item; + + if (node == NULL || !NODE_IS_DIR (node)) + return; + + dir = FILE_BROWSER_NODE_DIR (node); + + if (dir->children == NULL) + return; + + if (!model_node_visibility (model, node)) { + // Node is invisible and therefore the children can just + // be freed + if (free_nodes) + file_browser_node_free_children (model, node); + + return; + } + + if (path == NULL) + path_child = + gedit_file_browser_store_get_path_real (model, node); + else + path_child = gtk_tree_path_copy (path); + + gtk_tree_path_down (path_child); + + list = g_slist_copy (dir->children); + + for (item = list; item; item = item->next) { + model_remove_node (model, (FileBrowserNode *) (item->data), + path_child, free_nodes); + } + + g_slist_free (list); + gtk_tree_path_free (path_child); +} + +/** + * model_remove_node: + * @model: the #GeditFileBrowserStore + * @node: the FileBrowserNode to remove + * @path: the path to use to remove this node, or NULL to use the path + * calculated from the node itself + * @free_nodes: whether to also remove the nodes from memory + * + * Removes this node and all its children from the model. This function is used + * to remove the node from the _model_. Don't use it to just free + * a node. + **/ +static void +model_remove_node (GeditFileBrowserStore * model, + FileBrowserNode * node, + GtkTreePath * path, + gboolean free_nodes) +{ + gboolean free_path = FALSE; + FileBrowserNode *parent; + + if (path == NULL) { + path = + gedit_file_browser_store_get_path_real (model, node); + free_path = TRUE; + } + + model_remove_node_children (model, node, path, free_nodes); + + /* Only delete if the node is visible in the tree (but only when it's + not the virtual root) */ + if (model_node_visibility (model, node) && node != model->priv->virtual_root) + { + node->inserted = FALSE; + row_deleted (model, path); + } + + if (free_path) + gtk_tree_path_free (path); + + parent = node->parent; + + if (free_nodes) { + /* Remove the node from the parents children list */ + if (parent) + FILE_BROWSER_NODE_DIR (node->parent)->children = + g_slist_remove (FILE_BROWSER_NODE_DIR + (node->parent)->children, + node); + } + + /* If this is the virtual root, than set the parent as the virtual root */ + if (node == model->priv->virtual_root) + set_virtual_root_from_node (model, parent); + else if (parent && model_node_visibility (model, parent) && !(free_nodes && NODE_IS_DUMMY(node))) + model_check_dummy (model, parent); + + /* Now free the node if necessary */ + if (free_nodes) + file_browser_node_free (model, node); +} + +/** + * model_clear: + * @model: the #GeditFileBrowserStore + * @free_nodes: whether to also remove the nodes from memory + * + * Removes all nodes from the model. This function is used + * to remove all the nodes from the _model_. Don't use it to just free the + * nodes in the model. + **/ +static void +model_clear (GeditFileBrowserStore * model, gboolean free_nodes) +{ + GtkTreePath *path; + FileBrowserNodeDir *dir; + FileBrowserNode *dummy; + + path = gtk_tree_path_new (); + model_remove_node_children (model, model->priv->virtual_root, path, + free_nodes); + gtk_tree_path_free (path); + + /* Remove the dummy if there is one */ + if (model->priv->virtual_root) { + dir = FILE_BROWSER_NODE_DIR (model->priv->virtual_root); + + if (dir->children != NULL) { + dummy = (FileBrowserNode *) (dir->children->data); + + if (NODE_IS_DUMMY (dummy) + && model_node_visibility (model, dummy)) { + path = gtk_tree_path_new_first (); + + dummy->inserted = FALSE; + row_deleted (model, path); + gtk_tree_path_free (path); + } + } + } +} + +static void +file_browser_node_unload (GeditFileBrowserStore * model, + FileBrowserNode * node, gboolean remove_children) +{ + FileBrowserNodeDir *dir; + + if (node == NULL) + return; + + if (!NODE_IS_DIR (node) || !NODE_LOADED (node)) + return; + + dir = FILE_BROWSER_NODE_DIR (node); + + if (remove_children) + model_remove_node_children (model, node, NULL, TRUE); + + if (dir->cancellable) { + g_cancellable_cancel (dir->cancellable); + g_object_unref (dir->cancellable); + + model_end_loading (model, node); + dir->cancellable = NULL; + } + + if (dir->monitor) { + g_file_monitor_cancel (dir->monitor); + g_object_unref (dir->monitor); + + dir->monitor = NULL; + } + + node->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; +} + +static void +model_recomposite_icon_real (GeditFileBrowserStore * tree_model, + FileBrowserNode * node, + GFileInfo * info) +{ + GdkPixbuf *icon; + + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (node != NULL); + + if (node->file == NULL) + return; + + if (info) { + GIcon *gicon = g_file_info_get_icon (info); + if (gicon != NULL) + icon = gedit_file_browser_utils_pixbuf_from_icon (gicon, GTK_ICON_SIZE_MENU); + else + icon = NULL; + } else { + icon = gedit_file_browser_utils_pixbuf_from_file (node->file, GTK_ICON_SIZE_MENU); + } + + if (node->icon) + g_object_unref (node->icon); + + if (node->emblem) { + gint icon_size; + + gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, NULL, &icon_size); + + if (icon == NULL) { + node->icon = + gdk_pixbuf_new (gdk_pixbuf_get_colorspace (node->emblem), + gdk_pixbuf_get_has_alpha (node->emblem), + gdk_pixbuf_get_bits_per_sample (node->emblem), + icon_size, + icon_size); + } else { + node->icon = gdk_pixbuf_copy (icon); + g_object_unref (icon); + } + + gdk_pixbuf_composite (node->emblem, node->icon, + icon_size - 10, icon_size - 10, 10, + 10, icon_size - 10, icon_size - 10, + 1, 1, GDK_INTERP_NEAREST, 255); + } else { + node->icon = icon; + } +} + +static void +model_recomposite_icon (GeditFileBrowserStore * tree_model, + GtkTreeIter * iter) +{ + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (iter != NULL); + g_return_if_fail (iter->user_data != NULL); + + model_recomposite_icon_real (tree_model, + (FileBrowserNode *) (iter->user_data), + NULL); +} + +static FileBrowserNode * +model_create_dummy_node (GeditFileBrowserStore * model, + FileBrowserNode * parent) +{ + FileBrowserNode *dummy; + + dummy = file_browser_node_new (NULL, parent); + dummy->name = g_strdup (_("(Empty)")); + + dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY; + dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + + return dummy; +} + +static FileBrowserNode * +model_add_dummy_node (GeditFileBrowserStore * model, + FileBrowserNode * parent) +{ + FileBrowserNode *dummy; + + dummy = model_create_dummy_node (model, parent); + + if (model_node_visibility (model, parent)) + dummy->flags &= ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + + model_add_node (model, dummy, parent); + + return dummy; +} + +static void +model_check_dummy (GeditFileBrowserStore * model, FileBrowserNode * node) +{ + // Hide the dummy child if needed + if (NODE_IS_DIR (node)) { + FileBrowserNode *dummy; + GtkTreeIter iter; + GtkTreePath *path; + guint flags; + FileBrowserNodeDir *dir; + + dir = FILE_BROWSER_NODE_DIR (node); + + if (dir->children == NULL) { + model_add_dummy_node (model, node); + return; + } + + dummy = (FileBrowserNode *) (dir->children->data); + + if (!NODE_IS_DUMMY (dummy)) { + dummy = model_create_dummy_node (model, node); + dir->children = g_slist_prepend (dir->children, dummy); + } + + if (!model_node_visibility (model, node)) { + dummy->flags |= + GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + return; + } + + /* Temporarily set the node to invisible to check + * for real children */ + flags = dummy->flags; + dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + + if (!filter_tree_model_iter_has_child_real (model, node)) { + dummy->flags &= + ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + + if (FILE_IS_HIDDEN (flags)) { + // Was hidden, needs to be inserted + iter.user_data = dummy; + path = + gedit_file_browser_store_get_path_real + (model, dummy); + + row_inserted (model, &path, &iter); + gtk_tree_path_free (path); + } + } else { + if (!FILE_IS_HIDDEN (flags)) { + // Was shown, needs to be removed + + // To get the path we need to set it to visible temporarily + dummy->flags &= + ~GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + path = + gedit_file_browser_store_get_path_real + (model, dummy); + dummy->flags |= + GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + + dummy->inserted = FALSE; + row_deleted (model, path); + gtk_tree_path_free (path); + } + } + } +} + +static void +insert_node_sorted (GeditFileBrowserStore * model, + FileBrowserNode * child, + FileBrowserNode * parent) +{ + FileBrowserNodeDir *dir; + + dir = FILE_BROWSER_NODE_DIR (parent); + + if (model->priv->sort_func == NULL) { + dir->children = g_slist_append (dir->children, child); + } else { + dir->children = + g_slist_insert_sorted (dir->children, child, + (GCompareFunc) (model->priv-> + sort_func)); + } +} + +static void +model_add_node (GeditFileBrowserStore * model, FileBrowserNode * child, + FileBrowserNode * parent) +{ + /* Add child to parents children */ + insert_node_sorted (model, child, parent); + + if (model_node_visibility (model, parent) && + model_node_visibility (model, child)) { + GtkTreeIter iter; + GtkTreePath *path; + + iter.user_data = child; + path = gedit_file_browser_store_get_path_real (model, child); + + /* Emit row inserted */ + row_inserted (model, &path, &iter); + gtk_tree_path_free (path); + } + + model_check_dummy (model, parent); + model_check_dummy (model, child); +} + +static void +model_add_nodes_batch (GeditFileBrowserStore * model, + GSList * children, + FileBrowserNode * parent) +{ + GSList *sorted_children; + GSList *child; + GSList *prev; + GSList *l; + FileBrowserNodeDir *dir; + + dir = FILE_BROWSER_NODE_DIR (parent); + + sorted_children = g_slist_sort (children, (GCompareFunc) model->priv->sort_func); + + child = sorted_children; + l = dir->children; + prev = NULL; + + model_check_dummy (model, parent); + + while (child) { + FileBrowserNode *node = child->data; + GtkTreeIter iter; + GtkTreePath *path; + + /* reached the end of the first list, just append the second */ + if (l == NULL) { + + dir->children = g_slist_concat (dir->children, child); + + for (l = child; l; l = l->next) { + if (model_node_visibility (model, parent) && + model_node_visibility (model, l->data)) { + iter.user_data = l->data; + path = gedit_file_browser_store_get_path_real (model, l->data); + + // Emit row inserted + row_inserted (model, &path, &iter); + gtk_tree_path_free (path); + } + + model_check_dummy (model, l->data); + } + + break; + } + + if (model->priv->sort_func (l->data, node) > 0) { + GSList *next_child; + + if (prev == NULL) { + /* prepend to the list */ + dir->children = g_slist_prepend (dir->children, child); + } else { + prev->next = child; + } + + next_child = child->next; + prev = child; + child->next = l; + child = next_child; + + if (model_node_visibility (model, parent) && + model_node_visibility (model, node)) { + iter.user_data = node; + path = gedit_file_browser_store_get_path_real (model, node); + + // Emit row inserted + row_inserted (model, &path, &iter); + gtk_tree_path_free (path); + } + + model_check_dummy (model, node); + + /* try again at the same l position with the + * next child */ + } else { + + /* Move to the next item in the list */ + prev = l; + l = l->next; + } + } +} + +static gchar const * +backup_content_type (GFileInfo * info) +{ + gchar const * content; + + if (!g_file_info_get_is_backup (info)) + return NULL; + + content = g_file_info_get_content_type (info); + + if (!content || g_content_type_equals (content, "application/x-trash")) + return "text/plain"; + + return content; +} + +static void +file_browser_node_set_from_info (GeditFileBrowserStore * model, + FileBrowserNode * node, + GFileInfo * info, + gboolean isadded) +{ + FileBrowserNodeDir * dir; + gchar const * content; + gchar const * name; + gboolean free_info = FALSE; + GtkTreePath * path; + gchar * uri; + GError * error = NULL; + + if (info == NULL) { + info = g_file_query_info (node->file, + STANDARD_ATTRIBUTE_TYPES, + G_FILE_QUERY_INFO_NONE, + NULL, + &error); + + if (!info) { + if (!(error->domain == G_IO_ERROR && error->code == G_IO_ERROR_NOT_FOUND)) { + uri = g_file_get_uri (node->file); + g_warning ("Could not get info for %s: %s", uri, error->message); + g_free (uri); + } + g_error_free (error); + + return; + } + + free_info = TRUE; + } + + dir = FILE_BROWSER_NODE_DIR (node->parent); + name = g_file_info_get_name (info); + + if (g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info)) + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + else if (dir != NULL && dir->hidden_file_hash != NULL && + g_hash_table_lookup (dir->hidden_file_hash, name) != NULL) + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + + if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY; + else { + if (!(content = backup_content_type (info))) + content = g_file_info_get_content_type (info); + + if (!content || + g_content_type_is_unknown (content) || + g_content_type_is_a (content, "text/plain")) + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT; + } + + model_recomposite_icon_real (model, node, info); + + if (free_info) + g_object_unref (info); + + if (isadded) { + path = gedit_file_browser_store_get_path_real (model, node); + model_refilter_node (model, node, &path); + gtk_tree_path_free (path); + + model_check_dummy (model, node->parent); + } else { + model_node_update_visibility (model, node); + } +} + +static FileBrowserNode * +node_list_contains_file (GSList *children, GFile * file) +{ + GSList *item; + + for (item = children; item; item = item->next) { + FileBrowserNode *node; + + node = (FileBrowserNode *) (item->data); + + if (node->file != NULL + && g_file_equal (node->file, file)) + return node; + } + + return NULL; +} + +static FileBrowserNode * +model_add_node_from_file (GeditFileBrowserStore * model, + FileBrowserNode * parent, + GFile * file, + GFileInfo * info) +{ + FileBrowserNode *node; + gboolean free_info = FALSE; + GError * error = NULL; + + if ((node = node_list_contains_file (FILE_BROWSER_NODE_DIR (parent)->children, file)) == NULL) { + if (info == NULL) { + info = g_file_query_info (file, + STANDARD_ATTRIBUTE_TYPES, + G_FILE_QUERY_INFO_NONE, + NULL, + &error); + free_info = TRUE; + } + + if (!info) { + g_warning ("Error querying file info: %s", error->message); + g_error_free (error); + + /* FIXME: What to do now then... */ + node = file_browser_node_new (file, parent); + } else if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { + node = file_browser_node_dir_new (model, file, parent); + } else { + node = file_browser_node_new (file, parent); + } + + file_browser_node_set_from_info (model, node, info, FALSE); + model_add_node (model, node, parent); + + if (info && free_info) + g_object_unref (info); + } + + return node; +} + +/* We pass in a copy of the list of parent->children so that we do + * not have to check if a file already exists among the ones we just + * added */ +static void +model_add_nodes_from_files (GeditFileBrowserStore * model, + FileBrowserNode * parent, + GSList * original_children, + GList * files) +{ + GList *item; + GSList *nodes = NULL; + + for (item = files; item; item = item->next) { + GFileInfo *info = G_FILE_INFO (item->data); + GFileType type; + gchar const * name; + GFile * file; + FileBrowserNode *node; + + type = g_file_info_get_file_type (info); + + /* Skip all non regular, non directory files */ + if (type != G_FILE_TYPE_REGULAR && + type != G_FILE_TYPE_DIRECTORY && + type != G_FILE_TYPE_SYMBOLIC_LINK) { + g_object_unref (info); + continue; + } + + name = g_file_info_get_name (info); + + /* Skip '.' and '..' directories */ + if (type == G_FILE_TYPE_DIRECTORY && + (strcmp (name, ".") == 0 || + strcmp (name, "..") == 0)) { + continue; + } + + file = g_file_get_child (parent->file, name); + + if ((node = node_list_contains_file (original_children, file)) == NULL) { + + if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { + node = file_browser_node_dir_new (model, file, parent); + } else { + node = file_browser_node_new (file, parent); + } + + file_browser_node_set_from_info (model, node, info, FALSE); + + nodes = g_slist_prepend (nodes, node); + } + + g_object_unref (file); + g_object_unref (info); + } + + if (nodes) + model_add_nodes_batch (model, nodes, parent); +} + +static FileBrowserNode * +model_add_node_from_dir (GeditFileBrowserStore * model, + FileBrowserNode * parent, + GFile * file) +{ + FileBrowserNode *node; + + /* Check if it already exists */ + if ((node = node_list_contains_file (FILE_BROWSER_NODE_DIR (parent)->children, file)) == NULL) { + node = file_browser_node_dir_new (model, file, parent); + file_browser_node_set_from_info (model, node, NULL, FALSE); + + if (node->name == NULL) { + file_browser_node_set_name (node); + } + + if (node->icon == NULL) { + node->icon = gedit_file_browser_utils_pixbuf_from_theme ("folder", GTK_ICON_SIZE_MENU); + } + + model_add_node (model, node, parent); + } + + return node; +} + +/* Read is sync, but we only do it for local files */ +static void +parse_dot_hidden_file (FileBrowserNode *directory) +{ + gsize file_size; + char *file_contents; + GFile *child; + GFileInfo *info; + GFileType type; + int i; + FileBrowserNodeDir * dir = FILE_BROWSER_NODE_DIR (directory); + + /* FIXME: We only support .hidden on file: uri's for the moment. + * Need to figure out if we should do this async or sync to extend + * it to all types of uris. + */ + if (directory->file == NULL || !g_file_is_native (directory->file)) { + return; + } + + child = g_file_get_child (directory->file, ".hidden"); + info = g_file_query_info (child, G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL); + + type = info ? g_file_info_get_file_type (info) : G_FILE_TYPE_UNKNOWN; + + if (info) + g_object_unref (info); + + if (type != G_FILE_TYPE_REGULAR) { + g_object_unref (child); + + return; + } + + if (!g_file_load_contents (child, NULL, &file_contents, &file_size, NULL, NULL)) { + g_object_unref (child); + return; + } + + g_object_unref (child); + + if (dir->hidden_file_hash == NULL) { + dir->hidden_file_hash = + g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + } + + /* Now parse the data */ + i = 0; + while (i < file_size) { + int start; + + start = i; + while (i < file_size && file_contents[i] != '\n') { + i++; + } + + if (i > start) { + char *hidden_filename; + + hidden_filename = g_strndup (file_contents + start, i - start); + g_hash_table_insert (dir->hidden_file_hash, + hidden_filename, hidden_filename); + } + + i++; + + } + + g_free (file_contents); +} + +static void +on_directory_monitor_event (GFileMonitor * monitor, + GFile * file, + GFile * other_file, + GFileMonitorEvent event_type, + FileBrowserNode * parent) +{ + FileBrowserNode *node; + FileBrowserNodeDir *dir = FILE_BROWSER_NODE_DIR (parent); + + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + node = node_list_contains_file (dir->children, file); + + if (node != NULL) { + model_remove_node (dir->model, node, NULL, TRUE); + } + break; + case G_FILE_MONITOR_EVENT_CREATED: + if (g_file_query_exists (file, NULL)) { + model_add_node_from_file (dir->model, parent, file, NULL); + } + + break; + default: + break; + } +} + +static void +async_node_free (AsyncNode *async) +{ + g_object_unref (async->cancellable); + g_slist_free (async->original_children); + g_free (async); +} + +static void +model_iterate_next_files_cb (GFileEnumerator * enumerator, + GAsyncResult * result, + AsyncNode * async) +{ + GList * files; + GError * error = NULL; + FileBrowserNodeDir * dir = async->dir; + FileBrowserNode * parent = (FileBrowserNode *)dir; + + files = g_file_enumerator_next_files_finish (enumerator, result, &error); + + if (files == NULL) { + g_file_enumerator_close (enumerator, NULL, NULL); + async_node_free (async); + + if (!error) + { + /* We're done loading */ + g_object_unref (dir->cancellable); + dir->cancellable = NULL; + +/* + * FIXME: This is temporarly, it is a bug in gio: + * http://bugzilla.mate.org/show_bug.cgi?id=565924 + */ +#ifndef G_OS_WIN32 + if (g_file_is_native (parent->file) && dir->monitor == NULL) { + dir->monitor = g_file_monitor_directory (parent->file, + G_FILE_MONITOR_NONE, + NULL, + NULL); + if (dir->monitor != NULL) + { + g_signal_connect (dir->monitor, + "changed", + G_CALLBACK (on_directory_monitor_event), + parent); + } + } +#endif + + model_check_dummy (dir->model, parent); + model_end_loading (dir->model, parent); + } else { + /* Simply return if we were cancelled */ + if (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_CANCELLED) + return; + + /* Otherwise handle the error appropriately */ + g_signal_emit (dir->model, + model_signals[ERROR], + 0, + GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY, + error->message); + + file_browser_node_unload (dir->model, (FileBrowserNode *)parent, TRUE); + g_error_free (error); + } + } else if (g_cancellable_is_cancelled (async->cancellable)) { + /* Check cancel state manually */ + g_file_enumerator_close (enumerator, NULL, NULL); + async_node_free (async); + } else { + model_add_nodes_from_files (dir->model, parent, async->original_children, files); + + g_list_free (files); + next_files_async (enumerator, async); + } +} + +static void +next_files_async (GFileEnumerator * enumerator, + AsyncNode * async) +{ + g_file_enumerator_next_files_async (enumerator, + DIRECTORY_LOAD_ITEMS_PER_CALLBACK, + G_PRIORITY_DEFAULT, + async->cancellable, + (GAsyncReadyCallback)model_iterate_next_files_cb, + async); +} + +static void +model_iterate_children_cb (GFile * file, + GAsyncResult * result, + AsyncNode * async) +{ + GError * error = NULL; + GFileEnumerator * enumerator; + + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_node_free (async); + return; + } + + enumerator = g_file_enumerate_children_finish (file, result, &error); + + if (enumerator == NULL) { + /* Simply return if we were cancelled or if the dir is not there */ + FileBrowserNodeDir *dir = async->dir; + + /* Otherwise handle the error appropriately */ + g_signal_emit (dir->model, + model_signals[ERROR], + 0, + GEDIT_FILE_BROWSER_ERROR_LOAD_DIRECTORY, + error->message); + + file_browser_node_unload (dir->model, (FileBrowserNode *)dir, TRUE); + g_error_free (error); + async_node_free (async); + } else { + next_files_async (enumerator, async); + } +} + +static void +model_load_directory (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + FileBrowserNodeDir *dir; + AsyncNode *async; + + g_return_if_fail (NODE_IS_DIR (node)); + + dir = FILE_BROWSER_NODE_DIR (node); + + /* Cancel a previous load */ + if (dir->cancellable != NULL) { + file_browser_node_unload (dir->model, node, TRUE); + } + + node->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; + model_begin_loading (model, node); + + /* Read the '.hidden' file first (if any) */ + parse_dot_hidden_file (node); + + dir->cancellable = g_cancellable_new (); + + async = g_new (AsyncNode, 1); + async->dir = dir; + async->cancellable = g_object_ref (dir->cancellable); + async->original_children = g_slist_copy (dir->children); + + /* Start loading async */ + g_file_enumerate_children_async (node->file, + STANDARD_ATTRIBUTE_TYPES, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT, + async->cancellable, + (GAsyncReadyCallback)model_iterate_children_cb, + async); +} + +static GList * +get_parent_files (GeditFileBrowserStore * model, GFile * file) +{ + GList * result = NULL; + + result = g_list_prepend (result, g_object_ref (file)); + + while ((file = g_file_get_parent (file))) { + if (g_file_equal (file, model->priv->root->file)) { + g_object_unref (file); + break; + } + + result = g_list_prepend (result, file); + } + + return result; +} + +static void +model_fill (GeditFileBrowserStore * model, FileBrowserNode * node, + GtkTreePath ** path) +{ + gboolean free_path = FALSE; + GtkTreeIter iter = {0,}; + GSList *item; + FileBrowserNode *child; + + if (node == NULL) { + node = model->priv->virtual_root; + *path = gtk_tree_path_new (); + free_path = TRUE; + } + + if (*path == NULL) { + *path = + gedit_file_browser_store_get_path_real (model, node); + free_path = TRUE; + } + + if (!model_node_visibility (model, node)) { + if (free_path) + gtk_tree_path_free (*path); + + return; + } + + if (node != model->priv->virtual_root) { + /* Insert node */ + iter.user_data = node; + + row_inserted(model, path, &iter); + } + + if (NODE_IS_DIR (node)) { + /* Go to the first child */ + gtk_tree_path_down (*path); + + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; + item = item->next) { + child = (FileBrowserNode *) (item->data); + + if (model_node_visibility (model, child)) { + model_fill (model, child, path); + + /* Increase path for next child */ + gtk_tree_path_next (*path); + } + } + + /* Move back up to node path */ + gtk_tree_path_up (*path); + } + + model_check_dummy (model, node); + + if (free_path) + gtk_tree_path_free (*path); +} + +static void +set_virtual_root_from_node (GeditFileBrowserStore * model, + FileBrowserNode * node) +{ + FileBrowserNode *next; + FileBrowserNode *prev; + FileBrowserNode *check; + FileBrowserNodeDir *dir; + GSList *item; + GSList *copy; + GtkTreePath *empty = NULL; + + prev = node; + next = prev->parent; + + /* Free all the nodes below that we don't need in cache */ + while (prev != model->priv->root) { + dir = FILE_BROWSER_NODE_DIR (next); + copy = g_slist_copy (dir->children); + + for (item = copy; item; item = item->next) { + check = (FileBrowserNode *) (item->data); + + if (prev == node) { + /* Only free the children, keeping this depth in cache */ + if (check != node) { + file_browser_node_free_children + (model, check); + file_browser_node_unload (model, + check, + FALSE); + } + } else if (check != prev) { + /* Only free when the node is not in the chain */ + dir->children = + g_slist_remove (dir->children, check); + file_browser_node_free (model, check); + } + } + + if (prev != node) + file_browser_node_unload (model, next, FALSE); + + g_slist_free (copy); + prev = next; + next = prev->parent; + } + + /* Free all the nodes up that we don't need in cache */ + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; + item = item->next) { + check = (FileBrowserNode *) (item->data); + + if (NODE_IS_DIR (check)) { + for (copy = + FILE_BROWSER_NODE_DIR (check)->children; copy; + copy = copy->next) { + file_browser_node_free_children (model, + (FileBrowserNode + *) + (copy-> + data)); + file_browser_node_unload (model, + (FileBrowserNode + *) (copy->data), + FALSE); + } + } else if (NODE_IS_DUMMY (check)) { + check->flags |= + GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN; + } + } + + /* Now finally, set the virtual root, and load it up! */ + model->priv->virtual_root = node; + + /* Notify that the virtual-root has changed before loading up new nodes so that the + "root_changed" signal can be emitted before any "inserted" signals */ + g_object_notify (G_OBJECT (model), "virtual-root"); + + model_fill (model, NULL, &empty); + + if (!NODE_LOADED (node)) + model_load_directory (model, node); +} + +static void +set_virtual_root_from_file (GeditFileBrowserStore * model, + GFile * file) +{ + GList * files; + GList * item; + FileBrowserNode * parent; + GFile * check; + + /* Always clear the model before altering the nodes */ + model_clear (model, FALSE); + + /* Create the node path, get all the uri's */ + files = get_parent_files (model, file); + parent = model->priv->root; + + for (item = files; item; item = item->next) { + check = G_FILE (item->data); + + parent = model_add_node_from_dir (model, parent, check); + g_object_unref (check); + } + + g_list_free (files); + set_virtual_root_from_node (model, parent); +} + +static FileBrowserNode * +model_find_node_children (GeditFileBrowserStore * model, + FileBrowserNode * parent, + GFile * file) +{ + FileBrowserNodeDir *dir; + FileBrowserNode *child; + FileBrowserNode *result; + GSList *children; + + if (!NODE_IS_DIR (parent)) + return NULL; + + dir = FILE_BROWSER_NODE_DIR (parent); + + for (children = dir->children; children; children = children->next) { + child = (FileBrowserNode *)(children->data); + + result = model_find_node (model, child, file); + + if (result) + return result; + } + + return NULL; +} + +static FileBrowserNode * +model_find_node (GeditFileBrowserStore * model, + FileBrowserNode * node, + GFile * file) +{ + if (node == NULL) + node = model->priv->root; + + if (node->file && g_file_equal (node->file, file)) + return node; + + if (NODE_IS_DIR (node) && g_file_has_prefix (file, node->file)) + return model_find_node_children (model, node, file); + + return NULL; +} + +static GQuark +gedit_file_browser_store_error_quark (void) +{ + static GQuark quark = 0; + + if (G_UNLIKELY (quark == 0)) { + quark = g_quark_from_string ("gedit_file_browser_store_error"); + } + + return quark; +} + +static GFile * +unique_new_name (GFile * directory, gchar const * name) +{ + GFile * newuri = NULL; + guint num = 0; + gchar * newname; + + while (newuri == NULL || g_file_query_exists (newuri, NULL)) { + if (newuri != NULL) + g_object_unref (newuri); + + if (num == 0) + newname = g_strdup (name); + else + newname = g_strdup_printf ("%s(%d)", name, num); + + newuri = g_file_get_child (directory, newname); + g_free (newname); + + ++num; + } + + return newuri; +} + +static GeditFileBrowserStoreResult +model_root_mounted (GeditFileBrowserStore * model, gchar const * virtual_root) +{ + model_check_dummy (model, model->priv->root); + g_object_notify (G_OBJECT (model), "root"); + + if (virtual_root != NULL) + return + gedit_file_browser_store_set_virtual_root_from_string + (model, virtual_root); + else + set_virtual_root_from_node (model, + model->priv->root); + + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +static void +handle_root_error (GeditFileBrowserStore * model, GError *error) +{ + FileBrowserNode * root; + + g_signal_emit (model, + model_signals[ERROR], + 0, + GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + error->message); + + /* Set the virtual root to the root */ + root = model->priv->root; + model->priv->virtual_root = root; + + /* Set the root to be loaded */ + root->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_LOADED; + + /* Check the dummy */ + model_check_dummy (model, root); + + g_object_notify (G_OBJECT (model), "root"); + g_object_notify (G_OBJECT (model), "virtual-root"); +} + +static void +mount_cb (GFile * file, + GAsyncResult * res, + MountInfo * mount_info) +{ + gboolean mounted; + GError * error = NULL; + GeditFileBrowserStore * model = mount_info->model; + + mounted = g_file_mount_enclosing_volume_finish (file, res, &error); + + if (mount_info->model) + { + model->priv->mount_info = NULL; + model_end_loading (model, model->priv->root); + } + + if (!mount_info->model || g_cancellable_is_cancelled (mount_info->cancellable)) + { + // Reset because it might be reused? + g_cancellable_reset (mount_info->cancellable); + } + else if (mounted) + { + model_root_mounted (model, mount_info->virtual_root); + } + else if (error->code != G_IO_ERROR_CANCELLED) + { + handle_root_error (model, error); + } + + if (error) + g_error_free (error); + + g_object_unref (mount_info->operation); + g_object_unref (mount_info->cancellable); + g_free (mount_info->virtual_root); + + g_free (mount_info); +} + +static GeditFileBrowserStoreResult +model_mount_root (GeditFileBrowserStore * model, gchar const * virtual_root) +{ + GFileInfo * info; + GError * error = NULL; + MountInfo * mount_info; + + info = g_file_query_info (model->priv->root->file, + G_FILE_ATTRIBUTE_STANDARD_TYPE, + G_FILE_QUERY_INFO_NONE, + NULL, + &error); + + if (!info) { + if (error->code == G_IO_ERROR_NOT_MOUNTED) { + /* Try to mount it */ + FILE_BROWSER_NODE_DIR (model->priv->root)->cancellable = g_cancellable_new (); + + mount_info = g_new(MountInfo, 1); + mount_info->model = model; + mount_info->virtual_root = g_strdup (virtual_root); + + /* FIXME: we should be setting the correct window */ + mount_info->operation = gtk_mount_operation_new (NULL); + mount_info->cancellable = g_object_ref (FILE_BROWSER_NODE_DIR (model->priv->root)->cancellable); + + model_begin_loading (model, model->priv->root); + g_file_mount_enclosing_volume (model->priv->root->file, + G_MOUNT_MOUNT_NONE, + mount_info->operation, + mount_info->cancellable, + (GAsyncReadyCallback)mount_cb, + mount_info); + + model->priv->mount_info = mount_info; + return GEDIT_FILE_BROWSER_STORE_RESULT_MOUNTING; + } + else + { + handle_root_error (model, error); + } + + g_error_free (error); + } else { + g_object_unref (info); + + return model_root_mounted (model, virtual_root); + } + + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +/* Public */ +GeditFileBrowserStore * +gedit_file_browser_store_new (gchar const *root) +{ + GeditFileBrowserStore *obj = + GEDIT_FILE_BROWSER_STORE (g_object_new + (GEDIT_TYPE_FILE_BROWSER_STORE, + NULL)); + + gedit_file_browser_store_set_root (obj, root); + return obj; +} + +void +gedit_file_browser_store_set_value (GeditFileBrowserStore * tree_model, + GtkTreeIter * iter, gint column, + GValue * value) +{ + gpointer data; + FileBrowserNode *node; + GtkTreePath *path; + + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model)); + g_return_if_fail (column == + GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM); + g_return_if_fail (G_VALUE_HOLDS_OBJECT (value)); + g_return_if_fail (iter != NULL); + g_return_if_fail (iter->user_data != NULL); + + data = g_value_get_object (value); + + if (data) + g_return_if_fail (GDK_IS_PIXBUF (data)); + + node = (FileBrowserNode *) (iter->user_data); + + if (node->emblem) + g_object_unref (node->emblem); + + if (data) + node->emblem = g_object_ref (GDK_PIXBUF (data)); + else + node->emblem = NULL; + + model_recomposite_icon (tree_model, iter); + + if (model_node_visibility (tree_model, node)) { + path = gedit_file_browser_store_get_path (GTK_TREE_MODEL (tree_model), + iter); + row_changed (tree_model, &path, iter); + gtk_tree_path_free (path); + } +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root (GeditFileBrowserStore * model, + GtkTreeIter * iter) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (iter != NULL, + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (iter->user_data != NULL, + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + + model_clear (model, FALSE); + set_virtual_root_from_node (model, + (FileBrowserNode *) (iter->user_data)); + + return TRUE; +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root_from_string + (GeditFileBrowserStore * model, gchar const *root) { + GFile *file; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + + file = g_file_new_for_uri (root); + if (file == NULL) { + g_warning ("Invalid uri (%s)", root); + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + } + + /* Check if uri is already the virtual root */ + if (model->priv->virtual_root && + g_file_equal (model->priv->virtual_root->file, file)) { + g_object_unref (file); + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + } + + /* Check if uri is the root itself */ + if (g_file_equal (model->priv->root->file, file)) { + g_object_unref (file); + + /* Always clear the model before altering the nodes */ + model_clear (model, FALSE); + set_virtual_root_from_node (model, model->priv->root); + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; + } + + if (!g_file_has_prefix (file, model->priv->root->file)) { + gchar *str, *str1; + + str = g_file_get_parse_name (model->priv->root->file); + str1 = g_file_get_parse_name (file); + + g_warning + ("Virtual root (%s) is not below actual root (%s)", + str1, str); + + g_free (str); + g_free (str1); + + g_object_unref (file); + return GEDIT_FILE_BROWSER_STORE_RESULT_ERROR; + } + + set_virtual_root_from_file (model, file); + g_object_unref (file); + + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root_top (GeditFileBrowserStore * + model) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + + if (model->priv->virtual_root == model->priv->root) + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + + model_clear (model, FALSE); + set_virtual_root_from_node (model, model->priv->root); + + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root_up (GeditFileBrowserStore * + model) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + + if (model->priv->virtual_root == model->priv->root) + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + + model_clear (model, FALSE); + set_virtual_root_from_node (model, + model->priv->virtual_root->parent); + + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +gboolean +gedit_file_browser_store_get_iter_virtual_root (GeditFileBrowserStore * + model, GtkTreeIter * iter) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + + if (model->priv->virtual_root == NULL) + return FALSE; + + iter->user_data = model->priv->virtual_root; + return TRUE; +} + +gboolean +gedit_file_browser_store_get_iter_root (GeditFileBrowserStore * model, + GtkTreeIter * iter) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + + if (model->priv->root == NULL) + return FALSE; + + iter->user_data = model->priv->root; + return TRUE; +} + +gboolean +gedit_file_browser_store_iter_equal (GeditFileBrowserStore * model, + GtkTreeIter * iter1, + GtkTreeIter * iter2) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (iter1 != NULL, FALSE); + g_return_val_if_fail (iter2 != NULL, FALSE); + g_return_val_if_fail (iter1->user_data != NULL, FALSE); + g_return_val_if_fail (iter2->user_data != NULL, FALSE); + + return (iter1->user_data == iter2->user_data); +} + +void +gedit_file_browser_store_cancel_mount_operation (GeditFileBrowserStore *store) +{ + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (store)); + + cancel_mount_operation (store); +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * + model, + gchar const *root, + gchar const *virtual_root) +{ + GFile * file = NULL; + GFile * vfile = NULL; + FileBrowserNode * node; + gboolean equal = FALSE; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + + if (root == NULL && model->priv->root == NULL) + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + + if (root != NULL) { + file = g_file_new_for_uri (root); + } + + if (root != NULL && model->priv->root != NULL) { + equal = g_file_equal (file, model->priv->root->file); + + if (equal && virtual_root == NULL) { + g_object_unref (file); + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + } + } + + if (virtual_root) { + vfile = g_file_new_for_uri (virtual_root); + + if (equal && g_file_equal (vfile, model->priv->virtual_root->file)) { + if (file) + g_object_unref (file); + + g_object_unref (vfile); + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + } + + g_object_unref (vfile); + } + + /* make sure to cancel any previous mount operations */ + cancel_mount_operation (model); + + /* Always clear the model before altering the nodes */ + model_clear (model, TRUE); + file_browser_node_free (model, model->priv->root); + + model->priv->root = NULL; + model->priv->virtual_root = NULL; + + if (file != NULL) { + /* Create the root node */ + node = file_browser_node_dir_new (model, file, NULL); + + g_object_unref (file); + + model->priv->root = node; + return model_mount_root (model, virtual_root); + } else { + g_object_notify (G_OBJECT (model), "root"); + g_object_notify (G_OBJECT (model), "virtual-root"); + } + + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_set_root (GeditFileBrowserStore * model, + gchar const *root) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + return gedit_file_browser_store_set_root_and_virtual_root (model, + root, + NULL); +} + +gchar * +gedit_file_browser_store_get_root (GeditFileBrowserStore * model) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), NULL); + + if (model->priv->root == NULL || model->priv->root->file == NULL) + return NULL; + else + return g_file_get_uri (model->priv->root->file); +} + +gchar * +gedit_file_browser_store_get_virtual_root (GeditFileBrowserStore * model) +{ + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), NULL); + + if (model->priv->virtual_root == NULL || model->priv->virtual_root->file == NULL) + return NULL; + else + return g_file_get_uri (model->priv->virtual_root->file); +} + +void +_gedit_file_browser_store_iter_expanded (GeditFileBrowserStore * model, + GtkTreeIter * iter) +{ + FileBrowserNode *node; + + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + g_return_if_fail (iter != NULL); + g_return_if_fail (iter->user_data != NULL); + + node = (FileBrowserNode *) (iter->user_data); + + if (NODE_IS_DIR (node) && !NODE_LOADED (node)) { + /* Load it now */ + model_load_directory (model, node); + } +} + +void +_gedit_file_browser_store_iter_collapsed (GeditFileBrowserStore * model, + GtkTreeIter * iter) +{ + FileBrowserNode *node; + GSList *item; + + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + g_return_if_fail (iter != NULL); + g_return_if_fail (iter->user_data != NULL); + + node = (FileBrowserNode *) (iter->user_data); + + if (NODE_IS_DIR (node) && NODE_LOADED (node)) { + /* Unload children of the children, keeping 1 depth in cache */ + + for (item = FILE_BROWSER_NODE_DIR (node)->children; item; + item = item->next) { + node = (FileBrowserNode *) (item->data); + + if (NODE_IS_DIR (node) && NODE_LOADED (node)) { + file_browser_node_unload (model, node, + TRUE); + model_check_dummy (model, node); + } + } + } +} + +GeditFileBrowserStoreFilterMode +gedit_file_browser_store_get_filter_mode (GeditFileBrowserStore * model) +{ + return model->priv->filter_mode; +} + +void +gedit_file_browser_store_set_filter_mode (GeditFileBrowserStore * model, + GeditFileBrowserStoreFilterMode + mode) +{ + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + + if (model->priv->filter_mode == mode) + return; + + model->priv->filter_mode = mode; + model_refilter (model); + + g_object_notify (G_OBJECT (model), "filter-mode"); +} + +void +gedit_file_browser_store_set_filter_func (GeditFileBrowserStore * model, + GeditFileBrowserStoreFilterFunc + func, gpointer user_data) +{ + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + + model->priv->filter_func = func; + model->priv->filter_user_data = user_data; + model_refilter (model); +} + +void +gedit_file_browser_store_refilter (GeditFileBrowserStore * model) +{ + model_refilter (model); +} + +GeditFileBrowserStoreFilterMode +gedit_file_browser_store_filter_mode_get_default (void) +{ + return GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; +} + +void +gedit_file_browser_store_refresh (GeditFileBrowserStore * model) +{ + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model)); + + if (model->priv->root == NULL || model->priv->virtual_root == NULL) + return; + + /* Clear the model */ + g_signal_emit (model, model_signals[BEGIN_REFRESH], 0); + file_browser_node_unload (model, model->priv->virtual_root, TRUE); + model_load_directory (model, model->priv->virtual_root); + g_signal_emit (model, model_signals[END_REFRESH], 0); +} + +static void +reparent_node (FileBrowserNode * node, gboolean reparent) +{ + FileBrowserNodeDir * dir; + GSList * child; + GFile * parent; + gchar * base; + + if (!node->file) { + return; + } + + if (reparent) { + parent = node->parent->file; + base = g_file_get_basename (node->file); + g_object_unref (node->file); + + node->file = g_file_get_child (parent, base); + g_free (base); + } + + if (NODE_IS_DIR (node)) { + dir = FILE_BROWSER_NODE_DIR (node); + + for (child = dir->children; child; child = child->next) { + reparent_node ((FileBrowserNode *)child->data, TRUE); + } + } +} + +gboolean +gedit_file_browser_store_rename (GeditFileBrowserStore * model, + GtkTreeIter * iter, + const gchar * new_name, + GError ** error) +{ + FileBrowserNode *node; + GFile * file; + GFile * parent; + GFile * previous; + GError * err = NULL; + gchar * olduri; + gchar * newuri; + GtkTreePath *path; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (iter->user_data != NULL, FALSE); + + node = (FileBrowserNode *) (iter->user_data); + + parent = g_file_get_parent (node->file); + g_return_val_if_fail (parent != NULL, FALSE); + + file = g_file_get_child (parent, new_name); + g_object_unref (parent); + + if (g_file_equal (node->file, file)) { + g_object_unref (file); + return TRUE; + } + + if (g_file_move (node->file, file, G_FILE_COPY_NONE, NULL, NULL, NULL, &err)) { + previous = node->file; + node->file = file; + + /* This makes sure the actual info for the node is requeried */ + file_browser_node_set_name (node); + file_browser_node_set_from_info (model, node, NULL, TRUE); + + reparent_node (node, FALSE); + + if (model_node_visibility (model, node)) { + path = gedit_file_browser_store_get_path_real (model, node); + row_changed (model, &path, iter); + gtk_tree_path_free (path); + + /* Reorder this item */ + model_resort_node (model, node); + } else { + g_object_unref (previous); + + if (error != NULL) + *error = g_error_new_literal (gedit_file_browser_store_error_quark (), + GEDIT_FILE_BROWSER_ERROR_RENAME, + _("The renamed file is currently filtered out. You need to adjust your filter settings to make the file visible")); + return FALSE; + } + + olduri = g_file_get_uri (previous); + newuri = g_file_get_uri (node->file); + + g_signal_emit (model, model_signals[RENAME], 0, olduri, newuri); + + g_object_unref (previous); + g_free (olduri); + g_free (newuri); + + return TRUE; + } else { + g_object_unref (file); + + if (err) { + if (error != NULL) { + *error = + g_error_new_literal + (gedit_file_browser_store_error_quark (), + GEDIT_FILE_BROWSER_ERROR_RENAME, + err->message); + } + + g_error_free (err); + } + + return FALSE; + } +} + +static void +async_data_free (AsyncData * data) +{ + g_object_unref (data->cancellable); + + g_list_foreach (data->files, (GFunc)g_object_unref, NULL); + g_list_free (data->files); + + if (!data->removed) + data->model->priv->async_handles = g_slist_remove (data->model->priv->async_handles, data); + + g_free (data); +} + +static gboolean +emit_no_trash (AsyncData * data) +{ + /* Emit the no trash error */ + gboolean ret; + + g_signal_emit (data->model, model_signals[NO_TRASH], 0, data->files, &ret); + return ret; +} + +typedef struct { + GeditFileBrowserStore * model; + GFile * file; +} IdleDelete; + +static gboolean +file_deleted (IdleDelete * data) +{ + FileBrowserNode * node; + node = model_find_node (data->model, NULL, data->file); + + if (node != NULL) + model_remove_node (data->model, node, NULL, TRUE); + + return FALSE; +} + +static gboolean +delete_files (GIOSchedulerJob * job, + GCancellable * cancellable, + AsyncData * data) +{ + GFile * file; + GError * error = NULL; + gboolean ret; + gint code; + IdleDelete delete; + + /* Check if our job is done */ + if (!data->iter) + return FALSE; + + /* Move a file to the trash */ + file = G_FILE (data->iter->data); + + if (data->trash) + ret = g_file_trash (file, cancellable, &error); + else + ret = g_file_delete (file, cancellable, &error); + + if (ret) { + delete.model = data->model; + delete.file = file; + + /* Remove the file from the model in the main loop */ + g_io_scheduler_job_send_to_mainloop (job, (GSourceFunc)file_deleted, &delete, NULL); + } else if (!ret && error) { + code = error->code; + g_error_free (error); + + if (data->trash && code == G_IO_ERROR_NOT_SUPPORTED) { + /* Trash is not supported on this system ... */ + if (g_io_scheduler_job_send_to_mainloop (job, (GSourceFunc)emit_no_trash, data, NULL)) + { + /* Changes this into a delete job */ + data->trash = FALSE; + data->iter = data->files; + + return TRUE; + } + + /* End the job */ + return FALSE; + } else if (code == G_IO_ERROR_CANCELLED) { + /* Job has been cancelled, just let the job end */ + return FALSE; + } + } + + /* Process the next item */ + data->iter = data->iter->next; + return TRUE; +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_delete_all (GeditFileBrowserStore *model, + GList *rows, gboolean trash) +{ + FileBrowserNode * node; + AsyncData * data; + GList * files = NULL; + GList * row; + GtkTreeIter iter; + GtkTreePath * prev = NULL; + GtkTreePath * path; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + + if (rows == NULL) + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + + /* First we sort the paths so that we can later on remove any + files/directories that are actually subfiles/directories of + a directory that's also deleted */ + rows = g_list_sort (g_list_copy (rows), (GCompareFunc)gtk_tree_path_compare); + + for (row = rows; row; row = row->next) { + path = (GtkTreePath *)(row->data); + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path)) + continue; + + /* Skip if the current path is actually a descendant of the + previous path */ + if (prev != NULL && gtk_tree_path_is_descendant (path, prev)) + continue; + + prev = path; + node = (FileBrowserNode *)(iter.user_data); + files = g_list_prepend (files, g_object_ref (node->file)); + } + + data = g_new (AsyncData, 1); + + data->model = model; + data->cancellable = g_cancellable_new (); + data->files = files; + data->trash = trash; + data->iter = files; + data->removed = FALSE; + + model->priv->async_handles = + g_slist_prepend (model->priv->async_handles, data); + + g_io_scheduler_push_job ((GIOSchedulerJobFunc)delete_files, + data, + (GDestroyNotify)async_data_free, + G_PRIORITY_DEFAULT, + data->cancellable); + g_list_free (rows); + + return GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +GeditFileBrowserStoreResult +gedit_file_browser_store_delete (GeditFileBrowserStore * model, + GtkTreeIter * iter, gboolean trash) +{ + FileBrowserNode *node; + GList *rows = NULL; + GeditFileBrowserStoreResult result; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (iter != NULL, GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + g_return_val_if_fail (iter->user_data != NULL, GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE); + + node = (FileBrowserNode *) (iter->user_data); + + if (NODE_IS_DUMMY (node)) + return GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE; + + rows = g_list_append(NULL, gedit_file_browser_store_get_path_real (model, node)); + result = gedit_file_browser_store_delete_all (model, rows, trash); + + g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); + g_list_free (rows); + + return result; +} + +gboolean +gedit_file_browser_store_new_file (GeditFileBrowserStore * model, + GtkTreeIter * parent, + GtkTreeIter * iter) +{ + GFile * file; + GFileOutputStream * stream; + FileBrowserNodeDir *parent_node; + gboolean result = FALSE; + FileBrowserNode *node; + GError * error = NULL; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (parent != NULL, FALSE); + g_return_val_if_fail (parent->user_data != NULL, FALSE); + g_return_val_if_fail (NODE_IS_DIR + ((FileBrowserNode *) (parent->user_data)), + FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + + parent_node = FILE_BROWSER_NODE_DIR (parent->user_data); + /* Translators: This is the default name of new files created by the file browser pane. */ + file = unique_new_name (((FileBrowserNode *) parent_node)->file, _("file")); + + stream = g_file_create (file, G_FILE_CREATE_NONE, NULL, &error); + + if (!stream) + { + g_signal_emit (model, model_signals[ERROR], 0, + GEDIT_FILE_BROWSER_ERROR_NEW_FILE, + error->message); + g_error_free (error); + } else { + g_object_unref (stream); + node = model_add_node_from_file (model, + (FileBrowserNode *)parent_node, + file, + NULL); + + if (model_node_visibility (model, node)) { + iter->user_data = node; + result = TRUE; + } else { + g_signal_emit (model, model_signals[ERROR], 0, + GEDIT_FILE_BROWSER_ERROR_NEW_FILE, + _ + ("The new file is currently filtered out. You need to adjust your filter settings to make the file visible")); + } + } + + g_object_unref (file); + return result; +} + +gboolean +gedit_file_browser_store_new_directory (GeditFileBrowserStore * model, + GtkTreeIter * parent, + GtkTreeIter * iter) +{ + GFile * file; + FileBrowserNodeDir *parent_node; + GError * error = NULL; + FileBrowserNode *node; + gboolean result = FALSE; + + g_return_val_if_fail (GEDIT_IS_FILE_BROWSER_STORE (model), FALSE); + g_return_val_if_fail (parent != NULL, FALSE); + g_return_val_if_fail (parent->user_data != NULL, FALSE); + g_return_val_if_fail (NODE_IS_DIR + ((FileBrowserNode *) (parent->user_data)), + FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + + parent_node = FILE_BROWSER_NODE_DIR (parent->user_data); + /* Translators: This is the default name of new directories created by the file browser pane. */ + file = unique_new_name (((FileBrowserNode *) parent_node)->file, _("directory")); + + if (!g_file_make_directory (file, NULL, &error)) { + g_signal_emit (model, model_signals[ERROR], 0, + GEDIT_FILE_BROWSER_ERROR_NEW_DIRECTORY, + error->message); + g_error_free (error); + } else { + node = model_add_node_from_file (model, + (FileBrowserNode *)parent_node, + file, + NULL); + + if (model_node_visibility (model, node)) { + iter->user_data = node; + result = TRUE; + } else { + g_signal_emit (model, model_signals[ERROR], 0, + GEDIT_FILE_BROWSER_ERROR_NEW_FILE, + _ + ("The new directory is currently filtered out. You need to adjust your filter settings to make the directory visible")); + } + } + + g_object_unref (file); + return result; +} + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-store.h b/plugins/filebrowser/gedit-file-browser-store.h new file mode 100755 index 00000000..f31da327 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-store.h @@ -0,0 +1,200 @@ +/* + * gedit-file-browser-store.h - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 __GEDIT_FILE_BROWSER_STORE_H__ +#define __GEDIT_FILE_BROWSER_STORE_H__ + +#include + +G_BEGIN_DECLS +#define GEDIT_TYPE_FILE_BROWSER_STORE (gedit_file_browser_store_get_type ()) +#define GEDIT_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStore)) +#define GEDIT_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStore const)) +#define GEDIT_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStoreClass)) +#define GEDIT_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_STORE)) +#define GEDIT_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_STORE)) +#define GEDIT_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_STORE, GeditFileBrowserStoreClass)) + +typedef enum +{ + GEDIT_FILE_BROWSER_STORE_COLUMN_ICON = 0, + GEDIT_FILE_BROWSER_STORE_COLUMN_NAME, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, + GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM, + GEDIT_FILE_BROWSER_STORE_COLUMN_NUM +} GeditFileBrowserStoreColumn; + +typedef enum +{ + GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0, + GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1, + GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2, + GEDIT_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3, + GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4, + GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5 +} GeditFileBrowserStoreFlag; + +typedef enum +{ + GEDIT_FILE_BROWSER_STORE_RESULT_OK, + GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE, + GEDIT_FILE_BROWSER_STORE_RESULT_ERROR, + GEDIT_FILE_BROWSER_STORE_RESULT_NO_TRASH, + GEDIT_FILE_BROWSER_STORE_RESULT_MOUNTING, + GEDIT_FILE_BROWSER_STORE_RESULT_NUM +} GeditFileBrowserStoreResult; + +typedef enum +{ + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0, + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0, + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1 +} GeditFileBrowserStoreFilterMode; + +#define FILE_IS_DIR(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY) +#define FILE_IS_HIDDEN(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN) +#define FILE_IS_TEXT(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_TEXT) +#define FILE_LOADED(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_LOADED) +#define FILE_IS_FILTERED(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_FILTERED) +#define FILE_IS_DUMMY(flags) (flags & GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY) + +typedef struct _GeditFileBrowserStore GeditFileBrowserStore; +typedef struct _GeditFileBrowserStoreClass GeditFileBrowserStoreClass; +typedef struct _GeditFileBrowserStorePrivate GeditFileBrowserStorePrivate; + +typedef gboolean (*GeditFileBrowserStoreFilterFunc) (GeditFileBrowserStore + * model, + GtkTreeIter * iter, + gpointer user_data); + +struct _GeditFileBrowserStore +{ + GObject parent; + + GeditFileBrowserStorePrivate *priv; +}; + +struct _GeditFileBrowserStoreClass { + GObjectClass parent_class; + + /* Signals */ + void (*begin_loading) (GeditFileBrowserStore * model, + GtkTreeIter * iter); + void (*end_loading) (GeditFileBrowserStore * model, + GtkTreeIter * iter); + void (*error) (GeditFileBrowserStore * model, + guint code, + gchar * message); + gboolean (*no_trash) (GeditFileBrowserStore * model, + GList * files); + void (*rename) (GeditFileBrowserStore * model, + const gchar * olduri, + const gchar * newuri); + void (*begin_refresh) (GeditFileBrowserStore * model); + void (*end_refresh) (GeditFileBrowserStore * model); + void (*unload) (GeditFileBrowserStore * model, + const gchar * uri); +}; + +GType gedit_file_browser_store_get_type (void) G_GNUC_CONST; +GType gedit_file_browser_store_register_type (GTypeModule * module); + +GeditFileBrowserStore *gedit_file_browser_store_new (gchar const *root); + +GeditFileBrowserStoreResult +gedit_file_browser_store_set_root_and_virtual_root (GeditFileBrowserStore * model, + gchar const *root, + gchar const *virtual_root); +GeditFileBrowserStoreResult +gedit_file_browser_store_set_root (GeditFileBrowserStore * model, + gchar const *root); +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root (GeditFileBrowserStore * model, + GtkTreeIter * iter); +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root_from_string (GeditFileBrowserStore * model, + gchar const *root); +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root_up (GeditFileBrowserStore * model); +GeditFileBrowserStoreResult +gedit_file_browser_store_set_virtual_root_top (GeditFileBrowserStore * model); + +gboolean +gedit_file_browser_store_get_iter_virtual_root (GeditFileBrowserStore * model, + GtkTreeIter * iter); +gboolean gedit_file_browser_store_get_iter_root (GeditFileBrowserStore * model, + GtkTreeIter * iter); +gchar * gedit_file_browser_store_get_root (GeditFileBrowserStore * model); +gchar * gedit_file_browser_store_get_virtual_root (GeditFileBrowserStore * model); + +gboolean gedit_file_browser_store_iter_equal (GeditFileBrowserStore * model, + GtkTreeIter * iter1, + GtkTreeIter * iter2); + +void gedit_file_browser_store_set_value (GeditFileBrowserStore * tree_model, + GtkTreeIter * iter, + gint column, + GValue * value); + +void _gedit_file_browser_store_iter_expanded (GeditFileBrowserStore * model, + GtkTreeIter * iter); +void _gedit_file_browser_store_iter_collapsed (GeditFileBrowserStore * model, + GtkTreeIter * iter); + +GeditFileBrowserStoreFilterMode +gedit_file_browser_store_get_filter_mode (GeditFileBrowserStore * model); +void gedit_file_browser_store_set_filter_mode (GeditFileBrowserStore * model, + GeditFileBrowserStoreFilterMode mode); +void gedit_file_browser_store_set_filter_func (GeditFileBrowserStore * model, + GeditFileBrowserStoreFilterFunc func, + gpointer user_data); +void gedit_file_browser_store_refilter (GeditFileBrowserStore * model); +GeditFileBrowserStoreFilterMode +gedit_file_browser_store_filter_mode_get_default (void); + +void gedit_file_browser_store_refresh (GeditFileBrowserStore * model); +gboolean gedit_file_browser_store_rename (GeditFileBrowserStore * model, + GtkTreeIter * iter, + gchar const *new_name, + GError ** error); +GeditFileBrowserStoreResult +gedit_file_browser_store_delete (GeditFileBrowserStore * model, + GtkTreeIter * iter, + gboolean trash); +GeditFileBrowserStoreResult +gedit_file_browser_store_delete_all (GeditFileBrowserStore * model, + GList *rows, + gboolean trash); + +gboolean gedit_file_browser_store_new_file (GeditFileBrowserStore * model, + GtkTreeIter * parent, + GtkTreeIter * iter); +gboolean gedit_file_browser_store_new_directory (GeditFileBrowserStore * model, + GtkTreeIter * parent, + GtkTreeIter * iter); + +void gedit_file_browser_store_cancel_mount_operation (GeditFileBrowserStore *store); + +G_END_DECLS +#endif /* __GEDIT_FILE_BROWSER_STORE_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-utils.c b/plugins/filebrowser/gedit-file-browser-utils.c new file mode 100755 index 00000000..d8f4028a --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-utils.c @@ -0,0 +1,198 @@ +/* + * gedit-file-bookmarks-store.c - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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. + */ + +#include "gedit-file-browser-utils.h" +#include + +static GdkPixbuf * +process_icon_pixbuf (GdkPixbuf * pixbuf, + gchar const * name, + gint size, + GError * error) +{ + GdkPixbuf * scale; + + if (error != NULL) { + g_warning ("Could not load theme icon %s: %s", + name, + error->message); + g_error_free (error); + } + + if (pixbuf && gdk_pixbuf_get_width (pixbuf) > size) { + scale = gdk_pixbuf_scale_simple (pixbuf, + size, + size, + GDK_INTERP_BILINEAR); + g_object_unref (pixbuf); + pixbuf = scale; + } + + return pixbuf; +} + +GdkPixbuf * +gedit_file_browser_utils_pixbuf_from_theme (gchar const * name, + GtkIconSize size) +{ + gint width; + GError *error = NULL; + GdkPixbuf *pixbuf; + + gtk_icon_size_lookup (size, &width, NULL); + + pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), + name, + width, + 0, + &error); + + pixbuf = process_icon_pixbuf (pixbuf, name, width, error); + + return pixbuf; +} + +GdkPixbuf * +gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon, + GtkIconSize size) +{ + GdkPixbuf * ret = NULL; + GtkIconTheme *theme; + GtkIconInfo *info; + gint width; + + if (!icon) + return NULL; + + theme = gtk_icon_theme_get_default (); + gtk_icon_size_lookup (size, &width, NULL); + + info = gtk_icon_theme_lookup_by_gicon (theme, + icon, + width, + GTK_ICON_LOOKUP_USE_BUILTIN); + + if (!info) + return NULL; + + ret = gtk_icon_info_load_icon (info, NULL); + gtk_icon_info_free (info); + + return ret; +} + +GdkPixbuf * +gedit_file_browser_utils_pixbuf_from_file (GFile * file, + GtkIconSize size) +{ + GIcon * icon; + GFileInfo * info; + GdkPixbuf * ret = NULL; + + info = g_file_query_info (file, + G_FILE_ATTRIBUTE_STANDARD_ICON, + G_FILE_QUERY_INFO_NONE, + NULL, + NULL); + + if (!info) + return NULL; + + icon = g_file_info_get_icon (info); + if (icon != NULL) + ret = gedit_file_browser_utils_pixbuf_from_icon (icon, size); + + g_object_unref (info); + + return ret; +} + +gchar * +gedit_file_browser_utils_file_basename (GFile * file) +{ + gchar *uri; + gchar *ret; + + uri = g_file_get_uri (file); + ret = gedit_file_browser_utils_uri_basename (uri); + g_free (uri); + + return ret; +} + +gchar * +gedit_file_browser_utils_uri_basename (gchar const * uri) +{ + return gedit_utils_basename_for_display (uri); +} + +gboolean +gedit_file_browser_utils_confirmation_dialog (GeditWindow * window, + GtkMessageType type, + gchar const *message, + gchar const *secondary, + gchar const * button_stock, + gchar const * button_label) +{ + GtkWidget *dlg; + gint ret; + GtkWidget *button; + + dlg = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + type, + GTK_BUTTONS_NONE, "%s", message); + + if (secondary) + gtk_message_dialog_format_secondary_text + (GTK_MESSAGE_DIALOG (dlg), "%s", secondary); + + /* Add a cancel button */ + button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); + gtk_widget_show (button); + + GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); + gtk_dialog_add_action_widget (GTK_DIALOG (dlg), + button, + GTK_RESPONSE_CANCEL); + + /* Add custom button */ + button = gtk_button_new_from_stock (button_stock); + + if (button_label) { + gtk_button_set_use_stock (GTK_BUTTON (button), FALSE); + gtk_button_set_label (GTK_BUTTON (button), button_label); + } + + gtk_widget_show (button); + GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); + gtk_dialog_add_action_widget (GTK_DIALOG (dlg), + button, + GTK_RESPONSE_OK); + + ret = gtk_dialog_run (GTK_DIALOG (dlg)); + gtk_widget_destroy (dlg); + + return (ret == GTK_RESPONSE_OK); +} + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-utils.h b/plugins/filebrowser/gedit-file-browser-utils.h new file mode 100755 index 00000000..fc9acbce --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-utils.h @@ -0,0 +1,27 @@ +#ifndef __GEDIT_FILE_BROWSER_UTILS_H__ +#define __GEDIT_FILE_BROWSER_UTILS_H__ + +#include +#include + +GdkPixbuf *gedit_file_browser_utils_pixbuf_from_theme (gchar const *name, + GtkIconSize size); + +GdkPixbuf *gedit_file_browser_utils_pixbuf_from_icon (GIcon * icon, + GtkIconSize size); +GdkPixbuf *gedit_file_browser_utils_pixbuf_from_file (GFile * file, + GtkIconSize size); + +gchar * gedit_file_browser_utils_file_basename (GFile * file); +gchar * gedit_file_browser_utils_uri_basename (gchar const * uri); + +gboolean gedit_file_browser_utils_confirmation_dialog (GeditWindow * window, + GtkMessageType type, + gchar const *message, + gchar const *secondary, + gchar const * button_stock, + gchar const * button_label); + +#endif /* __GEDIT_FILE_BROWSER_UTILS_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-view.c b/plugins/filebrowser/gedit-file-browser-view.c new file mode 100755 index 00000000..05733da1 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-view.c @@ -0,0 +1,1256 @@ +/* + * gedit-file-browser-view.c - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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. + */ + +#include +#include +#include +#include + +#include "gedit-file-browser-store.h" +#include "gedit-file-bookmarks-store.h" +#include "gedit-file-browser-view.h" +#include "gedit-file-browser-marshal.h" +#include "gedit-file-browser-enum-types.h" + +#define GEDIT_FILE_BROWSER_VIEW_GET_PRIVATE(object)( \ + G_TYPE_INSTANCE_GET_PRIVATE((object), \ + GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewPrivate)) + +struct _GeditFileBrowserViewPrivate +{ + GtkTreeViewColumn *column; + GtkCellRenderer *pixbuf_renderer; + GtkCellRenderer *text_renderer; + + GtkTreeModel *model; + GtkTreeRowReference *editable; + + GdkCursor *busy_cursor; + + /* CLick policy */ + GeditFileBrowserViewClickPolicy click_policy; + GtkTreePath *double_click_path[2]; /* Both clicks in a double click need to be on the same row */ + GtkTreePath *hover_path; + GdkCursor *hand_cursor; + gboolean ignore_release; + gboolean selected_on_button_down; + gint drag_button; + gboolean drag_started; + + gboolean restore_expand_state; + gboolean is_refresh; + GHashTable * expand_state; +}; + +/* Properties */ +enum +{ + PROP_0, + + PROP_CLICK_POLICY, + PROP_RESTORE_EXPAND_STATE +}; + +/* Signals */ +enum +{ + ERROR, + FILE_ACTIVATED, + DIRECTORY_ACTIVATED, + BOOKMARK_ACTIVATED, + NUM_SIGNALS +}; + +static guint signals[NUM_SIGNALS] = { 0 }; + +static const GtkTargetEntry drag_source_targets[] = { + { "text/uri-list", 0, 0 } +}; + +GEDIT_PLUGIN_DEFINE_TYPE (GeditFileBrowserView, gedit_file_browser_view, + GTK_TYPE_TREE_VIEW) + +static void on_cell_edited (GtkCellRendererText * cell, + gchar * path, + gchar * new_text, + GeditFileBrowserView * tree_view); + +static void on_begin_refresh (GeditFileBrowserStore * model, + GeditFileBrowserView * view); +static void on_end_refresh (GeditFileBrowserStore * model, + GeditFileBrowserView * view); + +static void on_unload (GeditFileBrowserStore * model, + gchar const * uri, + GeditFileBrowserView * view); + +static void on_row_inserted (GeditFileBrowserStore * model, + GtkTreePath * path, + GtkTreeIter * iter, + GeditFileBrowserView * view); + +static void +gedit_file_browser_view_finalize (GObject * object) +{ + GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW(object); + + if (obj->priv->hand_cursor) + gdk_cursor_unref(obj->priv->hand_cursor); + + if (obj->priv->hover_path) + gtk_tree_path_free (obj->priv->hover_path); + + if (obj->priv->expand_state) + { + g_hash_table_destroy (obj->priv->expand_state); + obj->priv->expand_state = NULL; + } + + gdk_cursor_unref (obj->priv->busy_cursor); + + G_OBJECT_CLASS (gedit_file_browser_view_parent_class)-> + finalize (object); +} + +static void +add_expand_state (GeditFileBrowserView * view, + gchar const * uri) +{ + GFile * file; + + if (!uri) + return; + + file = g_file_new_for_uri (uri); + + if (view->priv->expand_state) + g_hash_table_insert (view->priv->expand_state, file, file); + else + g_object_unref (file); +} + +static void +remove_expand_state (GeditFileBrowserView * view, + gchar const * uri) +{ + GFile * file; + + if (!uri) + return; + + file = g_file_new_for_uri (uri); + + if (view->priv->expand_state) + g_hash_table_remove (view->priv->expand_state, file); + + g_object_unref (file); +} + +static void +row_expanded (GtkTreeView * tree_view, + GtkTreeIter * iter, + GtkTreePath * path) +{ + GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (tree_view); + gchar * uri; + + if (GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_expanded) + GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_expanded (tree_view, iter, path); + + if (!GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + return; + + if (view->priv->restore_expand_state) + { + gtk_tree_model_get (view->priv->model, + iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + &uri, + -1); + + add_expand_state (view, uri); + g_free (uri); + } + + _gedit_file_browser_store_iter_expanded (GEDIT_FILE_BROWSER_STORE (view->priv->model), + iter); +} + +static void +row_collapsed (GtkTreeView * tree_view, + GtkTreeIter * iter, + GtkTreePath * path) +{ + GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (tree_view); + gchar * uri; + + if (GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_collapsed) + GTK_TREE_VIEW_CLASS (gedit_file_browser_view_parent_class)->row_collapsed (tree_view, iter, path); + + if (!GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + return; + + if (view->priv->restore_expand_state) + { + gtk_tree_model_get (view->priv->model, + iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + &uri, + -1); + + remove_expand_state (view, uri); + g_free (uri); + } + + _gedit_file_browser_store_iter_collapsed (GEDIT_FILE_BROWSER_STORE (view->priv->model), + iter); +} + +static gboolean +leave_notify_event (GtkWidget *widget, + GdkEventCrossing *event) +{ + GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + + if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE && + view->priv->hover_path != NULL) { + gtk_tree_path_free (view->priv->hover_path); + view->priv->hover_path = NULL; + } + + // Chainup + return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->leave_notify_event (widget, event); +} + +static gboolean +enter_notify_event (GtkWidget *widget, + GdkEventCrossing *event) +{ + GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + + if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + if (view->priv->hover_path != NULL) + gtk_tree_path_free (view->priv->hover_path); + + gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), + event->x, event->y, + &view->priv->hover_path, + NULL, NULL, NULL); + + if (view->priv->hover_path != NULL) + gdk_window_set_cursor (gtk_widget_get_window (widget), + view->priv->hand_cursor); + } + + // Chainup + return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->enter_notify_event (widget, event); +} + +static gboolean +motion_notify_event (GtkWidget * widget, + GdkEventMotion * event) +{ + GtkTreePath *old_hover_path; + GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + + if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + old_hover_path = view->priv->hover_path; + gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), + event->x, event->y, + &view->priv->hover_path, + NULL, NULL, NULL); + + if ((old_hover_path != NULL) != (view->priv->hover_path != NULL)) { + if (view->priv->hover_path != NULL) + gdk_window_set_cursor (gtk_widget_get_window (widget), + view->priv->hand_cursor); + else + gdk_window_set_cursor (gtk_widget_get_window (widget), + NULL); + } + + if (old_hover_path != NULL) + gtk_tree_path_free (old_hover_path); + } + + // Chainup + return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->motion_notify_event (widget, event); +} + +static void +set_click_policy_property (GeditFileBrowserView *obj, + GeditFileBrowserViewClickPolicy click_policy) +{ + GtkTreeIter iter; + GdkDisplay *display; + GdkWindow *win; + + obj->priv->click_policy = click_policy; + + if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + if (obj->priv->hand_cursor == NULL) + obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2); + } else if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) { + if (obj->priv->hover_path != NULL) { + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (obj->priv->model), + &iter, obj->priv->hover_path)) + gtk_tree_model_row_changed (GTK_TREE_MODEL (obj->priv->model), + obj->priv->hover_path, &iter); + + gtk_tree_path_free (obj->priv->hover_path); + obj->priv->hover_path = NULL; + } + + if (GTK_WIDGET_REALIZED (GTK_WIDGET (obj))) { + win = gtk_widget_get_window (GTK_WIDGET (obj)); + gdk_window_set_cursor (win, NULL); + + display = gtk_widget_get_display (GTK_WIDGET (obj)); + + if (display != NULL) + gdk_display_flush (display); + } + + if (obj->priv->hand_cursor) { + gdk_cursor_unref (obj->priv->hand_cursor); + obj->priv->hand_cursor = NULL; + } + } +} + +static void +directory_activated (GeditFileBrowserView *view, + GtkTreeIter *iter) +{ + gedit_file_browser_store_set_virtual_root (GEDIT_FILE_BROWSER_STORE (view->priv->model), iter); +} + +static void +activate_selected_files (GeditFileBrowserView *view) { + GtkTreeView *tree_view = GTK_TREE_VIEW (view); + GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view); + GList *rows, *row; + GtkTreePath *directory = NULL; + GtkTreePath *path; + GtkTreeIter iter; + GeditFileBrowserStoreFlag flags; + + rows = gtk_tree_selection_get_selected_rows (selection, &view->priv->model); + + for (row = rows; row; row = row->next) { + path = (GtkTreePath *)(row->data); + + /* Get iter from path */ + if (!gtk_tree_model_get_iter (view->priv->model, &iter, path)) + continue; + + gtk_tree_model_get (view->priv->model, &iter, GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, -1); + + if (FILE_IS_DIR (flags)) { + if (directory == NULL) + directory = path; + + } else if (!FILE_IS_DUMMY (flags)) { + g_signal_emit (view, signals[FILE_ACTIVATED], 0, &iter); + } + } + + if (directory != NULL) { + if (gtk_tree_model_get_iter (view->priv->model, &iter, directory)) + g_signal_emit (view, signals[DIRECTORY_ACTIVATED], 0, &iter); + } + + g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); + g_list_free (rows); +} + +static void +activate_selected_bookmark (GeditFileBrowserView *view) { + GtkTreeView *tree_view = GTK_TREE_VIEW (view); + GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view); + GtkTreeIter iter; + + if (gtk_tree_selection_get_selected (selection, &view->priv->model, &iter)) + g_signal_emit (view, signals[BOOKMARK_ACTIVATED], 0, &iter); +} + +static void +activate_selected_items (GeditFileBrowserView *view) +{ + if (GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + activate_selected_files (view); + else if (GEDIT_IS_FILE_BOOKMARKS_STORE (view->priv->model)) + activate_selected_bookmark (view); +} + +static void +toggle_hidden_filter (GeditFileBrowserView *view) +{ + GeditFileBrowserStoreFilterMode mode; + + if (GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + { + mode = gedit_file_browser_store_get_filter_mode + (GEDIT_FILE_BROWSER_STORE (view->priv->model)); + mode ^= GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN; + gedit_file_browser_store_set_filter_mode + (GEDIT_FILE_BROWSER_STORE (view->priv->model), mode); + } +} + +static gboolean +button_event_modifies_selection (GdkEventButton *event) +{ + return (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) != 0; +} + +static void +drag_begin (GtkWidget *widget, + GdkDragContext *context) +{ + GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + + view->priv->drag_button = 0; + view->priv->drag_started = TRUE; + + /* Chain up */ + GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->drag_begin (widget, context); +} + +static void +did_not_drag (GeditFileBrowserView *view, + GdkEventButton *event) +{ + GtkTreeView *tree_view; + GtkTreeSelection *selection; + GtkTreePath *path; + + tree_view = GTK_TREE_VIEW (view); + selection = gtk_tree_view_get_selection (tree_view); + + if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y, + &path, NULL, NULL, NULL)) { + if ((view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) + && !button_event_modifies_selection(event) + && (event->button == 1 || event->button == 2)) { + /* Activate all selected items, and leave them selected */ + activate_selected_items (view); + } else if ((event->button == 1 || event->button == 2) + && ((event->state & GDK_CONTROL_MASK) != 0 || + (event->state & GDK_SHIFT_MASK) == 0) + && view->priv->selected_on_button_down) { + if (!button_event_modifies_selection (event)) { + gtk_tree_selection_unselect_all (selection); + gtk_tree_selection_select_path (selection, path); + } else { + gtk_tree_selection_unselect_path (selection, path); + } + } + + gtk_tree_path_free (path); + } +} + +static gboolean +button_release_event (GtkWidget *widget, + GdkEventButton *event) +{ + GeditFileBrowserView *view = GEDIT_FILE_BROWSER_VIEW (widget); + + if (event->button == view->priv->drag_button) { + view->priv->drag_button = 0; + + if (!view->priv->drag_started && + !view->priv->ignore_release) + did_not_drag (view, event); + } + + /* Chain up */ + return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->button_release_event (widget, event); +} + +static gboolean +button_press_event (GtkWidget *widget, + GdkEventButton *event) +{ + int double_click_time; + static int click_count = 0; + static guint32 last_click_time = 0; + GeditFileBrowserView *view; + GtkTreeView *tree_view; + GtkTreeSelection *selection; + GtkTreePath *path; + int expander_size; + int horizontal_separator; + gboolean on_expander; + gboolean call_parent; + gboolean selected; + GtkWidgetClass *widget_parent = GTK_WIDGET_CLASS(gedit_file_browser_view_parent_class); + + tree_view = GTK_TREE_VIEW (widget); + view = GEDIT_FILE_BROWSER_VIEW (widget); + selection = gtk_tree_view_get_selection (tree_view); + + /* Get double click time */ + g_object_get (G_OBJECT (gtk_widget_get_settings (widget)), + "gtk-double-click-time", &double_click_time, + NULL); + + /* Determine click count */ + if (event->time - last_click_time < double_click_time) + click_count++; + else + click_count = 0; + + last_click_time = event->time; + + /* Ignore double click if we are in single click mode */ + if (view->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE && + click_count >= 2) { + return TRUE; + } + + view->priv->ignore_release = FALSE; + call_parent = TRUE; + + if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y, + &path, NULL, NULL, NULL)) { + /* Keep track of path of last click so double clicks only happen + * on the same item */ + if ((event->button == 1 || event->button == 2) && + event->type == GDK_BUTTON_PRESS) { + if (view->priv->double_click_path[1]) + gtk_tree_path_free (view->priv->double_click_path[1]); + + view->priv->double_click_path[1] = view->priv->double_click_path[0]; + view->priv->double_click_path[0] = gtk_tree_path_copy (path); + } + + if (event->type == GDK_2BUTTON_PRESS) { + if (view->priv->double_click_path[1] && + gtk_tree_path_compare (view->priv->double_click_path[0], view->priv->double_click_path[1]) == 0) + activate_selected_items (view); + + /* Chain up */ + widget_parent->button_press_event (widget, event); + } else { + /* We're going to filter out some situations where + * we can't let the default code run because all + * but one row would be would be deselected. We don't + * want that; we want the right click menu or single + * click to apply to everything that's currently selected. */ + selected = gtk_tree_selection_path_is_selected (selection, path); + + if (event->button == 3 && selected) + call_parent = FALSE; + + if ((event->button == 1 || event->button == 2) && + ((event->state & GDK_CONTROL_MASK) != 0 || + (event->state & GDK_SHIFT_MASK) == 0)) { + gtk_widget_style_get (widget, + "expander-size", &expander_size, + "horizontal-separator", &horizontal_separator, + NULL); + on_expander = (event->x <= horizontal_separator / 2 + + gtk_tree_path_get_depth (path) * expander_size); + + view->priv->selected_on_button_down = selected; + + if (selected) { + call_parent = on_expander || gtk_tree_selection_count_selected_rows (selection) == 1; + view->priv->ignore_release = call_parent && view->priv->click_policy != GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE; + } else if ((event->state & GDK_CONTROL_MASK) != 0) { + call_parent = FALSE; + gtk_tree_selection_select_path (selection, path); + } else { + view->priv->ignore_release = on_expander; + } + } + + if (call_parent) { + /* Chain up */ + widget_parent->button_press_event (widget, event); + } else if (selected) { + gtk_widget_grab_focus (widget); + } + + if ((event->button == 1 || event->button == 2) && + event->type == GDK_BUTTON_PRESS) { + view->priv->drag_started = FALSE; + view->priv->drag_button = event->button; + } + } + + gtk_tree_path_free (path); + } else { + if ((event->button == 1 || event->button == 2) && + event->type == GDK_BUTTON_PRESS) { + if (view->priv->double_click_path[1]) + gtk_tree_path_free (view->priv->double_click_path[1]); + + view->priv->double_click_path[1] = view->priv->double_click_path[0]; + view->priv->double_click_path[0] = NULL; + } + + gtk_tree_selection_unselect_all (selection); + /* Chain up */ + widget_parent->button_press_event (widget, event); + } + + /* We already chained up if nescessary, so just return TRUE */ + return TRUE; +} + +static gboolean +key_press_event (GtkWidget *widget, + GdkEventKey *event) +{ + GeditFileBrowserView *view; + guint modifiers; + gboolean handled; + + view = GEDIT_FILE_BROWSER_VIEW (widget); + handled = FALSE; + + modifiers = gtk_accelerator_get_default_mod_mask (); + + switch (event->keyval) { + case GDK_space: + if (event->state & GDK_CONTROL_MASK) { + handled = FALSE; + break; + } + if (!GTK_WIDGET_HAS_FOCUS (widget)) { + handled = FALSE; + break; + } + + activate_selected_items (view); + handled = TRUE; + break; + + case GDK_Return: + case GDK_KP_Enter: + activate_selected_items (view); + handled = TRUE; + break; + + case GDK_h: + if ((event->state & modifiers) == GDK_CONTROL_MASK) { + toggle_hidden_filter (view); + handled = TRUE; + break; + } + + default: + handled = FALSE; + } + + /* Chain up */ + if (!handled) + return GTK_WIDGET_CLASS (gedit_file_browser_view_parent_class)->key_press_event (widget, event); + + return TRUE; +} + +static void +fill_expand_state (GeditFileBrowserView * view, GtkTreeIter * iter) +{ + GtkTreePath * path; + GtkTreeIter child; + gchar * uri; + + if (!gtk_tree_model_iter_has_child (view->priv->model, iter)) + return; + + path = gtk_tree_model_get_path (view->priv->model, iter); + + if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), path)) + { + gtk_tree_model_get (view->priv->model, + iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + &uri, + -1); + + add_expand_state (view, uri); + g_free (uri); + } + + if (gtk_tree_model_iter_children (view->priv->model, &child, iter)) + { + do { + fill_expand_state (view, &child); + } while (gtk_tree_model_iter_next (view->priv->model, &child)); + } + + gtk_tree_path_free (path); +} + +static void +uninstall_restore_signals (GeditFileBrowserView * tree_view, + GtkTreeModel * model) +{ + g_signal_handlers_disconnect_by_func (model, + on_begin_refresh, + tree_view); + + g_signal_handlers_disconnect_by_func (model, + on_end_refresh, + tree_view); + + g_signal_handlers_disconnect_by_func (model, + on_unload, + tree_view); + + g_signal_handlers_disconnect_by_func (model, + on_row_inserted, + tree_view); +} + +static void +install_restore_signals (GeditFileBrowserView * tree_view, + GtkTreeModel * model) +{ + g_signal_connect (model, + "begin-refresh", + G_CALLBACK (on_begin_refresh), + tree_view); + + g_signal_connect (model, + "end-refresh", + G_CALLBACK (on_end_refresh), + tree_view); + + g_signal_connect (model, + "unload", + G_CALLBACK (on_unload), + tree_view); + + g_signal_connect_after (model, + "row-inserted", + G_CALLBACK (on_row_inserted), + tree_view); +} + +static void +set_restore_expand_state (GeditFileBrowserView * view, + gboolean state) +{ + if (state == view->priv->restore_expand_state) + return; + + if (view->priv->expand_state) + { + g_hash_table_destroy (view->priv->expand_state); + view->priv->expand_state = NULL; + } + + if (state) + { + view->priv->expand_state = g_hash_table_new_full (g_file_hash, + (GEqualFunc)g_file_equal, + g_object_unref, + NULL); + + if (view->priv->model && GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + { + fill_expand_state (view, NULL); + + install_restore_signals (view, view->priv->model); + } + } + else if (view->priv->model && GEDIT_IS_FILE_BROWSER_STORE (view->priv->model)) + { + uninstall_restore_signals (view, view->priv->model); + } + + view->priv->restore_expand_state = state; +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW (object); + + switch (prop_id) + { + case PROP_CLICK_POLICY: + g_value_set_enum (value, obj->priv->click_policy); + break; + case PROP_RESTORE_EXPAND_STATE: + g_value_set_boolean (value, obj->priv->restore_expand_state); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditFileBrowserView *obj = GEDIT_FILE_BROWSER_VIEW (object); + + switch (prop_id) + { + case PROP_CLICK_POLICY: + set_click_policy_property (obj, g_value_get_enum (value)); + break; + case PROP_RESTORE_EXPAND_STATE: + set_restore_expand_state (obj, g_value_get_boolean (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_file_browser_view_class_init (GeditFileBrowserViewClass * klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkTreeViewClass *tree_view_class = GTK_TREE_VIEW_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + object_class->finalize = gedit_file_browser_view_finalize; + object_class->get_property = get_property; + object_class->set_property = set_property; + + /* Event handlers */ + widget_class->motion_notify_event = motion_notify_event; + widget_class->enter_notify_event = enter_notify_event; + widget_class->leave_notify_event = leave_notify_event; + widget_class->button_press_event = button_press_event; + widget_class->button_release_event = button_release_event; + widget_class->drag_begin = drag_begin; + widget_class->key_press_event = key_press_event; + + /* Tree view handlers */ + tree_view_class->row_expanded = row_expanded; + tree_view_class->row_collapsed = row_collapsed; + + /* Default handlers */ + klass->directory_activated = directory_activated; + + g_object_class_install_property (object_class, PROP_CLICK_POLICY, + g_param_spec_enum ("click-policy", + "Click Policy", + "The click policy", + GEDIT_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY, + GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, PROP_RESTORE_EXPAND_STATE, + g_param_spec_boolean ("restore-expand-state", + "Restore Expand State", + "Restore expanded state of loaded directories", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + + signals[ERROR] = + g_signal_new ("error", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserViewClass, + error), NULL, NULL, + gedit_file_browser_marshal_VOID__UINT_STRING, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); + signals[FILE_ACTIVATED] = + g_signal_new ("file-activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserViewClass, + file_activated), NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); + signals[DIRECTORY_ACTIVATED] = + g_signal_new ("directory-activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserViewClass, + directory_activated), NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); + signals[BOOKMARK_ACTIVATED] = + g_signal_new ("bookmark-activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserViewClass, + bookmark_activated), NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER); + + g_type_class_add_private (object_class, + sizeof (GeditFileBrowserViewPrivate)); +} + +static void +cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell, + GtkTreeModel * tree_model, GtkTreeIter * iter, + GeditFileBrowserView * obj) +{ + GtkTreePath *path; + PangoUnderline underline = PANGO_UNDERLINE_NONE; + gboolean editable = FALSE; + + path = gtk_tree_model_get_path (tree_model, iter); + + if (obj->priv->click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) { + if (obj->priv->hover_path != NULL && + gtk_tree_path_compare (path, obj->priv->hover_path) == 0) + underline = PANGO_UNDERLINE_SINGLE; + } + + if (GEDIT_IS_FILE_BROWSER_STORE (tree_model)) + { + if (obj->priv->editable != NULL && + gtk_tree_row_reference_valid (obj->priv->editable)) + { + GtkTreePath *edpath = gtk_tree_row_reference_get_path (obj->priv->editable); + + editable = edpath && gtk_tree_path_compare (path, edpath) == 0; + } + } + + gtk_tree_path_free (path); + g_object_set (cell, "editable", editable, "underline", underline, NULL); +} + +static void +gedit_file_browser_view_init (GeditFileBrowserView * obj) +{ + obj->priv = GEDIT_FILE_BROWSER_VIEW_GET_PRIVATE (obj); + + obj->priv->column = gtk_tree_view_column_new (); + + obj->priv->pixbuf_renderer = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_column_pack_start (obj->priv->column, + obj->priv->pixbuf_renderer, + FALSE); + gtk_tree_view_column_add_attribute (obj->priv->column, + obj->priv->pixbuf_renderer, + "pixbuf", + GEDIT_FILE_BROWSER_STORE_COLUMN_ICON); + + obj->priv->text_renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_column_pack_start (obj->priv->column, + obj->priv->text_renderer, TRUE); + gtk_tree_view_column_add_attribute (obj->priv->column, + obj->priv->text_renderer, + "text", + GEDIT_FILE_BROWSER_STORE_COLUMN_NAME); + + g_signal_connect (obj->priv->text_renderer, "edited", + G_CALLBACK (on_cell_edited), obj); + + gtk_tree_view_append_column (GTK_TREE_VIEW (obj), + obj->priv->column); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (obj), FALSE); + + gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (obj), + GDK_BUTTON1_MASK, + drag_source_targets, + G_N_ELEMENTS (drag_source_targets), + GDK_ACTION_COPY); + + obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH); +} + +static gboolean +bookmarks_separator_func (GtkTreeModel * model, GtkTreeIter * iter, + gpointer user_data) +{ + guint flags; + + gtk_tree_model_get (model, iter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + &flags, -1); + + return (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_SEPARATOR); +} + +/* Public */ +GtkWidget * +gedit_file_browser_view_new (void) +{ + GeditFileBrowserView *obj = + GEDIT_FILE_BROWSER_VIEW (g_object_new + (GEDIT_TYPE_FILE_BROWSER_VIEW, NULL)); + + return GTK_WIDGET (obj); +} + +void +gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view, + GtkTreeModel * model) +{ + GtkTreeSelection *selection; + + if (tree_view->priv->model == model) + return; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); + + if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); + gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW + (tree_view), + bookmarks_separator_func, + NULL, NULL); + gtk_tree_view_column_set_cell_data_func (tree_view->priv-> + column, + tree_view->priv-> + text_renderer, + (GtkTreeCellDataFunc) + cell_data_cb, + tree_view, NULL); + } else { + gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); + gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW + (tree_view), NULL, + NULL, NULL); + gtk_tree_view_column_set_cell_data_func (tree_view->priv-> + column, + tree_view->priv-> + text_renderer, + (GtkTreeCellDataFunc) + cell_data_cb, + tree_view, NULL); + + if (tree_view->priv->restore_expand_state) + install_restore_signals (tree_view, model); + + } + + if (tree_view->priv->hover_path != NULL) { + gtk_tree_path_free (tree_view->priv->hover_path); + tree_view->priv->hover_path = NULL; + } + + if (GEDIT_IS_FILE_BROWSER_STORE (tree_view->priv->model)) { + if (tree_view->priv->restore_expand_state) + uninstall_restore_signals (tree_view, + tree_view->priv->model); + } + + tree_view->priv->model = model; + gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model); +} + +void +gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view, + GtkTreeIter * iter) +{ + guint flags; + GtkTreeRowReference *rowref; + GtkTreePath *path; + + g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view)); + g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE + (tree_view->priv->model)); + g_return_if_fail (iter != NULL); + + gtk_tree_model_get (tree_view->priv->model, iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!(FILE_IS_DIR (flags) || !FILE_IS_DUMMY (flags))) + return; + + path = gtk_tree_model_get_path (tree_view->priv->model, iter); + rowref = gtk_tree_row_reference_new (tree_view->priv->model, path); + + /* Start editing */ + gtk_widget_grab_focus (GTK_WIDGET (tree_view)); + + if (gtk_tree_path_up (path)) + gtk_tree_view_expand_to_path (GTK_TREE_VIEW (tree_view), + path); + + gtk_tree_path_free (path); + tree_view->priv->editable = rowref; + + gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), + gtk_tree_row_reference_get_path (tree_view->priv->editable), + tree_view->priv->column, TRUE); + + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree_view), + gtk_tree_row_reference_get_path (tree_view->priv->editable), + tree_view->priv->column, + FALSE, 0.0, 0.0); +} + +void +gedit_file_browser_view_set_click_policy (GeditFileBrowserView *tree_view, + GeditFileBrowserViewClickPolicy policy) +{ + g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view)); + + set_click_policy_property (tree_view, policy); + + g_object_notify (G_OBJECT (tree_view), "click-policy"); +} + +void +gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_view, + gboolean restore_expand_state) +{ + g_return_if_fail (GEDIT_IS_FILE_BROWSER_VIEW (tree_view)); + + set_restore_expand_state (tree_view, restore_expand_state); + g_object_notify (G_OBJECT (tree_view), "restore-expand-state"); +} + +/* Signal handlers */ +static void +on_cell_edited (GtkCellRendererText * cell, gchar * path, gchar * new_text, + GeditFileBrowserView * tree_view) +{ + GtkTreePath * treepath; + GtkTreeIter iter; + gboolean ret; + GError * error = NULL; + + gtk_tree_row_reference_free (tree_view->priv->editable); + tree_view->priv->editable = NULL; + + if (new_text == NULL || *new_text == '\0') + return; + + treepath = gtk_tree_path_new_from_string (path); + ret = gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_view->priv->model), &iter, treepath); + gtk_tree_path_free (treepath); + + if (ret) { + if (gedit_file_browser_store_rename (GEDIT_FILE_BROWSER_STORE (tree_view->priv->model), + &iter, new_text, &error)) { + treepath = gtk_tree_model_get_path (GTK_TREE_MODEL (tree_view->priv->model), &iter); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree_view), + treepath, NULL, + FALSE, 0.0, 0.0); + gtk_tree_path_free (treepath); + } + else { + if (error) { + g_signal_emit (tree_view, signals[ERROR], 0, + error->code, error->message); + g_error_free (error); + } + } + } +} + +static void +on_begin_refresh (GeditFileBrowserStore * model, + GeditFileBrowserView * view) +{ + /* Store the refresh state, so we can handle unloading of nodes while + refreshing properly */ + view->priv->is_refresh = TRUE; +} + +static void +on_end_refresh (GeditFileBrowserStore * model, + GeditFileBrowserView * view) +{ + /* Store the refresh state, so we can handle unloading of nodes while + refreshing properly */ + view->priv->is_refresh = FALSE; +} + +static void +on_unload (GeditFileBrowserStore * model, + gchar const * uri, + GeditFileBrowserView * view) +{ + /* Don't remove the expand state if we are refreshing */ + if (!view->priv->restore_expand_state || view->priv->is_refresh) + return; + + remove_expand_state (view, uri); +} + +static void +restore_expand_state (GeditFileBrowserView * view, + GeditFileBrowserStore * model, + GtkTreeIter * iter) +{ + gchar * uri; + GFile * file; + GtkTreePath * path; + + gtk_tree_model_get (GTK_TREE_MODEL (model), + iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + &uri, + -1); + + if (!uri) + return; + + file = g_file_new_for_uri (uri); + path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), iter); + + if (g_hash_table_lookup (view->priv->expand_state, file)) + { + gtk_tree_view_expand_row (GTK_TREE_VIEW (view), + path, + FALSE); + } + + gtk_tree_path_free (path); + + g_object_unref (file); + g_free (uri); +} + +static void +on_row_inserted (GeditFileBrowserStore * model, + GtkTreePath * path, + GtkTreeIter * iter, + GeditFileBrowserView * view) +{ + GtkTreeIter parent; + GtkTreePath * copy; + + if (gtk_tree_model_iter_has_child (GTK_TREE_MODEL (model), iter)) + restore_expand_state (view, model, iter); + + copy = gtk_tree_path_copy (path); + + if (gtk_tree_path_up (copy) && + (gtk_tree_path_get_depth (copy) != 0) && + gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &parent, copy)) + { + restore_expand_state (view, model, &parent); + } + + gtk_tree_path_free (copy); +} + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-view.h b/plugins/filebrowser/gedit-file-browser-view.h new file mode 100755 index 00000000..a5ada255 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-view.h @@ -0,0 +1,84 @@ +/* + * gedit-file-browser-view.h - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 __GEDIT_FILE_BROWSER_VIEW_H__ +#define __GEDIT_FILE_BROWSER_VIEW_H__ + +#include + +G_BEGIN_DECLS +#define GEDIT_TYPE_FILE_BROWSER_VIEW (gedit_file_browser_view_get_type ()) +#define GEDIT_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserView)) +#define GEDIT_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserView const)) +#define GEDIT_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewClass)) +#define GEDIT_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW)) +#define GEDIT_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_VIEW)) +#define GEDIT_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_VIEW, GeditFileBrowserViewClass)) + +typedef struct _GeditFileBrowserView GeditFileBrowserView; +typedef struct _GeditFileBrowserViewClass GeditFileBrowserViewClass; +typedef struct _GeditFileBrowserViewPrivate GeditFileBrowserViewPrivate; + +typedef enum { + GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE, + GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE +} GeditFileBrowserViewClickPolicy; + +struct _GeditFileBrowserView +{ + GtkTreeView parent; + + GeditFileBrowserViewPrivate *priv; +}; + +struct _GeditFileBrowserViewClass +{ + GtkTreeViewClass parent_class; + + /* Signals */ + void (*error) (GeditFileBrowserView * filetree, + guint code, + gchar const *message); + void (*file_activated) (GeditFileBrowserView * filetree, + GtkTreeIter *iter); + void (*directory_activated) (GeditFileBrowserView * filetree, + GtkTreeIter *iter); + void (*bookmark_activated) (GeditFileBrowserView * filetree, + GtkTreeIter *iter); +}; + +GType gedit_file_browser_view_get_type (void) G_GNUC_CONST; +GType gedit_file_browser_view_register_type (GTypeModule * module); + +GtkWidget *gedit_file_browser_view_new (void); +void gedit_file_browser_view_set_model (GeditFileBrowserView * tree_view, + GtkTreeModel * model); +void gedit_file_browser_view_start_rename (GeditFileBrowserView * tree_view, + GtkTreeIter * iter); +void gedit_file_browser_view_set_click_policy (GeditFileBrowserView * tree_view, + GeditFileBrowserViewClickPolicy policy); +void gedit_file_browser_view_set_restore_expand_state (GeditFileBrowserView * tree_view, + gboolean restore_expand_state); + +G_END_DECLS +#endif /* __GEDIT_FILE_BROWSER_VIEW_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-widget-ui.xml b/plugins/filebrowser/gedit-file-browser-widget-ui.xml new file mode 100755 index 00000000..472fd185 --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-widget-ui.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/filebrowser/gedit-file-browser-widget.c b/plugins/filebrowser/gedit-file-browser-widget.c new file mode 100755 index 00000000..e8a73cce --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-widget.c @@ -0,0 +1,3143 @@ +/* + * gedit-file-browser-widget.c - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gedit-file-browser-utils.h" +#include "gedit-file-browser-error.h" +#include "gedit-file-browser-widget.h" +#include "gedit-file-browser-view.h" +#include "gedit-file-browser-store.h" +#include "gedit-file-bookmarks-store.h" +#include "gedit-file-browser-marshal.h" +#include "gedit-file-browser-enum-types.h" + +#define GEDIT_FILE_BROWSER_WIDGET_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \ + GEDIT_TYPE_FILE_BROWSER_WIDGET, \ + GeditFileBrowserWidgetPrivate)) + +#define XML_UI_FILE "gedit-file-browser-widget-ui.xml" +#define LOCATION_DATA_KEY "gedit-file-browser-widget-location" + +enum +{ + BOOKMARKS_ID, + SEPARATOR_CUSTOM_ID, + SEPARATOR_ID, + PATH_ID, + NUM_DEFAULT_IDS +}; + +enum +{ + COLUMN_INDENT, + COLUMN_ICON, + COLUMN_NAME, + COLUMN_FILE, + COLUMN_ID, + N_COLUMNS +}; + +/* Properties */ +enum +{ + PROP_0, + + PROP_FILTER_PATTERN, + PROP_ENABLE_DELETE +}; + +/* Signals */ +enum +{ + URI_ACTIVATED, + ERROR, + CONFIRM_DELETE, + CONFIRM_NO_TRASH, + NUM_SIGNALS +}; + +static guint signals[NUM_SIGNALS] = { 0 }; + +typedef struct _SignalNode +{ + GObject *object; + gulong id; +} SignalNode; + +typedef struct +{ + gulong id; + GeditFileBrowserWidgetFilterFunc func; + gpointer user_data; + GDestroyNotify destroy_notify; +} FilterFunc; + +typedef struct +{ + GFile *root; + GFile *virtual_root; +} Location; + +typedef struct +{ + gchar *name; + GdkPixbuf *icon; +} NameIcon; + +struct _GeditFileBrowserWidgetPrivate +{ + GeditFileBrowserView *treeview; + GeditFileBrowserStore *file_store; + GeditFileBookmarksStore *bookmarks_store; + + GHashTable *bookmarks_hash; + + GtkWidget *combo; + GtkTreeStore *combo_model; + + GtkWidget *filter_expander; + GtkWidget *filter_entry; + + GtkUIManager *manager; + GtkActionGroup *action_group; + GtkActionGroup *action_group_selection; + GtkActionGroup *action_group_file_selection; + GtkActionGroup *action_group_single_selection; + GtkActionGroup *action_group_single_most_selection; + GtkActionGroup *action_group_sensitive; + GtkActionGroup *bookmark_action_group; + + GSList *signal_pool; + + GSList *filter_funcs; + gulong filter_id; + gulong glob_filter_id; + GPatternSpec *filter_pattern; + gchar *filter_pattern_str; + + GList *locations; + GList *current_location; + gboolean changing_location; + GtkWidget *location_previous_menu; + GtkWidget *location_next_menu; + GtkWidget *current_location_menu_item; + + gboolean enable_delete; + + GCancellable *cancellable; + + GdkCursor *busy_cursor; +}; + +static void set_enable_delete (GeditFileBrowserWidget *obj, + gboolean enable); +static void on_model_set (GObject * gobject, + GParamSpec * arg1, + GeditFileBrowserWidget * obj); +static void on_treeview_error (GeditFileBrowserView * tree_view, + guint code, + gchar * message, + GeditFileBrowserWidget * obj); +static void on_file_store_error (GeditFileBrowserStore * store, + guint code, + gchar * message, + GeditFileBrowserWidget * obj); +static gboolean on_file_store_no_trash (GeditFileBrowserStore * store, + GList * files, + GeditFileBrowserWidget * obj); +static void on_combo_changed (GtkComboBox * combo, + GeditFileBrowserWidget * obj); +static gboolean on_treeview_popup_menu (GeditFileBrowserView * treeview, + GeditFileBrowserWidget * obj); +static gboolean on_treeview_button_press_event (GeditFileBrowserView * treeview, + GdkEventButton * event, + GeditFileBrowserWidget * obj); +static gboolean on_treeview_key_press_event (GeditFileBrowserView * treeview, + GdkEventKey * event, + GeditFileBrowserWidget * obj); +static void on_selection_changed (GtkTreeSelection * selection, + GeditFileBrowserWidget * obj); + +static void on_virtual_root_changed (GeditFileBrowserStore * model, + GParamSpec *param, + GeditFileBrowserWidget * obj); + +static gboolean on_entry_filter_activate (GeditFileBrowserWidget * obj); +static void on_location_jump_activate (GtkMenuItem * item, + GeditFileBrowserWidget * obj); +static void on_bookmarks_row_changed (GtkTreeModel * model, + GtkTreePath * path, + GtkTreeIter * iter, + GeditFileBrowserWidget * obj); +static void on_bookmarks_row_deleted (GtkTreeModel * model, + GtkTreePath * path, + GeditFileBrowserWidget * obj); +static void on_filter_mode_changed (GeditFileBrowserStore * model, + GParamSpec * param, + GeditFileBrowserWidget * obj); +static void on_action_directory_previous (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_directory_next (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_directory_up (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_directory_new (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_file_open (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_file_new (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_file_rename (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_file_delete (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_file_move_to_trash (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_directory_refresh (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_directory_open (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_filter_hidden (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_filter_binary (GtkAction * action, + GeditFileBrowserWidget * obj); +static void on_action_bookmark_open (GtkAction * action, + GeditFileBrowserWidget * obj); + +GEDIT_PLUGIN_DEFINE_TYPE (GeditFileBrowserWidget, gedit_file_browser_widget, + GTK_TYPE_VBOX) + +static void +free_name_icon (gpointer data) +{ + NameIcon * item; + + if (data == NULL) + return; + + item = (NameIcon *)(data); + + g_free (item->name); + + if (item->icon) + g_object_unref (item->icon); + + g_free (item); +} + +static FilterFunc * +filter_func_new (GeditFileBrowserWidget * obj, + GeditFileBrowserWidgetFilterFunc func, + gpointer user_data, + GDestroyNotify notify) +{ + FilterFunc *result; + + result = g_new (FilterFunc, 1); + + result->id = ++obj->priv->filter_id; + result->func = func; + result->user_data = user_data; + result->destroy_notify = notify; + return result; +} + +static void +location_free (Location * loc) +{ + if (loc->root) + g_object_unref (loc->root); + + if (loc->virtual_root) + g_object_unref (loc->virtual_root); + + g_free (loc); +} + +static gboolean +combo_find_by_id (GeditFileBrowserWidget * obj, guint id, + GtkTreeIter * iter) +{ + guint checkid; + GtkTreeModel *model = GTK_TREE_MODEL (obj->priv->combo_model); + + if (iter == NULL) + return FALSE; + + if (gtk_tree_model_get_iter_first (model, iter)) { + do { + gtk_tree_model_get (model, iter, COLUMN_ID, + &checkid, -1); + + if (checkid == id) + return TRUE; + } while (gtk_tree_model_iter_next (model, iter)); + } + + return FALSE; +} + +static void +remove_path_items (GeditFileBrowserWidget * obj) +{ + GtkTreeIter iter; + + while (combo_find_by_id (obj, PATH_ID, &iter)) + gtk_tree_store_remove (obj->priv->combo_model, &iter); +} + +static void +cancel_async_operation (GeditFileBrowserWidget *widget) +{ + if (!widget->priv->cancellable) + return; + + g_cancellable_cancel (widget->priv->cancellable); + g_object_unref (widget->priv->cancellable); + + widget->priv->cancellable = NULL; +} + +static void +gedit_file_browser_widget_finalize (GObject * object) +{ + GeditFileBrowserWidget *obj = GEDIT_FILE_BROWSER_WIDGET (object); + GList *loc; + + remove_path_items (obj); + gedit_file_browser_store_set_filter_func (obj->priv->file_store, + NULL, NULL); + + g_object_unref (obj->priv->manager); + g_object_unref (obj->priv->file_store); + g_object_unref (obj->priv->bookmarks_store); + g_object_unref (obj->priv->combo_model); + + g_slist_foreach (obj->priv->filter_funcs, (GFunc) g_free, NULL); + g_slist_free (obj->priv->filter_funcs); + + for (loc = obj->priv->locations; loc; loc = loc->next) + location_free ((Location *) (loc->data)); + + if (obj->priv->current_location_menu_item) + g_object_unref (obj->priv->current_location_menu_item); + + g_list_free (obj->priv->locations); + + g_hash_table_destroy (obj->priv->bookmarks_hash); + + cancel_async_operation (obj); + + gdk_cursor_unref (obj->priv->busy_cursor); + + G_OBJECT_CLASS (gedit_file_browser_widget_parent_class)->finalize (object); +} + +static void +gedit_file_browser_widget_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GeditFileBrowserWidget *obj = GEDIT_FILE_BROWSER_WIDGET (object); + + switch (prop_id) + { + case PROP_FILTER_PATTERN: + g_value_set_string (value, obj->priv->filter_pattern_str); + break; + case PROP_ENABLE_DELETE: + g_value_set_boolean (value, obj->priv->enable_delete); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_file_browser_widget_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GeditFileBrowserWidget *obj = GEDIT_FILE_BROWSER_WIDGET (object); + + switch (prop_id) + { + case PROP_FILTER_PATTERN: + gedit_file_browser_widget_set_filter_pattern (obj, + g_value_get_string (value)); + break; + case PROP_ENABLE_DELETE: + set_enable_delete (obj, g_value_get_boolean (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gedit_file_browser_widget_class_init (GeditFileBrowserWidgetClass * klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gedit_file_browser_widget_finalize; + + object_class->get_property = gedit_file_browser_widget_get_property; + object_class->set_property = gedit_file_browser_widget_set_property; + + g_object_class_install_property (object_class, PROP_FILTER_PATTERN, + g_param_spec_string ("filter-pattern", + "Filter Pattern", + "The filter pattern", + NULL, + G_PARAM_READWRITE)); + g_object_class_install_property (object_class, PROP_ENABLE_DELETE, + g_param_spec_boolean ("enable-delete", + "Enable delete", + "Enable permanently deleting items", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); + + signals[URI_ACTIVATED] = + g_signal_new ("uri-activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + uri_activated), NULL, NULL, + g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, + G_TYPE_STRING); + signals[ERROR] = + g_signal_new ("error", G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + error), NULL, NULL, + gedit_file_browser_marshal_VOID__UINT_STRING, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); + + signals[CONFIRM_DELETE] = + g_signal_new ("confirm-delete", G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + confirm_delete), + g_signal_accumulator_true_handled, + NULL, + gedit_file_browser_marshal_BOOL__OBJECT_POINTER, + G_TYPE_BOOLEAN, + 2, + G_TYPE_OBJECT, + G_TYPE_POINTER); + + signals[CONFIRM_NO_TRASH] = + g_signal_new ("confirm-no-trash", G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GeditFileBrowserWidgetClass, + confirm_no_trash), + g_signal_accumulator_true_handled, + NULL, + gedit_file_browser_marshal_BOOL__POINTER, + G_TYPE_BOOLEAN, + 1, + G_TYPE_POINTER); + + g_type_class_add_private (object_class, + sizeof (GeditFileBrowserWidgetPrivate)); +} + +static void +add_signal (GeditFileBrowserWidget * obj, gpointer object, gulong id) +{ + SignalNode *node = g_new (SignalNode, 1); + + node->object = G_OBJECT (object); + node->id = id; + + obj->priv->signal_pool = + g_slist_prepend (obj->priv->signal_pool, node); +} + +static void +clear_signals (GeditFileBrowserWidget * obj) +{ + GSList *item; + SignalNode *node; + + for (item = obj->priv->signal_pool; item; item = item->next) { + node = (SignalNode *) (item->data); + + g_signal_handler_disconnect (node->object, node->id); + g_free (item->data); + } + + g_slist_free (obj->priv->signal_pool); + obj->priv->signal_pool = NULL; +} + +static gboolean +separator_func (GtkTreeModel * model, GtkTreeIter * iter, gpointer data) +{ + guint id; + + gtk_tree_model_get (model, iter, COLUMN_ID, &id, -1); + + return (id == SEPARATOR_ID); +} + +static gboolean +get_from_bookmark_file (GeditFileBrowserWidget * obj, GFile * file, + gchar ** name, GdkPixbuf ** icon) +{ + gpointer data; + NameIcon * item; + + data = g_hash_table_lookup (obj->priv->bookmarks_hash, file); + + if (data == NULL) + return FALSE; + + item = (NameIcon *)data; + + *name = g_strdup (item->name); + *icon = item->icon; + + if (item->icon != NULL) + { + g_object_ref (item->icon); + } + + return TRUE; +} + +static void +insert_path_item (GeditFileBrowserWidget * obj, + GFile * file, + GtkTreeIter * after, + GtkTreeIter * iter, + guint indent) +{ + gchar * unescape; + GdkPixbuf * icon = NULL; + + /* Try to get the icon and name from the bookmarks hash */ + if (!get_from_bookmark_file (obj, file, &unescape, &icon)) { + /* It's not a bookmark, fetch the name and the icon ourselves */ + unescape = gedit_file_browser_utils_file_basename (file); + + /* Get the icon */ + icon = gedit_file_browser_utils_pixbuf_from_file (file, GTK_ICON_SIZE_MENU); + } + + gtk_tree_store_insert_after (obj->priv->combo_model, iter, NULL, + after); + + gtk_tree_store_set (obj->priv->combo_model, + iter, + COLUMN_INDENT, indent, + COLUMN_ICON, icon, + COLUMN_NAME, unescape, + COLUMN_FILE, file, + COLUMN_ID, PATH_ID, + -1); + + if (icon) + g_object_unref (icon); + + g_free (unescape); +} + +static void +insert_separator_item (GeditFileBrowserWidget * obj) +{ + GtkTreeIter iter; + + gtk_tree_store_insert (obj->priv->combo_model, &iter, NULL, 1); + gtk_tree_store_set (obj->priv->combo_model, &iter, + COLUMN_ICON, NULL, + COLUMN_NAME, NULL, + COLUMN_ID, SEPARATOR_ID, -1); +} + +static void +combo_set_active_by_id (GeditFileBrowserWidget * obj, guint id) +{ + GtkTreeIter iter; + + if (combo_find_by_id (obj, id, &iter)) + gtk_combo_box_set_active_iter (GTK_COMBO_BOX + (obj->priv->combo), &iter); +} + +static guint +uri_num_parents (GFile * from, GFile * to) +{ + /* Determine the number of 'levels' to get from #from to #to. */ + guint parents = 0; + GFile * parent; + + if (from == NULL) + return 0; + + g_object_ref (from); + + while ((parent = g_file_get_parent (from)) && !(to && g_file_equal (from, to))) { + g_object_unref (from); + from = parent; + + ++parents; + } + + g_object_unref (from); + return parents; +} + +static void +insert_location_path (GeditFileBrowserWidget * obj) +{ + Location *loc; + GFile *current = NULL; + GFile * tmp; + GtkTreeIter separator; + GtkTreeIter iter; + guint indent; + + if (!obj->priv->current_location) { + g_message ("insert_location_path: no current location"); + return; + } + + loc = (Location *) (obj->priv->current_location->data); + + current = loc->virtual_root; + combo_find_by_id (obj, SEPARATOR_ID, &separator); + + indent = uri_num_parents (loc->virtual_root, loc->root); + + while (current != NULL) { + insert_path_item (obj, current, &separator, &iter, indent--); + + if (current == loc->virtual_root) { + g_signal_handlers_block_by_func (obj->priv->combo, + on_combo_changed, + obj); + gtk_combo_box_set_active_iter (GTK_COMBO_BOX + (obj->priv->combo), + &iter); + g_signal_handlers_unblock_by_func (obj->priv-> + combo, + on_combo_changed, + obj); + } + + if (g_file_equal (current, loc->root) || !gedit_utils_file_has_parent (current)) { + if (current != loc->virtual_root) + g_object_unref (current); + break; + } + + tmp = g_file_get_parent (current); + + if (current != loc->virtual_root) + g_object_unref (current); + + current = tmp; + } +} + +static void +check_current_item (GeditFileBrowserWidget * obj, gboolean show_path) +{ + GtkTreeIter separator; + gboolean has_sep; + + remove_path_items (obj); + has_sep = combo_find_by_id (obj, SEPARATOR_ID, &separator); + + if (show_path) { + if (!has_sep) + insert_separator_item (obj); + + insert_location_path (obj); + } else if (has_sep) + gtk_tree_store_remove (obj->priv->combo_model, &separator); +} + +static void +fill_combo_model (GeditFileBrowserWidget * obj) +{ + GtkTreeStore *store = obj->priv->combo_model; + GtkTreeIter iter; + GdkPixbuf *icon; + + icon = gedit_file_browser_utils_pixbuf_from_theme (GTK_STOCK_HOME, GTK_ICON_SIZE_MENU); + + gtk_tree_store_append (store, &iter, NULL); + gtk_tree_store_set (store, &iter, + COLUMN_ICON, icon, + COLUMN_NAME, _("Bookmarks"), + COLUMN_ID, BOOKMARKS_ID, -1); + g_object_unref (icon); + + gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (obj->priv->combo), + separator_func, obj, NULL); + gtk_combo_box_set_active (GTK_COMBO_BOX (obj->priv->combo), 0); +} + +static void +indent_cell_data_func (GtkCellLayout * cell_layout, + GtkCellRenderer * cell, + GtkTreeModel * model, + GtkTreeIter * iter, + gpointer data) +{ + gchar * indent; + guint num; + + gtk_tree_model_get (model, iter, COLUMN_INDENT, &num, -1); + + if (num == 0) + g_object_set (cell, "text", "", NULL); + else { + indent = g_strnfill (num * 2, ' '); + + g_object_set (cell, "text", indent, NULL); + g_free (indent); + } +} + +static void +create_combo (GeditFileBrowserWidget * obj) +{ + GtkCellRenderer *renderer; + + obj->priv->combo_model = gtk_tree_store_new (N_COLUMNS, + G_TYPE_UINT, + GDK_TYPE_PIXBUF, + G_TYPE_STRING, + G_TYPE_FILE, + G_TYPE_UINT); + obj->priv->combo = + gtk_combo_box_new_with_model (GTK_TREE_MODEL + (obj->priv->combo_model)); + + renderer = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (obj->priv->combo), + renderer, FALSE); + gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT + (obj->priv->combo), renderer, + indent_cell_data_func, obj, NULL); + + + renderer = gtk_cell_renderer_pixbuf_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (obj->priv->combo), + renderer, FALSE); + gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (obj->priv->combo), + renderer, "pixbuf", COLUMN_ICON); + + renderer = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (obj->priv->combo), + renderer, TRUE); + gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (obj->priv->combo), + renderer, "text", COLUMN_NAME); + + g_object_set (renderer, "ellipsize-set", TRUE, + "ellipsize", PANGO_ELLIPSIZE_END, NULL); + + gtk_box_pack_start (GTK_BOX (obj), GTK_WIDGET (obj->priv->combo), + FALSE, FALSE, 0); + + fill_combo_model (obj); + g_signal_connect (obj->priv->combo, "changed", + G_CALLBACK (on_combo_changed), obj); + + gtk_widget_show (obj->priv->combo); +} + +static GtkActionEntry toplevel_actions[] = +{ + {"FilterMenuAction", NULL, N_("_Filter")} +}; + +static const GtkActionEntry tree_actions_selection[] = +{ + {"FileMoveToTrash", "mate-stock-trash", N_("_Move to Trash"), NULL, + N_("Move selected file or folder to trash"), + G_CALLBACK (on_action_file_move_to_trash)}, + {"FileDelete", GTK_STOCK_DELETE, N_("_Delete"), NULL, + N_("Delete selected file or folder"), + G_CALLBACK (on_action_file_delete)} +}; + +static const GtkActionEntry tree_actions_file_selection[] = +{ + {"FileOpen", GTK_STOCK_OPEN, NULL, NULL, + N_("Open selected file"), + G_CALLBACK (on_action_file_open)} +}; + +static const GtkActionEntry tree_actions[] = +{ + {"DirectoryUp", GTK_STOCK_GO_UP, N_("Up"), NULL, + N_("Open the parent folder"), G_CALLBACK (on_action_directory_up)} +}; + +static const GtkActionEntry tree_actions_single_most_selection[] = +{ + {"DirectoryNew", GTK_STOCK_ADD, N_("_New Folder"), NULL, + N_("Add new empty folder"), + G_CALLBACK (on_action_directory_new)}, + {"FileNew", GTK_STOCK_NEW, N_("New F_ile"), NULL, + N_("Add new empty file"), G_CALLBACK (on_action_file_new)} +}; + +static const GtkActionEntry tree_actions_single_selection[] = +{ + {"FileRename", NULL, N_("_Rename"), NULL, + N_("Rename selected file or folder"), + G_CALLBACK (on_action_file_rename)} +}; + +static const GtkActionEntry tree_actions_sensitive[] = +{ + {"DirectoryPrevious", GTK_STOCK_GO_BACK, N_("_Previous Location"), + NULL, + N_("Go to the previous visited location"), + G_CALLBACK (on_action_directory_previous)}, + {"DirectoryNext", GTK_STOCK_GO_FORWARD, N_("_Next Location"), NULL, + N_("Go to the next visited location"), G_CALLBACK (on_action_directory_next)}, + {"DirectoryRefresh", GTK_STOCK_REFRESH, N_("Re_fresh View"), NULL, + N_("Refresh the view"), G_CALLBACK (on_action_directory_refresh)}, + {"DirectoryOpen", GTK_STOCK_OPEN, N_("_View Folder"), NULL, + N_("View folder in file manager"), + G_CALLBACK (on_action_directory_open)} +}; + +static const GtkToggleActionEntry tree_actions_toggle[] = +{ + {"FilterHidden", GTK_STOCK_DIALOG_AUTHENTICATION, + N_("Show _Hidden"), NULL, + N_("Show hidden files and folders"), + G_CALLBACK (on_action_filter_hidden), FALSE}, + {"FilterBinary", NULL, N_("Show _Binary"), NULL, + N_("Show binary files"), G_CALLBACK (on_action_filter_binary), + FALSE} +}; + +static const GtkActionEntry bookmark_actions[] = +{ + {"BookmarkOpen", GTK_STOCK_OPEN, N_("_View Folder"), NULL, + N_("View folder in file manager"), G_CALLBACK (on_action_bookmark_open)} +}; + +static void +create_toolbar (GeditFileBrowserWidget * obj, + const gchar *data_dir) +{ + GtkUIManager *manager; + GError *error = NULL; + GtkActionGroup *action_group; + GtkWidget *toolbar; + GtkWidget *widget; + GtkAction *action; + gchar *ui_file; + + manager = gtk_ui_manager_new (); + obj->priv->manager = manager; + + ui_file = g_build_filename (data_dir, XML_UI_FILE, NULL); + gtk_ui_manager_add_ui_from_file (manager, ui_file, &error); + + g_free (ui_file); + + if (error != NULL) { + g_warning ("Error in adding ui from file %s: %s", + XML_UI_FILE, error->message); + g_error_free (error); + return; + } + + action_group = gtk_action_group_new ("FileBrowserWidgetActionGroupToplevel"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + toplevel_actions, + G_N_ELEMENTS (toplevel_actions), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + + action_group = gtk_action_group_new ("FileBrowserWidgetActionGroup"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + tree_actions, + G_N_ELEMENTS (tree_actions), + obj); + gtk_action_group_add_toggle_actions (action_group, + tree_actions_toggle, + G_N_ELEMENTS (tree_actions_toggle), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + obj->priv->action_group = action_group; + + action_group = gtk_action_group_new ("FileBrowserWidgetSelectionActionGroup"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + tree_actions_selection, + G_N_ELEMENTS (tree_actions_selection), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + obj->priv->action_group_selection = action_group; + + action_group = gtk_action_group_new ("FileBrowserWidgetFileSelectionActionGroup"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + tree_actions_file_selection, + G_N_ELEMENTS (tree_actions_file_selection), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + obj->priv->action_group_file_selection = action_group; + + action_group = gtk_action_group_new ("FileBrowserWidgetSingleSelectionActionGroup"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + tree_actions_single_selection, + G_N_ELEMENTS (tree_actions_single_selection), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + obj->priv->action_group_single_selection = action_group; + + action_group = gtk_action_group_new ("FileBrowserWidgetSingleMostSelectionActionGroup"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + tree_actions_single_most_selection, + G_N_ELEMENTS (tree_actions_single_most_selection), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + obj->priv->action_group_single_most_selection = action_group; + + action_group = gtk_action_group_new ("FileBrowserWidgetSensitiveActionGroup"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + tree_actions_sensitive, + G_N_ELEMENTS (tree_actions_sensitive), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + obj->priv->action_group_sensitive = action_group; + + action_group = gtk_action_group_new ("FileBrowserWidgetBookmarkActionGroup"); + gtk_action_group_set_translation_domain (action_group, NULL); + gtk_action_group_add_actions (action_group, + bookmark_actions, + G_N_ELEMENTS (bookmark_actions), + obj); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + obj->priv->bookmark_action_group = action_group; + + action = gtk_action_group_get_action (obj->priv->action_group_sensitive, + "DirectoryPrevious"); + gtk_action_set_sensitive (action, FALSE); + + action = gtk_action_group_get_action (obj->priv->action_group_sensitive, + "DirectoryNext"); + gtk_action_set_sensitive (action, FALSE); + + toolbar = gtk_ui_manager_get_widget (manager, "/ToolBar"); + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS); + gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar), GTK_ICON_SIZE_MENU); + + /* Previous directory menu tool item */ + obj->priv->location_previous_menu = gtk_menu_new (); + gtk_widget_show (obj->priv->location_previous_menu); + + widget = GTK_WIDGET (gtk_menu_tool_button_new_from_stock (GTK_STOCK_GO_BACK)); + gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget), + obj->priv->location_previous_menu); + + g_object_set (widget, "label", _("Previous location"), NULL); + gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (widget), + _("Go to previous location")); + gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (widget), + _("Go to a previously opened location")); + + action = gtk_action_group_get_action (obj->priv->action_group_sensitive, + "DirectoryPrevious"); + g_object_set (action, "is_important", TRUE, "short_label", + _("Previous location"), NULL); + gtk_action_connect_proxy (action, widget); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget), 0); + + /* Next directory menu tool item */ + obj->priv->location_next_menu = gtk_menu_new (); + gtk_widget_show (obj->priv->location_next_menu); + + widget = GTK_WIDGET (gtk_menu_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD)); + gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget), + obj->priv->location_next_menu); + + g_object_set (widget, "label", _("Next location"), NULL); + gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (widget), + _("Go to next location")); + gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (widget), + _("Go to a previously opened location")); + + action = gtk_action_group_get_action (obj->priv->action_group_sensitive, + "DirectoryNext"); + g_object_set (action, "is_important", TRUE, "short_label", + _("Previous location"), NULL); + gtk_action_connect_proxy (action, widget); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget), 1); + + gtk_box_pack_start (GTK_BOX (obj), toolbar, FALSE, FALSE, 0); + gtk_widget_show (toolbar); + + set_enable_delete (obj, obj->priv->enable_delete); +} + +static void +set_enable_delete (GeditFileBrowserWidget *obj, + gboolean enable) +{ + GtkAction *action; + obj->priv->enable_delete = enable; + + if (obj->priv->action_group_selection == NULL) + return; + + action = + gtk_action_group_get_action (obj->priv->action_group_selection, + "FileDelete"); + + g_object_set (action, "visible", enable, "sensitive", enable, NULL); +} + +static gboolean +filter_real (GeditFileBrowserStore * model, GtkTreeIter * iter, + GeditFileBrowserWidget * obj) +{ + GSList *item; + FilterFunc *func; + + for (item = obj->priv->filter_funcs; item; item = item->next) { + func = (FilterFunc *) (item->data); + + if (!func->func (obj, model, iter, func->user_data)) + return FALSE; + } + + return TRUE; +} + +static void +add_bookmark_hash (GeditFileBrowserWidget * obj, + GtkTreeIter * iter) +{ + GtkTreeModel *model; + GdkPixbuf * pixbuf; + gchar * name; + gchar * uri; + GFile * file; + NameIcon * item; + + model = GTK_TREE_MODEL (obj->priv->bookmarks_store); + + uri = gedit_file_bookmarks_store_get_uri (obj->priv-> + bookmarks_store, + iter); + + if (uri == NULL) + return; + + file = g_file_new_for_uri (uri); + g_free (uri); + + gtk_tree_model_get (model, iter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_ICON, + &pixbuf, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_NAME, + &name, -1); + + item = g_new (NameIcon, 1); + item->name = name; + item->icon = pixbuf; + + g_hash_table_insert (obj->priv->bookmarks_hash, + file, + item); +} + +static void +init_bookmarks_hash (GeditFileBrowserWidget * obj) +{ + GtkTreeIter iter; + GtkTreeModel *model; + + model = GTK_TREE_MODEL (obj->priv->bookmarks_store); + + if (!gtk_tree_model_get_iter_first (model, &iter)) + return; + + do { + add_bookmark_hash (obj, &iter); + } while (gtk_tree_model_iter_next (model, &iter)); + + g_signal_connect (obj->priv->bookmarks_store, + "row-changed", + G_CALLBACK (on_bookmarks_row_changed), + obj); + + g_signal_connect (obj->priv->bookmarks_store, + "row-deleted", + G_CALLBACK (on_bookmarks_row_deleted), + obj); +} + +static void +on_begin_loading (GeditFileBrowserStore *model, + GtkTreeIter *iter, + GeditFileBrowserWidget *obj) +{ + if (!GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET (obj->priv->treeview)))) + return; + + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (obj)), + obj->priv->busy_cursor); +} + +static void +on_end_loading (GeditFileBrowserStore *model, + GtkTreeIter *iter, + GeditFileBrowserWidget *obj) +{ + if (!GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET (obj->priv->treeview)))) + return; + + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (obj)), NULL); +} + +static void +create_tree (GeditFileBrowserWidget * obj) +{ + GtkWidget *sw; + + obj->priv->file_store = gedit_file_browser_store_new (NULL); + obj->priv->bookmarks_store = gedit_file_bookmarks_store_new (); + obj->priv->treeview = + GEDIT_FILE_BROWSER_VIEW (gedit_file_browser_view_new ()); + + gedit_file_browser_view_set_restore_expand_state (obj->priv->treeview, TRUE); + + gedit_file_browser_store_set_filter_mode (obj->priv->file_store, + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN + | + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); + gedit_file_browser_store_set_filter_func (obj->priv->file_store, + (GeditFileBrowserStoreFilterFunc) + filter_real, obj); + + sw = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), + GTK_SHADOW_ETCHED_IN); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + gtk_container_add (GTK_CONTAINER (sw), + GTK_WIDGET (obj->priv->treeview)); + gtk_box_pack_start (GTK_BOX (obj), sw, TRUE, TRUE, 0); + + g_signal_connect (obj->priv->treeview, "notify::model", + G_CALLBACK (on_model_set), obj); + g_signal_connect (obj->priv->treeview, "error", + G_CALLBACK (on_treeview_error), obj); + g_signal_connect (obj->priv->treeview, "popup-menu", + G_CALLBACK (on_treeview_popup_menu), obj); + g_signal_connect (obj->priv->treeview, "button-press-event", + G_CALLBACK (on_treeview_button_press_event), + obj); + g_signal_connect (obj->priv->treeview, "key-press-event", + G_CALLBACK (on_treeview_key_press_event), obj); + + g_signal_connect (gtk_tree_view_get_selection + (GTK_TREE_VIEW (obj->priv->treeview)), "changed", + G_CALLBACK (on_selection_changed), obj); + g_signal_connect (obj->priv->file_store, "notify::filter-mode", + G_CALLBACK (on_filter_mode_changed), obj); + + g_signal_connect (obj->priv->file_store, "notify::virtual-root", + G_CALLBACK (on_virtual_root_changed), obj); + + g_signal_connect (obj->priv->file_store, "begin-loading", + G_CALLBACK (on_begin_loading), obj); + + g_signal_connect (obj->priv->file_store, "end-loading", + G_CALLBACK (on_end_loading), obj); + + g_signal_connect (obj->priv->file_store, "error", + G_CALLBACK (on_file_store_error), obj); + + init_bookmarks_hash (obj); + + gtk_widget_show (sw); + gtk_widget_show (GTK_WIDGET (obj->priv->treeview)); +} + +static void +create_filter (GeditFileBrowserWidget * obj) +{ + GtkWidget *expander; + GtkWidget *vbox; + GtkWidget *entry; + + expander = gtk_expander_new_with_mnemonic (_("_Match Filename")); + gtk_widget_show (expander); + gtk_box_pack_start (GTK_BOX (obj), expander, FALSE, FALSE, 0); + + vbox = gtk_vbox_new (FALSE, 3); + gtk_widget_show (vbox); + + obj->priv->filter_expander = expander; + + entry = gtk_entry_new (); + gtk_widget_show (entry); + + obj->priv->filter_entry = entry; + + g_signal_connect_swapped (entry, "activate", + G_CALLBACK (on_entry_filter_activate), + obj); + g_signal_connect_swapped (entry, "focus_out_event", + G_CALLBACK (on_entry_filter_activate), + obj); + + gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); + gtk_container_add (GTK_CONTAINER (expander), vbox); +} + +static void +gedit_file_browser_widget_init (GeditFileBrowserWidget * obj) +{ + obj->priv = GEDIT_FILE_BROWSER_WIDGET_GET_PRIVATE (obj); + + obj->priv->bookmarks_hash = g_hash_table_new_full (g_file_hash, + (GEqualFunc)g_file_equal, + g_object_unref, + free_name_icon); + + gtk_box_set_spacing (GTK_BOX (obj), 3); + + obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH); +} + +/* Private */ + +static void +update_sensitivity (GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model = + gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + GtkAction *action; + gint mode; + + if (GEDIT_IS_FILE_BROWSER_STORE (model)) { + gtk_action_group_set_sensitive (obj->priv->action_group, + TRUE); + gtk_action_group_set_sensitive (obj->priv->bookmark_action_group, + FALSE); + + mode = + gedit_file_browser_store_get_filter_mode + (GEDIT_FILE_BROWSER_STORE (model)); + + action = + gtk_action_group_get_action (obj->priv->action_group, + "FilterHidden"); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), + !(mode & + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN)); + } else if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + gtk_action_group_set_sensitive (obj->priv->action_group, + FALSE); + gtk_action_group_set_sensitive (obj->priv->bookmark_action_group, + TRUE); + + /* Set the filter toggle to normal up state, just for visual pleasure */ + action = + gtk_action_group_get_action (obj->priv->action_group, + "FilterHidden"); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), + FALSE); + } + + on_selection_changed (gtk_tree_view_get_selection + (GTK_TREE_VIEW (obj->priv->treeview)), obj); +} + +static gboolean +gedit_file_browser_widget_get_first_selected (GeditFileBrowserWidget *obj, + GtkTreeIter *iter) +{ + GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); + GtkTreeModel *model; + GList *rows = gtk_tree_selection_get_selected_rows (selection, &model); + gboolean result; + + if (!rows) + return FALSE; + + result = gtk_tree_model_get_iter(model, iter, (GtkTreePath *)(rows->data)); + + g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); + g_list_free (rows); + + return result; +} + +static gboolean +popup_menu (GeditFileBrowserWidget * obj, GdkEventButton * event, GtkTreeModel * model) +{ + GtkWidget *menu; + + if (GEDIT_IS_FILE_BROWSER_STORE (model)) + menu = gtk_ui_manager_get_widget (obj->priv->manager, "/FilePopup"); + else if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) + menu = gtk_ui_manager_get_widget (obj->priv->manager, "/BookmarkPopup"); + else + return FALSE; + + g_return_val_if_fail (menu != NULL, FALSE); + + if (event != NULL) { + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); + + if (gtk_tree_selection_count_selected_rows (selection) <= 1) { + GtkTreePath *path; + + if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (obj->priv->treeview), + (gint)event->x, (gint)event->y, + &path, NULL, NULL, NULL)) + { + gtk_tree_selection_unselect_all (selection); + gtk_tree_selection_select_path (selection, path); + gtk_tree_path_free (path); + } + } + + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, + event->button, event->time); + } else { + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, + gedit_utils_menu_position_under_tree_view, + obj->priv->treeview, 0, + gtk_get_current_event_time ()); + gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE); + } + + return TRUE; +} + +static gboolean +filter_glob (GeditFileBrowserWidget * obj, GeditFileBrowserStore * store, + GtkTreeIter * iter, gpointer user_data) +{ + gchar *name; + gboolean result; + guint flags; + + if (obj->priv->filter_pattern == NULL) + return TRUE; + + gtk_tree_model_get (GTK_TREE_MODEL (store), iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_NAME, &name, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (FILE_IS_DIR (flags) || FILE_IS_DUMMY (flags)) + result = TRUE; + else + result = + g_pattern_match_string (obj->priv->filter_pattern, + name); + + g_free (name); + + return result; +} + +static void +rename_selected_file (GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return; + + if (gedit_file_browser_widget_get_first_selected (obj, &iter)) + gedit_file_browser_view_start_rename (obj->priv->treeview, + &iter); +} + +static GList * +get_deletable_files (GeditFileBrowserWidget *obj) { + GtkTreeSelection *selection; + GtkTreeModel *model; + GList *rows; + GList *row; + GList *paths = NULL; + guint flags; + GtkTreeIter iter; + GtkTreePath *path; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + /* Get all selected files */ + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); + rows = gtk_tree_selection_get_selected_rows (selection, &model); + + for (row = rows; row; row = row->next) { + path = (GtkTreePath *)(row->data); + + if (!gtk_tree_model_get_iter (model, &iter, path)) + continue; + + gtk_tree_model_get (model, &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, + &flags, -1); + + if (FILE_IS_DUMMY (flags)) + continue; + + paths = g_list_append (paths, gtk_tree_path_copy (path)); + } + + g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); + g_list_free (rows); + + return paths; +} + +static gboolean +delete_selected_files (GeditFileBrowserWidget * obj, gboolean trash) +{ + GtkTreeModel *model; + gboolean confirm; + GeditFileBrowserStoreResult result; + GList *rows; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return FALSE; + + rows = get_deletable_files (obj); + + if (!rows) + return FALSE; + + if (!trash) { + g_signal_emit (obj, signals[CONFIRM_DELETE], 0, model, rows, &confirm); + + if (!confirm) + return FALSE; + } + + result = gedit_file_browser_store_delete_all (GEDIT_FILE_BROWSER_STORE (model), + rows, trash); + + g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); + g_list_free (rows); + + return result == GEDIT_FILE_BROWSER_STORE_RESULT_OK; +} + +static gboolean +on_file_store_no_trash (GeditFileBrowserStore * store, + GList * files, + GeditFileBrowserWidget * obj) +{ + gboolean confirm = FALSE; + + g_signal_emit (obj, signals[CONFIRM_NO_TRASH], 0, files, &confirm); + + return confirm; +} + +static GFile * +get_topmost_file (GFile * file) +{ + GFile * tmp; + GFile * current; + + current = g_object_ref (file); + + while ((tmp = g_file_get_parent (current)) != NULL) { + g_object_unref (current); + current = tmp; + } + + return current; +} + +static GtkWidget * +create_goto_menu_item (GeditFileBrowserWidget * obj, GList * item, + GdkPixbuf * icon) +{ + GtkWidget *result; + GtkWidget *image; + gchar *unescape; + GdkPixbuf *pixbuf = NULL; + Location *loc; + + loc = (Location *) (item->data); + + if (!get_from_bookmark_file (obj, loc->virtual_root, &unescape, &pixbuf)) { + unescape = gedit_file_browser_utils_file_basename (loc->virtual_root); + + if (icon) + pixbuf = g_object_ref (icon); + } + + if (pixbuf) { + image = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + + gtk_widget_show (image); + + result = gtk_image_menu_item_new_with_label (unescape); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (result), + image); + } else { + result = gtk_menu_item_new_with_label (unescape); + } + + g_object_set_data (G_OBJECT (result), LOCATION_DATA_KEY, item); + g_signal_connect (result, "activate", + G_CALLBACK (on_location_jump_activate), obj); + + gtk_widget_show (result); + + g_free (unescape); + + return result; +} + +static GList * +list_next_iterator (GList * list) +{ + if (!list) + return NULL; + + return list->next; +} + +static GList * +list_prev_iterator (GList * list) +{ + if (!list) + return NULL; + + return list->prev; +} + +static void +jump_to_location (GeditFileBrowserWidget * obj, GList * item, + gboolean previous) +{ + Location *loc; + GtkWidget *widget; + GList *children; + GList *child; + GList *(*iter_func) (GList *); + GtkWidget *menu_from; + GtkWidget *menu_to; + gchar *root; + gchar *virtual_root; + + if (!obj->priv->locations) + return; + + if (previous) { + iter_func = list_next_iterator; + menu_from = obj->priv->location_previous_menu; + menu_to = obj->priv->location_next_menu; + } else { + iter_func = list_prev_iterator; + menu_from = obj->priv->location_next_menu; + menu_to = obj->priv->location_previous_menu; + } + + children = gtk_container_get_children (GTK_CONTAINER (menu_from)); + child = children; + + /* This is the menuitem for the current location, which is the first + to be added to the menu */ + widget = obj->priv->current_location_menu_item; + + while (obj->priv->current_location != item) { + if (widget) { + /* Prepend the menu item to the menu */ + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu_to), + widget); + + g_object_unref (widget); + } + + widget = GTK_WIDGET (child->data); + + /* Make sure the widget isn't destroyed when removed */ + g_object_ref (widget); + gtk_container_remove (GTK_CONTAINER (menu_from), widget); + + obj->priv->current_location_menu_item = widget; + + if (obj->priv->current_location == NULL) { + obj->priv->current_location = obj->priv->locations; + + if (obj->priv->current_location == item) + break; + } else { + obj->priv->current_location = + iter_func (obj->priv->current_location); + } + + child = child->next; + } + + g_list_free (children); + + obj->priv->changing_location = TRUE; + + loc = (Location *) (obj->priv->current_location->data); + + /* Set the new root + virtual root */ + root = g_file_get_uri (loc->root); + virtual_root = g_file_get_uri (loc->virtual_root); + + gedit_file_browser_widget_set_root_and_virtual_root (obj, + root, + virtual_root); + + g_free (root); + g_free (virtual_root); + + obj->priv->changing_location = FALSE; +} + +static void +clear_next_locations (GeditFileBrowserWidget * obj) +{ + GList *children; + GList *item; + + if (obj->priv->current_location == NULL) + return; + + while (obj->priv->current_location->prev) { + location_free ((Location *) (obj->priv->current_location-> + prev->data)); + obj->priv->locations = + g_list_remove_link (obj->priv->locations, + obj->priv->current_location->prev); + } + + children = + gtk_container_get_children (GTK_CONTAINER + (obj->priv->location_next_menu)); + + for (item = children; item; item = item->next) { + gtk_container_remove (GTK_CONTAINER + (obj->priv->location_next_menu), + GTK_WIDGET (item->data)); + } + + g_list_free (children); + + gtk_action_set_sensitive (gtk_action_group_get_action + (obj->priv->action_group_sensitive, + "DirectoryNext"), FALSE); +} + +static void +update_filter_mode (GeditFileBrowserWidget * obj, + GtkAction * action, + GeditFileBrowserStoreFilterMode mode) +{ + gboolean active = + gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + GtkTreeModel *model = + gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + gint now; + + if (GEDIT_IS_FILE_BROWSER_STORE (model)) { + now = + gedit_file_browser_store_get_filter_mode + (GEDIT_FILE_BROWSER_STORE (model)); + + if (active) + now &= ~mode; + else + now |= mode; + + gedit_file_browser_store_set_filter_mode + (GEDIT_FILE_BROWSER_STORE (model), now); + } +} + +static void +set_filter_pattern_real (GeditFileBrowserWidget * obj, + gchar const * pattern, + gboolean update_entry) +{ + GtkTreeModel *model; + + model = + gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (pattern != NULL && *pattern == '\0') + pattern = NULL; + + if (pattern == NULL && obj->priv->filter_pattern_str == NULL) + return; + + if (pattern != NULL && obj->priv->filter_pattern_str != NULL && + strcmp (pattern, obj->priv->filter_pattern_str) == 0) + return; + + /* Free the old pattern */ + g_free (obj->priv->filter_pattern_str); + obj->priv->filter_pattern_str = g_strdup (pattern); + + if (obj->priv->filter_pattern) { + g_pattern_spec_free (obj->priv->filter_pattern); + obj->priv->filter_pattern = NULL; + } + + if (pattern == NULL) { + if (obj->priv->glob_filter_id != 0) { + gedit_file_browser_widget_remove_filter (obj, + obj-> + priv-> + glob_filter_id); + obj->priv->glob_filter_id = 0; + } + } else { + obj->priv->filter_pattern = g_pattern_spec_new (pattern); + + if (obj->priv->glob_filter_id == 0) + obj->priv->glob_filter_id = + gedit_file_browser_widget_add_filter (obj, + filter_glob, + NULL, + NULL); + } + + if (update_entry) { + if (obj->priv->filter_pattern_str == NULL) + gtk_entry_set_text (GTK_ENTRY (obj->priv->filter_entry), + ""); + else { + gtk_entry_set_text (GTK_ENTRY (obj->priv->filter_entry), + obj->priv->filter_pattern_str); + + gtk_expander_set_expanded (GTK_EXPANDER (obj->priv->filter_expander), + TRUE); + } + } + + if (GEDIT_IS_FILE_BROWSER_STORE (model)) + gedit_file_browser_store_refilter (GEDIT_FILE_BROWSER_STORE + (model)); + + g_object_notify (G_OBJECT (obj), "filter-pattern"); +} + + +/* Public */ + +GtkWidget * +gedit_file_browser_widget_new (const gchar *data_dir) +{ + GeditFileBrowserWidget *obj = + g_object_new (GEDIT_TYPE_FILE_BROWSER_WIDGET, NULL); + + create_toolbar (obj, data_dir); + create_combo (obj); + create_tree (obj); + create_filter (obj); + + gedit_file_browser_widget_show_bookmarks (obj); + + return GTK_WIDGET (obj); +} + +void +gedit_file_browser_widget_show_bookmarks (GeditFileBrowserWidget * obj) +{ + /* Select bookmarks in the combo box */ + g_signal_handlers_block_by_func (obj->priv->combo, + on_combo_changed, obj); + combo_set_active_by_id (obj, BOOKMARKS_ID); + g_signal_handlers_unblock_by_func (obj->priv->combo, + on_combo_changed, obj); + + check_current_item (obj, FALSE); + + gedit_file_browser_view_set_model (obj->priv->treeview, + GTK_TREE_MODEL (obj->priv-> + bookmarks_store)); +} + +static void +show_files_real (GeditFileBrowserWidget *obj, + gboolean do_root_changed) +{ + gedit_file_browser_view_set_model (obj->priv->treeview, + GTK_TREE_MODEL (obj->priv-> + file_store)); + + if (do_root_changed) + on_virtual_root_changed (obj->priv->file_store, NULL, obj); +} + +void +gedit_file_browser_widget_show_files (GeditFileBrowserWidget * obj) +{ + show_files_real (obj, TRUE); +} + +void +gedit_file_browser_widget_set_root_and_virtual_root (GeditFileBrowserWidget *obj, + gchar const *root, + gchar const *virtual_root) +{ + GeditFileBrowserStoreResult result; + + if (!virtual_root) + result = + gedit_file_browser_store_set_root_and_virtual_root + (obj->priv->file_store, root, root); + else + result = + gedit_file_browser_store_set_root_and_virtual_root + (obj->priv->file_store, root, virtual_root); + + if (result == GEDIT_FILE_BROWSER_STORE_RESULT_NO_CHANGE) + show_files_real (obj, TRUE); +} + +void +gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj, + gchar const *root, + gboolean virtual_root) +{ + GFile *file; + GFile *parent; + gchar *str; + + if (!virtual_root) { + gedit_file_browser_widget_set_root_and_virtual_root (obj, + root, + NULL); + return; + } + + if (!root) + return; + + file = g_file_new_for_uri (root); + parent = get_topmost_file (file); + str = g_file_get_uri (parent); + + gedit_file_browser_widget_set_root_and_virtual_root + (obj, str, root); + + g_free (str); + + g_object_unref (file); + g_object_unref (parent); +} + +GeditFileBrowserStore * +gedit_file_browser_widget_get_browser_store (GeditFileBrowserWidget * obj) +{ + return obj->priv->file_store; +} + +GeditFileBookmarksStore * +gedit_file_browser_widget_get_bookmarks_store (GeditFileBrowserWidget * obj) +{ + return obj->priv->bookmarks_store; +} + +GeditFileBrowserView * +gedit_file_browser_widget_get_browser_view (GeditFileBrowserWidget * obj) +{ + return obj->priv->treeview; +} + +GtkUIManager * +gedit_file_browser_widget_get_ui_manager (GeditFileBrowserWidget * obj) +{ + return obj->priv->manager; +} + +GtkWidget * +gedit_file_browser_widget_get_filter_entry (GeditFileBrowserWidget * obj) +{ + return obj->priv->filter_entry; +} + +gulong +gedit_file_browser_widget_add_filter (GeditFileBrowserWidget * obj, + GeditFileBrowserWidgetFilterFunc func, + gpointer user_data, + GDestroyNotify notify) +{ + FilterFunc *f; + GtkTreeModel *model = + gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + f = filter_func_new (obj, func, user_data, notify); + obj->priv->filter_funcs = + g_slist_append (obj->priv->filter_funcs, f); + + if (GEDIT_IS_FILE_BROWSER_STORE (model)) + gedit_file_browser_store_refilter (GEDIT_FILE_BROWSER_STORE + (model)); + + return f->id; +} + +void +gedit_file_browser_widget_remove_filter (GeditFileBrowserWidget * obj, + gulong id) +{ + GSList *item; + FilterFunc *func; + + for (item = obj->priv->filter_funcs; item; item = item->next) + { + func = (FilterFunc *) (item->data); + + if (func->id == id) + { + if (func->destroy_notify) + func->destroy_notify (func->user_data); + + obj->priv->filter_funcs = + g_slist_remove_link (obj->priv->filter_funcs, + item); + g_free (func); + break; + } + } +} + +void +gedit_file_browser_widget_set_filter_pattern (GeditFileBrowserWidget * obj, + gchar const *pattern) +{ + set_filter_pattern_real (obj, pattern, TRUE); +} + +gboolean +gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget * obj, + GtkTreeIter * iter) +{ + GtkTreeModel *model = + gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + GtkTreeIter parent; + guint flags; + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return FALSE; + + if (!gedit_file_browser_widget_get_first_selected (obj, iter)) { + if (!gedit_file_browser_store_get_iter_virtual_root + (GEDIT_FILE_BROWSER_STORE (model), iter)) + return FALSE; + } + + gtk_tree_model_get (model, iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!FILE_IS_DIR (flags)) { + /* Get the parent, because the selection is a file */ + gtk_tree_model_iter_parent (model, &parent, iter); + *iter = parent; + } + + return TRUE; +} + +static guint +gedit_file_browser_widget_get_num_selected_files_or_directories (GeditFileBrowserWidget *obj, + guint *files, + guint *dirs) +{ + GList *rows, *row; + GtkTreePath *path; + GtkTreeIter iter; + GeditFileBrowserStoreFlag flags; + guint result = 0; + GtkTreeSelection *selection; + GtkTreeModel *model; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) + return 0; + + rows = gtk_tree_selection_get_selected_rows (selection, &model); + + for (row = rows; row; row = row->next) { + path = (GtkTreePath *)(row->data); + + /* Get iter from path */ + if (!gtk_tree_model_get_iter (model, &iter, path)) + continue; + + gtk_tree_model_get (model, &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + -1); + + if (!FILE_IS_DUMMY (flags)) { + if (!FILE_IS_DIR (flags)) + ++(*files); + else + ++(*dirs); + + ++result; + } + } + + g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); + g_list_free (rows); + + return result; +} + +typedef struct +{ + GeditFileBrowserWidget *widget; + GCancellable *cancellable; +} AsyncData; + +static AsyncData * +async_data_new (GeditFileBrowserWidget *widget) +{ + AsyncData *ret; + + ret = g_new (AsyncData, 1); + ret->widget = widget; + + cancel_async_operation (widget); + widget->priv->cancellable = g_cancellable_new (); + + ret->cancellable = g_object_ref (widget->priv->cancellable); + + return ret; +} + +static void +async_free (AsyncData *async) +{ + g_object_unref (async->cancellable); + g_free (async); +} + +static void +set_busy (GeditFileBrowserWidget *obj, gboolean busy) +{ + GdkCursor *cursor; + GdkWindow *window; + + window = gtk_widget_get_window (GTK_WIDGET (obj->priv->treeview)); + + if (!GDK_IS_WINDOW (window)) + return; + + if (busy) + { + cursor = gdk_cursor_new (GDK_WATCH); + gdk_window_set_cursor (window, cursor); + gdk_cursor_unref (cursor); + } + else + { + gdk_window_set_cursor (window, NULL); + } +} + +static void try_mount_volume (GeditFileBrowserWidget *widget, GVolume *volume); + +static void +activate_mount (GeditFileBrowserWidget *widget, + GVolume *volume, + GMount *mount) +{ + GFile *root; + gchar *uri; + + if (!mount) + { + gchar *message; + gchar *name; + + name = g_volume_get_name (volume); + message = g_strdup_printf (_("No mount object for mounted volume: %s"), name); + + g_signal_emit (widget, + signals[ERROR], + 0, + GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + message); + + g_free (name); + g_free (message); + return; + } + + root = g_mount_get_root (mount); + uri = g_file_get_uri (root); + + gedit_file_browser_widget_set_root (widget, uri, FALSE); + + g_free (uri); + g_object_unref (root); +} + +static void +try_activate_drive (GeditFileBrowserWidget *widget, + GDrive *drive) +{ + GList *volumes; + GVolume *volume; + GMount *mount; + + volumes = g_drive_get_volumes (drive); + + volume = G_VOLUME (volumes->data); + mount = g_volume_get_mount (volume); + + if (mount) + { + /* try set the root of the mount */ + activate_mount (widget, volume, mount); + g_object_unref (mount); + } + else + { + /* try to mount it then? */ + try_mount_volume (widget, volume); + } + + g_list_foreach (volumes, (GFunc)g_object_unref, NULL); + g_list_free (volumes); +} + +static void +poll_for_media_cb (GDrive *drive, + GAsyncResult *res, + AsyncData *async) +{ + GError *error = NULL; + + /* check for cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_free (async); + return; + } + + /* finish poll operation */ + set_busy (async->widget, FALSE); + + if (g_drive_poll_for_media_finish (drive, res, &error) && + g_drive_has_media (drive) && + g_drive_has_volumes (drive)) + { + try_activate_drive (async->widget, drive); + } + else + { + gchar *message; + gchar *name; + + name = g_drive_get_name (drive); + message = g_strdup_printf (_("Could not open media: %s"), name); + + g_signal_emit (async->widget, + signals[ERROR], + 0, + GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + message); + + g_free (name); + g_free (message); + + g_error_free (error); + } + + async_free (async); +} + +static void +mount_volume_cb (GVolume *volume, + GAsyncResult *res, + AsyncData *async) +{ + GError *error = NULL; + + /* check for cancelled state */ + if (g_cancellable_is_cancelled (async->cancellable)) + { + async_free (async); + return; + } + + if (g_volume_mount_finish (volume, res, &error)) + { + GMount *mount; + + mount = g_volume_get_mount (volume); + activate_mount (async->widget, volume, mount); + + if (mount) + g_object_unref (mount); + } + else + { + gchar *message; + gchar *name; + + name = g_volume_get_name (volume); + message = g_strdup_printf (_("Could not mount volume: %s"), name); + + g_signal_emit (async->widget, + signals[ERROR], + 0, + GEDIT_FILE_BROWSER_ERROR_SET_ROOT, + message); + + g_free (name); + g_free (message); + + g_error_free (error); + } + + set_busy (async->widget, FALSE); + async_free (async); +} + +static void +activate_drive (GeditFileBrowserWidget *obj, + GtkTreeIter *iter) +{ + GDrive *drive; + AsyncData *async; + + gtk_tree_model_get (GTK_TREE_MODEL (obj->priv->bookmarks_store), iter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + &drive, -1); + + /* most common use case is a floppy drive, we'll poll for media and + go from there */ + async = async_data_new (obj); + g_drive_poll_for_media (drive, + async->cancellable, + (GAsyncReadyCallback)poll_for_media_cb, + async); + + g_object_unref (drive); + set_busy (obj, TRUE); +} + +static void +try_mount_volume (GeditFileBrowserWidget *widget, + GVolume *volume) +{ + GMountOperation *operation; + AsyncData *async; + + operation = gtk_mount_operation_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (widget)))); + async = async_data_new (widget); + + g_volume_mount (volume, + G_MOUNT_MOUNT_NONE, + operation, + async->cancellable, + (GAsyncReadyCallback)mount_volume_cb, + async); + + g_object_unref (operation); + set_busy (widget, TRUE); +} + +static void +activate_volume (GeditFileBrowserWidget *obj, + GtkTreeIter *iter) +{ + GVolume *volume; + + gtk_tree_model_get (GTK_TREE_MODEL (obj->priv->bookmarks_store), iter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_OBJECT, + &volume, -1); + + /* see if we can mount the volume */ + try_mount_volume (obj, volume); + g_object_unref (volume); +} + +void +gedit_file_browser_widget_refresh (GeditFileBrowserWidget *obj) +{ + GtkTreeModel *model = + gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (GEDIT_IS_FILE_BROWSER_STORE (model)) + gedit_file_browser_store_refresh (GEDIT_FILE_BROWSER_STORE + (model)); + else if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + g_hash_table_ref (obj->priv->bookmarks_hash); + g_hash_table_destroy (obj->priv->bookmarks_hash); + + gedit_file_bookmarks_store_refresh + (GEDIT_FILE_BOOKMARKS_STORE (model)); + } +} + +void +gedit_file_browser_widget_history_back (GeditFileBrowserWidget *obj) +{ + if (obj->priv->locations) { + if (obj->priv->current_location) + jump_to_location (obj, + obj->priv->current_location-> + next, TRUE); + else { + jump_to_location (obj, obj->priv->locations, TRUE); + } + } +} + +void +gedit_file_browser_widget_history_forward (GeditFileBrowserWidget *obj) +{ + if (obj->priv->locations) + jump_to_location (obj, obj->priv->current_location->prev, + FALSE); +} + +static void +bookmark_open (GeditFileBrowserWidget *obj, + GtkTreeModel *model, + GtkTreeIter *iter) +{ + gchar *uri; + gint flags; + + gtk_tree_model_get (model, iter, + GEDIT_FILE_BOOKMARKS_STORE_COLUMN_FLAGS, + &flags, -1); + + if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_DRIVE) + { + /* handle a drive node */ + gedit_file_browser_store_cancel_mount_operation (obj->priv->file_store); + activate_drive (obj, iter); + return; + } + else if (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_VOLUME) + { + /* handle a volume node */ + gedit_file_browser_store_cancel_mount_operation (obj->priv->file_store); + activate_volume (obj, iter); + return; + } + + uri = + gedit_file_bookmarks_store_get_uri + (GEDIT_FILE_BOOKMARKS_STORE (model), iter); + + if (uri) { + /* here we check if the bookmark is a mount point, or if it + is a remote bookmark. If that's the case, we will set the + root to the uri of the bookmark and not try to set the + topmost parent as root (since that may as well not be the + mount point anymore) */ + if ((flags & GEDIT_FILE_BOOKMARKS_STORE_IS_MOUNT) || + (flags & GEDIT_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK)) { + gedit_file_browser_widget_set_root (obj, + uri, + FALSE); + } else { + gedit_file_browser_widget_set_root (obj, + uri, + TRUE); + } + } else { + g_warning ("No uri!"); + } + + g_free (uri); +} + +static void +file_open (GeditFileBrowserWidget *obj, + GtkTreeModel *model, + GtkTreeIter *iter) +{ + gchar *uri; + gint flags; + + gtk_tree_model_get (model, iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + -1); + + if (!FILE_IS_DIR (flags) && !FILE_IS_DUMMY (flags)) { + g_signal_emit (obj, signals[URI_ACTIVATED], 0, uri); + } + + g_free (uri); +} + +static gboolean +directory_open (GeditFileBrowserWidget *obj, + GtkTreeModel *model, + GtkTreeIter *iter) +{ + gboolean result = FALSE; + GError *error = NULL; + gchar *uri = NULL; + GeditFileBrowserStoreFlag flags; + + gtk_tree_model_get (model, iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, &uri, + -1); + + if (FILE_IS_DIR (flags)) { + result = TRUE; + + if (!gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (obj)), uri, GDK_CURRENT_TIME, &error)) { + g_signal_emit (obj, signals[ERROR], 0, + GEDIT_FILE_BROWSER_ERROR_OPEN_DIRECTORY, + error->message); + + g_error_free (error); + error = NULL; + } + } + + g_free (uri); + + return result; +} + +static void +on_bookmark_activated (GeditFileBrowserView *tree_view, + GtkTreeIter *iter, + GeditFileBrowserWidget *obj) +{ + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); + + bookmark_open (obj, model, iter); +} + +static void +on_file_activated (GeditFileBrowserView *tree_view, + GtkTreeIter *iter, + GeditFileBrowserWidget *obj) +{ + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); + + file_open (obj, model, iter); +} + +static gboolean +virtual_root_is_root (GeditFileBrowserWidget * obj, + GeditFileBrowserStore * model) +{ + GtkTreeIter root; + GtkTreeIter virtual_root; + + if (!gedit_file_browser_store_get_iter_root (model, &root)) + return TRUE; + + if (!gedit_file_browser_store_get_iter_virtual_root (model, &virtual_root)) + return TRUE; + + return gedit_file_browser_store_iter_equal (model, &root, &virtual_root); +} + +static void +on_virtual_root_changed (GeditFileBrowserStore * model, + GParamSpec * param, + GeditFileBrowserWidget * obj) +{ + GtkTreeIter iter; + gchar *uri; + gchar *root_uri; + GtkTreeIter root; + GtkAction *action; + Location *loc; + GdkPixbuf *pixbuf; + + if (gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)) != + GTK_TREE_MODEL (obj->priv->file_store)) + { + show_files_real (obj, FALSE); + } + + if (gedit_file_browser_store_get_iter_virtual_root (model, &iter)) { + gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_URI, + &uri, -1); + + if (gedit_file_browser_store_get_iter_root (model, &root)) { + if (!obj->priv->changing_location) { + /* Remove all items from obj->priv->current_location on */ + if (obj->priv->current_location) + clear_next_locations (obj); + + root_uri = + gedit_file_browser_store_get_root + (model); + + loc = g_new (Location, 1); + loc->root = g_file_new_for_uri (root_uri); + loc->virtual_root = g_file_new_for_uri (uri); + g_free (root_uri); + + if (obj->priv->current_location) { + /* Add current location to the menu so we can go back + to it later */ + gtk_menu_shell_prepend + (GTK_MENU_SHELL + (obj->priv-> + location_previous_menu), + obj->priv-> + current_location_menu_item); + } + + obj->priv->locations = + g_list_prepend (obj->priv->locations, + loc); + + gtk_tree_model_get (GTK_TREE_MODEL (model), + &iter, + GEDIT_FILE_BROWSER_STORE_COLUMN_ICON, + &pixbuf, -1); + + obj->priv->current_location = + obj->priv->locations; + obj->priv->current_location_menu_item = + create_goto_menu_item (obj, + obj->priv-> + current_location, + pixbuf); + + g_object_ref_sink (obj->priv-> + current_location_menu_item); + + if (pixbuf) + g_object_unref (pixbuf); + + } + + action = + gtk_action_group_get_action (obj->priv-> + action_group, + "DirectoryUp"); + gtk_action_set_sensitive (action, + !virtual_root_is_root (obj, model)); + + action = + gtk_action_group_get_action (obj->priv-> + action_group_sensitive, + "DirectoryPrevious"); + gtk_action_set_sensitive (action, + obj->priv-> + current_location != NULL + && obj->priv-> + current_location->next != + NULL); + + action = + gtk_action_group_get_action (obj->priv-> + action_group_sensitive, + "DirectoryNext"); + gtk_action_set_sensitive (action, + obj->priv-> + current_location != NULL + && obj->priv-> + current_location->prev != + NULL); + } + + check_current_item (obj, TRUE); + g_free (uri); + } else { + g_message ("NO!"); + } +} + +static void +on_model_set (GObject * gobject, GParamSpec * arg1, + GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (gobject)); + + clear_signals (obj); + + if (GEDIT_IS_FILE_BOOKMARKS_STORE (model)) { + clear_next_locations (obj); + + /* Add the current location to the back menu */ + if (obj->priv->current_location) { + GtkAction *action; + + gtk_menu_shell_prepend (GTK_MENU_SHELL (obj->priv->location_previous_menu), + obj->priv->current_location_menu_item); + + g_object_unref (obj->priv->current_location_menu_item); + obj->priv->current_location = NULL; + obj->priv->current_location_menu_item = NULL; + + action = gtk_action_group_get_action (obj->priv->action_group_sensitive, + "DirectoryPrevious"); + gtk_action_set_sensitive (action, TRUE); + } + + gtk_widget_set_sensitive (obj->priv->filter_expander, FALSE); + + add_signal (obj, gobject, + g_signal_connect (gobject, "bookmark-activated", + G_CALLBACK + (on_bookmark_activated), obj)); + } else if (GEDIT_IS_FILE_BROWSER_STORE (model)) { + /* make sure any async operation is cancelled */ + cancel_async_operation (obj); + + add_signal (obj, gobject, + g_signal_connect (gobject, "file-activated", + G_CALLBACK + (on_file_activated), obj)); + + add_signal (obj, model, + g_signal_connect (model, "no-trash", + G_CALLBACK + (on_file_store_no_trash), obj)); + + gtk_widget_set_sensitive (obj->priv->filter_expander, TRUE); + } + + update_sensitivity (obj); +} + +static void +on_file_store_error (GeditFileBrowserStore * store, guint code, + gchar * message, GeditFileBrowserWidget * obj) +{ + g_signal_emit (obj, signals[ERROR], 0, code, message); +} + +static void +on_treeview_error (GeditFileBrowserView * tree_view, guint code, + gchar * message, GeditFileBrowserWidget * obj) +{ + g_signal_emit (obj, signals[ERROR], 0, code, message); +} + +static void +on_combo_changed (GtkComboBox * combo, GeditFileBrowserWidget * obj) +{ + GtkTreeIter iter; + guint id; + gchar * uri; + GFile * file; + + if (!gtk_combo_box_get_active_iter (combo, &iter)) + return; + + gtk_tree_model_get (GTK_TREE_MODEL (obj->priv->combo_model), &iter, + COLUMN_ID, &id, -1); + + switch (id) { + case BOOKMARKS_ID: + gedit_file_browser_widget_show_bookmarks (obj); + break; + + case PATH_ID: + gtk_tree_model_get (GTK_TREE_MODEL + (obj->priv->combo_model), &iter, + COLUMN_FILE, &file, -1); + + uri = g_file_get_uri (file); + gedit_file_browser_store_set_virtual_root_from_string + (obj->priv->file_store, uri); + + g_free (uri); + g_object_unref (file); + break; + } +} + +static gboolean +on_treeview_popup_menu (GeditFileBrowserView * treeview, + GeditFileBrowserWidget * obj) +{ + return popup_menu (obj, NULL, gtk_tree_view_get_model (GTK_TREE_VIEW (treeview))); +} + +static gboolean +on_treeview_button_press_event (GeditFileBrowserView * treeview, + GdkEventButton * event, + GeditFileBrowserWidget * obj) +{ + if (event->type == GDK_BUTTON_PRESS && event->button == 3) { + return popup_menu (obj, event, + gtk_tree_view_get_model (GTK_TREE_VIEW (treeview))); + } + + return FALSE; +} + +static gboolean +do_change_directory (GeditFileBrowserWidget * obj, + GdkEventKey * event) +{ + GtkAction * action = NULL; + + if ((event->state & + (~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK & ~GDK_MOD1_MASK)) == + event->state && event->keyval == GDK_BackSpace) + action = gtk_action_group_get_action (obj->priv-> + action_group_sensitive, + "DirectoryPrevious"); + else if (!((event->state & GDK_MOD1_MASK) && + (event->state & (~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK)) == event->state)) + return FALSE; + + switch (event->keyval) { + case GDK_Left: + action = gtk_action_group_get_action (obj->priv-> + action_group_sensitive, + "DirectoryPrevious"); + break; + case GDK_Right: + action = gtk_action_group_get_action (obj->priv-> + action_group_sensitive, + "DirectoryNext"); + break; + case GDK_Up: + action = gtk_action_group_get_action (obj->priv-> + action_group, + "DirectoryUp"); + break; + default: + break; + } + + if (action != NULL) { + gtk_action_activate (action); + return TRUE; + } + + return FALSE; +} + +static gboolean +on_treeview_key_press_event (GeditFileBrowserView * treeview, + GdkEventKey * event, + GeditFileBrowserWidget * obj) +{ + guint modifiers; + + if (do_change_directory (obj, event)) + return TRUE; + + if (!GEDIT_IS_FILE_BROWSER_STORE + (gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)))) + return FALSE; + + modifiers = gtk_accelerator_get_default_mod_mask (); + + if (event->keyval == GDK_Delete + || event->keyval == GDK_KP_Delete) { + + if ((event->state & modifiers) == GDK_SHIFT_MASK) { + if (obj->priv->enable_delete) { + delete_selected_files (obj, FALSE); + return TRUE; + } + } else if ((event->state & modifiers) == 0) { + delete_selected_files (obj, TRUE); + return TRUE; + } + } + + if ((event->keyval == GDK_F2) + && (event->state & modifiers) == 0) { + rename_selected_file (obj); + + return TRUE; + } + + return FALSE; +} + +static void +on_selection_changed (GtkTreeSelection * selection, + GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + guint selected = 0; + guint files = 0; + guint dirs = 0; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (GEDIT_IS_FILE_BROWSER_STORE (model)) + { + selected = gedit_file_browser_widget_get_num_selected_files_or_directories (obj, + &files, + &dirs); + } + + gtk_action_group_set_sensitive (obj->priv->action_group_selection, + selected > 0); + gtk_action_group_set_sensitive (obj->priv->action_group_file_selection, + (selected > 0) && (selected == files)); + gtk_action_group_set_sensitive (obj->priv->action_group_single_selection, + selected == 1); + gtk_action_group_set_sensitive (obj->priv->action_group_single_most_selection, + selected <= 1); +} + +static gboolean +on_entry_filter_activate (GeditFileBrowserWidget * obj) +{ + gchar const *text; + + text = gtk_entry_get_text (GTK_ENTRY (obj->priv->filter_entry)); + set_filter_pattern_real (obj, text, FALSE); + + return FALSE; +} + +static void +on_location_jump_activate (GtkMenuItem * item, + GeditFileBrowserWidget * obj) +{ + GList *location; + + location = g_object_get_data (G_OBJECT (item), LOCATION_DATA_KEY); + + if (obj->priv->current_location) { + jump_to_location (obj, location, + g_list_position (obj->priv->locations, + location) > + g_list_position (obj->priv->locations, + obj->priv-> + current_location)); + } else { + jump_to_location (obj, location, TRUE); + } + +} + +static void +on_bookmarks_row_changed (GtkTreeModel * model, + GtkTreePath * path, + GtkTreeIter * iter, + GeditFileBrowserWidget *obj) +{ + add_bookmark_hash (obj, iter); +} + +static void +on_bookmarks_row_deleted (GtkTreeModel * model, + GtkTreePath * path, + GeditFileBrowserWidget *obj) +{ + GtkTreeIter iter; + gchar * uri; + GFile * file; + + if (!gtk_tree_model_get_iter (model, &iter, path)) + return; + + uri = gedit_file_bookmarks_store_get_uri (obj->priv->bookmarks_store, &iter); + + if (!uri) + return; + + file = g_file_new_for_uri (uri); + g_hash_table_remove (obj->priv->bookmarks_hash, file); + + g_object_unref (file); + g_free (uri); +} + +static void +on_filter_mode_changed (GeditFileBrowserStore * model, + GParamSpec * param, + GeditFileBrowserWidget * obj) +{ + gint mode; + GtkToggleAction * action; + gboolean active; + + mode = gedit_file_browser_store_get_filter_mode (model); + + action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group, + "FilterHidden")); + active = !(mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN); + + if (active != gtk_toggle_action_get_active (action)) + gtk_toggle_action_set_active (action, active); + + action = GTK_TOGGLE_ACTION (gtk_action_group_get_action (obj->priv->action_group, + "FilterBinary")); + active = !(mode & GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); + + if (active != gtk_toggle_action_get_active (action)) + gtk_toggle_action_set_active (action, active); +} + +static void +on_action_directory_next (GtkAction * action, GeditFileBrowserWidget * obj) +{ + gedit_file_browser_widget_history_forward (obj); +} + +static void +on_action_directory_previous (GtkAction * action, + GeditFileBrowserWidget * obj) +{ + gedit_file_browser_widget_history_back (obj); +} + +static void +on_action_directory_up (GtkAction * action, + GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return; + + gedit_file_browser_store_set_virtual_root_up (GEDIT_FILE_BROWSER_STORE (model)); +} + +static void +on_action_directory_new (GtkAction * action, GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + GtkTreeIter parent; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return; + + if (!gedit_file_browser_widget_get_selected_directory (obj, &parent)) + return; + + if (gedit_file_browser_store_new_directory + (GEDIT_FILE_BROWSER_STORE (model), &parent, &iter)) { + gedit_file_browser_view_start_rename (obj->priv->treeview, + &iter); + } +} + +static void +on_action_file_open (GtkAction * action, GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + GtkTreeSelection *selection; + GList *rows; + GList *row; + GtkTreeIter iter; + GtkTreePath *path; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return; + + rows = gtk_tree_selection_get_selected_rows (selection, &model); + + for (row = rows; row; row = row->next) { + path = (GtkTreePath *)(row->data); + + if (gtk_tree_model_get_iter (model, &iter, path)) + file_open (obj, model, &iter); + + gtk_tree_path_free (path); + } + + g_list_free (rows); +} + +static void +on_action_file_new (GtkAction * action, GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + GtkTreeIter parent; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return; + + if (!gedit_file_browser_widget_get_selected_directory (obj, &parent)) + return; + + if (gedit_file_browser_store_new_file + (GEDIT_FILE_BROWSER_STORE (model), &parent, &iter)) { + gedit_file_browser_view_start_rename (obj->priv->treeview, + &iter); + } +} + +static void +on_action_file_rename (GtkAction * action, GeditFileBrowserWidget * obj) +{ + rename_selected_file (obj); +} + +static void +on_action_file_delete (GtkAction * action, GeditFileBrowserWidget * obj) +{ + delete_selected_files (obj, FALSE); +} + +static void +on_action_file_move_to_trash (GtkAction * action, GeditFileBrowserWidget * obj) +{ + delete_selected_files (obj, TRUE); +} + +static void +on_action_directory_refresh (GtkAction * action, + GeditFileBrowserWidget * obj) +{ + gedit_file_browser_widget_refresh (obj); +} + +static void +on_action_directory_open (GtkAction * action, GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + GtkTreeSelection *selection; + GList *rows; + GList *row; + gboolean directory_opened = FALSE; + GtkTreeIter iter; + GtkTreePath *path; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BROWSER_STORE (model)) + return; + + rows = gtk_tree_selection_get_selected_rows (selection, &model); + + for (row = rows; row; row = row->next) { + path = (GtkTreePath *)(row->data); + + if (gtk_tree_model_get_iter (model, &iter, path)) + directory_opened |= directory_open (obj, model, &iter); + + gtk_tree_path_free (path); + } + + if (!directory_opened) { + if (gedit_file_browser_widget_get_selected_directory (obj, &iter)) + directory_open (obj, model, &iter); + } + + g_list_free (rows); +} + +static void +on_action_filter_hidden (GtkAction * action, GeditFileBrowserWidget * obj) +{ + update_filter_mode (obj, + action, + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN); +} + +static void +on_action_filter_binary (GtkAction * action, GeditFileBrowserWidget * obj) +{ + update_filter_mode (obj, + action, + GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY); +} + +static void +on_action_bookmark_open (GtkAction * action, GeditFileBrowserWidget * obj) +{ + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (obj->priv->treeview)); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview)); + + if (!GEDIT_IS_FILE_BOOKMARKS_STORE (model)) + return; + + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) + bookmark_open (obj, model, &iter); +} + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser-widget.h b/plugins/filebrowser/gedit-file-browser-widget.h new file mode 100755 index 00000000..e9cc2a0e --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser-widget.h @@ -0,0 +1,121 @@ +/* + * gedit-file-browser-widget.h - Gedit plugin providing easy file access + * from the sidepanel + * + * Copyright (C) 2006 - Jesse van den Kieboom + * + * 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, 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 __GEDIT_FILE_BROWSER_WIDGET_H__ +#define __GEDIT_FILE_BROWSER_WIDGET_H__ + +#include +#include "gedit-file-browser-store.h" +#include "gedit-file-bookmarks-store.h" +#include "gedit-file-browser-view.h" + +G_BEGIN_DECLS +#define GEDIT_TYPE_FILE_BROWSER_WIDGET (gedit_file_browser_widget_get_type ()) +#define GEDIT_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidget)) +#define GEDIT_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidget const)) +#define GEDIT_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidgetClass)) +#define GEDIT_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET)) +#define GEDIT_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FILE_BROWSER_WIDGET)) +#define GEDIT_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FILE_BROWSER_WIDGET, GeditFileBrowserWidgetClass)) + +typedef struct _GeditFileBrowserWidget GeditFileBrowserWidget; +typedef struct _GeditFileBrowserWidgetClass GeditFileBrowserWidgetClass; +typedef struct _GeditFileBrowserWidgetPrivate GeditFileBrowserWidgetPrivate; + +typedef +gboolean (*GeditFileBrowserWidgetFilterFunc) (GeditFileBrowserWidget * obj, + GeditFileBrowserStore * + model, GtkTreeIter * iter, + gpointer user_data); + +struct _GeditFileBrowserWidget +{ + GtkVBox parent; + + GeditFileBrowserWidgetPrivate *priv; +}; + +struct _GeditFileBrowserWidgetClass +{ + GtkVBoxClass parent_class; + + /* Signals */ + void (*uri_activated) (GeditFileBrowserWidget * widget, + gchar const *uri); + void (*error) (GeditFileBrowserWidget * widget, + guint code, + gchar const *message); + gboolean (*confirm_delete) (GeditFileBrowserWidget * widget, + GeditFileBrowserStore * model, + GList *list); + gboolean (*confirm_no_trash) (GeditFileBrowserWidget * widget, + GList *list); +}; + +GType gedit_file_browser_widget_get_type (void) G_GNUC_CONST; +GType gedit_file_browser_widget_register_type (GTypeModule * module); + +GtkWidget *gedit_file_browser_widget_new (const gchar *data_dir); + +void gedit_file_browser_widget_show_bookmarks (GeditFileBrowserWidget * obj); +void gedit_file_browser_widget_show_files (GeditFileBrowserWidget * obj); + +void gedit_file_browser_widget_set_root (GeditFileBrowserWidget * obj, + gchar const *root, + gboolean virtual_root); +void +gedit_file_browser_widget_set_root_and_virtual_root (GeditFileBrowserWidget * obj, + gchar const *root, + gchar const *virtual_root); + +gboolean +gedit_file_browser_widget_get_selected_directory (GeditFileBrowserWidget * obj, + GtkTreeIter * iter); + +GeditFileBrowserStore * +gedit_file_browser_widget_get_browser_store (GeditFileBrowserWidget * obj); +GeditFileBookmarksStore * +gedit_file_browser_widget_get_bookmarks_store (GeditFileBrowserWidget * obj); +GeditFileBrowserView * +gedit_file_browser_widget_get_browser_view (GeditFileBrowserWidget * obj); +GtkWidget * +gedit_file_browser_widget_get_filter_entry (GeditFileBrowserWidget * obj); + +GtkUIManager * +gedit_file_browser_widget_get_ui_manager (GeditFileBrowserWidget * obj); + +gulong gedit_file_browser_widget_add_filter (GeditFileBrowserWidget * obj, + GeditFileBrowserWidgetFilterFunc func, + gpointer user_data, + GDestroyNotify notify); +void gedit_file_browser_widget_remove_filter (GeditFileBrowserWidget * obj, + gulong id); +void gedit_file_browser_widget_set_filter_pattern (GeditFileBrowserWidget * obj, + gchar const *pattern); + +void gedit_file_browser_widget_refresh (GeditFileBrowserWidget * obj); +void gedit_file_browser_widget_history_back (GeditFileBrowserWidget * obj); +void gedit_file_browser_widget_history_forward (GeditFileBrowserWidget * obj); + +G_END_DECLS +#endif /* __GEDIT_FILE_BROWSER_WIDGET_H__ */ + +// ex:ts=8:noet: diff --git a/plugins/filebrowser/gedit-file-browser.schemas.in b/plugins/filebrowser/gedit-file-browser.schemas.in new file mode 100755 index 00000000..c80c8eec --- /dev/null +++ b/plugins/filebrowser/gedit-file-browser.schemas.in @@ -0,0 +1,97 @@ + + + + /schemas/apps/gedit-2/plugins/filebrowser/on_load/tree_view + /apps/gedit-2/plugins/filebrowser/on_load/tree_view + gedit + bool + TRUE + + Open With Tree View + Open the tree view when the file browser plugin gets loaded instead of the bookmarks view + + + + + /schemas/apps/gedit-2/plugins/filebrowser/on_load/root + /apps/gedit-2/plugins/filebrowser/on_load/root + gedit + string + + + File Browser Root Directory + The file browser root directory to use when loading the file + browser plugin and onload/tree_view is TRUE. + + + + + /schemas/apps/gedit-2/plugins/filebrowser/on_load/virtual_root + /apps/gedit-2/plugins/filebrowser/on_load/virtual_root + gedit + string + + + File Browser Virtual Root Directory + The file browser virtual root directory to use when loading the + file browser plugin when onload/tree_view is TRUE. The virtual root + must always be below the actual root. + + + + + /schemas/apps/gedit-2/plugins/filebrowser/on_load/enable_remote + /apps/gedit-2/plugins/filebrowser/on_load/enable_remote + gedit + bool + FALSE + + Enable Restore of Remote Locations + Sets whether to enable restoring of remote locations. + + + + + /schemas/apps/gedit-2/plugins/filebrowser/open_at_first_doc + /apps/gedit-2/plugins/filebrowser/open_at_first_doc + gedit + bool + TRUE + + Set Location to First Document + If TRUE the file browser plugin will view the directory of + the first opened document given that the file browser hasn't been + used yet. (Thus this generally applies to opening a document from + the command line or opening it with Caja, etc.) + + + + + /schemas/apps/gedit-2/plugins/filebrowser/filter_mode + /apps/gedit-2/plugins/filebrowser/filter_mode + gedit + string + hidden_and_binary + + File Browser Filter Mode + This value determines what files get filtered from the file + browser. Valid values are: none (filter nothing), + hidden (filter hidden files), binary (filter binary files) and + hidden_and_binary (filter both hidden and binary files). + + + + + /schemas/apps/gedit-2/plugins/filebrowser/filter_pattern + /apps/gedit-2/plugins/filebrowser/filter_pattern + gedit + string + + + File Browser Filter Pattern + The filter pattern to filter the file browser with. This filter + works on top of the filter_mode. + + + + diff --git a/plugins/modelines/Makefile.am b/plugins/modelines/Makefile.am new file mode 100755 index 00000000..ddcfccc8 --- /dev/null +++ b/plugins/modelines/Makefile.am @@ -0,0 +1,38 @@ +# Modelines Plugin +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +INCLUDES = \ + -I$(top_srcdir) \ + $(GEDIT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) + +modelinesdir = $(GEDIT_PLUGINS_DATA_DIR)/modelines +modelines_DATA = \ + language-mappings + +plugin_LTLIBRARIES = libmodelines.la + +libmodelines_la_SOURCES = \ + gedit-modeline-plugin.h \ + gedit-modeline-plugin.c \ + modeline-parser.h \ + modeline-parser.c + +libmodelines_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) +libmodelines_la_LIBADD = $(GEDIT_LIBS) + +plugin_in_files = modelines.gedit-plugin.desktop.in +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +EXTRA_DIST = \ + $(plugin_in_files) \ + $(modelines_DATA) + +CLEANFILES = $(plugin_DATA) +DISTCLEANFILES = $(plugin_DATA) + + +-include $(top_srcdir)/git.mk diff --git a/plugins/modelines/gedit-modeline-plugin.c b/plugins/modelines/gedit-modeline-plugin.c new file mode 100755 index 00000000..49fc2f69 --- /dev/null +++ b/plugins/modelines/gedit-modeline-plugin.c @@ -0,0 +1,248 @@ +/* + * gedit-modeline-plugin.c + * Emacs, Kate and Vim-style modelines support for gedit. + * + * Copyright (C) 2005-2007 - Steve Frécinaux + * + * 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, 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 +#endif + +#include +#include +#include "gedit-modeline-plugin.h" +#include "modeline-parser.h" + +#include +#include + +#define WINDOW_DATA_KEY "GeditModelinePluginWindowData" +#define DOCUMENT_DATA_KEY "GeditModelinePluginDocumentData" + +typedef struct +{ + gulong tab_added_handler_id; + gulong tab_removed_handler_id; +} WindowData; + +typedef struct +{ + gulong document_loaded_handler_id; + gulong document_saved_handler_id; +} DocumentData; + +static void gedit_modeline_plugin_activate (GeditPlugin *plugin, GeditWindow *window); +static void gedit_modeline_plugin_deactivate (GeditPlugin *plugin, GeditWindow *window); +static GObject *gedit_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param); +static void gedit_modeline_plugin_finalize (GObject *object); + +GEDIT_PLUGIN_REGISTER_TYPE(GeditModelinePlugin, gedit_modeline_plugin) + +static void +window_data_free (WindowData *wdata) +{ + g_slice_free (WindowData, wdata); +} + +static void +document_data_free (DocumentData *ddata) +{ + g_slice_free (DocumentData, ddata); +} + +static void +gedit_modeline_plugin_class_init (GeditModelinePluginClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GeditPluginClass *plugin_class = GEDIT_PLUGIN_CLASS (klass); + + object_class->constructor = gedit_modeline_plugin_constructor; + object_class->finalize = gedit_modeline_plugin_finalize; + + plugin_class->activate = gedit_modeline_plugin_activate; + plugin_class->deactivate = gedit_modeline_plugin_deactivate; +} + +static GObject * +gedit_modeline_plugin_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_param) +{ + GObject *object; + gchar *data_dir; + + object = G_OBJECT_CLASS (gedit_modeline_plugin_parent_class)->constructor (type, + n_construct_properties, + construct_param); + + data_dir = gedit_plugin_get_data_dir (GEDIT_PLUGIN (object)); + + modeline_parser_init (data_dir); + + g_free (data_dir); + + return object; +} + +static void +gedit_modeline_plugin_init (GeditModelinePlugin *plugin) +{ + gedit_debug_message (DEBUG_PLUGINS, "GeditModelinePlugin initializing"); +} + +static void +gedit_modeline_plugin_finalize (GObject *object) +{ + gedit_debug_message (DEBUG_PLUGINS, "GeditModelinePlugin finalizing"); + + modeline_parser_shutdown (); + + G_OBJECT_CLASS (gedit_modeline_plugin_parent_class)->finalize (object); +} + +static void +on_document_loaded_or_saved (GeditDocument *document, + const GError *error, + GtkSourceView *view) +{ + modeline_parser_apply_modeline (view); +} + +static void +connect_handlers (GeditView *view) +{ + DocumentData *data; + GtkTextBuffer *doc; + + doc = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + + data = g_slice_new (DocumentData); + + data->document_loaded_handler_id = + g_signal_connect (doc, "loaded", + G_CALLBACK (on_document_loaded_or_saved), + view); + data->document_saved_handler_id = + g_signal_connect (doc, "saved", + G_CALLBACK (on_document_loaded_or_saved), + view); + + g_object_set_data_full (G_OBJECT (doc), DOCUMENT_DATA_KEY, + data, (GDestroyNotify) document_data_free); +} + +static void +disconnect_handlers (GeditView *view) +{ + DocumentData *data; + GtkTextBuffer *doc; + + doc = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + + data = g_object_steal_data (G_OBJECT (doc), DOCUMENT_DATA_KEY); + + if (data) + { + g_signal_handler_disconnect (doc, data->document_loaded_handler_id); + g_signal_handler_disconnect (doc, data->document_saved_handler_id); + + document_data_free (data); + } + else + { + g_warning ("Modeline handlers not found"); + } +} + +static void +on_window_tab_added (GeditWindow *window, + GeditTab *tab, + gpointer user_data) +{ + connect_handlers (gedit_tab_get_view (tab)); +} + +static void +on_window_tab_removed (GeditWindow *window, + GeditTab *tab, + gpointer user_data) +{ + disconnect_handlers (gedit_tab_get_view (tab)); +} + +static void +gedit_modeline_plugin_activate (GeditPlugin *plugin, + GeditWindow *window) +{ + WindowData *wdata; + GList *views; + GList *l; + + gedit_debug (DEBUG_PLUGINS); + + views = gedit_window_get_views (window); + for (l = views; l != NULL; l = l->next) + { + connect_handlers (GEDIT_VIEW (l->data)); + modeline_parser_apply_modeline (GTK_SOURCE_VIEW (l->data)); + } + g_list_free (views); + + wdata = g_slice_new (WindowData); + + wdata->tab_added_handler_id = + g_signal_connect (window, "tab-added", + G_CALLBACK (on_window_tab_added), NULL); + + wdata->tab_removed_handler_id = + g_signal_connect (window, "tab-removed", + G_CALLBACK (on_window_tab_removed), NULL); + + g_object_set_data_full (G_OBJECT (window), WINDOW_DATA_KEY, + wdata, (GDestroyNotify) window_data_free); +} + +static void +gedit_modeline_plugin_deactivate (GeditPlugin *plugin, + GeditWindow *window) +{ + WindowData *wdata; + GList *views; + GList *l; + + gedit_debug (DEBUG_PLUGINS); + + wdata = g_object_steal_data (G_OBJECT (window), WINDOW_DATA_KEY); + + g_signal_handler_disconnect (window, wdata->tab_added_handler_id); + g_signal_handler_disconnect (window, wdata->tab_removed_handler_id); + + window_data_free (wdata); + + views = gedit_window_get_views (window); + + for (l = views; l != NULL; l = l->next) + { + disconnect_handlers (GEDIT_VIEW (l->data)); + + modeline_parser_deactivate (GTK_SOURCE_VIEW (l->data)); + } + + g_list_free (views); +} + diff --git a/plugins/modelines/gedit-modeline-plugin.h b/plugins/modelines/gedit-modeline-plugin.h new file mode 100755 index 00000000..92b01e70 --- /dev/null +++ b/plugins/modelines/gedit-modeline-plugin.h @@ -0,0 +1,48 @@ +/* + * gedit-modeline-plugin.h + * Emacs, Kate and Vim-style modelines support for gedit. + * + * Copyright (C) 2005-2007 - Steve Frécinaux + * + * 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, 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 __GEDIT_MODELINE_PLUGIN_H__ +#define __GEDIT_MODELINE_PLUGIN_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define GEDIT_TYPE_MODELINE_PLUGIN (gedit_modeline_plugin_get_type ()) +#define GEDIT_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePlugin)) +#define GEDIT_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePluginClass)) +#define GEDIT_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GEDIT_TYPE_MODELINE_PLUGIN)) +#define GEDIT_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GEDIT_TYPE_MODELINE_PLUGIN)) +#define GEDIT_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GEDIT_TYPE_MODELINE_PLUGIN, GeditModelinePluginClass)) + +/* Private structure type */ +typedef GeditPluginClass GeditModelinePluginClass; +typedef GeditPlugin GeditModelinePlugin; + +GType gedit_modeline_plugin_get_type (void) G_GNUC_CONST; + +G_MODULE_EXPORT GType register_gedit_plugin (GTypeModule *module); + +G_END_DECLS + +#endif /* __GEDIT_MODELINE_PLUGIN_H__ */ diff --git a/plugins/modelines/language-mappings b/plugins/modelines/language-mappings new file mode 100755 index 00000000..47d00296 --- /dev/null +++ b/plugins/modelines/language-mappings @@ -0,0 +1,14 @@ +[vim] +cs=c-sharp +docbk=docbook +javascript=js +lhaskell=haskell-literate +spec=rpmspec +tex=latex +xhtml=html + +[emacs] +c++=cpp + +[kate] + diff --git a/plugins/modelines/modeline-parser.c b/plugins/modelines/modeline-parser.c new file mode 100755 index 00000000..6feafc55 --- /dev/null +++ b/plugins/modelines/modeline-parser.c @@ -0,0 +1,852 @@ +/* + * modeline-parser.c + * Emacs, Kate and Vim-style modelines support for gedit. + * + * Copyright (C) 2005-2007 - Steve Frécinaux + * + * 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, 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. + */ + +#include +#include +#include +#include +#include +#include +#include "modeline-parser.h" + +#define MODELINES_LANGUAGE_MAPPINGS_FILE "language-mappings" + +/* base dir to lookup configuration files */ +static gchar *modelines_data_dir; + +/* Mappings: language name -> Gedit language ID */ +static GHashTable *vim_languages; +static GHashTable *emacs_languages; +static GHashTable *kate_languages; + +typedef enum +{ + MODELINE_SET_NONE = 0, + MODELINE_SET_TAB_WIDTH = 1 << 0, + MODELINE_SET_INDENT_WIDTH = 1 << 1, + MODELINE_SET_WRAP_MODE = 1 << 2, + MODELINE_SET_SHOW_RIGHT_MARGIN = 1 << 3, + MODELINE_SET_RIGHT_MARGIN_POSITION = 1 << 4, + MODELINE_SET_LANGUAGE = 1 << 5, + MODELINE_SET_INSERT_SPACES = 1 << 6 +} ModelineSet; + +typedef struct _ModelineOptions +{ + gchar *language_id; + + /* these options are similar to the GtkSourceView properties of the + * same names. + */ + gboolean insert_spaces; + guint tab_width; + guint indent_width; + GtkWrapMode wrap_mode; + gboolean display_right_margin; + guint right_margin_position; + + ModelineSet set; +} ModelineOptions; + +#define MODELINE_OPTIONS_DATA_KEY "ModelineOptionsDataKey" + +static gboolean +has_option (ModelineOptions *options, + ModelineSet set) +{ + return options->set & set; +} + +void +modeline_parser_init (const gchar *data_dir) +{ + modelines_data_dir = g_strdup (data_dir); +} + +void +modeline_parser_shutdown () +{ + if (vim_languages != NULL) + g_hash_table_destroy (vim_languages); + + if (emacs_languages != NULL) + g_hash_table_destroy (emacs_languages); + + if (kate_languages != NULL) + g_hash_table_destroy (kate_languages); + + vim_languages = NULL; + emacs_languages = NULL; + kate_languages = NULL; + + g_free (modelines_data_dir); +} + +static GHashTable * +load_language_mappings_group (GKeyFile *key_file, const gchar *group) +{ + GHashTable *table; + gchar **keys; + gsize length = 0; + int i; + + table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + + keys = g_key_file_get_keys (key_file, group, &length, NULL); + + gedit_debug_message (DEBUG_PLUGINS, + "%" G_GSIZE_FORMAT " mappings in group %s", + length, group); + + for (i = 0; i < length; i++) + { + gchar *name = keys[i]; + gchar *id = g_key_file_get_string (key_file, group, name, NULL); + g_hash_table_insert (table, name, id); + } + g_free (keys); + + return table; +} + +/* lazy loading of language mappings */ +static void +load_language_mappings (void) +{ + gchar *fname; + GKeyFile *mappings; + GError *error = NULL; + + fname = g_build_filename (modelines_data_dir, + MODELINES_LANGUAGE_MAPPINGS_FILE, + NULL); + + mappings = g_key_file_new (); + + if (g_key_file_load_from_file (mappings, fname, 0, &error)) + { + gedit_debug_message (DEBUG_PLUGINS, + "Loaded language mappings from %s", + fname); + + vim_languages = load_language_mappings_group (mappings, "vim"); + emacs_languages = load_language_mappings_group (mappings, "emacs"); + kate_languages = load_language_mappings_group (mappings, "kate"); + } + else + { + gedit_debug_message (DEBUG_PLUGINS, + "Failed to loaded language mappings from %s: %s", + fname, error->message); + + g_error_free (error); + } + + g_key_file_free (mappings); + g_free (fname); +} + +static gchar * +get_language_id (const gchar *language_name, GHashTable *mapping) +{ + gchar *name; + gchar *language_id; + + name = g_ascii_strdown (language_name, -1); + + language_id = g_hash_table_lookup (mapping, name); + + if (language_id != NULL) + { + g_free (name); + return g_strdup (language_id); + } + else + { + /* by default assume that the gtksourcevuew id is the same */ + return name; + } +} + +static gchar * +get_language_id_vim (const gchar *language_name) +{ + if (vim_languages == NULL) + load_language_mappings (); + + return get_language_id (language_name, vim_languages); +} + +static gchar * +get_language_id_emacs (const gchar *language_name) +{ + if (emacs_languages == NULL) + load_language_mappings (); + + return get_language_id (language_name, emacs_languages); +} + +static gchar * +get_language_id_kate (const gchar *language_name) +{ + if (kate_languages == NULL) + load_language_mappings (); + + return get_language_id (language_name, kate_languages); +} + +static gboolean +skip_whitespaces (gchar **s) +{ + while (**s != '\0' && g_ascii_isspace (**s)) + (*s)++; + return **s != '\0'; +} + +/* Parse vi(m) modelines. + * Vi(m) modelines looks like this: + * - first form: [text]{white}{vi:|vim:|ex:}[white]{options} + * - second form: [text]{white}{vi:|vim:|ex:}[white]se[t] {options}:[text] + * They can happen on the three first or last lines. + */ +static gchar * +parse_vim_modeline (gchar *s, + ModelineOptions *options) +{ + gboolean in_set = FALSE; + gboolean neg; + guint intval; + GString *key, *value; + + key = g_string_sized_new (8); + value = g_string_sized_new (8); + + while (*s != '\0' && !(in_set && *s == ':')) + { + while (*s != '\0' && (*s == ':' || g_ascii_isspace (*s))) + s++; + + if (*s == '\0') + break; + + if (strncmp (s, "set ", 4) == 0 || + strncmp (s, "se ", 3) == 0) + { + s = strchr(s, ' ') + 1; + in_set = TRUE; + } + + neg = FALSE; + if (strncmp (s, "no", 2) == 0) + { + neg = TRUE; + s += 2; + } + + g_string_assign (key, ""); + g_string_assign (value, ""); + + while (*s != '\0' && *s != ':' && *s != '=' && + !g_ascii_isspace (*s)) + { + g_string_append_c (key, *s); + s++; + } + + if (*s == '=') + { + s++; + while (*s != '\0' && *s != ':' && + !g_ascii_isspace (*s)) + { + g_string_append_c (value, *s); + s++; + } + } + + if (strcmp (key->str, "ft") == 0 || + strcmp (key->str, "filetype") == 0) + { + g_free (options->language_id); + options->language_id = get_language_id_vim (value->str); + + options->set |= MODELINE_SET_LANGUAGE; + } + else if (strcmp (key->str, "et") == 0 || + strcmp (key->str, "expandtab") == 0) + { + options->insert_spaces = !neg; + options->set |= MODELINE_SET_INSERT_SPACES; + } + else if (strcmp (key->str, "ts") == 0 || + strcmp (key->str, "tabstop") == 0) + { + intval = atoi (value->str); + + if (intval) + { + options->tab_width = intval; + options->set |= MODELINE_SET_TAB_WIDTH; + } + } + else if (strcmp (key->str, "sw") == 0 || + strcmp (key->str, "shiftwidth") == 0) + { + intval = atoi (value->str); + + if (intval) + { + options->indent_width = intval; + options->set |= MODELINE_SET_INDENT_WIDTH; + } + } + else if (strcmp (key->str, "wrap") == 0) + { + options->wrap_mode = neg ? GTK_WRAP_NONE : GTK_WRAP_WORD; + + options->set |= MODELINE_SET_WRAP_MODE; + } + else if (strcmp (key->str, "textwidth") == 0) + { + intval = atoi (value->str); + + if (intval) + { + options->right_margin_position = intval; + options->display_right_margin = TRUE; + + options->set |= MODELINE_SET_SHOW_RIGHT_MARGIN | + MODELINE_SET_RIGHT_MARGIN_POSITION; + + } + } + } + + g_string_free (key, TRUE); + g_string_free (value, TRUE); + + return s; +} + +/* Parse emacs modelines. + * Emacs modelines looks like this: "-*- key1: value1; key2: value2 -*-" + * They can happen on the first line, or on the second one if the first line is + * a shebang (#!) + * See http://www.delorie.com/gnu/docs/emacs/emacs_486.html + */ +static gchar * +parse_emacs_modeline (gchar *s, + ModelineOptions *options) +{ + guint intval; + GString *key, *value; + + key = g_string_sized_new (8); + value = g_string_sized_new (8); + + while (*s != '\0') + { + while (*s != '\0' && (*s == ';' || g_ascii_isspace (*s))) + s++; + if (*s == '\0' || strncmp (s, "-*-", 3) == 0) + break; + + g_string_assign (key, ""); + g_string_assign (value, ""); + + while (*s != '\0' && *s != ':' && *s != ';' && + !g_ascii_isspace (*s)) + { + g_string_append_c (key, *s); + s++; + } + + if (!skip_whitespaces (&s)) + break; + + if (*s != ':') + continue; + s++; + + if (!skip_whitespaces (&s)) + break; + + while (*s != '\0' && *s != ';' && !g_ascii_isspace (*s)) + { + g_string_append_c (value, *s); + s++; + } + + gedit_debug_message (DEBUG_PLUGINS, + "Emacs modeline bit: %s = %s", + key->str, value->str); + + /* "Mode" key is case insenstive */ + if (g_ascii_strcasecmp (key->str, "Mode") == 0) + { + g_free (options->language_id); + options->language_id = get_language_id_emacs (value->str); + + options->set |= MODELINE_SET_LANGUAGE; + } + else if (strcmp (key->str, "tab-width") == 0) + { + intval = atoi (value->str); + + if (intval) + { + options->tab_width = intval; + options->set |= MODELINE_SET_TAB_WIDTH; + } + } + else if (strcmp (key->str, "indent-offset") == 0) + { + intval = atoi (value->str); + + if (intval) + { + options->indent_width = intval; + options->set |= MODELINE_SET_INDENT_WIDTH; + } + } + else if (strcmp (key->str, "indent-tabs-mode") == 0) + { + intval = strcmp (value->str, "nil") == 0; + options->insert_spaces = intval; + + options->set |= MODELINE_SET_INSERT_SPACES; + } + else if (strcmp (key->str, "autowrap") == 0) + { + intval = strcmp (value->str, "nil") != 0; + options->wrap_mode = intval ? GTK_WRAP_WORD : GTK_WRAP_NONE; + + options->set |= MODELINE_SET_WRAP_MODE; + } + } + + g_string_free (key, TRUE); + g_string_free (value, TRUE); + + return *s == '\0' ? s : s + 2; +} + +/* + * Parse kate modelines. + * Kate modelines are of the form "kate: key1 value1; key2 value2;" + * These can happen on the 10 first or 10 last lines of the buffer. + * See http://wiki.kate-editor.org/index.php/Modelines + */ +static gchar * +parse_kate_modeline (gchar *s, + ModelineOptions *options) +{ + guint intval; + GString *key, *value; + + key = g_string_sized_new (8); + value = g_string_sized_new (8); + + while (*s != '\0') + { + while (*s != '\0' && (*s == ';' || g_ascii_isspace (*s))) + s++; + if (*s == '\0') + break; + + g_string_assign (key, ""); + g_string_assign (value, ""); + + while (*s != '\0' && *s != ';' && !g_ascii_isspace (*s)) + { + g_string_append_c (key, *s); + s++; + } + + if (!skip_whitespaces (&s)) + break; + if (*s == ';') + continue; + + while (*s != '\0' && *s != ';' && + !g_ascii_isspace (*s)) + { + g_string_append_c (value, *s); + s++; + } + + gedit_debug_message (DEBUG_PLUGINS, + "Kate modeline bit: %s = %s", + key->str, value->str); + + if (strcmp (key->str, "hl") == 0 || + strcmp (key->str, "syntax") == 0) + { + g_free (options->language_id); + options->language_id = get_language_id_kate (value->str); + + options->set |= MODELINE_SET_LANGUAGE; + } + else if (strcmp (key->str, "tab-width") == 0) + { + intval = atoi (value->str); + + if (intval) + { + options->tab_width = intval; + options->set |= MODELINE_SET_TAB_WIDTH; + } + } + else if (strcmp (key->str, "indent-width") == 0) + { + intval = atoi (value->str); + if (intval) options->indent_width = intval; + } + else if (strcmp (key->str, "space-indent") == 0) + { + intval = strcmp (value->str, "on") == 0 || + strcmp (value->str, "true") == 0 || + strcmp (value->str, "1") == 0; + + options->insert_spaces = intval; + options->set |= MODELINE_SET_INSERT_SPACES; + } + else if (strcmp (key->str, "word-wrap") == 0) + { + intval = strcmp (value->str, "on") == 0 || + strcmp (value->str, "true") == 0 || + strcmp (value->str, "1") == 0; + + options->wrap_mode = intval ? GTK_WRAP_WORD : GTK_WRAP_NONE; + + options->set |= MODELINE_SET_WRAP_MODE; + } + else if (strcmp (key->str, "word-wrap-column") == 0) + { + intval = atoi (value->str); + + if (intval) + { + options->right_margin_position = intval; + options->display_right_margin = TRUE; + + options->set |= MODELINE_SET_RIGHT_MARGIN_POSITION | + MODELINE_SET_SHOW_RIGHT_MARGIN; + } + } + } + + g_string_free (key, TRUE); + g_string_free (value, TRUE); + + return s; +} + +/* Scan a line for vi(m)/emacs/kate modelines. + * Line numbers are counted starting at one. + */ +static void +parse_modeline (gchar *s, + gint line_number, + gint line_count, + ModelineOptions *options) +{ + gchar prev; + + /* look for the beginning of a modeline */ + for (prev = ' '; (s != NULL) && (*s != '\0'); prev = *(s++)) + { + if (!g_ascii_isspace (prev)) + continue; + + if ((line_number <= 3 || line_number > line_count - 3) && + (strncmp (s, "ex:", 3) == 0 || + strncmp (s, "vi:", 3) == 0 || + strncmp (s, "vim:", 4) == 0)) + { + gedit_debug_message (DEBUG_PLUGINS, "Vim modeline on line %d", line_number); + + while (*s != ':') s++; + s = parse_vim_modeline (s + 1, options); + } + else if (line_number <= 2 && strncmp (s, "-*-", 3) == 0) + { + gedit_debug_message (DEBUG_PLUGINS, "Emacs modeline on line %d", line_number); + + s = parse_emacs_modeline (s + 3, options); + } + else if ((line_number <= 10 || line_number > line_count - 10) && + strncmp (s, "kate:", 5) == 0) + { + gedit_debug_message (DEBUG_PLUGINS, "Kate modeline on line %d", line_number); + + s = parse_kate_modeline (s + 5, options); + } + } +} + +static gboolean +check_previous (GtkSourceView *view, + ModelineOptions *previous, + ModelineSet set) +{ + GtkSourceBuffer *buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + + /* Do not restore default when this is the first time */ + if (!previous) + return FALSE; + + /* Do not restore default when previous was not set */ + if (!(previous->set & set)) + return FALSE; + + /* Only restore default when setting has not changed */ + switch (set) + { + case MODELINE_SET_INSERT_SPACES: + return gtk_source_view_get_insert_spaces_instead_of_tabs (view) == + previous->insert_spaces; + break; + case MODELINE_SET_TAB_WIDTH: + return gtk_source_view_get_tab_width (view) == previous->tab_width; + break; + case MODELINE_SET_INDENT_WIDTH: + return gtk_source_view_get_indent_width (view) == previous->indent_width; + break; + case MODELINE_SET_WRAP_MODE: + return gtk_text_view_get_wrap_mode (GTK_TEXT_VIEW (view)) == + previous->wrap_mode; + break; + case MODELINE_SET_RIGHT_MARGIN_POSITION: + return gtk_source_view_get_right_margin_position (view) == + previous->right_margin_position; + break; + case MODELINE_SET_SHOW_RIGHT_MARGIN: + return gtk_source_view_get_show_right_margin (view) == + previous->display_right_margin; + break; + case MODELINE_SET_LANGUAGE: + { + GtkSourceLanguage *language = gtk_source_buffer_get_language (buffer); + + return (language == NULL && previous->language_id == NULL) || + (language != NULL && g_strcmp0 (gtk_source_language_get_id (language), + previous->language_id) == 0); + } + break; + default: + return FALSE; + break; + } +} + +static void +free_modeline_options (ModelineOptions *options) +{ + g_free (options->language_id); + g_slice_free (ModelineOptions, options); +} + +void +modeline_parser_apply_modeline (GtkSourceView *view) +{ + ModelineOptions options; + GtkTextBuffer *buffer; + GtkTextIter iter, liter; + gint line_count; + + options.language_id = NULL; + options.set = MODELINE_SET_NONE; + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + gtk_text_buffer_get_start_iter (buffer, &iter); + + line_count = gtk_text_buffer_get_line_count (buffer); + + /* Parse the modelines on the 10 first lines... */ + while ((gtk_text_iter_get_line (&iter) < 10) && + !gtk_text_iter_is_end (&iter)) + { + gchar *line; + + liter = iter; + gtk_text_iter_forward_to_line_end (&iter); + line = gtk_text_buffer_get_text (buffer, &liter, &iter, TRUE); + + parse_modeline (line, + 1 + gtk_text_iter_get_line (&iter), + line_count, + &options); + + gtk_text_iter_forward_line (&iter); + + g_free (line); + } + + /* ...and on the 10 last ones (modelines are not allowed in between) */ + if (!gtk_text_iter_is_end (&iter)) + { + gint cur_line; + guint remaining_lines; + + /* we are on the 11th line (count from 0) */ + cur_line = gtk_text_iter_get_line (&iter); + /* g_assert (10 == cur_line); */ + + remaining_lines = line_count - cur_line - 1; + + if (remaining_lines > 10) + { + gtk_text_buffer_get_end_iter (buffer, &iter); + gtk_text_iter_backward_lines (&iter, 9); + } + } + + while (!gtk_text_iter_is_end (&iter)) + { + gchar *line; + + liter = iter; + gtk_text_iter_forward_to_line_end (&iter); + line = gtk_text_buffer_get_text (buffer, &liter, &iter, TRUE); + + parse_modeline (line, + 1 + gtk_text_iter_get_line (&iter), + line_count, + &options); + + gtk_text_iter_forward_line (&iter); + + g_free (line); + } + + /* Try to set language */ + if (has_option (&options, MODELINE_SET_LANGUAGE) && options.language_id) + { + GtkSourceLanguageManager *manager; + GtkSourceLanguage *language; + + manager = gedit_get_language_manager (); + language = gtk_source_language_manager_get_language + (manager, options.language_id); + + if (language != NULL) + { + gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (buffer), + language); + } + } + + ModelineOptions *previous = g_object_get_data (G_OBJECT (buffer), + MODELINE_OPTIONS_DATA_KEY); + + /* Apply the options we got from modelines and restore defaults if + we set them before */ + if (has_option (&options, MODELINE_SET_INSERT_SPACES)) + { + gtk_source_view_set_insert_spaces_instead_of_tabs + (view, options.insert_spaces); + } + else if (check_previous (view, previous, MODELINE_SET_INSERT_SPACES)) + { + gtk_source_view_set_insert_spaces_instead_of_tabs + (view, + gedit_prefs_manager_get_insert_spaces ()); + } + + if (has_option (&options, MODELINE_SET_TAB_WIDTH)) + { + gtk_source_view_set_tab_width (view, options.tab_width); + } + else if (check_previous (view, previous, MODELINE_SET_TAB_WIDTH)) + { + gtk_source_view_set_tab_width (view, + gedit_prefs_manager_get_tabs_size ()); + } + + if (has_option (&options, MODELINE_SET_INDENT_WIDTH)) + { + gtk_source_view_set_indent_width (view, options.indent_width); + } + else if (check_previous (view, previous, MODELINE_SET_INDENT_WIDTH)) + { + gtk_source_view_set_indent_width (view, -1); + } + + if (has_option (&options, MODELINE_SET_WRAP_MODE)) + { + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), options.wrap_mode); + } + else if (check_previous (view, previous, MODELINE_SET_WRAP_MODE)) + { + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), + gedit_prefs_manager_get_wrap_mode ()); + } + + if (has_option (&options, MODELINE_SET_RIGHT_MARGIN_POSITION)) + { + gtk_source_view_set_right_margin_position (view, options.right_margin_position); + } + else if (check_previous (view, previous, MODELINE_SET_RIGHT_MARGIN_POSITION)) + { + gtk_source_view_set_right_margin_position (view, + gedit_prefs_manager_get_right_margin_position ()); + } + + if (has_option (&options, MODELINE_SET_SHOW_RIGHT_MARGIN)) + { + gtk_source_view_set_show_right_margin (view, options.display_right_margin); + } + else if (check_previous (view, previous, MODELINE_SET_SHOW_RIGHT_MARGIN)) + { + gtk_source_view_set_show_right_margin (view, + gedit_prefs_manager_get_display_right_margin ()); + } + + if (previous) + { + *previous = options; + previous->language_id = g_strdup (options.language_id); + } + else + { + previous = g_slice_new (ModelineOptions); + *previous = options; + previous->language_id = g_strdup (options.language_id); + + g_object_set_data_full (G_OBJECT (buffer), + MODELINE_OPTIONS_DATA_KEY, + previous, + (GDestroyNotify)free_modeline_options); + } + + g_free (options.language_id); +} + +void +modeline_parser_deactivate (GtkSourceView *view) +{ + g_object_set_data (G_OBJECT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))), + MODELINE_OPTIONS_DATA_KEY, + NULL); +} + +/* vi:ts=8 */ diff --git a/plugins/modelines/modeline-parser.h b/plugins/modelines/modeline-parser.h new file mode 100755 index 00000000..2e8559e4 --- /dev/null +++ b/plugins/modelines/modeline-parser.h @@ -0,0 +1,37 @@ +/* + * modelie-parser.h + * Emacs, Kate and Vim-style modelines support for gedit. + * + * Copyright (C) 2005-2007 - Steve Frécinaux + * + * 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, 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 __MODELINE_PARSER_H__ +#define __MODELINE_PARSER_H__ + +#include +#include + +G_BEGIN_DECLS + +void modeline_parser_init (const gchar *data_dir); +void modeline_parser_shutdown (void); +void modeline_parser_apply_modeline (GtkSourceView *view); +void modeline_parser_deactivate (GtkSourceView *view); + +G_END_DECLS + +#endif /* __MODELINE_PARSER_H__ */ diff --git a/plugins/modelines/modelines.gedit-plugin.desktop.in b/plugins/modelines/modelines.gedit-plugin.desktop.in new file mode 100755 index 00000000..c72f0199 --- /dev/null +++ b/plugins/modelines/modelines.gedit-plugin.desktop.in @@ -0,0 +1,8 @@ +[Gedit Plugin] +Module=modelines +IAge=2 +_Name=Modelines +_Description=Emacs, Kate and Vim-style modelines support for gedit. +Authors=Steve Frécinaux +Copyright=Copyright © 2005 Steve Frécinaux +Website=http://www.gedit.org diff --git a/plugins/pythonconsole/Makefile.am b/plugins/pythonconsole/Makefile.am new file mode 100755 index 00000000..c27227f3 --- /dev/null +++ b/plugins/pythonconsole/Makefile.am @@ -0,0 +1,15 @@ +# Python Console Plugin +SUBDIRS = pythonconsole +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +plugin_in_files = pythonconsole.gedit-plugin.desktop.in +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +EXTRA_DIST = $(plugin_in_files) + +CLEANFILES = $(plugin_DATA) +DISTCLEANFILES = $(plugin_DATA) + +-include $(top_srcdir)/git.mk diff --git a/plugins/pythonconsole/pythonconsole.gedit-plugin.desktop.in b/plugins/pythonconsole/pythonconsole.gedit-plugin.desktop.in new file mode 100755 index 00000000..8cc65648 --- /dev/null +++ b/plugins/pythonconsole/pythonconsole.gedit-plugin.desktop.in @@ -0,0 +1,10 @@ +[Gedit Plugin] +Loader=python +Module=pythonconsole +IAge=2 +_Name=Python Console +_Description=Interactive Python console standing in the bottom panel +Icon=mate-mime-text-x-python +Authors=Steve Frécinaux +Copyright=Copyright © 2006 Steve Frécinaux +Website=http://www.gedit.org diff --git a/plugins/pythonconsole/pythonconsole/Makefile.am b/plugins/pythonconsole/pythonconsole/Makefile.am new file mode 100755 index 00000000..7aa91fe9 --- /dev/null +++ b/plugins/pythonconsole/pythonconsole/Makefile.am @@ -0,0 +1,17 @@ +# Python console plugin + +plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/pythonconsole +plugin_PYTHON = \ + __init__.py \ + console.py \ + config.py + +uidir = $(GEDIT_PLUGINS_DATA_DIR)/pythonconsole/ui +ui_DATA = config.ui + +EXTRA_DIST = $(ui_DATA) + +CLEANFILES = +DISTCLEANFILES = + +-include $(top_srcdir)/git.mk diff --git a/plugins/pythonconsole/pythonconsole/__init__.py b/plugins/pythonconsole/pythonconsole/__init__.py new file mode 100755 index 00000000..60f70e9f --- /dev/null +++ b/plugins/pythonconsole/pythonconsole/__init__.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +# __init__.py -- plugin object +# +# Copyright (C) 2006 - Steve Frécinaux +# +# 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, 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. + +# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py) +# Copyright (C), 1998 James Henstridge +# Copyright (C), 2005 Adam Hooper +# Bits from gedit Python Console Plugin +# Copyrignt (C), 2005 Raphaël Slinckx + +import gtk +import gedit + +from console import PythonConsole +from config import PythonConsoleConfigDialog +from config import PythonConsoleConfig + +PYTHON_ICON = 'mate-mime-text-x-python' + +class PythonConsolePlugin(gedit.Plugin): + def __init__(self): + gedit.Plugin.__init__(self) + self.dlg = None + + def activate(self, window): + console = PythonConsole(namespace = {'__builtins__' : __builtins__, + 'gedit' : gedit, + 'window' : window}) + console.eval('print "You can access the main window through ' \ + '\'window\' :\\n%s" % window', False) + bottom = window.get_bottom_panel() + image = gtk.Image() + image.set_from_icon_name(PYTHON_ICON, gtk.ICON_SIZE_MENU) + bottom.add_item(console, _('Python Console'), image) + window.set_data('PythonConsolePluginInfo', console) + + def deactivate(self, window): + console = window.get_data("PythonConsolePluginInfo") + console.stop() + window.set_data("PythonConsolePluginInfo", None) + bottom = window.get_bottom_panel() + bottom.remove_item(console) + +def create_configure_dialog(self): + + if not self.dlg: + self.dlg = PythonConsoleConfigDialog(self.get_data_dir()) + + dialog = self.dlg.dialog() + window = gedit.app_get_default().get_active_window() + if window: + dialog.set_transient_for(window) + + return dialog + +# Here we dynamically insert create_configure_dialog based on if configuration +# is enabled. This has to be done like this because gedit checks if a plugin +# is configurable solely on the fact that it has this member defined or not +if PythonConsoleConfig.enabled(): + PythonConsolePlugin.create_configure_dialog = create_configure_dialog + +# ex:et:ts=4: diff --git a/plugins/pythonconsole/pythonconsole/config.py b/plugins/pythonconsole/pythonconsole/config.py new file mode 100755 index 00000000..fed4699b --- /dev/null +++ b/plugins/pythonconsole/pythonconsole/config.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- + +# config.py -- Config dialog +# +# Copyright (C) 2008 - B. Clausius +# +# 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, 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. + +# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py) +# Copyright (C), 1998 James Henstridge +# Copyright (C), 2005 Adam Hooper +# Bits from gedit Python Console Plugin +# Copyrignt (C), 2005 Raphaël Slinckx + +import os +import gtk + +__all__ = ('PythonConsoleConfig', 'PythonConsoleConfigDialog') + +MATECONF_KEY_BASE = '/apps/gedit-2/plugins/pythonconsole' +MATECONF_KEY_COMMAND_COLOR = MATECONF_KEY_BASE + '/command-color' +MATECONF_KEY_ERROR_COLOR = MATECONF_KEY_BASE + '/error-color' + +DEFAULT_COMMAND_COLOR = '#314e6c' # Blue Shadow +DEFAULT_ERROR_COLOR = '#990000' # Accent Red Dark + +class PythonConsoleConfig(object): + try: + import mateconf + except ImportError: + mateconf = None + + def __init__(self): + pass + + @staticmethod + def enabled(): + return PythonConsoleConfig.mateconf != None + + @staticmethod + def add_handler(handler): + if PythonConsoleConfig.mateconf: + PythonConsoleConfig.mateconf.client_get_default().notify_add(MATECONF_KEY_BASE, handler) + + color_command = property( + lambda self: self.mateconf_get_str(MATECONF_KEY_COMMAND_COLOR, DEFAULT_COMMAND_COLOR), + lambda self, value: self.mateconf_set_str(MATECONF_KEY_COMMAND_COLOR, value)) + + color_error = property( + lambda self: self.mateconf_get_str(MATECONF_KEY_ERROR_COLOR, DEFAULT_ERROR_COLOR), + lambda self, value: self.mateconf_set_str(MATECONF_KEY_ERROR_COLOR, value)) + + @staticmethod + def mateconf_get_str(key, default=''): + if not PythonConsoleConfig.mateconf: + return default + + val = PythonConsoleConfig.mateconf.client_get_default().get(key) + if val is not None and val.type == mateconf.VALUE_STRING: + return val.get_string() + else: + return default + + @staticmethod + def mateconf_set_str(key, value): + if not PythonConsoleConfig.mateconf: + return + + v = PythonConsoleConfig.mateconf.Value(mateconf.VALUE_STRING) + v.set_string(value) + PythonConsoleConfig.mateconf.client_get_default().set(key, v) + +class PythonConsoleConfigDialog(object): + + def __init__(self, datadir): + object.__init__(self) + self._dialog = None + self._ui_path = os.path.join(datadir, 'ui', 'config.ui') + self.config = PythonConsoleConfig() + + def dialog(self): + if self._dialog is None: + self._ui = gtk.Builder() + self._ui.add_from_file(self._ui_path) + + self.set_colorbutton_color(self._ui.get_object('colorbutton-command'), + self.config.color_command) + self.set_colorbutton_color(self._ui.get_object('colorbutton-error'), + self.config.color_error) + + self._ui.connect_signals(self) + + self._dialog = self._ui.get_object('dialog-config') + self._dialog.show_all() + else: + self._dialog.present() + + return self._dialog + + @staticmethod + def set_colorbutton_color(colorbutton, value): + try: + color = gtk.gdk.color_parse(value) + except ValueError: + pass # Default color in config.ui used + else: + colorbutton.set_color(color) + + def on_dialog_config_response(self, dialog, response_id): + self._dialog.destroy() + + def on_dialog_config_destroy(self, dialog): + self._dialog = None + self._ui = None + + def on_colorbutton_command_color_set(self, colorbutton): + self.config.color_command = colorbutton.get_color().to_string() + + def on_colorbutton_error_color_set(self, colorbutton): + self.config.color_error = colorbutton.get_color().to_string() + +# ex:et:ts=4: diff --git a/plugins/pythonconsole/pythonconsole/config.ui b/plugins/pythonconsole/pythonconsole/config.ui new file mode 100755 index 00000000..4ffe26f6 --- /dev/null +++ b/plugins/pythonconsole/pythonconsole/config.ui @@ -0,0 +1,107 @@ + + + + + + center-on-parent + True + dialog + False + + + + + True + + + True + 6 + 2 + 2 + 6 + 6 + + + True + 0 + C_ommand color: + True + colorbutton-command + + + + + True + 0 + _Error color: + True + colorbutton-error + + + 1 + 2 + + + + + True + True + True + #31314e4e6c6c + + + + 1 + 2 + + + + + True + True + True + #999900000000 + + + + 1 + 2 + 1 + 2 + + + + + 1 + + + + + True + end + + + gtk-close + True + True + True + True + + + 0 + + + + + False + end + 0 + + + + + + button1 + + + diff --git a/plugins/pythonconsole/pythonconsole/console.py b/plugins/pythonconsole/pythonconsole/console.py new file mode 100755 index 00000000..e9d7a331 --- /dev/null +++ b/plugins/pythonconsole/pythonconsole/console.py @@ -0,0 +1,370 @@ +# -*- coding: utf-8 -*- + +# pythonconsole.py -- Console widget +# +# Copyright (C) 2006 - Steve Frécinaux +# +# 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, 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. + +# Parts from "Interactive Python-GTK Console" (stolen from epiphany's console.py) +# Copyright (C), 1998 James Henstridge +# Copyright (C), 2005 Adam Hooper +# Bits from gedit Python Console Plugin +# Copyrignt (C), 2005 Raphaël Slinckx + +import string +import sys +import re +import traceback +import gobject +import gtk +import pango + +from config import PythonConsoleConfig + +__all__ = ('PythonConsole', 'OutFile') + +class PythonConsole(gtk.ScrolledWindow): + + __gsignals__ = { + 'grab-focus' : 'override', + } + + def __init__(self, namespace = {}): + gtk.ScrolledWindow.__init__(self) + + self.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) + self.set_shadow_type(gtk.SHADOW_IN) + self.view = gtk.TextView() + self.view.modify_font(pango.FontDescription('Monospace')) + self.view.set_editable(True) + self.view.set_wrap_mode(gtk.WRAP_WORD_CHAR) + self.add(self.view) + self.view.show() + + buffer = self.view.get_buffer() + self.normal = buffer.create_tag("normal") + self.error = buffer.create_tag("error") + self.command = buffer.create_tag("command") + + PythonConsoleConfig.add_handler(self.apply_preferences) + self.apply_preferences() + + self.__spaces_pattern = re.compile(r'^\s+') + self.namespace = namespace + + self.block_command = False + + # Init first line + buffer.create_mark("input-line", buffer.get_end_iter(), True) + buffer.insert(buffer.get_end_iter(), ">>> ") + buffer.create_mark("input", buffer.get_end_iter(), True) + + # Init history + self.history = [''] + self.history_pos = 0 + self.current_command = '' + self.namespace['__history__'] = self.history + + # Set up hooks for standard output. + self.stdout = OutFile(self, sys.stdout.fileno(), self.normal) + self.stderr = OutFile(self, sys.stderr.fileno(), self.error) + + # Signals + self.view.connect("key-press-event", self.__key_press_event_cb) + buffer.connect("mark-set", self.__mark_set_cb) + + def do_grab_focus(self): + self.view.grab_focus() + + def apply_preferences(self, *args): + config = PythonConsoleConfig() + self.error.set_property("foreground", config.color_error) + self.command.set_property("foreground", config.color_command) + + def stop(self): + self.namespace = None + + def __key_press_event_cb(self, view, event): + modifier_mask = gtk.accelerator_get_default_mod_mask() + event_state = event.state & modifier_mask + + if event.keyval == gtk.keysyms.d and event_state == gtk.gdk.CONTROL_MASK: + self.destroy() + + elif event.keyval == gtk.keysyms.Return and event_state == gtk.gdk.CONTROL_MASK: + # Get the command + buffer = view.get_buffer() + inp_mark = buffer.get_mark("input") + inp = buffer.get_iter_at_mark(inp_mark) + cur = buffer.get_end_iter() + line = buffer.get_text(inp, cur) + self.current_command = self.current_command + line + "\n" + self.history_add(line) + + # Prepare the new line + cur = buffer.get_end_iter() + buffer.insert(cur, "\n... ") + cur = buffer.get_end_iter() + buffer.move_mark(inp_mark, cur) + + # Keep indentation of precendent line + spaces = re.match(self.__spaces_pattern, line) + if spaces is not None: + buffer.insert(cur, line[spaces.start() : spaces.end()]) + cur = buffer.get_end_iter() + + buffer.place_cursor(cur) + gobject.idle_add(self.scroll_to_end) + return True + + elif event.keyval == gtk.keysyms.Return: + # Get the marks + buffer = view.get_buffer() + lin_mark = buffer.get_mark("input-line") + inp_mark = buffer.get_mark("input") + + # Get the command line + inp = buffer.get_iter_at_mark(inp_mark) + cur = buffer.get_end_iter() + line = buffer.get_text(inp, cur) + self.current_command = self.current_command + line + "\n" + self.history_add(line) + + # Make the line blue + lin = buffer.get_iter_at_mark(lin_mark) + buffer.apply_tag(self.command, lin, cur) + buffer.insert(cur, "\n") + + cur_strip = self.current_command.rstrip() + + if cur_strip.endswith(":") \ + or (self.current_command[-2:] != "\n\n" and self.block_command): + # Unfinished block command + self.block_command = True + com_mark = "... " + elif cur_strip.endswith("\\"): + com_mark = "... " + else: + # Eval the command + self.__run(self.current_command) + self.current_command = '' + self.block_command = False + com_mark = ">>> " + + # Prepare the new line + cur = buffer.get_end_iter() + buffer.move_mark(lin_mark, cur) + buffer.insert(cur, com_mark) + cur = buffer.get_end_iter() + buffer.move_mark(inp_mark, cur) + buffer.place_cursor(cur) + gobject.idle_add(self.scroll_to_end) + return True + + elif event.keyval == gtk.keysyms.KP_Down or event.keyval == gtk.keysyms.Down: + # Next entry from history + view.emit_stop_by_name("key_press_event") + self.history_down() + gobject.idle_add(self.scroll_to_end) + return True + + elif event.keyval == gtk.keysyms.KP_Up or event.keyval == gtk.keysyms.Up: + # Previous entry from history + view.emit_stop_by_name("key_press_event") + self.history_up() + gobject.idle_add(self.scroll_to_end) + return True + + elif event.keyval == gtk.keysyms.KP_Left or event.keyval == gtk.keysyms.Left or \ + event.keyval == gtk.keysyms.BackSpace: + buffer = view.get_buffer() + inp = buffer.get_iter_at_mark(buffer.get_mark("input")) + cur = buffer.get_iter_at_mark(buffer.get_insert()) + if inp.compare(cur) == 0: + if not event_state: + buffer.place_cursor(inp) + return True + return False + + # For the console we enable smart/home end behavior incoditionally + # since it is useful when editing python + + elif (event.keyval == gtk.keysyms.KP_Home or event.keyval == gtk.keysyms.Home) and \ + event_state == event_state & (gtk.gdk.SHIFT_MASK|gtk.gdk.CONTROL_MASK): + # Go to the begin of the command instead of the begin of the line + buffer = view.get_buffer() + iter = buffer.get_iter_at_mark(buffer.get_mark("input")) + ins = buffer.get_iter_at_mark(buffer.get_insert()) + + while iter.get_char().isspace(): + iter.forward_char() + + if iter.equal(ins): + iter = buffer.get_iter_at_mark(buffer.get_mark("input")) + + if event_state & gtk.gdk.SHIFT_MASK: + buffer.move_mark_by_name("insert", iter) + else: + buffer.place_cursor(iter) + return True + + elif (event.keyval == gtk.keysyms.KP_End or event.keyval == gtk.keysyms.End) and \ + event_state == event_state & (gtk.gdk.SHIFT_MASK|gtk.gdk.CONTROL_MASK): + + buffer = view.get_buffer() + iter = buffer.get_end_iter() + ins = buffer.get_iter_at_mark(buffer.get_insert()) + + iter.backward_char() + + while iter.get_char().isspace(): + iter.backward_char() + + iter.forward_char() + + if iter.equal(ins): + iter = buffer.get_end_iter() + + if event_state & gtk.gdk.SHIFT_MASK: + buffer.move_mark_by_name("insert", iter) + else: + buffer.place_cursor(iter) + return True + + def __mark_set_cb(self, buffer, iter, name): + input = buffer.get_iter_at_mark(buffer.get_mark("input")) + pos = buffer.get_iter_at_mark(buffer.get_insert()) + self.view.set_editable(pos.compare(input) != -1) + + def get_command_line(self): + buffer = self.view.get_buffer() + inp = buffer.get_iter_at_mark(buffer.get_mark("input")) + cur = buffer.get_end_iter() + return buffer.get_text(inp, cur) + + def set_command_line(self, command): + buffer = self.view.get_buffer() + mark = buffer.get_mark("input") + inp = buffer.get_iter_at_mark(mark) + cur = buffer.get_end_iter() + buffer.delete(inp, cur) + buffer.insert(inp, command) + self.view.grab_focus() + + def history_add(self, line): + if line.strip() != '': + self.history_pos = len(self.history) + self.history[self.history_pos - 1] = line + self.history.append('') + + def history_up(self): + if self.history_pos > 0: + self.history[self.history_pos] = self.get_command_line() + self.history_pos = self.history_pos - 1 + self.set_command_line(self.history[self.history_pos]) + + def history_down(self): + if self.history_pos < len(self.history) - 1: + self.history[self.history_pos] = self.get_command_line() + self.history_pos = self.history_pos + 1 + self.set_command_line(self.history[self.history_pos]) + + def scroll_to_end(self): + iter = self.view.get_buffer().get_end_iter() + self.view.scroll_to_iter(iter, 0.0) + return False + + def write(self, text, tag = None): + buffer = self.view.get_buffer() + if tag is None: + buffer.insert(buffer.get_end_iter(), text) + else: + buffer.insert_with_tags(buffer.get_end_iter(), text, tag) + gobject.idle_add(self.scroll_to_end) + + def eval(self, command, display_command = False): + buffer = self.view.get_buffer() + lin = buffer.get_mark("input-line") + buffer.delete(buffer.get_iter_at_mark(lin), + buffer.get_end_iter()) + + if isinstance(command, list) or isinstance(command, tuple): + for c in command: + if display_command: + self.write(">>> " + c + "\n", self.command) + self.__run(c) + else: + if display_command: + self.write(">>> " + c + "\n", self.command) + self.__run(command) + + cur = buffer.get_end_iter() + buffer.move_mark_by_name("input-line", cur) + buffer.insert(cur, ">>> ") + cur = buffer.get_end_iter() + buffer.move_mark_by_name("input", cur) + self.view.scroll_to_iter(buffer.get_end_iter(), 0.0) + + def __run(self, command): + sys.stdout, self.stdout = self.stdout, sys.stdout + sys.stderr, self.stderr = self.stderr, sys.stderr + + # eval and exec are broken in how they deal with utf8-encoded + # strings so we have to explicitly decode the command before + # passing it along + command = command.decode('utf8') + + try: + try: + r = eval(command, self.namespace, self.namespace) + if r is not None: + print `r` + except SyntaxError: + exec command in self.namespace + except: + if hasattr(sys, 'last_type') and sys.last_type == SystemExit: + self.destroy() + else: + traceback.print_exc() + + sys.stdout, self.stdout = self.stdout, sys.stdout + sys.stderr, self.stderr = self.stderr, sys.stderr + + def destroy(self): + pass + #gtk.ScrolledWindow.destroy(self) + +class OutFile: + """A fake output file object. It sends output to a TK test widget, + and if asked for a file number, returns one set on instance creation""" + def __init__(self, console, fn, tag): + self.fn = fn + self.console = console + self.tag = tag + def close(self): pass + def flush(self): pass + def fileno(self): return self.fn + def isatty(self): return 0 + def read(self, a): return '' + def readline(self): return '' + def readlines(self): return [] + def write(self, s): self.console.write(s, self.tag) + def writelines(self, l): self.console.write(l, self.tag) + def seek(self, a): raise IOError, (29, 'Illegal seek') + def tell(self): raise IOError, (29, 'Illegal seek') + truncate = tell + +# ex:et:ts=4: diff --git a/plugins/quickopen/Makefile.am b/plugins/quickopen/Makefile.am new file mode 100755 index 00000000..4b5faf00 --- /dev/null +++ b/plugins/quickopen/Makefile.am @@ -0,0 +1,15 @@ +# Quick Open Plugin +SUBDIRS = quickopen +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +plugin_in_files = quickopen.gedit-plugin.desktop.in +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +EXTRA_DIST = $(plugin_in_files) + +CLEANFILES = $(plugin_DATA) +DISTCLEANFILES = $(plugin_DATA) + +-include $(top_srcdir)/git.mk diff --git a/plugins/quickopen/quickopen.gedit-plugin.desktop.in b/plugins/quickopen/quickopen.gedit-plugin.desktop.in new file mode 100755 index 00000000..40f7f040 --- /dev/null +++ b/plugins/quickopen/quickopen.gedit-plugin.desktop.in @@ -0,0 +1,10 @@ +[Gedit Plugin] +Loader=python +Module=quickopen +IAge=2 +_Name=Quick Open +_Description=Quickly open files +Icon=gtk-open +Authors=Jesse van den Kieboom +Copyright=Copyright © 2009 Jesse van den Kieboom +Website=http://www.gedit.org diff --git a/plugins/quickopen/quickopen/Makefile.am b/plugins/quickopen/quickopen/Makefile.am new file mode 100755 index 00000000..88882fdf --- /dev/null +++ b/plugins/quickopen/quickopen/Makefile.am @@ -0,0 +1,13 @@ +# Quick Open Plugin + +plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/quickopen +plugin_PYTHON = \ + __init__.py \ + popup.py \ + virtualdirs.py \ + windowhelper.py + +CLEANFILES = +DISTCLEANFILES = + +-include $(top_srcdir)/git.mk diff --git a/plugins/quickopen/quickopen/__init__.py b/plugins/quickopen/quickopen/__init__.py new file mode 100755 index 00000000..a41c9400 --- /dev/null +++ b/plugins/quickopen/quickopen/__init__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2009 - Jesse van den Kieboom +# +# 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. + +import gedit +from windowhelper import WindowHelper + +class QuickOpenPlugin(gedit.Plugin): + def __init__(self): + gedit.Plugin.__init__(self) + + self._popup_size = (450, 300) + self._helpers = {} + + def activate(self, window): + self._helpers[window] = WindowHelper(window, self) + + def deactivate(self, window): + self._helpers[window].deactivate() + del self._helpers[window] + + def update_ui(self, window): + self._helpers[window].update_ui() + + def get_popup_size(self): + return self._popup_size + + def set_popup_size(self, size): + self._popup_size = size + +# ex:ts=8:et: diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py new file mode 100755 index 00000000..a80caf31 --- /dev/null +++ b/plugins/quickopen/quickopen/popup.py @@ -0,0 +1,534 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2009 - Jesse van den Kieboom +# +# 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. + +import gtk +import gtk.gdk +import gobject +import os +import gio +import pango +import glib +import fnmatch +import gedit +import xml.sax.saxutils +from virtualdirs import VirtualDirectory + +class Popup(gtk.Dialog): + def __init__(self, window, paths, handler): + gtk.Dialog.__init__(self, + title=_('Quick Open'), + parent=window, + flags=gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR | gtk.DIALOG_MODAL) + + self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) + self._open_button = self.add_button(gtk.STOCK_OPEN, gtk.RESPONSE_ACCEPT) + + self._handler = handler + self._build_ui() + + self._dirs = [] + self._cache = {} + self._theme = None + self._cursor = None + self._shift_start = None + + accel_group = gtk.AccelGroup() + accel_group.connect_group(gtk.keysyms.l, gtk.gdk.CONTROL_MASK, 0, self.on_focus_entry) + + self.add_accel_group(accel_group) + + unique = [] + + for path in paths: + if not path.get_uri() in unique: + self._dirs.append(path) + unique.append(path.get_uri()) + + def _build_ui(self): + vbox = self.get_content_area() + vbox.set_spacing(3) + + self._entry = gtk.Entry() + + self._entry.connect('changed', self.on_changed) + self._entry.connect('key-press-event', self.on_key_press_event) + + sw = gtk.ScrolledWindow(None, None) + sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + sw.set_shadow_type(gtk.SHADOW_OUT) + + tv = gtk.TreeView() + tv.set_headers_visible(False) + + self._store = gtk.ListStore(gio.Icon, str, object, int) + tv.set_model(self._store) + + self._treeview = tv + tv.connect('row-activated', self.on_row_activated) + + renderer = gtk.CellRendererPixbuf() + column = gtk.TreeViewColumn() + column.pack_start(renderer, False) + column.set_attributes(renderer, gicon=0) + + renderer = gtk.CellRendererText() + column.pack_start(renderer, True) + column.set_attributes(renderer, markup=1) + + column.set_cell_data_func(renderer, self.on_cell_data_cb) + + tv.append_column(column) + sw.add(tv) + + selection = tv.get_selection() + selection.connect('changed', self.on_selection_changed) + selection.set_mode(gtk.SELECTION_MULTIPLE) + + vbox.pack_start(self._entry, False, False, 0) + vbox.pack_start(sw, True, True, 0) + + lbl = gtk.Label() + lbl.set_alignment(0, 0.5) + lbl.set_ellipsize(pango.ELLIPSIZE_MIDDLE) + self._info_label = lbl + + vbox.pack_start(lbl, False, False, 0) + + # Initial selection + self.on_selection_changed(tv.get_selection()) + vbox.show_all() + + def on_cell_data_cb(self, column, cell, model, piter): + path = model.get_path(piter) + + if self._cursor and path == self._cursor.get_path(): + style = self._treeview.get_style() + bg = style.bg[gtk.STATE_PRELIGHT] + + cell.set_property('cell-background-gdk', bg) + cell.set_property('style', pango.STYLE_ITALIC) + else: + cell.set_property('cell-background-set', False) + cell.set_property('style-set', False) + + def _icon_from_stock(self, stock): + theme = gtk.icon_theme_get_default() + size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU) + pixbuf = theme.load_icon(stock, size[0], gtk.ICON_LOOKUP_USE_BUILTIN) + + return pixbuf + + def _list_dir(self, gfile): + entries = [] + + try: + entries = gfile.enumerate_children("standard::*") + except glib.GError: + pass + + children = [] + + for entry in entries: + if isinstance(gfile, VirtualDirectory): + child, entry = entry + else: + child = gfile.get_child(entry.get_name()) + + children.append((child, entry.get_name(), entry.get_file_type(), entry.get_icon())) + + return children + + def _compare_entries(self, a, b, lpart): + if lpart in a: + if lpart in b: + return cmp(a.index(lpart), b.index(lpart)) + else: + return -1 + elif lpart in b: + return 1 + else: + return 0 + + def _match_glob(self, s, glob): + if glob: + glob += '*' + + return fnmatch.fnmatch(s, glob) + + def do_search_dir(self, parts, d): + if not parts or not d: + return [] + + if not d in self._cache: + entries = self._list_dir(d) + entries.sort(lambda x, y: cmp(x[1].lower(), y[1].lower())) + + self._cache[d] = entries + else: + entries = self._cache[d] + + found = [] + newdirs = [] + + lpart = parts[0].lower() + + for entry in entries: + if not entry: + continue + + lentry = entry[1].lower() + + if not lpart or lpart in lentry or self._match_glob(lentry, lpart): + if entry[2] == gio.FILE_TYPE_DIRECTORY: + if len(parts) > 1: + newdirs.append(entry[0]) + else: + found.append(entry) + elif entry[2] == gio.FILE_TYPE_REGULAR and \ + (not lpart or len(parts) == 1): + found.append(entry) + + found.sort(lambda a, b: self._compare_entries(a[1].lower(), b[1].lower(), lpart)) + + if lpart == '..': + newdirs.append(d.get_parent()) + + for dd in newdirs: + found.extend(self.do_search_dir(parts[1:], dd)) + + return found + + def _replace_insensitive(self, s, find, rep): + out = '' + l = s.lower() + find = find.lower() + last = 0 + + if len(find) == 0: + return xml.sax.saxutils.escape(s) + + while True: + m = l.find(find, last) + + if m == -1: + break + else: + out += xml.sax.saxutils.escape(s[last:m]) + rep % (xml.sax.saxutils.escape(s[m:m + len(find)]),) + last = m + len(find) + + return out + xml.sax.saxutils.escape(s[last:]) + + + def make_markup(self, parts, path): + out = [] + + for i in range(0, len(parts)): + out.append(self._replace_insensitive(path[i], parts[i], "%s")) + + return os.sep.join(out) + + def _get_icon(self, f): + query = f.query_info(gio.FILE_ATTRIBUTE_STANDARD_ICON) + + if not query: + return None + else: + return query.get_icon() + + def _make_parts(self, parent, child, pp): + parts = [] + + # We went from parent, to child, using pp + idx = len(pp) - 1 + + while idx >= 0: + if pp[idx] == '..': + parts.insert(0, '..') + else: + parts.insert(0, child.get_basename()) + child = child.get_parent() + + idx -= 1 + + return parts + + def normalize_relative(self, parts): + if not parts: + return [] + + out = self.normalize_relative(parts[:-1]) + + if parts[-1] == '..': + if not out or (out[-1] == '..') or len(out) == 1: + out.append('..') + else: + del out[-1] + else: + out.append(parts[-1]) + + return out + + def _append_to_store(self, item): + if not item in self._stored_items: + self._store.append(item) + self._stored_items[item] = True + + def _clear_store(self): + self._store.clear() + self._stored_items = {} + + def _show_virtuals(self): + for d in self._dirs: + if isinstance(d, VirtualDirectory): + for entry in d.enumerate_children("standard::*"): + self._append_to_store((entry[1].get_icon(), xml.sax.saxutils.escape(entry[1].get_name()), entry[0], entry[1].get_file_type())) + + def _remove_cursor(self): + if self._cursor: + path = self._cursor.get_path() + self._cursor = None + + self._store.row_changed(path, self._store.get_iter(path)) + + def do_search(self): + self.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) + self._remove_cursor() + + text = self._entry.get_text().strip() + self._clear_store() + + if text == '': + self._show_virtuals() + else: + parts = self.normalize_relative(text.split(os.sep)) + files = [] + + for d in self._dirs: + for entry in self.do_search_dir(parts, d): + pathparts = self._make_parts(d, entry[0], parts) + self._append_to_store((entry[3], self.make_markup(parts, pathparts), entry[0], entry[2])) + + piter = self._store.get_iter_first() + + if piter: + self._treeview.get_selection().select_path(self._store.get_path(piter)) + + self.window.set_cursor(None) + + def do_show(self): + gtk.Window.do_show(self) + + self._entry.grab_focus() + self._entry.set_text("") + + self.do_search() + + def on_changed(self, editable): + self.do_search() + self.on_selection_changed(self._treeview.get_selection()) + + def _shift_extend(self, towhere): + selection = self._treeview.get_selection() + + if not self._shift_start: + model, rows = selection.get_selected_rows() + start = rows[0] + + self._shift_start = gtk.TreeRowReference(self._store, start) + else: + start = self._shift_start.get_path() + + selection.unselect_all() + selection.select_range(start, towhere) + + def _select_index(self, idx, hasctrl, hasshift): + path = (idx,) + + if not (hasctrl or hasshift): + self._treeview.get_selection().unselect_all() + + if hasshift: + self._shift_extend(path) + else: + self._shift_start = None + + if not hasctrl: + self._treeview.get_selection().select_path(path) + + self._treeview.scroll_to_cell(path, None, True, 0.5, 0) + self._remove_cursor() + + if hasctrl or hasshift: + self._cursor = gtk.TreeRowReference(self._store, path) + + piter = self._store.get_iter(path) + self._store.row_changed(path, piter) + + def _move_selection(self, howmany, hasctrl, hasshift): + num = self._store.iter_n_children(None) + + if num == 0: + return True + + # Test for cursor + path = None + + if self._cursor: + path = self._cursor.get_path() + else: + model, rows = self._treeview.get_selection().get_selected_rows() + + if len(rows) == 1: + path = rows[0] + + if not path: + if howmany > 0: + self._select_index(0, hasctrl, hasshift) + else: + self._select_index(num - 1, hasctrl, hasshift) + else: + idx = path[0] + + if idx + howmany < 0: + self._select_index(0, hasctrl, hasshift) + elif idx + howmany >= num: + self._select_index(num - 1, hasctrl, hasshift) + else: + self._select_index(idx + howmany, hasctrl, hasshift) + + return True + + def _direct_file(self): + uri = self._entry.get_text() + gfile = None + + if gedit.utils.uri_is_valid(uri): + gfile = gio.File(uri) + elif os.path.isabs(uri): + f = gio.File(uri) + + if f.query_exists(): + gfile = f + + return gfile + + def _activate(self): + model, rows = self._treeview.get_selection().get_selected_rows() + ret = True + + for row in rows: + s = model.get_iter(row) + info = model.get(s, 2, 3) + + if info[1] != gio.FILE_TYPE_DIRECTORY: + ret = ret and self._handler(info[0]) + else: + text = self._entry.get_text() + + for i in range(len(text) - 1, -1, -1): + if text[i] == os.sep: + break + + self._entry.set_text(os.path.join(text[:i], os.path.basename(info[0].get_uri())) + os.sep) + self._entry.set_position(-1) + self._entry.grab_focus() + return True + + if rows and ret: + self.destroy() + + if not rows: + gfile = self._direct_file() + + if gfile and self._handler(gfile): + self.destroy() + else: + ret = False + else: + ret = False + + return ret + + def toggle_cursor(self): + if not self._cursor: + return + + path = self._cursor.get_path() + selection = self._treeview.get_selection() + + if selection.path_is_selected(path): + selection.unselect_path(path) + else: + selection.select_path(path) + + def on_key_press_event(self, widget, event): + move_mapping = { + gtk.keysyms.Down: 1, + gtk.keysyms.Up: -1, + gtk.keysyms.Page_Down: 5, + gtk.keysyms.Page_Up: -5 + } + + if event.keyval == gtk.keysyms.Escape: + self.destroy() + return True + elif event.keyval in move_mapping: + return self._move_selection(move_mapping[event.keyval], event.state & gtk.gdk.CONTROL_MASK, event.state & gtk.gdk.SHIFT_MASK) + elif event.keyval in [gtk.keysyms.Return, gtk.keysyms.KP_Enter, gtk.keysyms.Tab, gtk.keysyms.ISO_Left_Tab]: + return self._activate() + elif event.keyval == gtk.keysyms.space and event.state & gtk.gdk.CONTROL_MASK: + self.toggle_cursor() + + return False + + def on_row_activated(self, view, path, column): + self._activate() + + def do_response(self, response): + if response != gtk.RESPONSE_ACCEPT or not self._activate(): + self.destroy() + + def on_selection_changed(self, selection): + model, rows = selection.get_selected_rows() + + gfile = None + fname = None + + if not rows: + gfile = self._direct_file() + elif len(rows) == 1: + gfile = model.get(model.get_iter(rows[0]), 2)[0] + else: + fname = '' + + if gfile: + if gfile.is_native(): + fname = xml.sax.saxutils.escape(gfile.get_path()) + else: + fname = xml.sax.saxutils.escape(gfile.get_uri()) + + self._open_button.set_sensitive(fname != None) + self._info_label.set_markup(fname or '') + + def on_focus_entry(self, group, accel, keyval, modifier): + self._entry.grab_focus() + +gobject.type_register(Popup) + +# ex:ts=8:et: diff --git a/plugins/quickopen/quickopen/virtualdirs.py b/plugins/quickopen/quickopen/virtualdirs.py new file mode 100755 index 00000000..ef0b8dc4 --- /dev/null +++ b/plugins/quickopen/quickopen/virtualdirs.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2009 - Jesse van den Kieboom +# +# 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. + +import gtk +import gio + +class VirtualDirectory: + def __init__(self, name): + self._name = name + self._children = [] + + def get_uri(self): + return 'virtual://' + self._name + + def get_parent(self): + return None + + def enumerate_children(self, attr): + return self._children + + def append(self, child): + if not child.is_native(): + return + + try: + info = child.query_info("standard::*") + + if info: + self._children.append((child, info)) + except: + pass + +class RecentDocumentsDirectory(VirtualDirectory): + def __init__(self, maxitems=10, screen=None): + VirtualDirectory.__init__(self, 'recent') + + self._maxitems = maxitems + self.fill(screen) + + def fill(self, screen): + if screen: + manager = gtk.recent_manager_get_for_screen(screen) + else: + manager = gtk.recent_manager_get_default() + + items = manager.get_items() + items.sort(lambda a, b: cmp(b.get_visited(), a.get_visited())) + + added = 0 + + for item in items: + if item.has_group('gedit'): + self.append(gio.File(item.get_uri())) + added += 1 + + if added >= self._maxitems: + break + +class CurrentDocumentsDirectory(VirtualDirectory): + def __init__(self, window): + VirtualDirectory.__init__(self, 'documents') + + self.fill(window) + + def fill(self, window): + for doc in window.get_documents(): + location = doc.get_location() + if location: + self.append(location) + +# ex:ts=8:et: diff --git a/plugins/quickopen/quickopen/windowhelper.py b/plugins/quickopen/quickopen/windowhelper.py new file mode 100755 index 00000000..70ea26f0 --- /dev/null +++ b/plugins/quickopen/quickopen/windowhelper.py @@ -0,0 +1,198 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2009 - Jesse van den Kieboom +# +# 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. + +import gedit +import gtk +from popup import Popup +import os +import gedit.commands +import gio +import glib +from virtualdirs import RecentDocumentsDirectory +from virtualdirs import CurrentDocumentsDirectory + +ui_str = """ + + + + + + + + +""" + +class WindowHelper: + def __init__(self, window, plugin): + self._window = window + self._plugin = plugin + + self._popup = None + self._install_menu() + + def deactivate(self): + self._uninstall_menu() + self._window = None + self._plugin = None + + def update_ui(self): + pass + + def _uninstall_menu(self): + manager = self._window.get_ui_manager() + + manager.remove_ui(self._ui_id) + manager.remove_action_group(self._action_group) + + manager.ensure_update() + + def _install_menu(self): + manager = self._window.get_ui_manager() + self._action_group = gtk.ActionGroup("GeditQuickOpenPluginActions") + self._action_group.add_actions([ + ("QuickOpen", gtk.STOCK_OPEN, _("Quick open"), + 'O', _("Quickly open documents"), + self.on_quick_open_activate) + ]) + + manager.insert_action_group(self._action_group, -1) + self._ui_id = manager.add_ui_from_string(ui_str) + + def _create_popup(self): + paths = [] + + # Open documents + paths.append(CurrentDocumentsDirectory(self._window)) + + doc = self._window.get_active_document() + + # Current document directory + if doc and doc.is_local(): + gfile = doc.get_location() + paths.append(gfile.get_parent()) + + # File browser root directory + if gedit.version[0] > 2 or (gedit.version[0] == 2 and (gedit.version[1] > 26 or (gedit.version[1] == 26 and gedit.version[2] >= 2))): + bus = self._window.get_message_bus() + + try: + msg = bus.send_sync('/plugins/filebrowser', 'get_root') + + if msg: + uri = msg.get_value('uri') + + if uri: + gfile = gio.File(uri) + + if gfile.is_native(): + paths.append(gfile) + + except StandardError: + pass + + # Recent documents + paths.append(RecentDocumentsDirectory(screen=self._window.get_screen())) + + # Local bookmarks + for path in self._local_bookmarks(): + paths.append(path) + + # Desktop directory + desktopdir = self._desktop_dir() + + if desktopdir: + paths.append(gio.File(desktopdir)) + + # Home directory + paths.append(gio.File(os.path.expanduser('~'))) + + self._popup = Popup(self._window, paths, self.on_activated) + + self._popup.set_default_size(*self._plugin.get_popup_size()) + self._popup.set_transient_for(self._window) + self._popup.set_position(gtk.WIN_POS_CENTER_ON_PARENT) + + self._window.get_group().add_window(self._popup) + + self._popup.connect('destroy', self.on_popup_destroy) + + def _local_bookmarks(self): + filename = os.path.expanduser('~/.gtk-bookmarks') + + if not os.path.isfile(filename): + return [] + + paths = [] + + for line in file(filename, 'r').xreadlines(): + uri = line.strip().split(" ")[0] + f = gio.File(uri) + + if f.is_native(): + try: + info = f.query_info("standard::type") + + if info and info.get_file_type() == gio.FILE_TYPE_DIRECTORY: + paths.append(f) + except glib.GError: + pass + + return paths + + def _desktop_dir(self): + config = os.getenv('XDG_CONFIG_HOME') + + if not config: + config = os.path.expanduser('~/.config') + + config = os.path.join(config, 'user-dirs.dirs') + desktopdir = None + + if os.path.isfile(config): + for line in file(config, 'r').xreadlines(): + line = line.strip() + + if line.startswith('XDG_DESKTOP_DIR'): + parts = line.split('=', 1) + desktopdir = os.path.expandvars(parts[1].strip('"').strip("'")) + break + + if not desktopdir: + desktopdir = os.path.expanduser('~/Desktop') + + return desktopdir + + # Callbacks + def on_quick_open_activate(self, action): + if not self._popup: + self._create_popup() + + self._popup.show() + + def on_popup_destroy(self, popup): + alloc = popup.get_allocation() + self._plugin.set_popup_size((alloc.width, alloc.height)) + + self._popup = None + + def on_activated(self, gfile): + gedit.commands.load_uri(self._window, gfile.get_uri(), None, -1) + return True + +# ex:ts=8:et: diff --git a/plugins/snippets/Makefile.am b/plugins/snippets/Makefile.am new file mode 100755 index 00000000..06f0009b --- /dev/null +++ b/plugins/snippets/Makefile.am @@ -0,0 +1,15 @@ +# Python snippets plugin +SUBDIRS = snippets data +plugindir = $(GEDIT_PLUGINS_LIBS_DIR) + +plugin_in_files = snippets.gedit-plugin.desktop.in +%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin) + +EXTRA_DIST = $(plugin_in_files) + +CLEANFILES = $(plugin_DATA) +DISTCLEANFILES = $(plugin_DATA) + +-include $(top_srcdir)/git.mk diff --git a/plugins/snippets/data/Makefile.am b/plugins/snippets/data/Makefile.am new file mode 100755 index 00000000..8ec40419 --- /dev/null +++ b/plugins/snippets/data/Makefile.am @@ -0,0 +1,33 @@ +# Python snippets plugin +SUBDIRS = lang + +snippets_DATA = \ + css.xml \ + c.xml \ + cpp.xml \ + chdr.xml \ + docbook.xml \ + fortran.xml \ + global.xml \ + haskell.xml \ + html.xml \ + idl.xml \ + javascript.xml \ + java.xml \ + latex.xml \ + mallard.xml \ + perl.xml \ + php.xml \ + python.xml \ + ruby.xml \ + sh.xml \ + snippets.xml \ + tcl.xml \ + xml.xml \ + xslt.xml + +snippetsdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets + +EXTRA_DIST = $(snippets_DATA) + +-include $(top_srcdir)/git.mk diff --git a/plugins/snippets/data/c.xml b/plugins/snippets/data/c.xml new file mode 100755 index 00000000..61171cb8 --- /dev/null +++ b/plugins/snippets/data/c.xml @@ -0,0 +1,283 @@ + + + + ]} + * This file is part of ${2:} + * + * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: +import pwd, os +try: + return pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0] +except KeyError: + return '' > + * + * ${2} 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. + * + * ${2} 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 ${2}; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +$0]]> + gpl + GPL License + + + ]} + * This file is part of ${2:} + * + * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: +import pwd, os +try: + return pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0] +except KeyError: + return '' > + * + * ${2} 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. + * + * ${2} 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +$0]]> + lgpl + LGPL License + + + + do + do .. while + + + + for + for loop + + + + while + while loop + + + + if + if + + + + elif + else if + + + + else + else + + + +$0]]> + Inc + #include <..> + + + + inc + #include ".." + + + + main + main + + + + struct + struct + + + + #endif + period]]> + + + + td + typedef + + + + +#define $<[1]: return up_str >_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), $<[1]: return type_str >, $<[1]: return camel_str >Private)) + +struct _$<[1]: return camel_str >Private +{ +}; + +G_DEFINE_TYPE ($<[1]: return camel_str >, $<[1]: return low_str >, ${2:G_TYPE_OBJECT}) + +static void +$<[1]: return low_str>_finalize (GObject *object) +{ + G_OBJECT_CLASS ($<[1]: return low_str >_parent_class)->finalize (object); +} + +static void +$<[1]: return low_str >_class_init ($<[1]: return camel_str >Class *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = $<[1]: return low_str >_finalize; + + g_type_class_add_private (object_class, sizeof ($<[1]: return camel_str >Private)); +} + +static void +$<[1]: return low_str >_init ($<[1]: return camel_str> *self) +{ + self->priv = $<[1]: return up_str >_GET_PRIVATE (self); +} + +$<[1]: return camel_str > * +$<[1]: return low_str >_new () +{ + return g_object_new ($<[1]: return type_str >, NULL); +}]]> + gobject + GObject template + + + +/* Default implementation */ +static const gchar * +$<[1]: return low_str>_example_method_default ($<[1]: return camel_str > *self) +{ + g_return_val_if_reached (NULL); +} + +static void +$<[1]: return low_str>_init ($<[1]: return camel_str >Iface *iface) +{ + static gboolean initialized = FALSE; + + iface->example_method = $<[1]: return low_str>_example_method_default; + + if (!initialized) + { + initialized = TRUE; + } +} + +/* + * This is an method example for an interface + */ +const gchar * +$<[1]: return low_str>_example_method ($<[1]: return camel_str > *self) +{ + g_return_val_if_fail ($<[1]: return up_str> (self), NULL); + return $<[1]: return up_str>_GET_INTERFACE (self)->example_method (self); +} + +GType +$<[1]: return low_str>_get_type () +{ + static GType $<[1]: return low_str>_type_id = 0; + + if (!$<[1]: return low_str>_type_id) + { + static const GTypeInfo g_define_type_info = + { + sizeof ($<[1]: return camel_str >Iface), + (GBaseInitFunc) $<[1]: return low_str>_init, + NULL, + NULL, + NULL, + NULL, + 0, + 0, + NULL + }; + + $<[1]: return low_str>_type_id = + g_type_register_static (G_TYPE_INTERFACE, + "$<[1]: return camel_str>", + &g_define_type_info, + 0); + } + + return $<[1]: return low_str>_type_id; +}]]> + ginterface + GObject interface + + diff --git a/plugins/snippets/data/chdr.xml b/plugins/snippets/data/chdr.xml new file mode 100755 index 00000000..f71ea901 --- /dev/null +++ b/plugins/snippets/data/chdr.xml @@ -0,0 +1,241 @@ + + + + + Header Include-Guard + once + + + + #include ".." + inc + + + +$0]]> + #include <..> + Inc + + + + namespace .. + namespace + + + ]} + * This file is part of ${2:} + * + * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: +import pwd, os +try: + return pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0] +except KeyError: + return '' > + * + * ${2} 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. + * + * ${2} 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 ${2}; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +$0]]> + gpl + GPL License + + + ]} + * This file is part of ${2:} + * + * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: +import pwd, os +try: + return pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0] +except KeyError: + return '' > + * + * ${2} 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. + * + * ${2} 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +$0]]> + lgpl + LGPL License + + + + td + typedef + + + + class .. + class + + + + struct + struct + + + ]]> + template <typename ..> + template + + + + +G_BEGIN_DECLS + +$< +global camel_str +components = $1.split('_') +type_str = '_'.join([components[0], 'TYPE'] + components[1:]) +is_str = '_'.join([components[0], 'IS'] + components[1:]) +camel_str = '' + +for t in components: + camel_str += t.capitalize() + +items = [ \ +['#define ' + type_str, '(' + $1.lower() + '_get_type ())'], \ +['#define ' + $1 + '(obj)', '(G_TYPE_CHECK_INSTANCE_CAST ((obj), ' + type_str + ', ' + camel_str + '))'], \ +['#define ' + $1 + '_CONST(obj)', '(G_TYPE_CHECK_INSTANCE_CAST ((obj), ' + type_str + ', ' + camel_str + ' const))'], \ +['#define ' + $1 + '_CLASS(klass)', '(G_TYPE_CHECK_CLASS_CAST ((klass), ' + type_str + ', ' + camel_str + 'Class))'], \ +['#define ' + is_str + '(obj)', '(G_TYPE_CHECK_INSTANCE_TYPE ((obj), ' + type_str + '))'], \ +['#define ' + is_str + '_CLASS(klass)', '(G_TYPE_CHECK_CLASS_TYPE ((klass), ' + type_str + '))'], \ +['#define ' + $1 + '_GET_CLASS(obj)', '(G_TYPE_INSTANCE_GET_CLASS ((obj), ' + type_str + ', ' + camel_str + 'Class))'] +] + +return align(items) > + +$<[1]: +items = [ \ +['typedef struct _' + camel_str, camel_str + ';'], \ +['typedef struct _' + camel_str + 'Class', camel_str + 'Class;'], \ +['typedef struct _' + camel_str + 'Private', camel_str + 'Private;'] \ +] + +return align(items) > + +struct _$<[1]: return camel_str > { + ${7:GObject} parent; + + $<[1]: return camel_str >Private *priv; +}; + +struct _$<[1]: return camel_str >Class { + $7Class parent_class; +}; + +GType $< return $1.lower() + '_get_type' > (void) G_GNUC_CONST; +$<[1]: return camel_str > *$< return $1.lower()>_new (void); + +$0 +G_END_DECLS + +#endif /* __$1_H__ */]]> + gobject + GObject template + + + + +G_BEGIN_DECLS + +$< +global camel_str +components = $1.split('_') +type_str = '_'.join([components[0], 'TYPE'] + components[1:]) +is_str = '_'.join([components[0], 'IS'] + components[1:]) +camel_str = '' + +for t in components: + camel_str += t.capitalize() + +items = [ \ +['#define ' + type_str, '(' + $1.lower() + '_get_type ())'], \ +['#define ' + $1 + '(obj)', '(G_TYPE_CHECK_INSTANCE_CAST ((obj), ' + type_str + ', ' + camel_str + '))'], \ +['#define ' + is_str + '(obj)', '(G_TYPE_CHECK_INSTANCE_TYPE ((obj), ' + type_str + '))'], \ +['#define ' + $1 + '_GET_INTERFACE(obj)', '(G_TYPE_INSTANCE_GET_INTERFACE ((obj), ' + type_str + ', ' + camel_str + 'Iface))'] +] + +return align(items) > + +$<[1]: +items = [ \ +['typedef struct _' + camel_str, camel_str + ';'], \ +['typedef struct _' + camel_str + 'Iface', camel_str + 'Iface;'], \ +] + +return align(items) > + +struct _$<[1]: return camel_str >Iface +{ + ${7:GTypeInterface} parent; + + const gchar * (*example_method) ($<[1]: return camel_str > *self); +}; + +GType $< return $1.lower() + '_get_type' > (void) G_GNUC_CONST; + +const gchar *$< return $1.lower()>_example_method ($<[1]: return camel_str > *self); +$0 +G_END_DECLS + +#endif /* __$1_H__ */]]> + ginterface + GObject interface + + diff --git a/plugins/snippets/data/cpp.xml b/plugins/snippets/data/cpp.xml new file mode 100755 index 00000000..7c7ccabd --- /dev/null +++ b/plugins/snippets/data/cpp.xml @@ -0,0 +1,183 @@ + + + + + main + main + + + + for loop + for + + + + $1.begin + beginend + + + + do .. while + do + + + + period]]> + #endif + + + + if .. + if + + + + #include ".." + inc + + + +$0]]> + #include <..> + Inc + + + + namespace .. + namespace + + + v; +if (FILE* fp = fopen (${1:"filename"}, "r")) +{ + uint8_t buf[1024]; + while (size_t len = fread (buf, 1, sizeof (buf), fp)) + v.insert (v.end(), buf, buf + len); + fclose(fp); +} +$0]]> + Read File Into Vector + readfile + + + ${3:map}; +$0]]> + std::map + map + + + ${2:v}; +$0]]> + std::vector + vector + + + + struct .. + struct + + + ]]> + template <typename ..> + template + + + ]} + * This file is part of ${2:} + * + * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: +import pwd, os +try: + return pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0] +except KeyError: + return '' > + * + * ${2} 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. + * + * ${2} 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 ${2}; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + + $0]]> + gpl + GPL License + + + ]} + * This file is part of ${2:} + * + * Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4: +import pwd, os +try: + return pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0] +except KeyError: + return '' > + * + * ${2} 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. + * + * ${2} 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + $0]]> + lgpl + LGPL License + + + + td + typedef + + + + while + while + + diff --git a/plugins/snippets/data/css.xml b/plugins/snippets/data/css.xml new file mode 100755 index 00000000..babca912 --- /dev/null +++ b/plugins/snippets/data/css.xml @@ -0,0 +1,557 @@ + + + + + background-attachment: scroll/fixed + background + + + + background-color: color-hex + background + + + + background-color: color-name + background + + + + background-color: color-rgb + background + + + + background: color image repeat attachment position + background + + + + background-color: transparent + background + + + + background-image: none + background + + + + background-image: url + background + + + + background-position: position + background + + + + background-repeat: r/r-x/r-y/n-r + background + + + + border-bottom-color: size style color + border + + + + border-bottom: size style color + border + + + + border-bottom-style: size style color + border + + + + border-bottom-width: size style color + border + + + + border-color: color + border + + + + border-left-color: color + border + + + + border-left: size style color + border + + + + border-left-style: style + border + + + + border-left-width: size + border + + + + border-right-color: color + border + + + + border-right: size style color + border + + + + border-right-style: style + border + + + + border-right-width: size + border + + + + border: size style color + border + + + + border-style: style + border + + + + border-top-color: color + border + + + + border-top: size style color + border + + + + border-top-style: style + border + + + + border-top-width: size + border + + + + border-width: width + border + + + + clear: value + clear + + + + color: color-hex + color + + + + color: color-name + color + + + + color: color-rgb + color + + + + cursor: type + cursor + + + + cursor: url + clear + + + + direction: ltr|rtl + direction + + + + display: block + display + + + + display: common-types + display + + + + display: inline + display + + + + display: table-types + display + + + + float: left/right/none + float + + + + font-family: family + font + + + + font: size font + font + + + + font-size: size + font + + + + font-style: normal/italic/oblique + font + + + + font: style variant weight size/line-height font-family + font + + + + font-variant: normal/small-caps + font + + + + font-weight: weight + font + + + + letter-spacing: length-em + letter + + + + letter-spacing: length-px + letter + + + + list-style-image: url + list + + + + list-style-position: pos + list + + + + list-style-type: asian + list + + + + list-style-type: marker + list + + + + list-style-type: numeric + list + + + + list-style-type: other + list + + + + list-style: type position image + list + + + + list-style-type: roman-alpha-greek + list + + + + margin: all + margin + + + + margin-bottom: length + margin + + + + margin-left: length + margin + + + + margin-right: length + margin + + + + margin-top: length + margin + + + + margin: T R B L + margin + + + + margin: V H + margin + + + + marker-offset: auto + marker + + + + marker-offset: length + marker + + + + overflow: type + overflow + + + + padding: all + padding + + + + padding-bottom: length + margin + + + + padding-left: length + margin + + + + padding-right: length + margin + + + + padding-top: length + margin + + + + padding: T R B L + padding + + + + padding: V H + padding + + + + position: type + position + + + + properties { } + { + + + + text-align: left/center/right + text + + + + text-decoration: none/underline/overline/line-through/blink + text + + + + text-indent: length + text + + + + text-shadow: color-hex x y blur + text + + + + text-shadow: color-rgb x y blur + text + + + + text-shadow: none + text + + + + text-transform: capitalize/upper/lower + text + + + + text-transform: none + text + + + + vertical-align: type + vertical + + + + visibility: type + visibility + + + + white-space: normal/pre/nowrap + white + + + + word-spacing: length + word + + + + word-spacing: normal + word + + + + z-index: index + z + + diff --git a/plugins/snippets/data/docbook.xml b/plugins/snippets/data/docbook.xml new file mode 100755 index 00000000..3159b603 --- /dev/null +++ b/plugins/snippets/data/docbook.xml @@ -0,0 +1,118 @@ + + + + + $0]]> + XML tag + < + + + $1$2 +]]> + menu + menuchoice + + + + ${1:Ctrl}${2}]]> + key + keycombo + + + + + ${3} +]]> + sect + sect* + + + + &app;]]> + app + app entity + + + + $GEDIT_SELECTED_TEXT]]> + application + application tag + + + + $GEDIT_SELECTED_TEXT]]> + enclose + enclose selected text + + + + + + ${1} + +]]> + ul + itemized list + + + + + + ${1} + +]]> + ol + ordered list + + + + + ${1} +]]> + li + list item + + + + + $1 +]]> + vl + variablelist + + + + ${1} + + ${2} + +]]> + vli + variablelist entry + + + + ]]> + / + para close + + + + ]]> + p + para open + + + + $2]]> + http + ulink http + + + + $2]]> + help + ulink mate help + + + diff --git a/plugins/snippets/data/fortran.xml b/plugins/snippets/data/fortran.xml new file mode 100755 index 00000000..c64d6461 --- /dev/null +++ b/plugins/snippets/data/fortran.xml @@ -0,0 +1,164 @@ + + + + + c + character + + + + cl + close + + + + do + do ... end do + + + + func + function + + + + ifel + if ... else ... end if + + + + if + if ... end if + + + + i + integer + + + + ida + integerdimalloc + + + + id + integerdim + + + + l + logical + + + + mod + module + + + + op + open + + + + prog + program + + + + re + read + + + + r + real + + + + rda + realdimalloc + + + + rd + realdim + + + + rec + recursivfunc + + + + sel + select + + + + sub + subroutine + + + + t + type + + + + dow + while + + + + wr + write + + diff --git a/plugins/snippets/data/global.xml b/plugins/snippets/data/global.xml new file mode 100755 index 00000000..afe3c0b7 --- /dev/null +++ b/plugins/snippets/data/global.xml @@ -0,0 +1,2 @@ + + diff --git a/plugins/snippets/data/haskell.xml b/plugins/snippets/data/haskell.xml new file mode 100755 index 00000000..54a8e7d6 --- /dev/null +++ b/plugins/snippets/data/haskell.xml @@ -0,0 +1,14 @@ + + + + + module + mod + + + ${1:t}]]> + \t -> t + \ + + diff --git a/plugins/snippets/data/html.xml b/plugins/snippets/data/html.xml new file mode 100755 index 00000000..d294f934 --- /dev/null +++ b/plugins/snippets/data/html.xml @@ -0,0 +1,246 @@ + + + + +]]> + HTML — 4.01 Strict + doctype + + + +]]> + XHTML — 1.0 Frameset + doctype + + + +]]> + XHTML — 1.0 Strict + doctype + + + +]]> + XHTML — 1.0 Transitional + doctype + + + +]]> + XHTML — 1.1 + doctype + + + +]]> + HTML — 4.0 Transitional + doctype + + + +$0]]> + author + Author + + + " /> +$0]]> + date + Date + + + ${2:$GEDIT_SELECTED_TEXT} +]]> + l]]> + Wrap Selection as Link + ref + + + $GEDIT_SELECTED_TEXT]]> + w]]> + Wrap Selection in Open/Close Tag + + + ${3:email me} $0]]> + Mail Anchor + mailto + + + $0]]> + Base + base + + + + $0 +]]> + Body + body + + + +$0]]> + space]]> + Br + + + $4 +]]> + button + Button + + + + ${0:$GEDIT_SELECTED_TEXT} +]]> + Div + div + + + $0 +]]> + file + File + + + + $0 + +

+]]>
+ Form + form +
+ + ${3:$GEDIT_SELECTED_TEXT} +$0]]> + Heading + h + + + + + ${1:Page Title} + $0 +]]> + Head + head + + + $0]]> + img + Image + + + ]]> + Input + input + + + $1$0]]> + li + List Element + + + ]]> + Link + link + + + ]]> + Meta + meta + + + + space]]> + Non-Breaking Space + + + $1$0]]> + noscript + Noscript + + + $2$0]]> + option + Option + + + +// +]]> + Script + script + + + ]]> + Script With External Source + scriptsrc + + + + + $4 +$0 +]]> + select + Select + + + $2$0]]> + span + Span + + + +/* */ + +]]> + Style + style + + + + ${4:Header} + ${5:Data} + $0 +]]> + Table + table + + + $0]]> + Text Area + textarea + + + ${1:Page Title}]]> + Title + title + + + $1 +$0]]> + tr + Table Row + + + +
  • $1
  • + $2 + +$0]]>
    + ul + Unordered List +
    +
    diff --git a/plugins/snippets/data/idl.xml b/plugins/snippets/data/idl.xml new file mode 100755 index 00000000..2b6ef30d --- /dev/null +++ b/plugins/snippets/data/idl.xml @@ -0,0 +1,49 @@ + + + + + mod + Module + + + + if + Interface + + + + str + Struct + + + + exc + Exception + + + ]]> + seq + Sequence + + + ${0:newtype};]]> + tseq + Typedef Sequence + + diff --git a/plugins/snippets/data/java.xml b/plugins/snippets/data/java.xml new file mode 100755 index 00000000..043a5dd3 --- /dev/null +++ b/plugins/snippets/data/java.xml @@ -0,0 +1,91 @@ + + + + + const def + cd + + + + if .. else + ife + + + + if + if + + + + logger + log + + + + try .. catch .. finally + tcf + + + + while statement + while + + + + main + main + + + + System.out.println + sout + + + + t]]> + Wrap Selection in Try/Catch + + + + tc + try .. catch + + diff --git a/plugins/snippets/data/javascript.xml b/plugins/snippets/data/javascript.xml new file mode 100755 index 00000000..c1d498a6 --- /dev/null +++ b/plugins/snippets/data/javascript.xml @@ -0,0 +1,11 @@ + + + + + function + fun + + diff --git a/plugins/snippets/data/lang/Makefile.am b/plugins/snippets/data/lang/Makefile.am new file mode 100755 index 00000000..8a497c12 --- /dev/null +++ b/plugins/snippets/data/lang/Makefile.am @@ -0,0 +1,9 @@ +# Python snippets plugin +lang_DATA = \ + snippets.lang + +langdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets/lang + +EXTRA_DIST = $(lang_DATA) + +-include $(top_srcdir)/git.mk diff --git a/plugins/snippets/data/lang/snippets.lang b/plugins/snippets/data/lang/snippets.lang new file mode 100755 index 00000000..81e57394 --- /dev/null +++ b/plugins/snippets/data/lang/snippets.lang @@ -0,0 +1,162 @@ + + +