diff --git a/COPYING-CMAKE-SCRIPTS b/COPYING-CMAKE-SCRIPTS new file mode 120000 index 0000000..37e4ca8 --- /dev/null +++ b/COPYING-CMAKE-SCRIPTS @@ -0,0 +1 @@ +LICENSE.BSD-3-clause \ No newline at end of file diff --git a/LICENSE.BSD-3-clause b/LICENSE.BSD-3-clause new file mode 100644 index 0000000..c7a0aa4 --- /dev/null +++ b/LICENSE.BSD-3-clause @@ -0,0 +1,26 @@ +Copyright (c) The Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/LICENSE.LGPL2+ b/LICENSE.LGPL2+ new file mode 100644 index 0000000..5bc8fb2 --- /dev/null +++ b/LICENSE.LGPL2+ @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 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. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, 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 library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, 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 companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/cmake/FindUtf8Proc.cmake b/cmake/FindUtf8Proc.cmake index 4081854..8e0d1af 100644 --- a/cmake/FindUtf8Proc.cmake +++ b/cmake/FindUtf8Proc.cmake @@ -47,11 +47,12 @@ find_library( # all listed variables are TRUE include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS( - UTF8PROC + Utf8Proc + FOUND_VAR Utf8Proc_FOUND REQUIRED_VARS UTF8PROC_LIBRARY UTF8PROC_INCLUDE_DIR ) -if(UTF8PROC_FOUND) +if(Utf8Proc_FOUND) set( UTF8PROC_LIBRARIES ${UTF8PROC_LIBRARY} ) set( UTF8PROC_INCLUDE_DIRS ${UTF8PROC_INCLUDE_DIR} ) endif() diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 0000000..33fb676 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,20 @@ +# Migration for background images + +How the background image is drawn has been changed since version 0.17. +Intuitively, the background image is now drawn above the background color instead of below it. +Technically, the background image is no longer blended with the background color. + +Any background image can be used but, of course, it should be chosen so that the terminal text can be easily read on it. +Since an image may not be totally dark or light, you might want to use a translucent image as the background. +As a result, the background image is mixed with the background color to improve readability. +Opaque images can also be converted to translucent ones with a few steps. + +A common usage is an effect similiar to previous qtermwidget versions or other terminal emulators. +To achieve that, you can convert the background image to a translucent one with the transparency level matching the original terminal transparency. +For example, if the original terminal transparency of qtermwidget was 25% (or 75% in some other terminal emulators), a converted image with transparency 25% will work as usual. +The conversion can be done via ImageMagick, GraphicsMagick, GIMP or Krita. +Here is an example command using ImageMagick: + + $ convert original_image.jpg -matte -channel A +level 0,25% +channel translucent_image.png + +You may also want to change the terminal transparency to 0% if you do not want to see another window or the desktop below the terminal. diff --git a/lib/BlockArray.cpp b/lib/BlockArray.cpp index e4ccf8d..45b4346 100644 --- a/lib/BlockArray.cpp +++ b/lib/BlockArray.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include using namespace Konsole; @@ -41,9 +41,9 @@ BlockArray::BlockArray() : size(0), current(size_t(-1)), index(size_t(-1)), - lastmap(0), + lastmap(nullptr), lastmap_index(size_t(-1)), - lastblock(0), ion(-1), + lastblock(nullptr), ion(-1), length(0) { // lastmap_index = index = current = size_t(-1); @@ -138,7 +138,7 @@ const Block * BlockArray::at(size_t i) if (i > index) { qDebug() << "BlockArray::at() i > index\n"; - return 0; + return nullptr; } // if (index - i >= length) { @@ -151,11 +151,11 @@ const Block * BlockArray::at(size_t i) Q_ASSERT(j < size); unmap(); - Block * block = (Block *)mmap(0, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize); + Block * block = (Block *)mmap(nullptr, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize); if (block == (Block *)-1) { perror("mmap"); - return 0; + return nullptr; } lastmap = block; @@ -172,7 +172,7 @@ void BlockArray::unmap() perror("munmap"); } } - lastmap = 0; + lastmap = nullptr; lastmap_index = size_t(-1); } @@ -193,7 +193,7 @@ bool BlockArray::setHistorySize(size_t newsize) if (!newsize) { delete lastblock; - lastblock = 0; + lastblock = nullptr; if (ion >= 0) { close(ion); } diff --git a/lib/BlockArray.h b/lib/BlockArray.h index 4fee623..52b531a 100644 --- a/lib/BlockArray.h +++ b/lib/BlockArray.h @@ -27,8 +27,8 @@ //#error Do not use in KDE 2.1 -#define BlockSize (1 << 12) -#define ENTRIES ((BlockSize - sizeof(size_t) ) / sizeof(unsigned char)) +#define QTERMWIDGET_BLOCKSIZE (1 << 12) +#define ENTRIES ((QTERMWIDGET_BLOCKSIZE - sizeof(size_t) ) / sizeof(unsigned char)) namespace Konsole { diff --git a/lib/CharacterColor.h b/lib/CharacterColor.h index a5a5e67..7ad8f5d 100644 --- a/lib/CharacterColor.h +++ b/lib/CharacterColor.h @@ -78,16 +78,6 @@ public: */ ColorEntry() : transparent(false), fontWeight(UseCurrentFormat) {} - /** - * Sets the color, transparency and boldness of this color to those of @p rhs. - */ - void operator=(const ColorEntry& rhs) - { - color = rhs.color; - transparent = rhs.transparent; - fontWeight = rhs.fontWeight; - } - /** The color value of this entry for display. */ QColor color; @@ -278,7 +268,7 @@ inline QColor CharacterColor::color(const ColorEntry* base) const case COLOR_SPACE_DEFAULT: return base[_u+0+(_v?BASE_COLORS:0)].color; case COLOR_SPACE_SYSTEM: return base[_u+2+(_v?BASE_COLORS:0)].color; case COLOR_SPACE_256: return color256(_u,base); - case COLOR_SPACE_RGB: return QColor(_u,_v,_w); + case COLOR_SPACE_RGB: return {_u,_v,_w}; case COLOR_SPACE_UNDEFINED: return QColor(); } diff --git a/lib/ColorScheme.cpp b/lib/ColorScheme.cpp index ecf4a61..f7b9af2 100644 --- a/lib/ColorScheme.cpp +++ b/lib/ColorScheme.cpp @@ -48,27 +48,27 @@ const ColorEntry ColorScheme::defaultTable[TABLE_COLORS] = // gamma correction for the dim colors to compensate for bright X screens. // It contains the 8 ansiterm/xterm colors in 2 intensities. { - ColorEntry( QColor(0x00,0x00,0x00), 0), ColorEntry( -QColor(0xFF,0xFF,0xFF), 1), // Dfore, Dback - ColorEntry( QColor(0x00,0x00,0x00), 0), ColorEntry( -QColor(0xB2,0x18,0x18), 0), // Black, Red - ColorEntry( QColor(0x18,0xB2,0x18), 0), ColorEntry( -QColor(0xB2,0x68,0x18), 0), // Green, Yellow - ColorEntry( QColor(0x18,0x18,0xB2), 0), ColorEntry( -QColor(0xB2,0x18,0xB2), 0), // Blue, Magenta - ColorEntry( QColor(0x18,0xB2,0xB2), 0), ColorEntry( -QColor(0xB2,0xB2,0xB2), 0), // Cyan, White + ColorEntry( QColor(0x00,0x00,0x00), false), ColorEntry( +QColor(0xFF,0xFF,0xFF), true), // Dfore, Dback + ColorEntry( QColor(0x00,0x00,0x00), false), ColorEntry( +QColor(0xB2,0x18,0x18), false), // Black, Red + ColorEntry( QColor(0x18,0xB2,0x18), false), ColorEntry( +QColor(0xB2,0x68,0x18), false), // Green, Yellow + ColorEntry( QColor(0x18,0x18,0xB2), false), ColorEntry( +QColor(0xB2,0x18,0xB2), false), // Blue, Magenta + ColorEntry( QColor(0x18,0xB2,0xB2), false), ColorEntry( +QColor(0xB2,0xB2,0xB2), false), // Cyan, White // intensive - ColorEntry( QColor(0x00,0x00,0x00), 0), ColorEntry( -QColor(0xFF,0xFF,0xFF), 1), - ColorEntry( QColor(0x68,0x68,0x68), 0), ColorEntry( -QColor(0xFF,0x54,0x54), 0), - ColorEntry( QColor(0x54,0xFF,0x54), 0), ColorEntry( -QColor(0xFF,0xFF,0x54), 0), - ColorEntry( QColor(0x54,0x54,0xFF), 0), ColorEntry( -QColor(0xFF,0x54,0xFF), 0), - ColorEntry( QColor(0x54,0xFF,0xFF), 0), ColorEntry( -QColor(0xFF,0xFF,0xFF), 0) + ColorEntry( QColor(0x00,0x00,0x00), false), ColorEntry( +QColor(0xFF,0xFF,0xFF), true), + ColorEntry( QColor(0x68,0x68,0x68), false), ColorEntry( +QColor(0xFF,0x54,0x54), false), + ColorEntry( QColor(0x54,0xFF,0x54), false), ColorEntry( +QColor(0xFF,0xFF,0x54), false), + ColorEntry( QColor(0x54,0x54,0xFF), false), ColorEntry( +QColor(0xFF,0x54,0xFF), false), + ColorEntry( QColor(0x54,0xFF,0xFF), false), ColorEntry( +QColor(0xFF,0xFF,0xFF), false) }; const char* const ColorScheme::colorNames[TABLE_COLORS] = @@ -122,25 +122,25 @@ const char* const ColorScheme::translatedColorNames[TABLE_COLORS] = ColorScheme::ColorScheme() { - _table = 0; - _randomTable = 0; + _table = nullptr; + _randomTable = nullptr; _opacity = 1.0; } ColorScheme::ColorScheme(const ColorScheme& other) : _opacity(other._opacity) - ,_table(0) - ,_randomTable(0) + ,_table(nullptr) + ,_randomTable(nullptr) { setName(other.name()); setDescription(other.description()); - if ( other._table != 0 ) + if ( other._table != nullptr ) { for ( int i = 0 ; i < TABLE_COLORS ; i++ ) setColorTableEntry(i,other._table[i]); } - if ( other._randomTable != 0 ) + if ( other._randomTable != nullptr ) { for ( int i = 0 ; i < TABLE_COLORS ; i++ ) { @@ -185,7 +185,7 @@ ColorEntry ColorScheme::colorEntry(int index , uint randomSeed) const ColorEntry entry = colorTable()[index]; if ( randomSeed != 0 && - _randomTable != 0 && + _randomTable != nullptr && !_randomTable[index].isNull() ) { const RandomizationRange& range = _randomTable[index]; @@ -213,7 +213,7 @@ void ColorScheme::getColorTable(ColorEntry* table , uint randomSeed) const } bool ColorScheme::randomizedBackgroundColor() const { - return _randomTable == 0 ? false : !_randomTable[1].isNull(); + return _randomTable == nullptr ? false : !_randomTable[1].isNull(); } void ColorScheme::setRandomizedBackgroundColor(bool randomize) { @@ -238,7 +238,7 @@ void ColorScheme::setRandomizationRange( int index , quint16 hue , quint8 satura Q_ASSERT( hue <= MAX_HUE ); Q_ASSERT( index >= 0 && index < TABLE_COLORS ); - if ( _randomTable == 0 ) + if ( _randomTable == nullptr ) _randomTable = new RandomizationRange[TABLE_COLORS]; _randomTable[index].hue = hue; @@ -491,94 +491,6 @@ AccessibleColorScheme::AccessibleColorScheme() #endif } -KDE3ColorSchemeReader::KDE3ColorSchemeReader( QIODevice* device ) : - _device(device) -{ -} -ColorScheme* KDE3ColorSchemeReader::read() -{ - Q_ASSERT( _device->openMode() == QIODevice::ReadOnly || - _device->openMode() == QIODevice::ReadWrite ); - - ColorScheme* scheme = new ColorScheme(); - - QRegExp comment(QLatin1String("#.*$")); - while ( !_device->atEnd() ) - { - QString line(QString::fromUtf8(_device->readLine())); - line.remove(comment); - line = line.simplified(); - - if ( line.isEmpty() ) - continue; - - if ( line.startsWith(QLatin1String("color")) ) - { - if (!readColorLine(line,scheme)) - qDebug() << "Failed to read KDE 3 color scheme line" << line; - } - else if ( line.startsWith(QLatin1String("title")) ) - { - if (!readTitleLine(line,scheme)) - qDebug() << "Failed to read KDE 3 color scheme title line" << line; - } - else - { - qDebug() << "KDE 3 color scheme contains an unsupported feature, '" << - line << "'"; - } - } - - return scheme; -} -bool KDE3ColorSchemeReader::readColorLine(const QString& line,ColorScheme* scheme) -{ - QStringList list = line.split(QLatin1Char(' ')); - - if (list.count() != 7) - return false; - if (list.first() != QLatin1String("color")) - return false; - - int index = list[1].toInt(); - int red = list[2].toInt(); - int green = list[3].toInt(); - int blue = list[4].toInt(); - int transparent = list[5].toInt(); - int bold = list[6].toInt(); - - const int MAX_COLOR_VALUE = 255; - - if( (index < 0 || index >= TABLE_COLORS ) - || (red < 0 || red > MAX_COLOR_VALUE ) - || (blue < 0 || blue > MAX_COLOR_VALUE ) - || (green < 0 || green > MAX_COLOR_VALUE ) - || (transparent != 0 && transparent != 1 ) - || (bold != 0 && bold != 1) ) - return false; - - ColorEntry entry; - entry.color = QColor(red,green,blue); - entry.transparent = ( transparent != 0 ); - entry.fontWeight = ( bold != 0 ) ? ColorEntry::Bold : ColorEntry::UseCurrentFormat; - - scheme->setColorTableEntry(index,entry); - return true; -} -bool KDE3ColorSchemeReader::readTitleLine(const QString& line,ColorScheme* scheme) -{ - if( !line.startsWith(QLatin1String("title")) ) - return false; - - int spacePos = line.indexOf(QLatin1Char(' ')); - if( spacePos == -1 ) - return false; - - QString description = line.mid(spacePos+1); - - scheme->setDescription(description); - return true; -} ColorSchemeManager::ColorSchemeManager() : _haveLoadedAll(false) { @@ -594,7 +506,7 @@ ColorSchemeManager::~ColorSchemeManager() } void ColorSchemeManager::loadAllColorSchemes() { - qDebug() << "loadAllColorSchemes"; + //qDebug() << "loadAllColorSchemes"; int failed = 0; QList nativeColorSchemes = listColorSchemes(); @@ -605,16 +517,8 @@ void ColorSchemeManager::loadAllColorSchemes() failed++; } - QList kde3ColorSchemes = listKDE3ColorSchemes(); - QListIterator kde3Iter(kde3ColorSchemes); - while ( kde3Iter.hasNext() ) - { - if ( !loadKDE3ColorScheme( kde3Iter.next() ) ) - failed++; - } - - if ( failed > 0 ) - qDebug() << "failed to load " << failed << " color schemes."; + /*if ( failed > 0 ) + qDebug() << "failed to load " << failed << " color schemes.";*/ _haveLoadedAll = true; } @@ -627,37 +531,6 @@ QList ColorSchemeManager::allColorSchemes() return _colorSchemes.values(); } -bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath) -{ - QFile file(filePath); - if (!filePath.endsWith(QLatin1String(".schema")) || !file.open(QIODevice::ReadOnly)) - return false; - - KDE3ColorSchemeReader reader(&file); - ColorScheme* scheme = reader.read(); - scheme->setName(QFileInfo(file).baseName()); - file.close(); - - if (scheme->name().isEmpty()) - { - qDebug() << "color scheme name is not valid."; - delete scheme; - return false; - } - - QFileInfo info(filePath); - - if ( !_colorSchemes.contains(info.baseName()) ) - _colorSchemes.insert(scheme->name(),scheme); - else - { - qDebug() << "color scheme with name" << scheme->name() << "has already been" << - "found, ignoring."; - delete scheme; - } - - return true; -} #if 0 void ColorSchemeManager::addColorScheme(ColorScheme* scheme) { @@ -675,10 +548,8 @@ bool ColorSchemeManager::loadCustomColorScheme(const QString& path) { if (path.endsWith(QLatin1String(".colorscheme"))) return loadColorScheme(path); - else if (path.endsWith(QLatin1String(".schema"))) - return loadKDE3ColorScheme(path); - else - return false; + + return false; } void ColorSchemeManager::addCustomColorSchemeDir(const QString& custom_dir) @@ -701,7 +572,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath) if (scheme->name().isEmpty()) { - qDebug() << "Color scheme in" << filePath << "does not have a valid name and was not loaded."; + //qDebug() << "Color scheme in" << filePath << "does not have a valid name and was not loaded."; delete scheme; return false; } @@ -712,37 +583,17 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath) } else { - qDebug() << "color scheme with name" << schemeName << "has already been" << - "found, ignoring."; + /*qDebug() << "color scheme with name" << schemeName << "has already been" << + "found, ignoring.";*/ delete scheme; } return true; } -QList ColorSchemeManager::listKDE3ColorSchemes() -{ - QStringList ret; - for (const QString &scheme_dir : get_color_schemes_dirs()) - { - const QString dname(scheme_dir); - QDir dir(dname); - QStringList filters; - filters << QLatin1String("*.schema"); - dir.setNameFilters(filters); - QStringList list = dir.entryList(filters); - for (const QString &i : list) - ret << dname + QLatin1Char('/') + i; - } - return ret; - //return KGlobal::dirs()->findAllResources("data", - // "konsole/*.schema", - // KStandardDirs::NoDuplicates); - // -} QList ColorSchemeManager::listColorSchemes() { - QStringList ret; + QList ret; for (const QString &scheme_dir : get_color_schemes_dirs()) { const QString dname(scheme_dir); @@ -750,7 +601,7 @@ QList ColorSchemeManager::listColorSchemes() QStringList filters; filters << QLatin1String("*.colorscheme"); dir.setNameFilters(filters); - QStringList list = dir.entryList(filters); + const QStringList list = dir.entryList(filters); for (const QString &i : list) ret << dname + QLatin1Char('/') + i; } @@ -777,7 +628,7 @@ bool ColorSchemeManager::deleteColorScheme(const QString& name) } else { - qDebug() << "Failed to remove color scheme -" << path; + //qDebug() << "Failed to remove color scheme -" << path; return false; } } @@ -813,15 +664,10 @@ const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name) { return findColorScheme(name); } - else - { - if (!path.isEmpty() && loadKDE3ColorScheme(path)) - return findColorScheme(name); - } - qDebug() << "Could not find color scheme - " << name; + //qDebug() << "Could not find color scheme - " << name; - return 0; + return nullptr; } } Q_GLOBAL_STATIC(ColorSchemeManager, theColorSchemeManager) diff --git a/lib/ColorScheme.h b/lib/ColorScheme.h index f9e619b..416fe25 100644 --- a/lib/ColorScheme.h +++ b/lib/ColorScheme.h @@ -217,41 +217,6 @@ public: AccessibleColorScheme(); }; -/** - * Reads a color scheme stored in the .schema format used in the KDE 3 incarnation - * of Konsole - * - * Only the basic essentials ( title and color palette entries ) are currently - * supported. Additional options such as background image and background - * blend colors are ignored. - */ -class KDE3ColorSchemeReader -{ -public: - /** - * Constructs a new reader which reads from the specified device. - * The device should be open in read-only mode. - */ - KDE3ColorSchemeReader( QIODevice* device ); - - /** - * Reads and parses the contents of the .schema file from the input - * device and returns the ColorScheme defined within it. - * - * Returns a null pointer if an error occurs whilst parsing - * the contents of the file. - */ - ColorScheme* read(); - -private: - // reads a line from the file specifying a colour palette entry - // format is: color [index] [red] [green] [blue] [transparent] [bold] - bool readColorLine(const QString& line , ColorScheme* scheme); - bool readTitleLine(const QString& line , ColorScheme* scheme); - - QIODevice* _device; -}; - /** * Manages the color schemes available for use by terminal displays. * See ColorScheme @@ -338,13 +303,8 @@ public: private: // loads a color scheme from a KDE 4+ .colorscheme file bool loadColorScheme(const QString& path); - // loads a color scheme from a KDE 3 .schema file - bool loadKDE3ColorScheme(const QString& path); // returns a list of paths of color schemes in the KDE 4+ .colorscheme file format QList listColorSchemes(); - // returns a list of paths of color schemes in the .schema file format - // used in KDE 3 - QList listKDE3ColorSchemes(); // loads all of the color schemes void loadAllColorSchemes(); // finds the path of a color scheme diff --git a/lib/Emulation.cpp b/lib/Emulation.cpp index a81a2e8..5d5251d 100644 --- a/lib/Emulation.cpp +++ b/lib/Emulation.cpp @@ -23,8 +23,8 @@ #include "Emulation.h" // System -#include -#include +#include +#include #include #include @@ -51,10 +51,10 @@ using namespace Konsole; Emulation::Emulation() : - _currentScreen(0), - _codec(0), - _decoder(0), - _keyTranslator(0), + _currentScreen(nullptr), + _codec(nullptr), + _decoder(nullptr), + _keyTranslator(nullptr), _usesMouse(false), _bracketedPasteMode(false) { @@ -109,6 +109,12 @@ ScreenWindow* Emulation::createWindow() connect(this , SIGNAL(outputChanged()), window , SLOT(notifyOutputChanged()) ); + + connect(this, &Emulation::handleCommandFromKeyboard, + window, &ScreenWindow::handleCommandFromKeyboard); + connect(this, &Emulation::outputFromKeypressEvent, + window, &ScreenWindow::scrollToEnd); + return window; } @@ -133,7 +139,7 @@ void Emulation::setScreen(int n) if (_currentScreen != old) { // tell all windows onto this emulation to switch to the newly active screen - for(ScreenWindow* window : const_cast&>(_windows)) + for(ScreenWindow* window : qAsConst(_windows)) window->setScreen(_currentScreen); } } @@ -206,7 +212,7 @@ void Emulation::receiveChar(wchar_t c) }; } -void Emulation::sendKeyEvent( QKeyEvent* ev ) +void Emulation::sendKeyEvent(QKeyEvent* ev, bool) { emit stateSet(NOTIFYNORMAL); @@ -385,7 +391,7 @@ void Emulation::setImageSize(int lines, int columns) QSize Emulation::imageSize() const { - return QSize(_currentScreen->getColumns(), _currentScreen->getLines()); + return {_currentScreen->getColumns(), _currentScreen->getLines()}; } ushort ExtendedCharTable::extendedCharHash(ushort* unicodePoints , ushort length) const @@ -403,7 +409,7 @@ bool ExtendedCharTable::extendedCharMatch(ushort hash , ushort* unicodePoints , // compare given length with stored sequence length ( given as the first ushort in the // stored buffer ) - if ( entry == 0 || entry[0] != length ) + if ( entry == nullptr || entry[0] != length ) return false; // if the lengths match, each character must be checked. the stored buffer starts at // entry[1] @@ -463,7 +469,7 @@ ushort* ExtendedCharTable::lookupExtendedChar(ushort hash , ushort& length) cons else { length = 0; - return 0; + return nullptr; } } diff --git a/lib/Emulation.h b/lib/Emulation.h index 95581b9..9e7ea54 100644 --- a/lib/Emulation.h +++ b/lib/Emulation.h @@ -24,7 +24,7 @@ #define EMULATION_H // System -#include +#include // Qt #include @@ -33,14 +33,11 @@ #include #include -// Konsole -//#include "konsole_export.h" -#define KONSOLEPRIVATE_EXPORT +#include "KeyboardTranslator.h" namespace Konsole { -class KeyboardTranslator; class HistoryType; class Screen; class ScreenWindow; @@ -120,7 +117,7 @@ enum * how long the emulation has been active/idle for and also respond to * a 'bell' event in different ways. */ -class KONSOLEPRIVATE_EXPORT Emulation : public QObject +class Emulation : public QObject { Q_OBJECT @@ -148,7 +145,7 @@ public: /** Constructs a new terminal emulation */ Emulation(); - ~Emulation(); + ~Emulation() override; /** * Creates a new window onto the output from this emulation. The contents @@ -265,7 +262,7 @@ public slots: * Interprets a key press event and emits the sendData() signal with * the resulting character stream. */ - virtual void sendKeyEvent(QKeyEvent*); + virtual void sendKeyEvent(QKeyEvent*, bool fromPaste); /** * Converts information about a mouse event into an xterm-compatible escape @@ -454,6 +451,9 @@ signals: */ void cursorChanged(KeyboardCursorShape cursorShape, bool blinkingCursorEnabled); + void handleCommandFromKeyboard(KeyboardTranslator::Command command); + void outputFromKeypressEvent(void); + protected: virtual void setMode(int mode) = 0; virtual void resetMode(int mode) = 0; diff --git a/lib/Filter.cpp b/lib/Filter.cpp index 3ed2aff..f219292 100644 --- a/lib/Filter.cpp +++ b/lib/Filter.cpp @@ -22,7 +22,6 @@ // System #include -#include // Qt #include @@ -99,13 +98,13 @@ Filter::HotSpot* FilterChain::hotSpotAt(int line , int column) const { Filter* filter = iter.next(); Filter::HotSpot* spot = filter->hotSpotAt(line,column); - if ( spot != 0 ) + if ( spot != nullptr ) { return spot; } } - return 0; + return nullptr; } QList FilterChain::hotSpots() const @@ -122,8 +121,8 @@ QList FilterChain::hotSpots() const //QList FilterChain::hotSpotsAtLine(int line) const; TerminalImageFilterChain::TerminalImageFilterChain() -: _buffer(0) -, _linePositions(0) +: _buffer(nullptr) +, _linePositions(nullptr) { } @@ -181,30 +180,19 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines } Filter::Filter() : -_linePositions(0), -_buffer(0) +_linePositions(nullptr), +_buffer(nullptr) { } Filter::~Filter() { - QListIterator iter(_hotspotList); - while (iter.hasNext()) - { - delete iter.next(); - } + qDeleteAll(_hotspotList); + _hotspotList.clear(); } void Filter::reset() { - QListIterator iter(_hotspotList); - while (iter.hasNext()) - { - HotSpot* currentHotSpot = iter.next(); - if (currentHotSpot->hasAnotherParent()) { - continue; - } - delete currentHotSpot; - } + qDeleteAll(_hotspotList); _hotspots.clear(); _hotspotList.clear(); } @@ -287,22 +275,19 @@ Filter::HotSpot* Filter::hotSpotAt(int line , int column) const return spot; } - return 0; + return nullptr; } Filter::HotSpot::HotSpot(int startLine , int startColumn , int endLine , int endColumn) - : _hasAnotherParent(false) - , _startLine(startLine) + : _startLine(startLine) , _startColumn(startColumn) , _endLine(endLine) , _endColumn(endColumn) , _type(NotSpecified) { } -QList Filter::HotSpot::actions(QWidget* parent) +QList Filter::HotSpot::actions() { - Q_UNUSED(parent); - return QList(); } int Filter::HotSpot::startLine() const @@ -514,28 +499,14 @@ FilterObject* UrlFilter::HotSpot::getUrlObject() const return _urlObject; } -class UrlAction : public QAction { -public: - UrlAction(QWidget* parent, std::shared_ptr hotspotPtr) - : QAction(parent) - , _hotspotPtr(hotspotPtr) - { - } - -private: - std::shared_ptr _hotspotPtr; -}; - -QList UrlFilter::HotSpot::actions(QWidget* parent) +QList UrlFilter::HotSpot::actions() { - this->_hasAnotherParent = true; QList list; const UrlType kind = urlType(); - std::shared_ptr hotspotPtr(this); - UrlAction* openAction = new UrlAction(parent, hotspotPtr); - UrlAction* copyAction = new UrlAction(parent, hotspotPtr); + QAction* openAction = new QAction(_urlObject); + QAction* copyAction = new QAction(_urlObject);; Q_ASSERT( kind == StandardUrl || kind == Email ); diff --git a/lib/Filter.h b/lib/Filter.h index bb411ef..f788ae2 100644 --- a/lib/Filter.h +++ b/lib/Filter.h @@ -28,8 +28,6 @@ #include #include -// Local - namespace Konsole { @@ -115,27 +113,24 @@ public: * Returns a list of actions associated with the hotspot which can be used in a * menu or toolbar */ - virtual QList actions(QWidget* parent); - - bool hasAnotherParent() const { return _hasAnotherParent; } + virtual QList actions(); protected: /** Sets the type of a hotspot. This should only be set once */ void setType(Type type); - bool _hasAnotherParent; - private: int _startLine; int _startColumn; int _endLine; int _endColumn; Type _type; + }; /** Constructs a new filter. */ Filter(); - virtual ~Filter(); + ~Filter() override; /** Causes the filter to process the block of text currently in its internal buffer */ virtual void process() = 0; @@ -197,7 +192,7 @@ public: { public: HotSpot(int startLine, int startColumn, int endLine , int endColumn); - virtual void activate(const QString& action = QString()); + void activate(const QString& action = QString()) override; /** Sets the captured texts associated with this hotspot */ void setCapturedTexts(const QStringList& texts); @@ -226,7 +221,7 @@ public: * If regexp matches the empty string, then process() will return immediately * without finding results. */ - virtual void process(); + void process() override; protected: /** @@ -255,17 +250,17 @@ public: { public: HotSpot(int startLine,int startColumn,int endLine,int endColumn); - virtual ~HotSpot(); + ~HotSpot() override; FilterObject* getUrlObject() const; - virtual QList actions(QWidget* parent); + QList actions() override; /** * Open a web browser at the current URL. The url itself can be determined using * the capturedTexts() method. */ - virtual void activate(const QString& action = QString()); + void activate(const QString& action = QString()) override; private: enum UrlType @@ -282,7 +277,7 @@ public: UrlFilter(); protected: - virtual RegExpFilter::HotSpot* newHotSpot(int,int,int,int); + RegExpFilter::HotSpot* newHotSpot(int,int,int,int) override; private: @@ -365,7 +360,7 @@ class TerminalImageFilterChain : public FilterChain { public: TerminalImageFilterChain(); - virtual ~TerminalImageFilterChain(); + ~TerminalImageFilterChain() override; /** * Set the current terminal image to @p image. diff --git a/lib/History.cpp b/lib/History.cpp index b297b0e..ec3536b 100644 --- a/lib/History.cpp +++ b/lib/History.cpp @@ -22,13 +22,14 @@ #include "History.h" // System +#include #include -#include -#include +#include +#include #include #include #include -#include +#include #include @@ -89,7 +90,8 @@ FIXME: There is noticeable decrease in speed, also. Perhaps, HistoryFile::HistoryFile() : ion(-1), length(0), - fileMap(0) + fileMap(nullptr), + readWriteBalance(0) { if (tmpFile.open()) { @@ -109,15 +111,15 @@ HistoryFile::~HistoryFile() //to avoid this. void HistoryFile::map() { - Q_ASSERT( fileMap == 0 ); + Q_ASSERT( fileMap == nullptr ); - fileMap = (char*)mmap( 0 , length , PROT_READ , MAP_PRIVATE , ion , 0 ); + fileMap = (char*)mmap( nullptr , length , PROT_READ , MAP_PRIVATE , ion , 0 ); //if mmap'ing fails, fall back to the read-lseek combination if ( fileMap == MAP_FAILED ) { readWriteBalance = 0; - fileMap = 0; + fileMap = nullptr; //qDebug() << __FILE__ << __LINE__ << ": mmap'ing history failed. errno = " << errno; } } @@ -127,12 +129,12 @@ void HistoryFile::unmap() int result = munmap( fileMap , length ); Q_ASSERT( result == 0 ); Q_UNUSED( result ); - fileMap = 0; + fileMap = nullptr; } bool HistoryFile::isMapped() const { - return (fileMap != 0); + return (fileMap != nullptr); } void HistoryFile::add(const unsigned char* bytes, int len) @@ -313,7 +315,7 @@ void HistoryScrollBuffer::addCellsVector(const QVector& cells) void HistoryScrollBuffer::addCells(const Character a[], int count) { HistoryLine newLine(count); - qCopy(a,a+count,newLine.begin()); + std::copy(a,a+count,newLine.begin()); addCellsVector(newLine); } @@ -399,7 +401,7 @@ void HistoryScrollBuffer::setMaxNbLines(unsigned int lineCount) dynamic_cast(m_histType)->m_nbLines = lineCount; } -int HistoryScrollBuffer::bufferIndex(int lineNumber) +int HistoryScrollBuffer::bufferIndex(int lineNumber) const { Q_ASSERT( lineNumber >= 0 ); Q_ASSERT( lineNumber < _maxLineCount ); @@ -537,7 +539,7 @@ void* CompactHistoryBlock::allocate ( size_t length ) { Q_ASSERT ( length > 0 ); if ( tail-blockStart+length > blockLength ) - return NULL; + return nullptr; void* block = tail; tail += length; @@ -610,7 +612,7 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo { length=line.size(); - if (line.size() > 0) { + if (!line.empty()) { formatLength=1; int k=1; @@ -628,9 +630,9 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo //kDebug() << "number of different formats in string: " << formatLength; formatArray = (CharacterFormat*) blockList.allocate(sizeof(CharacterFormat)*formatLength); - Q_ASSERT (formatArray!=NULL); + Q_ASSERT (formatArray!=nullptr); text = (quint16*) blockList.allocate(sizeof(quint16)*line.size()); - Q_ASSERT (text!=NULL); + Q_ASSERT (text!=nullptr); length=line.size(); wrapped=false; @@ -729,7 +731,7 @@ void CompactHistoryScroll::addCellsVector ( const TextLine& cells ) void CompactHistoryScroll::addCells ( const Character a[], int count ) { TextLine newLine ( count ); - qCopy ( a,a+count,newLine.begin() ); + std::copy ( a,a+count,newLine.begin() ); addCellsVector ( newLine ); } @@ -923,7 +925,7 @@ HistoryScroll* HistoryTypeFile::scroll(HistoryScroll *old) const HistoryScroll *newScroll = new HistoryScrollFile(m_fileName); Character line[LINE_SIZE]; - int lines = (old != 0) ? old->getLines() : 0; + int lines = (old != nullptr) ? old->getLines() : 0; for(int i = 0; i < lines; i++) { int size = old->getLineLen(i); diff --git a/lib/History.h b/lib/History.h index d921a86..eb8c9e1 100644 --- a/lib/History.h +++ b/lib/History.h @@ -139,15 +139,15 @@ class HistoryScrollFile : public HistoryScroll { public: HistoryScrollFile(const QString &logFileName); - virtual ~HistoryScrollFile(); + ~HistoryScrollFile() override; - virtual int getLines(); - virtual int getLineLen(int lineno); - virtual void getCells(int lineno, int colno, int count, Character res[]); - virtual bool isWrappedLine(int lineno); + int getLines() override; + int getLineLen(int lineno) override; + void getCells(int lineno, int colno, int count, Character res[]) override; + bool isWrappedLine(int lineno) override; - virtual void addCells(const Character a[], int count); - virtual void addLine(bool previousWrapped=false); + void addCells(const Character a[], int count) override; + void addLine(bool previousWrapped=false) override; private: int startOfLine(int lineno); @@ -168,23 +168,23 @@ public: typedef QVector HistoryLine; HistoryScrollBuffer(unsigned int maxNbLines = 1000); - virtual ~HistoryScrollBuffer(); + ~HistoryScrollBuffer() override; - virtual int getLines(); - virtual int getLineLen(int lineno); - virtual void getCells(int lineno, int colno, int count, Character res[]); - virtual bool isWrappedLine(int lineno); + int getLines() override; + int getLineLen(int lineno) override; + void getCells(int lineno, int colno, int count, Character res[]) override; + bool isWrappedLine(int lineno) override; - virtual void addCells(const Character a[], int count); - virtual void addCellsVector(const QVector& cells); - virtual void addLine(bool previousWrapped=false); + void addCells(const Character a[], int count) override; + void addCellsVector(const QVector& cells) override; + void addLine(bool previousWrapped=false) override; void setMaxNbLines(unsigned int nbLines); unsigned int maxNbLines() const { return _maxLineCount; } private: - int bufferIndex(int lineNumber); + int bufferIndex(int lineNumber) const; HistoryLine* _historyBuffer; QBitArray _wrappedLine; @@ -223,17 +223,17 @@ class HistoryScrollNone : public HistoryScroll { public: HistoryScrollNone(); - virtual ~HistoryScrollNone(); + ~HistoryScrollNone() override; - virtual bool hasScroll(); + bool hasScroll() override; - virtual int getLines(); - virtual int getLineLen(int lineno); - virtual void getCells(int lineno, int colno, int count, Character res[]); - virtual bool isWrappedLine(int lineno); + int getLines() override; + int getLineLen(int lineno) override; + void getCells(int lineno, int colno, int count, Character res[]) override; + bool isWrappedLine(int lineno) override; - virtual void addCells(const Character a[], int count); - virtual void addLine(bool previousWrapped=false); + void addCells(const Character a[], int count) override; + void addLine(bool previousWrapped=false) override; }; ////////////////////////////////////////////////////////////////////// @@ -243,15 +243,15 @@ class HistoryScrollBlockArray : public HistoryScroll { public: HistoryScrollBlockArray(size_t size); - virtual ~HistoryScrollBlockArray(); + ~HistoryScrollBlockArray() override; - virtual int getLines(); - virtual int getLineLen(int lineno); - virtual void getCells(int lineno, int colno, int count, Character res[]); - virtual bool isWrappedLine(int lineno); + int getLines() override; + int getLineLen(int lineno) override; + void getCells(int lineno, int colno, int count, Character res[]) override; + bool isWrappedLine(int lineno) override; - virtual void addCells(const Character a[], int count); - virtual void addLine(bool previousWrapped=false); + void addCells(const Character a[], int count) override; + void addLine(bool previousWrapped=false) override; protected: BlockArray m_blockArray; @@ -293,7 +293,7 @@ public: CompactHistoryBlock(){ blockLength = 4096*64; // 256kb - head = (quint8*) mmap(0, blockLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); + head = (quint8*) mmap(nullptr, blockLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); //head = (quint8*) malloc(blockLength); Q_ASSERT(head != MAP_FAILED); tail = blockStart = head; @@ -363,16 +363,16 @@ class CompactHistoryScroll : public HistoryScroll public: CompactHistoryScroll(unsigned int maxNbLines = 1000); - virtual ~CompactHistoryScroll(); + ~CompactHistoryScroll() override; - virtual int getLines(); - virtual int getLineLen(int lineno); - virtual void getCells(int lineno, int colno, int count, Character res[]); - virtual bool isWrappedLine(int lineno); + int getLines() override; + int getLineLen(int lineno) override; + void getCells(int lineno, int colno, int count, Character res[]) override; + bool isWrappedLine(int lineno) override; - virtual void addCells(const Character a[], int count); - virtual void addCellsVector(const TextLine& cells); - virtual void addLine(bool previousWrapped=false); + void addCells(const Character a[], int count) override; + void addCellsVector(const TextLine& cells) override; + void addLine(bool previousWrapped=false) override; void setMaxNbLines(unsigned int nbLines); unsigned int maxNbLines() const { return _maxLineCount; } @@ -418,10 +418,10 @@ class HistoryTypeNone : public HistoryType public: HistoryTypeNone(); - virtual bool isEnabled() const; - virtual int maximumLineCount() const; + bool isEnabled() const override; + int maximumLineCount() const override; - virtual HistoryScroll* scroll(HistoryScroll *) const; + HistoryScroll* scroll(HistoryScroll *) const override; }; class HistoryTypeBlockArray : public HistoryType @@ -429,10 +429,10 @@ class HistoryTypeBlockArray : public HistoryType public: HistoryTypeBlockArray(size_t size); - virtual bool isEnabled() const; - virtual int maximumLineCount() const; + bool isEnabled() const override; + int maximumLineCount() const override; - virtual HistoryScroll* scroll(HistoryScroll *) const; + HistoryScroll* scroll(HistoryScroll *) const override; protected: size_t m_size; @@ -444,11 +444,11 @@ class HistoryTypeFile : public HistoryType public: HistoryTypeFile(const QString& fileName=QString()); - virtual bool isEnabled() const; + bool isEnabled() const override; virtual const QString& getFileName() const; - virtual int maximumLineCount() const; + int maximumLineCount() const override; - virtual HistoryScroll* scroll(HistoryScroll *) const; + HistoryScroll* scroll(HistoryScroll *) const override; protected: QString m_fileName; @@ -462,10 +462,10 @@ class HistoryTypeBuffer : public HistoryType public: HistoryTypeBuffer(unsigned int nbLines); - virtual bool isEnabled() const; - virtual int maximumLineCount() const; + bool isEnabled() const override; + int maximumLineCount() const override; - virtual HistoryScroll* scroll(HistoryScroll *) const; + HistoryScroll* scroll(HistoryScroll *) const override; protected: unsigned int m_nbLines; @@ -476,10 +476,10 @@ class CompactHistoryType : public HistoryType public: CompactHistoryType(unsigned int size); - virtual bool isEnabled() const; - virtual int maximumLineCount() const; + bool isEnabled() const override; + int maximumLineCount() const override; - virtual HistoryScroll* scroll(HistoryScroll *) const; + HistoryScroll* scroll(HistoryScroll *) const override; protected: unsigned int m_nbLines; diff --git a/lib/HistorySearch.cpp b/lib/HistorySearch.cpp index 41c514f..33c6f4e 100644 --- a/lib/HistorySearch.cpp +++ b/lib/HistorySearch.cpp @@ -24,7 +24,7 @@ #include "Emulation.h" #include "HistorySearch.h" -HistorySearch::HistorySearch(EmulationPtr emulation, QRegExp regExp, +HistorySearch::HistorySearch(EmulationPtr emulation, const QRegExp& regExp, bool forwards, int startColumn, int startLine, QObject* parent) : QObject(parent), diff --git a/lib/HistorySearch.h b/lib/HistorySearch.h index e019650..ad5ac87 100644 --- a/lib/HistorySearch.h +++ b/lib/HistorySearch.h @@ -38,10 +38,10 @@ class HistorySearch : public QObject Q_OBJECT public: - explicit HistorySearch(EmulationPtr emulation, QRegExp regExp, bool forwards, + explicit HistorySearch(EmulationPtr emulation, const QRegExp& regExp, bool forwards, int startColumn, int startLine, QObject* parent); - ~HistorySearch(); + ~HistorySearch() override; void search(); diff --git a/lib/KeyboardTranslator.cpp b/lib/KeyboardTranslator.cpp index 6b555a1..4487480 100644 --- a/lib/KeyboardTranslator.cpp +++ b/lib/KeyboardTranslator.cpp @@ -23,8 +23,8 @@ #include "KeyboardTranslator.h" // System -#include -#include +#include +#include // Qt #include @@ -50,6 +50,13 @@ const QByteArray KeyboardTranslatorManager::defaultTranslatorText( "key Tab : \"\\t\"" ); +#ifdef Q_OS_MAC +// On Mac, Qt::ControlModifier means Cmd, and MetaModifier means Ctrl +const Qt::KeyboardModifier KeyboardTranslator::CTRL_MOD = Qt::MetaModifier; +#else +const Qt::KeyboardModifier KeyboardTranslator::CTRL_MOD = Qt::ControlModifier; +#endif + KeyboardTranslatorManager::KeyboardTranslatorManager() : _haveLoadedAll(false) { @@ -71,7 +78,6 @@ void KeyboardTranslatorManager::findTranslators() filters << QLatin1String("*.keytab"); dir.setNameFilters(filters); QStringList list = dir.entryList(filters); - list = dir.entryList(filters); // QStringList list = KGlobal::dirs()->findAllResources("data", // "konsole/*.keytab", // KStandardDirs::NoDuplicates); @@ -103,7 +109,7 @@ const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QStrin KeyboardTranslator* translator = loadTranslator(name); - if ( translator != 0 ) + if ( translator != nullptr ) _translators[name] = translator; else if ( !name.isEmpty() ) qDebug() << "Unable to load translator" << name; @@ -149,7 +155,7 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(const QString& nam QFile source(path); if (name.isEmpty() || !source.open(QIODevice::ReadOnly | QIODevice::Text)) - return 0; + return nullptr; return loadTranslator(&source,name); } @@ -186,7 +192,7 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(QIODevice* source, else { delete translator; - return 0; + return nullptr; } } @@ -469,7 +475,7 @@ QString KeyboardTranslatorReader::description() const { return _description; } -bool KeyboardTranslatorReader::hasNextEntry() +bool KeyboardTranslatorReader::hasNextEntry() const { return _hasNext; } @@ -614,6 +620,11 @@ bool KeyboardTranslator::Entry::matches(int keyCode , Qt::KeyboardModifiers modifiers, States testState) const { +#ifdef Q_OS_MAC + // On Mac, arrow keys are considered part of keypad. Ignore that. + modifiers &= ~Qt::KeypadModifier; +#endif + if ( _keyCode != keyCode ) return false; @@ -621,7 +632,7 @@ bool KeyboardTranslator::Entry::matches(int keyCode , return false; // if modifiers is non-zero, the 'any modifier' state is implicit - if ( modifiers != 0 ) + if ( (modifiers & ~Qt::KeypadModifier) != 0 ) testState |= AnyModifierState; if ( (testState & _stateMask) != (_state & _stateMask) ) diff --git a/lib/KeyboardTranslator.h b/lib/KeyboardTranslator.h index a9614e4..4ca6b86 100644 --- a/lib/KeyboardTranslator.h +++ b/lib/KeyboardTranslator.h @@ -314,6 +314,9 @@ public: /** Returns a list of all entries in the translator. */ QList entries() const; + /** The modifier code for the actual Ctrl key on this OS. */ + static const Qt::KeyboardModifier CTRL_MOD; + private: QMultiHash _entries; // entries in this keyboard translation, @@ -366,7 +369,7 @@ public: QString description() const; /** Returns true if there is another entry in the source stream */ - bool hasNextEntry(); + bool hasNextEntry() const; /** Returns the next entry found in the source stream */ KeyboardTranslator::Entry nextEntry(); @@ -558,8 +561,8 @@ inline QByteArray KeyboardTranslator::Entry::text(bool expandWildCards,Qt::Keybo { int modifierValue = 1; modifierValue += oneOrZero(modifiers & Qt::ShiftModifier); - modifierValue += oneOrZero(modifiers & Qt::AltModifier) << 1; - modifierValue += oneOrZero(modifiers & Qt::ControlModifier) << 2; + modifierValue += oneOrZero(modifiers & Qt::AltModifier) << 1; + modifierValue += oneOrZero(modifiers & KeyboardTranslator::CTRL_MOD) << 2; for (int i=0;i<_text.length();i++) { diff --git a/lib/Pty.cpp b/lib/Pty.cpp index 87484be..821517a 100644 --- a/lib/Pty.cpp +++ b/lib/Pty.cpp @@ -33,9 +33,9 @@ #include #include #include -#include +#include #include -#include +#include // Qt #include @@ -56,7 +56,7 @@ void Pty::setWindowSize(int lines, int cols) } QSize Pty::windowSize() const { - return QSize(_windowColumns,_windowLines); + return {_windowColumns,_windowLines}; } void Pty::setFlowControlEnabled(bool enable) @@ -173,6 +173,7 @@ int Pty::start(const QString& program, addEnvironmentVariables(environment); setEnv(QLatin1String("WINDOWID"), QString::number(winid)); + setEnv(QLatin1String("COLORTERM"), QLatin1String("truecolor")); // unless the LANGUAGE environment variable has been set explicitly // set it to a null string @@ -328,11 +329,12 @@ void Pty::setupChildProcess() struct sigaction action; sigset_t sigset; sigemptyset(&action.sa_mask); + sigemptyset(&sigset); action.sa_handler = SIG_DFL; action.sa_flags = 0; for (int signal=1;signal < NSIG; signal++) { - sigaction(signal,&action,0L); + sigaction(signal,&action,nullptr); sigaddset(&sigset, signal); } - sigprocmask(SIG_UNBLOCK, &sigset, NULL); + sigprocmask(SIG_UNBLOCK, &sigset, nullptr); } diff --git a/lib/Pty.h b/lib/Pty.h index e5f6ceb..f427a53 100644 --- a/lib/Pty.h +++ b/lib/Pty.h @@ -70,15 +70,15 @@ Q_OBJECT * To start the terminal process, call the run() method with the * name of the program to start and appropriate arguments. */ - explicit Pty(QObject* parent = 0); + explicit Pty(QObject* parent = nullptr); /** * Construct a process using an open pty master. * See KPtyProcess::KPtyProcess() */ - explicit Pty(int ptyMasterFd, QObject* parent = 0); + explicit Pty(int ptyMasterFd, QObject* parent = nullptr); - ~Pty(); + ~Pty() override; /** * Starts the terminal process. @@ -189,7 +189,7 @@ Q_OBJECT void receivedData(const char* buffer, int length); protected: - void setupChildProcess(); + void setupChildProcess() override; private slots: // called when data is received from the terminal process diff --git a/lib/Screen.cpp b/lib/Screen.cpp index ea635e5..d07bb4f 100644 --- a/lib/Screen.cpp +++ b/lib/Screen.cpp @@ -24,11 +24,11 @@ #include "Screen.h" // Standard -#include -#include +#include +#include #include -#include -#include +#include +#include // Qt #include @@ -1359,7 +1359,7 @@ void Screen::setScroll(const HistoryType& t , bool copyPreviousScroll) else { HistoryScroll* oldScroll = history; - history = t.scroll(0); + history = t.scroll(nullptr); delete oldScroll; } } diff --git a/lib/Screen.h b/lib/Screen.h index c4baf0e..0b44de2 100644 --- a/lib/Screen.h +++ b/lib/Screen.h @@ -551,6 +551,8 @@ public: static void fillWithDefaultChar(Character* dest, int count); private: + Screen(const Screen &) = delete; + Screen &operator=(const Screen &) = delete; //copies a line of text from the screen or history into a stream using a //specified character decoder. Returns the number of lines actually copied, @@ -637,8 +639,8 @@ private: int _bottomMargin; // states ---------------- - int currentModes[MODES_SCREEN]; - int savedModes[MODES_SCREEN]; + bool currentModes[MODES_SCREEN]; + bool savedModes[MODES_SCREEN]; // ---------------------------- diff --git a/lib/ScreenWindow.cpp b/lib/ScreenWindow.cpp index 640465f..a6ce7c2 100644 --- a/lib/ScreenWindow.cpp +++ b/lib/ScreenWindow.cpp @@ -30,7 +30,8 @@ using namespace Konsole; ScreenWindow::ScreenWindow(QObject* parent) : QObject(parent) - , _windowBuffer(0) + , _screen(nullptr) + , _windowBuffer(nullptr) , _windowBufferSize(0) , _bufferNeedsUpdate(true) , _windowLines(1) @@ -59,7 +60,7 @@ Character* ScreenWindow::getImage() { // reallocate internal buffer if the window size has changed int size = windowLines() * windowColumns(); - if (_windowBuffer == 0 || _windowBufferSize != size) + if (_windowBuffer == nullptr || _windowBufferSize != size) { delete[] _windowBuffer; _windowBufferSize = size; @@ -259,7 +260,7 @@ QRect ScreenWindow::scrollRegion() const if ( atEndOfOutput() && equalToScreenSize ) return _screen->lastScrolledRegion(); else - return QRect(0,0,windowColumns(),windowLines()); + return {0,0,windowColumns(),windowLines()}; } void ScreenWindow::notifyOutputChanged() @@ -291,4 +292,51 @@ void ScreenWindow::notifyOutputChanged() emit outputChanged(); } +void ScreenWindow::handleCommandFromKeyboard(KeyboardTranslator::Command command) +{ + // Keyboard-based navigation + bool update = false; + + // EraseCommand is handled in Vt102Emulation + if ( command & KeyboardTranslator::ScrollPageUpCommand ) + { + scrollBy( ScreenWindow::ScrollPages , -1 ); + update = true; + } + if ( command & KeyboardTranslator::ScrollPageDownCommand ) + { + scrollBy( ScreenWindow::ScrollPages , 1 ); + update = true; + } + if ( command & KeyboardTranslator::ScrollLineUpCommand ) + { + scrollBy( ScreenWindow::ScrollLines , -1 ); + update = true; + } + if ( command & KeyboardTranslator::ScrollLineDownCommand ) + { + scrollBy( ScreenWindow::ScrollLines , 1 ); + update = true; + } + if ( command & KeyboardTranslator::ScrollDownToBottomCommand ) + { + Q_EMIT scrollToEnd(); + update = true; + } + if ( command & KeyboardTranslator::ScrollUpToTopCommand) + { + scrollTo(0); + update = true; + } + // TODO: KeyboardTranslator::ScrollLockCommand + // TODO: KeyboardTranslator::SendCommand + + if ( update ) + { + setTrackOutput( atEndOfOutput() ); + + Q_EMIT outputChanged(); + } +} + //#include "ScreenWindow.moc" diff --git a/lib/ScreenWindow.h b/lib/ScreenWindow.h index 87d0840..3a75c08 100644 --- a/lib/ScreenWindow.h +++ b/lib/ScreenWindow.h @@ -27,6 +27,7 @@ // Konsole #include "Character.h" +#include "KeyboardTranslator.h" namespace Konsole { @@ -64,8 +65,8 @@ public: * to notify the window when the associated screen has changed and synchronize selection updates * between all views on a session. */ - ScreenWindow(QObject* parent = 0); - virtual ~ScreenWindow(); + ScreenWindow(QObject* parent = nullptr); + ~ScreenWindow() override; /** Sets the screen which this window looks onto */ void setScreen(Screen* screen); @@ -223,6 +224,8 @@ public slots: */ void notifyOutputChanged(); + void handleCommandFromKeyboard(KeyboardTranslator::Command command); + signals: /** * Emitted when the contents of the associated terminal screen (see screen()) changes. @@ -239,6 +242,8 @@ signals: /** Emitted when the selection is changed. */ void selectionChanged(); + void scrollToEnd(); + private: int endWindowLine() const; void fillUnusedArea(); diff --git a/lib/SearchBar.cpp b/lib/SearchBar.cpp index 7a5e52b..1f69dcc 100644 --- a/lib/SearchBar.cpp +++ b/lib/SearchBar.cpp @@ -81,6 +81,7 @@ void SearchBar::show() { QWidget::show(); widget.searchTextEdit->setFocus(); + widget.searchTextEdit->selectAll(); } void SearchBar::noMatchFound() @@ -97,11 +98,11 @@ void SearchBar::keyReleaseEvent(QKeyEvent* keyEvent) { if (keyEvent->modifiers() == Qt::ShiftModifier) { - findPrevious(); + Q_EMIT findPrevious(); } else { - findNext(); + Q_EMIT findNext(); } } else if (keyEvent->key() == Qt::Key_Escape) @@ -112,8 +113,6 @@ void SearchBar::keyReleaseEvent(QKeyEvent* keyEvent) void SearchBar::clearBackgroundColor() { - QPalette p; - p.setColor(QPalette::Base, Qt::white); - widget.searchTextEdit->setPalette(p); + widget.searchTextEdit->setPalette(QWidget::window()->palette()); } diff --git a/lib/SearchBar.h b/lib/SearchBar.h index 0201173..0f4299b 100644 --- a/lib/SearchBar.h +++ b/lib/SearchBar.h @@ -27,8 +27,8 @@ class SearchBar : public QWidget { Q_OBJECT public: - SearchBar(QWidget* parent = 0); - virtual ~SearchBar(); + SearchBar(QWidget* parent = nullptr); + ~SearchBar() override; virtual void show(); QString searchText(); bool useRegularExpression(); @@ -45,7 +45,7 @@ signals: void findPrevious(); protected: - virtual void keyReleaseEvent(QKeyEvent* keyEvent); + void keyReleaseEvent(QKeyEvent* keyEvent) override; private slots: void clearBackgroundColor(); diff --git a/lib/Session.cpp b/lib/Session.cpp index 3776fc5..1e185e7 100644 --- a/lib/Session.cpp +++ b/lib/Session.cpp @@ -26,7 +26,7 @@ #include "Session.h" // Standard -#include +#include // Qt #include @@ -53,8 +53,8 @@ int Session::lastSessionId = 0; Session::Session(QObject* parent) : QObject(parent), - _shellProcess(0) - , _emulation(0) + _shellProcess(nullptr) + , _emulation(nullptr) , _monitorActivity(false) , _monitorSilence(false) , _notifiedActivity(false) @@ -148,7 +148,7 @@ bool Session::isRunning() const return _shellProcess->state() == QProcess::Running; } -void Session::setCodec(QTextCodec * codec) +void Session::setCodec(QTextCodec * codec) const { emulation()->setCodec(codec); } @@ -177,10 +177,10 @@ void Session::addView(TerminalDisplay * widget) _views.append(widget); - if ( _emulation != 0 ) { + if ( _emulation != nullptr ) { // connect emulation - view signals and slots - connect( widget , SIGNAL(keyPressedSignal(QKeyEvent *)) , _emulation , - SLOT(sendKeyEvent(QKeyEvent *)) ); + connect( widget , &TerminalDisplay::keyPressedSignal, _emulation , + &Emulation::sendKeyEvent); connect( widget , SIGNAL(mouseSignal(int,int,int,int)) , _emulation , SLOT(sendMouseEvent(int,int,int,int)) ); connect( widget , SIGNAL(sendStringToEmu(const char *)) , _emulation , @@ -225,19 +225,19 @@ void Session::removeView(TerminalDisplay * widget) { _views.removeAll(widget); - disconnect(widget,0,this,0); + disconnect(widget,nullptr,this,nullptr); - if ( _emulation != 0 ) { + if ( _emulation != nullptr ) { // disconnect // - key presses signals from widget // - mouse activity signals from widget // - string sending signals from widget // // ... and any other signals connected in addView() - disconnect( widget, 0, _emulation, 0); + disconnect( widget, nullptr, _emulation, nullptr); // disconnect state change signals emitted by emulation - disconnect( _emulation , 0 , widget , 0); + disconnect( _emulation , nullptr , widget , nullptr); } // close the session automatically when the last view is removed @@ -456,10 +456,7 @@ void Session::monitorTimerDone() void Session::activityStateSet(int state) { if (state==NOTIFYBELL) { - QString s; - s.sprintf("Bell in session '%s'",_nameTitle.toUtf8().data()); - - emit bellRequest( s ); + emit bellRequest(tr("Bell in session '%1'").arg(_nameTitle)); } else if (state==NOTIFYACTIVITY) { if (_monitorSilence) { _monitorTimer->start(_silenceSeconds*1000); @@ -547,7 +544,7 @@ void Session::refresh() bool Session::sendSignal(int signal) { - int result = ::kill(_shellProcess->pid(),signal); + int result = ::kill(static_cast(_shellProcess->processId()),signal); if ( result == 0 ) { @@ -573,6 +570,11 @@ void Session::sendText(const QString & text) const _emulation->sendText(text); } +void Session::sendKeyEvent(QKeyEvent* e) const +{ + _emulation->sendKeyEvent(e, false); +} + Session::~Session() { delete _emulation; @@ -598,24 +600,24 @@ void Session::done(int exitStatus) return; } + // message is not being used. But in the original kpty.cpp file + // (https://cgit.kde.org/kpty.git/) it's part of a notification. + // So, we make it translatable, hoping that in the future it will + // be used in some kind of notification. QString message; if (!_wantedClose || exitStatus != 0) { if (_shellProcess->exitStatus() == QProcess::NormalExit) { - message.sprintf("Session '%s' exited with status %d.", - _nameTitle.toUtf8().data(), exitStatus); + message = tr("Session '%1' exited with status %2.").arg(_nameTitle).arg(exitStatus); } else { - message.sprintf("Session '%s' crashed.", - _nameTitle.toUtf8().data()); + message = tr("Session '%1' crashed.").arg(_nameTitle); } } - if ( !_wantedClose && _shellProcess->exitStatus() != QProcess::NormalExit ) { - message.sprintf("Session '%s' exited unexpectedly.", - _nameTitle.toUtf8().data()); - } - - emit finished(); + if ( !_wantedClose && _shellProcess->exitStatus() != QProcess::NormalExit ) + message = tr("Session '%1' exited unexpectedly.").arg(_nameTitle); + else + emit finished(); } Emulation * Session::emulation() const @@ -977,7 +979,7 @@ bool Session::updateForegroundProcessInfo() int Session::processId() const { - return _shellProcess->pid(); + return static_cast(_shellProcess->processId()); } int Session::getPtySlaveFd() const { @@ -1065,8 +1067,7 @@ void SessionGroup::setMasterStatus(Session * session, bool master) bool wasMaster = _sessions[session]; _sessions[session] = master; - if ((!wasMaster && !master) - || (wasMaster && master)) { + if (wasMaster == master) { return; } @@ -1084,7 +1085,7 @@ void SessionGroup::setMasterStatus(Session * session, bool master) } } -void SessionGroup::connectPair(Session * master , Session * other) +void SessionGroup::connectPair(Session * master , Session * other) const { // qDebug() << k_funcinfo; @@ -1095,7 +1096,7 @@ void SessionGroup::connectPair(Session * master , Session * other) SLOT(sendString(const char *,int)) ); } } -void SessionGroup::disconnectPair(Session * master , Session * other) +void SessionGroup::disconnectPair(Session * master , Session * other) const { // qDebug() << k_funcinfo; diff --git a/lib/Session.h b/lib/Session.h index b577d69..79f2f94 100644 --- a/lib/Session.h +++ b/lib/Session.h @@ -72,8 +72,8 @@ public: * falls back to using the program specified in the SHELL environment * variable. */ - Session(QObject* parent = 0); - virtual ~Session(); + Session(QObject* parent = nullptr); + ~Session() override; /** * Returns true if the session is currently running. This will be true @@ -315,6 +315,8 @@ public: */ void sendText(const QString & text) const; + void sendKeyEvent(QKeyEvent* e) const; + /** * Returns the process id of the terminal process. * This is the id used by the system API to refer to the process. @@ -349,7 +351,7 @@ public: void setSize(const QSize & size); /** Sets the text codec used by this session's terminal emulation. */ - void setCodec(QTextCodec * codec); + void setCodec(QTextCodec * codec) const; /** * Sets whether the session has a dark background or not. The session @@ -595,7 +597,7 @@ public: /** Constructs an empty session group. */ SessionGroup(); /** Destroys the session group and removes all connections between master and slave sessions. */ - ~SessionGroup(); + ~SessionGroup() override; /** Adds a session to the group. */ void addSession( Session * session ); @@ -643,8 +645,8 @@ public: int masterMode() const; private: - void connectPair(Session * master , Session * other); - void disconnectPair(Session * master , Session * other); + void connectPair(Session * master , Session * other) const; + void disconnectPair(Session * master , Session * other) const; void connectAll(bool connect); QList masters() const; diff --git a/lib/ShellCommand.cpp b/lib/ShellCommand.cpp index 5b86537..03afa45 100644 --- a/lib/ShellCommand.cpp +++ b/lib/ShellCommand.cpp @@ -59,9 +59,8 @@ ShellCommand::ShellCommand(const QString & fullCommand) } } ShellCommand::ShellCommand(const QString & command , const QStringList & arguments) + : _arguments(arguments) { - _arguments = arguments; - if ( !_arguments.isEmpty() ) { _arguments[0] = command; } diff --git a/lib/TerminalCharacterDecoder.cpp b/lib/TerminalCharacterDecoder.cpp index 7ce8c78..fd65807 100644 --- a/lib/TerminalCharacterDecoder.cpp +++ b/lib/TerminalCharacterDecoder.cpp @@ -34,9 +34,11 @@ // Konsole #include "konsole_wcwidth.h" +#include + using namespace Konsole; PlainTextDecoder::PlainTextDecoder() - : _output(0) + : _output(nullptr) , _includeTrailingWhitespace(true) , _recordLinePositions(false) { @@ -58,7 +60,7 @@ void PlainTextDecoder::begin(QTextStream* output) } void PlainTextDecoder::end() { - _output = 0; + _output = nullptr; } void PlainTextDecoder::setRecordLinePositions(bool record) @@ -80,6 +82,16 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count, _linePositions << pos; } + // check the real length + for (int i = 0 ; i < count ; i++) + { + if (characters + i == nullptr) + { + count = i; + break; + } + } + //TODO should we ignore or respect the LINE_WRAPPED line property? //note: we build up a QString and send it to the text stream rather writing into the text @@ -112,7 +124,7 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count, } HTMLDecoder::HTMLDecoder() : - _output(0) + _output(nullptr) ,_colorTable(base_color_table) ,_innerSpanOpen(false) ,_lastRendition(DEFAULT_RENDITION) @@ -142,7 +154,7 @@ void HTMLDecoder::end() *_output << QString::fromStdWString(text); - _output = 0; + _output = nullptr; } diff --git a/lib/TerminalCharacterDecoder.h b/lib/TerminalCharacterDecoder.h index a73e9a1..c49b3d4 100644 --- a/lib/TerminalCharacterDecoder.h +++ b/lib/TerminalCharacterDecoder.h @@ -92,12 +92,12 @@ public: /** Enables recording of character positions at which new lines are added. See linePositions() */ void setRecordLinePositions(bool record); - virtual void begin(QTextStream* output); - virtual void end(); + void begin(QTextStream* output) override; + void end() override; - virtual void decodeLine(const Character* const characters, + void decodeLine(const Character* const characters, int count, - LineProperty properties); + LineProperty properties) override; private: @@ -125,12 +125,12 @@ public: */ void setColorTable( const ColorEntry* table ); - virtual void decodeLine(const Character* const characters, + void decodeLine(const Character* const characters, int count, - LineProperty properties); + LineProperty properties) override; - virtual void begin(QTextStream* output); - virtual void end(); + void begin(QTextStream* output) override; + void end() override; private: void openSpan(std::wstring& text , const QString& style); diff --git a/lib/TerminalDisplay.cpp b/lib/TerminalDisplay.cpp index 521a950..2484d10 100644 --- a/lib/TerminalDisplay.cpp +++ b/lib/TerminalDisplay.cpp @@ -23,7 +23,11 @@ // Own #include "TerminalDisplay.h" +// C++ +#include + // Qt +#include #include #include #include @@ -34,8 +38,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -82,17 +88,17 @@ const ColorEntry Konsole::base_color_table[TABLE_COLORS] = { // Fixme: could add faint colors here, also. // normal - ColorEntry(QColor(0x00,0x00,0x00), 0), ColorEntry( QColor(0xB2,0xB2,0xB2), 1), // Dfore, Dback - ColorEntry(QColor(0x00,0x00,0x00), 0), ColorEntry( QColor(0xB2,0x18,0x18), 0), // Black, Red - ColorEntry(QColor(0x18,0xB2,0x18), 0), ColorEntry( QColor(0xB2,0x68,0x18), 0), // Green, Yellow - ColorEntry(QColor(0x18,0x18,0xB2), 0), ColorEntry( QColor(0xB2,0x18,0xB2), 0), // Blue, Magenta - ColorEntry(QColor(0x18,0xB2,0xB2), 0), ColorEntry( QColor(0xB2,0xB2,0xB2), 0), // Cyan, White + ColorEntry(QColor(0x00,0x00,0x00), false), ColorEntry( QColor(0xB2,0xB2,0xB2), true), // Dfore, Dback + ColorEntry(QColor(0x00,0x00,0x00), false), ColorEntry( QColor(0xB2,0x18,0x18), false), // Black, Red + ColorEntry(QColor(0x18,0xB2,0x18), false), ColorEntry( QColor(0xB2,0x68,0x18), false), // Green, Yellow + ColorEntry(QColor(0x18,0x18,0xB2), false), ColorEntry( QColor(0xB2,0x18,0xB2), false), // Blue, Magenta + ColorEntry(QColor(0x18,0xB2,0xB2), false), ColorEntry( QColor(0xB2,0xB2,0xB2), false), // Cyan, White // intensiv - ColorEntry(QColor(0x00,0x00,0x00), 0), ColorEntry( QColor(0xFF,0xFF,0xFF), 1), - ColorEntry(QColor(0x68,0x68,0x68), 0), ColorEntry( QColor(0xFF,0x54,0x54), 0), - ColorEntry(QColor(0x54,0xFF,0x54), 0), ColorEntry( QColor(0xFF,0xFF,0x54), 0), - ColorEntry(QColor(0x54,0x54,0xFF), 0), ColorEntry( QColor(0xFF,0x54,0xFF), 0), - ColorEntry(QColor(0x54,0xFF,0xFF), 0), ColorEntry( QColor(0xFF,0xFF,0xFF), 0) + ColorEntry(QColor(0x00,0x00,0x00), false), ColorEntry( QColor(0xFF,0xFF,0xFF), true), + ColorEntry(QColor(0x68,0x68,0x68), false), ColorEntry( QColor(0xFF,0x54,0x54), false), + ColorEntry(QColor(0x54,0xFF,0x54), false), ColorEntry( QColor(0xFF,0xFF,0x54), false), + ColorEntry(QColor(0x54,0x54,0xFF), false), ColorEntry( QColor(0xFF,0x54,0xFF), false), + ColorEntry(QColor(0x54,0xFF,0xFF), false), ColorEntry( QColor(0xFF,0xFF,0xFF), false) }; // scroll increment used when dragging selection at top/bottom of window. @@ -128,21 +134,16 @@ void TerminalDisplay::setScreenWindow(ScreenWindow* window) // disconnect existing screen window if any if ( _screenWindow ) { - disconnect( _screenWindow , 0 , this , 0 ); + disconnect( _screenWindow , nullptr , this , nullptr ); } _screenWindow = window; if ( window ) { - -// TODO: Determine if this is an issue. -// TODO: Those two connections caused an additional painting. Determine if this is an issue. -//#warning "The order here is not specified - does it matter whether updateImage or updateLineProperties comes first?" - connect( _screenWindow , SIGNAL(outputChanged()) , this , SLOT(updateLineProperties()) ); - connect( _screenWindow , SIGNAL(outputChanged()) , this , SLOT(updateImage()) ); - //connect( _screenWindow , SIGNAL(outputChanged()) , this , SLOT(updateFilters()) ); - //connect( _screenWindow , SIGNAL(scrolled(int)) , this , SLOT(updateFilters()) ); + connect(_screenWindow, &ScreenWindow::outputChanged, this, &TerminalDisplay::updateLineProperties); + connect(_screenWindow, &ScreenWindow::outputChanged, this, &TerminalDisplay::updateImage); + connect(_screenWindow, &ScreenWindow::scrollToEnd, this, &TerminalDisplay::scrollToEnd); window->setWindowLines(_lines); } } @@ -195,10 +196,12 @@ void TerminalDisplay::setColorTable(const ColorEntry table[]) QCodec. */ -static inline bool isLineChar(wchar_t c) { return ((c & 0xFF80) == 0x2500);} -static inline bool isLineCharString(const std::wstring& string) -{ - return (string.length() > 0) && (isLineChar(string[0])); +bool TerminalDisplay::isLineChar(wchar_t c) const { + return _drawLineChars && ((c & 0xFF80) == 0x2500); +} + +bool TerminalDisplay::isLineCharString(const std::wstring& string) const { + return (string.length() > 0) && (isLineChar(string[0])); } @@ -245,6 +248,22 @@ void TerminalDisplay::fontChange(const QFont&) update(); } +//void TerminalDisplay::calDrawTextAdditionHeight(QPainter& painter) +//{ +// QRect test_rect, feedback_rect; +// test_rect.setRect(1, 1, _fontWidth * 4, _fontHeight); +// painter.drawText(test_rect, Qt::AlignBottom, LTR_OVERRIDE_CHAR + QLatin1String("Mq"), &feedback_rect); + +// //qDebug() << "test_rect:" << test_rect << "feeback_rect:" << feedback_rect; + +// _drawTextAdditionHeight = (feedback_rect.height() - _fontHeight) / 2; +// if(_drawTextAdditionHeight < 0) { +// _drawTextAdditionHeight = 0; +// } + +// _drawTextTestFlag = false; +//} + void TerminalDisplay::setVTFont(const QFont& f) { QFont font = f; @@ -300,9 +319,9 @@ void TerminalDisplay::setFont(const QFont &f) TerminalDisplay::TerminalDisplay(QQuickItem *parent) :QQuickPaintedItem(parent) -,_screenWindow(0) +,_screenWindow(nullptr) ,_allowBell(true) -,_gridLayout(0) +,_gridLayout(nullptr) ,_fontHeight(1) ,_fontWidth(1) ,_fontAscent(1) @@ -313,13 +332,14 @@ TerminalDisplay::TerminalDisplay(QQuickItem *parent) ,_usedColumns(1) ,_contentHeight(1) ,_contentWidth(1) -,_image(0) +,_image(nullptr) ,_randomSeed(0) ,_resizing(false) ,_terminalSizeHint(false) ,_terminalSizeStartup(true) ,_bidiEnabled(false) ,_mouseMarks(false) +,_disabledBracketedPasteMode(false) ,_actSel(0) ,_wordSelectionMode(false) ,_lineSelectionMode(false) @@ -337,13 +357,14 @@ TerminalDisplay::TerminalDisplay(QQuickItem *parent) ,_tripleClickMode(SelectWholeLine) ,_isFixedSize(false) ,_possibleTripleClick(false) -,_resizeWidget(0) -,_resizeTimer(0) +,_resizeWidget(nullptr) +,_resizeTimer(nullptr) ,_flowControlWarningEnabled(false) -,_outputSuspendedLabel(0) +,_outputSuspendedLabel(nullptr) ,_lineSpacing(0) ,_colorsInverted(false) -,_blendColor(qRgba(0,0,0,0xff)) +,_opacity(static_cast(1)) +,_backgroundMode(None) ,_filterChain(new TerminalImageFilterChain()) ,_cursorShape(Emulation::KeyboardCursorShape::BlockCursor) ,mMotionAfterPasting(NoMoveScreenWindow) @@ -352,6 +373,7 @@ TerminalDisplay::TerminalDisplay(QQuickItem *parent) ,m_full_cursor_height(false) ,_leftBaseMargin(1) ,_topBaseMargin(1) +,_drawLineChars(true) { // terminal applications are not designed with Right-To-Left in mind, // so the layout is forced to Left-To-Right @@ -638,7 +660,7 @@ static void drawOtherChar(QPainter& paint, int x, int y, int w, int h, uchar cod } void TerminalDisplay::drawLineCharString( QPainter& painter, int x, int y, const std::wstring& str, - const Character* attributes) + const Character* attributes) const { const QPen& currentPen = painter.pen(); @@ -689,24 +711,10 @@ QColor TerminalDisplay::keyboardCursorColor() const void TerminalDisplay::setOpacity(qreal opacity) { - QColor color(_blendColor); - color.setAlphaF(opacity); - - // enable automatic background filling to prevent the display - // flickering if there is no transparency - /*if ( color.alpha() == 255 ) - { - setAutoFillBackground(true); - } - else - { - setAutoFillBackground(false); - }*/ - - _blendColor = color.rgba(); + _opacity = qBound(static_cast(0), opacity, static_cast(1)); } -void TerminalDisplay::setBackgroundImage(QString backgroundImage) +void TerminalDisplay::setBackgroundImage(const QString& backgroundImage) { if (!backgroundImage.isEmpty()) { @@ -720,16 +728,21 @@ void TerminalDisplay::setBackgroundImage(QString backgroundImage) } } +void TerminalDisplay::setBackgroundMode(BackgroundMode mode) +{ + _backgroundMode = mode; +} + void TerminalDisplay::drawBackground(QPainter& painter, const QRect& rect, const QColor& backgroundColor, bool useOpacitySetting ) { // The whole widget rectangle is filled by the background color from // the color scheme set in setColorTable(), while the scrollbar is // left to the widget style for a consistent look. - if ( HAVE_TRANSPARENCY && qAlpha(_blendColor) < 0xff && useOpacitySetting ) + if ( useOpacitySetting ) { if (_backgroundImage.isNull()) { QColor color(backgroundColor); - color.setAlpha(qAlpha(_blendColor)); + color.setAlphaF(_opacity); painter.save(); painter.setCompositionMode(QPainter::CompositionMode_Source); @@ -762,16 +775,18 @@ void TerminalDisplay::drawCursor(QPainter& painter, { // draw the cursor outline, adjusting the area so that // it is draw entirely inside 'rect' - int penWidth = qMax(1,painter.pen().width()); + float penWidth = qMax(1,painter.pen().width()); - // QMLTermWidget: we need to add penWidth%2 to have a perfectly squared cursor -// painter.drawRect(cursorRect.adjusted(penWidth/2 + penWidth%2, -// penWidth/2 + penWidth%2, + // + painter.drawRect( + cursorRect.adjusted( + + penWidth/2 + fmod(penWidth, 2), + + penWidth/2 + fmod(penWidth, 2), + - penWidth/2 - fmod(penWidth, 2), + - penWidth/2 - fmod(penWidth, 2) + ) + ); - painter.drawRect(cursorRect.adjusted(+ penWidth/2 + penWidth%2, - + penWidth/2 + penWidth%2, - - penWidth/2 - penWidth%2, - - penWidth/2 - penWidth%2)); //if ( hasFocus() ) if ( true ) //QMLTermWidget: Always fill the cursor. Even when not in focus. { @@ -941,7 +956,7 @@ void TerminalDisplay::scrollImage(int lines , const QRect& screenWindowRegion) // return if there is nothing to do if ( lines == 0 - || _image == 0 + || _image == nullptr || !region.isValid() || (region.top() + abs(lines)) >= region.bottom() || this->_lines <= region.height() ) return; @@ -960,8 +975,10 @@ void TerminalDisplay::scrollImage(int lines , const QRect& screenWindowRegion) // Set the QT_FLUSH_PAINT environment variable to '1' before starting the // application to monitor repainting. // - int scrollBarWidth = _scrollBar->isHidden() ? 0 : _scrollBar->width(); - const int SCROLLBAR_CONTENT_GAP = 1; + int scrollBarWidth = _scrollBar->isHidden() ? 0 : + _scrollBar->style()->styleHint(QStyle::SH_ScrollBar_Transient, nullptr, _scrollBar) ? + 0 : _scrollBar->width(); + const int SCROLLBAR_CONTENT_GAP = scrollBarWidth == 0 ? 0 : 1; QRect scrollRect; if ( _scrollbarLocation == QTermWidget::ScrollBarLeft ) { @@ -1362,8 +1379,7 @@ void TerminalDisplay::focusInEvent(QFocusEvent*) _blinkTimer->start(); } -// TODO QMLTERMWIDGET We should double check if we need this to fix the vertical truncation issue. - +// QMLTermWidget version. See the upstream commented version for reference. void TerminalDisplay::paint(QPainter *painter) { QRect clipRect = painter->clipBoundingRect().toAlignedRect(); @@ -1371,12 +1387,114 @@ void TerminalDisplay::paint(QPainter *painter) drawContents(*painter, dirtyRect); } +// qtermwidget upstream version, might be useful for reference. +//void TerminalDisplay::paintEvent( QPaintEvent* pe ) +//{ +// QPainter paint(this); +// QRect cr = contentsRect(); + +// if ( !_backgroundImage.isNull() ) +// { +// QColor background = _colorTable[DEFAULT_BACK_COLOR].color; +// if (_opacity < static_cast(1)) +// { +// background.setAlphaF(_opacity); +// paint.save(); +// paint.setCompositionMode(QPainter::CompositionMode_Source); +// paint.fillRect(cr, background); +// paint.restore(); +// } +// else +// { +// paint.fillRect(cr, background); +// } + +// paint.save(); +// paint.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); + +// if (_backgroundMode == Stretch) +// { // scale the image without keeping its proportions to fill the screen +// paint.drawPixmap(cr, _backgroundImage, _backgroundImage.rect()); +// } +// else if (_backgroundMode == Zoom) +// { // zoom in/out the image to fit it +// QRect r = _backgroundImage.rect(); +// qreal wRatio = static_cast(cr.width()) / r.width(); +// qreal hRatio = static_cast(cr.height()) / r.height(); +// if (wRatio > hRatio) +// { +// r.setWidth(qRound(r.width() * hRatio)); +// r.setHeight(cr.height()); +// } +// else +// { +// r.setHeight(qRound(r.height() * wRatio)); +// r.setWidth(cr.width()); +// } +// r.moveCenter(cr.center()); +// paint.drawPixmap(r, _backgroundImage, _backgroundImage.rect()); +// } +// else if (_backgroundMode == Fit) +// { // if the image is bigger than the terminal, zoom it out to fit it +// QRect r = _backgroundImage.rect(); +// qreal wRatio = static_cast(cr.width()) / r.width(); +// qreal hRatio = static_cast(cr.height()) / r.height(); +// if (r.width() > cr.width()) +// { +// if (wRatio <= hRatio) +// { +// r.setHeight(qRound(r.height() * wRatio)); +// r.setWidth(cr.width()); +// } +// else +// { +// r.setWidth(qRound(r.width() * hRatio)); +// r.setHeight(cr.height()); +// } +// } +// else if (r.height() > cr.height()) +// { +// r.setWidth(qRound(r.width() * hRatio)); +// r.setHeight(cr.height()); +// } +// r.moveCenter(cr.center()); +// paint.drawPixmap(r, _backgroundImage, _backgroundImage.rect()); +// } +// else if (_backgroundMode == Center) +// { // center the image without scaling/zooming +// QRect r = _backgroundImage.rect(); +// r.moveCenter(cr.center()); +// paint.drawPixmap(r.topLeft(), _backgroundImage); +// } +// else //if (_backgroundMode == None) +// { +// paint.drawPixmap(0, 0, _backgroundImage); +// } + +// paint.restore(); +// } + +// if(_drawTextTestFlag) +// { +// calDrawTextAdditionHeight(paint); +// } + +// const auto rects = (pe->region() & cr).rects(); +// for (const QRect &rect : rects) +// { +// drawBackground(paint,rect,palette().background().color(), +// true /* use opacity setting */); +// drawContents(paint, rect); +// } +// drawInputMethodPreeditString(paint,preeditRect()); +// paintFilters(paint); + QPoint TerminalDisplay::cursorPosition() const { if (_screenWindow) return _screenWindow->cursorPosition(); else - return QPoint(0,0); + return {0,0}; } QRect TerminalDisplay::preeditRect() const @@ -1384,7 +1502,7 @@ QRect TerminalDisplay::preeditRect() const const int preeditLength = string_width(_inputMethodData.preeditString); if ( preeditLength == 0 ) - return QRect(); + return {}; return QRect(_leftMargin + _fontWidth*cursorPosition().x(), _topMargin + _fontHeight*cursorPosition().y(), @@ -1546,10 +1664,10 @@ QRect TerminalDisplay::calculateTextArea(int topLeftX, int topLeftY, int startCo int left = _fixedFont ? _fontWidth * startColumn : textWidth(0, startColumn, line); int top = _fontHeight * line; int width = _fixedFont ? _fontWidth * length : textWidth(startColumn, length, line); - return QRect(_leftMargin + topLeftX + left, + return {_leftMargin + topLeftX + left, _topMargin + topLeftY + top, width, - _fontHeight); + _fontHeight}; } void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect) @@ -1954,14 +2072,14 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev) } } -QList TerminalDisplay::filterActions(const QPoint& position, QWidget* parent) +QList TerminalDisplay::filterActions(const QPoint& position) { int charLine, charColumn; getCharacterPosition(position,charLine,charColumn); Filter::HotSpot* spot = _filterChain->hotSpotAt(charLine,charColumn); - return spot ? spot->actions(parent) : QList(); + return spot ? spot->actions() : QList(); } void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev) @@ -2337,26 +2455,24 @@ void TerminalDisplay::mouseReleaseEvent(QMouseEvent* ev) void TerminalDisplay::getCharacterPosition(const QPoint& widgetPoint,int& line,int& column) const { line = (widgetPoint.y()-contentsRect().top()-_topMargin) / _fontHeight; + if (line < 0) + line = 0; + if (line >= _usedLines) + line = _usedLines - 1; + int x = widgetPoint.x() + _fontWidth / 2 - contentsRect().left() - _leftMargin; if ( _fixedFont ) - column = (widgetPoint.x() + _fontWidth/2 -contentsRect().left()-_leftMargin) / _fontWidth; + column = x / _fontWidth; else { - int x = contentsRect().left() + widgetPoint.x() - _fontWidth/2; column = 0; - - while(x > textWidth(0, column, line)) + while(column + 1 < _usedColumns && x > textWidth(0, column + 1, line)) column++; } - if ( line < 0 ) - line = 0; if ( column < 0 ) column = 0; - if ( line >= _usedLines ) - line = _usedLines-1; - // the column value returned can be equal to _usedColumns, which // is the position just after the last character displayed in a line. // @@ -2503,7 +2619,7 @@ void TerminalDisplay::wheelEvent( QWheelEvent* ev ) QKeyEvent keyScrollEvent(QEvent::KeyPress,key,Qt::NoModifier); for (int i=0;itext(useXselection ? QClipboard::Selection : QClipboard::Clipboard); - if(appendReturn) - text.append(QLatin1Char('\r')); if ( ! text.isEmpty() ) { + text.replace(QLatin1String("\r\n"), QLatin1String("\n")); text.replace(QLatin1Char('\n'), QLatin1Char('\r')); + + if (_trimPastedTrailingNewlines) { + text.replace(QRegularExpression(QStringLiteral("\\r+$")), QString()); + } + + // TODO QMLTERMWIDGET We should expose this as a signal. +// if (_confirmMultilinePaste && text.contains(QLatin1Char('\r'))) { +// QMessageBox confirmation(this); +// confirmation.setWindowTitle(tr("Paste multiline text")); +// confirmation.setText(tr("Are you sure you want to paste this text?")); +// confirmation.setDetailedText(text); +// confirmation.setStandardButtons(QMessageBox::Yes | QMessageBox::No); +// // Click "Show details..." to show those by default +// const auto buttons = confirmation.buttons(); +// for( QAbstractButton * btn : buttons ) { +// if (confirmation.buttonRole(btn) == QMessageBox::ActionRole && btn->text() == QMessageBox::tr("Show Details...")) { +// Q_EMIT btn->clicked(); +// break; +// } +// } +// confirmation.setDefaultButton(QMessageBox::Yes); +// confirmation.exec(); +// if (confirmation.standardButton(confirmation.clickedButton()) != QMessageBox::Yes) { +// return; +// } +// } + bracketText(text); + + // appendReturn is intentionally handled _after_ enclosing texts with brackets as + // that feature is used to allow execution of commands immediately after paste. + // Ref: https://bugs.kde.org/show_bug.cgi?id=16179 + // Ref: https://github.com/KDE/konsole/commit/83d365f2ebfe2e659c1e857a2f5f247c556ab571 + if(appendReturn) { + text.append(QLatin1Char('\r')); + } + QKeyEvent e(QEvent::KeyPress, 0, Qt::NoModifier, text); - emit keyPressedSignal(&e); // expose as a big fat keypress event + emit keyPressedSignal(&e, true); // expose as a big fat keypress event _screenWindow->clearSelection(); + + switch(mMotionAfterPasting) + { + case MoveStartScreenWindow: + // Temporarily stop tracking output, or pasting contents triggers + // ScreenWindow::notifyOutputChanged() and the latter scrolls the + // terminal to the last line. It will be re-enabled when needed + // (e.g., scrolling to the last line). + _screenWindow->setTrackOutput(false); + _screenWindow->scrollTo(0); + break; + case MoveEndScreenWindow: + scrollToEnd(); + break; + case NoMoveScreenWindow: + break; + } } } -void TerminalDisplay::bracketText(QString& text) +void TerminalDisplay::bracketText(QString& text) const { - if (bracketedPasteMode()) + if (bracketedPasteMode() && !_disabledBracketedPasteMode) { text.prepend(QLatin1String("\033[200~")); text.append(QLatin1String("\033[201~")); @@ -2673,7 +2841,10 @@ void TerminalDisplay::bracketText(QString& text) void TerminalDisplay::setSelection(const QString& t) { - QApplication::clipboard()->setText(t, QClipboard::Selection); + if (QApplication::clipboard()->supportsSelection()) + { + QApplication::clipboard()->setText(t, QClipboard::Selection); + } } void TerminalDisplay::copyClipboard() @@ -2696,6 +2867,15 @@ void TerminalDisplay::pasteSelection() emitSelection(true,false); } + +void TerminalDisplay::setConfirmMultilinePaste(bool confirmMultilinePaste) { + _confirmMultilinePaste = confirmMultilinePaste; +} + +void TerminalDisplay::setTrimPastedTrailingNewlines(bool trimPastedTrailingNewlines) { + _trimPastedTrailingNewlines = trimPastedTrailingNewlines; +} + /* ------------------------------------------------------------------------- */ /* */ /* Keyboard */ @@ -2724,52 +2904,6 @@ int TerminalDisplay::motionAfterPasting() void TerminalDisplay::keyPressEvent( QKeyEvent* event ) { - bool emitKeyPressSignal = true; - - // Keyboard-based navigation - if ( event->modifiers() == Qt::ShiftModifier ) - { - bool update = true; - - if ( event->key() == Qt::Key_PageUp ) - { - _screenWindow->scrollBy( ScreenWindow::ScrollPages , -1 ); - } - else if ( event->key() == Qt::Key_PageDown ) - { - _screenWindow->scrollBy( ScreenWindow::ScrollPages , 1 ); - } - else if ( event->key() == Qt::Key_Up ) - { - _screenWindow->scrollBy( ScreenWindow::ScrollLines , -1 ); - } - else if ( event->key() == Qt::Key_Down ) - { - _screenWindow->scrollBy( ScreenWindow::ScrollLines , 1 ); - } - else if ( event->key() == Qt::Key_End) - { - scrollToEnd(); - } - else if ( event->key() == Qt::Key_Home) - { - _screenWindow->scrollTo(0); - } - else - update = false; - - if ( update ) - { - _screenWindow->setTrackOutput( _screenWindow->atEndOfOutput() ); - - updateLineProperties(); - updateImage(); - - // do not send key press to terminal - emitKeyPressSignal = false; - } - } - _actSel=0; // Key stroke implies a screen update, so TerminalDisplay won't // know where the current selection is. @@ -2782,31 +2916,7 @@ void TerminalDisplay::keyPressEvent( QKeyEvent* event ) _cursorBlinking = false; } - if ( emitKeyPressSignal ) - { - emit keyPressedSignal(event); - - if(event->modifiers().testFlag(Qt::ShiftModifier) - || event->modifiers().testFlag(Qt::ControlModifier) - || event->modifiers().testFlag(Qt::AltModifier)) - { - switch(mMotionAfterPasting) - { - case MoveStartScreenWindow: - _screenWindow->scrollTo(0); - break; - case MoveEndScreenWindow: - scrollToEnd(); - break; - case NoMoveScreenWindow: - break; - } - } - else - { - scrollToEnd(); - } - } + emit keyPressedSignal(event, false); event->accept(); } @@ -2814,7 +2924,7 @@ void TerminalDisplay::keyPressEvent( QKeyEvent* event ) void TerminalDisplay::inputMethodEvent( QInputMethodEvent* event ) { QKeyEvent keyEvent(QEvent::KeyPress,0,Qt::NoModifier,event->commitString()); - emit keyPressedSignal(&keyEvent); + emit keyPressedSignal(&keyEvent, false); _inputMethodData.preeditString = event->preeditString().toStdWString(); update(preeditRect() | _inputMethodData.previousPreeditRect); @@ -3408,7 +3518,7 @@ void TerminalDisplay::simulateKeyPress(int key, int modifiers, bool pressed, qui Q_UNUSED(nativeScanCode); QEvent::Type type = pressed ? QEvent::KeyPress : QEvent::KeyRelease; QKeyEvent event = QKeyEvent(type, key, (Qt::KeyboardModifier) modifiers, text); - keyPressedSignal(&event); + keyPressedSignal(&event, false); } void TerminalDisplay::simulateKeySequence(const QKeySequence &keySequence) @@ -3417,7 +3527,7 @@ void TerminalDisplay::simulateKeySequence(const QKeySequence &keySequence) const Qt::Key key = Qt::Key(keySequence[i] & ~Qt::KeyboardModifierMask); const Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(keySequence[i] & Qt::KeyboardModifierMask); QKeyEvent eventPress = QKeyEvent(QEvent::KeyPress, key, modifiers, ""); - keyPressedSignal(&eventPress); + keyPressedSignal(&eventPress, false); } } diff --git a/lib/TerminalDisplay.h b/lib/TerminalDisplay.h index 4fbba9b..8e97a5d 100644 --- a/lib/TerminalDisplay.h +++ b/lib/TerminalDisplay.h @@ -67,6 +67,13 @@ namespace Konsole MoveEndScreenWindow = 2 }; + enum BackgroundMode { + None, + Stretch, + Zoom, + Fit, + Center + }; extern unsigned short vt100_graphics[32]; @@ -141,7 +148,10 @@ public: /** /** Sets the background image of the terminal display. */ - void setBackgroundImage(QString backgroundImage); + void setBackgroundImage(const QString& backgroundImage); + + /** Sets the background image mode of the terminal display. */ + void setBackgroundMode(BackgroundMode mode); /** * Specifies whether the terminal display has a vertical scroll bar, and if so whether it @@ -195,7 +205,7 @@ public: * Returns a list of menu actions created by the filters for the content * at the given @p position. */ - QList filterActions(const QPoint& position, QWidget* parent); + QList filterActions(const QPoint& position); /** Returns true if the cursor is set to blink or false otherwise. */ bool blinkingCursor() { return _hasBlinkingCursor; } @@ -233,7 +243,7 @@ public: void emitSelection(bool useXselection,bool appendReturn); /** change and wrap text corresponding to paste mode **/ - void bracketText(QString& text); + void bracketText(QString& text) const; /** * Sets the shape of the keyboard cursor. This is the cursor drawn @@ -388,6 +398,12 @@ public: */ static bool antialias() { return _antialiasText; } + /** + * Specify whether line chars should be drawn by ourselves or left to + * underlying font rendering libraries. + */ + void setDrawLineChars(bool drawLineChars) { _drawLineChars = drawLineChars; } + /** * Specifies whether characters with intense colors should be rendered * as bold. Defaults to true. @@ -444,12 +460,17 @@ public: void setMotionAfterPasting(MotionAfterPasting action); int motionAfterPasting(); + void setConfirmMultilinePaste(bool confirmMultilinePaste); + void setTrimPastedTrailingNewlines(bool trimPastedTrailingNewlines); // maps a point on the widget to the position ( ie. line and column ) // of the character at that point. void getCharacterPosition(const QPoint& widgetPoint,int& line,int& column) const; + void disableBracketedPasteMode(bool disable) { _disabledBracketedPasteMode = disable; } + bool bracketedPasteModeIsDisabled() const { return _disabledBracketedPasteMode; } + public slots: /** @@ -563,7 +584,7 @@ signals: /** * Emitted when the user presses a key whilst the terminal widget has focus. */ - void keyPressedSignal(QKeyEvent *e); + void keyPressedSignal(QKeyEvent *e, bool fromPaste); /** * A mouse event occurred. @@ -621,30 +642,28 @@ signals: void boldIntenseChanged(); protected: - virtual bool event( QEvent * ); + bool event( QEvent * ) override; - //virtual void paintEvent( QPaintEvent * ); - - virtual void showEvent(QShowEvent*); - virtual void hideEvent(QHideEvent*); - virtual void resizeEvent(QResizeEvent*); + void showEvent(QShowEvent*); + void hideEvent(QHideEvent*); + void resizeEvent(QResizeEvent*); virtual void fontChange(const QFont &font); - virtual void focusInEvent(QFocusEvent* event); - virtual void focusOutEvent(QFocusEvent* event); - virtual void keyPressEvent(QKeyEvent* event); - virtual void mouseDoubleClickEvent(QMouseEvent* ev); - virtual void mousePressEvent( QMouseEvent* ); - virtual void mouseReleaseEvent( QMouseEvent* ); - virtual void mouseMoveEvent( QMouseEvent* ); + void focusInEvent(QFocusEvent* event) override; + void focusOutEvent(QFocusEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; + void mouseDoubleClickEvent(QMouseEvent* ev) override; + void mousePressEvent( QMouseEvent* ) override; + void mouseReleaseEvent( QMouseEvent* ) override; + void mouseMoveEvent( QMouseEvent* ) override; virtual void extendSelection( const QPoint& pos ); - virtual void wheelEvent( QWheelEvent* ); + void wheelEvent( QWheelEvent* ) override; - virtual bool focusNextPrevChild( bool next ); + bool focusNextPrevChild( bool next ); // drag and drop - virtual void dragEnterEvent(QDragEnterEvent* event); - virtual void dropEvent(QDropEvent* event); + void dragEnterEvent(QDragEnterEvent* event) override; + void dropEvent(QDropEvent* event) override; void doDrag(); enum DragState { diNone, diPending, diDragging }; @@ -667,8 +686,8 @@ protected: void mouseTripleClickEvent(QMouseEvent* ev); // reimplemented - virtual void inputMethodEvent ( QInputMethodEvent* event ); - virtual QVariant inputMethodQuery( Qt::InputMethodQuery query ) const; + void inputMethodEvent ( QInputMethodEvent* event ) override; + QVariant inputMethodQuery( Qt::InputMethodQuery query ) const override; // QMLTermWidget void paint(QPainter * painter); @@ -722,7 +741,7 @@ private: const Character* style, bool invertCharacterColor); // draws a string of line graphics void drawLineCharString(QPainter& painter, int x, int y, - const std::wstring& str, const Character* attributes); + const std::wstring& str, const Character* attributes) const; // draws the preedit string for input methods void drawInputMethodPreeditString(QPainter& painter , const QRect& rect); @@ -766,6 +785,9 @@ private: bool handleShortcutOverrideEvent(QKeyEvent* event); + bool isLineChar(wchar_t c) const; + bool isLineCharString(const std::wstring& string) const; + // the window onto the terminal screen which this display // is currently showing. QPointer _screenWindow; @@ -811,6 +833,7 @@ private: bool _bidiEnabled; bool _mouseMarks; bool _bracketedPasteMode; + bool _disabledBracketedPasteMode; QPoint _iPntSel; // initial selection point QPoint _pntSel; // current selection point @@ -861,9 +884,10 @@ private: QSize _size; - QRgb _blendColor; + qreal _opacity; QPixmap _backgroundImage; + BackgroundMode _backgroundMode; // list of filters currently applied to the display. used for links and // search highlight @@ -878,6 +902,8 @@ private: MotionAfterPasting mMotionAfterPasting; + bool _confirmMultilinePaste; + bool _trimPastedTrailingNewlines; struct InputMethodData { @@ -930,6 +956,8 @@ private: void setFullCursorHeight(bool val); + bool _drawLineChars; + public: static void setTransparencyEnabled(bool enable) { @@ -945,8 +973,8 @@ Q_OBJECT public: AutoScrollHandler(QWidget* parent); protected: - virtual void timerEvent(QTimerEvent* event); - virtual bool eventFilter(QObject* watched,QEvent* event); + void timerEvent(QTimerEvent* event) override; + bool eventFilter(QObject* watched,QEvent* event) override; private: QWidget* widget() const { return static_cast(parent()); } int _timerId; diff --git a/lib/Vt102Emulation.cpp b/lib/Vt102Emulation.cpp index bd18ca4..2c58a52 100644 --- a/lib/Vt102Emulation.cpp +++ b/lib/Vt102Emulation.cpp @@ -23,6 +23,8 @@ // Own #include "Vt102Emulation.h" #include "mac-vkcode.h" +#include "tools.h" + // XKB //#include @@ -39,13 +41,14 @@ #endif // Standard -#include +#include #include // Qt #include #include #include +#include // KDE //#include @@ -344,7 +347,7 @@ void Vt102Emulation::receiveChar(wchar_t cc) if (epe( )) { processToken( TY_CSI_PE(cc), 0, 0); resetTokenizer(); return; } if (ees(DIG)) { addDigit(cc-'0'); return; } - if (eec(';')) { addArgument(); return; } + if (eec(';') || eec(':')) { addArgument(); return; } for (int i=0;i<=argc;i++) { if (epp()) @@ -416,10 +419,10 @@ void Vt102Emulation::processWindowAttributeChange() return; } - QString newValue; - newValue.reserve(tokenBufferPos-i-2); - for (int j = 0; j < tokenBufferPos-i-2; j++) - newValue[j] = tokenBuffer[i+1+j]; + // copy from the first char after ';', and skipping the ending delimiter + // 0x07 or 0x92. Note that as control characters in OSC text parts are + // ignored, only the second char in ST ("\e\\") is appended to tokenBuffer. + QString newValue = QString::fromWCharArray(tokenBuffer + i + 1, tokenBufferPos-i-2); _pendingTitleUpdates[attributeToChange] = newValue; _titleUpdateTimer->start(20); @@ -873,8 +876,12 @@ void Vt102Emulation::sendString(const char* s , int length) void Vt102Emulation::reportCursorPosition() { - char tmp[20]; - sprintf(tmp,"\033[%d;%dR",_currentScreen->getCursorY()+1,_currentScreen->getCursorX()+1); + const size_t sz = 20; + char tmp[sz]; + const size_t r = snprintf(tmp, sz, "\033[%d;%dR",_currentScreen->getCursorY()+1,_currentScreen->getCursorX()+1); + if (sz <= r) { + qWarning("Vt102Emulation::reportCursorPosition: Buffer too small\n"); + } sendString(tmp); } @@ -904,8 +911,12 @@ void Vt102Emulation::reportSecondaryAttributes() void Vt102Emulation::reportTerminalParms(int p) // DECREPTPARM { - char tmp[100]; - sprintf(tmp,"\033[%d;1;1;112;112;1;0x",p); // not really true. + const size_t sz = 100; + char tmp[sz]; + const size_t r = snprintf(tmp, sz, "\033[%d;1;1;112;112;1;0x",p); // not really true. + if (sz <= r) { + qWarning("Vt102Emulation::reportTerminalParms: Buffer too small\n"); + } sendString(tmp); } @@ -1011,9 +1022,10 @@ void Vt102Emulation::sendText( const QString& text ) 0, Qt::NoModifier, text); - sendKeyEvent(&event); // expose as a big fat keypress event + sendKeyEvent(&event, false); // expose as a big fat keypress event } } +//<<<<<<< HEAD QKeyEvent * Vt102Emulation::remapKeyModifiersForMac(QKeyEvent *event) { Qt::KeyboardModifiers modifiers = event->modifiers(); @@ -1158,7 +1170,7 @@ QKeyEvent * Vt102Emulation::remapKeyModifiersForMac(QKeyEvent *event) { eventText, event->isAutoRepeat(), event->count()); } -void Vt102Emulation::sendKeyEvent( QKeyEvent* origEvent ) +void Vt102Emulation::sendKeyEvent(QKeyEvent* origEvent, bool fromPaste) { #if defined(Q_OS_MAC) QScopedPointer event(remapKeyModifiersForMac(origEvent)); @@ -1177,7 +1189,7 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* origEvent ) states |= KeyboardTranslator::ApplicationKeypadState; // check flow control state - if (modifiers & Qt::ControlModifier) + if (modifiers & KeyboardTranslator::CTRL_MOD) { switch (event->key()) { case Qt::Key_S: @@ -1223,8 +1235,11 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* origEvent ) if ( entry.command() != KeyboardTranslator::NoCommand ) { - if (entry.command() & KeyboardTranslator::EraseCommand) + if (entry.command() & KeyboardTranslator::EraseCommand) { textToSend += eraseChar(); + } else { + Q_EMIT handleCommandFromKeyboard(entry.command()); + } // TODO command handling } @@ -1232,7 +1247,7 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* origEvent ) { textToSend += entry.text(true,modifiers); } - else if((modifiers & Qt::ControlModifier) && event->key() >= 0x40 && event->key() < 0x5f) { + else if((modifiers & KeyboardTranslator::CTRL_MOD) && event->key() >= 0x40 && event->key() < 0x5f) { textToSend += (event->key() & 0x1f); } else if(event->key() == Qt::Key_Tab) { @@ -1248,7 +1263,10 @@ void Vt102Emulation::sendKeyEvent( QKeyEvent* origEvent ) textToSend += _codec->fromUnicode(event->text()); } - sendData( textToSend.constData() , textToSend.length() ); + if (!fromPaste && textToSend.length()) { + Q_EMIT outputFromKeypressEvent(); + } + Q_EMIT sendData( textToSend.constData() , textToSend.length() ); } else { @@ -1494,36 +1512,19 @@ char Vt102Emulation::eraseChar() const { KeyboardTranslator::Entry entry = _keyTranslator->findEntry( Qt::Key_Backspace, - 0, - 0); + Qt::NoModifier, + KeyboardTranslator::NoState); if ( entry.text().count() > 0 ) return entry.text().at(0); else return '\b'; } -// print contents of the scan buffer -static void hexdump(wchar_t* s, int len) -{ int i; - for (i = 0; i < len; i++) - { - if (s[i] == '\\') - printf("\\\\"); - else - if ((s[i]) > 32 && s[i] < 127) - printf("%c",s[i]); - else - printf("\\%04x(hex)",s[i]); - } -} - void Vt102Emulation::reportDecodingError() { if (tokenBufferPos == 0 || ( tokenBufferPos == 1 && (tokenBuffer[0] & 0xff) >= 32) ) return; - printf("Undecodable sequence: "); - hexdump(tokenBuffer,tokenBufferPos); - printf("\n"); + qCDebug(qtermwidgetLogger) << "Undecodable sequence:" << QString::fromWCharArray(tokenBuffer, tokenBufferPos); } //#include "Vt102Emulation.moc" diff --git a/lib/Vt102Emulation.h b/lib/Vt102Emulation.h index dacaa1d..524b6f0 100644 --- a/lib/Vt102Emulation.h +++ b/lib/Vt102Emulation.h @@ -24,7 +24,7 @@ #define VT102EMULATION_H // Standard Library -#include +#include // Qt #include @@ -82,27 +82,27 @@ Q_OBJECT public: /** Constructs a new emulation */ Vt102Emulation(); - ~Vt102Emulation(); + ~Vt102Emulation() override; // reimplemented from Emulation - virtual void clearEntireScreen(); - virtual void reset(); - virtual char eraseChar() const; + void clearEntireScreen() override; + void reset() override; + char eraseChar() const override; public slots: // reimplemented from Emulation - virtual void sendString(const char*,int length = -1); - virtual void sendText(const QString& text); - virtual void sendKeyEvent(QKeyEvent*); - virtual void sendMouseEvent(int buttons, int column, int line, int eventType); + void sendString(const char*,int length = -1) override; + void sendText(const QString& text) override; + void sendKeyEvent(QKeyEvent*, bool fromPaste) override; + void sendMouseEvent(int buttons, int column, int line, int eventType) override; virtual void focusLost(); virtual void focusGained(); protected: // reimplemented from Emulation - virtual void setMode(int mode); - virtual void resetMode(int mode); - virtual void receiveChar(wchar_t cc); + void setMode(int mode) override; + void resetMode(int mode) override; + void receiveChar(wchar_t cc) override; private slots: //causes changeTitle() to be emitted for each (int,QString) pair in pendingTitleUpdates diff --git a/lib/color-schemes/BlackOnLightYellow.colorscheme b/lib/color-schemes/BlackOnLightYellow.colorscheme new file mode 100644 index 0000000..5150ea1 --- /dev/null +++ b/lib/color-schemes/BlackOnLightYellow.colorscheme @@ -0,0 +1,94 @@ +[Background] +Color=255,255,221 + +[BackgroundIntense] +Color=255,255,221 + +[BackgroundFaint] +Color=255,255,221 + +[Color0] +Color=0,0,0 + +[Color0Intense] +Color=104,104,104 + +[Color0Faint] +Color=192,192,192 + +[Color1] +Color=178,24,24 + +[Color1Intense] +Color=255,84,84 + +[Color1Faint] +Color=224,142,142 + +[Color2] +Color=24,178,24 + +[Color2Intense] +Color=84,255,84 + +[Color2Faint] +Color=142,224,142 + +[Color3] +Color=178,104,24 + +[Color3Intense] +Color=255,255,84 + +[Color3Faint] +Color=224,224,142 + +[Color4] +Color=24,24,178 + +[Color4Intense] +Color=84,84,255 + +[Color4Faint] +Color=142,142,224 + +[Color5] +Color=178,24,178 + +[Color5Intense] +Color=255,84,255 + +[Color5Faint] +Color=224,142,224 + +[Color6] +Color=24,178,178 + +[Color6Intense] +Color=84,255,255 + +[Color6Faint] +Color=142,224,224 + +[Color7] +Color=178,178,178 + +[Color7Intense] +Color=255,255,255 + +[Color7Faint] +Color=142,142,142 + +[Foreground] +Color=0,0,0 + +[ForegroundIntense] +Bold=true +Color=0,0,0 + +[ForegroundFaint] +Color=0,0,0 + +[General] +Description=Black on Light Yellow +Opacity=1 diff --git a/lib/color-schemes/BlackOnLightYellow.schema b/lib/color-schemes/BlackOnLightYellow.schema deleted file mode 100644 index 251a696..0000000 --- a/lib/color-schemes/BlackOnLightYellow.schema +++ /dev/null @@ -1,42 +0,0 @@ -# example scheme for konsole - -# the title is to appear in the menu. - -title Black on Light Yellow - -# foreground colors - -# note that the default background color is flagged -# to become transparent when an image is present. - -# slot transparent bold -# | | | -# V V--color--V V V - -color 0 0 0 0 0 0 # regular foreground color (Black) -color 1 255 255 221 1 0 # regular background color (Light Yellow) - -color 2 0 0 0 0 0 # regular color 0 Black -color 3 178 24 24 0 0 # regular color 1 Red -color 4 24 178 24 0 0 # regular color 2 Green -color 5 178 104 24 0 0 # regular color 3 Yellow -color 6 24 24 178 0 0 # regular color 4 Blue -color 7 178 24 178 0 0 # regular color 5 Magenta -color 8 24 178 178 0 0 # regular color 6 Cyan -color 9 178 178 178 0 0 # regular color 7 White - -# intensive colors - -# instead of changing the colors, we've flaged the text to become bold - -color 10 0 0 0 0 1 # intensive foreground color -color 11 255 255 221 1 0 # intensive background color - -color 12 104 104 104 0 0 # intensive color 0 -color 13 255 84 84 0 0 # intensive color 1 -color 14 84 255 84 0 0 # intensive color 2 -color 15 255 255 84 0 0 # intensive color 3 -color 16 84 84 255 0 0 # intensive color 4 -color 17 255 84 255 0 0 # intensive color 5 -color 18 84 255 255 0 0 # intensive color 6 -color 19 255 255 255 0 0 # intensive color 7 diff --git a/lib/color-schemes/BlackOnWhite.colorscheme b/lib/color-schemes/BlackOnWhite.colorscheme new file mode 100644 index 0000000..73cc3c8 --- /dev/null +++ b/lib/color-schemes/BlackOnWhite.colorscheme @@ -0,0 +1,94 @@ +[Background] +Color=255,255,255 + +[BackgroundIntense] +Color=255,255,255 + +[BackgroundFaint] +Color=255,255,255 + +[Color0] +Color=0,0,0 + +[Color0Intense] +Color=104,104,104 + +[Color0Faint] +Color=192,192,192 + +[Color1] +Color=178,24,24 + +[Color1Intense] +Color=255,84,84 + +[Color1Faint] +Color=224,142,142 + +[Color2] +Color=24,178,24 + +[Color2Intense] +Color=84,255,84 + +[Color2Faint] +Color=142,224,142 + +[Color3] +Color=178,104,24 + +[Color3Intense] +Color=255,255,84 + +[Color3Faint] +Color=224,224,142 + +[Color4] +Color=24,24,178 + +[Color4Intense] +Color=84,84,255 + +[Color4Faint] +Color=142,142,224 + +[Color5] +Color=178,24,178 + +[Color5Intense] +Color=255,84,255 + +[Color5Faint] +Color=224,142,224 + +[Color6] +Color=24,178,178 + +[Color6Intense] +Color=84,255,255 + +[Color6Faint] +Color=142,224,224 + +[Color7] +Color=178,178,178 + +[Color7Intense] +Color=255,255,255 + +[Color7Faint] +Color=142,142,142 + +[Foreground] +Color=0,0,0 + +[ForegroundIntense] +Bold=true +Color=0,0,0 + +[ForegroundFaint] +Color=0,0,0 + +[General] +Description=Black on White +Opacity=1 diff --git a/lib/color-schemes/BlackOnWhite.schema b/lib/color-schemes/BlackOnWhite.schema deleted file mode 100644 index 11853e6..0000000 --- a/lib/color-schemes/BlackOnWhite.schema +++ /dev/null @@ -1,42 +0,0 @@ -# example scheme for konsole - -# the title is to appear in the menu. - -title Black on White - -# foreground colors - -# note that the default background color is flagged -# to become transparent when an image is present. - -# slot transparent bold -# | | | -# V V--color--V V V - -color 0 0 0 0 0 0 # regular foreground color (Black) -color 1 255 255 255 1 0 # regular background color (White) - -color 2 0 0 0 0 0 # regular color 0 Black -color 3 178 24 24 0 0 # regular color 1 Red -color 4 24 178 24 0 0 # regular color 2 Green -color 5 178 104 24 0 0 # regular color 3 Yellow -color 6 24 24 178 0 0 # regular color 4 Blue -color 7 178 24 178 0 0 # regular color 5 Magenta -color 8 24 178 178 0 0 # regular color 6 Cyan -color 9 178 178 178 0 0 # regular color 7 White - -# intensive colors - -# instead of changing the colors, we've flaged the text to become bold - -color 10 0 0 0 0 1 # intensive foreground color -color 11 255 255 255 1 0 # intensive background color - -color 12 104 104 104 0 0 # intensive color 0 -color 13 255 84 84 0 0 # intensive color 1 -color 14 84 255 84 0 0 # intensive color 2 -color 15 255 255 84 0 0 # intensive color 3 -color 16 84 84 255 0 0 # intensive color 4 -color 17 255 84 255 0 0 # intensive color 5 -color 18 84 255 255 0 0 # intensive color 6 -color 19 255 255 255 0 0 # intensive color 7 diff --git a/lib/color-schemes/WhiteOnBlack.colorscheme b/lib/color-schemes/WhiteOnBlack.colorscheme new file mode 100644 index 0000000..c3d801d --- /dev/null +++ b/lib/color-schemes/WhiteOnBlack.colorscheme @@ -0,0 +1,94 @@ +[Background] +Color=0,0,0 + +[BackgroundIntense] +Color=0,0,0 + +[BackgroundFaint] +Color=0,0,0 + +[Color0] +Color=0,0,0 + +[Color0Intense] +Color=104,104,104 + +[Color0Faint] +Color=24,24,24 + +[Color1] +Color=178,24,24 + +[Color1Intense] +Color=255,84,84 + +[Color1Faint] +Color=101,0,0 + +[Color2] +Color=24,178,24 + +[Color2Intense] +Color=84,255,84 + +[Color2Faint] +Color=0,101,0 + +[Color3] +Color=178,104,24 + +[Color3Intense] +Color=255,255,84 + +[Color3Faint] +Color=101,74,0 + +[Color4] +Color=24,24,178 + +[Color4Intense] +Color=84,84,255 + +[Color4Faint] +Color=0,0,101 + +[Color5] +Color=178,24,178 + +[Color5Intense] +Color=255,84,255 + +[Color5Faint] +Color=95,5,95 + +[Color6] +Color=24,178,178 + +[Color6Intense] +Color=84,255,255 + +[Color6Faint] +Color=24,178,178 + +[Color7] +Color=178,178,178 + +[Color7Intense] +Color=255,255,255 + +[Color7Faint] +Color=101,101,101 + +[Foreground] +Color=255,255,255 + +[ForegroundIntense] +Bold=true +Color=255,255,255 + +[ForegroundFaint] +Color=255,255,255 + +[General] +Description=White on Black +Opacity=1 diff --git a/lib/color-schemes/WhiteOnBlack.schema b/lib/color-schemes/WhiteOnBlack.schema deleted file mode 100644 index 05c5bc0..0000000 --- a/lib/color-schemes/WhiteOnBlack.schema +++ /dev/null @@ -1,42 +0,0 @@ -# example scheme for konsole - -# the title is to appear in the menu. - -title White on Black - -# foreground colors - -# note that the default background color is flagged -# to become transparent when an image is present. - -# slot transparent bold -# | | | -# V V--color--V V V - -color 0 255 255 255 0 0 # regular foreground color (White) -color 1 0 0 0 1 0 # regular background color (Black) - -color 2 0 0 0 0 0 # regular color 0 Black -color 3 178 24 24 0 0 # regular color 1 Red -color 4 24 178 24 0 0 # regular color 2 Green -color 5 178 104 24 0 0 # regular color 3 Yellow -color 6 24 24 178 0 0 # regular color 4 Blue -color 7 178 24 178 0 0 # regular color 5 Magenta -color 8 24 178 178 0 0 # regular color 6 Cyan -color 9 178 178 178 0 0 # regular color 7 White - -# intensive colors - -# instead of changing the colors, we've flaged the text to become bold - -color 10 255 255 255 0 1 # intensive foreground color -color 11 0 0 0 1 0 # intensive background color - -color 12 104 104 104 0 0 # intensive color 0 -color 13 255 84 84 0 0 # intensive color 1 -color 14 84 255 84 0 0 # intensive color 2 -color 15 255 255 84 0 0 # intensive color 3 -color 16 84 84 255 0 0 # intensive color 4 -color 17 255 84 255 0 0 # intensive color 5 -color 18 84 255 255 0 0 # intensive color 6 -color 19 255 255 255 0 0 # intensive color 7 diff --git a/lib/color-schemes/cool-retro-term.colorscheme b/lib/color-schemes/cool-retro-term.colorscheme new file mode 100644 index 0000000..a7e2ff5 --- /dev/null +++ b/lib/color-schemes/cool-retro-term.colorscheme @@ -0,0 +1,103 @@ +[Background] +Bold=false +Color=0,0,0 +Transparency=false + +[BackgroundIntense] +Bold=true +Color=0,0,0 +Transparency=false + +[Color0] +Bold=false +Color=63,63,63 +Transparency=false + +[Color0Intense] +Bold=true +Color=112,144,128 +Transparency=false + +[Color1] +Bold=false +Color=112,80,80 +Transparency=false + +[Color1Intense] +Bold=true +Color=220,163,163 +Transparency=false + +[Color2] +Bold=false +Color=96,180,138 +Transparency=false + +[Color2Intense] +Bold=true +Color=114,213,163 +Transparency=false + +[Color3] +Bold=false +Color=223,175,143 +Transparency=false + +[Color3Intense] +Bold=true +Color=240,223,175 +Transparency=false + +[Color4] +Bold=false +Color=154,184,215 +Transparency=false + +[Color4Intense] +Bold=true +Color=148,191,243 +Transparency=false + +[Color5] +Bold=false +Color=220,140,195 +Transparency=false + +[Color5Intense] +Bold=true +Color=236,147,211 +Transparency=false + +[Color6] +Bold=false +Color=140,208,211 +Transparency=false + +[Color6Intense] +Bold=true +Color=147,224,227 +Transparency=false + +[Color7] +Bold=false +Color=220,220,204 +Transparency=false + +[Color7Intense] +Bold=true +Color=255,255,255 +Transparency=false + +[Foreground] +Bold=false +Color=255,255,255 +Transparency=false + +[ForegroundIntense] +Bold=true +Color=255,255,255 +Transparency=false + +[General] +Description=cool-retro-term +Opacity=1 diff --git a/lib/color-schemes/cool-retro-term.schema b/lib/color-schemes/cool-retro-term.schema deleted file mode 100644 index b9340a7..0000000 --- a/lib/color-schemes/cool-retro-term.schema +++ /dev/null @@ -1,85 +0,0 @@ -# example scheme for konsole - - - -# the title is to appear in the menu. - - - -title White on Black - - - -# foreground colors - - - -# note that the default background color is flagged - -# to become transparent when an image is present. - - - -# slot transparent bold - -# | | | - -# V V--color--V V V - - - -color 0 255 255 255 0 0 # regular foreground color (White) - -color 1 0 0 0 1 0 # regular background color (Black) - - - -color 2 0 0 0 0 0 # regular color 0 Black - -color 3 255 43 43 0 0 # regular color 1 Red - -color 4 28 172 120 0 0 # regular color 2 Green - -color 5 248 213 104 0 0 # regular color 3 Yellow - -color 6 43 108 196 0 0 # regular color 4 Blue - -color 7 255 29 206 0 0 # regular color 5 Magenta - -color 8 24 167 181 0 0 # regular color 6 Cyan - -color 9 179 179 179 0 0 # regular color 7 White - - - - -# intensive colors - - - -# instead of changing the colors, we've flaged the text to become bold - - - -color 10 255 255 255 0 1 # intensive foreground color - -color 11 0 0 0 1 0 # intensive background color - - - -color 12 106 106 106 0 0 # intensive color 0 - -color 13 253 94 83 0 0 # intensive color 1 - -color 14 168 228 160 0 0 # intensive color 2 - -color 15 254 254 34 0 0 # intensive color 3 - -color 16 154 206 235 0 0 # intensive color 4 - -color 17 252 116 253 0 0 # intensive color 5 - -color 18 236 234 190 0 0 # intensive color 6 - -color 19 255 255 255 0 0 # intensive color 7 - diff --git a/lib/kb-layouts/default.keytab b/lib/kb-layouts/default.keytab index e8eacea..4d18dc1 100644 --- a/lib/kb-layouts/default.keytab +++ b/lib/kb-layouts/default.keytab @@ -114,6 +114,9 @@ key Delete +KeyPad : "\E[3~" key PgUp -Shift+KeyPad : "\E[5~" key PgDown -Shift+KeyPad : "\E[6~" +key Clear -AnyMod+KeyPad+AppKeyPad : "\E[OE" +key Clear +AnyMod+KeyPad+AppKeyPad : "\E[1;*E" + # other grey PC keys key Enter+NewLine : "\r\n" @@ -178,4 +181,3 @@ key PgDown +Shift-AppScreen : scrollPageDown key End +Shift-AppScreen : scrollDownToBottom key ScrollLock : scrollLock - diff --git a/lib/kprocess.cpp b/lib/kprocess.cpp index 73264a6..904e1bb 100644 --- a/lib/kprocess.cpp +++ b/lib/kprocess.cpp @@ -35,7 +35,7 @@ # include #else # include -# include +# include #endif #ifndef Q_OS_WIN @@ -400,13 +400,3 @@ int KProcess::startDetached(const QStringList &argv) QString prog = args.takeFirst(); return startDetached(prog, args); } - -int KProcess::pid() const -{ -#ifdef Q_OS_UNIX - return (int) QProcess::pid(); -#else - return QProcess::pid() ? QProcess::pid()->dwProcessId : 0; -#endif -} - diff --git a/lib/kprocess.h b/lib/kprocess.h index ec90721..ad2f05e 100644 --- a/lib/kprocess.h +++ b/lib/kprocess.h @@ -77,12 +77,12 @@ public: /** * Constructor */ - explicit KProcess(QObject *parent = 0); + explicit KProcess(QObject *parent = nullptr); /** * Destructor */ - virtual ~KProcess(); + ~KProcess() override; /** * Set how to handle the output channels of the child process. @@ -311,18 +311,6 @@ public: */ static int startDetached(const QStringList &argv); - /** - * Obtain the process' ID as known to the system. - * - * Unlike with QProcess::pid(), this is a real PID also on Windows. - * - * This function can be called only while the process is running. - * It cannot be applied to detached processes. - * - * @return the process ID - */ - int pid() const; - protected: /** * @internal diff --git a/lib/kpty.cpp b/lib/kpty.cpp index b42bf95..5234b5f 100644 --- a/lib/kpty.cpp +++ b/lib/kpty.cpp @@ -26,8 +26,7 @@ #include - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__DragonFly__) #define HAVE_LOGIN #define HAVE_LIBUTIL_H #endif @@ -37,6 +36,12 @@ #define HAVE_UTIL_H #endif +#if defined(__NetBSD__) +#define HAVE_LOGIN +#define HAVE_UTIL_H +#define HAVE_OPENPTY +#endif + #if defined(__APPLE__) #define HAVE_OPENPTY #define HAVE_UTIL_H @@ -70,12 +75,12 @@ #include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -259,7 +264,7 @@ bool KPty::open() d->ttyName = ptsn; #else int ptyno; - if (!ioctl(d->masterFd, TIOCGPTN, &ptyno)) { + if (ioctl(d->masterFd, TIOCGPTN, &ptyno) != -1) { d->ttyName = QByteArray("/dev/pts/") + QByteArray::number(ptyno); #endif #ifdef HAVE_GRANTPT @@ -279,8 +284,8 @@ bool KPty::open() // Linux device names, FIXME: Trouble on other systems? for (const char * s3 = "pqrstuvwxyzabcde"; *s3; s3++) { for (const char * s4 = "0123456789abcdef"; *s4; s4++) { - ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toUtf8(); - d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toUtf8(); + ptyName = QByteArrayLiteral("/dev/pty") + *s3 + *s4; + d->ttyName = QByteArrayLiteral("/dev/tty") + *s3 + *s4; d->masterFd = ::open(ptyName.data(), O_RDWR); if (d->masterFd >= 0) { @@ -290,7 +295,7 @@ bool KPty::open() * and we need to get another one. */ int pgrp_rtn; - if (ioctl(d->masterFd, TIOCGPGRP, &pgrp_rtn) == 0 || errno != EIO) { + if (ioctl(d->masterFd, TIOCGPGRP, &pgrp_rtn) != -1 || errno != EIO) { ::close(d->masterFd); d->masterFd = -1; continue; @@ -331,7 +336,7 @@ gotpty: !d->chownpty(true)) { qWarning() << "chownpty failed for device " << ptyName << "::" << d->ttyName - << "\nThis means the communication can be eavesdropped." << endl; + << "\nThis means the communication can be eavesdropped.\n"; } #if defined (HAVE__GETPTY) || defined (HAVE_GRANTPT) @@ -392,9 +397,13 @@ bool KPty::open(int fd) d->ttyName = ptsn; # else int ptyno; - if (!ioctl(fd, TIOCGPTN, &ptyno)) { - char buf[32]; - sprintf(buf, "/dev/pts/%d", ptyno); + if (ioctl(fd, TIOCGPTN, &ptyno) != -1) { + const size_t sz = 32; + char buf[sz]; + const size_t r = snprintf(buf, sz, "/dev/pts/%d", ptyno); + if (sz <= r) { + qWarning("KPty::open: Buffer too small\n"); + } d->ttyName = buf; # endif } else { @@ -544,7 +553,7 @@ void KPty::login(const char * user, const char * remotehost) # ifdef HAVE_UTMPX gettimeofday(&l_struct.ut_tv, 0); # else - l_struct.ut_time = time(0); + l_struct.ut_time = time(nullptr); # endif # ifdef HAVE_LOGIN @@ -646,7 +655,7 @@ void KPty::logout() } endutxent(); # else - ut->ut_time = time(0); + ut->ut_time = time(nullptr); pututline(ut); } endutent(); @@ -680,7 +689,7 @@ bool KPty::setWinSize(int lines, int columns) memset(&winSize, 0, sizeof(winSize)); winSize.ws_row = (unsigned short)lines; winSize.ws_col = (unsigned short)columns; - return ioctl(d->masterFd, TIOCSWINSZ, (char *)&winSize) == 0; + return ioctl(d->masterFd, TIOCSWINSZ, (char *)&winSize) != -1; } bool KPty::setEcho(bool echo) diff --git a/lib/kpty.h b/lib/kpty.h index ab34f6e..e9f8fa5 100644 --- a/lib/kpty.h +++ b/lib/kpty.h @@ -50,6 +50,9 @@ public: */ ~KPty(); + KPty(const KPty &) = delete; + KPty &operator=(const KPty &) = delete; + /** * Create a pty master/slave pair. * @@ -95,7 +98,7 @@ public: * of the client. For local logins from inside an X session it should * be the name of the X display. Otherwise it should be empty. */ - void login(const char * user = 0, const char * remotehost = 0); + void login(const char * user = nullptr, const char * remotehost = nullptr); /** * Removes the utmp entry for this tty. diff --git a/lib/kptydevice.cpp b/lib/kptydevice.cpp index 90b4a58..9af1545 100644 --- a/lib/kptydevice.cpp +++ b/lib/kptydevice.cpp @@ -35,8 +35,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -74,7 +74,7 @@ static void qt_ignore_sigpipe() struct sigaction noaction; memset(&noaction, 0, sizeof(noaction)); noaction.sa_handler = SIG_IGN; - sigaction(SIGPIPE, &noaction, 0); + sigaction(SIGPIPE, &noaction, nullptr); } } @@ -90,7 +90,7 @@ bool KPtyDevicePrivate::_k_canRead() #else int available; #endif - if (!::ioctl(q->masterFd(), PTY_BYTES_AVAILABLE, (char *) &available)) { + if (::ioctl(q->masterFd(), PTY_BYTES_AVAILABLE, (char *) &available) != -1) { #ifdef Q_OS_SOLARIS // A Pty is a STREAMS module, and those can be activated // with 0 bytes available. This happens either when ^C is @@ -211,7 +211,7 @@ bool KPtyDevicePrivate::doWait(int msecs, bool reading) struct timeval tv, *tvp; if (msecs < 0) - tvp = 0; + tvp = nullptr; else { tv.tv_sec = msecs / 1000; tv.tv_usec = (msecs % 1000) * 1000; @@ -243,7 +243,7 @@ bool KPtyDevicePrivate::doWait(int msecs, bool reading) } #endif - switch (select(q->masterFd() + 1, &rfds, &wfds, 0, tvp)) { + switch (select(q->masterFd() + 1, &rfds, &wfds, nullptr, tvp)) { case -1: if (errno == EINTR) break; diff --git a/lib/kptydevice.h b/lib/kptydevice.h index c398646..5040400 100644 --- a/lib/kptydevice.h +++ b/lib/kptydevice.h @@ -55,7 +55,7 @@ public: /** * Constructor */ - KPtyDevice(QObject *parent = 0); + KPtyDevice(QObject *parent = nullptr); /** * Destructor: @@ -63,14 +63,14 @@ public: * If the pty is still open, it will be closed. Note, however, that * an utmp registration is @em not undone. */ - virtual ~KPtyDevice(); + ~KPtyDevice() override; /** * Create a pty master/slave pair. * * @return true if a pty pair was successfully opened */ - virtual bool open(OpenMode mode = ReadWrite | Unbuffered); + bool open(OpenMode mode = ReadWrite | Unbuffered) override; /** * Open using an existing pty master. The ownership of the fd @@ -90,7 +90,7 @@ public: /** * Close the pty master/slave pair. */ - virtual void close(); + void close() override; /** * Sets whether the KPtyDevice monitors the pty for incoming data. @@ -119,30 +119,30 @@ public: /** * @return always true */ - virtual bool isSequential() const; + bool isSequential() const override; /** * @reimp */ - bool canReadLine() const; + bool canReadLine() const override; /** * @reimp */ - bool atEnd() const; + bool atEnd() const override; /** * @reimp */ - qint64 bytesAvailable() const; + qint64 bytesAvailable() const override; /** * @reimp */ - qint64 bytesToWrite() const; + qint64 bytesToWrite() const override; - bool waitForBytesWritten(int msecs = -1); - bool waitForReadyRead(int msecs = -1); + bool waitForBytesWritten(int msecs = -1) override; + bool waitForReadyRead(int msecs = -1) override; Q_SIGNALS: @@ -154,9 +154,9 @@ Q_SIGNALS: void readEof(); protected: - virtual qint64 readData(char *data, qint64 maxSize); - virtual qint64 readLineData(char *data, qint64 maxSize); - virtual qint64 writeData(const char *data, qint64 maxSize); + qint64 readData(char *data, qint64 maxSize) override; + qint64 readLineData(char *data, qint64 maxSize) override; + qint64 writeData(const char *data, qint64 maxSize) override; private: Q_PRIVATE_SLOT(d_func(), bool _k_canRead()) @@ -168,7 +168,7 @@ private: ///////////////////////////////////////////////////// #include -#include +#include #define CHUNKSIZE 4096 @@ -185,14 +185,14 @@ public: buffers.clear(); QByteArray tmp; tmp.resize(CHUNKSIZE); - buffers << tmp; + buffers.push_back(tmp); head = tail = 0; totalSize = 0; } inline bool isEmpty() const { - return buffers.count() == 1 && !tail; + return buffers.size() == 1 && !tail; } inline int size() const @@ -202,13 +202,13 @@ public: inline int readSize() const { - return (buffers.count() == 1 ? tail : buffers.first().size()) - head; + return (buffers.size() == 1 ? tail : buffers.front().size()) - head; } inline const char *readPointer() const { Q_ASSERT(totalSize > 0); - return buffers.first().constData() + head; + return buffers.front().constData() + head; } void free(int bytes) @@ -221,21 +221,21 @@ public: if (bytes < nbs) { head += bytes; - if (head == tail && buffers.count() == 1) { - buffers.first().resize(CHUNKSIZE); + if (head == tail && buffers.size() == 1) { + buffers.front().resize(CHUNKSIZE); head = tail = 0; } break; } bytes -= nbs; - if (buffers.count() == 1) { - buffers.first().resize(CHUNKSIZE); + if (buffers.size() == 1) { + buffers.front().resize(CHUNKSIZE); head = tail = 0; break; } - buffers.removeFirst(); + buffers.pop_front(); head = 0; } } @@ -245,15 +245,15 @@ public: totalSize += bytes; char *ptr; - if (tail + bytes <= buffers.last().size()) { - ptr = buffers.last().data() + tail; + if (tail + bytes <= buffers.back().size()) { + ptr = buffers.back().data() + tail; tail += bytes; } else { - buffers.last().resize(tail); + buffers.back().resize(tail); QByteArray tmp; tmp.resize(qMax(CHUNKSIZE, bytes)); ptr = tmp.data(); - buffers << tmp; + buffers.push_back(tmp); tail = bytes; } return ptr; @@ -278,7 +278,7 @@ public: { int index = 0; int start = head; - QLinkedList::ConstIterator it = buffers.constBegin(); + std::list::const_iterator it = buffers.cbegin(); forever { if (!maxLength) return index; @@ -286,7 +286,7 @@ public: return -1; const QByteArray &buf = *it; ++it; - int len = qMin((it == buffers.end() ? tail : buf.size()) - start, + int len = qMin((it == buffers.cend() ? tail : buf.size()) - start, maxLength); const char *ptr = buf.data() + start; if (const char *rptr = (const char *)memchr(ptr, c, len)) @@ -327,7 +327,7 @@ public: } private: - QLinkedList buffers; + std::list buffers; int head, tail; int totalSize; }; @@ -339,7 +339,7 @@ struct KPtyDevicePrivate : public KPtyPrivate { KPtyDevicePrivate(KPty* parent) : KPtyPrivate(parent), emittedReadyRead(false), emittedBytesWritten(false), - readNotifier(0), writeNotifier(0) + readNotifier(nullptr), writeNotifier(nullptr) { } diff --git a/lib/kptyprocess.cpp b/lib/kptyprocess.cpp index ec8df33..5c829fd 100644 --- a/lib/kptyprocess.cpp +++ b/lib/kptyprocess.cpp @@ -32,9 +32,9 @@ #include "kprocess.h" #include "kptydevice.h" -#include +#include #include -#include +#include #include KPtyProcess::KPtyProcess(QObject *parent) : @@ -77,7 +77,7 @@ KPtyProcess::~KPtyProcess() if (state() != QProcess::NotRunning) { qWarning() << Q_FUNC_INFO << "the terminal process is still running, trying to stop it by SIGHUP"; - ::kill(pid(), SIGHUP); + ::kill(static_cast(processId()), SIGHUP); waitForFinished(300); if (state() != QProcess::NotRunning) qCritical() << Q_FUNC_INFO << "process didn't stop upon SIGHUP and will be SIGKILL-ed"; diff --git a/lib/kptyprocess.h b/lib/kptyprocess.h index 1270c47..3491b35 100644 --- a/lib/kptyprocess.h +++ b/lib/kptyprocess.h @@ -33,7 +33,7 @@ #include "kprocess.h" #include "kptydevice.h" -#include +#include class KPtyDevice; @@ -74,7 +74,7 @@ public: /** * Constructor */ - explicit KPtyProcess(QObject *parent = 0); + explicit KPtyProcess(QObject *parent = nullptr); /** * Construct a process using an open pty master. @@ -83,12 +83,12 @@ public: * The process does not take ownership of the descriptor; * it will not be automatically closed at any point. */ - KPtyProcess(int ptyMasterFd, QObject *parent = 0); + KPtyProcess(int ptyMasterFd, QObject *parent = nullptr); /** * Destructor */ - virtual ~KPtyProcess(); + ~KPtyProcess() override; /** * Set to which channels the PTY should be assigned. @@ -102,7 +102,7 @@ public: bool isRunning() const { bool rval; - (pid() > 0) ? rval= true : rval= false; + (processId() > 0) ? rval= true : rval= false; return rval; } @@ -144,7 +144,7 @@ protected: /** * @reimp */ - virtual void setupChildProcess(); + void setupChildProcess() override; private: Q_PRIVATE_SLOT(d_func(), void _k_onStateChanged(QProcess::ProcessState)) diff --git a/lib/qtermwidget.cpp b/lib/qtermwidget.cpp index a5b796d..e5c58a5 100644 --- a/lib/qtermwidget.cpp +++ b/lib/qtermwidget.cpp @@ -33,6 +33,12 @@ #include "SearchBar.h" #include "qtermwidget.h" +#ifdef Q_OS_MACOS +// Qt does not support fontconfig on macOS, so we need to use a "real" font name. +#define DEFAULT_FONT_FAMILY "Menlo" +#else +#define DEFAULT_FONT_FAMILY "Monospace" +#endif #define STEP_ZOOM 1 @@ -43,8 +49,10 @@ void *createTermWidget(int startnow, void *parent) return (void*) new QTermWidget(startnow, (QWidget*)parent); } -struct TermWidgetImpl { - TermWidgetImpl(QWidget* parent = 0); +class TermWidgetImpl { + +public: + TermWidgetImpl(QWidget* parent = nullptr); TerminalDisplay *m_terminalDisplay; Session *m_session; @@ -156,8 +164,8 @@ void QTermWidget::search(bool forwards, bool next) m_impl->m_terminalDisplay->screenWindow()->screen()->getSelectionStart(startColumn, startLine); } - qDebug() << "current selection starts at: " << startColumn << startLine; - qDebug() << "current cursor position: " << m_impl->m_terminalDisplay->screenWindow()->cursorPosition(); + //qDebug() << "current selection starts at: " << startColumn << startLine; + //qDebug() << "current cursor position: " << m_impl->m_terminalDisplay->screenWindow()->cursorPosition(); QRegExp regExp(m_searchBar->searchText()); regExp.setPatternSyntax(m_searchBar->useRegularExpression() ? QRegExp::RegExp : QRegExp::FixedString); @@ -175,7 +183,7 @@ void QTermWidget::search(bool forwards, bool next) void QTermWidget::matchFound(int startColumn, int startLine, int endColumn, int endLine) { ScreenWindow* sw = m_impl->m_terminalDisplay->screenWindow(); - qDebug() << "Scroll to" << startLine; + //qDebug() << "Scroll to" << startLine; sw->scrollTo(startLine); sw->setTrackOutput(false); sw->notifyOutputChanged(); @@ -221,15 +229,11 @@ QSize QTermWidget::sizeHint() const void QTermWidget::setTerminalSizeHint(bool on) { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->setTerminalSizeHint(on); } bool QTermWidget::terminalSizeHint() { - if (!m_impl->m_terminalDisplay) - return true; return m_impl->m_terminalDisplay->terminalSizeHint(); } @@ -263,7 +267,7 @@ void QTermWidget::init(int startnow) // translations // First check $XDG_DATA_DIRS. This follows the implementation in libqtxdg QString d = QFile::decodeName(qgetenv("XDG_DATA_DIRS")); - QStringList dirs = d.split(QLatin1Char(':'), QString::SkipEmptyParts); + QStringList dirs = d.split(QLatin1Char(':'), Qt::SkipEmptyParts); if (dirs.isEmpty()) { dirs.append(QString::fromLatin1("/usr/local/share")); dirs.append(QString::fromLatin1("/usr/share")); @@ -272,11 +276,11 @@ void QTermWidget::init(int startnow) m_translator = new QTranslator(this); - for (const QString& dir : dirs) { - qDebug() << "Trying to load translation file from dir" << dir; + for (const QString& dir : qAsConst(dirs)) { + //qDebug() << "Trying to load translation file from dir" << dir; if (m_translator->load(QLocale::system(), QLatin1String("qtermwidget"), QLatin1String(QLatin1String("_")), dir)) { qApp->installTranslator(m_translator); - qDebug() << "Translations found in" << dir; + //qDebug() << "Translations found in" << dir; break; } } @@ -320,12 +324,12 @@ void QTermWidget::init(int startnow) this, SIGNAL(termGetFocus())); connect(m_impl->m_terminalDisplay, SIGNAL(termLostFocus()), this, SIGNAL(termLostFocus())); - connect(m_impl->m_terminalDisplay, SIGNAL(keyPressedSignal(QKeyEvent *)), - this, SIGNAL(termKeyPressed(QKeyEvent *))); + connect(m_impl->m_terminalDisplay, &TerminalDisplay::keyPressedSignal, + [this] (QKeyEvent* e, bool) { Q_EMIT termKeyPressed(e); }); // m_impl->m_terminalDisplay->setSize(80, 40); QFont font = QApplication::font(); - font.setFamily(QLatin1String("Monospace")); + font.setFamily(QLatin1String(DEFAULT_FONT_FAMILY)); font.setPointSize(10); font.setStyleHint(QFont::TypeWriter); setTerminalFont(font); @@ -352,34 +356,29 @@ QTermWidget::~QTermWidget() void QTermWidget::setTerminalFont(const QFont &font) { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->setVTFont(font); } QFont QTermWidget::getTerminalFont() { - if (!m_impl->m_terminalDisplay) - return QFont(); return m_impl->m_terminalDisplay->getVTFont(); } void QTermWidget::setTerminalOpacity(qreal level) { - if (!m_impl->m_terminalDisplay) - return; - m_impl->m_terminalDisplay->setOpacity(level); } -void QTermWidget::setTerminalBackgroundImage(QString backgroundImage) +void QTermWidget::setTerminalBackgroundImage(const QString& backgroundImage) { - if (!m_impl->m_terminalDisplay) - return; - m_impl->m_terminalDisplay->setBackgroundImage(backgroundImage); } +void QTermWidget::setTerminalBackgroundMode(int mode) +{ + m_impl->m_terminalDisplay->setBackgroundMode((Konsole::BackgroundMode)mode); +} + void QTermWidget::setShellProgram(const QString &progname) { if (!m_impl->m_session) @@ -433,7 +432,7 @@ void QTermWidget::setTextCodec(QTextCodec *codec) void QTermWidget::setColorScheme(const QString& origName) { - const ColorScheme *cs = 0; + const ColorScheme *cs = nullptr; const bool isFile = QFile::exists(origName); const QString& name = isFile ? @@ -487,8 +486,6 @@ void QTermWidget::addCustomColorSchemeDir(const QString& custom_dir) void QTermWidget::setSize(const QSize &size) { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->setSize(size.width(), size.height()); } @@ -502,15 +499,11 @@ void QTermWidget::setHistorySize(int lines) void QTermWidget::setScrollBarPosition(ScrollBarPosition pos) { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->setScrollBarPosition(pos); } void QTermWidget::scrollToEnd() { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->scrollToEnd(); } @@ -519,6 +512,11 @@ void QTermWidget::sendText(const QString &text) m_impl->m_session->sendText(text); } +void QTermWidget::sendKeyEvent(QKeyEvent *e) +{ + m_impl->m_session->sendKeyEvent(e); +} + void QTermWidget::resizeEvent(QResizeEvent*) { //qDebug("global window resizing...with %d %d", this->size().width(), this->size().height()); @@ -536,6 +534,16 @@ void QTermWidget::bracketText(QString& text) m_impl->m_terminalDisplay->bracketText(text); } +void QTermWidget::disableBracketedPasteMode(bool disable) +{ + m_impl->m_terminalDisplay->disableBracketedPasteMode(disable); +} + +bool QTermWidget::bracketedPasteModeIsDisabled() const +{ + return m_impl->m_terminalDisplay->bracketedPasteModeIsDisabled(); +} + void QTermWidget::copyClipboard() { m_impl->m_terminalDisplay->copyClipboard(); @@ -553,9 +561,6 @@ void QTermWidget::pasteSelection() void QTermWidget::setZoom(int step) { - if (!m_impl->m_terminalDisplay) - return; - QFont font = m_impl->m_terminalDisplay->getVTFont(); font.setPointSize(font.pointSize() + step); @@ -694,9 +699,9 @@ Filter::HotSpot* QTermWidget::getHotSpotAt(int row, int column) const return m_impl->m_terminalDisplay->filterChain()->hotSpotAt(row, column); } -QList QTermWidget::filterActions(const QPoint& position, QWidget* parent) +QList QTermWidget::filterActions(const QPoint& position) { - return m_impl->m_terminalDisplay->filterActions(position, parent); + return m_impl->m_terminalDisplay->filterActions(position); } int QTermWidget::getPtySlaveFd() const @@ -706,29 +711,21 @@ int QTermWidget::getPtySlaveFd() const void QTermWidget::setKeyboardCursorShape(KeyboardCursorShape shape) { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->setKeyboardCursorShape(shape); } void QTermWidget::setBlinkingCursor(bool blink) { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->setBlinkingCursor(blink); } void QTermWidget::setBidiEnabled(bool enabled) { - if (!m_impl->m_terminalDisplay) - return; m_impl->m_terminalDisplay->setBidiEnabled(enabled); } bool QTermWidget::isBidiEnabled() { - if (!m_impl->m_terminalDisplay) - return false; // Default value return m_impl->m_terminalDisplay->isBidiEnabled(); } @@ -774,3 +771,29 @@ int QTermWidget::getMargin() const { return m_impl->m_terminalDisplay->margin(); } + +void QTermWidget::saveHistory(QIODevice *device) +{ + QTextStream stream(device); + PlainTextDecoder decoder; + decoder.begin(&stream); + m_impl->m_session->emulation()->writeToStream(&decoder, 0, m_impl->m_session->emulation()->lineCount()); +} + +void QTermWidget::setDrawLineChars(bool drawLineChars) +{ + m_impl->m_terminalDisplay->setDrawLineChars(drawLineChars); +} + +void QTermWidget::setBoldIntense(bool boldIntense) +{ + m_impl->m_terminalDisplay->setBoldIntense(boldIntense); +} + +void QTermWidget::setConfirmMultilinePaste(bool confirmMultilinePaste) { + m_impl->m_terminalDisplay->setConfirmMultilinePaste(confirmMultilinePaste); +} + +void QTermWidget::setTrimPastedTrailingNewlines(bool trimPastedTrailingNewlines) { + m_impl->m_terminalDisplay->setTrimPastedTrailingNewlines(trimPastedTrailingNewlines); +} diff --git a/lib/qtermwidget.h b/lib/qtermwidget.h index 08746ea..589879f 100644 --- a/lib/qtermwidget.h +++ b/lib/qtermwidget.h @@ -26,7 +26,7 @@ #include "Filter.h" class QVBoxLayout; -struct TermWidgetImpl; +class TermWidgetImpl; class SearchBar; class QUrl; @@ -50,14 +50,14 @@ public: //Creation of widget QTermWidget(int startnow, // 1 = start shell programm immediatelly - QWidget * parent = 0); + QWidget * parent = nullptr); // A dummy constructor for Qt Designer. startnow is 1 by default - QTermWidget(QWidget *parent = 0); + QTermWidget(QWidget *parent = nullptr); - virtual ~QTermWidget(); + ~QTermWidget() override; //Initial size - QSize sizeHint() const; + QSize sizeHint() const override; // expose TerminalDisplay::TerminalSizeHint, setTerminalSizeHint void setTerminalSizeHint(bool on); @@ -85,7 +85,8 @@ public: void setTerminalFont(const QFont & font); QFont getTerminalFont(); void setTerminalOpacity(qreal level); - void setTerminalBackgroundImage(QString backgroundImage); + void setTerminalBackgroundImage(const QString& backgroundImage); + void setTerminalBackgroundMode(int mode); //environment void setEnvironment(const QStringList & environment); @@ -124,6 +125,9 @@ public: // Send some text to terminal void sendText(const QString & text); + // Send key event to terminal + void sendKeyEvent(QKeyEvent* e); + // Sets whether flow control is enabled void setFlowControlEnabled(bool enabled); @@ -185,7 +189,7 @@ public: /* * Proxy for TerminalDisplay::filterActions * */ - QList filterActions(const QPoint& position, QWidget* parent); + QList filterActions(const QPoint& position); /** * Returns a pty slave file descriptor. @@ -221,11 +225,22 @@ public: /** change and wrap text corresponding to paste mode **/ void bracketText(QString& text); + /** forcefully disable bracketed paste mode **/ + void disableBracketedPasteMode(bool disable); + bool bracketedPasteModeIsDisabled() const; + /** Set the empty space outside the terminal */ void setMargin(int); /** Get the empty space outside the terminal */ int getMargin() const; + + void setDrawLineChars(bool drawLineChars); + + void setBoldIntense(bool boldIntense); + + void setConfirmMultilinePaste(bool confirmMultilinePaste); + void setTrimPastedTrailingNewlines(bool trimPastedTrailingNewlines); signals: void finished(); void copyAvailable(bool); @@ -286,8 +301,9 @@ public slots: void toggleShowSearchBar(); + void saveHistory(QIODevice *device); protected: - virtual void resizeEvent(QResizeEvent *); + void resizeEvent(QResizeEvent *) override; protected slots: void sessionFinished(); diff --git a/lib/qtermwidget_version.h.in b/lib/qtermwidget_version.h.in new file mode 100644 index 0000000..00e2a74 --- /dev/null +++ b/lib/qtermwidget_version.h.in @@ -0,0 +1,33 @@ +/* Copyright (C) 2020 Axel Kittenberger (axel.kittenberger@univie.ac.at) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#ifndef _Q_TERM_WIDGET_VERSION +#define _Q_TERM_WIDGET_VERSION + +#include +#define QTERMWIDGET_VERSION_MAJOR @QTERMWIDGET_VERSION_MAJOR@ +#define QTERMWIDGET_VERSION_MINOR @QTERMWIDGET_VERSION_MINOR@ +#define QTERMWIDGET_VERSION_PATCH @QTERMWIDGET_VERSION_PATCH@ +#define QTERMWIDGET_VERSION QT_VERSION_CHECK(\ + QTERMWIDGET_VERSION_MAJOR,\ + QTERMWIDGET_VERSION_MINOR,\ + QTERMWIDGET_VERSION_PATCH) + +#endif + diff --git a/lib/tools.cpp b/lib/tools.cpp index 11ef9fa..8934bce 100644 --- a/lib/tools.cpp +++ b/lib/tools.cpp @@ -5,6 +5,8 @@ #include +Q_LOGGING_CATEGORY(qtermwidgetLogger, "qtermwidget", QtWarningMsg) + /*! Helper function to get possible location of layout files. By default the KB_LAYOUT_DIR is used (linux/BSD/macports). But in some cases (apple bundle) there can be more locations). @@ -17,7 +19,7 @@ QString get_kb_layout_dir() QString k(qgetenv("KB_LAYOUT_DIR")); QDir d(k); - qDebug() << "default KB_LAYOUT_DIR: " << k; + //qDebug() << "default KB_LAYOUT_DIR: " << k; if (d.exists()) { @@ -25,17 +27,18 @@ QString get_kb_layout_dir() return rval; } +#ifdef Q_OS_MAC // subdir in the app location d.setPath(QCoreApplication::applicationDirPath() + QLatin1String("/kb-layouts/")); //qDebug() << d.path(); if (d.exists()) return QCoreApplication::applicationDirPath() + QLatin1String("/kb-layouts/"); -#ifdef Q_WS_MAC - d.setPath(QCoreApplication::applicationDirPath() + "/../Resources/kb-layouts/"); + + d.setPath(QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/kb-layouts/")); if (d.exists()) - return QCoreApplication::applicationDirPath() + "/../Resources/kb-layouts/"; + return QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/kb-layouts/"); #endif - qDebug() << "Cannot find KB_LAYOUT_DIR. Default:" << k; + //qDebug() << "Cannot find KB_LAYOUT_DIR. Default:" << k; return QString(); } @@ -67,6 +70,7 @@ const QStringList get_color_schemes_dirs() if (d.exists()) rval << k.append(QLatin1Char('/')); +#ifdef Q_OS_MAC // subdir in the app location d.setPath(QCoreApplication::applicationDirPath() + QLatin1String("/color-schemes/")); //qDebug() << d.path(); @@ -76,16 +80,16 @@ const QStringList get_color_schemes_dirs() rval.clear(); rval << (QCoreApplication::applicationDirPath() + QLatin1String("/color-schemes/")); } -#ifdef Q_WS_MAC - d.setPath(QCoreApplication::applicationDirPath() + "/../Resources/color-schemes/"); + d.setPath(QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/color-schemes/")); if (d.exists()) { if (!rval.isEmpty()) rval.clear(); - rval << (QCoreApplication::applicationDirPath() + "/../Resources/color-schemes/"); + rval << (QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/color-schemes/")); } #endif - for (const QString& custom_dir : const_cast(custom_color_schemes_dirs)) + + for (const QString& custom_dir : qAsConst(custom_color_schemes_dirs)) { d.setPath(custom_dir); if (d.exists()) diff --git a/lib/tools.h b/lib/tools.h index 455037e..239689b 100644 --- a/lib/tools.h +++ b/lib/tools.h @@ -3,9 +3,12 @@ #include #include +#include QString get_kb_layout_dir(); void add_custom_color_scheme_dir(const QString& custom_dir); const QStringList get_color_schemes_dirs(); +Q_DECLARE_LOGGING_CATEGORY(qtermwidgetLogger) + #endif diff --git a/lib/translations/CMakeLists.txt b/lib/translations/CMakeLists.txt index ce40923..84bb691 100644 --- a/lib/translations/CMakeLists.txt +++ b/lib/translations/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) - project(qtermwidget) build_component("." "${CMAKE_INSTALL_FULL_DATADIR}/qtermwidget/translations") diff --git a/lib/translations/qtermwidget.ts b/lib/translations/qtermwidget.ts index c099dcb..51a6366 100644 --- a/lib/translations/qtermwidget.ts +++ b/lib/translations/qtermwidget.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + Konsole::TerminalDisplay - + Size: XXX x XXX - + Size: %1 x %2 - + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + + QMessageBox + + + Show Details... + + + QObject @@ -41,22 +82,22 @@ - + Open Link - + Copy Link Address - + Send Email To... - + Copy Email Address @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error - + Cannot load color scheme: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case - + Regular expression - + Highlight all matches diff --git a/lib/translations/qtermwidget_arn.ts b/lib/translations/qtermwidget_arn.ts new file mode 100644 index 0000000..bd6929e --- /dev/null +++ b/lib/translations/qtermwidget_arn.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + + + + + Size: %1 x %2 + + + + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + + + + + QMessageBox + + + Show Details... + + + + + QObject + + + + Un-named Color Scheme + + + + + Accessible Color Scheme + + + + + Open Link + + + + + Copy Link Address + + + + + Send Email To... + + + + + Copy Email Address + + + + + QTermWidget + + + Color Scheme Error + + + + + Cannot load color scheme: %1 + + + + + SearchBar + + + Match case + + + + + Regular expression + + + + + Highlight all matches + + + + + SearchBar + + + + + X + + + + + Find: + + + + + < + + + + + > + + + + + ... + + + + diff --git a/lib/translations/qtermwidget_ast.ts b/lib/translations/qtermwidget_ast.ts new file mode 100644 index 0000000..65b4a9e --- /dev/null +++ b/lib/translations/qtermwidget_ast.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + + + + + Size: %1 x %2 + + + + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + + + + + QMessageBox + + + Show Details... + + + + + QObject + + + + Un-named Color Scheme + + + + + Accessible Color Scheme + + + + + Open Link + + + + + Copy Link Address + + + + + Send Email To... + + + + + Copy Email Address + + + + + QTermWidget + + + Color Scheme Error + + + + + Cannot load color scheme: %1 + + + + + SearchBar + + + Match case + + + + + Regular expression + + + + + Highlight all matches + + + + + SearchBar + + + + + X + + + + + Find: + + + + + < + + + + + > + + + + + ... + + + + diff --git a/lib/translations/qtermwidget_bg.ts b/lib/translations/qtermwidget_bg.ts new file mode 100644 index 0000000..d0ed7c1 --- /dev/null +++ b/lib/translations/qtermwidget_bg.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Звънец в сесия '%1' + + + + Session '%1' exited with status %2. + Сесия '%1' завърши със статус %2. + + + + Session '%1' crashed. + Сесия '%1' се срина. + + + + Session '%1' exited unexpectedly. + Сесия '%1' завърши неочаквано. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Размер: XXX x XXX + + + + Size: %1 x %2 + Размер: %1 x %2 + + + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>Предаването на данни <a href="http://en.wikipedia.org/wiki/Flow_control">прекъсна</a> при натискане на Ctrl+S. Натиснете <b>Ctrl+Q</b> за възстановяване.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Няма наличен транслатор за клавиатура. Липсва информацията, необходима за преобразуване на клавишите в символи за изпращане до терминала. + + + + QMessageBox + + + Show Details... + + + + + QObject + + + + Un-named Color Scheme + Цветна схема без име + + + + Accessible Color Scheme + Достъпна цветна схема + + + + Open Link + Отваряне на Връзка + + + + Copy Link Address + Копиране адреса на връзката + + + + Send Email To... + Изпращане E-Mail на... + + + + Copy Email Address + Копиране E-Mail адреса + + + + QTermWidget + + + Color Scheme Error + Грешка в цветовата схема + + + + Cannot load color scheme: %1 + Цветна схема %1 не може да се зареди + + + + SearchBar + + + Match case + Зачитане на регистъра + + + + Regular expression + Регулярен израз + + + + Highlight all matches + Маркиране всички съвпадения + + + + SearchBar + Лента за търсене + + + + X + X + + + + Find: + Търсене: + + + + < + < + + + + > + > + + + + ... + ... + + + diff --git a/lib/translations/qtermwidget_ca.ts b/lib/translations/qtermwidget_ca.ts index 573719b..30d12e4 100644 --- a/lib/translations/qtermwidget_ca.ts +++ b/lib/translations/qtermwidget_ca.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + Konsole::TerminalDisplay - + Size: XXX x XXX Mida: XXX x XXX - + Size: %1 x %2 Mida: %1 x %2 - + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> <qt>La sortida ha estat <a href="http://en.wikipedia.org/wiki/Flow_control">suspesa</a> en prémer Ctrl+S. Premeu <b>Ctrl+Q</b> per reprendre-la.</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. No hi ha disponible cap traductor de teclat. No es disposa de la informació necessària per convertir la pressió de les tecles a caràcters al terminal. + + QMessageBox + + + Show Details... + + + QObject @@ -41,22 +82,22 @@ Esquema de color accessible - + Open Link Obre l'enllaç - + Copy Link Address Copia l'adreça de l'enllaç - + Send Email To... Envia un correu electrònic a... - + Copy Email Address Copia l'adreça de correu electrònic @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error Error de l'esquema de color - + Cannot load color scheme: %1 No es pot carregar l'esquema de color: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case Coincidència - + Regular expression Expressió regular - + Highlight all matches Ressalta totes les coincidències diff --git a/lib/translations/qtermwidget_cs.ts b/lib/translations/qtermwidget_cs.ts index d420ba4..d2978e9 100644 --- a/lib/translations/qtermwidget_cs.ts +++ b/lib/translations/qtermwidget_cs.ts @@ -1,30 +1,71 @@ + + Konsole::Session + + + Bell in session '%1' + Zvonek v sezení '%1' + + + + Session '%1' exited with status %2. + Sezení '%1' ukončeno se stavem %2. + + + + Session '%1' crashed. + Sezení '%1' spadlo. + + + + Session '%1' exited unexpectedly. + Sezení '%1' neočekávaně ukončeno. + + Konsole::TerminalDisplay - + Size: XXX x XXX Velikost: XXX x XXX - + Size: %1 x %2 Velikost: %1 x %2 - + + Paste multiline text + Vložit víceřádkový text + + + + Are you sure you want to paste this text? + Opravdu chcete vložit tento text? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>Výstup byl <a href="http://en.wikipedia.org/wiki/Flow_control">pozastaven</a> stisknutím Ctrl+S. Znovu ho spustíte stisknutím <b>Ctrl+Q</b>.</qt> + <qt>Výstup byl <a href="http://en.wikipedia.org/wiki/Flow_control">pozastaven</a> stisknutím Ctrl+S. Znovu ho spustíte stisknutím <b>Ctrl+Q</b>.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. - Není k dispozici žádný překladač klávesnice. Chybí informace pro převod kódů stisknutých kláves na znaky posílané na terminál. + Není k dispozici žádný překladač klávesnice. Chybí tak informace pro převod kódů stisknutých kláves na znaky posílané na terminál. + + + + QMessageBox + + + Show Details... + Zobrazit podrobnosti... @@ -38,25 +79,25 @@ Accessible Color Scheme - Barevné schéma pro zrakově hendikepované uživatele + Barevné schéma pro uživatele se zrakovou vadou - + Open Link Otevřít odkaz - + Copy Link Address Zkopírovat adresu odkazu - + Send Email To... Poslat e-mail na… - + Copy Email Address Zkopírovat e-mailovou adresu @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error Chyba barevného schématu - + Cannot load color scheme: %1 Nedaří se načíst barevné schéma: %1 @@ -77,24 +118,24 @@ SearchBar - + Match case Rozlišovat malá/VELKÁ písmena - + Regular expression Regulární výraz - + Highlight all matches Zvýraznit všechny shody SearchBar - Pruh hledání + Lišta hledání diff --git a/lib/translations/qtermwidget_cy.ts b/lib/translations/qtermwidget_cy.ts index 1562523..05f0b9e 100644 --- a/lib/translations/qtermwidget_cy.ts +++ b/lib/translations/qtermwidget_cy.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + Konsole::TerminalDisplay - + Size: XXX x XXX - + Size: %1 x %2 - + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + + QMessageBox + + + Show Details... + + + QObject @@ -41,22 +82,22 @@ - + Open Link - + Copy Link Address - + Send Email To... - + Copy Email Address @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error - + Cannot load color scheme: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case - + Regular expression - + Highlight all matches diff --git a/lib/translations/qtermwidget_da.ts b/lib/translations/qtermwidget_da.ts index aa1736f..e425e0d 100644 --- a/lib/translations/qtermwidget_da.ts +++ b/lib/translations/qtermwidget_da.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + Bell i session '%1' + + + + Session '%1' exited with status %2. + Session '%1' afsluttede med status %2. + + + + Session '%1' crashed. + Session '%1' holdt op med at virke. + + + + Session '%1' exited unexpectedly. + Session '%1' afsluttede uventet. + + Konsole::TerminalDisplay - + Size: XXX x XXX Størrelse: XXX x XXX - + Size: %1 x %2 Størrelse: %1 x %2 - + + Paste multiline text + Indsæt multilinjetekst + + + + Are you sure you want to paste this text? + Er du sikker på, at du vil indsætte teksten? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> <qt>Output er blevet <a href="http://en.wikipedia.org/wiki/Flow_control">suspenderet</a> ved tryk på Ctrl+S. Tryk på <b>Ctrl+Q</b> for at genoptage.</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. Ingen tastaturoversætter tilgængelig. Informationen, som er nødvendig for at konvertere tastetryk til tegn, som sendes til terminalen, mangler. + + QMessageBox + + + Show Details... + Vis detaljer ... + + QObject @@ -41,22 +82,22 @@ Tilgængeligt farveskema - + Open Link Åbn link - + Copy Link Address Kopiér linkadresse - + Send Email To... Send e-mail til... - + Copy Email Address Kopiér e-mailadresse @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error Fejl ved farveskema - + Cannot load color scheme: %1 Kan ikke indlæse farveskema: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case Der skelnes mellem store og små bogstaver - + Regular expression Regulært udtryk - + Highlight all matches Fremhæv alle match diff --git a/lib/translations/qtermwidget_de.ts b/lib/translations/qtermwidget_de.ts index c78f39c..daf13e0 100644 --- a/lib/translations/qtermwidget_de.ts +++ b/lib/translations/qtermwidget_de.ts @@ -1,30 +1,71 @@ + + Konsole::Session + + + Bell in session '%1' + Glocke in Sitzung '%1' + + + + Session '%1' exited with status %2. + SItzung '%1' wurde mit Status %2 beendet. + + + + Session '%1' crashed. + SItzung '%1' ist abgestürzt. + + + + Session '%1' exited unexpectedly. + Sitzung '%1' wurde unerwartet beendet. + + Konsole::TerminalDisplay - + Size: XXX x XXX Größe: XXX x XXX - + Size: %1 x %2 Größe: %1 x %2 - + + Paste multiline text + mehrzeiligen Text einfügen + + + + Are you sure you want to paste this text? + Sie wollen diesen Text einfügen? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>Ausgabe wurde <a href="http://en.wikipedia.org/wiki/Flow_control">ausgesetzt</a> beim Drücken von Strg+S. Drücke <b>Strg+Q</b> um fortzufahren.</qt> + <qt>Druch drücken von Strg+S wurde die Ausgabe <a href="http://en.wikipedia.org/wiki/Flow_control">unterbrochen</a>. <b>Strg+Q</b> drücken um fortzufahren.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. - Kein Tastaturinterpretierer verfügbar. Die benötigte Information, um Tastenbefehle in Zeichen umzuwandeln und anschließenfd zum Terminal zu schicken, fehlt. + Kein Tastaturinterpreter verfügbar. Die benötigte Information, um Tastenbefehle in Zeichen umzuwandeln und anschließenfd zum Terminal zu senden, fehlt. + + + + QMessageBox + + + Show Details... + Details... @@ -41,35 +82,35 @@ Zugängliches Farbschema - + Open Link - Öffne Link + Link öffnen - + Copy Link Address - Kopiere Verknüpfungsadresse + Link-Adresse kopieren - + Send Email To... - Sende Email an... + E-Mail senden an... - + Copy Email Address - Kopiere Emailadresse + E-Mail-Adresse kopieren QTermWidget - + Color Scheme Error - Farbschemafehler + Fehler im Farbschema - + Cannot load color scheme: %1 Kann Farbschema nicht laden: %1 @@ -77,19 +118,19 @@ SearchBar - + Match case - Groß- / Kleinschreibung berücksichtigen + Groß-/Kleinschreibung beachten - + Regular expression Regulärer Ausdruck - + Highlight all matches - Markiere alle Treffer + Alle Treffer hervorheben diff --git a/lib/translations/qtermwidget_el.ts b/lib/translations/qtermwidget_el.ts index 756a0cd..34dddeb 100644 --- a/lib/translations/qtermwidget_el.ts +++ b/lib/translations/qtermwidget_el.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + Κουδούνι στην συνεδρία '%1' + + + + Session '%1' exited with status %2. + Η συνεδρία '%1' τερματίστηκε με την κατάσταση %2. + + + + Session '%1' crashed. + Η συνεδρία '%1' κατέρρευσε. + + + + Session '%1' exited unexpectedly. + Η συνεδρία '%1' τερματίστηκε απροσδόκητα. + + Konsole::TerminalDisplay - + Size: XXX x XXX Μέγεθος: XXX x XXX - + Size: %1 x %2 Μέγεθος: %1 x %2 - + + Paste multiline text + Επικόλληση κειμένου πολλαπλών γραμμών + + + + Are you sure you want to paste this text? + Επιθυμείτε σίγουρα την επικόλληση του κειμένου; + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> <qt>Η έξοδος έχει <a href="http://en.wikipedia.org/wiki/Flow_control">ανασταλεί</a> με τον συνδυασμό πλήκτρων Ctrl+S. Πιέστε <b>Ctrl+Q</b> για επαναφορά.</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. Δεν υπάρχει κάποιος μεταφραστής πληκτρολογίου διαθέσιμος. Η απαιτούμενη πληροφορία για την μετατροπή των πατημάτων πλήκτρων σε χαρακτήρες στο τερματικό λείπει. + + QMessageBox + + + Show Details... + Εμφάνιση λεπτομερειών... + + QObject @@ -41,22 +82,22 @@ Προσπελάσιμος χρωματικός σχηματισμός - + Open Link Άνοιγμα του δεσμού - + Copy Link Address Αντιγραφή διεύθυνσης του δεσμού - + Send Email To... Αποστολή ηλ. αλληλογραφίας προς... - + Copy Email Address Αντιγραφή της ηλ. διεύθυνσης @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error Σφάλμα του χρωματικού συνδυασμού - + Cannot load color scheme: %1 Αδύνατη η φόρτωση του χρωματικού συνδυασμού: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case Ταίριασμα πεζών/κεφαλαίων - + Regular expression Κανονική έκφραση - + Highlight all matches Τονισμός όλων των ταιριαστών diff --git a/lib/translations/qtermwidget_es.ts b/lib/translations/qtermwidget_es.ts index 0777122..133bc37 100644 --- a/lib/translations/qtermwidget_es.ts +++ b/lib/translations/qtermwidget_es.ts @@ -1,62 +1,103 @@ + + Konsole::Session + + + Bell in session '%1' + Campana en sesión «%1» + + + + Session '%1' exited with status %2. + La sesión «%1» ha terminado con el estado %2. + + + + Session '%1' crashed. + Cesó el funcionamiento de la sesión «%1». + + + + Session '%1' exited unexpectedly. + La sesión «%1» ha terminado inesperadamente. + + Konsole::TerminalDisplay - + Size: XXX x XXX - Tamaño: XXX x XXX + Tamaño: XXX × XXX - + Size: %1 x %2 - Tamaño: %1 x %2 + Tamaño: %1 × %2 - + + Paste multiline text + Pegar texto multirrenglón + + + + Are you sure you want to paste this text? + ¿Confirma que quiere pegar este texto? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>La salida ha sido <a href="http://en.wikipedia.org/wiki/Flow_control">suspendida</a> al pulsar Ctrl+S. Pulse <b>Ctrl+Q</b> para reanudarla.</qt> + <qt>La salida se ha <a href="http://en.wikipedia.org/wiki/Flow_control">suspendido</a> al presionar Ctrl+S. Presione <b>Ctrl+Q</b> para reanudarla.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. No hay traductor de teclado disponible. La información necesaria para convertir pulsaciones de tecla en caracteres para enviarlos a la terminal está ausente. + + QMessageBox + + + Show Details... + Mostrar detalles… + + QObject Un-named Color Scheme - Esquema de color sin nombre + Combinación de colores sin nombre Accessible Color Scheme - Esquema de color accesible + Combinación de colores accesible - + Open Link Abrir el enlace - + Copy Link Address Copiar la dirección del enlace - + Send Email To... Enviar correo a... - + Copy Email Address Copiar la dirección de correo @@ -64,30 +105,30 @@ QTermWidget - + Color Scheme Error - Error del esquema de color + Error de la combinación de colores - + Cannot load color scheme: %1 - No se puede cargar el esquema de color: %1 + No se puede cargar la combinación de colores: %1 SearchBar - + Match case - Distinguir mayúsculas de minúsculas + Distinguir mayúsculas y minúsculas - + Regular expression Expresión regular - + Highlight all matches Resaltar todas las coincidencias diff --git a/lib/translations/qtermwidget_et.ts b/lib/translations/qtermwidget_et.ts new file mode 100644 index 0000000..e905351 --- /dev/null +++ b/lib/translations/qtermwidget_et.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Signaal sessioonis „%1“ + + + + Session '%1' exited with status %2. + Sessioon „%1“ lõpetas töö olekuga %2. + + + + Session '%1' crashed. + Sessioon „%1“ jooksis kokku. + + + + Session '%1' exited unexpectedly. + Sessioon „%1“ lõpetas ootamatult töö. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Suurus: XXX x XXX + + + + Size: %1 x %2 + Suurus: %1 x %2 + + + + Paste multiline text + Aseta mitmerealine tekst + + + + Are you sure you want to paste this text? + Kas sa oled kindel, et soovid asetada seda teksti? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>Vajutades Ctrl+S jääb väljundi kuvamine <a href="http://en.wikipedia.org/wiki/Flow_control">pausile</a>. Jätkamiseks vajuta <b>Ctrl+Q</b>.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Klaviatuurisisendi tõlgendaja pole saadaval. Hetkel ei leidu teavet kuidas muuta klahvivajutused terminali saadetavateks tähemärkideks. + + + + QMessageBox + + + Show Details... + Näita üksikasju... + + + + QObject + + + + Un-named Color Scheme + Nimeta värvikombinatsioon + + + + Accessible Color Scheme + Hõlpsalt kasutatav värvikombinatsioon + + + + Open Link + Ava link + + + + Copy Link Address + Kopeeri lingi aadress + + + + Send Email To... + Saada e-kiri aadressile... + + + + Copy Email Address + Kopeeri e-posti aadress + + + + QTermWidget + + + Color Scheme Error + Värvikombinatsiooni viga + + + + Cannot load color scheme: %1 + Värvikombinatsiooni laadimine ei õnnestu: %1 + + + + SearchBar + + + Match case + Tõstutundlik + + + + Regular expression + Regulaaravaldis + + + + Highlight all matches + Tõsta kõik vasted esile + + + + SearchBar + Otsinguriba + + + + X + X + + + + Find: + Otsi: + + + + < + < + + + + > + > + + + + ... + ... + + + diff --git a/lib/translations/qtermwidget_fr.ts b/lib/translations/qtermwidget_fr.ts index e69c667..aee5376 100644 --- a/lib/translations/qtermwidget_fr.ts +++ b/lib/translations/qtermwidget_fr.ts @@ -1,30 +1,71 @@ + + Konsole::Session + + + Bell in session '%1' + Sonnerie dans la session '%1' + + + + Session '%1' exited with status %2. + La session '%1' s'est terminée avec le statut %2. + + + + Session '%1' crashed. + La session '%1' a planté. + + + + Session '%1' exited unexpectedly. + La session '%1' s'est fermée de manière inattendue. + + Konsole::TerminalDisplay - + Size: XXX x XXX Taille : XXX x XXX - + Size: %1 x %2 Taille : %1 x %2 - + + Paste multiline text + Coller des textes multiligne + + + + Are you sure you want to paste this text? + Êtes vous sûr de vouloir coller ce texte ? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>La sortie a été <a href="http://en.wikipedia.org/wiki/Flow_control">suspendue</a> en pressant Ctrl+S. Pressez <b>Ctrl+Q</b> pour reprendre.</qt> + <qt>La sortie a été <a href="http://en.wikipedia.org/wiki/Flow_control">suspendue</a> en pressant Ctrl+S. Presser <b>Ctrl+Q</b> pour reprendre.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. - Aucun traducteur disponible. L'information nécessaire à la conversion des touches pressées en caractères à envoyer au terminal est absente. + Aucun traducteur de clavier disponible. Les informations nécessaires pour convertir les touches utilisées en caractères à envoyer au terminal sont manquantes. + + + + QMessageBox + + + Show Details... + Voir les détails... @@ -33,30 +74,30 @@ Un-named Color Scheme - Schéma des couleurs non nommé + Jeu de couleurs non nommé Accessible Color Scheme - Schéma des couleur accessible + Schéma de couleur accessible - + Open Link Ouvrir le lien - + Copy Link Address Copier l'adresse du lien - + Send Email To... - Envoyer un courriel à ... + Envoyer un courriel à... - + Copy Email Address Copier l'adresse du courriel @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error Erreur du schéma des couleurs - + Cannot load color scheme: %1 Impossible de charger le schéma de couleurs : %1 @@ -107,17 +148,17 @@ ... - + Match case Sensible à la casse - + Regular expression Expression régulière - + Highlight all matches Surbrillance de toutes les concordances diff --git a/lib/translations/qtermwidget_gl.ts b/lib/translations/qtermwidget_gl.ts new file mode 100644 index 0000000..28b51fd --- /dev/null +++ b/lib/translations/qtermwidget_gl.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Tamaño: XXX x XXX + + + + Size: %1 x %2 + Tamaño: %1 x %2 + + + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>A saída foi <a href="http://en.wikipedia.org/wiki/Flow_control">suspendida</a> ao premer Ctrl+S. Prema <b>Ctrl+Q</b> para continuar.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Non hai dispoñíbel ningún tradutor de teclado. Non está dispoñíbel a información necesaria para converter pulsacións de tecla en caracteres para envialos o terminal. + + + + QMessageBox + + + Show Details... + + + + + QObject + + + + Un-named Color Scheme + Esquema de cor sen nome + + + + Accessible Color Scheme + Esquema de cor accesíbel + + + + Open Link + Abrir a ligazón + + + + Copy Link Address + Copiar o enderezo da ligazón + + + + Send Email To... + Enviar correo a... + + + + Copy Email Address + Copiar o enderezo de correo + + + + QTermWidget + + + Color Scheme Error + Produciuse un erro no esquema de cor + + + + Cannot load color scheme: %1 + Non é posíbel cargar o esquema de cor: %1 + + + + SearchBar + + + Match case + Distinguir maiúsculas de minúsculas + + + + Regular expression + Expresión regular + + + + Highlight all matches + Resaltar todas as coincidencias + + + + SearchBar + Barra de buscas + + + + X + + + + + Find: + Atopar: + + + + < + + + + + > + + + + + ... + + + + diff --git a/lib/translations/qtermwidget_he.ts b/lib/translations/qtermwidget_he.ts index 87d5406..d10bd54 100644 --- a/lib/translations/qtermwidget_he.ts +++ b/lib/translations/qtermwidget_he.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + צלצול בהפעלה ‚%1’ + + + + Session '%1' exited with status %2. + ההפעלה ‚%1’ נסגרה עם הכרזת המצב %2. + + + + Session '%1' crashed. + ההפעלה ‚%1’ קרסה. + + + + Session '%1' exited unexpectedly. + ההפעלה ‚%1’ נסגרה במפתיע. + + Konsole::TerminalDisplay - + Size: XXX x XXX גודל: XXX × XXX - + Size: %1 x %2 גודל: %1 × %2 - + + Paste multiline text + הדבקת מקבץ שורות + + + + Are you sure you want to paste this text? + להדביק את הטקסט הזה? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> <qt>הפלט <a href="http://en.wikipedia.org/wiki/Flow_control">הושהה</a> בלחיצה על Ctrl+S. יש ללחוץ על <b>Ctrl+Q</b> כדי להמשיך.</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. אין מתרגם מקלדת זמין. המידע שנדרש לצורך המרת לחיצות מקשים לתווים לשליחה למסוף חסר. + + QMessageBox + + + Show Details... + להציג פרטים… + + QObject @@ -41,22 +82,22 @@ ערכת צבעים נגישה - + Open Link פתיחת קישור - + Copy Link Address העתקת כתובת קישור - + Send Email To... שליחת דוא״ל אל… - + Copy Email Address העתקת כתובת דוא״ל @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error שגיאת ערכת צבעים - + Cannot load color scheme: %1 לא ניתן לטעון ערכת צבעים: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case התאמת רישיות - + Regular expression ביטוי רגולרי - + Highlight all matches הדגשת כל המופעים diff --git a/lib/translations/qtermwidget_hr.ts b/lib/translations/qtermwidget_hr.ts new file mode 100644 index 0000000..db56101 --- /dev/null +++ b/lib/translations/qtermwidget_hr.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Zvono u sesiji „%1“ + + + + Session '%1' exited with status %2. + Sesija „%1“ je prekinuta sa stanjem %2. + + + + Session '%1' crashed. + Fatalna greška u sesiji „%1“. + + + + Session '%1' exited unexpectedly. + Sesija „%1“ je nenadano prekinuta. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Veličina: XXX × XXX + + + + Size: %1 x %2 + Veličina: %1 × %2 + + + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>Rezultat je <a href="http://en.wikipedia.org/wiki/Flow_control">obustavljen</a> pritiskom Ctrl+S. Pritisni <b>Ctrl+Q</b> za nastavak.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Nema interpretera tipkovnice. Nedostaju podaci za pretvaranje tipki u znakove koji se šalju u terminal. + + + + QMessageBox + + + Show Details... + + + + + QObject + + + + Un-named Color Scheme + Neimenovana shema boja + + + + Accessible Color Scheme + Dostupna shema boja + + + + Open Link + Otvori poveznicu + + + + Copy Link Address + Otvori adresu poveznice + + + + Send Email To... + Pošalji e-mail na … + + + + Copy Email Address + Kopiraj e-adresu + + + + QTermWidget + + + Color Scheme Error + Greška u shemi boja + + + + Cannot load color scheme: %1 + Nije moguće učitati shemu boja: %1 + + + + SearchBar + + + Match case + Razlikuj velika/mala slova + + + + Regular expression + Regularni izrazi + + + + Highlight all matches + Istakni sva poklapanja + + + + SearchBar + Traka pretrage + + + + X + X + + + + Find: + Traži: + + + + < + < + + + + > + > + + + + ... + + + + diff --git a/lib/translations/qtermwidget_hu.ts b/lib/translations/qtermwidget_hu.ts index cb706d9..27718cb 100644 --- a/lib/translations/qtermwidget_hu.ts +++ b/lib/translations/qtermwidget_hu.ts @@ -1,30 +1,71 @@ + + Konsole::Session + + + Bell in session '%1' + Jelzés a '%1' munkamenetben + + + + Session '%1' exited with status %2. + A(z) '%1' munkamenet %2 állapottal lépett ki. + + + + Session '%1' crashed. + A(z) '%1' munkamenet összeomlott. + + + + Session '%1' exited unexpectedly. + A '%1' munkamenet váratlanul kilépett. + + Konsole::TerminalDisplay - + Size: XXX x XXX Méret: XXX x XXX - + Size: %1 x %2 Méret: %1 x %2 - + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>A kimenet <a href="http://en.wikipedia.org/wiki/Flow_control">el van nyomva</a> a Ctrl+S megnyomásával. Nyomj <b>Ctrl+Q -t</b> a visszatéréshez.</qt> + <qt>A kimenet <a href="http://en.wikipedia.org/wiki/Flow_control">fel van függesztve</a> a Ctrl+S megnyomásával. Nyomjon <b>Ctrl+Q-t</b> a folytatáshoz.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. - Nincs billentyűzet átalakító. Hiányzik az információ, ami a billentyű lenyomásnak a terminálhoz küldendő karakterekké alakításához szükséges. + Nincs elérhető billentyűzet-átalakító. Hiányzik az információ, amely a billentyű lenyomások a terminálhoz küldendő karakterekké alakításához szükséges. + + + + QMessageBox + + + Show Details... + @@ -41,53 +82,53 @@ Elérhető színséma - + Open Link - Link megnyitás + Link megnyitása - + Copy Link Address - Link cím másolás + Link másolása - + Send Email To... - Email küldés ... + Email küldése ... - + Copy Email Address - Email cím másolás + Email cím másolása QTermWidget - + Color Scheme Error Színséma hiba - + Cannot load color scheme: %1 - A %1 színséma elérhetetlen + Nem sikerült betölteni a színsémát. %1 SearchBar - + Match case - Nagybetű érzékeny + Nagybetűérzékeny - + Regular expression - Szaabályos kifejezés + Reguláris kifejezés - + Highlight all matches Találatok kiemelése @@ -104,7 +145,7 @@ Find: - Keres: + Keresés: diff --git a/lib/translations/qtermwidget_it.ts b/lib/translations/qtermwidget_it.ts new file mode 100644 index 0000000..2f9f0ae --- /dev/null +++ b/lib/translations/qtermwidget_it.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Campanello in sessione '%1' + + + + Session '%1' exited with status %2. + Sessione '%1' terminata con stato %2. + + + + Session '%1' crashed. + Sessione '%1' terminata inaspettatamente. + + + + Session '%1' exited unexpectedly. + Sessione '%1' terminata inaspettatamente. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Dimensione: XXX x XXX + + + + Size: %1 x %2 + Dimensione: %1 x %2 + + + + Paste multiline text + Incolla testo multi-righe + + + + Are you sure you want to paste this text? + Si è sicuro di voler incollare questo testo? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>L'output è stato <a href="https://it.wikipedia.org/wiki/Controllo_di_flusso">sospeso</a> premendo Ctrl+S. Premi <b>Ctrl+Q</b> per riprendere.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Nessuno traduttore di tastiera disponibile. L'informazione necessaria per convertire tasti in caratteri da inviare al terminale è mancante. + + + + QMessageBox + + + Show Details... + Mostra dettagli... + + + + QObject + + + + Un-named Color Scheme + Schema Colore senza nome + + + + Accessible Color Scheme + Schema Colore Accessibile + + + + Open Link + Apri collegamento + + + + Copy Link Address + Copia indirizzo collegamento + + + + Send Email To... + Invia email a... + + + + Copy Email Address + Copia indirizzo email + + + + QTermWidget + + + Color Scheme Error + Errore su Schema Colori + + + + Cannot load color scheme: %1 + Caricamento schema colore %1 non riuscito + + + + SearchBar + + + Match case + Rispetta maiuscolo/minuscolo + + + + Regular expression + Espressione regolare + + + + Highlight all matches + Evidenzia tutte le corrispondenze + + + + SearchBar + Barra di ricerca + + + + X + X + + + + Find: + Trova: + + + + < + < + + + + > + > + + + + ... + ... + + + diff --git a/lib/translations/qtermwidget_ja.ts b/lib/translations/qtermwidget_ja.ts index aed78d2..21f57a0 100644 --- a/lib/translations/qtermwidget_ja.ts +++ b/lib/translations/qtermwidget_ja.ts @@ -1,30 +1,71 @@ + + Konsole::Session + + + Bell in session '%1' + セッション '%1' のベル + + + + Session '%1' exited with status %2. + セッション '%1' はステータス %2 で終了しました。 + + + + Session '%1' crashed. + セッション '%1' がクラッシュしました。 + + + + Session '%1' exited unexpectedly. + セッション '%1' が予期せず終了しました。 + + Konsole::TerminalDisplay - + Size: XXX x XXX - + サイズ: XXX x XXX - + Size: %1 x %2 - + サイズ: %1 x %2 - + + Paste multiline text + 複数行テキストの貼り付け + + + + Are you sure you want to paste this text? + このテキストを貼り付けますか? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - + <qt>Ctrl+S を押して出力を<a href="http://en.wikipedia.org/wiki/Flow_control">中断</a> しました 。再開するには <b>Ctrl+Q</b> を押します。</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. - + キーボードトランスレーターがありません。押されたキーを文字に変換してターミナルへ送信するために必要な情報がありません。 + + + + QMessageBox + + + Show Details... + 詳細の表示... @@ -33,30 +74,30 @@ Un-named Color Scheme - 名前のないカラースキーム + 名前のない配色 Accessible Color Scheme - アクセス可能なカラースキーム + アクセス可能な配色 - + Open Link リンクを開く - + Copy Link Address リンクのアドレスをコピー - + Send Email To... メールを送信... - + Copy Email Address メールアドレスをコピー @@ -64,32 +105,32 @@ QTermWidget - + Color Scheme Error - カラースキームのエラー + 配色のエラー - + Cannot load color scheme: %1 - カラースキームをロードすることができません: %1 + 配色をロードできません: %1 SearchBar - + Match case - + 大文字と小文字の区別 - + Regular expression 正規表現 - + Highlight all matches - 一致するものをハイライト + 一致する全ての文字列を強調表示 @@ -104,22 +145,22 @@ Find: - 探す: + 検索: < - + < > - + > ... - + ... diff --git a/lib/translations/qtermwidget_lt.ts b/lib/translations/qtermwidget_lt.ts index e6d0eeb..5bca2a1 100644 --- a/lib/translations/qtermwidget_lt.ts +++ b/lib/translations/qtermwidget_lt.ts @@ -1,32 +1,73 @@ + + Konsole::Session + + + Bell in session '%1' + Skambutis “%1„ seanse + + + + Session '%1' exited with status %2. + Seansas „%1“ išėjo su būsena %2. + + + + Session '%1' crashed. + Seansas „%1“ užstrigo. + + + + Session '%1' exited unexpectedly. + Seansas „%1“ netikėtai išėjo. + + Konsole::TerminalDisplay - + Size: XXX x XXX Dydis: XXX x XXX - + Size: %1 x %2 Dydis: %1 x %2 - + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>Išvestis buvo <a href="http://en.wikipedia.org/wiki/Flow_control">pristabdyta,</a> paspaudžiant Ctrl(Vald)+S. Paspauskite <b>Ctrl(Vald)+Q</b>, norėdami pratęsti.</qt> + <qt>Išvestis buvo <a href="http://en.wikipedia.org/wiki/Flow_control">pristabdyta,</a> paspaudžiant Ctrl+S. Paspauskite <b>Ctrl+Q</b>, norėdami pratęsti.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. Nėra prieinamas joks klaviatūros vertėjas. Informacijos, kurios reikia, norint konvertuoti klavišų paspaudimus į simbolius ir siųsti į terminalą, nėra. + + QMessageBox + + + Show Details... + + + QObject @@ -41,22 +82,22 @@ Pasiekiamas spalvų rinkinys - + Open Link Atverti nuorodą - + Copy Link Address Kopijuoti nuorodos adresą - + Send Email To... Siųsti el. paštą... - + Copy Email Address Kopijuoti el. pašto adresą @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error Spalvų rinkinio klaida - + Cannot load color scheme: %1 Nepavyksta įkelti spalvų rinkinio: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case Skirti raidžių dydį - + Regular expression Reguliarusis reiškinys - + Highlight all matches Paryškinti visus atitikmenis diff --git a/lib/translations/qtermwidget_nb_NO.ts b/lib/translations/qtermwidget_nb_NO.ts new file mode 100644 index 0000000..aa42d5e --- /dev/null +++ b/lib/translations/qtermwidget_nb_NO.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Klokke i økt «%1» + + + + Session '%1' exited with status %2. + Økt «%1» avsluttet med status %2. + + + + Session '%1' crashed. + Økt «%1» krasjet. + + + + Session '%1' exited unexpectedly. + Økt «%1» avsluttet uventet. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Størrelse: XXX x XXX + + + + Size: %1 x %2 + Størrelse: %1 x %2 + + + + Paste multiline text + Lim inn flerlinjerstekst + + + + Are you sure you want to paste this text? + Er du sikker på at du vil lime inn denne teksten? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>Utgangssignalet ble <a href="http://en.wikipedia.org/wiki/Flow_control">stoppet</a> da Ctrl+S ble trykket. Trykk <b>Ctrl+Q</b> for å fortsette.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Ingen tastaturoversetter er tilgjengelig. Nødvendig info for å gjøre om tastetrykk til tegn å sende terminalen mangler. + + + + QMessageBox + + + Show Details... + Vis detaljer … + + + + QObject + + + + Un-named Color Scheme + Fargemønster uten navn + + + + Accessible Color Scheme + Fargemønster for funksjonshemmede + + + + Open Link + Åpne lenke + + + + Copy Link Address + Kopier lenkeadresse + + + + Send Email To... + Send epost til... + + + + Copy Email Address + Kopier epostadressen + + + + QTermWidget + + + Color Scheme Error + Feil med fargemønster + + + + Cannot load color scheme: %1 + Kan ikke åpne fargemønster: %1 + + + + SearchBar + + + Match case + Bruk STORE og små bokstaver + + + + Regular expression + Bokstavmønstre (regex) + + + + Highlight all matches + Lys opp alle søkeresultat + + + + SearchBar + Søkelinje + + + + X + + + + + Find: + Finn: + + + + < + + + + + > + + + + + ... + + + + diff --git a/lib/translations/qtermwidget_nl.ts b/lib/translations/qtermwidget_nl.ts new file mode 100644 index 0000000..8dccc54 --- /dev/null +++ b/lib/translations/qtermwidget_nl.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Bel in sessie ‘%1’ + + + + Session '%1' exited with status %2. + Sessie ‘%1’ is afgesloten met status ‘%2’. + + + + Session '%1' crashed. + Sessie ‘%1’ is gecrasht. + + + + Session '%1' exited unexpectedly. + Sessie ‘%1’ is onverwachts afgebroken. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Grootte: XXX x XXX + + + + Size: %1 x %2 + Grootte: %1x%2 + + + + Paste multiline text + Meerregelige tekst plakken + + + + Are you sure you want to paste this text? + Weet u zeker dat u deze tekst wilt plakken? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>Door op Ctrl+S te drukken is de uitvoer <a href="http://en.wikipedia.org/wiki/Flow_control">onderbroken</a>. Druk op <b>Ctrl+Q</b> om te hervatten.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Er is geen toetsaanslagomzetting beschikbaar, waardoor toetsaanslagen niet kunnen worden omgezet in tekens. + + + + QMessageBox + + + Show Details... + Details tonen… + + + + QObject + + + + Un-named Color Scheme + Naamloos kleurenschema + + + + Accessible Color Scheme + Toegankelijk kleurenschema + + + + Open Link + Link openen + + + + Copy Link Address + Linkadres kopiëren + + + + Send Email To... + E-mail versturen naar… + + + + Copy Email Address + E-mailadres kopiëren + + + + QTermWidget + + + Color Scheme Error + Kleurenschemafout + + + + Cannot load color scheme: %1 + Het kleurenschema kan niet worden geladen: %1 + + + + SearchBar + + + Match case + Hoofdlettergevoelig + + + + Regular expression + Reguliere uitdrukking + + + + Highlight all matches + Alle overeenkomsten markeren + + + + SearchBar + Zoekbalk + + + + X + X + + + + Find: + Zoeken: + + + + < + < + + + + > + > + + + + ... + + + + diff --git a/lib/translations/qtermwidget_pl.ts b/lib/translations/qtermwidget_pl.ts index dc23dc3..24a570c 100644 --- a/lib/translations/qtermwidget_pl.ts +++ b/lib/translations/qtermwidget_pl.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + Konsole::TerminalDisplay - + Size: XXX x XXX Rozmiar: XXX x XXX - + Size: %1 x %2 Rozmiar: %1 x %2 - + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> <qt>Wyjście zostało <a href="http://en.wikipedia.org/wiki/Flow_control">wstrzymane</a> skrótem Ctrl+S. Wciśnij <b>Ctrl+Q</b> aby wznowić.</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. Brak sterownika klawiatury. Nie wiadomo jak przełożyć wciśniecia przycisków na znaki wysyłane do terminalu. + + QMessageBox + + + Show Details... + + + QObject @@ -41,22 +82,22 @@ Paleta o zwiększonej przystępności - + Open Link Przejdź pod adres - + Copy Link Address Kopiuj adres łącza - + Send Email To... Wyślij e-mail do… - + Copy Email Address Kopiuj adres e-mail @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error Błąd w palecie - + Cannot load color scheme: %1 Nie można wczytać palety: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case Rozróżniaj wielkość liter - + Regular expression Wyrażenie regularne - + Highlight all matches Podświetl wszystkie dopasowania diff --git a/lib/translations/qtermwidget_pt.ts b/lib/translations/qtermwidget_pt.ts index bf29a92..04383ec 100644 --- a/lib/translations/qtermwidget_pt.ts +++ b/lib/translations/qtermwidget_pt.ts @@ -1,30 +1,71 @@ + + Konsole::Session + + + Bell in session '%1' + Campainha na sessão '%1' + + + + Session '%1' exited with status %2. + A sessão '%1' terminou com o estado %2. + + + + Session '%1' crashed. + A sessão '%1' terminou. + + + + Session '%1' exited unexpectedly. + A sessão '%1' terminou inesperadamente. + + Konsole::TerminalDisplay - + Size: XXX x XXX Tamanho: XXX x XXX - + Size: %1 x %2 Tamanho: %1 x %2 - + + Paste multiline text + Colar texto com várias linhas + + + + Are you sure you want to paste this text? + Tem a certeza que deseja colar este texto? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>O resultado foi <a href="http://en.wikipedia.org/wiki/Flow_control">suspenso</a> através de Ctrl+S. Prima <b>Ctrl+Q</b> para continuar.</qt> + <qt>A saída foi <a href="http://en.wikipedia.org/wiki/Flow_control"> suspendida</a> com Ctrl+S. Prima <b>Ctrl+Q</b> para continuar.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. - Não há tradutores de teclado disponíveis. A informação necessária para converter os toques das teclas em caracteres enviados ao terminal não existem. + Não há um tradutor de teclado disponível. A informação necessária para converter a pressão da tecla nos caracteres a enviar ao terminal não existe. + + + + QMessageBox + + + Show Details... + Mostrar detalhes... @@ -41,22 +82,22 @@ Esquema de cores acessível - + Open Link Abrir ligação - + Copy Link Address Copiar endereço da ligação - + Send Email To... Enviar e-mail para... - + Copy Email Address Copiar endereço de e-mail @@ -64,30 +105,30 @@ QTermWidget - + Color Scheme Error Erro no esquema de cores - + Cannot load color scheme: %1 - Incapaz de carregar o esquema: %1 + Não foi possível carregar o esquema de cores: %1 SearchBar - + Match case Diferenciar maiúsculas/minúsculas - + Regular expression Expressão regular - + Highlight all matches Realçar todas as ocorrências diff --git a/lib/translations/qtermwidget_pt_BR.ts b/lib/translations/qtermwidget_pt_BR.ts new file mode 100644 index 0000000..2a78b56 --- /dev/null +++ b/lib/translations/qtermwidget_pt_BR.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Campainha na sessão '%1' + + + + Session '%1' exited with status %2. + A sessão '%1' encerrada com status %2. + + + + Session '%1' crashed. + A sessão '%1' travada. + + + + Session '%1' exited unexpectedly. + A sessão '%1' foi encerrada inesperadamente. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Tamanho: XXX x XXX + + + + Size: %1 x %2 + Tamanho: %1 x %2 + + + + Paste multiline text + Cole texto multilinha + + + + Are you sure you want to paste this text? + Tem certeza que deseja colar este texto? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>A saída foi <a href="http://en.wikipedia.org/wiki/Flow_control">suspensa</a> pressionando Ctrl+S. Pressione <b>Ctrl+Q</b> para continuar.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Nenhum tradutor de teclado disponível. A informação necessária para converter a tecla pressionada em caracteres para enviar para o terminal está faltando. + + + + QMessageBox + + + Show Details... + Mostrar Detalhes... + + + + QObject + + + + Un-named Color Scheme + Esquema de cor sem nome + + + + Accessible Color Scheme + Esquema de cor acessível + + + + Open Link + Abrir Link + + + + Copy Link Address + Copiar Endereço do Link + + + + Send Email To... + Enviar E-mail Para... + + + + Copy Email Address + Copiar Endereço de E-mail + + + + QTermWidget + + + Color Scheme Error + Erro no esquema de cor + + + + Cannot load color scheme: %1 + Não foi possível carregar o esquema de cor: %1 + + + + SearchBar + + + Match case + Caso de compatibilidade + + + + Regular expression + Expressão Regular + + + + Highlight all matches + Destacar todas as correspondências + + + + SearchBar + Barra de Pesquisa + + + + X + X + + + + Find: + Encontrar: + + + + < + < + + + + > + > + + + + ... + ... + + + diff --git a/lib/translations/qtermwidget_ru.ts b/lib/translations/qtermwidget_ru.ts new file mode 100644 index 0000000..b28eab8 --- /dev/null +++ b/lib/translations/qtermwidget_ru.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + Звуковой сигнал в сессии '%1' + + + + Session '%1' exited with status %2. + Сессия '%1' завершилась со статусом %2. + + + + Session '%1' crashed. + Сессия '%1' упала. + + + + Session '%1' exited unexpectedly. + Сессия ’%1’ завершилась неожиданно. + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + Размер: XXX x XXX + + + + Size: %1 x %2 + Размер: %1 x %2 + + + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + <qt>Вывод был <a href="https://ru.wikipedia.org/wiki/%D0%9A%D0%BE%D0%BD%D1%82%D1%80%D0%BE%D0%BB%D1%8C_%D0%BF%D0%BE%D1%82%D0%BE%D0%BA%D0%B0">приостановлен</a> нажатием Ctrl+S. Нажмите <b>Ctrl+Q</b> для продолжения.</qt> + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + Нет доступных трансляторов клавиатуры. Информация, необходимая, чтобы преобразовать нажатия клавиш в символы, которые будут отправлены на терминал, не найдена. + + + + QMessageBox + + + Show Details... + + + + + QObject + + + + Un-named Color Scheme + Безымянная цветовая схема + + + + Accessible Color Scheme + Упрощённая цветовая схема + + + + Open Link + Открыть ссылку + + + + Copy Link Address + Скопировать адрес ссылки + + + + Send Email To... + Отправить e-mail на... + + + + Copy Email Address + Скопировать e-mail адрес + + + + QTermWidget + + + Color Scheme Error + Ошибка цветовой схемы + + + + Cannot load color scheme: %1 + Не удалось загрузить цветовую схему: %1 + + + + SearchBar + + + Match case + С учётом регистра + + + + Regular expression + Регулярное выражение + + + + Highlight all matches + Подсвечивать все совпадения + + + + SearchBar + ПанельПоиска + + + + X + X + + + + Find: + Найти: + + + + < + < + + + + > + > + + + + ... + ... + + + diff --git a/lib/translations/qtermwidget_si.ts b/lib/translations/qtermwidget_si.ts new file mode 100644 index 0000000..9f43597 --- /dev/null +++ b/lib/translations/qtermwidget_si.ts @@ -0,0 +1,166 @@ + + + + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + + + Konsole::TerminalDisplay + + + Size: XXX x XXX + + + + + Size: %1 x %2 + + + + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> + + + + + Konsole::Vt102Emulation + + + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. + + + + + QMessageBox + + + Show Details... + + + + + QObject + + + + Un-named Color Scheme + + + + + Accessible Color Scheme + + + + + Open Link + + + + + Copy Link Address + + + + + Send Email To... + + + + + Copy Email Address + + + + + QTermWidget + + + Color Scheme Error + + + + + Cannot load color scheme: %1 + + + + + SearchBar + + + Match case + + + + + Regular expression + + + + + Highlight all matches + + + + + SearchBar + + + + + X + + + + + Find: + + + + + < + + + + + > + + + + + ... + + + + diff --git a/lib/translations/qtermwidget_tr.ts b/lib/translations/qtermwidget_tr.ts index be6546a..3e2ec67 100644 --- a/lib/translations/qtermwidget_tr.ts +++ b/lib/translations/qtermwidget_tr.ts @@ -1,30 +1,71 @@ + + Konsole::Session + + + Bell in session '%1' + '%1'. oturumda zil + + + + Session '%1' exited with status %2. + '%1' oturum %2 koduyla kapandı. + + + + Session '%1' crashed. + '%1' oturumu çöktü. + + + + Session '%1' exited unexpectedly. + '%1' oturumu beklenmedik şekilde kapandı. + + Konsole::TerminalDisplay - + Size: XXX x XXX Boyut: XXX x XXX - + Size: %1 x %2 Boyut: %1 x %2 - + + Paste multiline text + Çok satırlı metni yapıştır + + + + Are you sure you want to paste this text? + Bu metni yapıştırmak istediğinizden emin misiniz? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> - <qt>Çıktı <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> Ctrl+S basınız. <b>Ctrl+Q</b> bas devam etmek için.</qt> + <qt>Çıktı, Ctrl+S'ye basılarak <a href="http://en.wikipedia.org/wiki/Flow_control">durduruldu</a>. Sürdürmek için <b>Ctrl+Q</b>'a basınız.</qt> Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. - Hiçbir klavye çevirici yok. Tuş takımlarını terminale göndermek için karakterlere dönüştürmek için gereken bilgi eksik. + Hiçbir klavye çeviricisi yok. Tuş vuruşlarını karaktere dönüştürüp uçbirime göndermek için gereken bilgi eksik. + + + + QMessageBox + + + Show Details... + Detayları göster... @@ -33,7 +74,7 @@ Un-named Color Scheme - İsimsiz renk şeması + Adsız Renk Şeması @@ -41,85 +82,85 @@ Erişilebilir Renk Şeması - + Open Link Bağlantıyı Aç - + Copy Link Address - Bağlantı adresini kopyala + Bağlantı Adresini Kopyala - + Send Email To... - Eposta gönder... + E-posta Gönder... - + Copy Email Address - Eposta adresini kopyala + E-posta Adresini Kopyala QTermWidget - + Color Scheme Error - Renk Şema Hatası + Renk Şeması Hatası - + Cannot load color scheme: %1 - Renk şeması yüklenemedi + Renk şeması yüklenemedi: %1 SearchBar - + Match case - Tam eşleştir + Büyük/küçük harf eşleştir - + Regular expression Düzenli ifade - + Highlight all matches Tüm eşleşenleri vurgula SearchBar - + Arama Çubuğu X - + X Find: - + Bul: < - + < > - + > ... - + ... diff --git a/lib/translations/qtermwidget_zh_CN.ts b/lib/translations/qtermwidget_zh_CN.ts index acbd5b1..a2ddeb3 100644 --- a/lib/translations/qtermwidget_zh_CN.ts +++ b/lib/translations/qtermwidget_zh_CN.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + 在会话中响铃 '%1' + + + + Session '%1' exited with status %2. + 会话'%1' 以状态 %2 退出。 + + + + Session '%1' crashed. + 会话 '%1' 奔溃了。 + + + + Session '%1' exited unexpectedly. + 会话 '%1' 意外退出了。 + + Konsole::TerminalDisplay - + Size: XXX x XXX 大小: XXX x XXX - + Size: %1 x %2 大小: %1 x %2 - + + Paste multiline text + 粘帖多行文本 + + + + Are you sure you want to paste this text? + 确定你想要粘贴此文本? + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> <qt>输出已被 Ctrl+S <a href="http://en.wikipedia.org/wiki/Flow_control">暂停</a>。按 <b>Ctrl+Q</b> 复原。</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. 没有可用的键码转换表。找不到需要把按键转换至符号以传送至终端的信息。 + + QMessageBox + + + Show Details... + 显示详情... + + QObject @@ -41,22 +82,22 @@ 可用配色 - + Open Link 打开链接 - + Copy Link Address 复制链接地址 - + Send Email To... 发送邮件至... - + Copy Email Address 复制邮件地址 @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error 配色错误 - + Cannot load color scheme: %1 无法加载配色: %1 @@ -77,17 +118,17 @@ SearchBar - + Match case 匹配大小写 - + Regular expression 正则表达式 - + Highlight all matches 高亮所有匹配项 diff --git a/lib/translations/qtermwidget_zh_TW.ts b/lib/translations/qtermwidget_zh_TW.ts index 6750d13..231ee19 100644 --- a/lib/translations/qtermwidget_zh_TW.ts +++ b/lib/translations/qtermwidget_zh_TW.ts @@ -1,20 +1,53 @@ + + Konsole::Session + + + Bell in session '%1' + + + + + Session '%1' exited with status %2. + + + + + Session '%1' crashed. + + + + + Session '%1' exited unexpectedly. + + + Konsole::TerminalDisplay - + Size: XXX x XXX 大小:XXX x XXX - + Size: %1 x %2 大小:%1 x %2 - + + Paste multiline text + + + + + Are you sure you want to paste this text? + + + + <qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt> <qt>輸出已被Ctrl+S<a href="http://en.wikipedia.org/wiki/Flow_control">暫停</a>。按<b>Ctrl+Q</b>復原。</qt> @@ -22,11 +55,19 @@ Konsole::Vt102Emulation - + No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. 沒有可用的鍵碼轉換表。用來將按鍵轉換成終端機字元的資訊遺失。 + + QMessageBox + + + Show Details... + + + QObject @@ -41,22 +82,22 @@ 可用的配色 - + Open Link 開啟連結 - + Copy Link Address 複製網址 - + Send Email To... 傳送郵件給… - + Copy Email Address 複製信箱地址 @@ -64,12 +105,12 @@ QTermWidget - + Color Scheme Error 配色錯誤 - + Cannot load color scheme: %1 無法載入配色:%1 @@ -77,17 +118,17 @@ SearchBar - + Match case 符合大小寫 - + Regular expression 正規表示式 - + Highlight all matches 標亮所有相符的項目