diff -Nru sakura-3.7.1/AUTHORS sakura-3.8.4/AUTHORS --- sakura-3.7.1/AUTHORS 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/AUTHORS 2021-10-15 00:55:05.000000000 +0000 @@ -1,7 +1,7 @@ Main author ============ - David Gómez Espinosa + David Gómez Espinosa Contributors ============ @@ -40,9 +40,9 @@ Enric Morales Thorsten Mühlfelder Rafał Mużyło - Dmitry N. Shilov + Dmitry N. Shilov Erik Nelson - Raúl Núñez de Arenas + Raúl Núñez de Arenas Coronado Dražen Odobašić Marc-Antoine Perennou Kalle Raiskila diff -Nru sakura-3.7.1/CMakeLists.txt sakura-3.8.4/CMakeLists.txt --- sakura-3.7.1/CMakeLists.txt 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/CMakeLists.txt 2021-10-15 00:55:05.000000000 +0000 @@ -2,7 +2,7 @@ CMAKE_POLICY(SET CMP0005 NEW) PROJECT (sakura) SET (AUTHOR "David Gómez Espinosa" INTERNAL "Author") -SET (VERSION "3.7.1") +SET (VERSION "3.8.3") INCLUDE (FindPkgConfig) @@ -31,8 +31,8 @@ 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}) +FIND_PROGRAM(POD2MAN pod2man) +MESSAGE ("pod2man executable is" ${POD2MAN}) ADD_DEFINITIONS (-DVERSION="${VERSION}") ADD_DEFINITIONS (-DDATADIR="${CMAKE_INSTALL_PREFIX}/share") @@ -51,13 +51,13 @@ ADD_SUBDIRECTORY (po) -INSTALL (TARGETS sakura RUNTIME DESTINATION bin) +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) +IF (POD2MAN) + INSTALL (FILES ${sakura_BINARY_DIR}/sakura.1 DESTINATION share/man/man1) ENDIF (POD2MAN) -INSTALL (FILES INSTALL DESTINATION share/doc/sakura) +INSTALL (FILES README.md DESTINATION share/doc/sakura) FILE (GLOB MO_FILES po/*.mo) @@ -67,10 +67,10 @@ 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 -f po/*.mo po/sakura.pot po/Makefile po/cmake_install.cmake COMMAND rm -rf CMakeFiles po/CMakeFiles) -IF (POD2MAN) +IF (POD2MAN) ADD_CUSTOM_TARGET(man ALL COMMAND ${POD2MAN} -u --section=1 --release=${VERSION} --center '' ${sakura_SOURCE_DIR}/sakura.pod sakura.1) -ENDIF (POD2MAN) +ENDIF (POD2MAN) diff -Nru sakura-3.7.1/debian/changelog sakura-3.8.4/debian/changelog --- sakura-3.7.1/debian/changelog 2020-05-17 21:53:28.000000000 +0000 +++ sakura-3.8.4/debian/changelog 2021-10-19 13:54:05.000000000 +0000 @@ -1,3 +1,29 @@ +sakura (3.8.4-1) unstable; urgency=medium + + * New upstream version 3.8.4 + * Update Standards Version to 4.6.0.1 (No changes required) + * Update Copyright source location + * Update copyright years + + -- Andreas Rönnquist Tue, 19 Oct 2021 15:54:05 +0200 + +sakura (3.8.3-1) unstable; urgency=medium + + * New upstream version 3.8.3 + - Fixes typo in manual page (Ctrl + [1-9] for switching tabs) + (Closes: #987357) + - Fix Solarized dark palette no longer different from Solarized light + (Closes: #940233) + * Remove patch + 0002-Fix-manpage-shortcut-for-next-prev-tab-from-Alt-to-C.patch, + applied upstream + * Make sure dh_clean removes src/sakura + * Update Standards Version to 4.5.1 (No changes required) + * Update watch file to version 4 + * Add field Rules-Requires-Root: no + + -- Andreas Rönnquist Mon, 16 Aug 2021 22:58:55 +0200 + sakura (3.7.1-2) unstable; urgency=medium * Add patch to fix manpage shortcut for next/prev tab from Alt diff -Nru sakura-3.7.1/debian/control sakura-3.8.4/debian/control --- sakura-3.7.1/debian/control 2020-05-10 10:44:35.000000000 +0000 +++ sakura-3.8.4/debian/control 2021-10-19 13:54:05.000000000 +0000 @@ -9,7 +9,8 @@ libpcre2-dev, libvte-2.91-dev, perl -Standards-Version: 4.5.0 +Standards-Version: 4.6.0.1 +Rules-Requires-Root: no Vcs-Git: https://salsa.debian.org/debian/sakura.git Vcs-Browser: https://salsa.debian.org/debian/sakura Homepage: http://www.pleyades.net/david/projects/sakura diff -Nru sakura-3.7.1/debian/copyright sakura-3.8.4/debian/copyright --- sakura-3.7.1/debian/copyright 2020-05-10 11:09:40.000000000 +0000 +++ sakura-3.8.4/debian/copyright 2021-10-19 13:54:05.000000000 +0000 @@ -1,15 +1,15 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Sakura Upstream-Contact: David Gómez -Source: http://www.pleyades.net/david/sakura.php +Source: https://www.pleyades.net/david/projects/sakura Files: * -Copyright: 2006-2012, David Gómez +Copyright: 2006-2021, David Gómez 2008, Hong Jen Yee (PCMan) License: GPL-2 Files: debian/* -Copyright: 2008-2011, Andrew Starr-Bochicchio +Copyright: 2008-2021, Andrew Starr-Bochicchio 2015-2017, Andreas Rönnquist License: GPL-2 diff -Nru sakura-3.7.1/debian/patches/0002-Fix-manpage-shortcut-for-next-prev-tab-from-Alt-to-C.patch sakura-3.8.4/debian/patches/0002-Fix-manpage-shortcut-for-next-prev-tab-from-Alt-to-C.patch --- sakura-3.7.1/debian/patches/0002-Fix-manpage-shortcut-for-next-prev-tab-from-Alt-to-C.patch 2020-05-17 21:52:36.000000000 +0000 +++ sakura-3.8.4/debian/patches/0002-Fix-manpage-shortcut-for-next-prev-tab-from-Alt-to-C.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -From: =?utf-8?q?Andreas_R=C3=B6nnquist?= -Date: Sun, 17 May 2020 23:52:17 +0200 -Subject: Fix manpage shortcut for next/prev tab from Alt to Ctrl (Closes: - #933734) - ---- - sakura.pod | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/sakura.pod b/sakura.pod -index 7baf602..a0de3c0 100644 ---- a/sakura.pod -+++ b/sakura.pod -@@ -162,8 +162,8 @@ Before sakura used keycodes instead of strings. They're still valid. - 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 -+ Ctrl + Left cursor -> Previous tab -+ Ctrl + 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 diff -Nru sakura-3.7.1/debian/patches/series sakura-3.8.4/debian/patches/series --- sakura-3.7.1/debian/patches/series 2020-05-17 21:52:36.000000000 +0000 +++ sakura-3.8.4/debian/patches/series 2021-10-19 13:54:05.000000000 +0000 @@ -1,2 +1 @@ 0001-Add-Keywords-field-to-desktop-file.patch -0002-Fix-manpage-shortcut-for-next-prev-tab-from-Alt-to-C.patch diff -Nru sakura-3.7.1/debian/rules sakura-3.8.4/debian/rules --- sakura-3.7.1/debian/rules 2019-01-23 20:02:13.000000000 +0000 +++ sakura-3.8.4/debian/rules 2021-10-19 13:54:05.000000000 +0000 @@ -16,3 +16,7 @@ override_dh_install: dh_install rm -f debian/sakura/usr/share/doc/sakura/INSTALL + +override_dh_clean: + rm -f src/sakura + dh_clean diff -Nru sakura-3.7.1/debian/watch sakura-3.8.4/debian/watch --- sakura-3.7.1/debian/watch 2019-01-23 20:02:13.000000000 +0000 +++ sakura-3.8.4/debian/watch 2021-10-19 13:54:05.000000000 +0000 @@ -1,3 +1,3 @@ -version=3 +version=4 https://launchpad.net/sakura/ \ .*/\+download/sakura(?:-|\.|_|_v)(\d\S*)[\._](?:tar\.xz|tar\.bz2|tar\.gz) diff -Nru sakura-3.7.1/.gitignore sakura-3.8.4/.gitignore --- sakura-3.7.1/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ sakura-3.8.4/.gitignore 2021-10-15 00:55:05.000000000 +0000 @@ -0,0 +1,11 @@ +cmake_install.cmake +CMakeFiles +CMakeCache.txt +Makefile +build/ +*.gmo +*.mo +po/sakura.pot +install_manifest.txt +src/sakura +sakura.1 diff -Nru sakura-3.7.1/GPL sakura-3.8.4/GPL --- sakura-3.7.1/GPL 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/GPL 1970-01-01 00:00:00.000000000 +0000 @@ -1,345 +0,0 @@ -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 -Nru sakura-3.7.1/INSTALL sakura-3.8.4/INSTALL --- sakura-3.7.1/INSTALL 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/INSTALL 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -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 please use your favourite editor to change the following properties: - - Accelerators: - - Accelerators can be set to any mask value from GdkModifierType. For reference look at: - http://gtk.php.net/manual/en/html/gdk/gdk.enum.modifiertype.html - - 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 -Nru sakura-3.7.1/LICENSE sakura-3.8.4/LICENSE --- sakura-3.7.1/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ sakura-3.8.4/LICENSE 2021-10-15 00:55:05.000000000 +0000 @@ -0,0 +1,339 @@ + 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 Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 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) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru sakura-3.7.1/po/ca.po sakura-3.8.4/po/ca.po --- sakura-3.7.1/po/ca.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/ca.po 2021-10-15 00:55:05.000000000 +0000 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2019-09-30 05:43+0000\n" "Last-Translator: Adolfo Jayme \n" "Language-Team: Jordi Jané Cardo \n" @@ -25,9 +25,8 @@ msgid "Select initial number of tabs" msgstr "Sel·leccionar el número inicial de pestanyes" -#, fuzzy msgid "Set working directory" -msgstr "Definir el cursor" +msgstr "Definir el directori actual" msgid "Execute command" msgstr "Executa l'ordre" @@ -38,12 +37,8 @@ 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" +msgstr "Definir el nom de la icona" msgid "Set columns number" msgstr "Definir el nombre de columnes" @@ -61,20 +56,10 @@ msgstr "Pantalla complèta" msgid "Use alternate configuration file" -msgstr "" +msgstr "Utilitzeu un fitxer de configuració alternatiu" -#, fuzzy msgid "Select initial colorset" -msgstr "Sel·leccionar color" - -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?" +msgstr "Sel·leccionar grupo de colors inicial" msgid "" "There are running processes.\n" @@ -100,7 +85,6 @@ msgid "New text" msgstr "Nou text" -#, fuzzy msgid "Select colors" msgstr "Sel·leccionar color" @@ -108,7 +92,10 @@ msgstr "_Selecciona" msgid "Colorset" -msgstr "" +msgstr "Grup de colors" + +msgid "Color scheme" +msgstr "Esquema de colors" msgid "Foreground color" msgstr "Color de font" @@ -119,19 +106,23 @@ msgid "Cursor color" msgstr "Color del cursor" -#, fuzzy msgid "Opacity level (%)" msgstr "Nivell d'opacitat (%)" -msgid "Search" -msgstr "Cerca" +msgid "Palette" +msgstr "Paleta" + +msgid "Use bright colors for bold text" +msgstr "Utilitzeu colors brillants per al text en negreta" + +msgid "Set window title" +msgstr "Definir el nom de la finestra" msgid "New window title" msgstr "Definiu el nom de la finestra" -#, fuzzy msgid "Open mail" -msgstr "Obrir enllaç" +msgstr "Obrir correu" msgid "Open link" msgstr "Obrir enllaç" @@ -143,7 +134,7 @@ msgstr "Nova pestanya" msgid "Set tab name..." -msgstr "" +msgstr "Definir el nom de pestanya..." msgid "Close tab" msgstr "Tancar pestanya" @@ -157,21 +148,15 @@ msgid "Paste" msgstr "Enganxar" +msgid "Options" +msgstr "Opcions" + 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" @@ -187,9 +172,8 @@ msgid "Less questions at exit time" msgstr "" -#, fuzzy msgid "Set urgent bell" -msgstr "Definir la senyal acústica" +msgstr "Definir la senyal urgent" msgid "Set audible bell" msgstr "Definir la senyal acústica" @@ -197,17 +181,14 @@ msgid "Set blinking cursor" msgstr "Definir el cursor" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "" msgid "Enable focus fade" -msgstr "" +msgstr "Activar atenuació de focus" msgid "Set cursor type" -msgstr "" +msgstr "Definir el tipus de cursor" msgid "Block" msgstr "Bloc" @@ -218,27 +199,35 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Definir paleta de colors" +msgid "Search" +msgstr "Cerca" #, c-format msgid "Terminal %d" msgstr "Terminal %d" +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?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "" msgid "Error message" msgstr "Missatge d'error" -#, fuzzy, c-format +#, c-format msgid "Cannot change working directory\n" -msgstr "Definir el cursor" +msgstr "No es pot cambiar el directori actual\n" 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 -Nru sakura-3.7.1/po/CMakeLists.txt sakura-3.8.4/po/CMakeLists.txt --- sakura-3.7.1/po/CMakeLists.txt 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/CMakeLists.txt 2021-10-15 00:55:05.000000000 +0000 @@ -17,14 +17,14 @@ 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} + 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 + ADD_CUSTOM_COMMAND(TARGET translations COMMAND ${MSGMERGE} -q -U ${_poFile} --backup=none sakura.pot - COMMAND ${MSGFMT} --check -o ${_moFile} ${_poFile} + COMMAND ${MSGFMT} --check -o ${_moFile} ${_poFile} DEPENDS ${_poFile}) INSTALL(FILES ${CMAKE_BINARY_DIR}/po/${_moFile} DESTINATION share/locale/${_lang}/LC_MESSAGES/ @@ -32,5 +32,3 @@ ENDFOREACH(_poFile ${PO_FILES}) ENDIF(NOT MSGFMT) - - diff -Nru sakura-3.7.1/po/cs.po sakura-3.8.4/po/cs.po --- sakura-3.7.1/po/cs.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/cs.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura 2.3.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-05-03 16:14+0000\n" "Last-Translator: David Gómez \n" "Language-Team: Czech \n" @@ -39,9 +39,6 @@ msgid "Login shell" msgstr "Přihlašovací shell" -msgid "Set window title" -msgstr "Nastaví titulek okna" - msgid "Set window icon" msgstr "Nastavit ikonu okna" @@ -67,15 +64,6 @@ msgstr "Vybrat počáteční sadu barev" 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 "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -106,7 +94,10 @@ msgstr "_Vybrat" msgid "Colorset" -msgstr "" +msgstr "Barevné sada" + +msgid "Color scheme" +msgstr "Barevné schéma" msgid "Foreground color" msgstr "Barva popředí" @@ -117,12 +108,17 @@ msgid "Cursor color" msgstr "Barva kurzoru" -#, fuzzy msgid "Opacity level (%)" msgstr "Úroveň průhlednosti (%):" -msgid "Search" -msgstr "Hledat" +msgid "Palette" +msgstr "Paletu" + +msgid "Use bright colors for bold text" +msgstr "" + +msgid "Set window title" +msgstr "Nastaví titulek okna" msgid "New window title" msgstr "Název nového okna" @@ -154,21 +150,15 @@ msgid "Paste" msgstr "Vložit" +msgid "Options" +msgstr "Volby" + 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" @@ -184,19 +174,15 @@ msgid "Less questions at exit time" msgstr "" -#, fuzzy msgid "Set urgent bell" -msgstr "Nastavit akustické upozornění" +msgstr "Nastavit naléhavý zvon" msgid "Set audible bell" -msgstr "Nastavit akustické upozornění" +msgstr "Nastavit akustické zvon" msgid "Set blinking cursor" msgstr "Nastavit blikající kurzor" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "" @@ -215,13 +201,22 @@ msgid "IBeam" msgstr "Svislá čára" -msgid "Set palette" -msgstr "Nastavit paletu" +msgid "Search" +msgstr "Hledat" #, c-format msgid "Terminal %d" msgstr "Terminál %d" +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 "Configuration has been modified by another process. Overwrite?" msgstr "" @@ -238,6 +233,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "sakura verze %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Zapnout tučné písmo" diff -Nru sakura-3.7.1/po/de.po sakura-3.8.4/po/de.po --- sakura-3.7.1/po/de.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/de.po 2021-10-15 00:55:05.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Sakura 2.3.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2020-05-06 05:00+0000\n" "Last-Translator: Milo Ivir \n" "Language-Team: Deutsch \n" @@ -40,9 +40,6 @@ msgid "Login shell" msgstr "Login-Shell" -msgid "Set window title" -msgstr "Fenstertitel wählen" - msgid "Set window icon" msgstr "Fenstertitel-Symbol" @@ -68,15 +65,6 @@ msgstr "Farbengruppe auswä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" -"Soll er wirklich beendet werden?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -109,6 +97,9 @@ msgid "Colorset" msgstr "Farbengruppe" +msgid "Color scheme" +msgstr "Farbschema" + msgid "Foreground color" msgstr "Vordergrundfarbe" @@ -121,8 +112,14 @@ msgid "Opacity level (%)" msgstr "Opazitätsgrad (%)" -msgid "Search" -msgstr "Suchen" +msgid "Palette" +msgstr "Palette" + +msgid "Use bright colors for bold text" +msgstr "Verwenden Sie helle Farben für fetten Text" + +msgid "Set window title" +msgstr "Fenstertitel wählen" msgid "New window title" msgstr "Fenstertitel wählen" @@ -154,21 +151,15 @@ msgid "Paste" msgstr "Einfügen" +msgid "Options" +msgstr "Optionen" + msgid "Select font..." msgstr "Schrift auswählen …" msgid "Select colors..." msgstr "Farben auswä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" @@ -193,11 +184,6 @@ msgid "Set blinking cursor" msgstr "Blinkender Cursor" -msgid "Stop tab cycling at end tabs" -msgstr "" -"Den Übergang zum nächsten Reiter mithilfe des Tabulators beim letzten Reiter " -"stoppen" - msgid "Disable numbered tabswitch" msgstr "Den Umschalter für nummerierte Reiter deaktivieren" @@ -216,13 +202,22 @@ msgid "IBeam" msgstr "Senkrechter Strich" -msgid "Set palette" -msgstr "Palette setzen" +msgid "Search" +msgstr "Suchen" #, c-format msgid "Terminal %d" msgstr "Terminal %d" +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" +"Soll er wirklich beendet werden?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "" "Die Konfiguration wurde durch einen anderen Prozess geändert. Šberschreiben?" @@ -240,18 +235,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "Sakura-Version ist %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Fetten Schriftschnitt aktivieren" - -#~ msgid "X geometry specification" -#~ msgstr "X-Fenstergeometrie" - -#~ msgid "Configuration has been modified. Save?" -#~ msgstr "Die Konfiguration wurde geändert. Speichern?" - -#~ msgid "Don't show exit dialog" -#~ msgstr "Beenden-Dialog nicht anzeigen" - -#~ msgid "Use focus fading" -#~ msgstr "Fokusüberblendung verwenden" diff -Nru sakura-3.7.1/po/en_GB.po sakura-3.8.4/po/en_GB.po --- sakura-3.7.1/po/en_GB.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/en_GB.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2019-08-12 16:54+0000\n" "Last-Translator: David Gómez \n" "Language-Team: English (United Kingdom) \n" @@ -39,9 +39,6 @@ msgid "Login shell" msgstr "Login shell" -msgid "Set window title" -msgstr "Set window title" - msgid "Set window icon" msgstr "Set window icon" @@ -67,15 +64,6 @@ msgstr "Select initial colourset" 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?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -108,6 +96,9 @@ msgid "Colorset" msgstr "Colourset" +msgid "Color scheme" +msgstr "Colour scheme" + msgid "Foreground color" msgstr "Foreground colour" @@ -120,8 +111,14 @@ msgid "Opacity level (%)" msgstr "Opacity level (%)" -msgid "Search" -msgstr "Search" +msgid "Palette" +msgstr "Palette" + +msgid "Use bright colors for bold text" +msgstr "Use bright colours for bold text" + +msgid "Set window title" +msgstr "Set window title" msgid "New window title" msgstr "New window title" @@ -153,21 +150,15 @@ msgid "Paste" msgstr "Paste" +msgid "Options" +msgstr "Options" + 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" @@ -192,9 +183,6 @@ msgid "Set blinking cursor" msgstr "Set blinking cursor" -msgid "Stop tab cycling at end tabs" -msgstr "Stop tab cycling at end tabs" - msgid "Disable numbered tabswitch" msgstr "Disable numbered tabswitch" @@ -213,13 +201,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Set palette" +msgid "Search" +msgstr "Search" #, c-format msgid "Terminal %d" msgstr "Terminal %d" +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?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "Configuration has been modified by another process. Overwrite?" @@ -236,6 +233,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "sakura version is %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Enable bold font" diff -Nru sakura-3.7.1/po/es.po sakura-3.8.4/po/es.po --- sakura-3.7.1/po/es.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/es.po 2021-10-15 00:55:05.000000000 +0000 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2019-08-12 16:53+0000\n" "Last-Translator: David Gómez \n" "Language-Team: \n" @@ -37,9 +37,6 @@ 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" @@ -65,15 +62,6 @@ msgstr "Seleccionar grupo de colores inicial" 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 "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -106,6 +94,9 @@ msgid "Colorset" msgstr "Grupo de colores" +msgid "Color scheme" +msgstr "Esquema de colores" + msgid "Foreground color" msgstr "Color de primer plano" @@ -118,8 +109,14 @@ msgid "Opacity level (%)" msgstr "Nivel de opacidad (%)" -msgid "Search" -msgstr "Buscar" +msgid "Palette" +msgstr "Paleta" + +msgid "Use bright colors for bold text" +msgstr "Usar colores brillantes para texto en negrita" + +msgid "Set window title" +msgstr "Establecer nombre de ventana" msgid "New window title" msgstr "Título nuevo de la ventana" @@ -151,21 +148,15 @@ msgid "Paste" msgstr "Pegar" +msgid "Options" +msgstr "Opciones" + 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" @@ -190,14 +181,11 @@ msgid "Set blinking cursor" msgstr "Activar parpadeo del cursor" -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" msgid "Enable focus fade" -msgstr "Activar foco atenuado" +msgstr "Activar atenuación de foco" msgid "Set cursor type" msgstr "Establecer tipo de cursor" @@ -211,13 +199,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Establecer paleta" +msgid "Search" +msgstr "Buscar" #, c-format msgid "Terminal %d" msgstr "Terminal %d" +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 "Configuration has been modified by another process. Overwrite?" msgstr "La configuración ha sido modificada por otro proceso. ¿Sobreescribir?" @@ -235,6 +232,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "La versión de sakura es %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Activar fuente en negrita" diff -Nru sakura-3.7.1/po/fr.po sakura-3.8.4/po/fr.po --- sakura-3.7.1/po/fr.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/fr.po 2021-10-15 00:55:05.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: sakura 1.2.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: David Gómez \n" "Language-Team: \n" @@ -38,9 +38,6 @@ 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" @@ -66,15 +63,6 @@ msgstr "Sélectionner le jeu de couleurs initial" 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 ?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -107,6 +95,9 @@ msgid "Colorset" msgstr "Jeu de couleurs" +msgid "Color scheme" +msgstr "Schéma de couleur" + msgid "Foreground color" msgstr "Couleur d'avant plan" @@ -119,15 +110,20 @@ msgid "Opacity level (%)" msgstr "Niveau d'opacité (%)" -msgid "Search" -msgstr "" +msgid "Palette" +msgstr "Palette" + +msgid "Use bright colors for bold text" +msgstr "Utilisez des couleurs vives pour le text en gras" + +msgid "Set window title" +msgstr "Définir le titre de la fenêtre" msgid "New window title" msgstr "Définir le titre de la fenêtre" -#, fuzzy msgid "Open mail" -msgstr "Ouvrir le lien" +msgstr "Ouvrir le courrier" msgid "Open link" msgstr "Ouvrir le lien" @@ -153,21 +149,15 @@ msgid "Paste" msgstr "Coller" +msgid "Options" +msgstr "Options" + 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" @@ -181,7 +171,7 @@ msgstr "Afficher la barre de défilement" msgid "Less questions at exit time" -msgstr "" +msgstr "Moins de questions au moment de la sortie" msgid "Set urgent bell" msgstr "Définir un avertissement d'urgence" @@ -192,15 +182,11 @@ msgid "Set blinking cursor" msgstr "Définir un curseur clignotant" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" -msgstr "" +msgstr "Désactiver les nombres pour le changement d'onglet" -#, fuzzy msgid "Enable focus fade" -msgstr "Activer la police de caractères en gras" +msgstr "Activer le fondu de la mise au point" msgid "Set cursor type" msgstr "Définir le type de curseur" @@ -214,14 +200,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Sélectionner une palette de couleurs" +msgid "Search" +msgstr "Chercher" #, c-format msgid "Terminal %d" msgstr "Terminal %d" -#, fuzzy +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 ?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "La configuration a été modifié par un autre processus. L'écraser ?" @@ -238,6 +232,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "Sakura version %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Activer la police de caractères en gras" diff -Nru sakura-3.7.1/po/he.po sakura-3.8.4/po/he.po --- sakura-3.7.1/po/he.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/he.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura 3.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: David Gómez \n" "Language-Team: Rahut \n" @@ -50,10 +50,6 @@ 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" @@ -87,15 +83,6 @@ msgstr "בחר צבע" msgid "" -"There is a running process in this terminal.\n" -"\n" -"Do you really want to close it?" -msgstr "" -"קיים תהליך אשר כעת מורץ בתוך מסוף זה.\n" -"\n" -"האם אתה בטוח כי ברצונך לסגור אותו?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -130,6 +117,10 @@ msgid "Colorset" msgstr "חוג צבעים לעריכה" +#, fuzzy +msgid "Color scheme" +msgstr "חוג צבעים לעריכה" + msgid "Foreground color" msgstr "צבע קדמה" @@ -142,9 +133,16 @@ msgid "Opacity level (%)" msgstr "רמת העמימות (%)" -msgid "Search" +msgid "Palette" +msgstr "לוח צבעים" + +msgid "Use bright colors for bold text" msgstr "" +# CLI: Do not translate! +msgid "Set window title" +msgstr "Set window title" + msgid "New window title" msgstr "כותרת חלון חדשה" @@ -176,21 +174,15 @@ msgid "Paste" msgstr "הדבק" +msgid "Options" +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 "הצג תמיד סרגל כרטיסיות" @@ -216,9 +208,6 @@ msgid "Set blinking cursor" msgstr "קבע סמן מהבהב" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "" @@ -237,14 +226,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "קבע לוח צבעים" +msgid "Search" +msgstr "" #, c-format msgid "Terminal %d" msgstr "מסוף %d" -#, fuzzy +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"קיים תהליך אשר כעת מורץ בתוך מסוף זה.\n" +"\n" +"האם אתה בטוח כי ברצונך לסגור אותו?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "תצורה השתנתה על ידי תהליך אחר. להחליפו?" diff -Nru sakura-3.7.1/po/hr.po sakura-3.8.4/po/hr.po --- sakura-3.7.1/po/hr.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/hr.po 2021-10-15 00:55:05.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Sakura 2.3.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2020-05-06 05:00+0000\n" "Last-Translator: Milo Ivir \n" "Language-Team: \n" @@ -40,9 +40,6 @@ msgid "Login shell" msgstr "Ljuska prijave" -msgid "Set window title" -msgstr "Postavi naslov prozora" - msgid "Set window icon" msgstr "Postavi ikonu prozora" @@ -68,15 +65,6 @@ msgstr "Odaberi skup boja" msgid "" -"There is a running process in this terminal.\n" -"\n" -"Do you really want to close it?" -msgstr "" -"U ovom terminalu postoji jedan aktivan proces.\n" -"\n" -"Stvarno zatvoriti terminal?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -109,6 +97,9 @@ msgid "Colorset" msgstr "Skup boja" +msgid "Color scheme" +msgstr "Shema boja" + msgid "Foreground color" msgstr "Prednja boja" @@ -121,8 +112,14 @@ msgid "Opacity level (%)" msgstr "Razina neporozirnosti (%)" -msgid "Search" -msgstr "Traži" +msgid "Palette" +msgstr "Paleta" + +msgid "Use bright colors for bold text" +msgstr "" + +msgid "Set window title" +msgstr "Postavi naslov prozora" msgid "New window title" msgstr "Naslov novog prozora" @@ -154,21 +151,15 @@ msgid "Paste" msgstr "Paste" +msgid "Options" +msgstr "Mogućnosti" + msgid "Select font..." msgstr "Odaberi font …" msgid "Select colors..." msgstr "Odaberi 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 traku s karticama" @@ -193,9 +184,6 @@ msgid "Set blinking cursor" msgstr "Postavi treperenje pokazivača" -msgid "Stop tab cycling at end tabs" -msgstr "Zaustavi prelaženje na kartice pomoću tabulatora na zadnjoj kartici" - msgid "Disable numbered tabswitch" msgstr "Deaktiviraj prekidač numeriranih kartica" @@ -214,13 +202,22 @@ msgid "IBeam" msgstr "Okomita crta" -msgid "Set palette" -msgstr "Postavi paletu" +msgid "Search" +msgstr "Traži" #, c-format msgid "Terminal %d" msgstr "Terminal %d" +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"U ovom terminalu postoji jedan aktivan proces.\n" +"\n" +"Stvarno zatvoriti terminal?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "Jedan drugi proces je promijenio konfiguraciju. Prepisati?" @@ -238,6 +235,15 @@ msgid "sakura version is %s\n" msgstr "sakura verzija je %s\n" +#~ msgid "More" +#~ msgstr "Više" + +#~ msgid "Set window title..." +#~ msgstr "Postavi naslov prozora …" + +#~ msgid "Stop tab cycling at end tabs" +#~ msgstr "Zaustavi prelaženje na kartice pomoću tabulatora na zadnjoj kartici" + #~ msgid "Enable bold font" #~ msgstr "Dozvoli podebljani font" diff -Nru sakura-3.7.1/po/hu.po sakura-3.8.4/po/hu.po --- sakura-3.7.1/po/hu.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/hu.po 2021-10-15 00:55:05.000000000 +0000 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: David Gómez \n" "Language-Team: hu\n" @@ -37,9 +37,6 @@ 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" @@ -65,15 +62,6 @@ msgstr "Alapértelmezett színek beállítása" 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?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -106,6 +94,10 @@ msgid "Colorset" msgstr "Színek" +#, fuzzy +msgid "Color scheme" +msgstr "Színek" + msgid "Foreground color" msgstr "Előtér színe" @@ -118,9 +110,16 @@ msgid "Opacity level (%)" msgstr "Átlátszóság mértéke (%)" -msgid "Search" +#, fuzzy +msgid "Palette" +msgstr "Paletta beállítása" + +msgid "Use bright colors for bold text" msgstr "" +msgid "Set window title" +msgstr "Ablak címének beállítása" + msgid "New window title" msgstr "Új ablakcím" @@ -152,21 +151,15 @@ msgid "Paste" msgstr "Beillesztés" +msgid "Options" +msgstr "Beállítások" + 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" @@ -191,9 +184,6 @@ msgid "Set blinking cursor" msgstr "Villogó kurzor beállítása" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "Gyorsbillentyűs fülváltás tiltása" @@ -213,13 +203,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Paletta beállítása" +msgid "Search" +msgstr "" #, c-format msgid "Terminal %d" msgstr "Terminál %d" +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 "Configuration has been modified by another process. Overwrite?" msgstr "A konfigurációt egy másik folyamat módosította. Felülírja?" @@ -237,6 +236,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "sakura verzió: %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Vastag betű engedélyezése" diff -Nru sakura-3.7.1/po/it.po sakura-3.8.4/po/it.po --- sakura-3.7.1/po/it.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/it.po 2021-10-15 00:55:05.000000000 +0000 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: David Gómez \n" "Language-Team: sakura-it \n" @@ -28,9 +28,8 @@ msgid "Select initial number of tabs" msgstr "Seleziona il numero di schede iniziali" -#, fuzzy msgid "Set working directory" -msgstr "Imposta il cursore lampeggiante" +msgstr "Imposta la directory di lavoro" msgid "Execute command" msgstr "Esegui il comando" @@ -41,9 +40,6 @@ 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" @@ -69,15 +65,6 @@ msgstr "Seleziona insieme iniziale di colori" 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?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -110,6 +97,9 @@ msgid "Colorset" msgstr "Insieme di colori" +msgid "Color scheme" +msgstr "Schema di colori" + msgid "Foreground color" msgstr "Colore del testo" @@ -122,15 +112,20 @@ msgid "Opacity level (%)" msgstr "Livello di opacità (%)" -msgid "Search" -msgstr "" +msgid "Palette" +msgstr "Tavolozza" + +msgid "Use bright colors for bold text" +msgstr "Usa colori vivaci per il testo in grassetto" + +msgid "Set window title" +msgstr "Imposta il titolo della finestra" msgid "New window title" msgstr "Nuovo titolo della finestra" -#, fuzzy msgid "Open mail" -msgstr "Apri collegamento" +msgstr "Apri posta" msgid "Open link" msgstr "Apri collegamento" @@ -156,21 +151,15 @@ msgid "Paste" msgstr "Incolla" +msgid "Options" +msgstr "Opzioni" + 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" @@ -184,11 +173,10 @@ msgstr "Visualizza la barra di scorrimento" msgid "Less questions at exit time" -msgstr "" +msgstr "Meno domande al momento dell'uscita" -#, fuzzy msgid "Set urgent bell" -msgstr "Imposta l'avviso acustico" +msgstr "Imposta l'avviso urgente" msgid "Set audible bell" msgstr "Imposta l'avviso acustico" @@ -196,14 +184,11 @@ msgid "Set blinking cursor" msgstr "Imposta il cursore lampeggiante" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" -msgstr "" +msgstr "Disabilitare i numeri per cambiare scheda" msgid "Enable focus fade" -msgstr "" +msgstr "Abilitare il dimmer della messa a fuoco" msgid "Set cursor type" msgstr "Imposta il modello di cursore" @@ -217,14 +202,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Imposta la tavolozza dei colori" +msgid "Search" +msgstr "Ricerca" #, c-format msgid "Terminal %d" msgstr "Terminale %d" -#, fuzzy +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?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "" "La configurazione è stata modificata da un altro processo. Sovrascrivere?" @@ -232,13 +225,13 @@ msgid "Error message" msgstr "Messaggio d'errore" -#, fuzzy, c-format +#, c-format msgid "Cannot change working directory\n" -msgstr "Imposta il cursore lampeggiante" +msgstr "Non è possibile modificare la directory di lavoro\n" 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" +msgstr "La versione di sakura è %s\n" diff -Nru sakura-3.7.1/po/ja.po sakura-3.8.4/po/ja.po --- sakura-3.7.1/po/ja.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/ja.po 2021-10-15 00:55:05.000000000 +0000 @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: ja\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2019-08-12 16:55+0000\n" "Last-Translator: David Gómez \n" "Language-Team: Japanese \n" @@ -36,9 +36,6 @@ msgid "Login shell" msgstr "ログインシェル" -msgid "Set window title" -msgstr "ウィンドウタイトルを設定" - msgid "Set window icon" msgstr "ウィンドウアイコンを設定" @@ -64,15 +61,6 @@ msgstr "初カラーセットを選択" msgid "" -"There is a running process in this terminal.\n" -"\n" -"Do you really want to close it?" -msgstr "" -"この端末には実行中のプロセスがあります。\n" -"\n" -"本当に閉じますか?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -105,6 +93,9 @@ msgid "Colorset" msgstr "カラーセット" +msgid "Color scheme" +msgstr "カラースキーム" + msgid "Foreground color" msgstr "前景色" @@ -117,8 +108,14 @@ msgid "Opacity level (%)" msgstr "不透過率 (%)" -msgid "Search" -msgstr "探索" +msgid "Palette" +msgstr "パレット" + +msgid "Use bright colors for bold text" +msgstr "太字のテキストには明るい色を使用する" + +msgid "Set window title" +msgstr "ウィンドウタイトルを設定" msgid "New window title" msgstr "新しいウィンドウタイトル" @@ -150,21 +147,15 @@ msgid "Paste" msgstr "貼り付け" +msgid "Options" +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 "タブバーを常に表示" @@ -189,9 +180,6 @@ msgid "Set blinking cursor" msgstr "カーソルの点滅を有効にする" -msgid "Stop tab cycling at end tabs" -msgstr "最後のタブでタブサイクリングを停止" - msgid "Disable numbered tabswitch" msgstr "番号のタブ切り替えを無効にする" @@ -210,13 +198,22 @@ msgid "IBeam" msgstr "Iビーム" -msgid "Set palette" -msgstr "パレットを設定" +msgid "Search" +msgstr "探索" #, c-format msgid "Terminal %d" msgstr "ターミナル %d" +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"この端末には実行中のプロセスがあります。\n" +"\n" +"本当に閉じますか?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "別のプロセスに設定が変更された。上書き?" @@ -233,6 +230,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "sakura のバージョンは %s です\n" - -#~ msgid "Enable bold font" -#~ msgstr "太字フォントを有効にする" diff -Nru sakura-3.7.1/po/ko.po sakura-3.8.4/po/ko.po --- sakura-3.7.1/po/ko.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/ko.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2019-09-30 05:48+0000\n" "Last-Translator: Minho Park \n" "Language-Team: Korean \n" @@ -39,9 +39,6 @@ msgid "Login shell" msgstr "로그인 쉘" -msgid "Set window title" -msgstr "창 제목 설정" - msgid "Set window icon" msgstr "창 아이콘 설정" @@ -67,15 +64,6 @@ msgstr "초기 색상 세트 선댁" msgid "" -"There is a running process in this terminal.\n" -"\n" -"Do you really want to close it?" -msgstr "" -"이 터미널에 실행되는 프로세스가 있습니다.\n" -"\n" -"정말로 닫을까요?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -108,6 +96,9 @@ msgid "Colorset" msgstr "색상 세트" +msgid "Color scheme" +msgstr "색 구성표" + msgid "Foreground color" msgstr "글자색" @@ -120,8 +111,14 @@ msgid "Opacity level (%)" msgstr "불투명도 (%)" -msgid "Search" -msgstr "검색" +msgid "Palette" +msgstr "파레트" + +msgid "Use bright colors for bold text" +msgstr "굵은 텍스트에 밝은 색상 사용" + +msgid "Set window title" +msgstr "창 제목 설정" msgid "New window title" msgstr "새 창 제목" @@ -153,21 +150,15 @@ msgid "Paste" msgstr "붙여넣기" +msgid "Options" +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 "탭바 항상 보기" @@ -192,9 +183,6 @@ msgid "Set blinking cursor" msgstr "커서 깜빡임 설정" -msgid "Stop tab cycling at end tabs" -msgstr "끝 탭에 탭 순환 중지" - msgid "Disable numbered tabswitch" msgstr "번호 탭 스위치 사용 안 함" @@ -213,13 +201,22 @@ msgid "IBeam" msgstr "I기둥" -msgid "Set palette" -msgstr "파레트 설정" +msgid "Search" +msgstr "검색" #, c-format msgid "Terminal %d" msgstr "터미널 %d" +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"이 터미널에 실행되는 프로세스가 있습니다.\n" +"\n" +"정말로 닫을까요?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "다른 프로세스에서 설정을 수정했습니다. 덮어쓸까요?" @@ -236,6 +233,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "sakura 버전은 %s 입니다\n" - -#~ msgid "Enable bold font" -#~ msgstr "굵은 글꼴 사용" diff -Nru sakura-3.7.1/po/pl.po sakura-3.8.4/po/pl.po --- sakura-3.7.1/po/pl.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/pl.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: David Gómez \n" "Language-Team: Polish \n" @@ -39,9 +39,6 @@ msgid "Login shell" msgstr "Powłoka logowania" -msgid "Set window title" -msgstr "Ustaw tytuł okna" - msgid "Set window icon" msgstr "Ustaw ikonę okna" @@ -67,15 +64,6 @@ msgstr "Wybierz domyślny schemat kolorów" 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ąć?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -108,6 +96,10 @@ msgid "Colorset" msgstr "Schemat kolorów" +#, fuzzy +msgid "Color scheme" +msgstr "Schemat kolorów" + msgid "Foreground color" msgstr "Kolor pierwszoplanowy" @@ -120,9 +112,16 @@ msgid "Opacity level (%)" msgstr "Nieprzezroczystość" -msgid "Search" +#, fuzzy +msgid "Palette" +msgstr "Ustaw paletę" + +msgid "Use bright colors for bold text" msgstr "" +msgid "Set window title" +msgstr "Ustaw tytuł okna" + msgid "New window title" msgstr "Nowy tytuł okna" @@ -154,21 +153,15 @@ msgid "Paste" msgstr "Wklej" +msgid "Options" +msgstr "Ustawienia" + 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" @@ -194,9 +187,6 @@ msgid "Set blinking cursor" msgstr "Migający kursor" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "" @@ -215,13 +205,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Ustaw paletę" +msgid "Search" +msgstr "" #, c-format msgid "Terminal %d" msgstr "Terminal %d" +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ąć?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "" @@ -238,6 +237,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "wersja sakura to %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Włącz pogrubienie czcionki" diff -Nru sakura-3.7.1/po/pt_BR.po sakura-3.8.4/po/pt_BR.po --- sakura-3.7.1/po/pt_BR.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/pt_BR.po 2021-10-15 00:55:05.000000000 +0000 @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+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" @@ -35,9 +35,6 @@ 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" @@ -65,15 +62,6 @@ msgstr "Selecionar cor" 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?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -97,7 +85,6 @@ msgid "New text" msgstr "Novo texto" -#, fuzzy msgid "Select colors" msgstr "Selecionar cor" @@ -107,6 +94,9 @@ msgid "Colorset" msgstr "" +msgid "Color scheme" +msgstr "" + msgid "Foreground color" msgstr "Cor de primeiro plano" @@ -116,13 +106,18 @@ msgid "Cursor color" msgstr "Cor do cursor" -#, fuzzy msgid "Opacity level (%)" msgstr "Nível de opacidade (%):" -msgid "Search" +msgid "Palette" +msgstr "Paleta" + +msgid "Use bright colors for bold text" msgstr "" +msgid "Set window title" +msgstr "Definir título da janela" + msgid "New window title" msgstr "Definir título da janela" @@ -130,11 +125,9 @@ msgid "Open mail" msgstr "Abrir link..." -#, fuzzy msgid "Open link" msgstr "Abrir link..." -#, fuzzy msgid "Copy link" msgstr "Copiar link..." @@ -156,21 +149,15 @@ msgid "Paste" msgstr "Colar" +msgid "Options" +msgstr "Opções" + 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" @@ -196,9 +183,6 @@ msgid "Set blinking cursor" msgstr "Ativar cursor piscando" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "" @@ -217,14 +201,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Definir paleta" +msgid "Search" +msgstr "" #, c-format msgid "Terminal %d" msgstr "Terminal %d" -#, fuzzy +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?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "A configuração foi modificada por outro processo. Sobrescrever?" diff -Nru sakura-3.7.1/po/pt.po sakura-3.8.4/po/pt.po --- sakura-3.7.1/po/pt.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/pt.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: David Gómez \n" "Language-Team: Portuguese \n" @@ -22,10 +22,10 @@ msgstr "Mostrar número da versão" msgid "Select initial terminal font" -msgstr "Escolha o tipo de letra do terminal" +msgstr "Escolha o tipo inicial de letra do terminal" msgid "Select initial number of tabs" -msgstr "Escolha o número de separadores" +msgstr "Escolha o número inicial de separadores" msgid "Set working directory" msgstr "Definir diretório de trabalho" @@ -39,12 +39,8 @@ 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" +msgstr "Definir ícone de janela" msgid "Set columns number" msgstr "Definir número de colunas" @@ -64,18 +60,8 @@ msgid "Use alternate configuration file" msgstr "Utilizar ficheiro alternativo de configurações" -#, fuzzy msgid "Select initial colorset" -msgstr "Escolha a cor" - -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?" +msgstr "Escolha conjunto de cores inicial" msgid "" "There are running processes.\n" @@ -101,7 +87,6 @@ msgid "New text" msgstr "Novo texto" -#, fuzzy msgid "Select colors" msgstr "Escolha a cor" @@ -109,7 +94,10 @@ msgstr "_Selecionar" msgid "Colorset" -msgstr "" +msgstr "Conjunto de cores" + +msgid "Color scheme" +msgstr "Esquema de cores" msgid "Foreground color" msgstr "Cor de primeiro plano" @@ -117,22 +105,26 @@ msgid "Background color" msgstr "Cor de fundo" -#, fuzzy msgid "Cursor color" -msgstr "Escolha a cor de fundo:" +msgstr "Cor do cursor" msgid "Opacity level (%)" msgstr "Nivel de opacidade (%)" -msgid "Search" +msgid "Palette" +msgstr "Palete" + +msgid "Use bright colors for bold text" msgstr "" +msgid "Set window title" +msgstr "Definir título da janela" + msgid "New window title" msgstr "Título da nova janela" -#, fuzzy msgid "Open mail" -msgstr "Abrir ligação" +msgstr "Abrir correio" msgid "Open link" msgstr "Abrir ligação" @@ -158,21 +150,15 @@ msgid "Paste" msgstr "Colar" +msgid "Options" +msgstr "Opções" + 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" @@ -188,9 +174,8 @@ msgid "Less questions at exit time" msgstr "" -#, fuzzy msgid "Set urgent bell" -msgstr "Definir sinal sonoro" +msgstr "Definir sinal urgente" msgid "Set audible bell" msgstr "Definir sinal sonoro" @@ -198,14 +183,11 @@ msgid "Set blinking cursor" msgstr "Definir cursor intermitente" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "" msgid "Enable focus fade" -msgstr "" +msgstr "Habilitar enfranquecimiento do foco" msgid "Set cursor type" msgstr "Definir tipo de cursor" @@ -219,14 +201,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Definir palete" +msgid "Search" +msgstr "Pesquisar" #, c-format msgid "Terminal %d" msgstr "Terminal %d" -#, fuzzy +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?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "A configuração foi modificada por outro processo. Substituir?" @@ -235,11 +225,11 @@ #, c-format msgid "Cannot change working directory\n" -msgstr "" +msgstr "Não pode mudar o diretório de trabalho\n" 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" +msgstr "A versão do sakura é a %s\n" diff -Nru sakura-3.7.1/po/ru.po sakura-3.8.4/po/ru.po --- sakura-3.7.1/po/ru.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/ru.po 2021-10-15 00:55:05.000000000 +0000 @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: ManDrive \n" "Language-Team: Evgenij Vdovin \n" @@ -34,9 +34,6 @@ msgid "Login shell" msgstr "Логин shell" -msgid "Set window title" -msgstr "Изменение заголовка окна" - msgid "Set window icon" msgstr "Установить иконку окна" @@ -62,15 +59,6 @@ msgstr "Выбрать начальную цветовую палитру" msgid "" -"There is a running process in this terminal.\n" -"\n" -"Do you really want to close it?" -msgstr "" -"Не все процессы завершены в этом терминале.\n" -"\n" -"Вы уверены, что хотите выйти закрыть его?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -103,6 +91,9 @@ msgid "Colorset" msgstr "Цветовой набор" +msgid "Color scheme" +msgstr "Цветовой нсхема" + msgid "Foreground color" msgstr "Цвет текста" @@ -115,15 +106,20 @@ msgid "Opacity level (%)" msgstr "Уровень прозрачности (%)" -msgid "Search" +msgid "Palette" +msgstr "Палитра" + +msgid "Use bright colors for bold text" msgstr "" +msgid "Set window title" +msgstr "Изменение заголовка окна" + msgid "New window title" msgstr "Новый заголовок окна:" -#, fuzzy msgid "Open mail" -msgstr "Открыть ссылку" +msgstr "Открыть почта" msgid "Open link" msgstr "Открыть ссылку" @@ -149,21 +145,15 @@ msgid "Paste" msgstr "Вставить" +msgid "Options" +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 "Всегда показывать панель вкладок" @@ -188,15 +178,11 @@ msgid "Set blinking cursor" msgstr "Мигающий курсор" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "Отключить нумерованный переключатель вкладок" -#, fuzzy msgid "Enable focus fade" -msgstr "Включить жирный шрифт" +msgstr "Включение фокусировки замирания" msgid "Set cursor type" msgstr "Установить вид курсора" @@ -210,14 +196,22 @@ msgid "IBeam" msgstr "I-образный" -msgid "Set palette" -msgstr "Палитра" +msgid "Search" +msgstr "Поиск" #, c-format msgid "Terminal %d" msgstr "Терминал %d" -#, fuzzy +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"Не все процессы завершены в этом терминале.\n" +"\n" +"Вы уверены, что хотите выйти закрыть его?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "Настройки были изменены другим процессом. Перезаписать?" @@ -234,6 +228,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "Версия sakura %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Включить жирный шрифт" diff -Nru sakura-3.7.1/po/sv.po sakura-3.8.4/po/sv.po --- sakura-3.7.1/po/sv.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/sv.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2019-08-12 16:27+0000\n" "Last-Translator: Andreas Rönnquist \n" "Language-Team: Swedish \n" @@ -39,9 +39,6 @@ msgid "Login shell" msgstr "Inloggningsskal" -msgid "Set window title" -msgstr "Sätt fönstertitel" - msgid "Set window icon" msgstr "Sätt fönsterikon" @@ -67,15 +64,6 @@ msgstr "Välj initial färguppsättning" 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 "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -108,6 +96,9 @@ msgid "Colorset" msgstr "Färguppsättning" +msgid "Color scheme" +msgstr "Färgschema" + msgid "Foreground color" msgstr "Förgrundsfärg" @@ -120,8 +111,14 @@ msgid "Opacity level (%)" msgstr "Opacitetsnivå (%)" -msgid "Search" -msgstr "Sök" +msgid "Palette" +msgstr "Palett" + +msgid "Use bright colors for bold text" +msgstr "" + +msgid "Set window title" +msgstr "Sätt fönstertitel" msgid "New window title" msgstr "Ny fönstertitel" @@ -153,21 +150,15 @@ msgid "Paste" msgstr "Klistra in" +msgid "Options" +msgstr "Alternativ" + 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" @@ -192,9 +183,6 @@ msgid "Set blinking cursor" msgstr "Sätt blinkande markör" -msgid "Stop tab cycling at end tabs" -msgstr "Stoppa flikcykling vid ändflikar" - msgid "Disable numbered tabswitch" msgstr "Inaktivera numrerad flikväxlare" @@ -213,13 +201,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Sätt palett" +msgid "Search" +msgstr "Sök" #, c-format msgid "Terminal %d" msgstr "Terminal %d" +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 "Configuration has been modified by another process. Overwrite?" msgstr "Konfigurationen har ändrats av en annan process. Skriv över?" @@ -236,6 +233,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "sakura-versionen är %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "Aktivera fetstil" diff -Nru sakura-3.7.1/po/uk.po sakura-3.8.4/po/uk.po --- sakura-3.7.1/po/uk.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/uk.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2018-04-29 13:18+0000\n" "Last-Translator: Andriy Nezhivy \n" "Language-Team: Ukrainian \n" @@ -40,9 +40,6 @@ msgid "Login shell" msgstr "Оболонка входу" -msgid "Set window title" -msgstr "Встановити заголовок вікна" - #, fuzzy msgid "Set window icon" msgstr "Встановити заголовок вікна" @@ -71,15 +68,6 @@ msgstr "Обрати колір" msgid "" -"There is a running process in this terminal.\n" -"\n" -"Do you really want to close it?" -msgstr "" -"В цьому терміналі є запущені процеси.\n" -"\n" -"Ви хочете закрити його?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -113,6 +101,9 @@ msgid "Colorset" msgstr "" +msgid "Color scheme" +msgstr "" + #, fuzzy msgid "Foreground color" msgstr "Оберіть колір:" @@ -129,9 +120,16 @@ msgid "Opacity level (%)" msgstr "Рівень прозорості (%):" -msgid "Search" +#, fuzzy +msgid "Palette" +msgstr "Оберіть палітру" + +msgid "Use bright colors for bold text" msgstr "" +msgid "Set window title" +msgstr "Встановити заголовок вікна" + msgid "New window title" msgstr "Новий заголовок вікна" @@ -165,21 +163,15 @@ msgid "Paste" msgstr "Вставити" +msgid "Options" +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 "Завжди показувати панель вкладок" @@ -205,9 +197,6 @@ msgid "Set blinking cursor" msgstr "Встановити мерехтіння курсора" -msgid "Stop tab cycling at end tabs" -msgstr "" - msgid "Disable numbered tabswitch" msgstr "" @@ -226,13 +215,22 @@ msgid "IBeam" msgstr "IBeam" -msgid "Set palette" -msgstr "Оберіть палітру" +msgid "Search" +msgstr "" #, c-format msgid "Terminal %d" msgstr "Термінал %d" +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"В цьому терміналі є запущені процеси.\n" +"\n" +"Ви хочете закрити його?" + #, fuzzy msgid "Configuration has been modified by another process. Overwrite?" msgstr "Конфігурація була змінена іншим процесом. Переписати?" diff -Nru sakura-3.7.1/po/zh_CN.po sakura-3.8.4/po/zh_CN.po --- sakura-3.7.1/po/zh_CN.po 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/po/zh_CN.po 2021-10-15 00:55:05.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: sakura 1.0.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:38+0200\n" +"POT-Creation-Date: 2021-04-23 07:17+0200\n" "PO-Revision-Date: 2019-08-12 17:06+0000\n" "Last-Translator: David Gómez \n" "Language-Team: Chinese/Simplified \n" @@ -39,9 +39,6 @@ msgid "Login shell" msgstr "登录 shell" -msgid "Set window title" -msgstr "设置窗口标题" - msgid "Set window icon" msgstr "设置窗口图标" @@ -67,15 +64,6 @@ msgstr "选择初始颜色设置" msgid "" -"There is a running process in this terminal.\n" -"\n" -"Do you really want to close it?" -msgstr "" -"终端中有进程正在执行。\n" -"\n" -"您确定要关闭它吗?" - -msgid "" "There are running processes.\n" "\n" "Do you really want to close Sakura?" @@ -108,6 +96,9 @@ msgid "Colorset" msgstr "色彩集" +msgid "Color scheme" +msgstr "颜色方案" + msgid "Foreground color" msgstr "前景色" @@ -120,8 +111,14 @@ msgid "Opacity level (%)" msgstr "不透明度(%)" -msgid "Search" -msgstr "搜索" +msgid "Palette" +msgstr "调色板" + +msgid "Use bright colors for bold text" +msgstr "为了粗体字使用鲜艳的色彩" + +msgid "Set window title" +msgstr "设置窗口标题" msgid "New window title" msgstr "新窗口标题" @@ -153,21 +150,15 @@ msgid "Paste" msgstr "粘贴" +msgid "Options" +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 "总是显示第一个标签页" @@ -192,9 +183,6 @@ msgid "Set blinking cursor" msgstr "设置闪烁光标" -msgid "Stop tab cycling at end tabs" -msgstr "在结束标签处停止标签循环" - msgid "Disable numbered tabswitch" msgstr "禁用编号标签开关" @@ -213,13 +201,22 @@ msgid "IBeam" msgstr "竖线" -msgid "Set palette" -msgstr "设置调色板" +msgid "Search" +msgstr "搜索" #, c-format msgid "Terminal %d" msgstr "终端 %d" +msgid "" +"There is a running process in this terminal.\n" +"\n" +"Do you really want to close it?" +msgstr "" +"终端中有进程正在执行。\n" +"\n" +"您确定要关闭它吗?" + msgid "Configuration has been modified by another process. Overwrite?" msgstr "配置已被另一个进程修改。覆盖?" @@ -236,6 +233,3 @@ #, c-format msgid "sakura version is %s\n" msgstr "sakura 版本是 %s\n" - -#~ msgid "Enable bold font" -#~ msgstr "启动粗体字" diff -Nru sakura-3.7.1/README.md sakura-3.8.4/README.md --- sakura-3.7.1/README.md 1970-01-01 00:00:00.000000000 +0000 +++ sakura-3.8.4/README.md 2021-10-15 00:55:05.000000000 +0000 @@ -0,0 +1,95 @@ +# sakura + +**sakura** is a simple [gtk](http://www.gtk.org) and [vte](https://gitlab.gnome.org/GNOME/vte) based terminal emulator. It uses tabs to provide several terminals in one window and allows to change configuration options via a contextual menu. No more no less. + +## Installation + +How to compile and install this beast ? + +```bash +$ cmake . +$ make +$ sudo '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 for example, to install sakura in `/usr`, you must type: + +```bash +$ cmake -DCMAKE_INSTALL_PREFIX=/usr . +``` + +Use CMAKE_BUILD_TYPE=Debug if you need debug symbols. Default type is "Release". + + +## Usage + +**sakura** has several command line options. Run `sakura --help` for a full list. + +## Keybindings + +**sakura** supports keyboard bindings in its config file (`~/.config/sakura/sakura.conf`), but there's no GUI to edit them, so please use your favourite editor to change the following values. Keybindings are a combination of an accelerator+key. + +### Accelerators + +Accelerators can be set to any _GdkModifierType_ mask value. The full list of _GdkModifierType_ values is available [here](http://gtk.php.net/manual/en/html/gdk/gdk.enum.modifiertype.html) + +Mask values can be combined by ORing them. For example, to set the delete tab accelerator to Ctrl+Shift, change the option "del_tab_accelerator" value to "5". This number comes from ORing GDK_SHIFT_MASK and GDK_CONTROL_MASK. + +I realise that this configuration is not user-friendly, but... :-P + +Quick reference: Shift(1), Cps-Lock(2), Ctrl(4), Alt(8), Ctrl-S(5), Ctrl-A(12), Ctrl-A-S(13) + +### Keys + +To change default keys, set the key value you want to modify to your desired key. For example, if you want to use the "D" key instead of the "W" key to delete a tab, set "del_tab_key" to "D" in the config file. + +### Default keybindings + + 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 + + Ctrl + Left cursor -> Previous tab + Ctrl + Right cursor -> Next tab + Ctrl + Shift + Left cursor -> Move tab to the left + Ctrl + 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: + + Ctrl + '+' -> Increase font size + Ctrl + '-' -> Decrease font size + +By default, mouse buttons are bound to the following: + + Button1 -> No action + Button2 -> Paste + Button3 -> Context menu + +Behavior can be changed with the following config settings: + + copy_on_select -> set to true to automatically copy selected text + paste_button -> set to desired mouse button (default: 2) + menu_button -> set to desired mouse button (default: 3) + +## Contributing +Pull requests are welcome. But please, create first a bug report in [Launchpad](https://bugs.launchpad.net/sakura), particularly if you plan to make major changes, to make sure your patch will be merged into **sakura**. If you'd like to contribute with translations, use the translations framework in [Launchpad](https://translations.launchpad.net/sakura) or send [me](mailto:dabisu@gmail.com) directly the translated po file. + +## License +[GPL 2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) + +\ +Enjoy **sakura**! diff -Nru sakura-3.7.1/sakura.pod sakura-3.8.4/sakura.pod --- sakura-3.7.1/sakura.pod 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/sakura.pod 2021-10-15 00:55:05.000000000 +0000 @@ -58,10 +58,6 @@ Login shell -=item B<-t, --title> - -Set window title - =item B<-c, --columns> Set columns number @@ -150,21 +146,21 @@ =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. +Before sakura used keycodes instead of strings. They're still valid. -=head2 DEFAULTS +=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 + Left cursor -> Previous tab + Ctrl + Right cursor -> Next tab + Ctrl + [1-9] -> Switch to tab N (1-9) Ctrl + Shift + S -> Toggle scrollbar Ctrl + Shift + Mouse left button -> Open link F11 -> Fullscreen @@ -174,7 +170,7 @@ 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 @@ -186,7 +182,7 @@ =head1 AUTHORS -B was written by David Gómez . +B was written by David Gómez . This manual page was written by Andrew Starr-Bochicchio . diff -Nru sakura-3.7.1/src/sakura.c sakura-3.8.4/src/sakura.c --- sakura-3.7.1/src/sakura.c 2020-05-06 16:40:28.000000000 +0000 +++ sakura-3.8.4/src/sakura.c 2021-10-15 00:55:05.000000000 +0000 @@ -2,7 +2,7 @@ * Filename: sakura.c * Description: VTE-based terminal emulator * - * Copyright (C) 2006-2012 David Gómez + * Copyright (C) 2006-2021 David Gómez * Copyright (C) 2008 Hong Jen Yee (PCMan) * * This program is free software; you can redistribute it and/or modify @@ -58,27 +58,25 @@ #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). */ +/* 16 color palettes in GdkRGBA format (red, green, blue, alpha) */ 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}, + {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] = { @@ -119,80 +117,134 @@ {1, 1, 1, 1} }; -const GdkRGBA solarized_dark_palette[PALETTE_SIZE] = { - {0.027451, 0.211765, 0.258824, 1}, // 0 base02 (background) +const GdkRGBA solarized_palette[PALETTE_SIZE] = { + {0.027451, 0.211765, 0.258824, 1}, // 0 base02 {0.862745, 0.196078, 0.184314, 1}, // 1 red {0.521569, 0.600000, 0.000000, 1}, // 2 green {0.709804, 0.537255, 0.000000, 1}, // 3 yellow {0.149020, 0.545098, 0.823529, 1}, // 4 blue {0.827451, 0.211765, 0.509804, 1}, // 5 magenta {0.164706, 0.631373, 0.596078, 1}, // 6 cyan - {0.933333, 0.909804, 0.835294, 1}, // 7 base2 (foreground) - {0.000000, 0.168627, 0.211765, 1}, // 8 base03 + {0.933333, 0.909804, 0.835294, 1}, // 7 base2 + {0.000000, 0.168627, 0.211765, 1}, // 8 base03 (bg) {0.796078, 0.294118, 0.086275, 1}, // 9 orange {0.345098, 0.431373, 0.458824, 1}, // 10 base01 {0.396078, 0.482353, 0.513725, 1}, // 11 base00 - {0.513725, 0.580392, 0.588235, 1}, // 12 base0 + {0.513725, 0.580392, 0.588235, 1}, // 12 base0 (fg) {0.423529, 0.443137, 0.768627, 1}, // 13 violet {0.576471, 0.631373, 0.631373, 1}, // 14 base1 {0.992157, 0.964706, 0.890196, 1} // 15 base3 }; +const GdkRGBA nord_palette[PALETTE_SIZE] = { + {0.0, 0.0, 0.0234375, 1.0}, + {0.74609375, 0.37890625, 0.4140625, 1.0}, + {0.63671875, 0.7421875, 0.546875, 1.0}, + {0.91796875, 0.79296875, 0.54296875, 1.0}, + {0.50390625, 0.62890625, 0.75390625, 1.0}, + {0.703125, 0.5546875, 0.67578125, 1.0}, + {0.53125, 0.75, 0.8125, 1.0}, + {0.89453125, 0.91015625, 0.9375, 1.0}, + {0.296875, 0.3359375, 0.4140625, 1.0}, + {0.74609375, 0.37890625, 0.4140625, 1.0}, + {0.63671875, 0.7421875, 0.546875, 1.0}, + {0.91796875, 0.79296875, 0.54296875, 1.0}, + {0.50390625, 0.62890625, 0.75390625, 1.0}, + {0.703125, 0.5546875, 0.67578125, 1.0}, + {0.55859375, 0.734375, 0.73046875, 1.0}, + {0.921875, 0.93359375, 0.953125, 1.0} +}; + + 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} + {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 } + {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} }; +const char *palettes_names[]= {"Solarized", "Tango", "Gruvbox","Nord","Xterm","Linux", "Rxvt", NULL}; +const GdkRGBA *palettes[] = {solarized_palette, tango_palette, gruvbox_palette, nord_palette, xterm_palette, linux_palette, rxvt_palette, NULL}; +#define DEFAULT_PALETTE 1 /* Tango palette */ + +/* Color schemes (fg&bg) for sakura. Each colorset can use a different scheme */ +struct scheme { + gchar *name; + GdkRGBA bg; + GdkRGBA fg; +}; + +#define NUM_SCHEMES 5 +#define DEFAULT_SCHEME 1 +struct scheme predefined_schemes[NUM_SCHEMES] = { + {"Custom", {0, 0, 0, 1}, {1, 1, 1, 1}}, /* Custom values are ignored, we use the ones chosen by the user */ + {"White on black", {0, 0, 0, 1}, {1, 1, 1, 1}}, + {"Green on black", {0, 0, 0, 1}, {0.4, 1, 0, 1}}, + {"Solarized dark", {0.000000, 0.168627, 0.211765, 1}, {0.513725, 0.580392, 0.588235, 1}}, + {"Solarized light", {0.992157, 0.964706, 0.890196, 1}, {0.396078, 0.482353, 0.513725, 1}} +}; -/* Empty by now. Just drop here you CSS to personalize widgets */ +/* CSS definitions. Global CSS is empty, just drop here you CSS to personalize widgets */ #define SAKURA_CSS "" +#define FADE_WINDOW_CSS "\ +window#fade_window {\ + background-color: black;\ +} " + +#define FADE_WINDOW_OPACITY 0.5 + #define NUM_COLORSETS 6 #define PCRE2_CODE_UNIT_WIDTH 8 #include + + +/* Global sakura data */ static struct { GtkWidget *main_window; GtkWidget *notebook; GtkWidget *menu; + GtkWidget *fade_window; /* Window used for fading effect */ PangoFontDescription *font; GdkRGBA forecolors[NUM_COLORSETS]; GdkRGBA backcolors[NUM_COLORSETS]; GdkRGBA curscolors[NUM_COLORSETS]; + guint schemes[NUM_COLORSETS]; /* Selected color scheme for each colorset */ const GdkRGBA *palette; + guint palette_idx; + gint last_colorset; char *current_match; guint width; guint height; @@ -208,29 +260,23 @@ bool urgent_bell; bool audible_bell; bool blinking_cursor; - bool stop_tab_cycling_at_end_tabs; 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 use_fading; /* Fade the window when the focus change */ bool scrollable_tabs; + bool bold_is_bright; /* Show bold characters as bright */ + bool dont_save; /* Don't save config file */ 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; @@ -255,19 +301,23 @@ gint increase_font_size_key; gint decrease_font_size_key; gint set_colorset_keys[NUM_COLORSETS]; + gint paste_button; + gint menu_button; VteRegex *http_vteregexp, *mail_vteregexp; + char *word_chars; /* Exceptions for word selection */ char *argv[3]; } sakura; -struct terminal { +/* Data associated to each sakura tab */ +struct sakura_tab { GtkWidget *hbox; - GtkWidget *vte; /* Reference to VTE terminal */ - GPid pid; /* pid of the forked process */ - GtkWidget *scrollbar; GtkWidget *label; - bool label_set_byuser; + GtkWidget *vte; /* Reference to VTE terminal */ + GtkWidget *scrollbar; GtkBorder padding; /* inner-property data */ + bool label_set_byuser; int colorset; + GPid pid; /* pid of the forked process */ gulong exit_handler_id; }; @@ -280,19 +330,19 @@ #define DEFAULT_CONFIGFILE "sakura.conf" #define DEFAULT_COLUMNS 80 #define DEFAULT_ROWS 24 +#define DEFAULT_MIN_WIDTH_CHARS 20 +#define DEFAULT_MIN_HEIGHT_CHARS 1 #define DEFAULT_FONT "Ubuntu Mono,monospace 13" #define FONT_MINIMAL_SIZE (PANGO_SCALE*6) #define DEFAULT_WORD_CHARS "-,./?%&#_~:" -#define DEFAULT_PALETTE "tango" #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_SWITCH_TAB_ACCELERATOR (GDK_MOD1_MASK) +#define DEFAULT_MOVE_TAB_ACCELERATOR (GDK_MOD1_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) @@ -313,25 +363,29 @@ #define DEFAULT_INCREASE_FONT_SIZE_KEY GDK_KEY_plus #define DEFAULT_DECREASE_FONT_SIZE_KEY GDK_KEY_minus #define DEFAULT_SCROLLABLE_TABS TRUE +#define DEFAULT_PASTE_BUTTON 2 +#define DEFAULT_MENU_BUTTON 3 /* 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] = +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"; +/* Get a set sakura tab data from/to our GObject (notebook) */ static GQuark term_data_id = 0; -#define sakura_get_page_term( sakura, page_idx ) \ - (struct terminal*)g_object_get_qdata( \ +#define sakura_get_sktab( sakura, page_idx ) \ + (struct sakura_tab*)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 ) \ +#define sakura_set_sktab( sakura, page_idx, sk_tab ) \ g_object_set_qdata_full( \ G_OBJECT( gtk_notebook_get_nth_page( (GtkNotebook*)sakura.notebook, page_idx) ), \ - term_data_id, term, (GDestroyNotify)g_free); + term_data_id, sk_tab, (GDestroyNotify)g_free); +/* Configuration macros */ #define sakura_set_config_integer(key, value) do {\ g_key_file_set_integer(sakura.cfg, cfg_group, key, value);\ sakura.config_modified=TRUE;\ @@ -351,81 +405,85 @@ /* Spawn callback */ void sakura_spawm_callback (VteTerminal *, GPid, GError, gpointer); /* VTE callbacks */ -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_term_buttonpressed_cb (GtkWidget *, GdkEventButton *, gpointer); +static gboolean sakura_term_buttonreleased_cb (GtkWidget *, GdkEventButton *, gpointer); +static void sakura_beep_cb (GtkWidget *, void *); +static void sakura_increase_font_cb (GtkWidget *, void *); +static void sakura_decrease_font_cb (GtkWidget *, void *); +static void sakura_child_exited_cb (GtkWidget *, void *); +static void sakura_eof_cb (GtkWidget *, void *); +static void sakura_title_changed_cb (GtkWidget *, void *); +static gboolean sakura_delete_event_cb (GtkWidget *, void *); +static void sakura_destroy_window_cb (GtkWidget *, void *); /* Main window callbacks */ -static gboolean sakura_key_press (GtkWidget *, GdkEventKey *, gpointer); -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_show_event (GtkWidget *, gpointer); -/* Notebook callbacks */ -static void sakura_switch_page (GtkWidget *widget, GtkWidget *page, guint page_num, void *data); -static void sakura_page_removed (GtkWidget *, void *); -static gboolean sakura_notebook_scroll (GtkWidget *, GdkEventScroll *); +static gboolean sakura_key_press_cb (GtkWidget *, GdkEventKey *, gpointer); +static gboolean sakura_resized_window_cb (GtkWidget *, GdkEventConfigure *, void *); +static gboolean sakura_focus_in_cb (GtkWidget *, GdkEvent *, void *); +static gboolean sakura_focus_out_cb (GtkWidget *, GdkEvent *, void *); +static void sakura_conf_changed_cb (GtkWidget *, void *); +static void sakura_show_event_cb (GtkWidget *, gpointer); +/* Notebook, notebook labels and notebook buttons callbacks */ +static void sakura_switch_page_cb (GtkWidget *, GtkWidget *, guint, void *); +static void sakura_page_removed_cb (GtkWidget *, void *); +static gboolean sakura_notebook_scroll_cb (GtkWidget *, GdkEventScroll *); +static gboolean sakura_label_clicked_cb (GtkWidget *, GdkEventButton *, void *); +static gboolean sakura_notebook_focus_cb (GtkWindow *, GdkEvent *, void *); +static void sakura_closebutton_clicked_cb (GtkWidget *, void *); /* 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_open_mail (GtkWidget *, void *); -static void sakura_copy_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 *); -static void sakura_set_palette (GtkWidget *, void *); -static void sakura_set_cursor (GtkWidget *, void *); -static void sakura_stop_tab_cycling_at_end_tabs (GtkWidget *, void *); -static void sakura_blinking_cursor (GtkWidget *, void *); -static void sakura_audible_bell (GtkWidget *, void *); -static void sakura_urgent_bell (GtkWidget *, void *); +static void sakura_font_dialog_cb (GtkWidget *, void *); +static void sakura_set_name_dialog_cb (GtkWidget *, void *); +static void sakura_color_dialog_cb (GtkWidget *, void *); +//static void sakura_set_title_dialog (GtkWidget *, void *); +static void sakura_new_tab_cb (GtkWidget *, void *); +static void sakura_close_tab_cb (GtkWidget *, void *); +static void sakura_fullscreen_cb (GtkWidget *, void *); +static void sakura_open_url_cb (GtkWidget *, void *); +static void sakura_open_mail_cb (GtkWidget *, void *); +static void sakura_copy_url_cb (GtkWidget *, void *); +static void sakura_copy_cb (GtkWidget *, void *); +static void sakura_paste_cb (GtkWidget *, void *); +static void sakura_show_first_tab_cb (GtkWidget *, void *); +static void sakura_tabs_on_bottom_cb (GtkWidget *, void *); +static void sakura_less_questions_cb (GtkWidget *, void *); +static void sakura_show_close_button_cb (GtkWidget *, void *); +static void sakura_show_scrollbar_cb (GtkWidget *, void *); +static void sakura_disable_numbered_tabswitch_cb (GtkWidget *, void *); +//static void sakura_use_fading_cb (GtkWidget *, void *); +static void sakura_setname_entry_changed_cb (GtkWidget *, void *); +static void sakura_set_cursor_cb (GtkWidget *, void *); +static void sakura_blinking_cursor_cb (GtkWidget *, void *); +static void sakura_audible_bell_cb (GtkWidget *, void *); +static void sakura_urgent_bell_cb (GtkWidget *, void *); /* Misc */ static void sakura_error (const char *, ...); -static char * sakura_get_term_cwd (struct terminal *); +static void sakura_build_command (int *, char ***); +static char * sakura_get_term_cwd (struct sakura_tab *); static guint sakura_tokeycode (guint key); static void sakura_set_keybind (const gchar *, guint); static guint sakura_get_keybind (const gchar *); -static void sakura_sanitize_working_directory (void); +static void sakura_sanitize_working_directory (void); /* 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_del_tab (gint); +static void sakura_close_tab (gint); /* Save config, del tab and destroy sakura */ +static void sakura_destroy (); 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_tab_label_text (const gchar *, gint); static void sakura_set_size (void); static void sakura_config_done (); static void sakura_set_colorset (int); static void sakura_set_colors (void); -static void sakura_fade_in (void); -static void sakura_fade_out (void); -static void sakura_search (const char *, bool); +static void sakura_search_dialog (void); +static void sakura_search (const char *, bool); +static void sakura_copy (void); +static void sakura_paste (void); +static void sakura_show_scrollbar (void); /* Globals for command line parameters */ @@ -437,7 +495,6 @@ 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; @@ -445,7 +502,7 @@ static gboolean option_fullscreen; static gboolean option_maximize; static gint option_colorset; -static gboolean option_boldisbright; + static GOptionEntry entries[] = { { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, N_("Print version number"), NULL }, @@ -456,9 +513,7 @@ { "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 }, @@ -466,7 +521,6 @@ { "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 }, - { "bold-is-bright", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &option_boldisbright, NULL, NULL }, { NULL } }; @@ -479,26 +533,28 @@ /*************************/ static gboolean -sakura_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data) +sakura_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { - if (event->type!=GDK_KEY_PRESS) return FALSE; - + gint page, npages; unsigned int topage = 0; - gint npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); - + if (event->type != GDK_KEY_PRESS) return FALSE; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + 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)) { + 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) ) { + } 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); + sakura_close_tab(page); return TRUE; } @@ -507,16 +563,16 @@ 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) && + if ( ((event->state & sakura.switch_tab_accelerator) == sakura.switch_tab_accelerator) && ((event->state & sakura.move_tab_accelerator) != sakura.move_tab_accelerator) ) { /* Just propagate the event if there is only one tab */ - if(npages < 2) return FALSE; + if (npages < 2) return FALSE; - if ((keycode>=sakura_tokeycode(GDK_KEY_1)) && (keycode<=sakura_tokeycode( GDK_KEY_9))) { + 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.disable_numbered_tabswitch) return FALSE; if (sakura_tokeycode(GDK_KEY_1) == keycode) topage = 0; else if (sakura_tokeycode(GDK_KEY_2) == keycode) topage = 1; @@ -530,91 +586,91 @@ if (topage <= npages) gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), topage); return TRUE; - } else if (keycode==sakura_tokeycode(sakura.prev_tab_key)) { + } 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)) { + } 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)) { + 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)) { + } 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); + if ( (event->state & sakura.copy_accelerator) == sakura.copy_accelerator ) { + if (keycode == sakura_tokeycode(sakura.copy_key)) { + sakura_copy(); return TRUE; - } else if (keycode==sakura_tokeycode(sakura.paste_key)) { - sakura_paste(NULL, NULL); + } else if (keycode == sakura_tokeycode(sakura.paste_key)) { + sakura_paste(); 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); + if ( (event->state & sakura.scrollbar_accelerator) == sakura.scrollbar_accelerator ) { + if (keycode == sakura_tokeycode(sakura.scrollbar_key)) { + sakura_show_scrollbar(); 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); + 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_cb(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); + if ( (event->state & sakura.search_accelerator) == sakura.search_accelerator ) { + if (keycode == sakura_tokeycode(sakura.search_key)) { + sakura_search_dialog(); 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); + if ( (event->state & sakura.font_size_accelerator) == sakura.font_size_accelerator ) { + if (keycode == sakura_tokeycode(sakura.increase_font_size_key)) { + sakura_increase_font_cb(NULL, NULL); return TRUE; - } else if (keycode==sakura_tokeycode(sakura.decrease_font_size_key)) { - sakura_decrease_font(NULL, NULL); + } else if (keycode == sakura_tokeycode(sakura.decrease_font_size_key)) { + sakura_decrease_font_cb(NULL, NULL); return TRUE; } } /* F11 (fullscreen) pressed */ - if (keycode==sakura_tokeycode(sakura.fullscreen_key)){ - sakura_fullscreen(NULL, NULL); + if (keycode == sakura_tokeycode(sakura.fullscreen_key)) { + sakura_fullscreen_cb(NULL, NULL); return TRUE; } /* Change in colorset */ - if ( (event->state & sakura.set_colorset_accelerator)==sakura.set_colorset_accelerator ) { + if ( (event->state & sakura.set_colorset_accelerator) == sakura.set_colorset_accelerator ) { int i; - for(i=0; iwidth!=sakura.width || event->height!=sakura.height) { + 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; + gtk_widget_hide(sakura.fade_window); + sakura.resized = TRUE; } - + return FALSE; } - +/* Use focus-in-event to unmap the fade window */ static gboolean -sakura_focus_in(GtkWidget *widget, GdkEvent *event, void *data) +sakura_focus_in_cb (GtkWidget *widget, GdkEvent *event, void *data) { if (event->type != GDK_FOCUS_CHANGE) return FALSE; + if (!sakura.use_fading) return FALSE; - /* Reset urgency hint */ - gtk_window_set_urgency_hint(GTK_WINDOW(sakura.main_window), 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(); - } + /* Got the focus, hide the fade */ + gtk_widget_hide(sakura.fade_window); - sakura_set_colors(); - return FALSE; - } + /* Reset urgency hint */ + gtk_window_set_urgency_hint(GTK_WINDOW(sakura.main_window), FALSE); - return FALSE; + return FALSE; } +/* Use focus-out-event to map the fade window */ static gboolean -sakura_focus_out(GtkWidget *widget, GdkEvent *event, void *data) +sakura_focus_out_cb (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 FALSE; - } - - 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; -//} - - - -/* 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?")); + gint ax, ay, mx, my, x, y; - response=gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); + if (event->type != GDK_FOCUS_CHANGE) return FALSE; + if (!sakura.use_fading) return FALSE; - if (response==GTK_RESPONSE_YES) { - sakura_del_tab(page); + /* No fade when the menu is displayed */ + if (gtk_widget_is_visible(sakura.menu)) return FALSE; - if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook))==0) - sakura_destroy(); - } - } else { /* No processes, hell with tab */ + /* Give the right size and position to the fade_window to cover all the main window */ + gtk_widget_translate_coordinates(sakura.notebook, sakura.main_window, 0, 0, &ax, &ay); + gtk_window_get_position(GTK_WINDOW(sakura.main_window), &mx, &my); + gint titlebar_height = ay-my; + gtk_window_move(GTK_WINDOW(sakura.fade_window), mx, my+titlebar_height); + //SAY("FADE ax %d ay %d x %d y %d titlebar_h %d", ax, ay, mx, my, titlebar_height); + + /* Same size as main window */ + gtk_window_get_size(GTK_WINDOW(sakura.main_window), &x, &y); + gtk_window_resize(GTK_WINDOW(sakura.fade_window), x, y); - sakura_del_tab(page); + //gtk_widget_show_all(sakura.fade_window); - if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook))==0) - sakura_destroy(); - } + return FALSE; } static void -sakura_show_event(GtkWidget *widget, gpointer data) +sakura_show_event_cb (GtkWidget *widget, gpointer data) { - // set size when the window is first shown + /* Set size when the window is first shown */ sakura_set_size(); } /* Callback called when sakura configuration file is modified by an external process */ static void -sakura_conf_changed (GtkWidget *widget, void *data) +sakura_conf_changed_cb (GtkWidget *widget, void *data) { - sakura.externally_modified=true; + sakura.externally_modified = true; } + + /**********************/ /* Notebook callbacks */ /**********************/ -/* Handler for notebook scroll-event - switches tabs by scroll direction - TODO: let scroll directions configurable */ + +/* Handler for notebook scroll-event - switches tabs by scroll direction */ static gboolean -sakura_notebook_scroll(GtkWidget *widget, GdkEventScroll *event) +sakura_notebook_scroll_cb (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) { + + 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); - } + 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); - } + 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: @@ -811,75 +787,161 @@ } +/* Callback called when the user switches tabs or closes a tab (but not when a tab is added) */ static void -sakura_switch_page (GtkWidget *widget, GtkWidget *widget_page, guint page_num, void *data) +sakura_switch_page_cb (GtkWidget *widget, GtkWidget *widget_page, guint page_num, void *data) { - struct terminal *term; - const char *title; - + struct sakura_tab *sk_tab; + /* Don't use gtk_notebook_get_current_page in the callbacks, it returns the previous page */ - - term = sakura_get_page_term(sakura, page_num); - title = vte_terminal_get_window_title(VTE_TERMINAL(term->vte)); + + sk_tab = sakura_get_sktab(sakura, page_num); /* Update the window title when a new tab is selected, but don't override the default */ - if (option_title == NULL) - gtk_window_set_title(GTK_WINDOW(sakura.main_window), title); + if (!sakura.tab_default_title) + gtk_window_set_title(GTK_WINDOW(sakura.main_window), gtk_label_get_text(GTK_LABEL(sk_tab->label))); } static void -sakura_page_removed (GtkWidget *widget, void *data) +sakura_page_removed_cb (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 */ + /* If the first tab is disabled, window size changes and we need to recalculate its size */ sakura_set_size(); } } +/* Callback for focus-in-event to the notebook widget */ +static gboolean +sakura_notebook_focus_cb (GtkWindow *window, GdkEvent *event, void *data) +{ + struct sakura_tab *sk_tab; gint page; + + if (event->type != GDK_FOCUS_CHANGE) return FALSE; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + sk_tab = sakura_get_sktab(sakura, page); + + /* When clicking several times in the label, terminal loses its focus. + * So, when the notebook got the focus, make sure the terminal HAS te focus */ + gtk_widget_grab_focus(sk_tab->vte); + + return FALSE; +} + + +/* Callback for clicking in the tabs close buttons */ +static void +sakura_closebutton_clicked_cb (GtkWidget *widget, void *data) +{ + GtkWidget *hbox = (GtkWidget *)data; + gint page; + + page = gtk_notebook_page_num(GTK_NOTEBOOK(sakura.notebook), hbox); + + sakura_close_tab(page); +} + + +/* Callback for clicking in the tabs labels */ +static gboolean +sakura_label_clicked_cb (GtkWidget *widget, GdkEventButton *button_event, void *data) +{ + GtkWidget *hbox = (GtkWidget *)data; + struct sakura_tab *sk_tab; + gint page; + + page = gtk_notebook_page_num(GTK_NOTEBOOK(sakura.notebook), hbox); + sk_tab = sakura_get_sktab(sakura, page); + + /* Not interested in non button press events */ + if (button_event->type != GDK_BUTTON_PRESS) + return FALSE; + + /* Left button click. We HAVE to propagate the event, or things like tab moving won't work */ + if (button_event->button == 1) { + gtk_widget_grab_focus(sk_tab->vte); + return FALSE; + } + + /* Ignore right click and propagate the event */ + if (button_event->button == 3) + return FALSE; + + /* The middle button was clicked, so close the tab */ + sakura_close_tab(page); + + return TRUE; +} + + /*****************/ /* VTE callbacks */ /*****************/ + +/* Callback for button release on the vte terminal. Used for copy-on-selection to clipboard */ static gboolean -sakura_button_press(GtkWidget *widget, GdkEventButton *button_event, gpointer user_data) +sakura_term_buttonreleased_cb (GtkWidget *widget, GdkEventButton *button_event, gpointer user_data) { - struct terminal *term; + + if (button_event->type != GDK_BUTTON_RELEASE) + return FALSE; + + if (button_event->button == 1) + sakura_copy(); + + return FALSE; +} + + +static gboolean +sakura_term_buttonpressed_cb (GtkWidget *widget, GdkEventButton *button_event, gpointer user_data) +{ + struct sakura_tab *sk_tab; gint page, tag; if (button_event->type != GDK_BUTTON_PRESS) return FALSE; page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(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); + sakura.current_match = vte_terminal_match_check_event(VTE_TERMINAL(sk_tab->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); + sakura_open_url_cb(NULL, NULL); return TRUE; } - /* Right button: show the popup menu */ - if (button_event->button == 3) { + /* Paste when paste button is pressed */ + if (button_event->button == sakura.paste_button) { + sakura_paste(); + + /* Do not propagate. vte has his own copy-on-select and we'll end with duplicates pastes */ + return TRUE; + } + + /* Show the popup menu when menu button is pressed */ + if (button_event->button == sakura.menu_button) { 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, + if (vte_terminal_event_check_regex_simple(VTE_TERMINAL(sk_tab->vte), (GdkEvent *) button_event, &sakura.mail_vteregexp, 1, 0, &matches)) { gtk_widget_show(sakura.item_open_mail); gtk_widget_hide(sakura.item_open_link); @@ -909,10 +971,10 @@ static void -sakura_beep (GtkWidget *widget, void *data) +sakura_beep_cb (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. + /* 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) { @@ -922,12 +984,12 @@ static void -sakura_increase_font (GtkWidget *widget, void *data) +sakura_increase_font_cb (GtkWidget *widget, void *data) { gint new_size; /* Increment font size one unit */ - new_size=pango_font_description_get_size(sakura.font)+PANGO_SCALE; + new_size = pango_font_description_get_size(sakura.font)+PANGO_SCALE; pango_font_description_set_size(sakura.font, new_size); sakura_set_font(); @@ -937,15 +999,15 @@ static void -sakura_decrease_font (GtkWidget *widget, void *data) +sakura_decrease_font_cb (GtkWidget *widget, void *data) { gint new_size; /* Decrement font size one unit */ - new_size=pango_font_description_get_size(sakura.font)-PANGO_SCALE; - + new_size = pango_font_description_get_size(sakura.font)-PANGO_SCALE; + /* Set a minimal size */ - if (new_size >= FONT_MINIMAL_SIZE ) { + if (new_size >= FONT_MINIMAL_SIZE) { pango_font_description_set_size(sakura.font, new_size); sakura_set_font(); sakura_set_size(); @@ -955,15 +1017,15 @@ static void -sakura_child_exited (GtkWidget *widget, void *data) +sakura_child_exited_cb (GtkWidget *widget, void *data) { gint page, npages; - struct terminal *term; + struct sakura_tab *sk_tab; 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); + sk_tab = sakura_get_sktab(sakura, page); /* Only write configuration to disk if it's the last tab */ if (npages==1) { @@ -976,68 +1038,50 @@ } /* Child should be automatically reaped because we don't use G_SPAWN_DO_NOT_REAP_CHILD flag */ - g_spawn_close_pid(term->pid); + g_spawn_close_pid(sk_tab->pid); sakura_del_tab(page); npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); - if (npages==0) + if (npages == 0) sakura_destroy(); } static void -sakura_eof (GtkWidget *widget, void *data) +sakura_eof_cb (GtkWidget *widget, void *data) { - //gint npages; - SAY("Got EOF signal"); - - //npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); - - /* This call to config_done seems unnecesary because is already being called from child_exited */ - - /* Only write configuration to disk if it's the last tab */ - //if (npages==1) { - // SAY("sakura_eof: config_done"); - // sakura_config_done(); - //} } /* This handler is called when vte window title changes (i.e.: cwd changes), * and it is used to change window and notebook pages titles */ static void -sakura_title_changed (GtkWidget *widget, void *data) +sakura_title_changed_cb (GtkWidget *widget, void *data) { - struct terminal *term; + struct sakura_tab *sk_tab; const char *tabtitle; gint modified_page; VteTerminal *vte_term=(VteTerminal *)widget; - SAY("title changed event"); - /* TODO: use the callback page, if provided */ modified_page = sakura_find_tab(vte_term); - term = sakura_get_page_term(sakura, modified_page); + sk_tab = sakura_get_sktab(sakura, modified_page); - tabtitle = vte_terminal_get_window_title(VTE_TERMINAL(term->vte)); + tabtitle = vte_terminal_get_window_title(VTE_TERMINAL(sk_tab->vte)); - /* User set values overrides any other one, but title should be changed */ - if (!term->label_set_byuser) + /* User set values overrides any other one */ + if (!sk_tab->label_set_byuser) { sakura_set_tab_label_text(tabtitle, modified_page); - - if (option_title == NULL) { /* No user set title, so we use the current tab title */ gtk_window_set_title(GTK_WINDOW(sakura.main_window), tabtitle); - } else { - gtk_window_set_title(GTK_WINDOW(sakura.main_window), option_title); } } static gboolean -sakura_delete_event (GtkWidget *widget, void *data) +sakura_delete_event_cb (GtkWidget *widget, void *data) { - struct terminal *term; + struct sakura_tab *sk_tab; GtkWidget *dialog; gint response; gint npages; @@ -1050,11 +1094,11 @@ /* 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)))); + sk_tab = sakura_get_sktab(sakura, i); + pgid = tcgetpgrp(vte_pty_get_fd(vte_terminal_get_pty(VTE_TERMINAL(sk_tab->vte)))); /* If running processes are found, we ask one time and exit */ - if ( (pgid != -1) && (pgid != term->pid)) { + if ( (pgid != -1) && (pgid != sk_tab->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?")); @@ -1068,8 +1112,8 @@ } else { return TRUE; } - } - + } + } } @@ -1079,7 +1123,7 @@ static void -sakura_destroy_window (GtkWidget *widget, void *data) +sakura_destroy_window_cb (GtkWidget *widget, void *data) { sakura_destroy(); } @@ -1091,19 +1135,19 @@ static void -sakura_font_dialog (GtkWidget *widget, void *data) +sakura_font_dialog_cb (GtkWidget *widget, void *data) { GtkWidget *font_dialog; gint response; - font_dialog=gtk_font_chooser_dialog_new(_("Select font"), GTK_WINDOW(sakura.main_window)); + 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)); + response = gtk_dialog_run(GTK_DIALOG(font_dialog)); - if (response==GTK_RESPONSE_OK) { + 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.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)); @@ -1114,18 +1158,18 @@ static void -sakura_set_name_dialog (GtkWidget *widget, void *data) +sakura_set_name_dialog_cb (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; + struct sakura_tab *sk_tab; const gchar *text; page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(sakura, page); input_dialog=gtk_dialog_new_with_buttons(_("Set tab name"), GTK_WINDOW(sakura.main_window), @@ -1135,7 +1179,7 @@ NULL); /* Configure the new gtk header bar*/ - input_header=gtk_dialog_get_header_bar(GTK_DIALOG(input_dialog)); + 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); @@ -1147,7 +1191,7 @@ /* Set tab label as entry default text (when first tab is not displayed, get_tab_label_text returns a null value, so check accordingly */ /* FIXME: Check why is returning NULL */ - text = gtk_notebook_get_tab_label_text(GTK_NOTEBOOK(sakura.notebook), term->hbox); + text = gtk_notebook_get_tab_label_text(GTK_NOTEBOOK(sakura.notebook), sk_tab->hbox); if (text) { SAY("TEXT %s", text); gtk_entry_set_text(GTK_ENTRY(entry), text); @@ -1156,18 +1200,19 @@ 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); + g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(sakura_setname_entry_changed_cb), 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)); + response = gtk_dialog_run(GTK_DIALOG(input_dialog)); - if (response==GTK_RESPONSE_ACCEPT) { + if (response == GTK_RESPONSE_ACCEPT) { sakura_set_tab_label_text(gtk_entry_get_text(GTK_ENTRY(entry)), page); - term->label_set_byuser=true; + gtk_window_set_title(GTK_WINDOW(sakura.main_window), gtk_entry_get_text(GTK_ENTRY(entry))); + sk_tab->label_set_byuser=true; } gtk_widget_destroy(input_dialog); @@ -1175,229 +1220,252 @@ -/* Callback from the color change dialog. Updates the contents of that - * dialog, passed as 'data' from user input. */ +/* Callback for the color dialog signals. Used to UPDATE the contents of that dialog (passed as 'data') */ static void -sakura_color_dialog_changed( GtkWidget *widget, void *data) +sakura_color_dialog_changed_cb ( 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 ) { + GtkDialog *dialog = (GtkDialog*) data; + GtkColorButton *fore_button = g_object_get_data (G_OBJECT(dialog), "fore_button"); + GtkColorButton *back_button = g_object_get_data (G_OBJECT(dialog), "back_button"); + GtkColorButton *curs_button = g_object_get_data (G_OBJECT(dialog), "curs_button"); + GdkRGBA *forecolors = g_object_get_data( G_OBJECT(dialog), "fore"); + GdkRGBA *backcolors = g_object_get_data( G_OBJECT(dialog), "back"); + GdkRGBA *curscolors = g_object_get_data( G_OBJECT(dialog), "curs"); + GtkComboBox *cs_combo = g_object_get_data (G_OBJECT(dialog), "cs_combo"); + GtkComboBox *scheme_combo = g_object_get_data (G_OBJECT(dialog), "scheme_combo"); + GtkSpinButton *opacity_spin = g_object_get_data(G_OBJECT(dialog), "opacity_spin"); + GtkCheckButton *bib_checkbutton = g_object_get_data (G_OBJECT(dialog), "bib_checkbutton"); + + gint current_cs = gtk_combo_box_get_active(cs_combo); + + /* If we come here as a result of a change in the active colorset, load the new colorset to the buttons. + * Else, the color buttons or opacity spin have gotten a new value, store that. */ + if ((GtkWidget *)cs_combo == 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]); + gint new_opacity = (int) (backcolors[current_cs].alpha*100); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fore_button), &forecolors[current_cs]); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(back_button), &backcolors[current_cs]); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(curs_button), &curscolors[current_cs]); + gtk_spin_button_set_value(opacity_spin, new_opacity); + gtk_combo_box_set_active(GTK_COMBO_BOX(scheme_combo), sakura.schemes[current_cs]); + } else if ((GtkWidget *)scheme_combo == widget) { + /* Scheme has changed, update the buttons. No cursor and no alpha */ + int selected_scheme = gtk_combo_box_get_active(GTK_COMBO_BOX(scheme_combo)); + if (selected_scheme != 0) { + float old_alpha = backcolors[current_cs].alpha; /* Keep the previous alpha */ + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fore_button), &predefined_schemes[selected_scheme].fg); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(back_button), &predefined_schemes[selected_scheme].bg); + forecolors[current_cs] = predefined_schemes[selected_scheme].fg; + backcolors[current_cs] = predefined_schemes[selected_scheme].bg; + backcolors[current_cs].alpha = old_alpha; + sakura.schemes[current_cs] = selected_scheme; + } /* else Custom, do nothing */ + } else if ((GtkWidget *)bib_checkbutton == widget) { + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(bib_checkbutton))) { + sakura.bold_is_bright = true; + } + else { + sakura.bold_is_bright = false; + } + } else { + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(fore_button), &forecolors[current_cs]); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(back_button), &backcolors[current_cs]); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(curs_button), &curscolors[current_cs]); gtk_spin_button_update(opacity_spin); - temp_back_colors[selected].alpha=gtk_spin_button_get_value(opacity_spin)/100; + backcolors[current_cs].alpha = gtk_spin_button_get_value(opacity_spin)/100; + /* User changed colors. Set custom scheme */ + sakura.schemes[current_cs] = 0; + gtk_combo_box_set_active(GTK_COMBO_BOX(scheme_combo), sakura.schemes[current_cs]); } } +/* Dialog to select foreground, background and cursors colors, transparency and palette */ static void -sakura_color_dialog (GtkWidget *widget, void *data) +sakura_color_dialog_cb (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; + GtkWidget *cs_label, *scheme_label, *fore_label, *back_label, *curs_label, *opacity_label, *palette_label; + GtkWidget *cs_combo, *scheme_combo, *fore_button, *back_button, *curs_button, *palette_combo, *opacity_spin; + GtkWidget *cs_hbox, *scheme_hbox, *fore_hbox, *back_hbox, *curs_hbox, *opacity_hbox, *palette_hbox, *bib_hbox; + GtkWidget *bib_checkbutton; + GdkRGBA temp_fore[NUM_COLORSETS]; GdkRGBA temp_back[NUM_COLORSETS]; GdkRGBA temp_curs[NUM_COLORSETS]; + GtkAdjustment *spin_adj; + struct sakura_tab *sk_tab; 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]; - + gint page, i; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(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); + 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)); + /* 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); - - /* 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); + + /* Add the scheme combobox */ + scheme_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + scheme_label = gtk_label_new(_("Color scheme")); + scheme_combo = gtk_combo_box_text_new(); + for (i=0; i < NUM_SCHEMES; i++) { + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(scheme_combo), NULL, predefined_schemes[i].name); } - gtk_combo_box_set_active(GTK_COMBO_BOX(set_combo), term->colorset); + gtk_combo_box_set_active(GTK_COMBO_BOX(scheme_combo), sakura.schemes[sk_tab->colorset]); /* 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]); + fore_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + back_hbox = gtk_box_new(FALSE, 12); + curs_hbox = gtk_box_new(FALSE, 12); + fore_label = gtk_label_new(_("Foreground color")); + back_label = gtk_label_new(_("Background color")); + curs_label = gtk_label_new(_("Cursor color")); + fore_button = gtk_color_button_new_with_rgba(&sakura.forecolors[sk_tab->colorset]); + back_button = gtk_color_button_new_with_rgba(&sakura.backcolors[sk_tab->colorset]); + curs_button = gtk_color_button_new_with_rgba(&sakura.curscolors[sk_tab->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, 100.0, 1.0, 5.0, 0); - opacity_spin = gtk_spin_button_new(GTK_ADJUSTMENT(spinner_adj), 1.0, 0); + opacity_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + spin_adj = gtk_adjustment_new ((sakura.backcolors[sk_tab->colorset].alpha)*100, 0.0, 100.0, 1.0, 5.0, 0); + opacity_spin = gtk_spin_button_new(GTK_ADJUSTMENT(spin_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); + /* Palette combobox */ + palette_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + palette_label = gtk_label_new(_("Palette")); + palette_combo = gtk_combo_box_text_new(); + for (i=0; i < sizeof(&palettes_names)-1; i++) { + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(palette_combo), NULL, palettes_names[i]); + } + gtk_combo_box_set_active(GTK_COMBO_BOX(palette_combo), sakura.palette_idx); + + /* Bold is bright checkbutton */ + bib_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + bib_checkbutton = gtk_check_button_new_with_label(_("Use bright colors for bold text")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bib_checkbutton), sakura.bold_is_bright); + + gtk_box_pack_start(GTK_BOX(cs_hbox), cs_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(cs_hbox), cs_combo, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(scheme_hbox), scheme_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(scheme_hbox), scheme_combo, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(fore_hbox), fore_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(fore_hbox), fore_button, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(back_hbox), back_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(back_hbox), back_button, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(curs_hbox), curs_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(curs_hbox), curs_button, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(opacity_hbox), opacity_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(opacity_hbox), opacity_spin, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(palette_hbox), palette_label, FALSE, FALSE, 12); + gtk_box_pack_end(GTK_BOX(palette_hbox), palette_combo, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(bib_hbox), bib_checkbutton, FALSE, FALSE, 12); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), cs_hbox, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), scheme_hbox, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), fore_hbox, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), back_hbox, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), curs_hbox, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), opacity_hbox, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), palette_hbox, FALSE, FALSE, 6); + gtk_box_pack_end(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(color_dialog))), bib_hbox, 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); + /* When the user switches the colorset, callback needs access to these selector widgets */ + g_object_set_data(G_OBJECT(color_dialog), "cs_combo", cs_combo); + g_object_set_data(G_OBJECT(color_dialog), "scheme_combo", scheme_combo); + g_object_set_data(G_OBJECT(color_dialog), "fore_button", fore_button); + g_object_set_data(G_OBJECT(color_dialog), "back_button", back_button); + g_object_set_data(G_OBJECT(color_dialog), "curs_button", curs_button); 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_object_set_data(G_OBJECT(color_dialog), "bib_checkbutton", bib_checkbutton); - 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 ); + g_signal_connect(G_OBJECT(cs_combo), "changed", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); + g_signal_connect(G_OBJECT(scheme_combo), "changed", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); + g_signal_connect(G_OBJECT(fore_button), "color-set", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); + g_signal_connect(G_OBJECT(back_button), "color-set", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); + g_signal_connect(G_OBJECT(curs_button), "color-set", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); + g_signal_connect(G_OBJECT(opacity_spin), "changed", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); + g_signal_connect(G_OBJECT(bib_checkbutton), "toggled", G_CALLBACK(sakura_color_dialog_changed_cb), 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); -} + sprintf(name, "colorset%d_scheme", i+1); + sakura_set_config_integer(name, sakura.schemes[i]); + } -static void -sakura_search_dialog (GtkWidget *widget, void *data) -{ - GtkWidget *title_dialog, *title_header; - GtkWidget *entry, *label; - GtkWidget *title_hbox; - gint response; + /* Set the current tab's colorset to the last selected one in the dialog. + * This is probably what the new user expects, and the experienced user hopefully will not mind. */ + sk_tab->colorset = gtk_combo_box_get_active(GTK_COMBO_BOX(cs_combo)); + sakura_set_config_integer("last_colorset", sk_tab->colorset+1); - 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); + /* Set the selected palette */ + guint palette_idx = gtk_combo_box_get_active(GTK_COMBO_BOX(palette_combo)); + sakura.palette = palettes[palette_idx]; + sakura.palette_idx = palette_idx; + sakura_set_config_integer("palette", sakura.palette_idx); - /* 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 bold is bright option */ + sakura_set_config_boolean("bold_is_bright", sakura.bold_is_bright); - 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) { - sakura_search(gtk_entry_get_text(GTK_ENTRY(entry)), 0); + /* Apply the new colorsets to all tabs */ + sakura_set_colors(); } - gtk_widget_destroy(title_dialog); + + gtk_widget_destroy(color_dialog); } +#if 0 static void sakura_set_title_dialog (GtkWidget *widget, void *data) { @@ -1406,7 +1474,7 @@ GtkWidget *title_hbox; gint response; - title_dialog=gtk_dialog_new_with_buttons(_("Set window title"), + 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, @@ -1427,7 +1495,7 @@ 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); @@ -1436,16 +1504,16 @@ response=gtk_dialog_run(GTK_DIALOG(title_dialog)); if (response==GTK_RESPONSE_ACCEPT) { - /* Bug #257391 shadow reachs here too... */ + /* Bug #257391 shadow reaches here too... */ gtk_window_set_title(GTK_WINDOW(sakura.main_window), gtk_entry_get_text(GTK_ENTRY(entry))); } gtk_widget_destroy(title_dialog); } - +#endif static void -sakura_copy_url (GtkWidget *widget, void *data) +sakura_copy_url_cb (GtkWidget *widget, void *data) { GtkClipboard* clip; @@ -1458,34 +1526,35 @@ static void -sakura_open_url (GtkWidget *widget, void *data) +sakura_open_url_cb (GtkWidget *widget, void *data) { GError *error=NULL; gchar *browser=NULL; SAY("Opening %s", sakura.current_match); - browser=g_strdup(g_getenv("BROWSER")); + 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"); + sakura_error("Browser not found"); } } - 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); - } + if (browser) { + 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); + g_free(browser); + } } static void -sakura_open_mail (GtkWidget *widget, void *data) +sakura_open_mail_cb (GtkWidget *widget, void *data) { GError *error = NULL; gchar *program = NULL; @@ -1501,7 +1570,7 @@ static void -sakura_show_first_tab (GtkWidget *widget, void *data) +sakura_show_first_tab_cb (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); @@ -1520,7 +1589,7 @@ static void -sakura_tabs_on_bottom (GtkWidget *widget, void *data) +sakura_tabs_on_bottom_cb (GtkWidget *widget, void *data) { if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { @@ -1534,20 +1603,20 @@ static void -sakura_less_questions (GtkWidget *widget, void *data) +sakura_less_questions_cb (GtkWidget *widget, void *data) { if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { - sakura.less_questions=TRUE; + sakura.less_questions = TRUE; sakura_set_config_boolean("less_questions", TRUE); } else { - sakura.less_questions=FALSE; + sakura.less_questions = FALSE; sakura_set_config_boolean("less_questions", FALSE); } } static void -sakura_show_close_button (GtkWidget *widget, void *data) +sakura_show_close_button_cb (GtkWidget *widget, void *data) { if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { sakura_set_config_boolean("closebutton", TRUE); @@ -1558,41 +1627,14 @@ static void -sakura_show_scrollbar (GtkWidget *widget, void *data) +sakura_show_scrollbar_cb (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(); + sakura_show_scrollbar(); } static void -sakura_urgent_bell (GtkWidget *widget, void *data) +sakura_urgent_bell_cb (GtkWidget *widget, void *data) { sakura.urgent_bell = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)); if (sakura.urgent_bell) { @@ -1604,38 +1646,38 @@ static void -sakura_audible_bell (GtkWidget *widget, void *data) +sakura_audible_bell_cb (GtkWidget *widget, void *data) { gint page; - struct terminal *term; + struct sakura_tab *sk_tab; page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(sakura, page); if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { - vte_terminal_set_audible_bell (VTE_TERMINAL(term->vte), TRUE); + vte_terminal_set_audible_bell (VTE_TERMINAL(sk_tab->vte), TRUE); sakura_set_config_string("audible_bell", "Yes"); } else { - vte_terminal_set_audible_bell (VTE_TERMINAL(term->vte), FALSE); + vte_terminal_set_audible_bell (VTE_TERMINAL(sk_tab->vte), FALSE); sakura_set_config_string("audible_bell", "No"); } } static void -sakura_blinking_cursor (GtkWidget *widget, void *data) +sakura_blinking_cursor_cb (GtkWidget *widget, void *data) { gint page; - struct terminal *term; + struct sakura_tab *sk_tab; page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(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); + vte_terminal_set_cursor_blink_mode (VTE_TERMINAL(sk_tab->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); + vte_terminal_set_cursor_blink_mode (VTE_TERMINAL(sk_tab->vte), VTE_CURSOR_BLINK_OFF); sakura_set_config_string("blinking_cursor", "No"); } } @@ -1643,27 +1685,13 @@ static void -sakura_stop_tab_cycling_at_end_tabs (GtkWidget *widget, void *data) +sakura_set_cursor_cb (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; + struct sakura_tab *sk_tab; int n_pages, i; char *cursor_string = (char *)data; - n_pages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { @@ -1673,11 +1701,11 @@ 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); + sk_tab = sakura_get_sktab(sakura, i); + vte_terminal_set_cursor_shape(VTE_TERMINAL(sk_tab->vte), sakura.cursor_type); } sakura_set_config_integer("cursor_type", sakura.cursor_type); @@ -1686,39 +1714,7 @@ 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 { - /* FIXME: Use a light background */ - sakura.palette=solarized_dark_palette; - //sakura.palette=solarized_light_palette; - } - - /* Palette changed so we ¿need? to set colors again */ - sakura_set_colors(); - - sakura_set_config_string("palette", palette); - } -} - - -static void -sakura_setname_entry_changed (GtkWidget *widget, void *data) +sakura_setname_entry_changed_cb (GtkWidget *widget, void *data) { GtkDialog *title_dialog=(GtkDialog *)data; @@ -1732,95 +1728,54 @@ /* Parameters are never used */ static void -sakura_copy (GtkWidget *widget, void *data) +sakura_copy_cb (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); + sakura_copy(); } /* Parameters are never used */ static void -sakura_paste (GtkWidget *widget, void *data) +sakura_paste_cb (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)); + sakura_paste(); } static void -sakura_new_tab (GtkWidget *widget, void *data) +sakura_new_tab_cb (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); +static void +sakura_close_tab_cb (GtkWidget *widget, void *data) +{ + gint page; - if (response==GTK_RESPONSE_YES) { - sakura_del_tab(page); - } - } else - sakura_del_tab(page); + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); - if (npages==0) - sakura_destroy(); + sakura_close_tab(page); } + static void -sakura_fullscreen (GtkWidget *widget, void *data) +sakura_fullscreen_cb (GtkWidget *widget, void *data) { - if (sakura.fullscreen!=TRUE) { - sakura.fullscreen=TRUE; + 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; + sakura.fullscreen = FALSE; } } static void -sakura_disable_numbered_tabswitch(GtkWidget *widget, void *data) +sakura_disable_numbered_tabswitch_cb (GtkWidget *widget, void *data) { if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { sakura.disable_numbered_tabswitch = true; @@ -1832,8 +1787,9 @@ } +#if 0 static void -sakura_use_fading(GtkWidget *widget, void *data) +sakura_use_fading_cb (GtkWidget *widget, void *data) { if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { sakura.use_fading = true; @@ -1841,10 +1797,9 @@ } else { sakura.use_fading = false; sakura_set_config_boolean("use_fading", FALSE); - sakura_fade_in(); - sakura_set_colors(); } } +#endif /**************************/ @@ -1854,44 +1809,45 @@ static void sakura_init() { + GError *gerror=NULL; char* configdir = NULL; int i; term_data_id = g_quark_from_static_string("sakura_term"); - /* Config file initialization*/ + /*** 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) ) + 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) ) + 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); + 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); + 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 (!g_key_file_load_from_file(sakura.cfg, sakura.configfile, 0, &gerror)) { /* 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); + if (gerror->code==G_KEY_FILE_ERROR_UNKNOWN_ENCODING || gerror->code==G_KEY_FILE_ERROR_INVALID_VALUE) { + g_error_free(gerror); 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); - + g_signal_connect(G_OBJECT(mon_cfgfile), "changed", G_CALLBACK(sakura_conf_changed_cb), NULL); + gchar *cfgtmp = NULL; /* We can safely ignore errors from g_key_file_get_value(), since if the @@ -1901,8 +1857,8 @@ * doesn't exist, but we have just read it! */ - for( i=0; icode == G_KEY_FILE_ERROR_INVALID_VALUE) { + sakura.palette_idx = DEFAULT_PALETTE; + sakura_set_config_integer("palette", DEFAULT_PALETTE); + g_error_free(gerror); } - g_free(cfgtmp); + sakura.palette = palettes[sakura.palette_idx]; if (!g_key_file_has_key(sakura.cfg, cfg_group, "add_tab_accelerator", NULL)) { sakura_set_config_integer("add_tab_accelerator", DEFAULT_ADD_TAB_ACCELERATOR); @@ -2148,7 +2099,7 @@ sakura_set_keybind("search_key", DEFAULT_SEARCH_KEY); } sakura.search_key = sakura_get_keybind("search_key"); - + if (!g_key_file_has_key(sakura.cfg, cfg_group, "increase_font_size_key", NULL)) { sakura_set_keybind("increase_font_size_key", DEFAULT_INCREASE_FONT_SIZE_KEY); } @@ -2174,55 +2125,79 @@ } sakura.icon = g_key_file_get_string(sakura.cfg, cfg_group, "icon_file", NULL); - /* set default title pattern from config or NULL */ + if (!g_key_file_has_key(sakura.cfg, cfg_group, "paste_button", NULL)) { + sakura_set_config_integer("paste_button", DEFAULT_PASTE_BUTTON); + } + sakura.paste_button = g_key_file_get_integer(sakura.cfg, cfg_group, "paste_button", NULL); + + if (!g_key_file_has_key(sakura.cfg, cfg_group, "menu_button", NULL)) { + sakura_set_config_integer("menu_button", DEFAULT_MENU_BUTTON); + } + sakura.menu_button = g_key_file_get_integer(sakura.cfg, cfg_group, "menu_button", NULL); + + /* NULL if not found. Don't add a new one */ sakura.tab_default_title = g_key_file_get_string(sakura.cfg, cfg_group, "tab_default_title", NULL); + sakura.dont_save = g_key_file_get_boolean(sakura.cfg, cfg_group, "dont_save", NULL); + + /*** Sakura window initialization ***/ + /* Use always GTK header bar*/ g_object_set(gtk_settings_get_default(), "gtk-dialogs-use-header", TRUE, NULL); - sakura.main_window=gtk_window_new(GTK_WINDOW_TOPLEVEL); + /* Create our windows */ + sakura.main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(sakura.main_window), "sakura"); - - /* Add CSS style for sakura */ - sakura.provider = gtk_css_provider_new(); - GdkScreen *screen2 = gtk_widget_get_screen (GTK_WIDGET (sakura.main_window)); - gtk_css_provider_load_from_data(sakura.provider, SAKURA_CSS, -1, NULL); - gtk_style_context_add_provider_for_screen (screen2, GTK_STYLE_PROVIDER (sakura.provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + + sakura.fade_window = gtk_window_new(GTK_WINDOW_POPUP); + gtk_widget_set_name(sakura.fade_window, "fade_window"); + gtk_window_set_position(GTK_WINDOW(sakura.fade_window), GTK_WIN_POS_NONE); + gtk_widget_set_opacity(sakura.fade_window, FADE_WINDOW_OPACITY); + gtk_window_set_transient_for(GTK_WINDOW(sakura.fade_window), GTK_WINDOW(sakura.main_window)); + + /* Add CSS styles for main and fade window*/ + GtkCssProvider *provider = gtk_css_provider_new(); + GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(sakura.main_window)); + gtk_css_provider_load_from_data(provider, SAKURA_CSS, -1, NULL); + gtk_style_context_add_provider_for_screen(screen, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref(provider); + + provider = gtk_css_provider_new(); + screen = gtk_widget_get_screen(GTK_WIDGET(sakura.fade_window)); + gtk_css_provider_load_from_data(provider, FADE_WINDOW_CSS, -1, NULL); + gtk_style_context_add_provider_for_screen(screen, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref(provider); /* Default terminal size*/ sakura.columns = DEFAULT_COLUMNS; sakura.rows = DEFAULT_ROWS; /* Create notebook and set style */ - sakura.notebook=gtk_notebook_new(); + sakura.notebook = gtk_notebook_new(); gtk_notebook_set_scrollable((GtkNotebook*)sakura.notebook, sakura.scrollable_tabs); /* Adding mask, for handle scroll events */ gtk_widget_add_events(sakura.notebook, GDK_SCROLL_MASK); - - /* Figure out if we have rgba capabilities. FIXME: Is this really needed? */ - GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (sakura.main_window)); + + /* Figure out if we have rgba capabilities. Without this transparency won't work as expected */ + screen = gtk_widget_get_screen (GTK_WIDGET (sakura.main_window)); GdkVisual *visual = gdk_screen_get_rgba_visual (screen); if (visual != NULL && gdk_screen_is_composited (screen)) { gtk_widget_set_visual (GTK_WIDGET (sakura.main_window), visual); } - - /* Command line options initialization */ + + /*** Command line options initialization ***/ /* Set argv for forked childs. Real argv vector starts at argv[1] because we're using G_SPAWN_FILE_AND_ARGV_ZERO to be able to launch login shells */ - sakura.argv[0]=g_strdup(g_getenv("SHELL")); + sakura.argv[0] = g_strdup(g_getenv("SHELL")); if (option_login) { - sakura.argv[1]=g_strdup_printf("-%s", g_getenv("SHELL")); + sakura.argv[1] = g_strdup_printf("-%s", g_getenv("SHELL")); } else { - sakura.argv[1]=g_strdup(g_getenv("SHELL")); + sakura.argv[1] = g_strdup(g_getenv("SHELL")); } sakura.argv[2]=NULL; - if (option_title) { - gtk_window_set_title(GTK_WINDOW(sakura.main_window), option_title); - } - if (option_columns) { sakura.columns = option_columns; } @@ -2232,68 +2207,59 @@ } /* Add datadir path to icon name and set icon */ - gchar *icon_path; error=NULL; + gchar *icon_path; gerror=NULL; if (option_icon) { icon_path = g_strdup_printf("%s", option_icon); } else { icon_path = g_strdup_printf(DATADIR "/pixmaps/%s", sakura.icon); } - gtk_window_set_icon_from_file(GTK_WINDOW(sakura.main_window), icon_path, &error); + gtk_window_set_icon_from_file(GTK_WINDOW(sakura.main_window), icon_path, &gerror); g_free(icon_path); icon_path=NULL; - if (error) g_error_free(error); + if (gerror) g_error_free(gerror); if (option_font) { sakura.font=pango_font_description_from_string(option_font); } if (option_colorset && option_colorset>0 && option_colorset <= NUM_COLORSETS) { - sakura.last_colorset=option_colorset; + sakura.last_colorset = option_colorset; } /* These options are exclusive */ if (option_fullscreen) { - sakura_fullscreen(NULL, NULL); + sakura_fullscreen_cb(NULL, NULL); } else if (option_maximize) { gtk_window_maximize(GTK_WINDOW(sakura.main_window)); } - sakura.fullscreen=FALSE; - sakura.resized=FALSE; - sakura.keep_fc=false; - sakura.externally_modified=false; + sakura.fullscreen = FALSE; + sakura.resized = FALSE; + sakura.externally_modified = false; - error=NULL; - sakura.http_vteregexp=vte_regex_new_for_match(HTTP_REGEXP, strlen(HTTP_REGEXP), 0, &error); + gerror = NULL; + sakura.http_vteregexp = vte_regex_new_for_match(HTTP_REGEXP, strlen(HTTP_REGEXP), 0, &gerror); if (!sakura.http_vteregexp) { - SAY("http_regexp: %s", error->message); - g_error_free(error); + SAY("http_regexp: %s", gerror->message); + g_error_free(gerror); } - error=NULL; - sakura.mail_vteregexp=vte_regex_new_for_match(MAIL_REGEXP, strlen(MAIL_REGEXP), 0, &error); + gerror=NULL; + sakura.mail_vteregexp = vte_regex_new_for_match(MAIL_REGEXP, strlen(MAIL_REGEXP), 0, &gerror); if (!sakura.mail_vteregexp) { - SAY("mail_regexp: %s", error->message); - g_error_free(error); + SAY("mail_regexp: %s", gerror->message); + g_error_free(gerror); } 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_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); + g_signal_connect(G_OBJECT(sakura.main_window), "delete_event", G_CALLBACK(sakura_delete_event_cb), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "destroy", G_CALLBACK(sakura_destroy_window_cb), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "key-press-event", G_CALLBACK(sakura_key_press_cb), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "configure-event", G_CALLBACK(sakura_resized_window_cb), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "focus-out-event", G_CALLBACK(sakura_focus_out_cb), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "focus-in-event", G_CALLBACK(sakura_focus_in_cb), NULL); + g_signal_connect(G_OBJECT(sakura.main_window), "show", G_CALLBACK(sakura_show_event_cb), NULL); } @@ -2301,62 +2267,45 @@ 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_paste, *item_fullscreen, *item_select_font, *item_select_colors, *item_toggle_scrollbar, *item_options, - *item_show_first_tab, *item_urgent_bell, *item_audible_bell, - *item_blinking_cursor, *item_other_options, + *item_show_first_tab, *item_urgent_bell, *item_audible_bell, *item_blinking_cursor, *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; + *item_disable_numbered_tabswitch; // *item_use_fading; + GtkWidget *options_menu, *cursor_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(_("Less questions at exit time")); - 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_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"); + 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_options = gtk_menu_item_new_with_label(_("Options")); + + item_select_font = gtk_menu_item_new_with_label(_("Select font...")); + item_select_colors = gtk_menu_item_new_with_label(_("Select colors...")); + 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(_("Less questions at exit time")); + 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_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")); /* Show defaults in menu items */ - gchar *cfgtmp = NULL; - - if (sakura.first_tab) { + 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); @@ -2392,11 +2341,11 @@ 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.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); @@ -2410,11 +2359,7 @@ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_blinking_cursor), 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){ + switch (sakura.cursor_type) { case VTE_CURSOR_SHAPE_BLOCK: gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item_cursor_block), TRUE); break; @@ -2425,28 +2370,9 @@ 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.open_link_separator = gtk_separator_menu_item_new(); - sakura.menu=gtk_menu_new(); - //sakura.labels_menu=gtk_menu_new(); + sakura.menu = gtk_menu_new(); /* Add items to popup menu */ gtk_menu_shell_append(GTK_MENU_SHELL(sakura.menu), sakura.item_open_mail); @@ -2464,83 +2390,58 @@ 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(); + options_menu = gtk_menu_new(); + cursor_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_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(options_menu), item_show_first_tab); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_tabs_on_bottom); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_show_close_button); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), gtk_separator_menu_item_new()); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_toggle_scrollbar); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_less_questions); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_urgent_bell); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_audible_bell); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_disable_numbered_tabswitch); + //gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_use_fading); + gtk_menu_shell_append(GTK_MENU_SHELL(options_menu), item_blinking_cursor); + gtk_menu_shell_append(GTK_MENU_SHELL(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_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); + g_signal_connect(G_OBJECT(item_new_tab), "activate", G_CALLBACK(sakura_new_tab_cb), NULL); + g_signal_connect(G_OBJECT(item_set_name), "activate", G_CALLBACK(sakura_set_name_dialog_cb), NULL); + g_signal_connect(G_OBJECT(item_close_tab), "activate", G_CALLBACK(sakura_close_tab_cb), NULL); + g_signal_connect(G_OBJECT(item_select_font), "activate", G_CALLBACK(sakura_font_dialog_cb), NULL); + g_signal_connect(G_OBJECT(item_copy), "activate", G_CALLBACK(sakura_copy_cb), NULL); + g_signal_connect(G_OBJECT(item_paste), "activate", G_CALLBACK(sakura_paste_cb), NULL); + g_signal_connect(G_OBJECT(item_select_colors), "activate", G_CALLBACK(sakura_color_dialog_cb), NULL); + + g_signal_connect(G_OBJECT(item_show_first_tab), "activate", G_CALLBACK(sakura_show_first_tab_cb), NULL); + g_signal_connect(G_OBJECT(item_tabs_on_bottom), "activate", G_CALLBACK(sakura_tabs_on_bottom_cb), NULL); + g_signal_connect(G_OBJECT(item_less_questions), "activate", G_CALLBACK(sakura_less_questions_cb), NULL); + g_signal_connect(G_OBJECT(item_show_close_button), "activate", G_CALLBACK(sakura_show_close_button_cb), NULL); + g_signal_connect(G_OBJECT(item_toggle_scrollbar), "activate", G_CALLBACK(sakura_show_scrollbar_cb), NULL); + g_signal_connect(G_OBJECT(item_urgent_bell), "activate", G_CALLBACK(sakura_urgent_bell_cb), NULL); + g_signal_connect(G_OBJECT(item_audible_bell), "activate", G_CALLBACK(sakura_audible_bell_cb), NULL); + g_signal_connect(G_OBJECT(item_blinking_cursor), "activate", G_CALLBACK(sakura_blinking_cursor_cb), NULL); + g_signal_connect(G_OBJECT(item_disable_numbered_tabswitch), "activate", G_CALLBACK(sakura_disable_numbered_tabswitch_cb), NULL); + //g_signal_connect(G_OBJECT(item_use_fading), "activate", G_CALLBACK(sakura_use_fading_cb), NULL); + g_signal_connect(G_OBJECT(item_cursor_block), "activate", G_CALLBACK(sakura_set_cursor_cb), "block"); + g_signal_connect(G_OBJECT(item_cursor_underline), "activate", G_CALLBACK(sakura_set_cursor_cb), "underline"); + g_signal_connect(G_OBJECT(item_cursor_ibeam), "activate", G_CALLBACK(sakura_set_cursor_cb), "ibeam"); + + g_signal_connect(G_OBJECT(sakura.item_open_mail), "activate", G_CALLBACK(sakura_open_mail_cb), NULL); + g_signal_connect(G_OBJECT(sakura.item_open_link), "activate", G_CALLBACK(sakura_open_url_cb), NULL); + g_signal_connect(G_OBJECT(sakura.item_copy_link), "activate", G_CALLBACK(sakura_copy_url_cb), NULL); + g_signal_connect(G_OBJECT(item_fullscreen), "activate", G_CALLBACK(sakura_fullscreen_cb), NULL); gtk_widget_show_all(sakura.menu); @@ -2550,8 +2451,6 @@ 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); @@ -2568,18 +2467,60 @@ } +static void +sakura_search_dialog () +{ + 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); + + 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_cb), 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) { + sakura_search(gtk_entry_get_text(GTK_ENTRY(entry)), 0); + } + gtk_widget_destroy(title_dialog); +} + + void sakura_search (const char *pattern, bool reverse) { GError *error=NULL; VteRegex *regex; gint page; - struct terminal *term; - + struct sakura_tab *sk_tab; + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(sakura, page); - vte_terminal_search_set_wrap_around(VTE_TERMINAL(term->vte), TRUE); + vte_terminal_search_set_wrap_around(VTE_TERMINAL(sk_tab->vte), TRUE); regex=vte_regex_new_for_search(pattern, (gssize) strlen(pattern), PCRE2_MULTILINE|PCRE2_CASELESS, &error); if (!regex) { /* Ubuntu-fucking-morons (17.10/18.04/18.10) package a broken VTE without PCRE2, and search fails */ @@ -2587,11 +2528,11 @@ sakura_error(error->message); g_error_free(error); } else { - vte_terminal_search_set_regex(VTE_TERMINAL(term->vte), regex, 0); + vte_terminal_search_set_regex(VTE_TERMINAL(sk_tab->vte), regex, 0); - if (!vte_terminal_search_find_next(VTE_TERMINAL(term->vte))) { - vte_terminal_unselect_all(VTE_TERMINAL(term->vte)); - vte_terminal_search_find_next(VTE_TERMINAL(term->vte)); + if (!vte_terminal_search_find_next(VTE_TERMINAL(sk_tab->vte))) { + vte_terminal_unselect_all(VTE_TERMINAL(sk_tab->vte)); + vte_terminal_search_find_next(VTE_TERMINAL(sk_tab->vte)); } if (regex) vte_regex_unref(regex); @@ -2600,9 +2541,68 @@ static void -sakura_set_size(void) +sakura_copy () +{ + gint page; + struct sakura_tab *sk_tab; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + sk_tab = sakura_get_sktab(sakura, page); + + if (vte_terminal_get_has_selection(VTE_TERMINAL(sk_tab->vte))) { + vte_terminal_copy_clipboard_format(VTE_TERMINAL(sk_tab->vte), VTE_FORMAT_TEXT); + } +} + + +static void +sakura_paste () +{ + gint page; + struct sakura_tab *sk_tab; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + sk_tab = sakura_get_sktab(sakura, page); + + vte_terminal_paste_clipboard(VTE_TERMINAL(sk_tab->vte)); +} + + +static void +sakura_show_scrollbar (void) +{ + gint page, n_pages; + struct sakura_tab *sk_tab; + int i; + + n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); + sk_tab = sakura_get_sktab(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--) { + sk_tab = sakura_get_sktab(sakura, i); + if (!sakura.show_scrollbar) + gtk_widget_hide(sk_tab->scrollbar); + else + gtk_widget_show(sk_tab->scrollbar); + } + sakura_set_size(); +} + + +static void +sakura_set_size (void) { - struct terminal *term; + struct sakura_tab *sk_tab; gint pad_x, pad_y; gint char_width, char_height; guint npages; @@ -2610,25 +2610,25 @@ gint page; - term = sakura_get_page_term(sakura, 0); + sk_tab = sakura_get_sktab(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)); + sakura.columns = vte_terminal_get_column_count(VTE_TERMINAL(sk_tab->vte)); + sakura.rows = vte_terminal_get_row_count(VTE_TERMINAL(sk_tab->vte)); SAY("New columns %ld and rows %ld", sakura.columns, sakura.rows); - sakura.resized=FALSE; + 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; + gtk_style_context_get_padding(gtk_widget_get_style_context(sk_tab->vte), + gtk_widget_get_state_flags(sk_tab->vte), + &sk_tab->padding); + pad_x = sk_tab->padding.left + sk_tab->padding.right; + pad_y = sk_tab->padding.top + sk_tab->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)); + char_width = vte_terminal_get_char_width(VTE_TERMINAL(sk_tab->vte)); + char_height = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)); sakura.width = pad_x + (char_width * sakura.columns); sakura.height = pad_y + (char_height * sakura.rows); @@ -2636,7 +2636,7 @@ 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) + if (!sakura.show_scrollbar) //sakura.height += min_height - 10; sakura.height += 10; else @@ -2648,19 +2648,19 @@ } page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(sakura, page); - gtk_widget_get_preferred_width(term->scrollbar, &min_width, &natural_width); + gtk_widget_get_preferred_width(sk_tab->scrollbar, &min_width, &natural_width); //SAY("SCROLLBAR min width %d natural width %d", min_width, natural_width); - if(sakura.show_scrollbar) { + 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) { + if (gdk_window != NULL) { + if (gdk_window_get_state(gdk_window) & GDK_WINDOW_STATE_MAXIMIZED) { SAY("window is maximized, will not resize"); return; } @@ -2675,117 +2675,66 @@ sakura_set_font() { gint n_pages; - struct terminal *term; + struct sakura_tab *sk_tab; 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); + sk_tab = sakura_get_sktab(sakura, i); + vte_terminal_set_font(VTE_TERMINAL(sk_tab->vte), sakura.font); } } - -static void +/* Set colorset when colosert keybinding is used */ +static void sakura_set_colorset (int cs) { gint page; - struct terminal *term; + struct sakura_tab *sk_tab; - if (cs<0 || cs>= NUM_COLORSETS) + 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; + sk_tab = sakura_get_sktab(sakura, page); + sk_tab->colorset = cs; - sakura_set_config_integer("last_colorset", term->colorset+1); + sakura_set_config_integer("last_colorset", sk_tab->colorset+1); sakura_set_colors(); } /* Set the terminal colors for all notebook tabs */ -static void +static void sakura_set_colors () { int i; int n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); - struct terminal *term; + struct sakura_tab *sk_tab; for (i = (n_pages - 1); i >= 0; i--) { - term = sakura_get_page_term(sakura, i); + sk_tab = sakura_get_sktab(sakura, i); /* Set fore, back, cursor color and palette for the terminal's colorset */ - vte_terminal_set_colors(VTE_TERMINAL(term->vte), - &sakura.forecolors[term->colorset], - &sakura.backcolors[term->colorset], + vte_terminal_set_colors(VTE_TERMINAL(sk_tab->vte), + &sakura.forecolors[sk_tab->colorset], + &sakura.backcolors[sk_tab->colorset], sakura.palette, PALETTE_SIZE); - vte_terminal_set_color_cursor(VTE_TERMINAL(term->vte), &sakura.curscolors[term->colorset]); + vte_terminal_set_color_cursor(VTE_TERMINAL(sk_tab->vte), &sakura.curscolors[sk_tab->colorset]); /* Use background color to make text visible when the cursor is over it */ - vte_terminal_set_color_cursor_foreground(VTE_TERMINAL(term->vte), &sakura.backcolors[term->colorset]); - } - - /* Bug #1485360: bright colors broken */ - if (option_boldisbright) { - vte_terminal_set_bold_is_bright(VTE_TERMINAL(term->vte), true); - } - - /* Main window opacity must be set. Otherwise vte widget will remain opaque */ - gtk_widget_set_opacity(sakura.main_window, sakura.backcolors[term->colorset].alpha); - -} - - -static void -sakura_fade_out() -{ - gint page; - struct terminal *term; + vte_terminal_set_color_cursor_foreground(VTE_TERMINAL(sk_tab->vte), &sakura.backcolors[sk_tab->colorset]); - page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - term = sakura_get_page_term(sakura, page); + vte_terminal_set_bold_is_bright(VTE_TERMINAL(sk_tab->vte), sakura.bold_is_bright); - if (!sakura.faded) { - sakura.faded = true; - GdkRGBA x = sakura.forecolors[term->colorset]; - 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); + /* Main window opacity must be set. Otherwise vte widget will remain opaque */ + gtk_widget_set_opacity(sakura.main_window, sakura.backcolors[sk_tab->colorset].alpha); - 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"); - } - } } @@ -2796,14 +2745,14 @@ 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); + 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) + if (direction == FORWARD) { + if (page != n_pages-1) gtk_notebook_reorder_child(GTK_NOTEBOOK(sakura.notebook), child, page+1); } else { - if (page!=0) + if (page != 0) gtk_notebook_reorder_child(GTK_NOTEBOOK(sakura.notebook), child, page-1); } } @@ -2814,16 +2763,16 @@ sakura_find_tab(VteTerminal *vte_term) { gint matched_page, page, n_pages; - struct terminal *term; + struct sakura_tab *sk_tab; 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) { + sk_tab = sakura_get_sktab(sakura, page); + if ((VteTerminal *)sk_tab->vte == vte_term) { matched_page=page; } page++; @@ -2836,26 +2785,26 @@ static void sakura_set_tab_label_text(const gchar *title, gint page) { - struct terminal *term; + struct sakura_tab *sk_tab; gchar *chopped_title; gchar *default_label_text; - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(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); + if ((title != NULL) && (g_strcmp0(title, "") != 0)) { + /* Chop to max size */ + 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); + gtk_label_set_text(GTK_LABEL(sk_tab->label), chopped_title); free(chopped_title); } else { /* Use the default values */ - default_label_text=g_strdup_printf(_("Terminal %d"), page); - gtk_label_set_text(GTK_LABEL(term->label), default_label_text); + default_label_text = g_strdup_printf(_("Terminal %d"), page); + gtk_label_set_text(GTK_LABEL(sk_tab->label), default_label_text); free(default_label_text); } } @@ -2865,12 +2814,12 @@ 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 */ + struct sakura_tab *sk_tab = (struct sakura_tab *) user_data; + + if (pid == -1) { /* Fork has failed */ SAY("Error: %s", error->message); } else { - term->pid=pid; + sk_tab->pid=pid; } } @@ -2878,98 +2827,103 @@ static void sakura_add_tab() { - struct terminal *term; - GtkWidget *tab_label_hbox; - GtkWidget *close_button; - int index; - int npages; - gchar *cwd = NULL; - gchar *default_label_text = NULL; + struct sakura_tab *sk_tab; + GtkWidget *tab_title_hbox; GtkWidget *close_button; /* We could put them inside struct sakura_tab, but it is not necessary */ + GtkWidget *event_box; + int index; int npages; + gchar *cwd = NULL; gchar *default_label_text = NULL; + + sk_tab = g_new0( struct sakura_tab, 1 ); + + /* Create the tab label */ + sk_tab->label = gtk_label_new(NULL); + gtk_label_set_ellipsize(GTK_LABEL(sk_tab->label), PANGO_ELLIPSIZE_END); + + /* Create hbox for our label & button */ + tab_title_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2); + gtk_widget_set_hexpand(tab_title_hbox, TRUE); + + /* Label widgets has no window associated, so we need an event box to catch click events */ + event_box = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(event_box), sk_tab->label); + gtk_widget_set_events(event_box, GDK_BUTTON_PRESS_MASK); - term = g_new0( struct terminal, 1 ); + /* Expand&fill the event_box to get click events all along the tab */ + gtk_box_pack_start(GTK_BOX(tab_title_hbox), event_box, TRUE, TRUE, 0); - term->label=gtk_label_new(NULL); - - 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(); + 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); + 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); + gtk_box_pack_start(GTK_BOX(tab_title_hbox), close_button, FALSE, FALSE, 0); } if (sakura.tabs_on_bottom) { gtk_notebook_set_tab_pos(GTK_NOTEBOOK(sakura.notebook), GTK_POS_BOTTOM); } - gtk_widget_show_all(tab_label_hbox); - + gtk_widget_show_all(tab_title_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); + sk_tab->vte = vte_terminal_new(); + sk_tab->scrollbar = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(sk_tab->vte))); + sk_tab->hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_box_pack_start(GTK_BOX(sk_tab->hbox), sk_tab->vte, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(sk_tab->hbox), sk_tab->scrollbar, FALSE, FALSE, 0); - term->colorset=sakura.last_colorset-1; + sk_tab->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; + /* Use previous terminal (if there is one) cwd and colorset */ + if (index >= 0) { + struct sakura_tab *prev_term; + prev_term = sakura_get_sktab(sakura, index); + cwd = sakura_get_term_cwd(prev_term); /* FIXME: Use current_uri from vte */ + + sk_tab->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) { + if ((index=gtk_notebook_append_page(GTK_NOTEBOOK(sakura.notebook), sk_tab->hbox, tab_title_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); + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(sakura.notebook), sk_tab->hbox, TRUE); - sakura_set_page_term(sakura, index, term ); + sakura_set_sktab(sakura, index, sk_tab ); /* 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); - term->exit_handler_id = 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), "switch-page", G_CALLBACK(sakura_switch_page), NULL); - g_signal_connect(G_OBJECT(sakura.notebook), "page-removed", G_CALLBACK(sakura_page_removed), NULL); + g_signal_connect(G_OBJECT(sk_tab->vte), "bell", G_CALLBACK(sakura_beep_cb), NULL); + g_signal_connect(G_OBJECT(sk_tab->vte), "increase-font-size", G_CALLBACK(sakura_increase_font_cb), NULL); + g_signal_connect(G_OBJECT(sk_tab->vte), "decrease-font-size", G_CALLBACK(sakura_decrease_font_cb), NULL); + sk_tab->exit_handler_id = g_signal_connect(G_OBJECT(sk_tab->vte), "child-exited", G_CALLBACK(sakura_child_exited_cb), NULL); + g_signal_connect(G_OBJECT(sk_tab->vte), "eof", G_CALLBACK(sakura_eof_cb), NULL); + g_signal_connect(G_OBJECT(sk_tab->vte), "window-title-changed", G_CALLBACK(sakura_title_changed_cb), NULL); + g_signal_connect_swapped(G_OBJECT(sk_tab->vte), "button-press-event", G_CALLBACK(sakura_term_buttonpressed_cb), sakura.menu); + g_signal_connect_swapped(G_OBJECT(sk_tab->vte), "button-release-event", G_CALLBACK(sakura_term_buttonreleased_cb), sakura.menu); + + /* Label & button signals */ + /* We need the hbox to know which label/button was clicked */ + g_signal_connect(G_OBJECT(event_box), "button_press_event", G_CALLBACK(sakura_label_clicked_cb), sk_tab->hbox); if (sakura.show_closebutton) { - g_signal_connect(G_OBJECT(close_button), "clicked", G_CALLBACK(sakura_closebutton_clicked), term->hbox); + g_signal_connect(G_OBJECT(close_button), "clicked", G_CALLBACK(sakura_closebutton_clicked_cb), sk_tab->hbox); } /* Since vte-2.91 env is properly overwritten */ - char *command_env[2]={"TERM=xterm-256color",0}; + char *command_env[2] = {"TERM=xterm-256color",0}; + /* First tab */ - npages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + 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); @@ -2978,18 +2932,39 @@ } gtk_notebook_set_show_border(GTK_NOTEBOOK(sakura.notebook), FALSE); + + /* Set geometry hints when the first tab is created */ + GdkGeometry sk_hints; + + sk_hints.base_width = vte_terminal_get_char_width(VTE_TERMINAL(sk_tab->vte)); + sk_hints.base_height = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)); + sk_hints.min_width = vte_terminal_get_char_width(VTE_TERMINAL(sk_tab->vte)) * DEFAULT_MIN_WIDTH_CHARS; + sk_hints.min_height = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)) * DEFAULT_MIN_HEIGHT_CHARS; + sk_hints.width_inc = vte_terminal_get_char_width(VTE_TERMINAL(sk_tab->vte)); + sk_hints.height_inc = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)); + + gtk_window_set_geometry_hints(GTK_WINDOW(sakura.main_window), GTK_WIDGET (sk_tab->vte), &sk_hints, + GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE); + sakura_set_font(); sakura_set_colors(); /* Set size before showing the widgets but after setting the font */ sakura_set_size(); + /* Notebook signals. Per notebook signals only need to be defined once, so we put them here */ + g_signal_connect(sakura.notebook, "scroll-event", G_CALLBACK(sakura_notebook_scroll_cb), NULL); + g_signal_connect(G_OBJECT(sakura.notebook), "switch-page", G_CALLBACK(sakura_switch_page_cb), NULL); + g_signal_connect(G_OBJECT(sakura.notebook), "page-removed", G_CALLBACK(sakura_page_removed_cb), NULL); + g_signal_connect(G_OBJECT(sakura.notebook), "focus-in-event", G_CALLBACK(sakura_notebook_focus_cb), NULL); + gtk_widget_show_all(sakura.notebook); if (!sakura.show_scrollbar) { - gtk_widget_hide(term->scrollbar); + gtk_widget_hide(sk_tab->scrollbar); } gtk_widget_show(sakura.main_window); + sakura_set_colors(); #ifdef GDK_WINDOWING_X11 /* Set WINDOWID env variable */ GdkDisplay *display = gdk_display_get_default(); @@ -3005,88 +2980,49 @@ } #endif - int command_argc=0; char **command_argv; + int command_argc = 0; char **command_argv = NULL; + if (option_execute||option_xterm_execute) { - GError *gerror = NULL; - gchar *path; + char *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); - } - } + sakura_build_command(&command_argc, &command_argv); - /* Check if the command is valid */ + /* If the command is valid, run it */ 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 { + path = g_find_program_in_path(command_argv[0]); + + if (!path) { sakura_error("%s command not found", command_argv[0]); - command_argc=0; - //exit(1); + command_argc = 0; } + vte_terminal_spawn_async(VTE_TERMINAL(sk_tab->vte), VTE_PTY_NO_HELPER, NULL, command_argv, command_env, + G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, -1, NULL, sakura_spawn_callback, sk_tab); + 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) { + + /* 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; + 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); + vte_terminal_spawn_async(VTE_TERMINAL(sk_tab->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, sk_tab); } + /* Not the first tab */ } else { sakura_set_font(); sakura_set_colors(); - gtk_widget_show_all(term->hbox); + gtk_widget_show_all(sk_tab->hbox); if (!sakura.show_scrollbar) { - gtk_widget_hide(term->scrollbar); + gtk_widget_hide(sk_tab->scrollbar); } - if (npages==2) { + if (npages == 2) { gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), TRUE); sakura_set_size(); } @@ -3094,18 +3030,18 @@ * 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); + vte_terminal_spawn_async(VTE_TERMINAL(sk_tab->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, sk_tab); } free(cwd); - /* Appling tab title pattern from config (https://answers.launchpad.net/sakura/+question/267951) */ + /* Applying tab title pattern from config (https://answers.launchpad.net/sakura/+question/267951) */ if (sakura.tab_default_title != NULL) { default_label_text = sakura.tab_default_title; - term->label_set_byuser = true; + sk_tab->label_set_byuser = true; } else { - term->label_set_byuser=false; + sk_tab->label_set_byuser=false; } /* Set the default title text (NULL is valid) */ @@ -3113,21 +3049,54 @@ sakura_set_tab_label_text(default_label_text, page); /* 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_cursor_shape (VTE_TERMINAL(term->vte), sakura.cursor_type); - - //sakura_set_colors(); + vte_terminal_set_scrollback_lines(VTE_TERMINAL(sk_tab->vte), sakura.scroll_lines); + vte_terminal_match_add_regex(VTE_TERMINAL(sk_tab->vte), sakura.http_vteregexp, PCRE2_CASELESS); + vte_terminal_match_add_regex(VTE_TERMINAL(sk_tab->vte), sakura.mail_vteregexp, PCRE2_CASELESS); + vte_terminal_set_mouse_autohide(VTE_TERMINAL(sk_tab->vte), TRUE); + vte_terminal_set_backspace_binding(VTE_TERMINAL(sk_tab->vte), VTE_ERASE_ASCII_DELETE); + vte_terminal_set_word_char_exceptions(VTE_TERMINAL(sk_tab->vte), sakura.word_chars); + vte_terminal_set_audible_bell (VTE_TERMINAL(sk_tab->vte), sakura.audible_bell ? TRUE : FALSE); + vte_terminal_set_cursor_blink_mode (VTE_TERMINAL(sk_tab->vte), sakura.blinking_cursor ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF); + vte_terminal_set_cursor_shape (VTE_TERMINAL(sk_tab->vte), sakura.cursor_type); + +} + + +/* Do all the work necessary before & after deleting the tab passed as a parameter */ +static void +sakura_close_tab (gint page) +{ + gint npages, response; pid_t pgid; + struct sakura_tab *sk_tab; + GtkWidget *dialog; + + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + sk_tab = sakura_get_sktab(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(sk_tab->vte)))); - /* 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; + if ( (pgid != -1) && (pgid != sk_tab->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 /* No processes */ + sakura_del_tab(page); + + /* And destroy sakura if it's the last tab */ + if (npages == 1) + sakura_destroy(); } @@ -3135,32 +3104,31 @@ static void sakura_del_tab(gint page) { - struct terminal *term; + struct sakura_tab *sk_tab; gint npages; - term = sakura_get_page_term(sakura, page); + sk_tab = sakura_get_sktab(sakura, page); npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); /* Do the first tab checks BEFORE deleting the tab, to ensure correct * sizes are calculated when the tab is deleted */ - if ( npages == 2) { + 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); - g_signal_handler_disconnect (term->vte, term->exit_handler_id); + gtk_widget_hide(sk_tab->hbox); + g_signal_handler_disconnect (sk_tab->vte, sk_tab->exit_handler_id); 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); + sk_tab = sakura_get_sktab(sakura, page); + gtk_widget_grab_focus(sk_tab->vte); } } @@ -3172,35 +3140,36 @@ GError *gerror = NULL; gsize len = 0; + /* Don't save config file. Option only available thru the config file for users who know the risks */ + if (sakura.dont_save) + return; + gchar *cfgdata = g_key_file_to_data(sakura.cfg, &len, &gerror); if (!cfgdata) { fprintf(stderr, "%s\n", gerror->message); exit(EXIT_FAILURE); } - bool overwrite=false; + bool overwrite = false; /* If there's been changes by another sakura process, ask whether to overwrite it or not */ /* And if less_questions options is selected don't overwrite */ if (sakura.externally_modified && !sakura.config_modified && !sakura.less_questions) { 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)); + 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 (response == GTK_RESPONSE_YES) + overwrite = true; } - - /* Write to file IF there's been changes of IF we want to overwrite anothe process changes */ + + /* Write to file IF there's been changes of IF we want to overwrite another process changes */ if (sakura.config_modified || overwrite) { GIOChannel *cfgfile = g_io_channel_new_file(sakura.configfile, "w", &gerror); if (!cfgfile) { @@ -3250,33 +3219,82 @@ static void +sakura_build_command(int *command_argc, char ***command_argv) +{ + GError *gerror = NULL; + + 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); + } + } +} + + +static void sakura_set_keybind(const gchar *key, guint value) { char *valname; - valname=gdk_keyval_name(value); + valname = gdk_keyval_name(value); g_key_file_set_string(sakura.cfg, cfg_group, key, valname); - sakura.config_modified=TRUE; - //FIXME: free() valname? -} + sakura.config_modified = TRUE; +} static guint sakura_get_keybind(const gchar *key) { gchar *value; - guint retval=GDK_KEY_VoidSymbol; + 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); + 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); + 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 */ @@ -3284,20 +3302,20 @@ } -/* Retrieve the cwd of the specified term page. +/* Retrieve the cwd of the specified sk_tab 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) +sakura_get_term_cwd(struct sakura_tab* sk_tab) { char *cwd = NULL; - if (term->pid >= 0) { + if (sk_tab->pid >= 0) { char *file, *buf; struct stat sb; int len; - file = g_strdup_printf ("/proc/%d/cwd", term->pid); + file = g_strdup_printf ("/proc/%d/cwd", sk_tab->pid); if (g_stat(file, &sb) == -1) { g_free(file); @@ -3306,7 +3324,7 @@ buf = malloc(sb.st_size + 1); - if(buf == NULL) { + if (buf == NULL) { g_free(file); return cwd; } @@ -3329,21 +3347,21 @@ static guint sakura_tokeycode (guint key) { - GdkKeymap *keymap; - GdkKeymapKey *keys; - gint n_keys; - guint res = 0; + 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); - } + 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; + return res; } @@ -3379,7 +3397,7 @@ /* Localization */ setlocale(LC_ALL, ""); - localedir=g_strdup_printf("%s/locale", DATADIR); + localedir = g_strdup_printf("%s/locale", DATADIR); textdomain(GETTEXT_PACKAGE); bindtextdomain(GETTEXT_PACKAGE, localedir); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -3390,11 +3408,11 @@ /* Initialize nargv */ nargv = (char**)calloc((argc+1), sizeof(char*)); - n=0; nargc=argc; - have_e=FALSE; + n = 0; nargc = argc; + have_e = FALSE; - for(i=0; i