From 12e2fc69f9b7698f19ab21d98f92151029c669fb Mon Sep 17 00:00:00 2001 From: Kenny Ballou Date: Tue, 7 Aug 2018 16:59:49 -0600 Subject: sakura: convert repository to git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a repository conversion of sakura, a VTE based terminal emulator authored and maintained by David Gómez[0]. See the AUTHORS file for a more comprehensive list of contributors. Full history is not being imported since `bzr-git` and `fast-import` plugins seem to be broken. To get a full history before this point, please refer to the original Bazaar repository on launchpad[1]. [0]: mailto:david@pleyades.net [1]: https://launchpad.net/sakura --- AUTHORS | 74 ++ CMakeLists.txt | 76 ++ GPL | 345 +++++ INSTALL | 81 ++ po/CMakeLists.txt | 36 + po/POTFILES.in | 1 + po/ca.po | 247 ++++ po/cs.po | 243 ++++ po/de.po | 249 ++++ po/en_GB.po | 244 ++++ po/es.po | 241 ++++ po/fr.po | 243 ++++ po/he.po | 269 ++++ po/hr.po | 254 ++++ po/hu.po | 242 ++++ po/it.po | 247 ++++ po/ja.po | 241 ++++ po/ko.po | 244 ++++ po/pl.po | 243 ++++ po/pt.po | 248 ++++ po/pt_BR.po | 246 ++++ po/ru.po | 239 ++++ po/sv.po | 245 ++++ po/uk.po | 255 ++++ po/zh_CN.po | 244 ++++ sakura.desktop | 99 ++ sakura.pod | 199 +++ src/sakura.c | 3536 ++++++++++++++++++++++++++++++++++++++++++++++++++++ terminal-tango.svg | 498 ++++++++ 29 files changed, 9629 insertions(+) create mode 100644 AUTHORS create mode 100644 CMakeLists.txt create mode 100644 GPL create mode 100644 INSTALL create mode 100644 po/CMakeLists.txt create mode 100644 po/POTFILES.in create mode 100644 po/ca.po create mode 100644 po/cs.po create mode 100644 po/de.po create mode 100644 po/en_GB.po create mode 100644 po/es.po create mode 100644 po/fr.po create mode 100644 po/he.po create mode 100644 po/hr.po create mode 100644 po/hu.po create mode 100644 po/it.po create mode 100644 po/ja.po create mode 100644 po/ko.po create mode 100644 po/pl.po create mode 100644 po/pt.po create mode 100644 po/pt_BR.po create mode 100644 po/ru.po create mode 100644 po/sv.po create mode 100644 po/uk.po create mode 100644 po/zh_CN.po create mode 100644 sakura.desktop create mode 100644 sakura.pod create mode 100644 src/sakura.c create mode 100644 terminal-tango.svg diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..ca11573 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,74 @@ +Main author +============ + + David Gómez Espinosa + +Contributors +============ + + Tom Adams + Fábio Antunes + Szervác Attila + Mattia Bertoni + Mario Blättermann + Iain Bucław + Kang Bundo + Tim Bynum + Costin Chirvasuta + Isratine Citizen + Álex Cornejo + Eric Davis + Fabio Di Matteo + Nicola Fontana + Aleksey Frolov atommixz@gmail.com + Dávid Gábor Bodor + Thibaut Girka + Josh Glover + Grindhold + Stefan Haller + Jen Yee Hong + Itn + Jordi Jané Cardo + David Jensen + Adam Juraszek + Lado Kumsiashvili + Lukáš Lommer + Torbjörn Lönnemark + Yannick LM + Michał Łuszczyk + Calvin M + Enric Morales + Thorsten Mühlfelder + Rafał Mużyło + Dmitry N. Shilov + Erik Nelson + Raúl Núñez de Arenas + Dražen Odobašić + Marc-Antoine Perennou + Kalle Raiskila + Sebastian Reichel + Páder Rezső + Aurélien Riviere + Andreas Rönnquist + Iñigo Serna + Andrew Starr-Bochicchio + Tenzing + Sergey Tominov + Fabrice Thiroux + Hiroshi Utumi + Pável Varela Rodríguez + Evgenij Vdovin + Jesper Wallin + Aron Xu + Yuanyelele + Chidambar Zinnoury + + +Artwork +======= + + Terminal icon was created by the Tango Desktop Project: + http://tango.freedesktop.org + + + If you're not here, cry loud and send me an email ;) : diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3d43426 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,76 @@ +CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) +CMAKE_POLICY(SET CMP0005 NEW) +PROJECT (sakura) +SET (AUTHOR "David Gómez Espinosa" INTERNAL "Author") +SET (VERSION "3.6.0") + + +INCLUDE (FindPkgConfig) + +IF (NOT PKG_CONFIG_FOUND) + MESSAGE (FATAL_ERROR "pkg-config not found...") +ENDIF (NOT PKG_CONFIG_FOUND) + +pkg_check_modules (GLIB REQUIRED glib-2.0>=2.40) +IF (NOT GLIB_FOUND) + MESSAGE(FATAL_ERROR "You don't seem to have glib >= 2.40 development libraries installed...") +ENDIF (NOT GLIB_FOUND) + +pkg_check_modules (GTK REQUIRED gtk+-3.0>=3.20) +IF (NOT GTK_FOUND) + MESSAGE(FATAL_ERROR "You don't seem to have gtk >= 3.20 development libraries installed...") +ENDIF (NOT GTK_FOUND) + +pkg_check_modules (VTE REQUIRED vte-2.91>=0.50) +IF (NOT VTE_FOUND) + MESSAGE(FATAL_ERROR "You don't seem to have vte >= 0.50 development libraries installed...") +ENDIF (NOT VTE_FOUND) + +pkg_check_modules (X11 REQUIRED x11) +IF (NOT X11_FOUND) + MESSAGE(FATAL_ERROR "You don't seem to have x11 development libraries installed...") +ENDIF (NOT X11_FOUND) + +FIND_PROGRAM(POD2MAN pod2man) +MESSAGE ("pod2man executable is" ${POD2MAN}) + +ADD_DEFINITIONS (-DVERSION="${VERSION}") +ADD_DEFINITIONS (-DDATADIR="${CMAKE_INSTALL_PREFIX}/share") +ADD_DEFINITIONS (-DBUILDTYPE="${CMAKE_BUILD_TYPE}") + +IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") +ELSE (${CMAKE_BUILD_TYPE} NOT MATCHES "Debug") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wno-deprecated-declarations") +ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + +INCLUDE_DIRECTORIES (. ${GTK_INCLUDE_DIRS} ${VTE_INCLUDE_DIRS}) +LINK_DIRECTORIES (${GTK_LIBRARY_DIRS} ${VTE_LIBRARY_DIRS} ${X11_LIBRARY_DIRS}) +LINK_LIBRARIES (${GTK_LIBRARIES} ${VTE_LIBRARIES} ${X11_LIBRARIES} m) +ADD_EXECUTABLE (sakura src/sakura.c) + +ADD_SUBDIRECTORY (po) + +INSTALL (TARGETS sakura RUNTIME DESTINATION bin) +INSTALL (FILES sakura.desktop DESTINATION share/applications) +INSTALL (FILES terminal-tango.svg DESTINATION share/pixmaps) +IF (POD2MAN) + INSTALL (FILES ${sakura_BINARY_DIR}/sakura.1 DESTINATION share/man/man1) +ENDIF (POD2MAN) +INSTALL (FILES INSTALL DESTINATION share/doc/sakura) + +FILE (GLOB MO_FILES po/*.mo) + +SET_DIRECTORY_PROPERTIES (PROPERTIES + ADDITIONAL_MAKE_CLEAN_FILES "${MO_FILES};po/sakura.pot") +SET (EXECUTABLE_OUTPUT_PATH src) + +ADD_CUSTOM_TARGET (distclean + rm -f Makefile cmake_install.cmake CMakeCache.txt install_manifest.txt sakura.1 + COMMAND rm -f po/*.mo po/sakura.pot po/Makefile po/cmake_install.cmake + COMMAND rm -rf CMakeFiles po/CMakeFiles) + +IF (POD2MAN) +ADD_CUSTOM_TARGET(man ALL + COMMAND ${POD2MAN} -u --section=1 --release=${VERSION} --center '' ${sakura_SOURCE_DIR}/sakura.pod sakura.1) +ENDIF (POD2MAN) diff --git a/GPL b/GPL new file mode 100644 index 0000000..82a4501 --- /dev/null +++ b/GPL @@ -0,0 +1,345 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 +Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor +Boston, MA 02110-1301 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) 19yy + + 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 Street, Fifth Floor, Boston, MA 02110-1301 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) 19yy 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/INSTALL b/INSTALL new file mode 100644 index 0000000..060b20c --- /dev/null +++ b/INSTALL @@ -0,0 +1,81 @@ +Installing sakura +=============== + +* How to compile and install this beast ? + + $ cmake . + $ make + $ su -c 'make install' + + sakura now uses the CMake building system (RIP our old system MOBS, we'll remember you ;)). + + To install sakura with a different prefix, cmake needs to be invoked with the proper environment + variables, so to install sakura in /usr, you must type: + + $ cmake -DCMAKE_INSTALL_PREFIX=/usr . + + Use CMAKE_BUILD_TYPE=Debug if you need debug symbols. Default type is "Release". + + +Keybindings support +=================== + + sakura supports keyboard bindings in its config file (~/.config/sakura/sakura.conf), but there's + no GUI to edit them, so plese use your favourite editor to change the following properties: + + Accelerators: + + Accelerators can be set to any mask value from the GdkModifierType in gdktypes.h. For reference look at: + https://github.com/GNOME/gtk/blob/master/gdk/gdktypes.h + + Quick reference: Shift(1), Cps-Lock(2), Ctrl(4), Alt(8), Ctrl-S (5), Ctrl-A(12), Ctrl-A-S(13) + + Mask values can be combined by ORing them. For example, to set the delete tab accelerator to Ctrl+Shift, + set "del_tab_accelerator=5". GDK_SHIFT_MASK has a value of 1 (1 << 0), and GDK_CONTROL_MASK has a value of + 4 (1 << 2), so ORing them and you got 5 for Ctrl+Shift. + + I realise that this configuration is not user-friendly, but :) + + Keys: + + For example, to set the add tab key to 'T': + add_tab_key=T + + + Defaults: + + Ctrl + Shift + T -> New tab + Ctrl + Shift + W -> Close current tab + Ctrl + Shift + C -> Copy selected text + Ctrl + Shift + V -> Paste selected text + Ctrl + Shift + N -> Set tab name + + Ctr + Left cursor -> Previous tab + Ctr + Right cursor -> Next tab + Ctr + Shift + Left cursor -> Move tab to the left + Ctr + Shift + Right cursor -> Move tab to the right + Ctrl + [1-9] -> Switch to tab N (1-9) + + Ctrl + Shift + S -> Toggle/Untoggle scrollbar + Ctrl + Shift + Mouse left button -> Open link + F11 -> Fullscreen + Shift + PageUp -> Move up through scrollback by page + Shift + PageDown -> Move down through scrollback by page + Ctrl + Shift + Up -> Move up through scrollback by line + Ctrl + Shift + Down -> Move down through scrollback by line + Ctrl + Shift + [F1-F6] -> Select the colorset for the current tab + + You can also increase and decrease the font size in the GTK+ + standard way (not configurable): + + Ctrl + '+' -> Increase font size + Ctrl + '-' -> Decrease font size + + + +-- + +Enjoy sakura! + + + diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..a710347 --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,36 @@ +# Localization +FIND_PROGRAM(XGETTEXT xgettext) +FIND_PROGRAM(MSGFMT msgfmt) +FIND_PROGRAM(MSGMERGE msgmerge) + +IF(NOT MSGFMT) + MESSAGE( "------ + NOTE: msgfmt not found. Translations will *not* be installed + ------") +ELSE(NOT MSGFMT) + + SET(catalogname sakura) + + FILE (GLOB PO_FILES *.po) + FILE (GLOB SOURCES ../src/*.c) + + ADD_CUSTOM_TARGET(translations ALL) + + ADD_CUSTOM_COMMAND(TARGET translations + COMMAND ${XGETTEXT} -o sakura.pot --keyword=_ --keyword=N_ --no-location --from-code=utf-8 ${SOURCES} + DEPENDS ${_poFile}) + FOREACH(_poFile ${PO_FILES}) + GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE) + SET(_moFile ${_lang}.mo) + ADD_CUSTOM_COMMAND(TARGET translations + COMMAND ${MSGMERGE} -q -U ${_poFile} --backup=none sakura.pot + COMMAND ${MSGFMT} --check -o ${_moFile} ${_poFile} + DEPENDS ${_poFile}) + INSTALL(FILES ${CMAKE_BINARY_DIR}/po/${_moFile} + DESTINATION share/locale/${_lang}/LC_MESSAGES/ + RENAME ${catalogname}.mo) + ENDFOREACH(_poFile ${PO_FILES}) + +ENDIF(NOT MSGFMT) + + diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..776037c --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1 @@ +src/sakura.c diff --git a/po/ca.po b/po/ca.po new file mode 100644 index 0000000..214b1e3 --- /dev/null +++ b/po/ca.po @@ -0,0 +1,247 @@ +# Copyright (C) 2006 +# This file is distributed under the same license as the sakura package. +# David Gómez +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Jordi Jané Cardo \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Imprimir el número de versió" + +msgid "Select initial terminal font" +msgstr "Sel·leccionar el tipus de font inicial" + +msgid "Select initial number of tabs" +msgstr "Sel·leccionar el número inicial de pestanyes" + +#, fuzzy +msgid "Set working directory" +msgstr "Definir el cursor" + +msgid "Execute command" +msgstr "Executa l'ordre" + +msgid "Execute command (last option in the command line)" +msgstr "" + +msgid "Login shell" +msgstr "Entrada d'usuari en Shell" + +msgid "Set window title" +msgstr "Definir el nom de la finestra" + +#, fuzzy +msgid "Set window icon" +msgstr "Definir el nom de la finestra" + +msgid "Set columns number" +msgstr "Definir el nombre de columnes" + +msgid "Set rows number" +msgstr "Definir el nombre de linies" + +msgid "Hold window after execute command" +msgstr "Mantenir la finestra després de l'execució del comandament" + +msgid "Maximize window" +msgstr "Maximitza la finestra" + +msgid "Fullscreen mode" +msgstr "Pantalla complèta" + +msgid "Use alternate configuration file" +msgstr "" + +#, fuzzy +msgid "Select initial colorset" +msgstr "Sel·leccionar color" + +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Hi ha processos executant-se.\n" +"\n" +"Realment desitgeu tancar Sakura?" + +msgid "Select font" +msgstr "Sel·leccioni font" + +msgid "Set tab name" +msgstr "" + +msgid "_Cancel" +msgstr "_Cancel·la" + +msgid "_Apply" +msgstr "_Aplica" + +msgid "New text" +msgstr "Nou text" + +#, fuzzy +msgid "Select colors" +msgstr "Sel·leccionar color" + +msgid "_Select" +msgstr "_Selecciona" + +msgid "Colorset" +msgstr "" + +msgid "Foreground color" +msgstr "Color de font" + +msgid "Background color" +msgstr "Color de fons" + +msgid "Cursor color" +msgstr "Color del cursor" + +#, fuzzy +msgid "Opacity level (%)" +msgstr "Nivell d'opacitat (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Definiu el nom de la finestra" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Hi ha processos en marxa en aquest terminal.\n" +"\n" +"Realment desitgeu tarncar-la?" + +#, fuzzy +msgid "Open mail" +msgstr "Obrir enllaç" + +msgid "Open link" +msgstr "Obrir enllaç" + +msgid "Copy link" +msgstr "Copia enllaç" + +msgid "New tab" +msgstr "Nova pestanya" + +msgid "Set tab name..." +msgstr "" + +msgid "Close tab" +msgstr "Tancar pestanya" + +msgid "Full screen" +msgstr "Pantalla complèta" + +msgid "Copy" +msgstr "Copiar" + +msgid "Paste" +msgstr "Enganxar" + +msgid "Select font..." +msgstr "Sel·leccionar font..." + +msgid "Select colors..." +msgstr "Sel·leccionar colors..." + +msgid "Set window title..." +msgstr "Definir el nom de la finestra" + +msgid "Options" +msgstr "Opcions" + +msgid "More" +msgstr "Més" + +msgid "Always show tab bar" +msgstr "Mostra sempre la barra de pestanyes" + +msgid "Tabs at bottom" +msgstr "Pestanyes a la part baixa." + +msgid "Show close button on tabs" +msgstr "Mostrar el botó de tancament de pestanya" + +msgid "Show scrollbar" +msgstr "Mostrar la barra de desplaçament" + +msgid "Don't show exit dialog" +msgstr "" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Definir la senyal acústica" + +msgid "Set audible bell" +msgstr "Definir la senyal acústica" + +msgid "Set blinking cursor" +msgstr "Definir el cursor" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "" + +msgid "Block" +msgstr "Bloc" + +msgid "Underline" +msgstr "Subratllat" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Definir paleta de colors" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Missatge d'error" + +#, fuzzy, c-format +msgid "Cannot change working directory\n" +msgstr "Definir el cursor" + +msgid "- vte-based terminal emulator" +msgstr "- emulador de terminal basat en libvte" + +# c-format +#, c-format +msgid "sakura version is %s\n" +msgstr "La versió de sakura és %s\n" diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 0000000..5e0786e --- /dev/null +++ b/po/cs.po @@ -0,0 +1,243 @@ +# Czech translation of sakura. +# Copyright (C) 2006 THE sakura'S COPYRIGHT HOLDER +# This file is distributed under the same license as the sakura package. +# Lucas Lommer , 2006, 2009, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura 2.3.8\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Vytiskne informaci o verzi" + +msgid "Select initial terminal font" +msgstr "Volba výchozího písma terminálu" + +msgid "Select initial number of tabs" +msgstr "Výchozí počet karet" + +msgid "Set working directory" +msgstr "Nastavit pracovní složku" + +msgid "Execute command" +msgstr "Spustit příkaz" + +msgid "Execute command (last option in the command line)" +msgstr "" + +msgid "Login shell" +msgstr "Přihlašovací shell" + +msgid "Set window title" +msgstr "Nastaví titulek okna" + +msgid "Set window icon" +msgstr "Nastavit ikonu okna" + +msgid "Set columns number" +msgstr "Nastaví počet sloupců" + +msgid "Set rows number" +msgstr "Nastaví počet řádek" + +msgid "Hold window after execute command" +msgstr "Zachovat okno po vykonání příkazu" + +msgid "Maximize window" +msgstr "Maximalizovat okno" + +msgid "Fullscreen mode" +msgstr "Na celou obrazovku" + +msgid "Use alternate configuration file" +msgstr "Použít alternativní soubor s nastaveními" + +msgid "Select initial colorset" +msgstr "Vybrat počáteční sadu barev" + +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Aplikace obsahuje běžící procesy.\n" +"\n" +"Opravdu chcete ukončit aplikaci Sakura?" + +msgid "Select font" +msgstr "Zvolte písmo" + +msgid "Set tab name" +msgstr "Nastavit název panelu" + +msgid "_Cancel" +msgstr "_Storno" + +msgid "_Apply" +msgstr "_Použít" + +msgid "New text" +msgstr "Nový text" + +msgid "Select colors" +msgstr "Vybrat barvy" + +msgid "_Select" +msgstr "_Vybrat" + +msgid "Colorset" +msgstr "" + +msgid "Foreground color" +msgstr "Barva popředí" + +msgid "Background color" +msgstr "Barva pozadí" + +msgid "Cursor color" +msgstr "Barva kurzoru" + +#, fuzzy +msgid "Opacity level (%)" +msgstr "Úroveň průhlednosti (%):" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Název nového okna" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"V tomto terminálu běží proces.\n" +"\n" +"Opravdu jej chcete uzavřít?" + +msgid "Open mail" +msgstr "Otevřít e-mail" + +msgid "Open link" +msgstr "Otevřít odkaz" + +msgid "Copy link" +msgstr "Zkopírovat odkaz" + +msgid "New tab" +msgstr "Nová karta" + +msgid "Set tab name..." +msgstr "Nastavit název panelu…" + +msgid "Close tab" +msgstr "Zavřít kartu" + +msgid "Full screen" +msgstr "Celá obrazovka" + +msgid "Copy" +msgstr "Kopírovat" + +msgid "Paste" +msgstr "Vložit" + +msgid "Select font..." +msgstr "Zvolte písmo…" + +msgid "Select colors..." +msgstr "Zvolte barvy…" + +msgid "Set window title..." +msgstr "Nastavit název okna…" + +msgid "Options" +msgstr "Volby" + +msgid "More" +msgstr "Více" + +msgid "Always show tab bar" +msgstr "Vždy zobrazit lištu karet" + +msgid "Tabs at bottom" +msgstr "Panely dole" + +msgid "Show close button on tabs" +msgstr "Zobrazovat na panelech zavírací tlačítko" + +msgid "Show scrollbar" +msgstr "Zobrazit posuvník" + +msgid "Don't show exit dialog" +msgstr "" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Nastavit akustické upozornění" + +msgid "Set audible bell" +msgstr "Nastavit akustické upozornění" + +msgid "Set blinking cursor" +msgstr "Nastavit blikající kurzor" + +msgid "Enable bold font" +msgstr "Zapnout tučné písmo" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "Nastavit typ kurzoru" + +msgid "Block" +msgstr "Blokový" + +msgid "Underline" +msgstr "Podtržítko" + +msgid "IBeam" +msgstr "Svislá čára" + +msgid "Set palette" +msgstr "Nastavit paletu" + +#, c-format +msgid "Terminal %d" +msgstr "Terminál %d" + +msgid "Error message" +msgstr "Chybové hlášení" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "Nepodařilo se změnit pracovní složku\n" + +msgid "- vte-based terminal emulator" +msgstr "- emulátor terminálu založený na VTE" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura verze %s\n" diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..54ecffe --- /dev/null +++ b/po/de.po @@ -0,0 +1,249 @@ +# German translation for Sakura. +# Copyright (C) 2008 David Gómez +# This file is distributed under the same license as the Sakura package. +# Mario Blättermann , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: 2.3.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Deutsch \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Versionsnummer anzeigen" + +msgid "Select initial terminal font" +msgstr "Terminalschrift beim Programmstart auswählen" + +msgid "Select initial number of tabs" +msgstr "Anzahl der Reiter beim Programmstart wählen" + +msgid "Set working directory" +msgstr "" + +msgid "Execute command" +msgstr "Befehl ausführen" + +msgid "Execute command (last option in the command line)" +msgstr "" + +msgid "Login shell" +msgstr "Login-Shell" + +msgid "Set window title" +msgstr "Fenstertitel wählen" + +#, fuzzy +msgid "Set window icon" +msgstr "Fenstertitel wählen" + +msgid "Set columns number" +msgstr "Spaltennummer wählen" + +msgid "Set rows number" +msgstr "Zeilennummer wählen" + +msgid "Hold window after execute command" +msgstr "Fenster nach Ausführen des Befehls nicht schließen" + +msgid "Maximize window" +msgstr "" + +msgid "Fullscreen mode" +msgstr "Vollbild" + +msgid "Use alternate configuration file" +msgstr "Benutze alternative Konfigurationsdatei" + +#, fuzzy +msgid "Select initial colorset" +msgstr "Farbe wählen" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "" +"Die Konfiguration wurde durch einen anderen Prozess geändert. Soll sie " +"überschrieben werden?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Es laufen noch Prozesse.\n" +"\n" +"Wollen Sie Sakura wirklich beenden?" + +msgid "Select font" +msgstr "Schrift auswählen" + +msgid "Set tab name" +msgstr "Reiternamen setzen" + +msgid "_Cancel" +msgstr "A_bbrechen" + +msgid "_Apply" +msgstr "_Anwenden" + +msgid "New text" +msgstr "Neuer Text" + +#, fuzzy +msgid "Select colors" +msgstr "Farbe wählen" + +msgid "_Select" +msgstr "A_uswählen" + +msgid "Colorset" +msgstr "" + +msgid "Foreground color" +msgstr "Vordergrundfarbe" + +msgid "Background color" +msgstr "Hintergrundfarbe" + +msgid "Cursor color" +msgstr "Cursorfarbe" + +msgid "Opacity level (%)" +msgstr "Opazitätsgrad (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Fenstertitel wählen" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"In diesem Terminal läuft noch ein Prozess.\n" +"\n" +"Wollen Sie es wirklich beenden?" + +#, fuzzy +msgid "Open mail" +msgstr "Verweis öffnen" + +msgid "Open link" +msgstr "Verweis öffnen" + +msgid "Copy link" +msgstr "Verweis kopieren" + +msgid "New tab" +msgstr "Neuer Reiter" + +msgid "Set tab name..." +msgstr "Reiternamen setzen..." + +msgid "Close tab" +msgstr "Reiter schließen" + +msgid "Full screen" +msgstr "Vollbild" + +msgid "Copy" +msgstr "Kopieren" + +msgid "Paste" +msgstr "Einfügen" + +msgid "Select font..." +msgstr "Schrift wählen..." + +msgid "Select colors..." +msgstr "Farben wählen..." + +msgid "Set window title..." +msgstr "Fenstertitel wählen..." + +msgid "Options" +msgstr "Optionen" + +msgid "More" +msgstr "Weitere" + +msgid "Always show tab bar" +msgstr "Reiterleiste immer anzeigen" + +msgid "Tabs at bottom" +msgstr "Reiter unten" + +msgid "Show close button on tabs" +msgstr "„Schließen“-Knopf auf Reitern anzeigen" + +msgid "Show scrollbar" +msgstr "Bildlaufleiste anzeigen" + +msgid "Don't show exit dialog" +msgstr "Beenden-Dialog nicht anzeigen" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Hörbarer Alarm" + +msgid "Set audible bell" +msgstr "Hörbarer Alarm" + +msgid "Set blinking cursor" +msgstr "Blinkender Cursor" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "" + +msgid "Block" +msgstr "Blockieren" + +msgid "Underline" +msgstr "Unterstreichen" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Palette" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Fehlermeldung" + +#, fuzzy, c-format +msgid "Cannot change working directory\n" +msgstr "Blinkender Cursor" + +msgid "- vte-based terminal emulator" +msgstr "- vte-basierter Terminal-Emulator" + +#, c-format +msgid "sakura version is %s\n" +msgstr "Sakura-Version ist %s\n" diff --git a/po/en_GB.po b/po/en_GB.po new file mode 100644 index 0000000..d8d85b3 --- /dev/null +++ b/po/en_GB.po @@ -0,0 +1,244 @@ +# English (United Kingdom) translation for sakura +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the sakura package. +# FIRST AUTHOR , 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: English (United Kingdom) \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Print version number" + +msgid "Select initial terminal font" +msgstr "Select initial terminal font" + +msgid "Select initial number of tabs" +msgstr "Select initial number of tabs" + +msgid "Set working directory" +msgstr "Set working directory" + +msgid "Execute command" +msgstr "Execute command" + +msgid "Execute command (last option in the command line)" +msgstr "Execute command (last option in the command line)" + +msgid "Login shell" +msgstr "Login shell" + +msgid "Set window title" +msgstr "Set window title" + +msgid "Set window icon" +msgstr "Set window icon" + +msgid "Set columns number" +msgstr "Set columns number" + +msgid "Set rows number" +msgstr "Set rows number" + +msgid "Hold window after execute command" +msgstr "Hold window after execute command" + +msgid "Maximize window" +msgstr "Maximise window" + +msgid "Fullscreen mode" +msgstr "Full screen mode" + +msgid "Use alternate configuration file" +msgstr "Use alternate configuration file" + +msgid "Select initial colorset" +msgstr "Select initial colourset" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "Configuration has been modified by another proccess. Overwrite?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" + +msgid "Select font" +msgstr "Select font" + +msgid "Set tab name" +msgstr "Set tab name" + +msgid "_Cancel" +msgstr "_Cancel" + +msgid "_Apply" +msgstr "_Apply" + +msgid "New text" +msgstr "New text" + +msgid "Select colors" +msgstr "Select colours" + +msgid "_Select" +msgstr "_Select" + +msgid "Colorset" +msgstr "Colourset" + +msgid "Foreground color" +msgstr "Foreground colour" + +msgid "Background color" +msgstr "Background colour" + +msgid "Cursor color" +msgstr "Cursor colour" + +msgid "Opacity level (%)" +msgstr "Opacity level (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "New window title" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" + +#, fuzzy +msgid "Open mail" +msgstr "Open link" + +msgid "Open link" +msgstr "Open link" + +msgid "Copy link" +msgstr "Copy link" + +msgid "New tab" +msgstr "New tab" + +msgid "Set tab name..." +msgstr "Set tab name..." + +msgid "Close tab" +msgstr "Close tab" + +msgid "Full screen" +msgstr "Full screen" + +msgid "Copy" +msgstr "Copy" + +msgid "Paste" +msgstr "Paste" + +msgid "Select font..." +msgstr "Select font..." + +msgid "Select colors..." +msgstr "Select colours..." + +msgid "Set window title..." +msgstr "Set window title..." + +msgid "Options" +msgstr "Options" + +msgid "More" +msgstr "More" + +msgid "Always show tab bar" +msgstr "Always show tab bar" + +msgid "Tabs at bottom" +msgstr "Tabs at bottom" + +msgid "Show close button on tabs" +msgstr "Show close button on tabs" + +msgid "Show scrollbar" +msgstr "Show scrollbar" + +msgid "Don't show exit dialog" +msgstr "Don't show exit dialog" + +msgid "Set urgent bell" +msgstr "Set urgent bell" + +msgid "Set audible bell" +msgstr "Set audible bell" + +msgid "Set blinking cursor" +msgstr "Set blinking cursor" + +msgid "Enable bold font" +msgstr "Enable bold font" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "Disable numbered tabswitch" + +#, fuzzy +msgid "Enable focus fade" +msgstr "Enable bold font" + +msgid "Set cursor type" +msgstr "Set cursor type" + +msgid "Block" +msgstr "Block" + +msgid "Underline" +msgstr "Underline" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Set palette" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Error message" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "Cannot change working directory\n" + +msgid "- vte-based terminal emulator" +msgstr "- vte-based terminal emulator" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura version is %s\n" diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..77d8194 --- /dev/null +++ b/po/es.po @@ -0,0 +1,241 @@ +# Copyright (C) 2006 +# This file is distributed under the same license as the sakura package. +# David Gómez +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Imprimir número de versión" + +msgid "Select initial terminal font" +msgstr "Seleccionar el tipo de fuente inicial" + +msgid "Select initial number of tabs" +msgstr "Seleccionar el número inicial de pestañas" + +msgid "Set working directory" +msgstr "Establecer directorio actual" + +msgid "Execute command" +msgstr "Ejecutar orden" + +msgid "Execute command (last option in the command line)" +msgstr "Ejecutar comando (última opción en la linea de comandos)" + +msgid "Login shell" +msgstr "Shell de login" + +msgid "Set window title" +msgstr "Establecer nombre de ventana" + +msgid "Set window icon" +msgstr "Establecer icono de ventana" + +msgid "Set columns number" +msgstr "Establecer número de columnas" + +msgid "Set rows number" +msgstr "Establecer número de líneas" + +msgid "Hold window after execute command" +msgstr "Mantener la ventana tras el final del comando" + +msgid "Maximize window" +msgstr "Maximizar ventana" + +msgid "Fullscreen mode" +msgstr "Modo de pantalla completa" + +msgid "Use alternate configuration file" +msgstr "Usar fichero de configuración alternativo" + +msgid "Select initial colorset" +msgstr "Seleccionar grupo de colores inicial" + +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "La configuración ha sido modificada por otro proceso. ¿Sobreescribir?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Hay procesos en ejecución.\n" +"\n" +"¿Confirma que quiere cerrar Sakura?" + +msgid "Select font" +msgstr "Seleccionar tipo de letra" + +msgid "Set tab name" +msgstr "Establecer nombre de pestaña" + +msgid "_Cancel" +msgstr "_Cancelar" + +msgid "_Apply" +msgstr "_Aplicar" + +msgid "New text" +msgstr "Texto nuevo" + +msgid "Select colors" +msgstr "Seleccionar colores" + +msgid "_Select" +msgstr "_Seleccionar" + +msgid "Colorset" +msgstr "Grupo de colores" + +msgid "Foreground color" +msgstr "Color de primer plano" + +msgid "Background color" +msgstr "Color de fondo" + +msgid "Cursor color" +msgstr "Color del cursor" + +msgid "Opacity level (%)" +msgstr "Nivel de opacidad (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Título nuevo de la ventana" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Hay procesos en ejecución en este terminal.\n" +"\n" +"¿Confirma que quiere cerrarlo?" + +msgid "Open mail" +msgstr "Abrir correo" + +msgid "Open link" +msgstr "Abrir enlace" + +msgid "Copy link" +msgstr "Copiar enlace" + +msgid "New tab" +msgstr "Pestaña nueva" + +msgid "Set tab name..." +msgstr "Establecer nombre de pestaña..." + +msgid "Close tab" +msgstr "Cerrar pestaña" + +msgid "Full screen" +msgstr "Pantalla completa" + +msgid "Copy" +msgstr "Copiar" + +msgid "Paste" +msgstr "Pegar" + +msgid "Select font..." +msgstr "Seleccionar tipo de letra…" + +msgid "Select colors..." +msgstr "Seleccionar colores..." + +msgid "Set window title..." +msgstr "Establecer nombre de ventana..." + +msgid "Options" +msgstr "Opciones" + +msgid "More" +msgstr "Más" + +msgid "Always show tab bar" +msgstr "Mostrar siempre la barra de pestañas" + +msgid "Tabs at bottom" +msgstr "Pestañas en la parte inferior" + +msgid "Show close button on tabs" +msgstr "Mostrar botón de cerrar en las pestañas" + +msgid "Show scrollbar" +msgstr "Mostrar barra de desplazamiento" + +msgid "Don't show exit dialog" +msgstr "No mostrar el diálogo de salida" + +msgid "Set urgent bell" +msgstr "Activar campana de urgencia" + +msgid "Set audible bell" +msgstr "Activar campana audible" + +msgid "Set blinking cursor" +msgstr "Activar parpadeo del cursor" + +msgid "Enable bold font" +msgstr "Activar fuente en negrita" + +msgid "Stop tab cycling at end tabs" +msgstr "Detener rotación de pestañas en la pestaña final" + +msgid "Disable numbered tabswitch" +msgstr "Desactivar números para cambio de pestañas" + +#, fuzzy +msgid "Enable focus fade" +msgstr "Activar fuente en negrita" + +msgid "Set cursor type" +msgstr "Establecer tipo de cursor" + +msgid "Block" +msgstr "Bloque" + +msgid "Underline" +msgstr "Subrayado" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Establecer paleta" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Mensaje de error" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "No se puede cambiar el directorio actual\n" + +msgid "- vte-based terminal emulator" +msgstr "- emulador de terminal basado en libvte" + +# c-format +#, c-format +msgid "sakura version is %s\n" +msgstr "La versión de sakura es %s\n" diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..e07e0e2 --- /dev/null +++ b/po/fr.po @@ -0,0 +1,243 @@ +# This file is distributed under the same license as the sakura package. +# Fabrice Thiroux , 2008. +# +# +msgid "" +msgstr "" +"Project-Id-Version: sakura 1.2.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Afficher le numéro de version" + +msgid "Select initial terminal font" +msgstr "Sélectionner la police de caractères à utiliser au démarrage" + +msgid "Select initial number of tabs" +msgstr "Sélectionner le nombre d'onglets au démarrage" + +msgid "Set working directory" +msgstr "Définir le répertoire de travail" + +msgid "Execute command" +msgstr "Exécuter une commande" + +msgid "Execute command (last option in the command line)" +msgstr "Exécuter une commande (dernière option sur la ligne de commande)" + +msgid "Login shell" +msgstr "Shell de connexion" + +msgid "Set window title" +msgstr "Définir le titre de la fenêtre" + +msgid "Set window icon" +msgstr "Définir l'icône de fenêtre" + +msgid "Set columns number" +msgstr "Définir le nombre de colonnes" + +msgid "Set rows number" +msgstr "Définir le nombre de lignes" + +msgid "Hold window after execute command" +msgstr "Conserver la fenêtre après l'exécution d'une commande" + +msgid "Maximize window" +msgstr "Agrandir la fenêtre" + +msgid "Fullscreen mode" +msgstr "Mode plein écran" + +msgid "Use alternate configuration file" +msgstr "Utiliser un fichier de configuration alternatif" + +msgid "Select initial colorset" +msgstr "Sélectionner le jeu de couleurs initial" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "La configuration a été modifié par un autre processus. L'écraser ?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Il y a des processus actifs dans ce terminal.\n" +"\n" +"Voulez-vous vraiment le fermer ?" + +msgid "Select font" +msgstr "Sélectionner une police de caractères" + +msgid "Set tab name" +msgstr "Définir le titre de l'onglet" + +msgid "_Cancel" +msgstr "Ann_uler" + +msgid "_Apply" +msgstr "_Appliquer" + +msgid "New text" +msgstr "Nouveau texte" + +msgid "Select colors" +msgstr "Sélectionner les couleurs" + +msgid "_Select" +msgstr "_Sélectionner" + +msgid "Colorset" +msgstr "Jeu de couleurs" + +msgid "Foreground color" +msgstr "Couleur d'avant plan" + +msgid "Background color" +msgstr "Couleur d'arrière-plan" + +msgid "Cursor color" +msgstr "Couleur du curseur" + +msgid "Opacity level (%)" +msgstr "Niveau d'opacité (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Définir le titre de la fenêtre" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Il y a un processus actif dans ce terminal.\n" +"\n" +"Voulez-vous vraiment le fermer ?" + +#, fuzzy +msgid "Open mail" +msgstr "Ouvrir le lien" + +msgid "Open link" +msgstr "Ouvrir le lien" + +msgid "Copy link" +msgstr "Copier le lien" + +msgid "New tab" +msgstr "Nouvel onglet" + +msgid "Set tab name..." +msgstr "Définir le titre de l'onglet..." + +msgid "Close tab" +msgstr "Fermer l'onglet" + +msgid "Full screen" +msgstr "Plein écran" + +msgid "Copy" +msgstr "Copier" + +msgid "Paste" +msgstr "Coller" + +msgid "Select font..." +msgstr "Sélectionner la police de caractères..." + +msgid "Select colors..." +msgstr "Sélectionner les couleurs..." + +msgid "Set window title..." +msgstr "Définir le titre de la fenêtre..." + +msgid "Options" +msgstr "Options" + +msgid "More" +msgstr "Plus" + +msgid "Always show tab bar" +msgstr "Toujours afficher la barre d'onglets" + +msgid "Tabs at bottom" +msgstr "Onglets en bas" + +msgid "Show close button on tabs" +msgstr "Afficher le bouton fermer sur les onglets" + +msgid "Show scrollbar" +msgstr "Afficher la barre de défilement" + +msgid "Don't show exit dialog" +msgstr "Ne pas afficher les messages de sortie" + +msgid "Set urgent bell" +msgstr "Définir un avertissement d'urgence" + +msgid "Set audible bell" +msgstr "Définir un avertissement audio" + +msgid "Set blinking cursor" +msgstr "Définir un curseur clignotant" + +msgid "Enable bold font" +msgstr "Activer la police de caractères en gras" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +#, fuzzy +msgid "Enable focus fade" +msgstr "Activer la police de caractères en gras" + +msgid "Set cursor type" +msgstr "Définir le type de curseur" + +msgid "Block" +msgstr "Bloc" + +msgid "Underline" +msgstr "Souligner" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Sélectionner une palette de couleurs" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Message d'erreur" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "Impossible de changer le répertoire de travail\n" + +msgid "- vte-based terminal emulator" +msgstr "Émulateur de terminal utilisant VTE" + +#, c-format +msgid "sakura version is %s\n" +msgstr "Sakura version %s\n" diff --git a/po/he.po b/po/he.po new file mode 100644 index 0000000..ba6dfc7 --- /dev/null +++ b/po/he.po @@ -0,0 +1,269 @@ +# Hebrew translation for Sakura. +# Copyright (C) 2008 David Gómez +# This file is distributed under the same license as the sakura package. +# Isratine Citizen , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura 3.1.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Rahut \n" +"Language: he\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" +"X-Language: he\n" +"X-Source-Language: en\n" +"X-Poedit-Language: Hebrew\n" + +# CLI: Do not translate! +msgid "Print version number" +msgstr "Print version number" + +# CLI: Do not translate! +msgid "Select initial terminal font" +msgstr "Select initial terminal font" + +# CLI: Do not translate! +msgid "Select initial number of tabs" +msgstr "Select initial number of tabs" + +# CLI: Do not translate! +msgid "Set working directory" +msgstr "Set working directory" + +# CLI: Do not translate! +msgid "Execute command" +msgstr "Execute command" + +# CLI: Do not translate! +msgid "Execute command (last option in the command line)" +msgstr "Execute command (last option in the command line)" + +# CLI: Do not translate! +msgid "Login shell" +msgstr "Login shell" + +# CLI: Do not translate! +msgid "Set window title" +msgstr "Set window title" + +# CLI: Do not translate! +#, fuzzy +msgid "Set window icon" +msgstr "Set window title" + +# CLI: Do not translate! +msgid "Set columns number" +msgstr "Set columns number" + +# CLI: Do not translate! +msgid "Set rows number" +msgstr "Set rows number" + +# CLI: Do not translate! +msgid "Hold window after execute command" +msgstr "Hold window after execute command" + +# CLI: Do not translate! +msgid "Maximize window" +msgstr "Maximize window" + +# CLI: Do not translate! +msgid "Fullscreen mode" +msgstr "Fullscreen mode" + +# CLI: Do not translate! +msgid "Use alternate configuration file" +msgstr "Use alternate configuration file" + +#, fuzzy +msgid "Select initial colorset" +msgstr "בחר צבע" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "תצורה השתנתה על ידי תהליך אחר. להחליפו?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"קיימים תהליכים אשר כעת מורצים.\n" +"\n" +"האם אתה בטוח כי ברצונך לסגור את Sakura?" + +msgid "Select font" +msgstr "בחירת גופן" + +msgid "Set tab name" +msgstr "קביעת שם כרטיסייה" + +msgid "_Cancel" +msgstr "_ביטול" + +msgid "_Apply" +msgstr "_החל" + +msgid "New text" +msgstr "תמליל חדש" + +#, fuzzy +msgid "Select colors" +msgstr "בחר צבע" + +msgid "_Select" +msgstr "ב_חר" + +#, fuzzy +msgid "Colorset" +msgstr "חוג צבעים לעריכה" + +msgid "Foreground color" +msgstr "צבע קדמה" + +msgid "Background color" +msgstr "צבע רקע" + +msgid "Cursor color" +msgstr "צבע סמן" + +msgid "Opacity level (%)" +msgstr "רמת העמימות (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "כותרת חלון חדשה" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"קיים תהליך אשר כעת מורץ בתוך מסוף זה.\n" +"\n" +"האם אתה בטוח כי ברצונך לסגור אותו?" + +#, fuzzy +msgid "Open mail" +msgstr "פתח קישור" + +msgid "Open link" +msgstr "פתח קישור" + +msgid "Copy link" +msgstr "העתק קישור" + +msgid "New tab" +msgstr "כרטיסייה חדשה" + +msgid "Set tab name..." +msgstr "קבע שם כרטיסייה..." + +msgid "Close tab" +msgstr "סגור כרטיסייה" + +msgid "Full screen" +msgstr "מסך מלא" + +msgid "Copy" +msgstr "העתק" + +msgid "Paste" +msgstr "הדבק" + +msgid "Select font..." +msgstr "בחר גופן..." + +msgid "Select colors..." +msgstr "בחר צבעים..." + +msgid "Set window title..." +msgstr "קבע כותרת חלון..." + +msgid "Options" +msgstr "אפשרויות" + +msgid "More" +msgstr "עוד" + +msgid "Always show tab bar" +msgstr "הצג תמיד סרגל כרטיסיות" + +msgid "Tabs at bottom" +msgstr "כרטיסיות בתחתית" + +msgid "Show close button on tabs" +msgstr "הצג לחצן סגירה על כרטיסיות" + +msgid "Show scrollbar" +msgstr "הצג פס גלילה" + +msgid "Don't show exit dialog" +msgstr "אל תציג דו שיח יציאה" + +#, fuzzy +msgid "Set urgent bell" +msgstr "קבע פעמון שמיע" + +msgid "Set audible bell" +msgstr "קבע פעמון שמיע" + +msgid "Set blinking cursor" +msgstr "קבע סמן מהבהב" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "קבע טיפוס סמן" + +msgid "Block" +msgstr "קטע" + +msgid "Underline" +msgstr "קו תחתון" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "קבע לוח צבעים" + +#, c-format +msgid "Terminal %d" +msgstr "מסוף %d" + +msgid "Error message" +msgstr "הודעת שגיאה" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "אין אפשרות לשנות מדור עבודה\n" + +# CLI: Do not translate! +# - אמולטור מסוף מבוסס vte +msgid "- vte-based terminal emulator" +msgstr "- vte-based terminal emulator" + +# CLI: Do not translate! +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura version is %s\n" diff --git a/po/hr.po b/po/hr.po new file mode 100644 index 0000000..9f401a8 --- /dev/null +++ b/po/hr.po @@ -0,0 +1,254 @@ +# Copyright (C) 2006 +# This file is distributed under the same license as the sakura package. +# David Gómez +# +msgid "" +msgstr "" +"Project-Id-Version: Sakura 2.3.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: gogo \n" +"Language-Team: brentaal \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Ispiši inačicu" + +msgid "Select initial terminal font" +msgstr "Postavi početni font terminala" + +msgid "Select initial number of tabs" +msgstr "Postavi početni broj kartica" + +#, fuzzy +msgid "Set working directory" +msgstr "Koristi treptajući pokazivač" + +msgid "Execute command" +msgstr "Izvrši naredbu" + +msgid "Execute command (last option in the command line)" +msgstr "Izvršite naredbu (zadnja opcija u naredbenoj liniji)" + +msgid "Login shell" +msgstr "Prijavna ljuska" + +msgid "Set window title" +msgstr "Postavi naslov prozora" + +#, fuzzy +msgid "Set window icon" +msgstr "Postavi naslov prozora" + +msgid "Set columns number" +msgstr "Postavi broj stupaca" + +msgid "Set rows number" +msgstr "Postavi broj redaka" + +msgid "Hold window after execute command" +msgstr "Zadrži prozor nakon izvršavanja naredbe" + +msgid "Maximize window" +msgstr "" + +#, fuzzy +msgid "Fullscreen mode" +msgstr "Prikaz preko cijelog zaslona" + +msgid "Use alternate configuration file" +msgstr "Koristi alternativnu konfiguracijsku datoteku" + +#, fuzzy +msgid "Select initial colorset" +msgstr "Postavite boju" + +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Pokrenuti su procesi.\n" +"\n" +"Želite li zbilja zatvoriti Sakura aplikaciju?" + +msgid "Select font" +msgstr "Postavite font" + +msgid "Set tab name" +msgstr "Postavite ime kartice" + +msgid "_Cancel" +msgstr "" + +msgid "_Apply" +msgstr "" + +msgid "New text" +msgstr "Novi tekst" + +#, fuzzy +msgid "Select colors" +msgstr "Postavite boju" + +#, fuzzy +msgid "_Select" +msgstr "Postavite font" + +msgid "Colorset" +msgstr "" + +#, fuzzy +msgid "Foreground color" +msgstr "Odaberite boju fonta:" + +#, fuzzy +msgid "Background color" +msgstr "Odaberite boju pozadine:" + +#, fuzzy +msgid "Cursor color" +msgstr "Odaberite boju pozadine:" + +#, fuzzy +msgid "Opacity level (%)" +msgstr "Nivo zasićenosti (%):" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Novi naslov prozora" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Pokrenuti su procesi unutar ovog terminala.\n" +"\n" +"Želite li zbilja zatvoriti terminal?" + +#, fuzzy +msgid "Open mail" +msgstr "Otvori link..." + +#, fuzzy +msgid "Open link" +msgstr "Otvori link..." + +#, fuzzy +msgid "Copy link" +msgstr "Kopiraj link..." + +msgid "New tab" +msgstr "Nova kartica" + +msgid "Set tab name..." +msgstr "Postavite ime kartice..." + +msgid "Close tab" +msgstr "Zatvori karticu" + +msgid "Full screen" +msgstr "Prikaz preko cijelog zaslona" + +msgid "Copy" +msgstr "Kopiraj" + +msgid "Paste" +msgstr "Zalijepi" + +msgid "Select font..." +msgstr "Postavi font..." + +msgid "Select colors..." +msgstr "Postavi boje..." + +msgid "Set window title..." +msgstr "Postavi naslov prozora" + +msgid "Options" +msgstr "Mogućnosti" + +msgid "More" +msgstr "Više" + +msgid "Always show tab bar" +msgstr "Uvijek prikaži tablu s karticama" + +msgid "Tabs at bottom" +msgstr "Kartice na dnu" + +msgid "Show close button on tabs" +msgstr "Prikaži gumb za zatvaranje na karticama" + +msgid "Show scrollbar" +msgstr "Prikaži kliznu traku" + +msgid "Don't show exit dialog" +msgstr "Ne prikaži dijalog za izlazak" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Postavi zvučno zvono" + +msgid "Set audible bell" +msgstr "Postavi zvučno zvono" + +msgid "Set blinking cursor" +msgstr "Koristi treptajući pokazivač" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "Postavi tip kursora" + +msgid "Block" +msgstr "Blok" + +msgid "Underline" +msgstr "Podcrtano" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Postavi paletu" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Poruka o pogrešci" + +#, fuzzy, c-format +msgid "Cannot change working directory\n" +msgstr "Koristi treptajući pokazivač" + +msgid "- vte-based terminal emulator" +msgstr "- emulator terminala temeljen na vte-u" + +#, c-format +msgid "sakura version is %s\n" +msgstr "inačica Sakure je %s\n" diff --git a/po/hu.po b/po/hu.po new file mode 100644 index 0000000..69748c7 --- /dev/null +++ b/po/hu.po @@ -0,0 +1,242 @@ +# Copyright (C) 2006 +# This file is distributed under the same license as the sakura package. +# David Gómez +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: hu\n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Verziószám kiírása" + +msgid "Select initial terminal font" +msgstr "Alapértelmezett terminál font beállítása" + +msgid "Select initial number of tabs" +msgstr "Fülek alapértelmezett számának beállítása" + +msgid "Set working directory" +msgstr "Munkakönyvtár beállítása" + +msgid "Execute command" +msgstr "Parancs végrehajtása" + +msgid "Execute command (last option in the command line)" +msgstr "Parancs végrehajtása (utolsó opció a parancssorban)" + +msgid "Login shell" +msgstr "Bejelentkező shell" + +msgid "Set window title" +msgstr "Ablak címének beállítása" + +msgid "Set window icon" +msgstr "Ablak ikonjának beállítása" + +msgid "Set columns number" +msgstr "Oszlopok számának beállítása" + +msgid "Set rows number" +msgstr "Sorok számának beállítása" + +msgid "Hold window after execute command" +msgstr "Ablak megtartása a parancs végrehajtása után" + +msgid "Maximize window" +msgstr "Ablak maximalizálása" + +msgid "Fullscreen mode" +msgstr "Teljes képernyős mód" + +msgid "Use alternate configuration file" +msgstr "Alternatív konfigurációs fájl beállítása" + +msgid "Select initial colorset" +msgstr "Alapértelmezett színek beállítása" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "A konfigurációt egy másik folyamat módosította. Felülírja?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Még van futó folyamat.\n" +"\n" +"Valóban be akarja zárni a Sakura-t?" + +msgid "Select font" +msgstr "Betűkészlet kiválasztása" + +msgid "Set tab name" +msgstr "Fül nevének beállítása" + +msgid "_Cancel" +msgstr "_Mégse" + +msgid "_Apply" +msgstr "_Alkalmaz" + +msgid "New text" +msgstr "Új szöveg" + +msgid "Select colors" +msgstr "Színek kiválasztása" + +msgid "_Select" +msgstr "_Kiválasztás" + +msgid "Colorset" +msgstr "Színek" + +msgid "Foreground color" +msgstr "Előtér színe" + +msgid "Background color" +msgstr "Háttér színe" + +msgid "Cursor color" +msgstr "Kurzor színe" + +msgid "Opacity level (%)" +msgstr "Átlátszóság mértéke (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Új ablakcím" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"A terminálban még van futó folyamat.\n" +"\n" +"Valóban be akarja zárni?" + +#, fuzzy +msgid "Open mail" +msgstr "Link megnyitása" + +msgid "Open link" +msgstr "Link megnyitása" + +msgid "Copy link" +msgstr "Link másolása" + +msgid "New tab" +msgstr "Új fül" + +msgid "Set tab name..." +msgstr "Fül nevének beállítása..." + +msgid "Close tab" +msgstr "Lap bezárása" + +msgid "Full screen" +msgstr "Teljes képernyő" + +msgid "Copy" +msgstr "Másolás" + +msgid "Paste" +msgstr "Beillesztés" + +msgid "Select font..." +msgstr "Betűkészlet kiválasztása..." + +msgid "Select colors..." +msgstr "Színek kiválasztása..." + +msgid "Set window title..." +msgstr "Ablak címének beállítása..." + +msgid "Options" +msgstr "Beállítások" + +msgid "More" +msgstr "Továbbiak" + +msgid "Always show tab bar" +msgstr "Mindig jelenjen meg a fülsáv" + +msgid "Tabs at bottom" +msgstr "Fülek alul" + +msgid "Show close button on tabs" +msgstr "Bezárás gomb megjelenítése a füleken" + +msgid "Show scrollbar" +msgstr "Görgetősáv megjelenítése" + +msgid "Don't show exit dialog" +msgstr "Nincs kilépési megerősítés" + +msgid "Set urgent bell" +msgstr "Sürgős jelzés beállítása" + +msgid "Set audible bell" +msgstr "Hang lejátszása" + +msgid "Set blinking cursor" +msgstr "Villogó kurzor beállítása" + +msgid "Enable bold font" +msgstr "Vastag betű engedélyezése" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "Gyorsbillentyűs fülváltás tiltása" + +#, fuzzy +msgid "Enable focus fade" +msgstr "Vastag betű engedélyezése" + +msgid "Set cursor type" +msgstr "Kurzor típusának beállítása" + +msgid "Block" +msgstr "Blokk" + +msgid "Underline" +msgstr "Aláhúzás" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Paletta beállítása" + +#, c-format +msgid "Terminal %d" +msgstr "Terminál %d" + +msgid "Error message" +msgstr "Hibaüzenet" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "A munkakönyvtár nem módosítható\n" + +msgid "- vte-based terminal emulator" +msgstr "- vte alapú terminálemulátor" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura verzió: %s\n" diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..7492d12 --- /dev/null +++ b/po/it.po @@ -0,0 +1,247 @@ +# Copyright (C) 2006 +# This file is distributed under the same license as the sakura package. +# Fontana Nicola +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: sakura-it \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" +"X-Poedit-Country: ITALY\n" +"X-Poedit-Language: Italian\n" +"X-Poedit-SourceCharset: utf-8\n" + +msgid "Print version number" +msgstr "Stampa il numero di versione" + +msgid "Select initial terminal font" +msgstr "Seleziona il font iniziale" + +msgid "Select initial number of tabs" +msgstr "Seleziona il numero di schede iniziali" + +#, fuzzy +msgid "Set working directory" +msgstr "Imposta il cursore lampeggiante" + +msgid "Execute command" +msgstr "Esegui il comando" + +msgid "Execute command (last option in the command line)" +msgstr "Esegui il comando (l'ultima scelta nella riga di comando)" + +msgid "Login shell" +msgstr "Shell di login" + +msgid "Set window title" +msgstr "Imposta il titolo della finestra" + +msgid "Set window icon" +msgstr "Imposta l'icona della finestra" + +msgid "Set columns number" +msgstr "Imposta il numero di colonne" + +msgid "Set rows number" +msgstr "Imposta il numero di righe" + +msgid "Hold window after execute command" +msgstr "Blocca la finestra dopo l'esecuzione di un comando" + +msgid "Maximize window" +msgstr "Massimizza finestra" + +msgid "Fullscreen mode" +msgstr "Modalità a schermo intero" + +msgid "Use alternate configuration file" +msgstr "Usa un file di configurazione alternativo" + +msgid "Select initial colorset" +msgstr "Seleziona insieme iniziale di colori" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "" +"La configurazione è stata modificata da un altro processo. Sovrascrivere?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Ci sono dei processi in esecuzione.\n" +"\n" +"Vuoi davvero chiudere Sakura?" + +msgid "Select font" +msgstr "Seleziona il font" + +msgid "Set tab name" +msgstr "Imposta il nome della scheda" + +msgid "_Cancel" +msgstr "_Annulla" + +msgid "_Apply" +msgstr "_Applica" + +msgid "New text" +msgstr "Nuovo testo" + +msgid "Select colors" +msgstr "Seleziona i colori" + +msgid "_Select" +msgstr "_Seleziona" + +msgid "Colorset" +msgstr "Insieme di colori" + +msgid "Foreground color" +msgstr "Colore del testo" + +msgid "Background color" +msgstr "Colore dello sfondo" + +msgid "Cursor color" +msgstr "Colore del cursore" + +msgid "Opacity level (%)" +msgstr "Livello di opacità (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Nuovo titolo della finestra" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"C'è un processo in esecuzione in questo terminale.\n" +"\n" +"Vuoi davvero chiudere Sakura?" + +#, fuzzy +msgid "Open mail" +msgstr "Apri collegamento" + +msgid "Open link" +msgstr "Apri collegamento" + +msgid "Copy link" +msgstr "Copia collegamento" + +msgid "New tab" +msgstr "Nuova scheda" + +msgid "Set tab name..." +msgstr "Imposta il nome di la scheda" + +msgid "Close tab" +msgstr "Chiudi la scheda" + +msgid "Full screen" +msgstr "Schermo intero" + +msgid "Copy" +msgstr "Copia" + +msgid "Paste" +msgstr "Incolla" + +msgid "Select font..." +msgstr "Seleziona il font..." + +msgid "Select colors..." +msgstr "Seleziona i colori..." + +msgid "Set window title..." +msgstr "Imposta il titolo della finestra..." + +msgid "Options" +msgstr "Opzioni" + +msgid "More" +msgstr "Altro" + +msgid "Always show tab bar" +msgstr "Mostra sempre la barra delle schede" + +msgid "Tabs at bottom" +msgstr "Schede in basso" + +msgid "Show close button on tabs" +msgstr "Mostra il pulsante di chiusura sulle schede" + +msgid "Show scrollbar" +msgstr "Visualizza la barra di scorrimento" + +msgid "Don't show exit dialog" +msgstr "Non mostrare il dialogo di uscita" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Imposta l'avviso acustico" + +msgid "Set audible bell" +msgstr "Imposta l'avviso acustico" + +msgid "Set blinking cursor" +msgstr "Imposta il cursore lampeggiante" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "Imposta il modello di cursore" + +msgid "Block" +msgstr "Blocco" + +msgid "Underline" +msgstr "Sottolineato" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Imposta la tavolozza dei colori" + +#, c-format +msgid "Terminal %d" +msgstr "Terminale %d" + +msgid "Error message" +msgstr "Messaggio d'errore" + +#, fuzzy, c-format +msgid "Cannot change working directory\n" +msgstr "Imposta il cursore lampeggiante" + +msgid "- vte-based terminal emulator" +msgstr "- emulatore di terminale basato su VTE" + +#, c-format +msgid "sakura version is %s\n" +msgstr "La versione di Sakura è %s\n" diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 0000000..77fc0f8 --- /dev/null +++ b/po/ja.po @@ -0,0 +1,241 @@ +# translation of ja.po to Japanese +# UTUMI Hirosi , 2006, 2008. +msgid "" +msgstr "" +"Project-Id-Version: ja\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "バージョン番号を表示" + +msgid "Select initial terminal font" +msgstr "ターミナルのフォントを選択" + +msgid "Select initial number of tabs" +msgstr "タブの数を選択" + +msgid "Set working directory" +msgstr "作業ディレクトリを設定" + +msgid "Execute command" +msgstr "コマンドを実行" + +msgid "Execute command (last option in the command line)" +msgstr "コマンドを実行(コマンド行の最終オプション)" + +msgid "Login shell" +msgstr "ログインシェル" + +msgid "Set window title" +msgstr "ウィンドウタイトルを設定" + +msgid "Set window icon" +msgstr "ウィンドウアイコンを設定" + +msgid "Set columns number" +msgstr "列数を設定" + +msgid "Set rows number" +msgstr "行数を設定" + +msgid "Hold window after execute command" +msgstr "実行コマンドの後ウインドウ食い止める" + +msgid "Maximize window" +msgstr "ウィンドウを最大化" + +msgid "Fullscreen mode" +msgstr "フルスクリーンモード" + +msgid "Use alternate configuration file" +msgstr "別の設定ファイルを使用する" + +msgid "Select initial colorset" +msgstr "初カラーセットを選択" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "他のプロセスによって設定が変えられています。上書きしますか?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"実行中のプロセスがあります。\n" +"\n" +"本当にsakuraを終了しますか?" + +msgid "Select font" +msgstr "フォントを選択" + +msgid "Set tab name" +msgstr "タブの名前を設定" + +msgid "_Cancel" +msgstr "キャンセル(_C)" + +msgid "_Apply" +msgstr "適用(_A)" + +msgid "New text" +msgstr "新規テキスト" + +msgid "Select colors" +msgstr "色を選択" + +msgid "_Select" +msgstr "選択(_S)" + +msgid "Colorset" +msgstr "カラーセット" + +msgid "Foreground color" +msgstr "前景色" + +msgid "Background color" +msgstr "背景色" + +msgid "Cursor color" +msgstr "カーソルの色" + +msgid "Opacity level (%)" +msgstr "不透過率 (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "新しいウィンドウタイトル" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"この端末には実行中のプロセスがあります。\n" +"\n" +"本当に閉じますか?" + +#, fuzzy +msgid "Open mail" +msgstr "リンクを開く" + +msgid "Open link" +msgstr "リンクを開く" + +msgid "Copy link" +msgstr "リンクをコピー" + +msgid "New tab" +msgstr "新規タブ" + +msgid "Set tab name..." +msgstr "タブの名前を設定..." + +msgid "Close tab" +msgstr "タブを閉じる" + +msgid "Full screen" +msgstr "フルスクリーン" + +msgid "Copy" +msgstr "コピー" + +msgid "Paste" +msgstr "貼り付け" + +msgid "Select font..." +msgstr "フォントを選択..." + +msgid "Select colors..." +msgstr "色を選択..." + +msgid "Set window title..." +msgstr "ウィンドウのタイトルを設定..." + +msgid "Options" +msgstr "設定" + +msgid "More" +msgstr "さらに" + +msgid "Always show tab bar" +msgstr "タブバーを常に表示" + +msgid "Tabs at bottom" +msgstr "タブを下に表示" + +msgid "Show close button on tabs" +msgstr "タブに閉じるボタンを表示" + +msgid "Show scrollbar" +msgstr "スクロールバーを表示" + +msgid "Don't show exit dialog" +msgstr "終了ダイアログを表示しない" + +msgid "Set urgent bell" +msgstr "救急ベルを有効にする" + +msgid "Set audible bell" +msgstr "ベル音を有効にする" + +msgid "Set blinking cursor" +msgstr "カーソルの点滅を有効にする" + +msgid "Enable bold font" +msgstr "太字フォントを有効にする" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "番号のタブ切り替えを無効にする" + +#, fuzzy +msgid "Enable focus fade" +msgstr "太字フォントを有効にする" + +msgid "Set cursor type" +msgstr "カーソルタイプを設定" + +msgid "Block" +msgstr "四角" + +msgid "Underline" +msgstr "アンダーライン" + +msgid "IBeam" +msgstr "Iビーム" + +msgid "Set palette" +msgstr "パレットを設定" + +#, c-format +msgid "Terminal %d" +msgstr "ターミナル %d" + +msgid "Error message" +msgstr "エラー・メッセージ" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "作業ディレクトリを変更することはできません\n" + +msgid "- vte-based terminal emulator" +msgstr "- vte ベースのターミナル・エミュレータ" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura のバージョンは %s です\n" diff --git a/po/ko.po b/po/ko.po new file mode 100644 index 0000000..cdf0da9 --- /dev/null +++ b/po/ko.po @@ -0,0 +1,244 @@ +# Korean translation for sakura +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the sakura package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Korean \n" +"Language: ko\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "버전 보기" + +msgid "Select initial terminal font" +msgstr "터미널 초기 글꼴 선택" + +msgid "Select initial number of tabs" +msgstr "탭 초기 갯수 선택" + +msgid "Set working directory" +msgstr "작업 디렉토리 설정" + +msgid "Execute command" +msgstr "명령 실행" + +msgid "Execute command (last option in the command line)" +msgstr "명령을 실행 (명령줄에 마지막 희망)" + +msgid "Login shell" +msgstr "로그인 쉘" + +msgid "Set window title" +msgstr "창제목 설정" + +msgid "Set window icon" +msgstr "창 아이콘 설정" + +msgid "Set columns number" +msgstr "열 번호 설정" + +msgid "Set rows number" +msgstr "줄 번호 설정" + +msgid "Hold window after execute command" +msgstr "명령 실행 후 창 고정" + +msgid "Maximize window" +msgstr "창 최대화" + +msgid "Fullscreen mode" +msgstr "전체화면 모드" + +msgid "Use alternate configuration file" +msgstr "대체 구성 파일을 사용" + +msgid "Select initial colorset" +msgstr "초기 색상 세트 선댁" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "설정이 다른 프로세스에 의해 수정되었습니다. 덮어 쓰시겠습니까?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"프로세스를 실행하고 있습니다.\n" +"\n" +"당신은 사쿠라를 닫으시겠습니까?" + +msgid "Select font" +msgstr "글꼴 선택" + +msgid "Set tab name" +msgstr "탭 이름 설정" + +msgid "_Cancel" +msgstr "취소" + +msgid "_Apply" +msgstr "적용" + +msgid "New text" +msgstr "새 텍스트" + +msgid "Select colors" +msgstr "색상 선댁" + +msgid "_Select" +msgstr "선택" + +msgid "Colorset" +msgstr "색상 세트" + +msgid "Foreground color" +msgstr "전경색" + +msgid "Background color" +msgstr "배경색" + +msgid "Cursor color" +msgstr "커서색" + +msgid "Opacity level (%)" +msgstr "불투명도" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "새 창 제목" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"실행되는 프로세스가 있습니다.\n" +"\n" +"그것을 닫으시겠습니까?" + +#, fuzzy +msgid "Open mail" +msgstr "링크 열기" + +msgid "Open link" +msgstr "링크 열기" + +msgid "Copy link" +msgstr "링크 복사" + +msgid "New tab" +msgstr "새 탭" + +msgid "Set tab name..." +msgstr "탭 이름 설정..." + +msgid "Close tab" +msgstr "탭 닫기" + +msgid "Full screen" +msgstr "전체 화면" + +msgid "Copy" +msgstr "복사" + +msgid "Paste" +msgstr "붙여넣기" + +msgid "Select font..." +msgstr "글꼴 선택..." + +msgid "Select colors..." +msgstr "색상 선택..." + +msgid "Set window title..." +msgstr "창 제목 성정..." + +msgid "Options" +msgstr "설정" + +msgid "More" +msgstr "더 많이" + +msgid "Always show tab bar" +msgstr "탭바 항상 보이게 함" + +msgid "Tabs at bottom" +msgstr "탭을 아래에 표시" + +msgid "Show close button on tabs" +msgstr "탭에 닫기 단추 보이기" + +msgid "Show scrollbar" +msgstr "스크롤바 보이기" + +msgid "Don't show exit dialog" +msgstr "종료 대화 상자를 표시하지 않음" + +msgid "Set urgent bell" +msgstr "긴급 종 성정" + +msgid "Set audible bell" +msgstr "소리 종 성정" + +msgid "Set blinking cursor" +msgstr "커서 깜빡임 설정" + +msgid "Enable bold font" +msgstr "굵은 글꼴 사용" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "번호 탭 스위치 비활성화" + +#, fuzzy +msgid "Enable focus fade" +msgstr "굵은 글꼴 사용" + +msgid "Set cursor type" +msgstr "커서 유형을 설정" + +msgid "Block" +msgstr "블럭" + +msgid "Underline" +msgstr "밑줄" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "파레트 설정" + +#, c-format +msgid "Terminal %d" +msgstr "터미널 %d" + +msgid "Error message" +msgstr "오류 메시지" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "작업 디렉토리를 변경할 수 없습니다\n" + +msgid "- vte-based terminal emulator" +msgstr "- vte 기반의 터미널 에뮬레이터" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura 버전은 %s 입니다\n" diff --git a/po/pl.po b/po/pl.po new file mode 100644 index 0000000..5c2b6fb --- /dev/null +++ b/po/pl.po @@ -0,0 +1,243 @@ +# Polish translation for sakura +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the sakura package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Pokaż wersję" + +msgid "Select initial terminal font" +msgstr "Wybierz domyślną czcionkę" + +msgid "Select initial number of tabs" +msgstr "Wybierz domyślną ilość zakładek" + +msgid "Set working directory" +msgstr "Ustaw katalog roboczy" + +msgid "Execute command" +msgstr "Wykonaj polecenie" + +msgid "Execute command (last option in the command line)" +msgstr "Wykonaj komendę (ostatnia opcja w wierszu poleceń" + +msgid "Login shell" +msgstr "Powłoka logowania" + +msgid "Set window title" +msgstr "Ustaw tytuł okna" + +msgid "Set window icon" +msgstr "Ustaw ikonę okna" + +msgid "Set columns number" +msgstr "Ustaw liczbę kolumn" + +msgid "Set rows number" +msgstr "Ustaw liczbę wierszy" + +msgid "Hold window after execute command" +msgstr "Nie wyłączaj okna po wykonaniu polecenia" + +msgid "Maximize window" +msgstr "Maksymalizuj okno" + +msgid "Fullscreen mode" +msgstr "Tryb pełnoekranowy" + +msgid "Use alternate configuration file" +msgstr "Użyj alternatywnego pliku konfiguracyjnego" + +msgid "Select initial colorset" +msgstr "Wybierz domyślny schemat kolorów" + +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Dalej działają uruchomione procesy.\n" +"\n" +"Czy na pewno chcesz zamknąć Sakura?" + +msgid "Select font" +msgstr "Wybierz czcionkę" + +msgid "Set tab name" +msgstr "Wybierz nazwę zakładki" + +msgid "_Cancel" +msgstr "_Anuluj" + +msgid "_Apply" +msgstr "_Zastosuj" + +msgid "New text" +msgstr "Nowy tekst" + +msgid "Select colors" +msgstr "Wybierz kolory" + +msgid "_Select" +msgstr "_Wybierz" + +msgid "Colorset" +msgstr "Schemat kolorów" + +msgid "Foreground color" +msgstr "Kolor pierwszoplanowy" + +msgid "Background color" +msgstr "Kolor tła" + +msgid "Cursor color" +msgstr "Kolor kursora" + +msgid "Opacity level (%)" +msgstr "Nieprzezroczystość" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Nowy tytuł okna" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"W tym terminalu dalej działa proces.\n" +"\n" +"Czy na pewno chcesz go zamknąć?" + +#, fuzzy +msgid "Open mail" +msgstr "Otwórz link..." + +msgid "Open link" +msgstr "Otwórz odnośnik" + +msgid "Copy link" +msgstr "Kopiuj odnośnik" + +msgid "New tab" +msgstr "Nowa zakładka" + +msgid "Set tab name..." +msgstr "Ustaw nazwę karty..." + +msgid "Close tab" +msgstr "Zamknij zakładkę" + +msgid "Full screen" +msgstr "Pełny ekran" + +msgid "Copy" +msgstr "Kopiuj" + +msgid "Paste" +msgstr "Wklej" + +msgid "Select font..." +msgstr "Wybierz czcionkę..." + +msgid "Select colors..." +msgstr "Wybierz kolory..." + +msgid "Set window title..." +msgstr "Ustaw tytuł okna..." + +msgid "Options" +msgstr "Ustawienia" + +msgid "More" +msgstr "Więcej" + +msgid "Always show tab bar" +msgstr "Zawsze wyświetlaj pasek kart" + +msgid "Tabs at bottom" +msgstr "Karty na dole" + +msgid "Show close button on tabs" +msgstr "Pokaż przyciski zamykania na kartach" + +msgid "Show scrollbar" +msgstr "Pokaż pasek przesuwania" + +msgid "Don't show exit dialog" +msgstr "Nie pokazuj potwierdzenia zamykania" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Dźwiękowy sygnał" + +msgid "Set audible bell" +msgstr "Dźwiękowy sygnał" + +msgid "Set blinking cursor" +msgstr "Migający kursor" + +msgid "Enable bold font" +msgstr "Włącz pogrubienie czcionki" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "Wybierz typ kursora" + +msgid "Block" +msgstr "Blokuj" + +msgid "Underline" +msgstr "Podkreślenie" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Ustaw paletę" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Komunikat o błędzie" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "Nie można zmienić katalogu roboczego\n" + +msgid "- vte-based terminal emulator" +msgstr "- emulator terminala oparty na vte" + +#, c-format +msgid "sakura version is %s\n" +msgstr "wersja sakura to %s\n" diff --git a/po/pt.po b/po/pt.po new file mode 100644 index 0000000..3f89509 --- /dev/null +++ b/po/pt.po @@ -0,0 +1,248 @@ +# Portuguese translation for sakura +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the sakura package. +# FIRST AUTHOR , 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Mostrar número da versão" + +msgid "Select initial terminal font" +msgstr "Escolha o tipo de letra do terminal" + +msgid "Select initial number of tabs" +msgstr "Escolha o número de separadores" + +msgid "Set working directory" +msgstr "Definir diretório de trabalho" + +msgid "Execute command" +msgstr "Executar comando" + +msgid "Execute command (last option in the command line)" +msgstr "Executar comando (última opção da linha de comandos)" + +msgid "Login shell" +msgstr "" + +msgid "Set window title" +msgstr "Definir título da janela" + +#, fuzzy +msgid "Set window icon" +msgstr "Definir título da janela" + +msgid "Set columns number" +msgstr "Definir número de colunas" + +msgid "Set rows number" +msgstr "Definir número de linhas" + +msgid "Hold window after execute command" +msgstr "" + +msgid "Maximize window" +msgstr "Maximizar janela" + +msgid "Fullscreen mode" +msgstr "Ecrã completo" + +msgid "Use alternate configuration file" +msgstr "Utilizar ficheiro alternativo de configurações" + +#, fuzzy +msgid "Select initial colorset" +msgstr "Escolha a cor" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "A configuração foi modificada por outro processo. Substituir?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Existem processos em curso.\n" +"\n" +"Quer mesmo fechar o Sakura?" + +msgid "Select font" +msgstr "Escolha o tipo de letra" + +msgid "Set tab name" +msgstr "Definir nome do separador" + +msgid "_Cancel" +msgstr "_Cancelar" + +msgid "_Apply" +msgstr "_Aplicar" + +msgid "New text" +msgstr "Novo texto" + +#, fuzzy +msgid "Select colors" +msgstr "Escolha a cor" + +msgid "_Select" +msgstr "_Selecionar" + +msgid "Colorset" +msgstr "" + +msgid "Foreground color" +msgstr "Cor de primeiro plano" + +msgid "Background color" +msgstr "Cor de fundo" + +#, fuzzy +msgid "Cursor color" +msgstr "Escolha a cor de fundo:" + +msgid "Opacity level (%)" +msgstr "Nivel de opacidade (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Título da nova janela" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Ainda existem processos em curso neste terminal.\n" +"\n" +"Quer mesmo fechar o terminal?" + +#, fuzzy +msgid "Open mail" +msgstr "Abrir ligação" + +msgid "Open link" +msgstr "Abrir ligação" + +msgid "Copy link" +msgstr "Copiar ligação" + +msgid "New tab" +msgstr "Novo separador" + +msgid "Set tab name..." +msgstr "Definir nome do separador" + +msgid "Close tab" +msgstr "Fechar separador" + +msgid "Full screen" +msgstr "Ecrã completo" + +msgid "Copy" +msgstr "Copiar" + +msgid "Paste" +msgstr "Colar" + +msgid "Select font..." +msgstr "Escolha o tipo de letra..." + +msgid "Select colors..." +msgstr "Escolha as cores..." + +msgid "Set window title..." +msgstr "Definir título da janela..." + +msgid "Options" +msgstr "Opções" + +msgid "More" +msgstr "Mais..." + +msgid "Always show tab bar" +msgstr "Barra de separadores omnipresente" + +msgid "Tabs at bottom" +msgstr "Separadores em baixo" + +msgid "Show close button on tabs" +msgstr "Mostrar botão para fechar separadores" + +msgid "Show scrollbar" +msgstr "Mostrar barra de deslocação" + +msgid "Don't show exit dialog" +msgstr "Não mostrar diálogo de saída" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Definir sinal sonoro" + +msgid "Set audible bell" +msgstr "Definir sinal sonoro" + +msgid "Set blinking cursor" +msgstr "Definir cursor intermitente" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "Definir tipo de cursor" + +msgid "Block" +msgstr "Bloco" + +msgid "Underline" +msgstr "Sublinhado" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Definir palete" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Mensagem de erro" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "" + +msgid "- vte-based terminal emulator" +msgstr "- Emulador de terminal vte-based" + +#, c-format +msgid "sakura version is %s\n" +msgstr "a versão do sakura é a %s\n" diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 0000000..51d077b --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,246 @@ +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: fabio.antunes@hotmail.com \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Mostrar número da versão" + +msgid "Select initial terminal font" +msgstr "Selecionar fonte inicial do terminal" + +msgid "Select initial number of tabs" +msgstr "Selecionar número inicial de abas" + +#, fuzzy +msgid "Set working directory" +msgstr "Ativar cursor piscando" + +msgid "Execute command" +msgstr "Executar comando" + +msgid "Execute command (last option in the command line)" +msgstr "Executar comando (última opção da linha de comando)" + +msgid "Login shell" +msgstr "Login shell" + +msgid "Set window title" +msgstr "Definir título da janela" + +#, fuzzy +msgid "Set window icon" +msgstr "Definir título da janela" + +msgid "Set columns number" +msgstr "Definir número de colunas" + +msgid "Set rows number" +msgstr "Definir número de linhas" + +msgid "Hold window after execute command" +msgstr "Mostrar a janela depois de executar o comando" + +msgid "Maximize window" +msgstr "Maximizar janela" + +msgid "Fullscreen mode" +msgstr "Tela cheia" + +msgid "Use alternate configuration file" +msgstr "Usar arquivo de configuração alternativo" + +#, fuzzy +msgid "Select initial colorset" +msgstr "Selecionar cor" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "A configuração foi modificada por outro processo. Sobrescrever?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Existem processos sendo executados.\n" +"\n" +"Tem certeza que deseja fechar Sakura?" + +msgid "Select font" +msgstr "Selecionar fonte" + +msgid "Set tab name" +msgstr "Definir nome da aba" + +msgid "_Cancel" +msgstr "_Cancelar" + +msgid "_Apply" +msgstr "_Aplicar" + +msgid "New text" +msgstr "Novo texto" + +#, fuzzy +msgid "Select colors" +msgstr "Selecionar cor" + +msgid "_Select" +msgstr "_Selecionar" + +msgid "Colorset" +msgstr "" + +msgid "Foreground color" +msgstr "Cor de primeiro plano" + +msgid "Background color" +msgstr "Cor de fundo" + +msgid "Cursor color" +msgstr "Cor do cursor" + +#, fuzzy +msgid "Opacity level (%)" +msgstr "Nível de opacidade (%):" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Definir título da janela" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Existem processos sendo executados nesse terminal.\n" +"\n" +"Tem certeza que deseja fechar ele?" + +#, fuzzy +msgid "Open mail" +msgstr "Abrir link..." + +#, fuzzy +msgid "Open link" +msgstr "Abrir link..." + +#, fuzzy +msgid "Copy link" +msgstr "Copiar link..." + +msgid "New tab" +msgstr "Nova aba" + +msgid "Set tab name..." +msgstr "Definir nome da aba..." + +msgid "Close tab" +msgstr "Fechar aba" + +msgid "Full screen" +msgstr "Tela cheia" + +msgid "Copy" +msgstr "Copiar" + +msgid "Paste" +msgstr "Colar" + +msgid "Select font..." +msgstr "Selecionar fonte..." + +msgid "Select colors..." +msgstr "Selecionar cores..." + +msgid "Set window title..." +msgstr "Definir título da janela" + +msgid "Options" +msgstr "Opções" + +msgid "More" +msgstr "Mais" + +msgid "Always show tab bar" +msgstr "Sempre mostrar a barra de abas" + +msgid "Tabs at bottom" +msgstr "Abas em baixo" + +msgid "Show close button on tabs" +msgstr "Exibir o botão fechar nas abas" + +msgid "Show scrollbar" +msgstr "Mostra barra de rolagem" + +msgid "Don't show exit dialog" +msgstr "Não mostrar caixa de diálogo na saída" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Ativar aviso sonoro" + +msgid "Set audible bell" +msgstr "Ativar aviso sonoro" + +msgid "Set blinking cursor" +msgstr "Ativar cursor piscando" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "Definir tipo de cursor" + +msgid "Block" +msgstr "Bloquear" + +msgid "Underline" +msgstr "Sublinhar" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Definir paleta" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Mensagem de erro" + +#, fuzzy, c-format +msgid "Cannot change working directory\n" +msgstr "Ativar cursor piscando" + +msgid "- vte-based terminal emulator" +msgstr "- emulador de terminal baseado no vte" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura versão %s\n" diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 0000000..298f923 --- /dev/null +++ b/po/ru.po @@ -0,0 +1,239 @@ +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: ManDrive \n" +"Language-Team: Evgenij Vdovin \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Вывести номер версии" + +msgid "Select initial terminal font" +msgstr "Выбрать начальный шрифт терминала" + +msgid "Select initial number of tabs" +msgstr "Выбрать начальное число вкладок" + +msgid "Set working directory" +msgstr "Установить рабочую директорию" + +msgid "Execute command" +msgstr "Выполнить команду" + +msgid "Execute command (last option in the command line)" +msgstr "Выполнить команду (последнюю опцию в командной строке)" + +msgid "Login shell" +msgstr "Логин shell" + +msgid "Set window title" +msgstr "Изменение заголовка окна" + +msgid "Set window icon" +msgstr "Установить иконку окна" + +msgid "Set columns number" +msgstr "Установить число столбцов" + +msgid "Set rows number" +msgstr "Установить число строк" + +msgid "Hold window after execute command" +msgstr "Удерживать окно после выполнения команды" + +msgid "Maximize window" +msgstr "Максимальный размер окна" + +msgid "Fullscreen mode" +msgstr "Полноэкранный режим" + +msgid "Use alternate configuration file" +msgstr "Использовать альтернативный файл конфигурации" + +msgid "Select initial colorset" +msgstr "Выбрать начальную цветовую палитру" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "Настройки были изменены другим процессом. Перезаписать?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Имеются запущенные процессы.\n" +"\n" +"Вы уверены, что хотите закрыть Sakura?" + +msgid "Select font" +msgstr "Выбрать шрифт" + +msgid "Set tab name" +msgstr "Установить заголовок вкладки" + +msgid "_Cancel" +msgstr "_Отменить" + +msgid "_Apply" +msgstr "_Применить" + +msgid "New text" +msgstr "Новый текст" + +msgid "Select colors" +msgstr "Выбрать цвета" + +msgid "_Select" +msgstr "_Выбрать" + +msgid "Colorset" +msgstr "Цветовой набор" + +msgid "Foreground color" +msgstr "Цвет текста" + +msgid "Background color" +msgstr "Цвет фона" + +msgid "Cursor color" +msgstr "Цвет курсора" + +msgid "Opacity level (%)" +msgstr "Уровень прозрачности (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Новый заголовок окна:" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Не все процессы завершены в этом терминале.\n" +"\n" +"Вы уверены, что хотите выйти закрыть его?" + +#, fuzzy +msgid "Open mail" +msgstr "Открыть ссылку" + +msgid "Open link" +msgstr "Открыть ссылку" + +msgid "Copy link" +msgstr "Копировать ссылку" + +msgid "New tab" +msgstr "Новая вкладка" + +msgid "Set tab name..." +msgstr "Установить заголовок вкладки..." + +msgid "Close tab" +msgstr "Закрыть вкладку" + +msgid "Full screen" +msgstr "Полноэкранный режим" + +msgid "Copy" +msgstr "Копировать" + +msgid "Paste" +msgstr "Вставить" + +msgid "Select font..." +msgstr "Выбрать шрифт..." + +msgid "Select colors..." +msgstr "Выбрать цвета..." + +msgid "Set window title..." +msgstr "Установить заголовок окна..." + +msgid "Options" +msgstr "Настройки" + +msgid "More" +msgstr "Ещё" + +msgid "Always show tab bar" +msgstr "Всегда показывать панель вкладок" + +msgid "Tabs at bottom" +msgstr "Панель вкладок внизу" + +msgid "Show close button on tabs" +msgstr "Показывать кнопку закрытия на вкладке" + +msgid "Show scrollbar" +msgstr "Показать линейку прокрутки" + +msgid "Don't show exit dialog" +msgstr "Не показывать диалог выхода" + +msgid "Set urgent bell" +msgstr "Установить срочный звонок" + +msgid "Set audible bell" +msgstr "Звуковое оповещение" + +msgid "Set blinking cursor" +msgstr "Мигающий курсор" + +msgid "Enable bold font" +msgstr "Включить жирный шрифт" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "Отключить нумерованный переключатель вкладок" + +#, fuzzy +msgid "Enable focus fade" +msgstr "Включить жирный шрифт" + +msgid "Set cursor type" +msgstr "Установить вид курсора" + +msgid "Block" +msgstr "Блочный" + +msgid "Underline" +msgstr "_-образный" + +msgid "IBeam" +msgstr "I-образный" + +msgid "Set palette" +msgstr "Палитра" + +#, c-format +msgid "Terminal %d" +msgstr "Терминал %d" + +msgid "Error message" +msgstr "Сообщение об ошибке" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "Не удалось сменить рабочую директорию\n" + +msgid "- vte-based terminal emulator" +msgstr "- эмулятор терминала, основанный на VTE" + +#, c-format +msgid "sakura version is %s\n" +msgstr "Версия sakura %s\n" diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 0000000..4f30d5c --- /dev/null +++ b/po/sv.po @@ -0,0 +1,245 @@ +# Swedish translation for sakura +# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015 +# This file is distributed under the same license as the sakura package. +# FIRST AUTHOR , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-05-01 10:23+0000\n" +"Last-Translator: Andreas Rönnquist \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-05-02 05:20+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Skriv ut versionsnummer" + +msgid "Select initial terminal font" +msgstr "Välj initialt terminaltypsnitt" + +msgid "Select initial number of tabs" +msgstr "Välj initialt antal flikar" + +msgid "Set working directory" +msgstr "Sätt arbetskatalog" + +msgid "Execute command" +msgstr "Kör kommando" + +msgid "Execute command (last option in the command line)" +msgstr "Kör kommando (Sista alternativet på kommandoraden)" + +msgid "Login shell" +msgstr "Inloggningsskal" + +msgid "Set window title" +msgstr "Sätt fönstertitel" + +msgid "Set window icon" +msgstr "Sätt fönsterikon" + +msgid "Set columns number" +msgstr "Sätt antal kolumner" + +msgid "Set rows number" +msgstr "Sätt antal rader" + +msgid "Hold window after execute command" +msgstr "Håll kvar fönster efter kommandokörning" + +msgid "Maximize window" +msgstr "Maximera fönster" + +msgid "Fullscreen mode" +msgstr "Helskärmsläge" + +msgid "Use alternate configuration file" +msgstr "Använd alternativ konfigurationsfil" + +msgid "Select initial colorset" +msgstr "Välj initial färguppsättning" + +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "Konfigurationen har ändrats av en annan process. Skriv över?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Det finns processer som fortfarande är igång.\n" +"\n" +"Vill du verkligen avsluta sakura?" + +msgid "Select font" +msgstr "Välj typsnitt" + +msgid "Set tab name" +msgstr "Sätt fliknamn" + +msgid "_Cancel" +msgstr "_Avbryt" + +msgid "_Apply" +msgstr "_Verkställ" + +msgid "New text" +msgstr "Ny text" + +msgid "Select colors" +msgstr "Välj färger" + +msgid "_Select" +msgstr "_Välj" + +msgid "Colorset" +msgstr "Färguppsättning" + +msgid "Foreground color" +msgstr "Förgrundsfärg" + +msgid "Background color" +msgstr "Bakgrundsfärg" + +msgid "Cursor color" +msgstr "Markörfärg" + +msgid "Opacity level (%)" +msgstr "Opacitetsnivå (%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Ny fönstertitel" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Det finns en process igång i denna terminal.\n" +"\n" +"Vill du verkligen avsluta den?" + +msgid "Open mail" +msgstr "Öppna e-post" + +msgid "Open link" +msgstr "Öppna länk" + +msgid "Copy link" +msgstr "Kopiera länk" + +msgid "New tab" +msgstr "Ny flik" + +msgid "Set tab name..." +msgstr "Sätt fliknamn..." + +msgid "Close tab" +msgstr "Stäng flik" + +msgid "Full screen" +msgstr "Helskärm" + +msgid "Copy" +msgstr "Kopiera" + +msgid "Paste" +msgstr "Klistra in" + +msgid "Select font..." +msgstr "Välj typsnitt..." + +msgid "Select colors..." +msgstr "Välj färger..." + +msgid "Set window title..." +msgstr "Sätt fönstertitel..." + +msgid "Options" +msgstr "Alternativ" + +msgid "More" +msgstr "Fler" + +msgid "Always show tab bar" +msgstr "Visa alltid flikfältet" + +msgid "Tabs at bottom" +msgstr "Flikar nederst" + +msgid "Show close button on tabs" +msgstr "Visa stängningsknapp på flikar" + +msgid "Show scrollbar" +msgstr "Visa rullningslist" + +msgid "Don't show exit dialog" +msgstr "Visa inte stängningsdialog" + +msgid "Set urgent bell" +msgstr "Sätt larmsignal" + +msgid "Set audible bell" +msgstr "Sätt hörbar signal" + +msgid "Set blinking cursor" +msgstr "Sätt blinkande markör" + +msgid "Enable bold font" +msgstr "Aktivera fetstil" + +msgid "Stop tab cycling at end tabs" +msgstr "Stoppa flikcykling vid ändflikar" + +msgid "Disable numbered tabswitch" +msgstr "Inaktivera numrerad flikväxlare" + +#, fuzzy +msgid "Enable focus fade" +msgstr "Aktivera fetstil" + +msgid "Set cursor type" +msgstr "Sätt markörtyp" + +msgid "Block" +msgstr "Block" + +msgid "Underline" +msgstr "Understreck" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Sätt palett" + +#, c-format +msgid "Terminal %d" +msgstr "Terminal %d" + +msgid "Error message" +msgstr "Felmeddelande" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "Kan inte ändra arbetskatalog\n" + +msgid "- vte-based terminal emulator" +msgstr "- vte-baserad terminalemulator" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura-versionen är %s\n" + +#~ msgid "Use focus fading" +#~ msgstr "Använd fokustoning" diff --git a/po/uk.po b/po/uk.po new file mode 100644 index 0000000..5bec2ba --- /dev/null +++ b/po/uk.po @@ -0,0 +1,255 @@ +# Ukrainian translation for sakura +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the sakura package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: Andriy Nezhivy \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "Показати версію" + +msgid "Select initial terminal font" +msgstr "Оберіть початкаовий шрифт терміналу" + +msgid "Select initial number of tabs" +msgstr "Оберіть початкову кількість вкладок терміналу" + +#, fuzzy +msgid "Set working directory" +msgstr "Встановити мерехтіння курсора" + +msgid "Execute command" +msgstr "Виконати команду" + +msgid "Execute command (last option in the command line)" +msgstr "Виконати команду (остання опція в командному рядку)" + +msgid "Login shell" +msgstr "Оболонка входу" + +msgid "Set window title" +msgstr "Встановити заголовок вікна" + +#, fuzzy +msgid "Set window icon" +msgstr "Встановити заголовок вікна" + +msgid "Set columns number" +msgstr "Встановити кількість стовпців" + +msgid "Set rows number" +msgstr "Встановити кількість рядків" + +msgid "Hold window after execute command" +msgstr "Тримати вікно після виконання команди" + +msgid "Maximize window" +msgstr "" + +#, fuzzy +msgid "Fullscreen mode" +msgstr "Повноекранний режим" + +msgid "Use alternate configuration file" +msgstr "Використати інший файл конфігурації" + +#, fuzzy +msgid "Select initial colorset" +msgstr "Обрати колір" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "Конфігурація була змінена іншим процесом. Переписати?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"Є запущені процеси.\n" +"Ви дійсно хочете закрити Sakura?" + +msgid "Select font" +msgstr "Обрати шрифт" + +msgid "Set tab name" +msgstr "Вказати ім'я вкладки" + +msgid "_Cancel" +msgstr "" + +msgid "_Apply" +msgstr "" + +msgid "New text" +msgstr "Новий текст" + +#, fuzzy +msgid "Select colors" +msgstr "Обрати колір" + +#, fuzzy +msgid "_Select" +msgstr "Обрати шрифт" + +msgid "Colorset" +msgstr "" + +#, fuzzy +msgid "Foreground color" +msgstr "Оберіть колір:" + +#, fuzzy +msgid "Background color" +msgstr "Оберіть колір тла:" + +#, fuzzy +msgid "Cursor color" +msgstr "Оберіть колір тла:" + +#, fuzzy +msgid "Opacity level (%)" +msgstr "Рівень прозорості (%):" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "Новий заголовок вікна" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"В цьому терміналі є запущені процеси.\n" +"\n" +"Ви хочете закрити його?" + +#, fuzzy +msgid "Open mail" +msgstr "Відкрити посилання..." + +#, fuzzy +msgid "Open link" +msgstr "Відкрити посилання..." + +#, fuzzy +msgid "Copy link" +msgstr "Копіювати посилання..." + +msgid "New tab" +msgstr "Нова вкладка" + +msgid "Set tab name..." +msgstr "Встановити нове ім'я вкладки..." + +msgid "Close tab" +msgstr "Закрити вкладку" + +msgid "Full screen" +msgstr "Повноекранний режим" + +msgid "Copy" +msgstr "Копіювати" + +msgid "Paste" +msgstr "Вставити" + +msgid "Select font..." +msgstr "Обрати шрифт..." + +msgid "Select colors..." +msgstr "Обрати кольори..." + +msgid "Set window title..." +msgstr "Встановити заголовок вікна..." + +msgid "Options" +msgstr "Параметри" + +msgid "More" +msgstr "Більше" + +msgid "Always show tab bar" +msgstr "Завжди показувати панель вкладок" + +msgid "Tabs at bottom" +msgstr "Вкладки знизу" + +msgid "Show close button on tabs" +msgstr "Показувати кнопки закриття на вкладках" + +msgid "Show scrollbar" +msgstr "Показувати скроллбар" + +msgid "Don't show exit dialog" +msgstr "Не показувати діалог виходу" + +#, fuzzy +msgid "Set urgent bell" +msgstr "Встановити звуковий сигнал" + +msgid "Set audible bell" +msgstr "Встановити звуковий сигнал" + +msgid "Set blinking cursor" +msgstr "Встановити мерехтіння курсора" + +msgid "Enable bold font" +msgstr "" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "" + +msgid "Enable focus fade" +msgstr "" + +msgid "Set cursor type" +msgstr "Оберіть тип курсора" + +msgid "Block" +msgstr "Блок" + +msgid "Underline" +msgstr "Підкреслення" + +msgid "IBeam" +msgstr "IBeam" + +msgid "Set palette" +msgstr "Оберіть палітру" + +#, c-format +msgid "Terminal %d" +msgstr "Термінал %d" + +msgid "Error message" +msgstr "Повідомлення про помилку" + +#, fuzzy, c-format +msgid "Cannot change working directory\n" +msgstr "Встановити мерехтіння курсора" + +msgid "- vte-based terminal emulator" +msgstr "Термінальний емулятор базований на vte" + +#, c-format +msgid "sakura version is %s\n" +msgstr "версія Sakura %s\n" diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100644 index 0000000..df3092c --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,244 @@ +# Chinese/Simplified translation of sakura. +# Copyright (C) 2006 THE sakura'S COPYRIGHT HOLDER +# This file is distributed under the same license as the sakura package. +# yanghong , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: sakura 1.0.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 21:33+0200\n" +"PO-Revision-Date: 2018-04-29 13:18+0000\n" +"Last-Translator: David Gómez \n" +"Language-Team: Chinese/Simplified \n" +"Language: zh\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2018-04-30 04:34+0000\n" +"X-Generator: Launchpad (build 18623)\n" + +msgid "Print version number" +msgstr "显示版本号" + +msgid "Select initial terminal font" +msgstr "选择初始终端字体" + +msgid "Select initial number of tabs" +msgstr "选择初始标签数" + +msgid "Set working directory" +msgstr "设置工作目录" + +msgid "Execute command" +msgstr "执行命令" + +msgid "Execute command (last option in the command line)" +msgstr "执行命令(命令行结束前执行)" + +msgid "Login shell" +msgstr "登录 shell" + +msgid "Set window title" +msgstr "设置窗口标题" + +msgid "Set window icon" +msgstr "设置窗口图标" + +msgid "Set columns number" +msgstr "设置列数" + +msgid "Set rows number" +msgstr "设置行数" + +msgid "Hold window after execute command" +msgstr "运行后保留窗口" + +msgid "Maximize window" +msgstr "最大化窗口" + +msgid "Fullscreen mode" +msgstr "全屏模式" + +msgid "Use alternate configuration file" +msgstr "使用其他配置文件" + +msgid "Select initial colorset" +msgstr "选择初始颜色设置" + +#, fuzzy +msgid "Configuration has been modified by another process. Overwrite?" +msgstr "配置文件已经被其他进程修改。覆盖吗?" + +msgid "" +"There are running processes.\n" +"\n" +"Do you really want to close Sakura?" +msgstr "" +"有进程正在运行。\n" +"\n" +"您真的要关闭 Sakura 吗?" + +msgid "Select font" +msgstr "选择字体" + +msgid "Set tab name" +msgstr "设置标签页名称" + +msgid "_Cancel" +msgstr "取消" + +msgid "_Apply" +msgstr "应用" + +msgid "New text" +msgstr "新文本" + +msgid "Select colors" +msgstr "选择颜色" + +msgid "_Select" +msgstr "选择" + +msgid "Colorset" +msgstr "色彩集" + +msgid "Foreground color" +msgstr "前景色" + +msgid "Background color" +msgstr "背景色" + +msgid "Cursor color" +msgstr "光标色" + +msgid "Opacity level (%)" +msgstr "不透明度(%)" + +msgid "Search" +msgstr "" + +msgid "New window title" +msgstr "新窗口标题" + +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"终端中有进程正在执行。\n" +"\n" +"您确定要关闭它吗?" + +#, fuzzy +msgid "Open mail" +msgstr "打开链接" + +msgid "Open link" +msgstr "打开链接" + +msgid "Copy link" +msgstr "复制链接" + +msgid "New tab" +msgstr "新建标签" + +msgid "Set tab name..." +msgstr "设置标签页名称..." + +msgid "Close tab" +msgstr "关闭标签" + +msgid "Full screen" +msgstr "全屏" + +msgid "Copy" +msgstr "复制" + +msgid "Paste" +msgstr "粘贴" + +msgid "Select font..." +msgstr "选择字体..." + +msgid "Select colors..." +msgstr "选择颜色..." + +msgid "Set window title..." +msgstr "设置窗口标题..." + +msgid "Options" +msgstr "选项" + +msgid "More" +msgstr "更多" + +msgid "Always show tab bar" +msgstr "总是显示第一个标签页" + +msgid "Tabs at bottom" +msgstr "标签页在底部" + +msgid "Show close button on tabs" +msgstr "在标签上显示关闭按钮" + +msgid "Show scrollbar" +msgstr "显示滚动条" + +msgid "Don't show exit dialog" +msgstr "不显示退出对话框" + +msgid "Set urgent bell" +msgstr "设定紧急铃" + +msgid "Set audible bell" +msgstr "设定蜂鸣铃" + +msgid "Set blinking cursor" +msgstr "设置闪烁光标" + +msgid "Enable bold font" +msgstr "启动粗体字" + +msgid "Stop tab cycling at end tabs" +msgstr "" + +msgid "Disable numbered tabswitch" +msgstr "禁用编号标签开关" + +#, fuzzy +msgid "Enable focus fade" +msgstr "启动粗体字" + +msgid "Set cursor type" +msgstr "设置光标类型" + +msgid "Block" +msgstr "方块" + +msgid "Underline" +msgstr "下划线" + +msgid "IBeam" +msgstr "竖线" + +msgid "Set palette" +msgstr "设置调色板" + +#, c-format +msgid "Terminal %d" +msgstr "终端 %d" + +msgid "Error message" +msgstr "错误消息" + +#, c-format +msgid "Cannot change working directory\n" +msgstr "不能改变工作目录\n" + +msgid "- vte-based terminal emulator" +msgstr "- 基于 vte 的终端模拟器" + +#, c-format +msgid "sakura version is %s\n" +msgstr "sakura 版本是 %s\n" diff --git a/sakura.desktop b/sakura.desktop new file mode 100644 index 0000000..fb3f5b3 --- /dev/null +++ b/sakura.desktop @@ -0,0 +1,99 @@ +[Desktop Entry] +Name=Sakura +GenericName=Terminal +GenericName[af]=Terminaal +GenericName[ar]=طرفيّة +GenericName[as]=টাৰ্মিনেল +GenericName[be@latin]=Terminał +GenericName[bg]=Терминал +GenericName[bn]=টার্মিনাল +GenericName[bn_IN]=টার্মিন্যাল +GenericName[cs]=Terminál +GenericName[el]=Τερματικό +GenericName[eo]=Terminalo +GenericName[eu]=Terminala +GenericName[fi]=Pääteikkuna +GenericName[ga]=Teirminéal +GenericName[gu]=ટર્મિનલ +GenericName[he]=מסוף +GenericName[hi]=टर्मिनल +GenericName[hne]=टर्मिनल +GenericName[hu]=Terminál +GenericName[is]=Skjáhermir +GenericName[it]=Terminale +GenericName[ja]=ターミナル +GenericName[ka]=ტერმინალი +GenericName[kk]=Терминал +GenericName[ko]=터미널 +GenericName[ku]=Termînal +GenericName[lt]=Terminalas +GenericName[lv]=Terminālis +GenericName[mai]=टर्मिनल +GenericName[mk]=Терминал +GenericName[ml]=ടെര്മിനല് +GenericName[mr]=टर्मिनल +GenericName[nds]=Konsool +GenericName[or]=ଟର୍ମିନାଲ +GenericName[pa]=ਟਰਮੀਨਲ +GenericName[ru]=Терминал +GenericName[si]=අග්රය +GenericName[sk]=Terminál +GenericName[sr]=Терминал +GenericName[sr@ijekavian]=Терминал +GenericName[ta]=முனையம் +GenericName[tg]=Терминал +GenericName[th]=เทอร์มินัล +GenericName[tr]=Uçbirim +GenericName[ug]=تېرمىنال +GenericName[uk]=Термінал +GenericName[uz@cyrillic]=Терминал +GenericName[wa]=Terminå +GenericName[zh_CN]=终端 +GenericName[zh_TW]=終端機 +Comment=Use the command line +Comment[ru]=Использовать командную строку +Comment[am]=የትእዛዝ መስመሩን መጠቀሚያ +Comment[bg]=Използване на команден ред +Comment[ca]=Utilitza la línia d'ordres +Comment[cs]=Použít příkazový řádek +Comment[da]=Brug kommandolinjen +Comment[de]=Die Befehlszeile verwenden +Comment[el]=Χρήση της γραμμής εντολών +Comment[eo]=Uzi komandlinion +Comment[es]=Usar la línea de órdenes +Comment[et]=Käsurea kasutamine +Comment[eu]=Erabili komando-lerroa +Comment[fi]=Käytä komentoriviä +Comment[fr]=Utiliser la ligne de commande +Comment[gl]=Usar a liña de ordes +Comment[hi]=कमांड लाइन का प्रयोग करें +Comment[hr]=Koristiti naredbeni redak +Comment[hu]=Parancssor használata +Comment[id]=Gunakan baris perintah +Comment[it]=Usa la riga di comando +Comment[ja]=コマンドラインを利用する +Comment[ko]=명령줄 사용하기 +Comment[ms]=Guna baris perintah +Comment[nb]=Bruk kommandolinjen +Comment[nl]=Opdrachtregel gebruiken +Comment[pl]=Umożliwia korzystanie z wiersza poleceń +Comment[pt]=Utilizar a linha de comandos +Comment[pt_BR]=Usar a linha de comando +Comment[ro]=Folosiți linia de comandă +Comment[rue]=Використати командний рядок +Comment[sl]=Uporabi ukazno vrstico +Comment[sr]=Користите командну линију +Comment[sv]=Använd kommandoraden +Comment[sw]=Tumia komand +Comment[tr]=Komut satırını kullan +Comment[uk]=Використати командну лінію +Comment[vi]=Sử dụng dòng lệnh +Comment[zh_CN]=使用命令行 +Comment[zh_TW]=使用指令列 +TryExec=sakura +Exec=sakura +Icon=terminal-tango +Type=Application +Categories=GTK;Utility;TerminalEmulator;System; +StartupNotify=true +X-Ubuntu-Gettext-Domain=sakura diff --git a/sakura.pod b/sakura.pod new file mode 100644 index 0000000..fddb5a4 --- /dev/null +++ b/sakura.pod @@ -0,0 +1,199 @@ +=encoding utf8 + +=head1 NAME + +sakura - A simple but powerful libvte-based terminal emulator. + +=head1 SYNOPSIS + +sakura [options...] + +=head1 DESCRIPTION + +sakura is a terminal emulator based on GTK+ and VTE. It's a terminal emulator with few dependencies, so you don't need a full GNOME desktop installed to have a decent terminal emulator. + +=head1 HELP OPTIONS + +=over 8 + +=item B<-?, --help> + +Show help options. + +=item B<--help-all> + +Show all help options + +=item B<--help-gtk> + +Show GTK+ Options + +=back + +=head1 APPLICATION OPTIONS + +=over 8 + +=item B<-v, --version> + +Print version number + +=item B<-f, --font> + +Select initial terminal font + +=item B<-n, --ntabs> + +Select initial number of tabs + +=item B<-x, --execute> + +Execute command + +=item B<-e, --xterm-execute> + +Execute command (compatible with xterm's -e option) + +=item B<-l, --login> + +Login shell + +=item B<-t, --title> + +Set window title + +=item B<-c, --columns> + +Set columns number + +=item B<-r, --rows> + +Set rows number + +=item B<-h, --hold> + +Hold window after execute command + +=item B<-d, --working-directory> + +Set working directory + +=item B<-m, --maximize> + +Maximize window + +=item B<-s, --fullscreen> + +Fullscreen mode + +=item B<--display=DISPLAY> + +X display to use + +=item B<--config-file=FILENAME> + +Use alternate configuration file. Path is relative to the sakura config dir. +(Example: ~/.config/sakura/FILENAME). + +=back + +=head1 GTK+ OPTIONS + +=over 8 + +=item B<--class=CLASS> + +Program class as used by the window manager + +=item B<--name=NAME> + +Program name as used by the window manager + +=item B<--screen=SCREEN> + +X screen to use + +=item B<--sync> + +Make X calls synchronous + +=item B<--gtk-module=MODULES> + +Load additional GTK+ modules + +=item B<--g-fatal-warnings> + +Make all warnings fatal + +=back + +=head1 KEYBINDINGS SUPPORT + +B supports keyboard bindings. They are configurable by setting the following properties in your sakura config file (~/.config/sakura/sakura.conf). + +=head2 ACCELERATORS + +Accelerators can be set to any mask value from the GdkModifierType in gdktypes.h; see: + +http://www.krugle.org/examples/p-6R7SuZt1c28ljzpZ/gdktypes.h + +or, on your own system: + +/usr/include/gtk-2.0/gdk/gdkkeysyms.h + +Mask values can be combined by ORing them. + +For example, to set the delete tab accelerator to Ctrl + Shift: + +del_tab_accelerator=5 + +because GDK_SHIFT_MASK has a value of 1 (1 << 0), and GDK_CONTROL_MASK has a value of 4 (1 << 2); ORing them together, you get 5. + +I realise that this configuration is not so friendly to non-programmers, but it is a start. :) + +=head2 KEYS + +For example, to set the add tab key to 'T': + +add_tab_key=T + +Before sakura used keycodes instead of strings. They're still valid. + + +=head2 DEFAULTS + + Ctrl + Shift + T -> New tab + Ctrl + Shift + W -> Close current tab + Ctrl + Shift + C -> Copy selected text + Ctrl + Shift + V -> Paste selected text + Alt + Left cursor -> Previous tab + Alt + Right cursor -> Next tab + Alt + [1-9] -> Switch to tab N (1-9) + Ctrl + Shift + S -> Toggle scrollbar + Ctrl + Shift + Mouse left button -> Open link + F11 -> Fullscreen + Shift + PageUp -> Move up through scrollback by page + Shift + PageDown -> Move down through scrollback by page + Ctrl + Shift + Up -> Move up through scrollback by line + Ctrl + Shift + Down -> Move down through scrollback by line + +You can also increase and decrease the font size in the GTK+ standard way (not configurable): + + Ctrl + '+' -> Increase font size + Ctrl + '-' -> Decrease font size + +=head1 BUGS + +B is hosted on Launchpad. Bugs can be filed at: + +https://bugs.launchpad.net/sakura + +=head1 AUTHORS + +B was written by David Gómez . + +This manual page was written by Andrew Starr-Bochicchio . + +Both are released under the GNU General Public License, version 2 or later. + +=cut diff --git a/src/sakura.c b/src/sakura.c new file mode 100644 index 0000000..e72a9aa --- /dev/null +++ b/src/sakura.c @@ -0,0 +1,3536 @@ +/******************************************************************************* + * Filename: sakura.c + * Description: VTE-based terminal emulator + * + * Copyright (C) 2006-2012 David Gómez + * Copyright (C) 2008 Hong Jen Yee (PCMan) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define _(String) gettext(String) +#define N_(String) (String) +#define GETTEXT_PACKAGE "sakura" + +#define SAY(format,...) do {\ + if (strcmp("Debug", BUILDTYPE)==0) {\ + fprintf(stderr, "[%d] ", getpid());\ + fprintf(stderr, "[%s] ", __FUNCTION__);\ + if (format) fprintf(stderr, format, ##__VA_ARGS__);\ + fputc('\n', stderr);\ + fflush(stderr);\ + }\ +} while (0) + +#define PALETTE_SIZE 16 + +/* 16 color palettes in GdkRGBA format (red, green, blue, alpha) + * Text displayed in the first 8 colors (0-7) is meek (uses thin strokes). + * Text displayed in the second 8 colors (8-15) is bold (uses thick strokes). */ + +const GdkRGBA gruvbox_palette[PALETTE_SIZE] = { + {0.156863, 0.156863, 0.156863, 1.000000}, + {0.800000, 0.141176, 0.113725, 1.000000}, + {0.596078, 0.592157, 0.101961, 1.000000}, + {0.843137, 0.600000, 0.129412, 1.000000}, + {0.270588, 0.521569, 0.533333, 1.000000}, + {0.694118, 0.384314, 0.525490, 1.000000}, + {0.407843, 0.615686, 0.415686, 1.000000}, + {0.658824, 0.600000, 0.517647, 1.000000}, + {0.572549, 0.513725, 0.454902, 1.000000}, + {0.984314, 0.286275, 0.203922, 1.000000}, + {0.721569, 0.733333, 0.149020, 1.000000}, + {0.980392, 0.741176, 0.184314, 1.000000}, + {0.513725, 0.647059, 0.596078, 1.000000}, + {0.827451, 0.525490, 0.607843, 1.000000}, + {0.556863, 0.752941, 0.486275, 1.000000}, + {0.921569, 0.858824, 0.698039, 1.000000}, +}; + +const GdkRGBA tango_palette[PALETTE_SIZE] = { + {0, 0, 0, 1}, + {0.8, 0, 0, 1}, + {0.305882, 0.603922, 0.023529, 1}, + {0.768627, 0.627451, 0, 1}, + {0.203922, 0.396078, 0.643137, 1}, + {0.458824, 0.313725, 0.482353, 1}, + {0.0235294,0.596078, 0.603922, 1}, + {0.827451, 0.843137, 0.811765, 1}, + {0.333333, 0.341176, 0.32549, 1}, + {0.937255, 0.160784, 0.160784, 1}, + {0.541176, 0.886275, 0.203922, 1}, + {0.988235, 0.913725, 0.309804, 1}, + {0.447059, 0.623529, 0.811765, 1}, + {0.678431, 0.498039, 0.658824, 1}, + {0.203922, 0.886275, 0.886275, 1}, + {0.933333, 0.933333, 0.92549, 1} +}; + +const GdkRGBA linux_palette[PALETTE_SIZE] = { + {0, 0, 0, 1}, + {0.666667, 0, 0, 1}, + {0, 0.666667, 0, 1}, + {0.666667, 0.333333, 0, 1}, + {0, 0, 0.666667, 1}, + {0.666667, 0, 0.666667, 1}, + {0, 0.666667, 0.666667, 1}, + {0.666667, 0.666667, 0.666667, 1}, + {0.333333, 0.333333, 0.333333, 1}, + {1, 0.333333, 0.333333, 1}, + {0.333333, 1, 0.333333, 1}, + {1, 1, 0.333333, 1}, + {0.333333, 0.333333, 1, 1}, + {1, 0.333333, 1, 1}, + {0.333333, 1, 1, 1}, + {1, 1, 1, 1} +}; + +const GdkRGBA solarized_dark_palette[PALETTE_SIZE] = { + {0.027451, 0.211765, 0.258824, 1}, + {0.862745, 0.196078, 0.184314, 1}, + {0.521569, 0.600000, 0.000000, 1}, + {0.709804, 0.537255, 0.000000, 1}, + {0.149020, 0.545098, 0.823529, 1}, + {0.827451, 0.211765, 0.509804, 1}, + {0.164706, 0.631373, 0.596078, 1}, + {0.933333, 0.909804, 0.835294, 1}, + {0.000000, 0.168627, 0.211765, 1}, + {0.796078, 0.294118, 0.086275, 1}, + {0.345098, 0.431373, 0.458824, 1}, + {0.396078, 0.482353, 0.513725, 1}, + {0.513725, 0.580392, 0.588235, 1}, + {0.423529, 0.443137, 0.768627, 1}, + {0.576471, 0.631373, 0.631373, 1}, + {0.992157, 0.964706, 0.890196, 1} +#if 0 + { 0, 0x0707, 0x3636, 0x4242 }, // 0 base02 black (used as background color) + { 0, 0xdcdc, 0x3232, 0x2f2f }, // 1 red + { 0, 0x8585, 0x9999, 0x0000 }, // 2 green + { 0, 0xb5b5, 0x8989, 0x0000 }, // 3 yellow + { 0, 0x2626, 0x8b8b, 0xd2d2 }, // 4 blue + { 0, 0xd3d3, 0x3636, 0x8282 }, // 5 magenta + { 0, 0x2a2a, 0xa1a1, 0x9898 }, // 6 cyan + { 0, 0xeeee, 0xe8e8, 0xd5d5 }, // 7 base2 white (used as foreground color) + { 0, 0x0000, 0x2b2b, 0x3636 }, // 8 base3 bright black + { 0, 0xcbcb, 0x4b4B, 0x1616 }, // 9 orange + { 0, 0x5858, 0x6e6e, 0x7575 }, // 10 base01 bright green + { 0, 0x6565, 0x7b7b, 0x8383 }, // 11 base00 bright yellow + { 0, 0x8383, 0x9494, 0x9696 }, // 12 base0 brigth blue + { 0, 0x6c6c, 0x7171, 0xc4c4 }, // 13 violet + { 0, 0x9393, 0xa1a1, 0xa1a1 }, // 14 base1 cyan + { 0, 0xfdfd, 0xf6f6, 0xe3e3 } // 15 base3 white +#endif +}; + +const GdkRGBA solarized_light_palette[PALETTE_SIZE] = { + {0.933333, 0.909804, 0.835294, 1}, + {0.862745, 0.196078, 0.184314, 1}, + {0.521569, 0.600000, 0.000000, 1}, + {0.709804, 0.537255, 0.000000, 1}, + {0.149020, 0.545098, 0.823529, 1}, + {0.827451, 0.211765, 0.509804, 1}, + {0.164706, 0.631373, 0.596078, 1}, + {0.027451, 0.211765, 0.258824, 1}, + {0.992157, 0.964706, 0.890196, 1}, + {0.796078, 0.294118, 0.086275, 1}, + {0.576471, 0.631373, 0.631373, 1}, + {0.513725, 0.580392, 0.588235, 1}, + {0.396078, 0.482353, 0.513725, 1}, + {0.423529, 0.443137, 0.768627, 1}, + {0.345098, 0.431373, 0.458824, 1}, + {0.000000, 0.168627, 0.211765, 1} +#if 0 + { 0, 0xeeee, 0xe8e8, 0xd5d5 }, // 0 S_base2 + { 0, 0xdcdc, 0x3232, 0x2f2f }, // 1 S_red + { 0, 0x8585, 0x9999, 0x0000 }, // 2 S_green + { 0, 0xb5b5, 0x8989, 0x0000 }, // 3 S_yellow + { 0, 0x2626, 0x8b8b, 0xd2d2 }, // 4 S_blue + { 0, 0xd3d3, 0x3636, 0x8282 }, // 5 S_magenta + { 0, 0x2a2a, 0xa1a1, 0x9898 }, // 6 S_cyan + { 0, 0x0707, 0x3636, 0x4242 }, // 7 S_base02 + { 0, 0xfdfd, 0xf6f6, 0xe3e3 }, // 8 S_base3 + { 0, 0xcbcb, 0x4b4B, 0x1616 }, // 9 S_orange + { 0, 0x9393, 0xa1a1, 0xa1a1 }, // 10 S_base1 + { 0, 0x8383, 0x9494, 0x9696 }, // 11 S_base0 + { 0, 0x6565, 0x7b7b, 0x8383 }, // 12 S_base00 + { 0, 0x6c6c, 0x7171, 0xc4c4 }, // 13 S_violet + { 0, 0x5858, 0x6e6e, 0x7575 }, // 14 S_base01 + { 0, 0x0000, 0x2b2b, 0x3636 } // 15 S_base03 +#endif +}; + + +const GdkRGBA xterm_palette[PALETTE_SIZE] = { + {0, 0, 0, 1}, + {0.803922, 0, 0, 1}, + {0, 0.803922, 0, 1}, + {0.803922, 0.803922, 0, 1}, + {0.117647, 0.564706, 1, 1}, + {0.803922, 0, 0.803922, 1}, + {0, 0.803922, 0.803922, 1}, + {0.898039, 0.898039, 0.898039, 1}, + {0.298039, 0.298039, 0.298039, 1}, + {1, 0, 0, 1}, + {0, 1, 0, 1}, + {1, 1, 0, 1}, + {0.27451, 0.509804, 0.705882, 1}, + {1, 0, 1, 1}, + {0, 1, 1, 1}, + {1, 1, 1, 1} +}; + +const GdkRGBA rxvt_palette[PALETTE_SIZE] = { + {0, 0, 0, 1 }, + {0.803921, 0, 0, 1 }, + {0, 0.803921, 0, 1 }, + {0.803921, 0.803921, 0, 1 }, + {0, 0, 0.803921, 1 }, + {0.803921, 0, 0.803921, 1 }, + {0, 0.803921, 0.803921, 1 }, + {0.980392, 0.921568, 0.843137, 1 }, + {0.250980, 0.250980, 0.250980, 1 }, + {1, 0, 0, 1 }, + {0, 1, 0, 1 }, + {1, 1, 0, 1 }, + {0, 0, 1, 1 }, + {1, 0, 1, 1 }, + {0, 1, 1, 1 }, + {1, 1, 1, 1 } +}; + + +#define HIG_DIALOG_CSS "* {\n"\ + "-GtkDialog-action-area-border : 12;\n"\ + "-GtkDialog-button-spacing : 12;\n"\ + "}" + +#define NOTEBOOK_CSS "* {\n"\ + "color : rgba(0,0,0,1.0);\n"\ + "background-color : rgba(0,0,0,1.0);\n"\ + "border-color : rgba(0,0,0,1.0);\n"\ + "}" + +#define TAB_TITLE_CSS "* {\n"\ + "padding : 0px;\n"\ + "}" + +#define NUM_COLORSETS 6 +#define PCRE2_CODE_UNIT_WIDTH 8 +#include + +static struct { + GtkWidget *main_window; + GtkWidget *notebook; + GtkWidget *menu; + PangoFontDescription *font; + GdkRGBA forecolors[NUM_COLORSETS]; + GdkRGBA backcolors[NUM_COLORSETS]; + GdkRGBA curscolors[NUM_COLORSETS]; + const GdkRGBA *palette; + char *current_match; + guint width; + guint height; + glong columns; + glong rows; + gint scroll_lines; + gint label_count; + VteCursorShape cursor_type; + bool first_tab; + bool show_scrollbar; + bool show_closebutton; + bool tabs_on_bottom; + bool less_questions; + bool urgent_bell; + bool audible_bell; + bool blinking_cursor; + bool stop_tab_cycling_at_end_tabs; + bool allow_bold; + bool fullscreen; + bool keep_fc; /* Global flag to indicate that we don't want changes in the files and columns values */ + bool config_modified; /* Configuration has been modified */ + bool externally_modified; /* Configuration file has been modified by another process */ + bool resized; + bool disable_numbered_tabswitch; /* For disabling direct tabswitching key */ + bool focused; /* For fading feature */ + bool first_focus; /* First time gtkwindow recieve focus when is created */ + bool faded; /* Fading state */ + bool use_fading; + bool scrollable_tabs; + GtkWidget *item_copy_link; /* We include here only the items which need to be hidden */ + GtkWidget *item_open_link; + GtkWidget *item_open_mail; + GtkWidget *open_link_separator; + GKeyFile *cfg; + GtkCssProvider *provider; + char *configfile; + char *icon; + char *word_chars; /* Exceptions for word selection */ + gchar *tab_default_title; + gint last_colorset; + gint add_tab_accelerator; + gint del_tab_accelerator; + gint switch_tab_accelerator; + gint move_tab_accelerator; + gint copy_accelerator; + gint scrollbar_accelerator; + gint open_url_accelerator; + gint font_size_accelerator; + gint set_tab_name_accelerator; + gint search_accelerator; + gint set_colorset_accelerator; + gint add_tab_key; + gint del_tab_key; + gint prev_tab_key; + gint next_tab_key; + gint copy_key; + gint paste_key; + gint scrollbar_key; + gint set_tab_name_key; + gint search_key; + gint fullscreen_key; + gint increase_font_size_key; + gint decrease_font_size_key; + gint set_colorset_keys[NUM_COLORSETS]; + VteRegex *http_vteregexp, *mail_vteregexp; + char *argv[3]; +} sakura; + +struct terminal { + GtkWidget *hbox; + GtkWidget *vte; /* Reference to VTE terminal */ + GPid pid; /* pid of the forked process */ + GtkWidget *scrollbar; + GtkWidget *label; + gchar *label_text; + bool label_set_byuser; + GtkBorder padding; /* inner-property data */ + int colorset; +}; + + +#define ICON_FILE "terminal-tango.svg" +#define SCROLL_LINES 4096 +#define DEFAULT_SCROLL_LINES 4096 +#define HTTP_REGEXP "(ftp|http)s?://[^ \t\n\b()<>{}«»\\[\\]\'\"]+[^.]" +#define MAIL_REGEXP "[^ \t\n\b]+@([^ \t\n\b]+\\.)+([a-zA-Z]{2,4})" +#define DEFAULT_CONFIGFILE "sakura.conf" +#define DEFAULT_COLUMNS 80 +#define DEFAULT_ROWS 24 +#define DEFAULT_FONT "Ubuntu Mono,monospace 12" +#define FONT_MINIMAL_SIZE (PANGO_SCALE*6) +#define DEFAULT_WORD_CHARS "-,./?%&#_~:" +#define DEFAULT_PALETTE "solarized_dark" +#define TAB_MAX_SIZE 40 +#define TAB_MIN_SIZE 6 +#define FORWARD 1 +#define BACKWARDS 2 +#define FADE_PERCENT 60 +#define DEFAULT_ADD_TAB_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_DEL_TAB_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_SWITCH_TAB_ACCELERATOR (GDK_CONTROL_MASK) +#define DEFAULT_MOVE_TAB_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_COPY_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_SCROLLBAR_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_OPEN_URL_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_FONT_SIZE_ACCELERATOR (GDK_CONTROL_MASK) +#define DEFAULT_SET_TAB_NAME_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_SEARCH_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_SELECT_COLORSET_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) +#define DEFAULT_ADD_TAB_KEY GDK_KEY_T +#define DEFAULT_DEL_TAB_KEY GDK_KEY_W +#define DEFAULT_PREV_TAB_KEY GDK_KEY_Left +#define DEFAULT_NEXT_TAB_KEY GDK_KEY_Right +#define DEFAULT_COPY_KEY GDK_KEY_C +#define DEFAULT_PASTE_KEY GDK_KEY_V +#define DEFAULT_SCROLLBAR_KEY GDK_KEY_S +#define DEFAULT_SET_TAB_NAME_KEY GDK_KEY_N +#define DEFAULT_SEARCH_KEY GDK_KEY_F +#define DEFAULT_FULLSCREEN_KEY GDK_KEY_F11 +#define DEFAULT_INCREASE_FONT_SIZE_KEY GDK_KEY_plus +#define DEFAULT_DECREASE_FONT_SIZE_KEY GDK_KEY_minus +#define DEFAULT_SCROLLABLE_TABS TRUE + +/* make this an array instead of #defines to get a compile time + * error instead of a runtime if NUM_COLORSETS changes */ +static int cs_keys[NUM_COLORSETS] = + {GDK_KEY_F1, GDK_KEY_F2, GDK_KEY_F3, GDK_KEY_F4, GDK_KEY_F5, GDK_KEY_F6}; + +#define ERROR_BUFFER_LENGTH 256 +const char cfg_group[] = "sakura"; + +static GQuark term_data_id = 0; +#define sakura_get_page_term( sakura, page_idx ) \ + (struct terminal*)g_object_get_qdata( \ + G_OBJECT( gtk_notebook_get_nth_page( (GtkNotebook*)sakura.notebook, page_idx ) ), term_data_id); + +#define sakura_set_page_term( sakura, page_idx, term ) \ + g_object_set_qdata_full( \ + G_OBJECT( gtk_notebook_get_nth_page( (GtkNotebook*)sakura.notebook, page_idx) ), \ + term_data_id, term, (GDestroyNotify)g_free); + +#define sakura_set_config_integer(key, value) do {\ + g_key_file_set_integer(sakura.cfg, cfg_group, key, value);\ + sakura.config_modified=TRUE;\ + } while(0); + +#define sakura_set_config_string(key, value) do {\ + g_key_file_set_value(sakura.cfg, cfg_group, key, value);\ + sakura.config_modified=TRUE;\ + } while(0); + +#define sakura_set_config_boolean(key, value) do {\ + g_key_file_set_boolean(sakura.cfg, cfg_group, key, value);\ + sakura.config_modified=TRUE;\ + } while(0); + + +/* Spawn callback */ +void sakura_spawm_callback (VteTerminal *, GPid, GError, gpointer); +/* Callbacks */ +static gboolean sakura_key_press (GtkWidget *, GdkEventKey *, gpointer); +static gboolean sakura_button_press (GtkWidget *, GdkEventButton *, gpointer); +static void sakura_beep (GtkWidget *, void *); +static void sakura_increase_font (GtkWidget *, void *); +static void sakura_decrease_font (GtkWidget *, void *); +static void sakura_child_exited (GtkWidget *, void *); +static void sakura_eof (GtkWidget *, void *); +static void sakura_title_changed (GtkWidget *, void *); +static gboolean sakura_delete_event (GtkWidget *, void *); +static void sakura_destroy_window (GtkWidget *, void *); +static gboolean sakura_resized_window( GtkWidget *, GdkEventConfigure *, void *); +static gboolean sakura_focus_in( GtkWidget *, GdkEvent *, void *); +static gboolean sakura_focus_out( GtkWidget *, GdkEvent *, void *); +static void sakura_closebutton_clicked (GtkWidget *, void *); +static void sakura_conf_changed (GtkWidget *, void *); +static void sakura_window_show_event (GtkWidget *, gpointer); +//static gboolean sakura_notebook_focus_in (GtkWidget *, void *); +static gboolean sakura_notebook_scroll (GtkWidget *, GdkEventScroll *); +/* Menuitem callbacks */ +static void sakura_font_dialog (GtkWidget *, void *); +static void sakura_set_name_dialog (GtkWidget *, void *); +static void sakura_color_dialog (GtkWidget *, void *); +static void sakura_set_title_dialog (GtkWidget *, void *); +static void sakura_search_dialog (GtkWidget *, void *); +static void sakura_new_tab (GtkWidget *, void *); +static void sakura_close_tab (GtkWidget *, void *); +static void sakura_fullscreen (GtkWidget *, void *); +static void sakura_open_url (GtkWidget *, void *); +static void sakura_copy (GtkWidget *, void *); +static void sakura_paste (GtkWidget *, void *); +static void sakura_show_first_tab (GtkWidget *widget, void *data); +static void sakura_tabs_on_bottom (GtkWidget *widget, void *data); +static void sakura_less_questions (GtkWidget *widget, void *data); +static void sakura_show_close_button (GtkWidget *widget, void *data); +static void sakura_show_scrollbar(GtkWidget *, void *); +static void sakura_disable_numbered_tabswitch (GtkWidget *, void *); +static void sakura_use_fading (GtkWidget *, void *); +static void sakura_setname_entry_changed(GtkWidget *, void *); + +/* Misc */ +static void sakura_error(const char *, ...); + +/* Functions */ +static void sakura_init(); +static void sakura_init_popup(); +static void sakura_destroy(); +static void sakura_add_tab(); +static void sakura_del_tab(); +static void sakura_move_tab(gint); +static gint sakura_find_tab(VteTerminal *); +static void sakura_set_font(); +static void sakura_set_tab_label_text(const gchar *, gint page); +static void sakura_set_size(void); +static void sakura_set_keybind(const gchar *, guint); +static guint sakura_get_keybind(const gchar *); +static void sakura_config_done(); +static void sakura_set_colorset (int); +static void sakura_set_colors (void); +static guint sakura_tokeycode(guint key); +static void sakura_fade_in(void); +static void sakura_fade_out(void); + +/* Globals for command line parameters */ +static const char *option_font; +static const char *option_workdir; +static const char *option_execute; +static gchar **option_xterm_args; +static gboolean option_xterm_execute=FALSE; +static gboolean option_version=FALSE; +static gint option_ntabs=1; +static gint option_login = FALSE; +static const char *option_title; +static const char *option_icon; +static int option_rows, option_columns; +static gboolean option_hold=FALSE; +static char *option_config_file; +static gboolean option_fullscreen; +static gboolean option_maximize; +static gint option_colorset; + +static GOptionEntry entries[] = { + { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, N_("Print version number"), NULL }, + { "font", 'f', 0, G_OPTION_ARG_STRING, &option_font, N_("Select initial terminal font"), NULL }, + { "ntabs", 'n', 0, G_OPTION_ARG_INT, &option_ntabs, N_("Select initial number of tabs"), NULL }, + { "working-directory", 'd', 0, G_OPTION_ARG_STRING, &option_workdir, N_("Set working directory"), NULL }, + { "execute", 'x', 0, G_OPTION_ARG_STRING, &option_execute, N_("Execute command"), NULL }, + { "xterm-execute", 'e', 0, G_OPTION_ARG_NONE, &option_xterm_execute, N_("Execute command (last option in the command line)"), NULL }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &option_xterm_args, NULL, NULL }, + { "login", 'l', 0, G_OPTION_ARG_NONE, &option_login, N_("Login shell"), NULL }, + { "title", 't', 0, G_OPTION_ARG_STRING, &option_title, N_("Set window title"), NULL }, + { "icon", 'i', 0, G_OPTION_ARG_STRING, &option_icon, N_("Set window icon"), NULL }, + { "xterm-title", 'T', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &option_title, NULL, NULL }, + { "columns", 'c', 0, G_OPTION_ARG_INT, &option_columns, N_("Set columns number"), NULL }, + { "rows", 'r', 0, G_OPTION_ARG_INT, &option_rows, N_("Set rows number"), NULL }, + { "hold", 'h', 0, G_OPTION_ARG_NONE, &option_hold, N_("Hold window after execute command"), NULL }, + { "maximize", 'm', 0, G_OPTION_ARG_NONE, &option_maximize, N_("Maximize window"), NULL }, + { "fullscreen", 's', 0, G_OPTION_ARG_NONE, &option_fullscreen, N_("Fullscreen mode"), NULL }, + { "config-file", 0, 0, G_OPTION_ARG_FILENAME, &option_config_file, N_("Use alternate configuration file"), NULL }, + { "colorset", 0, 0, G_OPTION_ARG_INT, &option_colorset, N_("Select initial colorset"), NULL }, + { NULL } +}; + + +static guint +sakura_tokeycode (guint key) +{ + GdkKeymap *keymap; + GdkKeymapKey *keys; + gint n_keys; + guint res = 0; + + keymap = gdk_keymap_get_for_display(gdk_display_get_default()); + + if (gdk_keymap_get_entries_for_keyval(keymap, key, &keys, &n_keys)) { + if (n_keys > 0) { + res = keys[0].keycode; + } + g_free(keys); + } + + return res; +} + + +void +search(VteTerminal *vte, const char *pattern, bool reverse) +{ + GError *error=NULL; + VteRegex *regex; + + vte_terminal_search_set_wrap_around(vte, TRUE); + + regex=vte_regex_new_for_search(pattern, (gssize) strlen(pattern), PCRE2_MULTILINE|PCRE2_CASELESS, &error); + if (!regex) { /* Ubuntu-fucking-morons (17.10 and 18.04) package a broken VTE without PCRE2, and search fails */ + sakura_error(error->message); + g_error_free(error); + } else { + vte_terminal_search_set_regex(vte, regex, 0); + + if (!vte_terminal_search_find_next(vte)) { + vte_terminal_unselect_all(vte); + vte_terminal_search_find_next(vte); + } + + if (regex) vte_regex_unref(regex); + } +} + + +static gboolean +sakura_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data) +{ + if (event->type!=GDK_KEY_PRESS) return FALSE; + + unsigned int topage = 0; + + gint npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + /* Use keycodes instead of keyvals. With keyvals, key bindings work only in US/ISO8859-1 and similar locales */ + guint keycode = event->hardware_keycode; + + /* Add/delete tab keybinding pressed */ + if ( (event->state & sakura.add_tab_accelerator)==sakura.add_tab_accelerator && + keycode==sakura_tokeycode(sakura.add_tab_key)) { + sakura_add_tab(); + return TRUE; + } else if ( (event->state & sakura.del_tab_accelerator)==sakura.del_tab_accelerator && + keycode==sakura_tokeycode(sakura.del_tab_key) ) { + /* Delete current tab */ + sakura_close_tab(NULL, NULL); + return TRUE; + } + + /* Switch tab keybinding pressed (numbers or next/prev) */ + /* In cases when the user configured accelerators like these ones: + switch_tab_accelerator=4 for ctrl+next[prev]_tab_key + move_tab_accelerator=5 for ctrl+shift+next[prev]_tab_key + move never works, because switch will be processed first, so it needs to be fixed with the following condition */ + if ( ((event->state & sakura.switch_tab_accelerator) == sakura.switch_tab_accelerator) && + ((event->state & sakura.move_tab_accelerator) != sakura.move_tab_accelerator) ) { + + if ((keycode>=sakura_tokeycode(GDK_KEY_1)) && (keycode<=sakura_tokeycode( GDK_KEY_9))) { + + /* User has explicitly disabled this branch, make sure to propagate the event */ + if(sakura.disable_numbered_tabswitch) return FALSE; + + if (sakura_tokeycode(GDK_KEY_1) == keycode) topage = 0; + else if (sakura_tokeycode(GDK_KEY_2) == keycode) topage = 1; + else if (sakura_tokeycode(GDK_KEY_3) == keycode) topage = 2; + else if (sakura_tokeycode(GDK_KEY_4) == keycode) topage = 3; + else if (sakura_tokeycode(GDK_KEY_5) == keycode) topage = 4; + else if (sakura_tokeycode(GDK_KEY_6) == keycode) topage = 5; + else if (sakura_tokeycode(GDK_KEY_7) == keycode) topage = 6; + else if (sakura_tokeycode(GDK_KEY_8) == keycode) topage = 7; + else if (sakura_tokeycode(GDK_KEY_9) == keycode) topage = 8; + if (topage <= npages) + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), topage); + return TRUE; + } else if (keycode==sakura_tokeycode(sakura.prev_tab_key)) { + if (gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook))==0) { + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), npages-1); + } else { + gtk_notebook_prev_page(GTK_NOTEBOOK(sakura.notebook)); + } + return TRUE; + } else if (keycode==sakura_tokeycode(sakura.next_tab_key)) { + if (gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook))==(npages-1)) { + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), 0); + } else { + gtk_notebook_next_page(GTK_NOTEBOOK(sakura.notebook)); + } + return TRUE; + } + } + + /* Move tab keybinding pressed */ + if ( ((event->state & sakura.move_tab_accelerator) == sakura.move_tab_accelerator)) { + if (keycode==sakura_tokeycode(sakura.prev_tab_key)) { + sakura_move_tab(BACKWARDS); + return TRUE; + } else if (keycode==sakura_tokeycode(sakura.next_tab_key)) { + sakura_move_tab(FORWARD); + return TRUE; + } + } + + /* Copy/paste keybinding pressed */ + if ( (event->state & sakura.copy_accelerator)==sakura.copy_accelerator ) { + if (keycode==sakura_tokeycode(sakura.copy_key)) { + sakura_copy(NULL, NULL); + return TRUE; + } else if (keycode==sakura_tokeycode(sakura.paste_key)) { + sakura_paste(NULL, NULL); + return TRUE; + } + } + + /* Show scrollbar keybinding pressed */ + if ( (event->state & sakura.scrollbar_accelerator)==sakura.scrollbar_accelerator ) { + if (keycode==sakura_tokeycode(sakura.scrollbar_key)) { + sakura_show_scrollbar(NULL, NULL); + return TRUE; + } + } + + /* Set tab name keybinding pressed */ + if ( (event->state & sakura.set_tab_name_accelerator)==sakura.set_tab_name_accelerator ) { + if (keycode==sakura_tokeycode(sakura.set_tab_name_key)) { + sakura_set_name_dialog(NULL, NULL); + return TRUE; + } + } + + /* Search keybinding pressed */ + if ( (event->state & sakura.search_accelerator)==sakura.search_accelerator ) { + if (keycode==sakura_tokeycode(sakura.search_key)) { + sakura_search_dialog(NULL, NULL); + return TRUE; + } + } + + /* Increase/decrease font size keybinding pressed */ + if ( (event->state & sakura.font_size_accelerator)==sakura.font_size_accelerator ) { + if (keycode==sakura_tokeycode(sakura.increase_font_size_key)) { + sakura_increase_font(NULL, NULL); + return TRUE; + } else if (keycode==sakura_tokeycode(sakura.decrease_font_size_key)) { + sakura_decrease_font(NULL, NULL); + return TRUE; + } + } + + /* F11 (fullscreen) pressed */ + if (keycode==sakura_tokeycode(sakura.fullscreen_key)){ + sakura_fullscreen(NULL, NULL); + return TRUE; + } + + /* Change in colorset */ + if ( (event->state & sakura.set_colorset_accelerator)==sakura.set_colorset_accelerator ) { + int i; + for(i=0; itype != GDK_BUTTON_PRESS) + return FALSE; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + /* Find out if cursor it's over a matched expression...*/ + sakura.current_match = vte_terminal_match_check_event(VTE_TERMINAL(term->vte), (GdkEvent *) button_event, &tag); + + /* Left button with accelerator: open the URL if any */ + if (button_event->button == 1 && + ((button_event->state & sakura.open_url_accelerator) == sakura.open_url_accelerator) && + sakura.current_match) { + + sakura_open_url(NULL, NULL); + + return TRUE; + } + + /* Right button: show the popup menu */ + if (button_event->button == 3) { + GtkMenu *menu; + menu = GTK_MENU (widget); + + if (sakura.current_match) { + /* Show the extra options in the menu */ + + char *matches; + /* Is it a mail address? */ + if (vte_terminal_event_check_regex_simple(VTE_TERMINAL(term->vte), (GdkEvent *) button_event, + &sakura.mail_vteregexp, 1, 0, &matches)) { + gtk_widget_show(sakura.item_open_mail); + gtk_widget_hide(sakura.item_open_link); + } else { + gtk_widget_show(sakura.item_open_link); + gtk_widget_hide(sakura.item_open_mail); + } + gtk_widget_show(sakura.item_copy_link); + gtk_widget_show(sakura.open_link_separator); + + g_free(matches); + } else { + /* Hide all the options */ + gtk_widget_hide(sakura.item_open_mail); + gtk_widget_hide(sakura.item_open_link); + gtk_widget_hide(sakura.item_copy_link); + gtk_widget_hide(sakura.open_link_separator); + } + + gtk_menu_popup_at_pointer(menu, (GdkEvent *) button_event); + + return TRUE; + } + + return FALSE; +} + + +static gboolean +sakura_focus_in(GtkWidget *widget, GdkEvent *event, void *data) +{ + if (event->type != GDK_FOCUS_CHANGE) return FALSE; + + /* Ignore first focus event */ + if (sakura.first_focus) { + sakura.first_focus=false; return FALSE; + } + + if (!sakura.focused) { + sakura.focused=true; + + if (!sakura.first_focus && sakura.use_fading) { + sakura_fade_in(); + } + + sakura_set_colors(); + return TRUE; + } + + return FALSE; +} + + +static gboolean +sakura_focus_out(GtkWidget *widget, GdkEvent *event, void *data) +{ + if (event->type != GDK_FOCUS_CHANGE) return FALSE; + + if (sakura.focused) { + sakura.focused=false; + + if (!sakura.first_focus && sakura.use_fading) { + sakura_fade_out(); + } + + sakura_set_colors(); + return TRUE; + } + + return FALSE; +} + + +/* Handler for notebook focus-in-event */ +//static gboolean +//sakura_notebook_focus_in(GtkWidget *widget, void *data) +//{ +// struct terminal *term; +// int index; +// +// index = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); +// term = sakura_get_page_term(sakura, index); +// +// /* If term is found stop event propagation */ +// if(term != NULL) { +// gtk_widget_grab_focus(term->vte); +// return TRUE; +// } +// +// return FALSE; +//} + + +/* Handler for notebook scroll-event - switches tabs by scroll direction + TODO: let scroll directions configurable */ +static gboolean +sakura_notebook_scroll(GtkWidget *widget, GdkEventScroll *event) +{ + gint page, npages; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + switch(event->direction) { + case GDK_SCROLL_DOWN: + { + if (sakura.stop_tab_cycling_at_end_tabs == 1) { + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), --page >= 0 ? page : 0); + } else { + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), --page >= 0 ? page : npages - 1); + } + break; + } + case GDK_SCROLL_UP: + { + if (sakura.stop_tab_cycling_at_end_tabs == 1) { + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), ++page < npages ? page : npages - 1); + } else { + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), ++page < npages ? page : 0); + } + break; + } + case GDK_SCROLL_LEFT: + case GDK_SCROLL_RIGHT: + case GDK_SCROLL_SMOOTH: + break; + } + + return FALSE; +} + + +static void +sakura_page_removed (GtkWidget *widget, void *data) +{ + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook))==1) { + /* If the first tab is disabled, window size changes and we need + * to recalculate its size */ + sakura_set_size(); + } +} + + +static void +sakura_beep (GtkWidget *widget, void *data) +{ + // Remove the urgency hint. This is necessary to signal the window manager + // that a new urgent event happened when the urgent hint is set after this. + gtk_window_set_urgency_hint(GTK_WINDOW(sakura.main_window), FALSE); + + if (sakura.urgent_bell) { + gtk_window_set_urgency_hint(GTK_WINDOW(sakura.main_window), TRUE); + } +} + + +static void +sakura_increase_font (GtkWidget *widget, void *data) +{ + gint new_size; + + /* Increment font size one unit */ + new_size=pango_font_description_get_size(sakura.font)+PANGO_SCALE; + + pango_font_description_set_size(sakura.font, new_size); + sakura_set_font(); + sakura_set_size(); + sakura_set_config_string("font", pango_font_description_to_string(sakura.font)); +} + + +static void +sakura_decrease_font (GtkWidget *widget, void *data) +{ + gint new_size; + + /* Decrement font size one unit */ + new_size=pango_font_description_get_size(sakura.font)-PANGO_SCALE; + + /* Set a minimal size */ + if (new_size >= FONT_MINIMAL_SIZE ) { + pango_font_description_set_size(sakura.font, new_size); + sakura_set_font(); + sakura_set_size(); + sakura_set_config_string("font", pango_font_description_to_string(sakura.font)); + } +} + + +static void +sakura_child_exited (GtkWidget *widget, void *data) +{ + gint page, npages; + struct terminal *term; + + page = gtk_notebook_page_num(GTK_NOTEBOOK(sakura.notebook), + gtk_widget_get_parent(widget)); + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + /* Only write configuration to disk if it's the last tab */ + if (npages==1) { + sakura_config_done(); + } + + if (option_hold==TRUE) { + SAY("hold option has been activated"); + return; + } + + /* Child should be automatically reaped because we don't use G_SPAWN_DO_NOT_REAP_CHILD flag */ + g_spawn_close_pid(term->pid); + + sakura_del_tab(page); + + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + if (npages==0) + sakura_destroy(); +} + + +static void +sakura_eof (GtkWidget *widget, void *data) +{ + gint npages; + struct terminal *term; + + SAY("Got EOF signal"); + + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + /* Only write configuration to disk if it's the last tab */ + if (npages==1) { + sakura_config_done(); + } + + /* Workaround for libvte strange behaviour. There is not child-exited signal for + the last terminal, so we need to kill it here. Check with libvte authors about + child-exited/eof signals */ + if (gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook))==0) { + + term = sakura_get_page_term(sakura, 0); + + if (option_hold==TRUE) { + SAY("hold option has been activated"); + return; + } + + //SAY("waiting for terminal pid (in eof) %d", term->pid); + //waitpid(term->pid, &status, WNOHANG); + /* TODO: check wait return */ + /* Child should be automatically reaped because we don't use G_SPAWN_DO_NOT_REAP_CHILD flag */ + g_spawn_close_pid(term->pid); + + sakura_del_tab(0); + + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + if (npages==0) + sakura_destroy(); + } +} + +/* This handler is called when window title changes, and is used to change window and notebook pages titles */ +static void +sakura_title_changed (GtkWidget *widget, void *data) +{ + struct terminal *term; + const char *title; + gint n_pages; + gint modified_page; + VteTerminal *vte_term=(VteTerminal *)widget; + + modified_page = sakura_find_tab(vte_term); + n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, modified_page); + + title = vte_terminal_get_window_title(VTE_TERMINAL(term->vte)); + + /* User set values overrides any other one, but title should be changed */ + if (!term->label_set_byuser) + sakura_set_tab_label_text(title, modified_page); + + if (option_title == NULL) { + if (n_pages==1) { + /* Beware: It doesn't work in Unity because there is a Compiz bug: #257391 */ + gtk_window_set_title(GTK_WINDOW(sakura.main_window), title); + } else + gtk_window_set_title(GTK_WINDOW(sakura.main_window), "sakura"); + } else { + gtk_window_set_title(GTK_WINDOW(sakura.main_window), option_title); + } + +} + + +/* Save configuration */ +static void +sakura_config_done() +{ + GError *gerror = NULL; + gsize len = 0; + + gchar *cfgdata = g_key_file_to_data(sakura.cfg, &len, &gerror); + if (!cfgdata) { + fprintf(stderr, "%s\n", gerror->message); + exit(EXIT_FAILURE); + } + + /* Write to file IF there's been changes */ + if (sakura.config_modified) { + + bool overwrite=true; + + if (sakura.externally_modified) { + GtkWidget *dialog; + gint response; + + dialog=gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, + _("Configuration has been modified by another process. Overwrite?")); + + response=gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + + if (response==GTK_RESPONSE_YES) { + overwrite=true; + } else + overwrite=false; + } + + if (overwrite) { + GIOChannel *cfgfile = g_io_channel_new_file(sakura.configfile, "w", &gerror); + if (!cfgfile) { + fprintf(stderr, "%s\n", gerror->message); + g_error_free(gerror); + exit(EXIT_FAILURE); + } + + /* FIXME: if the number of chars written is not "len", something happened. + * Check for errors appropriately...*/ + GIOStatus status = g_io_channel_write_chars(cfgfile, cfgdata, len, NULL, &gerror); + if (status != G_IO_STATUS_NORMAL) { + // FIXME: we should deal with temporary failures (G_IO_STATUS_AGAIN) + fprintf(stderr, "%s\n", gerror->message); + g_error_free(gerror); + exit(EXIT_FAILURE); + } + g_io_channel_shutdown(cfgfile, TRUE, &gerror); + g_io_channel_unref(cfgfile); + } + } +} + + +static gboolean +sakura_delete_event (GtkWidget *widget, void *data) +{ + struct terminal *term; + GtkWidget *dialog; + gint response; + gint npages; + gint i; + pid_t pgid; + + if (!sakura.less_questions) { + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + /* Check for each tab if there are running processes. Use tcgetpgrp to compare to the shell PGID */ + for (i=0; i < npages; i++) { + + term = sakura_get_page_term(sakura, i); + pgid = tcgetpgrp(vte_pty_get_fd(vte_terminal_get_pty(VTE_TERMINAL(term->vte)))); + + /* If running processes are found, we ask one time and exit */ + if ( (pgid != -1) && (pgid != term->pid)) { + dialog=gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, + _("There are running processes.\n\nDo you really want to close Sakura?")); + + response=gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + + if (response==GTK_RESPONSE_YES) { + sakura_config_done(); + return FALSE; + } else { + return TRUE; + } + } + + } + } + + sakura_config_done(); + return FALSE; +} + + +static void +sakura_destroy_window (GtkWidget *widget, void *data) +{ + sakura_destroy(); +} + + +static void +sakura_window_show_event(GtkWidget *widget, gpointer data) +{ + // set size when the window is first shown + sakura_set_size(); +} + + +static void +sakura_font_dialog (GtkWidget *widget, void *data) +{ + GtkWidget *font_dialog; + gint response; + + font_dialog=gtk_font_chooser_dialog_new(_("Select font"), GTK_WINDOW(sakura.main_window)); + gtk_font_chooser_set_font_desc(GTK_FONT_CHOOSER(font_dialog), sakura.font); + + response=gtk_dialog_run(GTK_DIALOG(font_dialog)); + + if (response==GTK_RESPONSE_OK) { + pango_font_description_free(sakura.font); + sakura.font=gtk_font_chooser_get_font_desc(GTK_FONT_CHOOSER(font_dialog)); + sakura_set_font(); + sakura_set_size(); + sakura_set_config_string("font", pango_font_description_to_string(sakura.font)); + } + + gtk_widget_destroy(font_dialog); +} + + +static void +sakura_set_name_dialog (GtkWidget *widget, void *data) +{ + GtkWidget *input_dialog, *input_header; + GtkWidget *entry, *label; + GtkWidget *name_hbox; /* We need this for correct spacing */ + gint response; + gint page; + struct terminal *term; + const gchar *text; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + input_dialog=gtk_dialog_new_with_buttons(_("Set tab name"), + GTK_WINDOW(sakura.main_window), + GTK_DIALOG_MODAL|GTK_DIALOG_USE_HEADER_BAR, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Apply"), GTK_RESPONSE_ACCEPT, + NULL); + + /* Configure the new gtk header bar*/ + input_header=gtk_dialog_get_header_bar(GTK_DIALOG(input_dialog)); + gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(input_header), FALSE); + gtk_dialog_set_default_response(GTK_DIALOG(input_dialog), GTK_RESPONSE_ACCEPT); + + /* Set style */ + gchar *css = g_strdup_printf (HIG_DIALOG_CSS); + gtk_css_provider_load_from_data(sakura.provider, css, -1, NULL); + GtkStyleContext *context = gtk_widget_get_style_context (input_dialog); + gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (sakura.provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_free(css); + + name_hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + entry=gtk_entry_new(); + label=gtk_label_new(_("New text")); + /* Set tab label as entry default text (when first tab is not displayed, get_tab_label_text + returns a null value, so check accordingly */ + text = gtk_notebook_get_tab_label_text(GTK_NOTEBOOK(sakura.notebook), term->hbox); + if (text) { + gtk_entry_set_text(GTK_ENTRY(entry), text); + } + gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); + gtk_box_pack_start(GTK_BOX(name_hbox), label, TRUE, TRUE, 12); + gtk_box_pack_start(GTK_BOX(name_hbox), entry, TRUE, TRUE, 12); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(input_dialog))), name_hbox, FALSE, FALSE, 12); + + /* Disable accept button until some text is entered */ + g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(sakura_setname_entry_changed), input_dialog); + gtk_dialog_set_response_sensitive(GTK_DIALOG(input_dialog), GTK_RESPONSE_ACCEPT, FALSE); + + gtk_widget_show_all(name_hbox); + + response=gtk_dialog_run(GTK_DIALOG(input_dialog)); + + if (response==GTK_RESPONSE_ACCEPT) { + sakura_set_tab_label_text(gtk_entry_get_text(GTK_ENTRY(entry)), page); + term->label_set_byuser=true; + } + + gtk_widget_destroy(input_dialog); +} + +static void +sakura_set_colorset (int cs) +{ + gint page; + struct terminal *term; + + if (cs<0 || cs>= NUM_COLORSETS) + return; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + term->colorset=cs; + + sakura_set_config_integer("last_colorset", term->colorset+1); + + sakura_set_colors(); +} + + +/* Set the terminal colors for all notebook tabs */ +static void +sakura_set_colors () +{ + int i; + int n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + struct terminal *term; + + for (i = (n_pages - 1); i >= 0; i--) { + term = sakura_get_page_term(sakura, i); + //SAY("Setting colorset %d", term->colorset+1); + + vte_terminal_set_colors(VTE_TERMINAL(term->vte), + &sakura.forecolors[term->colorset], + &sakura.backcolors[term->colorset], + sakura.palette, PALETTE_SIZE); + vte_terminal_set_color_cursor(VTE_TERMINAL(term->vte), &sakura.curscolors[term->colorset]); + } + + /* Main window opacity must be set. Otherwise vte widget will remain opaque */ + gtk_widget_set_opacity (sakura.main_window, sakura.backcolors[term->colorset].alpha); + +} + + +/* Callback from the color change dialog. Updates the contents of that + * dialog, passed as 'data' from user input. */ +static void +sakura_color_dialog_changed( GtkWidget *widget, void *data) +{ + int selected=-1; + GtkDialog *dialog = (GtkDialog*)data; + GtkColorButton *fore_button = g_object_get_data (G_OBJECT(dialog), "buttonfore"); + GtkColorButton *back_button = g_object_get_data (G_OBJECT(dialog), "buttonback"); + GtkColorButton *curs_button = g_object_get_data (G_OBJECT(dialog), "buttoncurs"); + GtkComboBox *set = g_object_get_data (G_OBJECT(dialog), "set_combo"); + GtkSpinButton *opacity_spin = g_object_get_data( G_OBJECT(dialog), "opacity_spin"); + GdkRGBA *temp_fore_colors = g_object_get_data( G_OBJECT(dialog), "fore"); + GdkRGBA *temp_back_colors = g_object_get_data( G_OBJECT(dialog), "back"); + GdkRGBA *temp_curs_colors = g_object_get_data( G_OBJECT(dialog), "curs"); + selected = gtk_combo_box_get_active( set ); + + /* if we come here as a result of a change in the active colorset, + * load the new colorset to the buttons. + * Else, the colorselect buttons or opacity spin have gotten a new + * value, store that. */ + if( (GtkWidget*)set == widget ) { + /* Spin opacity is a percentage, convert it*/ + gint new_opacity=(int)(temp_back_colors[selected].alpha*100); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fore_button), &temp_fore_colors[selected]); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(back_button), &temp_back_colors[selected]); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(curs_button), &temp_curs_colors[selected]); + gtk_spin_button_set_value(opacity_spin, new_opacity); + } else { + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(fore_button), &temp_fore_colors[selected]); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(back_button), &temp_back_colors[selected]); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(curs_button), &temp_curs_colors[selected]); + gtk_spin_button_update(opacity_spin); + temp_back_colors[selected].alpha=gtk_spin_button_get_value(opacity_spin)/100; + } + +} + + +static void +sakura_color_dialog (GtkWidget *widget, void *data) +{ + GtkWidget *color_dialog; GtkWidget *color_header; + GtkWidget *label1, *label2, *label3, *set_label, *opacity_label; + GtkWidget *buttonfore, *buttonback, *buttoncurs, *set_combo, *opacity_spin; + GtkAdjustment *spinner_adj; + GtkWidget *hbox_fore, *hbox_back, *hbox_curs, *hbox_sets, *hbox_opacity; + gint response; + struct terminal *term; + gint page; + int cs; + int i; + gchar combo_text[3]; + GdkRGBA temp_fore[NUM_COLORSETS]; + GdkRGBA temp_back[NUM_COLORSETS]; + GdkRGBA temp_curs[NUM_COLORSETS]; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + color_dialog=gtk_dialog_new_with_buttons(_("Select colors"), + GTK_WINDOW(sakura.main_window), + GTK_DIALOG_MODAL|GTK_DIALOG_USE_HEADER_BAR, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Select"), GTK_RESPONSE_ACCEPT, + NULL); + + /* Configure the new gtk header bar*/ + color_header=gtk_dialog_get_header_bar(GTK_DIALOG(color_dialog)); + gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(color_header), FALSE); + gtk_dialog_set_default_response(GTK_DIALOG(color_dialog), GTK_RESPONSE_ACCEPT); + + /* Set style */ + gchar *css = g_strdup_printf (HIG_DIALOG_CSS); + gtk_css_provider_load_from_data(sakura.provider, css, -1, NULL); + GtkStyleContext *context = gtk_widget_get_style_context (color_dialog); + gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (sakura.provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_free(css); + + + /* Add the drop-down combobox that selects current colorset to edit. */ + hbox_sets=gtk_box_new(FALSE, 12); + set_label=gtk_label_new(_("Colorset")); + set_combo=gtk_combo_box_text_new(); + for(cs=0; cscolorset); + + /* Foreground and background and cursor color buttons */ + hbox_fore=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + hbox_back=gtk_box_new(FALSE, 12); + hbox_curs=gtk_box_new(FALSE, 12); + label1=gtk_label_new(_("Foreground color")); + label2=gtk_label_new(_("Background color")); + label3=gtk_label_new(_("Cursor color")); + buttonfore=gtk_color_button_new_with_rgba(&sakura.forecolors[term->colorset]); + buttonback=gtk_color_button_new_with_rgba(&sakura.backcolors[term->colorset]); + buttoncurs=gtk_color_button_new_with_rgba(&sakura.curscolors[term->colorset]); + + /* Opacity control */ + hbox_opacity=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + spinner_adj = gtk_adjustment_new ((sakura.backcolors[term->colorset].alpha)*100, 0.0, 99.0, 1.0, 5.0, 0); + opacity_spin = gtk_spin_button_new(GTK_ADJUSTMENT(spinner_adj), 1.0, 0); + opacity_label = gtk_label_new(_("Opacity level (%)")); + gtk_box_pack_start(GTK_BOX(hbox_opacity), opacity_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(hbox_opacity), opacity_spin, FALSE, FALSE, 12); + + gtk_box_pack_start(GTK_BOX(hbox_fore), label1, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(hbox_fore), buttonfore, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(hbox_back), label2, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(hbox_back), buttonback, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(hbox_curs), label3, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(hbox_curs), buttoncurs, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(hbox_sets), set_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(hbox_sets), set_combo, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), hbox_sets, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), hbox_fore, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), hbox_back, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), hbox_curs, FALSE, FALSE, 6); + gtk_box_pack_end(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), hbox_opacity, FALSE, FALSE, 6); + + gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))); + + /* When user switches the colorset to change, the callback needs access + * to these selector widgets */ + g_object_set_data(G_OBJECT(color_dialog), "set_combo", set_combo); + g_object_set_data(G_OBJECT(color_dialog), "buttonfore", buttonfore); + g_object_set_data(G_OBJECT(color_dialog), "buttonback", buttonback); + g_object_set_data(G_OBJECT(color_dialog), "buttoncurs", buttoncurs); + g_object_set_data(G_OBJECT(color_dialog), "opacity_spin", opacity_spin); + g_object_set_data(G_OBJECT(color_dialog), "fore", temp_fore); + g_object_set_data(G_OBJECT(color_dialog), "back", temp_back); + g_object_set_data(G_OBJECT(color_dialog), "curs", temp_curs); + + g_signal_connect(G_OBJECT(buttonfore), "color-set", G_CALLBACK(sakura_color_dialog_changed), color_dialog ); + g_signal_connect(G_OBJECT(buttonback), "color-set", G_CALLBACK(sakura_color_dialog_changed), color_dialog ); + g_signal_connect(G_OBJECT(buttoncurs), "color-set", G_CALLBACK(sakura_color_dialog_changed), color_dialog ); + g_signal_connect(G_OBJECT(set_combo), "changed", G_CALLBACK(sakura_color_dialog_changed), color_dialog ); + g_signal_connect(G_OBJECT(opacity_spin), "changed", G_CALLBACK(sakura_color_dialog_changed), color_dialog ); + + for(i=0; icolorset = gtk_combo_box_get_active(GTK_COMBO_BOX(set_combo)); + sakura_set_config_integer("last_colorset", term->colorset+1); + sakura_set_colors(); + } + + gtk_widget_destroy(color_dialog); +} + + +static void +sakura_fade_out() +{ + gint page; + struct terminal *term; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + if (!sakura.faded) { + sakura.faded = true; + GdkRGBA x = sakura.forecolors[term->colorset]; + //SAY("fade out red %f to %f", x.red, x.red/100.0*FADE_PERCENT); + x.red = x.red/100.0 * FADE_PERCENT; + x.green = x.green/100.0 * FADE_PERCENT; + x.blue = x.blue/100.0 * FADE_PERCENT; + if ( (x.red >=0 && x.red <=1.0) && (x.green >=0 && x.green <=1.0) && (x.blue >=0 && x.blue <=1.0)) { + sakura.forecolors[term->colorset]=x; + } else { + SAY("Forecolor value out of range"); + } + } +} + + +static void +sakura_fade_in() +{ + gint page; + struct terminal *term; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + if (sakura.faded) { + sakura.faded = false; + GdkRGBA x = sakura.forecolors[term->colorset]; + //SAY("fade in red %f to %f", x.red, x.red/FADE_PERCENT*100.0); + x.red = x.red/FADE_PERCENT * 100.0; + x.green = x.green/FADE_PERCENT * 100.0; + x.blue = x.blue/FADE_PERCENT * 100.0; + if ( (x.red >=0 && x.red <=1.0) && (x.green >=0 && x.green <=1.0) && (x.blue >=0 && x.blue <=1.0)) { + sakura.forecolors[term->colorset]=x; + } else { + SAY("Forecolor value out of range"); + } + } +} + + +static void +sakura_search_dialog (GtkWidget *widget, void *data) +{ + GtkWidget *title_dialog, *title_header; + GtkWidget *entry, *label; + GtkWidget *title_hbox; + gint response; + + title_dialog=gtk_dialog_new_with_buttons(_("Search"), + GTK_WINDOW(sakura.main_window), + GTK_DIALOG_MODAL|GTK_DIALOG_USE_HEADER_BAR, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Apply"), GTK_RESPONSE_ACCEPT, + NULL); + + /* Configure the new gtk header bar*/ + title_header=gtk_dialog_get_header_bar(GTK_DIALOG(title_dialog)); + gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(title_header), FALSE); + gtk_dialog_set_default_response(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT); + + /* Set style */ + gchar *css = g_strdup_printf (HIG_DIALOG_CSS); + gtk_css_provider_load_from_data(sakura.provider, css, -1, NULL); + GtkStyleContext *context = gtk_widget_get_style_context (title_dialog); + gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (sakura.provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_free(css); + + entry=gtk_entry_new(); + label=gtk_label_new(_("Search")); + title_hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); + gtk_box_pack_start(GTK_BOX(title_hbox), label, TRUE, TRUE, 12); + gtk_box_pack_start(GTK_BOX(title_hbox), entry, TRUE, TRUE, 12); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(title_dialog))), title_hbox, FALSE, FALSE, 12); + + /* Disable accept button until some text is entered */ + g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(sakura_setname_entry_changed), title_dialog); + gtk_dialog_set_response_sensitive(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT, FALSE); + + gtk_widget_show_all(title_hbox); + + response=gtk_dialog_run(GTK_DIALOG(title_dialog)); + if (response==GTK_RESPONSE_ACCEPT) { + gint page; + struct terminal *term; + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + search(VTE_TERMINAL(term->vte), gtk_entry_get_text(GTK_ENTRY(entry)), 0); + } + gtk_widget_destroy(title_dialog); +} + + +static void +sakura_set_title_dialog (GtkWidget *widget, void *data) +{ + GtkWidget *title_dialog, *title_header; + GtkWidget *entry, *label; + GtkWidget *title_hbox; + gint response; + + title_dialog=gtk_dialog_new_with_buttons(_("Set window title"), + GTK_WINDOW(sakura.main_window), + GTK_DIALOG_MODAL|GTK_DIALOG_USE_HEADER_BAR, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Apply"), GTK_RESPONSE_ACCEPT, + NULL); + + /* Configure the new gtk header bar*/ + title_header=gtk_dialog_get_header_bar(GTK_DIALOG(title_dialog)); + gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(title_header), FALSE); + gtk_dialog_set_default_response(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT); + + /* Set style */ + gchar *css = g_strdup_printf (HIG_DIALOG_CSS); + gtk_css_provider_load_from_data(sakura.provider, css, -1, NULL); + GtkStyleContext *context = gtk_widget_get_style_context (title_dialog); + gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (sakura.provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_free(css); + + entry=gtk_entry_new(); + label=gtk_label_new(_("New window title")); + title_hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + /* Set window label as entry default text */ + gtk_entry_set_text(GTK_ENTRY(entry), gtk_window_get_title(GTK_WINDOW(sakura.main_window))); + gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); + gtk_box_pack_start(GTK_BOX(title_hbox), label, TRUE, TRUE, 12); + gtk_box_pack_start(GTK_BOX(title_hbox), entry, TRUE, TRUE, 12); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(title_dialog))), title_hbox, FALSE, FALSE, 12); + + /* Disable accept button until some text is entered */ + g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(sakura_setname_entry_changed), title_dialog); + gtk_dialog_set_response_sensitive(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT, FALSE); + + gtk_widget_show_all(title_hbox); + + response=gtk_dialog_run(GTK_DIALOG(title_dialog)); + if (response==GTK_RESPONSE_ACCEPT) { + /* Bug #257391 shadow reachs here too... */ + gtk_window_set_title(GTK_WINDOW(sakura.main_window), gtk_entry_get_text(GTK_ENTRY(entry))); + } + gtk_widget_destroy(title_dialog); +} + + + +static void +sakura_copy_url (GtkWidget *widget, void *data) +{ + GtkClipboard* clip; + + clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + gtk_clipboard_set_text(clip, sakura.current_match, -1 ); + clip = gtk_clipboard_get(GDK_SELECTION_PRIMARY); + gtk_clipboard_set_text(clip, sakura.current_match, -1 ); + +} + + +static void +sakura_open_url (GtkWidget *widget, void *data) +{ + GError *error=NULL; + gchar *browser=NULL; + + SAY("Opening %s", sakura.current_match); + + browser=g_strdup(g_getenv("BROWSER")); + + if (!browser) { + if ( !(browser = g_find_program_in_path("xdg-open")) ) { + /* TODO: Legacy for systems without xdg-open. This should be removed */ + browser = g_strdup("firefox"); + } + } + + gchar * argv[] = {browser, sakura.current_match, NULL}; + if (!g_spawn_async(".", argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error)) { + sakura_error("Couldn't exec \"%s %s\": %s", browser, sakura.current_match, error->message); + g_error_free(error); + } + + g_free(browser); +} + + +static void +sakura_open_mail (GtkWidget *widget, void *data) +{ + GError *error = NULL; + gchar *program = NULL; + + if ( (program = g_find_program_in_path("xdg-email")) ) { + gchar * argv[] = { program, sakura.current_match, NULL }; + if (!g_spawn_async(".", argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error)) { + sakura_error("Couldn't exec \"%s %s\": %s", program, sakura.current_match, error->message); + } + g_free(program); + } +} + + +static void +sakura_show_first_tab (GtkWidget *widget, void *data) +{ + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), TRUE); + sakura_set_config_string("show_always_first_tab", "Yes"); + sakura.first_tab = true; + } else { + /* Only hide tabs if the notebook has one page */ + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)) == 1) { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), FALSE); + } + sakura_set_config_string("show_always_first_tab", "No"); + sakura.first_tab = false; + } + sakura_set_size(); +} + +static void +sakura_tabs_on_bottom (GtkWidget *widget, void *data) +{ + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(sakura.notebook), GTK_POS_BOTTOM); + sakura_set_config_boolean("tabs_on_bottom", TRUE); + } else { + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(sakura.notebook), GTK_POS_TOP); + sakura_set_config_boolean("tabs_on_bottom", FALSE); + } +} + +static void +sakura_less_questions (GtkWidget *widget, void *data) +{ + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + sakura.less_questions=TRUE; + sakura_set_config_boolean("less_questions", TRUE); + } else { + sakura.less_questions=FALSE; + sakura_set_config_boolean("less_questions", FALSE); + } +} + +static void +sakura_show_close_button (GtkWidget *widget, void *data) +{ + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + sakura_set_config_boolean("closebutton", TRUE); + } else { + sakura_set_config_boolean("closebutton", FALSE); + } +} + + +static void +sakura_show_scrollbar (GtkWidget *widget, void *data) +{ + gint page; + struct terminal *term; + gint n_pages; + int i; + + sakura.keep_fc=1; + + n_pages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + if (!g_key_file_get_boolean(sakura.cfg, cfg_group, "scrollbar", NULL)) { + sakura.show_scrollbar=true; + sakura_set_config_boolean("scrollbar", TRUE); + } else { + sakura.show_scrollbar=false; + sakura_set_config_boolean("scrollbar", FALSE); + } + + /* Toggle/Untoggle the scrollbar for all tabs */ + for (i = (n_pages - 1); i >= 0; i--) { + term = sakura_get_page_term(sakura, i); + if (!sakura.show_scrollbar) + gtk_widget_hide(term->scrollbar); + else + gtk_widget_show(term->scrollbar); + } + sakura_set_size(); +} + + +static void +sakura_urgent_bell (GtkWidget *widget, void *data) +{ + sakura.urgent_bell = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); + if (sakura.urgent_bell) { + sakura_set_config_string("urgent_bell", "Yes"); + } else { + sakura_set_config_string("urgent_bell", "No"); + } +} + + +static void +sakura_audible_bell (GtkWidget *widget, void *data) +{ + gint page; + struct terminal *term; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + vte_terminal_set_audible_bell (VTE_TERMINAL(term->vte), TRUE); + sakura_set_config_string("audible_bell", "Yes"); + } else { + vte_terminal_set_audible_bell (VTE_TERMINAL(term->vte), FALSE); + sakura_set_config_string("audible_bell", "No"); + } +} + + + +static void +sakura_blinking_cursor (GtkWidget *widget, void *data) +{ + gint page; + struct terminal *term; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + vte_terminal_set_cursor_blink_mode (VTE_TERMINAL(term->vte), VTE_CURSOR_BLINK_ON); + sakura_set_config_string("blinking_cursor", "Yes"); + } else { + vte_terminal_set_cursor_blink_mode (VTE_TERMINAL(term->vte), VTE_CURSOR_BLINK_OFF); + sakura_set_config_string("blinking_cursor", "No"); + } +} + + +static void +sakura_allow_bold (GtkWidget *widget, void *data) +{ + gint page; + struct terminal *term; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + vte_terminal_set_allow_bold (VTE_TERMINAL(term->vte), TRUE); + sakura_set_config_string("allow_bold", "Yes"); + } else { + vte_terminal_set_allow_bold (VTE_TERMINAL(term->vte), FALSE); + sakura_set_config_string("allow_bold", "No"); + } +} + +static void +sakura_stop_tab_cycling_at_end_tabs (GtkWidget *widget, void *data) +{ + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + sakura_set_config_string("stop_tab_cycling_at_end_tabs", "Yes"); + sakura.stop_tab_cycling_at_end_tabs = TRUE; + } else { + sakura_set_config_string("stop_tab_cycling_at_end_tabs", "No"); + sakura.stop_tab_cycling_at_end_tabs = FALSE; + } +} + + +static void +sakura_set_cursor(GtkWidget *widget, void *data) +{ + struct terminal *term; + int n_pages, i; + + char *cursor_string = (char *)data; + n_pages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + + if (strcmp(cursor_string, "block")==0) { + sakura.cursor_type=VTE_CURSOR_SHAPE_BLOCK; + } else if (strcmp(cursor_string, "underline")==0) { + sakura.cursor_type=VTE_CURSOR_SHAPE_UNDERLINE; + } else if (strcmp(cursor_string, "ibeam")==0) { + sakura.cursor_type=VTE_CURSOR_SHAPE_IBEAM; + } + + for (i = (n_pages - 1); i >= 0; i--) { + term = sakura_get_page_term(sakura, i); + vte_terminal_set_cursor_shape(VTE_TERMINAL(term->vte), sakura.cursor_type); + } + + sakura_set_config_integer("cursor_type", sakura.cursor_type); + } +} + + +static void +sakura_set_palette(GtkWidget *widget, void *data) +{ + char *palette=(char *)data; + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + if (strcmp(palette, "linux")==0) { + sakura.palette=linux_palette; + } else if (strcmp(palette, "gruvbox")==0) { + sakura.palette=gruvbox_palette; + } else if (strcmp(palette, "xterm")==0) { + sakura.palette=xterm_palette; + } else if (strcmp(palette, "rxvt")==0) { + sakura.palette=rxvt_palette; + } else if (strcmp(palette, "tango")==0) { + sakura.palette=tango_palette; + } else if (strcmp(palette, "solarized_dark")==0) { + sakura.palette=solarized_dark_palette; + } else { + sakura.palette=solarized_light_palette; + } + + /* Palette changed so we ¿need? to set colors again */ + sakura_set_colors(); + + sakura_set_config_string("palette", palette); + } +} + + +/* Retrieve the cwd of the specified term page. + * Original function was from terminal-screen.c of gnome-terminal, copyright (C) 2001 Havoc Pennington + * Adapted by Hong Jen Yee, non-linux shit removed by David Gómez */ +static char* +sakura_get_term_cwd(struct terminal* term) +{ + char *cwd = NULL; + + if (term->pid >= 0) { + char *file, *buf; + struct stat sb; + int len; + + file = g_strdup_printf ("/proc/%d/cwd", term->pid); + + if (g_stat(file, &sb) == -1) { + g_free(file); + return cwd; + } + + buf = malloc(sb.st_size + 1); + + if(buf == NULL) { + g_free(file); + return cwd; + } + + len = readlink(file, buf, sb.st_size + 1); + + if (len > 0 && buf[0] == '/') { + buf[len] = '\0'; + cwd = g_strdup(buf); + } + + g_free(buf); + g_free(file); + } + + return cwd; +} + + +static gboolean +sakura_resized_window (GtkWidget *widget, GdkEventConfigure *event, void *data) +{ + if (event->width!=sakura.width || event->height!=sakura.height) { + //SAY("Configure event received. Current w %d h %d ConfigureEvent w %d h %d", + //sakura.width, sakura.height, event->width, event->height); + sakura.resized=TRUE; + } + + return FALSE; +} + + + +static void +sakura_setname_entry_changed (GtkWidget *widget, void *data) +{ + GtkDialog *title_dialog=(GtkDialog *)data; + + if (strcmp(gtk_entry_get_text(GTK_ENTRY(widget)), "")==0) { + gtk_dialog_set_response_sensitive(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT, FALSE); + } else { + gtk_dialog_set_response_sensitive(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT, TRUE); + } +} + + +/* Parameters are never used */ +static void +sakura_copy (GtkWidget *widget, void *data) +{ + gint page; + struct terminal *term; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + vte_terminal_copy_clipboard_format(VTE_TERMINAL(term->vte), VTE_FORMAT_TEXT); +} + + +/* Parameters are never used */ +static void +sakura_paste (GtkWidget *widget, void *data) +{ + gint page; + struct terminal *term; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + vte_terminal_paste_clipboard(VTE_TERMINAL(term->vte)); +} + + +static void +sakura_new_tab (GtkWidget *widget, void *data) +{ + sakura_add_tab(); +} + + +static void +sakura_close_tab (GtkWidget *widget, void *data) +{ + pid_t pgid; + GtkWidget *dialog; + gint response; + struct terminal *term; + gint page, npages; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + /* Only write configuration to disk if it's the last tab */ + if (npages==1) { + sakura_config_done(); + } + + /* Check if there are running processes for this tab. Use tcgetpgrp to compare to the shell PGID */ + pgid = tcgetpgrp(vte_pty_get_fd(vte_terminal_get_pty(VTE_TERMINAL(term->vte)))); + + if ( (pgid != -1) && (pgid != term->pid) && (!sakura.less_questions) ) { + dialog=gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, + _("There is a running process in this terminal.\n\nDo you really want to close it?")); + + response=gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + + if (response==GTK_RESPONSE_YES) { + sakura_del_tab(page); + } + } else + sakura_del_tab(page); + + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + if (npages==0) + sakura_destroy(); +} + + +static void +sakura_fullscreen (GtkWidget *widget, void *data) +{ + if (sakura.fullscreen!=TRUE) { + sakura.fullscreen=TRUE; + gtk_window_fullscreen(GTK_WINDOW(sakura.main_window)); + } else { + gtk_window_unfullscreen(GTK_WINDOW(sakura.main_window)); + sakura.fullscreen=FALSE; + } +} + + +/* Callback for the tabs close buttons */ +static void +sakura_closebutton_clicked(GtkWidget *widget, void *data) +{ + gint page; + GtkWidget *hbox=(GtkWidget *)data; + struct terminal *term; + pid_t pgid; + GtkWidget *dialog; + gint npages, response; + + page = gtk_notebook_page_num(GTK_NOTEBOOK(sakura.notebook), hbox); + term = sakura_get_page_term(sakura, page); + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + /* Only write configuration to disk if it's the last tab */ + if (npages==1) { + sakura_config_done(); + } + + /* Check if there are running processes for this tab. Use tcgetpgrp to compare to the shell PGID */ + pgid = tcgetpgrp(vte_pty_get_fd(vte_terminal_get_pty(VTE_TERMINAL(term->vte)))); + + if ( (pgid != -1) && (pgid != term->pid) && (!sakura.less_questions) ) { + dialog=gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, + _("There is a running process in this terminal.\n\nDo you really want to close it?")); + + response=gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + + if (response==GTK_RESPONSE_YES) { + sakura_del_tab(page); + + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook))==0) + sakura_destroy(); + } + } else { /* No processes, hell with tab */ + + sakura_del_tab(page); + + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook))==0) + sakura_destroy(); + } +} + +/* Callback called when sakura configuration file is modified by an external process */ +static void +sakura_conf_changed (GtkWidget *widget, void *data) +{ + sakura.externally_modified=true; +} + +static void +sakura_disable_numbered_tabswitch(GtkWidget *widget, void *data) +{ + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + sakura.disable_numbered_tabswitch = true; + sakura_set_config_boolean("disable_numbered_tabswitch", TRUE); + } else { + sakura.disable_numbered_tabswitch = false; + sakura_set_config_boolean("disable_numbered_tabswitch", FALSE); + } +} + +static void +sakura_use_fading(GtkWidget *widget, void *data) +{ + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + sakura.use_fading = true; + sakura_set_config_boolean("use_fading", TRUE); + } else { + sakura.use_fading = false; + sakura_set_config_boolean("use_fading", FALSE); + sakura_fade_in(); + sakura_set_colors(); + } +} + + + +/******* Functions ********/ + + +static void +sakura_init() +{ + char* configdir = NULL; + int i; + + term_data_id = g_quark_from_static_string("sakura_term"); + + /* Config file initialization*/ + sakura.cfg = g_key_file_new(); + sakura.config_modified=false; + + configdir = g_build_filename( g_get_user_config_dir(), "sakura", NULL ); + if( ! g_file_test( g_get_user_config_dir(), G_FILE_TEST_EXISTS) ) + g_mkdir( g_get_user_config_dir(), 0755 ); + if( ! g_file_test( configdir, G_FILE_TEST_EXISTS) ) + g_mkdir( configdir, 0755 ); + if (option_config_file) { + sakura.configfile=g_build_filename(configdir, option_config_file, NULL); + } else { + /* Use more standard-conforming path for config files, if available. */ + sakura.configfile=g_build_filename(configdir, DEFAULT_CONFIGFILE, NULL); + } + g_free(configdir); + + GError *error=NULL; + /* Open config file */ + if (!g_key_file_load_from_file(sakura.cfg, sakura.configfile, 0, &error)) { + /* If there's no file, ignore the error. A new one is created */ + if (error->code==G_KEY_FILE_ERROR_UNKNOWN_ENCODING || error->code==G_KEY_FILE_ERROR_INVALID_VALUE) { + g_error_free(error); + fprintf(stderr, "Not valid config file format\n"); + exit(EXIT_FAILURE); + } + } + + /* Add GFile monitor to control file external changes */ + GFile *cfgfile = g_file_new_for_path(sakura.configfile); + GFileMonitor *mon_cfgfile = g_file_monitor_file (cfgfile, 0, NULL, NULL); + g_signal_connect(G_OBJECT(mon_cfgfile), "changed", G_CALLBACK(sakura_conf_changed), NULL); + + gchar *cfgtmp = NULL; + + /* We can safely ignore errors from g_key_file_get_value(), since if the + * call to g_key_file_has_key() was successful, the key IS there. From the + * glib docs I don't know if we can ignore errors from g_key_file_has_key, + * too. I think we can: the only possible error is that the config file + * doesn't exist, but we have just read it! + */ + + for( i=0; i0 && option_colorset <= NUM_COLORSETS) { + sakura.last_colorset=option_colorset; + } + + /* These options are exclusive */ + if (option_fullscreen) { + sakura_fullscreen(NULL, NULL); + } else if (option_maximize) { + gtk_window_maximize(GTK_WINDOW(sakura.main_window)); + } + + sakura.label_count=1; + sakura.fullscreen=FALSE; + sakura.resized=FALSE; + sakura.keep_fc=false; + sakura.externally_modified=false; + + error=NULL; + sakura.http_vteregexp=vte_regex_new_for_match(HTTP_REGEXP, strlen(HTTP_REGEXP), 0, &error); + if (!sakura.http_vteregexp) { + SAY("http_regexp: %s", error->message); + g_error_free(error); + } + error=NULL; + sakura.mail_vteregexp=vte_regex_new_for_match(MAIL_REGEXP, strlen(MAIL_REGEXP), 0, &error); + if (!sakura.mail_vteregexp) { + SAY("mail_regexp: %s", error->message); + g_error_free(error); + } + + gtk_container_add(GTK_CONTAINER(sakura.main_window), sakura.notebook); + + /* Adding mask to see wheter sakura window is focused or not */ + //gtk_widget_add_events(sakura.main_window, GDK_FOCUS_CHANGE_MASK); + sakura.focused = true; + sakura.first_focus = true; + sakura.faded = false; + + sakura_init_popup(); + + g_signal_connect(G_OBJECT(sakura.main_window), "delete_event", G_CALLBACK(sakura_delete_event), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "destroy", G_CALLBACK(sakura_destroy_window), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "key-press-event", G_CALLBACK(sakura_key_press), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "configure-event", G_CALLBACK(sakura_resized_window), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "focus-out-event", G_CALLBACK(sakura_focus_out), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "focus-in-event", G_CALLBACK(sakura_focus_in), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "show", G_CALLBACK(sakura_window_show_event), NULL); + //g_signal_connect(G_OBJECT(sakura.notebook), "focus-in-event", G_CALLBACK(sakura_notebook_focus_in), NULL); + g_signal_connect(sakura.notebook, "scroll-event", G_CALLBACK(sakura_notebook_scroll), NULL); +} + + +static void +sakura_init_popup() +{ + GtkWidget *item_new_tab, *item_set_name, *item_close_tab, *item_copy, + *item_paste, *item_select_font, *item_select_colors, + *item_set_title, *item_fullscreen, + *item_toggle_scrollbar, *item_options, + *item_show_first_tab, *item_urgent_bell, *item_audible_bell, + *item_blinking_cursor, *item_allow_bold, *item_other_options, + *item_cursor, *item_cursor_block, *item_cursor_underline, *item_cursor_ibeam, + *item_palette, *item_palette_tango, *item_palette_linux, *item_palette_xterm, *item_palette_rxvt, + *item_palette_solarized_dark, *item_palette_solarized_light, *item_palette_gruvbox, + *item_show_close_button, *item_tabs_on_bottom, *item_less_questions, + *item_disable_numbered_tabswitch, *item_use_fading, *item_stop_tab_cycling_at_end_tabs; + GtkWidget *options_menu, *other_options_menu, *cursor_menu, *palette_menu; + + sakura.item_open_mail=gtk_menu_item_new_with_label(_("Open mail")); + sakura.item_open_link=gtk_menu_item_new_with_label(_("Open link")); + sakura.item_copy_link=gtk_menu_item_new_with_label(_("Copy link")); + item_new_tab=gtk_menu_item_new_with_label(_("New tab")); + item_set_name=gtk_menu_item_new_with_label(_("Set tab name...")); + item_close_tab=gtk_menu_item_new_with_label(_("Close tab")); + item_fullscreen=gtk_menu_item_new_with_label(_("Full screen")); + item_copy=gtk_menu_item_new_with_label(_("Copy")); + item_paste=gtk_menu_item_new_with_label(_("Paste")); + item_select_font=gtk_menu_item_new_with_label(_("Select font...")); + item_select_colors=gtk_menu_item_new_with_label(_("Select colors...")); + item_set_title=gtk_menu_item_new_with_label(_("Set window title...")); + + item_options=gtk_menu_item_new_with_label(_("Options")); + + item_other_options=gtk_menu_item_new_with_label(_("More")); + item_show_first_tab=gtk_check_menu_item_new_with_label(_("Always show tab bar")); + item_tabs_on_bottom=gtk_check_menu_item_new_with_label(_("Tabs at bottom")); + item_show_close_button=gtk_check_menu_item_new_with_label(_("Show close button on tabs")); + item_toggle_scrollbar=gtk_check_menu_item_new_with_label(_("Show scrollbar")); + item_less_questions=gtk_check_menu_item_new_with_label(_("Don't show exit dialog")); + item_urgent_bell=gtk_check_menu_item_new_with_label(_("Set urgent bell")); + item_audible_bell=gtk_check_menu_item_new_with_label(_("Set audible bell")); + item_blinking_cursor=gtk_check_menu_item_new_with_label(_("Set blinking cursor")); + item_allow_bold=gtk_check_menu_item_new_with_label(_("Enable bold font")); + item_stop_tab_cycling_at_end_tabs=gtk_check_menu_item_new_with_label(_("Stop tab cycling at end tabs")); + item_disable_numbered_tabswitch=gtk_check_menu_item_new_with_label(_("Disable numbered tabswitch")); + item_use_fading=gtk_check_menu_item_new_with_label(_("Enable focus fade")); + item_cursor=gtk_menu_item_new_with_label(_("Set cursor type")); + item_cursor_block=gtk_radio_menu_item_new_with_label(NULL, _("Block")); + item_cursor_underline=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_cursor_block), _("Underline")); + item_cursor_ibeam=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_cursor_block), _("IBeam")); + item_palette=gtk_menu_item_new_with_label(_("Set palette")); + item_palette_tango=gtk_radio_menu_item_new_with_label(NULL, "Tango"); + item_palette_linux=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_palette_tango), "Linux"); + item_palette_gruvbox=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_palette_tango), "Gruvbox"); + item_palette_xterm=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_palette_tango), "Xterm"); + item_palette_rxvt=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_palette_tango), "rxvt"); + item_palette_solarized_dark=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_palette_tango), "Solarized dark"); + item_palette_solarized_light=gtk_radio_menu_item_new_with_label_from_widget(GTK_RADIO_MENU_ITEM(item_palette_tango), "Solarized light"); + + /* Show defaults in menu items */ + gchar *cfgtmp = NULL; + + if (sakura.first_tab) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_show_first_tab), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_show_first_tab), FALSE); + } + + if (sakura.show_closebutton) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_show_close_button), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_show_close_button), FALSE); + } + + if (sakura.tabs_on_bottom) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_tabs_on_bottom), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_tabs_on_bottom), FALSE); + } + + if (sakura.less_questions) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_less_questions), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_less_questions), FALSE); + } + + if (sakura.show_scrollbar) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_toggle_scrollbar), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_toggle_scrollbar), FALSE); + } + + if (sakura.disable_numbered_tabswitch) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_disable_numbered_tabswitch), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_disable_numbered_tabswitch), FALSE); + } + + if (sakura.use_fading) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_use_fading), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_use_fading), FALSE); + } + + if (sakura.urgent_bell) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_urgent_bell), TRUE); + } + + if (sakura.audible_bell) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_audible_bell), TRUE); + } + + if (sakura.blinking_cursor) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_blinking_cursor), TRUE); + } + + if (sakura.allow_bold) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_allow_bold), TRUE); + } + + if (sakura.stop_tab_cycling_at_end_tabs) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_stop_tab_cycling_at_end_tabs), TRUE); + } + + switch (sakura.cursor_type){ + case VTE_CURSOR_SHAPE_BLOCK: + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_cursor_block), TRUE); + break; + case VTE_CURSOR_SHAPE_UNDERLINE: + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_cursor_underline), TRUE); + break; + case VTE_CURSOR_SHAPE_IBEAM: + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_cursor_ibeam), TRUE); + } + + cfgtmp = g_key_file_get_string(sakura.cfg, cfg_group, "palette", NULL); + if (strcmp(cfgtmp, "linux")==0) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_palette_linux), TRUE); + } else if (strcmp(cfgtmp, "gruvbox")==0) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_palette_gruvbox), TRUE); + } else if (strcmp(cfgtmp, "tango")==0) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_palette_tango), TRUE); + } else if (strcmp(cfgtmp, "xterm")==0) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_palette_xterm), TRUE); + } else if (strcmp(cfgtmp, "rxvt")==0) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_palette_rxvt), TRUE); + } else if (strcmp(cfgtmp, "solarized_dark")==0) { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_palette_solarized_dark), TRUE); + } else { + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_palette_solarized_light), TRUE); + } + g_free(cfgtmp); + + sakura.open_link_separator=gtk_separator_menu_item_new(); + + sakura.menu=gtk_menu_new(); + //sakura.labels_menu=gtk_menu_new(); + + /* Add items to popup menu */ + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), sakura.item_open_mail); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), sakura.item_open_link); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), sakura.item_copy_link); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), sakura.open_link_separator); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), item_new_tab); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), item_set_name); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), item_close_tab); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), gtk_separator_menu_item_new()); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), item_fullscreen); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), gtk_separator_menu_item_new()); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), item_copy); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), item_paste); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), gtk_separator_menu_item_new()); + gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), item_options); + + options_menu=gtk_menu_new(); + other_options_menu=gtk_menu_new(); + cursor_menu=gtk_menu_new(); + palette_menu=gtk_menu_new(); + + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_set_title); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_select_colors); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_select_font); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), gtk_separator_menu_item_new()); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_other_options); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_show_first_tab); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_tabs_on_bottom); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_show_close_button); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), gtk_separator_menu_item_new()); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_toggle_scrollbar); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_less_questions); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_urgent_bell); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_audible_bell); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_disable_numbered_tabswitch); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_use_fading); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_blinking_cursor); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_allow_bold); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_stop_tab_cycling_at_end_tabs); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_cursor); + gtk_menu_shell_append(GTK_MENU_SHELL(cursor_menu), item_cursor_block); + gtk_menu_shell_append(GTK_MENU_SHELL(cursor_menu), item_cursor_underline); + gtk_menu_shell_append(GTK_MENU_SHELL(cursor_menu), item_cursor_ibeam); + gtk_menu_shell_append(GTK_MENU_SHELL(other_options_menu), item_palette); + gtk_menu_shell_append(GTK_MENU_SHELL(palette_menu), item_palette_tango); + gtk_menu_shell_append(GTK_MENU_SHELL(palette_menu), item_palette_linux); + gtk_menu_shell_append(GTK_MENU_SHELL(palette_menu), item_palette_gruvbox); + gtk_menu_shell_append(GTK_MENU_SHELL(palette_menu), item_palette_xterm); + gtk_menu_shell_append(GTK_MENU_SHELL(palette_menu), item_palette_rxvt); + gtk_menu_shell_append(GTK_MENU_SHELL(palette_menu), item_palette_solarized_dark); + gtk_menu_shell_append(GTK_MENU_SHELL(palette_menu), item_palette_solarized_light); + + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item_options), options_menu); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item_other_options), other_options_menu); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item_cursor), cursor_menu); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item_palette), palette_menu); + + /* ... and finally assign callbacks to menuitems */ + g_signal_connect(G_OBJECT(item_new_tab), "activate", G_CALLBACK(sakura_new_tab), NULL); + g_signal_connect(G_OBJECT(item_set_name), "activate", G_CALLBACK(sakura_set_name_dialog), NULL); + g_signal_connect(G_OBJECT(item_close_tab), "activate", G_CALLBACK(sakura_close_tab), NULL); + g_signal_connect(G_OBJECT(item_select_font), "activate", G_CALLBACK(sakura_font_dialog), NULL); + g_signal_connect(G_OBJECT(item_copy), "activate", G_CALLBACK(sakura_copy), NULL); + g_signal_connect(G_OBJECT(item_paste), "activate", G_CALLBACK(sakura_paste), NULL); + g_signal_connect(G_OBJECT(item_select_colors), "activate", G_CALLBACK(sakura_color_dialog), NULL); + + g_signal_connect(G_OBJECT(item_show_first_tab), "activate", G_CALLBACK(sakura_show_first_tab), NULL); + g_signal_connect(G_OBJECT(item_tabs_on_bottom), "activate", G_CALLBACK(sakura_tabs_on_bottom), NULL); + g_signal_connect(G_OBJECT(item_less_questions), "activate", G_CALLBACK(sakura_less_questions), NULL); + g_signal_connect(G_OBJECT(item_show_close_button), "activate", G_CALLBACK(sakura_show_close_button), NULL); + g_signal_connect(G_OBJECT(item_toggle_scrollbar), "activate", G_CALLBACK(sakura_show_scrollbar), NULL); + g_signal_connect(G_OBJECT(item_urgent_bell), "activate", G_CALLBACK(sakura_urgent_bell), NULL); + g_signal_connect(G_OBJECT(item_audible_bell), "activate", G_CALLBACK(sakura_audible_bell), NULL); + g_signal_connect(G_OBJECT(item_blinking_cursor), "activate", G_CALLBACK(sakura_blinking_cursor), NULL); + g_signal_connect(G_OBJECT(item_allow_bold), "activate", G_CALLBACK(sakura_allow_bold), NULL); + g_signal_connect(G_OBJECT(item_stop_tab_cycling_at_end_tabs), "activate", G_CALLBACK(sakura_stop_tab_cycling_at_end_tabs), NULL); + g_signal_connect(G_OBJECT(item_disable_numbered_tabswitch), + "activate", G_CALLBACK(sakura_disable_numbered_tabswitch), NULL); + g_signal_connect(G_OBJECT(item_use_fading), "activate", G_CALLBACK(sakura_use_fading), NULL); + g_signal_connect(G_OBJECT(item_set_title), "activate", G_CALLBACK(sakura_set_title_dialog), NULL); + g_signal_connect(G_OBJECT(item_cursor_block), "activate", G_CALLBACK(sakura_set_cursor), "block"); + g_signal_connect(G_OBJECT(item_cursor_underline), "activate", G_CALLBACK(sakura_set_cursor), "underline"); + g_signal_connect(G_OBJECT(item_cursor_ibeam), "activate", G_CALLBACK(sakura_set_cursor), "ibeam"); + g_signal_connect(G_OBJECT(item_palette_tango), "activate", G_CALLBACK(sakura_set_palette), "tango"); + g_signal_connect(G_OBJECT(item_palette_linux), "activate", G_CALLBACK(sakura_set_palette), "linux"); + g_signal_connect(G_OBJECT(item_palette_gruvbox), "activate", G_CALLBACK(sakura_set_palette), "gruvbox"); + g_signal_connect(G_OBJECT(item_palette_xterm), "activate", G_CALLBACK(sakura_set_palette), "xterm"); + g_signal_connect(G_OBJECT(item_palette_rxvt), "activate", G_CALLBACK(sakura_set_palette), "rxvt"); + g_signal_connect(G_OBJECT(item_palette_solarized_dark), "activate", G_CALLBACK(sakura_set_palette), "solarized_dark"); + g_signal_connect(G_OBJECT(item_palette_solarized_light), "activate", G_CALLBACK(sakura_set_palette), "solarized_light"); + + g_signal_connect(G_OBJECT(sakura.item_open_mail), "activate", G_CALLBACK(sakura_open_mail), NULL); + g_signal_connect(G_OBJECT(sakura.item_open_link), "activate", G_CALLBACK(sakura_open_url), NULL); + g_signal_connect(G_OBJECT(sakura.item_copy_link), "activate", G_CALLBACK(sakura_copy_url), NULL); + g_signal_connect(G_OBJECT(item_fullscreen), "activate", G_CALLBACK(sakura_fullscreen), NULL); + + gtk_widget_show_all(sakura.menu); + +} + + +static void +sakura_destroy() +{ + SAY("Destroying sakura"); + + /* Delete all existing tabs */ + while (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)) >= 1) { + sakura_del_tab(-1); + } + + g_key_file_free(sakura.cfg); + + pango_font_description_free(sakura.font); + + free(sakura.configfile); + + gtk_main_quit(); + +} + + +static void +sakura_set_size(void) +{ + struct terminal *term; + gint pad_x, pad_y; + gint char_width, char_height; + guint npages; + gint min_width, natural_width; + gint page; + + + term = sakura_get_page_term(sakura, 0); + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + /* Mayhaps an user resize happened. Check if row and columns have changed */ + if (sakura.resized) { + sakura.columns=vte_terminal_get_column_count(VTE_TERMINAL(term->vte)); + sakura.rows=vte_terminal_get_row_count(VTE_TERMINAL(term->vte)); + SAY("New columns %ld and rows %ld", sakura.columns, sakura.rows); + sakura.resized=FALSE; + } + + gtk_style_context_get_padding(gtk_widget_get_style_context(term->vte), + gtk_widget_get_state_flags(term->vte), + &term->padding); + pad_x = term->padding.left + term->padding.right; + pad_y = term->padding.top + term->padding.bottom; + //SAY("padding x %d y %d", pad_x, pad_y); + char_width = vte_terminal_get_char_width(VTE_TERMINAL(term->vte)); + char_height = vte_terminal_get_char_height(VTE_TERMINAL(term->vte)); + + sakura.width = pad_x + (char_width * sakura.columns); + sakura.height = pad_y + (char_height * sakura.rows); + + if (npages>=2 || sakura.first_tab) { + + /* TODO: Yeah i know, this is utter shit. Remove this ugly hack and set geometry hints*/ + if (!sakura.show_scrollbar) + //sakura.height += min_height - 10; + sakura.height += 10; + else + //sakura.height += min_height - 47; + sakura.height += 47; + + sakura.width += 8; + sakura.width += /* (hb*2)+*/ (pad_x*2); + } + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + + gtk_widget_get_preferred_width(term->scrollbar, &min_width, &natural_width); + //SAY("SCROLLBAR min width %d natural width %d", min_width, natural_width); + if(sakura.show_scrollbar) { + sakura.width += min_width; + } + + /* GTK does not ignore resize for maximized windows on some systems, + so we do need check if it's maximized or not */ + GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(sakura.main_window)); + if(gdk_window != NULL) { + if(gdk_window_get_state(gdk_window) & GDK_WINDOW_STATE_MAXIMIZED) { + SAY("window is maximized, will not resize"); + return; + } + } + + gtk_window_resize(GTK_WINDOW(sakura.main_window), sakura.width, sakura.height); + SAY("Resized to %d %d", sakura.width, sakura.height); +} + + +static void +sakura_set_font() +{ + gint n_pages; + struct terminal *term; + int i; + + n_pages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + /* Set the font for all tabs */ + for (i = (n_pages - 1); i >= 0; i--) { + term = sakura_get_page_term(sakura, i); + vte_terminal_set_font(VTE_TERMINAL(term->vte), sakura.font); + } +} + + +static void +sakura_move_tab(gint direction) +{ + gint page, n_pages; + GtkWidget *child; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + n_pages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + child=gtk_notebook_get_nth_page(GTK_NOTEBOOK(sakura.notebook), page); + + if (direction==FORWARD) { + if (page!=n_pages-1) + gtk_notebook_reorder_child(GTK_NOTEBOOK(sakura.notebook), child, page+1); + } else { + if (page!=0) + gtk_notebook_reorder_child(GTK_NOTEBOOK(sakura.notebook), child, page-1); + } +} + + +/* Find the notebook page for the vte terminal passed as a parameter */ +static gint +sakura_find_tab(VteTerminal *vte_term) +{ + gint matched_page, page, n_pages; + struct terminal *term; + + n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + matched_page = -1; + page = 0; + + do { + term = sakura_get_page_term(sakura, page); + if ((VteTerminal *)term->vte == vte_term) { + matched_page=page; + } + page++; + } while (page < n_pages); + + return (matched_page); +} + + +static void +sakura_set_tab_label_text(const gchar *title, gint page) +{ + struct terminal *term; + gchar *chopped_title; + + term = sakura_get_page_term(sakura, page); + + if ( (title!=NULL) && (g_strcmp0(title, "") !=0) ) { + /* Chop to max size. TODO: Should it be configurable by the user? */ + chopped_title = g_strndup(title, TAB_MAX_SIZE); + /* Honor the minimum tab label size */ + while (strlen(chopped_title)< TAB_MIN_SIZE) { + char *old_ptr = chopped_title; + chopped_title = g_strconcat(chopped_title, " ", NULL); + free(old_ptr); + } + gtk_label_set_text(GTK_LABEL(term->label), chopped_title); + free(chopped_title); + } else { /* Use the default values */ + gtk_label_set_text(GTK_LABEL(term->label), term->label_text); + } +} + + +/* Callback for vte_terminal_spawn_async */ +void +sakura_spawn_callback (VteTerminal *vte, GPid pid, GError *error, gpointer user_data) +{ + struct terminal *term = (struct terminal *) user_data; + //term = sakura_get_page_term(sakura, page); + if (pid==-1) { /* Fork has failed */ + SAY("Error: %s", error->message); + } else { + term->pid=pid; + } +} + + +static void +sakura_add_tab() +{ + struct terminal *term; + GtkWidget *tab_label_hbox; + GtkWidget *close_button; + int index; + int npages; + gchar *cwd = NULL; + gchar *label_text = _("Terminal %d"); + + term = g_new0( struct terminal, 1 ); + + /* Create label for tabs */ + term->label_set_byuser=false; + + /* appling tab title pattern from config (https://answers.launchpad.net/sakura/+question/267951) */ + if(sakura.tab_default_title != NULL) { + label_text = sakura.tab_default_title; + term->label_set_byuser = true; + } + + term->label_text=g_strdup_printf(label_text, sakura.label_count++); + term->label=gtk_label_new(term->label_text); + + tab_label_hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2); + gtk_widget_set_hexpand(tab_label_hbox, TRUE); + gtk_label_set_ellipsize (GTK_LABEL (term->label), PANGO_ELLIPSIZE_END); + gtk_box_pack_start(GTK_BOX(tab_label_hbox), term->label, TRUE, FALSE, 0); + + /* If the tab close button is enabled, create and add it to the tab */ + if (sakura.show_closebutton) { + close_button=gtk_button_new(); + /* Adding scroll-event to button, to propagate it to notebook (fix for scroll event when pointer is above the button) */ + gtk_widget_add_events(close_button, GDK_SCROLL_MASK); + + gtk_widget_set_name(close_button, "closebutton"); + gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE); + + GtkWidget *image=gtk_image_new_from_icon_name("window-close", GTK_ICON_SIZE_MENU); + gtk_container_add (GTK_CONTAINER (close_button), image); + gtk_box_pack_start(GTK_BOX(tab_label_hbox), close_button, FALSE, FALSE, 0); + } + + if (sakura.tabs_on_bottom) { + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(sakura.notebook), GTK_POS_BOTTOM); + } + + /* Set tab title style */ + gchar *css = g_strdup_printf(TAB_TITLE_CSS); + gtk_css_provider_load_from_data(sakura.provider, css, -1, NULL); + GtkStyleContext *context = gtk_widget_get_style_context(tab_label_hbox); + gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(sakura.provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_free(css); + + gtk_widget_show_all(tab_label_hbox); + + /* Create new vte terminal, scrollbar, and pack it */ + term->vte=vte_terminal_new(); + term->scrollbar=gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(term->vte))); + term->hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_box_pack_start(GTK_BOX(term->hbox), term->vte, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(term->hbox), term->scrollbar, FALSE, FALSE, 0); + + term->colorset=sakura.last_colorset-1; + + /* Select the directory to use for the new tab */ + index = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + if(index >= 0) { + struct terminal *prev_term; + prev_term = sakura_get_page_term( sakura, index ); + cwd = sakura_get_term_cwd( prev_term ); + + term->colorset = prev_term->colorset; + } + if (!cwd) + cwd = g_get_current_dir(); + + /* Keep values when adding tabs */ + sakura.keep_fc=true; + + if ((index=gtk_notebook_append_page(GTK_NOTEBOOK(sakura.notebook), term->hbox, tab_label_hbox))==-1) { + sakura_error("Cannot create a new tab"); + exit(1); + } + + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(sakura.notebook), term->hbox, TRUE); + // TODO: Set group id to support detached tabs + // gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(sakura.notebook), term->hbox, TRUE); + + sakura_set_page_term(sakura, index, term ); + + /* vte signals */ + g_signal_connect(G_OBJECT(term->vte), "bell", G_CALLBACK(sakura_beep), NULL); + g_signal_connect(G_OBJECT(term->vte), "increase-font-size", G_CALLBACK(sakura_increase_font), NULL); + g_signal_connect(G_OBJECT(term->vte), "decrease-font-size", G_CALLBACK(sakura_decrease_font), NULL); + g_signal_connect(G_OBJECT(term->vte), "child-exited", G_CALLBACK(sakura_child_exited), NULL); + g_signal_connect(G_OBJECT(term->vte), "eof", G_CALLBACK(sakura_eof), NULL); + g_signal_connect(G_OBJECT(term->vte), "window-title-changed", G_CALLBACK(sakura_title_changed), NULL); + g_signal_connect_swapped(G_OBJECT(term->vte), "button-press-event", G_CALLBACK(sakura_button_press), sakura.menu); + + /* Notebook signals */ + g_signal_connect(G_OBJECT(sakura.notebook), "page-removed", G_CALLBACK(sakura_page_removed), NULL); + if (sakura.show_closebutton) { + g_signal_connect(G_OBJECT(close_button), "clicked", G_CALLBACK(sakura_closebutton_clicked), term->hbox); + } + + /* Since vte-2.91 env is properly overwritten */ + char *command_env[2]={"TERM=xterm-256color",0}; + /* First tab */ + npages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + if (npages == 1) { + if (sakura.first_tab) { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), TRUE); + } else { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), FALSE); + } + + gtk_notebook_set_show_border(GTK_NOTEBOOK(sakura.notebook), FALSE); + sakura_set_font(); + sakura_set_colors(); + /* Set size before showing the widgets but after setting the font */ + sakura_set_size(); + + gtk_widget_show_all(sakura.notebook); + if (!sakura.show_scrollbar) { + gtk_widget_hide(term->scrollbar); + } + + gtk_widget_show(sakura.main_window); + +#ifdef GDK_WINDOWING_X11 + /* Set WINDOWID env variable */ + GdkDisplay *display = gdk_display_get_default(); + + if (GDK_IS_X11_DISPLAY (display)) { + GdkWindow *gwin = gtk_widget_get_window (sakura.main_window); + if (gwin != NULL) { + guint winid = gdk_x11_window_get_xid (gwin); + gchar *winidstr = g_strdup_printf ("%d", winid); + g_setenv ("WINDOWID", winidstr, FALSE); + g_free (winidstr); + } + } +#endif + + int command_argc=0; char **command_argv; + if (option_execute||option_xterm_execute) { + GError *gerror = NULL; + gchar *path; + + if(option_execute) { + /* -x option */ + if (!g_shell_parse_argv(option_execute, &command_argc, &command_argv, &gerror)) { + switch (gerror->code) { + case G_SHELL_ERROR_EMPTY_STRING: + sakura_error("Empty exec string"); + exit(1); + break; + case G_SHELL_ERROR_BAD_QUOTING: + sakura_error("Cannot parse command line arguments: mangled quoting"); + exit(1); + break; + case G_SHELL_ERROR_FAILED: + sakura_error("Error in exec option command line arguments"); + exit(1); + } + g_error_free(gerror); + } + } else { + /* -e option - last in the command line, takes all extra arguments */ + if (option_xterm_args) { + gchar *command_joined; + command_joined = g_strjoinv(" ", option_xterm_args); + if (!g_shell_parse_argv(command_joined, &command_argc, &command_argv, &gerror)) { + switch (gerror->code) { + case G_SHELL_ERROR_EMPTY_STRING: + sakura_error("Empty exec string"); + exit(1); + break; + case G_SHELL_ERROR_BAD_QUOTING: + sakura_error("Cannot parse command line arguments: mangled quoting"); + exit(1); + case G_SHELL_ERROR_FAILED: + sakura_error("Error in exec option command line arguments"); + exit(1); + } + } + if (gerror!=NULL) g_error_free(gerror); + g_free(command_joined); + } + } + + /* Check if the command is valid */ + if (command_argc > 0) { + path=g_find_program_in_path(command_argv[0]); + if (path) { + vte_terminal_spawn_async(VTE_TERMINAL(term->vte), VTE_PTY_NO_HELPER, NULL, command_argv, command_env, + G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, -1, NULL, sakura_spawn_callback, term); + } else { + sakura_error("%s command not found", command_argv[0]); + command_argc=0; + //exit(1); + } + free(path); + g_strfreev(command_argv); g_strfreev(option_xterm_args); + } + } // else { /* No execute option */ + + /* Only fork if there is no execute option or if it has failed */ + if ( (!option_execute && !option_xterm_args) || (command_argc==0)) { + if (option_hold==TRUE) { + sakura_error("Hold option given without any command"); + option_hold=FALSE; + } + vte_terminal_spawn_async(VTE_TERMINAL(term->vte), VTE_PTY_NO_HELPER, cwd, sakura.argv, command_env, + G_SPAWN_SEARCH_PATH|G_SPAWN_FILE_AND_ARGV_ZERO, NULL, NULL, NULL, -1, NULL, sakura_spawn_callback, term); + } + /* Not the first tab */ + } else { + sakura_set_font(); + sakura_set_colors(); + gtk_widget_show_all(term->hbox); + if (!sakura.show_scrollbar) { + gtk_widget_hide(term->scrollbar); + } + + if (npages==2) { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), TRUE); + sakura_set_size(); + } + /* Call set_current page after showing the widget: gtk ignores this + * function in the window is not visible *sigh*. Gtk documentation + * says this is for "historical" reasons. Me arse */ + gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), index); + vte_terminal_spawn_async(VTE_TERMINAL(term->vte), VTE_PTY_NO_HELPER, cwd, sakura.argv, command_env, + G_SPAWN_SEARCH_PATH|G_SPAWN_FILE_AND_ARGV_ZERO, NULL, NULL, NULL, -1, NULL, sakura_spawn_callback, term); + } + + free(cwd); + + /* Init vte terminal */ + vte_terminal_set_scrollback_lines(VTE_TERMINAL(term->vte), sakura.scroll_lines); + vte_terminal_match_add_regex(VTE_TERMINAL(term->vte), sakura.http_vteregexp, PCRE2_CASELESS); + vte_terminal_match_add_regex(VTE_TERMINAL(term->vte), sakura.mail_vteregexp, PCRE2_CASELESS); + vte_terminal_set_mouse_autohide(VTE_TERMINAL(term->vte), TRUE); + vte_terminal_set_backspace_binding(VTE_TERMINAL(term->vte), VTE_ERASE_ASCII_DELETE); + vte_terminal_set_word_char_exceptions(VTE_TERMINAL(term->vte), sakura.word_chars); + vte_terminal_set_audible_bell (VTE_TERMINAL(term->vte), sakura.audible_bell ? TRUE : FALSE); + vte_terminal_set_cursor_blink_mode (VTE_TERMINAL(term->vte), sakura.blinking_cursor ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF); + vte_terminal_set_allow_bold (VTE_TERMINAL(term->vte), sakura.allow_bold ? TRUE : FALSE); + vte_terminal_set_cursor_shape (VTE_TERMINAL(term->vte), sakura.cursor_type); + + //sakura_set_colors(); + + /* FIXME: Possible race here. Find some way to force to process all configure + * events before setting keep_fc again to false */ + sakura.keep_fc=false; +} + + +/* Delete the notebook tab passed as a parameter */ +static void +sakura_del_tab(gint page) +{ + struct terminal *term; + gint npages; + + term = sakura_get_page_term(sakura, page); + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + + /* When there's only one tab use the shell title, if provided */ + if (npages==2) { + const char *title; + + term = sakura_get_page_term(sakura, 0); + title = vte_terminal_get_window_title(VTE_TERMINAL(term->vte)); + if (title!=NULL) + gtk_window_set_title(GTK_WINDOW(sakura.main_window), title); + } + + term = sakura_get_page_term(sakura, page); + + /* Do the first tab checks BEFORE deleting the tab, to ensure correct + * sizes are calculated when the tab is deleted */ + if ( npages == 2) { + if (sakura.first_tab) { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), TRUE); + } else { + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), FALSE); + } + sakura.keep_fc=true; + } + + gtk_widget_hide(term->hbox); + gtk_notebook_remove_page(GTK_NOTEBOOK(sakura.notebook), page); + + /* Find the next page, if it exists, and grab focus */ + if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)) > 0) { + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + term = sakura_get_page_term(sakura, page); + gtk_widget_grab_focus(term->vte); + } +} + + +static void +sakura_set_keybind(const gchar *key, guint value) +{ + char *valname; + + valname=gdk_keyval_name(value); + g_key_file_set_string(sakura.cfg, cfg_group, key, valname); + sakura.config_modified=TRUE; + //FIXME: free() valname? +} + + +static guint +sakura_get_keybind(const gchar *key) +{ + gchar *value; + guint retval=GDK_KEY_VoidSymbol; + + value=g_key_file_get_string(sakura.cfg, cfg_group, key, NULL); + if (value!=NULL){ + retval=gdk_keyval_from_name(value); + g_free(value); + } + + /* For backwards compatibility with integer values */ + /* If gdk_keyval_from_name fail, it seems to be integer value*/ + if ((retval==GDK_KEY_VoidSymbol)||(retval==0)) { + retval=g_key_file_get_integer(sakura.cfg, cfg_group, key, NULL); + } + + /* Always use uppercase value as keyval */ + return gdk_keyval_to_upper(retval); +} + + +static void +sakura_error(const char *format, ...) +{ + GtkWidget *dialog; + va_list args; + char* buff; + + va_start(args, format); + buff = malloc(sizeof(char)*ERROR_BUFFER_LENGTH); + vsnprintf(buff, sizeof(char)*ERROR_BUFFER_LENGTH, format, args); + va_end(args); + + dialog = gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", buff); + gtk_window_set_title(GTK_WINDOW(dialog), _("Error message")); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + free(buff); +} + + +/* This function is used to fix bug #1393939 */ +static void +sakura_sanitize_working_directory() +{ + const gchar *home_directory = g_getenv("HOME"); + if (home_directory == NULL) { + home_directory = g_get_home_dir(); + } + + if (home_directory != NULL) { + if (chdir(home_directory)) { + fprintf(stderr, _("Cannot change working directory\n")); + exit(1); + } + } +} + + +int +main(int argc, char **argv) +{ + gchar *localedir; + int i; int n; + char **nargv; int nargc; + gboolean have_e; + + /* Localization */ + setlocale(LC_ALL, ""); + localedir=g_strdup_printf("%s/locale", DATADIR); + textdomain(GETTEXT_PACKAGE); + bindtextdomain(GETTEXT_PACKAGE, localedir); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + g_free(localedir); + + /* Rewrites argv to include a -- after the -e argument this is required to make + * sure GOption doesn't grab any arguments meant for the command being called */ + + /* Initialize nargv */ + nargv = (char**)calloc((argc+1), sizeof(char*)); + n=0; nargc=argc; + have_e=FALSE; + + for(i=0; imessage); + g_error_free(error); + exit(1); + } + + g_option_context_free(context); + + if (option_workdir && chdir(option_workdir)) { + fprintf(stderr, _("Cannot change working directory\n")); + exit(1); + } + + if (option_version) { + fprintf(stderr, _("sakura version is %s\n"), VERSION); + exit(1); + } + + if (option_ntabs <= 0) { + option_ntabs=1; + } + + /* Init stuff */ + gtk_init(&nargc, &nargv); g_strfreev(nargv); + sakura_init(); + + /* Add initial tabs (1 by default) */ + for (i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Terminal + 2005-10-15 + + + Andreas Nilsson + + + + + terminal + emulator + term + command line + + + + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1